text:
# Ansible Vault

Ansible Vault is a security mechanism to protect variables with sensitive information as usernames, password, IPs, etc. This lesson tries to emulate regular use cases around these objects.

In order to understand this lesson properly, a set of steps have been designed to be implemented in the following section.

**ENJOY !!!**

## Steps

-   Create an inventory file named "inventory" with a group named "myinstance" and your internal instance IP assigned included
-   Crate a vault variables file named "vault-vars.yml" in a new folder named "vars" with password "vault" and the following variables:
    -   String variable called "new_user_name" with a name "test01"
    -   String variable called "new_user_pass" with a password "test01"
-   Create a playbook named "vault-playbook.yml" using "myinstance" as a hosts parameter and ``<studentxx>`` as a user. The playbook should use tasks to ensure that the following conditions are met on the managed hosts:
    -   Generate a password hash in sha512 using "new_user_pass" and "123qweasdzxc" secret in a new variable named "new_hash_pass"
    -   Create a new user using "new_user_name" and "new_hash_pass" variables
-   Import "vault-vars.yml" file into the playbook
-   Before running your playbook, run the ansible-playbook --syntax-check  command to verify that its syntax is correct
-   Run the playbook!
-   Test the new user
-   Modify "vault-vars.yml" file to include a string variable named "new_user_secret" with the previous secret content "123qweasdzxc"
-   Modify "vault-playbook.yml" playbook in order to include "new_user_secret" variable instead of then plain text secret
-   Run the playbook!
-   Test the user again

## Useful Links

For more information, please visit:

-   https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#how-do-i-generate-encrypted-passwords-for-the-user-module
-   https://docs.ansible.com/ansible/latest/user_guide/playbooks.html
-   https://docs.ansible.com/ansible/latest/user_guide/vault.html
-   https://docs.ansible.com/ansible/latest/modules/modules_by_category.html

License
-------

BSD

Author Information
------------------

 Asier Cidon - Cloud Consultant

 asier.cidon@redhat.com

repository: autstudent/ansible-training

repo_name: autstudent/ansible-training


text:
# **Bamazon**

## *MySQL + Node.js Amazon-like Storefront*

**Bamazon** is a amazon-like storefront created with the help of mySQL and Node.js. The user can view the stock of inventory, select a purchase, and inquire stock quantity left. In the future a Manager view will be added to further manage current stock.

---

## Author & Contributor List

* [Albert Schumacher](github.com/ahs012)

---

## Quick-Start Guide

1. Initialize Server/MySQL
2. In GitBash, go to repository directory, and run connection to server (node.js script.js)
3. Input answers with #'s

**Bamazon in Action**

![alt text](https://raw.githubusercontent.com/ahs012/bamazon/master/bamazonInAction.gif)

---

## Technologies Used

* [Node.JS](https://nodejs.org/en/)
* [MySQL](https://www.mysql.com/) - Database

---

license: MIT

branch_name: refs/heads/master

extension: md

gha_language: JavaScript

gha_license_id: MIT

license_type: permissive


text:
# Tinder Clone in React.js
A simple Tinder clone application developed by Jerry S Joseph. This project demonstrates the method to create responsive UIs using Material UI.

## About
    This project is developed by Jerry S Joseph as a demostration of Material UI Components.

## Demo

Visit this link to see how it looks like,
https://jerrysjoseph.github.io/React_tinderClone/

License
-------

    Copyright 2014 - 2021 Jerin Sebastian

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.


text:
# Building a Namecoin #Fullnode

### You will need:
1. 16Gb Micro SD Card or Larger (preferably Class 10 or above with wear protection)
2. Raspian Jessie https://www.raspberrypi.org/downloads/raspbian / or your favourite distro

Write the Jessie .img file to the SD Card using your preferred method.

### Then boot for the first time and at the command line:
```
sudo raspi-config
```
Select:
* [1] Expand File System - Click OK
* [2] Change the *pi* users password to something secure
* [3] Boot Options - Set to preferred boot mode: command line or desktop as you wish.
* [4] Internationalisation Options - Set locale, timezone and keyboard as appropriate.
* [5] Overclock - Set to Pi 2 1000Mhz
* [6] Advanced Options - Change hostname to something appropriate e.g. "nmcpi" (without quotes)
* [7] Advanced Options - Memory Split - We suggest *16* for headless/server or *128* for gui/desktop.
* [8] Advanced Options - Ensure SSH is enabled.

#### Reboot either via the config or manually like so:
```
sudo reboot
```
#### Installing Updates

Now the Raspeberry Pi is fully configured we need to ensure it is upto date, again in the command line:
```
sudo apt-get update
```
```
sudo apt-get upgrade -y
```
The -y flag tells the OS to answer "yes" to any prompts warning you of extra disk space required, we use this for convenience but it is not essential.
```
sudo reboot
```

#### Install the dependencies for Namecoin
```
sudo apt-get install build-essential autoconf libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils libboost-all-dev libminiupnpc-dev -y

```

#### Install the dependencies for the Graphical User Interface (GUI) QT Wallet
```
sudo apt-get install libqt4-dev qt4-dev-tools libprotobuf-dev protobuf-compiler libqrencode-dev -y
```

#### Create a folder where we will work with installation the files
```
mkdir ~/bin
```
```
cd ~/bin
```

#### Download, Unpack, Configure and Install the Berkeley DB 4.8
```
wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
```
```
tar -xzvf db-4.8.30.NC.tar.gz
```
```
cd db-4.8.30.NC/build_unix/
```
```
../dist/configure --enable-cxx
```
##### the -j4 flag uses all four cores on the Raspberry Pi for maximum speed.
```
make -j4
```
```
sudo make install
```

#### Installing Namecoin-core
```
cd ~/bin
```
```
git clone https://github.com/namecoin/namecoin-core.git
```
```
cd namecoin-core/
```
```
./autogen.sh
```
```
./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib" --with-gui=qt4
```
##### For this make operation we only use 2 of the cores to prevent errors
```
make -j2
```
```
sudo make install
```
Delete the ~/bin folder and all subfolders after the compiling and installing.  Assuming we are still in the ```namecoin-core``` folder
```
cd ..
cd ..
sudo rm -R ~/bin
```
Now that Namecoin is installed create a .namecoin folder inside of your home directory so we can ensure that when run it is configured as we would like it to be, with a full index of transactions and name history:
```
mkdir /home/pi/.namecoin/
```
```
cd /home/pi/.namecoin
```
Open a blank text editor.
```
nano namecoin.conf
```
Enter the following text as a minimum:
```
listen=1
server=1
daemon=1
txindex=1
namehistory=1
testnet=0
dbcache=50
rpcuser=namecoinrpcuser
rpcpassword=changme_and_make_me_secure
rpcallowip=<IP_ADDRESS>
rpcport=8335
```
Press ```ctrl+X``` followed by ```Y``` then ```Enter``` to save changes and return back to the command line.

#### Starting Namecoin

To start namecoin use either ```namecoind &``` or from within a terminal from the desktop (for the GUI) ```namecoin-qt &``` as appropriate.

If you would like namecoind to start automatically at boot update your startup configuration as follows:
```
sudo nano /etc/rc.local
```
and then above the last line ```exit 0 ``` place the following line:
```
su pi -c 'namecoind &'
```

#### Reboot the system
```
sudo reboot
```
##### Expect to wait a while for the namecoin blockchain to fully sync.
The namecoin blockchain when fully indexded and with a full name history is around 4Gb, it took a little under 48 hours to fully sync.

### And that's all there is to it.

You now have your Namecoin #Fullnode but keep reading as we have some additional tricks and tweaks below

To view the status of your node use the following command
```
namecoin-cli getblockchaininfo
```

### Additional Applications

We are going to install some other apps that are useful now that we have access to the Namecoin blockchain. Firstly we need a few Python related files and then we can install *NMControl* and *Bitmessage*

```
sudo apt-get install python-qt4
```
```
sudo apt-get install python-pip
```
```
sudo pip install bottle
```

#### NMControl - gives you easy access to the .bit domain name system
```
git clone https://github.com/namecoin/nmcontrol/
```
Then we must make a configuration file as follows:
```
cd nmcontrol
```
```
cd conf
```
Open a blank text editor.
```
nano service-dns.conf
```
Use the following text as a template NOTE it must include the , at the end but you are free to modify as required:
```
; service-dns.conf example

[dns]
; Launch at startup
start=1

; Listen on ip
host=<IP_ADDRESS>

; Disable lookups for standard domains
disable_standard_lookups=0

; Listen on port
port=53

; Forward standard requests to your standard DNS
; There has to be a comma at the end!
; e.g. lokal router ip: resolver=<IP_ADDRESS>,
; e.g. Google DNS: resolver=<IP_ADDRESS>, <IP_ADDRESS>,
resolver=<IP_ADDRESS>,
```
Please note NMControl is alpha software. We were unable to get the RESTFUL API to work over HTTP so will revist this as and when updates become available.

##### To start NMControl from within the /nmcontrol directory in the command line use:
```
sudo python ./nmcontrol.py
```
alternatively start in debug mode:
```
sudo python nmcontrol.py --daemon=0 --debug=1 start
```
We have provided an example rc.local file in this repo that starts both Namecoin and NMControl.

#### Bitmessage - Can be configured to use NMControl.
```
git clone https://github.com/Bitmessage/PyBitmessage ~/PyBitmessage
```
To launch Bitmessage, From a terminal on the desktop:
```
python ~/PyBitmessage/src/bitmessagemain.py &
```
and then use Settings | Namecoin Integration and select NMControl then press ```Test``` to verify.

#### Mozilla Browser and Email client
```
sudo apt-get install iceweasel
```
```
sudo apt-get install icedove
```
Both Iceweael and Icedove have launch icons that are found in the Menu | Internet section within GUI.

### Additional Configuration Tweaks

Some additional tweaks we have found useful are

#### To prevent terminals from blanking the following can be done:
```
sudo nano /etc/kbd/config
```
Locate these options and change to these values:
```
BLANK_TIME=0
POWERDOWN_TIME=0
```
Press ```ctrl+X``` followed by ```Y``` then ```Enter``` to save changes and return back to the command line.

#### The size of the swap file can easily be modified by using:
```
sudo nano /etc/dphys-swapfile
```
and then editing the value e.g.
```
CONF_SWAPSIZE=1024
```
Press ```ctrl+X``` followed by ```Y``` then ```Enter``` to save changes and return back to the command line. Then run the following commands to initialse the changes
```
sudo dphys-swapfile setup
sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start
```

#### Firewall

It is also advisable to add a firewall to your configuration.  Namecoin uses port 8334 by default and we have assigned port 8335 for RPC and Bitmessage uses port 8444.  NMControl runs on port 9000 and the standard port for DNS is 53.  So we install the firewall and configure it to deny incoming connections by default and to then allow SSH but limit to prevent attacks:
```
sudo apt-get install ufw
sudo ufw default deny incoming
sudo ufw allow ssh/tcp
sudo ufw limit ssh/tcp
```
Then we open the additional Namecoin, BitMessage, NMControl and DNS ports
```
sudo ufw allow 8334/tcp
sudo ufw allow 8335/tcp
sudo ufw allow 8444/tcp
sudo ufw allow 9000/tcp
sudo ufw allow 53/tcp
```
Finally enable the firewall and reboot
```
sudo ufw enable
sudo reboot
```

## Enjoy your Freedom!
https://twitter.com/_myveryown/status/696659199770697729


text:
# Reinforcement learning

Reinforcement learning (RL) is an area of machine learning concerned with how software agents ought to take actions in an environment in order to maximize the notion of cumulative reward. Reinforcement learning is one of three basic machine learning paradigms, alongside supervised learning and unsupervised learning.
Reinforcement learning is the training of machine learning models to make a sequence of decisions. The agent learns to achieve a goal in an uncertain, potentially complex environment. In reinforcement learning, an artificial intelligence faces a game-like situation. The computer employs trial and error to come up with a solution to the problem. To get the machine to do what the programmer wants, the artificial intelligence gets either rewards or penalties for the actions it performs. Its goal is to maximize the total reward.

It has following major Components :

* **Agent** : An AI algorithm which learns .
* **Environment** : A task/simulation which needs to be solved by the Agent.
* **Action** : How agent interacts with environment .
* **Reward** :  A reward Rt is a scalar feedback signal that indicates how well the agent is doing at time step t. The agent’s job is to maximize the expected sum of rewards.

repository: JeremyNjonge/Data-Science-Portfolio

path: /Reinforcement Learning/README.md

repo_name: JeremyNjonge/Data-Science-Portfolio


text:
# jQuery Turbolinks

[![Build Status](https://secure.travis-ci.org/kossnocorp/jquery.turbolinks.png?branch=master)](http://travis-ci.org/kossnocorp/jquery.turbolinks)

Do you like [Turbolinks](https://github.com/rails/turbolinks)? It's easy and fast way to improve user experience of surfing on your website.

But if you have a large codebase with lots of `$(el).bind(...)` Turbolinks will surprise you. Most part of your JavaScripts will stop working in usual way. It's because the nodes on which you bind events no longer exist.

I wrote jquery.turbolinks to solve this problem in [my project](http://amplifr.com). It's easy to use: just require it *immediately after* `jquery.js`. Your other scripts should be loaded after `jquery.turbolinks.js`, and `turbolinks.js` should be after your other scripts.

Initially sponsored by [Evil Martians](http://evilmartians.com/).

This project is a member of the [OSS Manifesto](http://ossmanifesto.org/).

## Usage

Gemfile:
``` js
gem 'jquery-turbolinks'
```

JavaScript manifest file:
``` js
//= require jquery.turbolinks
```

And it just works!

## Customization

### $.setReadyEvent

By default [ready](https://github.com/kossnocorp/jquery.turbolinks/blob/master/src/jquery.turbolinks.coffee#L17:L18) function is bound to [page:load](https://github.com/rails/turbolinks/#events) event.

If you want to change it use `$.setReadyEvent` function:

``` js
$.setReadyEvent('page:change');
```

### $.setFetchEvent

By default right after trigger `page:fetch` `$.isReady` is set to false. And after `page:load` is set to true.

If you want to change default behaviour you can use `$.setFetchEvent`:

``` js
$.setReadyEvent('custom_loading_event');
```

## Troubleshooting

### Events firing twice or more

If you find that some events are being fired multiple times after using jQuery Turbolinks, you may have been binding your `document` events inside a `$(function())` block. For instance, this example below can be a common occurrence and should be avoided:

``` javascript
/* BAD: don't bind 'document' events while inside $()! */
$(function() {
  $(document).on('click', 'button', function() { ... })
});
```

You should be binding your events outside a `$(function())` block. This will ensure that your events will only ever be bound once.

``` javascript
/* Good: events are bound outside a $() wrapper. */
$(document).on('click', 'button', function() { ... })
```

## Changelog

This project uses [Semantic Versioning](http://semver.org/) for release numbering.

### 1.0.0 (April 5, 2013)

* Add uglified version.

### 1.0.0-rc2 (January 31, 2013)

* Fix problem with 3rd-party libraries [#12](https://github.com/kossnocorp/jquery.turbolinks/issues/12), [#15](https://github.com/kossnocorp/jquery.turbolinks/issues/15) (kudos to [@rstacruz](https://github.com/rstacruz));
* Reopen [#8](https://github.com/kossnocorp/jquery.turbolinks/issues/8).

### 1.0.0-rc1 (November 28, 2012)

* Set $.isReady to false after `page:fetch` [#6](https://github.com/kossnocorp/jquery.turbolinks/issues/6);
* add `$.setFetchEvent` function;
* remove all delegated events after trigger fetch event [#8](https://github.com/kossnocorp/jquery.turbolinks/issues/8).

### 1.0.0-rc (November 8, 2012)

* Add turbolinks as dependency (kudos to [@gbchaosmaster](https://github.com/gbchaosmaster));
* run callback after adding to waiting list if `$.isReady` [#6](https://github.com/kossnocorp/jquery.turbolinks/issues/6).

### 0.2.1 (October 15, 2012)

* Pass jQuery object to each callback [#4](https://github.com/kossnocorp/jquery.turbolinks/issues/4)

### 0.2.0 (October 10, 2012)

* Change event: `page:change` -> `page:load` (kudos to [@davydotcom](https://github.com/davydotcom));
* added ability to change ready event via `$.setReadyEvent`

### 0.1.0 (October 3, 2012)

* First, initial release

## Contributors

Initial idea and code by [@kossnocorp](http://koss.nocorp.me/), with special thanks to [@rstacruz](https://github.com/rstacruz) and other the project's [contributors](https://github.com/kossnocorp/jquery.turbolinks/graphs/contributors).

## License

[The MIT License](https://github.com/kossnocorp/jquery.turbolinks/blob/master/LICENSE.md)


text:
---
topic: "Registration and Pass Times"
desc: "How does this work?"
---

Be aware of your pass times at: <https://my.sa.ucsb.edu/gold/RegistrationInfo.aspx>


text:
# 4.0.0 (8 Mar 2023)
## Breaking change
- python3.6 no longer supported
- added python 3.11

# 3.0.0 (22 June 2022)
## Features
- Use aioredis==^2.0.0

# 2.2.0 (13 Oct 2020)
## Features
- Supports python 3.9
- Monthly maintenance update

## Fixes
- using sha256 from hashlib see
(https://github.com/cr0hn/aiohttp-cache/pull/26)

## Features
- Supports python 3.6, 3.7 and 3.8
- Monthly maintenance update

# 2.0.2 (8 Apr 2020)

## Bug fix
- Fixed #22 when chache wasn't worked if other middlewares
appended

# 2.0.1 (31 Jan 2020)

## Codebase improvements
- Supports python 3.8
- Monthly maintenance update

# 2.0.0 (30 Jan 2020)

## Features:
- Add possibility to setup custom cache key
- Now the key value being encrypted when
written to Redis

## Bug fix
- Use new style aiohttp middlewares

## Codebase improvements
- Use poetry
- Use pre-commit linters
- Add integration tests including real calls
to redis backend
- Use gitlab ci

# 1.0.0 (11 Nov 2016)

- First release

gha_language: Python

gha_license_id: NOASSERTION


text:
---
title: Text, links and buttons
date: Last Modified
permalink: /components/text-links-buttons.html
eleventyNavigation:
  key: Text, links and buttons
  parent: Components and styles
  order: 52
---

## Text Stlyes

### Headers

#### When we use them

Headers are used to organize information. They allow readers to scan content and find what they’re looking for. Properly cascading headers help screen readers identify the hierarchy of information.

We have five levels of header available:

* H1 - Montserrat bold 700, font-size 2.3rem, line height 1.2
* H2 - Montserrat bold 700, font-size 2rem,  line height 1.2
* H3 - Roboto bold 700, font-size 1.5rem (24px),  line height 1.2
* H4 - Roboto bold 700, font-size 1.4rem (22.4px),  line height 1.2
* H5 - Montserrat bold 700 uppercase, font-size 0.8rem (13.6px),  line height 1.2

More information about when we use headers is available in the [content style guide](https://teamdocs.covid19.ca.gov/components/when/content-style-guide.html).

#### How to apply

When creating a block of text in WordPress, select the *Heading* option. It will default to creating an H2. Once you’ve created the block, you can change the level of header by selecting the *H2* button in the menu above the block.

Do not use H1 headers when creating content. These are automatically created by WordPress using the title of the post. Each page can only have one H1.

### Separator line

#### When we use them

Even with headers, people can find it hard to know where one section ends and a new one begins. The separator line creates a delineation between sections. Use them when:

* There are at least 3 H2 headers on a page.
* Sections are long enough when viewed on desktop that you will not see two separators in one screen.

When in doubt, get a second opinion on whether a page warrants a separator lines.

#### How to apply

To create a separator:

1. Create a new paragraph block in the WordPress post above an H2.
2. Select the black **+** button on the right side of the editing field for the block.
3. Select **Browse All**.
4. A menu will open on the left. Scroll down to the _Design_ section. Select **Separator**.
5. In the right menu (you may need to open it again using the **gear icon**), select the **Block** tab.
6. Open the **Advanced** accordion.
7. Copy the _HTML anchor_ from the H2 header and apply it to the separator block. (This creates some white space above the header when someone uses the anchor link, which looks better.)
8. Remove the _HTML anchor_ from the H2.

### Emphasized text (P large)

P large - Roboto regular 400, color #000000, font-size  1.45rem,  line height 1.5

#### When we use it

Emphasized text is used whenever we want to make regular paragraph text larger than other text. The most common scenario is the first sentence of a page as part of introducing the page index.

#### How to apply

You can add the _emphasized_ CSS class in the right menu.

![Block section in WordPress with emphasized class code](https://cagov.github.io/covid19.ca.gov-site-eng-playbook//content/images/emphasized-class-in-block.jpg)

### Normal text (P)

P - Roboto regular 300, color #00000, font-size 1.2rem,  line height 1.5, paragraph spacing 1.2rem

#### When we use it

This is the default text size for covid19.ca.gov. Use it whenever you’re creating body text or other general information.

#### How to apply

This text size is applied by default. You do not have to do anything to make your text show up in the normal size.

### P small

P small - Roboto regular 400, font-size 0.95rem,  line height 1.5, paragraph spacing 0.95rem

#### When we use it

Small text is used as explanatory text, usually underneath charts, tables, and other data presentations. It gives additional detail that the majority of people do not need, but still needs to be present for accuracy.

#### How to apply

Open the *Block* menu on the right side of the WordPress post. Select *Advanced* and enter _small-text_ in the _Additional CSS class(es)_ field to make the entire block small text.

You can also open the HTML view of the block you’d like to make small. Add the _small-text_ class to the paragraph code that starts the text.

```
<p class="small-text">The positivity rate in the matrix above excludes people in state and federal prisons, US Immigration and Customs Enforcement facilities, US Marshal detention facilities, and Department of State Hospitals facilities.</p>
```

### P extra small

P extra small - Roboto regular 400, color #000000, font-size 0.75rem,  line height 1.5, paragraph spacing 0.75rem

#### When we use it

Extra small text is reserved for data visualizations and charts.

## Link Styles

### Text link

![Examples of text links](https://cagov.github.io/covid19.ca.gov-site-eng-playbook//content/images/text-links.jpg)

#### When we use it

Use a text link to send people to other parts of the covid19.ca.gov website.

#### How to apply

Highlight the text you want to have become a text link. A menu will appear over the text block. Select the chain icon. Enter the destination URL. Select *Enter* to create the link.

### External link icon

![Examples of external link icons](https://cagov.github.io/covid19.ca.gov-site-eng-playbook//content/images/external-link-icons.jpg)

#### When we use it

Use an external link icon to tell people a link will take them away from covid19.ca.gov. This includes any sites that use a domain that includes covid19.ca.gov, but is not maintained by our team. It’s OK to use this formatting multiple times if there are multiple external links in one paragraph.

If a link goes to a PDF hosted on an external site, do not apply the external link icon code. We only use one link icon per link. It’s more important to tell people they’re going to a PDF than it is to tell them that it’s not hosted on our site.

#### How to apply

For this external link icon:

![External link icon](https://cagov.github.io/covid19.ca.gov-site-eng-playbook//content/images/external-link.png)

The code is:

```
<p>After reading, you can request to <a class="external" href="https://state-of-california-agency.forms.fm/great-plates-delivered-food-provider-interest-form">volunteer or provide meals</a>.</p>
```

### PDF link icon

![Examples of PDF link icons](https://cagov.github.io/covid19.ca.gov-site-eng-playbook//content/images/pdf-link-icons.jpg)

#### When we use it

Use a PDF link icon to tell people a link will take them to a PDF. Use this formatting on any link to a PDF document, regardless of who owns it. It’s OK to use this formatting multiple times if there are multiple external links in one paragraph.

#### How to apply

The PDF link icon is applied automatically when you create a hyperlink that directs to a URL ending in _.pdf_.

If you need to manually apply the PDF link icon, use this code:

![PDF link icon](https://cagov.github.io/covid19.ca.gov-site-eng-playbook//content/images/pdf-link-icon.png)

The code is:

```
<p>More details about receiving meals are available in the <a class="pdf" href="https://files.covid19.ca.gov/pdf/great-plates-delivered-participants-faqs.pdf">participant FAQ</a>.</p>
```

## Buttons and calls to action (CTA)

### Action button (action link)

![Examples of action buttons](https://cagov.github.io/covid19.ca.gov-site-eng-playbook//content/images/action-buttons.jpg)

#### When we use it

An action link is styled as a button so it stands out. It is used for a high-priority link near the top of the page. Only use one action link per page. Using a leading icon is preferred, but optional. Always put a space after the icon.

#### How to apply

For this action link:

![Action link](https://cagov.github.io/covid19.ca.gov-site-eng-playbook//content/images/action-link.jpg)

The code is:

```
<a class="action-link" href="https://covid19.ca.gov/sign-up-for-county-alerts/"><span class="ca-gov-icon-warning-circle"></span><strong> Sign up for county alerts</strong></a>
```

### User interface (UI) button

![Examples of user interface buttons](https://cagov.github.io/covid19.ca.gov-site-eng-playbook//content/images/ui-buttons.jpg)

There are many standard color combinations for this button and arrow links. See the [Examples](https://staging.covid19.ca.gov/sample) page for a preview, and check its [Wordpress file](https://as-go-covid19-d-001.azurewebsites.net/wp-admin/post.php?post=6854&action=edit) for the code for each.

#### When we use it

These button styles are used in forms and search fields. For example, the search field on the State Dashboard or Equity page.

#### How to apply

To create an action button, use this code:

```
<div class="col-md-3 py-4">
    <button class="button-lightblue bd-4px">button</button>
</div>
```

### Arrow link

![Examples of arrow links](https://cagov.github.io/covid19.ca.gov-site-eng-playbook//content/images/arrow-links.jpg )

#### When we use it

This code makes a special navigation link that responds to hover-overs with motion and a color change. Use this only once per page.

#### How to apply

For this arrow:

![Arrow button](https://cagov.github.io/covid19.ca.gov-site-eng-playbook//content/images/arrow-button.jpg)

Use this code:

```
<div class="row py-5 text-center">
    <div class="col-md-3 bg-blue py-4">
        <a href="#" class="link-arrow-white">
            <div class="link-arrow-label">Arrow</div>
            <cagov-arrow></cagov-arrow>
        </a>
    </div>
</div>
```

branch_name: refs/heads/main


text:
# streaming-svg-parser

Very fast parser of SVG files, that doesn't need the entire file to start
parsing it.

## usage

You can find example of this parser in https://anvaka.github.io/map-of-reddit/ and
more specifically - [here](https://github.com/anvaka/map-of-reddit/blob/756ece61fdf246be10076994f7f5876a7af002e8/src/lib/createSVGLoader.js#L10).
I need to document this better, but here is a quick demo of how the parser could
work to print indented elements along with their attributes:

``` js
const createStreamingSVGParser = require('streaming-svg-parser');

let indent = '';
let parseText = createStreamingSVGParser(
  openElement => {
    // attributes is a map, let's print it
    let attributes = Array.from(openElement.attributes)
      .map(pair => pair.join('='))
      .join(' ');

    console.log(indent + 'Open ' + openElement.tagName + ' ' + attributes);
    indent += '  ';
  },
  closeElement => {
    indent = indent.substring(2);
    console.log(indent + 'Close ' + closeElement.tagName);
  }
);
parseText('<?xml version="1.0" encoding="UTF-8"?>');
parseText('<svg clip-rule="evenodd" viewBox="0 0 42 42">')
parseText('<g id="my-id"><');
parseText('/g></svg>');
```

This will print:

```
Open svg clip-rule=evenodd viewBox=0 0 42 42
  Open g id=my-id
  Close g
Close svg
```

Note that `parseText()` was fed incomplete chunks of svg, which makes this parser
ideal when you load large SVG files over the network but want to process them without
waiting for the entire file to be loaded.

## License

MIT

repository: standardgalactic/streaming-svg-parser

repo_name: standardgalactic/streaming-svg-parser


text:
# deep-learning-cpu-gpu-benchmark

Repository to benchmark the performance of Cloud CPUs vs. Cloud GPUs on TensorFlow(as Keras Backend),  FloydHub and AWS.

## Usage

`floydhub_keras_cpu_gpu_benchmark.py` contains the launcher script for running the complete benchmark on FH. (You have to be logged on FloydHub before you run it)

`aws_gce_keras_cpu_gpu_benchmark.py [aws|gce]` contains the launcher script for running the complete benchmark on AWS or GCE. *Note: you must specifies the cloud service name as a script parameters.**

`/test_files` contains the test files.

`/logs` contains the performance output (CSV) for each test.

`/analysis` contains the Jupyter Notebook of the logs used to create the interactive data visualizations.

## TODO

See the project page: [here](https://github.com/ReDeiPirati/deep-learning-cpu-gpu-benchmark/projects).

## Credits

Max Woolf ([@minimaxir](http://minimaxir.com))

## License

MIT


text:
# amcrest2influx

A simple app to write events generated by an Amcrest device to InfluxDB using the
[`python-amcrest`](https://github.com/tchellomello/python-amcrest) and [`aioinflux`](https://github.com/gusutabopb/aioinflux) libraries.

## Installation
create a config.py. See [example-config.py].

Then Install the service:

```
pip3 install -r requirements.txt

sudo cp amcrest2influx.service /etc/systemd/system/
sudo systemctl enable amcrest2influx.service
sudo systemctl start amcrest2influx.service
```


text:
# Installation
> `npm install --save @types/cross-spawn`

# Summary
This package contains type definitions for cross-spawn (https://github.com/moxystudio/node-cross-spawn).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cross-spawn.

### Additional Details
 * Last updated: Fri, 15 May 2020 04:08:59 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)
 * Global values: none

# Credits
These definitions were written by [Alorel](https://github.com/Alorel), and [ExE Boss](https://github.com/ExE-Boss).

repository: thomas-yanxin/the-eye-knows-the-garbage

repo_name: thomas-yanxin/the-eye-knows-the-garbage


text:
django-nyt
=============

django-nyt does this:

```python
from django_nyt.utils import notify

EVENT_KEY = "my_key"
notify(_("OMG! Something happened"), EVENT_KEY)
```

All users subscribing to `EVENT_KEY` will have a notification created in their
stack. If you have emails enabled, they may get a summary of notifications at an
interval of their choice.

Data can be accessed easily from Django models or from the included JSON views.

Why should you do this?
-----------------------

Users need a cleverly sifted stream of events that's highly customizable as well.
By using django-nyt, your users can subscribe to global events or specific events
pertaining specific objects.

Each event can be associated with a link so the user can use the notifications as
shortcuts in their work flow.

What do you need to do?
-----------------------

You need to do a lot! But django-nyt does everything to meet as many needs as possible.
Firstly, you need to write some javascript that will fetch the latest notifications
and display them in some area of the screen. Upon clicking that icon, the latest
notifications are displayed. Something like this:

![Javascript drop-down](https://raw.githubusercontent.com/benjaoming/django-nyt/master/docs/misc/screenshot_dropdown.png)

Some examples are provided, but there is no real easy way to place this nifty
little thing at the top of your site.

Other things for your TODO list:

 * Provide your users with options to customize their subscriptions and notification preferences
 * Customize contents of notification emails
 * Make the mail notification daemon script run `python manage.py notifymail --daemon`
 * Put calls to `notify(...)` where ever necessary

Docs
-----

Here:

http://django-nyt.readthedocs.org/en/latest/

Community
---------

Please visit #django-wiki on irc.freenode.net as many django-wiki users are also familiar with django-nyt which previously lived inside django-wiki.

Development
------------

In your Git fork, run `pip install -r requirements.txt` to install the requirements.

The folder **testproject/** contains a pre-configured django project and an sqlite database. Login for django admin is *admin:admin*.

[![Build Status](https://travis-ci.org/benjaoming/django-nyt.png?branch=master)](https://travis-ci.org/benjaoming/django-nyt)

[![Downloads](https://pypip.in/d/django-nyt/badge.png)](https://pypi.python.org/pypi/django-nyt)

[![Downloads](https://pypip.in/v/django-nyt/badge.png)](https://pypi.python.org/pypi/django-nyt)

[![Wheel Status](https://pypip.in/wheel/django-ny/badge.svg)](https://pypi.python.org/pypi/django-nyt/)

[![Egg Status](https://pypip.in/egg/django-nyt/badge.svg)](https://pypi.python.org/pypi/django-nyt/)

*This is a work in progre..*
----------------------------

Please refer to the [TODO](https://github.com/benjaoming/django-nyt/blob/master/TODO.md)

repository: tonioo/django-nyt

repo_name: tonioo/django-nyt


text:
---
layout: base
title:  'Introduction'
permalink: fi/overview/introduction.html
---

# Introduction

The Finnish UD treebank is based on the [Turku Dependency Treebank](http://bionlp.utu.fi/fintreebank.html) (TDT), created at the University of Turku. The treebank consists of 15,000 sentences (200,000 tokens) and covers 10 different genres ranging from news to fiction and blog entries.

The morphological and syntactic annotation of the Finnish UD treebank is created through a conversion of TDT data, and much of the Finnish UD documentation draws directly on the TDT annotation guidelines ([Haverinen et al. 2013](http://tucs.fi/publications/attachment.php?fname=tHaverinen_Katri13a.full.pdf)).

## Acknowledgments

We wish to thank all of the contributors to the original TDT annotation effort, including Katri Haverinen who led the annotation, Jenna Kanerva, Filip Ginter, Timo Viljanen, Veronika Laippala, Samuel Kohonen, Anna Missilä, Stina Ojala, and Tapio Salakoski, as well as the University of Turku, the Turku Centre for Computer Science, the Finnish Academy and the Turku University Foundation for supporting the original TDT annotation effort.

## See also

The University of Helsinki provides a different Finnish treebank, converted to the UD notation from a newly revised
[FinnTreeBank 1](http://www.ling.helsinki.fi/kieliteknologia/tutkimus/treebank/) (ftb1-2014.zip, beta). The 19089 sentences and fragments originate as grammatical examples in the VISK Finnish grammar reference (161906 tokens, sentence lengths from 1 to 72 tokens with quartiles 5, 7, 11). This treebank is distributed as `UD_Finnish-FTB`.

## References

* Sampo Pyysalo, Jenna Kanerva, Anna Missilä, Veronika Laippala, and Filip Ginter. 2015. [Universal Dependencies for Finnish](http://www.aclweb.org/anthology/W/W15/W15-1821.pdf). In *Proceedings of Nodalida 2015*.
* Katri Haverinen, Jenna Nyblom, Timo Viljanen, Veronika Laippala, Samuel Kohonen, Anna Missilä, Stina Ojala, Tapio Salakoski, and Filip Ginter. 2013.
  [Building the essential resources for Finnish: the Turku Dependency Treebank](http://dx.doi.org/10.1007/s10579-013-9244-1). *Language Resources and Evaluation*. Volume 48, Issue 3, pp 493-531.
* Katri Haverinen. 2013.
  [Syntax Annotation Guidelines for the Turku Dependency Treebank - 2nd edition, revised for the treebank release of July 2013](http://tucs.fi/publications/attachment.php?fname=tHaverinen_Katri13a.full.pdf). *Technical report 1034, Turku Centre for Computer Science*.

repository: UniversalDependencies/docs

branch_name: refs/heads/pages-source

gha_language: HTML

repo_name: UniversalDependencies/docs


text:
# Slack file upload action

This action uploads file to slack

## Inputs

### `token`

**Required** Slack app token. See [Internal app tokens](https://slack.com/intl/en-ru/help/articles/215770388-Create-and-regenerate-API-tokens#internal-app-tokens)
* Create app
* Add `files:write` permission
* Install app to your workspase
* Invite bot to required channels `/invite <botname>`
* Use bot token from `OAuth & Permissions` page
### `path`

**Required** Path to file

### `channel`

Slack channel for upload

### `filename`

Filename of file

### `filetype`

A file type identifier.

### `initial_comment`

The message text introducing the file in specified channels.

### `title`

Title of file

## Example usage

```
on: [push]

jobs:
  slack_upload_job:
    runs-on: ubuntu-latest
    name: Upload test file
    steps:
      - name: Checkout
        uses: actions/checkout@v1
      - run: echo "Test file " > test.txt
      - name: Upload to slack step
        uses: adrey/slack-file-upload-action@master
        with:
          token: ${{ secrets.SLACK_TOKEN }}
          path: test.txt
          channel: random
```

repository: adrey/slack-file-upload-action

repo_name: adrey/slack-file-upload-action


text:
# nvim-lspfuzzy

This plugin makes the Neovim LSP client use
[FZF](https://github.com/junegunn/fzf)
to display results and navigate the code.

It works by redefining LSP handlers so that they call FZF. Therefore
you don't need to change any of your exising LSP mappings. It's also **small**
(currently at ~160 SLOC) and **written entirely in Lua**.

The plugin is compatible only with Neovim 0.5+.

![demo](./demo.gif)

## Installation

#### With Packer
In your *plugins.lua*:
```lua
cmd 'packadd packer.nvim'
return require('packer').startup(function()
  use {
    'ojroques/nvim-lspfuzzy',
    requires = {
      {'junegunn/fzf'},
      {'junegunn/fzf.vim'},  -- to enable preview (optional)
    },
  }
end)
```

#### With Plug
In your *.vimrc* or *init.vim*:
```vim
call plug#begin()
Plug 'junegunn/fzf', {'do': {-> fzf#install()}}
Plug 'junegunn/fzf.vim'  " to enable preview (optional)
Plug 'ojroques/nvim-lspfuzzy', {'branch': 'main'}
call plug#end()
```

#### With Paq
[Paq](https://github.com/savq/paq-nvim) is a lightweight package manager for
Neovim. In your *init.lua*:
```lua
cmd 'packadd paq-nvim'
local paq = require('paq-nvim').paq
paq 'junegunn/fzf'
paq 'junegunn/fzf.vim'  -- to enable preview (optional)
paq 'ojroques/nvim-lspfuzzy'
```

## Usage
Simply add this line to your *init.lua*:
```lua
require('lspfuzzy').setup {}
```

If you're using a *.vimrc* or *init.vim*, you need to enclose that line in a
lua block:
```vim
lua << EOF
require('lspfuzzy').setup {}
EOF
```

By default the following FZF commands are available:
* **tab** : select multiple entries
* **shift+tab** : deselect an entry
* **ctrl-a** : select all entries
* **ctrl-d** : deselect all entries
* **ctrl-t** : go to location in a new tab
* **ctrl-v** : go to location in a vertical split
* **ctrl-x** : go to location in a horizontal split

## Configuration
You can pass options to the `setup()` function. Here are all available options
with their default settings:
```lua
require('lspfuzzy').setup {
  methods = 'all',         -- either 'all' or a list of LSP methods (see below)
  fzf_options = {},        -- options passed to FZF (overwrite the embedded default ones)
  fzf_action = {           -- additional FZF commands
    ['ctrl-t'] = 'tabedit',  -- go to location in a new tab
    ['ctrl-v'] = 'vsplit',   -- go to location in a vertical split
    ['ctrl-x'] = 'split',    -- go to location in a horizontal split
  },
  fzf_modifier = ':~:.',   -- format FZF entries, see |filename-modifiers|
  fzf_trim = true,         -- trim FZF entries
}
```

The FZF commands are determined as follows:
1. Commands passed to the `fzf_action` option when calling `setup()` are used
  first.
2. Otherwise the plugin will try to load commands from the FZF option
  `g:fzf_action` if it's set.
3. Finally the default commands will be used.

## Supported LSP methods
You can enable FZF only for a subset of LSP methods by passing them as a list
to the `methods` option when calling `setup()`. The supported LSP methods are:
```
callHierarchy/incomingCalls
callHierarchy/outgoingCalls
textDocument/declaration
textDocument/definition
textDocument/documentSymbol
textDocument/implementation
textDocument/references
textDocument/typeDefinition
workspace/symbol
```

## Troubleshooting

#### Preview does not work
You need to install [fzf.vim](https://github.com/junegunn/fzf.vim) to enable
previews. If it's already installed, make sure it's up-to-date. The plugin
checks that `g:loaded_fzf_vim` is set, which was defined
[in this commit](https://github.com/junegunn/fzf.vim/commit/636a62f140181f80c8e7460a76ae6a5d2c5d97b2).

#### Using the `fzf_modifier` option breaks the plugin
The plugin uses the filename embedded in the FZF entry selected by the user
to jump to the correct location. Therefore it must resolve to a valid path.
For instance `:.` or `:p` can be used but not `:t`.

## License
[LICENSE](./LICENSE)

repository: TrendingTechnology/nvim-lspfuzzy

repo_name: TrendingTechnology/nvim-lspfuzzy


text:
# Poria hyalina var. byssopora (Rick) Rick VARIETY

#### Status
ACCEPTED

#### According to
Index Fungorum

#### Published in
in Rambo (Ed. ), Iheringia, Sér. Bot. 7: 271 (1960)

#### Original name
Poria byssospora Rick

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# SwiftLambdaTwist
Lambda Twist algorithm implementation on Swift

see: https://openaccess.thecvf.com/content_ECCV_2018/html/Mikael_Persson_Lambda_Twist_An_ECCV_2018_paper.html

and: https://github.com/vlarsson/lambdatwist

# Dependencies
None

# Notes
Implemented as per Algorithm 1 in the paper, so not particularly optimized. Quite many errors were found and fixed by referring to the authors' implementation.

repository: tkarv/SwiftLambdaTwist

gha_language: Swift

repo_name: tkarv/SwiftLambdaTwist


text:
# S3 Terraform Module

A Terraform module to create a S3 endpoint service association to a VPC

## Prerequisites

Terraform and AWS Command Line Interface tools need to be installed on your
local computer.

### Terraform

Terraform version 0.10.3 or higher is required.

Terraform installation instructions can be found
[here](https://www.terraform.io/intro/getting-started/install.html).

### AWS Command Line Interface

AWS Command Line Interface installation instructions can be found
[here](http://docs.aws.amazon.com/cli/latest/userguide/installing.html).

## Module Input Variables

- `private_route_tables` - List of the private Route Table Identifiers to be associated with the S3 Endpoint. *[default value: []]*
- `public_route_tables` - List of the public Route Table Identifiers to be associated with the S3 Endpoint. *[default value: []]*
- `vpc_id` - The ID of the VPC in which the S3 endpoint will be used. *[default value: '']*

## Usage

Simple example:

```hcl
module "my_s3" {
  source               = "github.com/fscm/terraform-module-aws-s3"
  private_route_tables = ["rtb-012345a67b8901234"]
  public_route_tables  = ["rtb-0123a456b7890cdef"]
  vpc_id               = "vpc-0a12b345678cd9e0f"
}
```

Example with VPC:

```hcl
module "my_vpc" {
  source                 = "github.com/fscm/terraform-module-aws-vpc"
  cidr                   = "<IP_ADDRESS>/16"
  domain                 = "mydomain.tld"
  name                   = "vpc"
  prefix                 = "mycompany-"
  private_subnets_amount = "3"
  public_subnets_amount  = "3"
}

module "my_s3" {
  source               = "github.com/fscm/terraform-module-aws-s3"
  private_route_tables = "${module.my_vpc.private_route_table_id}"
  public_route_tables  = "${module.my_vpc.public_route_table_id}"
  vpc_id               = "${module.my_vpc.id}"
}
```

## Outputs

- `id` - **[type: string]** The ID of the S3 endpoint.
- `state` - **[type: string]** The state of the VPC endpoint.

## Contributing

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3.  Push to the branch: `git push origin my-new-feature`
5. Submit a pull request

Please read the [CONTRIBUTING.md](CONTRIBUTING.md) file for more details on how
to contribute to this project.

## Versioning

This project uses [SemVer](http://semver.org/) for versioning. For the versions
available, see the [tags on this repository](https://github.com/fscm/terraform-module-aws-s3/tags).

## Authors

* **Frederico Martins** - [fscm](https://github.com/fscm)

See also the list of [contributors](https://github.com/fscm/terraform-module-aws-s3/contributors)
who participated in this project.

## License

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


text:
---
layout: docs
title: Node Eviction
permalink: /docs/workloads/vms/node-eviction.html
navbar_active: Docs
order: 10
---

# VirtualMachineInstance Node Eviction

Before removing a kubernetes node from the cluster, users will want to ensure
that VirtualMachineInstances have been gracefully terminated before powering down the
node. Since all VirtualMachineInstances are backed by a Pod, the recommended method
of evicting VirtualMachineInstances is to use the **kubectl drain** command, or in the
case of OpenShift the **oc adm drain** command.

## How to Evict all VMs on a Node

Select the node you'd like to evict VirtualMachineInstances from by identifying the
node from the list of cluster nodes.

```kubectl get nodes```

The following command will gracefully terminate all VMs on a specific node.
Replace **<node name>** with the target node you want the eviction to occur on.

```kubectl drain <node name> --delete-local-data --ignore-daemonsets=true --force --pod-selector=kubevirt.io=virt-launcher```

Below is a break down of why each argument passed to the drain command is
required.

- ```kubectl drain <node name>``` is selecting a specific node as a target for
the eviction

- ```--delete-local-data``` is a required flag that is necessary for removing
any pod that utilizes an emptyDir volume. The VirtualMachineInstance Pod does use
emptryDir volumes, however the data in those volumes are ephemeral which means
it is safe to delete after termination.

- ```--ignore-daemonsets=true``` is a required flag because every node running
a VirtualMachineInstance will also be running our helper DaemonSet called virt-handler.
DaemonSets are not allowed to be evicted using **kubectl drain**. By default,
if this command encounters a DaemonSet on the target node, the command will
fail. This flag tells the command it is safe to proceed with the eviction and
to just ignore DaemonSets.

- ```--force``` is a required flag because VirtualMachineInstance pods are not owned by
a ReplicaSet or DaemonSet controller. This means kubectl can't guarantee that
the pods being terminated on the target node will get re-scheduled replacements
placed else where in the cluster after the pods are evicted. KubeVirt has its
own controllers which manage the underlying VirtualMachineInstance pods. Each
controller behaves differently to a VirtualMachineInstance being evicted. That behavior
is outlined futher down in this document.

- ```--pod-selector=kubevirt.io=virt-launcher``` means only VirtualMachineInstance pods
managed by KubeVirt will be removed from the node.

## How to Evict all VMs and Pods on a Node

By removing the **--pod-selector** argument from the previous command, we can
issue the eviction of all Pods on a node. This command ensures Pods
associated with VMs as well as all other Pods are evicted from the target node.

```kubectl drain <node name> --delete-local-data --ignore-daemonsets=true --force```

## Re-enabling a Node after Eviction

The **kubectl drain** will result in the target node being marked as
unschedulable. This means the node will not be eligible for running new
VirtualMachineInstances or Pods.

If it is decided that the target node should become schedulable again, the
following command must be run.

```kubectl uncordon <node name>```

or in the case of OpenShift

```oc adm uncordon <node name```

## Shutting down a Node after Eviction

From KubeVirt's perspective, a node is safe to shutdown once all VirtualMachineInstances
have been evicted from the node. In a multi-use cluster where VirtualMachineInstances
are being scheduled along side other containerized workloads, it is up to the
cluster admin to ensure all other pods have been safely evicted before powering
down the node.

## VirtualMachine Evictions

The eviction of any VirtualMachineInstance that is owned by a VirtualMachine
set to **running=true** will result in the VirtualMachineInstance being re-scheduled to
another node.

The VirtualMachineInstance in this case will be forced to power down and restart on
another node. In the future once KubeVirt introduces live migration support,
the VM will be able to seamlessly migrate to another node during eviction.

## VirtualMachineInstanceReplicaSet Eviction Behavior

The eviction of VirtualMachineInstances owned by a VirtualMachineInstanceReplicaSet will result
in the VirtualMachineInstanceReplicaSet scheduling replacements for the evicted
VirtualMachineInstances on other nodes in the cluster.

## VirtualMachineInstance Eviction Behavior

VirtualMachineInstances not backed by either a VirtualMachineInstanceReplicaSet or an
VirtualMachine object will not be re-scheduled after eviction.


text:
## 0.1.3

- Fixed handling of user input around embeds.
- Added new heuristic rule to preserve block style on paste

## 0.1.2

* Upgraded dependency on quiver_hashcode to 2.0.0.

## 0.1.1

* Added `meta` package to dependencies.
* Fixed analysis warnings.
* Added example.

## 0.1.0

*  Initial release.


text:
title: Deep Learning for automatic stroma classification and quantification in pancreatic H&E stained whole-slide-images
groups: ai-for-health
closed: true
type: student
picture: vacancies/MD_drug_repurposing.png
template: vacancy-single
people: Pierpaolo Vendittelli,Tom Perik, Geert Litjens, John Hermans
description: Develop a method to automatically classify and quantify stroma in pancreatic H&E stained whole-slide-images

**This is an AI for Health MSc project. Students are
elgible to receive a monthly reimbursement of €500,- for
a period of six months. For more information please read the
[requirements](https://www.ai-for-health.nl/requirements/).**

## Clinical Problem
Pancreatic ductal adenocarcinoma (PDAC) has the worst prognosis of all cancer diseases with a 5-year survival rate of less than 10%. One of the reason for poor prognosis is resistance to treatment, which could be explained by the tumour morphology.  PDAC is known to be a heterogeneous tumour. Recent studies hypothesised that morphological heterogeneity reflect structural and functional diversity in tumour biology. This could provide relevant clinical information on tumour-intrinsic properties as part of the routine diagnostic work-up to improve clinical outcome.

## Solution
The goal of this project is to create a Deep Learning algorithm for the automatic classification and quantification of stroma in H&E stained whole slide images of pancreatic cancer. The algorithm should first segment the tumour area (coarse area which includes tumour glands and tumour stroma), then within that region it should detect regions of interest (defined as bounding boxes built around tumour glands) and last, it should classify the stroma in these regions of interest. Challenges include working with gigapixel images and with large amount of data. Tasks will include automatic selection of the regions of interest (ROIs) to use for classification and quantification of the tumour stroma.

## Data
Our hospital archive currently contains hundreds digitized pancreatic slides, including biopsies and resections, which can be used for training/testing the models. This project will use annotated data from an ongoing prospective study.

## Embedding
This project will be embedded in a clinical project with the goal to correlate CT perfusion imaging.  The goal of this research is to correlate functional imaging parameters with pathology features such as stroma type and micro vessel density. The ultimate goal is to improve prediction of chemotherapy response and survival in PDAC.

## Requirements
- Students Artificial Intelligence, Data Science, Computer Science, Bioinformatics in the final stages of their Master education.
- You should be proficient in python programming and have a theoretical understanding of deep learning architectures.
- Basic biological / biomedical knowledge is preferred.

## Information
- Project duration: 6 months
- Location: Radboud University Medical Center
- More information can be obtained from Pierpaolo Vendittelli (mailto<EMAIL_ADDRESS>

repository: DIAGNijmegen/website-content

gha_language: TeX

repo_name: DIAGNijmegen/website-content


text:
# Frontier Coding Test - Display Sorted Account Info

## Purpose

The business needs a view that displays user accounts by status.

## Feature Description

The new accounts view will display user accounts sorted by status. The view will pull data from the vendor's REST API. Account statuses, due dates and amounts due should be calculated by the vendor. This feature is only for US users, so a currency type of USD can be inferred.

## Scope

A template for the view has been provided, this template can be modified to fit the template engine of the framework generating the view. Responsive design is handled in another unassigned user story, this functionality can be implemented in this story if time permits.

## Marketing Notes

- A basic template has been provided using CSS grid and HTML 5. This template can be modified.
- Responsive design is not required at this time, but is considered a nice to have.
- Fields displayed include Name, Email, Phone Number, Amount Due and Payment Due Date
- Phone Number should be formatted as (###)-###-####
- Dates should be formatted as (##/##/####). We have no preference on leading zeros in days and months, but years should display all 4 digits.
- Name should be formatted as $"{LastName}, {FirstName}".
- Amount Due should be formatted as "$###.##" or "$##.##"
- Currency type of USD can be inferred.
- Empty due dates for inactive accounts should hide.

## Developer Notes

- Provided template seems to have issues if the content in the lists overflow into the footer. This is not in the acceptance criteria, but is marked as a known issue. If time permits, this is a nice to have fix.
- This solution should be completed in either vue.js, angular(v2+), react, .NET core, or .NET 5.

## Known  Issues

### Template

- Content overflows from lists into footer causes list content to render underneath the footer rather than pushing the footer down.
- Three column layout causes issues on mobile.

## Acceptance Criteria

- Solution is written in vue.js, angular(v2+), react, .NET core, or .NET 5.
- Accounts appear in the correct column by status
- All 7 Mock Data accounts appear
- Dates, Names, Amounts and Phone Numbers are formatted correctly
- Empty due dates hide field and label
- Data integrity between endpoint and view is preserved.


text:
# [Cheese Of The Day](http://alexa.amazon.com/#skills/amzn1.ask.skill.bf880f90-8ce2-4e4e-a71e-139d0ed09297)
![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png) 0

To use the Cheese Of The Day skill, try saying...

* *Alexa, open cheese of the day*

* *Alexa, ask cheese of the day what is the cheese of the day*

* *Alexa, ask cheese of the day what is today's cheese*

Cheese of the Day recommends you a delicious cheese that you can eat. Ask Cheese of the Day for a recommendation, and you will learn about the different cheeses around the world, how they are made, and what tastes and textures they have.
Start with "Alexa, open Cheese of the Day"!

***

### Skill Details

* **Invocation Name:** cheese of the day
* **Category:** null
* **ID:** amzn1.ask.skill.bf880f90-8ce2-4e4e-a71e-139d0ed09297
* **ASIN:** B01LYRKGCC
* **Author:** Jadenator
* **Release Date:** October 11, 2016 @ 01:41:59
* **In-App Purchasing:** No


text:
---
id: jest
title: Jest integration
sidebar_label: Jest integration
---

Async Storage module is tightly coupled with its `NativeModule` part - it needs
a running React Native application to work properly. In order to use it in
tests, you have to provide its separate implementation. Follow these steps to
add a mocked `Async Storage` module.

## Using Async Storage mock

You can use one of two ways to provide mocked version of `AsyncStorage`:

### With **mocks** directory

1. In your project root directory, create
   `__mocks__/@react-native-async-storage` directory.
2. Inside that folder, create `async-storage.js` file.
3. Inside that file, export `Async Storage` mock.

```javascript
export * from '@react-native-async-storage/async-storage/jest/async-storage-mock';
```

### With Jest setup file

1. In your Jest config (probably in `package.json`) add setup files location:

```json
"jest": {
  "setupFiles": ["./path/to/jestSetupFile.js"]
}
```

2. Inside your setup file, set up Async Storage mocking:

```javascript
jest.mock('@react-native-async-storage/async-storage', () =>
  require('@react-native-async-storage/async-storage/jest/async-storage-mock')
);
```

## Testing with mock

Each public method available from `Async Storage` is
[a mock function](https://jestjs.io/docs/en/mock-functions), that you can test
for certain condition, for example, if `.getItem` has been called with a
specific arguments:

```javascript
it('checks if Async Storage is used', async () => {
  await asyncOperationOnAsyncStorage();

  expect(AsyncStorage.getItem).toBeCalledWith('myKey');
});
```

## Overriding Mock logic

You can override mock implementation, by replacing its inner functions:

```javascript
// somewhere in your configuration files
import AsyncStorageMock from '@react-native-async-storage/async-storage/jest/async-storage-mock';

AsyncStorageMock.multiGet = jest.fn(([keys], callback) => {
  // do something here to retrieve data
  callback([]);
});

export default AsyncStorageMock;
```

You can
[check its implementation](https://github.com/react-native-async-storage/async-storage/blob/main/jest/async-storage-mock.js)
to get more insight into methods signatures.

gha_language: TypeScript


text:
# url-exists-deep [![npm version](https://badge.fury.io/js/url-exists-deep.svg)](https://badge.fury.io/js/url-exists-deep) ![Node CI](https://github.com/StephanGeorg/url-exists-deep/workflows/Node%20CI/badge.svg?branch=master&event=push)

A deeper determination if an URL exists.

It tests for:

+ Domain available and accessible
+ Url available and accessible
+ Redirect available and accessible

url-exists-deep was developed for performance and accuracy. To check whether a url
exists and is publicly accessible or not a HEAD request is sent, because this is much faster then a GET.
Most hosts are responding correct. If the host responses with a 403 Forbidden a GET
request with User-Agent and Accept header is sent.

## Installation

```
> npm i url-exists-deep
```

## Usage

```javascript
import urlExists from 'url-exists-deep';

```

```javascript
const url = 'https://www.google.com';
const exists = await urlExists(url);
```

## Result

Returns ``false`` if url does not exists or ``` object ``` with url information.

Makes a deeper determination if a url exists or not. To reduce false negative
responses.

### Rewrites 301

If ```url``` redirects with 301 url-exists-deep follows the redirect and returns
the destination url if exists.

repository: StephanGeorg/url-exists-deep

repo_name: StephanGeorg/url-exists-deep


text:
# GorillaScript Community Release v1.0.0

## March 6th, 2017 (v1.0.3)

Fixed `__slice` not being defined when using array splats.

## June 15th, 2016 (v1.0.2)

Fixed bugs with async functions

## June 14th, 2016 (v1.0.1)

Added an `async!` macro ala `promise!`

## June 14th, 2016 (v1.0.0)

Made #** produce an async function and added await keyword. Usage:

	#**
		await abc()

The old syntax of:

  # -> promise!
	    yield abc()

Is still valid.

## April 8th, 2015 (v0.10.0)

GorillaScript community release 0.10.0 aimed to erridcate built-in generators and add iojs support. I'm happy to say that GorillaScript now defaults to using ES6 generator/yields and is fully compatable with iojs!

repository: kkirby/gorillascript

repo_name: kkirby/gorillascript


text:
#### 1.4.0
* Added support for {{#is...}} helper tags based on Dan Harper's Handlebars-Helpers library (https://github.com/danharper/Handlebars-Helpers)
* Added support for compiling against CoreCLR using `net451` and `dotnet5.4` TFMs
* Added support for resolving unknown expression values using the `UnknownValueResolver` delegate.
* Changed `Func<object, string>` instances to `HandlebarTemplate` to simplify the delegate types used for templates.
* Changed `Func<RenderContext, string>` instances to `HandlebarPartialTemplate` to simplify the delegate types used for partial templates.
* Changed `Func<HelperOptions, string>` instances to `HandlebarHelper` to simplify the delegate types used for helpers.

#### 1.3.0
* Added missing Handlebars.RegisterHelper method

#### 1.2.0
* Added support for html escaping using {{&...}} experssions. These are equivalent to {{{...}}} expressions.
* Renamed RawString to SafeString to align with HandlebarsJS API, and moved to base FuManchu namespace.
* Fixed issue with Write method for SyntaxTreeRenderer<T>.Write method not actually considering the RenderContext.EscapeEncoding value.

#### 1.1.0
* Added support for block and expression helpers.
* Added support for @root lookups in expressions.

#### 1.0.0
* Initial release of FuManchu


text:
# sass-ratios
Sass function to generate ratio sizes.

Just grab the contents of [_sass-ratios.scss](_sass-ratios.scss) and `@import` it into your project somewhere.

https://alistapart.com/article/content-out-layout to learn more about why we should be using ratios in web-design.

## Demo

https://codepen.io/corysimmons/pen/XaJMXy

## Example

```scss
// in.scss
.small-ratio {
  width: ratio(2, 1.5, 2);
}

.large-ratio {
  width: ratio(1, 1.5, 2);
}
```

```scss
// out.css
.small-ratio {
  width: calc(100% * 1.5/3.75);
}

.large-ratio {
  width: calc(100% * 2.25/3.75);
}
```

## Params/API

```scss
// @function ratio(
//   $index: 1,
//   $ratio: 1.618,
//   $count: 3,
//   $no-calc: null)
//
// Returns a single value from a list of ratio values.
//
// $index | 1-based index to get from the list of ratio fractions.
// $ratio | Whatever ratio you want to use as your base. Check out modularscale.com for fancy ideas.
// $count | The number of results you're working with, so if you want 4 sizes to work with, you'd set this to 4. It's used to generate the denominator for the returned fraction.
// $no-calc | By default these will return the fraction with a CSS calc() formula multiplyng the fraction by 100%. This is useful for widths/heights (most common usage), but you can disable this and just get the fraction by setting this to `true`.
```

## Globals

```scss
$global-ratio: 1.618 !default;
$global-count: 3 !default;
$global-no-calc: false !default;
```

repository: corysimmons/sass-ratios

repo_name: corysimmons/sass-ratios


text:
# **This is an archived repository. Probably you want to check my** [TPFramework](https://github.com/Prastiwar/TPFrameworkUnity) **where it is merged into.**

#### Full documentation: https://github.com/Prastiwar/TPSaveLoadCreator/blob/master/SaveLoadDocumentation.docx

repository: Prastiwar/TPSaveLoadCreator

repo_name: Prastiwar/TPSaveLoadCreator


text:
# Project "Springfield"

_Springfield_ is the name given to the GPU cluster owned and operated by the
[UiT Machine Learning Group](https://machine-learning.uit.no). Currently the
cluster consists of five physical nodes, four of which are GPU servers.
The nodes are joined together as a Kubernetes (k8s) cluster.

## Getting access

Access to the cluster is strictly controlled and only available to researchers
and students directly associated with the research group. Detailed instructions
are given in the [getting started][getting-started] guide.

[getting-started]: https://uitml.github.io/springfield/getting-started.html

repository: uitml/springfield

gha_language: Shell

repo_name: uitml/springfield


text:
# Automated Code Generation

## This is currently out of date

What we need to begin
We need the [json_to_cpp](https://github.com/beached/json_to_cpp) tool.

To build it
```bash
git clone https://github.com/beached/json_to_cpp.git
cd json_to_cpp
mkdir build
cd build
cmake ..
cmake --build .
```

Now we will have an executable called `json_to_cpp` or `json_to_cpp.exe` that will allow us to convert a json file to C++ structures along with the JSON Link mappings.

For example, let's use [cookbook_class2.json](https://raw.githubusercontent.com/beached/daw_json_link/release/test_data/cookbook_class2.json) from the [class.md](class.md) cookbook

```bash
json_to_cpp --infile=cookbook_class2.json
```

The program will output the following C++ code
```c++
#include <tuple>
#include <cstdint>
#include <string>
#include <daw/json/daw_json_link.h>

struct a_t {
	std::string member0;
	int64_t member1;
	bool member2;
};	// a_t

struct root_object_t {
	a_t a;
	int64_t b;
};	// root_object_t

namespace daw::json {
  template<>
  struct json_data_contract<a_t> {
    static constexpr char const mem_member0[] = "member0";
    static constexpr char const mem_member1[] = "member1";
    static constexpr char const mem_member2[] = "member2";
    using type = json_member_list<
        json_string<mem_member0>,
        json_number<mem_member1, int64_t>,
        json_bool<mem_member2>>;

    static inline auto to_json_data( a_t const &value ) {
      return std::forward_as_tuple( value.member0, value.member1,
                                    value.member2 );
    }
  };
}

namespace daw::json {
  template<>
  struct json_data_contract<root_object_t> {
  	static constexpr char const mem_a[] = "a";
  	static constexpr char const mem_b[] = "b";
  	using type =
  	  json_member_list<
  	    json_class<mem_a, a_t>,
  	    json_number<mem_b, int64_t>>;

  	static inline auto to_json_data( root_object_t const &value ) {
  	  return std::forward_as_tuple( value.a, value.b );
  	}
  };
}
```

As you can see it is pretty close to the types specified, except in this case for integrals it defaults to int64_t as it cannot know that it was an unsigned.

We can make it prettier as the default will use root_object_t as the type of the root class and the other objects are the name of their members suffixed with `_t`

Let's give the root object a name
```bash
json_to_cpp --root_object=MyClass2 --infile=cookbook_class2.json
```

The tool was used to generate the citm, twitter, and canada json examples as the json data is large.

One other option is we can specify members that are kv class pairs where the keys are the member names and values the associated values.  This cleans up the generated code substantially in many cases.  The path is specified as `member.submember.subsubmember...`

branch_name: refs/heads/release


text:
# System Users Module

Sage Imel<EMAIL_ADDRESS>
This module provides a wrapper user class and module to enable simple management of
system users and their ssh keys through hiera.

# Dependencies

## Required
* Puppet 3.x
* Hiera

# Quick Start

Currently this module is closely coupled to Debian family Linux and to NGINX.

## Load the system_users class

  include system_users

## Define your users

'system_users::users':
  'example':
    keys:
      'unique-key-name':
        'key': 'long-key-here'

extension: markdown


text:
# How to contribute

We invite everybody to help make Git Town better. Every contribution is welcome,
no matter how big or small.

#### I want to report a bug or need a feature

please [open an issue](https://github.com/git-town/git-town/issues/new)

#### I want to fix a bug or add a feature

- see our [developer guidelines](DEVELOPMENT.md) to get started
- if you plan a larger change or need guidance, connect with the maintainers by
  [opening an issue](https://github.com/git-town/git-town/issues/new)
- otherwise, hack away and
  [send a pull request](https://help.github.com/articles/using-pull-requests)

#### I want to say thank you

Please star this repo on GitHub and tweet or blog about us!

repository: git-town/git-town

gha_language: Go

repo_name: git-town/git-town


text:
# Kill-Camels
A 2d platformer game made in one week for a Game Jam.

The theme was "Magic and spells".

## Some screenshots
![Thumbnail](screenshots/thumbnail.jpg "Kill Camels")
![Power Ups](screenshots/power_ups.png "Power Ups")
![Kill a Camel](screenshots/jump_kill.png "Kill a Camel")
![Shoot](screenshots/shoot.png "Shoot")
![Boss](screenshots/boss.png "The boss")

## Some features
This is a 2D platformer made with Unity.

This game has 3 parts : Learning, Training and Fighting.

All textures, sounds and code are free and under the MIT licence.
Assets includes a _Raw folder with Photoshop and FL Studio files.

## Some links
[Check it on Itch.IO](https://cc618.itch.io/kill-camels "Itch.IO")


text:
# Binder

The **Binder** group contains the SDK packages for working with [Binder](https://mybinder.org) specifications. This group allows developers to leverage Binder APIs to provide features such as connecting to notebooks, notebook servers, as well as notebook instances.

**Table of contents**

[TOC]

---

## /host-cache

The `@nteract/host-cache` package contains a provider component for you to connect to a Binder instance and access its context in all child components. Examples of this package are in the source for the [nteract play application](https://github.com/nteract/play).

### Example

The example below shows how to use the `Host` component within this package to connect to a Binder instance and display information about the connection.

**Example:**

```javascript
import { Host } from "@mybinder/host-cache";

export default () => {
  return (
    <Host
      repo="nteract/examples"
      gitRef="master"
      binderURL="https://mybinder.org"
    >
      <p>We've connected to a Binder instance within this context.</p>
      <p>
        But now we need to retrieve some information about the Binder context we
        are connected to.
      </p>
      <p>So let's use the "Host.Consumer" component!</p>
      <Host.Consumer>
        {host =>
          host ? (
            <pre>
              Endpoint: {host.endpoint}
              Token: {host.token}
            </pre>
          ) : null
        }
      </Host.Consumer>
    </Host>
  );
};
```

## /rx-binder

The `@nteract/rx-binder` package provides a set of functions for connecting to a remote instance provided by [Binder](https://mybinder.org/). This package allows you to connect to a remote compute instance from your nteract application to execute code.

See an example of this package in the source code for the [nteract play app](https://github.com/nteract/play).

### Example

This content is still in development. For more information, reach out to the community on [GitHub](https://github.com/nteract).

**Example:**

```javascript
const { binder } = require("rx-binder");

binder({ repo: "nteract/vdom" }).subscribe(msg => console.log(msg));
> { phase: 'built',
  imageName: 'gcr.io/binder-prod/prod-v4-1-nteract-vdom:78fa2b549f67afc3525543b0bccfb08a9e06b006',
  message: 'Found built image, launching...\n' }
{ phase: 'launching', message: 'Launching server...\n' }
{ phase: 'ready',
  message: 'server running at https://hub.mybinder.org/user/nteract-vdom-r115e00y/\n',
  url: 'https://hub.mybinder.org/user/nteract-vdom-r115e00y/',
  token: 'tocwpFakeToken' }
```

repository: nteract/nteract

repo_name: nteract/nteract


text:
---
layout: post
title:  "Toggl iOS/Android app"
date:   2016-08-31 09:16:00 +0100
categories: project
---

The [Toggl](https://www.toggl.com) mobile client is a project made-up by two UI side clients, one for each system (iOS or Android) and a library to share the common business logic. This project is fully implemented using C# and Xamarin platform and cross-platform techniques. The clients serve as complement to the Toggl's main product, a web based time tracker.

### Architecture

As most of Xamarin projects, the Toggl mobile clients have a common library with the follow content:

- _Persistence logic_: Access to databases, DAO definition, synchronization mechanism.
- _View Models_: Helper objects to encapsulate the functionality of the views.
- _Service access layer_: Accesses to the remote APIs.
- _Business logic_: Logic to process user input and incoming data.

Besides, therea are two platform projects, one for Android and another for iOS that contain the UI code using system native API. This code is fed by the data generated inside the common library.

![Screenshot]({{ "/assets/projects/toggl-code-sharing.png" | absolute_url }})

The whole projects is inserted into a [MvvM architecture](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel) where the [Rx(reactive extensions)](http://reactivex.io/) code is used as glue between layers.

![Screenshot]({{ "/assets/projects/toggl-mvvm.png" | absolute_url }})
([image source](https://ramonesteban78.github.io/es/tutorials/mvvm/xamarin-forms-and-mvvm.html))

The most complex part of the whole project is the remote data synchronization. The Toggl app has offline capabilities and collects user input without network connection. Once the connection is restored, the clients execute the conflict resolution algorithm in order to drive _server-side_ and _client-side_ data to the same state. The principle "last writer wins" is used.

### Services

- Developer team lead
- Frontend development and maintenance
- Content creation
- UX/UI design collaboration

gha_language: CSS


text:
# numberedStringOrder

[![Latest Version on Packagist](https://img.shields.io/packagist/v/awssat/numbered-string-order.svg?style=flat-square)](https://packagist.org/packages/awssat/numbered-string-order)
[![StyleCI](https://styleci.io/repos/110764857/shield?branch=master)](https://styleci.io/repos/110764857)
[![Build Status](https://img.shields.io/travis/awssat/numberedStringOrder/master.svg?style=flat-square)](https://travis-ci.org/awssat/numberedStringOrder)

Sort an array of strings based on the included numbers naturally. An alternative to PHP built-in natsort function that's actually work.

## Install

Via Composer

``` bash
$ composer require awssat/numbered-string-order
```

## Usage

#### Sort

```php
//if you are using laravel, then instead use:
//$numberedStringOrder = app(Awssat\numberedStringOrder\numberedStringOrder::class);

$numberedStringOrder = new numberedStringOrder();

$numberedStringOrder->sort([
    'episode 5',
    'episode50',
    '499',
    'episode1',
    'episode two hundred',
    'episode one',
    'episode two',
    'episode eleven',
    'episode three'
]);

>> output:
[
     "episode1",
     "episode one",
     "episode two",
     "episode three",
     "episode 5",
     "episode eleven",
     "episode50",
     "episode two hundred",
     499,
]

```

If you ask why not use the built-in function (natsort), then see the natsort output of the same example above to know why:
```php
 //output of built-in function natsor(): 🤨
 [
     "499",
     "episode1",
     "episode 5",
     "episode50",
     "episode eleven",
     "episode one",
     "episode three",
     "episode two",
     "episode two hundred",
   ]
 ```

 #### Get the numbers
If you want to use our internal numbers extracting method

```php
$numberedStringOrder->getNumbers(['2digits', 'text1', 'three3', 'two cars', 'blank']);

>> output:
[
     "2digits" => 2,
     "text1" => "1",
     "three3" => "3",
     "two cars" => 2,
     "blank" => "blank",
]
```

#### Convert words to numbers
This package can also be helpful if you want to convert numerical words to numbers

```php
new numberedStringOrder();
$numberedStringOrder->englishWordsToNumbers('one hundred twenty-three thousand four hundred fifty-six');
>> output: 123456

//to get arabic words to number use: arabicWordsToNumbers(...)

```

## Test
```bash
composer test
```

Currently, it supports English and Arabic.

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

repository: i-Developers/numbered-string-order

repo_name: i-Developers/numbered-string-order


text:
# dnsperfbench
DNS Performance Benchmarker

dnsperfbench is a command line tool to compare performance of popular public DNS resolvers from your computer, including Google Public DNS, OpenDNS and Cloudflare's <IP_ADDRESS>.

You may optionally specify IP addresses of additional resolvers to include in the benchmark, for example the IP address of your ISP's resolver.

For each resolver, dnsperfbench first runs runs a few tests for a specific FQDN, to ensure the resolver has the response in cache.
Next, dnsperfbench tests cache hit performance (basically round trip latency; we call this ResolverHit) and cache miss performance against various major authoritative DNS providers.
Each test is repeated 15 times.

Once all the tests have finished, dnsperfbench shows the results per resolver (median and mean RTT and % tests that failed) and computes an overall performance score per resolver. The lower the score, the better was the resolver's performance.

Example of the overall Summary:

```
========== Summary ===========
Scores (lower is better)
+--------------------------------+-------------------+
|            RESOLVER            | PERFORMANCE SCORE |
+--------------------------------+-------------------+
| <IP_ADDRESS> (Cloudflare)           |              1983 |
| <IP_ADDRESS> (OpenDNS)       |              3175 |
| <IP_ADDRESS> (Norton)         |              3846 |
| <IP_ADDRESS> (Google)               |              6275 |
| <IP_ADDRESS> (Clean         |             12825 |
| Browsing)                      |                   |
| <IP_ADDRESS> (Quad9)                |             14677 |
| <IP_ADDRESS> (Comodo)            |            200494 |
+--------------------------------+-------------------+
You should probably use <IP_ADDRESS> as your default resolver
```

... and the Summary of running dnsperfbench at the same location but from another ISP:

```
========== Summary ===========
Scores (lower is better)
+--------------------------------+-------------------+
|            RESOLVER            | PERFORMANCE SCORE |
+--------------------------------+-------------------+
| <IP_ADDRESS> (Cloudflare)           |              1720 |
| <IP_ADDRESS> (Norton)         |              3031 |
| <IP_ADDRESS> (Google)               |              5580 |
| <IP_ADDRESS> (Clean         |              7205 |
| Browsing)                      |                   |
| <IP_ADDRESS> (OpenDNS)       |             12415 |
| <IP_ADDRESS> (Quad9)                |             62491 |
| <IP_ADDRESS> (Comodo)            |            131040 |
+--------------------------------+-------------------+
You should probably use <IP_ADDRESS> as your default resolver
```

While Cloudflare happened to be the best in both cases, performance of OpenDNS was quite different.

The performance score is calculated using the following formula:
`5 * (ResolverHit mean + ResolverHit median) + ( for each auth: (auth mean + auth median) )`
A failed test is treated as the test taking 10 seconds.

## httptest

New functionality `-httptest` benchmarks the performance of a given http(s) endpoint using the answer returned by various resolvers.

Example

```
$ dnsperfbench -resolver <IP_ADDRESS> -httptest https://turbobytes.akamaized.net/static/rum/100kb-image.jpg
2018/04/21 20:09:47 Resolving
2018/04/21 20:10:00 Issuing HTTP(s) tests
+-------------------------------------+---------------------+-------+---------+-------+-------+----------+--------+
|              RESOLVER               |       REMOTE        |  DNS  | CONNECT |  TLS  | TTFB  | TRANSFER | TOTAL  |
+-------------------------------------+---------------------+-------+---------+-------+-------+----------+--------+
| <IP_ADDRESS> (Unknown)             | <IP_ADDRESS>:443    | 26ms  | 23ms    | 83ms  | 25ms  | 40ms     | 197ms  |
| <IP_ADDRESS> (Quad9)                     | <IP_ADDRESS>:443  | 56ms  | 25ms    | 89ms  | 26ms  | 43ms     | 238ms  |
| <IP_ADDRESS> (OpenDNS)            | <IP_ADDRESS>:443   | 71ms  | 23ms    | 83ms  | 25ms  | 40ms     | 242ms  |
| <IP_ADDRESS> (Google)                    | <IP_ADDRESS>:443    | 110ms | 24ms    | 84ms  | 24ms  | 40ms     | 281ms  |
| [2001:4860:4860::8888] (Google)     | <IP_ADDRESS>:443   | 111ms | 24ms    | 83ms  | 24ms  | 41ms     | 282ms  |
| [2620:0:ccc::2] (OpenDNS)           | <IP_ADDRESS>:443   | 156ms | 24ms    | 82ms  | 24ms  | 40ms     | 326ms  |
| [2606:4700:4700::1111] (Cloudflare) | <IP_ADDRESS>:443    | 53ms  | 53ms    | 114ms | 53ms  | 69ms     | 342ms  |
| <IP_ADDRESS> (Cloudflare)                | <IP_ADDRESS>:443    | 54ms  | 56ms    | 120ms | 57ms  | 72ms     | 358ms  |
| <IP_ADDRESS> (Norton)              | <IP_ADDRESS>:443    | 89ms  | 62ms    | 130ms | 60ms  | 85ms     | 426ms  |
| <IP_ADDRESS> (Baidu)                | <IP_ADDRESS>:443      | 129ms | 86ms    | 180ms | 86ms  | 123ms    | 605ms  |
| [2620:fe::fe] (Quad9)               | <IP_ADDRESS>:443   | 27ms  | 223ms   | 456ms | 224ms | 317ms    | 1.247s |
| [2a0d:2a00:1::] (Clean Browsing)    | <IP_ADDRESS>:443    | 350ms | 228ms   | 465ms | 229ms | 278ms    | 1.55s  |
| <IP_ADDRESS> (Clean Browsing)    | <IP_ADDRESS>:443    | 382ms | 227ms   | 463ms | 227ms | 292ms    | 1.591s |
| <IP_ADDRESS> (DNSPod)               | <IP_ADDRESS>:443 | 474ms | 236ms   | 481ms | 244ms | 335ms    | 1.772s |
| <IP_ADDRESS> (114dns)            | <IP_ADDRESS>:443  | 382ms | 283ms   | 573ms | 284ms | 401ms    | 1.924s |
| <IP_ADDRESS> (Comodo)                 | <IP_ADDRESS>:443  | 219ms | 280ms   | 566ms | 279ms | 648ms    | 1.993s |
+-------------------------------------+---------------------+-------+---------+-------+-------+----------+--------+
```

Behind the scenes, the tool fetches `https://turbobytes.akamaized.net/static/rum/100kb-image.jpg` 10 times for each resolver, using the IP returned by the individual resolver, and reports the result with the median total time.

In the above example, we can see that the best performing IP were returned by my ISP resolver and ECS compatible public resolvers.

This test is bandwidth intensive. In the above example, it ran 10 tests each against 16 resolvers downloading 100KB each time. A total of ~16 MB + TLS handshake overhead.

IPv6 is supported by default.

## Installation

### From source

```
go get -u github.com/turbobytes/dnsperfbench
go install github.com/turbobytes/dnsperfbench
#Run using
$GOPATH/bin/dnsperfbench  #If $GOPATH/bin is not in PATH
or
dnsperfbench #If $GOPATH/bin is in PATH
```

Binary will be located at `$GOPATH/bin/dnsperfbench`

### Docker

```
docker pull turbobytes/dnsperfbench
#Run using
docker run --rm -it turbobytes/dnsperfbench
```

You can also set flags with the Docker image:

```
docker run --rm -it turbobytes/dnsperfbench -workers 2
```

### Download a release

View the page of the [latest release](https://github.com/turbobytes/dnsperfbench/releases/latest). Then copy download link from there.

Assume the latest tag is `v0.1.7`

```
#One-off test
curl -Lo /tmp/dnsperfbench https://github.com/turbobytes/dnsperfbench/releases/download/v0.1.7/dnsperfbench-linux && chmod +x /tmp/dnsperfbench && /tmp/dnsperfbench #Linux
curl -Lo /tmp/dnsperfbench https://github.com/turbobytes/dnsperfbench/releases/download/v0.1.7/dnsperfbench-osx && chmod +x /tmp/dnsperfbench && /tmp/dnsperfbench #OSX
```

To have it permanently available store the binary somewhere permanent.

## Usage

```
$ dnsperfbench --help
Usage of dnsperfbench:
-httptest string
    Specify a URL to test including protocol (http or https)
-queries int
    Limit the number of DNS queries in-flight at a time (default 5)
-r	Output raw mode
-resolver value
    Additional resolvers to test. default=<IP_ADDRESS>, <IP_ADDRESS>, [2001:4860:4860::8888], [2620:fe::fe], <IP_ADDRESS>, [2606:4700:4700::1111], [2a0d:2a00:1::], <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, [2620:0:ccc::2]
-version
    Print version and exit
-workers int
    Number of tests to run at once (default 15)
```

repository: vadv/dnsperfbench

repo_name: vadv/dnsperfbench


text:
# DuoTones
Based on [DuoTone themes](http://simurai.com/projects/2016/01/01/duotone-themes/) by [Simurai](http://simurai.com/)

This is a work in progress. Until now only templates for Vim, Sublime Text and Prism have been edited.
In time the templates for HighlightJs and Prettify will also be edited to tone down those brackets, punctuation and so on, in order to keep these colorschemes in the spirit of the original DuoTone Themes.

Go to [demopage](http://atelierbram.github.io/syntax-highlighting/duotones)

> “DuoTone themes use only 2 hues (7 shades in total). It **tones down** less important parts (like punctuation and brackets) and highlights only the **important** ones. This leads to a more calm color scheme, but still lets you find the stuff you’re looking for.”

![DuoTones Dark theme](http://atelierbram.github.io/syntax-highlighting/assets/img/duotones-dark_vim_960x640.png "DuoTones Dark theme")
Screenshot of DuoTones Dark theme in Vim

### Downloads
All downloads can be [found in the output](https://github.com/atelierbram/syntax-highlighting/tree/master/duotones/output/) folder.

NOTE: For Atom, please use [the original theme](https://atom.io/themes/search?utf8=%E2%9C%93&q=keyword:duotone) by [Simurai](https://atom.io/users/simurai).

For Sublime Text, go to the [Textmate folder](https://github.com/atelierbram/syntax-highlighting/tree/master/duotones/output/textmate) within the output folder. Or download the zipfile for Sublime Text/Textmate directly [from here](http://atelierbram.github.com/syntax-highlighting/duotones/output/textmate/textmate.zip).

#### Installation for Sublime Text with Git
Or, when using Git, you can clone the [dedicated repo for this purpose](https://github.com/atelierbram/duotones-sublime-colorschemes)

In your Packages  directory, clone the theme repository using the command below:

```bash
$ git clone https://github.com/atelierbram/duotones-sublime-colorschemes.git
```

#### Installation for Vim with Git
For Vim with Pathogen you can clone [the dedicated repo for this purpose](https://github.com/atelierbram/vim-colors_duotones) in the ~/.vim/bundle directory like so:

```bash
cd ~/.vim/bundle
git clone https://github.com/atelierbram/vim-colors_duotones.git
```

### Credits
- Credits to [Simurai](http://simurai.com/) whose [DuoTone themes](http://simurai.com/projects/2016/01/01/duotone-themes) for Atom were a model for these colorschemes
- Credits to [Chris Kempson](http://chriskempson.com/), whose [Base16 Builder](https://github.com/chriskempson/base16-builder) was used for conversion to the different output formats. It’s a remarkable building tool, and I would also recommend trying out the colorschemes he made with them.

### Resources
- [Orginal Colorscheme for Atom on simurai.com](http://simurai.com/projects/2016/01/01/duotone-themes/)
- [Orginal Colorscheme for Atom on Github](https://github.com/simurai/duotone-dark-syntax/blob/master/styles/colors.less)
- [Creating Colorschemes for Vim on vimcasts.org](http://vimcasts.org/episodes/creating-colorschemes-for-vim/)

### License
Released under [MIT Licence](http://atelierbram.mit-license.org)

[Pathogen]: https://github.com/tpope/vim-pathogen

repository: bcelenza/syntax-highlighting

repo_name: bcelenza/syntax-highlighting


text:
## Description

Please write any background information about this PR you think is useful for the Office of Civic Innovation team.

## User story

If this PR introduces new functionality, include a user story or stories describing what this pull request is intended for.

## How to reproduce

1.  If the PR fixes a bug, include instructions for reproducing the bug on a current release.

## QA Steps

- [ ] Add manual QA steps in checklist format for a reviewer to perform to confirm that the feature or fix is working. Include as much details as possible so that the reviewer doesn't lose time figuring out how to perform steps.

## Merge process

- [ ] Note if there is a special sequence for merging (such as PRs on other repos that need to be merged first) or other abnormalities to look out for.


text:
---
layout: "post"
---

根据这个很Fancy的网站 [Laws of UX](https://lawsofux.com)整理的UX规则。

规则这东西每次都要想蛮累的。

自己不负责任的翻译了一点中文，为了自己看起来方便。看到解释多的，就是我不够理解，然后从其他网站上复制黏贴过来的更详尽的解释。。因为很懒，就不翻译。 看两眼应该就能明白。

[The Psychology Principles Every UI/UX Designer Needs to Know - Marvel Blog](https://blog.marvelapp.com/psychology-principles-every-uiux-designer-needs-know/)

# 1. Fitts’s Law

[Fitts’s Law: The Importance of Size and Distance in UI Design | Interaction Design Foundation](https://www.interaction-design.org/literature/article/fitts-s-law-the-importance-of-size-and-distance-in-ui-design)

The time to acquire a target is a function of the distance to and size of the target.

用户抵达目标的时间取决于距离以及目标大小

# 2. Hick’s Law

The time it takes to make a decision increases with the number and complexity of choices.

做决定的速度取决于选择个数以及选项的复杂程度。

# 3. Jakob’s Law

Users spend most of their time on other sites. This means that users prefer your site to work the same way as all the other sites they already know.

用户会花大量时间在其他的网站上。 职责意味着用户在使用你的网站的时候期待的方式是和其他网站保持一致的。

# 4.Law of Prägnanz

[Design Principles: Visual Perception And The Principles Of Gestalt — Smashing Magazine](https://www.smashingmagazine.com/2014/03/design-principles-visual-perception-and-the-principles-of-gestalt/)

People will perceive and interpret ambiguous or complex images as the simplest form possible, because it is the interpretation that requires the least cognitive effort of us.
对于模糊或是负责的的图片/图形， 我们会以简单的方式去理解。

# 5. Law of Proximity

Objects that are near, or proximate to each other, tend to be grouped together.

相近的元素更容易被视为是一组。

# 6. Law of Similarity

The human eye tends to perceive similar elements in a design as a complete picture, shape, or group, even if those elements are separated.

相似的元素更容易被视为是一副完整的图片，形状或是同一组，即便他们是分开的。

# 7. Miller’s Law

The average person can only keep 7 (plus or minus 2) items in their working memory.
普通人的工作记忆做多只能记住7个左右的事项。

# 8. Occam’s Razor

[Occam’s Razor: A Great Principle for Designers - Webdesigner Depot](https://www.webdesignerdepot.com/2010/07/occams-razor-a-great-principle-for-designers/)

Among competing hypotheses that predict equally well, the one with the fewest assumptions should be selected.

用户倾向于选择更加简单明了的选项而不是那些不理解的选项。

# 9. Pareto Principle

The Pareto principle states that, for many events, roughly 80% of the effects come from 20% of the causes.

对于大多数事情来说， 80%的效果来自20%的原因。

# 10. Parkinson’s Law

Any task will inflate until all of the available time is spent.

时间有所限制的时候人们才会更快的采取行动

# 11. Serial Position Effect

[The Serial Position Effect: Why ABC and XYZ stand out the most among all the alphabets.](https://medium.com/coffee-and-junk/design-psychology-serial-position-effect-ca0e4cf299cb)

Users have a propensity to best remember the first and last items in a series.

用户更倾向于记住列表中的第一项或最后一项。

Experiments show that when participants are presented with a list of words, they tend to remember the first few and last few words, and are more likely to forget those in the middle of the list.

This is known as the serial position effect.

The tendency to recall earlier words in a list is called the Primacy Effect; and the tendency to recall the later words is called the Recency Effect.

## The Primacy Effect

The theory for the primacy effect is that the greater accuracy of recall is due to the relatively small amount of processing effort expended in rehearsing the item by itself.

This is in contrast to proceeding items (in the middle of a sequence) which must be rehearsed with all the other preceding information (in the beginning of a sequence); causing significant cognitive burden and affecting recall.

## The Recency Effect

The theory for the recency effect is that recall is better for items appearing towards the end of a sequence due to their preservation in our working memory (the part of our short-term memory that processes conscious and immediate perceptual information.) Our working memory holds temporary information and acts as a buffer for new information while it absorbs into other memory systems.

How can designers use Serial Position Effect?

Knowing that the positioning of an item can affect user experience by causing information in the middle of a sequence to be harder to recall, designers can make conscious choices while placing items in a list, or arrange content in a webpage.

Placing the least important items in the middle of lists can be helpful because these items tend to be stored less frequently in long-term and working memory.

If the user has to take a decision some time after exposure (> 30 seconds), then placing the most important items first in a list can be of advantage. And, if the user has to take a decision immediately after reading the list, then placing the most important item last on the list can be of advantage.

E.g., on a sales pages consider placing the main benefit of your product on top of the list, and your persuasive extras like “free shipping” and “5% cashback”, last. This way if the subject leaves the page they are more likely to remember the main benefit of your product.

When the user doesn’t set the pace of the presented items, such as in video and audio, it is usually better to present the most important items last.

Designers should also be aware of the primacy and recency effects while conducting surveys, especially while having people choose from a long list, as they often represent a margin of error. The right way to conduct the survey is to shuffle the list positions for each vote so as to nullify the error.

# 12. Tesler’s Law

[Explaining the Law of Conservation of Complexity - Humanist](http://www.humanist.co/blog/law-of-conservation-of-complexity/)
[Larry Tesler Interview](http://www.designingforinteraction.com/tesler.html)
[Simplicity is Overrated - Marvel Blog](https://blog.marvelapp.com/simplicity-is-overrated/)

Tesler’s Law, also known as The Law of Conservation of Complexity, states that for any system there is a certain amount of complexity which cannot be reduced.

Every application must have an inherent amount of irreducible complexity. The only question is who will have to deal with it.

Here is one way to estimate value or cost to users for a cost-benefit analysis. In this case, we will calculate the value or cost to users within a week. To do so, multiply the following together:

* Average frequency per week that a user encounters the complexity in question
* Number of active users per week
* Value/Cost, a unit representing what a single user will receive from the change or the cost incurred by users due to the complexity in question.

> The problem is that sometimes “simple” ends up treated as “minimal”, resulting on faulty features that don’t add much value to the user until the next iteration comes around, causing flaws on the user experience.

Here are a few things to consider when simplifying things:

* Aim for exceeding the expectations without overwhelming the experience.
* Try to reduce the time to perform a task. If that’s not possible, how can you make the waiting more tolerable?
* Provide clear and organized steps towards achieving the end result, ensuring that each state of your application fits properly into the flow.
* Reduce the amount of distractions
* Bring data forward in order to facilitate the process

# 13. Von Restorff Effect

The Von Restorff effect, also known as The Isolation Effect, predicts that when multiple similar objects are present, the one that differs from the rest is most likely to be remembered.

最与众不同的那个元素最容易被记住。

# 14. Zeigarnik Effect

People remember uncompleted or interrupted tasks better than completed tasks.

人们倾向于记住那些尚未完成的或是中途被打扰的任务。

path: /_posts/2018-03-4-Laws of UX .md