text:
> Sub-generators allow you to add a specific file or files to an existing project.

## yo assemble

This is the default generator. Running `yo assemble` will generate the following files to create a complete Assemble project:

* `docs/README.tmpl.md`: a readme template
* `.assemblerc.yml`: a runtime config file for Assemble
* `package.json`: with minimal properties defined. However, if this exists already `assemble` will be added to `devDependencies`.

## Config

### yo assemble:config

Add a basic `.assemblerc.yml` config file for Assemble with:

```bash
yo assemble:config
```

To add a config file that is geared towards usage with Grunt, run `yo assemble:config grunt`

## Templates

> Add a Handlebars template to your project, ready to use with Assemble.

### yo assemble:page

Add a page template to `templates/pages` with:

```bash
yo assemble:page foo
```

Where `foo` is the name of the file you want to add.

* `yo assemble:page about` results in `templates/pages/about.hbs`
* `yo assemble:page index` results in `templates/pages/index.hbs`
* `yo assemble:page foo/bar` results in `templates/pages/foo/bar.hbs`

### yo assemble:layout

Add a layout template to `templates/layouts` with:

```bash
yo assemble:layout foo
```

Where `foo` is the name of the file you want to add.

* `yo assemble:layout default` results in `templates/layouts/default.hbs`
* `yo assemble:layout base` results in `templates/layouts/base.hbs`

### yo assemble:include

Add a include template to `templates/includes` with:

```bash
yo assemble:include foo
```

Where `foo` is the name of the file you want to add.

* `yo assemble:include nav` results in `templates/includes/nav.hbs`
* `yo assemble:include button` results in `templates/includes/button.hbs`

### yo assemble:data

Assemble processes templates using data from your project's package.json. You can extend the data available to your
templates with any JSON or YAML files specified in `.assemblerc.yml` or in `options.data`.

Add a data file to your project with:

* `yo assemble:data changelog`: adds a `CHANGELOG` file to the root of your project, formatted as valid YAML.

### yo assemble:doc

Add a starter markdown file for general content to `content/` with:

```bash
yo assemble:doc foo.md
```

Where `foo.md` is the name of the file you want to add.

### yo assemble:post

Add a starter markdown file for a blog post to `content/posts/` with:

```bash
yo assemble:post foo.md
```
Where `foo` is the name of the blog post you want to add. Blog posts also include basic YAML front matter.

### yo assemble:helper

Add a starter Handlebars helper to `templates/_helpers` with:

```bash
yo assemble:helper foo
```

Where `foo` is the name of the file you want to add.

* `yo assemble:helper slugify` results in `templates/_helpers/slugify.js`
* `yo assemble:helper eachIndex` results in `templates/_helpers/eachIndex.js`

### yo assemble:plugin

Add a starter Assemble plugin to `templates/_plugins` with:

```bash
yo assemble:plugin foo
```

Where `foo` is the name of the file you want to add.

* `yo assemble:plugin navigation` results in `templates/_plugins/navigation.js`
* `yo assemble:plugin breadcrumbs` results in `templates/_plugins/breadcrumbs.js`

### yo assemble:component

Add a UI component consisting of:

* template
* stylesheet
* data file (yaml/json)

```bash
yo assemble:doc foo.md
```

Where `foo.md` is the name of the file you want to add. If the name used matches an actual file in [assemble-readme-includes](https://github.com/assemble/assemble-readme-includes), then that file will be copied into the `docs/` directory of your project.

If the name _doesn't match_ a valid file in [upstage-components](https://github.com/upstage/upstage-components), then a new "starter" document will be created using the given file name.

### yo assemble:boilerplate

Use a boilerplate to kickstart documentation for a project. Boilerplates include a `README.tmpl.md` template and a few includes, such as `install.md`, `options.md` etc.

```bash
yo assemble:boilerplate foo
```

Where `foo` is the name of the boilerplate you want to use from [assemble-boilerplates](https://github.com/assemble/assemble-boilerplates).

Valid `yo assemble:boilerplate` arguments are:

_(TODO)_

**Pro tip**: you can use the default boilerplate, `node`, by running just `yo assemble:boilerplate`.

### Custom boilerplates

Visit the docs for [adding custom boilerplates](./docs/custom-boilerplates.md).

## Misc

### yo assemble:remote

Adds files from the specified GitHub repository.

Usage:

```bash
yo assemble:remote foo
```

There are only two options here:

1. Use `yo assemble:remote helpers` to get docs from the [handlebars-helpers](https://github.com/assemble/handlebars-helpers) repo, and write them to `docs/helpers`.
2. Use this format: `yo assemble:remote username/repo some/directory` to get files from the specified repo and directory.


text:
This document describes the protocol with which the robots communicate.

On connection to the server (which will be on a static IP address):
  Send a Hello message that contains some RobotID. Of the format: "HELLO: ID\n"

  The server will reply with a "start" message, indicating that the robot
  should proceed down the starting ramp. This message will be of the format:

  "START\n"

Once the robot is done with this command, it sends a "RESET: ID\n" message back
;o the server. (See the done message section).

Server can send a "stop" message, format:
  "STOP\n"

Server can send a "resume" message, format:
  "RESUME\n"

Server can send a "wait" message, format:
  "WAIT 0000\n"
Where 0000 is any 4 digit number, representing the number
of milliseconds. After waiting for the amount of time specified,
the robot should respond with a "DONE" message.

Server can send a movement command, format:
  "INSTRUCTION, currentX, currentY, currentOritentation, distance, rotation"
  Where X and Y are floating point representations of the
  robot's current position. All distances are in millimeters.
  Distance is the distance that the robot
  should travel, rotation is the amount it should rotate
  in degrees, currentOrientation is the current orientation of the robot
  After the movement command is finished, the server expects a message with format:
  "DONE: ID\n" from the robot

If the connection is broken, the robot connects to the server again and sends another HELLO message (with the _same id_   as before)

Robots will send a message indicating intensities at positions as a list (possibly empty or single valued) in the format:

"INTENSITY: ID; (X1, Y1, Intensity1); (X2, Y2, Intensity2); ... (XN, YN, IntensityN)\n"

The ITENSITY message will be sent *before* the DONE message for that
respective command.

__On a reconnection__
The robot sends a HELLO message.

When the server sends a START message, the robot either:
	(a) Starts down the ramp if it is on the ramp. When it
	gets to the end of the ramp it sends a RESET message.

	(b) Does not send a RESET message. Instead sends a DONE
	message to the server which starts the routing.

license: MIT

repository: dyth/ARMSurveySwarm

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: dyth/ARMSurveySwarm


text:
Python implementations of hashing model
---------------------------------------

The implemented hashing models include:
- LSH1
- PCA-ITQ, CCA-ITQ2
- SDH3

Requirements
------------

```
# create a new env
conda create --name hashing scikit-learn numpy
# activate the new env
conda activate hashing
```

Usage
------

The current implemented models are `LSH, ITQ, ITQ_CCA, SDH`. All the models share the same interface,
so it is very easy to use them. The Following are two examples:

> You can download **MNIST-GIST512D** from [here](https://drive.google.com/open?id=14MG9OGekFROlbe-aLHuNlRMiFZITHFhh).

## ITQ

```python
from hashing.model import ITQ
from hashing.dataset import load_mnist_gist
from hashing.evaluation import mean_average_precision, precision_recall

# load mnist-512d data
root = './datasets/mnist-gist-512d.npz'
query_data, train_data, database_data = load_mnist_gist(root)
query, query_label = query_data
train, _ = train_data
database, database_label = database_data

# ITQ
encode_len = 32
model = ITQ(encode_len)
model.fit(database)

# encode
query_b = model.encode(query)
database_b = model.encode(database)

# evaluation
mAP = mean_average_precision(query_b, query_label,
                             database_b, database_label)
precision, recall = precision_recall(query_b, query_label,
                                     database_b, database_label)
print(f'mAP = {mAP}')
print("Precision:")
print(precision)
print("Recall:")
print(recall)
```

## ITQ-CCA

```python
from hashing.model import ITQ_CCA
from hashing.dataset import load_mnist_gist
from hashing.evaluation import mean_average_precision, precision_recall
from hashing.utils import one_hot_encoding

# load mnist-512d data
root = './datasets/mnist-gist-512d.npz'
query_data, train_data, database_data = load_mnist_gist(root)
query, query_label = query_data
train, train_label = train_data
database, database_label = database_data

# ITQ
model = ITQ_CCA(encode_len=32)
train_label = one_hot_encoding(train_label, 10)
model.fit(train, train_label)

# encode
query_b = model.encode(query)
database_b = model.encode(database)

# evaluation
mAP = mean_average_precision(query_b, query_label,
                             database_b, database_label)
precision, recall = precision_recall(query_b, query_label,
                                     database_b, database_label)
print(f'mAP = {mAP}')
print("Precision:")
print(precision)
print("Recall:")
print(recall)
```

# References

[1] M. S. Charikar, “**Similarity Estimation Techniques from Rounding Algorithms**,” in Proceedings of the Thiry-Fourth Annual ACM Symposium on Theory of Computing, New York, NY, USA, 2002, pp. 380–388, doi: 10.1145/509907.509965.
[2] Y. Gong and S. Lazebnik, “**Iterative quantization: A procrustean approach to learning binary codes**,” in 2011 IEEE Conference on Computer Vision and Pattern Recognition, Piscataway, NJ, USA, Jun. 2011, pp. 817–824.
[3] F. Shen, C. Shen, W. Liu, and H. Tao Shen, “**Supervised Discrete Hashing**,” in 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Piscataway, NJ, USA, Jun. 2015, pp. 37–45.

repository: wen-zhi/hashing

repo_name: wen-zhi/hashing


text:
---
name: Feature request
about: Suggest an idea for this plugin
title: ''
labels: enhancement
assignees: ''

---

### Description

Description of the new feature or enhancement you'd like to request.

## Current Behaviour

Description of the current behaviour of the plugin (if applicable).

## Proposed Behaviour

Description of the new behaviour you'd like to see implemented in the plugin.

## Use Case

Description of how this new feature or enhancement would be useful for you or other users of the plugin.

## Additional Information

Any additional details that may be relevant to the feature request. This could include related issues/PRs, examples of other plugins that have similar features, or screenshots/mockups of the proposed feature.

repository: WilliamIsted/craft-plural

repo_name: WilliamIsted/craft-plural


text:
# Cellphone robot ROS Package quick tutorial
## Structure of Package
![img](https://github.com/wang3303/ros_cellphonerobot/blob/master/ROS.png)
## Interaction with Android
![img](https://github.com/wang3303/ros_cellphonerobot/blob/master/android.png)

## Step 1: Install ROS
* Follow the [link](http://wiki.ros.org/ROS/Tutorials/InstallingandConfiguringROSEnvironment) and configure the ROS environment. For instance you can build the catkin works space in `~/catkin_ws`.
* Type the following line in your terminal.
```
$ cd ~/catkin_ws/src
$ git clone https://github.com/wang3303/ros_cellphonerobot.git
$ cd ~/catkin_ws
$ catkin_make
```
* Note: ROS_PACKAGE_PATH environment variable includes the directory you're in. You should see something similar as below in your terminal.
```
$ echo $ROS_PACKAGE_PATH
/home/youruser/catkin_ws/src:/opt/ros/kinetic/share
```
## Step 2: Run the robot system using the following line:

```
$ roslaunch ros_cellphonerobot robot.launch
```

This will bring all the nodes online.

## Step 3: Change profiles in rosparam and set up your robot

You can modify the profile for your robot in `/ros_cellphonerobot/rosparam/profile.yaml`. The explanation for this file could be found [here](https://github.com/wang3303/ros_cellphonerobot/wiki/Resume).

## Step 4: Action publishing

You can run the following line to publish keys to `/action` topic for debugging. For instance, `w` could stand for moving forward. `a` could stand for moving backward.
```
$ rosrun ros_cellphonerobot key_publisher.py
```

## Step 5 (Optional): Image classification
* Install [Tensorflow](https://github.com/samjabrahams/tensorflow-on-raspberry-pi)
* Uncomment the node `image_classify.py` in `ros_cellphonerobot/`.
You can publish images to topic `/inception`

+ *Important Note: `ros_inception.py` will download Neural Network weights and models the first time it runs. Hence, wait patiently until `ros_inception.py` successfully download necessary files. You can monitor downloading progress by output `ros_inception.py` to screen after modifying the launch file.*
```
<node pkg="ros_cellphonerobot" name="image_classify" type="image_classify.py" output="screen"/>
```
+ *Make sure you pass argument `--model_dir` and `--num_top_predictions` to this node as instructed [here](http://wiki.ros.org/roslaunch/XML/node)*.


text:
# Mozart Launcher

This directory contains the Launcher, a simple tool for launching an
application as the root view of a new view tree attached to the
frame buffer and input.

It's intended as scaffolding to test UI applications which implement
the ViewProvider interface while we build the higher level parts of
the system.

## USAGE

  mojo:launcher <app url>

repository: rzel/mozart

repo_name: rzel/mozart


text:
---
title: About the LLNL Software Portal
layout: info
permalink: /about/
---

## {{ page.title }}
{: .page-header .no_toc}

* Table of Contents
{:toc}

### Collaboration Fuels Our Culture

Welcome to the Lawrence Livermore National Laboratory (LLNL) software portal—a hub for open source software (OSS) produced at the Lab.

LLNL developers create and evolve software on a daily basis. Some of this software is used only internally; other components are licensed for use by external partners and collaborators; and still other software is released and actively developed out in the open on software-hosting platforms. This website is the gateway to all of it.

LLNL is a Department of Energy (DOE) institution, so we abide by the Federal Source Code Policy* that guides release of open source software (OSS). And not just because we have to but because we *want* to. Long before GitHub was founded, [we started releasing software](https://software.llnl.gov/visualize/) for public use and collaboration.

We often work with other national labs, universities, and industry partners. Working on these projects is a lot easier when we can share code directly. For example, building the next generation of supercomputers requires collaboration. The [Exascale Computing Project (ECP)](https://www.exascaleproject.org) uses OSS to develop the exascale ecosystem of apps, analytics, infrastructure, and so much more. The ECP is tackling a huge range of scientific areas, like precision medicine and nuclear physics. Future breakthroughs will likely owe some debt to the best practices and accelerated development made possible by OSS.

One of the great things about a large government organization is that we’re not motivated by profit. “The greater good” might sound like a cliché, but it’s true. LLNL’s national security mission governs our work, so our OSS portfolio of apps, libraries, compilers, and other tools support that mission. This includes everything from monitoring the performance of our supercomputers to making multiphysics codes run more smoothly.

Case in point: The DOE’s [Advanced Simulation and Computing (ASC) Program](https://asc.llnl.gov) leverages OSS to build, field, and integrate Linux clusters into production service at our [Livermore Computing supercomputing center](https://hpc.llnl.gov/). ASC is responsible for developing computer simulation capabilities that analyze and predict the performance, safety, and effectiveness of the nation’s nuclear stockpile. In other words, the stakes are high for ensuring our code is accurate. ASC leadership joined the DOE’s Office of Advanced Scientific Computing Research to establish a policy of using and distributing OSS to achieve the Program’s goals. With OSS, we can develop quickly and choose the best solutions.

This portal abounds with examples of projects that have found a home in the open source community. Access is key, which is why we jumped at the chance to index our software on [Code.gov](https://code.gov). You’ll find our work in the DOE [repo list](https://code.gov/#!/browse-projects?agencies=DOE), and we invite you to browse our projects on [GitHub](https://github.com/LLNL).

* The original policy memorandum is no longer available online. See [The People's Code blog post](https://www.cio.gov/2016/08/11/peoples-code.html) and [the archived policy on GitHub](https://github.com/WhiteHouse/source-code-policy).

### Learn More About OSS at LLNL

* This website's [News Archive](/news/archive/)
* 18F guest post: [The Case for Open Source Software](https://18f.gsa.gov/2018/07/12/the-case-for-open-source-software/)
* *Science & Technology Review* coverage
  * Cover story: [Ambassadors of Code](https://str.llnl.gov/2018-01/lee)
  * [Commentary by Bruce Hendrickson](https://str.llnl.gov/2018-01/comjan18), LLNL Computing associate director
  * Video (3:04): [Ambassadors of Code](https://youtu.be/nTxMn1NWHQU)
  * Highlight: [Visualization Software Stands the Test of Time](https://str.llnl.gov/2021-05/brugger)
* Code.gov blog post: [OSS Spotlight: Lawrence Livermore National Laboratory and ZFS on Linux](https://medium.com/codedotgov/oss-spotlight-lawrence-livermore-national-laboratory-and-zfs-on-linux-6596fca6e5f6)
* LLNL news: [Spack, A Lab-Developed ‘App Store for Supercomputers,’ becoming Standard-Bearer](https://www.llnl.gov/news/spack-lab-developed-app-store-supercomputers-becoming-standard-bearer)
* 2020 LLNL Computing Virtual Expo materials
  * Releasing Open Source Software at the Lab ([poster](https://computing.llnl.gov/sites/default/files/COMP_Poster_OSS.pdf))
  * Video: Open Source at LLNL (11:31) ([YouTube](https://youtu.be/kL4wIYhNVxE)) ([slides](https://computing.llnl.gov/sites/default/files/2020CompExpo_Open_Source.pdf))

### Other References

* [18F Handbook: GitHub](https://handbook.18f.gov/github/)
* [fisma-ready/github: Controls necessary for Federal use of GitHub](https://github.com/fisma-ready/github)
* [Guidance for Agency Use of Third-Party Websites and Applications](https://obamawhitehouse.archives.gov/sites/default/files/omb/assets/memoranda_2010/m10-23.pdf)
* [18F Blog: Facts about Publishing Open Source Code](https://18f.gsa.gov/2016/08/08/facts-about-publishing-open-source-code-in-government/)

### Contact

Check out our [FAQ](faq). If you have other questions or would like to request a private repository, please don't hesitate to contact [Ian<EMAIL_ADDRESS>or our [LLNL GitHub admins](mailto:github-admin@llnl.gov). You can also find us on our mailing list: [open-source@llnl.gov](mailto:open-source@llnl.gov).

  Follow @LLNL_OpenSource

branch_name: refs/heads/main

gha_language: JavaScript

gha_license_id: MIT


text:
OpenIGTLink Plugin {#org_custusx_core_openigtlink}
===================

\addindex network_data_transfer_widget
Data Transfer Widget {#org_custusx_core_openigtlink_datatransfer_widget}
===========================================================

Connect to a remote system using the OpenIGTLink protocol, and send/receive
volume and model data.

This widget is intended primarily for exchanging images and volumes, and has been
tested towards Slicer3D (<https://www.slicer.org>).
See <http://www.openigtlink.org> for details on the protocol.

Connection:
- Role: Choose client/server role in the connection, usually client.
- Address/Port: TCP/IP info.
- Connect to: The variant of the protocol to use. For Slicer3D, choose RAS.

Receive:
- Check to automatically accept incoming data into the Patient.

Send:
- Choose data to send to the remove side.

repository: leettran/CustusX

repo_name: leettran/CustusX


text:
---
title: Understanding VPC endpoints
date: "2020-08-20"
layout: post
path: "/understanding-vpc-endpoints/"
categories:
  - AWS
  - Terraform
  - VPC
  - Networking
related:
  - "/provisioning-an-application-load-balancer-with-terraform/"
  - "/provisioning-a-network-load-balancer-with-terraform/"
  - "/aws-iam-an-overview/"
draft: false
description: "Using VPC endpoints helps keeping your network traffic away from prying eyes. I'm showing you how to provision them using Terraform"
image: ./images/private_communication.png
---

If you are going to do one thing with your network traffic, it should be using https. But you already do that, don't you? Once you have that in place, why not use [VPC endpoints](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints.html) to make your data flow through private channels?

With VPC endpoints, you can connect to most AWS services without ever leaving Amazon's network. Not only that, but you can connect two of your services in different VPCs, even across accounts. It doesn't replace the need for [End-to-End Encryption](https://searchsecurity.techtarget.com/definition/end-to-end-encryption-E2EE), but it adds an extra layer of security. Maybe keeping the traffic private can help convince some cloud skeptics along the way.

You'll find many guides using the _AWS Management Console_. Don't do that. Let's use [Terraform](https://www.terraform.io/) to provision them instead. Code is easier to follow than screenshots.

## Accessing AWS services

A typical setup is having instances in a private subnet and go through a [NAT gateway](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html) to reach AWS services (i.e., S3).

We'll replace the NAT gateway with a VPC endpoint so that we can reach S3 (or any other AWS service) without connectivity to the outside. There are two types of endpoints, `Gateway` and `Interface`.

### [Gateway endpoint](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-gateway.html)

This type can be used for S3 and DynamoDB (don't ask me why). I'm assuming that there is an existing VPC.

```hcl
data "aws_route_table" "this" {
  vpc_id = var.vpc_id
}

resource "aws_vpc_endpoint" "s3" {
  vpc_id            = var.vpc_id
  vpc_endpoint_type = "Gateway"

  service_name      = "com.amazonaws.${var.region}.s3"

  route_table_ids = [data.aws_route_table.this.id]
}
```

There are a bunch of arguments that we can pass. Let's have a look at the ones that are relevant for us:

- `vpc_id`: We always associate an endpoint with a [VPC](https://aws.amazon.om/vpc/).
- `type`: In this case, `Gateway`.
- `service_name`: The URL associated with the service. I found [this list](https://docs.aws.amazon.com/general/latest/gr/aws-general.pdf#aws-service-information) as a reference.
- `route_table_ids`: For this type of endpoint, you have to specify a routing table, which will get an entry to route to the service. In our case, the routing table of the VPC.

And that's it. S3 is now accessible from our private subnet without needing a NAT gateway. This kind of endpoint is free, by the way. Useful if you need to pull Docker images, for instance.

### [Interface endpoint](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html)

For other AWS services, we use the `Interface` type. Let's take accessing CloudWatch as an example. We define our endpoint like this:

```hcl
data "aws_subnet_ids" "this" {
  vpc_id = var.vpc_id
  filter {
    name   = "tag:Name"
    values = var.subnet_names
  }
}

resource "aws_vpc_endpoint" "log" {
  vpc_id              = var.vpc_id
  vpc_endpoint_type   = "Interface"

  service_name        = "com.amazonaws.${var.region}.logs"

  subnet_ids = data.aws_subnet_ids.this.ids
  security_group_ids = [
    aws_security_group.this.id,
  ]
}
```

Both `vpc_id` and `service_name` work as before. `type` is `Interface` this time. Some new arguments are coming  to the party:

- `subnet_ids`: Instead of a route table, we need the subnets accessing the endpoint. These are the private subnets where we put our instances.
- `security_group_ids`: We need an existing security group as well. This security group must allow inbound traffic on port 443, as well as outbound traffic (in case you want to touch the defaults).

By default, we can reach the AWS service that we're connecting through its DNS hostname. It can be disabled with `private_dns_enabled`.

### Using policies to limit permissions

There is an extra argument, `policy`, where you can pass an IAM policy to restrict the permissions allowed by the endpoint. If you need a refresher on IAM, check [this article I wrote](../aws-iam-an-overview/).

## Accessing our own services

We have covered one aspect of endpoints, accessing AWS itself. But we can use it for our infrastructure as well. Consider this:

We have two services. Service A wants to reach Service B, which is exposed through an [ELB](https://aws.amazon.com/elasticloadbalancing/). Both services reside in different networks and might even be in different accounts.

One solution is to make the load balancer publicly reachable. Then, our Service A can use a NAT gateway, as I described before.

Or we can use endpoints again. To do so, we need a new toy, a [VPC endpoint service](https://docs.aws.amazon.com/vpc/latest/userguide/endpoint-service.html).

### Endpoint service

An endpoint service allows us to expose Service B. Once created, it gets assigned a `service_name`, that we can reference as an attribute.

```hcl
data "aws_subnet_ids" "this" {
  vpc_id = var.vpc_id
  filter {
    name   = "tag:Name"
    values = var.subnet_names
  }
}

resource "aws_lb" "this" {
  name               = "internal-lb"
  load_balancer_type = "network"
  subnets            = data.aws_subnet_ids.this.ids
  internal           = true
}

resource "aws_vpc_endpoint_service" "this" {
  network_load_balancer_arns = [aws_lb.this.arn]

  allowed_principals = var.vpce_allowed_principals
  acceptance_required = false
}
```

We configure it as follows:

- `network_load_balancer_arn`: The service has to be attached to an existing (internal) network load balancer. That load balancer determines the VPC and subnets.
- `allowed_principals`: The list of actors that can connect to the service, like a list of AWS Accounts.
- `acceptance_required`: You can force the connections to be manually accepted. For automation reasons, it's preferable to use `allowed_principals` to restrict access instead.

### Connecting to the endpoint Service

We use an _Interface endpoint_ to connect to the service that we just created:

```hcl
resource "aws_vpc_endpoint" "this" {
  vpc_id            = var.vpc_id
  vpc_endpoint_type = "Interface"
  service_name      = aws_vpc_endpoint_service.this.service_name

  subnet_ids         = var.subnet_ids
  security_group_ids = [aws_security_group.this.id]
}

output "dns_entry" {
  value = aws_vpc_endpoint.this.dns_entry[0].dns_name
}
```

The configuration is similar to what we did before. We get the `service_name` from the endpoint service directly.

And now, the connection between the two is complete. Our Service A can reach Service B through the endpoint. That endpoint exports a `dns_entry` attribute so that we know what to use as a URL.

### A note about availability zones

You need to remember one thing. A VPC endpoint can only connect to a VPC endpoint service in the same [Availability Zone](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-availability-zones). That's more relevant for a zone like `us-east-1`, which has six AZs.

For the names to be consistent across accounts, you need to identify them with [Availability Zone IDs](https://docs.aws.amazon.com/ram/latest/userguide/working-with-az-ids.html).

## The end(point) justifies the means

I wasn't a massive fan of endpoints when I started using them in my project, to be honest. But they have grown on me over time.

Don't use them to recreate an old-school on-premise setup. This idea of a huge private network where all the connections flow unimpeded doesn't need to be recreated in the cloud.


text:
# TopoJSON

The final TopoJSON file was generated by merging us-states.tsv with us-states.json:

    topojson -o us-states-output.json -e us-states.tsv -p -- us-states.json

See the official [TopoJSON wiki](https://github.com/mbostock/topojson/wiki/Command-Line-Reference) for more options.


text:
# angular-placeholder

HTML5 placeholder polyfill for AngularJS.

This angular directive allows for the use of HTML5 placeholder functionality
across all browsers, including legacy versions of Internet Explorer.

## Usage

Include the `angular-placeholder.min.js` file within your project (don't
forget to add the `ngPlaceholder` DI to your app) and use the directive like:

    <input type="text" ng-placeholder placeholder="This is placeholder text" />

This will ensure the `ng-placeholder` text value works across all browsers,
using the HTML5 functionality where possible. You may also use the following
format:

    <input type="text" ng-placeholder="This is placeholder text" />

## License

This code is licensed under MIT and can be used as required.

repository: jimmyhillis/angular-placeholder

repo_name: jimmyhillis/angular-placeholder


text:
# LoRNA_ER_stress
A LoRNA/LOPIT experiment to explore the relocalisation or RNA and protein in response to activation of the Unfolded Protein Response (UPR).

The analyses in this repository are contained in R markdown (Rmd) notebooks. These notebooks can be re-run in the order denoted by their prefixes and all experimental data required for the re-analysis is contained with the repository, with one noteable exception described below.

### Repository structure

The top level directories are:

* 1_external - Data from external sources including functional annotations and experimental results and, where required, Rmd notebooks to process the data for use in analysis notebooks
* 2_protein - Analysis of LOPIT data, including relocalisation upon UPR activation
* 3_rna - Analysis of LoRNA data, including relocalisation and modelling of features driving localisation/re-localisation
* 5_manuscript_figures - Figures generated within analysis notebooks for presentation in the manuscript (main and supplementary)
* 6_shiny_app - Generation of objects for shiny app. Note that this does not include the code for the deployment of the app itself
* 7_sup_tables - Generation of supplementary tables for the manuscript
* accessory - Additional files required for the analysis
* experimental_design - Further experimental details required for analysis

Within the directories, further README files describe the file structure. Notebook directories will always have numerical prefixes to indicate the order in which the notebooks were run.

⚠
The RNA (LoRNA) notebooks `3_rna/notebooks/2_lorna/1_data_processing/1_estimate_spike_in.Rmd` and `2_Make_MsnSets.Rmd` require access to the output of salmon from the RNA-Seq fastq data processing pipeline, and have hardcoded paths to the expected location of this output. As such, these cannot be run from the files in this repository alone. All LoRNA notebooks from `3_Normalise_by_abundance.Rmd` onwards and all other notebooks can be run from the data included in this repository alone, or data which can be obtained as described in READMEs.
⚠

## Dependencies
The notebooks in this repository were run with R 4.0.3 and Bioconductor 3.11. Using other versions of R may not be possible for some notebooks. For example, ENCODExplorer is used in some notebooks and is not available in Bioconductor 3.14.

This repository makes extensive use of non-base R packages. To run all notebooks, the following dependencies need to be installed.

** From CRAN **:
- broom
- cowplot
- dbscan
- ggalluvial
- ggbeeswarm
- ggplot2
- ggrepel
- ggridges
- ggtern
- glmnet
- gplots
- tidyverse
- naniar
- NNLM
- pbapply
- pbmcapply
- pROC
- RColorBrewer
- Rtsne
- writexl

** From Bioconductor **
- AnnotationHub
- biobroom
- biomaRt
- coRdon
- DEqMS
- ENCODExplorer
- ensembldb
- GenomicRanges
- GO.db
- goseq
- Gviz
- limma
- MSnbase
- pRoloc
- pRolocdata
- rtracklayer
- tximport
- UniProt.ws

** From Github ** (use e.g `devtools::install_github()`):
- bandle (ococrook/bandle) # Note now available through Bioconductor but not with R 4.0.3
- camprotR (CambridgeCentreForProteomics/camprotR)
- OptProc (TomSmithCGAT/OptProc)
- pRolocExt (TomSmithCGAT/pRolocExt)

gha_language: HTML


text:
# Payouts

Currently all tournaments with a buy-in pay out via the [BARGE Unified
Payout Schedule](../barge/payouts.html).  The size of the payout pool
is the sum of all of the buy-ins minus any amount reserved for bounties.
Currently, in rebuy and/or add-on tournaments, none of the rebuy or add-on
buy-in goes into the prize pool.


text:
### CONTRIBUTING

Thank you for your interesting in make this library better.

* If you find any bugs feel free to create a issue over here and i will try to solve this as soon as I can.

* If you want to fix something, you must make the following steps:

      	1. Fork this project
      	2. Install dependencies of the project

      			npm install

      	3.  Upload your fix in a new branch and create a pull request
      	5. I will review the code and if everything is fine I will merge your changes.

### Getting a fixer api key

1.  Create an account on [fixer.io](https://fixer.io)

### Generating a build

1.  Making a new build is easy thanks to the awesome vue-cli, just type in your terminal

        npm run lib

2.  I will generate the library in the dist folder

        dist/vueFixer[umd/common].js

### Contact

If you want to contact me feel free to send me a message in my<EMAIL_ADDRESS>or my [twitter account](https://twitter.comeperedo)

repository: eperedo/vue-fixer

repo_name: eperedo/vue-fixer


text:
[![Build Status](https://travis-ci.org/LocalGround/localground.svg?branch=master)](https://travis-ci.org/LocalGround/localground)
# About
Local Ground is a software platform for online mapping that allows you to create and share your own annotated online maps.  Using this tool, you can draw on existing maps, add pictures, audio, video and other data, and share with your friends, family and colleagues.  This tool is currently being developed by the Represent Research Group at the I School at the University of California, Berkeley.

  Of course you're welcome to take a look at it, but we're still working on implementing all of the core features needed for the beta release and fixing bugs: http://bugzilla.localground.org.  We're currently testing out functionality with some of our core users, and will continue to update this README file as the tool progresses.

# Installation
Please read the prerequisites / installation instructions here:  https://github.com/LocalGround/localground/wiki/Installation

# Acknowledgements / Inspiration
This tool draws from many good ideas, and we would like to especially thank Walking-Papers (http://walking-papers.org/) and Shreddr (https://twitter.com/shreddr_org).

#Contact Us
Please contact us at<EMAIL_ADDRESS>if you have any questions, or join our mailing list at<EMAIL_ADDRESS>

repository: LocalGround/localground

gha_license_id: NOASSERTION

repo_name: LocalGround/localground


text:
# rocambole-indent changelog

## v2.0.3 (2015-03-26)

 - fix comment alignment if surrounded by empty lines (#5)

## v2.0.2 (2015-03-25)

 - fix edge cases related to comments just after `{` followed by an empty line.

## v2.0.1 (2015-03-25)

 - safeguard against empty nodes/ast on `alignComments()`

## v2.0.0 (2015-03-25)

 - change `alignComments()` rule to add one indent level if comment is inside
   empty block/array/parenthesis

## v1.1.1 (2015-03-25)

 - fix `WhiteSpace` conversion into `Indent` inside `alignComments()`

## v1.1.0 (2015-03-25)

 - update `alignComments()` to consider `WhiteSpace` tokens at the begining of
   the line as `Indent` tokens as well
 - add `whiteSpaceToIndent()`

## v1.0.0 (2015-03-24)

 - add `alignComments()`
 - expose `updateBlockComment()`

## v0.2.0 (2015-03-20)

 - rename `line()` as `addLevel()`
 - change the way `inBetween()` loops through the `start` and `end` tokens
   (not inclusive)
 - `sanitize()` won't call `updateBlockComment()` since this is already handled
   by `addLevel()`

## v0.1.0 (2015-03-20)

 - initial release


text:
---
title: 'Computing Innovations Activity'
metaTitle: 'Computing Innovations Activity'
order: 1
---

## Activity

### A. Brainstorm

Brainstorm a list of at least 15 computing innovations that you or someone you know uses. Before you include it on your list, evaluate it in light of the following questions:

* Does it include a program as an integral part of its function? (It must to qualify as a computing innovation.)
* Is it easy to describe what the program of the innovation does? (If you have a hard time identifying the program in it, or you cannot easily describe what the program does, it might not be a computing innovation.)
* Is it easy to classify the computing innovation as "physical," "non-physical computing software," or "non-physical computing concept?" (If it does not fall into one of these categories, it might not be a computing innovation.)
* Is the computing innovation a reality or is it still theoretical? (Computing innovations that exist and are used by the public can be easier to understand and describe.)

Add your list of computing innovations here:

### B. Computing Innovation Examples

Use at least three examples of computing innovations from Section A and analyze each one for its beneficial and harmful impact.  Explain who the end users are, and how this computing innovation can potentially benefit and harm them. Also list any links to online references. (Three samples are provided)

#### Example 1

**Technology**: Video conferencing tools

**Purpose / Function**:
* Solves the problem of staying connected to people who are far away and/or allowing people to collaborate on projects even though they cannot be in the same office.
* Allows employees; students; families to connect with one another via video

**How is it beneficial**:
* Promotes collaboration among teams that cannot be in the same office
* Allows grandparents who may be far away from their families to connect with their grandchildren and extended families on a regular basis.

**How it can be harmful**:
* It can make it hard for employees or students to separate work from home life.
* It can create a situation where people are expected to be available all the time and rarely have down time or uninterrupted family time.

**Online References**:
* [Skype Helps Grandparents Stay Connected to Grandchildren](https://youtu.be/EEKu4Wmce0I)
* [Grandparents Visit Safely](https://www.nytimes.com/2020/03/20/parenting/grandparents-visit-safety-coronavirus.html)
* [Always on work culture: tech workers report feeling more burned out](https://www.msn.com/en-us/news/us/always-on-work-culture-tech-workers-report-feeling-more-burned-out-working-from-home/ar-BB1adTcC)

#### Example 2

**Technology**: Video games

**Purpose / Function**:
* Solves the problem of entertainment
* Allows adults; teenagers; young kids to pursue interests through creative expression

**How is it beneficial**:
* Studies have shown that games can help improve visual processes, attention, and executive functioning.
* They can also help people improve in job-related skills, especially those that require hand-eye coordination or a strong working memory.

**How it can be harmful**:
* Young kids who may not have good self-control /regulation can get addicted to video games.

**Online References**:
* [Cognitive Benefits of Video Games](https://www.psychologytoday.com/us/blog/freedom-learn/201502/cognitive-benefits-playing-video-games)
* [Video Game Related Health Problems](https://en.wikipedia.org/wiki/Video_game%E2%80%93related_health_problems)

#### Example 3

**Technology**: Attendance app

**Purpose / Function**:
* Solves the problem of keeping track of attendance at a school

**How is it beneficial**:
* Keeps track of attendance quickly so teachers and administrators
* Promote safety and record keeping for schools

**How it can be harmful**:
* Interrupts the workflow of a teacher's class, taking away from classroom instruction
* Report can be inaccurate if a teacher forgets to submit attendance, causing administrators unnecessary work

#### Student examples

**Technology**:

**Purpose / Function**:

**How is it beneficial**:

**How it can be harmful**:

**Online References**:

### C. Responsibility

In your opinion, do companies or individuals who create technology products, or computing innovations have any responsibility for how it is used? Please explain why you think so.

repository: ganicke/makecode-apcsp

repo_name: ganicke/makecode-apcsp


text:
---
title: How to check if user scrolls to the bottom of the page in JavaScript
tags:
    - JavaScript
    - ES6
    - one-line
    - js
    - DOM
layout: note
---

In this Article we will go through how to check if user scrolls to the bottom of the page only using single line of code in JavaScript.
This is a one-line JavaScript code snippet that uses one of the most popular ES6 features => `Arrow Function`.

Let's define this short function:

```js {.wrap}
const isAtBottom = () => document.documentElement.clientHeight + window.scrollY >= document.documentElement.scrollHeight;
```


text:
# Seq Forwarder [![Build status](https://ci.appveyor.com/api/projects/status/qdvdn50xqwi43jkm?svg=true)](https://ci.appveyor.com/project/datalust/seq-forwarder) [![Join the chat at https://gitter.im/datalust/seq](https://img.shields.io/gitter/room/datalust/seq.svg)](https://gitter.im/datalust/seq) [![Download](https://img.shields.io/github/release/datalust/seq-forwarder.svg)](https://github.com/datalust/seq-forwarder/releases)

Seq Forwarder is a client-side log collector that receives events over its local HTTP API and persists them to its own
internal storage until a remote Seq server can be reached.

![Seq Forwarder](https://raw.githubusercontent.com/nblumhardt/images/master/seq-forwarder-schematic.png)

Seq Forwarder listens on port `15341` by default. The HTTP ingestion API is identical to
the Seq one, so standard client libraries like _Serilog.Sinks.Seq_ can write to
it directly.

```csharp
Log.Logger = new LoggerConfiguration()
    .WriteTo.Seq("http://localhost:15341")
    .CreateLogger();

Log.Information("Hello, Seq Forwarder!");
```

Client applications can specify an API key when logging to Seq Forwarder. In this case the API key supplied by the client
will be forwarded along to the target Seq server.

Alternatively, Seq Forwarder can be configured with an API key, and will use this to log to Seq when client applications do not specify one.

## Getting started

First, download the release bundle for your platform, and extract it to a suitable location.

The instructions below use the `seqfwd` command-line. To learn about available commands, try `seqfwd help`.

### On Windows

To set up Seq Forwarder as a Windows service, from an administrative PowerShell prompt in the Seq Forwarder directory,
set the target Seq server URL and an optional API key:

```powershell
./seqfwd config -k output.serverUrl --value="http://seq.example.com/"
./seqfwd config -k output.apiKey --value="1a2b3c4d5e6f"
./seqfwd config -k storage.bufferSizeBytes -v<PHONE_NUMBER>
./seqfwd install
./seqfwd start
```

The default buffer size limit is 64 MB. In the example, this is increased to 1 GB.

To upgrade, stop the service, overwrite the forwarder release bundle, and restart the service.

On Windows, Seq Forwarder will used machine-scoped DPAPI to encrypt the default API key and any API keys supplied by
clients.

## On macOS or Linux

On Linux, you'll need `liblmdb`:

```
apt install liblmdb-dev
```

To run Seq Forwarder, configure the target Seq server URL, and optionally, an API key:

```shell
./seqfwd config -k output.serverUrl --value="http://seq.example.com/"
./seqfwd config -k output.apiKey --value="1a2b3c4d5e6f"
./seqfwd config -k storage.bufferSizeBytes -v<PHONE_NUMBER>
./seqfwd run
```

**Note** that on macOS and Linux, the output API key and any API keys provided by clients will be stored in plain text.

The default buffer size cap is 64 MB. In the example, this is increased to 1 GB.

## Development

Seq Forwarder is a .NET Core application that can be built using the .NET Core SDK on Windows, macOS, and Linux.

To debug, `F5` will work, but on Windows you will need to either run the `install` command (see below) to create an HTTP namespace
reservation, or run as Administrator.

## Troubleshooting

By default the "forwarder" logs will be stored under `%PROGRAMDATA%\Seq\Logs`.  If the destination Seq server is not
available, an exception will be stored in these log files.

If you need to inspect the current configuration, it can be found at: `%PROGRAMDATA%\Seq\Forwarder\SeqForwarder.json`

## Command line usage

```
> ./seqfwd help
Usage: seqfwd <command> [<args>]

Available commands are:
  bind-ssl   Bind an installed SSL certificate to an HTTPS port served by Seq
             Forwarder
  config     View and set fields in the SeqForwarder.json file; run with no
             arguments to list all fields
  dump       Print the complete log buffer contents as JSON
  help       Show information about available commands
  install    Install the Seq Forwarder as a Windows service
  restart    Restart the Windows service
  run        Run the server interactively
  start      Start the Windows service
  status     Show the status of the Seq Forwarder service
  stop       Stop the Windows service
  truncate   Clear the log buffer contents
  uninstall  Uninstall the Windows service
  version    Print the current executable version
```

Note that the Windows HTTP and service-related commands (`bind-ssl`, `install`, `restart`, `start`, `status`, `stop`,
and `uninstall`) are only available on that platform.

## _SeqForwarder.json_ configuration example

The `seqfwd config` command reads and writes _SeqForwarder.json_:

```json
{
  "diagnostics": {
    "internalLogPath": "C:\\ProgramData\\Seq\\Logs\\",
    "internalLoggingLevel": "Information"
  },
  "output": {
    "serverUrl": "http://localhost:5341",
    "eventBodyLimitBytes": 262144,
    "rawPayloadLimitBytes": 10485760,
    "apiKey": null
  },
  "storage": {
    "bufferSizeBytes": 67108864
  },
  "api": {
    "listenUri": "http://localhost:15341"
  }
}
```

On Windows, this file lives in `C:\ProgramData\Seq\Forwarder`.

repository: datalust/seq-forwarder

branch_name: refs/heads/dev

gha_language: C#

repo_name: datalust/seq-forwarder


text:
### Overview

The `geocode` package provides a facade to three freely-available but limited geocoding services:  US Census, Nominatim (Open Street Map), Google, and ArcGIS's GeocodeServer.

Each of these geocoding services is useful in its own right, but the goal of this package is to provide a seamless interface to all of them, and to use them in combination.  The Nominatim and Google services
have usage limits, but allow for richer and more varied queries than the US Census geocoder.  A common use case is to try the US Census geocoder first, and if it doesn't succeed, then try the others.  This
package implements this use case. It executes Census, Nominatim, and Google geocoders, in that order, by default. The user can specify the specific geocoders to try, and the order, as an optional
parameter to the `geocode` function.

This package does not attempt to prevent the user from exceeding the rate/usage limits for ArcGIS, [Google](https://developers.google.com/maps/documentation/geocoding/usage-limits) and
[Nominatim](https://operations.osmfoundation.org/policies/nominatim/).  The `geocodeNominatim()` function takes an optional parameter, `nominatimServiceURL`, that directs the client to an alternative
instance of Nominatim (e.g., one running locally or on a private network). Setting up Nominatim can be a bit of a chore, but I have made it a bit easier with [Docker](https://www.docker.com/)
[images](https://github.com/scottcame/docker/tree/master/nominatim).

### Installation

This package is not currently available on CRAN.  Install directly from github:

``` r
# install.packages("devtools")
devtools::install_github("scottcame/geocode")
```

### Usage

There are two usage modes available through the package:

* [Non-batch (address by address)](#non-batch-usage)
* [Census Batch](#census-batch-usage)

#### Non-Batch Usage

Default usage, attempts Census first, then Nominatim, then Google:

```
> library(geocode)
> stadiums <- c(safeco='1250 1st Avenue South, Seattle, WA 98134', progressive='2401 Ontario St, Cleveland, OH 44115', yankee='Yankee Stadium')
> geocode(stadiums)
# A tibble: 3 x 11
     Number     Street      City    State   Zip Latitude  Longitude                             InputAddress Approximate    Source SourceIndex
      <chr>      <chr>     <chr>    <chr> <chr>    <dbl>      <dbl>                                    <chr>       <lgl>     <chr>       <int>
1 1100-1298  1ST AVE S   SEATTLE       WA 98134 47.59090 -122.33419 1250 1st Avenue South, Seattle, WA 98134       FALSE    Census           1
2 2401-2599 ONTARIO ST CLEVELAND       OH 44115 41.49500  -81.68713     2401 Ontario St, Cleveland, OH 44115       FALSE    Census           2
3         1       <NA>       NYC New York 10451 40.82958  -73.92652                           Yankee Stadium       FALSE Nominatim           3
>
```

Or just go straight to Google:

```
> geocode(stadiums, geocoders='Google')
# A tibble: 3 x 11
  Number           Street      City State   Zip Latitude  Longitude Source Approximate                             InputAddress SourceIndex
   <chr>            <chr>     <chr> <chr> <chr>    <dbl>      <dbl>  <chr>       <lgl>                                    <chr>       <int>
1   1250 1st Avenue South   Seattle    WA 98134 47.59163 -122.33326 Google       FALSE 1250 1st Avenue South, Seattle, WA 98134           1
2   2401       Ontario St Cleveland    OH 44115 41.49570  -81.68527 Google       FALSE     2401 Ontario St, Cleveland, OH 44115           2
3      1       E 161st St     Bronx    NY 10451 40.82964  -73.92617 Google       FALSE                           Yankee Stadium           3
>
```

An unresolvable address:

```
> geocode('A non-existent address, Chicago, IL')
# A tibble: 0 x 0
>
```

Centroid of a jurisdiction (state, county, etc.):

```
> geocode('Kennebec County, ME')
# A tibble: 1 x 11
  Number Street  City State   Zip Latitude Longitude        InputAddress Approximate    Source SourceIndex
   <chr>  <chr> <chr> <chr> <chr>    <dbl>     <dbl>               <chr>       <lgl>     <chr>       <int>
1   <NA>   <NA>  <NA> Maine  <NA> 44.41846 -69.82507 Kennebec County, ME        TRUE Nominatim           1
>
```

Handling of nulls in input and invalid addresses (note `SourceIndex` column):

```
> geocode(c('1250 1st Avenue South, Seattle, WA 98134', NA_character_, 'A non-existent address, Chicago, IL', 'Yankee Stadium'))
# A tibble: 2 x 11
     Number    Street    City    State   Zip Latitude  Longitude                             InputAddress Approximate    Source SourceIndex
      <chr>     <chr>   <chr>    <chr> <chr>    <dbl>      <dbl>                                    <chr>       <lgl>     <chr>       <int>
1 1100-1298 1ST AVE S SEATTLE       WA 98134 47.59090 -122.33419 1250 1st Avenue South, Seattle, WA 98134       FALSE    Census           1
2         1      <NA>     NYC New York 10451 40.82958  -73.92652                           Yankee Stadium       FALSE Nominatim           4
>
```

Handling of duplicates in the input vector:

```
> geocode(rep('1250 1st Avenue South, Seattle, WA 98134', 2))
# A tibble: 2 x 11
     Number    Street    City State   Zip Latitude Longitude                             InputAddress Approximate Source SourceIndex
      <chr>     <chr>   <chr> <chr> <chr>    <dbl>     <dbl>                                    <chr>       <lgl>  <chr>       <int>
1 1100-1298 1ST AVE S SEATTLE    WA 98134  47.5909 -122.3342 1250 1st Avenue South, Seattle, WA 98134       FALSE Census           1
2 1100-1298 1ST AVE S SEATTLE    WA 98134  47.5909 -122.3342 1250 1st Avenue South, Seattle, WA 98134       FALSE Census           2
>
```
#### Census Batch Usage

The package provides an interface to the US Census Bureau's [batch geocoding service](https://geocoding.geo.census.gov/geocoder/locations/addressbatch?form).
It automatically partitions the input data into chunks of the appropriate size (currently 999 records) and submits them via HTTP POST.

Example:

```
> geocodeCensusBatch(
+     c('520 4th Ave E', '4550 Wyoga Lake Rd'),
+     c('Olympia', 'Cuyahoga Falls'),
+     c('WA', 'OH'),
+     c('98501', NA_character_))
Processing batch 1 of 1
Batch had 2 successful geocodes
# A tibble: 2 x 11
  SourceIndex                            InputAddress Match Status                                     Address  Longitude Latitude TIGERLineID  Side      Source Approximate
        <int>                                   <chr> <chr>  <chr>                                       <chr>      <dbl>    <dbl>       <int> <chr>       <chr>       <lgl>
1           2 4550 Wyoga Lake Rd, Cuyahoga Falls, OH, Match  Exact 4550 WYOGA LAKE RD, CUYAHOGA FLS, OH, 44224  -81.49443 41.19390    61393964     L CensusBatch       FALSE
2           1       520 4th Ave E, Olympia, WA, 98501 Match  Exact           520 4TH AVE E, OLYMPIA, WA, 98501 -122.89642 47.04527   180944221     L CensusBatch       FALSE
>
```

repository: cakmakaf/geocode

repo_name: cakmakaf/geocode


text:
## Description

The HTTP `304 Not Modified` client redirection response
code indicates that there is no need to retransmit the requested resources. It is an
implicit redirection to a cached resource. This happens when the request method is
a safe method, such as `GET` or `HEAD`,
or when the request is conditional and uses an `If-None-Match` or an
`If-Modified-Since` header.

The response must not contain a body and must include the headers that would
have been sent in an equivalent `200 OK` response:
`Cache-Control`, `Content-Location`, `Date`, `ETag`, `Expires`, and `Vary`.

Note: Many developer tools' network panels
of browsers create extraneous requests leading to 304 responses, so that
access to the local cache is visible to developers.

### See Also

- [Spec](https://httpwg.org/specs/rfc9110.html#status.304)
- [If-Modified-Since](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since), the header that triggers the `304 Not Modified` response
- [If-None-Match](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match), the header that triggers the `304 Not Modified` response
- [204 No Content](https://http.cat/status/204)

**Source:** [https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/304](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/304)

gha_language: TypeScript


text:
# Selectable Views ConstraintLayout

*[Selectable Views](../views-selectable) for ConstraintLayout.*

Supported platforms: **Android**.

## Usage

Just use `SelectableConstraintLayout` with the proper import instead of
`ConstraintLayout`, and change the `foregroundSelector` `Drawable` if the
default doesn't suit your needs.

## Download

```groovy
implementation("com.louiscad.splitties:splitties-views-selectable-constraintlayout:$splitties_version")
```

repository: swapnilkadlag/Splitties

repo_name: swapnilkadlag/Splitties


text:
# Cerebro-tldr

> Cerebro plugin for searching on [tldr-pages](https://github.com/tldr-pages/tldr)

![](demo.gif)

## Features

* Search on your local tldr-pages repo.
* Shortcuts for tldr-pages repo (local and GitHub), tldr-pages web client and more.
* It will only allow to search for pages / commands available on your OS.
* TLDR Pages are cached for 24h in cerebro

## Usage and Requirements

* This plugin requires you to have cloned [tldr-pages](https://github.com/tldr-pages/tldr) somewhere into your machine. (By default, this plugin will expect the tldr repo to be found on $HOME/tldr)
* The path for the cloned repo folder should be configured on Plugin settings before usage.
* By default, the plugin is expected the tldr-pages repo to live on $HOME/tldr.

**Note** The settings section is not tested and are broken on currently Cerebro release. If you want to use tldr from a different location than the default, you
can try running cerebro "master" branch. Sorry for the inconvinience.

## Supported Platforms

* This plugin was only tested on Linux but it should work fine in MacOS.
* It is not compatible on Windows, since tldr-pages dont have any Windows commands yet.

## Knwon issues

* Open the tldr repo folder locally is not working ATM.

## Future improvements

* Be able to update the tldr pages directly from cerebro.

## Related

* [Cerebro](http://github.com/KELiON/cerebro) – Plugin extracted from core Cerebro app;
* [cerebro-plugin](http://github.com/KELiON/cerebro-plugin) – boilerplate to create Cerebro plugins;
* [tldr](https://github.com/tldr-pages/tldr) - Simplified and community-driven man pages
* [tldr-alfred](https://github.com/cs1707/tldr-alfred) - tldr alfred workflow

## License

MIT © [Bruno Paz](http://brunopaz.net)


text:
# A deeper look into the code

This chapter details all specific stuff coded or configured in Woofer related to logging.

---

## Featured logging tools

Woofer uses the following libraries:

* [SLF4J](https://www.slf4j.org/) and [Logback](https://logback.qos.ch/) as the logging facade and implementation (the default with Spring Boot).
* [logstash-logback-encoder](https://github.com/logstash/logstash-logback-encoder), a great Logback add-on that enables
shipping logs directly to Logstash in JSON format over TCP or UDP.
* [Spring Cloud Sleuth](https://cloud.spring.io/spring-cloud-sleuth/) for distributed tracing & logs correlation.
* our [orange-mathoms-logging](https://github.com/Orange-OpenSource/orange-mathoms-logging) library that brings additional useful stuff.

---

## Distributed tracing & logs correlation

Especially in a microservices architecture, a request may go through several tiers (apache, j2ee server, bdd...) and it's not a trivial task to
understand and follow the callflow and spot the root cause of an error.

That's why it is so important to have a way of correlating logs produced from different tiers, but related to the same _treatment_.

This is demonstrated in our [Incident Analysis](incident-analysis) section.

Distributed tracing feature in Woofer is brought by [Spring Cloud Sleuth](https://cloud.spring.io/spring-cloud-sleuth/).

It only requires to be installed (follow quick start), and - _here we go_:

1. logs are automatically enriched with tracing context:
    * `X-B3-TraceId`: unique ID for an overall _treatment_ (across several services),
    * `X-B3-SpanId`: unique ID for a basic unit of work (one thread on one server),
    * `X-Span-Export`: whether or not the span is exported in the current span.
2. tracing context is automatically propagated upon calling other services (through standard HTTP headers).

---

## Enrich logs with user IDs

Logs from the `woofer-webfront` component are enriched with a `userId` field, that is the user's login.

This is done using the `PrincipalFilter` from the `orange-mathoms-logging` library ([see doc](https://github.com/Orange-OpenSource/orange-mathoms-logging#userIds)).

---

## Enrich logs with session IDs

Logs from the `woofer-webfront` component are enriched with a `sessionId` field, that is the current user's session ID.

This is done using the `SessionIdFilter` from the `orange-mathoms-logging` library ([see doc](https://github.com/Orange-OpenSource/orange-mathoms-logging#sessionIds)).

---

## Enrich stack traces with unique signatures

The idea is to generate a short, unique ID that identifies your stack trace.

It is an easy way to track the error from the client (UI and/or API) to your logs, count their frequency, make sure a problem has been fixed for good...

This is done using the `ShortenedThrowableConverter` & `StackHashJsonProvider` components from the `logstash-logback-encoder` library (available from version `4.11`) ([see doc](https://github.com/Orange-OpenSource/orange-mathoms-logging#stackTraceSign)).

---

## Error management

Error management in a web application is undoubtedly a complex task. It covers several topics:

error to http mapping

        How each Java error should be mapped to HTTP error? Which status code? Which (human readable) message?
        Generally speaking, you'll have to deal both with your own Java exceptions, and also errors from the underlying framework (Spring or else).

content negotiation

        When an error occurs, depending on the requesting client, you may have to render a human readable web page,
        a JSON response, an XML response or else.

integrate to your framework

        The way you will implement this logic will heavily depend on the framework you're using.

### Error handlers in Woofer

The *error handler* is a technical component linked to the underlying framework in charge of handling Java exceptions (intercept, turn it into a HTTP error, and display it to the client in an appropriate way).

In Woofer, error handling is implemented by:

* [AbstractGlobalErrorHandler](https://github.com/Orange-OpenSource/woofer/blob/master/woofer-commons/src/main/java/com/orange/oswe/demo/woofer/commons/error/AbstractGlobalErrorHandler.java): an abstract error handler that:
     * globally intercepts any unhandled [Spring MVC Exceptions](https://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.html#mvc-ann-rest-spring-mvc-exceptions),
     * exposes a global exception rendering endpoint,
     * that can be registered at the JEE container level and therefore is able to render non-Spring MVC errors (Spring Security or else),
     * maps any exception (Spring MVC or else) to:
        * an HTTP status,
        * an error code (based on [common Orange Partner error codes](https://developer.orange.com/apis/authentication-fr/api-reference#errors)),
        * a human-understandable error description.
* [RestErrorHandler](https://github.com/Orange-OpenSource/woofer/blob/master/woofer-commons/src/main/java/com/orange/oswe/demo/woofer/commons/error/RestErrorHandler.java): implementation that renders errors into JSON,
* [RestAndHtmlErrorHandler](https://github.com/Orange-OpenSource/woofer/blob/master/woofer-webfront/src/main/java/com/orange/oswe/demo/woofer/webfront/mvc/RestAndHtmlErrorHandler.java): an implementation that supports both JSON and html rendering (using content negotiation).

Both behave quite differently if the error is a **client** error or an **internal** (server) error.

A client error (HTTP `4XX`) is supposed to be due to a wrong usage of the API or application by the user. The error handler
simply displays some hints about the error (if you have started woofer locally, you may try this by navigating on this
[link with missing parameter](http://localhost:8080/misc/err/missingParam) of
[path that does not exist](http://localhost:8080/misc/err/noSuchUri)).

A server error (HTTP `5XX`) - on the contrary - is due to an internal issue (a bloody `NullPointerException` or any technical stuff going wrong in your code), and as such needs a specific treatment:

* **never display a cryptic error message or ugly stack strace** to the end user, but instead display a generic *"so sorry, we're working on it"* error message ;-)
* log the original Java error with full details to allow further analysis and maybe raise an alarm in production,
* be able to have error traceability (see below).

That's what [AbstractGlobalErrorHandler](https://github.com/Orange-OpenSource/woofer/blob/master/woofer-commons/src/main/java/com/orange/oswe/demo/woofer/commons/error/AbstractGlobalErrorHandler.java) does in case of internal errors:

1. generates a unique error ID,
2. adds this ID to the response headers (`X-Error-Uid`),
3. displays a generic error message, that includes this unique ID (ex: *Internal error [#d7506d00-99f2c6eb90682] occurred in request 'GET /misc/err/500'*),
4. logs the original Java error, with the unique error ID.

The unique error ID (displayed to the user) can then be used to retrieve the complete original stack trace, and start incident analysis: that's error traceability.

NOTE: Spring supports [lots of ways of managing exceptions](https://spring.io/blog/2013/11/01/exception-handling-in-spring-mvc)
(probably too many). I chose to implement it with:

* `@ControllerAdvice` + `@ExceptionHandler`: to globally intercept any unhandled Spring MVC exception,
* `ErrorController`: declares the component as the controller in charge of rendering any error at the JEE container level.

This is the design that suits the best my needs (render ALL errors, including non-Spring MVC, and manage content negotiation).

---

## Shipping logs directly to Logstash

Using the **logstash** [profile](http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-profiles.html),
logback is configured to ship directly application and access logs to [Logstash](https://www.elastic.co/products/logstash) over TCP,
using the amazing [logstash-logback-encoder](https://github.com/logstash/logstash-logback-encoder) library.

### Configuration for Java logs

Logback configuration for Java logs also uses `ShortenedThrowableConverter` & `StackHashJsonProvider` components
([see doc](https://github.com/Orange-OpenSource/orange-mathoms-logging#stackTraceSign))
to enrich stack traces with unique signatures.

```xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- application logging configuration to ship logs directly to Logstash -->
<configuration>
  <!-- define exclusion patterns as a property -->
  <property name="STE_EXCLUSIONS" value="\$\$FastClassByCGLIB\$\$,\$\$EnhancerBySpringCGLIB\$\$,^sun\.reflect\..*\.invoke,^com\.sun\.,^sun\.net\.,^net\.sf\.cglib\.proxy\.MethodProxy\.invoke,^org\.springframework\.cglib\.,^org\.springframework\.transaction\.,^org\.springframework\.validation\.,^org\.springframework\.app\.,^org\.springframework\.aop\.,^java\.lang\.reflect\.Method\.invoke,^org\.springframework\.ws\..*\.invoke,^org\.springframework\.ws\.transport\.,^org\.springframework\.ws\.soap\.saaj\.SaajSoapMessage\.,^org\.springframework\.ws\.client\.core\.WebServiceTemplate\.,^org\.springframework\.web\.filter\.,^org\.springframework\.boot\.web\.filter\.,^org\.springframework\.util\.ReflectionUtils\.invokeMethod$,^org\.apache\.tomcat\.,^org\.apache\.catalina\.,^org\.apache\.coyote\.,^java\.util\.concurrent\.ThreadPoolExecutor\.runWorker,^java\.lang\.Thread\.run$,^rx\."/>

  <appender name="TCP" class="net.logstash.logback.appender.LogstashTcpSocketAppender">
    <!-- remote Logstash server -->
    <remoteHost>${LOGSTASH_HOST}</remoteHost>
    <port>${LOGSTASH_PORT}</port>
    <encoder class="net.logstash.logback.encoder.LogstashEncoder">
      <!-- computes and adds a 'stack_hash' field on errors -->
      <provider class="net.logstash.logback.composite.loggingevent.StackHashJsonProvider">
        <exclusions>${STE_EXCLUSIONS}</exclusions>
      </provider>
      <!-- enriches the stack trace with unique hash -->
      <throwableConverter class="net.logstash.logback.stacktrace.ShortenedThrowableConverter">
        <inlineHash>true</inlineHash>
        <exclusions>${STE_EXCLUSIONS}</exclusions>
      </throwableConverter>
      <customFields>{"@project":"${MD_PROJECT:--}","@app":"webfront","@type":"java"}</customFields>
    </encoder>
  </appender>

  <logger name="com.orange" level="DEBUG" />

  <root level="INFO">
    <appender-ref ref="TCP" />
  </root>
</configuration>
```

NOTE: The [Logstash](https://www.elastic.co/products/logstash) server address is configured with non-standard Spring configuration `custom.logging.collector.host` and `custom.logging.collector.port`.

With this configuration, a single Java log in Elasticsearch will look like this:

```json
{
  "@version": 1,
  "@timestamp": "2017-03-17T14:21:25.643Z",
  "host": "<IP_ADDRESS>",
  "port": 46070,
  "HOSTNAME": "oswewooffront",
  "@app": "woofer-webfront",
  "@type": "java",
  "logger_name": "com.orange.oswe.demo.woofer.commons.error.RestErrorController",
  "level": "ERROR",
  "level_value": 40000,
  "message": "Internal error [#fe8ad9ce-317d85359a8531] occurred in request 'POST /woofs'",
  "thread_name": "http-nio-8080-exec-6",
  "stack_trace": "#fe8ad9ce> com.netflix.hystrix.exception.HystrixRuntimeException: ...",
  "stack_hash": "fe8ad9ce",
  "userId": "bpitt",
  "sessionId": "B3FD051F22C031B5A813B29D32EFF383",
  "X-B3-TraceId": "8210b57467b85195",
  "X-B3-SpanId": "8210b57467b85195",
  "X-Span-Export": "false"
}
```

| Field | Description
| ----- | -----------
|`@version`|standard Elasticsearch field set by Logstash
|`@timestamp`|standard Elasticsearch field set by Logback
|`host`|set by Logstash
|`port`|set by Logstash
|`HOSTNAME`|set by Logback
|`@app`|custom field set by configuration (the name of the origin microservice)
|`@type`|custom field set by configuration (type of the log)
|`logger_name`|set by Logback
|`level`|set by Logback
|`level_value`|set by Logback
|`message`|set by Logback
|`thread_name`|set by Logback
|`stack_trace`|set by Logback, content valuated by the `ShortenedThrowableConverter` component
|`stack_hash`|custom field set by the `StackHashJsonProvider` component
|`userId`|custom MDC field set by the `PrincipalFilter` component
|`sessionId`|custom MDC field set by the `SessionIdFilter` component
|`X-B3-TraceId`|MDC field set by Spring Cloud Sleuth for logs correlation
|`X-B3-SpanId`|MDC field set by Spring Cloud Sleuth for logs correlation
|`X-Span-Export`|MDC field set by Spring Cloud Sleuth for logs correlation

### Configuration for access logs (embedded tomcat)

Generally speaking, Logback integration to Spring Boot is quite seamless with respect to Java logs, but it is
far from the case with embedded Tomcat access logs. Spring Boot will probably improve on this aspect in the future.

In Woofer, access logs are configured by the
[TomcatCustomizerForLogback](https://github.com/Orange-OpenSource/woofer/blob/master/woofer-commons/src/main/java/com/orange/oswe/demo/woofer/commons/tomcat/TomcatCustomizerForLogback.java)
class by adding the [LogbackValve](http://logback.qos.ch/apidocs/ch/qos/logback/access/tomcat/LogbackValve.html) to Tomcat's context.

Here is the logback xml configuration for access log using the **logstash**
[profile](http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-profiles.html):

```xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- access log configuration to ship logs directly to Logstash -->
<configuration>
  <statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener" />

  <!-- TCP -->
  <appender name="TCP" class="net.logstash.logback.appender.LogstashAccessTcpSocketAppender">
    <!-- remote Logstash server -->
    <remoteHost>${LOGSTASH_HOST}</remoteHost>
    <port>${LOGSTASH_PORT}</port>
    <encoder class="net.logstash.logback.encoder.AccessEventCompositeJsonEncoder">
      <providers>
        <timestamp/>
        <version/>
        <pattern>
          <pattern>
            {
              "@project":"${MD_PROJECT:--}",
              "@app":"webfront",
              "@type":"http",
              "X-B3-TraceId":"%header{X-B3-TraceId}",
              "req": {
                "host": "%clientHost",
                "url": "%requestURL",
                "meth": "%requestMethod",
                "uri": "%requestURI"
              },
              "resp": {
                "status": "#asLong{%statusCode}",
                "size": "#asLong{%bytesSent}"
              },
              "elapsed": "#asLong{%elapsedTime}"
              }
          </pattern>
        </pattern>
      </providers>
    </encoder>
  </appender>

  <appender-ref ref="TCP" />
</configuration>
```

NOTE: You can see that this configuration allows us to control exactly the JSON structure of an access log sent to [Elasticsearch](https://www.elastic.co/products/elasticsearch) via [Logstash](https://www.elastic.co/products/logstash).

Notice that the access logs also use the same custom fields as Java logs (`@app`, `@type`, `@project`, with `@type` equals to `http`).

For more info about Logback & access logs, have a look at:

* [Logback access](http://logback.qos.ch/access.html)
* Logback [PatternLayout](http://logback.qos.ch/xref/ch/qos/logback/access/PatternLayout.html)
* logstash-logback-encoder [AccessEvent patterns](https://github.com/logstash/logstash-logback-encoder#accessevent-patterns)

### Logstash configuration

In order to be able to send directly logs in JSON format to Logstash, you will simply have to setup a Logstash `tcp`
input with `json` codec as follows:

```yaml
input {
  tcp {
    port => 4321
    codec => json
  }
}
```

repository: andyglick/woofer

repo_name: andyglick/woofer


text:
---
layout: post
title:  "Re→Coding"
date:   2021-01-20 18:00:00 +0100
categories: startup entrepreneurship education prototyping
permalink: /recoding
---

Recoding was a startup I've created with my good friend Gui Lozano.
The idea was to teach basic programming skills to the non-technical people in the IT world (get it? RE(_cruiters_) → CODING).
Our main target audience were the recruiters, but we also aimed for testers and project managers.

We partenered with a local company that would allow us to use their office in weekends, when we ran free coding bootcamps for recruiters. We ran four different bootcamps that took place on Saturdays and Sundays, 4 hours per day with a 10 minute break. During that time we hosted hundreds of people from 5 countries. Most sessios were overbooked. We set up a great website with resources and ways to contact/hire us, and a created a slack community. This was our schedule:

I still really like our pitch:

> We are not a standard coding bootcamp. This program is designed by IT recruiters and software developers for IT recruiters and sourcers.
>
> We understand the demands and expectations of hiring managers and candidates, the frustration of not fully understanding a badly written job description full of tech acronyms (thus not being able to re-write it properly) and, well, the reputation that IT recruiters got over the past years.
>
> __We want to change that.__

After collecting hundreds of survey responses, we used the numbers to try to sell our potential customers on offering the bootcamp for their employees. Our numbers were really fantastic:

And we got many testimonials from the people that joined our free sessions:

```
"Really good atmosphere, i liked it a lot"
"I liked the information about technologies, practical part (i could feel like IT girl :D) and overall atmosphere. They were very helpful and patien"
"I liked the most the practical part (coding exercices)"
"Good balance on theory and practice, interesting deliver"
"I really enjoyed my time here and thank you very much for that. I gained the knowledge which I always wanted but I didn't have proper source. Idea of this workshop is great and I'm sure you gonna rock the market :)"
"You guys are doing great :)"
"Everything was just great, nothing else to add:) Thank you!"
"Thanks a lot. It is great initiative"
"Thank you very much for this workshop, I find it very interesting and useful."
"Thank you very much! :) You have great teaching skills ;) you were very positive and patient"
"I've had a really great time, learned a lot and feel like I understand more front-end tools"
```

I think we managed to create a great balance between a relaxed atmosphere, a learning environment, and a space for people to exchange ideas. I'm really proud of us.

To end on a good note, I would like to make the learning materials available for download, in case anyone is interested.

- Presentation
- Exercises

### Why didn't it work out?

I think we failed to put in the effort to sell the idea properly. Or, like Gui put it:

> I could give many reasons why we decided to stop - but the biggest one probably is because we just weren't ready for it.

One of the lessons learned for me was to not balance many things at once, but instead focus on one thing and give it your 100%.

extension: markdown

gha_language: Shell


text:
# Gallery

## Core Features

* An admin can upload new photos through an admin panel
* An admin can update a photos details
* A user can copy an image's link
* A user can view images by category and location
* A user can view a photo's details
* Search for different categories of photos

## Prerequisites

* Python3
* Django

## Getting Started

First clone the repository from Github and switch to the new directory:

    $ git clone<EMAIL_ADDRESS>USERNAME }}/{{ project_name }}.git
    $ cd {{ project_name }}

## Usage
Activate the virtualenv for your project.

Install project dependencies:

    $ pip install -r requirements.txt

## Environment variables

The `ENVIRONMENT` variable loads the correct settings.

```
CLOUD_NAME=''
API_KEY=''
API_SECRET=''
SECRET_KEY=''
DEBUG=boolean
DB_NAME=''
DB_USER=''
DB_PASSWORD=''
DB_HOST=''
MODE=''
ALLOWED_HOSTS=''
DISABLE_COLLECTSTATIC=''
```

Then simply apply the migrations:

    $ python manage.py migrate

You can now run the development server:

    $ python manage.py runserver

## License

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

Copyright (c) 2020 Pretorious Ndung'u

repository: n-pretorious/week-eight-core-ip

repo_name: n-pretorious/week-eight-core-ip


text:
---
layout: post
image: img/writing.jpg
author: [Helmut]
tags:
  - Migration
exc: Work In Progress Migration
title: "Installing vim with ruby support (+ruby) - Stack Overflow"
date: "2012-01-03"
categories:
  - "as-burst"
---

> on mac os x, assuming you have Homebrew installed:
>
> brew install https://raw.github.com/adamv/homebrew-alt/master/duplicates/vim.rb
>
> This version of vim has ruby support enabled
>
> Source: [http://blog.jerodsanto.net/2011/08/brew-install-vim/](http://blog.jerodsanto.net/2011/08/brew-install-vim/)

via [stackoverflow.com](http://stackoverflow.com/questions/3794895/installing-vim-with-ruby-support-ruby)

Even faster installation if you have Homebrew available on MAC OS X.

repository: helmutgranda/nextjs-helmutgranda

repo_name: helmutgranda/nextjs-helmutgranda


text:
---
layout:     post
title:      "Redis08 rax"
subtitle:   "rax"
date:       2019-11-26 21:00:00
author:     "zhouhd"
header-img: "img/about-bg.jpg"
catalog: true
tags:
    - DataBase
    - Redis
---

rax是radix tree的缩写，基数树或者压缩前缀树。和前缀树trie相比，多了一种压缩节点的情况，此时只有一个子节点，不过可以存储超过1个字符。不过插入删除时就涉及拆分合并节点。下面贴一个rax的示意图。

```c++
/*
 *                    (f) ""
 *                    /
 *                 (i o) "f"
 *                 /   \
 *      "fi"  ("rst")  (o) "fo"
 *              /        \
 *    "first" []       [t   b] "foo"
 *                     /     \
 *           "foot" ("er")    ("ar") "foob"
 *                    /          \
 *          "footer" []          [] "foobar"
 *
 */
```

raxNode要记录本节点有没有key，是不是压缩节点之类的信息。如果本节点是key，iskey=1。如果key还有对应的value，isnull=0。如果是压缩节点，那就只有1个子节点，iscompr=1，size是存储的字符串长度。如果不是压缩节点，size是子节点个数。

另外还有一个值得注意的地方，就是raxNode->data里面存了子节点的指针，由于这些指针是自己手动存进去而不是malloc的源地址，所以需要对齐，否则使用指针访问值的时候会非常缓慢甚至某些平台上会崩溃。

rax本身就很简单了，主要是存了根节点。

```c++
typedef struct raxNode {
    uint32_t iskey:1;     /* Does this node contain a key? */
    uint32_t isnull:1;    /* Associated value is NULL (don't store it). */
    uint32_t iscompr:1;   /* Node is compressed. */
    uint32_t size:29;     /* Number of children, or compressed string len. */
    /* Data layout is as follows:
     *
     * If node is not compressed we have 'size' bytes, one for each children
     * character, and 'size' raxNode pointers, point to each child node.
     * Note how the character is not stored in the children but in the
     * edge of the parents:
     *
     * [header iscompr=0][abc][a-ptr][b-ptr][c-ptr](value-ptr?)  // **没有压缩的情况**
     *
     * if node is compressed (iscompr bit is 1) the node has 1 children.
     * In that case the 'size' bytes of the string stored immediately at
     * the start of the data section, represent a sequence of successive
     * nodes linked one after the other, for which only the last one in
     * the sequence is actually represented as a node, and pointed to by
     * the current compressed node.
     *
     * [header iscompr=1][xyz][z-ptr](value-ptr?)  // **压缩，只有一个子节点**
     *
     * Both compressed and not compressed nodes can represent a key
     * with associated data in the radix tree at any level (not just terminal
     * nodes).
     *
     * If the node has an associated key (iskey=1) and is not NULL
     * (isnull=0), then after the raxNode pointers poiting to the
     * children, an additional value pointer is present (as you can see
     * in the representation above as "value-ptr" field).
     */
    unsigned char data[];
} raxNode;

/* Return the padding needed in the characters section of a node having size
 * 'nodesize'. The padding is needed to store the child pointers to aligned
 * addresses. Note that we add 4 to the node size because the node has a four
 * bytes header. */
#define raxPadding(nodesize) ((sizeof(void*)-((nodesize+4) % sizeof(void*))) & (sizeof(void*)-1))

typedef struct rax {
    raxNode *head;
    uint64_t numele;
    uint64_t numnodes;
} rax;
```

作为树的节点，raxNode没有到父节点的指针，这个主要是减少存储所需空间。如果需要寻找从根节点到某个节点的路径，就需要遍历，用栈去存储所需信息。raxStack有固定大小的指针数组空间，如果不够，就需要另外在堆上分配。

```c++
/* Stack data structure used by raxLowWalk() in order to, optionally, return
 * a list of parent nodes to the caller. The nodes do not have a "parent"
 * field for space concerns, so we use the auxiliary stack when needed. */
#define RAX_STACK_STATIC_ITEMS 32
typedef struct raxStack {
    void **stack; /* Points to static_items or an heap allocated array. */
    size_t items, maxitems; /* Number of items contained and total space. */
    /* Up to RAXSTACK_STACK_ITEMS items we avoid to allocate on the heap
     * and use this static array of pointers instead. */
    void *static_items[RAX_STACK_STATIC_ITEMS];
    int oom; /* True if pushing into this stack failed for OOM at some point. */
} raxStack;

typedef int (*raxNodeCallback)(raxNode **noderef);

/* Radix tree iterator state is encapsulated into this data structure. */
#define RAX_ITER_STATIC_LEN 128
#define RAX_ITER_JUST_SEEKED (1<<0) /* Iterator was just seeked. Return current
                                       element for the first iteration and
                                       clear the flag. */
#define RAX_ITER_EOF (1<<1)    /* End of iteration reached. */
#define RAX_ITER_SAFE (1<<2)   /* Safe iterator, allows operations while
                                  iterating. But it is slower. */
typedef struct raxIterator {
    int flags;
    rax *rt;                /* Radix tree we are iterating. */
    unsigned char *key;     /* The current string. */
    void *data;             /* Data associated to this key. */
    size_t key_len;         /* Current key length. */
    size_t key_max;         /* Max key len the current key buffer can hold. */
    unsigned char key_static_string[RAX_ITER_STATIC_LEN];
    raxNode *node;          /* Current node. Only for unsafe iteration. */
    raxStack stack;         /* Stack used for unsafe iteration. */
    raxNodeCallback node_cb; /* Optional node callback. Normally set to NULL. */
} raxIterator;
```

先看一下增加一个子节点的操作。其实代码不是很多，注释很详细。

```c++
/* Add a new child to the node 'n' representing the character 'c' and return
 * its new pointer, as well as the child pointer by reference. Additionally
 * '***parentlink' is populated with the raxNode pointer-to-pointer of where
 * the new child was stored, which is useful for the caller to replace the
 * child pointer if it gets reallocated.
 *
 * On success the new parent node pointer is returned (it may change because
 * of the realloc, so the caller should discard 'n' and use the new value).
 * On out of memory NULL is returned, and the old node is still valid. */
raxNode *raxAddChild(raxNode *n, unsigned char c, raxNode **childptr, raxNode ***parentlink) {
    assert(n->iscompr == 0);

    size_t curlen = raxNodeCurrentLength(n);
    n->size++;
    size_t newlen = raxNodeCurrentLength(n);
    n->size--; /* For now restore the orignal size. We'll update it only on
                  success at the end. */

    /* Alloc the new child we will link to 'n'. */
    raxNode *child = raxNewNode(0,0);
    if (child == NULL) return NULL;

    /* Make space in the original node. */
    raxNode *newn = rax_realloc(n,newlen);
    if (newn == NULL) {
        rax_free(child);
        return NULL;
    }
    n = newn;

    /* After the reallocation, we have up to 8/16 (depending on the system
     * pointer size, and the required node padding) bytes at the end, that is,
     * the additional char in the 'data' section, plus one pointer to the new
     * child, plus the padding needed in order to store addresses into aligned
     * locations.
     *
     * So if we start with the following node, having "abde" edges.
     *
     * Note:
     * - We assume 4 bytes pointer for simplicity.
     * - Each space below corresponds to one byte
     *
     * [HDR*][abde][Aptr][Bptr][Dptr][Eptr]|AUXP|
     *
     * After the reallocation we need: 1 byte for the new edge character
     * plus 4 bytes for a new child pointer (assuming 32 bit machine).
     * However after adding 1 byte to the edge char, the header + the edge
     * characters are no longer aligned, so we also need 3 bytes of padding.
     * In total the reallocation will add 1+4+3 bytes = 8 bytes:
     *
     * (Blank bytes are represented by ".")
     *
     * [HDR*][abde][Aptr][Bptr][Dptr][Eptr]|AUXP|[....][....]
     *
     * Let's find where to insert the new child in order to make sure
     * it is inserted in-place lexicographically. Assuming we are adding
     * a child "c" in our case pos will be = 2 after the end of the following
     * loop. */
    int pos;
    for (pos = 0; pos < n->size; pos++) {
        if (n->data[pos] > c) break;
    }

    /* Now, if present, move auxiliary data pointer at the end
     * so that we can mess with the other data without overwriting it.
     * We will obtain something like that:
     *
     * [HDR*][abde][Aptr][Bptr][Dptr][Eptr][....][....]|AUXP|
     */
    unsigned char *src, *dst;
    if (n->iskey && !n->isnull) {
        src = ((unsigned char*)n+curlen-sizeof(void*));
        dst = ((unsigned char*)n+newlen-sizeof(void*));
        memmove(dst,src,sizeof(void*));
    }

    /* Compute the "shift", that is, how many bytes we need to move the
     * pointers section forward because of the addition of the new child
     * byte in the string section. Note that if we had no padding, that
     * would be always "1", since we are adding a single byte in the string
     * section of the node (where now there is "abde" basically).
     *
     * However we have padding, so it could be zero, or up to 8.
     *
     * Another way to think at the shift is, how many bytes we need to
     * move child pointers forward *other than* the obvious sizeof(void*)
     * needed for the additional pointer itself. */
    size_t shift = newlen - curlen - sizeof(void*);

    /* We said we are adding a node with edge 'c'. The insertion
     * point is between 'b' and 'd', so the 'pos' variable value is
     * the index of the first child pointer that we need to move forward
     * to make space for our new pointer.
     *
     * To start, move all the child pointers after the insertion point
     * of shift+sizeof(pointer) bytes on the right, to obtain:
     *
     * [HDR*][abde][Aptr][Bptr][....][....][Dptr][Eptr]|AUXP|
     */
    src = n->data+n->size+
          raxPadding(n->size)+
          sizeof(raxNode*)*pos;
    memmove(src+shift+sizeof(raxNode*),src,sizeof(raxNode*)*(n->size-pos));

    /* Move the pointers to the left of the insertion position as well. Often
     * we don't need to do anything if there was already some padding to use. In
     * that case the final destination of the pointers will be the same, however
     * in our example there was no pre-existing padding, so we added one byte
     * plus thre bytes of padding. After the next memmove() things will look
     * like thata:
     *
     * [HDR*][abde][....][Aptr][Bptr][....][Dptr][Eptr]|AUXP|
     */
    if (shift) {
        src = (unsigned char*) raxNodeFirstChildPtr(n);
        memmove(src+shift,src,sizeof(raxNode*)*pos);
    }

    /* Now make the space for the additional char in the data section,
     * but also move the pointers before the insertion point to the right
     * by shift bytes, in order to obtain the following:
     *
     * [HDR*][ab.d][e...][Aptr][Bptr][....][Dptr][Eptr]|AUXP|
     */
    src = n->data+pos;
    memmove(src+1,src,n->size-pos);

    /* We can now set the character and its child node pointer to get:
     *
     * [HDR*][abcd][e...][Aptr][Bptr][....][Dptr][Eptr]|AUXP|
     * [HDR*][abcd][e...][Aptr][Bptr][Cptr][Dptr][Eptr]|AUXP|
     */
    n->data[pos] = c;
    n->size++;
    src = (unsigned char*) raxNodeFirstChildPtr(n);
    raxNode **childfield = (raxNode**)(src+sizeof(raxNode*)*pos);
    memcpy(childfield,&child,sizeof(child));
    *childptr = child;  // childptr是新加节点的指针值
    *parentlink = childfield;  // parentlink是新加节点的地址
    return n;
}
```

上面的添加子节点基本用到了rax和raxNode所有相关概念。后面其它的接口差不多，根据不同需求操作不同数据而已。

raxLowWalk用来查找给定字符串，找不到的时候还会返回中断的地方，所以可以用来寻找新子节点该插入的地方。

raxGenericInsert是通用的插入方法，用到了raxLowWalk来寻找插入的地方，注意有一种情况，就是要插入的字符串已经在rax，但没有对应value，这个时候要设置一下value。插入还有些非常麻烦的情况，就是遇到要拆分和解压节点。

raxRemoveChild是基本的移除子节点的接口。对于压缩节点，它只有一个子节点，直接对比一下，删除。其它情况下需要先查找子节点。raxRemove删除指定字符串的节点，值得注意的细节是正常删除完毕，如果只剩下1个子节点并且本节点不是key，就尝试压缩本节点。


text:
# TestServer

This test server is used internally by Playwright to test Playwright itself.

### Example

```js
const {TestServer} = require('.');

(async () => {
  const httpServer = await TestServer.create(__dirname, 8000);
  const httpsServer = await TestServer.createHTTPS(__dirname, 8001);
  httpServer.setRoute('/hello', (req, res) => {
    res.end('Hello, world!');
  });
  console.log('HTTP and HTTPS servers are running!');
})();
```

repository: aslushnikov/playwright

repo_name: aslushnikov/playwright


text:
---
template: SinglePost
title: " Pedestrian deaths rise more than 50% in US"
status: Published
date: 2020-02-28
featuredImage: /images/animals.jpg
excerpt: Pedestrian fatalities on U.S. roads have increased by more than 50%
  over the past decade, while deaths of people riding in cars, trucks and other
  vehicles remained essentially unchanged, according to an analysis of federal
  and state data released Thursday.
categories:
  - category: Safety
meta:
  title: " Pedestrian deaths rise more than 50% in US"
  description: Pedestrian fatalities on U.S. roads have increased by more than 50%
    over the past decade, while deaths of people riding in cars, trucks and
    other vehicles remained essentially unchanged, according to an analysis of
    federal and state data released Thursday.
---
<!--StartFragment-->

Pedestrian fatalities on U.S. roads have increased by more than 50% over the past decade, while [deaths of people riding in cars](/practice-areas/wrongful-death-attorney/), trucks and other vehicles remained essentially unchanged, according to an analysis of federal and state data released Thursday.

The analysis from the Governors Highway Safety Association estimated that [pedestrian deaths](/practice-areas/pedestrian-accident-lawyers/) totaled 6,590 in 2019, an increase of 5% over 2018.

It’s the highest number in more than three decades, the report said, and underscores a historic reversal that has deeply disturbed safety experts.

“Pedestrian deaths were declining for 30 years and then in 2009, a complete reversal of progress became evident,” said Richard Retting, director of safety and research for Sam Schwartz Engineering, who wrote the report for the group, which represents state safety officials.

The report pointed to a host of long-established and other likely contributors to the grim tally, which has seen the number of pedestrian deaths in the United States rise from a rate of 1.3 per 100,000 population in 2009 to an estimated rate of 2.0 in 2019.

Among them: Cellphone use has soared, [distracting drivers](/practice-areas/distracted-driver/); Americans have moved toward heavier, less forgiving SUVs; [drivers are too often drunk](/practice-areas/drunk-driving-accident-lawyer/) and pedestrians are too often intoxicated as well; many roads were designed with cars, not people, in mind; and walking in the dark has become increasingly deadly, according to the report.

“Increases in pedestrian fatalities are occurring largely at night,” the report said, noting that nighttime deaths shot up.

Deaths occurring during the day were up 16% in that period.

Now, about three-quarters of all pedestrian deaths happen when it’s dark out.

That trend “suggests a need to prioritize engineering and enforcement countermeasures,” the report said, including better street lighting and more nighttime patrols.

Most pedestrians were killed away from intersections, the report notes, adding that cutting speeding can help. At busy crossings, adding flashing beacons and “pedestrian refuge islands” would make things safer. So would reducing impairment, the report said.

“An estimated 33% of fatal pedestrian crashes involved a pedestrian with a \[blood alcohol concentration] of 0.08% or higher, and an estimated 16% of drivers involved in these crashes had a BAC of 0.08% or higher,” the report said.

<!--EndFragment-->

repository: emmadigital/austinlaw

repo_name: emmadigital/austinlaw


text:
# Docker Cookiecutter Data Science

## This project is deprecated and has been archived.  A new, significantly improved, cookiecutter for Dockerized machine learning and data science can be found here: https://github.com/manifoldai/orbyter-cookiecutter.

gha_language: Python


text:
## Vanstein

**Vanstein** is an async implementation of Python 3.6 running inside CPython 3.3 or above.

It runs using CPython 3.3+ bytecode structures and emulates the entirety of CPython, providing a nearly seamless translation layer
between your code and the real implementation.

### Dependencies

 - CPython 3.3 or higher
    This means no alternative implementations.
 - `forbiddenfruit` for patching certain built-ins
 - `enum34` if running on CPython lower than 3.4

### Installation

To install the latest version of Vanstein:

```bash
$ pip install -U vanstein
```

To install the latest development version of Vanstein:

```bash
$ pip install -U git+https://github.com/SunDwarf/Vanstein.git
```

### Getting started

Vanstein sits transparently between CPython and your code, automatically turning it async when you run it.
Very little modification is required.

```py
import vanstein
from vanstein.decorators import async_func

# This call is essential!
vanstein.hijack()

import my.code

# It is recommended that you create an entry point instead of running
# your code directly.

@async_func
def entry_point(*args):
    return my.code.run(*args)

loop = vanstein.get_event_loop()
sys.exit(loop.run(entry_point(*sys.argv)))
```

### FAQ

**NotImplementedError: \<opcode\>**

This means your code is using a CPython feature that isn't currently supported inside Vanstein.
Either upgade, or wait for the feature to be implemented. Vanstein aims to be a 1<->1 replication of CPython.

**AttributeError: 'module' object has no attribute 'Instruction'**

This means you forgot to run `vanstein.hijack()`. This function call is very important, as it replaces certain
parts of the CPython runtime to make things work more seamlessly.

repository: ArsenArsen/Vanstein

repo_name: ArsenArsen/Vanstein


text:
[![Travis-CI Build Status](https://travis-ci.org/hochwagenlab/hwglabr.svg?branch=master)](https://travis-ci.org/hochwagenlab/hwglabr)

# hwglabr
### Hochwagen lab R package

Compilation of functions used frequently by Hochwagen lab members.

#### Installation

You can install the package directly from the source code on GitHub. For that you
will need Hadley Wickham's `devtools` R package:
``` r
install.packages("devtools")
```

Once you have `devtools` you can install and load `hwglabr`:
``` r
devtools::install_github("hochwagenlab/hwglabr")
library(hwglabr)
```

#### Documentation

Use the package GitHub [repo](https://github.com/hochwagenlab/hwglabr) and the
[documentation website](https://hochwagenlab.github.io/hwglabr/).
Function documentation is accessible within R in the standard way, by typing one of the following:

``` r
help("function_name")

?function_name
```

You can also get the list of included functions directly within R using one of the following:

``` r
ls("package:hwglabr")   # List function names

lsf.str("package:hwglabr")   # List function names and their arguments
```

repository: GeT-TRiX/hwglabr

repo_name: GeT-TRiX/hwglabr


text:
+++
title = "Event & Participant Extraction from News Articles (Automatic Timeline Generation of News Events)"
date = "2018-01-08"

summary = "Extract events in News articles and their participants using a conditional random field classifier and extensive feature engineering"

tags = ["machine-learning", "natural-language-processing"]

image_preview = "ukp_timeline_gen.png"

# Links (optional).
url_pdf = "/files/ukpreport.pdf"
url_preprint = ""
url_code = ""
url_dataset = ""
url_project = "https://www.ukp.tu-darmstadt.de/research/past-projects/structuring-story-chains/"
url_slides = ""
url_video = ""
url_poster = ""
url_source = ""

url_custom = [{name = "Dataset ECB+", url = "http://www.newsreader-project.eu/results/data/the-ecb-corpus/"}, {name = "Dataset TimeML", url = "http://www.timeml.org/timebank/timebank.html"}]

# Does the content use math formatting?
math = true

# Does the content use source code highlighting?
highlight = true

+++

The larger aim of the project is to create a chronological ordering of important sub-events (and their participants) involved in a bigger event. I worked on the task of creating a strong baseline model for identifying important events in news articles and their associated participants. We used articles from the ECB+ Corpus and Timebank Corpus. We performed extensive feature engineering using syntactic and semantic features that were then used with a CRF Classifier to achieve the following F-1 scores:

- Event Extraction
	- ECB+ Corpus \- 73.02 %
	- TimeBank Corpus \- 80.78%

- Participants
	- ECB+ Corpus \- 56.51%

repository: DushyantaDhyani/myhugowebpage

repo_name: DushyantaDhyani/myhugowebpage