text:
# SheetKit

SheetKit is an extension library for SwiftUI sheets.

[中文版说明 with Picture](https://www.fatbobman.com/posts/sheetKit/)

## What is SheetKit ##

SheetKit is a library of extensions for SwiftUI modal views. It provides several convenient display and cancel methods for modal views, as well as several View Extensions for modal views.

The main reasons for developing SheetKit.

* Convenient Deep link calls
  SwiftUI provides the onOpenURL method to make it very easy for applications to respond to Deep Link, but in practice, this is not as easy as expected. The main reason for this is that the important view presentation modes in SwiftUI: NavigationView, Sheet, etc. do not have the ability to be reset quickly and easily. It is difficult to instantly set the application to the view state we want with a couple of lines of code.

* Centralised management of modal views
  SwiftUI usually uses .sheets to create modal views, which is very intuitive for simple applications, but if the application logic is complex and requires many modal views, this can make the code very messy and difficult to organize. In this case, we usually manage all the modal views centrally and call them all together. See my previous article - Popping up different Sheets on demand in SwiftUI.

* The new UISheetPresentationController
  In WWDC 2021, Apple brought the long-awaited half-height modal view to everyone. The SheetKit makes up for it for now, but perhaps in a bit of a hurry, as there is no SwiftUI version of this popular interaction, only UIKit support. Both sheets, fullScreenCover and bottomSheet (half-height modal view) are fully supported and managed in one place.

## System requirements##

iOS 15

Swift 5.5

XCode 13.0 +

## How to use ##

### present ###

```swift
Button("show sheet"){
   SheetKit().present{
     Text("Hello world")
   }
}
```

or

```swift
@Environment(\.sheetKit) var sheetKit

Button("show sheet"){
   sheetKit.present{
     Text("Hello world")
   }
}
```

support multiSheet

```swift
@Environment(\.sheetKit) var sheetKit

Button("show sheet"){
   sheetKit.present{
     Button("show full sheet"){
       sheetKit.present(with:.fullScreenCover){
         Text("Hello world")
       }
     }
   }
}
```

### sheet style ###

three types sytle:
* sheet
* fullScreenCover
* bottomSheet

```swift
sheetKit.present(with: .bottomSheet){
  Text("Hello world")
}
```

custom bottomSheet

```swift
let configuration = SheetKit.BottomSheetConfiguration(  detents: [.medium(),.large()],
                                                        largestUndimmedDetentIdentifier: .medium,
                                                        prefersGrabberVisible: true,
                                                        prefersScrollingExpandsWhenScrolledToEdge: false,
                                                        prefersEdgeAttachedInCompactHeight: false,
                                                        widthFollowsPreferredContentSizeWhenEdgeAttached: true,
                                                        preferredCornerRadius: 100)

sheetKit.present(with: .customBottomSheet,configuration: configuration) {
  Text("Hello world")
}
```

get notice when bottomSheet modal changed

```swift
@State var detent:UISheetPresentationController.Detent.Identifier = .medium

Button("Show"){
  sheetKit.present(with: .bottomSheet,detentIdentifier: $detent){
    Text("Hello worl")
  }
}
.onChange(of: detent){ value in
    print(value)
}
```

or

```swift
@State var publisher = NotificationCenter.default.publisher(for: .bottomSheetDetentIdentifierDidChanged, object: nil)

.onReceive(publisher){ notification in
       guard let obj = notification.object else {return}
       print(obj)
}
```

### dismissAllSheets ###

```swift
 SheetKit().dismissAllSheets(animated: false, completion: {
        print("sheet has dismiss")
    })
```

### dismiss ###

```swift
 SheetKit().dismiss()
```

### interactiveDismissDisabled ###

SwiftUI 3.0's interactiveDismissDisabled enhancement adds the ability to be notified when a user uses a gesture to cancel, on top of the ability to control whether gesture cancellation is allowed via code.

```swift
struct ContentView: View {
    @State var sheet = false
    var body: some View {
        VStack {
            Button("show sheet") {
                sheet.toggle()
            }
        }
        .sheet(isPresented: $sheet) {
            SheetView()
        }
    }
}

struct SheetView: View {
    @State var disable = false
    @State var attempToDismiss = UUID()
    var body: some View {
        VStack {
            Button("disable: \(disable ? "true" : "false")") {
                disable.toggle()
            }
            .interactiveDismissDisabled(disable, attempToDismiss: $attempToDismiss)
        }
        .onChange(of: attempToDismiss) { _ in
            print("try to dismiss sheet")
        }
    }
}
```

### clearBackground ###

Set the background of the modal view to transparent. In SwiftUI 3.0, it is already possible to generate various hair-glass effects using the native API. However, the hair glass effect is only visible if the background of the modal view is set to transparent.

```swift
ZStack {
            Rectangle().fill(LinearGradient(colors: [.red, .green, .pink, .blue, .yellow, .cyan, .gray], startPoint: .topLeading, endPoint: .bottomTrailing))
            Button("Show bottomSheet") {
                sheetKit.present(with: .bottomSheet, afterPresent: { print("presented") }, onDisappear: { print("disappear") }, detentIdentifier: $detent) {
                    ZStack {
                        Rectangle()
                            .fill(.ultraThinMaterial)
                        VStack {
                            Text("Hello world")
                            Button("dismiss all") {
                                SheetKit().dismissAllSheets(animated: true, completion: {
                                    print("sheet has dismiss")
                                })
                            }
                        }
                    }
                    .clearBackground()
                    .ignoresSafeArea()
                }
            }
            .foregroundColor(.white)
            .buttonStyle(.bordered)
            .controlSize(.large)
            .tint(.green)
        }
        .ignoresSafeArea()
```

repository: BearLatte/SheetKit

repo_name: BearLatte/SheetKit


text:
# Mastering JavaScript

> JavaScript, often abbreviated as JS, is a high-level, interpreted programming language. It is a language which is also characterized as dynamic, weakly typed, prototype-based and multi-paradigm. Alongside HTML and CSS, JavaScript is one of the three core technologies of the World Wide Web.

## Introduction

- 📺 [JavaScript in 2019](https://youtu.be/cS6Txwk8Q-Q)

## Arrays

- 📖 [Eliminating duplicate objects: three approaches](https://2ality.com/2020/07/eliminating-duplicate-objects.html)

## Drag and drop

- 📖 [How To Make A Drag-and-Drop File Uploader With Vanilla JavaScript](https://www.smashingmagazine.com/2018/01/drag-drop-file-uploader-vanilla-js/)

## Ecosystem

- 📖 [State of JS for 2019](https://2019.stateofjs.com/)

- 📖 [State of JS for 2018](https://2018.stateofjs.com/introduction/)

- 📖 [State of JS for 2017](https://2017.stateofjs.com/2017/introduction)

## ES6 to ES10

- 📺 [ES10 / ES2019 _New_ Features!](https://www.youtube.com/watch?v=eps-J_p4eQY)

- 📺 [Array Iteration: 8 Methods - map, filter, reduce, some, every, find, findIndex, forEach](https://www.youtube.com/watch?v=Urwzk6ILvPQ)

- 📺 [JavaScript 2021 New Numeric Separators](https://www.youtube.com/watch?v=8L36qRYruec)

- 📖 [Rename & Destructure Variables in ES6](https://wesbos.com/destructuring-renaming)

## Things to Know

- 📺 [What is THIS in JavaScript? in 100 seconds](https://www.youtube.com/watch?v=YOlr79NaAtQ)

- 📺 [What is Polyfill (Web Development)](https://www.youtube.com/watch?v=saewjAZlwlg)

- 📖 [An Introduction to Source Maps](https://blog.teamtreehouse.com/introduction-source-maps)

- 📖 [Arrays vs Sets](https://www.frontendmayhem.com/javascript-arrays-vs-sets/)

- 📖 [JavaScript: Continue vs Break](https://codeburst.io/javascript-continue-vs-break-47b5c15cacc6)

## Native Features

- 📖 [Share like a native app with the Web Share API](https://web.dev/web-share/)

- 📖 [How to Use the Web Share API](https://css-tricks.com/how-to-use-the-web-share-api/)

## NPM

- 📺 [NPM and the Future of JavaScript](https://www.youtube.com/watch?v=Qa4dxW-Qi2s)

- 📖 [npm-link: symlink a package folder](https://docs.npmjs.com/cli/link.html)

## Performance

- 📺 [Speed highlights (Chrome Dev Summit 2019)](https://www.youtube.com/watch?v=5_Ns2xfBMLw)

## Tips

- 📺 [Top 5 Javascript Things You Should Know!](https://www.youtube.com/watch?v=v0QTqHXiVNw)

- 📖 [Better error handling in JavaScript](https://medium.com/@iaincollins/error-handling-in-javascript-a6172ccdf9af)

- 📖 [Console cheat sheet for JavaScript developers](https://levelup.gitconnected.com/console-cheat-sheet-for-javascript-developers-21f0c49604d4)

license: MIT

repository: hirajanwin/awesome-bootstrappers

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: hirajanwin/awesome-bootstrappers


text:
# Defining configuration properties in tests

A sample Ktor project demonstrating how to [define configuration properties in tests](https://ktor.io/docs/testing.html#configuration-properties).

In this project, the `upload.dir` custom property defined in the [application.conf](src/main/resources/application.conf) specifies a directory used to upload a file to a server. In [tests](src/test/kotlin/), you can see two approaches of defining this property:
* By using the `MapApplicationConfig.put` function.
* By loading a property value from `application.conf`.

repository: TimothyGillespie/ktor-documentation

branch_name: refs/heads/main

repo_name: TimothyGillespie/ktor-documentation


text:
ToDo List
====

## Features

* Description analysis using MeCab lib.
* Reorder chapter, episode, scene
* Omit Action
* Omit chapter, episode, scene
* Show comments
* Search file by hashtag
* Show Initialized message
* Work log feature
* Show note by filtering Category
* Update file and systems by version
* Story Event manager: management date event etc
* Show a guideline of size to culc from master size.
* Asset1: install template e.g. school set, office set and more.
* Asset2: convert tag name from templates
* Ask sub command when empty input.
* Show selected chapter, episode and more when push.
* Story graph feature.
* Todo marking: continue to work from the mark point
* Add character's attributes in scene
* Event table
* Foreshadow and payoff feature.
* Aozora bunko format.
* detail (time and camera) output mode in Script build.
* Scene info
* Rubi

## Bugs

* Cannot Move to trashbox when same name already exists

repository: NovelLab/stobu

gha_language: Python

gha_license_id: MIT

repo_name: NovelLab/stobu


text:
# DbUpsert
upsert in postgresql and mysql
PG: INSERT ... ON CONFLICT DO UPDATE
Mysql: INSERT ... DUPLICATE KEY UPDATE
This is my practice gem code, the code is simple and there are some else gem does better than this,such as **gem 'upsert'** and **gem 'activerecord-import'**

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'db_upsert'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install db_upsert

## Usage
```ruby
fields = %w(name email city created_at updated_at)
rows = [
 ["smile"<EMAIL_ADDRESS>'shanghai', '2016-01-01', '2016-01-01'],
 ['malzahar'<EMAIL_ADDRESS>'beijing', '2016-01-01', '2016-01-01'],
]
# mysql
User.bulk_write_mysql(fields, rows, :conflict => [:name])
# posrgresql
User.bulk_write_pg(fields, rows, :conflict => [:name])
```

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/smiledmiao/db_upsert. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).


text:
---
layout: layout.pug
navigationTitle: Version Policy
excerpt: Understanding DC/OS Apache Spark version policy
title: Version Policy
menuWeight: 130
render: mustache
model: /mesosphere/dcos/services/spark/data.yml
---

We have selected the latest version of the [Apache Spark](http://spark.apache.org) stable release train for new releases. We support HDFS version 2.9 by default and version 2.7.

repository: mesosphere/dcos-docs-site

gha_language: SCSS

repo_name: mesosphere/dcos-docs-site


text:
## 0.0.14 [unreleased]

### Features

- [#33](https://github.com/wallix/awless/issues/33): Ability to set AWS profile using `aws.profile` config key

### Bugfixes

- [#44](https://github.com/wallix/awless/issues/44): Fetch only the S3 buckets and related objects of the current region.


text:
# GreptimeDB Documentation

This directory contains sources of all content published at [docs.greptime.com][1]

[1]: https://docs.greptime.com

# Table of Contents

## Introduction

- [Introduction](./docs/index.md)

## Getting Started

If you are new to Greptime DB, documents below will help you quickly get started

- [Getting started](./docs/getting-started/overview.md)

## User Guide

Explains how to use, integrate or customize GreptimeDB; also includes common issues and solutions

- [Concepts](./docs/user-guide/concepts/overview.md)
- [Clients](./docs/user-guide/clients/overview.md)
- [Table management](./docs/user-guide/table-management.md)
- [Write data](./docs/user-guide/write-data/overview.md)
- [Query data](./docs/user-guide/query-data/overview.md)
- [Scripts & Functions](./docs/user-guide/scripts-&-functions/overview.md)
- [Cluster](./docs/user-guide/cluster.md)
- [Operations](./docs/user-guide/Operations/overview.md)
- [Integration](./docs/user-guide/integration.md)

## Developer Guide

Provides a detailed overview of how GreptimeDB operates and assists you in participating as a contributor in its development

  - [Overview](./docs/developer-guide/overview.md)
  - [Frontend](./docs/developer-guide/frontend/overview.md)
  - [Datanode](./docs/developer-guide/datanode/overview.md)
  - [Meta](./docs/developer-guide/meta/overview.md)

# Contributing

Thanks a lot for considering contributing to GreptimeDB. People like you would make
GreptimeDB a great product.

Please refer to [contribution guidelines](./CONTRIBUTING.md) for more information.

repository: paomian/docs

repo_name: paomian/docs


text:
I thought in getting up to my TED wish
I would try to begin by putting in
perspective what I try to do
and how it fits with what they try to do.
We live in a world that everyone knows is interdependent,
but insufficient in three major ways.

It is, first of all, profoundly unequal:
half the world's people still living on less than two dollars a day;
a billion people with no access to clean water;
two and a half billion no access to sanitation;
a billion going to bed hungry every night;
one in four deaths every year from AIDS, TB, malaria
and the variety of infections associated with dirty water --
80 percent of them under five years of age.
Even in wealthy countries it is common now to see inequality growing.
In the United States, since 2001 we've had five years of economic growth,
five years of productivity growth in the workplace,
but median wages are stagnant and the percentage of working families
dropping below the poverty line is up by four percent.
The percentage of working families without health care up by four percent.
So this interdependent world which has been pretty good to most of us --
which is why we're all here in Northern California doing what we do
for a living, enjoying this evening -- is profoundly unequal.
It is also unstable.
Unstable because of the threats of terror,
weapons of mass destruction, the spread of global disease
and a sense that we are vulnerable to it in a way that we weren't not so many years ago.
And perhaps most important of all, it is unsustainable
because of climate change, resource depletion and species destruction.
When I think about the world I would like to leave to my daughter
and the grandchildren I hope to have,
it is a world that moves away from unequal, unstable, unsustainable
interdependence to integrated communities -- locally, nationally and globally --

that share the characteristics of all successful communities:
a broadly shared, accessible set of opportunities,
a shared sense of responsibility for the success of the common enterprise
and a genuine sense of belonging.
All easier said than done.
When the terrorist incidents occurred in the United Kingdom a couple of years ago,
I think even though they didn't claim as many lives as we lost in the United States on 9/11,
I think the thing that troubled the British most
was that the perpetrators were not invaders, but homegrown citizens
whose religious and political identities were more important to them
than the people they grew up with, went to school with,
worked with, shared weekends with, shared meals with.
In other words, they thought their differences
were more important than their common humanity.
It is the central psychological plague of humankind in the 21st century.
Into this mix, people like us, who are not in public office,
have more power to do good than at any time in history,
because more than half the world's people
live under governments they voted in and can vote out.
And even non-democratic governments are more sensitive to public opinion.
Because primarily of the power of the Internet,
people of modest means can band together and amass vast sums of money
that can change the world for some public good if they all agree.
When the tsunami hit South Asia, the United States contributed 1.2 billion dollars.
30 percent of our households gave.
Half of them gave over the Internet.
The median contribution was somewhere around 57 dollars.
And thirdly, because of the rise of non-governmental organizations.
They, businesses, other citizens' groups, have enormous power
to affect the lives of our fellow human beings.
When I became president in 1993,
there were none of these organizations in Russia.
There are now a couple of hundred thousand.
None in India. There are now at least a half a million active.
None in China. There are now 250,000 registered with the government,
probably twice again that many who are not registered for political reasons.
When I organized my foundation, and I thought about the world as it is
and the world that I hope to leave to the next generation,
and I tried to be realistic about what I had cared about all my life
that I could still have an impact on.
I wanted to focus on activities
that would help to alleviate poverty, fight disease, combat climate change,
bridge the religious, racial and other divides that torment the world,
but to do it in a way that would either use
whatever particular skills we could put together in our group
to change the way some public good function was performed
so that it would sweep across the world more.
You saw one reference to that in what we were able to do with AIDS drugs.
And I want to say that the head of our AIDS effort,
and the person who also is primarily active in the wish I'll make tonight,
Ira Magaziner, is here with me and I want to thank him for everything he's done.
He's over there.

(Applause)

When I got out of office and was asked to work, first in the Caribbean,
to try to help deal with the AIDS crisis,
generic drugs were available for about 500 dollars a person a year.
If you bought them in vast bulks,
you could get them at a little under 400 dollars.
The first country we went to work in, the Bahamas,
was paying 3,500 dollars for these drugs.
The market was so terribly disorganized
that they were buying this medicine through two agents
who were gigging them sevenfold.
So the very first week we were working,
we got the price down to 500 dollars.
And all of a sudden, they could save seven times as many lives
for the same amount of money.
Then we went to work with the manufacturers of AIDS medicines,
one of whom was cited in the film,
and negotiated a whole different change in business strategy,
because even at 500 dollars, these drugs
were being sold on a high-margin, low-volume, uncertain-payment basis.
So we worked on improving the productivity of the operations
and the supply chain, and went to a low-margin, high-volume,
absolutely certain-payment business.
I joked that the main contribution we made
to the battle against AIDS was to get the manufacturers
to change from a jewelry store to a grocery store strategy.
But the price went to 140 dollars from 500.
And pretty soon, the average price was 192 dollars.
Now we can get it for about 100 dollars.
Children's medicine was 600 dollars,
because nobody could afford to buy any of it.
We negotiated it down to 190.
Then, the French imposed their brilliantly conceived airline tax
to create a something called UNITAID,
got a bunch of other countries to help.
That children's medicine is now 60 dollars a person a year.
The only thing that is keeping us from basically saving the lives
of everybody who needs the medicine to stay alive
are the absence of systems necessary to diagnose, treat and care
for people and deliver this medicine.
We started a childhood obesity initiative with the Heart Association in America.
We tried to do the same thing by negotiating industry-right deals
with the soft drink and the snack food industry to cut the caloric
and other dangerous content of food going to our children in the schools.
We just reorganized the markets.
And it occurred to me that in this whole non-governmental world,
somebody needs to be thinking about organizing public goods markets.
And that is now what we're trying to do,
and working with this large cities group to fight climate change,
to negotiate huge, big, volume deals that will enable cities
which generate 75 percent of the world's greenhouse gases,
to drastically and quickly reduce greenhouse gas emissions
in a way that is good economics.
And this whole discussion as if it's some sort of economic burden,
is a mystery to me.
I think it's a bird's nest on the ground.
When Al Gore won his well-deserved Oscar
for the "Inconvenient Truth" movie, I was thrilled,
but I had urged him to make a second movie quickly.
For those of you who saw "An Inconvenient Truth,"
the most important slide in the Gore lecture is the last one,
which shows here's where greenhouse gases are going
if we don't do anything, here's where they could go.
And then there are six different categories
of things we can do to change the trajectory.
We need a movie on those six categories.
And all of you need to have it embedded in your brains
and to organize yourselves around it.
So we're trying to do that.
So organizing these markets is one thing we try to do.
Now we have taken on a second thing, and this gets to my wish.
It has been my experience in working in developing countries
that while the headlines may all be -- the pessimistic headlines may say,
well, we can't do this, that or the other thing because of corruption --
I think incapacity is a far bigger problem in poor countries than corruption,
and feeds corruption.
We now have the money, given these low prices, to distribute
AIDS drugs all over the world to people we cannot presently reach.
Today these low prices are available in the 25 countries where we work,
and in a total of 62 countries,
and about 550,000 people are getting the benefits of them.
But the money is there to reach others.
The systems are not there to reach the people.
So what we have been trying to do,
working first in Rwanda and then in Malawi and other places --
but I want to talk about Rwanda tonight --
is to develop a model for rural health care in a very poor area
that can be used to deal with AIDS, TB, malaria, other infectious diseases,
maternal and child health, and a whole range of health issues
poor people are grappling with in the developing world,
that can first be scaled for the whole nation of Rwanda,
and then will be a model that could literally
be implemented in any other poor country in the world.

And the test is: one, will it do the job?
Will it provide high quality care?
And two, will it do it at a price
that will enable the country to sustain a health care system
without foreign donors after five to 10 years?
Because the longer I deal with these problems,
the more convinced I am that we have to --
whether it's economics, health, education, whatever --
we have to build systems.
And the absence of systems that function
break the connection which got you all in this seat tonight.

In a world with no systems, with chaos,
everything becomes a guerilla struggle,
and this predictability is not there.
And it becomes almost impossible to save lives,
educate kids, develop economies, whatever.
The person, in my view,
who has done the best job of this in the health care area,
of building a system in a very poor area, is Dr. Paul Farmer,
who, many of you know, has worked for now 20 years with his group,
Partners in Health, primarily in Haiti where he started,
but they've also worked in Russia, in Peru
and other places around the world.
As poor as Haiti is, in the area where Farmer's clinic is active --
and they serve a catchment area far greater
than the medical professionals they have would indicate they could serve --
since 1988, they have not lost one person to tuberculosis, not one.
And they've achieved a lot of other amazing health results.
So when we decided to work in Rwanda
on trying to dramatically increase the income of the country and fight the AIDS problem,
we wanted to build a healthcare network,
because it had been totally destroyed during the genocide in 1994,
and the per capita income was still under a dollar a day.
So I rang up, asked Paul Farmer if he would help.
Because it seemed to me if we could prove there was a model in Haiti
and a model in Rwanda that we could then take all over the country,
number one, it would be a wonderful thing for a country
that has suffered as much as any on Earth in the last 15 years,
and number two, we would have something that could then be adapted
to any other poor country anywhere in the world.
And so we have set about doing that.
Now, we started working together 18 months ago.
And we're working in an area called Southern Kayonza,
which is one of the poorest areas in Rwanda,
with a group that originally includes about 400,000 people.

We're essentially implementing what Paul Farmer did in Haiti:
he develops and trains paid community health workers
who are able to identify health problems,
ensure that people who have AIDS or TB are properly diagnosed
and take their medicine regularly,
who work on bringing about health education, clean water and sanitation,
providing nutritional supplements and moving people up the chain of health care
if they have problems of the severity that require it.
The procedures that make this work have been perfected,
as I said, by Paul Farmer and his team
in their work in rural Haiti over the last 20 years.
Recently we did an evaluation of the first 18 months of our efforts in Rwanda.
And the results were so good that the Rwandan government
has now agreed to adopt the model for the entire country,
and has strongly supported and put the full resources of the government behind it.
I'll tell you a little bit about our team because it's indicative of what we do.
We have about 500 people around the world
working in our AIDS program, some of them for nothing --
just for transportation, room and board.
And then we have others working in these other related programs.
Our business plan in Rwanda
was put together under the leadership of Diana Noble,
who is an unusually gifted woman,
but not unusual in the type of people who have been willing to do this kind of work.
She was the youngest partner at Schroder Ventures in London in her 20s.
She was CEO of a successful e-venture --
she started and built Reed Elsevier Ventures --
and at 45 she decided she wanted to do something different with her life.
So she now works full-time on this for very little pay.
She and her team of former business people have created a business plan
that will enable us to scale this health system up for the whole country.
And it would be worthy of the kind of private equity work
she used to do when she was making a lot more money for it.
When we came to this rural area, 45 percent of the children under the age of five
had stunted growth due to malnutrition.
23 percent of them died before they reached the age of five.
Mortality at birth was over two-and-a-half percent.
Over 15 percent of the deaths among adults and children occurred
because of intestinal parasites and diarrhea from dirty water and inadequate sanitation --
all entirely preventable and treatable.
Over 13 percent of the deaths were from respiratory illnesses --
again, all preventable and treatable.
And not a single soul in this area was being treated for AIDS or tuberculosis.

Within the first 18 months, the following things happened:
we went from zero to about 2,000 people being treated for AIDS.
That's 80 percent of the people who need treatment in this area.

Listen to this: less than four-tenths of one percent of those being treated
stopped taking their medicine or otherwise defaulted on treatment.
That's lower than the figure in the United States.
Less than three-tenths of one percent
had to transfer to the more expensive second-line drugs.
400,000 pregnant women were brought into counseling
and will give birth for the first time within an organized healthcare system.
That's about 43 percent of all the pregnancies.
About 40 percent of all the people -- I said 400,000. I meant 40,000.
About 40 percent of all the people who need TB treatment are now getting it --
in just 18 months, up from zero when we started.
43 percent of the children in need of an infant feeding program
to prevent malnutrition and early death
are now getting the food supplements they need to stay alive and to grow.
We've started the first malaria treatment programs they've ever had there.
Patients admitted to a hospital that was destroyed during the genocide
that we have renovated along with four other clinics,
complete with solar power generators, good lab technology.
We now are treating 325 people a month,
despite the fact that almost 100 percent of the AIDS patients are now treated at home.
And the most important thing is
because we've implemented Paul Farmer's model, using community health workers,
we estimate that this system could be put into place for all of Rwanda
for between five and six percent of GDP,
and that the government could sustain that
without depending on foreign aid after five or six years.
And for those of you who understand healthcare economics
you know that all wealthy countries spend between nine and 11 percent of GDP
on health care, except for the United States, we spend 16 --
but that's a story for another day.

(Laughter)

We're now working with Partners in Health and the Ministry of Health in Rwanda
and our Foundation folks to scale this system up.
We're also beginning to do this in Malawi and Lesotho.
And we have similar projects in Tanzania, Mozambique,

Kenya and Ethiopia with other partners trying to achieve the same thing:
to save as many lives as quickly as we can,
but to do it in a systematic way that can be implemented nationwide
and then with a model that can be implemented in any country in the world.
We need initial upfront investment to train doctors, nurses,
health administration and community health workers throughout the country,
to set up the information technology, the solar energy,
the water and sanitation, the transportation infrastructure.
But over a five- to 10-year period,
we will take down the need for outside assistance
and eventually it will be phased out.
My wish is that TED assist us in our work and help us to build
a high-quality rural health system in a poor country, Rwanda,
that can be a model for Africa,
and indeed, for any poor country anywhere in the world.
My belief is that this will help us to build a more integrated world
with more partners and fewer terrorists,
with more productive citizens and fewer haters,
a place we'd all want our kids and our grandchildren to grow up in.
It has been an honor for me, particularly, to work in Rwanda
where we also have a major economic development project
in partnership with Sir Tom Hunter, the Scottish philanthropist,
where last year we, using the same thing with AIDS drugs,
cut the cost of fertilizer and the interest rates on microcredit loans by 30 percent
and achieved three- to four-hundred percent increases
in crop yields with the farmers.
These people have been through a lot and none of us, most of all me,
helped them when they were on the verge of destroying each other.
We're undoing that now, and they are so over it and so into their future.
We're doing this in an environmentally responsible way.
I'm doing my best to convince them not to run the electric grid
to the 35 percent of the people that have no access,
but to do it with clean energy. To have responsible reforestation projects,
the Rwandans, interestingly enough, have been quite good, Mr. Wilson,
in preserving their topsoil.
There's a couple of guys from southern farming families --
the first thing I did when I went out to this place
was to get down on my hands and knees and dig in the dirt
and see what they'd done with it.
We have a chance here to prove that a country
that almost slaughtered itself out of existence
can practice reconciliation, reorganize itself, focus on tomorrow
and provide comprehensive, quality health care with minimal outside help.
I am grateful for this prize, and I will use it to that end.
We could use some more help to do this,
but think of what it would mean if we could have a world-class health system
in Rwanda -- in a country with a less-than-one-dollar-a-day-per-capita income,
one that could save hundreds of millions of lives
over the next decade if applied to every similarly situated country on Earth.
It's worth a try and I believe it would succeed.
Thank you and God bless you.

(Applause)

repository: prewittdavon/TEDVis

repo_name: prewittdavon/TEDVis


text:
---
title: Use Telerik AJAX and MasterPage
page_title: Use Telerik AJAX and MasterPage
description: "Learn how to use Telerik UI for ASP.NET AJAX and MasterPage."
slug: ajaxmanager/how-to/radajax-and-masterpage
previous_url: ajax/radajaxmanager/how-to/radajax-and-masterpage, controls/ajaxmanager/how-to/radajax-and-masterpage
tags: telerik, asp, net, ajax, manager, how, to, use, masterpage
published: True
type: how-to
category: knowledge-base
res_type: kb
---

## Environment

			Product
			Progress® Telerik® UI for ASP.NET AJAX

## Description

How can I use Telerik UI for ASP.NET AJAX and `MasterPage`?

## Solution

You can use the Telerik UI for ASP.NET AJAX controls with `MasterPage` in various scenarios. However, they cannot have two AjaxManager controls in the master and in the content page at the same time. Instead, since the May 2007 release, you can add the `RadAjaxManagerProxy` control and use the configure the design-time in the same way [as the manager]({%slug ajaxmanager/overview%}).

You can also add the AjaxManager control in any `ContentPage`. However, some scenarios cannot be handled when using the AjaxManager in this way, for example, a control in the master page cannot be ajaxified. The AjaxManager can handle only cases when the controls that will be ajaxified are beneath in the manager control hierarchy. Therefore, it is strongly recommended that you place the AjaxManager in the `MasterPage` and add proxy controls in content pages.

The following example demonstrates how to use the `RadAjaxManagerProxy` within a content page.

>* Note that the `RadAjaxManagerProxy` control can be used for design-time configuration only. It does not have a client-side object or methods
>* If you need the server or client-side AjaxManager functionality, like the `ResponseScripts` collection or the `ajaxRequest` function, you can get the `master` manager instance with the server-side `GetCurrent` method from the `ContentPage` code-behind in this way: `RadAjaxManager.GetCurrent(Page)`.

````ASPNET
<telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">
	<AjaxSettings>
	    <telerik:AjaxSetting AjaxControlID="DropDownList1">
	        <UpdatedControls>
	            <telerik:AjaxUpdatedControl ControlID="DetailsView1" />
	            <telerik:AjaxUpdatedControl ControlID="GridView1" />
	        </UpdatedControls>
	    </telerik:AjaxSetting>
	    <telerik:AjaxSetting AjaxControlID="GridView1">
	        <UpdatedControls>
	            <telerik:AjaxUpdatedControl ControlID="GridView1" />
	            <telerik:AjaxUpdatedControl ControlID="DetailsView1" />
	        </UpdatedControls>
	    </telerik:AjaxSetting>
	</AjaxSettings>
</telerik:RadAjaxManagerProxy>
````

Use server-side code block in your JavaScript function to call the master manager `AjaxRequest` function from the `ContentPage` as well:

````JavaScript
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
	<script type="text/javascript">
	    function myContentClickHandler() {
	        $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("content");
	    }
	</script>
</telerik:RadCodeBlock>
````

As to the AJAX settings, they can still be added programmatically. Telerik AJAX controls can be accessed at the code-behind of the `ContentPage` by using the `FindControl` method of the `MasterPage` object. However, if you use a lot of `ContentPage` instances, write the same "finding" code in all the places. A better approach is to set the Manager and the Loading Panel if used as a property, and access it directly.

For a live example, refer to the [demo on using Telerik AJAX and `MasterPage`](https://demos.telerik.com/aspnet-ajax/ajax/examples/manager/usercontrol/defaultcs.aspx).

## See Also

* [MasterPages: Ajaxify and Update Controls in the Master and Content Pages]({%slug ajaxmanager/how-to/ajaxify-and-update-controls-in-master-and-content-page%})

* [MasterPages: Initiate Requests from One ContentPlaceHolder and Load or Update Controls in Another]({%slug ajaxmanager/how-to/initiating-requests-from-contentplaceholder%})

repository: telerik/ajax-docs

gha_language: C#

repo_name: telerik/ajax-docs


text:
# ODatabaseDocument - newEdge()

This method creates a new edge between the given vertices.

## Creating Edges

When using OrientDB as a Graph database, this method allows you to create new edges on the database and connect them to related vertices.  To create new vertices on the database, see the [`newVertex()`](newVertex.md) method.

### Syntax

There are a few different versions available when using this method:

```
// METHOD 1
default OEdge ODatabaseDocument().newEdge(OVertex fromV, OVertex toV)

// METHOD 2
OEdge ODatabaseDocument().newEdge(OVertex fromV, OVertex toV, OClass class)

// METHOD 3
OEdge ODatabaseDocument().newEdge(OVertex fromV, OVertex toV, String class-name)
```

Edges have their own classes in OrientDB.  When using the first method, the edge is created using the default `E` class.  The other methods allow you to set the specific edge class that you want to use.

| Argument | Type | Description
|---|---|---|
| **`fromV`** | [`OVertex`](../OVertex.md) | Defines the vertex this edge comes from |
| **`toV`** | [`OVertex`](../OVertex.md) | Defines the vertex this edge points to |
| **`class`** | [`OClass`](../OClass.md) | Defines the edge class |
| **`class-name`** | [`String`]({{ book.javase }}/api/java/lang/String.html)  | Defines the edge class |

#### Return Value

This method returns an [`OEdge`](../OEdge.md) instance of the edge it creates.

### Example

Imagine an application that makes frequent use a particular edge class.  You might find it convenient to write a method that automatically calls that class by default when creating new edges.For instance, in a class handling social network accounts:

```java
// INITIALIZE VARIABLES
private static String edgeClass = "subscription";
private ODatabaseDocument db;
...

// SUBSCRIBE TO USER'S BLOG
public void subscribe(OVertex subscriber, OVertex publisher){

   db.newEdge(subscriber, publisher, edgeClass);

}
```

repository: orientechnologies/orientdb-docs

gha_language: CSS

repo_name: orientechnologies/orientdb-docs


text:
#3.1使用图形

对其中的接触到的一些术语进行了解，并实践

##mtcars
Motor Trend Car Road Tests

###Description

The data was extracted from the 1974 Motor Trend US magazine, and comprises fuel consumption and 10 aspects of automobile design and performance for 32 automobiles (1973–74 models).

###Usage

mtcars
###Format

A data frame with 32 observations on 11 variables.

[, 1]	mpg	Miles/(US) gallon

[, 2]	cyl	Number of cylinders

[, 3]	disp	Displacement (cu.in.)

[, 4]	hp	Gross horsepower

[, 5]	drat	Rear axle ratio

[, 6]	wt	Weight (lb/1000)

[, 7]	qsec	1/4 mile time

[, 8]	vs	V/S

[, 9]	am	Transmission (0 = automatic, 1 = manual)

[,10]	gear	Number of forward gears

[,11]	carb	Number of carburetors

##attach
Attach Set of R Objects to Search Path

###Description

The database is attached to the R search path. This means that the database is searched by R when evaluating a variable, so objects in the database can be accessed by simply giving their names.

###Usage

attach(what, pos = 2L, name = deparse(substitute(what)),
       warn.conflicts = TRUE)

##plot
Generic X-Y Plotting

###Description

Generic function for plotting of R objects. For more details about the graphical parameter arguments, see par.

For simple scatter plots, plot.default will be used. However, there are plot methods for many R objects, including functions, data.frames, density objects, etc. Use methods(plot) and the documentation for these.

###Usage

plot(x, y, ...)

###type
what type of plot should be drawn. Possible types are

"p" for points,

"l" for lines,

"b" for both,

"c" for the lines part alone of "b",

"o" for both ‘overplotted’,

"h" for ‘histogram’ like (or ‘high-density’) vertical lines,

"s" for stair steps,

"S" for other steps, see ‘Details’ below,

"n" for no plotting.

##abline
Add Straight Lines to a Plot

###Description

This function adds one or more straight lines through the current plot.

###Usage

abline(a = NULL, b = NULL, h = NULL, v = NULL, reg = NULL,
       coef = NULL, untf = FALSE, ...)
###Arguments

a, b

the intercept and slope, single values.

untf
logical asking whether to untransform. See ‘Details’.

h
the y-value(s) for horizontal line(s).

v
the x-value(s) for vertical line(s).

coef
a vector of length two giving the intercept and slope.

reg
an object with a coef method. See ‘Details’.

...

graphical parameters such as col, lty and lwd (possibly as vectors: see ‘Details’) and xpd and the line characteristics lend, ljoin and lmitre.

##detach

Detach Objects from the Search Path

###Description

Detach a database, i.e., remove it from the search() path of available R objects. Usually this is either a data.frame which has been attached or a package which was attached by library.

###Usage

detach(name, pos = 2L, unload = FALSE, character.only = FALSE,
       force = FALSE)
###Arguments

name
The object to detach. Defaults to search()[pos]. This can be an unquoted name or a character string but not a character vector. If a number is supplied this is taken as pos.

pos
Index position in search() of the database to detach. When name is a number, pos = name is used.

unload
A logical value indicating whether or not to attempt to unload the namespace when a package is being detached. If the package has a namespace and unload is TRUE, then detach will attempt to unload the namespace via unloadNamespace: if the namespace is imported by another namespace or unload is FALSE, no unloading will occur.

character.only
a logical indicating whether name can be assumed to be a character string.

force
logical: should a package be detached even though other attached packages depend on it?

##lm
Fitting Linear Models

###Description

lm is used to fit linear models. It can be used to carry out regression, single stratum analysis of variance and analysis of covariance (although aov may provide a more convenient interface for these).

###Usage

lm(formula, data, subset, weights, na.action,
   method = "qr", model = TRUE, x = FALSE, y = FALSE, qr = TRUE,
   singular.ok = TRUE, contrasts = NULL, offset, ...)

#3.2一个简单例子

重点：

￼plot(x,y,type = "b") ###根据上面的plot资料，type＝“b”，表示点加线。

#3.3图形参数

应用函数：
##par
Set or Query Graphical Parameters

###Description

par can be used to set or query graphical parameters. Parameters can be set by specifying them as arguments to par in tag = value form, or by passing them as a list of tagged values.

###Usage

par(..., no.readonly = FALSE)

<highlevel plot> (\dots, <tag> = <value>)
###Arguments

...
arguments in tag = value form, or a list of tagged values. The tags must come from the names of graphical parameters described in the ‘Graphical Parameters’ section.

no.readonly
logical; if TRUE and there are no other arguments, only parameters are returned which can be set by a subsequent par() call on the same device.

#3.1使用图形

对其中的接触到的一些术语进行了解，并实践

##mtcars
Motor Trend Car Road Tests

###Description

The data was extracted from the 1974 Motor Trend US magazine, and comprises fuel consumption and 10 aspects of automobile design and performance for 32 automobiles (1973–74 models).

###Usage

mtcars
###Format

A data frame with 32 observations on 11 variables.

[, 1]	mpg	Miles/(US) gallon

[, 2]	cyl	Number of cylinders

[, 3]	disp	Displacement (cu.in.)

[, 4]	hp	Gross horsepower

[, 5]	drat	Rear axle ratio

[, 6]	wt	Weight (lb/1000)

[, 7]	qsec	1/4 mile time

[, 8]	vs	V/S

[, 9]	am	Transmission (0 = automatic, 1 = manual)

[,10]	gear	Number of forward gears

[,11]	carb	Number of carburetors

##attach
Attach Set of R Objects to Search Path

###Description

The database is attached to the R search path. This means that the database is searched by R when evaluating a variable, so objects in the database can be accessed by simply giving their names.

###Usage

attach(what, pos = 2L, name = deparse(substitute(what)),
       warn.conflicts = TRUE)

##plot
Generic X-Y Plotting

###Description

Generic function for plotting of R objects. For more details about the graphical parameter arguments, see par.

For simple scatter plots, plot.default will be used. However, there are plot methods for many R objects, including functions, data.frames, density objects, etc. Use methods(plot) and the documentation for these.

###Usage

plot(x, y, ...)

###type
what type of plot should be drawn. Possible types are

"p" for points,

"l" for lines,

"b" for both,

"c" for the lines part alone of "b",

"o" for both ‘overplotted’,

"h" for ‘histogram’ like (or ‘high-density’) vertical lines,

"s" for stair steps,

"S" for other steps, see ‘Details’ below,

"n" for no plotting.

##abline
Add Straight Lines to a Plot

###Description

This function adds one or more straight lines through the current plot.

###Usage

abline(a = NULL, b = NULL, h = NULL, v = NULL, reg = NULL,
       coef = NULL, untf = FALSE, ...)
###Arguments

a, b

the intercept and slope, single values.

untf
logical asking whether to untransform. See ‘Details’.

h
the y-value(s) for horizontal line(s).

v
the x-value(s) for vertical line(s).

coef
a vector of length two giving the intercept and slope.

reg
an object with a coef method. See ‘Details’.

...

graphical parameters such as col, lty and lwd (possibly as vectors: see ‘Details’) and xpd and the line characteristics lend, ljoin and lmitre.

##detach

Detach Objects from the Search Path

###Description

Detach a database, i.e., remove it from the search() path of available R objects. Usually this is either a data.frame which has been attached or a package which was attached by library.

###Usage

detach(name, pos = 2L, unload = FALSE, character.only = FALSE,
       force = FALSE)
###Arguments

name
The object to detach. Defaults to search()[pos]. This can be an unquoted name or a character string but not a character vector. If a number is supplied this is taken as pos.

pos
Index position in search() of the database to detach. When name is a number, pos = name is used.

unload
A logical value indicating whether or not to attempt to unload the namespace when a package is being detached. If the package has a namespace and unload is TRUE, then detach will attempt to unload the namespace via unloadNamespace: if the namespace is imported by another namespace or unload is FALSE, no unloading will occur.

character.only
a logical indicating whether name can be assumed to be a character string.

force
logical: should a package be detached even though other attached packages depend on it?

##lm
Fitting Linear Models

###Description

lm is used to fit linear models. It can be used to carry out regression, single stratum analysis of variance and analysis of covariance (although aov may provide a more convenient interface for these).

###Usage

lm(formula, data, subset, weights, na.action,
   method = "qr", model = TRUE, x = FALSE, y = FALSE, qr = TRUE,
   singular.ok = TRUE, contrasts = NULL, offset, ...)

#3.2一个简单例子

重点：

￼plot(x,y,type = "b") ###根据上面的plot资料，type＝“b”，表示点加线。

#3.3图形参数

应用函数：
##par
Set or Query Graphical Parameters

###Description

par can be used to set or query graphical parameters. Parameters can be set by specifying them as arguments to par in tag = value form, or by passing them as a list of tagged values.

###Usage

par(..., no.readonly = FALSE)

<highlevel plot> (\dots, <tag> = <value>)
###Arguments

...
arguments in tag = value form, or a list of tagged values. The tags must come from the names of graphical parameters described in the ‘Graphical Parameters’ section.

no.readonly
logical; if TRUE and there are no other arguments, only parameters are returned which can be set by a subsequent par() call on the same device.


text:
---
layout: post
title: "Scribd is presenting at Data and AI Summit 2022"
team: Core Platform
author: rtyler
tags:
- databricks
- kafka
- deltalake
- featured
---

We are very excited to be presenting and attending this year's [Data and AI
Summit](https://databricks.com/dataaisummit/north-america-2022) which will be
hosted virtually and physically in San Francisco from June 27th-30th.
Throughout the course of 2021 we completed a number of really interesting
projects built around [delta-rs](https://github.com/delta-io/delta-rs) and the
Databricks platform which we are thrilled to share with a broader audience.
In addition to the presentations listed below, a number of Scribd engineers who
are responsible for data and ML platform, machine learning systems, and more,
will be in attendance if you want to meet up and learn more about how Scribd
uses data and ML to change the way the world reads!

* [Christian Williams](https://github.com/xianwill) will be sharing some of the
work he has done developing
[kafka-delta-ingest](https://github.com/scribd/kafka-delta-ingest) in his talk:
**[Streaming Data into Delta Lake with Rust and
Kafka](https://databricks.com/dataaisummit/north-america-2022/agenda/?sessionid=1834)**
* [QP Hou](https://github.com/houqp), Scribd Emeritus, will be presenting on
his foundational work to ensure correctness within delta-rs during his session:
**[Ensuring Correct Distributed Writes to Delta Lake in Rust with Formal
Verification](https://databricks.com/dataaisummit/north-america-2022/agenda/?sessionid=1623)**
* [R Tyler Croy](https://github.com/rtyler) will be co-presenting with Gavin
Edgley from Databricks on the cost analysis work Scribd has done to efficiently
grow our data platform with **[Doubling the size of the data lake without doubling the
cost](https://databricks.com/dataaisummit/north-america-2022/agenda/?sessionid=2366)**

There are so many great sessions to watch in person or online during the event,
particularly around [Delta Lake](https://delta.io), which is one of our
favorite technologies and powers our entire data platform. We are also
expecting some great ML related talks as data and ML begin to overlap more and
more. We hope to see you there!

gha_language: HTML


text:
project_path: /web/fundamentals/_project.yaml
book_path: /web/fundamentals/_book.yaml
description: When we measure loading performance, we often do so using testing tools that only describe performance from the perspective of the tester. If we want to measure loading performance from the user's perspective, we must rely on the Navigation and Resource Timing APIs.

{# wf_updated_on: 2018-08-17 #}
{# wf_published_on: 2018-06-08 #}
{# wf_blink_components: Blink>PerformanceAPIs,Blink>PerformanceAPIs>NavigationTiming,Blink>PerformanceAPIs>ResourceTiming #}

# Assessing Loading Performance in Real Life with Navigation and Resource Timing {: .page-title }

{% include "web/_shared/contributors/jeremywagner.html" %}

Chances are good you've opened your browser's dev tools at some point, [used the
network panel](/web/tools/chrome-devtools/network-performance/) (or perhaps even
[Lighthouse](/web/tools/lighthouse/)) to assess performance, and discovered
opportunities for improvement. Then you've refactored code, improved
performance, watched metrics improve, and congratulated yourself. A job well
done!

 They don't
tell you how your site is performing for [real users in the
field](/web/fundamentals/performance/speed-tools/#field_data).

It's not that synthetic testing is _bad_, it's that it's only a part of a much
larger picture of loading performance. No matter how many synthetic testing
tools you use, they'll only ever provide data from a single perspective: From
whatever device and network connection the test was run. Sure, the improvements
you make based on synthetic test recommendations will help all your users, but
to _which degree_ is something you won't understand as long as synthetic testing
remains your only performance measurement strategy.

This is where Real User Monitoring (RUM) comes in. RUM relies on JavaScript APIs
in the browser to gather statistics on how sites perform for _real users_. Two
specific APIs measure how fast documents and resources load for users by
capturing [high-resolution
timings](/web/updates/2012/08/When-milliseconds-are-not-enough-performance-now)
which measure various phases of resource loading. These are the Network and
Resource Timing APIs, and this guide will help you make sense of the data they
provide.

## Easy APIs to help you understand network requests in the browser

Navigation and Resource Timing overlap significantly with one another, yet they
each collect metrics for different things:

- [**Navigation Timing**](https://w3c.github.io/navigation-timing/) collects
performance metrics for HTML documents.
- [**Resource Timing**](https://w3c.github.io/resource-timing/) collects
performance metrics for document-dependent resources. Stuff like style sheets,
scripts, images, _et cetera_.

If you don't know anything about either API, you might be tempted to brush them
off as too complex or unnecessary. The truth is, it's easy to _get_ data from
these APIs, and that data is _critical_ for measuring loading performance for
actual users. The _hard_ part is making sense of the data they provide, but
we'll cover all that soon enough. For now, let's experiment a little in the
console.

Navigation and Resource Timing (as well as other related APIs) store
_performance entries_ in a _performance entry buffer_. In simpler terms, that
just means they store performance metrics for pages and resources into a list
accessible by JavaScript. Those methods exist in the `window.performance`
namespace, and they help us query this list in different ways. For now, though,
let's keep it simple and stick with the [`getEntriesByType`
method](https://developer.mozilla.org/en-US/docs/Web/API/Performance/getEntriesByType).
To start, load any page in your browser, open the console, and enter either (or
both) of these commands:

```javascript
// Get Navigation Timing entries:
performance.getEntriesByType("navigation");

// Get Resource Timing entries:
performance.getEntriesByType("resource");
```

`getEntriesByType` accepts a string describing the type of entries you want. To
get Navigation Timing entries, use `"navigation"`. For Resource Timing entries,
use `"resource"`. After you run this, you'll see an array with an object of
performance timings for the current page that looks something like this:

```javascript
{
  "connectEnd":<PHONE_NUMBER>1136214,
  "connectStart": 85.00000007916242,
  "decodedBodySize": 1270,
  "domComplete":<PHONE_NUMBER>7953495,
  "domContentLoadedEventEnd":<PHONE_NUMBER>525266,
  "domContentLoadedEventStart":<PHONE_NUMBER>525266,
  "domInteractive":<PHONE_NUMBER>895692,
  "domainLookupEnd": 85.00000007916242,
  "domainLookupStart": 64.4000000320375,
  "duration":<PHONE_NUMBER>7953495,
  "encodedBodySize": 606,
  "entryType": "navigation",
  "fetchStart": 61.600000015459955,
  "initiatorType": "navigation",
  "loadEventEnd":<PHONE_NUMBER>7953495,
  "loadEventStart":<PHONE_NUMBER>7953495,
  "name": "https://example.com/",
  "nextHopProtocol": "h2",
  "redirectCount": 0,
  "redirectEnd": 0,
  "redirectStart": 0,
  "requestStart":<PHONE_NUMBER>8381903,
  "responseEnd":<PHONE_NUMBER>8177012,
  "responseStart":<PHONE_NUMBER>4190952,
  "secureConnectionStart":<PHONE_NUMBER>1937151,
  "startTime": 0,
  "transferSize": 789,
  "type": "navigate",
  "unloadEventEnd": 0,
  "unloadEventStart": 0,
  "workerStart": 0
}
```

The density of this information can be overwhelming, but just remember one
thing: Any time you've seen a waterfall chart, you're looking at a visual
representation of the data these APIs provide! In fact, it's possible to
generate your own visuals with this data. Good examples of this are scripts like
[Waterfall](https://github.com/andydavies/waterfall) by [Andy
Davies](https://twitter.com/AndyDavies) or
[Performance-Bookmarklet](https://github.com/micmro/performance-bookmarklet) by
[Michael Mrowetz](https://twitter.com/micmro).

Figure 1. The Waterfall bookmarklet showing timings for a
page and its resources.

Navigation and Resource Timing are APIs that help you measure how long stuff
takes to load. Because these APIs are a part of JavaScript, you can use them to
gather vital performance statistics from users when they visit your page. That's
powerful stuff!

## The life and timings of a network request

When you gather timings for page navigations and resource downloads, you're
playing the role of an archaeologist in the sense that you're reconstructing the
fleeting life of a network request after the fact. Sometimes it helps to
visualize a concept, and where network requests are concerned, there's no better
visualization tool than your browser's dev tools.

Figure 2. How a network request is visualized in the network
panel of Chrome’s developer tools.

As you can see, this request has all the fun stuff you'd expect: DNS lookup,
connection, TLS negotiation, and so on. Let's take a look together at the
important (and not so important) bits in Navigation and Resource Timing, and
demonstrate which properties and metrics can help you measure activity vital to
application performance! Let's dig in!

Note: This guide is a bit opinionated on which metrics are most important. If
you want an unopinionated bird's eye view of both APIs and the exact order
metrics appear in, [this Timing processing model
diagram](https://www.w3.org/TR/navigation-timing-2/#processing-model) is super
helpful.

### DNS lookup

When a user requests a URL, the Domain Name System (DNS) is queried to translate
a domain to an IP address. Depending any number of factors (notably DNS caches),
this process can take significant time. Or perhaps not, but maybe it's something
you want to measure anyway. Navigation and Resource Timing both expose two
DNS-related metrics:

- `domainLookupStart` marks when a DNS lookup starts.
- `domainLookupEnd` marks when a DNS lookup ends.

Quite simple, really! When a network request phase is this linear, measuring its
duration is as easy as subtracting the start metric from the end metric:

```javascript
// Measuring DNS lookup time
var pageNav = performance.getEntriesByType("navigation")[0];
var dnsTime = pageNav.domainLookupEnd - pageNav.domainLookupStart;
```

Now for some bad news: You can't _always_ rely on some metrics to be populated.
Some properties in both APIs will be `0` under certain conditions. For example,
both `domainLookupStart` and `domainLookupEnd` (and others) can be `0` for a
resource served by a third party if that host doesn't set a proper
[`Timing-Allow-Origin`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Timing-Allow-Origin)
response header. We won't get into the weeds on this just yet, but [we'll talk
about it later on](#cross-origins_and_the_timing-allow-origin_header). For now,
let's move on.

### Connection negotiation

When a connection to a server is made, latency occurs as the client and server
sort things out prior to sending resources to the client. If HTTPS is used
([which is increasingly
common](https://httparchive.org/reports/state-of-the-web#pctHttps)), this
process also includes TLS negotiation time. The connection phase consists of
three metrics:

- `connectStart` marks when the client opens a connection to the server.
- `secureConnectionStart` marks when the client begins TLS negotiation.
- `connectEnd` marks when connection negotiation ends (including TLS time).

These are _almost_ as simple as DNS metrics, but `secureConnectionStart` changes
things up. You may ask "why isn't there a `secureConnectionEnd` property?" The
answer is that TLS negotiation ends at the same time as `connectEnd`. In cases
where HTTPS isn't used (or [an HTTP connection
persists](https://en.wikipedia.org/wiki/HTTP_persistent_connection)), this value
will be `0`, so you'll need to perform appropriate checks rather than assuming
it will always be populated:

```javascript
// Quantifying total connection time
var pageNav = performance.getEntriesByType("navigation")[0];
var connectionTime = pageNav.connectEnd - pageNav.connectStart;
var tlsTime = 0; // <-- Assume 0 by default

// Did any TLS stuff happen?
if (pageNav.secureConnectionStart > 0) {
  // Awesome! Calculate it!
  tlsTime = pageNav.connectEnd - pageNav.secureConnectionStart;
}
```

After a domain's IP is looked up and a connection is established, the _real_ fun
starts.

### Requests and responses

When we think of what affects page speed, we're considering two factors:

- **Extrinsic factors:** This is stuff like connection latency and bandwidth.
They're (mostly) out of our control as developers.
- **Intrinsic factors:** These are things we have more control over, such as
server and client side architecture, and resource size.

Both types of factors affect request and response speed. Metrics related to this
process are arguably most important of all, as they tell a story of how long
each resource took to arrive. Both Navigation and Resource Timing describe
requests and responses with these metrics:

- `fetchStart` marks when the browser starts to fetch a resource. This is distinct
from a request in that it doesn't mark when the browser makes a network request
for a resource, but rather when it begins checking caches (e.g., HTTP and
service worker caches) to see if a network request is even necessary.
- `workerStart` marks when a request is being fetched from a [service
worker](/web/fundamentals/primers/service-workers/) within a [`fetch` event
handler](https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent) (if
applicable). This will be always be `0` if a service worker isn't installed for
the current page.
- `requestStart` is when the browser issues the network request.
- `responseStart` is when the first byte of the response arrives.
- `responseEnd` is when the last byte of the response arrives.

You can use these metrics to measure many aspects of loading performance. For
example, you could measure resource download time while keeping cache seek times
in mind:

```javascript
// Cache seek plus response time
var pageNav = performance.getEntriesByType("navigation")[0];
var fetchTime = pageNav.responseEnd - pageNav.fetchStart;

// Service worker time plus response time
var workerTime = 0;

if (pageNav.workerStart > 0) {
  workerTime = pageNav.responseEnd - pageNav.workerStart;
}
```

You can also measure a bunch of other useful stuff as the code below
demonstrates:

```javascript
// Request plus response time (network only)
var totalTime = pageNav.responseEnd - pageNav.requestStart;

// Response time only (download)
var downloadTime = pageNav.responseEnd - pageNav.responseStart;

// Time to First Byte (TTFB)
var ttfb = pageNav.responseStart - pageNav.requestStart;
```

### The other stuff

Now that we've covered the most important metrics provided by Navigation and
Resource Timing, let's briefly look at some of their less consequential metrics.

#### Document unloading

Unloading is when the browser does some housekeeping prior to loading a new
page. This isn't a big deal in typical circumstances, but it _could_ be worth
quantifying if you have code (especially from third parties) running in a
[`unload` event
handler](https://developer.mozilla.org/en-US/docs/Web/Events/unload) that holds
up the next page from rendering. If that describes your situation, you'll want
to pay attention to the
[`unloadEventStart`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming/unloadEventStart)
and
[`unloadEventEnd`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming/unloadEventEnd)
metrics.

Note: Unload metrics are exclusive to Navigation Timing.

#### Redirects

OK, page redirects aren't _totally_ inconsequential, but they might not be
something you run into very often. Still, redirects add latency to requests, so
measuring them may be worth the effort.

Figure 3. A redirect chain shown in Chrome’s developer
tools.

If you're concerned about redirects, both APIs provide the
[`redirectStart`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/redirectStart)
and
[`redirectEnd`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/redirectEnd)
metrics, which makes measuring redirect time a trivial task.

#### Document processing

When HTML documents load, the browser takes time to process them. Navigation
Timing exposes metrics to measure this, but they aren't usually consequential
unless _perhaps_ you're serving huge documents. If you're interested in document
processing metrics, they're
[`domInteractive`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming/domInteractive),
[`domContentLoadedEventStart`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming/domContentLoadedEventStart),
[`domContentLoadedEventEnd`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming/domContentLoadedEventEnd),
and
[`domComplete`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming/domComplete).

Note: Document processing metrics are exclusive to Navigation Timing.

#### Loading

When a document and its resources have completely finished loading, the browser
fires a [`load`
event](https://developer.mozilla.org/en-US/docs/Web/Events/load). Some emphasize
load time as the metric supreme, but [a shift in
focus](https://www.stevesouders.com/blog/2013/05/13/moving-beyond-window-onload/)
has taken place to prioritize perceptual metrics (e.g., [Speed
Index](https://sites.google.com/a/webpagetest.org/docs/using-webpagetest/metrics/speed-index))
over load time.

Still, measuring load time may be helpful to you.
[`loadEventStart`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming/loadEventStart)
and
[`loadEventEnd`](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming/loadEventEnd)
can help you with that when it comes to documents, but it's probably easiest to
just use the `duration` property.

Note: `loadEventStart` and `loadEventEnd` metrics are exclusive to Navigation
Timing.

#### Document and resource size

The _size_ of a document or resource is undoubtedly influential on loading
performance. Fortunately, both APIs expose properties for quantifying resource
payloads:

- `transferSize` is the _total size_ of the resource including HTTP headers.
- `encodedBodySize` is the _compressed size_ of the resource _excluding_ HTTP
headers.
- `decodedBodySize` is the _decompressed size_ of the resource (again, excluding
HTTP headers).

Using simple arithmetic, it's easy to figure out how much of a response consists
of HTTP headers or even compression ratios:

```javascript
// HTTP header size
var pageNav = performance.getEntriesByType("navigation")[0];
var headerSize = pageNav.transferSize - pageNav.encodedBodySize;

// Compression ratio
var compressionRatio = pageNav.decodedBodySize / pageNav.encodedBodySize;
```

You'll likely already be aware of resource size, and you don't really need an
API to tell you this stuff, as the network panel in any browser's dev tools
conveys this information. But the information _is_ there if you need it.

## Acquiring timings in application code

Now that you know some of the metrics provided by these APIs, let's cover how
you can collect that data in your application code.

### Other methods for manually grabbing timings

Earlier in this guide, you dabbled with `getEntriesByType`, which is great for
grabbing performance entries of a specific type. There are two other related
methods worth mentioning, however.

#### `getEntriesByName`

[`getEntriesByName`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/getEntriesByName)
gets a performance entry by its name. For Navigation and Resource Timing, this
is the URL for the document or resource:

```javascript
// Get timing data for an important hero image
var heroImageTime = performance.getEntriesByName("https://somesite.com/images/hero-image.jpg");
```

This is _super_ useful if you need to get a performance entry for a single
resource. It's also a better performing alternative to filtering out an array by
other means.

#### getEntries

Unlike `getEntriesByName` and `getEntriesByType`,
[`getEntries`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/getEntries)
gets everything in the performance entry buffer by default:

```javascript
// Get timing data for an important hero image
var allTheTimings = performance.getEntries();
```

But wait, there's more! `getEntries` can also serve as more verbose alternatives
to `getEntriesByName` and `getEntriesByType`:

```javascript
// Get timing data for an important hero image
var allTheTimings = performance.getEntries({
  // Get entries by name
  "name": "https://somesite.com/images/hero-image.jpg",
  // Get entries by type
  "entryType": "resource",
  // Get entries by their initiatorType value:
  "initiatorType": "img"
});
```

If `initiatorType` looks new to you, that's because I didn't cover it here.
[Find out more about `initiatorType` at
MDN](https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/initiatorType).

### Listen for performance entries using PerformanceObserver

Because methods like `getEntriesByType` return arrays, you may be tempted to use
a loop to work with them and say "good enough", but this approach is problematic
for the following reasons:

- Loops, especially over arrays with many entries, tie up the main thread.
- Loops only capture performance entries available at the time the loop was run.
Periodically polling the performance entry buffer via a timer is expensive, and
competes with the renderer which can cause jank.

[`PerformanceObserver`](/web/updates/2016/06/performance-observer) was created
to address such annoyances. Using an observer pattern similar to
[Mutation](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver) or
[Intersection
Observer](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver),
you can assign a callback that runs whenever new performance entries are
recorded:

```javascript
// Instantiate the performance observer
var perfObserver = new PerformanceObserver(function(list, obj) {
  // Get all the resource entries collected so far
  // (You can also use getEntriesByType/getEntriesByName here)
  var entries = list.getEntries();

  // Iterate over entries
  for (var i = 0; i < entries.length; i++) {
    // Do the work!
  }
});

// Run the observer
perfObserver.observe({
  // Polls for Navigation and Resource Timing entries
  entryTypes: ["navigation", "resource"]
});
```

This pattern can initially feel awkward if you don't have experience with
observers, but it soon becomes second nature. Word to the wise:
`PerformanceObserver` isn't available in all browsers Navigation and Resource
Timing are available in! In fact, both Internet Explorer and Edge don't support
`PerformanceObserver`, so feature check to avoid weirdness:

```javascript
// Should we even be doing anything with perf APIs?
if ("performance" in window) {
  // OK, yes. Check PerformanceObserver support
  if ("PerformanceObserver" in window) {
    // Observe ALL the performance entries!
  } else {
    // WOMP WOMP. Find another way. Or not.
  }
}
```

With code like this, you can decide for yourself how you should collect
performance timings (if at all). You may decide that collecting timings isn't
worth the trouble if `PerformanceObserver` isn't available. And that's totally
up to you!

### The gotchas

Working with timings isn't always straightforward. As you'll recall from
earlier, we brought up how some timings may be populated the way you'd expect in
some circumstances, and there can be other sticky situations.

#### Cross-origins and the Timing-Allow-Origin header

Collecting metrics for cross-origin resources is weird, because not all
performance timings are accessible for them if a [`Timing-Allow-Origin`
header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Timing-Allow-Origin)
isn't set. To find out which metrics are affected by this, check out [this
section](https://www.w3.org/TR/resource-timing-2/#cross-origin-resources) of the
Resource Timing spec.

If you run an application on multiple domains, or serve public assets as a third
party, you should set an appropriate `Timing-Allow-Origin` header so developers
can capture timings for resources hosted on them. Check out [the MDN
documentation for
`Timing-Allow-Origin`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Timing-Allow-Origin)
to learn more.

#### Persistent connections affect timings

A persistent HTTP connection is when a connection is reused to transmit
additional resources. This happens in HTTP/1 when a [`Connection: Keep-Alive`
header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Keep-Alive) is
used. When content is served over HTTP/2, a single connection is used to stream
_all_ resources for that origin. This behavior affects timings. It's not
something you may have to explicitly check for, it's just something to be aware
of when working with metrics later on.

#### These APIs aren't available everywhere

If working on the web has taught you anything, it's that you can't depend on
APIs being available everywhere. This is equally true of Navigation and Resource
Timing. The great thing about methods like `getEntriesByType` is that if they're
available, they won't throw errors if they can't find anything.

This is great and all, but it can lead to a bit of confusion. In the curious
case of Safari (as of version 11.2), Resource Timing is supported, but
Navigation Timing isn't. That leads to situations like this:

```javascript
// This returns stuff!
performance.getEntriesByType("resource");

// Not so much. :\
performance.getEntriesByType("navigation");
```

While this is a pain, it's not the end of the world. When you grab entries with
these methods, just check if anything was returned:

```javascript
if (performance.getEntriesByType("navigation").length > 0) {
  // Yay, we have Navigation Timing stuff!
}
```

Whether or not a browser supports these APIs, this is just a smart check to
make. You should never make assumptions about what data might be available,
because there are always cases where assumptions can backfire.

## Phoning home

So we now know how to use these APIs and get data from them, but how do you get
that data to a place where you can work with it? While this is by no means an
exhaustive reference on RUM data collection, it's a place to start.

### Using `navigator.sendBeacon`

You've collected performance entries, and now you're ready to send them
someplace to be analyzed later. But what's the best way?

Normally we'd POST timings to an endpoint during an `unload` event, because this
is when we know definitively the user is finished with the page. The problem,
however, is that running code during `unload` can hold the next page up from
downloading and rendering. We need to send data back in a way that won't tie up
the browser while it loads a new page. For this, we have
[`navigator.sendBeacon`](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon),
which queues non-blocking requests with POST data to be sent asynchronously at a
time of the browser's choosing:

```javascript
window.addEventListener("unload", function() {
  // Caution: If you have a _lot_ of performance entries, don't send _everything_ via getEntries. This is just an example.
  let rumData = new FormData();
  rumData.append("entries", JSON.stringify(performance.getEntries()));

  // Queue beacon request and inspect for failure
  if(!navigator.sendBeacon("/phone-home", rumData)) {
    // Recover here (XHR or fetch maybe)
  }
}, false);
```

On the other end would be some back end code that looks at the POST form data
and decides what to do with it from there. How you do this depends on your
application back end.

Note: `navigator.sendBeacon` only _queues_ the request when called, and may not
fulfill it immediately. Additionally, user agents pose restrictions on how much
data may be sent, and may reject the request if that limit is exceeded.

### When navigator.sendBeacon is unavailable

[While `navigator.sendBeacon` is well
supported](https://caniuse.com/#feat=beacon), you can't use it in all browsers.
Thus, some basic feature checking is necessary:

```javascript
window.addEventListener("unload", function() {
  // Collect RUM data like before
  let rumData = new FormData();
  rumData.append("entries", JSON.stringify(performance.getEntries()));

  // Check for sendBeacon support:
  if("sendBeacon" in navigator) {
    // Beacon the requested
    if(navigator.sendBeacon(endpoint, rumData)) {
      // sendBeacon worked! We're good!
    } else {
      // sendBeacon failed! Use XHR or fetch instead
    }
  } else {
    // sendBeacon not available! Use XHR or fetch instead
  }
}, false);
```

With this approach, you'll be able to reliably transmit RUM data in most
browsers. If total coverage isn't crucial, you can always opt to _not_ transmit
data when `navigator.sendBeacon` is unavailable.

## Wrapping up

To wrap up, here's some rather opinionated, er, opinions: If you're not
confident on how these timings work, don't calculate metrics on the front end
and send that computed data to your back end. Store the original metrics and
work with those later. This is advantageous for a number of reasons, but
primarily because it's flexible. If you store the original metrics, you can
always make corrections later in case of a measurement error.

Finally, you don't need to store _every_ metric these APIs provide. For example,
if you know for a fact you don't need to measure DOM processing time, don't feel
like you _have_ to store those metrics.

Of course, this guide isn't meant to be an exhaustive resource on these APIs,
but rather to help you start using them with some confidence. If you want
alternative perspectives on this topic, here's some additional reading:

- [Navigation Timing Level 2 Spec.](https://www.w3.org/TR/navigation-timing-2/)
- [Resource Timing Level 2 Spec.](https://www.w3.org/TR/resource-timing-2/)
- [Understanding Resource
Timing.](/web/tools/chrome-devtools/network-performance/understanding-resource-timing)
- [ResourceTiming in Practice.](https://nicj.net/resourcetiming-in-practice/)
- [Using Navigation Timing APIs to Understand Your
Webpage.](https://community.akamai.com/community/web-performance/blog/2016/08/25/using-navigation-timing-apis-to-understand-your-webpage)

Even if you normally shy away from deeply technical reads, the official specs
for Navigation and Resource Timings are easy to understand. They also break out
gotchas in a hugely beneficial way. If you ever ask yourself questions like
"when _is_ `secureConnectionStart` `0`?", the specifications explain all the
weirdness quite well.

With these APIs at your command, you'll be better equipped to understand how
loading performance is experienced by real users. This means you'll be better
equipped to diagnose and address performance issues in the wild, and that
knowledge is truly powerful.

_Special thanks to [Paul Irish](/web/resources/contributors/paulirish), Gray
Norton, [Addy Osmani](/web/resources/contributors/addyosmani), and [Philip
Walton](/web/resources/contributors/philipwalton) for their valuable feedback,
which significantly improved the quality of this article._

## Feedback {: #feedback }

{% include "web/_shared/helpful.html" %}

repository: agektmr/WebFundamentals

repo_name: agektmr/WebFundamentals


text:
---
title: Columns (Projections)
description: Documentation for the concept of a column (projection)
---

Projections allow you to select which aspects of the entries are shown.
They usually represent the columns in a report.

repository: NorfairKing/smos

branch_name: refs/heads/release

extension: markdown

gha_language: Haskell

repo_name: NorfairKing/smos


text:
# UK federation Metadata Toolchain

This is the metadata repository and main toolset for the [UK Access Management Federation for Education and Research](http://ukfederation.org.uk) ("the UK federation").

## Private and Public Repository Variants

There are two variants of the repository:

* The private variant of the repository is used as part of UK federation operations. This is where we maintain federation membership details and the individual metadata documents for each entity registered with the UK federation.

* The public, read-only variant of the repository is made available on [GitHub](https://github.com/ukf/ukf-meta). If you're reading this, you're probably accessing this more restricted version. We provide it for the benefit of other federation operators who may be wondering how the UK federation systems operate, perhaps with a view to implementing something similar.

The public repository is kept roughly in synchronisation with the private one using [our `ukf-meta-meta` tools](https://github.com/ukf/ukf-meta-meta). We do this when we have made significant changes to the toolset and we think other federation operators may find the changes of interest.

We exclude a significant amount of material from the public repository. One reason for this is to save space: for example, the private repository retains a copy of every signed metadata aggregate we have ever produced, going back to 2005.

The second main category excluded from the public repository is the actual registration database: version-controlled XML documents describing registered entities and the federation membership. We don't include this material because it may include personal information.

The failure to separate the tooling from the data is, in retrospect, a failing of our current systems and we are working to separate them more cleanly in the future.

## Licensing

Everything in the public repository is Copyright (C) 2004–2013, University of Edinburgh. Each file is made available to you under the following terms:

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

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

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

repository: biancini/ukf-meta

repo_name: biancini/ukf-meta


text:
# MrscFastComponents
Fast Multi-Robot Sorting Centers Components for Prototyping.

## To install the package:

#### Method 1: Clone from Repository

After cloning this repository, execute the following command from the command prompt.

```
python -m pip install MrscFastComponents\MrscFastComponentsCpp\.
```

#### Method 2: Install via PyPI

```
python -m pip install MrscFastComponents
```

## To build docs (Sphinx):

```
MrscFastComponents\MrscFastComponentsCpp\docs\make html
```

## To run doctests (Sphinx):

```
MrscFastComponents\MrscFastComponentsCpp\docs\make doctest
```


text:
## Fixed Interest/Return Rate

Select this type of return rate if a single interest/return rate is expected for an account.

To change the return rate, tap on the __Edit__ button, make the change, then tap on the __Done__ button to save the change.

### See Also

* [Variable Return Rate][varReturn]

repository: sroehling/FutureBudget

path: /Retirement Simulator/fixedReturn.md

repo_name: sroehling/FutureBudget


text:
# DSPromoteLib

[![CI Status](https://img.shields.io/travis/feng_xing<EMAIL_ADDRESS>[![Version](https://img.shields.io/cocoapods/v/DSPromoteLib.svg?style=flat)](https://cocoapods.org/pods/DSPromoteLib)
[![License](https://img.shields.io/cocoapods/l/DSPromoteLib.svg?style=flat)](https://cocoapods.org/pods/DSPromoteLib)
[![Platform](https://img.shields.io/cocoapods/p/DSPromoteLib.svg?style=flat)](https://cocoapods.org/pods/DSPromoteLib)

## Example

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

## Requirements

## Installation

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

```ruby
pod 'DSPromoteLib'
```

## Author

<EMAIL_ADDRESS><EMAIL_ADDRESS>
## License

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


text:
ansible-role-solr
=================

[![Build Status](https://travis-ci.org/kevincoakley/ansible-role-solr.svg?branch=master)](https://travis-ci.org/kevincoakley/ansible-role-solr)

An Ansible role that installs Apache Solr in either a standalone or replicated environment. Test with Solr version 7.2.0.

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

You must be running a Linux OS that has systemd enabled by default (RHEL 7, CentOS 7, Ubuntu 16.04+, Debian 8, etc). If you would like to run
a separate Zookeeper cluster, see https://galaxy.ansible.com/detail#/role/6555

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

Version of Solr to install.

	solr_version: 6.6.0

Zookeeper Connection String. Use <IP_ADDRESS>:2181 to use the Zookeeper server that comes with Solr.

	solr_zookeeper_connect_string: <IP_ADDRESS>:2181

Solr home/data directory.

	solr_home: /mnt/solr/solr

The port that Solr should listen on.

	solr_port: 8983

The Amount of memory that should be allocated to Solr.

	solr_memory: 512m

Dependencies
------------

None

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

Example solr_playbook.yml:

	- hosts: solr
	  sudo: yes

	  vars:
	    solr_version: 6.6.0
	    solr_zookeeper_connect_string: <IP_ADDRESS>:2181,<IP_ADDRESS>:2181,<IP_ADDRESS>:2181/solr

	  roles:
	    - solr

License
-------

BSD

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

Kevin Coakley (https://github.com/kevincoakley)


text:
To use the common GSuite API logic (authentication and API requests), run the following command to import the `GSuiteApiModule`.

```python
def main():
    ...

from GSuiteApiModule import *  # noqa: E402

if __name__ in ["builtins", "__main__"]:
    main()
```

Then, the `GSuiteClient` will be available for usage. For examples, see the `G Suite Admin` or `Google Drive` or `Google Calendar` integrations.

repository: demisto/content

repo_name: demisto/content


text:
---
title: Balancers
permalink: /guide/balancers/
phase: run
---

A _balancer_ is a stable network endpoint that distributes traffic to the individual containers of a service.

### General Docker patterns

A common pattern when using Docker Compose is to declare a simple web frontend service. For example, this might mean a container based on the `nginx` base image (perhaps called `web`, `lb`, `www`, or the like), to which a simple `nginx.conf` file is added.

This NGINX container then serves as a lightweight proxy or load balancer which passes web requests to the appropriate container using its service name, which in Compose resolves automatically to the internal IP of the corresponding container.

In other words, in general terms and in the Docker world, a balancer is a stable network endpoint that distributes traffic to the individual containers of a service, enabling you to interact with a service over the network without knowledge of the service's containers' internal IPs or the host they're running on.

## Convox Balancer

We built Convox with the goal of ensuring maximum similarity between development and production. Apps deployed with Convox are automatically assigned their own Elastic Load Balancer in production. To emulate this behavior locally, Convox starts a local proxy container that emulates the production ELB.

When you run `convox start`, this proxy container is automatically started and configured under the hood by looking at the `ports:` section of your `docker-compose.yml`:

version: '2'
services:
  web:
    build: .
    command: ["node", "web.js"]
    ports:
     - 80:8000
  worker:
    build: .
    command: ["node", "worker.js"]
    environment:
     - GITHUB_API_TOKEN

An _internet_ balancer is defined by a pair of external and internal ports, e.g. `80:8000`. The balancer will listen to the internet on port `80` and forward requests to app containers that are bound to port `8000`.

An _internal_ balancer is defined by a single port, e.g. `8000`. The balancer will not listen to the internet, but will listen on port `8000` on the internal network and forward requests to app containers that are bound to port `8000`.

For details on these two types of Elastic Load Balancers, see the AWS ELB documentation:

* [Internet-Facing Classic Load Balancers](http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-internet-facing-load-balancers.html)
* [Internal Classic Load Balancers](http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/elb-internal-load-balancers.html)

The Convox balancer looks at your services' published ports and publishes those same ports itself instead, then automatically passes requests to those containers just as you would expect it to based on the contents of your `docker-compose.yml`. In this way, you're sure to get the same behavior when you run `convox deploy`, where a real ELB performs the same function.

Run `convox doctor` to validate your balancer definitions:

convox doctor

### Run: Balancer
[✓] Application exposes ports
[✓] Service web has valid ports

Now that you have defined Balancers, you can [add SSL](/guide/ssl/).

{% include_relative _includes/next.html
  next="Add SSL"
  next_url="/guide/ssl"
%}

repository: soulshake/hugo-site

repo_name: soulshake/hugo-site


text:
---
layout: post
title: 3-D Reconstruction with Vision
category: Machine Vision
tag: Machine Vision
---

https://towardsdatascience.com/3-d-reconstruction-with-vision-ef0f80cbb299

Homography is
Note that the homography matrix is a mapping between two planes. We have considered it here as a mapping from the image plane to a physical plane, but it could map between two image planes. The inverse of a homography will also provide the reverse mapping between the two planes.

disparity in image processing
The disparity image is one where the value of each pixel is inversely related to the distance between that point in the scene and the camera.


text:
ansible-lssd
============

Large scale server deploys using BitTorrent. aria2c, NodeJS Bittorrent-tracker and mktorrent are used.

DESCRIPTION
-----------

ansible-lssd  is a method of using Bittorrent to distribute files to a large amount of servers within a production environment.

ansible-lssd operates as a playbook of [Ansible](https://github.com/ansible/ansible).
These playbooks require Ansible 1.4.

These playbooks were tested on CentOS 7.x (ansible 2.6) with peers on Centos 7.x and Centos 6.x.

Advantage
---------

There is the following advantage as compared with Murder.
* *Ruby is not required*  to run on only python.
* *Capistrano is not required*. run in the ansible playbooks.
* Environment setup is automated by playbook.

Installation of software required minimum
-----------------------------------------

From EPEL:
# yum -y install ansible

HOW IT WORKS
------------

Same as the "[HOW IT WORKS](https://github.com/lg/murder/blob/master/README.md#how-it-works)" of Murder.

CONFIGURATION
-----------------------

You define `tracker`, `seeder` and `peer` server to inventory (./production) file.

All involved servers must have python installed.

The file group_vars/all contains the configuration.

MANUAL USAGE
------------

Modify a ./production and ./group_vars/all, manually define servers:

./production:
  ```INI:production
  # ansible host
  [ansible_host]
  localhost ansible_connection=local

  # tracker node
  [tracker]
  <IP_ADDRESS> node_type=tracker

  # seeder node
  [seeder]
  <IP_ADDRESS> node_type=seeder

  # peer nodes
  [peer]
  <IP_ADDRESS>
  <IP_ADDRESS>
  <IP_ADDRESS>
  ```

group_vars/all:
  ```YAML:group_vars/all
  # deploy tag
  tag: Deploy1

  # path
  seeder_files_path:  ~/builds
  destination_path:   /opt/hoge  # or some other directory
  ```

The destination_path, by setup.yml, specify the directory to be placed in the all server of Murder library and support files etc..

Then manually run the ansible playbooks:

1. Start the tracker:

  ```bash:
  $ ansible-playbook -i production start_tracker.yml
  ```

2. Create a torrent from a directory of files on the seeder, and start seeding:

  ```bash:
  # copy to seeder node
  $ scp -r ./builds <IP_ADDRESS>:~/builds

  # create torrent file
  $ ansible-playbook -i production create_torrent.yml

  # start seeding
  $ ansible-playbook -i production start_seeder.yml
  ```

3. Distribute the torrent to all peers:

  ```bash:
  $ ansible-playbook -i production deploy.yml -f 1000
  ```

4. Stop the seeder and tracker:

  ```bash:
  $ ansible-playbook -i production stop_seeder_and_tracker.yml
  ```

When this finishes, all peers will have the files in /opt/hoge/Deploy1

MAIN PLAYBOOKS REFERENCE
------------------------

* `create_torrent.yml:`
  * Create torrent file on seeder node.
* `deploy.yml:`
  * Deploy files on peer nodes.
* `setup.yml:`
  * Install the software required for each node.
* `full_deploy.yml:`
  * Run all Playbook deploy from the setup.
* `start_seeder.yml:`
  * start seeding.
* `start_tracker.yml:`
  * start tracker.
* `stop_all_peers.yml:`
  * stop all peer client.
* `stop_seeder_and_tracker.yml:`
  * stop seeding and tracker.

NOTES
------------------------

You may hit the request length limit (fixed in newer aria2 releases) :
https://github.com/aria2/aria2/commit/e220c5384961f9261f19c28cd0b85f76f06d8993#diff-03671aebef9174610c96db97917b960a

Workaround is using "-l 22" as mktorrent option to make less pieces.

repository: yohan-b/ansible-lssd

repo_name: yohan-b/ansible-lssd


text:
+++
title = "Surgical Robot Automation & Control"
date = 2018-07-05T23:24:46-07:00
draft = false

# Tags: can be used for filtering projects.
# Example: `tags = ["machine-learning", "deep-learning"]`
tags = []

# Project summary to display on homepage.
summary = "More than half a million abdominal, gynecologic, urologic and cardiac surgeries are performed minimally invasivelly with surgical robots. Current surgical robotics systems are fully teleoperated. Full or partial automation of some repetitive tasks like palpating and suturing has the potential to reduce surgeon errors, duration of procedures, trauma and expense. I have worked on partial automation and shared-control of surgical sub-tasks in a multilateral setting. "

# Optional image to display on homepage.
image_preview = "research/surgical_robot.jpg"

# Optional external URL for project (replaces project detail page).
external_link = ""

# Does the project detail page use math formatting?
math = false

# Does the project detail page use source code highlighting?
highlight = true

# Featured image
# Place your image in the `static/img/` folder and reference its filename below, e.g. `image = "example.jpg"`.
[header]
image = ""
caption = ""

+++

Details coming soon...

repository: yuhangc/personal-website

repo_name: yuhangc/personal-website


text:
## net.hh

An attempt to simplify the Berkley Sockets API

* Removes boilerplate
* APIs return objects where applicable (instead of half-filled socket structures and error codes)
* Exceptions.
* Header only. Inclusion of `net_buffer.hh` is optional via `USE_NET_BUFFER` macro.

### Example

```c++
#define USE_NET_BUFFER
#include "net.hh"

int main()
{
    /* UDP Socket which will interact with IPv4 address */
    net::ipv4::socket sock4 {SOCK_DGRAM};
    /* TCP Socket which will interact with IPv6 address */
    net::ipv6::socket sock6 {SOCK_STREAM};

    /* IPv4 wildcard address (<IP_ADDRESS>) */
    net::ipv4::address addr4 {net::ipv4::address::ANY, 9998};
    /* IPv6 loopback */
    net::ipv6::address addr6 {"::1", 9999};

    /* Create some buffer of data (unique_ptr) and send
     * to the IPv4 address
     */
    auto buffer = net::make_buffer(512);
    sock4.sendto(*buffer.get(), addr4);

    /* Bind and listen */
    sock6.bind(addr6);
    sock6.listen();

    /* Wait for a client...
     * client.first == net::ipv6::socket
     * client.second == net::Address with AF_INET6
     */
    auto client = sock6.accept();
}
```

###  TODO
* Fill out CRTP base classes (socket, address)
* Raw sockets, DCCP, Multicast, Broadcast, TUN, TAP
* IP and UDP header construction.
* Linux-only optional header with `netlink` sockets and `netfilter` bindings