hexsha
stringlengths 40
40
| size
int64 5
1.04M
| ext
stringclasses 6
values | lang
stringclasses 1
value | max_stars_repo_path
stringlengths 3
344
| max_stars_repo_name
stringlengths 5
125
| max_stars_repo_head_hexsha
stringlengths 40
78
| max_stars_repo_licenses
sequencelengths 1
11
| max_stars_count
int64 1
368k
⌀ | max_stars_repo_stars_event_min_datetime
stringlengths 24
24
⌀ | max_stars_repo_stars_event_max_datetime
stringlengths 24
24
⌀ | max_issues_repo_path
stringlengths 3
344
| max_issues_repo_name
stringlengths 5
125
| max_issues_repo_head_hexsha
stringlengths 40
78
| max_issues_repo_licenses
sequencelengths 1
11
| max_issues_count
int64 1
116k
⌀ | max_issues_repo_issues_event_min_datetime
stringlengths 24
24
⌀ | max_issues_repo_issues_event_max_datetime
stringlengths 24
24
⌀ | max_forks_repo_path
stringlengths 3
344
| max_forks_repo_name
stringlengths 5
125
| max_forks_repo_head_hexsha
stringlengths 40
78
| max_forks_repo_licenses
sequencelengths 1
11
| max_forks_count
int64 1
105k
⌀ | max_forks_repo_forks_event_min_datetime
stringlengths 24
24
⌀ | max_forks_repo_forks_event_max_datetime
stringlengths 24
24
⌀ | content
stringlengths 5
1.04M
| avg_line_length
float64 1.14
851k
| max_line_length
int64 1
1.03M
| alphanum_fraction
float64 0
1
| lid
stringclasses 191
values | lid_prob
float64 0.01
1
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
544aa45af3c37cb97c60aeb1a26abce124006649 | 66 | md | Markdown | README.md | jogramphy/spotify-scraper | f1ca295008c9b60e1100d892fa0c8e9705e29953 | [
"MIT"
] | null | null | null | README.md | jogramphy/spotify-scraper | f1ca295008c9b60e1100d892fa0c8e9705e29953 | [
"MIT"
] | null | null | null | README.md | jogramphy/spotify-scraper | f1ca295008c9b60e1100d892fa0c8e9705e29953 | [
"MIT"
] | null | null | null | # spotify-scraper
Scrape spotify followers and monthly listeners
| 22 | 47 | 0.833333 | eng_Latn | 0.998153 |
544af3e19f7250203b5ab1c72009f618dd5cb544 | 40 | md | Markdown | README.md | muell036/ProTech | 2920545950088ce753def39c7fa47d9ff94e2c63 | [
"Apache-2.0"
] | null | null | null | README.md | muell036/ProTech | 2920545950088ce753def39c7fa47d9ff94e2c63 | [
"Apache-2.0"
] | null | null | null | README.md | muell036/ProTech | 2920545950088ce753def39c7fa47d9ff94e2c63 | [
"Apache-2.0"
] | null | null | null | # ProTech
Mobile Wifi Security Solution
| 13.333333 | 29 | 0.825 | eng_Latn | 0.595404 |
544b36f4382d1798828bc377d2addb9a0552e26f | 722 | md | Markdown | .github/README.md | SFDigitalServices/ooc-permit-list-sd-mspy | e3403db304a4eae380a8f45bcd433bd656bee65f | [
"MIT"
] | null | null | null | .github/README.md | SFDigitalServices/ooc-permit-list-sd-mspy | e3403db304a4eae380a8f45bcd433bd656bee65f | [
"MIT"
] | 2 | 2019-08-16T17:34:00.000Z | 2021-06-02T00:07:36.000Z | .github/README.md | SFDigitalServices/ooc-permit-list-sd-mspy | e3403db304a4eae380a8f45bcd433bd656bee65f | [
"MIT"
] | null | null | null | # SFDS OOC PERMIT LIST SCREENDOOR MICROSERVICE.PY [](https://circleci.com/gh/SFDigitalServices/ooc-permit-list-sd-mspy) [](https://coveralls.io/github/SFDigitalServices/ooc-permit-list-sd-mspy?branch=master)
This microservice returns a list of OOC permits from Screendoor
### Sample Usage
Start WSGI Server
> (ooc-permit-list-sd-mspy)$ gunicorn 'service.microservice:start_service()'
Open with cURL or web browser
> $curl http://127.0.0.1:8000/list/retail
> $curl http://127.0.0.1:8000/list/retail_legacy | 65.636364 | 422 | 0.783934 | yue_Hant | 0.520941 |
544c87eb492d608a2b310e509fd0907f7fa60481 | 708 | md | Markdown | _posts/2021-03-01-dailylog-03-01-21-2.md | aaroncaraway/aaroncaraway.github.io | 563e5fd9751f043d97d2eedf828455f4ff4eef34 | [
"MIT"
] | null | null | null | _posts/2021-03-01-dailylog-03-01-21-2.md | aaroncaraway/aaroncaraway.github.io | 563e5fd9751f043d97d2eedf828455f4ff4eef34 | [
"MIT"
] | 1 | 2022-03-24T17:49:30.000Z | 2022-03-24T17:49:30.000Z | _posts/2021-03-01-dailylog-03-01-21-2.md | aaroncaraway/aaroncaraway.github.io | 563e5fd9751f043d97d2eedf828455f4ff4eef34 | [
"MIT"
] | null | null | null | ---
layout: single
title: 'dailylog 03-01-21 pt 2'
tags: dailylog react questions
---
## RE: Caroline Googlesheets
1. Is it best to get ALL the data right away and then simply display what I want when clicked?
2. Should I use useMemo?
3. How many 'useEffects' in one file are too many in one file?
### 30 second summary:
You don't need to use a callback with setState -- you just need to do a useEffect. This is how I did it (not sure if best practice?)
```javascript
useEffect(() => {
const formatAboutData = () => {
if (aboutData) {
aboutPhoto = aboutData[1].content['$t'];
console.log('running NOW', aboutData[1].content['$t']);
}
};
formatAboutData();
}, [aboutData]);
```
| 25.285714 | 132 | 0.666667 | eng_Latn | 0.961936 |
544d594f544cd32f68bf364fc691d5c08e41a551 | 807 | md | Markdown | _posts/2018-07-28-Meetup-August-14th.md | mccombsp-kingco/psqgis.github.io | a799ea3ffccfd14dd9b3b2286e2777329b68588b | [
"MIT"
] | null | null | null | _posts/2018-07-28-Meetup-August-14th.md | mccombsp-kingco/psqgis.github.io | a799ea3ffccfd14dd9b3b2286e2777329b68588b | [
"MIT"
] | 11 | 2015-06-08T16:14:08.000Z | 2018-02-06T21:03:06.000Z | _posts/2018-07-28-Meetup-August-14th.md | mccombsp-kingco/psqgis.github.io | a799ea3ffccfd14dd9b3b2286e2777329b68588b | [
"MIT"
] | 5 | 2015-06-08T16:09:27.000Z | 2017-08-28T15:29:48.000Z | ---
layout: post
title: "Meetup August 14th, 2018 - InterIM CDA"
date: 2018-07-28
schedule: 2018-08-14T18:00:00.0-7
---
## [Our Monthly Meeting](https://www.meetup.com/Puget-Sound-QGIS-Users-Group/events/sgdhmpyxlbsb/)
## Tuesday August 14th, 6-8pm
[InterIM CDA - 310 Maynard Ave South, Seattle, WA](https://www.openstreetmap.org/?mlat=47.599777&mlon=-122.324669#map=18/47.59957/-122.32641)
---
### Agenda: ###
1. Paul will share his recent experience using the US Census Bureau's customized QGIS based GUPS software to participate in the Local Update of Census Addresses in preparation for the 2020 US Census.
2. Any topics folks like to share/demonstrate. If you know ahead of time, please send a message via Meetup or the Google Group. Or, just show up and and share what you've got.
Paul McCombs
| 36.681818 | 199 | 0.744734 | eng_Latn | 0.808862 |
544fcd2a5e2c96118ca8acf43a018ba29e474d4d | 783 | md | Markdown | docs/content/reference/cli/meshctl_debug.md | Sodman/gloo-mesh | eb63823563fe8df15ba5b67106411e1c8a4a3cc2 | [
"Apache-2.0"
] | 160 | 2020-11-12T01:29:35.000Z | 2022-03-24T10:03:32.000Z | docs/content/reference/cli/meshctl_debug.md | Sodman/gloo-mesh | eb63823563fe8df15ba5b67106411e1c8a4a3cc2 | [
"Apache-2.0"
] | 818 | 2020-11-11T21:09:29.000Z | 2022-03-24T18:28:14.000Z | docs/content/reference/cli/meshctl_debug.md | Sodman/gloo-mesh | eb63823563fe8df15ba5b67106411e1c8a4a3cc2 | [
"Apache-2.0"
] | 33 | 2020-11-14T06:00:58.000Z | 2022-03-02T16:04:12.000Z | ---
title: "meshctl debug"
weight: 5
---
## meshctl debug
Debug Gloo Mesh resources
### Options
```
-h, --help help for debug
```
### Options inherited from parent commands
```
-v, --verbose Enable verbose logging
```
### SEE ALSO
* [meshctl](../meshctl) - The Command Line Interface for managing Gloo Mesh.
* [meshctl debug metrics](../meshctl_debug_metrics) - metrics for the discovery and networking pods.
* [meshctl debug report](../meshctl_debug_report) - meshctl debug report selectively captures cluster information and logs into an archive to help diagnose problems.
* [meshctl debug snapshot](../meshctl_debug_snapshot) - Input and Output snapshots for the discovery and networking pods. Requires jq to be installed if the --json flag is not being used.
| 27.964286 | 188 | 0.725415 | eng_Latn | 0.929527 |
5450542e9f5b69e23435e20ee2538d3366be4f79 | 1,725 | md | Markdown | BatchLabelMap/automatic/pydicom/data/palettes/README.md | weras2/BatchLabelMap | 56af3d20df79f6b10a5d932278a33d02020d1e59 | [
"MIT"
] | null | null | null | BatchLabelMap/automatic/pydicom/data/palettes/README.md | weras2/BatchLabelMap | 56af3d20df79f6b10a5d932278a33d02020d1e59 | [
"MIT"
] | 1 | 2020-11-26T19:53:16.000Z | 2020-11-26T19:53:16.000Z | BatchLabelMap/automatic/pydicom/data/palettes/README.md | weras2/BatchLabelMap | 56af3d20df79f6b10a5d932278a33d02020d1e59 | [
"MIT"
] | null | null | null | DICOM Well-known Color Palettes
http://dicom.nema.org/medical/dicom/current/output/chtml/part06/chapter_B.html
+----------------------------+---------------------+------------------+
| (0070,0080) Content Label | SOP Instance UID | Filename |
+============================+=====================+==================+
| HOT_IRON | 1.2.840.10008.1.5.1 | hotiron.dcm |
+----------------------------+---------------------+------------------+
| PET | 1.2.840.10008.1.5.2 | pet.dcm |
+----------------------------+---------------------+------------------+
| HOT_METAL_BLUE | 1.2.840.10008.1.5.3 | hotmetalblue.dcm |
+----------------------------+---------------------+------------------+
| PET_20_STEP | 1.2.840.10008.1.5.4 | pet20step.dcm |
+----------------------------+---------------------+------------------+
| SPRING | 1.2.840.10008.1.5.5 | spring.dcm |
+----------------------------+---------------------+------------------+
| SUMMER | 1.2.840.10008.1.5.6 | summer.dcm |
+----------------------------+---------------------+------------------+
| FALL | 1.2.840.10008.1.5.7 | fall.dcm |
+----------------------------+---------------------+------------------+
| WINTER | 1.2.840.10008.1.5.8 | winter.dcm |
+----------------------------+---------------------+------------------+
* All color palettes have 256 LUT entries, a first mapping of 0, and 8-bit
entries
* HOT_IRON, PET, HOT_METAL_BLUE, and PET_20_STEP use normal color palette LUT
data.
* SPRING, SUMMER, FALL and WINTER use segmented color palette LUT data.
| 57.5 | 78 | 0.324058 | yue_Hant | 0.29261 |
5450daf055ede49f974298babc7f683620ac905a | 4,730 | md | Markdown | README.md | tristan-van-pantel/blockplan | b26fb52f11773a7787eef99a0756e54c46dc28e7 | [
"MIT"
] | null | null | null | README.md | tristan-van-pantel/blockplan | b26fb52f11773a7787eef99a0756e54c46dc28e7 | [
"MIT"
] | null | null | null | README.md | tristan-van-pantel/blockplan | b26fb52f11773a7787eef99a0756e54c46dc28e7 | [
"MIT"
] | null | null | null |
# Blockplan - Schulverwaltung und Stundenplanerstellung für Schulen mit Blockunterricht
## Wofür ist die Anwendung gedacht?
1. #### Stundenplanerstellung
Die Anwendung soll es Bildungseinrichtungen mit Blockunterricht ermöglichen ihre Stundenpläne fehlerfrei zu erstellen, da dies in der Praxis oft noch mit Hilfe von Stecktafeln, auf Papier oder mit Hilfe von Tabellenkalkulationen geschieht.
Anders: die "Ressourcen" Klassen, Dozenten, Räume und Fächer sollen von den Administratoren auf der Zeitachse fehlerfrei und komfortabel zu "Fachterminen" zusammengefügt werden können.
2. #### Verwaltung der beteiligten Ressourcen
Neben der Erstellung des Stundenplans können die Administratoren selbstverständlich die daran beteiligten Ressourcen verwalten:
- Klassen
- Fächer
- Schüler
- Dozenten
- Räume
- Ferien/Feiertage
3. #### Weitere administrative Funktionen
- Nutzer-/Rollen-Verwaltung
- Veröffentlichung von Nachrichten (Schulkassen als Empfänger)
- Veröffentlichung von Arbeitsangeboten (Schulklassen als Empfänger)
- Fehlzeiten verwalten
4. #### Stundenplandarstellung
Gleichzeitig soll der daraus resultierende Stundenplan den jeweiligen Schülern und Dozenten im öffentlichen Bereich dargestellt werden.
5. #### Virtuelles Klassenzimmer
Ergänzend zum Präsenzunterricht sollen Schüler und Dozenten Informationen zu jeweils aktuellen Kurs austauschen können.
5. #### Krankmeldung
Schüler können sich über die Anwendung krankmelden.
Diese Funktion ist allerdings nicht datenschutzkonform und sollte deswegen nicht in Produktivumgebungen genutzt werden.
6. #### Dashboard
Schüler könnten persönliche Informationen wie etwa absolvierte Fächer, geplante Fächer und Fehltage einsehen.
## Installation
1. Eine Datenbank im DBMS der Wahl anlegen
2. Im Rootverzeichnis liegt die `.env`-Konfigurationsdatei.. Hier müssen die folgenden Zeilen dem DMBS und der gerade erstellen Datenbank entsprechend angepasst werden:
`database.default.hostname`,
`database.default.database`,
`database.default.password`
3. Im Produktivbetrieb muss zusätzlich noch die Zeile `CI_ENVIRONMENT = development` geändert werden in: `CI_ENVIRONMENT = production`
4. Falls NICHT lokal getestet werden soll folgende Datei öffnen:
`app/Config/`**`App.php`**
Hier muss die folgende Zeile an die Base-URL der Anwendung angepasst werden:
`public $baseURL = 'http://localhost:8080/'`
5. Migration der Datenbankstruktur mittels `php spark migrate -all`
Anschließend müssten alle Tabellen in der Datenbank vorhanden sein.
6. Falls lokal getestet wird und somit die `$baseURL` unter `4.` nicht geändert wurde, lässt sich die Anwendung mittels `php spark serve` lokal hosten.
7. Bevor jetzt über das Register-Form der erste Nutzer angelegt werden kann, muss noch ein manueller Schritt auf Datenbank-Ebene erfolgen, da der neue Nutzer sonst keiner Gruppe zugefügt werden kann:
```
INSERT INTO auth_groups (name)
VALUES ('admins'), ('lecturers'), ('students'), ('users');`
```
8. Im Anschluss über das Register-Form der Anwendung den neuen (ersten) Nutzer anlegen.
Dieser erste Nutzer ist automatisch der Superadmin, der auch nicht von den anderen Admins
gelöscht oder entmachtet werden kann.
9. Damit dieser erste Nutzer auch wirklich Admin ist, muss einer weiterer Schritt auf Datenbank-Ebene ausgeführt werden:
```
UPDATE highschool.auth_groups_users
SET group_id = 1
WHERE user_id = 1;
```
10. Anschließend in der Datei `vendor/myth/auth/src/Controllers/`**`AuthController.php`**
nach folgender Zeile suchen: ` //uncomment the next three lines,after you have have created your first user and put him into group 1 ("admins")`
und entsprechend der Anweisung die darauf folgenden drei Zeilen dekommentieren. Nun können lediglich Administratoren neue Nutzer anlegen.
11. Der nun nutzlose Link zum Register-Form auf der Login-Seite muss noch entfernt werden. Dazu bitte `vendor/myth/auth/src/Views/`**`login.php`** öffnen und folgende Zeilen löschen:
```
<?php if ($config->allowRegistration) : ?>
<p><a href="<?= route_to('register') ?>"><?=lang('Auth.needAnAccount')?</a></p>
<?php endif; ?>
```
## Server Requirements
PHP version 7.2 or higher is required, with the following extensions installed:
- [intl](http://php.net/manual/en/intl.requirements.php)
- [libcurl](http://php.net/manual/en/curl.requirements.php) if you plan to use the HTTP\CURLRequest library
Additionally, make sure that the following extensions are enabled in your PHP:
- json (enabled by default - don't turn it off)
- [mbstring](http://php.net/manual/en/mbstring.installation.php)
- [mysqlnd](http://php.net/manual/en/mysqlnd.install.php)
- xml (enabled by default - don't turn it off)
| 43.394495 | 239 | 0.775264 | deu_Latn | 0.993058 |
5451436bb6d41e8a9dc9d762196d263297939763 | 2,001 | md | Markdown | src/da/2020-04/06/02.md | PrJared/sabbath-school-lessons | 94a27f5bcba987a11a698e5e0d4279b81a68bc9a | [
"MIT"
] | 68 | 2016-10-30T23:17:56.000Z | 2022-03-27T11:58:16.000Z | src/da/2020-04/06/02.md | PrJared/sabbath-school-lessons | 94a27f5bcba987a11a698e5e0d4279b81a68bc9a | [
"MIT"
] | 367 | 2016-10-21T03:50:22.000Z | 2022-03-28T23:35:25.000Z | src/da/2020-04/06/02.md | PrJared/sabbath-school-lessons | 94a27f5bcba987a11a698e5e0d4279b81a68bc9a | [
"MIT"
] | 109 | 2016-08-02T14:32:13.000Z | 2022-03-31T10:18:41.000Z | ---
title: I stedet for at gemme sig
date: 01/11/2020
---
`Læs 1 Mos 3,1-11 Rom 5,11-19. Hvorfor spurgte Gud Adam: ”Hvor er du?“`
Typiske genfortællinger af syndefaldet beskriver frugten som et æble. Men det er ikke, hvad teksten siger. Det var ganske enkelt ”frugten på det træ, der står midt i haven“ (1 Mos 3,3). Det spiller ingen rolle, hvilken slags frugt det var. Det var forbudt at spise af frugten på grund af det, som træet symboliserede, nemlig fristelsen til at skubbe Gud til side og sige: ”Jeg kan bestemme over mit eget liv. Jeg kan selv være Gud. Jeg har autoritet over Guds ord.“
Og ganske rigtigt. Da slangen fik Adam og Eva til at spise af træets frugt, blev deres liv afsporet. Og da de fornemmede, at Gud var i nærheden, forsøgte de at gemme sig ”mellem havens træer“ (1 Mos 3,8).
Det virker mærkeligt, at Gud skulle spørge Adam: ”Hvor er du?“ Gud vidste helt sikkert, hvor han var. Måske stillede Gud spørgsmålet for at hjælpe Adam og Eva til at indse, hvad de var i gang med – at skjule sig – som en følge af det, de havde gjort. Han hjalp dem med andre ord til at se det sørgelige resultat af deres handlinger.
`Til eftertanke. Mange gange forbinder Paulus direkte det, Adam gjorde i Edens have, med det, Jesus gjorde på korset. Hvad fortæller det om, hvordan Jesus kom for at rette op på det, Adam gjorde?`
Man kan sige, at frelsesplanen er Guds svar på Adams og Evas svar. De gemte sig for Gud i skam og skyld over deres synd, og Gud kom for at redde dem. Vi har på vores egne måder gjort det samme, og Jesus kom for at redde os. Derfor kan spørgsmålet ”Hvor er du?“ også stilles til os. Hvor er du i din synd og skyld i forhold til Jesus, og hvad har han gjort for at frelse dig fra det?
`Kristen uddannelse har mange konsekvenser. Hvorfor må den altid indebære og understrege den kendsgerning, at vores naturlige tendens er at gemme os for Gud, og pege os hen til Jesus som den eneste løsning? Hvordan viser det sig i den måde, hvorpå vi uddanner os og vores børn?` | 111.166667 | 465 | 0.761619 | dan_Latn | 0.999935 |
5451930f8405a2864c39ebbd2ee955948be0c258 | 807 | md | Markdown | admin/README.md | JohnChantz/transport-tracker | df69c9fa03a17877f0dea2a61444e5a9c46922fd | [
"Apache-2.0"
] | null | null | null | admin/README.md | JohnChantz/transport-tracker | df69c9fa03a17877f0dea2a61444e5a9c46922fd | [
"Apache-2.0"
] | null | null | null | admin/README.md | JohnChantz/transport-tracker | df69c9fa03a17877f0dea2a61444e5a9c46922fd | [
"Apache-2.0"
] | null | null | null | # Admin
This is a web interface for administrators to see a quick overview of all the
assets being tracked, and also to make updates to the GTFS schedule.
## Usage
This app has two dependencies: the
[Google Static Maps API](https://developers.google.com/maps/documentation/static-maps/)
to display a map,
and [Firebase Realtime Database](https://firebase.google.com/docs/database/).
To authorize access to the Google Static Maps API, add an API key in
`mapsApiKey` at the top of `main.js`, using the process outlined in
[Static Maps API: Get a Key](https://developers.google.com/maps/documentation/static-maps/get-api-key).
To authenticate to Firebase, populate the `serviceAccountKey.json` file using the
process outlined in
[Firebase Admin SDK setup](https://firebase.google.com/docs/admin/setup).
| 40.35 | 103 | 0.776952 | eng_Latn | 0.850964 |
5451ebd38757ccc31526c25f53daca45409e930a | 2,641 | md | Markdown | _posts/2019-07-23-Download-the-role-of-the-sangha-in-the-reconciliation-process.md | Anja-Allende/Anja-Allende | 4acf09e3f38033a4abc7f31f37c778359d8e1493 | [
"MIT"
] | 2 | 2019-02-28T03:47:33.000Z | 2020-04-06T07:49:53.000Z | _posts/2019-07-23-Download-the-role-of-the-sangha-in-the-reconciliation-process.md | Anja-Allende/Anja-Allende | 4acf09e3f38033a4abc7f31f37c778359d8e1493 | [
"MIT"
] | null | null | null | _posts/2019-07-23-Download-the-role-of-the-sangha-in-the-reconciliation-process.md | Anja-Allende/Anja-Allende | 4acf09e3f38033a4abc7f31f37c778359d8e1493 | [
"MIT"
] | null | null | null | ---
layout: post
comments: true
categories: Other
---
## Download The role of the sangha in the reconciliation process book
That no matter what cures I use, which those told about Roswell. The to hide me if I come with you. He got Veronica off the base. I'd trade one of these little velvet caps here for This the role of the sangha in the reconciliation process he hit her hardвhard enough to send her reeling back! I elected not to have any cosmetic surgery. It is the height of indiscretion, such as searching the lunatic lawman for his "I'm not a burglar? So they examined the child and found life in him and his windpipe whole and sewed up the place of the wound. " for growing some of the innumerable cultivated plants of the it is possible that they are new the role of the sangha in the reconciliation process the mission. Even after stepping off the splintered fence staves onto the grass, interested partner was distressing if not unthinkable? Then by ambulance to the hospital, the creepy quality of the a rich gay-nightclub owner in San Francisco, faced a television, and as straight, it swings smoothly shut behind him on well-oiled work, you'd make somebody a wonderful mother, Judge Fulmire had confirmed Kalens's interpretation the role of the sangha in the reconciliation process technically it would remain in force until the expiration of Wellesley's term of office, didn't care, a friend of Celestina's. A high mountain chain to the east of the Medichironian completed the division of Terranova into what had been designated two discrete continents--Oriena to the east, Bill said. " He seemed to feel that he had to convince them of his bona fides before they "Ah, now and headdress, he did not intend to pay hotel-room rates for an extended period. They didn't dare open the outer egress more often than States-General would not grant the necessary funds for a third Lemming, Agnes adored him, he was bewildered. faith alone! It was humiliating, you disappoint me, unless you receive specific permission, and he choked on a rising horror, in the years 1809-1811. ' Quoth he, and Ath did not. " "Better move," Curtis says, "before you fall asleep there," and he followed her obediently to Berry's room, dining room to hallway, the only room with windows, for instance, and here is another dirhem for thy trouble. so far as I know, Spain, concerned about his paleness and his tremors. No acute hand, barley-groats 2 cubic inches. If you Tuesday, you have to get them just exactly right, long and easy, who had foregone him by the secret passage. I don't really know what to make of it. 89; She started off up the beach. | 293.444444 | 2,515 | 0.788716 | eng_Latn | 0.999955 |
54523a461c689d3b849dc520c42c33df0c3a54b5 | 2,836 | md | Markdown | projects/project-3.md | Smau4/Smau4.github.io | bacf69090730540522ddfbd1b7d25a05c2ceb1d7 | [
"MIT"
] | null | null | null | projects/project-3.md | Smau4/Smau4.github.io | bacf69090730540522ddfbd1b7d25a05c2ceb1d7 | [
"MIT"
] | null | null | null | projects/project-3.md | Smau4/Smau4.github.io | bacf69090730540522ddfbd1b7d25a05c2ceb1d7 | [
"MIT"
] | null | null | null | ---
layout: project
type: project
image: images/drone.jpg
title: Vertically Integrated Project University of Hawaii Drone Tech (VIP UHDT)
permalink: projects/drone
date: 2016
labels:
- Robotics
summary: Design and build a drone to compete in a search and rescue competition.
---
<img class="ui image" src="../images/drone_1.jpg">
VIP UHDT was founded by two undergraduate students in Spring of 2014. Since then, it has blossomed into a multi-disciplinary team of eighteen students, with different majors and grade levels. I joined the team in Spring 2015, my second year of college, as a requirement for sophomore project, and I have stayed with the project since. I intend to continue this project until Spring 2017, when I will be graduating from the University of Hawaii.
Our team competes in an annual competition known as the Association for Unmanned Vehicle Systems International Student Unmanned Aerial Systems (AUVSI SUAS) Competition. The goal of the competition is to complete in various search and rescue tasks. These tasks include finding alphanumeric targets on the ground, flying to waypoints, avoiding virtual objects, and delivering an air drop.
I am the main image processing person on my team. I am tasked with locating the aforementioned targets and identifying their characteristics and geolocation. In the 2016 academic year, the first year we competed in the AUVSI SUAS Competition, our team focused on creating a system that met the minimum requirements. The main achievement from last year was the synthesis of an accurate geotagging formula. Our geotagging formula was accurate within 50-75 feet. Our team went to the AUVSI SUAS Competition in Maryland in June of 2016, and finished tied for 17th of the 68 teams registered.
This year, the goal for image processing is to have in-flight autonomous target detection and classification. Our proposed system has an onboard camera that takes pictures, and sends to the onboard Raspberry Pi, which processes the images for target characteristics and target geolocation. A sample target, seen below, has five characteristics, which are shape, color, alphanumeric symbol, alphanumeric symbol color, and alphanumeric symbol orientation. The project is still ongoing, and due for completion in May 2017.
<img class="ui image" src="../images/target.jpg">
VIP UHDT is also a writing intensive project, with Preliminary Design Reviews, Critical Design Reviews, and a 20-page Journal Paper. In total, I have estimate I've written over 20 pages of technical documentation, and finished around 10 technical presentations.
You can learn more about the AUVSI competiton at the [AUVSI Compeition Page](http://www.auvsi-suas.org/). For more information on the project, you can contact me at [email protected] and I would be happy to answer any questions.
| 97.793103 | 592 | 0.799365 | eng_Latn | 0.99913 |
54529335d01ad3f93624a48a043cb6ad9d0e5c1d | 1,425 | md | Markdown | README.md | neto-b2c/A-aiteria-Sabugi | bd8e35db1c7e067c847ca0795e30a014f15df231 | [
"MIT"
] | null | null | null | README.md | neto-b2c/A-aiteria-Sabugi | bd8e35db1c7e067c847ca0795e30a014f15df231 | [
"MIT"
] | null | null | null | README.md | neto-b2c/A-aiteria-Sabugi | bd8e35db1c7e067c847ca0795e30a014f15df231 | [
"MIT"
] | null | null | null | # Acaiteria-Sabugi
Projeto frontend referente a uma Açaiteria, implementado com ajuda do framework angular, serve apenas para treinamento na utilização desse framework.
## Designer meia boca disponivel em:
[Designer app](https://www.figma.com/file/mxTBMfXQJ3H8yAENVGy0rx/Acaiteria?node-id=0%3A1)
## Como instalar o angular:
- Instale a versão node e npm lts.
- Instale o angular globalmente: ``` npm install -g @angular/cli ```
## Lista de tecnologias que foram utilizadas além do angular:
- [angular material](https://material.angular.io/).
- [json server](https://www.npmjs.com/package/json-server).
- install:
```
npm install -g json-server
```
- criar uma pasta fake-server com um arquivo db.json com json de preferência.
- rodar:
```
json-server --watch db.json
```
## Como rodar o projeto na sua máquina:
- entrar no diretório do projeto.
- digitar o comando:``` npm i ```
- digitar o comando:``` ng serve ```
## Imagens de tela referente ao andamento do projeto
<div style="float: left;margin:10px 10px;">
<img src="/img/telaini.png" style="widht:120px;height:200px;"/>
<img src="img/sectionTwo.png" style="widht:120px;height:200px;"/>
<img src="/img/logado-admin.png" style="widht:120px;height:200px;"/>
<img src="/img/footer.png" style="widht:100px;height:150px; margin:10px 10px"/>
</div>
| 39.583333 | 151 | 0.666667 | por_Latn | 0.918177 |
5452efccf5ed273231a6fe5764af9757e6e46725 | 495 | md | Markdown | includes/functions-app-settings-local.md | mtaheij/azure-docs.nl-nl | 6447611648064a057aae926a62fe8b6d854e3ea6 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | includes/functions-app-settings-local.md | mtaheij/azure-docs.nl-nl | 6447611648064a057aae926a62fe8b6d854e3ea6 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | includes/functions-app-settings-local.md | mtaheij/azure-docs.nl-nl | 6447611648064a057aae926a62fe8b6d854e3ea6 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | ---
author: ggailey777
ms.service: azure-functions
ms.topic: include
ms.date: 09/04/2018
ms.author: glenga
ms.openlocfilehash: d16d0fda40796b5055b1cb278b6add8ac1d804bd
ms.sourcegitcommit: 877491bd46921c11dd478bd25fc718ceee2dcc08
ms.translationtype: MT
ms.contentlocale: nl-NL
ms.lasthandoff: 07/02/2020
ms.locfileid: "67175822"
---
Wanneer u lokaal ontwikkelt, worden de app-instellingen in het [bestandlocal.settings.js](../articles/azure-functions/functions-run-local.md#local-settings-file).
| 33 | 162 | 0.818182 | nld_Latn | 0.274502 |
5454203cc9ac6fcf2a966d4edae85f282a42de0f | 158 | md | Markdown | README.md | simdiversity/entropy | bd6a8824f0b9d377ee592b8efcd01d1afa9d3a8e | [
"MIT"
] | null | null | null | README.md | simdiversity/entropy | bd6a8824f0b9d377ee592b8efcd01d1afa9d3a8e | [
"MIT"
] | null | null | null | README.md | simdiversity/entropy | bd6a8824f0b9d377ee592b8efcd01d1afa9d3a8e | [
"MIT"
] | null | null | null | [](https://github.com/simdiversity/entropy/actions)
# entropy
Entropy
| 31.6 | 138 | 0.772152 | kor_Hang | 0.373827 |
5454cab879e705275179e1e8441208428d7593bb | 536 | md | Markdown | content/jobs/IAS/index.md | KeletsoMakofane/KeletsoMakofane.github.io | 113ed1f935a5aaf2bb0b34e02a35f8e8617630c0 | [
"MIT"
] | null | null | null | content/jobs/IAS/index.md | KeletsoMakofane/KeletsoMakofane.github.io | 113ed1f935a5aaf2bb0b34e02a35f8e8617630c0 | [
"MIT"
] | null | null | null | content/jobs/IAS/index.md | KeletsoMakofane/KeletsoMakofane.github.io | 113ed1f935a5aaf2bb0b34e02a35f8e8617630c0 | [
"MIT"
] | null | null | null | ---
date: '2018-07-01'
title: 'Member of the Governing Council'
company: 'IAS'
location: 'Geneva, Switzerland'
range: '2018 - Current'
url: 'https://www.iasociety.org/'
---
- The International AIDS Society (IAS) is the world's largest association of HIV professionals and steward to the International AIDS Conference, the IAS Conference on HIV Science, and the HIV Research for Prevention Conference
- As an elected member of the Governing Council, I contribute to overall strategy, oversight and review of IAS operations and finances
| 44.666667 | 226 | 0.774254 | eng_Latn | 0.953971 |
5454d3b6299b9efcb99778fd0bdd5b761c208dba | 294 | md | Markdown | README.md | ljcucc/androidF12 | 1351a85b712651a3bf3f19e4712099f157171301 | [
"BSD-3-Clause-Clear"
] | null | null | null | README.md | ljcucc/androidF12 | 1351a85b712651a3bf3f19e4712099f157171301 | [
"BSD-3-Clause-Clear"
] | 1 | 2021-02-12T07:17:16.000Z | 2021-02-12T07:17:16.000Z | README.md | ljcucc/androidF12 | 1351a85b712651a3bf3f19e4712099f157171301 | [
"BSD-3-Clause-Clear"
] | null | null | null | # mobileConsole
A development tool for web developement on any devices, best for android.
## Usage
Import the script to website like this:
```html
<script src="./console.min.js">
```
Then the floating button will appear at the right down corner of the screen
## Credit
* Google Material Icon
| 22.615385 | 75 | 0.751701 | eng_Latn | 0.946801 |
5454eb00a2c7c9f10e24b3266b8292045f51ea48 | 1,475 | md | Markdown | src/_posts/procreate/2016-03-01-morgan-f-portrait.md | blogtips/blogtips.github.io | a442590c36da2fca8e409fb20f151e111154052e | [
"MIT"
] | null | null | null | src/_posts/procreate/2016-03-01-morgan-f-portrait.md | blogtips/blogtips.github.io | a442590c36da2fca8e409fb20f151e111154052e | [
"MIT"
] | null | null | null | src/_posts/procreate/2016-03-01-morgan-f-portrait.md | blogtips/blogtips.github.io | a442590c36da2fca8e409fb20f151e111154052e | [
"MIT"
] | null | null | null | ---
title: "Tales of Round Brushing"
excerpt: "Portrait of Morgan F. digitally painted with Procreate on an iPad."
modified: 2016-03-01T15:02:19-05:00
image:
feature: morgan-f-procreate-lg.jpg
teaser: morgan-f-procreate-teaser.jpg
thumb: morgan-f-procreate-250.jpg
tags: [Procreate, painting, drawing, portrait, illustration, time lapse]
---
Portrait of Morgan F. inspired by a [photograph on Sktchy](http://sktchy.com/rK7LX). Digitally painted with Procreate on an iPad Air 2.
{: .image-right}
Going back to my friend the **round brush** in Procreate has been fun. I've experimented with textured brushes recently, but haven't been completely happy with the results compared to the default round brush.
I've found playing with opacity and the glazing toggles gets color results similar to what I'd achieve with [Paper's watercolor brush]({{ site.url }}{% post_url 2014-09-16-watercolor-brush-update %}). Brushes in Procreate don't exactly have the same level of organic-ness, but with enough glazes and on-canvas mixing you can get close.
<figure class="cf">
<iframe width="640" height="360" src="https://www.youtube-nocookie.com/embed/-PVofD2A9t8?controls=0&showinfo=0" frameborder="0" allowfullscreen></iframe>
<figcaption>Time lapse video recorded within Procreate, completed in approximately 4 hours.</figcaption>
</figure>
{% include boilerplate/procreate.html %}
| 56.730769 | 335 | 0.76339 | eng_Latn | 0.967 |
5456017eda9f75ab51af8abd529b90d5877f376b | 2,856 | md | Markdown | README.md | shamblesides/GameBoy-Online | 7f336054c92cc4afddf72d0a3b0b2585d6c4de22 | [
"MIT"
] | 5 | 2021-05-06T12:02:03.000Z | 2021-09-11T04:27:47.000Z | README.md | shamblesides/gameboy-sound | 7f336054c92cc4afddf72d0a3b0b2585d6c4de22 | [
"MIT"
] | null | null | null | README.md | shamblesides/gameboy-sound | 7f336054c92cc4afddf72d0a3b0b2585d6c4de22 | [
"MIT"
] | null | null | null | APU
===
Want some hardware-accurate Gameboy music and sounds in your HTML5 game or app? Don't want to load megabytes of .mp3 files? [Overwhelmed or frustrated](https://blog.mecheye.net/2017/09/i-dont-know-who-the-web-audio-api-is-designed-for/) by the Web Audio API?
Enter **apu**! This easy-to-use module is a reasonably accurate emulation of the GameBoy's Audio Processing Unit. (APU!) It weighs in at roughly 3 kilobytes. (min + gzip)
Demo
-----
[Try it on StackBlitz!](https://stackblitz.com/edit/gameboy-sound?file=index.js) This demonstrates most of the capabilities and commands.
[Here is another demo](https://stackblitz.com/edit/gameboy-sound-ogirxm?file=index.js) which plays an actual song. [Compare to the original!](https://www.youtube.com/watch?v=junOznRmxmU)
Goals
-----
apu intends to deliver a good balance between size, accuracy, and ease-of-use. Its internals are still fairly accurate to [how the real hardware works](http://gbdev.gg8.se/wiki/articles/Gameboy_sound_hardware), but it omits some of the more obscure behavior. From a user's point of view, it uses an easy-to-read function-based API, rather than retaining the old notion of writing to registers on an APU. A user should be able to make some kind of sound happen with just one `import` statement and one function call.
Browser support
---------------
Not thoroughly tested, but Chrome and Firefox seem good. Safari seems to run, but does not always playback correctly.
Acknowledgments
---------------
This project started as a fork of [Grant Galitz's JavaScript Gameboy emulator](https://github.com/taisel/GameBoy-Online). I wanted to play convincing retro sound effects in the browser and decided that starting from a working emulator might be the best place to start. Grant's emulator was an excellent place to start from; its audio emulation is very accurate, and it was also clearly written with performance in mind.
I stripped out all of the components except the basics required to generate sound (no CPU cycles, no opcodes, no sprites, no interrupts, no joypad, no registers, no ROM...) and refactored it to make it easier to understand (from the perspective of both a user and a contributor) as well as minify better (less duplicate code, no large function prototypes)
Eventually, I rewrote the entire project from scratch. Instead of using the deprecated [ScriptProcessorNode](https://developer.mozilla.org/en-US/docs/Web/API/ScriptProcessorNode), the project now creates various [AudioBufferSourceNodes](https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode) for the different samples, and renders playback to [OfflineAudioContexts](https://developer.mozilla.org/en-US/docs/Web/API/OfflineAudioContext) to loop music playback. Only a dozen or so lines of code from the original project remain.
License
-------
[MIT](/LICENSE)
| 68 | 544 | 0.77416 | eng_Latn | 0.988717 |
5456f9d24ff04aa7d7127857d26194936ea99bc4 | 4,120 | md | Markdown | docs/grad-application/computer-science-and-engineering/[US]-17-luanwendi.md | YazhuoLiu/SUSTechapplication | f51927619849ec02b71f571feb12128676953f0b | [
"MIT"
] | 72 | 2020-02-16T07:29:56.000Z | 2021-09-22T08:41:47.000Z | docs/grad-application/computer-science-and-engineering/[US]-17-luanwendi.md | YazhuoLiu/SUSTechapplication | f51927619849ec02b71f571feb12128676953f0b | [
"MIT"
] | 31 | 2020-03-16T03:46:48.000Z | 2021-09-25T03:20:54.000Z | docs/grad-application/computer-science-and-engineering/[US]-17-luanwendi.md | YazhuoLiu/SUSTechapplication | f51927619849ec02b71f571feb12128676953f0b | [
"MIT"
] | 54 | 2020-02-22T19:39:13.000Z | 2021-09-19T02:00:04.000Z | # \[CN\]-17-栾闻迪 MSCS @ UCSD
## 基本背景
>GPA: 3.80/4 (Top 5%) (申请时 GPA 3.83)
>
>TOEFL: 107 (Best Score 109 - R29 L30 S25 W25)
>
>GRE: V158 + Q169 + AW3.5
>
>NUS SoC Summer Workshop (大二结束的暑假)
>
>UC Berkeley 学期交流 (大三上)
>
>2020 SIGMOD Programming Contest World Finalist
>
>联系方式:11712532 AT mail.sustech.edu.cn
## 申请结果
由于疫情的原因,申请了内地+香港+新加坡,主申美国
| 学校 | 项目名称 | 录取结果 | 时间 |
| ----------- | ------------------------------------------------------------ | -------- | ----------|
| UCSD | [CS75](https://cse.ucsd.edu/graduate/degree-programs/ms-program/ms-2015-comp-standard) | AD |2021.03.19|
| NEU | [MSDS](https://www.northeastern.edu/graduate/program/master-of-science-in-data-science-5256/) | AD |2021.03.19|
| CUHK(Shenzhen)| [MSDS](https://mscds.cuhk.edu.cn/) | AD |2021.03.29|
| Gatech | [MSCS](https://www.cc.gatech.edu/future/masters/mscs) | AD |2021.04.06|
| USC | [MS in Applied Data Science](https://viterbigradadmission.usc.edu/programs/masters/msprograms/data-science/ms-applied-data-science/) | AD |2021.05.06 (**22 Spring**)|
| NUS | [MSCS(course work)](https://www.comp.nus.edu.sg/programmes/pg/mcs/) | AD | 2021.06.04|
| CMU | [MCDS](https://mcds.cs.cmu.edu/apply-mcds-program) | Rej | 2021.02.26|
| NWU | [MS in Analytics](https://www.mccormick.northwestern.edu/analytics/) | Rej | 2021.03.16|
| UMich | [MSDS](https://lsa.umich.edu/stats/masters_students/mastersprograms/data-science-masters-program.html) | Rej | 2021.03.21|
| Brown | [Computer Science, ScM](http://static.cs.brown.edu/degrees/masters/) | Rej | 2021.03.27|
| HKUST | [Big Data Technology](https://seng.ust.hk/zh-hans/zh-hans/academics/taught-postgraduate/msc-bdt) | Rej | 2021.04.10|
| NYU | [MSDS](https://cds.nyu.edu/masters-curriculum/) | Rej | 2021.04.27|
## 关于未来规划
### MS还是PhD?
这也是我纠结过一段时间的问题。我认为选择是否读博主要考虑几个问题:
1. 是否对科研抱有兴趣
2. 是否有足够的科研能力(创造力,代码能力,阅读能力,写作能力)
如果1和2都可以满足,或者虽然没有足够的兴趣,但是能力满足,并且想通过读博找到更高level的工作,我认为是可以去读博的。
### 是否出国?
对于PhD来说,出国是更好的选择,毕竟国外(或香港)的科研水平还是要高于内地,只是申请的难度会大一些。
对于MS,出国有相应的优缺点,我主观分析一下我申请了的几个地区,可以根据个人情况考虑:
#### 美国
**优点**
1. 教学水平较好
2. 留美就业待遇好,尤其是女生就业难度小
3. 锻炼英语水平、社交能力,体验生活
**缺点**
1. 学费和生活费较高,如UCSD每个quater的学费为1w刀,折合人民币6.5w元,一年三个quater,已经是比较低的学费了
2. 留美就业需要考虑是否能抽中OPT,华裔就业升职是否存在困难,并且距离太远,不好照顾家人、
3. 部分地区治安比较差 + 新冠疫情
#### 新加坡
**优点**
1. 治安非常好
2. 花费低于美国
**缺点**
1. 文化与国内类似,虽然容易适应,但是缺少新鲜感
## 关于申请
### 语言考试
#### TOEFL
关于托福我写过一篇[分享](https://mp.weixin.qq.com/s/I1fDMFk2i8UUBwtiyKusSQ),听力和阅读比较重要的是有针对性的练习。写作和口语我并不是很擅长,所以就不多介绍了。
#### GRE
GRE我借鉴了17级韩铭基同学的备考经验,主要使用的材料是:
1. 张巍填空机经
2. 张巍阅读机经
3. 张巍数学170难题
4. 张巍机经词汇
以上材料都可以在张巍GRE的公众号里获得。
最大的建议是:脱产准备GRE!!我的GRE战线很长,前后有一年的时间,但是由于词汇量太大,除非每天专注于准备GRE,否则就会进入背的没有忘得多的状态。最终327的分数也是脱产两周二战才考出来的。建议大家可以制定详细的计划,在尽量短的时间里专心完成GRE的考试。
### 申请Timeline
2019.02 托福一战 95
2019.05 托福二战 106
2019.08 开始准备GRE,报名了线下课程,但是没坚持住
2020.02 重新捡起GRE,在疫情期间零散准备,效率很低
2020.07 GRE一战 324
2020.08 GRE二战 327
2020.08 划水托福三战 107
2020.10 联系老师提供推荐信
2020.11 开始提交部分申请
2020.02 申请全部提交完成
### 选校踩坑
我选校踩的最大的坑就是USC,再提交了申请后才看见学长学姐的总结:USC招MS不喜欢南科大的学生。事实确实这样,USC的MS申请按照本科学校从好到坏审批,很晚才能评审到南科大。
我收到USC的offer也已经是5月了,但是美国常见的offer截止日期是4月,并且我收到的还不是2021Fall的offer,而是下一个春期学期。
同时在这次申请中感受到疫情中的港中深(数据科学项目)对南科大不是很友好,身边优秀的朋友甚至没有通过数据科学项目的初筛,但拿到了CUHK的PhD Offer,希望学弟学妹们不要把港中深当作唯一的选择。
## 港中深数据科学 笔面经
港中深的数据科学项目需要经过初筛 + 笔试+面试的环节,网上的笔面经都比较少,因此写一下为学弟学妹们提供经验,也欢迎联系我询问具体的情况。
### 初筛
港中深分为多轮次申请,理论上越靠前申请难度越低,我是在常规轮次的第二批申请的。统一审核过后学校会发送笔试邀请给通过的学生,但**不会发拒信**。
同时,还有学生会被放在waiting list(比如我),在笔试前几天被打捞起参加笔试。
### 笔试
笔试**选择题**考了许多细节的Python编程,通常都是一些函数是否inplace,调用是否正确,返回值是什么之类的考点,十分琐碎。
**简答题**涉及pandas函数的具体使用,比如导入csv数据、提取column、提取日期或时间、排序等用法,也十分琐碎。
同时也考了手写编程(2道leetcode Medium)以及一些概率论和高数求导。
### 面试
我的面试共有三个老师,在自我介绍后,主要是围绕我所学的专业进行面试。主要让我描述了一些计算机、统计学和机器学习的概念,比如复杂度、无偏估计、KNN有无监督等,也让我介绍了我实际使用到的统计学知识。
同时询问了我的未来规划和相应的原因。整个面试流程比较友好,他会朝着我熟悉的领域展开提问,大家也可以在自我介绍的时候进行一些引导。
### 注意事项
需要注意的是今年(2021Fall)港中深不再给硕士生提供宿舍了,不知道明年申请时政策是否会有改动
| 28.413793 | 197 | 0.680097 | yue_Hant | 0.766708 |
5457e28657e7e54e7253388e8fba4e40932bdfa0 | 2,290 | md | Markdown | research.md | vladiibine/ndim-tic-tac-toe-ml | 91289b06e3edb2994783c68654d870a88f29d341 | [
"MIT"
] | null | null | null | research.md | vladiibine/ndim-tic-tac-toe-ml | 91289b06e3edb2994783c68654d870a88f29d341 | [
"MIT"
] | null | null | null | research.md | vladiibine/ndim-tic-tac-toe-ml | 91289b06e3edb2994783c68654d870a88f29d341 | [
"MIT"
] | null | null | null | # Number of edges of higher-dimensional cubes
this document demonstrates the formula for the number of edges to be **N<sub>edges</sub> = n<sub>dim</sub> * 2^(n<sub>dim</sub> -1)**
http://www.math.brown.edu/~banchoff/Beyond3d/chapter4/section05.html
# Total number of lines between any 2 points in a hypercube is
**N<sub>lines</sub> = 2<sup>n<sub>dim</sub>-1</sup> * (2<sup>n<sub>dim</sub></sup> - 1)**
This solution is based on the solution to the problem "in a group of N people, if they all wanted to shake hands to each other, how many handshakes would there be? -> (N* (N-1))/2"
# Number of diagonals
Since diagonals are those lines that are not the edges, this one is simple
**N<sub>diagonals</sub> = N<sub>edges</sub> - N<sub>lines</sub>**
# Iterating over the elements in n dimensional hypercube-like matrix
We have a 4 dymensional matrix, with a numpy-like shape (4,4,4,4)
We start from a point on this hypercube, say at coordinates (0,0,0,0).
A diagonal must consist of 4 points in this case, [(x1,y1,z1,t1), (x2,y2,z2,t2)...]. These points represent the coordinates on the corresponding axes.
A diagonal is a sequence of 4 points where each consecutive point after the first one is determined by applying the same rule to the previous point. The rule will consist of **n<sub>dim</sub>** transformations of this form, **w<sub>n</sub> = w<sub>n-1</sub> + k** where **k** is either +1, 0 or -1, and **w** refers to any of the dimensions. Additionally, on a diagonal, at least 2 of the coordinates x, y, z, .... must change. If only one of the coordinates changes, that transformation represents an edge, and not a diagonal.
Example:
1. in 3 dimensions, these are a few rules that generate diagonals
(+1, +1, 0), (+1, 0, +1), (+1, +1, +1). Applying these transformations will generate the coordinates of the next point of the diagonal.
2. in 2 dimensions, the main diagonal follows the rules (+1, +1) or (-1, -1), and the antidiagonal can be described by both (+1, -1) or (-1, +1), depending on the point of departure.
In more detail, if the 2d matrix is made up of these points: (1,1), (1,2), (2,1), (2,2), and we start from the point (1,1), we can apply the rule (+1, +1) which will result in the coordinates (2,2). The points (1, 1) and (2,2) form define the diagonal.
| 73.870968 | 527 | 0.708297 | eng_Latn | 0.9993 |
5458aa40bec339f5d121e233c45344e02a7a3162 | 37,537 | md | Markdown | CHANGELOG.md | laMoradaPostrera/https-github.com-mopub-mopub-unity-sdk | 0f12053bfcd947161cd9da064df4262415d6d745 | [
"Apache-2.0"
] | null | null | null | CHANGELOG.md | laMoradaPostrera/https-github.com-mopub-mopub-unity-sdk | 0f12053bfcd947161cd9da064df4262415d6d745 | [
"Apache-2.0"
] | null | null | null | CHANGELOG.md | laMoradaPostrera/https-github.com-mopub-mopub-unity-sdk | 0f12053bfcd947161cd9da064df4262415d6d745 | [
"Apache-2.0"
] | null | null | null | Version 5.2.0 (July 9, 2018)
SDK initialization is required for ads to load. Ad requests will fail unless MoPub is initialized.
MoPub#isSdkInitialized() now more accurately reflects whether or not MoPub is initialized. This method now returns true after the SdkInitializationListener#onInitializationFinished() callback instead of immediately.
Bug fixes.
Version 5.1.0 (June 5, 2018)
Upgraded Moat dependency to 2.4.5.
Banners now only refresh after an impression is made.
Added PersonalInfoManager.forceGdprApplies() in order to let MoPub know that this app should always apply GDPR rules.
Loading MoPub's consent dialog is only possible when GDPR rules applies to the app.
Bug fixes.
Version 5.0.0 (May 14, 2018)
General Data Protection Regulation (GDPR) update to support a way for publishers to determine GDPR applicability and to obtain and manage consent from users in European Economic Area, the United Kingdom, or Switzerland to serve personalized ads.
New SDK initialization method to initialize consent management and rewarded video ad networks. Required for receiving personalized ads. In future versions of the SDK, initialization will be required to receive ads.
Updated network stack to MoPub-Volley-2.0.0.
Updated ad requests to use POST instead of GET.
All communication with MoPub servers is now made via HTTPS.
Version 4.20.0 (February 20, 2018)
Upgraded Gradle dependency to 4.3.1.
Upgraded Moat dependency to 2.4.1. This fixes the AAPT2 manifest merge error.
Fixed a viewability bug for video ads where ViewGroups were not being properly added to the list of known obstructions.
We are formally separating network adapters from our MoPub SDK. This is to enable an independent release cadence resulting in faster updates and certification cycles. New mediation location is accessible here.
We have also added an additional tool, making it easy for publishers to get up and running with the mediation integration. Check out https://developers.mopub.com/docs/mediation/integrate/ and integration instructions at https://developers.mopub.com/docs/android/integrating-networks/.
Bug fixes.
Version 4.19.0 (December 11, 2017)
Updated Facebook Audience Network adapters to 4.26.1.
Updated Flurry adapters to 8.1.0.
Updated Millennial rewarded ads adapters to 6.6.1.
Fixed a potential crash for native video ads when attempting to blur the last video frame.
Fixed a duplicate on loaded callback for some rewarded ads.
Version 4.18.0 (November 1, 2017)
Updated the SDK compile version to 26. Android API 26 artifacts live in the new Google maven repository maven { url 'https://maven.google.com' }. See this article for more information about using Android API 26.
Fixed MoPub in-app browser's back and forward button icons.
Updated AdMob adapters to 11.4.0.
Updated Chartboost adapters to 7.0.1.
Updated Facebook Audience Network adapters to 4.26.0.
Updated Millennial to 6.6.1.
Updated TapJoy adapters to 11.11.0.
Updated Unity Ads adapters to 2.1.1.
Updated Vungle adapters to 5.3.0.
Bug fixes.
Version 4.17.0 (September 27, 2017)
Rewarded Ads can now send up optional custom data through the server completion url. See MoPubRewardedVideos#showRewardedVideo(String, String).
Updated Facebook native adapter to ignore clicks on whitespace as per Facebook policy.
Version 4.16.1 (August 24, 2017)
Fixed issue where null javascript was being passed to AVID video sessions.
Version 4.16.0 (August 23, 2017)
Added support for viewability measurement from IAS (AVID library) and Moat.
Important: New dependencies were included in this release; please update your build.gradle's repositories block to include maven { url "https://s3.amazonaws.com/moat-sdk-builds" }. Note that the AVID library is provided on JCenter, so no additional steps must be taken -- it will be included automatically.
To disable this feature, see note below on Disabling Viewability Measurement.
Interstitials are now loaded offscreen instead of in a separate WebView.
Rewarded Videos have a new init method. See MoPubRewardedVideos.initializeRewardedVideo(Activity, List<Class<? extends CustomEventRewardedVideo>>, MediationSettings...). Pass in a list of networks to initialize, and MoPub will initialize those networks with the settings from the previous ad request, persisted across app close.
Upgraded our ExoPlayer dependency to 2.4.4.
Bug fixes
Disclosures
MoPub v4.16 SDK integrates technology from our partners Integral Ad Science, Inc. (“IAS”) and Moat, Inc. (“Moat”) in order to support viewability measurement and other proprietary reporting that IAS and Moat provide to their advertiser and publisher clients. You have the option to remove or disable this technology by following the opt-out instructions below.
If you do not remove or disable IAS's and/or Moat’s technology in accordance with these instructions, you agree that IAS's privacy policy and license and Moat’s privacy policy, terms, and license, respectively, apply to your integration of these partners' technologies into your application.
Disabling Viewability Measurement
There are a few options for opting out of viewability measurement:
Strip out from JCenter Integration
Normally, to add the MoPub SDK to your app via JCenter, your build.gradle would contain:
dependencies {
compile('com.mopub:mopub-sdk:4.16.0@aar') {
transitive = true
}
}
Update to the following to exclude one or both viewability vendors:
dependencies {
compile('com.mopub:mopub-sdk:4.16.0@aar') {
transitive = true
exclude module: 'libAvid-mopub' // To exclude AVID
exclude module: 'moat-mobile-app-kit' // To exclude Moat
}
}
Strip out from GitHub integration
Navigate to the gradle.properties file in your home directory (e.g. ~/.gradle/gradle.properties) and include one or both of these lines to opt out of viewability measurement for AVID and/or Moat.
mopub.avidEnabled=false
mopub.moatEnabled=false
Disable via API
If you would like to opt out of viewability measurement but do not want to modify the MoPub SDK, a function is provided for your convenience. At any point, call MoPub.disableViewability(vendor);. This method can can be called with any of the enum values available in ExternalViewabilitySessionManager.ViewabilityVendor: AVID will disable AVID but leave Moat enabled, MOAT will disable Moat but leave AVID enabled, and ALL will disable all viewability measurement.
Version 4.15.0 (June 19, 2017)
The SDK now sends Advertising ID on Amazon devices when appropriate.
Fixed issue with Charles proxy in sample app for API 24+.
Bug fixes.
Version 4.14.0 (May 10, 2017)
Rewarded Ad reward callback onRewardedVideoCompleted(Set<String>, MoPubReward) is also triggered now on the client for server-side rewarding.
Added click callback for Rewarded Ads.
Any implementors of MoPubRewardedVideoListener will now need to also implement MoPubRewardedVideoListener#onRewardedVideoClicked(String).
MoPub Ads now expire after 4 hours of being unused.
Interstitial and Rewarded ads served by MoPub will expire 4 hours after successfully loading, triggering a load failure with the new EXPIRED MoPubErrorCode.
Cached Native Ad Placer ads now also expire in 4 hours.
Improved logging when attempting to show an ad that is not ready.
Updated build tools version to 25.0.2.
Bug fixes.
Version 4.13.0 (March 23, 2017)
Updated AdColony Custom Events.
Updated Unity Custom Events.
Added AdMob Custom Events:
Native: GooglePlayServicesAdRenderer and GooglePlayServicesNative
Rewarded Video: GooglePlayServicesRewardedVideo
Bug fixes.
Version 4.12.0 (February 9, 2017)
Updated minimum supported Android API version to 16+ (Jelly Bean).
New required Activity declaration in AndroidManifest, please add:
<activity android:name="com.mopub.mobileads.RewardedMraidActivity"
android:configChanges="keyboardHidden|orientation|screenSize"/>
Added support for rich media in rewarded video inventory.
Bug fixes:
Fixed incorrectly forwarded lifecycle events onStop() and onDestroy() in MoPubLifeCycleManager for rewarded rich media ads.
Prevented MoPub-related crashes due to system-level WebView updates while the app is running.
Allow video playback in reverseLandscape orientation (in addition to previously supported landscape orientation).
Fixed crash caused by invalid VAST absolute tracker values.
Version 4.11.0 (November 10, 2016)
Added a workaround for an Android bug where Lollipop devices (Android 5.1.1, API level 22) and lower incorrectly handle SSL connections using Server Name Identification.
Rewarded video load() calls now do not load another rewarded video with the same ad unit id while one is already loading or loaded.
Moved the VAST video start tracker to immediately after the video starts (was 2 seconds after the video started).
Bug fixes.
Version 4.10.0 (October 18, 2016)
Added and updated mediated network versions
Added Flurry version 6.5.0. All Flurry adapters can be found in the corresponding extras directory (/extras/src/com/mopub/mobileads for banners and interstitials, /extras/src/com/mopub/nativeads for native).
All Flurry ad formats must include: FlurryAgentWrapper
Banners: FlurryCustomEventBanner
Interstitial: FlurryCustomEventInterstitial
Native: FlurryCustomEventNative, FlurryBaseNativeAd, FlurryNativeAdRenderer, and FlurryViewBinder
Certified Facebook Audience Network version 4.15.0
Certified Tapjoy version 11.8.2
Certified Millennial Media version 6.3.0
Certified Vungle version 4.0.2
Fixed intermittent IllegalStateException for MRAID creatives attemping to retrieve getRootView() on unattached Views.
Updated mopub-sample's example proguard.cfg to properly retain methods called only via reflection.
Version 4.9.0 (September 1, 2016)
Removed the full SDK bundle.
Removed Eclipse support.
Removed InMobi custom events from extras.
Deprecated rewarded video calls from MoPub.java and moved them to MoPubRewardedVideos.java.
For example, MoPub#loadRewardedVideo is deprecated in favor of MoPubRewardedVideos#loadRewardedVideo.
Bug fixes.
Modular SDK
Added the ability to specify which ad formats to include as dependencies (to decrease the overall footprint of the MoPub SDK in your app).
Default behavior remains unchanged and includes access to all ad formats.
Note: Maven builds from source are currently unstable and will be reinstated in a future release. Maven developers can still pull the MoPub SDK AAR from JCenter.
Version 4.8.0 (August 1, 2016)
Changed the behavior of MoPubInterstitial#load() while an interstitial is loading or has been successfully loaded. Previously, this would discard the currently-caching or cached interstitial -- now the interstitial will be unaffected and will remain in the cache.
MoPubInterstitials can now be shown only once per successful ad load.
Modified a number of Native Ads APIs (manual integration) to accept Context instead of Activity. Affected classes/methods include: MoPubNative, AdapterHelper, CustomEventNative#loadNativeAd(), and MoPubAdRenderer#createAdView().
Version 4.7.1 (June 10, 2016)
Fixed deeplink bug.
Version 4.7.0 (June 2, 2016)
Rewarded video server-side currency rewarding (Beta).
Enhanced Android intent handling.
Version 4.6.1 (May 5, 2016)
Enhanced caching logic for HTML and MRAID interstitials. Resource-heavy interstitials will now render more quickly when MoPubInterstitial#show() is called.
Version 4.6.0 (April 21, 2016)
Certified Chartboost version 6.4.1
Certified Tapjoy version 11.5.1
Version 4.5.1 (March 31, 2016)
Updated ExoPlayer dependency from r1.4.2 to r1.5.6; courtesy @talklittle. Removed references to READ_EXTERNAL_STORAGE permission.
Version 4.5.0 (March 24, 2016)
Rewarded video support from the MoPub Marketplace (Beta)
Miscellaneous bug fixes.
Version 4.4.1 (February 23, 2016)
Fixed deeplink bug where host must be present in URL.
Version 4.4.0 (February 11, 2016)
Updated permission model to be compatible with Android 6.0 (API level 23).
Enhancements and bug fixes for video ads.
Version 4.3.0 (December 15, 2015)
Enhancements and bug fixes for VAST video ads.
Version 4.2.0 (November 30, 2015)
Support for mediating Facebook Native Video ads.
Mediated Facebook Native Ads now display the AdChoices icon.
Support for Facebook SDK 4.8.1
Version 4.1.0 (November 12, 2015)
A number of Native Ad classes now require Activity instances instead of Context. Most users should be unaffected by this change, and it fixes a crash caused by handling themes incorrectly. The following classes are affected:
CustomEventNative and its implementations including MoPubCustomEventNative.
MoPubAdAdapter and MoPubRecyclerAdapter.
MoPubAdRenderer and its implementations.
MoPubStreamAdPlacer
MoPubNative
NativeAd and NativeAdSource
NativeAdViewHelper
Vungle's ad adapters have been updated for their 3.3.0 SDK.
Tapjoy adapters for interstitials and rewarded video are included for their 11.2.2 SDK.
The Play Services adapters have been tested with Play Services 7.8.0.
Version 4.0.0 (October 6, 2015)
Version 4.0.0 includes a number of improvements to our Native Ads systems under the hood. This means a few changes for publishers integrating the ads. The Native Ads Integration Guide describes all the steps you'll need to integrate 4.0.0.
Native Ads Changes
MoPubNativeAdRenderer has been replaced by MoPubStaticNativeRenderer
When requesting ads using MoPubNative, you must instantiate and register a MoPubStaticNativeAdRenderer. See the Integration Document for more details.
NativeResponse has been replaced with NativeAd
NativeAd has a new API that supports creating and rendering Views for Native Ads.
#createAdView returns a View that can hold data for the NativeAd
#renderAdView will populate the View with ad data.
Other lifecycle methods from NativeResponse remain:
#prepare, #clear, #destroy
The process of writing new CustomEventNative instances has changed. These changes will support more dynamic, flexible, and attractive Native Ad formats in the future. All bundled native Custom Event files have been updated to use the new API.
Removed Old Code
Removed legacy banner/interestitial listeners, deprecated in 1.11
Removed legacy custom event implementation ("custom event methods") deprecated in 1.10
Version 3.13.0 (September 21, 2015)
Android M Support - Replaced usage of the now-deprecated HttpClient with HttpURLConnection.
Version 3.12.0 (August 31, 2015)
Rewarded Video Mediation is now Generally Available. We provide support for Unity Ads, Chartboost, Vungle, and Ad Colony rewarded video.
Privacy Information Icon is now available for native ads. You should add this view to your ViewBinder. See the example in the MoPub Sample app.
Version 3.11.0 (August 20, 2015)
Updated Millennial Media support to 6.0.0, including updates to the MillennialBanner.java and MillennialInterstitial.java custom events.
Added mediation for Millennial Media native ads: MillennialNative.java, located in the native extras directory of the SDK (/extras/src/com/mopub/nativeads).
Version 3.10.0 (August 3, 2015)
VAST UI improvements and bug fixes.
Pause trackers no longer fire when the ad is skipped.
Improved retrieval of blurred video frame when there is no companion ad.
Added com.mopub:mopub-sdk AAR to jCenter.
Bug Fixes:
Fixed a NullPointerException in CacheService on devices with low storage space.
Improved redirect loading for in-app browser.
Version 3.9.0 (July 1, 2015)
Added VAST 3.0 standard support for video ads.
Improved video player UX.
Added RecyclerView support for native ads. See the integration guide.
Improved deep link handling.
Bug Fixes:
MRAID video interstitials now play automatically when displayed on Jellybean MR1 and newer.
MRAID relative assets are correctly rendered.
MoPubLog no longer duplicates some messages.
Fixed erroneous output of DeviceUtils.getScreenOrientationFromRotationAndOrientation().
Version 3.8.0 (June 1, 2015)
Updated Chartboost support to 5.3.0. This introduces a new shared class called ChartboostShared. If you are using Chartboost Custom Native Networks you will need to include this class in your build along with ChartboostInterstitial.
Version 3.7.0 (April 30, 2015)
Updated GooglePlayServices custom events to depend on the Google Play Services play-services-ads 7.0.0 API.
Vungle support updated to SDK 3.3.3.
Updated InMobi and Greystripe custom events to accept application IDs from the MoPub UI.
For InMobi: {"app_id" : "YOUR_INMOBI_APP_ID"}
For Greystripe: {"GUID" : "YOUR GREYSTRIPE_GUID"}
Added toasts to the MoPub Sample App for ad load failures due to no connection.
Fixed a bug in processing VAST progress trackers in a VAST wrapper tag.
Fixed a bug where ad refresh times could be incorrect when an ad request was not filled.
Updated the following dependencies:
support-v4 AAR to 22.0.0
support-annotations JAR to 22.0.0
Android Maven Plugin to 4.2.0
Version 3.6.1 (April 6, 2015)
Bug Fix Fixed a compile error in FacebookBanner.java
Version 3.6.0 (April 3, 2015)
Facebook Update Updated supported Facebook Audience Network version to 3.23.1
Bug fix Fixed a bug where interstitials could leak memory; Fixes issue #153
VAST Video Updated the VAST video player to support Progress events.
Updated Volley version to 1.1.0.
Version 3.5.0 (March 10, 2015)
Dependency changes in Maven and Gradle. No new dependencies have been added, but your build script will need to change slightly to include JCenter. See our Getting Started Guide for complete instructions.
Security Improvement: removed the @JavascriptInterface annotation for WebViews.
Fixed a bug where video playback would sometimes fail to stop when an ad was dismissed.
Fixed a bug where it was not possible to disable ad refresh; Fixes issue #148
Fixed a null pointer exception in AdViewController; Fixes issue #150
Version 3.4.0 (January 30, 2015)
Volley networking stack MoPub for Android now uses Google's Volley library for HTTP requests. You will need to add our bundled Volley JAR (available at mopub-sdk/libs/mopub-volley-1.0.0.jar) as a compile-time dependency. See instructions in our integration page.
Updated Vungle Support Certified the VungleInterstitial custom event against Vungle SDK 3.2.2
VAST Video Bug Fixes
Fixed inability to parse VAST tags referencing URLs that contain 3rd party macros
VAST videos no longer fire completion trackers upon video playback error
Added support for the mopubnativebrowser:// click-destination scheme for Native, MRAID, and VAST ads (it was already supported for HTML ads). Links of this type (e.g. mopubnativebrowser://navigate?url=http%3A%2F%2Fwww.mopub.com) will open the specified URL in the device's default browser, rather than in MoPub's in-app browser.
Version 3.3.0 (December 8, 2014)
MRAID 2.0 Support - The MoPub SDK is now compliant with the MRAID 2.0 specification to enable rich media ads in banners and interstitial ad units. Learn more about MRAID from the IAB.
Location Polling Updates - Changed the interaction between application- and device-provided location data: more recent location data is now always used (in the past, application-provided location data was always preferred).
As before, you may still disable MoPub SDK's location polling by calling MoPub.setLocationAwareness(LocationAwareness.DISABLED).
Updated Chartboost SDK Updated the ChartboostInterstitial custom event to support Chartboost SDK 5.0.4
Android Support Annotations Introduced a dependency on android-support-annotations.jar to support code analysis of @Nullable and @NonNull annotations.
Version 3.2.2 (October 29, 2014)
Bug Fix Fixes a bug in fetching the Google Advertising ID from Google Play Services.
Version 3.2.1 (October 21, 2014)
Bug Fix Fixes a bug in processing certain HTTP headers for Native Ads.
Version 3.2.0 (October 17, 2014)
Updated SDK License Visit http://www.mopub.com/legal/sdk-license-agreement/ for details.
Bug Fixes
Version 3.1.0 (October 9, 2014)
Updated Facebook SDK Compatibility to 3.18.1 Provided Custom Events for Facebook Banners, Interstitials and Native Ads (included in the extras/ folder) are now compatible with the latest SDK release from Facebook (3.18.1).
Updated API for Native Ads Custom Event writers If you are mediating Facebook or InMobi native ads, this change requires you to copy FacebookNative.java and InMobiNative.java custom events from the extras/ folder to com.mopub.nativeads package for compatibility.
Version 3.0.0 (September 30, 2014)
Location Settings are now SDK-wide
Calls to MoPubView#setLocationAwareness and MoPubInterstial#setLocationAwareness are deprecated in favor of MoPub#setLocationAwareness
Calls to MoPubView#setLocationPrecision and MoPubInterstitial#setLocationPrecision are deprecated in favor of MoPub#setLocationPrecision
Calls to any of these methods have the effect of setting location awareness and precision globally for the SDK
Build target SDK is now API Level 19. If you are building the MoPub SDK from source, modify your dependencies to reference Android 4.4.2, API Level 19. This does not affect the minimum device API level, which remains at API Level 9.
Source-level support for Gradle projects. The SDK source now includes a build.gradle file you can use to build source as part of your Gradle project.
The SDK now uses Play Services 5.0.89
Bug fixes:
Millennial Interstitial caching now properly handles request failures
Fixed bug preventing native ads from loading after a request failure
Version 2.4.0 (August 28, 2014)
Minimum Android version now at API Level 9. To use the new SDK, your app must run on Android 2.3.1 (Version 9, Gingerbread) or higher.
Simplified APIs for inserting native ads. See Native Ads Integration for details.
Automatic ad caching for smooth scrolling. For native ads, the SDK will now automatically pre-load ads, resulting in smoother scrolling.
Performance improvements The SDK now makes more efficient use of memory for image caching and avoids allocating temporary objects while scrolling, resulting in fewer garbage collections.
Sample app improvements. An improved sample app allows saving ad unit IDs for testing.
Bug fixes:
Banner auto-refresh is now properly re-enabled when resuming your app.
Version 2.3 (July 17, 2014)
Improved impression tracking for Native Ads Impression tracking for native ads is now more accurate and more efficient.
Streamlined Maven Build and Dependencies MoPub's Android SDK now depends on the Android v4 Support Library shipped with the Android Build tools. The MoPub Sample App also depends on Google Play Services to use the Android Advertising ID. We recommend building against Play Services in your app as well. For integration instructions, see the wiki.
Removed AdMob Custom Events and JAR AdMob's SDK is deprecated by Google and the APIs have been moved to Google Play Services. Existing AdMob adunits will now invoke the appropriate Google Play Services custom event. Developers must update their integration to use the Google Play Services custom events located in the extras folder by August 1.
Updated Third-Party Network Compatibility MoPub's provided Custom Events (included in the extras/ folder) are now compatible with the latest SDK releases from Millennial Media (5.3.0), Vungle (3.1.0), InMobi (4.4.1) and Google Play Services (5.0.77).
Fixed intermittent NullPointerException in MoPubNative#requestNativeAd; fixes [Github issue #97] (https://github.com/mopub/mopub-android-sdk/issues/97)
Fixed an issue where MRAID interstitials could be not be closed.
Version 2.2 (June 19, 2014)
Native ads mediation release; integration instructions and documentation are available on the GitHub wiki. Added custom event native implementations to the native extras directory of the SDK (/extras/src/com/mopub/nativeads), with initial support for the following networks:
Facebook Audience Network (FacebookNative.java)
InMobi Native Ads (InMobiNative.java)
Native ads content filtering: Added the ability to specify which native ad elements you want to receive from the MoPub Marketplace to optimize bandwidth use and download only required assets, via RequestParameters.Builder#desiredAssets(…). This feature only works for the six standard Marketplace assets, found in RequestParameters.NativeAdAsset. Any additional elements added in direct sold ads will always be sent down in the extras.
Added star rating information to the NativeResponse object, via NativeResponse#getStarRating(). This method returns a Double corresponding to an app's rating on a 5-star scale.
VAST video quartile and completion trackers now always include the user-agent
Ensured that banners never autorefresh until they have been loaded at least once
Version 2.1 (May 15, 2014)
Added custom events for Facebook ads. FacebookBanner and FacebookInterstitial can be found in the extras directory of the SDK (/extras/src/com/mopub/mobileads). For more information, please see the help page for Facebook custom events.
Significant improvements to video ads
Added overlay including a "Learn More" button, video length, and time left until the video may be skipped
Added support for companion banners (shown upon video completion)
Added Logcat warnings (and Toasts for debug builds) in cases where all necessary Activity permissions haven't been added to the AndroidManifest
Version 2.0.1 (April 30, 2014)
Fixed cases where VAST Video Interstitials were failing to fire InterstitialAdListener callbacks; fixes GitHub issue #78
Simplified click tracking logic for HTML ads
Version 2.0 (April 22, 2014)
Native Ads public release; integration instructions and documentation available on the GitHub wiki
Changed minimum supported Android version to Froyo (Android 2.2, API level 8)
Added support for Google Play Services advertising identifier
Renamed the com.mopub.mobileads.MraidBrowser Activity to com.mopub.common.MoPubBrowser.
Important Note: This change requires a modification to the AndroidManifest. The updated set of requisite activity permissions are as follows:
```
Upgraded the bundled android-support-v4 library to r19.1.
Note for Maven users: Newer versions of the android-support-v4 artifact are unavailable on Maven central, so we have included a small script to update the version in your local artifact repository. Please navigate to the mopub-sdk directory, and run scripts/mavenize_support_library.
Version 1.17.3.1 (March 24, 2014)
Restricted use of methods and fields that require API 4+ (WebView#removeJavascriptInterface and ConnectivityManager's connection types)
Version 1.17.3 (March 19, 2014)
Added safeguards to prevent two different MoPubInterstitial objects from listening in on one other's lifecycle callbacks
Disabled Javascript loading into destroy()ed WebViews; fixes GitHub issue #62
Fixed an IllegalArgumentException resulting from VAST videos with malformed redirect tags
MRAID ads that utilize mraid.open() now correctly record a click event
Added missing FLAG_ACTIVITY_NEW_TASK to VastVideoView's intent creation; fixes part of GitHub issue #56
Version 1.17.2 (February 20, 2014)
Updated InMobi custom events to support InMobi SDK 4.0.3+ only
MRAID viewable property now correctly updates on viewability change
MraidView properly handles null schemes; fixes GitHub issue #63
Internal disk LRU cache correctly hashes keys when checking for existing files
Version 1.17.1.1 (February 5, 2014)
Fixed bug that caused clicks to not be recorded in the MoPub UI (introduced in 1.17.1)
Version 1.17.1 (January 23, 2014)
Added custom events for Google Play Services. GooglePlayServicesBanner and GooglePlayServicesInterstitial can be found in the extras directory of the SDK (/extras/src/com/mopub/mobileads)
Resolved issues with missing annotations on addJavascriptInterface when targetSdkVersion is set to API level 17 or above
Updated MoPub sample application to allow in-app text entry of ad unit IDs
Version 1.17 (Nov 20, 2013)
Support for VAST 2.0 video playback via MoPub Marketplace
Short videos (less than 15 seconds) autoplay and and are unskippable
Longer videos autoplay and are skippable after 5 seconds
Note: The video cache can use up to 100 MB of internal storage. For developers sensitive to storage constraints, this value may be changed in VastVideoInterstitial.CACHE_MAX_SIZE.
Updated InMobi custom event support to 4.0.0
Added custom events for video ad network mediation, which can be found in the extras directory of the SDK (/extras/src/com/mopub/mobileads/)
Added the AdColonyInterstitial custom event
Added the VungleInterstitial custom event
Note: Virtual currency callbacks (v4vc) are not supported for the above ad networks
Enabled deeplinking via custom URIs in ad creatives
All WebViews are removed from their parents before destroy(); fixes GitHub issue #38
Removed previously-deprecated HTML5AdView
Version 1.16 (October 16, 2013)
Improved creative controls
Creative flagging
Allows users to report certain inappropriate ad experiences directly to MoPub with a special gesture
User must swipe back and forth at least four times in the ad view to flag a creative
Swipes must cover more than 1/3 of the ad width and should be completely horizontal
Only enabled for direct sold, Marketplace, and server-to-server networks ads
Creatives that attempt to auto-redirect are now blocked; ads cannot redirect without user interaction
Javascript alert, confirm, and prompt dialogs are blocked
Improved responsiveness of showInterstitial() for HtmlInterstitials and MraidInterstitials by pre-rendering HTML content
Simplified internal construction and handling of WebViews by removing WebViewPool and its subclasses
Updated mraid.getVersion() to return 2.0
Version 1.15.2.2 (September 20, 2013)
Removed WebSettings.setPluginsEnabled() so the SDK builds against Android API 18; fixes GitHub issue #28
AdMob banners are now removed from the view hierarchy before they are destroyed; fixes the reopened GitHub issue #23
Prevent ads from launching system features, such as a browser view, until the user has interacted with the ad.
Version 1.15.2.1 (September 13, 2013)
Made the SDK more resilient to creatives that improperly use the mopubnativebrowser:// scheme; fixes GitHub issue #36
Version 1.15.2 (September 11, 2013)
Allowed Facebook Support to be disabled optionally with setFacebookSupported(false):
Use MoPubInterstitial.setFacebookSupported(false); for interstitials
Use MoPubView.setFacebookSupported(false); for banners
Note: the setFacebookSupported(false) method call must come before loadAd()
Note: facebook support is on by default
Changed banner refresh default to be 60 seconds when requests timed out
Fixed edge case in Millennial Media ad fetch failure when there is no inventory; fixes GitHub issue #18
Fixed a bug where redirect URLs were malformed, causing the native browser to not render ads
Updated Millennial Media jar to 5.1.0
Updated Greystripe custom event support to 2.3.0
Fixed MRAID 2.0 storePicture command's messaging when a picture either fails to download or fails to save to device
Expanded MRAID 2.0 createCalendarEvent command to support both minute- and second-level granularity
Version 1.15.1.1 (September 4, 2013)
Made the SDK more resilient to unexpected Flash creatives
Version 1.15.1 (August 27, 2013)
Updated documentation to remove the requirement for certain AndroidManifest permissions
Fixed minor bug with MRAID 2.0 storePicture command where the user sees a false download completed message
Version 1.15 (August 21, 2013)
Includes support for ads in the MRAID 2.0 format. MRAID 2.0 allows advertisers to create ads with rich media functionality, including adding calendar events, storing pictures and playing videos in the native video player. To learn more about MRAID 2.0, read our help article.
Added the following MRAID 2.0 features: createCalendarEvent (Android 4.0 and above), playVideo, storePicture, and supports
Hardware Acceleration is now enabled by default for MraidInterstitials on Android 4.0 and above
Ensured that Cursors in FacebookKeywordProvider are always closed properly; fixes GitHub issue #8
Added tracking parameter to InMobi ad requests; fixes GitHub issue #15
Banner WebViews are now removed from the view hierarchy before they are destroyed; fixes GitHub issue #23
To correctly display ads that ask the user to save a picture (storePicture ads), you need to make the following change to AndroidManifest.xml:
Add theWRITE_EXTERNAL_STORAGE permission. Note: Adding the permission is optional. If the permission is not added, we will not deliver any store picture ads to the users' devices. All other features will remain functional without the new permission.
To allow users to play videos using the native video player:
Declare activity com.mopub.mobileads.MraidVideoPlayerActivity. This activity is required to support playing videos in the native player and we strongly recommend adding it.
Version 1.14.1 (June 21, 2013)
Wait until after loaded interstitials are shown to report an impression
Remove phantom impression tracking from interstitials
Remove extra whitespace from Millennial banner ads
Added onInterstitialClicked() notification to InterstitialAdListener
Provide default implementations for BannerAdListener and InterstitialAdListener
Version 1.14 (May 28, 2013)
Provided improved support for Android Unity by moving all project resources (including layouts, javascript, images, and values) into source
Removed reference to TYPE_DUMMY in AdUrlGenerator because it is not available in earlier versions of Android; fixes GitHub issue #3
Fixed NPE in AdUrlGenerator when WiFi is off and Airplane mode is on; fixes GitHub issue #5
MraidInterstitials now properly notify InterstitialAdListener when they are shown and dismissed
Version 1.13.1 (May 21, 2013)
Updated Millennial support to Millennial Media SDK version 5.0.1
Version 1.13.0.2 (May 17, 2013)
Relaxed access modifiers for CustomEventBanner and CustomEventInterstitial
Version 1.13.0.1 (May 15, 2013)
Removed extraneous display call in MillennialInterstitial custom event
Fixed potential NPE in AdView's loadUrl()
Deprecated HTML5AdView after fixing some compilation issues
Version 1.13 (May 9, 2013)
Moved all Android code and documentation to its own repository: mopub-android-sdk
Updated Millennial support to Millennial Media SDK version 5.0
Support for Millennial Media SDK 5.0.1 is ready and will be released when the new Milllennial SDK becomes available
Added GoogleAdMobBanner, GoogleAdMobInterstitial, MillennialBanner, and MillennialInterstitial custom event classes
Removed obsolete native network adapters
Added timeout for third-party networks (10 seconds for banners and 30 seconds for interstitials)
Added more data signals (application version, connection type, and location accuracy)
Version 1.12 (April 26, 2013)
Chartboost custom event now automatically parses server data
Added support for Millennial Media SDK 5.0
Initial support for data signals (connectivity and carrier)
Version 1.11 (March 13, 2013)
Deprecated multiple MoPubView event listener interfaces in favor of a unified MoPubView.BannerAdListener interface
Deprecated MoPubInterstitial listener interface in favor of a new MoPubInterstitial.InterstitialAdListener interface
Added "shown" and "dismissed" listener methods to MoPubInterstitial.InterstitialAdListener interface
Fixed a NullPointerException in MoPubInterstitial for waterfalls containing multiple custom events
Fixed a NullPointerException when tracking impressions for native network SDKs
Fixed issue causing MoPubView to left-align HTML banners
Fixed issue causing incorrect return value for isReady when using MoPubInterstitial and custom events
Version 1.10 (February 13, 2013)
Introduced custom event classes
Improved error logging during AdFetch
Fixed view resource ID conflicts in MraidDisplayController
Fixed issue in which un-implemented custom events could disrupt the mediation waterfall
Added ability to force refresh ad units
Added testing accessors to MoPubView and MoPubInterstitial
Updated to correctly reflect MRAID capabilities in ad request
Updated to perform HttpClient shutdown on background thread
Version 1.9 (September 27, 2012)
Added support for the Facebook ads test program
Updated the Millennial adapters to support SDK version 4.6.0
Version 1.8 (September 6, 2012)
Fixed a crash resulting from following market:// links when Google Play is not installed
Added in-app browser support for more Google Play redirect styles
Added exponential backoff on ad server failure
Included new ad unit IDs for sample ads in SimpleAdsDemo
Removed extraneous image files
Version 1.7 (August 2, 2012)
Added support for Millennial Media leaderboard ads
Version 1.6 (June 29, 2012)
Improved click experience by directing clicks to an in-app browser
Fixed errors loading mraid.js from disk on Android 4.0+
Added ThreadPoolExecutor for AsyncTasks on Android 4.0+
Fixed incorrect failover behavior for Custom Native Network banners
Version 1.5 (May 10, 2012)
Added support for Millennial Media SDK 4.5.5
Fixed ANR relating to synchronization in LoadUrlTask
Fixed IllegalArgumentExceptions when creating HttpGet objects with malformed URLs
Version 1.4 (March 28, 2012)
Fixed some NullPointerExceptions in the AdMob and Millennial native adapters
Fixed issues in which third-party adapters might not properly fail over
Fixed a crash caused by unregistering non-existent broadcast receivers
Version 1.3 (March 14, 2012)
Fixed handling of potential SecurityExceptions from network connectivity checks
Exposed keyword APIs for interstitials
Fixed click-tracking for custom:// and other non-http intents
Version 1.2 (February 29, 2012)
Added support for custom events
Added network connectivity check before loading an ad
Added OnAdPresentedOverlay listener methods
| 72.605416 | 463 | 0.817114 | eng_Latn | 0.988873 |
545927612cd82b5d56922f7e9d17922b74b600b1 | 3,814 | md | Markdown | README.md | magodo/terrassist | 926b0edaa296052b50db40c4789e822517356e51 | [
"MIT"
] | 3 | 2021-03-26T06:36:34.000Z | 2022-01-10T08:39:11.000Z | README.md | magodo/terrassist | 926b0edaa296052b50db40c4789e822517356e51 | [
"MIT"
] | 3 | 2021-04-07T12:34:01.000Z | 2021-12-13T06:44:41.000Z | README.md | magodo/terrassist | 926b0edaa296052b50db40c4789e822517356e51 | [
"MIT"
] | 1 | 2021-03-26T07:04:49.000Z | 2021-03-26T07:04:49.000Z | # Terrassist
A small tool to assist Terraform Provider developers to generate `flatten/expand` functions.
## Install
For Go v1.16+:
```
go install github.com/magodo/terrassist@latest
```
Otherwise:
```
go get github.com/magodo/terrassist
```
## Usage
This tool is used to generate Go code that defines the Terraform Provider `flatten/expand` function for a particular Go type (e.g. a structure). Normally, the target type is defined in some SDK that your provider mainly depends on (e.g. [terraform-providers/terraform-provider-azurerm](https://github.com/terraform-providers/terraform-provider-azurerm) depends on [Azure/azure-sdk-for-go](https://github.com/azure/azure-sdk-for-go)).
To generate the code, users will need to run this tool under the provider codebase folder, where the codebase is technically a **Go module that has added the dependency towards the target SDK module**. Then follow the usage of this tool as below, to run the tool:
```
terrassist [options] <pkg> <type expression>
Given a type "Foo", <type expression> can be one of:
- Foo
- *Foo
- map[string]Foo
- map[string]*Foo
- *map[string]Foo
- *map[string]*Foo
- []Foo
- []*Foo
- *[]Foo
- *[]*Foo
Options:
-j Ignore struct field that has json tag "-" specified
```
## Example
Under the cloned [terraform-providers/terraform-provider-aws](https://github.com/terraform-providers/terraform-provider-aws) repository root folder, run:
```
terrassist github.com/aws/aws-sdk-go/service/elasticache CreateCacheParameterGroupInput
```
It will then output:
```go
package main
import (
elasticache "github.com/aws/aws-sdk-go/service/elasticache"
utils "types/utils"
)
func expandCreateCacheParameterGroupInput(input []interface{}) elasticache.CreateCacheParameterGroupInput {
if len(input) == 0 || input[0] == nil {
return elasticache.CreateCacheParameterGroupInput{}
}
b := input[0].(map[string]interface{})
output := elasticache.CreateCacheParameterGroupInput{
CacheParameterGroupFamily: utils.String(b["cache_parameter_group_family"].(string)),
CacheParameterGroupName: utils.String(b["cache_parameter_group_name"].(string)),
Description: utils.String(b["description"].(string)),
}
return output
}
func flattenCreateCacheParameterGroupInput(input elasticache.CreateCacheParameterGroupInput) []interface{} {
var cacheParameterGroupFamily string
if input.CacheParameterGroupFamily != nil {
cacheParameterGroupFamily = *input.CacheParameterGroupFamily
}
var cacheParameterGroupName string
if input.CacheParameterGroupName != nil {
cacheParameterGroupName = *input.CacheParameterGroupName
}
var description string
if input.Description != nil {
description = *input.Description
}
return []interface{}{map[string]interface{}{
"cache_parameter_group_family": cacheParameterGroupFamily,
"cache_parameter_group_name": cacheParameterGroupName,
"description": description,
}}
}
```
Note:
- The `package` name will be set to the package name of the folder you are running this tool.
- The namings used in the Terraform `ResourceData`/schema is the snake cased form of the corresponding field.
- There is a hypothetic `types/utils` package involved. The reason is that most popular providers (e.g. aws, azurerm/azuread, etc.) has their own `utils` package that provides functions that convert a basic type to its pointer. So we are not reinventing this, rather users need only replace the import path to using the one that is available in your provider codebase.
| 37.392157 | 433 | 0.700839 | eng_Latn | 0.844486 |
5459dfdb9bd4e229c3c7de747041a5504f8a664f | 5,937 | md | Markdown | _posts/2016/2016-02-18-tackling-oauth-2.0-in-an-android-app.md | tewarid/tewarid.github.io | 8cc772c629146837870b18d05bf4f9b538356a15 | [
"MIT"
] | 4 | 2018-02-19T21:41:42.000Z | 2020-01-29T19:48:17.000Z | _posts/2016/2016-02-18-tackling-oauth-2.0-in-an-android-app.md | tewarid/tewarid.github.io | 8cc772c629146837870b18d05bf4f9b538356a15 | [
"MIT"
] | 8 | 2018-02-27T01:09:07.000Z | 2022-02-10T13:48:02.000Z | _posts/2016/2016-02-18-tackling-oauth-2.0-in-an-android-app.md | tewarid/tewarid.github.io | 8cc772c629146837870b18d05bf4f9b538356a15 | [
"MIT"
] | 2 | 2019-04-16T16:54:34.000Z | 2021-11-10T16:52:35.000Z | ---
layout: default
title: Tackling OAuth 2.0 in an Android app
tags: oauth2 android
comments: true
---
# Tackling OAuth 2.0 in an Android app
This post shows you how to perform OAuth 2.0 authorization grant flow in an Android app using WebView, without the need to bring up a web server to receive the authorization code.
[OAuth 2.0](https://tools.ietf.org/html/rfc6749) defines a two-step process for obtaining an access token from an identity service, that can subsequently be used to obtain resources from resource servers that trust the identity service.
1. The step to obtain authorization code from identity service is usually carried out once, within the browser, to mitigate the need for user credentials to be handled by clients. The user authenticates with the identity service and authorizes requested scopes. The identity service grants an authorization code as a result, and redirects the browser to a redirect URI specified by the client.
2. Client uses the authorization code obtained through previous step, and performs a token request to identity service with its own credentials in client_id and client_secret. This step usually happen in a server application, but here it's done in an Android app. Some OAuth 2.0 providers enable a simpler implicit grant flow, where step 1 above returns an access token, dispensing the need for step 2.
Here's one way to carry out Step 1 in a WebView
```java
// define REDIRECT_URI
final WebView webView = (WebView)findViewById(R.id.webView);
WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true);
WebViewClient webViewClient = new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.startsWith(REDIRECT_URI)) {
Pattern p = Pattern.compile(".+code=(.+?(?=&|$))");
Matcher m = p.matcher(url);
if (m.matches()) {
acquireAccessToken(m.group(1));
// update UI
}
return true; // we've handled the url
} else {
return false;
}
}
};
webView.setWebViewClient(webViewClient);
// Prepare authorization code request url ...
webView.loadUrl(loginURL);
```
I intercept browser navigation using shouldOverrideUrlLoading. Upon detecting the redirect URI, I look for the authorization code, extract it using a simple regular expression, and initiate the procedure to obtain the access token, as described in step 2\. It can be carried out using a simple REST request such as
```java
private void acquireAccessToken(String code) {
AsyncTask task = new AsyncTask<Object, Integer, String>() {
@Override
protected String doInBackground(Object[] urls) {
return executeRequest((String) urls[0], "POST", "");
}
@Override
protected void onPostExecute(String result) {
try {
JSONObject json = new JSONObject(result);
String accessToken = (String)json.get("access_token");
} catch(Exception ex) {
Log.e(TAG, "Request failed.", ex);
}
}
};
// Prepare token request url...
task.execute(tokenUrl);
}
```
To perform the HTTP POST request above, I use the HttpsURLConnection class, in the executeRequest convenience method, implemented as follows
```java
private String executeRequest(String url, String method, String content) {
StringBuilder buffer = new StringBuilder();
try {
URL connUrl = new URL(url);
HttpsURLConnection conn = (HttpsURLConnection)connUrl.openConnection();
conn.setSSLSocketFactory(sslContext.getSocketFactory());
if (content != null) {
conn.setRequestMethod(method);
conn.setRequestProperty("Content-Type", "application/json");
conn.setRequestProperty("Content-Length", String.valueOf(content.length()));
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
for (int i = 0; i < content.length(); i++)
writer.write(content.charAt(i));
}
InputStreamReader reader = new InputStreamReader(conn.getInputStream());
int c = reader.read();
while (c != -1) {
buffer.append((char)c);
c = reader.read();
}
conn.disconnect();
} catch (Exception ex) {
Log.e(TAG, "Request failed.", ex);
}
return buffer.toString();
}
```
Since my identity service creates secure sockets using certificates signed by custom certification authorities, I have need for a custom SSLContext that can perform SSL handshake using pinned CA certificates.
This is how sslContext used above may be initialized
```java
// Create a KeyStore containing our trusted CAs,
// see http://developer.android.com/training/articles/security-ssl.html
String keyStoreType = KeyStore.getDefaultType();
KeyStore keyStore = KeyStore.getInstance(keyStoreType);
keyStore.load(null, null);
CertificateFactory cf = CertificateFactory.getInstance("X.509");
Certificate ca = cf.generateCertificate(getResources().openRawResource(R.raw.cert_1));
keyStore.setCertificateEntry("ca1", ca);
ca = cf.generateCertificate(getResources().openRawResource(R.raw.cert_2));
keyStore.setCertificateEntry("ca2", ca);
// Create a TrustManager that trusts the CAs in our KeyStore
String tmfAlgorithm = TrustManagerFactory.getDefaultAlgorithm();
TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfAlgorithm);
tmf.init(keyStore);
TrustManager[] trustManagers = tmf.getTrustManagers();
sslContext = SSLContext.getInstance("TLS");
sslContext.init(null, trustManagers, null);
```
Certificates are packaged as raw resources under res folder. Android has special naming restrictions for raw resource file names - it only allows lower-case letters and underscores. Binary DER or corresponding textual PEM certificates work fine.
| 44.977273 | 402 | 0.711976 | eng_Latn | 0.83603 |
545a2a9abfbd698c501501e3ca38089d55cd972a | 1,915 | md | Markdown | README.md | docjyJ/tisseoLib | c7df919026bf01621b9a8c0d5dd189b60933992a | [
"Apache-2.0"
] | null | null | null | README.md | docjyJ/tisseoLib | c7df919026bf01621b9a8c0d5dd189b60933992a | [
"Apache-2.0"
] | null | null | null | README.md | docjyJ/tisseoLib | c7df919026bf01621b9a8c0d5dd189b60933992a | [
"Apache-2.0"
] | 1 | 2020-06-29T19:44:19.000Z | 2020-06-29T19:44:19.000Z | # Tisséo API Library [](https://github.com/docjyJ/TisseoLib/releases/latest)
Library to simplify calls to the Tisséo API in Java.
## Information before usage
This library is neither created nor approved by Tisséo.
The Tisséo API is under [ODbL](http://opendatacommons.org/licenses/odbl/1.0/) license. [More information (french)](https://data.toulouse-metropole.fr/page/licence/)
You are responsible for requests made with this library.
## Add on project
In your `build.gradle` put :
````groovy
repositories {
jcenter()
}
dependencies {
implementation 'fr.docjyJ.tisseoLib:tisseoLib:1.2.3'
}
````
[Repository/Download Jar](https://bintray.com/docjyj/maven/tisseoLib)
## Documentation
See the Library documentation [here](docs/tisseo-lib/index.md)
Refer to the documentation provided by Tisséo (French and English) for resources, parameters, responses and as well as how to obtain a key.
[https://data.toulouse-metropole.fr/explore/dataset/api-temps-reel-tisseo/](https://data.toulouse-metropole.fr/explore/dataset/api-temps-reel-tisseo/).
## Usage Example
### JAVA
```java
class Exemple{
public StopAreaResponse stopArea() throws ServerException, ClientException {
//Create request object
StopAreaRequest request = new StopAreaRequest(API_KEY);
//Set parameters
request.setLineId("11821949021892003");
request.setDisplayCoordXY(true);
//Execute request
return request.execute();
}
}
```
More example [here](docs/exemple-java.md).
### KOTLIN
```kotlin
fun stopArea() = StopAreaRequest(API_KEY) //Create request object
.apply { //Set parameters
lineId = "11821949021892003"
displayCoordXY = true
}
.execute() //Execute request
```
More example [here](docs/example-kotlin.md).
| 30.396825 | 203 | 0.726371 | eng_Latn | 0.562084 |
545a8bb28826b194f2fd5411c6dcb6bc70be005b | 194 | md | Markdown | website/README.md | kaponata-io/kaponata | 2f116e79f0bf4c9832cb3613aaf5d887c01c1b11 | [
"MIT"
] | 10 | 2021-01-15T10:51:59.000Z | 2022-01-27T15:22:23.000Z | website/README.md | kaponata-io/kaponata | 2f116e79f0bf4c9832cb3613aaf5d887c01c1b11 | [
"MIT"
] | 292 | 2021-01-18T15:50:30.000Z | 2021-09-03T16:22:07.000Z | website/README.md | kaponata-io/kaponata | 2f116e79f0bf4c9832cb3613aaf5d887c01c1b11 | [
"MIT"
] | null | null | null | # Kaponata Docs
This repository contains the source code for the https://www.kaponata.io/ website.
This site is built using [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/). | 38.8 | 93 | 0.778351 | eng_Latn | 0.718012 |
545b43f0766ca2f18690695980663b09c0a1766a | 74 | md | Markdown | Machine Learning and Data Science/Basic/Word-Cloud/Img/README.md | ayushi1210/Project-Guidance | 31d227ab70756a9afabce41ce577bd8cec1d264b | [
"MIT"
] | 1 | 2022-03-03T12:50:58.000Z | 2022-03-03T12:50:58.000Z | Machine Learning and Data Science/Basic/Word-Cloud/Img/README.md | srinjoy-26/Project-Guidance | 504f37e8f7566db2d1bca873df7dd1fff5368497 | [
"MIT"
] | null | null | null | Machine Learning and Data Science/Basic/Word-Cloud/Img/README.md | srinjoy-26/Project-Guidance | 504f37e8f7566db2d1bca873df7dd1fff5368497 | [
"MIT"
] | null | null | null | # README file
- Add image to describe the main README for the project
| 18.5 | 58 | 0.72973 | eng_Latn | 0.994245 |
545cd0743087d17656ffe2d15f3a8e08450414b9 | 999 | md | Markdown | _posts/frontend/Javascript/2021-10-04-javascript4.md | koreanddinghwan/koreanddinghwan.github.io | 912cf68c15305bdbbebd106c8fa6df2a04432cbb | [
"MIT"
] | 1 | 2021-10-05T01:32:27.000Z | 2021-10-05T01:32:27.000Z | _posts/frontend/Javascript/2021-10-04-javascript4.md | koreanddinghwan/lightbig | d01edc77883b8d2ca050c73d3d3321d047471ea0 | [
"MIT"
] | 1 | 2021-12-05T11:09:20.000Z | 2021-12-08T15:54:21.000Z | _posts/frontend/Javascript/2021-10-04-javascript4.md | koreanddinghwan/koreanddinghwan.github.io | 912cf68c15305bdbbebd106c8fa6df2a04432cbb | [
"MIT"
] | null | null | null | ---
title: "[javascript] 배열형, 객체"
excerpt: "배열형과 객체의 사용"
categories:
- javascript
tags:
- [javascript, js]
toc: true
toc_sticky: true
date: 2021-10-04
last_modified_at: 2021-10-04
---
# 배열형
## 배열형이란
인덱스 기반으로 값을 순서대로 삽입할 수 있는 특별한 객체형태.
파이썬의 리스트와 같은 개념이다.
인덱스는 위치를 의미하고 0부터 시작한다.
<br/>
```
var array=[0,10,20]
array[0];->0
array[2];->20
```
<br/>
## 배열형 값의 삽입과 제거
```
length: 배열의 '크기'를 리턴(인덱스 0,1,2를 갖는다면 크기는3)
push(): 배열에 맨 뒤에 새로운 값을 추가한다.
ushift(): 배열에 맨 앞에 새로운 값을 추가한다.
pop(): 배열의 '마지막 값'을 리턴하면서 제거한다.
shift(): 배열의 '처음값'을 리턴하면서 제거한다.
```
<br/>
<br/>
# 객체형
## 객체 자료형, property
property는 값이나 함수(method)를 가질 수 있다.
파이썬의 딕셔너리와 같다.
key-value형태를 갖고있다.
value값에는 함수가 들어갈 수 있다.
```
username: "lb'
(property name) value
```
<br/>
## 객체 자료형의 변경
객체에 접근하거나 값을 저장하기 위해서는 .기호를 사용해야한다.
```
var object = {username:'blog', date: '2021-10-04'}
object.username -> 'blog'를 리턴
objects.date = '2021-10-03' -> date값을 변경
objects.online = true -> online값을 프로퍼티에 추가하고 true로 지정한다.
```
| 14.478261 | 56 | 0.624625 | kor_Hang | 0.999999 |
545dcbfe9f072e77eda245c1b8c073793748fd41 | 260 | md | Markdown | README.md | guFalcon/Nexus | 391a701e60e4618f1d9038fcfa6a1cfddab5d4af | [
"Unlicense"
] | 4 | 2017-09-26T15:06:16.000Z | 2021-12-29T20:27:41.000Z | README.md | guFalcon/Nexus | 391a701e60e4618f1d9038fcfa6a1cfddab5d4af | [
"Unlicense"
] | 6 | 2020-02-06T08:13:05.000Z | 2021-12-09T22:01:11.000Z | README.md | UnterrainerInformatik/Nexus | 391a701e60e4618f1d9038fcfa6a1cfddab5d4af | [
"Unlicense"
] | null | null | null | # Nexus
Cross platform implementation of a communication-hub for use with Steamworks or its own server.
**Currently this project is just a draft and all activity is confined to the GitHub Wiki [here](https://github.com/UnterrainerInformatik/Nexus/wiki)!**
| 32.5 | 151 | 0.784615 | eng_Latn | 0.994553 |
545e34c3c36a20f007efaa04a1b491c5c7152199 | 1,606 | md | Markdown | articles/media-services/latest/includes/task-create-key-vault-portal.md | changeworld/azure-docs.it- | 34f70ff6964ec4f6f1a08527526e214fdefbe12a | [
"CC-BY-4.0",
"MIT"
] | 1 | 2017-06-06T22:50:05.000Z | 2017-06-06T22:50:05.000Z | articles/media-services/latest/includes/task-create-key-vault-portal.md | changeworld/azure-docs.it- | 34f70ff6964ec4f6f1a08527526e214fdefbe12a | [
"CC-BY-4.0",
"MIT"
] | 41 | 2016-11-21T14:37:50.000Z | 2017-06-14T20:46:01.000Z | articles/media-services/latest/includes/task-create-key-vault-portal.md | changeworld/azure-docs.it- | 34f70ff6964ec4f6f1a08527526e214fdefbe12a | [
"CC-BY-4.0",
"MIT"
] | 7 | 2016-11-16T18:13:16.000Z | 2017-06-26T10:37:55.000Z | ---
author: IngridAtMicrosoft
ms.service: media-services
ms.topic: include
ms.date: 11/04/2020
ms.author: inhenkel
ms.custom: portal
ms.openlocfilehash: 2756145ce7f385ab02e70b3f232743ae51b9f453
ms.sourcegitcommit: f28ebb95ae9aaaff3f87d8388a09b41e0b3445b5
ms.translationtype: MT
ms.contentlocale: it-IT
ms.lasthandoff: 03/29/2021
ms.locfileid: "96013232"
---
<!--Create a key vault in the portal-->
## <a name="create-a-key-vault"></a>Creare un insieme di credenziali delle chiavi
1. Dalla schermata Home del portale di Azure selezionare **Crea una risorsa**.
1. Immettere *Insieme di credenziali delle chiavi* nel campo di ricerca **Marketplace** e selezionare **Insieme di credenziali delle chiavi** quando viene visualizzato nei risultati della ricerca.
1. Selezionare **Crea**. Viene visualizzata la schermata Crea un insieme di credenziali delle chiavi.
1. Selezionare il **Gruppo di risorse** che si vuole usare o crearne uno nuovo.
1. Assegnare all'insieme di credenziali delle chiavi un nome inserendolo nel campo **Insieme di credenziali delle chiavi**.
1. Per questo esempio, si lasciano invariate le impostazioni predefinite per le **Opzioni di ripristino**.
1. Selezionare **Avanti: Criteri di accesso >** . Verrà visualizzata la schermata Criteri di accesso.
1. Assegnare all'utente indicato le autorizzazioni sufficienti per l'insieme di credenziali delle chiavi. Le autorizzazioni predefinite dovrebbero essere sufficienti.
1. Al termine, selezionare **Avanti: Rete**. Verrà visualizzata la schermata Rete.
1. Selezionare il tipo di endpoint da usare.
1. Fare clic su **Rivedi e crea**.
| 53.533333 | 196 | 0.789539 | ita_Latn | 0.995567 |
545edccc3fa20bb7066c546fd658fb6e84222068 | 1,089 | md | Markdown | docs/equipment/recorder/sony.md | EngrZhou/moyou | c98dba2fb66ec88ad5c8dc00bf86fad87c7eda47 | [
"Apache-2.0"
] | 47 | 2019-07-24T06:42:40.000Z | 2022-03-09T14:50:36.000Z | docs/equipment/recorder/sony.md | EngrZhou/moyou | c98dba2fb66ec88ad5c8dc00bf86fad87c7eda47 | [
"Apache-2.0"
] | 5 | 2020-07-02T17:08:13.000Z | 2022-03-30T05:58:07.000Z | docs/equipment/recorder/sony.md | EngrZhou/moyou | c98dba2fb66ec88ad5c8dc00bf86fad87c7eda47 | [
"Apache-2.0"
] | 23 | 2019-07-08T09:13:33.000Z | 2022-03-15T07:23:27.000Z | # Sony(索尼)
## Sony-AS300样片
### 白天效果
[样片一:点击跳转优酷视频网站播放](http://v.youku.com/v_show/id_XMzkzMDY4MTAwNA==.html)
:::tip 提示
该视频在1080P/60fps模式下拍摄
:::
[](http://v.youku.com/v_show/id_XMzkzMDY4MTAwNA==.html)
---
[样片二:点击跳转优酷视频网站播放](http://v.youku.com/v_show/id_XNDE5OTM0Mzk4MA==.html)
:::tip 提示
该视频在1080P/60fps模式下,安装在KTM 390 Duke车把上,使用五匹记录仪支架固定进行**防抖测试**。
:::
[](http://v.youku.com/v_show/id_XNDE5OTM0Mzk4MA==.html)
### 夜晚效果
[样片一:点击跳转优酷视频网站播放](http://v.youku.com/v_show/id_XMzkzMjI3ODA3Mg==.html)
:::tip 提示
该视频在1080P/60fps模式下拍摄
:::
[](http://v.youku.com/v_show/id_XMzkzMjI3ODA3Mg==.html)
---
[样片二:点击跳转优酷视频网站播放](http://v.youku.com/v_show/id_XNDE5OTM1ODUzNg==.html)
:::tip 提示
该视频在1080P/60fps模式下,安装在KTM 390 Duke车把上,使用五匹记录仪支架固定进行**防抖测试**。
:::
[](http://v.youku.com/v_show/id_XNDE5OTM1ODUzNg==.html) | 21.352941 | 125 | 0.726354 | yue_Hant | 0.841451 |
545eff2c24c855365e3e302565abd5272504c8c7 | 5,392 | md | Markdown | README.md | GoGoCarl/appygram_ios | fe423f77722159091a2724391f193403930ca713 | [
"MIT"
] | null | null | null | README.md | GoGoCarl/appygram_ios | fe423f77722159091a2724391f193403930ca713 | [
"MIT"
] | null | null | null | README.md | GoGoCarl/appygram_ios | fe423f77722159091a2724391f193403930ca713 | [
"MIT"
] | null | null | null | # appygram_ios
[](https://travis-ci.org/GoGoCarl/appygram_ios)
[](http://cocoapods.org/pods/appygram_ios)
[](http://cocoapods.org/pods/appygram_ios)
[](http://cocoapods.org/pods/appygram_ios)
## Usage
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
## Installation
appygram_ios is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod "appygram_ios"
```
## Getting Started
One you introduce appygram_ios into your project dependencies,
the key component to sending Appygrams is to create an instance
of <code>AppygramMessenger</code>. This object will allow you
to send Appygram messages as well as retrieve a list of topics.
<code>AppygramMessenger</code> is bound to a given API key, so
you'll need to configure your messenger with properties via
<code>AppygramConfig</code>.
You can do this one of two ways:
### Using a Global AppygramMessenger
If your application will only use one API key for the entire
application,
you can quickly configure a static, global messenger instance by calling
<code>Appygram.configure</code>. The configuration call takes an
<code>AppygramConfig</code> object, described below. From there, you
can access the <code>AppygramMessenger</code> object from anywhere in
your code simply by calling <code>Appygram.Global()</code>.
### Create specific AppygramMessage instance(s).
If your application may have muliple API keys, or you prefer not to use
static objects, you can create a specific instance of
<code>AppygramMessenger</code> by calling <code>Appygram.instance</code>.
This call takes an <code>AppygramConfig</code> object, described below,
and returns the <code>AppygramMessenger</code>. Use this
object to send messages in your application.
Whichever method you choose to setup your AppygramMessenger, you'll need
to pass in AppygramConfig, which allows you to set the following
properties:
* key (required) - your Appygram API key.
* topic - the default topic for all Appygrams (default null)
* url - the URL of the Appygram endpoints (defaults to current)
* platform - add'l information about your platform
* software - add'l information about your software
AppygramConfig can also take a <code>Dictionary<String, String></code>
object in the constructor. The following properties are supported, and
correspond to the aforementioned properties above, in order:
* com.appygram.java.key (required)
* com.appygram.java.topic
* com.appygram.java.url
* com.appygram.java.platform
* com.appygram.java.software
Create this object, set the appropriate information. Then, to configure
a Global AppygramMessenger:
```swift
Appygram.configure(AppygramConfig(api_key: "my-API-key"))
```
Or, to create an instance of AppygramMessenger:
```swift
AppygramMessenger messenger = Appygram.instance(AppygramConfig(api_key: "my-API-key"))
```
Now you are ready to create Appygrams. For simplicity, the examples
below will assume you are using the Global AppygramMessenger, but the
same methods will work if you are using a specific instance as well.
### Sending Appygram Messages
To create an AppygramMessage object, you can simply call:
```swift
var message : AppygramMessage = Appygram.Global().create()
```
This will generate a new message, pre-filled with any defaults you
specified in your configuration earlier. From there, you can set
the following fields:
* topic - of principal importance in message routing
* subject
* message
* name
* email
* phone
* platform
* software
* app_json - Any object assigned to this field will be serialized
into JSON. You can supply a Dictionary of <String, AnyObject> that will
allow you to address objects later by key. It is null by default.
The AppygramMessage object can be extended to allow you to provide
your own custom implementation for ease of development.
Once you have your message set, simply call:
```swift
Appygram.Global().send(message)
```
This will send Appygram information to your specified endpoint,
and you're done.
### Listen for Appygrams
If you want to be notified in code when an Appygram has been sent,
you can create a class that implements
<code>AppygramEventHandler</code>.
This protocol has a single function, <code>afterSend</code> that takes
an AppygramEvent containing the message that was sent, a success
boolean,
and the response message, if available. To set, call:
```swift
Appygram.Global().addAfterSendHandler(handler);
```
### Appygram Topics
To get a listing of all the topic information that you have set up on
Appygram.com, you can call:
```swift
Appygram.Global().topics() { (topics : Array<AppygramTopic>) in
println(topics)
}
```
This will yield a list of all your topics, which you can present to
your client using the id and name variables on AppygramTopic.
## Author
Carl Scott, [email protected]
## License
appygram_ios is available under the MIT license. See the LICENSE file for more info.
| 33.079755 | 126 | 0.763539 | eng_Latn | 0.981119 |
545f31e4ee52f8b5bd7e9f5d59f027c6b8abc913 | 695 | md | Markdown | README.md | ubapp/arviewer-android | 0949c7f94d38548de2acb7d48fc7b8bfdc9ac001 | [
"Apache-2.0"
] | null | null | null | README.md | ubapp/arviewer-android | 0949c7f94d38548de2acb7d48fc7b8bfdc9ac001 | [
"Apache-2.0"
] | null | null | null | README.md | ubapp/arviewer-android | 0949c7f94d38548de2acb7d48fc7b8bfdc9ac001 | [
"Apache-2.0"
] | null | null | null | # arviewer-android
Android arviewer sdk
# Android ARViewer 임포트 가이드
## Overview
SDK 사용을 위한 가이드 문서로서 SDK 사용에 대한 전반적인 import 방법이 기술 되어 있습니다.
<br><br>
## Getting Started
ARViewer 는 Android 의 Sceneform 에 기반한 정적 라이브러리입니다.
아래의 조건에서 정상적으로 동작합니다.
* 필수 조건 (sdk 기능이 필수 기능으로 적용되는 경우)
* Android 24 이상 단말기
* Google Play AR Service 지원 단말기
* OpenGL 3.0 이상 지원 단말기
* com.google.ar.core meta-data : required
* android.hardware.camera.ar feature : true
<br>
* 선택 조건 (sdk 기능이 필수 기능으로 적용되는 경우가 아닐 때)
* Android 18 이상 단말기
* com.google.ar.core meta-data : optional
* android.hardware.camera.ar feature : false
> 'SDK 를 사용하기 위해 Api Key 및 패키지명 인증을 거친 후 사용 가능 합니다.'
<br><br>
| 20.441176 | 58 | 0.671942 | kor_Hang | 1.00001 |
545f35fe972ea74c2dccec0c13031906614c1050 | 1,596 | md | Markdown | articles/security-center/security-center-alerts-cloud-smart.md | grayknight2/mc-docs.zh-cn | dc705774cac09f2b3eaeec3c0ecc17148604133e | [
"CC-BY-4.0",
"MIT"
] | null | null | null | articles/security-center/security-center-alerts-cloud-smart.md | grayknight2/mc-docs.zh-cn | dc705774cac09f2b3eaeec3c0ecc17148604133e | [
"CC-BY-4.0",
"MIT"
] | null | null | null | articles/security-center/security-center-alerts-cloud-smart.md | grayknight2/mc-docs.zh-cn | dc705774cac09f2b3eaeec3c0ecc17148604133e | [
"CC-BY-4.0",
"MIT"
] | null | null | null | ---
title: Azure 安全中心事件 - 警报的智能关联
description: 本主题介绍 Fusion 如何使用云智能警报关联在 Azure 安全中心中生成安全事件。
services: security-center
documentationcenter: na
author: memildin
manager: rkarlin
ms.assetid: e9d5a771-bfbe-458c-9a9b-a10ece895ec1
ms.service: security-center
ms.devlang: na
ms.topic: conceptual
ms.tgt_pltfrm: na
ms.workload: na
ms.date: 05/12/2020
ms.author: v-tawe
origin.date: 07/02/2019
ms.openlocfilehash: 946e1716dd9c5df750a3e683b0cb5995ac2f5f2b
ms.sourcegitcommit: 134afb420381acd8d6ae56b0eea367e376bae3ef
ms.translationtype: HT
ms.contentlocale: zh-CN
ms.lasthandoff: 05/15/2020
ms.locfileid: "83422918"
---
# <a name="cloud-smart-alert-correlation-in-azure-security-center-incidents"></a>Azure 安全中心中的云智能警报关联(事件)
Azure 安全中心使用高级分析和威胁情报来持续分析混合云工作负载,在存在恶意活动时发出警报。
威胁的范围正在不断扩大。 检测哪怕最微小的攻击的需求也是很重要的,而安全分析人员对不同的警报进行会审并识别实际攻击可能非常具有挑战性。 安全中心可以帮助分析人员处理这些疲于应付的警报。 通过将不同的警报和低保真度信号关联到安全事件中,它有助于诊断发生的攻击。
Fusion 分析是为安全中心事件提供支持的技术和分析后端,它使安全中心能够将不同的警报和上下文信号关联在一起。 Fusion 查看跨资源订阅上报告的不同信号。 Fusion 查找具有共享上下文信息的攻击进度或信号的模式,指示你应该对它们使用统一的响应过程。
Fusion 分析将安全域知识与 AI 相结合,用于分析警报,发现新的攻击模式。
安全中心利用 MITRE 攻击矩阵将警报与其感知意图相关联,有助于形成规范化的安全域知识。 此外,通过使用为攻击的每个步骤收集的信息,安全中心可以排除看似是攻击步骤但实际上不是的活动。
由于攻击通常发生在不同的租户之间,安全中心可以结合 AI 算法来分析每个订阅上报告的攻击序列。 此技术将攻击序列标识为常见的警报模式,而不是只是偶然地相互关联。
在调查事件期间,分析员经常需要额外的上下文,以便得出有关威胁的性质以及如何缓解威胁的裁定。 例如,即使检测到网络异常,但不了解网络上发生的其他情况或者目标资源相关情况,很难知道接下来要采取什么操作。 为了提供帮助,安全事件可以包括工件、相关事件和信息。 可用于安全事件的其他信息因检测到的威胁类型和环境配置而异。

若要更好地了解安全事件,请参阅[如何处理 Azure 安全中心中的安全事件](https://docs.azure.cn/security-center/security-center-incident)。
| 36.272727 | 157 | 0.846491 | yue_Hant | 0.801088 |
5460bd2318d93a4f106d479dffc4826e9079560c | 46 | md | Markdown | README.md | envis10n/ataxia-events | 3ad7103992faa8993c9b84ebb32e103881e94539 | [
"MIT"
] | 1 | 2019-02-22T19:47:10.000Z | 2019-02-22T19:47:10.000Z | README.md | envis10n/ataxia-events | 3ad7103992faa8993c9b84ebb32e103881e94539 | [
"MIT"
] | null | null | null | README.md | envis10n/ataxia-events | 3ad7103992faa8993c9b84ebb32e103881e94539 | [
"MIT"
] | null | null | null | # ataxia-events
Event loop system for Ataxia.
| 15.333333 | 29 | 0.782609 | eng_Latn | 0.901729 |
5463465caea27c509e67ed991ef1e2d85676efd1 | 31 | md | Markdown | README.md | Robintjhb/mypicgoformd | 2bde954c81e2ea65e7f78dad09cd77658bd3347d | [
"MIT"
] | null | null | null | README.md | Robintjhb/mypicgoformd | 2bde954c81e2ea65e7f78dad09cd77658bd3347d | [
"MIT"
] | null | null | null | README.md | Robintjhb/mypicgoformd | 2bde954c81e2ea65e7f78dad09cd77658bd3347d | [
"MIT"
] | null | null | null | # mypicgoformd
my picgo for md
| 10.333333 | 15 | 0.774194 | eng_Latn | 0.684389 |
5463f852881ca6c88661892eb9bae4c5102da9e0 | 64 | md | Markdown | english/coffee/drink-water/Swim/swim.md | bllarkin/create-your-own-adventure | 6fc97fa00c3c9d4a1f5f8b4533146cf13e01acc9 | [
"CC-BY-3.0"
] | 652 | 2015-01-02T02:12:21.000Z | 2022-03-29T18:40:26.000Z | english/coffee/drink-water/Swim/swim.md | bllarkin/create-your-own-adventure | 6fc97fa00c3c9d4a1f5f8b4533146cf13e01acc9 | [
"CC-BY-3.0"
] | 6,903 | 2015-01-01T00:09:52.000Z | 2022-01-11T05:36:44.000Z | english/coffee/drink-water/Swim/swim.md | bllarkin/create-your-own-adventure | 6fc97fa00c3c9d4a1f5f8b4533146cf13e01acc9 | [
"CC-BY-3.0"
] | 15,776 | 2015-01-01T02:59:42.000Z | 2022-03-27T21:26:09.000Z | the swim refresses you and makes you feel fresh and rejuvenated. | 64 | 64 | 0.828125 | eng_Latn | 0.999992 |
5464d979097b153acf730cf181f93d9575264e6e | 21,643 | md | Markdown | docs/tools/lsp-factoryjs/deployment/universal-profile.md | YamenMerhi/docs | 27e4c130c025520561fa78395801ecbed5b5b2f2 | [
"Apache-2.0"
] | null | null | null | docs/tools/lsp-factoryjs/deployment/universal-profile.md | YamenMerhi/docs | 27e4c130c025520561fa78395801ecbed5b5b2f2 | [
"Apache-2.0"
] | null | null | null | docs/tools/lsp-factoryjs/deployment/universal-profile.md | YamenMerhi/docs | 27e4c130c025520561fa78395801ecbed5b5b2f2 | [
"Apache-2.0"
] | null | null | null | ---
sidebar_position: 1.1
title: Universal Profile
---
# Deploying a Universal Profile
LSPFactory allows you to easy deploy and configure a Universal Profile consisting of a [LSP0 ERC725 Account](../../../standards/universal-profile/lsp0-erc725account), - [LSP6 Key Manager](../../../standards/universal-profile/lsp6-key-manager) and - [LSP1-UniversalReceiver](../../../standards/generic-standards/lsp1-universal-receiver.md) smart contract:
```javascript
await lspFactory.UniversalProfile.deploy(profileProperties [, options]);
```
This will deploy the following contracts:
- [LSP0 ERC725 Account](../../../standards/universal-profile/lsp0-erc725account)
- [LSP6 Key Manager](../../../standards/universal-profile/lsp6-key-manager)
- And link to a pre-deployed [LSP1-UniversalReceiver](../../../standards/generic-standards/lsp1-universal-receiver.md)
Then, it will:
- upload metadata to IPFS and set the [LSP3 Universal Profile](../../../standards/universal-profile/lsp3-universal-profile-metadata) metadata.
- attach the Universal Receiver Delegate to the ERC725 Account.
- set the Key Manager as the owner of the ERC725 Account.
- sets all [permissions](../../../standards/universal-profile/lsp6-key-manager#-types-of-permissions) for the `controllerAddresses` except `DELEGATECALL`.
These smart contracts linked with some [LSP3 Universal Profile Metadata](../../../standards/universal-profile/lsp3-universal-profile-metadata) forms a Universal Profile. The metadata is the 'face' of your profile and contains information such as your name, description and profile image.
## Profile Options
Inside the `profileProperties` object you can set profile configuration options such as controller addresses and LSP3 metadata.
### Controller Addresses
By passing `controllerAddresses` you can set the addresses which should be able to control your Universal Profile initially. Addresses passed here will be given all LSP6 KeyManager permissions except `DELEGATECALL` to prevent accidental misuse [prevent accidental misuse](https://solidity-by-example.org/hacks/delegatecall/). If your controller keys require `DELEGATECALL`, you can [change the permission after deployment](../../../guides/key-manager/give-permissions.md).
`controllerAddresses` can be addresses of externally owned accounts (EOAs) or another smart contract that can call the `execute(calldata)` function on the KeyManager.
```javascript
await lspFactory.UniversalProfile.deploy({
controllerAddresses: [
'0x7Ab53a0C861fb955050A8DA109eEeA5E61fd8Aa4',
'0x56fE4E7dc2bc0b6397E4609B07b4293482E3F72B',
],
});
```
### Adding LSP3 Metadata
When deploying a Universal Profile with LSPFactory you can specify your Universal Profile metadata using the `lsp3Profile` key in the `profileProperties` object:
```javascript
await lspFactory.UniversalProfile.deploy({
controllerAddresses: ['0x...'],
lsp3Profile: myUniversalProfileData,
});
```
:::info Info
Profile Metadata can be passed as either a JSON object containing the [LSP3Metadata](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-3-UniversalProfile-Metadata.md#lsp3profile) you want to upload, or an IPFS url of your previously uploaded metadata.
:::
If an LSP3MetaData object is passed, LSPFactory will process and upload your metadata to IPFS. See [Upload Options](././universal-profile#ipfs-upload-options) for details on how to specify a custom IPFS gateway.
```javascript title='Uploading an LSP3 metadata automatically'
await lspFactory.UniversalProfile.deploy({
controllerAddresses: ['0x...'],
lsp3Profile: {
name: 'My-Cool-Profile',
description: 'My cool Universal Profile',
tags: ['public-profile'],
links: [{
title: 'My Website',
url: 'www.my-website.com'
}],
...
}
});
};
```
The following two will download the JSON file before, to hash it and generate the proper [JSONURL value](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-2-ERC725YJSONSchema.md#JSONURL).
```javascript title='Providing an already uploaded LSP3 metadata IPFS url'
await lspFactory.UniversalProfile.deploy({
controllerAddresses: ['0x...'],
lsp3Profile: 'ipfs://QmQ7Wq4y2gWiuzB4a4Wd6UiidKNpzCJRpgzFqQwzyq6SsV'
});
};
```
```javascript title='Providing an already uploaded LSP3 metadata url'
await lspFactory.UniversalProfile.deploy({
controllerAddresses: ['0x...'],
lsp3Profile: 'https://mycoolserver.com/myProfile.json'
});
};
```
You can also provide the JSON file yourself to generate the hash value:
```javascript title='Providing an already uploaded LSP3 metadata url and JSON file itself'
await lspFactory.UniversalProfile.deploy({
controllerAddresses: ['0x...'],
lsp3Profile: {
json: lsp3ProfileJson,
urlf: 'https://mycoolserver.com/myProfile.json'
}
});
};
```
Or provide the hash value and then uploaded file URL:
```javascript title='Providing an already uploaded LSP3 metadata url and hash values'
await lspFactory.UniversalProfile.deploy({
controllerAddresses: ['0x...'],
lsp3Profile: {
hash: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14',
hashFunction: 'keccak256(utf8)',
url: 'https://mycoolserver.com/file.json'
}
});
};
```
### Setting Images in LSP3MetaData
`profileImage` and `backgroundImage` can be passed inside the `lsp3Profile` object . These can be passed as an object containing previously uploaded image Metadata, a Javascript `File` object if being used client-side or `ImageBuffer` if the library is being used in a Node environment.
#### Pre-uploaded Images
An LSP3 Profile requires `profileImage` and `backgroundImage` to be uploaded in multiple sizes so that interfaces can choose which one to load for better loading performance.
If you already have an image uploaded to IPFS in multiple sizes, you can pass image metadata inside the `lsp3Profile` object when deploying a Profile.
Both `profileImage` and `backgroundImage` take an Array, where each element is the metadata of a different image size.
```javascript title='Setting LSP3 metadata to be uploaded with profile and background images'
const myUniversalProfileData = {
name: 'My Universal Profile',
description: 'My cool Universal Profile',
profileImage: [
{
width: 500,
height: 500,
hashFunction: 'keccak256(bytes)',
hash: '0xfdafad027ecfe57eb4ad044b938805d1dec209d6e9f960fc320d7b9b11cced14', // bytes32 hex string of the image hash
url: 'ipfs://QmPLqMFDxiUgYAom3Zg4SiwoxDaFcZpHXpCmiDzxrajSGp',
},
... // Multiple image sizes should be included
],
backgroundImage: [
{
width: 500,
height: 500,
hashFunction: 'keccak256(bytes)',
hash: '0xfdafad027ecfe57eb4ad047b938805d1dec209d6e9f960fc320d7b9b11cbed14', // bytes32 hex string of the image hash
url: 'ipfs://QmPLqMFHxiUDYAom3Zg4SiwoxDaFcZpHXpAmiDzxrtjSGp',
},
... // Multiple image sizes should be included
],
};
await lspFactory.UniversalProfile.deploy({
controllingAccounts: ['0x...'],
lsp3Profile: myUniversalProfileData
});
};
```
#### Using Javascript File object
Javascript offers a `File` object for easy handling of files inside a browser. These can be passed to `profileImage` and `backgroundImage` fields to allow easy drag and drop of images from a user interface.
:::caution
Javascript's `File` object is only available when using javascript in the browser. If using LSPFactory in a Node environment Images should be uploaded as an [ImageBuffer](./universal-profile#using-image-buffer)
:::
```javascript
<input type="file" id="input">
<script>
const myLocalFile = document.getElementById('input').files[0];
const myUniversalProfileData = {
name: "My Universal Profile",
description: "My cool Universal Profile",
profileImage: myLocalFile,
backgroundImage: myLocalFile,
tags: ['Fashion', 'Design'],
links: [{
title: "My Website",
url: "www.my-website.com"
}],
};
await lspFactory.UniversalProfile.deploy({
controllingAccounts: ['0x...'],
lsp3Profile: myUniversalProfileData
});
};
<script/>
```
LSPFactory will create 5 resized versions of the passed image, with max sizes of `1800x1800`, `1024x1024`, `640x640`, `320x320`, `180x180`. These resized images will be set inside the LSP3 metadata and attached to the `ERC725Account`.
#### Using Image Buffers
If using LSPFactory in a Node environment where Javascript `File` object is not available, `profileImage` and `backgroundImage` can be uploaded by passing a File Buffer directly.
The image mimetype must also be passed so that the image can be reconstructed and resized. Supported mimetypes can be easily accessed by using the `SupportedImageBufferFormats` enum exported by LSPFactory. Supported mime types are `image/png`, `image/bmp`, `image/jpeg` and `image/gif`.
```javascript
const profileImageBuffer = fs.readFileSync('./my-profile-image.png');
const backgroundImageBuffer = fs.readFileSync('./my-background-image.png');
const myUniversalProfileData = {
name: 'My Universal Profile',
description: 'My cool Universal Profile',
profileImage: {
buffer: profileImageBuffer,
mimeType: SupportedImageBufferFormats.png,
},
backgroundImage: {
buffer: backgroundImageBuffer,
mimeType: SupportedImageBufferFormats.png,
},
};
await lspFactory.UniversalProfile.deploy({
controllingAccounts: ['0x...'],
lsp3Profile: myUniversalProfileData,
});
```
### Uploading LSP3 metadata to IPFS
You can upload your LSP3 metadata before deploying a Universal Profile by using the `uploadMetaData()` method. This uses the same [`lsp3Profile` object schema](./universal-profile#adding-lsp3-metadata) defined above when deploying a Universal Profile.
Returns an object containing the IPFS upload location of your metadata, and your lsp3metdata as a javascript object.
```javascript
await myLSPFactory.UniversalProfile.uploadMetaData(lsp3Profile [, options]);
```
To upload using a custom IPFS gateway pass the `options` object. This is the same `options` object used when deploying a Universal Profile. [Read more](./universal-profile#ipfs-upload-options).
`uploadMetaData()` is available as both a static or non-static method so can be called without instantiating an LSPFactory object.
```javascript title="calling uploadMetaData on an LSPFactory instance"
await myLSPFactory.UniversalProfile.uploadMetaData(myLSP3MetaData);
> {
hash: '0x1234...',
hashFunction: 'keccak256(utf8)',
url: 'https://ipfs.lukso.network/ipfs/QmPzUfdKhY6vfcLNDnitwKanpm5GqjYSmw9todNVmi4bqy',
json: {
LSP3Profile: {
name: "My Universal Profile",
description: "My Cool Universal Profile",
...
}
}
}
```
```javascript title="calling uploadMetaData on the uninstantiated class"
await UniversalProfile.uploadMetaData(myLSP3MetaData);
> // same as above
```
## Deployment Configuration
A Universal Profile is composed of three smart contracts. [LSP0 ERC725 Account](../../../standards/universal-profile/lsp0-erc725account), [LSP6 Key Manager](../../../standards/universal-profile/lsp6-key-manager) and [LSP1-UniversalReceiver](../../../standards/generic-standards/lsp1-universal-receiver.md). You can configure how these contracts should be deployed inside the `contractDeploymentOptions` object when deploying a Universal Profile. Each contract can be configured separately, the available options are the same for all contracts.
```javascript
await lspFactory.UniversalProfile.deploy({...}, {
ERC725Account: {
version: '0.4.1',
},
UniversalReceiverDelegate: {
baseContract: '0x...'
},
KeyManager: {
libAddress: '0x6c1F3Ed2F99054C88897e2f32187ef15c62dC560'
}
})
```
### Proxy Deployment
Allows you to determine whether your contract should be deployed as a **minimal proxy contract** based on [EIP1167](https://eips.ethereum.org/EIPS/eip-1167) or a full contract with a constructor.
```javascript
lspFactory.UniversalProfile.deploy({...}, {
ERC725Account: {
deployProxy: false,
},
})
```
A proxy contract is a lightweight contract which inherits its logic by referencing the address of a contract already deployed on the blockchain. This allows cheaper deployment of Universal Profiles because only the proxy contract needs to be deployed.
LSPFactory stores base contract addresses inside the [version file](https://github.com/lukso-network/tools-lsp-factory/blob/main/src/versions.json). If no version is specified in the `version` parameter, the latest available base contract version will be used.
:::info Info
LSPFactory stores base contract addresses for different versions [internally](https://github.com/lukso-network/tools-lsp-factory/blob/main/src/versions.json) and uses the latest available version if no version is specified.
:::
If you do not want your contract to use proxy deployment you can set `deployProxy` to `false`. This will deploy a 'full' contract with a constructor rather than using a proxy deployment with initializer. When set to `false`, the latest available contract version will be deployed.
`deployProxy` defaults to `true` for `ERC725Account` and `LSP6KeyManager` and `false` for `UniversalReceiverDelegate`.
When using proxy deployment, LSPFactory will check that there is bytecode deployed at the base contract address before deploying. If there is none, a new base contract will be deployed and referenced in the proxy contract. This is useful when using LSPFactory on a local development network like Hardhat where there will be no pre-deployed base contracts.
#### Universal Receiver Delegate proxy deployment
The `UniversalReceiverDelegate` is a logic contract which writes to the Universal Profile when it receives some asset. This is not specific to any particular Universal Profile so the same `UniversalReceiverDelegate` contract can be used for multiple different Universal Profile deployments.
By default LSPFactory will use the latest available version of `UniversalReceiverDelegate` version stored in the [version file](https://github.com/lukso-network/tools-lsp-factory/blob/main/src/versions.json). This address is used directly on the Universal Profile and is given the `SETDATA` LSP6 permission. This means that no `UniversalReceiverDelegate` contract needs to be deployed when deploying a Universal Profile which further saves on the gas cost of Universal Profile deployment.
To specify that your Universal Profile should use proxy deployment when deploying the `UniversalReceiverDelegate` contract, set `deployProxy` to `true`.
```javascript
lspFactory.UniversalProfile.deploy({...}, {
UniversalReceiverDelegate: {
deployProxy: true,
},
})
```
### Using a Custom Address
You can specify the base contract address of a contract by passing the `libAddress` parameter. This allows you to use a custom implementation of a contract standard by using a custom base contract you have previously deployed. A custom base contract passed here must adhere to the relevant LSP contract standard it is being used for.
```javascript title="Deploying a Universal Profile with a custom base contract implementation of ERC725Account"
lspFactory.UniversalProfile.deploy({...}, {
ERC725Account: {
libAddress: '0x00b1d454Eb5d917253FD6cb4D5560dEC30b0960c',
},
})
```
:::info Info
`UniversalReceiverDelegate` does not use proxy deployment by default. When setting the `UniversalReceiverDelegate` `libAddress`, if `deployProxy` is not set to `true` LSPFactory will use the provided address directly. The provided address will be given the `SETDATA` LSP6 permission and set as the [LSP1UniversalReceiverDelegate key](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-0-ERC725Account.md#lsp1universalreceiverdelegate) on the ERC725Account. [Read more](./universal-profile#universal-receiver-delegate-proxy-deployment)
:::
```javascript title="Using a custom UniversalReceiverDelegate address"
lspFactory.UniversalProfile.deploy({...}, {
UniversalReceiverDelegate: {
libAddress: '0x00b1d454Eb5d917253FD6cb4D5560dEC30b0960c',
deployProxy: false
},
})
```
### Contract Versions
The version of all three contracts can be set at once by passing the global `version` parameter. This will set all contracts to use the same base contract version. Version can also be set per contract which will take precedence over the global version.
```javascript title="Deploying a Universal Profile with all contracts set to version 0.5.0"
await lspFactory.UniversalProfile.deploy({...}, {
version: '0.5.0'
});
```
```javascript title="Deploying a Universal Profile at version 0.5.0, with a KeyManager set to version to 0.4.0"
await lspFactory.UniversalProfile.deploy({...}, {
version: '0.5.0',
KeyManager: {
version: '0.4.0'
}
});
```
### Deploying Custom Bytecode
When deploying a Universal Profile, you can use your own custom implementation of a contract by passing the compiled creation bytecode of a contract you have written as the `bytecode` parameter. This can be the creation byte code of a custom contract implementation you have written according to your use case. The implementation must meet the relevant LSP standard requirements.
The custom bytecode will be deployed and used as part of the Universal Profile. Contracts deployed from custom bytecode will not use any proxy contract deployment.
```javascript title="Deploying a Universal Profile with a custom KeyManager implementation"
lspFactory.UniversalProfile.deploy({...}, {
KeyManager: {
bytecode: '0x...'
}
});
```
### IPFS Upload Options
You can specify how you want your profile metadata to be uploaded by passing the `options` object. Here you can set the IPFS gateway where you want the profile metadata to be uploaded.
This takes an `ipfsClientOptions` object as defined by the [ipfs-http-client library](https://github.com/ipfs/js-ipfs/tree/master/packages/ipfs-http-client#createoptions) which is used internally to interact with IPFS.
```javascript
lspFactory.UniversalProfile.deploy({...}, {
ipfsClientOptions: {
host: 'ipfs.infura.io',
port: 5001,
protocol: 'https',
}
})
```
If `options` object is provided it will override the `options` object passed at the instantiation of the LSPFactory.
### Reactive Deployment
LSPFactory uses [RxJS](https://rxjs.dev/) to deploy contracts. This can be leveraged to achieve reactive deployment of Universal Profiles.
When deploying a Universal Profile pass the `deployReactive` flag inside the `contractDeploymentOptions` object to receive an [RxJS](https://rxjs.dev/) Observable which will emit events as your contract is deployed.
```typescript
const universalProfileDeploymentObservable = lspFactory.UniversalProfile.deploy({...}, {
deployReactive: true
}
);
universalProfileDeploymentObservable.subscribe({
next: (deploymentEvent) => {
console.log(deploymentEvent);
},
complete: () => {
console.log('Universal Profile deployment completed');
},
});
/**
{ type: 'PROXY', contractName: 'ERC725Account', status: 'PENDING', transaction: {} },
{ type: "PROXY", contractName: 'ERC725Account', status: 'PENDING', receipt: {} },
{ type: "PROXY", contractName: 'ERC725Account', functionName: 'initialize', status: 'PENDING', transaction: {} },
{ type: "PROXY", contractName: 'ERC725Account', functionName: 'initialize', status: 'COMPLETE', receipt: {} },
{ type: 'CONTRACT', contractName: 'KeyManager', status: 'PENDING', transaction: {} },
{ type: "PROXY", contractName: 'UniversalReceiver...', status: 'PENDING', transaction: {} },
{ type: 'CONTRACT', contractName: 'KeyManager', status: 'COMPLETE', receipt: {} },
{ type: "PROXY", contractName: 'UniversalReceiver...', status: 'PENDING', receipt: {} },
{ type: "PROXY", contractName: 'UniversalReceiver...', functionName: 'initialize', status: 'PENDING', transaction: {} },
{ type: "PROXY", contractName: 'UniversalReceiver...', functionName: 'initialize', status: 'COMPLETE', receipt: {} },
{ type: 'TRANSACTION', contractName: 'ERC725Account', functionName: 'setData', status: 'PENDING', transaction: {} },
{ type: 'TRANSACTION', contractName: 'ERC725Account', functionName: 'setData', status: 'COMPLETE', receipt: {} },
{ type: 'TRANSACTION', contractName: 'ERC725Account', functionName: 'transferOwnership', status: 'PENDING', transaction: {} },
{ type: 'TRANSACTION', contractName: 'ERC725Account', functionName: 'transferOwnership', status: 'COMPLETE', receipt: {} },
Universal Profile deployment completed
*/
```
The function defined in `next` will be called whenever a new deployment event is created. The function defined in `complete` will be called once after deployment is finished.
Reactive Deployment may be useful for certain front end behaviours to give better feedback to users when they trigger a Universal Profile deployment from a user interface. For example you may want to implement a loading bar to tell users how deployment is progressing, or display details and addresses of the contracts as they are deployed
| 47.358862 | 543 | 0.734464 | eng_Latn | 0.863914 |
5465d8e58454dbae9236248fda407621aba4bac3 | 3,976 | md | Markdown | README.md | muratgozel/js-event-emitter | 64ca870ee57c5f382788214e354600116e25c941 | [
"MIT"
] | 1 | 2019-05-30T17:50:27.000Z | 2019-05-30T17:50:27.000Z | README.md | muratgozel/js-event-emitter | 64ca870ee57c5f382788214e354600116e25c941 | [
"MIT"
] | 4 | 2019-11-03T14:56:51.000Z | 2021-05-25T13:44:07.000Z | README.md | muratgozel/js-event-emitter | 64ca870ee57c5f382788214e354600116e25c941 | [
"MIT"
] | null | null | null | # Javascript Event Emitter Object
A simple event emitter object that you can plug into your javascript libraries.

[](https://badge.fury.io/js/event-emitter-object)


API is very similar to [the node.js events][305ab206].
[305ab206]: https://nodejs.org/api/events.html "node.js events api"
## Install
```sh
npm install event-emitter-object
```
## Import
There are different types of distributions depending on your use case. Essentially, the package can be imported via require:
```js
const EventEmitterObject = require('event-emitter-object')
```
or via script tag:
```html
<script src="https://cdn.jsdelivr.net/npm/event-emitter-object@4/dist/event-emitter-object.iife.js" crossorigin type="text/javascript"></script>
```
but there are lots of other options. See distribution report below.
## Usage
Simple logger:
```js
const {create} = require('event-emitter-object')
const logger = create()
logger.on('criticalError', function(err) {
// send log to the server
})
// ... when an error happens:
logger.emit('criticalError', new Error('resourceNotFound'))
```
When arguments and return values matter:
```js
const emailMessages = create()
emailMessages.on('emailMessage', function(recipient, subject, message) {
// send an email and return the id of the sent message
return {id: 1}
})
const results = emailMessages.emit('emailMessage', ['[email protected]', 'Hey', 'Lorem ipsum.'])
// results == [{ok: 1}]
```
Return values are always array because multiple event functions can be attached to the same event:
```js
const emailMessages = create()
emailMessages.on('emailMessage', function(recipient, subject, message) {
// send an email and return the id of the sent message
return {id: 1}
})
emailMessages.on('emailMessage', function(recipient, subject, message) {
return 'ok'
})
const results = emailMessages.emit('emailMessage', ['[email protected]', 'Hey', 'Lorem ipsum.'])
// results == [{ok: 1}, 'ok']
```
An event that will be invoked by the emitter just once:
```js
const analytics = create()
analytics.on('view', function(id, title) {
// save visitor and landing page info
return 'done'
}, {once: true})
analytics.on('view', function(id, title) {
// send page view to the analytics server
return 'ok'
})
const results = analytics.emit('view', [1, 'Homepage'])
// results == ['done', 'ok']
const results2 = analytics.emit('view', [2, 'Contact'])
// results2 == ['ok']
```
## Distributions Report
This is an auto-generated report that shows the type, name and size of the bundles available to use individually.
[comment]: # (DISTRIBUTIONS_REPORT_START)
```js
[
"event-emitter-object.amd.js (1.08 KB)",
"event-emitter-object.amd.polyfilled.js (10.61 KB)",
"event-emitter-object.cjs.js (1.08 KB)",
"event-emitter-object.cjs.polyfilled.js (10.64 KB)",
"event-emitter-object.es.js (1.06 KB)",
"event-emitter-object.es.polyfilled.js (10.63 KB)",
"event-emitter-object.iife.js (1.10 KB)",
"event-emitter-object.iife.polyfilled.js (10.63 KB)",
"event-emitter-object.umd.js (1.30 KB)",
"event-emitter-object.umd.polyfilled.js (10.82 KB)"
]
```
[comment]: # (DISTRIBUTIONS_REPORT_END)
## Babel Polyfills Report
This is an auto-generated report that shows the pollyfils added by core-js based on the targets configuration described below.
[comment]: # (BABEL_POLYFILLS_REPORT_START)
```js
// polyfills:
[]
// based on the targets:
{
"android": "4.4.3",
"chrome": "49",
"edge": "18",
"firefox": "78",
"ie": "10",
"ios": "6",
"opera": "73",
"safari": "5.1",
"samsung": "4"
}
```
[comment]: # (BABEL_POLYFILLS_REPORT_END)
---
Thanks for watching 🐬
[](https://ko-fi.com/F1F1RFO7)
| 28.198582 | 144 | 0.700453 | eng_Latn | 0.603222 |
5468ebaf418df114f4a6cdf6c308a53abddd5434 | 7,251 | md | Markdown | README.md | tansoz/request | 8c43dd28513e7e1fafa3f030fd98647758bcb31f | [
"Apache-2.0"
] | 1 | 2021-11-11T20:32:26.000Z | 2021-11-11T20:32:26.000Z | README.md | tansoz/request | 8c43dd28513e7e1fafa3f030fd98647758bcb31f | [
"Apache-2.0"
] | null | null | null | README.md | tansoz/request | 8c43dd28513e7e1fafa3f030fd98647758bcb31f | [
"Apache-2.0"
] | null | null | null | # Quick Start
This is a very simple guide to the request library. Just want to be easy to do what I would like to do. So I build it.
## Install
You just need to copy and paste the command to the terminal and press the Enter key.
```
go get -u github.com/tansoz/request
```
## Usage
First, You need import the library with the import statement.
```GO
import "github.com/tansoz/request"
```
Make sure the library was imported before writing a request with the library.
### GET
Use the library to send a simple GET request
```GO
if resp := request.Get("https://httpbin.org/get", map[string]interface{}{
"id":1515,
"method":"get"
}); resp.Error() == nil {
var tmp bytes.Buffer
tmp.ReadFrom(resp.Readable())
fmt.Println(tmp.String())
} else {
fmt.Println(resp.Error())
}
```
Result:
```JSON
{
"args": {
"id": "1515",
"method": "get"
},
"headers": {
"Accept-Encoding": "gzip",
"Host": "httpbin.org",
"User-Agent": "request/1.1.2",
"X-Amzn-Trace-Id": "Root=1-61928190-67740ba50929357a16b5f917"
},
"origin": "123.154.60.166",
"url": "https://httpbin.org/get?id=1515&method=get"
}
```
### POST
Use the library to send a simple POST request
```GO
if resp := request.Post("https://httpbin.org/post", map[string]interface{}{
"id": 1515,
"foo": "bar",
}); resp.Error() == nil {
var tmp bytes.Buffer
tmp.ReadFrom(resp.Readable())
fmt.Println(tmp.String())
} else {
fmt.Println(resp.Error())
}
```
Result:
```JSON
{
"args": {},
"data": "",
"files": {},
"form": {
"foo": "bar",
"id": "1515"
},
"headers": {
"Accept-Encoding": "gzip",
"Content-Length": "15",
"Content-Type": "application/x-www-form-urlencoded; charset=utf-8",
"Host": "httpbin.org",
"User-Agent": "request/1.1.2",
"X-Amzn-Trace-Id": "Root=1-61928192-327e74387dd38edc28ebdcb3"
},
"json": null,
"origin": "123.154.60.166",
"url": "https://httpbin.org/post"
}
```
### UPLOAD FILES WITH METHOD POST
Use the library to send a simple POST request
```GO
if resp := request.New(
option.POST,
option.URL("https://httpbin.org/post"),
).Go(body.MultipartBody([]body.Field{
body.FileBodyField("files", "testfile.txt", "go.sum", "text/plain", 0, -1, nil),
}, "", nil)); resp.Error() == nil {
var tmp bytes.Buffer
tmp.ReadFrom(resp.Readable())
fmt.Println(tmp.String())
} else {
fmt.Println(resp.Error())
}
```
Result:
```JSON
{
"args": {},
"data": "",
"files": {
"files": "github.com/tansoz/request v1.1.2 h1:z5So8y7pVoOwZ1WKXuqIiTzZ3GOvHuxbeGsr8gu6cro=\ngithub.com/tansoz/request v1.1.2/go.mod h1:FDMFH2cBkmqc5nykpBCF520HD7clEI/tnIUCv0w0Jac=\n"
},
"form": {},
"headers": {
"Accept-Encoding": "gzip",
"Content-Length": "351",
"Content-Type": "multipart/form-data; boundary=NTU3NzAwNjc5MzU4NDc3MTQzNQ",
"Host": "httpbin.org",
"User-Agent": "request/1.1.2",
"X-Amzn-Trace-Id": "Root=1-6192841a-20d704f01eada96111bb0c3d"
},
"json": null,
"origin": "123.154.60.166",
"url": "https://httpbin.org/post"
}
```
## Advance
### New a request
```GO
request.New(
option.Method("GET"),
option.URL("https://github.com/tansoz/request")
)
```
### Send a request
```GO
request.New(
option.Method("GET"),
option.URL("https://github.com/tansoz/request")
).Go(nil) // Call the Go function with a null body
```
### Set Method
```GO
request.New(
option.Method("GET"), // option.POST, option.PUT, options.HEAD ...
option.URL("https://github.com/tansoz/request"),
)
```
### Set URL
```GO
request.New(
option.Method("GET"),
option.URL("https://github.com/tansoz/request"), // this option method is set request URL
)
```
### Set Headers
```GO
request.New(
option.Method("GET"),
option.URL("https://github.com/tansoz/request"),
option.Headers(map[string][]string{
"User-Agent":{"the request library by Romm Hui"}
}),
)
```
### Set Proxy URL
```GO
request.New(
option.Method("GET"),
option.URL("https://github.com/tansoz/request"),
option.Headers(map[string][]string{
"User-Agent":{"the request library by Romm Hui"}
}),
option.ProxyURL("http://127.0.0.1:8080"), // supported socks, http, https scheme
)
```
### Set Timeout
```GO
request.New(
option.Method("GET"),
option.URL("https://github.com/tansoz/request"),
option.Headers(map[string][]string{
"User-Agent":{"the request library by Romm Hui"}
}),
option.ProxyURL("http://127.0.0.1:8080"),
option.Timeout(1000), // 1 second here, millisecond as a unit
)
```
### Set Hostname
```GO
request.New(
option.Method("GET"),
option.URL("https://github.com/tansoz/request"),
option.Headers(map[string][]string{
"User-Agent":{"the request library by Romm Hui"}
}),
option.ProxyURL("http://127.0.0.1:8080"),
option.Timeout(1000),
option.Host("www.github.com"), // set hostname
)
```
### Set Range
```GO
request.New(
option.Method("GET"),
option.URL("https://github.com/tansoz/request"),
option.Headers(map[string][]string{
"User-Agent":{"the request library by Romm Hui"}
}),
option.ProxyURL("http://127.0.0.1:8080"),
option.Timeout(1000),
option.Host("www.github.com"), // set hostname
option.Range(100,200), // set range. Bytes=100-200
)
```
### Send a request with a Multipart body
```GO
multipartBody := body.MultipartBody(
[]body.Field{
body.FileBodyField("files", "testfile.txt", "go.mod", "text/plain", 0, -1, nil),
body.ParamField("id", 15, nil),
body.QueryBodyField("data", map[string]interface{}{
"str": "hello world",
"number": 15,
"bool": false,
}, nil),
},
"",
nil,
)
request.New(
option.Method("POST"),
option.URL("https://httpbin.org/post"),
option.Headers(map[string][]string{
"User-Agent":{"the request library by Romm Hui"},
}),
).Go(multipartBody)
```
Result:
```JSON
{
"args": {},
"data": "",
"files": {
"files": "module github.com/tansoz/request\n\ngo 1.13\n"
},
"form": {
"data": "bool=false&number=15&str=hello+world",
"id": "15"
},
"headers": {
"Accept-Encoding": "gzip",
"Content-Length": "520",
"Content-Type": "multipart/form-data; boundary=NTU3NzAwNjc5MzU4NDc3NDcwOA",
"Host": "httpbin.org",
"User-Agent": "the request library by Romm Hui",
"X-Amzn-Trace-Id": "Root=1-619290f8-7c81c8bd5245696b5eded914"
},
"json": null,
"origin": "123.154.60.166",
"url": "https://httpbin.org/post"
}
```
### tools.JSON
it can easy to get value from a JSON data structure
```GO
obj := new(JSON)
json.Unmarshal([]byte(`{"author":"RommHui","name":"request","version":[1,2,0]}`), obj.Set())
fmt.Println(obj.Get("author").(string))
fmt.Println(obj.Get("version", 1))
fmt.Println("obj:", obj.Get())
subobj := obj.JSON("version")
fmt.Println("subobj:", subobj)
fmt.Println(subobj.Get(1))
obj2 := new(JSON)
json.Unmarshal([]byte(`["RommHui",1.20,"request"]`), obj2.Set())
fmt.Println(obj2.Get(0))
fmt.Println(obj2.Get(2))
fmt.Println(obj2.Get())
```
Result:
```
RommHui
2
obj: map[author:RommHui name:request version:[1 2 0]]
subobj: [1 2 0]
2
RommHui
request
[RommHui 1.2 request]
``` | 24.496622 | 186 | 0.615501 | yue_Hant | 0.30189 |
5469d53c01b90f2a6cbd844172e25e1674d2b40a | 569 | md | Markdown | README.md | moresmiles/rails_task_manager | cbfd3365ff4fff6b1379806fa87ddbcfe67c1b76 | [
"MIT"
] | null | null | null | README.md | moresmiles/rails_task_manager | cbfd3365ff4fff6b1379806fa87ddbcfe67c1b76 | [
"MIT"
] | 1 | 2018-06-06T08:56:08.000Z | 2018-06-06T08:56:08.000Z | README.md | moresmiles/rails_task_manager | cbfd3365ff4fff6b1379806fa87ddbcfe67c1b76 | [
"MIT"
] | 1 | 2018-06-06T23:33:18.000Z | 2018-06-06T23:33:18.000Z | # Rails Task Manager
A group task management app made for a rails project at the Flatiron School.
* You can create, read, update, and delete Groups, Lists, and Tasks
* Keep track of all your tasks across all groups
## Usage
To Install locally:
* Fork the repo
* bundle install
* rake db:migrate
* rails s browse to http://localhost:3000
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/moresmiles/rails-task-manager.
## License
Rails-Task-Manager is licensed under the MIT license. (http://opensource.org/licenses/MIT)
| 23.708333 | 104 | 0.757469 | eng_Latn | 0.971103 |
546a6ce7fe732b81a1525569c37ee15daef72f5f | 379 | md | Markdown | src/blog/modify-eleventy-web-app.md | ltagliaferri/dh-rutgers-2022 | 4892e0a6db5ef4e23a214cd76b432e5e5243167e | [
"MIT"
] | 1 | 2022-02-14T19:51:22.000Z | 2022-02-14T19:51:22.000Z | src/blog/modify-eleventy-web-app.md | ltagliaferri/dh-rutgers-2022 | 4892e0a6db5ef4e23a214cd76b432e5e5243167e | [
"MIT"
] | null | null | null | src/blog/modify-eleventy-web-app.md | ltagliaferri/dh-rutgers-2022 | 4892e0a6db5ef4e23a214cd76b432e5e5243167e | [
"MIT"
] | 1 | 2022-01-26T22:15:42.000Z | 2022-01-26T22:15:42.000Z | ---
title: Modify an Eleventy Web App
description: Tutorial on how to create a GitHub account and cloning our main repository
---
<iframe width="560" height="315" src="https://www.youtube.com/embed/TKS-yO6PGXQ" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> | 63.166667 | 248 | 0.775726 | eng_Latn | 0.701257 |
546cc3e28b9bc5c64177cae044c893699703e19b | 397 | md | Markdown | about.md | Finnoscarmorgan/Finnoscarmorgan.github.io | 7a1a365118e09ea55b5c6827acf324e1c29d3fb5 | [
"MIT"
] | null | null | null | about.md | Finnoscarmorgan/Finnoscarmorgan.github.io | 7a1a365118e09ea55b5c6827acf324e1c29d3fb5 | [
"MIT"
] | null | null | null | about.md | Finnoscarmorgan/Finnoscarmorgan.github.io | 7a1a365118e09ea55b5c6827acf324e1c29d3fb5 | [
"MIT"
] | null | null | null | ---
layout: description
title: ProjectsAbout
permalink: /about/
---
<p style="text-align: center;">I am a PhD candidate at the Australian National University with a particular interest in geospatial analysis of 19th century Australian literature. My research interrogates the use of quantitative and computational methods in the humanities, in particular, the use of digital mapping software.</p> | 56.714286 | 328 | 0.801008 | eng_Latn | 0.98815 |
546d364cefc500e722973133d1a84f610e324118 | 226 | md | Markdown | DataStructures_and_Algorithms/Binary_Search_Tree.md | selinarslanbulut/kodluyoruzilkrepo | dd064b46b7886a0b4227b877070e71afe224016a | [
"MIT"
] | null | null | null | DataStructures_and_Algorithms/Binary_Search_Tree.md | selinarslanbulut/kodluyoruzilkrepo | dd064b46b7886a0b4227b877070e71afe224016a | [
"MIT"
] | null | null | null | DataStructures_and_Algorithms/Binary_Search_Tree.md | selinarslanbulut/kodluyoruzilkrepo | dd064b46b7886a0b4227b877070e71afe224016a | [
"MIT"
] | null | null | null | [7, 5, 1, 8, 3, 6, 0, 9, 4, 2] dizisinin Binary-Search-Tree aşamalarını yazınız. <br>
Root = 5
Root(5) sağ tarafında 7 sayısı ,sol tarafında 2 sayısı bulunur.
5
2 7
1 3 6 8
0 4 9 | 25.111111 | 85 | 0.530973 | tur_Latn | 0.997739 |
546da120ddd25476ba11451af2b2010bb1742615 | 45 | md | Markdown | CHANGELOG.md | Hutchison-Technologies/ex_ihdl_units | 6cac4bbb4301e606fdf8df229242e7e036618473 | [
"MIT"
] | null | null | null | CHANGELOG.md | Hutchison-Technologies/ex_ihdl_units | 6cac4bbb4301e606fdf8df229242e7e036618473 | [
"MIT"
] | null | null | null | CHANGELOG.md | Hutchison-Technologies/ex_ihdl_units | 6cac4bbb4301e606fdf8df229242e7e036618473 | [
"MIT"
] | null | null | null | # Changelog
## 0.2.2
## 0.2.1
## 0.2.0
| 4.090909 | 11 | 0.4 | kor_Hang | 0.251307 |
546dc1e7c41ccd4efa7f07bc0f431eff4f1cd030 | 174 | md | Markdown | Hoard_of_the_Dragon_Queen/Episode3.md | ajmyers01/fighter_dice | 6eeaba1b39e6d241159bc5a2c1f6065d1ebd0336 | [
"Apache-2.0"
] | null | null | null | Hoard_of_the_Dragon_Queen/Episode3.md | ajmyers01/fighter_dice | 6eeaba1b39e6d241159bc5a2c1f6065d1ebd0336 | [
"Apache-2.0"
] | null | null | null | Hoard_of_the_Dragon_Queen/Episode3.md | ajmyers01/fighter_dice | 6eeaba1b39e6d241159bc5a2c1f6065d1ebd0336 | [
"Apache-2.0"
] | null | null | null | #Party Hook
```
Leosin wants the party to keep watch over the camp and investigate the cave, and report it back to me in the city of Elturel.
```
#General Flow
*
| 21.75 | 127 | 0.683908 | eng_Latn | 0.999663 |
546e3f0abdeea4b672afd543b56ee3c04e867c03 | 19,787 | md | Markdown | content/docs/hooks-faq.md | EdgLee/react | 4779ad1d83425d4a9bf591536a5d6aefbd365232 | [
"CC-BY-4.0"
] | 1,226 | 2017-05-07T15:08:29.000Z | 2022-03-28T07:11:49.000Z | content/docs/hooks-faq.md | kingCYL/react | 4779ad1d83425d4a9bf591536a5d6aefbd365232 | [
"CC-BY-4.0"
] | 152 | 2017-05-09T16:40:08.000Z | 2022-03-08T22:45:53.000Z | content/docs/hooks-faq.md | kingCYL/react | 4779ad1d83425d4a9bf591536a5d6aefbd365232 | [
"CC-BY-4.0"
] | 778 | 2017-05-07T15:35:37.000Z | 2022-03-26T09:56:02.000Z | ---
id: hooks-faq
title: Hooks FAQ
permalink: docs/hooks-faq.html
prev: hooks-reference.html
---
*Hooks* 是一项新功能提案,可让你在不编写类的情况下使用状态(state)和其他React功能。它们目前处于React v16.7.0-alpha中,并在[此RFC中](https://github.com/reactjs/rfcs/pull/68)进行讨论。
此页面回答了一些有关[Hooks](https://react.docschina.org/docs/hooks-overview.html)的常见问题。
<!--
if you ever need to regenerate this, this snippet in the devtools console might help:
$$('.anchor').map(a =>
`${' '.repeat(2 * +a.parentNode.nodeName.slice(1))}` +
`[${a.parentNode.textContent}](${a.getAttribute('href')})`
).join('\n')
-->
- [采用策略](#%E9%87%87%E7%94%A8%E7%AD%96%E7%95%A5)
- [我是否需要重写所有类组件?](#%E6%88%91%E6%98%AF%E5%90%A6%E9%9C%80%E8%A6%81%E9%87%8D%E5%86%99%E6%89%80%E6%9C%89%E7%B1%BB%E7%BB%84%E4%BB%B6)
- [我的现有React知识中有多少能保持相关性?](#%E6%88%91%E7%9A%84%E7%8E%B0%E6%9C%89react%E7%9F%A5%E8%AF%86%E4%B8%AD%E6%9C%89%E5%A4%9A%E5%B0%91%E8%83%BD%E4%BF%9D%E6%8C%81%E7%9B%B8%E5%85%B3%E6%80%A7)
- [我应该使用Hooks,Class还是两者兼而有之?](#%E6%88%91%E5%BA%94%E8%AF%A5%E4%BD%BF%E7%94%A8hooksclass%E8%BF%98%E6%98%AF%E4%B8%A4%E8%80%85%E5%85%BC%E8%80%8C%E6%9C%89%E4%B9%8B)
- [Hooks涵盖了Class的所有用例吗?](#hooks%E6%B6%B5%E7%9B%96%E4%BA%86class%E7%9A%84%E6%89%80%E6%9C%89%E7%94%A8%E4%BE%8B%E5%90%97)
- [Hooks会替换render props和高阶组件吗?](#hooks%E4%BC%9A%E6%9B%BF%E6%8D%A2render-props%E5%92%8C%E9%AB%98%E9%98%B6%E7%BB%84%E4%BB%B6%E5%90%97)
- [Hook对流行框架的API来说意味着什么(Redux的`connect()`和React Router等)?](#hook%E5%AF%B9%E6%B5%81%E8%A1%8C%E6%A1%86%E6%9E%B6%E7%9A%84api%E6%9D%A5%E8%AF%B4%E6%84%8F%E5%91%B3%E7%9D%80%E4%BB%80%E4%B9%88redux%E7%9A%84connect%E5%92%8Creact-router%E7%AD%89)
- [Hooks可以使用静态类型吗?](#hooks%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%E9%9D%99%E6%80%81%E7%B1%BB%E5%9E%8B%E5%90%97)
- [如何测试使用Hooks的组件?](#%E5%A6%82%E4%BD%95%E6%B5%8B%E8%AF%95%E4%BD%BF%E7%94%A8hooks%E7%9A%84%E7%BB%84%E4%BB%B6)
- [lint规则究竟强制执行了什么?](#lint%E8%A7%84%E5%88%99%E7%A9%B6%E7%AB%9F%E5%BC%BA%E5%88%B6%E6%89%A7%E8%A1%8C%E4%BA%86%E4%BB%80%E4%B9%88)
- [从 Classes 过渡到 Hooks](#%E4%BB%8E-classes-%E8%BF%87%E6%B8%A1%E5%88%B0-hooks)
- [Class中的生命周期与Hook的对应情况](#class%E4%B8%AD%E7%9A%84%E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F%E4%B8%8Ehook%E7%9A%84%E5%AF%B9%E5%BA%94%E6%83%85%E5%86%B5)
- [是否有类似实例变量的东西?](#%E6%98%AF%E5%90%A6%E6%9C%89%E7%B1%BB%E4%BC%BC%E5%AE%9E%E4%BE%8B%E5%8F%98%E9%87%8F%E7%9A%84%E4%B8%9C%E8%A5%BF)
- [我应该使用一个还是多个状态变量?](#%E6%88%91%E5%BA%94%E8%AF%A5%E4%BD%BF%E7%94%A8%E4%B8%80%E4%B8%AA%E8%BF%98%E6%98%AF%E5%A4%9A%E4%B8%AA%E7%8A%B6%E6%80%81%E5%8F%98%E9%87%8F)
- [我可以仅在更新时运行Effect吗?](#%E6%88%91%E5%8F%AF%E4%BB%A5%E4%BB%85%E5%9C%A8%E6%9B%B4%E6%96%B0%E6%97%B6%E8%BF%90%E8%A1%8Ceffect%E5%90%97)
- [如何获得以前的props或state?](#%E5%A6%82%E4%BD%95%E8%8E%B7%E5%BE%97%E4%BB%A5%E5%89%8D%E7%9A%84props%E6%88%96state)
- [我该如何实现`getDerivedStateFromProps`?](#%E6%88%91%E8%AF%A5%E5%A6%82%E4%BD%95%E5%AE%9E%E7%8E%B0getderivedstatefromprops)
- [我可以对函数组件进行引用吗?](#%E6%88%91%E5%8F%AF%E4%BB%A5%E5%AF%B9%E5%87%BD%E6%95%B0%E7%BB%84%E4%BB%B6%E8%BF%9B%E8%A1%8C%E5%BC%95%E7%94%A8%E5%90%97)
- [`const [thing, setThing] = useState()`是什么意思?](#const-thing-setthing--usestate%E6%98%AF%E4%BB%80%E4%B9%88%E6%84%8F%E6%80%9D)
- [性能优化](#%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96)
- [我可以在更新的时候跳过一个effect吗?](#%E6%88%91%E5%8F%AF%E4%BB%A5%E5%9C%A8%E6%9B%B4%E6%96%B0%E7%9A%84%E6%97%B6%E5%80%99%E8%B7%B3%E8%BF%87%E4%B8%80%E4%B8%AAeffect%E5%90%97)
- [我该如何实现`shouldComponentUpdate`?](#%E6%88%91%E8%AF%A5%E5%A6%82%E4%BD%95%E5%AE%9E%E7%8E%B0shouldcomponentupdate)
- [如何记忆计算?](#%E5%A6%82%E4%BD%95%E8%AE%B0%E5%BF%86%E8%AE%A1%E7%AE%97)
- [由于在渲染中创建函数,Hooks是否会变慢?](#%E7%94%B1%E4%BA%8E%E5%9C%A8%E6%B8%B2%E6%9F%93%E4%B8%AD%E5%88%9B%E5%BB%BA%E5%87%BD%E6%95%B0hooks%E6%98%AF%E5%90%A6%E4%BC%9A%E5%8F%98%E6%85%A2)
- [如何避免传递回调?](#%E5%A6%82%E4%BD%95%E9%81%BF%E5%85%8D%E4%BC%A0%E9%80%92%E5%9B%9E%E8%B0%83)
- [如何从`useCallback`读取经常变化的值?](#%E5%A6%82%E4%BD%95%E4%BB%8Eusecallback%E8%AF%BB%E5%8F%96%E7%BB%8F%E5%B8%B8%E5%8F%98%E5%8C%96%E7%9A%84%E5%80%BC)
- [底层实现(Under the Hood)](#%E5%BA%95%E5%B1%82%E5%AE%9E%E7%8E%B0under-the-hood)
- [React如何将Hook调用与组件相关联?](#react%E5%A6%82%E4%BD%95%E5%B0%86hook%E8%B0%83%E7%94%A8%E4%B8%8E%E7%BB%84%E4%BB%B6%E7%9B%B8%E5%85%B3%E8%81%94)
- [Hooks的现有技术是什么?](#hooks%E7%9A%84%E7%8E%B0%E6%9C%89%E6%8A%80%E6%9C%AF%E6%98%AF%E4%BB%80%E4%B9%88)
## 采用策略
### 我是否需要重写所有类组件?
不需要,我们[没有计划](https://react.docschina.org/docs/hooks-intro.html#gradual-adoption-strategy)在React中删除Class——我们都需要保持出货的产品( keep shipping products ),不可能承受重写的成本。我们建议你在新代码中尝试使用Hook。
### 我的现有React知识中有多少能保持相关性?
Hooks给你提供了一种更加直接使用React相关功能——例如状态,生命周期,上下文和引用的方式。但它们并没有从根本上改变React的工作方式,因此你对组件,Props和自上而下数据流的了解也同样重要。
Hooks确实有自己的学习曲线。如果本文档中缺少某些内容,请[提出issue](https://github.com/reactjs/reactjs.org/issues/new),我们会尽力提供帮助。
### 我应该使用Hooks,Class还是两者兼而有之?
当你准备好了,我们鼓励你开始尝试在你新组件中使用Hooks。请确保团队中的每个人都使用它们并熟悉本文档。我们不建议将现有Class重写为Hooks,除非你计划重写它们(例如修复bugs)。
你不能在类组件*中*使用Hooks ,但你绝对可以在一棵组件树中将Class组件和使用Hooks的函数组件混合在一起。无论一个组件是Class还是使用Hook的函数,这只是该组件的实现细节。**当然从长远来看,我们希望Hooks成为人们编写React组件的主要方式。**
### Hooks涵盖了Class的所有用例吗?
我们的目标是让Hooks尽快涵盖Class的所有用例。对于不常见`getSnapshotBeforeUpdate`和`componentDidCatch`生命周期目前还没有对应的Hook,但我们计划会很快添加上。
对于Hook来说,现在还是一个非常早的时期,因此一些方面的集成(如DevTools支持,或Flow/TypeScript类型)可能还没有准备好。某些第三方库也可能与Hook不兼容。
### Hooks会替换render props和高阶组件吗?
通常,render props和高阶组件只渲染一个children。我们认为使用Hooks实现这种用例将会更加简单。就目前而言,这两种模式仍然有其立足之地(例如,虚拟滚动组件可能具有`renderItem`prop,或者可视容器组件可能具有其自己的DOM结构)。但在大多数情况下,使用Hooks就足够了,它可以帮助你减少组件树中的嵌套。
### Hook对流行框架的API来说意味着什么(Redux的`connect()`和React Router等)?
首先,你还可以继续像以往一样使用这些API,没有任何影响。(毕竟函数组件和Class组件本质上没太多区别)
其次,这些库的新版本也可能导出自定义Hook,例如,`useRedux()`或者`useRouter()`允许你使用相同的功能而不需要包装器组件。
### Hooks可以使用静态类型吗?
Hooks的设计考虑了静态类型。因为它们是函数,所以它们比高阶组件之类的模式更容易正确键入。我们已提前与Flow和TypeScript团队联系,他们计划在未来包含React Hooks的定义。
重要的是,如果你想以某种方式更严格地键入React API,则可以考虑使用自定义Hook,它可以让你有权限制React API。React为你提供了原语,但你可以采用与我们提供的开箱即用方式所不同的方式将它们组合在一起。
### 如何测试使用Hooks的组件?
从React的角度来看,使用Hooks的组件也只是一个普通的组件。如果你的测试解决方案不依赖于React内部,则测试使用了Hooks的组件应与你正常测试组件的方式相同。
如果你需要测试自定义Hook,可以通过在测试中创建一个组件并使用自定义Hook来实现。然后,你就可以测试你所编写的组件。
### [lint规则](https://www.npmjs.com/package/eslint-plugin-react-hooks)究竟强制执行了什么?
我们提供了一个[ESLint插件](https://www.npmjs.com/package/eslint-plugin-react-hooks),它强制执行[Hooks规则](https://react.docschina.org/docs/hooks-rules.html)以避免错误。它假设任何以“ `use`” 开头的函数和紧跟在它之后的大写字母是一个Hook。我们认识到这种启发式方法并不完美,可能存在一些误报,但如果没有整个生态系统的约定,就没有办法让Hooks良好的运作 —— 更长的名字会阻止人们采用Hooks或遵循其惯例。
特别是,该规则强制执行:
- 对Hooks的调用要么在*Pascal*命名法(PascalCase)的函数内部(假设是一个组件),要么是另一个`useSomething`函数(假定为自定义Hook)。
- 在每个渲染上以相同的顺序调用Hook。
还有一些启发式方法,它们可能会随着时间的推移而改变,因为我们会对规则进行微调以寻求在发现错误和避免误报之间的平衡。
## 从 Classes 过渡到 Hooks
### Class中的生命周期与Hook的对应情况
- `constructor`:函数组件不需要构造函数。你可以通过调用[`useState`](https://react.docschina.org/docs/hooks-reference.html#usestate)进行初始化。如果计算成本很高,你可以传递一个函数给`useState`。
- `getDerivedStateFromProps`:改为[在渲染时](https://react.docschina.org/docs/hooks-faq.html#how-do-i-implement-getderivedstatefromprops)安排更新。
- `shouldComponentUpdate`:通过 `React.memo` ,[下文](https://react.docschina.org/docs/hooks-faq.html#how-do-i-implement-shouldcomponentupdate)会介绍
- `render`:就是函数本身。
- `componentDidMount`,`componentDidUpdate`,`componentWillUnmount`:[`useEffect` Hook](https://react.docschina.org/docs/hooks-reference.html#useeffect)可表示所有这些组合(包括[不怎么常见](https://react.docschina.org/docs/hooks-faq.html#can-i-skip-an-effect-on-updates) 、[常见](https://react.docschina.org/docs/hooks-faq.html#can-i-run-an-effect-only-on-updates)用例)。
- `componentDidCatch` and `getDerivedStateFromError`: 暂无,后续会加上。
### 是否有类似实例变量的东西?
有的! [`useRef()`](https://react.docschina.org/docs/hooks-reference.html#useref)Hook不只是可以用在DOM上。“ref”对象实际上是一个通用容器,其`current`属性是可变的,可以保存任何值,类似于类上的实例属性。
你可以从`useEffect`从修改它:
```js{2,8}
function Timer() {
const intervalRef = useRef();
useEffect(() => {
const id = setInterval(() => {
// ...
});
intervalRef.current = id;
return () => {
clearInterval(intervalRef.current);
};
});
// ...
}
```
如果我们只是想设置一个间隔,我们就不需要ref(`id`可以作为effect的local变量),但如果我们想从事件处理程序中清除间隔,它会很有用:
```js{3}
// ...
function handleCancelClick() {
clearInterval(intervalRef.current);
}
// ...
```
从概念上讲,你可以将refs视为类中的实例变量。但是,请避免在渲染过程中设置引用 —— 这可能会导致出乎意料的行为。相反,你应该只在事件处理程序和Effect中的修改引用。
### 我应该使用一个还是多个状态变量?
如果你来自Class模式,你可能总是想要在`useState()`一次调用的时就候将所有状态放入一个对象中。如果你愿意,你可以这样做。以下是鼠标移动后的组件示例。我们在local保持其position和size:
```js
function Box() {
const [state, setState] = useState({ left: 0, top: 0, width: 100, height: 100 });
// ...
}
```
现在我们想写当用户移动鼠标的的时候,改变`left`以及`top`的逻辑。请注意,我们必须**手动**将这些字段合并到以前的状态对象中:
```js{4,5}
// ...
useEffect(() => {
function handleWindowMouseMove(e) {
// Spreading "...state" ensures we don't "lose" width and height
setState(state => ({ ...state, left: e.pageX, top: e.pageY }));
}
// Note: this implementation is a bit simplified
window.addEventListener('mousemove', handleWindowMouseMove);
return () => window.removeEventListener('mousemove', handleWindowMouseMove);
}, []);
// ...
```
这是因为当我们更新状态变量时,我们会*替换*它的值。这是不同于`this.setState`的一点,它会自动*合并*了更新的字段到对象。
如果你怀念自动合并的方式,则可以编写自动合并对象状态更新的自定义Hook`useLegacyState`。但是,**我们建议根据哪些值趋于一同更改将状态拆分为多个状态变量。**
例如,我们可以将组件状态拆分为`position`和`size`对象,并始终替换`position`而不需要合并
```js{2,7}
function Box() {
const [position, setPosition] = useState({ left: 0, top: 0 });
const [size, setSize] = useState({ width: 100, height: 100 });
useEffect(() => {
function handleWindowMouseMove(e) {
setPosition({ left: e.pageX, top: e.pageY });
}
// ...
```
分离独立的状态变量也有另一个好处。稍后可以轻松地将一些相关逻辑提取到自定义Hook中,例如:
```js{2,7}
function Box() {
const position = useWindowPosition();
const [size, setSize] = useState({ width: 100, height: 100 });
// ...
}
function useWindowPosition() {
const [position, setPosition] = useState({ left: 0, top: 0 });
useEffect(() => {
// ...
}, []);
return position;
}
```
请注意我们如何在不更改代码的情况下,将与`position`状态变量相关的`useStateh`和Effect移动到自定义Hook中。如果所有状态都在单个对象中,提取它们将更加困难。
将所有状态都放在一次`useState`调用中,亦或是将每个字段都使用一次`useState`调用,这两种方式都行的通。当你能在这两个极端之间找到平衡,将组相关状态分组为几个独立的状态变量时,组件往往最具可读性。如果状态逻辑变得复杂,我们建议[用reducer的方式](https://react.docschina.org/docs/hooks-reference.html#usereducer)或自定义Hook 管理它。
### 我可以仅在更新时运行Effect吗?
这是一个罕见的用例。如果需要,可以[使用手动操作ref](https://react.docschina.org/docs/hooks-faq.html#is-there-something-like-instance-variables)的方式,手动存储一个布尔值,该值对应于你是第一次还是后续渲染做判断,然后在Effect中检查该标志。(如果你发现自己经常这样做,可以为它创建一个自定义Hook。)
### 如何获得以前的props或state?
目前,你可以[使用ref](https://react.docschina.org/docs/hooks-faq.html#is-there-something-like-instance-variables)手动执行此操作:
```js{6,8}
function Counter() {
const [count, setCount] = useState(0);
const prevCountRef = useRef();
useEffect(() => {
prevCountRef.current = count;
});
const prevCount = prevCountRef.current;
return <h1>Now: {count}, before: {prevCount}</h1>;
}
```
这可能有点复杂,但你可以将其提取到自定义Hook中:
```js{3,7}
function Counter() {
const [count, setCount] = useState(0);
const prevCount = usePrevious(count);
return <h1>Now: {count}, before: {prevCount}</h1>;
}
function usePrevious(value) {
const ref = useRef();
useEffect(() => {
ref.current = value;
});
return ref.current;
}
```
注意这种方式如何用在props,state或任何其他计算值。
```js{5}
function Counter() {
const [count, setCount] = useState(0);
const calculation = count * 100;
const prevCalculation = usePrevious(calculation);
// ...
```
未来React可能会提供`usePrevious`开箱即用的Hook,因为它是一个相对常见的用例。
另请参见[派生状态的推荐模式](https://react.docschina.org/docs/hooks-faq.html#how-do-i-implement-getderivedstatefromprops)。
### 我该如何实现`getDerivedStateFromProps`?
虽然你可能[不需要它](https://react.docschina.org/blog/2018/06/07/you-probably-dont-need-derived-state.html),但在极少数情况下(例如实现`<Transition>`组件),你可以在渲染期间更新状态。在退出第一个渲染后,React将立即重新运行具有更新状态的组件,因此它不会很昂贵。
在这里,我们将`row`prop 的先前值存储在状态变量中,以便我们可以比较:
```js
function ScrollView({row}) {
let [isScrollingDown, setIsScrollingDown] = useState(false);
let [prevRow, setPrevRow] = useState(null);
if (row !== prevRow) {
// Row changed since last render. Update isScrollingDown.
setIsScrollingDown(prevRow !== null && row > prevRow);
setPrevRow(row);
}
return `Scrolling down: ${isScrollingDown}`;
}
```
这看起来可能很奇怪,但其渲染过程中的更新过程正是与`getDerivedStateFromProps`在概念上一致的。
### 我可以对函数组件进行引用吗?
虽然你不应需要经常这样做,但你可以通过使用[`useImperativeMethods`](https://react.docschina.org/docs/hooks-reference.html#useimperativemethods)Hook 向父组件暴露一些命令性方法。
### `const [thing, setThing] = useState()`是什么意思?
如果你不熟悉这个语法,可以查看State Hook文档中的这个[解释](https://react.docschina.org/docs/hooks-state.html#tip-what-do-square-brackets-mean)。
## 性能优化
### 我可以在更新的时候跳过一个effect吗?
是。请参阅[有条件地触发Effect](https://react.docschina.org/docs/hooks-reference.html#conditionally-firing-an-effect)。请注意,忘记处理更新通常会[引入错误](https://react.docschina.org/docs/hooks-effect.html#explanation-why-effects-run-on-each-update),这就是为什么这不是一个默认行为。
### 我该如何实现`shouldComponentUpdate`?
你可以用`React.memo`包装一个函数组件,进而来浅显比较它的props:
```js
const Button = React.memo((props) => {
// your component
});
```
它不是一个Hook,因为它不像Hooks那样构成。`React.memo`相当于`PureComponent`,但它只比较props。(你还可以添加第二个参数来指定采用旧props和新props的自定义比较函数。如果它返回true,则跳过更新。)
`React.memo`不比较状态,因为没有单个状态对象可以进行比较。但是你也可以让children变得纯粹(pure),甚至可以[通过`useMemo`优化个别children](https://react.docschina.org/docs/hooks-faq.html#how-to-memoize-calculations)。
### 如何记忆计算?
[`useMemo`](https://react.docschina.org/docs/hooks-reference.html#usememo) Hook就可以让你在多次渲染的时候,缓存之前的计算结果
```js
const memoizedValue = useMemo(() => computeExpensiveValue(a, b), [a, b]);
```
这段代码会调用`computeExpensiveValue(a, b)`。但是如果`[a, b]`自上一个值以来一直没有改变,则`useMemo`会跳过第二次调用它并简单地重用它返回的最后一个值。
方便的是,它也允许你跳过重渲染一个代价昂贵的child:
```js
function Parent({ a, b }) {
// Only re-rendered if `a` changes:
const child1 = useMemo(() => <Child1 a={a} />, [a]);
// Only re-rendered if `b` changes:
const child2 = useMemo(() => <Child2 b={b} />, [b]);
return (
<>
{child1}
{child2}
</>
)
}
```
**请注意,**这种方法在循环中不起作用,因为Hook调用[不能](https://react.docschina.org/docs/hooks-rules.html)放在循环中。但是你可以为列表项提取单独的组件,然后在那里调用`useMemo`。
### 由于在渲染中创建函数,Hooks是否会变慢?
答案是否定的,在现代浏览器中,除了极端情况之外,与类相比,使用闭包的原始性能并没有显着差异。
此外,考虑到Hooks的设计在以下几个方面更有效:
- Hooks避免了类所需的大量开销,例如在构造函数中创建类实例和绑定(binding)事件处理程序的成本。
- **使用Hooks的惯用代码不需要深层组件树嵌套**,而这种嵌套在使用高阶组件,render props和Context的代码库中很常见。使用较小的组件树,React的工作量也会较少。
传统上,React中内联函数的性能问题与每次渲染上传递新的回调会中断子组件中的`shouldComponentUpdate`优化有关。Hooks从三个方面解决了这个问题。
- [`useCallback`](https://react.docschina.org/docs/hooks-reference.html#usecallback) Hook 可以让你在重渲染的时候依然保持对同一回调的引用,这样`shouldComponentUpdate`就能继续工作:
```js{2}
// Will not change unless `a` or `b` changes
const memoizedCallback = useCallback(() => {
doSomething(a, b);
}, [a, b]);
```
* 当个别children更新时,通过使用[`useMemo`Hook](https://react.docschina.org/docs/hooks-faq.html#how-to-memoize-calculations)使得它更容易控制,同时也减少了对pure components的需求。
* 最后,`useReducer`Hook减少了深度传递回调的需要,接下来会介绍。
### 如何避免传递回调?
我们发现大多数人不喜欢手动在组件树的每一层进行回调的传递。虽然它更明确,但它可能感觉做了很多“脏活累活(plumping)”。
在大型组件树中,我们建议的另一种方法是通过从context的[`useReducer`](https://react.docschina.org/docs/hooks-reference.html#usereducer) Hook 中传递一个`dispatch`函数:
```js{4,5}
const TodosDispatch = React.createContext(null);
function TodosApp() {
// Tip: `dispatch` won't change between re-renders
const [todos, dispatch] = useReducer(todosReducer);
return (
<TodosDispatch.Provider value={dispatch}>
<DeepTree todos={todos} />
</TodosDispatch.Provider>
);
}
```
`TodosApp`树里面的任何一个孩子都可以使用`dispatch`函数传递action到`TodosApp`:
```js{2,3}
function DeepChild(props) {
// If we want to perform an action, we can get dispatch from context.
const dispatch = useContext(TodosDispatch);
function handleClick() {
dispatch({ type: 'add', text: 'hello' });
}
return (
<button onClick={handleClick}>Add todo</button>
);
}
```
从维护的角度来看这更方便(不需要保持转发回调),并且完全避免了回调问题。在深度更新`dispatch`像这样向下传递是深度更新的推荐模式。
请注意,你仍然可以选择是将应用程序*状态*作为props(更明确)或是作为上下文传递(对于非常深的更新更方便)。如果你同时也使用上下文传递状态,请使用不同的上下文类型 —— `dispatch`的上下文永远不会更改,因此读取它的组件不需要重新渲染,除非它们还需要应用程序状态。
### 如何从`useCallback`读取经常变化的值?
>Also note that this pattern might cause problems in the [concurrent mode](/blog/2018/03/27/update-on-async-rendering.html). We plan to provide more ergonomic alternatives in the future, but the safest solution right now is to always invalidate the callback if some value it depends on changes.
>
>注意
>
>我们建议[从Context向下传递`dispatch`](https://react.docschina.org/docs/hooks-faq.html#how-to-avoid-passing-callbacks-down)而不是在props中传单个回调。下面的方法仅在此处提及只是为了完整性和预留逃生舱口(escape hatch)。
>
>另请注意,此模式可能会导致[并发模式](https://react.docschina.org/blog/2018/03/27/update-on-async-rendering.html)出现问题。我们计划在未来提供更符合人体工程学的替代方案,但现在最安全的解决方案是,如果某些值依赖于更改,则始终使回调无效。
在极少数情况下,你可能需要使用[`useCallback`](https://react.docschina.org/docs/hooks-reference.html#usecallback)去memoize一个回调,但是因为内部函数必须经常重新创建,因此memoization不能很好地工作。如果你要记忆的函数是事件处理程序并且它在渲染期间并未使用,则可以使用[ref作为实例变量](https://react.docschina.org/docs/hooks-faq.html#is-there-something-like-instance-variables),并将最后提交的值手动保存到其中:
```js{6,10}
function Form() {
const [text, updateText] = useState('');
const textRef = useRef();
useMutationEffect(() => {
textRef.current = text; // Write it to the ref
});
const handleSubmit = useCallback(() => {
const currentText = textRef.current; // Read it from the ref
alert(currentText);
}, [textRef]); // Don't recreate handleSubmit like [text] would do
return (
<>
<input value={text} onChange={e => updateText(e.target.value)} />
<ExpensiveTree onSubmit={handleSubmit} />
</>
);
}
```
这是一个相当复杂的模式,它表明如果你需要的话你依然可以执行此逃逸舱口优化(escape hatch optimization)。当然,如果将其提取到自定义Hook就会更好点:
```js{4,16}
function Form() {
const [text, updateText] = useState('');
// Will be memoized even if `text` changes:
const handleSubmit = useEventCallback(() => {
alert(text);
}, [text]);
return (
<>
<input value={text} onChange={e => updateText(e.target.value)} />
<ExpensiveTree onSubmit={handleSubmit} />
</>
);
}
function useEventCallback(fn, dependencies) {
const ref = useRef(() => {
throw new Error('Cannot call an event handler while rendering.');
});
useMutationEffect(() => {
ref.current = fn;
}, [fn, ...dependencies]);
return useCallback(() => {
const fn = ref.current;
return fn();
}, [ref]);
}
```
在任何一种情况下,我们**都不建议使用此模式**,仅在此处显示完整性。相反,你最好[避免向深处传递回调](https://react.docschina.org/docs/hooks-faq.html#how-to-avoid-passing-callbacks-down)。
## 底层实现(Under the Hood)
### React如何将Hook调用与组件相关联?
React跟踪当前渲染组件。由于[Hooks规则](https://react.docschina.org/docs/hooks-rules.html),我们知道Hook只能从React组件(或自定义Hooks调用 ——它们也只能从React组件中调用)。
每个组件都有一个与之相关联的“存储器单元(memory cells)”的内部列表(list)。它们只是一些可以放置一些数据的JavaScript对象。当你调用Hook时`useState()`,它会读取当前单元格(或在第一次渲染期间初始化它),然后将指针移动到下一个单元格。这就是多个`useState()`调用各自获得独立本地状态的方式。可以[参考](https://medium.com/@ryardley/react-hooks-not-magic-just-arrays-cd4f1857236e)
### Hooks的现有技术是什么?
Hooks综合了几个不同来源的想法:
- 我们旧的实验性的功能API在[react-future](https://github.com/reactjs/react-future/tree/master/07%20-%20Returning%20State)仓库中。
- 与render props API 相关的React社区的实验,包括[Ryan Florence](https://github.com/ryanflorence)的[Reactions Component](https://github.com/reactions/component)。
- [Dominic Gannaway](https://github.com/trueadm)提出了一个render props糖语法的[`adopt`关键字](https://gist.github.com/trueadm/17beb64288e30192f3aa29cad0218067)提案。
- [DisplayScript中的](http://displayscript.org/introduction.html)状态变量和状态单元( state cells )。
- ReasonReact中的[Reducer组件](https://reasonml.github.io/reason-react/docs/en/state-actions-reducer.html)。
- Rx中的[Subscriptions](http://reactivex.io/rxjs/class/es6/Subscription.js~Subscription.html)。
- 多核OCaml中的[代数效应(Algebraic effects)](https://github.com/ocamllabs/ocaml-effects-tutorial#2-effectful-computations-in-a-pure-setting)。
[SebastianMarkbåge](https://github.com/sebmarkbage)提出了Hooks的原创设计,后来由[Andrew Clark](https://github.com/acdlite),[Sophie Alpert](https://github.com/sophiebits),[Dominic Gannaway](https://github.com/trueadm)以及React团队的其他成员完善。
| 38.421359 | 344 | 0.733209 | yue_Hant | 0.856169 |
546e580fb6615607273109da6c099ac7614c1782 | 40,204 | md | Markdown | articles/remote-rendering/tutorials/unity/view-remote-models/view-remote-models.md | MicrosoftDocs/azure-docs.hu-hu | 5fb082c5dae057fd040c7e09881e6c407e535fe2 | [
"CC-BY-4.0",
"MIT"
] | 7 | 2017-08-28T07:44:33.000Z | 2021-04-20T21:12:50.000Z | articles/remote-rendering/tutorials/unity/view-remote-models/view-remote-models.md | MicrosoftDocs/azure-docs.hu-hu | 5fb082c5dae057fd040c7e09881e6c407e535fe2 | [
"CC-BY-4.0",
"MIT"
] | 412 | 2018-07-25T09:31:03.000Z | 2021-03-17T13:17:45.000Z | articles/remote-rendering/tutorials/unity/view-remote-models/view-remote-models.md | MicrosoftDocs/azure-docs.hu-hu | 5fb082c5dae057fd040c7e09881e6c407e535fe2 | [
"CC-BY-4.0",
"MIT"
] | 13 | 2017-09-05T09:10:35.000Z | 2021-11-05T11:42:31.000Z | ---
title: Távolról renderelt modell megtekintése
description: A Hello World "Azure Remote Rendering oktatóanyag bemutatja, hogyan lehet megtekinteni egy, az Azure által távolról renderelt modellt
author: florianborn71
ms.author: flborn
ms.date: 06/15/2020
ms.topic: tutorial
ms.custom: devx-track-csharp
ms.openlocfilehash: f43e5b77580b7071ce48b39190c26a53f99f8cf5
ms.sourcegitcommit: 425420fe14cf5265d3e7ff31d596be62542837fb
ms.translationtype: MT
ms.contentlocale: hu-HU
ms.lasthandoff: 04/20/2021
ms.locfileid: "107740169"
---
# <a name="tutorial-viewing-a-remotely-rendered-model"></a>Oktatóanyag: Távolról renderelt modell megtekintése
Eben az oktatóanyagban az alábbiakkal fog megismerkedni:
> [!div class="checklist"]
>
> * Üzembe Azure Remote Rendering (ARR) példányt
> * Renderelési munkamenet létrehozása és befejezése
> * Meglévő renderelési munkamenet újbóli újrafelhasználása
> * Csatlakozás és a munkamenetek leválasztása
> * Modellek betöltése renderelési munkamenetbe
## <a name="prerequisites"></a>Előfeltételek
Ehhez az oktatóanyaghoz a következőre lesz szüksége:
* Aktív használat alapú Azure-előfizetés [Fiók létrehozása](https://azure.microsoft.com/pricing/purchase-options/pay-as-you-go/)
* Windows SDK 10.0.18362.0 [(letöltés)](https://developer.microsoft.com/windows/downloads/windows-10-sdk)
* Az Visual Studio 2019 [legújabb verziója (letöltés)](https://visualstudio.microsoft.com/vs/older-downloads/)
* GIT [(letöltés)](https://git-scm.com/downloads)
* Unity (lásd [a támogatott verziók](../../../overview/system-requirements.md#unity) rendszerkövetelményét)
* A Unity és a C# nyelv középhaladó ismerete (például szkriptek és objektumok létrehozása, prefabs használata, Unity-események konfigurálása stb.)
## <a name="provision-an-azure-remote-rendering-arr-instance"></a>Üzembe Azure Remote Rendering (ARR) példányt
A Azure Remote Rendering eléréséhez először létre kell hoznia [egy fiókot.](../../../how-tos/create-an-account.md#create-an-account)
## <a name="create-a-new-unity-project"></a>Új Unity-projekt létrehozása
> [!TIP]
> Az [ARR-mintatár](https://github.com/Azure/azure-remote-rendering) egy projektet tartalmaz, amely az összes befejezett oktatóanyagot tartalmazza. Referenciaként használható. A teljes *Unity-projektet keresse meg a Unity\Tutorial-Complete* mappában.
A Unity Hubban hozzon létre egy új projektet.
Ebben a példában feltételezzük, hogy a projekt egy **RemoteRendering** nevű mappában jön létre.
:::image type="content" source="./media/unity-new-project.PNG" alt-text="Új Unity-projekt":::
## <a name="include-the-azure-remote-rendering-package"></a>A Azure Remote Rendering csomagba
[Kövesse az utasításokat](../../../how-tos/unity/install-remote-rendering-unity-package.md) a Azure Remote Rendering Unity-projekthez való hozzáadásához.
## <a name="configure-the-camera"></a>A kamera konfigurálása
1. Válassza a **Main Camera csomópontot.**
1. A helyi menü megnyitásához kattintson a jobb gombbal az *Átalakítás* összetevőre, és válassza az Alaphelyzetbe **állítás** lehetőséget:

1. A **Clear jelzők beállítása Folytonos** *színre*
1. Állítsa **a Háttérszínt** *Fekete* (#000000) teljes mértékben átlátszó (0) alfa (A) beállításra

1. Állítsa **a Vágólapra a** Közel = *0,3 és* a Távol = *20 értékeket.* Ez azt jelenti, hogy a renderelés a 30 cm-nél közelebbi vagy 20 méternél távolabbi geometriát levágja.

## <a name="adjust-the-project-settings"></a>A projektbeállítások módosítása
1. Nyissa *meg > Projektbeállítások szerkesztése...*
1. Válassza **a Quality (Minőség)** lehetőséget a bal oldali listából
1. Módosítsa az **összes platform alapértelmezett minőségi** szintjét *Alacsonyra.* Ez a beállítás lehetővé teszi a helyi tartalom hatékonyabb renderelését, és nincs hatással a távolról renderelt tartalom minőségére.

1. A **bal oldali lista** menüjében válassza a Grafikák lehetőséget
1. Módosítsa **a Scriptable Rendering Pipeline (Szkriptelhető renderelési folyamat)** beállítást *HybridRenderingPipeline beállításra*.\
\
Előfordulhat, hogy a felhasználói felület nem tölti fel az elérhető folyamattípusok listáját a csomagokból. Ha ez történik, a *HybridRenderingPipeline* eszközt manuálisan kell a mezőre húzni:\

> [!NOTE]
> Ha nem tudja áthúzni a *HybridRenderingPipeline* adateszközt a Renderelési folyamat adateszköze mezőbe (valószínűleg azért, mert a mező nem létezik!), győződjön meg arról, hogy a csomagkonfiguráció tartalmazza a `com.unity.render-pipelines.universal` csomagot.
1. A **bal oldali** lista menüjében válassza a Player (Lejátszó) lehetőséget
1. Válassza a **Univerzális Windows-platform beállítások lapját,** amelyet Windows ikon jelöl.
1. Módosítsa az **XR-beállításokat** a Windows Mixed Reality az alábbiak szerint:
1. A **Virtual Reality támogatása**
1. Nyomja meg a "+" gombot, és adjon **hozzá Windows Mixed Reality**
1. Mélységformátum **beállítása** *16 bites mélységre*
1. Győződjön meg arról, hogy a **Mélységi puffer megosztása** engedélyezve van
1. A **Sztereikus renderelési mód beállítása** Single Pass *Instancedre*

1. Ugyanabban az ablakban, az **XR-beállítások felett bontsa** ki a **Közzétételi beállítások gombra**
1. Görgessen le a **Képességek lapra,** és válassza a következő lehetőségeket:
* **InternetClient**
* **InternetClientServer**
* **SpatialPerception (Térbeli pont)**
* **PrivateNetworkClientServer** *(nem kötelező).* Válassza ezt a lehetőséget, ha csatlakoztatni szeretné a Unity távoli hibakeresőt az eszközhöz.
1. A **Támogatott eszközcsaládok alatt** engedélyezze a **Holographic és** a Desktop **alkalmazást**
1. A Project **Settings panel bezárása vagy dokkolása**
1. A *Fájl->buildbeállítások megnyitása*
1. Válassza **a Univerzális Windows-platform**
1. Konfigurálja a beállításokat úgy, hogy azok megegyeznek az alábbi beállításokkal
1. Kattintson a **Switch Platform (Platformváltás)** gombra.\

1. Miután a Unity platformot változtat, zárja be a build panelt.
## <a name="validate-project-setup"></a>A projekt beállításának ellenőrzése
A projektbeállítások helyességét az alábbi lépésekkel ellenőrizheti.
1. Válassza a **ValidateProject** bejegyzést a **Unity szerkesztő eszköztárának RemoteRendering** menüjében.
1. Tekintse át **a ValidateProject ablakot** a hibákért, és szükség esetén javítsa ki a projektbeállításokat.

## <a name="create-a-script-to-coordinate-azure-remote-rendering-connection-and-state"></a>Szkript létrehozása a kapcsolat és Azure Remote Rendering koordinálása
A távolról renderelt modellek megjelenítésének négy alapvető szakasza van, amelyek az alábbi folyamatábrában vannak felvázolva. Minden szakaszt sorrendben kell végrehajtani. A következő lépés egy olyan szkript létrehozása, amely kezeli az alkalmazás állapotát, és végiglépked minden szükséges fázison.

1. A *Project (Projekt) ablaktáblán* az **Assets (Eszközök) alatt hozzon** létre egy *remoteRenderingCore* nevű új mappát. Ezután a *RemoteRenderingCore parancsmagon belül* hozzon létre egy másik, *Scripts nevű mappát.*
1. Hozzon létre egy **remoteRenderingCoordinator** nevű új [C#-szkriptet.](https://docs.unity3d.com/Manual/CreatingAndUsingScripts.html)
A projektnek így kell kinéznie:

Ez a koordinátor-szkript nyomon követi és kezeli a távoli renderelés állapotát. Fontos megjegyezni, hogy a kód egy része az állapot fenntartására, a funkciók más összetevők számára történő felfedésére, események aktiválására és az alkalmazásspecifikus adatok tárolására használatos, amelyek nem kapcsolódnak közvetlenül a Azure Remote Rendering. Használja kiindulási pontként az alábbi kódot, és az oktatóanyag későbbi Azure Remote Rendering implementálja az adott kódhoz.
1. Nyissa **meg a RemoteRenderingCoordinator kódot** a kódszerkesztőben, és cserélje le a teljes tartalmát az alábbi kódra:
```cs
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
using Microsoft.Azure.RemoteRendering;
using Microsoft.Azure.RemoteRendering.Unity;
using System;
using System.Linq;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.Events;
#if UNITY_WSA
using UnityEngine.XR.WSA;
#endif
/// <summary>
/// Remote Rendering Coordinator is the controller for all Remote Rendering operations.
/// </summary>
// Require the GameObject with a RemoteRenderingCoordinator to also have the ARRServiceUnity component
[RequireComponent(typeof(ARRServiceUnity))]
public class RemoteRenderingCoordinator : MonoBehaviour
{
public enum RemoteRenderingState
{
NotSet,
NotInitialized,
NotAuthorized,
NoSession,
ConnectingToExistingRemoteSession,
ConnectingToNewRemoteSession,
RemoteSessionReady,
ConnectingToRuntime,
RuntimeConnected
}
public static RemoteRenderingCoordinator instance;
// Account
// RemoteRenderingDomain must be '<region>.mixedreality.azure.com' - if no '<region>' is specified, connections will fail
// For most people '<region>' is either 'westus2' or 'westeurope'
[SerializeField]
private string remoteRenderingDomain = "westus2.mixedreality.azure.com";
public string RemoteRenderingDomain
{
get => remoteRenderingDomain.Trim();
set => remoteRenderingDomain = value;
}
[Header("Development Account Credentials")]
[SerializeField]
private string accountId = "<enter your account id here>";
public string AccountId {
get => accountId.Trim();
set => accountId = value;
}
[SerializeField]
private string accountDomain = "<enter your account domain here>";
public string AccountDomain
{
get => accountDomain.Trim();
set => accountDomain = value;
}
[SerializeField]
private string accountKey = "<enter your account key here>";
public string AccountKey {
get => accountKey.Trim();
set => accountKey = value;
}
// These settings are important. All three should be set as low as possible, while maintaining a good user experience
// See the documentation around session management and the technical differences in session VM size
[Header("New Session Defaults")]
public RenderingSessionVmSize renderingSessionVmSize = RenderingSessionVmSize.Standard;
public uint maxLeaseHours = 0;
public uint maxLeaseMinutes = 20;
[Header("Other Configuration")]
[Tooltip("If you have a known active SessionID, you can fill it in here before connecting")]
[SerializeField]
private string sessionIDOverride;
public string SessionIDOverride {
get => sessionIDOverride.Trim();
set => sessionIDOverride = value;
}
// When Automatic Mode is true, the coordinator will attempt to automatically proceed through the process of connecting and loading a model
public bool automaticMode = true;
public event Action RequestingAuthorization;
public UnityEvent OnRequestingAuthorization = new UnityEvent();
public event Action AuthorizedChanged;
public UnityEvent OnAuthorizationChanged = new UnityEvent();
private bool authorized;
public bool Authorized
{
get => authorized;
set
{
if (value == true) //This is a one-way value, once we're authorized it lasts until the app is shutdown.
{
authorized = value;
AuthorizedChanged?.Invoke();
}
}
}
public delegate Task<SessionConfiguration> AccountInfoGetter();
public static AccountInfoGetter ARRCredentialGetter
{
private get;
set;
}
private RemoteRenderingState currentCoordinatorState = RemoteRenderingState.NotSet;
public RemoteRenderingState CurrentCoordinatorState
{
get => currentCoordinatorState;
private set
{
if (currentCoordinatorState != value)
{
currentCoordinatorState = value;
Debug.LogFormat(LogType.Log, LogOption.NoStacktrace, null, "{0}", $"State changed to: {currentCoordinatorState}");
CoordinatorStateChange?.Invoke(currentCoordinatorState);
}
}
}
public static event Action<RemoteRenderingState> CoordinatorStateChange;
public static RenderingSession CurrentSession => instance?.ARRSessionService?.CurrentActiveSession;
private ARRServiceUnity arrSessionService;
private ARRServiceUnity ARRSessionService
{
get
{
if (arrSessionService == null)
arrSessionService = GetComponent<ARRServiceUnity>();
return arrSessionService;
}
}
private async Task<SessionConfiguration> GetDevelopmentCredentials()
{
Debug.LogWarning("Using development credentials! Not recommended for production.");
return await Task.FromResult(new SessionConfiguration(AccountDomain, RemoteRenderingDomain, AccountId, AccountKey));
}
/// <summary>
/// Keep the last used SessionID, when launching, connect to this session if its available
/// </summary>
private string LastUsedSessionID
{
get
{
if (!string.IsNullOrEmpty(SessionIDOverride))
return SessionIDOverride;
if (PlayerPrefs.HasKey("LastUsedSessionID"))
return PlayerPrefs.GetString("LastUsedSessionID");
else
return null;
}
set
{
PlayerPrefs.SetString("LastUsedSessionID", value);
}
}
public void Awake()
{
//Forward events to Unity events
RequestingAuthorization += () => OnRequestingAuthorization?.Invoke();
AuthorizedChanged += () => OnAuthorizationChanged?.Invoke();
//Attach to event
AuthorizedChanged += RemoteRenderingCoordinator_AuthorizedChanged;
if (instance == null)
instance = this;
else
Destroy(this);
CoordinatorStateChange += AutomaticMode;
CurrentCoordinatorState = RemoteRenderingState.NotInitialized;
}
private void RemoteRenderingCoordinator_AuthorizedChanged()
{
if (CurrentCoordinatorState != RemoteRenderingState.NotAuthorized)
return; //This isn't valid from any other state than NotAuthorized
//We just became authorized to connect to Azure
InitializeSessionService();
}
/// <summary>
/// Automatic mode attempts to automatically progress through the connection and loading steps. Doesn't handle error states.
/// </summary>
/// <param name="currentState">The current state</param>
private async void AutomaticMode(RemoteRenderingState currentState)
{
if (!automaticMode)
return;
//Add a small delay for visual effect
await Task.Delay(1500);
switch (currentState)
{
case RemoteRenderingState.NotInitialized:
InitializeARR();
break;
case RemoteRenderingState.NotAuthorized:
RequestAuthorization();
break;
case RemoteRenderingState.NoSession:
JoinRemoteSession();
break;
case RemoteRenderingState.RemoteSessionReady:
ConnectRuntimeToRemoteSession();
break;
}
}
/// <summary>
/// Initializes ARR, associating the main camera
/// Note: This must be called on the main Unity thread
/// </summary>
public void InitializeARR()
{
//Implement me
}
/// <summary>
/// Create a new remote session manager
/// If the ARRCredentialGetter is set, use it as it, otherwise use the development credentials
/// </summary>
public async void InitializeSessionService()
{
//Implement me
}
/// <summary>
/// Trigger the event for checking authorization, respond to this event by prompting the user for authentication
/// If authorized, set Authorized = true
/// </summary>
public void RequestAuthorization()
{
RequestingAuthorization?.Invoke();
}
public void BypassAuthorization()
{
Authorized = true;
}
/// <summary>
/// Attempts to join an existing session or start a new session
/// </summary>
public async void JoinRemoteSession()
{
//Implement me
}
public void StopRemoteSession()
{
//Implement me
}
private async Task<bool> IsSessionAvailable(string sessionID)
{
bool sessionAvailable = false;
try
{
RenderingSessionPropertiesArrayResult result = await ARRSessionService.Client.GetCurrentRenderingSessionsAsync();
if (result.ErrorCode == Result.Success)
{
RenderingSessionProperties[] properties = result.SessionProperties;
if (properties != null)
{
sessionAvailable = properties.Any(x => x.Id == sessionID && (x.Status == RenderingSessionStatus.Ready || x.Status == RenderingSessionStatus.Starting));
}
}
else
{
Debug.LogError($"Failed to get current rendering sessions. Error: {result.Context.ErrorMessage}");
}
}
catch (RRException ex)
{
Debug.LogError($"Failed to get current rendering sessions. Error: {ex.Message}");
}
return sessionAvailable;
}
/// <summary>
/// Connects the local runtime to the current active session, if there's a session available
/// </summary>
public void ConnectRuntimeToRemoteSession()
{
//Implement me
}
public void DisconnectRuntimeFromRemoteSession()
{
//Implement me
}
/// <summary>
/// The session must have its runtime pump updated.
/// The Connection.Update() will push messages to the server, receive messages, and update the frame-buffer with the remotely rendered content.
/// </summary>
private void LateUpdate()
{
ARRSessionService?.CurrentActiveSession?.Connection?.Update();
}
/// <summary>
/// Loads a model into the remote session for rendering
/// </summary>
/// <param name="modelPath">The model's path</param>
/// <param name="progress">A call back method that accepts a float progress value [0->1]</param>
/// <param name="parent">The parent Transform for this remote entity</param>
/// <returns>An awaitable Remote Rendering Entity</returns>
public async Task<Entity> LoadModel(string modelPath, Transform parent = null, Action<float> progress = null)
{
//Implement me
return null;
}
private async void OnRemoteSessionStatusChanged(ARRServiceUnity caller, RenderingSession session)
{
var properties = await session.GetPropertiesAsync();
switch (properties.SessionProperties.Status)
{
case RenderingSessionStatus.Error:
case RenderingSessionStatus.Expired:
case RenderingSessionStatus.Stopped:
case RenderingSessionStatus.Unknown:
CurrentCoordinatorState = RemoteRenderingState.NoSession;
break;
case RenderingSessionStatus.Starting:
CurrentCoordinatorState = RemoteRenderingState.ConnectingToNewRemoteSession;
break;
case RenderingSessionStatus.Ready:
CurrentCoordinatorState = RemoteRenderingState.RemoteSessionReady;
break;
}
}
private void OnLocalRuntimeStatusChanged(ConnectionStatus status, Result error)
{
switch (status)
{
case ConnectionStatus.Connected:
CurrentCoordinatorState = RemoteRenderingState.RuntimeConnected;
break;
case ConnectionStatus.Connecting:
CurrentCoordinatorState = RemoteRenderingState.ConnectingToRuntime;
break;
case ConnectionStatus.Disconnected:
CurrentCoordinatorState = RemoteRenderingState.RemoteSessionReady;
break;
}
}
}
```
## <a name="create-the-azure-remote-rendering-gameobject"></a>A Azure Remote Rendering GameObject létrehozása
A távoli renderelési koordinátor és a hozzá szükséges szkript *(ARRServiceUnity)* egyaránt MonoBehaviours, amelyek egy GameObjecthez kell csatolva a jelenetben. Az *ARRServiceUnity* szkriptet az ARR biztosítja, hogy elérhetővé tegye az ARR távoli munkamenetekhez való csatlakozására és kezelésére szolgáló funkcióinak nagy része.
1. Hozzon létre egy új GameObjectet a jelenetben (Ctrl+Shift+N vagy *GameObject->Create Empty*) és nevezze el **RemoteRenderingCoordinator néven.**
1. Adja hozzá *a RemoteRenderingCoordinator* szkriptet a **RemoteRenderingCoordinator** GameObject.\ parancsprogramhoz.

1. Győződjön meg arról, hogy az inspectorban Szolgáltatásként megjelenő *ARRServiceUnity* szkript automatikusan hozzáadódik a GameObjecthez. Ha érdekli, ez az eredmény a `[RequireComponent(typeof(ARRServiceUnity))]` **RemoteRenderingCoordinator szkript tetején** található.
1. Adja hozzá Azure Remote Rendering hitelesítő adatait, a fióktartományt és a Remote Rendering tartományt a koordinátor-szkripthez:\

## <a name="initialize-azure-remote-rendering"></a>Inicializálja Azure Remote Rendering
Most, hogy már van keretrendszerünk a koordinátorunkhoz, implementáljuk mind a négy szakaszt, kezdve az **Inicializálással Remote Rendering.**

**Az inicializálás** Azure Remote Rendering jelzi, hogy melyik kameraobjektumot kell használni a rendereléshez, és a **NotAuthorized (Nemhorizált)** állapotgépre halad át. Ez azt jelenti, hogy inicializálva van, de még nem jogosult egy munkamenethez való csatlakozásra. Mivel egy ARR-munkamenet indítása költségeket is jár, meg kell erősítenie, hogy a felhasználó folytatni kívánja a műveletet.
A **NotAuthorized** állapot beírásakor a **CheckAuthorization** lesz meghívva, amely meghívja a **RequestingAuthorization** eseményt, és meghatározza, hogy mely fiók hitelesítő adatait kell használni ( Az **AccountInfo** az osztály tetején van meghatározva, és a Unity Inspectorban a fenti lépésben meghatározott hitelesítő adatokat használja).
> [!NOTE]
> Az ARR nem támogatja a futásidejű újrabefejtést. Ha módosítja és menti a szkriptet, miközben a play mód aktív, a Unity lefagyhat, és kényszerítenie kell a leállítást a feladatkezelőn keresztül. Mindig ellenőrizze, hogy leállította-e a lejátszás módot a szkriptek szerkesztése előtt.
1. Cserélje le az **InitializeARR** és **az InitializeSessionService** tartalmát az alábbi befejezett kódra:
```cs
/// <summary>
/// Initializes ARR, associating the main camera
/// Note: This must be called on the main Unity thread
/// </summary>
public void InitializeARR()
{
RemoteManagerUnity.InitializeManager(new RemoteUnityClientInit(Camera.main));
CurrentCoordinatorState = RemoteRenderingState.NotAuthorized;
}
/// <summary>
/// Create a new remote session manager
/// If the ARRCredentialGetter is set, use it as it, otherwise use the development credentials
/// </summary>
public async void InitializeSessionService()
{
if (ARRCredentialGetter == null)
ARRCredentialGetter = GetDevelopmentCredentials;
var accountInfo = await ARRCredentialGetter.Invoke();
ARRSessionService.OnSessionStatusChanged += OnRemoteSessionStatusChanged;
ARRSessionService.Initialize(accountInfo);
CurrentCoordinatorState = RemoteRenderingState.NoSession;
}
```
A **NotAuthorized** és a **NoSession** között való előrehaladáshoz általában egy modális párbeszédpanelt szeretnénk bemutatni a felhasználónak, hogy kiválasztható (és ezt egy másik fejezetben fogjuk megtenni). Jelenleg automatikusan megkerüljük az engedélyezési ellenőrzést a **ByPassAuthentication** hívásával, amint a **RequestingAuthorization** esemény aktiválódik.
1. Válassza ki **a RemoteRenderingCoordinator** GameObject et, és keresse meg az **OnRequestingAuthorization** Unity-eseményt, amely a **RemoteRenderingCoordinator** összetevő Vizsgálójében található.
1. Adjon hozzá egy új eseményt a jobb alsó sarokban a "+" billentyű lenyomásával.
1. Húzza az összetevőt a saját eseményére, hogy hivatkozni fog magára.\
\
1. A legördülő menüben válassza a **RemoteRenderingCoordinator -> BypassAuthorization**.\ lehetőséget.

## <a name="create-or-join-a-remote-session"></a>Távoli munkamenet létrehozása vagy csatlakozás hozzá
A második fázis egy új munkamenet létrehozása vagy Remote Rendering (további Remote Rendering [munkamenetek](../../../concepts/sessions.md) létrehozása).

A távoli munkamenetben renderelik a modelleket. A **JoinRemoteSession( ) metódus** egy meglévő, a **LastUsedSessionID** tulajdonsággal nyomon követni kívánt munkamenetet kísérel meg, vagy ha van hozzárendelt aktív munkamenet-azonosító a **SessionIDOverride tulajdonságban.** **A SessionIDOverride** csak hibakeresési célokra szolgál, csak akkor használja, ha tudja, hogy a munkamenet létezik, és explicit módon szeretne csatlakozni hozzá.
Ha nincsenek elérhető munkamenetek, a rendszer új munkamenetet hoz létre. Egy új munkamenet létrehozása azonban időigényes művelet. Ezért csak szükség esetén próbáljon munkameneteket létrehozni, és amikor csak lehetséges, használja újra őket (a munkamenetek kezelésével kapcsolatos további információkért lásd: Kereskedelmi felhasználásra kész: Munkamenetek készletezése, [ütemezése és](../commercial-ready/commercial-ready.md#fast-startup-time-strategies) ajánlott eljárások).
> [!TIP]
> **A StopRemoteSession() leállítja** az aktív munkamenetet. A szükségtelen díjak elkerülése érdekében mindig állítsa le a munkameneteket, amikor már nincs rájuk szükség.
Az állapotgép a rendelkezésre álló munkamenetek függvényében a **ConnectingToNewRemoteSession** vagy **a ConnectingToExistingRemoteSession** állapotba lép. Ha megnyit egy meglévő munkamenetet, vagy új munkamenetet hoz létre, az aktiválja az **ARRSessionService.OnSessionStatusChanged** eseményt, és végrehajtja az **OnRemoteSessionStatusChanged metódust.** Ideális esetben ez az állapotgép **RemoteSessionReady** állapotra való fejlesztését eredményezi.
1. Új munkamenethez való csatlakozáshoz módosítsa a kódot úgy, hogy az lecseréli a **JoinRemoteSession( )** és a **StopRemoteSession( )** metódusokat az alábbi példákra:
```cs
/// <summary>
/// Attempts to join an existing session or start a new session
/// </summary>
public async void JoinRemoteSession()
{
//If there's a session available that previously belonged to us, and it's ready, use it. Otherwise start a new session.
RenderingSessionProperties joinResult;
if (await IsSessionAvailable(LastUsedSessionID))
{
CurrentCoordinatorState = RemoteRenderingState.ConnectingToExistingRemoteSession;
joinResult = await ARRSessionService.OpenSession(LastUsedSessionID);
}
else
{
CurrentCoordinatorState = RemoteRenderingState.ConnectingToNewRemoteSession;
joinResult = await ARRSessionService.StartSession(new RenderingSessionCreationOptions(renderingSessionVmSize, (int)maxLeaseHours, (int)maxLeaseMinutes));
}
if (joinResult.Status == RenderingSessionStatus.Ready || joinResult.Status == RenderingSessionStatus.Starting)
{
LastUsedSessionID = joinResult.Id;
}
else
{
//The session should be ready or starting, if it's not, something went wrong
await ARRSessionService.StopSession();
if(LastUsedSessionID == SessionIDOverride)
SessionIDOverride = "";
CurrentCoordinatorState = RemoteRenderingState.NoSession;
}
}
public void StopRemoteSession()
{
if (ARRSessionService.CurrentActiveSession != null)
{
ARRSessionService.CurrentActiveSession.StopAsync();
}
}
```
Ha időt szeretne megtakarékosni a munkamenetek újrahasználása által, inaktiválja az Automatikus **munkamenet-leállítás** beállítást az *ARRServiceUnity összetevőben.* Ne feledje, hogy ez akkor is futni hagyja a munkameneteket, ha senki sincs hozzájuk csatlakoztatva. A munkamenet addig futhat, amíg a *MaxLeaseTime* értéke le nem áll a kiszolgáló számára (a *MaxLeaseTime* értéke az Remote Rendering Koordinátorban módosítható az Új munkamenet alapértelmezései *alatt).* Ha azonban a kapcsolat bontásakor automatikusan leállít minden munkamenetet, meg kell várnia, hogy minden alkalommal elinduljon egy új munkamenet, ami egy kissé hosszadalmas folyamat lehet.
> [!NOTE]
> A munkamenet leállítása azonnal életbe lép, és nem vonható vissza. Ha leállt, létre kell hoznia egy új munkamenetet, ugyanazokkal az indítási terheléssel.
## <a name="connect-the-local-runtime-to-the-remote-session"></a>A helyi futásidő csatlakoztatása a távoli munkamenethez
Ezután az alkalmazásnak csatlakoztatnia kell a helyi futásidejűt a távoli munkamenethez.

Az alkalmazásnak a futásidő és az aktuális munkamenet közötti kapcsolattal kapcsolatos eseményeket is figyelnie kell; Ezeket az állapotváltozásokat az **OnLocalRuntimeStatusChanged kezeli.** Ez a kód a **ConnectingToRuntime állapotra lép.** Miután csatlakozott az **OnLocalRuntimeStatusChanged** alatt, az állapot **a RuntimeConnected állapotra változik.** A runtime-hoz való csatlakozás az utolsó állapot, amellyel a koordinátornak aggályai vannak, ami azt jelenti, hogy az alkalmazás az összes közös konfigurációval elkészült, és készen áll a modellek betöltésével és rendereléssel kapcsolatos munkamenet-specifikus munka megkezdésére.
1. Cserélje le a **ConnectRuntimeToRemoteSession( ) és** **a DisconnectRuntimeFromRemoteSession( )** metódust az alábbi befejezett verziókra.
1. Fontos, hogy jegyezze fel a **LateUpdate** Unity-metódust, és hogy ez frissíti az aktuális aktív munkamenetet. Ez lehetővé teszi, hogy az aktuális munkamenet üzeneteket küldjön/fogad, és frissítse a keretpuffert a távoli munkamenetből fogadott képkockákra. Az ARR megfelelő működése kritikus fontosságú.
```cs
/// <summary>
/// Connects the local runtime to the current active session, if there's a session available
/// </summary>
public void ConnectRuntimeToRemoteSession()
{
if (ARRSessionService == null || ARRSessionService.CurrentActiveSession == null)
{
Debug.LogError("Not ready to connect runtime");
return;
}
//Connect the local runtime to the currently connected session
//This session is set when connecting to a new or existing session
ARRSessionService.CurrentActiveSession.ConnectionStatusChanged += OnLocalRuntimeStatusChanged;
ARRSessionService.CurrentActiveSession.ConnectAsync(new RendererInitOptions());
CurrentCoordinatorState = RemoteRenderingState.ConnectingToRuntime;
}
public void DisconnectRuntimeFromRemoteSession()
{
if (ARRSessionService == null || ARRSessionService.CurrentActiveSession == null || ARRSessionService.CurrentActiveSession.ConnectionStatus != ConnectionStatus.Connected)
{
Debug.LogError("Runtime not connected!");
return;
}
ARRSessionService.CurrentActiveSession.Disconnect();
ARRSessionService.CurrentActiveSession.ConnectionStatusChanged -= OnLocalRuntimeStatusChanged;
CurrentCoordinatorState = RemoteRenderingState.RemoteSessionReady;
}
/// <summary>
/// The session must have its runtime pump updated.
/// The Connection.Update() will push messages to the server, receive messages, and update the frame-buffer with the remotely rendered content.
/// </summary>
private void LateUpdate()
{
ARRSessionService?.CurrentActiveSession?.Connection?.Update();
}
```
> [!NOTE]
> A helyi futásidő távoli munkamenethez való csatlakoztatása attól függ, hogy az **aktuálisan** aktív munkameneten a Frissítés van-e meghívva. Ha azt találja, hogy az alkalmazás soha nem halad tovább **a ConnectingToRuntime** állapoton túl, ellenőrizze, hogy az aktív munkamenetben rendszeresen hívja-e az Update-et.
## <a name="load-a-model"></a>Modell betöltése
A szükséges alapokkal készen áll arra, hogy betöltsen egy modellt a távoli munkamenetbe, és elkezdje a képkockák fogadását.

A **LoadModel metódus** a modell elérési útjának, folyamatkezelőinek és szülő-átalakításának elfogadására lett kialakítva. Ezekkel az argumentumokkal tölt be egy modellt a távoli munkamenetbe, frissíti a felhasználót a betöltési folyamat során, és el tudja látni a távolról renderelt modellt a szülő-átalakítás alapján.
1. Cserélje le **a LoadModel metódust** teljes egészében az alábbi kódra:
```cs
/// <summary>
/// Loads a model into the remote session for rendering
/// </summary>
/// <param name="modelName">The model's path</param>
/// <param name="parent">The parent Transform for this remote entity</param>
/// <param name="progress">A call back method that accepts a float progress value [0->1]</param>
/// <returns>An awaitable Remote Rendering Entity</returns>
public async Task<Entity> LoadModel(string modelPath, Transform parent = null, Action<float> progress = null)
{
//Create a root object to parent a loaded model to
var modelEntity = ARRSessionService.CurrentActiveSession.Connection.CreateEntity();
//Get the game object representation of this entity
var modelGameObject = modelEntity.GetOrCreateGameObject(UnityCreationMode.DoNotCreateUnityComponents);
//Ensure the entity will sync its transform with the server
var sync = modelGameObject.GetComponent<RemoteEntitySyncObject>();
sync.SyncEveryFrame = true;
//Parent the new object under the defined parent
if (parent != null)
{
modelGameObject.transform.SetParent(parent, false);
modelGameObject.name = parent.name + "_Entity";
}
#if UNITY_WSA
//Anchor the model in the world, prefer anchoring parent if there is one
if (parent != null)
{
parent.gameObject.AddComponent<WorldAnchor>();
}
else
{
modelGameObject.AddComponent<WorldAnchor>();
}
#endif
//Load a model that will be parented to the entity
var loadModelParams = new LoadModelFromSasOptions(modelPath, modelEntity);
var loadModelAsync = ARRSessionService.CurrentActiveSession.Connection.LoadModelFromSasAsync(loadModelParams, progress);
var result = await loadModelAsync;
return modelEntity;
}
```
A fenti kód a következő lépéseket végzi el:
1. Hozzon létre [egy távoli entitást.](../../../concepts/entities.md)
1. Hozzon létre egy helyi GameObjectet, amely a távoli entitást képviseli.
1. Konfigurálja a helyi GameObjectet úgy, hogy az állapota (vagyis átalakítás) szinkronizálva legyenek a távoli entitással minden keretben.
1. Adjon meg egy nevet, és adjon hozzá egy [**WorldAnchort**](https://docs.unity3d.com/550/Documentation/ScriptReference/VR.WSA.WorldAnchor.html) a stabilitáshoz.
1. Modelladatok betöltése a Blob Storage a távoli entitásba.
1. Adja vissza a szülőentitást későbbi referenciaként.
## <a name="view-the-test-model"></a>A tesztmodell megtekintése
Most már minden kód megvan, amely egy távolról renderelt modell megtekintéséhez szükséges, és a távoli rendereléshez szükséges mind a négy szakasz befejeződött. Most hozzá kell adnunk egy kis kódot a modellbetöltési folyamat elindítani.

1. Adja hozzá a következő kódot a **RemoteRenderingCoordinator osztályhoz,** pont a **LoadModel** metódus alatt:
```cs
private bool loadingTestModel = false;
[ContextMenu("Load Test Model")]
public async void LoadTestModel()
{
if(CurrentCoordinatorState != RemoteRenderingState.RuntimeConnected)
{
Debug.LogError("Please wait for the runtime to connect before loading the test model. Try again later.");
return;
}
if(loadingTestModel)
{
Debug.Log("Test model already loading or loaded!");
return;
}
loadingTestModel = true;
// Create a parent object to use for positioning
GameObject testParent = new GameObject("TestModelParent");
testParent.transform.position = new Vector3(0f, 0f, 3f);
// The 'built in engine path' is a special path that references a test model built into Azure Remote Rendering.
await LoadModel("builtin://Engine", testParent.transform, (progressValue) => Debug.Log($"Loading Test Model progress: {Math.Round(progressValue * 100, 2)}%"));
}
```
Ez a kód létrehoz egy GameObjectet, amely a tesztmodell szülőjeként működik. Ezután a **LoadModel** metódust hívja meg a "builtin://Engine" modell betöltéséhez, amely a Azure Remote Rendering-ba épített eszköz a renderelés tesztelése céljából.
1. Mentse a kódot.
1. Nyomja le a Play gombot a Unity-szerkesztőben a csatlakozás Azure Remote Rendering új munkamenet létrehozásához.
1. A Game (Játék) nézetben azonban nem sokat fog látni, a konzolon azonban az alkalmazás változó állapota látható. Ez valószínűleg a (igaz) lesz, és akár öt percig is `ConnectingToNewRemoteSession` ott maradhat.
1. A **RemoteRenderingCoordinator** GameObject kiválasztásával láthatja a csatolt szkripteket a vizsgálóban. Figyelje **meg, ahogy** a szolgáltatás-összetevő frissülni fog az inicializálási és a kapcsolódási lépések során.
1. Figyelje a konzol kimenetét – várja meg, amíg az állapot **RuntimeConnected (Futtatás) állapotra vált.**
1. A futtatás csatlakoztatása után kattintson a jobb gombbal a **RemoteRenderingCoordinator** elemre az vizsgálóban a helyi menü felfedéshez. Ezután kattintson a **Load Test Model** (Modell betöltése) lehetőségre a helyi menüben, amelyet a fenti kód rész `[ContextMenu("Load Test Model")]` ad hozzá.

1. Figyelje meg a Konzolon a **LoadModel** metódusba átadott **ProgressHandler** kimenetét.
1. Tekintse meg a távolról renderelt modellt!
> [!NOTE]
> A távoli modell soha nem lesz látható a Scene (Jelenet) nézetben, csak a játéknézetben. Ennek az az oka, hogy az ARR távolról rendereli a képkockákat kifejezetten a Game view kamera szempontjából, és nem ismeri a Szerkesztő kameráját (amely a Scene nézet megjelenítésére használatos).
## <a name="next-steps"></a>Következő lépések

Gratulálunk! Létrehozott egy alapszintű alkalmazást, amely képes távolról renderelt modelleket a Azure Remote Rendering. A következő oktatóanyagban integráljuk az MRTK-t, és importáljuk a saját modelljeinket.
> [!div class="nextstepaction"]
> [Következő: Felületek és egyéni modellek](../custom-models/custom-models.md)
| 47.861905 | 660 | 0.734852 | hun_Latn | 0.997842 |
546ea1bad53c3c7b595fb5d696ffe208d9424231 | 4,452 | md | Markdown | README.md | CMACH508/RecSleepNet | 08571e85a8330e41b4f124baad5a33fbd3207e32 | [
"Apache-1.1"
] | 5 | 2022-02-08T23:58:32.000Z | 2022-03-01T14:46:04.000Z | README.md | CMACH508/RecSleepNet | 08571e85a8330e41b4f124baad5a33fbd3207e32 | [
"Apache-1.1"
] | null | null | null | README.md | CMACH508/RecSleepNet | 08571e85a8330e41b4f124baad5a33fbd3207e32 | [
"Apache-1.1"
] | null | null | null | # RecSleepNet: An Automatic Sleep Staging Model Based on Feature Reconstruction
Sleep staging via electroencephalogram (EEG) is the fundamental step to sleep quality assessment and disease diagnose. Deep learning methods have been demonstrated to be promising for automatic sleep staging, but the performance is still not satisfied, because learning representations over the EEG signals is very challenging.
In this study, we propose RecSleepNet, an automatic sleep staging model based on a hybrid structure of Convolutional Neural Networks (CNN) and Long Short Term Memory (LSTM) networks. To enhance the representation learning, we devise a Convolutional Reconstruction Block (CRB), which enforces the extracted features to reconstruct the previous low-level input well. The use of CRB also speeds up the training process.
Moreover, we introduce a Global Max and Average Pooling Block (GMAPB) to squeeze parameter numbers and extract shift-invariant features. Experiments on four public datasets of single-channel EEG signals indicate that RecSleepNet achieves better or at least comparable performance to the state-of-the-art methods. CRB and GMAPB enable the training to be more efficient with fewer parameters but faster convergence.

## Requirements
* numpy >= 1.16.1
* pandas >= 0.24.1
* scikit-learn>=0.20.3
* scipy>=1.21
* tensorflow-gpu==1.13.1
* mne=0.18.2
## Data preparing
We used three datasets: [SleepEDF](https://www.physionet.org/content/sleep-edf/1.0.0/), [ISURC](https://sleeptight.isr.uc.pt/) and [UCDDB](https://physionet.org/content/ucddb/1.0.0/) to evaluate RecSleepNet.
All labels annotated by the R\&K manual were transformed to the AASM manual. All MOVEMENT and UNKNOWN sleep segments were excluded. All EEG signals were re-sampled at 100Hz. All EEG segments 30 minutes before first and after last non-W segment were excluded.
The default preprocessed data directory is "./data".
A whole night's EEG file should be a "*.npz" file which includes "x": EEG signal and "y":labels.
For example, "./data/isruc/subject0.npz", "./data/ucddb/ucddb002.npz" and "./data/sleepedf/SC4001E0.npz" respectively correspond to the records in ISRUC, UCDDB and SleepEDF datasets.
Preprocessing ISRUC dataset:
```shell
python prepare_isruc.py --data_dir "./raw_data/isruc" --output_dir "./data/isruc" --select_ch "EEG Fpz-Cz"
```
Some of the available arguments are:
| Argument | Description | Default |
| ---------- | :----------------------------------- | --------------- |
| data_dir | the path of raw psg files | None/Required |
| output_dir | the path of npz files | None/Required |
| select_ch | which EEG channel will be extracted" | C3A2/EEG Fpz-Cz |
## Training
Runing a cross validation experiment on ISRUC:
```shell
python trainer.py --db isurc --gpu 0 --from_fold 0 --to_fold 9
```
Some of the available arguments are:
| Argument | Description | Default |
| ----------------- | :------------------------------------------ | ------------- |
| db | dataset (sleepedf, sleepedfx, isruc, ucddb) | None/Required |
| gpu | gpu number | 0 |
| from_fold/to_fold | start fold number and end fold number | None/Required |
| suffix | the suffix of the directory name | None |
Hyper-parameters could be set by config.py
## Quick validation
you can just run
```Python
python predict.py --dataset isruc --dir ./pretrained_model
```
to evaluate pre-trained models.
Some of the available arguments are:
| Argument | Description | Default |
| -------- | :------------------------------------------ | ------------------ |
| db | dataset (sleepedf, sleepedfx, isruc, ucddb) | isruc |
| dir | directory of pre-trained models | ./pretrained_model |
## Result

The whole night sleep stages annotated by our model and sleep experts for subject-1 in SEDF-39 dataset.
## Acknowledgement
This project is edited from the project [TinySleepNet]([TinySleepNet](https://physionetchallenges.org/2020/). ).
## Licence
- For academic and non-commercial use only
- Apache License 2.0
| 45.896907 | 418 | 0.648248 | eng_Latn | 0.961589 |
547030e2bc5713881553b83737a0fd94488b236f | 9,076 | md | Markdown | README.md | ShutterQuick/BlazorApplicationInsights | daddad58de9ff98595d73cdef8e897a62ac7f383 | [
"MIT"
] | 91 | 2020-07-14T09:51:12.000Z | 2022-03-30T14:49:40.000Z | README.md | ShutterQuick/BlazorApplicationInsights | daddad58de9ff98595d73cdef8e897a62ac7f383 | [
"MIT"
] | 90 | 2020-08-03T18:44:06.000Z | 2022-03-24T00:26:59.000Z | README.md | ShutterQuick/BlazorApplicationInsights | daddad58de9ff98595d73cdef8e897a62ac7f383 | [
"MIT"
] | 10 | 2020-11-29T15:58:53.000Z | 2022-02-08T21:39:14.000Z | [](https://BlazorApplicationInsights.netlify.app/)
[](https://www.nuget.org/packages/BlazorApplicationInsights)
[](https://www.nuget.org/packages/BlazorApplicationInsights)

Application Insights for Blazor web applications
## Install
- Add [BlazorApplicationInsights Nuget](https://www.nuget.org/packages/BlazorApplicationInsights)
- dotnet add package BlazorApplicationInsights
- Add call to Program.cs
- ```builder.Services.AddBlazorApplicationInsights();```
- Add using statement to _Imports.razor
- ```@using BlazorApplicationInsights;```
- Add component to App.razor
- ```<ApplicationInsightsComponent />```
- Add Application Insights JS to head in index.html
- [Source](https://github.com/microsoft/ApplicationInsights-JS#snippet-setup-ignore-if-using-npm-setup)
- Set 'ld: -1' so that the page will be blocked until the JS is loaded and enter your instrumentationKey
```html
<script type="text/javascript">
!function(T,l,y){var S=T.location,k="script",D="instrumentationKey",C="ingestionendpoint",I="disableExceptionTracking",E="ai.device.",b="toLowerCase",w="crossOrigin",N="POST",e="appInsightsSDK",t=y.name||"appInsights";(y.name||T[e])&&(T[e]=t);var n=T[t]||function(d){var g=!1,f=!1,m={initialize:!0,queue:[],sv:"5",version:2,config:d};function v(e,t){var n={},a="Browser";return n[E+"id"]=a[b](),n[E+"type"]=a,n["ai.operation.name"]=S&&S.pathname||"_unknown_",n["ai.internal.sdkVersion"]="javascript:snippet_"+(m.sv||m.version),{time:function(){var e=new Date;function t(e){var t=""+e;return 1===t.length&&(t="0"+t),t}return e.getUTCFullYear()+"-"+t(1+e.getUTCMonth())+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}(),iKey:e,name:"Microsoft.ApplicationInsights."+e.replace(/-/g,"")+"."+t,sampleRate:100,tags:n,data:{baseData:{ver:2}}}}var h=d.url||y.src;if(h){function a(e){var t,n,a,i,r,o,s,c,u,p,l;g=!0,m.queue=[],f||(f=!0,t=h,s=function(){var e={},t=d.connectionString;if(t)for(var n=t.split(";"),a=0;a<n.length;a++){var i=n[a].split("=");2===i.length&&(e[i[0][b]()]=i[1])}if(!e[C]){var r=e.endpointsuffix,o=r?e.location:null;e[C]="https://"+(o?o+".":"")+"dc."+(r||"services.visualstudio.com")}return e}(),c=s[D]||d[D]||"",u=s[C],p=u?u+"/v2/track":d.endpointUrl,(l=[]).push((n="SDK LOAD Failure: Failed to load Application Insights SDK script (See stack for details)",a=t,i=p,(o=(r=v(c,"Exception")).data).baseType="ExceptionData",o.baseData.exceptions=[{typeName:"SDKLoadFailed",message:n.replace(/\./g,"-"),hasFullStack:!1,stack:n+"\nSnippet failed to load ["+a+"] -- Telemetry is disabled\nHelp Link: https://go.microsoft.com/fwlink/?linkid=2128109\nHost: "+(S&&S.pathname||"_unknown_")+"\nEndpoint: "+i,parsedStack:[]}],r)),l.push(function(e,t,n,a){var i=v(c,"Message"),r=i.data;r.baseType="MessageData";var o=r.baseData;return o.message='AI (Internal): 99 message:"'+("SDK LOAD Failure: Failed to load Application Insights SDK script (See stack for details) ("+n+")").replace(/\"/g,"")+'"',o.properties={endpoint:a},i}(0,0,t,p)),function(e,t){if(JSON){var n=T.fetch;if(n&&!y.useXhr)n(t,{method:N,body:JSON.stringify(e),mode:"cors"});else if(XMLHttpRequest){var a=new XMLHttpRequest;a.open(N,t),a.setRequestHeader("Content-type","application/json"),a.send(JSON.stringify(e))}}}(l,p))}function i(e,t){f||setTimeout(function(){!t&&m.core||a()},500)}var e=function(){var n=l.createElement(k);n.src=h;var e=y[w];return!e&&""!==e||"undefined"==n[w]||(n[w]=e),n.onload=i,n.onerror=a,n.onreadystatechange=function(e,t){"loaded"!==n.readyState&&"complete"!==n.readyState||i(0,t)},n}();y.ld<0?l.getElementsByTagName("head")[0].appendChild(e):setTimeout(function(){l.getElementsByTagName(k)[0].parentNode.appendChild(e)},y.ld||0)}try{m.cookie=l.cookie}catch(p){}function t(e){for(;e.length;)!function(t){m[t]=function(){var e=arguments;g||m.queue.push(function(){m[t].apply(m,e)})}}(e.pop())}var n="track",r="TrackPage",o="TrackEvent";t([n+"Event",n+"PageView",n+"Exception",n+"Trace",n+"DependencyData",n+"Metric",n+"PageViewPerformance","start"+r,"stop"+r,"start"+o,"stop"+o,"addTelemetryInitializer","setAuthenticatedUserContext","clearAuthenticatedUserContext","flush"]),m.SeverityLevel={Verbose:0,Information:1,Warning:2,Error:3,Critical:4};var s=(d.extensionConfig||{}).ApplicationInsightsAnalytics||{};if(!0!==d[I]&&!0!==s[I]){var c="onerror";t(["_"+c]);var u=T[c];T[c]=function(e,t,n,a,i){var r=u&&u(e,t,n,a,i);return!0!==r&&m["_"+c]({message:e,url:t,lineNumber:n,columnNumber:a,error:i}),r},d.autoExceptionInstrumented=!0}return m}(y.cfg);function a(){y.onInit&&y.onInit(n)}(T[t]=n).queue&&0===n.queue.length?(n.queue.push(a),n.trackPageView({})):a()}(window,document,{
src: "https://js.monitor.azure.com/scripts/b/ai.2.min.js",
ld: -1,
crossOrigin: "anonymous",
cfg: {
instrumentationKey: "INSTRUMENTATION_KEY",
disableFetchTracking: false,
enableCorsCorrelation: true,
enableRequestHeaderTracking: true,
enableResponseHeaderTracking: true
}});
</script>
```
- Add JS Interop to the bottom of body in index.html
```html
<script src="_content/BlazorApplicationInsights/JsInterop.js"></script>
```
## [Example Project](https://github.com/IvanJosipovic/BlazorApplicationInsights/tree/master/src/BlazorApplicationInsights.Sample)
## Features
- Automatically triggers Track Page View on route changes
- ILoggerProvider which sends all the logs to App Insights (Wasm only)
- Supported [APIs](https://github.com/microsoft/ApplicationInsights-JS/blob/master/API-reference.md)
- AddTelemetryInitializer
- ClearAuthenticatedUserContext
- Flush
- SetAuthenticatedUserContext
- StartTrackEvent
- StartTrackPage
- StopTrackEvent
- StopTrackPage
- TrackDependencyData
- TrackEvent
- TrackException
- TrackMetric
- TrackPageView
- TrackPageViewPerformance
- TrackTrace
## TrackEvent
```csharp
@page "/"
<button class="btn btn-primary" @onclick="TrackEvent">Track Event</button>
@code {
[Inject] private IApplicationInsights AppInsights { get; set; }
private async Task TrackEvent()
{
await AppInsights.TrackEvent("My Event");
}
}
```
## Set User Name
- Edit Authentication.razor
```csharp
@page "/authentication/{action}"
<RemoteAuthenticatorView Action="@Action" OnLogInSucceeded="OnLogInSucceeded" OnLogOutSucceeded="OnLogOutSucceeded" />
@code{
[Parameter] public string Action { get; set; }
[CascadingParameter] public Task<AuthenticationState> AuthenticationState { get; set; }
[Inject] private IApplicationInsights AppInsights { get; set; }
public async Task OnLogInSucceeded()
{
var user = (await AuthenticationState).User;
await AppInsights.SetAuthenticatedUserContext(user.FindFirst("preferred_username")?.Value);
}
public async Task OnLogOutSucceeded()
{
await AppInsights.ClearAuthenticatedUserContext();
}
}
```
## Set Role and Instance
- Edit Program.cs
```csharp
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");
builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddBlazorApplicationInsights(async applicationInsights =>
{
var telemetryItem = new TelemetryItem()
{
Tags = new Dictionary<string, object>()
{
{ "ai.cloud.role", "SPA" },
{ "ai.cloud.roleInstance", "Blazor Wasm" },
}
};
await applicationInsights.AddTelemetryInitializer(telemetryItem);
});
await builder.Build().RunAsync();
}
```
## Set Instrumentation Key
- Edit Index.html and remove instrumentationKey from cfg
```html
<script type="text/javascript">
!function(T,l,y){ // Removed for brevity...
src: "https://js.monitor.azure.com/scripts/b/ai.2.min.js",
ld: -1, // Set this to -1
crossOrigin: "anonymous",
cfg: {}
});
</script>
```
- Edit Program.cs
```csharp
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("app");
builder.Services.AddTransient(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddBlazorApplicationInsights(async applicationInsights =>
{
await applicationInsights.SetInstrumentationKey("YOUR_INSTRUMENTATION_KEY_GOES_HERE");
await applicationInsights.LoadAppInsights();
});
await builder.Build().RunAsync();
}
```
| 54.02381 | 3,793 | 0.695791 | yue_Hant | 0.505587 |
5470810235e735afc87a81d9343c31c1dacc7081 | 674 | md | Markdown | README.md | vzwGrey/project-akuma | 8894d0a9506945cab6095341fa6c828a60517ed7 | [
"MIT"
] | 2 | 2018-08-04T21:07:33.000Z | 2018-08-08T19:47:08.000Z | README.md | vzwGrey/project-akuma | 8894d0a9506945cab6095341fa6c828a60517ed7 | [
"MIT"
] | null | null | null | README.md | vzwGrey/project-akuma | 8894d0a9506945cab6095341fa6c828a60517ed7 | [
"MIT"
] | null | null | null | # HexadOS
Simple 16-bit bootloader/operating system written in x86 assembly language.
For educational purposes only. Under development.
## Building
**NOTES:** Requires nasm to be installed.
Bash:
```
$ ./build.sh
```
CMD/Powershell:
```
...> .\build.bat
```
## Running
**DISCLAIMER:**
- This code has only been tested in Bochs and QEMU.
- I claim no responsibility for what might or might not happen when running this code.
The build script produces a file called `hexados.iso`.
Use this image as the first floppy disk and boot from it.
For example:
```
$ qemu-system-i386 -fda ./hexados.iso
```
## Images

| 18.216216 | 86 | 0.704748 | eng_Latn | 0.987906 |
54709d5055c538b47abb65be173334ed00a8ac26 | 1,261 | md | Markdown | AlchemyInsights/changes-to-external-user-access.md | isabella232/OfficeDocs-AlchemyInsights-pr.ro-RO | 03015a129e62a25629e7430f7fa7208c74a08ad7 | [
"CC-BY-4.0",
"MIT"
] | 3 | 2020-05-19T19:07:36.000Z | 2021-11-10T22:45:21.000Z | AlchemyInsights/changes-to-external-user-access.md | MicrosoftDocs/OfficeDocs-AlchemyInsights-pr.ro-RO | 7e915e888b922fd3272e8c1a0781a3b3373d8082 | [
"CC-BY-4.0",
"MIT"
] | 3 | 2020-06-02T23:26:32.000Z | 2022-02-09T06:55:22.000Z | AlchemyInsights/changes-to-external-user-access.md | isabella232/OfficeDocs-AlchemyInsights-pr.ro-RO | 03015a129e62a25629e7430f7fa7208c74a08ad7 | [
"CC-BY-4.0",
"MIT"
] | 2 | 2019-10-09T20:32:20.000Z | 2020-06-02T23:26:01.000Z | ---
title: Modificări ale accesului utilizatorilor externi
ms.author: pebaum
author: pebaum
manager: scotv
ms.date: 04/21/2020
ms.audience: Admin
ms.topic: article
ms.service: o365-administration
ROBOTS: NOINDEX, NOFOLLOW
localization_priority: Normal
ms.collection: Adm_O365
ms.custom: ''
ms.assetid: abdb45fb-93b0-4df9-994d-b997fcfcaff5
ms.openlocfilehash: a3c3ccbd8dd4f43a5f927f727e8757ded3612c630158cf045b4e6c0f93bb75ad
ms.sourcegitcommit: b5f7da89a650d2915dc652449623c78be6247175
ms.translationtype: MT
ms.contentlocale: ro-RO
ms.lasthandoff: 08/05/2021
ms.locfileid: "54045684"
---
# <a name="changes-to-external-user-access"></a>Modificări ale accesului utilizatorilor externi
Începând cu 23 martie 2018, utilizatorii externi nu vor mai putea să acceseze conținutul care a fost partajat cu toată lumea, cu toți utilizatorii autentificați sau cu toți utilizatorii formularelor, chiar dacă au fost invitați sau invitați la grupuri autorizate. Utilizatorii externi vor putea accesa doar conținutul care a fost partajat cu utilizatorul sau cu grupuri cărora le aparține utilizatorul. Dacă preferați să vă păstrați setările existente, consultați: https://support.microsoft.com/help/4089534/how-to-grant-the-everyone-claim-to-external-users-in-office-365
| 46.703704 | 571 | 0.826328 | ron_Latn | 0.998567 |
5470d3e21aaaa00c6917059661e262678bd1faac | 379 | md | Markdown | docs/multibyte.md | cknow/awesome-validator | e63ea57ab08102830d23934dea00a5aa1960a7c0 | [
"MIT"
] | 5 | 2017-06-14T11:23:00.000Z | 2021-08-22T06:10:15.000Z | docs/multibyte.md | cknow/awesome-validator | e63ea57ab08102830d23934dea00a5aa1960a7c0 | [
"MIT"
] | null | null | null | docs/multibyte.md | cknow/awesome-validator | e63ea57ab08102830d23934dea00a5aa1960a7c0 | [
"MIT"
] | 1 | 2021-04-26T06:31:24.000Z | 2021-04-26T06:31:24.000Z | # Multibyte
Validates if the given input is multibyte.
Valid values:
```js
validator.multibyte().validate('ひらがな・カタカナ、.漢字');
validator.multibyte().validate('あいうえお foobar');
validator.multibyte().validate('1234abcDExyz');
```
Invalid values:
```js
validator.multibyte().validate('abc');
validator.multibyte().validate('abc123');
validator.multibyte().validate('<>@" *.');
```
| 18.95 | 48 | 0.712401 | hun_Latn | 0.074645 |
5470f8633fd26c928315242b1e4a1ded4a7578e0 | 839 | md | Markdown | README.md | shannonmoeller-archive/collection | 111a89756b9eb9d752acd341872f5f0ba98809da | [
"MIT"
] | null | null | null | README.md | shannonmoeller-archive/collection | 111a89756b9eb9d752acd341872f5f0ba98809da | [
"MIT"
] | null | null | null | README.md | shannonmoeller-archive/collection | 111a89756b9eb9d752acd341872f5f0ba98809da | [
"MIT"
] | null | null | null |
# Collection.js
A basic JavaScript collection.
## Installation
Server-side ([Node.js](http://nodejs.org)):
$ npm install shannonmoeller/collection.js
Client-side ([component(1)](https://github.com/component)):
$ component install shannonmoeller/collection.js
## API
### `Collection(array)`
Create a new model which wraps around `object`.
```js
var Collection = require('collection');
var foo = Collection([{ a: 1 }, { a: 2 }, { a: 3 }]);
```
### `.model`
### `.filter(filterer)`
### `.map(mapper)`
### `.pluck(key):Array.<*>` <br /> `.pluck(array):Array.<Object>`
### `.sort(sorter)`
### `.toJSON()`
Returns the current state of the internal data as a plain object.
```js
var foo = Collection([{ a: 1 }, { a: 2 }, { a: 3 }]);
foo.toJSON(); // [{ a: 1 }, { a: 2 }, { a: 3 }]
```
## License
MIT
| 16.78 | 71 | 0.589988 | eng_Latn | 0.17934 |
5471ea917032ab2010e05155af0d2cb75683071b | 5,189 | md | Markdown | packages/website/docs/createAlgoliaInsightsPlugin.md | amprew/autocomplete | 1f20cbe99da11fa9bc5db3038bec827002165658 | [
"MIT"
] | null | null | null | packages/website/docs/createAlgoliaInsightsPlugin.md | amprew/autocomplete | 1f20cbe99da11fa9bc5db3038bec827002165658 | [
"MIT"
] | null | null | null | packages/website/docs/createAlgoliaInsightsPlugin.md | amprew/autocomplete | 1f20cbe99da11fa9bc5db3038bec827002165658 | [
"MIT"
] | null | null | null | ---
id: createAlgoliaInsightsPlugin
---
The Algolia Insights plugin automatically sends click and conversion events to the [Algolia Insights API](https://www.algolia.com/doc/rest-api/insights/) whenever a user interacts with the autocomplete.
## Installation
First, you need to install the plugin.
```bash
yarn add @algolia/autocomplete-plugin-algolia-insights@alpha
# or
npm install @algolia/autocomplete-plugin-algolia-insights@alpha
```
Then import it in your project:
```js
import { createAlgoliaInsightsPlugin } from '@algolia/autocomplete-plugin-algolia-insights';
```
If you don't use a package manager, you can use the HTML `script` element:
```html
<script src="https://cdn.jsdelivr.net/npm/@algolia/autocomplete-plugin-algolia-insights@alpha"></script>
<script>
const { createAlgoliaInsightsPlugin } = window[
'@algolia/autocomplete-plugin-algolia-insights'
];
</script>
```
## Examples
This example uses the plugin within [`autocomplete-js`](autocomplete-js), along with the [`algoliasearch`](https://www.npmjs.com/package/algoliasearch) API client and [Search Insights](https://www.npmjs.com/package/search-insights) library.
```js
import algoliasearch from 'algoliasearch/lite';
import { autocomplete } from '@algolia/autocomplete-js';
import { createAlgoliaInsightsPlugin } from '@algolia/autocomplete-plugin-algolia-insights';
import insightsClient from 'search-insights';
const appId = 'latency';
const apiKey = '6be0576ff61c053d5f9a3225e2a90f76';
const searchClient = algoliasearch(appId, apiKey);
insightsClient('init', { appId, apiKey });
const algoliaInsightsPlugin = createAlgoliaInsightsPlugin({ insightsClient });
autocomplete({
container: '#autocomplete',
plugins: [algoliaInsightsPlugin],
});
```
The plugin exposes hooks to let you inject custom logic in the lifecycle: [`onItemsChange`](#onitemschange), [`onSelect`](#onselect), and [`onActive`](#onactive). You can use them to either customize the events sent to Algolia, or plug additional behavior.
For example, if you have several search experiences on your site, you can customize the event name to identify where the events came from:
```js
const algoliaInsightsPlugin = createAlgoliaInsightsPlugin({
insightsClient,
onItemsChange({ insights, insightsEvents }) {
const events = insightsEvents.map((insightsEvent) => ({
...insightsEvent,
eventName: 'Product Viewed from Autocomplete',
}));
insights.viewedObjectIDs(...events);
},
onSelect({ insights, insightsEvents }) {
const events = insightsEvents.map((insightsEvent) => ({
...insightsEvent,
eventName: 'Product Selected from Autocomplete',
}));
insights.clickedObjectIDsAfterSearch(...events);
},
});
```
If you're using another analytics provider along with Algolia Insights, you can leverage these hooks to send them events as well. For example, you can send Segment events:
```js
const algoliaInsightsPlugin = createAlgoliaInsightsPlugin({
insightsClient,
onActive({ insights, insightsEvents }) {
insightsEvents.forEach((insightsEvent) => {
// Assuming you've initialized the Segment script
// and identified the current user already
analytics.track('Product Browsed from Autocomplete', insightsEvent);
});
},
});
```
:::note
If you send events to other analytics providers, it might make sense to [create a dedicated plugin](plugins/#building-your-own-plugin).
:::
## Parameters
### `insightsClient`
> `InsightsClient` | required
The initialized Search Insights client.
### `onItemsChange`
> `(params: OnItemsChangeParams) => void`
Hook to send an Insights event whenever the items change.
By default, it sends a `viewedObjectIDs` event.
In as-you-type experiences, items change as the user types. This hook is debounced every 400ms to reflect actual items that users notice and avoid generating too many events for items matching "in progress" queries.
```ts
type OnItemsChangeParams = {
insights: InsightsApi;
insightsEvents: ViewedObjectIDsParams[];
state: AutocompleteState<any>;
};
```
### `onSelect`
> `(params: OnSelectParams) => void`
Hook to send an Insights event whenever an item is selected.
By default, it sends a `clickedObjectIDsAfterSearch` event.
```ts
type OnSelectParams = {
insights: InsightsApi;
insightsEvents: ClickedObjectIDsAfterSearchParams[];
item: AlgoliaInsightsHit;
state: AutocompleteState<any>;
event: any;
};
```
### `onActive`
> `(params: OnActiveParams) => void`
Hook to send an Insights event whenever an item is active.
By default, it doesn't send any events.
```ts
type OnActiveParams = {
insights: InsightsApi;
insightsEvents: ClickedObjectIDsAfterSearchParams[];
item: AlgoliaInsightsHit;
state: AutocompleteState<any>;
event: any;
};
```
## Resources
For a more comprehensive guide on how to best leverage Algolia Insights with Autocomplete, check the [Sending Algolia Insights events](sending-algolia-insights-events) guide.
You can also learn more about [Click and Conversion Analytics](https://www.algolia.com/doc/guides/getting-insights-and-analytics/search-analytics/click-and-conversion-analytics/) on the Algolia documentation.
| 30.704142 | 256 | 0.749085 | eng_Latn | 0.818158 |
54722d8770e0c749ae36b49419c9b5e50bfba872 | 843 | md | Markdown | README.md | chelciebritt/astma-q1-project | e688fd5a3564ac481762195c44057befef1b479f | [
"MIT"
] | null | null | null | README.md | chelciebritt/astma-q1-project | e688fd5a3564ac481762195c44057befef1b479f | [
"MIT"
] | null | null | null | README.md | chelciebritt/astma-q1-project | e688fd5a3564ac481762195c44057befef1b479f | [
"MIT"
] | null | null | null | # A Scroll Through Modern Art
A Scroll Through Modern Art is a web application that timelines the modern
art movement. It highlights how the arts evolved as a response to the surrounding world during that era.
## Built With
* [Materialize](http://materializecss.com/)
* [JavaScript](https://www.javascript.com/)
* [TimelineJS](https://timeline.knightlab.com/)
## Links
* [Web App](https://astma-7d413.firebaseapp.com/)
* [Live Demo](https://www.youtube.com/watch?v=OZcWhkOkhkM&t=26s)
## Images



## Built By
* **Chelcie Britt** - (https://github.com/chelciebritt)
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
| 28.1 | 105 | 0.734282 | eng_Latn | 0.67749 |
54725b8ba64995936267aed2b0979e0b53b9a259 | 913 | md | Markdown | 2-resources/BLOG/ciriculumn/week-14/w14/d4/mds/00a_react-router.md | impastasyndrome/Lambda-Resource-Static-Assets | 7070672038620d29844991250f2476d0f1a60b0a | [
"MIT"
] | null | null | null | 2-resources/BLOG/ciriculumn/week-14/w14/d4/mds/00a_react-router.md | impastasyndrome/Lambda-Resource-Static-Assets | 7070672038620d29844991250f2476d0f1a60b0a | [
"MIT"
] | null | null | null | 2-resources/BLOG/ciriculumn/week-14/w14/d4/mds/00a_react-router.md | impastasyndrome/Lambda-Resource-Static-Assets | 7070672038620d29844991250f2476d0f1a60b0a | [
"MIT"
] | 1 | 2021-11-05T07:48:26.000Z | 2021-11-05T07:48:26.000Z |
# React Router Learning Objectives
At this point, you know how to build and render frontend components with React.
Now it's time to learn about frontend routing so that you can connect specific
components to render at specific URL paths. After reading and practicing, you
should be able to:
* Use the `react-router-dom` package to set up React Router in your applications
* Create routes using the `<Route>` component from the `react-router-dom`
package
* Generate navigation links with the `<Link>` and `<NavLink>` components from
the `react-router-dom` package
* Create `<Switch>` routes and manage the order of rendered components
* Use the React Router `match` prop to access router parameters
* Use the React Router `history` prop to programmatically change the browser's
URL
* Redirect users by using the `<Redirect>` component in a route
* Describe what nested routes are and how to create them
| 45.65 | 80 | 0.773275 | eng_Latn | 0.999238 |
547370414de729fd4dcca76e2a8d72996c3bf3be | 1,572 | md | Markdown | Documents/Datebase&Model.md | ppopcn/RyShop | 0850cae2ff94af08f58a423de0c627c4b656fbb0 | [
"MIT"
] | null | null | null | Documents/Datebase&Model.md | ppopcn/RyShop | 0850cae2ff94af08f58a423de0c627c4b656fbb0 | [
"MIT"
] | null | null | null | Documents/Datebase&Model.md | ppopcn/RyShop | 0850cae2ff94af08f58a423de0c627c4b656fbb0 | [
"MIT"
] | null | null | null | # RyShop 虚拟主机销售系统(在线商城程序)
Updated at 8/08/2017
## 模块设计
### 物品模块
- 添加商品
- 编辑商品
- 删除商品
### 订单模块
- 系统订单
### 已开通主机模块
- 虚拟主机信息(含续费)
### 用户管理
- 注册登录
- 用户编辑
- 用户删除
### 工单模块
- 发送工单
- 回复工单
- 删除工单
### 设置模块
- 储存设置信息
- 初始化站点(安装站点)
## 界面部分
### 用户层面
- 注册/登录
- 查看商品
- 购买商品( 填写信息->付款->通过API自动开通 )
- 我的主机
- 我的订单
- 用户推广
- 新闻公告
- 工单提问
### 管理员层面
#### 物品(主机)管理
- 添加主机 ( 名称 型号 价格 描述 控制面板 )
- 编辑主机
- 删除主机
#### 订单管理
- 查看订单( 订单号 用户名 商品型号 付款信息 开通情况 )
#### 用户管理
- 用户编辑
- 用户删除
#### 工单管理
- 查看工单
- 发送工单
- 删除工单
### 新闻公告
- 发布公告
- 查看公告
#### 虚拟主机管理
- 已开通虚拟主机
- 关闭/重启虚拟主机
- 储存续费信息
#### 设置模块
##### 常规设置
- 站点名称
- 站点域名
- 站点关键词
- 站点描述
- 产品使用条款
- 主页 展示图片
- 列表 提示语
- 主机详情 提示语
- 工单页面 提示语
- 底部版权 提示语
- 佣金比例
- 最低提现
- 推介提示语
##### 服务器对接
- 对接模块
## 数据表字段
### 用户部分
- id increments
- name string
- email string
- password string
- qq string
- level integer
- amount double
- timestamps
### 商品部分
- id increments
- name string
- model string
- price double
- description longtext
- details longtext
- panel string
- timestamps
### 订单部分
- id increments
- no string
- model string
- user_id integer
- price double
- end_at string
- payout boolean
- aff_id integer
- timestamps
### 已开通主机部分
- id increments
- order_no string
- model string
- user_id integer
- price double
- end_at string
- host_name
- host_pass
- host_panel
- timestamps
### 工单系统部分
- id increments
- content longtext
- user_id integer
- reply integer
- valid integer
- timestamp
### 设置部分
- id increments
- name string
- value longtext
- timestamp
### 新闻公告部分
- id increments
- title string
- content longtext
- user_id integer
- timestamp
| 10.410596 | 32 | 0.650127 | yue_Hant | 0.683386 |
547395416c2a15ee3c7fa5cc43e8a2122b8a3545 | 3,905 | md | Markdown | _posts/2019-05-30-Download-hydrology-and-floodplain-analysis-solutions.md | Camille-Conlin/26 | 00f0ca24639a34f881d6df937277b5431ae2dd5d | [
"MIT"
] | null | null | null | _posts/2019-05-30-Download-hydrology-and-floodplain-analysis-solutions.md | Camille-Conlin/26 | 00f0ca24639a34f881d6df937277b5431ae2dd5d | [
"MIT"
] | null | null | null | _posts/2019-05-30-Download-hydrology-and-floodplain-analysis-solutions.md | Camille-Conlin/26 | 00f0ca24639a34f881d6df937277b5431ae2dd5d | [
"MIT"
] | null | null | null | ---
layout: post
comments: true
categories: Other
---
## Download Hydrology and floodplain analysis solutions book
the merest minimum of his anger, I, young woman. " "But I want to have it at Clavestra," I said. At what she judged to be a safe distance, ii, thinks of that, she must have been stunning, one-half the natural size. Sun glare veiled the kid's features. the inland-ice of Greenland in the month of July 1870, in the He's not convinced that his mother would be proud of him if he bit his way to freedom! coffee. Until Monday morning "Well?" the touch, or better yet (since she had to see somebody after the pageant connected her wrist restraints to those that bound her ankles, less you safe, piping voice, all bony shoulders and sharp elbows and knobby knees, but you will if you stay here long enough-they know genetics. who decked and arranged the Christmas tree, beyond the bedroom door with the plaque "That would be the murderer," Micky interrupted without a wink or a smirk. _The principael Navigations, and we're happier, and when a few moments after as they are to look at, 'I have dared and trodden it. She bade her people exchanged for _soot_. While sailing down, I know, it's a case of how well you make out. And if Hemet proved to be but the When he glanced back, Old Yeller, feeling an ominous chill, which is just another way of stating conclusions that are well known. I'm just going to be the conscience that Enoch Cain seems to have been born without. Sitting on the railing of the ship a. I credited him with more character. Therewithal the world was straitened upon him and his life was a light matter to him and he sought his father Suleiman Shah's lodging, which he now relied upon to reach hydrology and floodplain analysis solutions There, and When the morning morrowed and the king sat on the throne of his hydrology and floodplain analysis solutions. We'll hire a band. sparking small new fires, time by Dr, Leilani spoke up when. Only truth. appear at any moment with a pot of Earl Grey and a tray of tea cakes. "Tusks. He doesn't like people much, i. suffered as a child herself, she learned more hydrology and floodplain analysis solutions humility than she had ever They were met with an unusual level of violence instead of with the usual volleys hydrology and floodplain analysis solutions attorneys; the battle What are you babblin' about, and when a few moments after as they are to look at, with few exceptions, there occur "My name. He must not humor, wouldn't improve the girl's situation! At all events, but true, hydrology and floodplain analysis solutions with luxuriant vegetation. The precious stones which are principally found at The members of the Expedition were here introduced to several Before bright Hydrology and floodplain analysis solutions was, if the king see fit to defer the putting of me to death till the morrow and will pass this night with me and take leave of me. gave him to put on, but there's places "Simple, but were available for purchase as anywhere else. The comfort of their breath on his head. running in terror, alternating with carpets of _Halianthus of little conspiracy here, actually. At two places at the level of the sea in the tragedy. "What's the use of all hydrology and floodplain analysis solutions talk?" evident enthusiasm. Neither intruders nor ghosts afoot. ) Intathin kept the other half of the broken Hydrology and floodplain analysis solutions, 'I will not give thee a dirhem!' And words ran high between them and contention was prolonged, something from the Book-of-the-Month Club and therefore both life-enriching and reliable. Don't worry about Diamond. Then he squeezed her arm one more time and turned to follow after the others. , just unnerving. menace of my day. He shook his head sadly. He was a peaceful man, ii. The tires spin up a white "I bet she does," Stanislau maintained. | 433.888889 | 3,788 | 0.787452 | eng_Latn | 0.999923 |
54757bcf5a1be329daa91f998e20705a37bd24fd | 1,425 | md | Markdown | docs/docs/list/dynamic-programming/70.climbingStairs.md | duang-repo/leetcode-in-javascript | 837c829ec22fd59a31124053357b72b4d09cdac6 | [
"MIT"
] | 11 | 2020-10-15T01:13:16.000Z | 2022-03-14T15:29:12.000Z | docs/docs/list/dynamic-programming/70.climbingStairs.md | duang-repo/leetcode-in-javascript | 837c829ec22fd59a31124053357b72b4d09cdac6 | [
"MIT"
] | 2 | 2022-01-19T04:16:25.000Z | 2022-01-19T04:16:46.000Z | docs/docs/list/dynamic-programming/70.climbingStairs.md | duang-repo/leetcode-in-javascript | 837c829ec22fd59a31124053357b72b4d09cdac6 | [
"MIT"
] | 2 | 2021-06-17T09:02:10.000Z | 2022-02-18T03:35:07.000Z | # [70] 爬楼梯
>假设你正在爬楼梯。需要 n 阶你才能到达楼顶。
>
>每次你可以爬 1 或 2 个台阶。你有多少种不同的方法可以爬到楼顶呢?
>
>注意:给定 n 是一个正整数。
>
>示例 1:
>
>输入: 2
>
>输出: 2
>
>解释: 有两种方法可以爬到楼顶。
>
>1. 1 阶 + 1 阶
>
>2. 2 阶
>
>示例 2:
>
>输入: 3
>
>输出: 3
>
>解释: 有三种方法可以爬到楼顶。
>
>1. 1 阶 + 1 阶 + 1 阶
>
>2. 1 阶 + 2 阶
>
>3. 2 阶 + 1 阶
这是入手动态规划方程最基础的两道题型之一,另一题是斐波那契数列。
根据高中学过的数列知识,我们需要将问题求出f(n)与f(n-1)...之间的关系,即得出数列的关于前若干项的通项公式。
我们很容易看出,在这里,`f(n) = f(n-1) + f(n-2)`。那么我们可以很轻松地将这个公式转变为程序解,即递归写法:
```js
var climbStairs = function(n) {
if (n === 0 || n === 1) return 1;
return climbStairs(n - 1) + climbStairs(n - 2);
};
```
有了递归式,实际上动态规划题里难度最高的部分:状态转移方程,就已经确定了。
状态转移方程: `dp[n] = dp[n-1] + dp[n-2]`
我们再来确立动态规划的边界值。很显然,这里的边界值dp[0]和dp[1](即爬楼梯的第0层和第一层的可选择爬法)为1。
之后我们就很容易得出改题的动态规划解法了。
```js
var climbStairs = function(n) {
const dp = [1, 1];
for (let i = 2; i <= n; i++) {
dp[i] = dp[i - 1] + dp[i - 2];
}
return dp[n];
};
```
同时我们可以注意到,改题状态转移方程只依赖f(n-1)与f(n-2),因此我们不需要建立一整个数组来记住之前遍历得到的所有数据,可以只用两个变量存储每次计算f(n)之前的f(n-1)与f(n-2)的值就能完成最终的计算,这有助于帮我们降低空间复杂度至O(1)。
```js
var climbStairs = function(n) {
let dp1 = 1;
let dp2 = 1;
while (--n) {
const temp = dp1 + dp2;
dp2 = dp1;
dp1 = temp;
}
return dp1;
};
```
```ts
function climbStairs(n: number): number {
if (n === 1) return 1;
if (n === 2) return 2;
let prev = 1;
let cur = 2;
for (let i = 3; i <= n; i++) {
const sum = prev + cur;
prev = cur;
cur = sum;
}
return cur;
}
```
| 15 | 130 | 0.575439 | yue_Hant | 0.621578 |
5475c09ae91ce0150c9392b87b59abde8c47a4cb | 251 | md | Markdown | iambismark.net/content/post/2009/04/1238970221.md | bismark/iambismark.net | 1ef89663cfcf4682fbfd60781bb143a7fd276312 | [
"MIT"
] | null | null | null | iambismark.net/content/post/2009/04/1238970221.md | bismark/iambismark.net | 1ef89663cfcf4682fbfd60781bb143a7fd276312 | [
"MIT"
] | null | null | null | iambismark.net/content/post/2009/04/1238970221.md | bismark/iambismark.net | 1ef89663cfcf4682fbfd60781bb143a7fd276312 | [
"MIT"
] | null | null | null | ---
alturls:
- https://twitter.com/bismark/status/1459276864
archive:
- 2009-04
date: '2009-04-05T22:23:41+00:00'
slug: '1238970221'
---
i suppose i better go back and look at all of those new followers that i got over the weekend... hi new people!
| 20.916667 | 111 | 0.717131 | eng_Latn | 0.830124 |
547603e304573a8a363bded84698431d595ee0ed | 1,655 | md | Markdown | tests/unit/test_data/gu_tw/gu_tw/bible/names/nileriver.md | linearcombination/DOC | 4478e55ec81426c15a2c402cb838e76d79741c03 | [
"MIT"
] | 1 | 2022-01-10T21:03:26.000Z | 2022-01-10T21:03:26.000Z | tests/unit/test_data/gu_tw/gu_tw/bible/names/nileriver.md | linearcombination/DOC | 4478e55ec81426c15a2c402cb838e76d79741c03 | [
"MIT"
] | 1 | 2022-03-28T17:44:24.000Z | 2022-03-28T17:44:24.000Z | tests/unit/test_data/gu_tw/gu_tw/bible/names/nileriver.md | linearcombination/DOC | 4478e55ec81426c15a2c402cb838e76d79741c03 | [
"MIT"
] | 3 | 2022-01-14T02:55:44.000Z | 2022-02-23T00:17:51.000Z | # નાઇલ નદી, ઈજીપ્તની નદી, નાઇલ
## તથ્યો:
ઉત્તરપૂર્વીય આફ્રિકામાં નાઇલ એક ખૂબ જ લાંબી અને પહોળી નદી છે.
તે ખાસ તો ઈજીપ્તની મુખ્ય નદી તરીકે જાણીતી છે.
* નાઇલ નદી ઈજીપ્તમાં થઈને ઉત્તર તરફ ભૂમધ્ય સમુદ્રમાં વહે છે.
* નાઇલ નદીની બન્ને બાજુએ ફળદ્રુપ જમીનમાં સારો પાક થાય છે.
* ખોરાકના પાકો માટે નાઇલ નદી એક અગત્યનો સ્રોત છે તે માટે મોટા ભાગના ઈજીપ્તના લોકો નાઇલ નદીની પાસે વસે છે.
* ઇઝરાયલીઓ ગોશેન પ્રદેશમાં વસ્યા હતા કે જે નાઇલ નદી પાસે સ્થિત હોવાથી ખૂબ જ ફળદ્રુપ હતો.
* જ્યારે મૂસા નાનું બાળક હતો ત્યારે, તેના માતાપિતાએ તેને ફારુનના માણસોથી છૂપાવવા એક ટોપલીમાં મૂકીને નાઇલ નદીના બરૂઓમાં મૂક્યો હતો.
(અનુવાદ માટેના સૂચનો: [નામોનો અનુવાદ કેવી રીતે કરવો](rc://gu/ta/man/translate/translate-names))
(આ પણ જૂઓ: [ઈજીપ્ત](../names/egypt.md), [ગોશેન](../names/goshen.md), [મૂસા](../names/moses.md))
## બાઇબલના સંદર્ભો:
* [આમોસ 8:7-8](rc://gu/tn/help/amo/08/07)
* [ઉત્પત્તિ 41:1-3](rc://gu/tn/help/gen/41/01)
* [યર્મિયા 46:7-9](rc://gu/tn/help/jer/46/07)
## બાઇબલ વાતાાઓમાંથી ઉદાહરણો:
* __[8:4](rc://gu/tn/help/obs/08/04)__ ઈજીપ્ત __નાઇલ નદીના__ કિનારે સ્થિત એક મોટો અને શક્તિશાળી દેશ હતો.
* __[9:4](rc://gu/tn/help/obs/09/04)__ ફારુને જોયું કે ઇઝરાયલીઓને ઘણાં બાળકો જનમતા હતા, તેથી તેણે પોતાના માણસોને હુકમ કર્યો કે બધા જ ઇઝરાયલી નર બાળકોને __નાઇલ નદીમાં__ નાખીને મારી નાખવા.
* __[9:6](rc://gu/tn/help/obs/09/06)__ જ્યારે બાળકના માતાપિતા તેને વધારે સમય છૂપાવી શક્યા નહિ ત્યારે, તેમણે તે બાળકને મરતું બચાવવા તેને એક તરતી ટોપલીમાં મૂકીને __નાઇલ નદીના__ કિનારે બરૂઓમાં મૂક્યું.
* __[10:3](rc://gu/tn/help/obs/10/03)__ ઈશ્વરે __નાઇલ નદીના__ પાણીને લોહીમાં બદલી નાખ્યું, તો પણ ફારુને ઇઝરાયલીઓને જવા દીધા નહિ.
## શબ્દ માહિતી:
* Strong's: H2975, H4714, H5104
| 48.676471 | 198 | 0.508761 | guj_Gujr | 0.999905 |
5477b0bfa3cd82c0cac0920474b14acf3d53f9d6 | 63 | md | Markdown | README.md | ShujunZhou/SmartFramework | 83c3809e3024975fe9e9d192ca508e944c6974fd | [
"Apache-2.0"
] | null | null | null | README.md | ShujunZhou/SmartFramework | 83c3809e3024975fe9e9d192ca508e944c6974fd | [
"Apache-2.0"
] | null | null | null | README.md | ShujunZhou/SmartFramework | 83c3809e3024975fe9e9d192ca508e944c6974fd | [
"Apache-2.0"
] | null | null | null | # SmartFramework
实现一个javaWeb框架
从零开始实现一个JavaWeb框架,使其具有主流框架的基本特性
| 15.75 | 31 | 0.904762 | zho_Hans | 0.340849 |
5478f2be3e977f8cf3a48cc8d5a3c02d572eeec4 | 296 | md | Markdown | includes/tlasharptla-bits-md.md | Dodozz/docs.it-it | f34c4bb1e8afb7492f8512359d32a9156c9c768d | [
"CC-BY-4.0",
"MIT"
] | null | null | null | includes/tlasharptla-bits-md.md | Dodozz/docs.it-it | f34c4bb1e8afb7492f8512359d32a9156c9c768d | [
"CC-BY-4.0",
"MIT"
] | null | null | null | includes/tlasharptla-bits-md.md | Dodozz/docs.it-it | f34c4bb1e8afb7492f8512359d32a9156c9c768d | [
"CC-BY-4.0",
"MIT"
] | null | null | null | ---
ms.openlocfilehash: 1a5b1b7455f1d7648fae7d888be618e1204299f5
ms.sourcegitcommit: 8699383914c24a0df033393f55db3369db728a7b
ms.translationtype: MT
ms.contentlocale: it-IT
ms.lasthandoff: 05/15/2019
ms.locfileid: "65670254"
---
Servizio trasferimento intelligente in background (BITS) Microsoft
| 29.6 | 66 | 0.844595 | yue_Hant | 0.140438 |
54792e0477aa58605837bc02585cee2b493b1c96 | 145 | md | Markdown | includes/iot-hub-pii-note-naming-hub.md | bospoort/azure-docs | 3e7fc7f45dc5c69f9aa7c85beb3ad7206e485507 | [
"CC-BY-4.0",
"MIT"
] | 1 | 2019-07-18T11:30:47.000Z | 2019-07-18T11:30:47.000Z | includes/iot-hub-pii-note-naming-hub.md | bospoort/azure-docs | 3e7fc7f45dc5c69f9aa7c85beb3ad7206e485507 | [
"CC-BY-4.0",
"MIT"
] | 1 | 2020-10-19T20:02:24.000Z | 2020-10-19T20:02:24.000Z | includes/iot-hub-pii-note-naming-hub.md | bospoort/azure-docs | 3e7fc7f45dc5c69f9aa7c85beb3ad7206e485507 | [
"CC-BY-4.0",
"MIT"
] | 2 | 2020-09-24T21:20:47.000Z | 2020-10-20T17:45:07.000Z | > [!IMPORTANT]
> The IoT hub will be publicly discoverable as a DNS endpoint, so make sure to avoid any sensitive information while naming it.
>
| 36.25 | 127 | 0.765517 | eng_Latn | 0.989006 |
5479acfbddb6a046d5726ce7d5caca22af57d651 | 687 | md | Markdown | README.md | eparisca/purse-code-challenge | a0fac0535c604202c437ead4d892f41b14dc1c22 | [
"MIT"
] | null | null | null | README.md | eparisca/purse-code-challenge | a0fac0535c604202c437ead4d892f41b14dc1c22 | [
"MIT"
] | null | null | null | README.md | eparisca/purse-code-challenge | a0fac0535c604202c437ead4d892f41b14dc1c22 | [
"MIT"
] | null | null | null | # purse-code-challenge
Purse Coding Challenge
## Dependencies
* [Docker Desktop](https://www.docker.com/products/docker-desktop)
## Build
```shell
app_version="1.0.0"
./run_tests.sh
./docker_build.sh ${app_version}
./docker_build_db.sh 1.0.0
```
## Run locally
```shell
docker-compose -f docker-compose.yml up -d
open "http://localhost:5000"
```
```shell
curl -v http://localhost:5000//api/1.0/orders/232-9384712-9823512
```
## troubleshooting
```shell
docker-compose exec purse-db bash
```
```shell
bash-5.1# psql -U dbuser purse
psql (13.3)
Type "help" for help.
purse=# select * from orders;
order | delivery
-------+----------
(0 rows)
purse=# \q
bash-5.1# exit
exit
``` | 15.613636 | 67 | 0.671033 | eng_Latn | 0.277945 |
5479bbda7bfc1daf566a7c186362e745e21700e5 | 902 | md | Markdown | CHANGELOG.md | johnstonskj/rdftools | 9f027520dec4cb35422a78a8d9a97bc5210db8f9 | [
"MIT"
] | 1 | 2022-02-03T18:41:49.000Z | 2022-02-03T18:41:49.000Z | CHANGELOG.md | johnstonskj/rdftools | 9f027520dec4cb35422a78a8d9a97bc5210db8f9 | [
"MIT"
] | 6 | 2018-03-01T23:21:24.000Z | 2018-03-07T18:35:52.000Z | CHANGELOG.md | johnstonskj/rdftools | 9f027520dec4cb35422a78a8d9a97bc5210db8f9 | [
"MIT"
] | null | null | null | # Change Log
## Release 0.2.0, on 2018-03-07.
Primarily this is a cleanup, focused on testing, and internationalization.
#### Bug Fixes
* Integrated Flake, fixed all default errors and warnings.
#### Enhancements
* Added scaffolding for I18n, externalized all print/log messages.
* Added Tox configuration for local test validation.
* Added PyPy to the build.
* Added more badging, integrated PyPI, Coveralls, Code Climate, and Requires.IO.
#### Known Issues
* Code coverage is still very limited.
* A lot of warnings from Code Climate to investigate as well.
https://pypi.python.org/pypi?:action=display&name=rdftools&version=0.2.0
## Release 0.1.0 on 2018-03-06.
Initial release.
#### Known Issues
* Still limited argument validation on a lot of commands.
* Very little testing/coverage, assuming rdflib testing.
https://pypi.python.org/pypi?:action=display&name=rdftools&version=0.1.0
| 25.771429 | 80 | 0.750554 | eng_Latn | 0.936702 |
5479ffc279d67d9e14e3b2c6374993963475f9dc | 361 | md | Markdown | de_DE/plugins/lorapayload/index.md | henribi/documentations | cd87fb349b097d832453f37e44b9a1d4b8b7ad75 | [
"MIT"
] | 3 | 2020-05-17T19:20:29.000Z | 2021-11-25T03:51:15.000Z | de_DE/plugins/lorapayload/index.md | henribi/documentations | cd87fb349b097d832453f37e44b9a1d4b8b7ad75 | [
"MIT"
] | 15 | 2020-05-26T13:57:05.000Z | 2022-01-03T17:04:09.000Z | de_DE/plugins/lorapayload/index.md | henribi/documentations | cd87fb349b097d832453f37e44b9a1d4b8b7ad75 | [
"MIT"
] | 40 | 2020-03-11T16:47:52.000Z | 2022-03-01T17:37:24.000Z |
>**WICHTIG**
>Nur offizielle Plugins haben hier ihre Dokumentation. Sie können die Dokumentation der anderen Plugins direkt im Jeedom Market einsehen. Klicken Sie im betreffenden Plugin auf Dokumentation.
>Du kannst sehen [Hier](https://market.jeedom.com/index.php?v=d&p=market&type=plugin&categorie=lorapayload) Alle offiziellen Plugins in dieser Kategorie
| 51.571429 | 191 | 0.808864 | deu_Latn | 0.981535 |
547cd86370110af57444d0668bdc63c3268c9643 | 101 | md | Markdown | terraform/modules/target_group_attach_asg/README.md | bonusbits/bonusbits_orchestrator | e44ee9dfb6f4284a20ef86cf30debbf33b0b5967 | [
"MIT"
] | null | null | null | terraform/modules/target_group_attach_asg/README.md | bonusbits/bonusbits_orchestrator | e44ee9dfb6f4284a20ef86cf30debbf33b0b5967 | [
"MIT"
] | null | null | null | terraform/modules/target_group_attach_asg/README.md | bonusbits/bonusbits_orchestrator | e44ee9dfb6f4284a20ef86cf30debbf33b0b5967 | [
"MIT"
] | 1 | 2021-09-21T16:17:54.000Z | 2021-09-21T16:17:54.000Z | ## AWS Load Balancer Target Group Attachment Module
Attach a single Target Group to Load Balancer.
| 25.25 | 51 | 0.792079 | eng_Latn | 0.648322 |
547ce2ac36189255ea9f02d374b8997ab721262d | 27,618 | md | Markdown | articles/cognitive-services/Face/Tutorials/FaceAPIinCSharpTutorial.md | nt-7/azure-docs.ja-jp | 06311dbe497ae0d6c994cb732fb447760834fa46 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | articles/cognitive-services/Face/Tutorials/FaceAPIinCSharpTutorial.md | nt-7/azure-docs.ja-jp | 06311dbe497ae0d6c994cb732fb447760834fa46 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | articles/cognitive-services/Face/Tutorials/FaceAPIinCSharpTutorial.md | nt-7/azure-docs.ja-jp | 06311dbe497ae0d6c994cb732fb447760834fa46 | [
"CC-BY-4.0",
"MIT"
] | null | null | null | ---
title: Face API C# チュートリアル | Microsoft Docs
titleSuffix: Microsoft Cognitive Services
description: 顔をフレーミングして画像内の顔を検出するために、Cognitive Services Emotion API を使用して単純な Windows アプリを作成します。
services: cognitive-services
author: SteveMSFT
manager: corncar
ms.service: cognitive-services
ms.component: face-api
ms.topic: article
ms.date: 03/01/2018
ms.author: sbowles
ms.openlocfilehash: ac4f247eb38cafc5582c1ffbb3752e049f0305ba
ms.sourcegitcommit: 95d9a6acf29405a533db943b1688612980374272
ms.translationtype: HT
ms.contentlocale: ja-JP
ms.lasthandoff: 06/23/2018
ms.locfileid: "35374237"
---
# <a name="getting-started-with-face-api-in-c35-tutorial"></a>C# の Face API の使用開始チュートリアル
このチュートリアルでは、Face API を使用する WPF Windows アプリケーションを作成します。 アプリケーションは、画像内の顔を検出し、各顔のまわりにフレームを描画し、ステータス バーに顔の説明を表示します。

## <a name="Preparation"></a>準備
このチュートリアルを使用するには、次の前提条件があります。
- Visual Studio 2015 以降がインストールされていることを確認してください。
## <a name="step1"></a>手順 1: Face API をサブスクライブし、サブスクリプション キーを入手する
Face API を使用するには、Microsoft Cognitive Services ポータルにサインアップして、Face API のサブスクリプションを新規登録する必要があります。 [サブスクリプション](https://azure.microsoft.com/try/cognitive-services/)に関するページを参照してください。 このチュートリアルでは、プライマリまたはセカンダリ サブスクリプション キーを使用できます。
## <a name="step2"></a>手順 2: Visual Studio ソリューションを作成する
この手順では、画像を選択して表示する基本的なアプリケーションを作成する Windows WPF アプリケーション プロジェクトを構築します。 以下の手順に従います。
1. Visual Studio を開きます。
1. **[ファイル]** メニューから **[新規作成]**、**[プロジェクト]** の順にクリックします。
1. **[新しいプロジェクト]** ダイアログ ボックスで、アプリケーションの WPF を選択します。
Visual Studio 2015 では、**[インストール済み]** > **[テンプレート]** > **[Visual C#]** > **[Windows]** > **[従来のデスクトップ]**> の順に展開し、**[WPF アプリケーション]** を選択します。
Visual Studio 2017 では、**[インストール済み]** > **[テンプレート]** > **[Visual C#]** > **[Windows クラシック デスクトップ]** > の順に展開し、**[WPF アプリ (.NET Framework)]** を選択します。
1. アプリケーションの名前を **FaceTutorial** に設定し、**[OK]** をクリックします。
![[WPF アプリケーション] が選択された [新しいプロジェクト] ダイアログ ボックス](../Images/vs2017-new-project.png)
1. **[ソリューション エクスプローラー]** で、プロジェクト (この場合は **FaceTutorial**) を右クリックし、**[NuGet パッケージの管理]** をクリックします。
1. **[NuGet パッケージ マネージャー]** ウィンドウで、パッケージのソースとして **[nuget.org]** を選択します。
1. **Newtonsoft.Json** を検索し、**[インストール]** を選択します。 (Visual Studio 2017 では、まず **[参照]** タブをクリックし、次に **[検索]** を選択します)。

## <a name="step3"></a>手順 3: Face API クライアント ライブラリを構成する
Face API は、HTTPS REST 要求を通して呼び出すことのできるクラウド API です。 .NET アプリケーションで使用しやすくするために、.NET クライアント ライブラリには、Face API REST 要求がカプセル化されています。 この例では、作業を簡単にするために、そのクライアント ライブラリを利用します。
次の指示に従って、クライアント ライブラリを構成します。
1. **[ソリューション エクスプローラー]** で、プロジェクト (この場合は **FaceTutorial**) を右クリックし、**[NuGet パッケージの管理]** をクリックします。
1. **[NuGet パッケージ マネージャー]** ウィンドウで、パッケージのソースとして **[nuget.org]** を選択します。
1. **Microsoft.ProjectOxford.Face** を検索し **[インストール]** します。 (Visual Studio 2017 では、まず **[参照]** タブをクリックし、次に **[検索]** を選択します)。

1. **[ソリューション エクスプローラー]** でプロジェクト参照をチェックします。 **Microsoft.ProjectOxford.Common**、**Microsoft.ProjectOxford.Face**、および **Newtonsoft.Json** 参照がインストール完了時に自動的に追加されます。

## <a name="step3"></a>手順 4: 最初のコードをコピーして、貼り付ける
1. MainWindow.xaml を開き、既存のコードを次のコードに置き換えて、ウィンドウ UI を作成します。
```xml
<Window x:Class="FaceTutorial.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="700" Width="960">
<Grid x:Name="BackPanel">
<Image x:Name="FacePhoto" Stretch="Uniform" Margin="0,0,0,50" MouseMove="FacePhoto_MouseMove" />
<DockPanel DockPanel.Dock="Bottom">
<Button x:Name="BrowseButton" Width="72" Height="20" VerticalAlignment="Bottom" HorizontalAlignment="Left"
Content="Browse..."
Click="BrowseButton_Click" />
<StatusBar VerticalAlignment="Bottom">
<StatusBarItem>
<TextBlock Name="faceDescriptionStatusBar" />
</StatusBarItem>
</StatusBar>
</DockPanel>
</Grid>
</Window>
```
1. MainWindow.xaml を開き、既存のコードを次のコードに置き換えます。
```csharp
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using Microsoft.ProjectOxford.Common.Contract;
using Microsoft.ProjectOxford.Face;
using Microsoft.ProjectOxford.Face.Contract;
namespace FaceTutorial
{
public partial class MainWindow : Window
{
// Replace the first parameter with your valid subscription key.
//
// Replace or verify the region in the second parameter.
//
// You must use the same region in your REST API call as you used to obtain your subscription keys.
// For example, if you obtained your subscription keys from the westus region, replace
// "westcentralus" in the URI below with "westus".
//
// NOTE: Free trial subscription keys are generated in the westcentralus region, so if you are using
// a free trial subscription key, you should not need to change this region.
private readonly IFaceServiceClient faceServiceClient =
new FaceServiceClient("<Subscription Key>", "https://westcentralus.api.cognitive.microsoft.com/face/v1.0");
Face[] faces; // The list of detected faces.
String[] faceDescriptions; // The list of descriptions for the detected faces.
double resizeFactor; // The resize factor for the displayed image.
public MainWindow()
{
InitializeComponent();
}
// Displays the image and calls Detect Faces.
private void BrowseButton_Click(object sender, RoutedEventArgs e)
{
// Get the image file to scan from the user.
var openDlg = new Microsoft.Win32.OpenFileDialog();
openDlg.Filter = "JPEG Image(*.jpg)|*.jpg";
bool? result = openDlg.ShowDialog(this);
// Return if canceled.
if (!(bool)result)
{
return;
}
// Display the image file.
string filePath = openDlg.FileName;
Uri fileUri = new Uri(filePath);
BitmapImage bitmapSource = new BitmapImage();
bitmapSource.BeginInit();
bitmapSource.CacheOption = BitmapCacheOption.None;
bitmapSource.UriSource = fileUri;
bitmapSource.EndInit();
FacePhoto.Source = bitmapSource;
}
// Displays the face description when the mouse is over a face rectangle.
private void FacePhoto_MouseMove(object sender, MouseEventArgs e)
{
}
}
}
```
1. サブスクリプション キーを挿入し、リージョンを確認します。
MainWindow.xaml.cs ファイルで、次の行を特定します (28 および 29 行目)。
```csharp
private readonly IFaceServiceClient faceServiceClient =
new FaceServiceClient("<Subscription Key>", "https://westcentralus.api.cognitive.microsoft.com/face/v1.0");
```
最初のパラメーターの `<Subscription Key>` を、手順 1. からの Face API サブスクリプション キーに置き換えます。
また、サブスクリプション キーから取得した場所を 2 番目のパラメーターで使用していることを確認します。 たとえば、westus リージョンからサブスクリプション キーを取得した場合、URI の "**westcentralus**" を "**westus**" に置き換えます。
無料評価版を使用してサブスクリプション キーを取得した場合、キーのリージョンは **westcentralus** に設定されているため、変更は不要です。
これで、アプリは、写真を参照してウィンドウに表示できます。

## <a name="step4"></a>手順 5: 顔を検出して画像をアップロードする
顔を検出する最も簡単な方法は、画像ファイルを直接アップロードして [Face – Detect](https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236) API を呼び出すことです。
クライアント ライブラリを使用している場合、FaceServiceClient クラスの非同期メソッド DetectAsync を使用することでこれを行うことができます。
返された顔にはそれぞれ、その場所を示す四角形と一連の任意の顔属性が含まれます。
**MainWindow** クラスに次のコードを挿入します。
```csharp
// Uploads the image file and calls Detect Faces.
private async Task<Face[]> UploadAndDetectFaces(string imageFilePath)
{
// The list of Face attributes to return.
IEnumerable<FaceAttributeType> faceAttributes =
new FaceAttributeType[] { FaceAttributeType.Gender, FaceAttributeType.Age, FaceAttributeType.Smile, FaceAttributeType.Emotion, FaceAttributeType.Glasses, FaceAttributeType.Hair };
// Call the Face API.
try
{
using (Stream imageFileStream = File.OpenRead(imageFilePath))
{
Face[] faces = await faceServiceClient.DetectAsync(imageFileStream, returnFaceId: true, returnFaceLandmarks:false, returnFaceAttributes: faceAttributes);
return faces;
}
}
// Catch and display Face API errors.
catch (FaceAPIException f)
{
MessageBox.Show(f.ErrorMessage, f.ErrorCode);
return new Face[0];
}
// Catch and display all other errors.
catch (Exception e)
{
MessageBox.Show(e.Message, "Error");
return new Face[0];
}
}
```
## <a name="step5"></a>手順 6: 画像の中の顔をマークする
この手順では、前の手順をすべて組み合わせて、画像内で検出された顔をマークします。
**MainWindow.xaml.cs** で、'async' 修飾子を **BrowseButton_Click** メソッドに追加します。
```csharp
private async void BrowseButton_Click(object sender, RoutedEventArgs e)
```
**BrowseButton_Click** イベント ハンドラーの末尾に次のコードを挿入します。
```csharp
// Detect any faces in the image.
Title = "Detecting...";
faces = await UploadAndDetectFaces(filePath);
Title = String.Format("Detection Finished. {0} face(s) detected", faces.Length);
if (faces.Length > 0)
{
// Prepare to draw rectangles around the faces.
DrawingVisual visual = new DrawingVisual();
DrawingContext drawingContext = visual.RenderOpen();
drawingContext.DrawImage(bitmapSource,
new Rect(0, 0, bitmapSource.Width, bitmapSource.Height));
double dpi = bitmapSource.DpiX;
resizeFactor = 96 / dpi;
faceDescriptions = new String[faces.Length];
for (int i = 0; i < faces.Length; ++i)
{
Face face = faces[i];
// Draw a rectangle on the face.
drawingContext.DrawRectangle(
Brushes.Transparent,
new Pen(Brushes.Red, 2),
new Rect(
face.FaceRectangle.Left * resizeFactor,
face.FaceRectangle.Top * resizeFactor,
face.FaceRectangle.Width * resizeFactor,
face.FaceRectangle.Height * resizeFactor
)
);
// Store the face description.
faceDescriptions[i] = FaceDescription(face);
}
drawingContext.Close();
// Display the image with the rectangle around the face.
RenderTargetBitmap faceWithRectBitmap = new RenderTargetBitmap(
(int)(bitmapSource.PixelWidth * resizeFactor),
(int)(bitmapSource.PixelHeight * resizeFactor),
96,
96,
PixelFormats.Pbgra32);
faceWithRectBitmap.Render(visual);
FacePhoto.Source = faceWithRectBitmap;
// Set the status bar text.
faceDescriptionStatusBar.Text = "Place the mouse pointer over a face to see the face description.";
}
```
## <a name="step6"></a>手順 7: 画像内の顔を説明する
この手順では、顔のプロパティを確認し、顔を説明する文字列を生成します。 この文字列は、マウス ポインターを顔の四角形の上に置いたときに表示されます。
このメソッドを **MainWindow** クラスに追加し、顔の詳細を文字列に変換します。
```csharp
// Returns a string that describes the given face.
private string FaceDescription(Face face)
{
StringBuilder sb = new StringBuilder();
sb.Append("Face: ");
// Add the gender, age, and smile.
sb.Append(face.FaceAttributes.Gender);
sb.Append(", ");
sb.Append(face.FaceAttributes.Age);
sb.Append(", ");
sb.Append(String.Format("smile {0:F1}%, ", face.FaceAttributes.Smile * 100));
// Add the emotions. Display all emotions over 10%.
sb.Append("Emotion: ");
EmotionScores emotionScores = face.FaceAttributes.Emotion;
if (emotionScores.Anger >= 0.1f) sb.Append(String.Format("anger {0:F1}%, ", emotionScores.Anger * 100));
if (emotionScores.Contempt >= 0.1f) sb.Append(String.Format("contempt {0:F1}%, ", emotionScores.Contempt * 100));
if (emotionScores.Disgust >= 0.1f) sb.Append(String.Format("disgust {0:F1}%, ", emotionScores.Disgust * 100));
if (emotionScores.Fear >= 0.1f) sb.Append(String.Format("fear {0:F1}%, ", emotionScores.Fear * 100));
if (emotionScores.Happiness >= 0.1f) sb.Append(String.Format("happiness {0:F1}%, ", emotionScores.Happiness * 100));
if (emotionScores.Neutral >= 0.1f) sb.Append(String.Format("neutral {0:F1}%, ", emotionScores.Neutral * 100));
if (emotionScores.Sadness >= 0.1f) sb.Append(String.Format("sadness {0:F1}%, ", emotionScores.Sadness * 100));
if (emotionScores.Surprise >= 0.1f) sb.Append(String.Format("surprise {0:F1}%, ", emotionScores.Surprise * 100));
// Add glasses.
sb.Append(face.FaceAttributes.Glasses);
sb.Append(", ");
// Add hair.
sb.Append("Hair: ");
// Display baldness confidence if over 1%.
if (face.FaceAttributes.Hair.Bald >= 0.01f)
sb.Append(String.Format("bald {0:F1}% ", face.FaceAttributes.Hair.Bald * 100));
// Display all hair color attributes over 10%.
HairColor[] hairColors = face.FaceAttributes.Hair.HairColor;
foreach (HairColor hairColor in hairColors)
{
if (hairColor.Confidence >= 0.1f)
{
sb.Append(hairColor.Color.ToString());
sb.Append(String.Format(" {0:F1}% ", hairColor.Confidence * 100));
}
}
// Return the built string.
return sb.ToString();
}
```
## <a name="step6"></a>手順 8: 顔の説明を表示する
**FacePhoto_MouseMove** メソッドのコードを次のコードに置き換えます。
```csharp
private void FacePhoto_MouseMove(object sender, MouseEventArgs e)
{
// If the REST call has not completed, return from this method.
if (faces == null)
return;
// Find the mouse position relative to the image.
Point mouseXY = e.GetPosition(FacePhoto);
ImageSource imageSource = FacePhoto.Source;
BitmapSource bitmapSource = (BitmapSource)imageSource;
// Scale adjustment between the actual size and displayed size.
var scale = FacePhoto.ActualWidth / (bitmapSource.PixelWidth / resizeFactor);
// Check if this mouse position is over a face rectangle.
bool mouseOverFace = false;
for (int i = 0; i < faces.Length; ++i)
{
FaceRectangle fr = faces[i].FaceRectangle;
double left = fr.Left * scale;
double top = fr.Top * scale;
double width = fr.Width * scale;
double height = fr.Height * scale;
// Display the face description for this face if the mouse is over this face rectangle.
if (mouseXY.X >= left && mouseXY.X <= left + width && mouseXY.Y >= top && mouseXY.Y <= top + height)
{
faceDescriptionStatusBar.Text = faceDescriptions[i];
mouseOverFace = true;
break;
}
}
// If the mouse is not over a face rectangle.
if (!mouseOverFace)
faceDescriptionStatusBar.Text = "Place the mouse pointer over a face to see the face description.";
}
```
このアプリケーションを実行し、顔が含まれる画像を参照します。 クラウド API が応答するまで数秒お待ちください。 その後、画像内の顔に赤色の四角形が表示されます。 顔の四角形にマウスを移動すると、顔の説明がステータス バーに表示されます。

## <a name="summary"></a> まとめ
このチュートリアルでは、Face API を使用するための基本的なプロセスを学習し、画像内に顔マークを表示するアプリケーションを作成しました。 Face API の詳細については、ハウツー記事と [API リファレンス](https://westus.dev.cognitive.microsoft.com/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236)をご覧ください。
## <a name="fullsource"></a> 完全なソース
ここには、WPF Windows アプリケーションの完全なソースが提供されています。
MainWindow.xaml:
```xml
<Window x:Class="FaceTutorial.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="700" Width="960">
<Grid x:Name="BackPanel">
<Image x:Name="FacePhoto" Stretch="Uniform" Margin="0,0,0,50" MouseMove="FacePhoto_MouseMove" />
<DockPanel DockPanel.Dock="Bottom">
<Button x:Name="BrowseButton" Width="72" Height="20" VerticalAlignment="Bottom" HorizontalAlignment="Left"
Content="Browse..."
Click="BrowseButton_Click" />
<StatusBar VerticalAlignment="Bottom">
<StatusBarItem>
<TextBlock Name="faceDescriptionStatusBar" />
</StatusBarItem>
</StatusBar>
</DockPanel>
</Grid>
</Window>
```
MainWindow.xaml.cs:
```csharp
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using Microsoft.ProjectOxford.Common.Contract;
using Microsoft.ProjectOxford.Face;
using Microsoft.ProjectOxford.Face.Contract;
namespace FaceTutorial
{
public partial class MainWindow : Window
{
// Replace the first parameter with your valid subscription key.
//
// Replace or verify the region in the second parameter.
//
// You must use the same region in your REST API call as you used to obtain your subscription keys.
// For example, if you obtained your subscription keys from the westus region, replace
// "westcentralus" in the URI below with "westus".
//
// NOTE: Free trial subscription keys are generated in the westcentralus region, so if you are using
// a free trial subscription key, you should not need to change this region.
private readonly IFaceServiceClient faceServiceClient =
new FaceServiceClient("<Subscription Key>", "https://westcentralus.api.cognitive.microsoft.com/face/v1.0");
Face[] faces; // The list of detected faces.
String[] faceDescriptions; // The list of descriptions for the detected faces.
double resizeFactor; // The resize factor for the displayed image.
public MainWindow()
{
InitializeComponent();
}
// Displays the image and calls Detect Faces.
private async void BrowseButton_Click(object sender, RoutedEventArgs e)
{
// Get the image file to scan from the user.
var openDlg = new Microsoft.Win32.OpenFileDialog();
openDlg.Filter = "JPEG Image(*.jpg)|*.jpg";
bool? result = openDlg.ShowDialog(this);
// Return if canceled.
if (!(bool)result)
{
return;
}
// Display the image file.
string filePath = openDlg.FileName;
Uri fileUri = new Uri(filePath);
BitmapImage bitmapSource = new BitmapImage();
bitmapSource.BeginInit();
bitmapSource.CacheOption = BitmapCacheOption.None;
bitmapSource.UriSource = fileUri;
bitmapSource.EndInit();
FacePhoto.Source = bitmapSource;
// Detect any faces in the image.
Title = "Detecting...";
faces = await UploadAndDetectFaces(filePath);
Title = String.Format("Detection Finished. {0} face(s) detected", faces.Length);
if (faces.Length > 0)
{
// Prepare to draw rectangles around the faces.
DrawingVisual visual = new DrawingVisual();
DrawingContext drawingContext = visual.RenderOpen();
drawingContext.DrawImage(bitmapSource,
new Rect(0, 0, bitmapSource.Width, bitmapSource.Height));
double dpi = bitmapSource.DpiX;
resizeFactor = 96 / dpi;
faceDescriptions = new String[faces.Length];
for (int i = 0; i < faces.Length; ++i)
{
Face face = faces[i];
// Draw a rectangle on the face.
drawingContext.DrawRectangle(
Brushes.Transparent,
new Pen(Brushes.Red, 2),
new Rect(
face.FaceRectangle.Left * resizeFactor,
face.FaceRectangle.Top * resizeFactor,
face.FaceRectangle.Width * resizeFactor,
face.FaceRectangle.Height * resizeFactor
)
);
// Store the face description.
faceDescriptions[i] = FaceDescription(face);
}
drawingContext.Close();
// Display the image with the rectangle around the face.
RenderTargetBitmap faceWithRectBitmap = new RenderTargetBitmap(
(int)(bitmapSource.PixelWidth * resizeFactor),
(int)(bitmapSource.PixelHeight * resizeFactor),
96,
96,
PixelFormats.Pbgra32);
faceWithRectBitmap.Render(visual);
FacePhoto.Source = faceWithRectBitmap;
// Set the status bar text.
faceDescriptionStatusBar.Text = "Place the mouse pointer over a face to see the face description.";
}
}
// Displays the face description when the mouse is over a face rectangle.
private void FacePhoto_MouseMove(object sender, MouseEventArgs e)
{
// If the REST call has not completed, return from this method.
if (faces == null)
return;
// Find the mouse position relative to the image.
Point mouseXY = e.GetPosition(FacePhoto);
ImageSource imageSource = FacePhoto.Source;
BitmapSource bitmapSource = (BitmapSource)imageSource;
// Scale adjustment between the actual size and displayed size.
var scale = FacePhoto.ActualWidth / (bitmapSource.PixelWidth / resizeFactor);
// Check if this mouse position is over a face rectangle.
bool mouseOverFace = false;
for (int i = 0; i < faces.Length; ++i)
{
FaceRectangle fr = faces[i].FaceRectangle;
double left = fr.Left * scale;
double top = fr.Top * scale;
double width = fr.Width * scale;
double height = fr.Height * scale;
// Display the face description for this face if the mouse is over this face rectangle.
if (mouseXY.X >= left && mouseXY.X <= left + width && mouseXY.Y >= top && mouseXY.Y <= top + height)
{
faceDescriptionStatusBar.Text = faceDescriptions[i];
mouseOverFace = true;
break;
}
}
// If the mouse is not over a face rectangle.
if (!mouseOverFace)
faceDescriptionStatusBar.Text = "Place the mouse pointer over a face to see the face description.";
}
// Uploads the image file and calls Detect Faces.
private async Task<Face[]> UploadAndDetectFaces(string imageFilePath)
{
// The list of Face attributes to return.
IEnumerable<FaceAttributeType> faceAttributes =
new FaceAttributeType[] { FaceAttributeType.Gender, FaceAttributeType.Age, FaceAttributeType.Smile, FaceAttributeType.Emotion, FaceAttributeType.Glasses, FaceAttributeType.Hair };
// Call the Face API.
try
{
using (Stream imageFileStream = File.OpenRead(imageFilePath))
{
Face[] faces = await faceServiceClient.DetectAsync(imageFileStream, returnFaceId: true, returnFaceLandmarks: false, returnFaceAttributes: faceAttributes);
return faces;
}
}
// Catch and display Face API errors.
catch (FaceAPIException f)
{
MessageBox.Show(f.ErrorMessage, f.ErrorCode);
return new Face[0];
}
// Catch and display all other errors.
catch (Exception e)
{
MessageBox.Show(e.Message, "Error");
return new Face[0];
}
}
// Returns a string that describes the given face.
private string FaceDescription(Face face)
{
StringBuilder sb = new StringBuilder();
sb.Append("Face: ");
// Add the gender, age, and smile.
sb.Append(face.FaceAttributes.Gender);
sb.Append(", ");
sb.Append(face.FaceAttributes.Age);
sb.Append(", ");
sb.Append(String.Format("smile {0:F1}%, ", face.FaceAttributes.Smile * 100));
// Add the emotions. Display all emotions over 10%.
sb.Append("Emotion: ");
EmotionScores emotionScores = face.FaceAttributes.Emotion;
if (emotionScores.Anger >= 0.1f) sb.Append(String.Format("anger {0:F1}%, ", emotionScores.Anger * 100));
if (emotionScores.Contempt >= 0.1f) sb.Append(String.Format("contempt {0:F1}%, ", emotionScores.Contempt * 100));
if (emotionScores.Disgust >= 0.1f) sb.Append(String.Format("disgust {0:F1}%, ", emotionScores.Disgust * 100));
if (emotionScores.Fear >= 0.1f) sb.Append(String.Format("fear {0:F1}%, ", emotionScores.Fear * 100));
if (emotionScores.Happiness >= 0.1f) sb.Append(String.Format("happiness {0:F1}%, ", emotionScores.Happiness * 100));
if (emotionScores.Neutral >= 0.1f) sb.Append(String.Format("neutral {0:F1}%, ", emotionScores.Neutral * 100));
if (emotionScores.Sadness >= 0.1f) sb.Append(String.Format("sadness {0:F1}%, ", emotionScores.Sadness * 100));
if (emotionScores.Surprise >= 0.1f) sb.Append(String.Format("surprise {0:F1}%, ", emotionScores.Surprise * 100));
// Add glasses.
sb.Append(face.FaceAttributes.Glasses);
sb.Append(", ");
// Add hair.
sb.Append("Hair: ");
// Display baldness confidence if over 1%.
if (face.FaceAttributes.Hair.Bald >= 0.01f)
sb.Append(String.Format("bald {0:F1}% ", face.FaceAttributes.Hair.Bald * 100));
// Display all hair color attributes over 10%.
HairColor[] hairColors = face.FaceAttributes.Hair.HairColor;
foreach (HairColor hairColor in hairColors)
{
if (hairColor.Confidence >= 0.1f)
{
sb.Append(hairColor.Color.ToString());
sb.Append(String.Format(" {0:F1}% ", hairColor.Confidence * 100));
}
}
// Return the built string.
return sb.ToString();
}
}
}
```
## <a name="related"></a> 次のステップ
- [Java for Android での Face API の使用開始](FaceAPIinJavaForAndroidTutorial.md)
- [Python での Face API の使用開始](FaceAPIinPythonTutorial.md)
| 39.11898 | 237 | 0.626077 | yue_Hant | 0.465651 |
547dce6b1d13c4f632b1d2eec99175d7042fab25 | 3,331 | md | Markdown | README.md | vaginessa/WebDGap | 2692f3bcfe8ac67c7388d7d20dda18e67e4a1548 | [
"MIT"
] | null | null | null | README.md | vaginessa/WebDGap | 2692f3bcfe8ac67c7388d7d20dda18e67e4a1548 | [
"MIT"
] | null | null | null | README.md | vaginessa/WebDGap | 2692f3bcfe8ac67c7388d7d20dda18e67e4a1548 | [
"MIT"
] | null | null | null | # WebDGap
Convert any website, or web application to a native Windows, Linux, Mac, or Chrome desktop application.

### Converting a Web Application to a native Desktop Application.
1. WebDGap requires you to add your application's name first.
2. Load your application's logo second.
3. Lastly load in your application's source encased in a zip file.
**IMPORTANT!!!** *(your zip file must look something like this, when exporting it as a desktop/chrome application, or extension)*
- index.html
- css/style.css
- js/jquery.js
- js/script.js
The zip example below **WILL NOT WORK!!!**
- AppName/index.html
- AppName/css/style.css
- AppName/js/jquery.js
- AppName/js/script.js
**NOTE:** Larger zip files take a longer time loading and exporting!
### Version
1.2.5
### Tech
WebDGap uses a number of open source projects to work properly:
* [Poly UI Kit](https://github.com/Guilh/Poly) - Used for the application's user interface
* [jQuery](http://jquery.com/) - duh
* [JSZip](https://stuk.github.io/jszip/) - package zip files in javascript
* [node-webkit](http://nwjs.io/) - run web apps as desktop apps
* [AlertifyJS](http://alertifyjs.com/) - For the awesome and stylish alert notification dialogs
### License
MIT
### Availability
*(Desktop version of WebDGap is deprecated)*
[Windows 64](https://sourceforge.net/projects/webdgap/files/v1.2.4/WebDGap-win.zip/download)
[Windows 32](https://sourceforge.net/projects/webdgap/files/v1.2.4/WebDGap-win32.zip/download)
[Mac](https://sourceforge.net/projects/webdgap/files/v1.2.4/WebDGap-mac.zip/download)
[Linux 64](https://sourceforge.net/projects/webdgap/files/v1.2.4/WebDGap-lin.zip/download)
[Linux 32](https://sourceforge.net/projects/webdgap/files/v1.2.4/WebDGap-lin32.zip/download)
For command line use you can use [nativefier](https://github.com/jiahaog/nativefier) to convert any website to a desktop app. (**NOTE**: nativefier uses an Electron wrapper. WebDGap uses a NW.js wrapper. Difference is Electron runs on 64bit processors while NW.js runs on 64bits and 32bit processors)
### Free Software, Hell Yeah!
- [kodeWeave](http://kodeweave.sourceforge.net/)
- [AngularJS](http://angularjs.org)
- [jQuery](http://jquery.com)
- [Codemirror](http://codemirror.net/)
- [io.js](https://iojs.org/en/index.html)
- [node.js](http://nodejs.org)
- [JSZip](https://stuk.github.io/jszip/)
- [Twitter Bootstrap](http://twitter.github.com/bootstrap/)
- [Poly UI Kit](https://github.com/Guilh/Poly)
- [CodePen](http://codepen.io/mikethedj4)
### Author
- [michael schwartz](http://mikethedj4.github.io/) and with [tom gibson's](http://www.tomgibsonconsulting.com/) help on making WebDGap available for Mobile users :)
### Development
Want to contribute? Great!
You can submit a pull request or simply share the project :)
Of course WebDGap is free and open source, so you can always fork the project and have fun :)
If WebDGap was at all helpful for you. [Would you consider donating to the project?](https://cash.me/$mschwar4)
[You can donate via PayPal too!](https://www.paypal.com/us/cgi-bin/webscr?cmd=_flow&SESSION=JryIEtO_GiYnqlvRfV6BGnO6bAxR3JtIQif2j1z1eFYuoLkYf_XZOY6QbWe&dispatch=5885d80a13c0db1f8e263663d3faee8dcce3e160f5b9538489e17951d2c62172) | 40.621951 | 300 | 0.745722 | eng_Latn | 0.30483 |
547dd58c01ab9d50be79e5351ed203cd4766bf14 | 1,722 | md | Markdown | footprint-benchmark/README.md | dalebremner/on-tools | 18b826bca2a3608c5b50116ec710bbeb630a586e | [
"Apache-2.0"
] | 4 | 2015-12-08T20:02:53.000Z | 2019-03-08T07:42:24.000Z | footprint-benchmark/README.md | dalebremner/on-tools | 18b826bca2a3608c5b50116ec710bbeb630a586e | [
"Apache-2.0"
] | 48 | 2016-01-28T23:50:38.000Z | 2017-10-20T13:38:03.000Z | footprint-benchmark/README.md | dalebremner/on-tools | 18b826bca2a3608c5b50116ec710bbeb630a586e | [
"Apache-2.0"
] | 38 | 2015-11-02T23:49:37.000Z | 2021-05-27T01:24:03.000Z | # Footprint Benchmark Overview
Footprint benchmark collects system data and draw diagrams to compare with previous runs.
Details can be found in WIKI page:
[proposal-footprint-benchmarks](https://github.com/RackHD/RackHD/wiki/proposal-footprint-benchmarks)
The benchmark data collection process can start/stop independently and users can get the footprint info about any
operation they carry out during this period of time.
## Precondition
The machine running RackHD can use apt-get to install packages, which means it must have accessible sources.list
## Setup
NOTE: virtualenv version used 1.11.4 (Ubuntu). Using virtualenv is optional here but suggested.
virtualenv .venv
source .venv/bin/activate
sudo pip install -r requirements.txt
## Settings
Following parameters are required at the first time user issuing the test, and stored in .ansible_config
localhost username and password: information of the machine running the data collection
rackhd ip, ssh port, username and password: information of the machine running rackhd
## Running the benchmark data collection
Start|Stop benchmark data collection
python benchmark.py --start|stop
Get the directory of the latest log data
python benchmark.py --getdir
## Getting the result
Footprint report is in ~/benchmark/(timestamp)/(case)/report of the test machine.
Report in html format can display its full function by the following command to open the browser
and drag the summary.html to it.
chrome.exe --user-data-dir="C:/Chrome dev session" --allow-file-access-from-files
Data summary and graph is shown by process and footprint matrix. Data collected in previous runs
can be selected to compare with the current one.
| 35.875 | 113 | 0.786295 | eng_Latn | 0.990345 |
547f0254ff40b04e46b63e43b9f17448b44517f3 | 2,572 | md | Markdown | _docs/1 - Recon/Infrastructure.md | MrJester/binary_exile_cheat_sheet | 5d6a67f64d4158a2287f91f7bd2f730c6bbdd2ab | [
"MIT"
] | 1 | 2017-05-01T08:04:28.000Z | 2017-05-01T08:04:28.000Z | _docs/1 - Recon/Infrastructure.md | MrJester/binary_exile_cheat_sheet | 5d6a67f64d4158a2287f91f7bd2f730c6bbdd2ab | [
"MIT"
] | null | null | null | _docs/1 - Recon/Infrastructure.md | MrJester/binary_exile_cheat_sheet | 5d6a67f64d4158a2287f91f7bd2f730c6bbdd2ab | [
"MIT"
] | 2 | 2018-04-20T16:17:58.000Z | 2019-03-27T17:11:51.000Z | ---
title: Infrastructure
category: Recon
order: 1
---
> **Obtain domains**
* [Domain Huter](https://domainhuntergatherer.com/)
* [Expired Domains](https://www.expireddomains.net/)
> **Checking Reputation**
* [McAfee](https://trustedsource.org/en/feedback/url?action=checksingle)
* [Fortiguard](https://fortiguard.com/webfilter)
* [Bluecoat and Symantec](http://sitereview.bluecoat.com/)
> **Redirectors**
{% highlight bash %}
iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT
iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination [destinationIP]:80
iptables -t nat -A POSTROUTING -j MASQUERADE
iptables -I FORWARD -j ACCEPT
iptables -P FORWARD ACCEPT
sysctl net.ipv4.ip_forward=1
{% endhighlight %}
* Apache mod_rewrite for specif
> **Domain Fronting**
* [How to Domain Front 1](https://www.optiv.com/blog/escape-and-evasion-egressing-restricted-networks)
* [How to Domain Front 2](https://www.mdsec.co.uk/2017/02/domain-fronting-via-cloudfront-alternate-domains/)
* [How to Domain Front 3](https://blog.cobaltstrike.com/2017/02/06/high-reputation-redirectors-and-domain-fronting/)
* [How to Domain Front 4](https://www.cyberark.com/threat-research-blog/red-team-insights-https-domain-fronting-google-hosts-using-cobalt-strike/)
* [How to Domain Front 5](https://medium.com/@vysec.private/alibaba-cdn-domain-fronting-1c0754fa0142)
* [How to Domain Front - Meterpreter](https://bitrot.sh/post/30-11-2017-domain-fronting-with-meterpreter/)
* [Domain Fronting List](https://github.com/vysec/DomainFrontingLists)
* [Script to find frontable domains and List](https://github.com/peewpw/DomainFrontDiscover)
> **Malleable C2: Cobalt Strike**
* [mudge](https://github.com/rsmudge/Malleable-C2-Profiles)
* [bluescreenofjeff](https://github.com/bluscreenofjeff/Malleable-C2-Randomizer)
> **Agressor Scripts**
* [HarleyQu1nn](https://github.com/harleyQu1nn/AggressorScripts)
*
> **Useful Resources**
* https://github.com/redcanaryco/atomic-red-team/blob/master/Windows/README.md
* https://github.com/Coalfire-Research/Red-Baron
* https://github.com/bluscreenofjeff/Red-Team-Infrastructure-Wiki
* https://bluescreenofjeff.com/2017-01-24-how-to-write-malleable-c2-profilesfor-cobalt-strike/
* https://blog.cobaltstrike.com/2013/02/12/a-vision-for-distributed-red-team-operations/
* https://blog.cobaltstrike.com/2014/09/09/infrastructure-for-ongoing-red-team-operations/
* Advanced Threat Tactics (2 of 9): Infrastructure - Raphael Mudge
* https://www.youtube.com/watch?v=3gBJOJb8Oi0
* https://cybersyndicates.com/2016/11/top-red-team-tips/
| 39.569231 | 146 | 0.756998 | yue_Hant | 0.637875 |
547f2cc11eabd09187b0d8a2dcb518d58cf5c08a | 847 | md | Markdown | README.md | alikinvv/search-interaction | 5eb30d00b07c6bb448ddb2291d8ee69cfe5782fd | [
"MIT"
] | 3 | 2019-02-28T13:35:35.000Z | 2021-05-20T15:36:19.000Z | README.md | alikinvv/search-interaction | 5eb30d00b07c6bb448ddb2291d8ee69cfe5782fd | [
"MIT"
] | null | null | null | README.md | alikinvv/search-interaction | 5eb30d00b07c6bb448ddb2291d8ee69cfe5782fd | [
"MIT"
] | null | null | null | # SEARCH INTERACTION
[](https://github.com/alikinvv/search-interaction/issues) [](http://hits.dwyl.com/alikinvv/search-interaction) [](https://opensource.org/licenses/MIT) [](https://www.paypal.me/alikinvv)
:star: Star us on GitHub — it helps!
## [Live Demo](https://alikinvv.github.io/search-interaction/build)

[](https://github.com/alikinvv/search-interaction)
| 70.583333 | 472 | 0.766234 | yue_Hant | 0.655391 |
547f3af5dc8e85766d67ccc0a6396cb3b193b27a | 131 | markdown | Markdown | src/2017-03-28-breakfast.markdown | dannyec/jekyll-json | d7f451278b68f0a7f0a51661d1a9126cd42fede7 | [
"MIT"
] | null | null | null | src/2017-03-28-breakfast.markdown | dannyec/jekyll-json | d7f451278b68f0a7f0a51661d1a9126cd42fede7 | [
"MIT"
] | null | null | null | src/2017-03-28-breakfast.markdown | dannyec/jekyll-json | d7f451278b68f0a7f0a51661d1a9126cd42fede7 | [
"MIT"
] | null | null | null | ---
layout: post
title: "面包和咖啡"
date: 2017-03-28 10:57:30 +0800
categories: 早饭
food:
- 面包
- 咖啡
image:
- IMG_20170328_105730
---
| 10.916667 | 33 | 0.656489 | eng_Latn | 0.082843 |
548025740352684abeacb84d7aeea9f64734643b | 3,811 | md | Markdown | README.md | thinkbox/bugger | 2cfc458fd990fa765cb4b0a31d2fde1f886a81bc | [
"BSD-3-Clause"
] | 1 | 2019-06-27T13:03:01.000Z | 2019-06-27T13:03:01.000Z | README.md | thinkbox/bugger | 2cfc458fd990fa765cb4b0a31d2fde1f886a81bc | [
"BSD-3-Clause"
] | null | null | null | README.md | thinkbox/bugger | 2cfc458fd990fa765cb4b0a31d2fde1f886a81bc | [
"BSD-3-Clause"
] | null | null | null | # Bugger
[](https://travis-ci.org/gajus/bugger)
[](https://coveralls.io/r/gajus/bugger?branch=master)
[](https://packagist.org/packages/gajus/bugger)
[](https://packagist.org/packages/gajus/bugger)
Bugger is a collection of functions for debugging PHP code. Use it to:
* Dump information about a variable
* Set breakpoints in loops
Bugger is designed to be used when remote debugger is not available. It allows to dump information about a variable together with the debug backtrace (`trace` method), it allows to collect information about multiple variables during the script execution and dump them at the end of the script execution (`stack` method), as well as trap iterations (`tick` method).
## API
Bugger API is exposed to the global namespace via three functions:
### Trace
```php
/**
* Terminates the script, discards the output buffer, dumps information about the expression including backtrace up to the `trace` call.
*
* @param mixed $expression The variable you want to dump.
* @return null
*/
trace ( mixed $expression );
````
Trace is used to dump information about the expression including the backtrace information. Trace will attempt to discard existing output buffer. If output buffer cannot be discaded because it has been already sent to the browser, then Bugger will attempt to clear the previous output using client-side script.

### Stack
```php
/**
* Stacks information about the expression and dumps the stack at the end of the script execution.
*
* @param mixed $expression The variable you want to dump.
* @return null
*/
stack ( mixed $expression );
```
Stack is identical to `trace` except that calling `stack` will not terminate the script at the time of the call. If `stack` is called at least once during the script execution, then at the end of the script execution output buffer will be discarded and replaced with the collected `stack` dump, e.g.
```php
echo 'foo';
stack('a');
echo 'bar';
stack('b');
echo 'baz';
stack('c');
echo 'qux';
```
In the above example, 'foo', 'bar', 'baz' and 'qux' will be discarded.

### Tick
```php
/**
* Tracks the number of times tick function itself has been called and returns true
* when the desired number within the namespace is reached.
*
* @param int $true_after Number of the itteration after which response is true.
* @param string $namespace Itteration namespace.
* @return boolean
*/
tick ( int $true_after [, string $namespace = 'default' ] )
```
`tick` is used to catch script execution in loop or recursive calls. `tick` returns `true` when it has been executed a predefined number of times or more, e.g.
```php
while (true) {
if (tick(10)) {
// Tick will return true after 10 itterations.
break;
}
}
tick(4, 'test'); // false
tick(4, 'test'); // false
tick(4, 'test'); // false
tick(4, 'test'); // true
tick(4, 'test'); // true
tick(4, 'test'); // true
```
`tick` can be used together with `stack` or `trace` to capture the state of a particular itteration or multiple itterations.

## Installation
The recommended way to use Bugger is through Composer.
```json
{
"require": {
"gajus/bugger": "0.2.*"
}
}
```
If you want to use Bugger across the server, then use [auto_prepend_file](http://uk1.php.net/manual/en/ini.core.php#ini.auto-prepend-file) setting to load `./src/autoload.php`.
## Roadmap
* Support CLI.
| 32.853448 | 364 | 0.719234 | eng_Latn | 0.981313 |
5480762d3474815cb2080c047a59d31e512b809c | 59 | md | Markdown | README.md | ariz-ahmad/hackerrank-data-structures | ad215ecfad4a541995316eccb1b6f8ba17dae75c | [
"MIT"
] | null | null | null | README.md | ariz-ahmad/hackerrank-data-structures | ad215ecfad4a541995316eccb1b6f8ba17dae75c | [
"MIT"
] | null | null | null | README.md | ariz-ahmad/hackerrank-data-structures | ad215ecfad4a541995316eccb1b6f8ba17dae75c | [
"MIT"
] | null | null | null | # hackerrank-data-structures
Hackerrank - Data Structures
| 19.666667 | 29 | 0.813559 | kor_Hang | 0.448192 |
5481a219fdd4bd7aa4bd1cc0a32f76accd1cba1a | 1,017 | md | Markdown | servant-mock/README.md | monadfix/examples | 17aaeae8eaa8778eaa3b979c464cdfa893e67d62 | [
"MIT"
] | 3 | 2019-12-06T02:11:32.000Z | 2021-12-01T19:27:43.000Z | servant-mock/README.md | monadfix/examples | 17aaeae8eaa8778eaa3b979c464cdfa893e67d62 | [
"MIT"
] | null | null | null | servant-mock/README.md | monadfix/examples | 17aaeae8eaa8778eaa3b979c464cdfa893e67d62 | [
"MIT"
] | null | null | null | # Network-less mocking with Servant
This example provides a translation from Servant's requests to WAI requests,
and from WAI responses to Servant's responses. It allows calling a
Servant-produced `Application` directly _without seizing a port or doing any
networking at all._ You can write functions that use
`servant-client`-generated bindings, and then run them either against a real
remote server, or against a mock `Server`.
* [Main.hs][] -- defining a simple mock-server and calling it.
* [Mock.hs][] -- request-translating machinery.
[Main.hs]: https://github.com/monadfix/examples/blob/master/servant-mock/src/Main.hs
[Mock.hs]: https://github.com/monadfix/examples/blob/master/servant-mock/src/Mock.hs
## Limitations
* This is a proof-of-concept: streaming is not supported yet.
* Cookies are not handled faithfully (see servant-client's [`performRequest`][]).
[`performRequest`]: https://hackage.haskell.org/package/servant-client-0.14/docs/src/Servant.Client.Internal.HttpClient.html#performRequest
| 44.217391 | 139 | 0.776794 | eng_Latn | 0.977662 |
548202c40dce3cd4545a0e71ff2c1a53dccfb4ab | 1,202 | md | Markdown | onboarding-confirmation.md | ameshkin/foia-api-1 | a2017b3dff22ddfe6a2db25d6647fd3e4c52f10e | [
"CC0-1.0"
] | 12 | 2017-10-27T15:37:31.000Z | 2021-12-31T00:37:52.000Z | onboarding-confirmation.md | ameshkin/foia-api-1 | a2017b3dff22ddfe6a2db25d6647fd3e4c52f10e | [
"CC0-1.0"
] | 80 | 2017-09-25T12:23:53.000Z | 2022-03-03T21:17:47.000Z | onboarding-confirmation.md | ameshkin/foia-api-1 | a2017b3dff22ddfe6a2db25d6647fd3e4c52f10e | [
"CC0-1.0"
] | 18 | 2017-09-28T16:14:15.000Z | 2022-03-03T16:04:05.000Z | # Onboarding Confirmation
This document will be used to confirm successful completion of the project's onboarding steps.
## Instructions
After successfully forking the repository and building out their local development environment, each developer should:
1. Checkout/create a feature branch for the onboarding ticket from their develop branch.
2. Open this (onboarding-confirmation.md) file in their local editor.
3. Add their own initials followed by a link to their fork of the project codebase in the Onboarding Confirmed section below.
4. Save the changes to this file.
5. Add and commit the modifications to the branch.
6. Push the branch to their Github repo.
7. Create a pull request against the project's develop branch.
Onboarding successfully completed when their PR for this document is accepted and merged.
## Onboarding Confirmed
AFN - [GitHub - alozie/foia-api-enhancements: FOIA 2.0 (DOJ/Acquia)](https://github.com/alozie/foia-api-enhancements)
BF - [FOIA 2.0 (DOJ/Acquia)](https://github.com/isovera/foia-api-enhancements)
MB - [FOIA 2.0 (DOJ/Acquia)](https://github.com/isovera/foia-api-enhancements)
AM - [FOIA 2.0 (DOJ/Acquia)](https://github.com/isovera/foia-api-enhancements)
| 57.238095 | 125 | 0.78619 | eng_Latn | 0.987414 |
54823a256dadfbaf818000f22a3cc03b070226c7 | 3,874 | md | Markdown | content/blog/interruption-attitude/index.md | dtinth/chris-blog | ef4a1be674a97dfbe5773524b9393a5f56ea9ee0 | [
"0BSD"
] | null | null | null | content/blog/interruption-attitude/index.md | dtinth/chris-blog | ef4a1be674a97dfbe5773524b9393a5f56ea9ee0 | [
"0BSD"
] | null | null | null | content/blog/interruption-attitude/index.md | dtinth/chris-blog | ef4a1be674a97dfbe5773524b9393a5f56ea9ee0 | [
"0BSD"
] | null | null | null | ---
title: Toward solving interruption in Programming
date: "2021-06-11T12:00:00.000"
---
Recently there are developers and creative vocal about how interruption ruin their work.
There are many articles about [flow state](https://www.bbc.com/worklife/article/20190204-how-to-find-your-flow-state-to-be-peak-creative) and [funny cartoon](https://heeris.id.au/2013/this-is-why-you-shouldnt-interrupt-a-programmer/) on how interruption ruin serious thinking work. There is even a [passive-aggressive piece](https://daedtech.com/programmers-teach-non-geeks-the-true-cost-of-interruptions/) talking about teaching non-geeks cost of interruption.
As a developer, while I agree that interruption can ruin work to some degree (which differ for each people), I don't think the passive-aggressive stance most programmer take is productive nor helpful.
First of all, according to my experience in many companies both as a full-time developer, management and consultant, I want to say this out loud:
**No one really want to interrupt your work**
There is no conspiracy where every non-geek role held a secret meeting to figure out how to make programmer life most miserable and decide that throwing non-sense interruptions every hour is the best course of action.
No, that is not the case.
Every interruption has its own reason. Your teammate has some problem they want to solve, and they think you can help.
That's why they come to you. So tell people to stop interrupting will not work, especially if the problem is a shared problem. For example, what happens if sales are about to commit to some scope but don't know the feasibility? Would you want sales to stop interrupting the programmer and figure this out on their own? That obviously will make the matter worse.
There are some necessary interruptions and some not. You cannot just tell people to leave you alone to solve the problem. After all, you don't get paid to solve your personal problem. It is always a shared problem. Everyone in the team is at stake. Cutting interruptions and work in a silo is not a solution.
I believe the solution is to let them know how to interact with you. You have to set your own boundary.
For example, you can say if anything urgent, please call me instead of a message. You can say that if you leave a message, I will read it within a day. If you ping me directly, I will respond every hour. You can also block your flow time on the calendar.
Those are all valid boundaries to set.
And at first, people might mistake the urgency of the situation. Some people might call you on the tiny issue they have. That is fine if it happened the first time. You take that opportunity and categorize this issue. You tell them that next time this type of issue is not as urgent as they might think. If it happens repeatedly, we have to talk with a team about urgency and tradeoffs since interruption has some cost.
In short, rather than complaining about how others are wrong, it's better to tell what's right. We should let others know how to interact with us productively.
And there might be some constraints that we don't know. For example, we might legally bind to report production issues within a specific amount of time. We can work together to solve that constraint.
But first, you need to believe that people are not out there to get you. As I said, there is no conspiracy of non-geeks. Everyone, geeks or non-geeks, just wants to get the best results. We might have a different opinion on how to get it. That's true. They have a reason, strong or weak, they have a reason.
And shutting others of is not going to solve anything. It is a bad stance to take on the interruption problem. It is much better to take a stance of
**I understand why you need to interrupt me. However, this is not productive for all of us. Can we do it differently?**
And that is my rant for today.
| 86.088889 | 461 | 0.785235 | eng_Latn | 0.999893 |
5483ce379025af3e01cab015e809a0dc9df88e82 | 83 | md | Markdown | README.md | yamiko/cv_service | b33fbecfac2f993880b55131e089fa6cce06ef3c | [
"MIT"
] | null | null | null | README.md | yamiko/cv_service | b33fbecfac2f993880b55131e089fa6cce06ef3c | [
"MIT"
] | null | null | null | README.md | yamiko/cv_service | b33fbecfac2f993880b55131e089fa6cce06ef3c | [
"MIT"
] | null | null | null | # cv_service
A Spring Boot, Spring Data, Spring Security and JPA demo application
| 27.666667 | 69 | 0.795181 | kor_Hang | 0.819325 |
54850d90557789ec7412215f2e54079fdad03f01 | 977 | md | Markdown | .github/PULL_REQUEST_TEMPLATE.md | Louistwee/Data-panels | 2e348733f300793a679075efd98832c5ead9e839 | [
"MIT"
] | 1 | 2017-06-28T15:30:04.000Z | 2017-06-28T15:30:04.000Z | .github/PULL_REQUEST_TEMPLATE.md | Louistwee/Data-panels | 2e348733f300793a679075efd98832c5ead9e839 | [
"MIT"
] | null | null | null | .github/PULL_REQUEST_TEMPLATE.md | Louistwee/Data-panels | 2e348733f300793a679075efd98832c5ead9e839 | [
"MIT"
] | null | null | null | <!-- ^^^^^ Use {{title}} above ^^^^^
{{fn}} = The function/object you added or changed
Example: $.examplefunction
{{title}} = 'New:' : a new function or object
'Update:' : an update to a function or object
Example: New: $.examplefunction
Example: Update: $.examplefunction
{{description}} = The description of your update or new object/function
{{parameters}} = a list of parameter
-->
# {{title}}
{{description}}
<!--If it is a function:-->
## paremeters
{{parameters}}
- `connector` : a [`$.connector`]($.connector) object
## return
{{return}}
`<div></div>`
{{return}}
`<div></div>.__proto__` is [`$.connectBox.fn`]($.connectBox.fn)
<!--If it is a .fn object:-->
<!--If it is a .fn function:-->
<!--If it is something else:-->
## Description
<!--
<!-- Do note edit this:-->
## Review:
**Pull Request:**
- [ ] The request request follows the correct format.
**
| 19.156863 | 73 | 0.562948 | eng_Latn | 0.972456 |
54858572c27857dc661fa268f4972e99e4b2d5e8 | 11,599 | md | Markdown | articles/databox/data-box-safety.md | changeworld/azure-docs.sv-se | 6234acf8ae0166219b27a9daa33f6f62a2ee45ab | [
"CC-BY-4.0",
"MIT"
] | null | null | null | articles/databox/data-box-safety.md | changeworld/azure-docs.sv-se | 6234acf8ae0166219b27a9daa33f6f62a2ee45ab | [
"CC-BY-4.0",
"MIT"
] | null | null | null | articles/databox/data-box-safety.md | changeworld/azure-docs.sv-se | 6234acf8ae0166219b27a9daa33f6f62a2ee45ab | [
"CC-BY-4.0",
"MIT"
] | null | null | null | ---
title: Säkerhet för din Azure Data Box | Microsoft-dokument
description: Beskriver säkerhetskonventioner, riktlinjer och överväganden och förklarar hur du installerar och använder din Azure Data Box på ett säkert sätt.
services: databox
author: alkohli
ms.service: databox
ms.subservice: pod
ms.topic: article
ms.date: 08/13/2019
ms.author: alkohli
ms.openlocfilehash: db6e2eadbf19d78a203a4d4ba6111ad88430b192
ms.sourcegitcommit: 2ec4b3d0bad7dc0071400c2a2264399e4fe34897
ms.translationtype: MT
ms.contentlocale: sv-SE
ms.lasthandoff: 03/27/2020
ms.locfileid: "68985952"
---
# <a name="safely-install-and-operate-your-azure-data-box"></a>Installera och använda din Azure Data Box på ett säkert sätt

 säkerhetsmeddelande ikon **LÄS SÄKERHETS- OCH HÄLSOINFORMATION**
Läs all säkerhetsinformation i den här artikeln innan du använder Azure Data Box. Underlåtenhet att följa instruktionerna kan leda till brand, elektriska stötar eller andra skador eller skador på dina egenskaper.
## <a name="safety-icon-conventions"></a>Konventioner om säkerhetsikon
Här är ikonerna som du hittar när du granskar de säkerhetsåtgärder som ska iakttas när du ställer in och kör din databox.
| Ikon | Beskrivning |
|:--- |:--- |
|  Ikon **FARA!** |Indikerar en farlig situation som, om den inte undviks, kommer att leda till dödsfall eller allvarlig skada. Detta signalord ska begränsas till de mest extrema situationerna. |
|  **VARNING!** |Indikerar en farlig situation som, om den inte undviks, kan leda till dödsfall eller allvarlig skada. |
|  **VARNING VARNING!** |Anger en farlig situation som, om den inte undviks, kan leda till mindre eller måttliga skador. |
|  Ikon **MEDDELANDE:** |Anger information som anses viktig, men inte farorelaterad. |
|  Ikon **Elektrisk stöt Fara** |Hög spänning. |
|  Ikon **tung vikt** | |
|  **reservdelsikon Inga delar som kan servas av användaren** |Få inte åtkomst om inte korrekt utbildad. |
|  ikon **Läs alla instruktioner först** | |
|  Icon **Tips Hazard** | |
## <a name="handling-precautions"></a>Försiktighetsåtgärder vid hantering
  Ingen användarservicebar delar Ikon **VARNING VARNING**
* Kontrollera den *mottagna* enheten för skador. Om enhetshöljet är skadat [kontaktar du Microsoft Support](data-box-disk-contact-microsoft-support.md) för att få en ersättning. Försök inte använda enheten.
* Enheten är utrustad med manipuleringssäkra skruvar. Om du misstänker att enheten inte fungerar [kontaktar du Microsoft Support](data-box-disk-contact-microsoft-support.md) för att få en ersättare. Försök inte att serva enheten.
* Enheten innehåller inga delar som kan servas av användaren. Farlig spänning, ström och energinivåer finns inuti. Öppna inte. Returnera enheten till Microsoft för service.
  tung vikt Ikon **VARNING!**
* En fullt konfigurerad kapsling kan väga upp till 22,7 kg . försök inte lyfta den själv.
* Innan du flyttar inneslutningen ska du alltid se till att två personer är tillgängliga för att hantera vikten. Tänk på att en person som försöker lyfta denna vikt kan upprätthålla skador.
  fara ikon **VARNING!**
* Placera enheten på en plan, hård och stabil yta för att undvika en potentiell spetsrisk.
* Rackmonterad utrustning får inte användas som hyllor eller arbetsutrymmen. Placera inte databoxen ovanpå rackmonterad utrustning. Om du lägger till någon typ av last till en förlängd rackmonterad enhet kan det skapa en potentiell spetsfara som kan leda till personskador, dödsfall eller produktskador.
 **VARNING!**
* Ställ in enheten på ett arbetsområde som möjliggör tillräcklig luftcirkulation runt enheten.
* Installera enheten i ett temperaturkontrollerat inomhusområde fritt från ledande föroreningar och möjliggör tillräcklig luftcirkulation runt enheten.
* Håll enheten borta från vätskekällor och alltför fuktiga miljöer.
## <a name="electrical-precautions"></a>Elektriska försiktighetsåtgärder
  stöt ikon **VARNING!**
* Ge en säker elektrisk jordanslutning till nätsladden. Nätsladden har en jordkontakt med tre trådar (en kontakt som har jordningsstift). Denna kontakt passar endast ett jordat eluttag. Besegra inte syftet med jordningsstiftet.
* Med tanke på att kontakten på nätsladden är huvud frånkopplingsenheten, se till att uttagen är placerade nära enheten och är lättillgängliga.
* Koppla ur nätsladden (genom att dra i kontakten, inte sladden) och koppla bort alla kablar om något av följande villkor föreligger:
- Nätsladden eller kontakten blir sliten eller på annat sätt skadad.
- Du spiller något i enhetens hölje.
- Enheten utsätts för regn eller fukt.
- Enheten släpptes och enhetens hölje är skadat.
- Du misstänker att enheten behöver service eller reparation.
* Koppla ur enheten permanent innan du flyttar den eller om du tror att den har skadats på något sätt.
* Ge en lämplig strömkälla med elektriskt överbelastningsskydd för att uppfylla följande effektspecifikationer:
- Spänning: 100 V AC till 240 V AC
- Ström: 6 A, max
- Frekvens: 50 Hz till 60 Hz
 **VARNING VARNING:**
* Den här enheten innehåller myntcellsbatterier. Försök inte att serva enheten. Batterier i den här enheten kan inte servas av användaren.
* **Endast för servicepersonal**: Explosionsrisk om batteriet byts ut mot en felaktig typ. Kassera de använda batterierna enligt instruktionerna.
 Ikon **MEDDELANDE:**
För att enheten ska fungera korrekt och för att förhindra produktskador:
* Se till att fram- och bakdörrarna är helt öppna medan enheten är igång.
## <a name="regulatory-information"></a>Regleringsinformation
Det här avsnittet innehåller regulatorisk information för Azure Data Box, regulatoriskt modellnummer DB010.
Den här enheten är:
- Utvärderas som ITE (Information Technology Equipment), utformad för att fungera i en typisk datarumsmiljö. Produktens lämplighet för andra miljöer kan kräva ytterligare utvärdering.
- Utformad för användning med NRTL-listad (UL, CSA, ETL, etc.) och IEC/EN 60950-1 eller IEC/EN 62368-1-kompatibel (CE-märkt) INFORMATIONsteknikutrustning.
- Utformad för att fungera i följande miljö.
- Driftstemperatur: 50° till 95° F (10° till 35° C)
- Förvaringstemperatur: -4° till 122° F (-20° till 50° C)
- Relativ luftfuktighet: 15% till 85% (noncondensing)
- Höjd över havet vid drift: Testad upp till 6500 fot (0 meter till 2000 meter)
För klassificering av elförsörjning, se enhetens märketikett som medföljer enheten.
 Ikon **MEDDELANDE:**
Ändringar eller ändringar som gjorts på enheten som inte uttryckligen godkänts av Microsoft kan upphäva användarens behörighet att använda enheten.
**KANADA och USA:**
 Ikon **MEDDELANDE:**
Denna utrustning har testats och befunnits uppfylla gränserna för en digital enhet av klass A, i enlighet med del 15 i FCC-reglerna. Dessa gränsvärden är utformade för att ge ett rimligt skydd mot skadliga störningar när utrustningen används i en kommersiell miljö. Denna utrustning genererar, använder och kan utstråla radiofrekvensenergi och kan, om den inte installeras och används i enlighet med bruksanvisningen, orsaka skadliga störningar i radiokommunikationen. Driften av denna utrustning i ett bostadsområde kommer sannolikt att orsaka skadliga störningar i vilket fall användaren kommer att krävas för att korrigera störningen på egen bekostnad.
Den här enheten uppfyller del 15 i FCC:s regler och bransch kanadas licensbefriade RSS-standard.This device complie with part 15 of the FCC Rules and Industry Canada license-exempt RSS standard(s). Användning är föremål för följande två villkor: (1) den här enheten får inte orsaka skadliga störningar, och (2) den här enheten måste acceptera alla mottagna störningar, inklusive störningar som kan orsaka oönskad användning av enheten.

CAN ICES-3(A)/NMB-3(A)
Microsoft Corporation, One Microsoft Way, Redmond, WA 98052, USA.
Förenta staterna: (800) 426-9400
Kanada: (800) 933-4750
**EUROPEISKA UNIONEN:**
[Begär en kopia av EU:s försäkran om överensstämmelse](mailto:[email protected]).
 **VARNING:**
Detta är en klass A-produkt. I en inhemsk miljö kan denna produkt orsaka radiostörningar, i vilket fall användaren kan åläggas att vidta lämpliga åtgärder.
**Bortskaffande av förbrukade batterier och elektrisk och elektronisk utrustning:**

Denna symbol på produkten eller dess batterier eller dess förpackning innebär att denna produkt och eventuella batterier som den innehåller inte får kastas tillsammans med hushållsavfallet. I stället är det ditt ansvar att lämna över detta till en lämplig återvinningsstation för batterier och elektrisk och elektronisk utrustning. Denna separata insamling och återvinning kommer att bidra till att bevara naturresurser och förhindra potentiella negativa konsekvenser för människors hälsa och miljön på grund av eventuell förekomst av farliga ämnen i batterier och elektriska och elektroniska utrustning, som kan orsakas av olämpligt bortskaffande. För mer information om var du kan släppa av dina batterier och elektriskt och elektroniskt avfall, kontakta ditt lokala stads-/kommunkontor, din hushållsavfallstjänst eller butiken där du köpte produkten. Kontakta *erecycle\@microsoft.com* för ytterligare information om WEEE.
Denna produkt innehåller myntcellsbatteri(er).
Microsoft Irland Sandyford Ind Est Dublin D18 KX32 IRL
Telefonnummer: +353 1 295 3826
Faxnummer: +353 1 706 4110
**Japan**

<!--**South Korea**

**China RoHS Hazardous Substances Table**

**Taiwan**
-->
När du har granskat dessa säkerhetsmeddelanden kan du ställa in och kabela enheten.
## <a name="next-steps"></a>Nästa steg
* [Kabel och anslut din Data Box](data-box-deploy-set-up.md)
| 65.162921 | 925 | 0.790154 | swe_Latn | 0.99972 |
5485ee1501474d374f044216ba695dacddb8ca46 | 45 | md | Markdown | ChangeLog.md | stothardj/story | 863ede1d779d9f133761dfc73cf5097954da14c5 | [
"BSD-3-Clause"
] | null | null | null | ChangeLog.md | stothardj/story | 863ede1d779d9f133761dfc73cf5097954da14c5 | [
"BSD-3-Clause"
] | null | null | null | ChangeLog.md | stothardj/story | 863ede1d779d9f133761dfc73cf5097954da14c5 | [
"BSD-3-Clause"
] | null | null | null | # Changelog for story
## Unreleased changes
| 11.25 | 21 | 0.755556 | eng_Latn | 0.99857 |
548666879334b0df3eca6c9ecf377f7e40c472f4 | 867 | md | Markdown | doc/bic.md | botsunit/bank | 52ac2c01157b870a4b6ce15335e44c1637ad8e69 | [
"Unlicense"
] | null | null | null | doc/bic.md | botsunit/bank | 52ac2c01157b870a4b6ce15335e44c1637ad8e69 | [
"Unlicense"
] | null | null | null | doc/bic.md | botsunit/bank | 52ac2c01157b870a4b6ce15335e44c1637ad8e69 | [
"Unlicense"
] | null | null | null |
# Module bic #
* [Description](#description)
* [Function Index](#index)
* [Function Details](#functions)
A simple module for [BIC](http://en.wikipedia.org/wiki/ISO_9362) manipulation.
<a name="index"></a>
## Function Index ##
<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#fake-1">fake/1</a></td><td>
Generate a fake BIC code.</td></tr><tr><td valign="top"><a href="#is_valid-1">is_valid/1</a></td><td>
Validate a BIC code.</td></tr></table>
<a name="functions"></a>
## Function Details ##
<a name="fake-1"></a>
### fake/1 ###
<pre><code>
fake(Country::binary()) -> binary()
</code></pre>
<br />
Generate a fake BIC code
<a name="is_valid-1"></a>
### is_valid/1 ###
<pre><code>
is_valid(BIC::string() | binary()) -> true | false
</code></pre>
<br />
Validate a BIC code
| 18.847826 | 146 | 0.625144 | yue_Hant | 0.278671 |
548808f45b3647e50b5f407313e5bd1b99778317 | 3,312 | md | Markdown | pg-dba/README.md | C2FO/public-charts | 01e07cc38e3c45f33eb0ecfc1ad11f318e8bf736 | [
"MIT"
] | null | null | null | pg-dba/README.md | C2FO/public-charts | 01e07cc38e3c45f33eb0ecfc1ad11f318e8bf736 | [
"MIT"
] | 1 | 2022-02-08T16:14:10.000Z | 2022-02-08T16:14:10.000Z | pg-dba/README.md | C2FO/public-charts | 01e07cc38e3c45f33eb0ecfc1ad11f318e8bf736 | [
"MIT"
] | null | null | null | # pg-dba Helm Chart
- [pg-dba Helm Chart](#pg-dba-Helm-Chart)
- [Chart Details](#Chart-Details)
- [Installing the Chart](#Installing-the-Chart)
- [Configuration](#Configuration)
- [Examples](#Examples)
- [Kick off a 1 time pg-dba job](#Kick-off-a-1-time-pg-dba-job)
- [Running as a kubernetes `CronJob` on a schedule](#Running-as-a-kubernetes-CronJob-on-a-schedule)
## Chart Details
This deploys a kubernetes job that runs [pg-dba](https://github.com/jonstacks/pg-dba)
to help perform common database maintenance.
## Installing the Chart
To install the chart with the release name `my-pg-dba`:
```bash
$ helm install --name my-pg-dba c2fo-public/pg-dba
```
## Configuration
The following table lists the configuration parameters of the pg-dba Chart and their default values.
| Parameter | Description | Default |
| ----------------------- | ---------------------------------------------------------- | --------------------------- |
| `hooks.enabled` | Whether or not to enable helm hooks to clean up the job | false (due to a helm bug) |
| `image.repository` | The image repository to pull from | jonstacks/pg-dba |
| `image.tag` | The image tag to pull | 0.1.0 |
| `image.pullPolicy` | The pull policy for the image | IfNotPresent |
| `postgres.host` | The postgres host to connect to | localhost |
| `postgres.db` | The postgres db to connect to | postgres |
| `postgres.user` | The user to connect to postgres as | postgres |
| `postgres.pass` | The password to use when connecting to postgres | '' |
| `postgres.sslMode` | The SSL Mode to use for postgres(require, disable, etc...) | require |
| `resources` | The resources to give to the pg-dba container | {} |
| `timeouts.analyze` | The timeout in seconds for running an analyze. | `600` |
| `timeouts.vacuum` | The timeout in seconds for running a vacuum. | `600` |
| `timeouts.fullVacuum` | The timeout in seconds for running a full vacuum. | `600` |
## Examples
### Kick off a 1 time pg-dba job
```
helm install --name my-pg-dba c2fo-public/pg-dba \
--set postgres.host=db \
--set postgres.db=mydb \
--set postgres.user=myuser \
--set postgres.pass=mypass \
--set postgres.sslMode=disable \
--set timeouts.analyze=900 \
--set timeouts.vacuum=900 \
--set timeouts.fullVacuum=900
```
## Running as a kubernetes `CronJob` on a schedule
```
helm install --name my-pg-dba c2fo-public/pg-dba \
--set postgres.host=db \
--set postgres.db=mydb \
--set postgres.user=myuser \
--set postgres.pass=mypass \
--set postgres.sslMode=disable \
--set cronJob.enabled=true \
--set cronJob.schedule="0 2 * * 6"
``` | 44.756757 | 118 | 0.523249 | eng_Latn | 0.834213 |
5488eb7336af6afedc2b37aa259532103b1fb5b2 | 5,840 | md | Markdown | website/blog/2022-01-29-v1.6.4-release.md | hextraza/jbrowse-components | e9a69fdac76cc0baac8a6d3c6e8e5c0d96d387d3 | [
"Apache-2.0"
] | null | null | null | website/blog/2022-01-29-v1.6.4-release.md | hextraza/jbrowse-components | e9a69fdac76cc0baac8a6d3c6e8e5c0d96d387d3 | [
"Apache-2.0"
] | null | null | null | website/blog/2022-01-29-v1.6.4-release.md | hextraza/jbrowse-components | e9a69fdac76cc0baac8a6d3c6e8e5c0d96d387d3 | [
"Apache-2.0"
] | null | null | null | ---
title: v1.6.4 Release
date: 2022-01-29 02:44:27
tags: ['release', 'jbrowse 2']
---
This release has a couple long awaited features!
- Ability to load a session from a URL in JBrowse Web, for example,
https://jbrowse.org/code/jb2/v1.6.4/?config=test_data/volvox/config.json&loc=ctgA:2000-40000&assembly=volvox&tracks=gff3tabix_genes,volvox_filtered_vcf,volvox_microarray,volvox_cram
Note: the embedded components do not make any assumptions about the URL, so
do not have this functionality. Just the JBrowse Web package. See [the URL
params API docs](/docs/urlparams) for more info
- Stats estimation, tracks will try to estimate how much data they have to load
and hide themselves if it is determined to be too much
There are also some improvements to synteny and dotplot views. The synteny view
can now render curvy lines and "square" the views (so they each have the same
zoom level), and have individual search panels in the synteny view. You can now
also vertically resize the linear synteny view panel allowing for a taller or
shorter view! The rendering has also been sped up in both linear synteny and
dotplot views with certain code paths being up to 40x faster.
Also check out the recording and notes from our [PAG 2022 tutorial
session](/docs/pag2022_synteny_tutorial)!

Screenshot showing the new curvy lines of the synteny view with the grape vs peach demo http://jbrowse.org/code/jb2/v1.6.4/?config=test_data%2Fconfig_synteny_grape_peach.json&session=share-EdWfJj5aIY&password=S8PGj
note that 1.6.0-1.6.3 were slightly buggy and collected into 1.6.4 here
## Downloads
- [v1.6.4](https://github.com/GMOD/jbrowse-components/releases/tag/v1.6.4)
To install JBrowse 2 for the web, you can download the link above, or you can
use the JBrowse CLI to automatically download the latest version. See the
[JBrowse web quick start](https://jbrowse.org/jb2/docs/quickstart_web) for more
details.
See "Packages in this release" in the changelog for links to packages published
on NPM.
<details><summary>Packages in this release</summary>
<p>
| Package | Download |
| ------------ | ------------------------------------------ |
| @jbrowse/cli | https://www.npmjs.com/package/@jbrowse/cli |
</p>
</details>
#### :rocket: Enhancement
- `core`
- [#2679](https://github.com/GMOD/jbrowse-components/pull/2679) Optimizations and usability improvements to synteny view ([@cmdcolin](https://github.com/cmdcolin))
- [#2677](https://github.com/GMOD/jbrowse-components/pull/2677) Save user settings from LGV ([@cmdcolin](https://github.com/cmdcolin))
- [#2571](https://github.com/GMOD/jbrowse-components/pull/2571) Add stats estimation to JB2 ([@cmdcolin](https://github.com/cmdcolin))
- [#2666](https://github.com/GMOD/jbrowse-components/pull/2666) Add option to display curved lines and to square the dotplot and synteny views ([@cmdcolin](https://github.com/cmdcolin))
- [#2672](https://github.com/GMOD/jbrowse-components/pull/2672) Optimize dot plot rendering ([@cmdcolin](https://github.com/cmdcolin))
- Other
- [#2680](https://github.com/GMOD/jbrowse-components/pull/2680) Improve error handling on jbrowse desktop open sequence dialog ([@cmdcolin](https://github.com/cmdcolin))
- [#2670](https://github.com/GMOD/jbrowse-components/pull/2670) Add mashmap PAF support ([@cmdcolin](https://github.com/cmdcolin))
- [#2659](https://github.com/GMOD/jbrowse-components/pull/2659) Draw size of deletion on reads in alignments track ([@cmdcolin](https://github.com/cmdcolin))
- `__mocks__`, `core`
- [#2165](https://github.com/GMOD/jbrowse-components/pull/2165) Add ability to create new sessions solely from a "session spec" in the URL ([@cmdcolin](https://github.com/cmdcolin))
#### :bug: Bug Fix
- `core`
- [#2688](https://github.com/GMOD/jbrowse-components/pull/2688) Fix adapterType dropdown in add track widget ([@cmdcolin](https://github.com/cmdcolin))
- [#2654](https://github.com/GMOD/jbrowse-components/pull/2654) Fix broken @jbrowse/img by adding babel config back to core ([@cmdcolin](https://github.com/cmdcolin))
- Other
- [#2686](https://github.com/GMOD/jbrowse-components/pull/2686) Use path.resolve to fix --load symlink in jbrowse CLI ([@cmdcolin](https://github.com/cmdcolin))
- [#2660](https://github.com/GMOD/jbrowse-components/pull/2660) Fix custom glyphs to apply to features without subfeatures ([@bbimber](https://github.com/bbimber))
- [#2652](https://github.com/GMOD/jbrowse-components/pull/2652) Fix "module" of embedded React views ([@garrettjstevens](https://github.com/garrettjstevens))
#### :memo: Documentation
- [#2663](https://github.com/GMOD/jbrowse-components/pull/2663) Add documentation for URL params and session spec ([@cmdcolin](https://github.com/cmdcolin))
- [#2655](https://github.com/GMOD/jbrowse-components/pull/2655) Add link to PAG 2022 youtube tutorial on demos page and course archive ([@cmdcolin](https://github.com/cmdcolin))
#### :house: Internal
- `core`
- [#2649](https://github.com/GMOD/jbrowse-components/pull/2649) Add Cypress test of package that uses embedded components ([@garrettjstevens](https://github.com/garrettjstevens))
- [#2648](https://github.com/GMOD/jbrowse-components/pull/2648) Avoid console.warns in tests due to writing to MST nodes that are not alive ([@cmdcolin](https://github.com/cmdcolin))
- Other
- [#2657](https://github.com/GMOD/jbrowse-components/pull/2657) Fix hot reload using yarn resolution on react-error-overlay ([@cmdcolin](https://github.com/cmdcolin))
#### Committers: 3
- Colin Diesh ([@cmdcolin](https://github.com/cmdcolin))
- Garrett Stevens ([@garrettjstevens](https://github.com/garrettjstevens))
- [@bbimber](https://github.com/bbimber)
| 60.206186 | 214 | 0.739555 | eng_Latn | 0.542681 |
548915d809474b878ba3b976510ac847b2d73b78 | 2,200 | md | Markdown | Home/Tutorials/Migrations/Seed-Data.md | Eonasdan/project-wiki-angular-csharp | bc2d6e58f8532c665880e765f6ca4cea3dfeaf94 | [
"MIT"
] | null | null | null | Home/Tutorials/Migrations/Seed-Data.md | Eonasdan/project-wiki-angular-csharp | bc2d6e58f8532c665880e765f6ca4cea3dfeaf94 | [
"MIT"
] | null | null | null | Home/Tutorials/Migrations/Seed-Data.md | Eonasdan/project-wiki-angular-csharp | bc2d6e58f8532c665880e765f6ca4cea3dfeaf94 | [
"MIT"
] | null | null | null | With Entity Framework it is possible to repopulate data in the database. This is very useful for ensuring that a default user for instance is available when deploying or a new developer comes in.
They way we provide this seed data in this project structure also makes it easy to have mock objects for test.
To add new seed data, add a new entry to `SeedData.cs` located in the business project. Please pay close attention to the existing items as an example of how a new entry should look.
Here’s an example of an entry. It must be `public`, `static` and `readonly`. Make sure that the meta columns (created, modified) are setup exactly like the example.
```
public static readonly Code CodeSystemConstant = new Code {
Id = CodeCategories.SystemConstant, CodeDescription = "System Constant",
Data1Description = "", Data2Description = "", Data3Description = "",
CreatedBy = CreatedBy, CreatedDate = CreatedAt, ModifiedBy = CreatedBy,
ModifiedDate = CreatedAt
};
```
Here’s an example of referencing one entry from another. The benefit of doing this is that the referential integrate between parent and child.
```
public static readonly CodeValue CodeValue3 = new CodeValue {
Id = 3, CodeId = CodeSystemConstant.Id, CodeValueKey = SystemConstants.PageCounts,
CodeValueDescription = "Page Counts To Show", Data1 = "25", Data2 = "",
Data3 = "", SequenceNumber = 1, CreatedBy = CreatedBy,
CreatedDate = CreatedAt, ModifiedBy = CreatedBy, ModifiedDate = CreatedAt
};
```
To get your new entries in the database, you will need to add the entries to the Db Context. Go to `ApplicationDbContext` located in the DAL project. Look for `OnModelCreating`, you will need to add your `SeedData.*` to either an existing `modelbuilder*.HasData` or add a new section matching the `<EntityType>`
```
modelBuilder.Entity<Code>().HasData(
SeedData.CodeSystemConstant,
…
SeedData.ProfileStatus,
[YOUR ITEM GOES HERE]
);
```
Once this is done, you will need to [add a new migration](/Home/Tutorials/Migrations/Adding-a-migration). Because we have added the new seed data to the model builder, the migration will automatically have the `InsertData` and `DeleteData`
| 56.410256 | 311 | 0.751818 | eng_Latn | 0.971896 |
54895db36d9c1f3e662424e9e04c4a777cea1280 | 295 | md | Markdown | _talks/2019-06-20-IBA.md | agporto/agporto.github.io | 00e29ba887edb0c2e13fae0b2684804820ddc093 | [
"MIT"
] | null | null | null | _talks/2019-06-20-IBA.md | agporto/agporto.github.io | 00e29ba887edb0c2e13fae0b2684804820ddc093 | [
"MIT"
] | null | null | null | _talks/2019-06-20-IBA.md | agporto/agporto.github.io | 00e29ba887edb0c2e13fae0b2684804820ddc093 | [
"MIT"
] | null | null | null | ---
title: "Morphological evolution of a single lineage through 2 million years: a study on _Steginoporella magnifica_"
collection: talks
type: "Contributed talk"
permalink: /talks/2019-06-20-IBA
venue: "Technical University of Liberec"
date: 2019-06-20
location: "Liberec, Czech Republic"
---
| 26.818182 | 115 | 0.772881 | eng_Latn | 0.726736 |
548a86849892f1e40fc82b68029879d4b4a28d28 | 92 | md | Markdown | README.md | MuthuSubramanium/kotlin-mvvm-coroutines-koin-master | 0aafe7300159992394f59ef89a00b64c6bd6118c | [
"Apache-2.0"
] | 16 | 2018-10-24T06:15:54.000Z | 2021-02-03T00:17:21.000Z | README.md | MuthuSubramanium/kotlin-mvvm-coroutines-koin-master | 0aafe7300159992394f59ef89a00b64c6bd6118c | [
"Apache-2.0"
] | 4 | 2019-05-07T12:13:09.000Z | 2019-05-07T14:18:09.000Z | README.md | MuthuSubramanium/kotlin-mvvm-coroutines-koin-master | 0aafe7300159992394f59ef89a00b64c6bd6118c | [
"Apache-2.0"
] | 4 | 2019-02-09T05:17:33.000Z | 2020-06-09T03:05:06.000Z | # kotlin-mvvm-coroutines-koin
Android architecture using Kotlin, MVVM, Coroutines and Koin.
| 30.666667 | 61 | 0.815217 | eng_Latn | 0.688181 |
548ac2bc7aeaa5e22912478ed4a0f2bead9a3bd1 | 39,556 | md | Markdown | README.md | RoboticVisionOrg/benchbot_addons | ced6da23286c248ad5131f1fe166b6227997ab59 | [
"BSD-3-Clause"
] | null | null | null | README.md | RoboticVisionOrg/benchbot_addons | ced6da23286c248ad5131f1fe166b6227997ab59 | [
"BSD-3-Clause"
] | 1 | 2022-03-16T06:35:52.000Z | 2022-03-16T06:35:52.000Z | README.md | qcr/benchbot_addons | ced6da23286c248ad5131f1fe166b6227997ab59 | [
"BSD-3-Clause"
] | null | null | null | **NOTE: this software is part of the BenchBot software stack, and not intended to be run in isolation (although it can be installed independently through pip if desired). For a working BenchBot system, please install the BenchBot software stack by following the instructions [here](https://github.com/qcr/benchbot).**
# BenchBot Add-ons Manager
[](http://benchbot.org)
[](https://qcr.github.io)

[](./LICENSE.txt)

The BenchBot Add-ons Manager allows you to use BenchBot with a wide array of additional content, and customise your installation to suite your needs. Semantic Scene Understanding not your thing? Install the Semantic Question Answering add-ons instead. Want to create your own content? Write some basic YAML files to make your own add-ons. Need to re-use existing content? Simply include a dependency on that add-on. Add-ons are all about making BenchBot whatever you need it to be—build a BenchBot for your research problems, exactly as you need it.
Add-ons come in a variety of types. Anything that you may need to customise for your own experiments or research, should be customisable through an add-on. If not, let us know, and we'll add more add-on enabled functionality to BenchBot!
The list of currently supported types of add-ons are:
- **batches**: a list of environments used for repeatable evaluation scores with the `benchbot_batch` script.
- **environments**: simulated or real world environments that a task can be performed in, with a robot. Only [Isaac Sim](https://developer.nvidia.com/Isaac-sim) simulation is currently supported, but there is capacity to support other simulators. Please get in contact if you'd like to see another simulator in BenchBot!
- **evaluation_methods**: a method for evaluating a set of formatted results, against a corresponding ground truth, and producing scores describing how well a result performed a given task.
- **formats**: formalisation of a format for results or ground truth data, including helper functions.
- **ground_truths**: ground truth data in a declared format, about a specific environment. Environments can have many different types of ground truths depending on what different tasks require.
- **robots**: a robot definition declaring the communication channels available to the BenchBot ecosystem. Both simulated and real world robots are supported, they just need to run ROS.
- **tasks**: a task is a definition of something we want a robot to do, including what observations and actions it has available, and how results should be reported.
See the sections below for details of how to interact with installed add-ons, how to create your own add-ons, and formalisation of what's required in an add-on.
## Installing and using the add-ons manager
In general, you won't use the add-ons manager directly. Instead you interact with the [BenchBot software stack](https://github.com/qcr/benchbot), which uses the add-ons manager to manage and access add-ons.
The manager is a Python package if you do find you want to use it directly, and installable with pip. Run the following in the root directory where the repository was cloned:
```
u@pc:~$ pip install .
```
The manager can then be imported and used to manage installation, loading, accessing, processing, and updating of add-ons. Some samples of supported functionality are shown below:
```python
from benchbot_addons import manager as bam
# Check if example with 'name' = 'hello_scd' exists
bam.exists('examples', [('name', 'hello_scd')])
# Find all installed environments
bam.find_all('environments')
# Get a list of the names for all installed tasks
bam.get_field('tasks', 'name')
# Get a list of (name, variant) pairs for all installed environments
bam.get_fields('environments', ['name', 'variant'])
# Find a robot with 'name' = 'carter'
bam.get_match('robots', [('name', 'carter')])
# Get the 'results_format' value for the task called 'scd:passive:ground_truth'
bam.get_value_by_name('tasks', 'scd:passive:ground_truth', 'results_format')
# Load YAML data for all installed ground truths
bam.load_yaml_list(bam.find_all('ground_truths', extension='json'))
# Install a list of comma-separated add-ons
bam.install_addons('benchbot-addons/ssu,benchbot-addons/sqa')
# Install a specific add-on (& it's dependencies)
bam.install_addon('tasks_ssu')
# Print the list of currently installed add-ons, & officially available add-ons
bam.print_state()
# Uninstall all add-ons
bam.remove_addons()
# Uninstall a string separated list of add-ons
bam.remove_addon('benchbot-addons/ssu,benchbot-addons/sqa')
```
## Creating your own add-on content
Add-ons are designed to make it easy to add your own local content to a BenchBot installation. You can add your own local content to the "local add-ons" folder provided with your install. The location on your machine can be printed via the following:
```python
from benchbot_addons import manager as bam
print(bam.local_addon_path())
```
BenchBot expects add-on content to be in named folders denoting the type of content. For example, robots must be in a folder called `'robots'`, tasks in a folder called `'tasks'`, and so on. A list of valid content types is available via the `SUPPORTED_TYPES` field in the add-ons manager.
Below is an example of the process you would go through to create your own custom task locally:
1. Find the location for your custom local add-ons:
```
u@pc:~$ python3 -c 'from benchbot_addons import manager as bam; print(bam.local_addon_path())'
/home/ben/repos/benchbot/addons/benchbot_addons/.local/my_addons
```
2. Create the following YAML file for your task: `/home/ben/repos/benchbot/addons/benchbot_addons/.local/my_addons/tasks/my_task.yaml`
3. Use the fields described below in the [task add-ons specification](#task-add-ons) to define your task
4. Save the file
Done. Your new custom task should now be available for use in your BenchBot system (e.g. [`benchbot_run --list-tasks`](https://github.com/qcr/benchbot)).
## Sharing your custom add-ons
Custom add-on content can be grouped together into an add-on package, of which there are two different types: 'official' and third-party.
'Official' packages are those we've verified, and are stored in our [benchbot-addons](https://github.com/benchbot-addons) GitHub organisation. You can get a full list of official add-on packages through the `manager.official_addons()` helper function, or `benchbot_install --list-addons` script in the [BenchBot software stack](https://github.com/qcr/benchbot).
Third-party add-on packages differ only in that we haven't looked at them, and they can be hosted anywhere on GitHub you please.
Creating all add-on packages is exactly the same process, the only difference is whether the repository is inside or outside of the [benchbot-addons](https://github.com/benchbot-addons) GitHub organisation:
1. Create a new GitHub repository
2. Add folders corresponding to the type of content your add-ons provide (i.e. an environments add-on has an `environments` directory at the root).
3. Add YAML / JSON files for your content, and make sure they match the corresponding format specification from the section below
4. Add in any extra content your add-on may require: Python files, simulator binaries, images, etc. (if your add-on gets too big for a Git repository, you can zip the content up, host it somewhere, and use the `.remote` metadata file described in the next section)
5. Decide if your package has any dependencies, and declare them using the appropriate `.dependencies*` files
6. Push everything up to GitHub on your default branch
_**Note:** it's a good idea to only include one type of add-on per repository as it makes your add-on package more usable for others. It's not a hard rule though, so feel free to add multiple folders to your add-on if you require._
Feel free to have a look at any of the [official add-ons](https://github.com/benchbot-addons) for help and examples of how to work with add-ons.
## Add-ons format specification
Here are the technical details of what's expected in add-on content. The BenchBot system will assume these specifications are adhered to, and errors can be expected if you try to use add-ons that don't match the specifications.
An add-on package has the following structure (technically none of the files are required, they just determine what functionality your add-on includes):
| Filename | Description |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `.dependencies` | A list of add-on packages that must be installed with this package. Packages are specified by their GitHub identifier (i.e. `github_username/repository_name`), with one per line |
| `.dependencies-python` | A list of Python dependencies for your add-on. Syntax for file is exactly the same as [`requirements.txt`](https://pip.pypa.io/en/stable/user_guide/#requirements-files) files. |
| `.remote` | Specifies content that should be installed from a remote URL, rather than residing in this repository. A remote resource is specified as a URL and target directory separated by a space. One resource is specified per line. The add-ons manager will fetch the URL specified, and extract the contents to the target directory (e.g. `http://myhost/my_content.zip environments`) |
| `<directory>/` | Each named directory corresponds to an add-on type described below. The directory will be ignored if its name doesn't exactly match any of those below. |
### Batch add-ons
A YAML file, that must exist in a folder called `batches` in the root of the add-on package (e.g. `batches/my_batch.yaml`).
The following keys are supported for batch add-ons:
| Key | Required | Description |
| ---------------- | -------- | ------------------------------------------------------------------------------------- |
| `'name'` | Yes | A string used to refer to this batch (must be unique!). |
| `'environments'` | Yes | A list of environment strings of the format `'name':'variant'` (e.g. `'miniroom:1'`). |
### Environment add-ons
A YAML file, that must exist in a folder called `environments` in the root of the add-on package (e.g. `environments/my_environment.yaml`).
The following keys are supported for environment add-ons:
| Key | Required | Description |
| -------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `'name'` | Yes | A string used to refer to this environment's name (the `('name', 'variant')` pair must be unique!). |
| `'variant'` | Yes | A string used to refer to this environment's variant (the `('name', 'variant')` pair must be unique!). |
| `'type'` | Yes | A string describing the type of this environment (`'sim_unreal'` & `'real'` are the only values currently used). |
| `'map_path'` | Yes | A path to the map for this environment, which will be used by either the simulator or real world system to load the environment. |
| `'start_pose'` | Yes | The start pose of the robot that will be provided to users through the [BenchBot API](https://github.com/qcr/benchbot_api). The pose is specified as a list of 7 numbers: quarternion_x, quarternion_y, quarternion_z, quarternion_w, position_x, position_y, position_z. This must be accurate! |
| `'trajectory_poses'` | No | A list of poses for the robot to traverse through in order. Each pose is a list of 7 numbers: quarternion_x, quarternion_y, quarternion_z, quarternion_w, position_x, position_y, position_z. This environment won't be usable for tasks that use the `'move_next'` action if this parameter isn't provided. |
| `'robots'` | No | A list of supported names for robot that are supported in this environment. If this list isn't included, all robots with the same `'type'` as this environment will be able to run. |
| `'object_labels'` | No | A list of labels for the objects that exist in the scene. Can be used with simulated sensors like segmentation sensors. |
### Evaluation method add-ons
A YAML file, that must exist in a folder called `evaluation_methods` in the root of the add-on package (e.g. `evaluation_methods/my_evaluation_method.yaml`).
The following keys are supported for evaluation method add-ons:
| Key | Required | Description |
| ------------------------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `'name'` | Yes | A string used to refer to this evaluation method (must be unique!) |
| `'valid_result_formats'` | Yes | List of strings denoting results formats supported by the evaluation method. Ideally these format definitions should also be installed. |
| `'valid_ground_truth_formats'` | Yes | List of strings denoting ground truth formats supported by the evaluation method. Ideally these format definitions should also be installed. |
| `'functions'` | Yes | Dictionary of named functions provided by the evaluation method. The named methods are key value pairs where the key is the function name, and the value is a string describing how the function can be imported with Python. For example, `evaluate: "omq.evaluate_method"` declares a function called `'evaluate'` that is imported via `from omq import evaluate_method`. Likewise `"omq.submodule.combine_method"` translates to `from omq.submodule import combine_method`. See below for the list of functions expected for evaluation methods. |
| `'description'` | No | A string describing what the evaluation method is and how it works. Should be included if you want users to understand where your method can be used. |
Evaluation methods expect the following named functions:
| Name | Signature | Usage |
| ------------ | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `'evaluate'` | `fn(dict: results, list: ground_truths) -> dict` | Evaluates the performance using a `results` dictionary, and returns a dictionary of containing the scores. It also takes a list of dictionaries containing each ground truth that will be used in evaluation. |
| `'combine'` | `fn(list: scores) -> dict` | Takes a list of `scores` dictionaries, and returns an aggregate score. If this method isn't declared, [`benchbot_eval`](https://github.com/qcr/benchbot_eval) won't return a summary score. |
### Example method add-ons
A YAML file, that must in a folder called `examples` in the root of the add-on package (e.g. `examples/my_example.yaml`).
The following keys are supported for example add-ons:
| Key | Required | Description |
| --------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name` | Yes | A string used to refer to this example (must be unique!) |
| `native_command` | Yes | A string describing the command used to run your example natively, relative to the directory of this YAML file! For example running your `my_example.py` file which is in the same director as this YAML would be `python3 ./my_example.py`. |
| `container_directory` | No | Directory to be used for Docker's build context. The submission process will automatically look for a file called `Dockerfile` in that directory unless the `'container_filename'` key is also provided. |
| `container_filename` | No | Custom filename for your example's Dockerfile. `Dockerfile` in `container_directory` will be used if this key is not included. This path is relative to this YAML file, **not** `'container_directory'`. |
| `description` | No | A string describing what the example is and how it works. Should be included if you want users to understand how your example can be expanded. |
### Format definition add-ons
A YAML file, that must exist in a folder called `formats` in the root of the add-on package (e.g. `formats/my_format.yaml`).
The following keys are supported for format add-ons:
| Key | Required | Description |
| --------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `'name'` | Yes | A string used to refer to this format (must be unique!) |
| `'functions'` | Yes | Dictionary of named functions for use with this format. The named methods are key-value pairs where the key is the function name, and the value is a string describing how the function can be imported with Python. For example, `create: "object_map.create_empty"` declares a function called `'create'` that is imported via `from object_map import create_empty`. Likewise `"object_map.submodule.validate"` translates to `from object_map.submodule import validate`. See below for the list of functions expected for format definitions. |
| `'description'` | No | A string describing what the format is and how it works. Should be included if you want users to understand what your format is supposed to capture. |
Format definitions expect the following named functions:
| Name | Signature | Usage |
| ------------ | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `'create'` | `fn() -> dict` | Function that returns an empty instance of this format. As much as possible should be filled in to make it easy for users to create valid instances (especially when a format is used for results). |
| `'validate'` | `fn(dict: instance) -> None` | Takes a proposed `instance` of this format and validates whether it meets the requirements. Will typically use a series of assert statements to confirm fields are valid. |
### Ground truth add-ons
A JSON file, that must exist in a folder called `ground_truths` in the root of the add-on package (e.g. `ground_truths/my_ground_truth.json`).
The following keys are supported for ground truth add-ons:
| Key | Required | Description |
| ---------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `'environment'` | Yes | A dictionary containing the definition data for the ground truth's reference environment. The data in this field should be a direct copy of an environment add-on. |
| `'format'` | Yes | A dictionary containing the definition data for the ground truth's format. The data in this field should be a direct copy of a format definition add-on. |
| `'ground_truth'` | Yes | A valid instance of the format described by the `'format'` field. This is where your actual ground truth data should be stored. |
A lot of these keys should be copied from other valid definitions. Please see the `GroundTruthCreator` helper class in [BenchBot Evaluation](https://github.com/qcr/benchbot_eval) for assistance in creating valid ground truths.
### Robot add-ons
A YAML file, that must exist in a folder called `robots` in the root of the add-on package (e.g. `robots/my_robot.yaml`).
The following keys are supported for robot add-ons:
| Key | Required | Description |
| ---------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `'name'` | Yes | A string used to refer to this robot (must be unique!). |
| `'type'` | Yes | A string describing the type of this robot (`'sim_unreal'` & `'real'` are the only values currently used). |
| `'address'` | Yes | A string for the address where a running [BenchBot Robot Controller](https://github.com/qcr/benchbot_robot_controller) can be accessed (e.g. `'localhost:10000'`) |
| `'global_frame'` | Yes | The name of the global TF frame. All poses reported by the [BenchBot API](https://github.com/qcr/benchbot_api) will be with respect to this frame. |
| `'robot_frame'` | Yes | The name of the robot's TF frame. |
| `'poses'` | Yes | A list of named poses that this robot provides. This list of poses will be available in observations provided by the [BenchBot API](https://github.com/qcr/benchbot_api). |
| `'start_cmds'` | Yes | A list of commands describing how to start the robot (this will often include the simulator). The commands will be run in parallel, and executed via `bash -c '<your_command_string>'` |
| `'connections'` | Yes | A dictionary of connections that your robot makes available to the BenchBot ecosystem. The name of the key-value pair is important, and should follow the recommendations provided on standard channels in the [BenchBot API documentation](https://github.com/qcr/benchbot_api). A description of connection definitions is provided below. |
Connections are the lifeblood of interaction between BenchBot and robot platforms. They are defined by named entries, with the following fields:
| Key | Required | Description |
| ---------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `'connection'` | Yes | Connection type string, used by the [BenchBot Robot Controller](https://github.com/qcr/benchbot_robot_controller). Supported values are `'api_to_ros'` (used for actions), `'ros_to_api'` (used for observations), and `'roscache_to_api'` (special value used for caching observation values). |
| `'ros_topic'` | Yes | Topic name for the ROS side of the connection. |
| `'ros_type'` | Yes | Topic type for the ROS side of the connection. |
| `'callback_api'` | No | A callback that is run on the HTTP encoded data received / sent on the API end of the connection. It takes in data, and returns transformed data based on the callback's action. Callbacks are specified by a string denoting how the callback can be accessed (e.g. `'api_callbacks.convert_to_rgb` = `from api_callbacks import convert_to_rgb`). No data transformation occurs if no callback is provided. |
| `'callback_ros'` | No | A callback that is run on the ROS data received / sent on the robot controller end of the connection. It takes in data and a reference to the robot controller. `'api_to_ros'` connections use this data to act on the robot, whereas `'ros_to_api'` connections turn this data into a dictionary that can be serialised into HTTP traffic. Callbacks are specified by a string denoting how the callback can be accessed (e.g. `'api_callbacks.convert_to_rgb` = `from api_callbacks import convert_to_rgb`). No action occurs at the ROS level if no callback is provided. |
### Task add-ons
A YAML file, that must exist in a folder called `tasks` in the root of the add-on package (e.g. `tasks/my_task.yaml`).
The following keys are supported for task add-ons:
| Key | Required | Description |
| ------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `'name'` | Yes | A string used to refer to this task (must be unique!). |
| `'actions'` | Yes | A list of named connections to be provided as actions through the [BenchBot API](https://github.com/qcr/benchbot_api). Running this task will fail if the robot doesn't provide these named connections. |
| `'observations'` | Yes | A list of named connections to be provided as observations through the [BenchBot API](https://github.com/qcr/benchbot_api). Running this task will fail if the robot doesn't provide these named connections. |
| `'localisation'` | No | A string describing the level of localisation. Only supported values currently are `'ground_truth'` and `'noisy'`. The default value is '`ground_truth`'. |
| `'results_format'` | No | A string naming the format for results. The format must be installed, as [BenchBot API](https://github.com/qcr/benchbot_api) will use the format's functions to provide the user with empty results. |
| `'description'` | No | A string describing what the task is, and how it works. Should be included if you want users to understand what challenges your task is trying to capture. |
| `'type'` | No | A string describing what robot / environment types are valid for this task. For example, a task that provides a magic image segmentation sensor would only be made available for `'sim_unreal'` type robots / environments. |
| `'scene_count'` | No | Integer representing the number of scenes (i.e. environment variations required for a task). If omitted, a default value of 1 will be used for the task. |
| 142.28777 | 590 | 0.441779 | eng_Latn | 0.993455 |
548acb44376cdd5ca42e3ffcd2b7e916a427ce1f | 1,680 | md | Markdown | docs/config-examples/spotify.md | waweru-kamau/react-native-app-auth | d26df44e9136a007cba7ea4a8b1a6375dff7f782 | [
"MIT"
] | 1,443 | 2017-11-23T16:37:34.000Z | 2022-03-29T14:21:56.000Z | docs/config-examples/spotify.md | waweru-kamau/react-native-app-auth | d26df44e9136a007cba7ea4a8b1a6375dff7f782 | [
"MIT"
] | 597 | 2017-11-24T17:23:48.000Z | 2022-03-31T23:09:57.000Z | docs/config-examples/spotify.md | waweru-kamau/react-native-app-auth | d26df44e9136a007cba7ea4a8b1a6375dff7f782 | [
"MIT"
] | 407 | 2017-12-26T15:52:04.000Z | 2022-03-23T10:43:09.000Z | # Spotify
If you don't already have a spotify app, create it [here](https://developer.spotify.com/dashboard/applications).
Open your app, go to settings and add a redirect uri, e.g. `com.myapp:/oauth`.
Note: iOS redirect on Spotify only works with one `/`.s
```js
const config = {
clientId: '<client_id>', // available on the app page
clientSecret: '<client_secret>', // click "show client secret" to see this
redirectUrl: 'com.myapp:/oauth', // the redirect you defined after creating the app
scopes: ['user-read-email', 'playlist-modify-public', 'user-read-private'], // the scopes you need to access
serviceConfiguration: {
authorizationEndpoint: 'https://accounts.spotify.com/authorize',
tokenEndpoint: 'https://accounts.spotify.com/api/token',
},
};
const authState = await authorize(config);
```
## Managing Client Secrets
In order to avoid storing the `clientSecret` in the client, Spotify has published a token exchange package that can be used to move this step to the backend:
https://github.com/bih/spotify-token-swap-service
The tokenEndpoint should then point to whereever you are hosting this server, and be sure to remove the secret from your app:
```js
const config = {
clientId: '<client_id>', // available on the app page
redirectUrl: 'com.myapp:/oauth', // the redirect you defined after creating the app
scopes: ['user-read-email', 'playlist-modify-public', 'user-read-private'], // the scopes you need to access
serviceConfiguration: {
authorizationEndpoint: 'https://accounts.spotify.com/authorize',
tokenEndpoint: 'https://my-token-service/api/token',
},
};
const authState = await authorize(config);
```
| 35.744681 | 158 | 0.72619 | eng_Latn | 0.96462 |
548c123647edc0099171bef7e6e76b4e06eb3c71 | 1,656 | md | Markdown | README.md | tomimick/chrome-ext-page-size | fbcca7f9b3bfd8576850075317e229e05a3e5458 | [
"MIT"
] | 29 | 2016-10-24T11:24:42.000Z | 2022-01-18T02:45:50.000Z | README.md | tomimick/chrome-ext-page-size | fbcca7f9b3bfd8576850075317e229e05a3e5458 | [
"MIT"
] | 2 | 2017-04-26T17:15:20.000Z | 2021-04-27T16:37:34.000Z | README.md | tomimick/chrome-ext-page-size | fbcca7f9b3bfd8576850075317e229e05a3e5458 | [
"MIT"
] | 4 | 2017-07-03T11:25:20.000Z | 2020-12-09T15:21:29.000Z |
Page Size Inspector
===================
Page Size Inspector is a Chrome extension that reports page size, cache usage,
network requests, load time in a convenient way.
Install from [Chrome Store](https://chrome.google.com/webstore/detail/oepnndnpjiahgkljgbohnnccmokgcoln)

Architecture
------------
- Vanilla JS, no jQuery or other libs being used. (This is Chrome only, after
all.)
- Tiny and fast [monkberry](http://monkberry.js.org) UI virtual DOM lib used for templating.
- Uses the [chrome.debugger API](https://developer.chrome.com/extensions/debugger) to collect request data, as [chrome.webRequest](https://developer.chrome.com/extensions/webRequest) was inadequate. And chrome.debugger is the only API with solid "Disable cache" logic.
- Does not consume any resources while inactive.
Build steps
-----------
A home made simple python make script takes care of 3 tasks.
To make a release, a zip package containing necessary files:
python make.py release
To compile Monkberry templates: (first install Monkberry compiler with
"npm install monkberry -g")
python make.py compile
To test the popup locally with test data:
python make.py www
Other extensions
----------------
I have developed also two other open-source Chrome extensions
[Quick source viewer](https://github.com/tomimick/chrome-ext-view-src) and
[Save CSS](https://github.com/tomimick/chrome-ext-save-css).
Feedback
--------
Send feedback to author [Tomi Mickelsson](mailto:[email protected]).
Enter praise in the [Chrome Store](https://chrome.google.com/webstore/detail/oepnndnpjiahgkljgbohnnccmokgcoln) :)
| 29.571429 | 268 | 0.745169 | eng_Latn | 0.790401 |
548ccd66f57cef690de5ef6044d5ddf9ad98b3ca | 4,015 | md | Markdown | _posts/2018-12-13-Download-a-tommy-at-ypres.md | Jobby-Kjhy/27 | ea48bae2a083b6de2c3f665443f18b1c8f241440 | [
"MIT"
] | null | null | null | _posts/2018-12-13-Download-a-tommy-at-ypres.md | Jobby-Kjhy/27 | ea48bae2a083b6de2c3f665443f18b1c8f241440 | [
"MIT"
] | null | null | null | _posts/2018-12-13-Download-a-tommy-at-ypres.md | Jobby-Kjhy/27 | ea48bae2a083b6de2c3f665443f18b1c8f241440 | [
"MIT"
] | null | null | null | ---
layout: post
comments: true
categories: Other
---
## Download A tommy at ypres book
No part of this publication may be parades, which is maybe pretty "He drinks because he drinks," she a tommy at ypres, I always thought he was mentally unbalanced. Curious, and Padawski had nursed a personal grudge ever since. "Think what?" She stopped moving. " nests! a tommy at ypres the evening in conversation, a similar direction, holes," Angel agreed, modified for police use. " health was utterly to ignore the negative, the troops (104) sallied forth of Baghdad and went out to meet those of El Abbas, not the clean-cut ordinary citizens whom they appear three reindeer skins to rest upon--these are the whole steamer of a smaller size, Merrick always seemed to have been designed along the lines of a medieval Gothic cathedral. Then she took leave of her and flew away; and all the birds took flight with her, they seed the planet with the spores and. She was lying there with blood all over? Yermak _jinrikisha_ over Usui-toge pleasant in a high degree. "Well. graduate college, by Agnes's count: an age when a tommy at ypres a precocious child usually spoke three or four at most, so we can eat on the road, screamed in frustration, but they're going to be outside and stopping your getting in until you've done it, the case has been quite different--as is sufficiently cop had no choice, not too theatrically- "She performed at a club called Planet Pussycat, 437; ii, 'O my ladies, important both in a purely geographical as well as a sixty-track stim by RobCal English translation Copyright В 1980 by Stanislaw Lem Barty looked at Angel. The sister had vanished, through a boundless egoism, 339. It included several restaurants; three bars, a tommy at ypres young mutant "I a tommy at ypres thought of it that way," Crawford admitted. " mother?" around and a tommy at ypres prove ferociously psychotic, just unnerving, Zimm) had settled. "Iвll follow you a tommy at ypres long as you keep leading," States. " Gabby glances at the road ahead, soft though charged with power, this behemoth is a daunting machine, a charcoal burner from Firn, "what am I going to do?" He moved out into the clearing. "My father remarried last month. He specialized in electronic rubbing the coin between the thumb and forefinger of his right hand, not all-seeing and all-knowing. The ice was nothing to go on but the stories other people tell us. Lawrence Island , a tommy at ypres for Hort Town," and With Barty's presence, a knowledge of the types and the other was in jail. The men drop into the than you did with what you said a few minutes ago. did not stir. " Sirocco snorted, to make her appearance; but saw her not. " "Since. He bursts into the open and explodes past Preston, January 7. Guilt had been his soul's salvation? No family photos, but she didn't grow as still as she had been previously. "Your Perri would want you to Billings, i? Neither talks, although additional members of this inbred clan might be lurking He followed an alleyway to the building's service entrance. The crews of the four boats had more probably been STRANGELY, is this fine young fella the Jay you were telling me about?" Hanlon asked, and who would have expected it of a rich man, passed through an instrumentation bay. The three ship-carpenters consisted of a half-meter set of eight blades that turned freely on teflon bearings. "[161] They found, he told himself, i. We did not see any beggars in our journey into the interior (the present Spitzbergen), to see his knowledge and competence slowly flower under her care. " 38. A tommy at ypres fin-like feet [Footnote 211: As specimens of the sub-fossil mollusc fauna of the He smiled at her. Her thin cold plaints melted into a moan of abject misery, anyhow, no minute checks. , by miles of rough experience Tom Vanadium set out to kill a man. But you've got to know what one forms the watershed on Yalmal between the rivers running west and rested. I indicate every power leak, iii. | 446.111111 | 3,925 | 0.781818 | eng_Latn | 0.999921 |
548e0db6107079e60f4bf0cab45ae5642debb8cf | 1,670 | md | Markdown | docs/code-quality/c6200.md | evanwindom/visualstudio-docs | 1470eb0a54bd870650b72adb625a6a0d488f620e | [
"CC-BY-4.0",
"MIT"
] | 1 | 2017-08-15T16:18:32.000Z | 2017-08-15T16:18:32.000Z | docs/code-quality/c6200.md | evanwindom/visualstudio-docs | 1470eb0a54bd870650b72adb625a6a0d488f620e | [
"CC-BY-4.0",
"MIT"
] | null | null | null | docs/code-quality/c6200.md | evanwindom/visualstudio-docs | 1470eb0a54bd870650b72adb625a6a0d488f620e | [
"CC-BY-4.0",
"MIT"
] | null | null | null | ---
title: "C6200 | Microsoft Docs"
ms.custom: ""
ms.date: "11/04/2016"
ms.reviewer: ""
ms.suite: ""
ms.technology:
- "vs-devops-test"
ms.tgt_pltfrm: ""
ms.topic: "article"
f1_keywords:
- "C6200"
helpviewer_keywords:
- "C6200"
ms.assetid: bbeb159b-4e97-4317-9a07-bb83cd03069a
caps.latest.revision: 16
author: "corob-msft"
ms.author: "corob"
manager: "ghogen"
translation.priority.ht:
- "cs-cz"
- "de-de"
- "es-es"
- "fr-fr"
- "it-it"
- "ja-jp"
- "ko-kr"
- "pl-pl"
- "pt-br"
- "ru-ru"
- "tr-tr"
- "zh-cn"
- "zh-tw"
---
# C6200
warning C6200: index \<name> is out of valid index range \<min> to \<max> for non-stack buffer \<variable>
This warning indicates that an integer offset into the specified array exceeds the maximum bounds of that array. This defect might cause random behavior or crashes.
One common cause of this defect is using the size of an array as an index into the array. Because C/C++ array indexing is zero-based, the maximum legal index into an array is one less than the number of array elements.
## Example
The following code generates this warning because the `for` loop exceeds the index range:
```
int buff[14]; // array of 0..13 elements
void f()
{
for (int i=0; i<=14;i++) // i exceeds the index
{
buff[i]= 0; // warning C6200
// code...
}
}
```
To correct both warnings, use correct array size as shown in the following code:
```
int buff[14]; // array of 0..13 elements
void f()
{
for ( int i=0; i < 14; i++) // loop stops when i < 14
{
buff[i]= 0; // initialize buffer
// code...
}
}
``` | 23.857143 | 221 | 0.616168 | eng_Latn | 0.966549 |
548fb5592259adabc730891bb4938195e041fa85 | 1,575 | md | Markdown | articles/container-instances/container-instances-quotas.md | changeworld/azure-docs.tr-tr | a6c8b9b00fe259a254abfb8f11ade124cd233fcb | [
"CC-BY-4.0",
"MIT"
] | null | null | null | articles/container-instances/container-instances-quotas.md | changeworld/azure-docs.tr-tr | a6c8b9b00fe259a254abfb8f11ade124cd233fcb | [
"CC-BY-4.0",
"MIT"
] | null | null | null | articles/container-instances/container-instances-quotas.md | changeworld/azure-docs.tr-tr | a6c8b9b00fe259a254abfb8f11ade124cd233fcb | [
"CC-BY-4.0",
"MIT"
] | null | null | null | ---
title: Hizmet kotaları ve bölge kullanılabilirliği
description: Azure Kapsayıcı Örnekleri hizmetinin kotaları, sınırları ve bölge kullanılabilirliği.
ms.topic: article
ms.date: 03/01/2019
ms.openlocfilehash: b3e7f2f67d806bd2fca74f58d446b0de9a4b8f44
ms.sourcegitcommit: 2ec4b3d0bad7dc0071400c2a2264399e4fe34897
ms.translationtype: MT
ms.contentlocale: tr-TR
ms.lasthandoff: 03/27/2020
ms.locfileid: "77117894"
---
# <a name="quotas-and-limits-for-azure-container-instances"></a>Azure Kapsayıcı Örnekleri için kotalar ve sınırlar
Tüm Azure hizmetleri, kaynak ve özelliklere yönelik bazı varsayılan limitler ve kotalar içerir. Bu makalede, Azure Kapsayıcı Örnekleri için varsayılan kotalar ve sınırlar ayrıntılı olarak açıklanmaktadır.
Azure Kapsayıcı Örnekleri için işlem, bellek ve depolama kaynaklarının kullanılabilirliği bölgeye ve işletim sistemine göre değişir. Ayrıntılar için Azure [Kapsayıcı Örnekleri için Kaynak kullanılabilirliği'ne](container-instances-region-availability.md)bakın.
## <a name="service-quotas-and-limits"></a>Hizmet kotaları ve limitleri
[!INCLUDE [container-instances-limits](../../includes/container-instances-limits.md)]
## <a name="next-steps"></a>Sonraki adımlar
Bazı varsayılan limitler ve kotalar artırılabilir. Artırmayı destekleyen bir veya daha fazla kaynak için artış istemek üzere lütfen bir [Azure destek isteği][azure-support] gönderin (**Sorun türü** olarak "Kota" öğesini seçin).
<!-- LINKS - External -->
[azure-support]: https://ms.portal.azure.com/#blade/Microsoft_Azure_Support/HelpAndSupportBlade/newsupportrequest
| 54.310345 | 260 | 0.813968 | tur_Latn | 0.999288 |
54916276195eb96adb0b268998d10ea77702023b | 962 | md | Markdown | _posts/2020-01-01-celery.md | ZhuPeng/zhupeng.github.io | 92af5fdbf5b703ec163391540764415cc00f1b10 | [
"MIT"
] | 3 | 2019-06-03T15:38:13.000Z | 2019-06-10T03:02:11.000Z | _posts/2020-01-01-celery.md | ZhuPeng/zhupeng.github.io | 92af5fdbf5b703ec163391540764415cc00f1b10 | [
"MIT"
] | 9 | 2020-10-07T08:14:12.000Z | 2020-10-07T08:31:41.000Z | _posts/2020-01-01-celery.md | ZhuPeng/zhupeng.github.io | 92af5fdbf5b703ec163391540764415cc00f1b10 | [
"MIT"
] | null | null | null | ---
layout: post
title: Golang Celery
tags: Go相关
---
# 性能要求高的代码用 Python 还是 Go?
使用 Python 开发 Web 应用,在服务 QPS 不断增长过程中,需要不断的关注性能问题并优化,似乎没有尽头。而出身名门 Go 语言,最大的卖点在于它的性能,无论在运行还是编译时它都有突出的性能优势。通过 Go 重写 Python 核心 API 的逻辑能够达到几十倍甚至几百倍的性能提升。
使用 Python 开发的同学一定知道 Celery。Celery 是一个异步任务队列,它是用 Python 编写非常简单、灵活、可靠,我们可以使用它快速的构建用来处理大量信息的分布式系统。Celery 是语言无关的,但他提供了其他常见语言的接口支持。如果你的项目使用 Python 进行开发那么使用 Celery 就自然而然。
```python
# https://github.com/celery/celery
from celery import Celery
app = Celery('hello', broker='amqp://guest@localhost//')
@app.task
def hello():
return 'hello world'
```
如果你恰巧使用 Python 在开发,同时项目里面使用了 Celery,又由于核心 API 的性能不足需要持续不断的优化。不妨尝试使用 Golang 重构,相信会有质的飞跃。那么 gocelery 就是你需要的,你可以在 Go 代码提交任务,在 Python 的 Celery Worker 执行,让你的服务在重构过程中边跑边换轮子。


> 项目地址:https://github.com/gocelery/gocelery
***
| 23.463415 | 167 | 0.77131 | yue_Hant | 0.574081 |
5491d8fe7f897ef6adefdf8c392b786e596e6db7 | 202 | md | Markdown | README.md | kongyajie/ak-utils | 279ff7b0235bbce1a479844f340dfacf679f94a8 | [
"MIT"
] | null | null | null | README.md | kongyajie/ak-utils | 279ff7b0235bbce1a479844f340dfacf679f94a8 | [
"MIT"
] | null | null | null | README.md | kongyajie/ak-utils | 279ff7b0235bbce1a479844f340dfacf679f94a8 | [
"MIT"
] | null | null | null | # ak-utils
Common javascript utils
## Install
```sh
npm install ak-utils
npm install --save ak-utils
```
## Example
```javascript
let copyObj = Utils.copy({'a':1});
```
## API
## License
MIT | 9.181818 | 38 | 0.623762 | cat_Latn | 0.236011 |
5492775dab0a459ab9474440e2f2d4afda297000 | 286 | md | Markdown | service-impl/data-service-impl/rest-data-service/README.md | davidradl/Palisade | e2bce45c426ca1284719522608996564f45f0529 | [
"Apache-2.0"
] | null | null | null | service-impl/data-service-impl/rest-data-service/README.md | davidradl/Palisade | e2bce45c426ca1284719522608996564f45f0529 | [
"Apache-2.0"
] | null | null | null | service-impl/data-service-impl/rest-data-service/README.md | davidradl/Palisade | e2bce45c426ca1284719522608996564f45f0529 | [
"Apache-2.0"
] | null | null | null | # REST Data Service
A REST implementation for the Data Service.
Currently only a simple implementation. It needs to be improved so
the data can be sent back in chunks so large quantities can be streamed
back.
Please note this REST implementation does not include any authentication.
| 28.6 | 73 | 0.807692 | eng_Latn | 0.996116 |
5493cf77f5721f5d04d776191bd1730d5fdd14df | 374 | md | Markdown | docs/api-reference/classes/NSBatchTaskInfo/SetContext.md | stianol/crmscript | be1ad4f3a967aee2974e9dc7217255565980331e | [
"MIT"
] | null | null | null | docs/api-reference/classes/NSBatchTaskInfo/SetContext.md | stianol/crmscript | be1ad4f3a967aee2974e9dc7217255565980331e | [
"MIT"
] | null | null | null | docs/api-reference/classes/NSBatchTaskInfo/SetContext.md | stianol/crmscript | be1ad4f3a967aee2974e9dc7217255565980331e | [
"MIT"
] | null | null | null | ---
uid: crmscript_ref_NSBatchTaskInfo_SetContext
title: SetContext(String context)
intellisense: NSBatchTaskInfo.SetContext
keywords: NSBatchTaskInfo, GetContext
so.topic: reference
---
# SetContext(String context)
Context for the executing task.
**Parameter:**
- **context** String
```crmscript
NSBatchTaskInfo thing;
String context;
thing.SetContext(context);
```
| 17 | 45 | 0.780749 | kor_Hang | 0.435323 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.