text:
## Tłumaczenia:

* [English](../README.md)
* [Español](../translations/README-es.md)
* [Français](../translations/README-fr.md)
* [Português do Brasil](../translations/README-pt_BR.md)
* [中文版](../translations/README-cn.md)
* [日本語](../translations/README-ja.md)
* [한국어](../translations/README-ko.md)
* [Turkish](../translations/README-tr.md)
* [Greek](../translations/README-gr.md)
* [Magyar](../translations/README-hu.md)
* [Polish](../translations/README-pl.md)
* [Русский](../translations/README-ru.md)
* [Tiếng Việt](../translations/README-vn.md)

## Co to jest wyrażenie regularne?

> Wyrażenie regularne to grupa znaków lub symboli, które służą do odnalezienia określonego wzoru w tekście.

Wyrażenie regularne to wzorzec, który jest dopasowywany do tekstu od lewej
do prawej strony. Termin "wyrażenie regularne" (ang. "regular expression")
jest dość długie, więc zazwyczaj używa się skróconej formy "regex" lub "regexp".
Wyrażenie regularne jest używane do zastępowania tekstu w łańcuchu znaków
(ang. string), walidacji formularzy, wyodrębniania wycinka z łańcucha
(ang. substring) według podanego wzorca, i wielu innych.

Wyobraź sobie, że piszesz aplikację i chcesz ustawić reguły dotyczące tego,
jak użytkownik wybiera swoją nazwę. Chcemy, aby nazwa użytkownika zawierała litery,
liczby, podkreślenia i myślniki. Chcemy również ograniczyć liczbę znaków w nazwie
użytkownika, aby nie wyglądała za brzydko. Stosujemy następujące wyrażenie
regularne, aby sprawdzić poprawność nazwy:

Powyższe wyrażenie akceptuje łańcuchy `john_doe`, `jo-hn_doe`
i `john12_as`. Odrzuca `Jo` ponieważ łańcuch zawiera dużą literę
i jest za krótki.

## Spis treści

- [Najprostsze wyrażenie](#1-najprostsze-wyrażenie)
- [Metaznaki](#2-metaznaki)
  - [Kropka](#21-kropka)
  - [Zestaw znaków](#22-zestaw-znaków)
    - [Odwrócony zestaw znaków](#221-odwrócony-zestaw-znaków)
  - [Powtórzenia](#23-powtórzenia)
    - [Gwiazdka](#231-gwiazdka)
    - [Plus](#232-plus)
    - [Znak zapytania](#233-znak-zapytania)
  - [Klamry](#24-klamry)
  - [Grupa znaków](#25-grupa-znaków)
  - [Alternatywa](#26-alternatywa)
  - [Znak ucieczki](#27-znak-ucieczki)
  - [Kotwice](#28-kotwice)
    - [Kareta](#281-kareta)
    - [Dolar](#282-dolar)
- [Skróty](#3-skróty)
- [Lookaround](#4-lookaround)
  - [Lookahead](#41-lookahead)
  - [Odwrócony lookahead](#42-odwrócony-lookahead)
  - [Lookbehind](#43-lookbehind)
  - [Odwrócony lookbehind](#44-odwrócony-lookbehind)
- [Flagi](#5-flagi)
  - [Wielkość znaków](#51-wielkość-znaków)
  - [Przeszukiwanie globalne](#52-przeszukiwanie-globalne)
  - [Multilinia](#53-multilinia)

## 1. Najprostsze wyrażenie

Wyrażenie regularne to ciąg znaków, których używamy do przeszukania tekstu.
Na przykład, wyrażenie `the` oznacza: literę `t`, następującą
po niej literę `h`, następującą po niej literę `e`.

"the" => The fat cat sat on the mat.

[Przetestuj wyrażenie](https://regex101.com/r/dmRygT/1)

Wyrażenie regularne `123` pasuje do łańcucha `123`. Wyrażenie regularne
jest dopasowywane do danego łańcucha poprzez porównanie każdego znaku,
jeden po drugim, w wyrażeniu i łańcuchu. Wyrażenia są zwykle wrażliwe
na wielkość znaków, więc wyrażenie `The` nie pasuje do łańcucha `the`.

"The" => The fat cat sat on the mat.

[Przetestuj wyrażenie](https://regex101.com/r/1paXsy/1)

## 2. Metaznaki

Metaznaki to składowe elementy wyrażeń regularnych. Znaki te, nie oznaczają
siebie samych, są natomiast interpretowane w specjalny sposób.
Niektóre znaki mają specjalne znaczenie i są zapisywane w kwadratowych nawiasach.
Metaznaki to:

|Metaznaki|Opis|
|:----:|----|
|.|Dowolny znak z wyjątkiem nowej linii.|
|[ ]|Zakres. Każdy znak zapisany w kwadratowym nawiasie.|
|[^ ]|Odwrócony zakres. Każdy znak, który nie znajduje się w kwadratowym nawiasie.|
|*|0 lub więcej poprzedzających znaków.|
|+|1 lub więcej poprzedzających znaków.|
|?|0 lub 1 poprzedzających znaków.|
|{n,m}|Minimum "n" ale nie więcej niż "m" poprzedzających znaków.|
|(xyz)|Grupowanie znaków. Znaki xyz dokładnie w tej kolejności.|
|||Alternatywa. Znaki przed symbolem lub za symbolem.|
|\|Znak ucieczki. Umożliwia używanie zarezerwowanych znaków [ ] ( ) { } . * + ? ^ $ \ |.|
|^|Oznacza początek wzorca.|
|$|Oznacza koniec wzorca.|

## 2.1 Kropka

Kropka `.` jest najprostszym przykładem metaznaku. Oznacza dowolny znak z wyłączeniem entera
i znaków nowej linii. Na przykład, wyrażenie regularne `.ar` oznacza: dowolny znak, następującą
po niej literę `a`, następującą po niej literę `r`.

".ar" => The car parked in the garage.

[Przetestuj wyrażenie](https://regex101.com/r/xc9GkU/1)

## 2.2 Zestaw znaków

Zestawy znaków nazywane też klasami znaków. Nawiasy kwadratowe służą do określenia zestawów znaków.
Użycie myślnika wewnątrz zestawu, określa jego zakres. Kolejność znaków w nawiasach kwadratowych
nie ma znaczenia. Na przykład wyrażenie `[Tt]he` oznacza: dużą literę `T` lub małą `t`,
następującą po niej literę `h`, następującą po niej literę `e`.

"[Tt]he" => The car parked in the garage.

[Przetestuj wyrażenie](https://regex101.com/r/2ITLQ4/1)

Jednak kropka w zestawie znaków, oznacza dosłownie kropkę. Wyrażenie regularne
`ar[.]` oznacza: małą literę `a`, następującą po niej literę `r`,
następującą po niej `.` kropkę.

"ar[.]" => A garage is a good place to park a car.

[Przetestuj wyrażenie](https://regex101.com/r/wL3xtE/1)

### 2.2.1 Odwrócony zestaw znaków

Generalnie znak karety oznacza początek wyrażenia, ale gdy zostanie użyty zaraz
za otwierającym nawiasem kwadratowym, odwraca zestaw znaków. Na przykład
wyrażenie `[^c]ar` oznacza: każdy znak z wyjątkiem `c`,
następującą po niej literę `a`, następującą po niej literę `r`.

"[^c]ar" => The car parked in the garage.

[Przetestuj wyrażenie](https://regex101.com/r/nNNlq3/1)

## 2.3 Powtórzenia

Następujące metaznaki `+`, `*` czy `?` określają ile razy wzorzec może się powtórzyć.
Te metaznaki zachowują się różnie, w zależności od sytuacji.

### 2.3.1 Gwiazdka

Symbol `*` oznacza zero lub więcej powtórzeń poprzedzających znaków. Wyrażenie
regularne `a*` oznacza: zero lub więcej powtórzeń poprzedzającej małej
litery `a`. Ale jeśli występuje po zestawie znaków lub klasie, to oznacza
powtórzenia całego zestawu lub klasy. Na przykład, wyrażenie regularne
`[a-z]*` oznacza: każdy ciąg znaków pisany małymi literami.

"[a-z]*" => The car parked in the garage #21.

[Przetestuj wyrażenie](https://regex101.com/r/7m8me5/1)

Symbol `*` może być użyty z metaznakiem `.` by oznaczyć każdy łańcuch
znaków `.*`. Symbol `*` może być użyty ze znakiem `\s`
by znaleźć łańcuch zawierający spacje. Na przykład, wyrażenie
`\s*cat\s*` oznacza: zero lub więcej spacji, następującą po niej małą literę `c`,
następującą po niej małą literę `a`, następującą po niej małą literę `t`,
następujące po niej zero lub więcej spacji.

"\s*cat\s*" => The fat cat sat on the concatenation.

[Przetestuj wyrażenie](https://regex101.com/r/gGrwuz/1)

### 2.3.2 Plus

Symbol `+` oznacza jeden lub więcej powtórzeń poprzedzających znaków. Na przykład,
wyrażenie `c.+t` oznacza: małą literę `c`, następujący po niej przynajmniej jeden
dowolny znak, następującą po nim małą literę `t`. W tym wypadku `t` jest ostatnim
`t` w zdaniu.

"c.+t" => The fat cat sat on the mat.

[Przetestuj wyrażenie](https://regex101.com/r/Dzf9Aa/1)

### 2.3.3 Znak zapytania

W wyrażeniach regularnych znak `?` sprawia, że poprzedzający znak jest opcjonalny.
Ten symbol oznacza zero lub jedno wystąpienie poprzedzającego znaku. Na przykład,
wyrażenie regularne `[T]?he` oznacza: opcjonalną dużą literę `T`, następującą
po niej małą literę `h`, następującą po niej małą literę `e`.

"[T]he" => The car is parked in the garage.

[Przetestuj wyrażenie](https://regex101.com/r/cIg9zm/1)

"[T]?he" => The car is parked in the garage.

[Przetestuj wyrażenie](https://regex101.com/r/kPpO2x/1)

## 2.4 Klamry

W wyrażeniach regularnych, klamry zwane również kwantyfikatorami, używane są
do określenia, ile razy znak lub grupa znaków może się powtórzyć.
Na przykład wyrażenie regularne `[0-9]{2,3}` oznacza: przynajmniej
2 znaki, ale nie więcej niż 3 (znaki z zakresu od 0 do 9).

"[0-9]{2,3}" => The number was 9.9997 but we rounded it off to 10.0.

[Przetestuj wyrażenie](https://regex101.com/r/juM86s/1)

Możemy opuścić drugą liczbę. Na przykład regularne wyrażenie `[0-9]{2,}`
oznacza: 2 lub więcej znaków. Jeżeli dodatkowo usuniemy przecinek,
to wyrażenie `[0-9]{3}` oznacza: dokładnie 3 znaki z zakresu 0 do 9.

"[0-9]{2,}" => The number was 9.9997 but we rounded it off to 10.0.

[Przetestuj wyrażenie](https://regex101.com/r/Gdy4w5/1)

"[0-9]{3}" => The number was 9.9997 but we rounded it off to 10.0.

[Przetestuj wyrażenie](https://regex101.com/r/Sivu30/1)

## 2.5 Grupa znaków

Grupa znaków to grupa podwzorców, które zapisywane są w nawiasach `(...)`.
Jak wspominaliśmy wyżej, jeśli w wyrażeniu regularnym wstawimy kwantyfikator po
znaku, wtedy powtórzy on ten znak. Ale gdy wstawimy kwantyfikator po grupie znaków,
wtedy cała grupa zostanie powtórzona. Na przykład wyrażenie regularne `(ab)*`
oznacza zero lub więcej powtórzeń grupy "ab". Możemy także użyć metaznaku
alternatywy `|` wewnątrz grupy. Na przykład wyrażenie `(c|g|p)ar` oznacza: małą literę `c`,
`g` lub `p`, następującą po niej literę `a`, następującą po niej literę `r`.

"(c|g|p)ar" => The car is parked in the garage.

[Przetestuj wyrażenie](https://regex101.com/r/tUxrBG/1)

## 2.6 Alternatywa

W wyrażeniach regularnych pionowa kreska `|` oznacza alternatywę.
Działa jak warunek pomiędzy różnymi wyrażeniami. Teraz możesz pomyśleć, że
to działa tak samo jak zestaw znaków. Różnica polega na tym, że zestaw znaków
działa na poziomie znaków, natomiast alternatywa na poziomie wyrażenia. Na przykład
wyrażenie regularne `(T|t)he|car` oznacza: dużą literę `T` lub małą `t`,
następującą po niej literę `h`, następującą po niej literę `e` lub `c`, następującą
po niej literę `a`, następującą po niej literę `r`.

"(T|t)he|car" => The car is parked in the garage.

[Przetestuj wyrażenie](https://regex101.com/r/fBXyX0/1)

## 2.7 Znak ucieczki

Ukośnik `\` w wyrażeniach regularnych jest znakiem ucieczki. Pozwala on
używać w wyrażeniu zarezerwowanych znaków takich jak `{ } [ ] / \ + * . $ ^ | ?`.
Aby użyć znaku specjalnego w wyrażeniu, postaw `\` przed nim.

Na przykład wyrażenie `.` dopasowuje każdy znak z wyjątkiem nowej linii.
Żeby dopasować kropkę `.` w wyrażeniu regularnym, trzeba wstawić przed nią ukośnik.
Wyrażenie `(f|c|m)at\.?` oznacza: małe litery `f` lub `c` lub `m`, następującą po niej
literę `a`, następującą po niej literę `t`, następującą kropkę `.`, która jest opcjonalna.

"(f|c|m)at\.?" => The fat cat sat on the mat.

[Przetestuj wyrażenie](https://regex101.com/r/DOc5Nu/1)

## 2.8 Kotwice

W wyrażeniach regularnych używamy kotwic aby sprawdzić czy dopasowywany symbol
jest pierwszym lub ostatnim symbolem w łańcuchu. Są dwa typy: pierwszy to
kareta `^`, która sprawdza czy znak jest początkiem łańcucha, drugi to dolar `$`,
który sprawdza czy znak jest ostatnim elementem łańcucha.

### 2.8.1 Kareta

Kareta `^` sprawdza czy znak jest początkiem łańcucha. Jeżeli użyjemy takiego
wyrażenia `^a` (jeśli a jest pierwszym znakiem) na łańcuchu `abc` to dopasuje
nam `a`. Ale jeśli użyjemy takiego wyrażenia `^b` na tym samym łańcuchu, to nie
zwróci nam nic. Ponieważ w łańcuchu `abc` "b" nie jest pierwszym symbolem.
Spójrzmy teraz na wyrażenie `^(T|t)he` które oznacza: dużą literę `T` lub małą
`t`, która jest początkiem łańcucha, następującą po niej literę `h`, następującą
po niej literę `e`.

"(T|t)he" => The car is parked in the garage.

[Przetestuj wyrażenie](https://regex101.com/r/5ljjgB/1)

"^(T|t)he" => The car is parked in the garage.

[Przetestuj wyrażenie](https://regex101.com/r/jXrKne/1)

### 2.8.2 Dolar

Symbol dolara `$` używany jest do sprawdzenia czy dopasowywany znak jest ostatni
w łańcuchu. Na przykład, wyrażenie regularne `(at\.)$` oznacza: małą literę `a`,
następującą po niej literę `t`, następującą po niej kropkę `.` i na dodatek
dopasowanie musi być końcem łańcucha.

"(at\.)" => The fat cat. sat. on the mat.

[Przetestuj wyrażenie](https://regex101.com/r/y4Au4D/1)

"(at\.)$" => The fat cat. sat. on the mat.

[Przetestuj wyrażenie](https://regex101.com/r/t0AkOd/1)

##  3. Skróty

W wyrażeniach regularnych znajdziemy także skróty dla popularnych zestawów znaków,
które ułatwiają pracę z wyrażeniami regularnymi. Skróty wyglądają następująco:

|Skrót|Opis|
|:----:|----|
|.|Każdy znak z wyjątkiem nowej linii|
|\w|Znaki alfanumeryczne: `[a-zA-Z0-9_]`|
|\W|Znaki nie alfanumeryczne: `[^\w]`|
|\d|Cyfry: `[0-9]`|
|\D|Nie cyfry: `[^\d]`|
|\s|Dowolny biały znak: `[\t\n\f\r\p{Z}]`|
|\S|Każdy znak oprócz białych: `[^\s]`|

## 4. Lookaround

Lookbehind i lookahead (nazywane również lookaround) to specyficzne typy
***niezwracających grup*** (dopasowują wzorzec, ale nie zwracają wartości).
Lookaround używane są w sytuacji, gdy mamy wzorzec i jest on poprzedzony innym wzorcem,
lub następuje po nim kolejny wzorzec. Na przykład, chcemy mieć wszystkie
numery, które są poprzedzone znakiem `$` w takim łańcuchu `$4.44 and $10.88`.
Użyjemy takiego wyrażenia regularnego `(?<=\$)[0-9\.]*` które oznacza: znajdź
wszystkie liczby ze znakiem `.` poprzedzone znakiem `$`. W wyrażeniach regularnych
wyróżniamy:

|Symbol|Opis|
|:----:|----|
|?=|Lookahead|
|?!|Odwrócony lookahead|
|?<=|Lookbehind|
|?<!|Odwrócony lookbehind|

### 4.1 Lookahead

Lookahead stwierdza, że po pierwszej części wyrażenia musi następować
następne wyrażenie. Zwracane dopasowanie zawiera tylko tekst, który został
dopasowany przez pierwszą część wyrażenia. Stosuje się je w nawiasach wraz
ze znakami zapytania i równości: `(?=...)`. Wyrażenie lookahead
wpisuje się po znaku równości. Na przykład wyrażenie `(T|t)he(?=\sfat)`
oznacza: opcjonalną małą literę `t` lub dużą `T`, następującą po niej
literę `h`, następującą po niej literę `e`. W nawiasach definiujemy
wyrażenie lookahead, które mówi aby dopasować `The` lub `the` i następujące
po nich `fat`.

"(T|t)he(?=\sfat)" => The fat cat sat on the mat.

[Przetestuj wyrażenie](https://regex101.com/r/IDDARt/1)

### 4.2 Odwrócony lookahead

Używany jest, gdy potrzebujemy dopasowania z łańcucha, po których nie następują
żadne wzorce. Odwrócony lookahead definiujemy w nawiasach, stosując znak negacji
`!` po znaku zapytania, na przykład: `(?!...)`. Popatrzmy na następujące wyrażenie
`(T|t)he(?!\sfat)` które oznacza: znajdź wszystkie słowa `The` lub `the` w łańcuchu,
po których nie następuje słowo `fat`, poprzedzone spacją.

"(T|t)he(?!\sfat)" => The fat cat sat on the mat.

[Przetestuj wyrażenie](https://regex101.com/r/V32Npg/1)

### 4.3 Lookbehind

Lookbehind używany jest do odnalezienia wszystkich dopasowań poprzedzonych konkretnym
wzorcem. Wyrażenie lookbehind zapisujemy tak: `(?<=...)`. Na przykład, wyrażenie
`(?<=(T|t)he\s)(fat|mat)` oznacza: znajdź wszystkie słowa `fat` lub `mat` w łańcuchu,
które znajdują się po słowach `The` lub `the`.

"(?<=(T|t)he\s)(fat|mat)" => The fat cat sat on the mat.

[Przetestuj wyrażenie](https://regex101.com/r/avH165/1)

### 4.4 Odwrócony lookbehind

Odwrócony używany jest do odnalezienia wszystkich dopasowań niepoprzedzonych konkretnym
wzorcem. Odwrócony lookbehind zapisujemy tak: `(?<!...)`. Na przykład, wyrażenie
`(?<!(T|t)he\s)(cat)` oznacza: znajdź wszystkie słowa `cat` w stringu, które nie następują
po słowach `The` lub `the`.

"(?<!(T|t)he\s)(cat)" => The cat sat on cat.

[Przetestuj wyrażenie](https://regex101.com/r/8Efx5G/1)

## 5. Flagi

Flagi nazywane są także modyfikatorami, ponieważ zmieniają wynik wyrażenia regularnego.
Flagi mogą być używane w każdej kombinacji i są integralną częścią wyrażeń regularnych.

|Flaga|Opis|
|:----:|----|
|i|Wielkość znaków: Sprawia, że dopasowanie nie jest wrażliwe na wielkość znaków.|
|g|Przeszukanie globalne: Wyszukiwanie wzorca w całym łańcuchu.|
|m|Multilinia: Sprawia, że kotwice działają na każdej linii.|

### 5.1 Wielkość znaków

Modyfikator `i` używany jest, gdy wielkość liter nie ma znaczenia. Na przykład
wyrażenie `/The/gi` oznacza: dużą literę `T`, następującą po niej literę `h`,
następującą po niej literę `e`. A na końcu wyrażenia, flaga `i` żeby ignorować
wielkość znaków. Jak widać, została też użyta flaga `g` ponieważ chcemy przeszukać
cały łańcuch.

"The" => The fat cat sat on the mat.

[Przetestuj wyrażenie](https://regex101.com/r/dpQyf9/1)

"/The/gi" => The fat cat sat on the mat.

[Przetestuj wyrażenie](https://regex101.com/r/ahfiuh/1)

### 5.2 Przeszukiwanie globalne

Modyfikator `g` używany jest do przeszukiwania całego łańcucha (znajdź wszystko,
a nie tylko zatrzymuj się na pierwszym). Na przykład wyrażenie `/.(at)/g`
oznacza: każdy znak z wyjątkiem nowej linii, następującą po nim literę `a`,
następującą po niej literę `t`. Ponieważ użyliśmy na końcu wyrażenia flagi `g`,
wyszukane zostaną wszystkie dopasowania w łańcuchu, a nie tylko pierwszy (domyślne zachowanie).

"/.(at)/" => The fat cat sat on the mat.

[Przetestuj wyrażenie](https://regex101.com/r/jnk6gM/1)

"/.(at)/g" => The fat cat sat on the mat.

[Przetestuj wyrażenie](https://regex101.com/r/dO1nef/1)

### 5.3 Multilinia

Modyfikator `m` używany jest do dopasowywania w wielu liniach. Jak wspominaliśmy
wcześniej, kotwice `(^, $)` używane są do sprawdzania czy wzorzec jest początkiem
lub końcem łańcucha. Jeśli chcemy, żeby kotwice zadziałały w każdej linii, używamy
wtedy flagi `m`. Na przykład wyrażenie `/at(.)?$/gm` oznacza: małą literę `a`,
następującą po niej małą literę `t`, opcjonalnie dowolny znak z wyjątkiem nowej linii.
I ponieważ użyliśmy flagi `m` dopasowywane będą wzorce na końcu każdej linii w łańcuchu.

"/.at(.)?$/" => The fat
                cat sat
                on the mat.

[Przetestuj wyrażenie](https://regex101.com/r/hoGMkP/1)

"/.at(.)?$/gm" => The fat
                  cat sat
                  on the mat.

[Przetestuj wyrażenie](https://regex101.com/r/E88WE2/1)

## Kontrybucja

* Zgłaszanie błędów
* Otwieranie pull request z poprawkami
* Dzielenie się poradnikiem
* Skontaktuj się ze mną ziishaned@gmail.com lub [![Twitter URL](https://img.shields.io/twitter/url/https/twitter.com/ziishaned.svg?style=social&label=Follow%20%40ziishaned)](https://twitter.com/ziishaned)

## Licencja

MIT © [Zeeshan Ahmad](https://twitter.com/ziishaned)


text:
using System;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.Helpers;
using Tacklr.CacheManager.Caches;
using Tacklr.CacheManager.HttpHandlers;
using Tacklr.CacheManager.Interfaces;
using Tacklr.CacheManager.Models.Api;

namespace Tacklr.CacheManager.Controllers
{
    //TODO: Attribute to control GET/POST?
    //Should every method refresh stats so they are as up-to-date as possible?
    internal class ApiController : DataHandler
    {
        internal IHttpHandler Cache()
        {
            var cache = new HttpCacheShim();
            var model = new CacheViewModel(cache) { Success = true };
            return base.Json(model);
        }

        //combine with delete? not sure how we would want to handle that
        //HttpPost
        internal IHttpHandler Clear()
        {
            if (!ValidateTokenHeader())
                return base.Json(new JsonErrorViewModel { Success = false, Message = "Invalid verification token." }, HttpStatusCode.BadRequest);

            var cache = new HttpCacheShim();
            cache.Clear();
            return base.Json(new ClearViewModel { Success = true });
        }

        internal IHttpHandler Combined()
        {
            var cache = new HttpCacheShim() as ICache;
            var model = new CombinedViewModel(cache, HttpContext.Current) { Success = true };
            return base.Json(model);
        }

        //HttpPost
        internal IHttpHandler Delete(string key, bool prefix = false)
        {
            if (!ValidateTokenHeader())
                return base.Json(new JsonErrorViewModel { Success = false, Message = "Invalid verification token." }, HttpStatusCode.BadRequest);

            if (String.IsNullOrEmpty(key))
                return base.Json(new JsonErrorViewModel { Success = false, Message = "Missing cache key or prefix." }, HttpStatusCode.BadRequest);

            var cache = new HttpCacheShim();
            cache.Clear(key, prefix);
            return base.Json(new DeleteViewModel(cache) { Success = true });
        }

        internal IHttpHandler Details(string key)
        {
            if (String.IsNullOrEmpty(key))
                return base.Json(new JsonErrorViewModel { Success = false, Message = "Missing cache key." }, HttpStatusCode.BadRequest);

            var cache = new HttpCacheShim() as ICache;
            var entry = cache.GetEntry(key);
            if (entry == default(CacheEntry))//better check?
                return base.Json(new JsonErrorViewModel { Success = false, Message = "Invalid cache key." }, HttpStatusCode.BadRequest);

            var model = new DetailsViewModel(entry) { Success = true };
            return base.Json(model);
        }

        //HttpPost
        internal IHttpHandler Page(string url)
        {
            if (!ValidateTokenHeader())
                return base.Json(new JsonErrorViewModel { Success = false, Message = "Invalid verification token." }, HttpStatusCode.BadRequest);
            if (String.IsNullOrEmpty(url))
                return base.Json(new JsonErrorViewModel { Success = false, Message = "Missing relative page url." }, HttpStatusCode.BadRequest);
            else if (!url.StartsWith("/"))
                return base.Json(new JsonErrorViewModel { Success = false, Message = "Url must start with a \"/\"." }, HttpStatusCode.BadRequest);

            HttpResponse.RemoveOutputCacheItem(url);
            return base.Json(new PageViewModel { Success = true });
        }

        private bool ValidateTokenHeader(string cookieName = null, string headerName = "X-CSRF-Token")
        {
            cookieName = cookieName ?? AntiForgeryConfig.CookieName;//Use the existing cookie if there is one. There may still end up being two (different paths), but this will reduce that chance.
            //Would we want to delete our own pathed cookie if there is one further up?

            var cookieToken = default(string);
            var cookies = Request.Cookies;//can we get this from actionContext?
            if (cookies.AllKeys.Contains(cookieName))
            {
                var cookie = cookies.Get(cookieName);//why does this create a cookie if it doesn't exist...
                if (cookie != null)//blank check?
                    cookieToken = cookie.Value;
            }

            if (String.IsNullOrEmpty(cookieToken))
                return false;

            var headers = Request.Headers.Get(headerName);
            if (headers == null)
                return false;

            var values = headers.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            var headerToken = values.FirstOrDefault();
            if (String.IsNullOrWhiteSpace(headerToken))
                return false;

            try
            {
                AntiForgery.Validate(cookieToken, headerToken);
            }
            catch (Exception)
            {
                return false;
            }
            return true;
        }

        //internal IHttpHandler Serialize(string key, bool prefix = false)
        //{
        //    //TODO: Custom serializer routing, we want to serialize the data we can serialize, instead of failing on the first bad object
        //    var cache = new HttpCacheShim() as ICache;
        //    var model = new SerializeViewModel(cache, key, prefix) { Success = true };
        //    return base.Json(model);
        //}

        //internal IHttpHandler Settings()
        //{
        //    var model = new SettingsViewModel() { Success = true };
        //    return base.Json(model);
        //}

        //internal IHttpHandler Stats()
        //{
        //    var cache = new HttpCacheShim() as ICache;
        //    var model = new StatsViewModel(cache, HttpContext.Current) { Success = true };
        //    return base.Json(model);
        //}
    }
}

redpajama_set_name: RedPajamaGithub


text:
-- phpMyAdmin SQL Dump
-- version 4.4.14
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 03, 2015 at 11:49 AM
-- Server version: 5.6.26
-- PHP Version: 5.6.12

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `yii2_demo`
--

-- --------------------------------------------------------

--
-- Table structure for table `yii2demo_category`
--

CREATE TABLE IF NOT EXISTS `yii2demo_category` (
  `id` int(11) NOT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `publish_date` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `yii2demo_migration`
--

CREATE TABLE IF NOT EXISTS `yii2demo_migration` (
  `version` varchar(180) NOT NULL,
  `apply_time` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `yii2demo_migration`
--

INSERT INTO `yii2demo_migration` (`version`, `apply_time`) VALUES
('m000000_000000_base', 1448858444),
('m130524_201442_init', 1448858446),
('m151203_044438_create_post_table', 1449133474);

-- --------------------------------------------------------

--
-- Table structure for table `yii2demo_post`
--

CREATE TABLE IF NOT EXISTS `yii2demo_post` (
  `id` int(11) NOT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `publish_date` datetime NOT NULL,
  `updated_at` int(11) DEFAULT NULL,
  `category_id` int(11) DEFAULT NULL,
  `enabled` tinyint(1) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `yii2demo_post`
--

INSERT INTO `yii2demo_post` (`id`, `name`, `publish_date`, `updated_at`, `category_id`, `enabled`) VALUES
(2, 'tes1', '0000-00-00 00:00:00', 3132, NULL, 1),
(3, 'tes1', '0000-00-00 00:00:00', 3132, NULL, 1),
(4, 'tes1', '0000-00-00 00:00:00', 3132, NULL, 1);

-- --------------------------------------------------------

--
-- Table structure for table `yii2demo_user`
--

CREATE TABLE IF NOT EXISTS `yii2demo_user` (
  `id` int(11) NOT NULL,
  `username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `auth_key` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
  `password_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `password_reset_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `status` smallint(6) NOT NULL DEFAULT '10',
  `created_at` int(11) NOT NULL,
  `updated_at` int(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

--
-- Dumping data for table `yii2demo_user`
--

INSERT INTO `yii2demo_user` (`id`, `username`, `auth_key`, `password_hash`, `password_reset_token`, `email`, `status`, `created_at`, `updated_at`) VALUES
(1, 'lacphan', 'urdtsRiDJt-ot9KTHBAtJZuMruBPXDNf', '$2y$13$bi/leAKfjFtAuHithH2tEej6IyBTnWtm6zFG0Bw9noFF3XUKrI94W', NULL, 'pthanhlac@gmail.com', 10, 1448858453, 1448858453),
(2, 'appadmin', 'mdMhkT7STXWT1-ysQj1-Z9-jNHyqbO_G', '$2y$13$82rVD2mk6pcORwBq8MCz/.ZhJjSwsxqL8f9LSXzDc95sWy/Z2AoEC', NULL, 'appadmin@gmail.com', 10, 1449043332, 1449043332);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `yii2demo_category`
--
ALTER TABLE `yii2demo_category`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `yii2demo_migration`
--
ALTER TABLE `yii2demo_migration`
  ADD PRIMARY KEY (`version`);

--
-- Indexes for table `yii2demo_post`
--
ALTER TABLE `yii2demo_post`
  ADD PRIMARY KEY (`id`),
  ADD KEY `fk_post_category` (`category_id`);

--
-- Indexes for table `yii2demo_user`
--
ALTER TABLE `yii2demo_user`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `username` (`username`),
  ADD UNIQUE KEY `email` (`email`),
  ADD UNIQUE KEY `password_reset_token` (`password_reset_token`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `yii2demo_post`
--
ALTER TABLE `yii2demo_post`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `yii2demo_user`
--
ALTER TABLE `yii2demo_user`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
--
-- Constraints for dumped tables
--

--
-- Constraints for table `yii2demo_post`
--
ALTER TABLE `yii2demo_post`
  ADD CONSTRAINT `fk_post_category` FOREIGN KEY (`category_id`) REFERENCES `yii2demo_category` (`id`) ON DELETE CASCADE;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;


text:
Using TensorFlow Lite with Python is great for embedded devices based on Linux,
such as [Raspberry Pi](https://www.raspberrypi.org/){:.external} and
[Coral devices with Edge TPU](https://coral.withgoogle.com/){:.external},
among many others.

This page shows how you can start running TensorFlow Lite models with Python in
just a few minutes. All you need is a TensorFlow model [converted to TensorFlow
Lite](../convert/). (If you don't have a model converted yet, you can experiment
using the model provided with the example linked below.)

## Install just the TensorFlow Lite interpreter

To quickly run TensorFlow Lite models with Python, you can install just the
TensorFlow Lite interpreter, instead of all TensorFlow packages.

This interpreter-only package is a fraction the size of the full TensorFlow
package and includes the bare minimum code required to run inferences with
TensorFlow Lite—it includes only the
[`tf.lite.Interpreter`](https://www.tensorflow.org/api_docs/python/tf/lite/Interpreter)
Python class. This small package is ideal when all you want to do is execute
`.tflite` models and avoid wasting disk space with the large TensorFlow library.

Note: If you need access to other Python APIs, such as the [TensorFlow Lite
Converter](../convert/python_api.md), you must install the [full TensorFlow
package](https://www.tensorflow.org/install/).

To install, run `pip3 install` and pass it the appropriate Python wheel URL from
the following table.

For example, if you have a Raspberry Pi that's running Raspberry Pi OS 10 (which
has Python 3.7), install the Python wheel as follows:

pip3 install https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp37-cp37m-linux_armv7l.whl

Platform	Python	URL

  Linux (ARM 32)
  3.5
  https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp35-cp35m-linux_armv7l.whl

  3.6
  https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp36-cp36m-linux_armv7l.whl

  3.7
  https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp37-cp37m-linux_armv7l.whl

  3.8
  https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp38-cp38-linux_armv7l.whl

  Linux (ARM 64)
  3.5
  https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp35-cp35m-linux_aarch64.whl

  3.6
  https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp36-cp36m-linux_aarch64.whl

  3.7
  https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp37-cp37m-linux_aarch64.whl

  3.8
  https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp38-cp38-linux_aarch64.whl

  Linux (x86-64)
  3.5
  https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp35-cp35m-linux_x86_64.whl

  3.6
  https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp36-cp36m-linux_x86_64.whl

  3.7
  https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp37-cp37m-linux_x86_64.whl

  3.8
  https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp38-cp38-linux_x86_64.whl

  macOS 10.14
  3.5
  https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp35-cp35m-macosx_10_14_x86_64.whl

  3.6
  https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp36-cp36m-macosx_10_14_x86_64.whl

  3.7
  https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp37-cp37m-macosx_10_14_x86_64.whl

  Windows 10
  3.5
  https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp35-cp35m-win_amd64.whl

  3.6
  https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp36-cp36m-win_amd64.whl

  3.7
  https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp37-cp37m-win_amd64.whl

## Run an inference using tflite_runtime

To distinguish this interpreter-only package from the full TensorFlow package
(allowing both to be installed, if you choose), the Python module provided in
the above wheel is named `tflite_runtime`.

So instead of importing `Interpreter` from the `tensorflow` module, you need to
import it from `tflite_runtime`.

For example, after you install the package above, copy and run the
[`label_image.py`](
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/examples/python/)
file. It will (probably) fail because you don't have the `tensorflow` library
installed. To fix it, edit this line of the file:

```python
import tensorflow as tf
```

So it instead reads:

```python
import tflite_runtime.interpreter as tflite
```

And then change this line:

```python
interpreter = tf.lite.Interpreter(model_path=args.model_file)
```

So it reads:

```python
interpreter = tflite.Interpreter(model_path=args.model_file)
```

Now run `label_image.py` again. That's it! You're now executing TensorFlow Lite
models.

## Learn more

For more details about the `Interpreter` API, read
[Load and run a model in Python](inference.md#load-and-run-a-model-in-python).

If you have a Raspberry Pi, try the
[classify_picamera.py example](https://github.com/tensorflow/examples/tree/master/lite/examples/image_classification/raspberry_pi)
to perform image classification with the Pi Camera and TensorFlow Lite.

If you're using a Coral ML accelerator, check out the
[Coral examples on GitHub](https://github.com/google-coral/tflite/tree/master/python/examples).

To convert other TensorFlow models to TensorFlow Lite, read about the
the [TensorFlow Lite Converter](../convert/).


text:
<?php

/*
 * This file is part of the Active Collab DatabaseObject project.
 *
 * (c) A51 doo <info@activecollab.com>. All rights reserved.
 */

declare(strict_types=1);

namespace ActiveCollab\DatabaseObject\Test;

use ActiveCollab\DatabaseObject\FinderFactory\FinderFactory;
use ActiveCollab\DatabaseObject\FinderInterface;
use ActiveCollab\DatabaseObject\Test\Base\WritersTypeTestCase;
use ActiveCollab\DatabaseObject\Test\Fixtures\Writers\Writer;

final class FinderFactoryTest extends WritersTypeTestCase
{
    public function testFinderFactoryProducesFinder()
    {
        $finder = (new FinderFactory(
            $this->connection,
            $this->pool,
            $this->logger
        ))->produceFinder(Writer::class);

        $this->assertInstanceOf(FinderInterface::class, $finder);
        $this->assertSame(Writer::class, $finder->getType());
    }

    public function testFinderFactoryCanSetWhere()
    {
        $finder = (new FinderFactory(
            $this->connection,
            $this->pool,
            $this->logger
        ))->produceFinder(Writer::class, '`name` = ?', 'Leo Tolstoy');

        $this->assertInstanceOf(FinderInterface::class, $finder);
        $this->assertSame(Writer::class, $finder->getType());

        $this->assertStringContainsString("`name` = 'Leo Tolstoy'", (string) $finder);
    }
}


text:
Installs/Configures snappy, the compression codec from google

* Cookbook source:   [http://github.com/infochimps-cookbooks/snappy](http://github.com/infochimps-cookbooks/snappy)
* Ironfan tools: [http://github.com/infochimps-labs/ironfan](http://github.com/infochimps-labs/ironfan)
* Homebase (shows cookbook in use): [http://github.com/infochimps-labs/ironfan-homebase](http://github.com/infochimps-labs/ironfan-homebase)

## Overview

A very basic recipe to install snappy from a downloaded tarball.

NOTE: **Not needed for HBase / Flume / Hadoop** (those should use the native libs as provided by the hadoop_cluster cookbook)

From [their documentation](http://code.google.com/p/snappy/):

> Snappy is a compression/decompression library. It does not aim for maximum
> compression, or compatibility with any other compression library; instead, it
> aims for very high speeds and reasonable compression. For instance, compared
> to the fastest mode of zlib, Snappy is an order of magnitude faster for most
> inputs, but the resulting compressed files are anywhere from 20% to 100%
> bigger. On a single core of a Core i7 processor in 64-bit mode, Snappy
> compresses at about 250 MB/sec or more and decompresses at about 500 MB/sec or
> more.  Snappy is widely used inside Google, in everything from BigTable and
> MapReduce to our internal RPC systems. (Snappy has previously been referred to
> as "Zippy" in some presentations and the likes.)
>
> For more information, please see the README. Benchmarks against a few other
> compression libraries (zlib, LZO, LZF, FastLZ, and QuickLZ) are included in
> the source code distribution. The source code also contains a formal format
> specification, as well as a specification for a framing format useful for
> higher-level framing and encapsulation of Snappy data, e.g. for transporting
> Snappy-compressed data across HTTP in a streaming fashion. Note that there is
> currently no known code implementing the latter.
>
> Snappy is written in C++, but C bindings are included, and several bindings to
> other languages are maintained by third parties

## Recipes

* `default`                  - Base configuration for snappy

## Integration

Supports platforms: debian and ubuntu

Cookbook dependencies:

* install_from

## Attributes

* `[:snappy][:home_dir]`              - Installed location of snappy (default: "/usr/local/share/snappy")
* `[:snappy][:release_url]`           - Snappy release tarball to install (default: "http://snappy.googlecode.com/files/snappy-:version:.tar.gz")
* `[:snappy][:version]`               -  (default: "1.0.4")

## License and Author

Author::                Philip (flip) Kromer - Infochimps, Inc (<coders@infochimps.com>)
Copyright::             2011, Philip (flip) Kromer - Infochimps, Inc

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

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

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

> readme generated by [ironfan](http://github.com/infochimps-labs/ironfan)'s cookbook_munger


text:
package netlink

import (
	"errors"
	"math/rand"
	"os"
	"sync"
	"sync/atomic"
	"syscall"
	"time"

	"golang.org/x/net/bpf"
)

// A Conn is a connection to netlink.  A Conn can be used to send and
// receives messages to and from netlink.
//
// A Conn is safe for concurrent use, but to avoid contention in
// high-throughput applications, the caller should almost certainly create a
// pool of Conns and distribute them among workers.
//
// A Conn is capable of manipulating netlink subsystems from within a specific
// Linux network namespace, but special care must be taken when doing so. See
// the documentation of Config for details.
type Conn struct {
	// sock is the operating system-specific implementation of
	// a netlink sockets connection.
	sock Socket

	// seq is an atomically incremented integer used to provide sequence
	// numbers when Conn.Send is called.
	seq *uint32

	// pid is the PID assigned by netlink.
	pid uint32

	// d provides debugging capabilities for a Conn if not nil.
	d *debugger

	// mu serializes access to the netlink socket for the request/response
	// transaction within Execute.
	mu sync.RWMutex
}

// A Socket is an operating-system specific implementation of netlink
// sockets used by Conn.
type Socket interface {
	Close() error
	Send(m Message) error
	SendMessages(m []Message) error
	Receive() ([]Message, error)
}

// Dial dials a connection to netlink, using the specified netlink family.
// Config specifies optional configuration for Conn.  If config is nil, a default
// configuration will be used.
func Dial(family int, config *Config) (*Conn, error) {
	// Use OS-specific dial() to create Socket
	c, pid, err := dial(family, config)
	if err != nil {
		return nil, err
	}

	return NewConn(c, pid), nil
}

// NewConn creates a Conn using the specified Socket and PID for netlink
// communications.
//
// NewConn is primarily useful for tests. Most applications should use
// Dial instead.
func NewConn(sock Socket, pid uint32) *Conn {
	// Seed the sequence number using a random number generator.
	r := rand.New(rand.NewSource(time.Now().UnixNano()))
	seq := r.Uint32()

	// Configure a debugger if arguments are set.
	var d *debugger
	if len(debugArgs) > 0 {
		d = newDebugger(debugArgs)
	}

	return &Conn{
		sock: sock,
		seq:  &seq,
		pid:  pid,
		d:    d,
	}
}

// debug executes fn with the debugger if the debugger is not nil.
func (c *Conn) debug(fn func(d *debugger)) {
	if c.d == nil {
		return
	}

	fn(c.d)
}

// Close closes the connection.
//
// Due to a bug https://github.com/mdlayher/netlink/issues/162, Close currently
// cannot unblock concurrent calls to Send or Receive. As a stop-gap measure,
// call SetDeadline with a time in the past such as time.Unix(1, 0) in a
// different goroutine to unblock a long-running Receive loop. The intent is to
// fix this issue in v1.2.0.
func (c *Conn) Close() error {
	// Close does not acquire a lock because it must be able to interrupt any
	// blocked system calls, such as when Receive is waiting on a multicast
	// group message.
	//
	// We rely on the kernel to deal with concurrent operations to the netlink
	// socket itself.
	return newOpError("close", c.sock.Close())
}

// Execute sends a single Message to netlink using Send, receives one or more
// replies using Receive, and then checks the validity of the replies against
// the request using Validate.
//
// Execute acquires a lock for the duration of the function call which blocks
// concurrent calls to Send, SendMessages, and Receive, in order to ensure
// consistency between netlink request/reply messages.
//
// See the documentation of Send, Receive, and Validate for details about
// each function.
func (c *Conn) Execute(message Message) ([]Message, error) {
	// Acquire the write lock and invoke the internal implementations of Send
	// and Receive which require the lock already be held.
	c.mu.Lock()
	defer c.mu.Unlock()

	req, err := c.lockedSend(message)
	if err != nil {
		return nil, err
	}

	replies, err := c.lockedReceive()
	if err != nil {
		return nil, err
	}

	if err := Validate(req, replies); err != nil {
		return nil, err
	}

	return replies, nil
}

// SendMessages sends multiple Messages to netlink. The handling of
// a Header's Length, Sequence and PID fields is the same as when
// calling Send.
func (c *Conn) SendMessages(messages []Message) ([]Message, error) {
	// Wait for any concurrent calls to Execute to finish before proceeding.
	c.mu.RLock()
	defer c.mu.RUnlock()

	for idx, m := range messages {
		ml := nlmsgLength(len(m.Data))

		// TODO(mdlayher): fine-tune this limit.
		if ml > (1024 * 32) {
			return nil, errors.New("netlink message data too large")
		}

		c.fixMsg(&messages[idx], ml)
	}

	c.debug(func(d *debugger) {
		for _, m := range messages {
			d.debugf(1, "send msgs: %+v", m)
		}
	})

	if err := c.sock.SendMessages(messages); err != nil {
		c.debug(func(d *debugger) {
			d.debugf(1, "send msgs: err: %v", err)
		})

		return nil, newOpError("send-messages", err)
	}

	return messages, nil
}

// Send sends a single Message to netlink.  In most cases, a Header's Length,
// Sequence, and PID fields should be set to 0, so they can be populated
// automatically before the Message is sent.  On success, Send returns a copy
// of the Message with all parameters populated, for later validation.
//
// If Header.Length is 0, it will be automatically populated using the
// correct length for the Message, including its payload.
//
// If Header.Sequence is 0, it will be automatically populated using the
// next sequence number for this connection.
//
// If Header.PID is 0, it will be automatically populated using a PID
// assigned by netlink.
func (c *Conn) Send(message Message) (Message, error) {
	// Wait for any concurrent calls to Execute to finish before proceeding.
	c.mu.RLock()
	defer c.mu.RUnlock()

	return c.lockedSend(message)
}

// lockedSend implements Send, but must be called with c.mu acquired for reading.
// We rely on the kernel to deal with concurrent reads and writes to the netlink
// socket itself.
func (c *Conn) lockedSend(message Message) (Message, error) {
	ml := nlmsgLength(len(message.Data))

	// TODO(mdlayher): fine-tune this limit.
	if ml > (1024 * 32) {
		return Message{}, errors.New("netlink message data too large")
	}

	c.fixMsg(&message, ml)

	c.debug(func(d *debugger) {
		d.debugf(1, "send: %+v", message)
	})

	if err := c.sock.Send(message); err != nil {
		c.debug(func(d *debugger) {
			d.debugf(1, "send: err: %v", err)
		})

		return Message{}, newOpError("send", err)
	}

	return message, nil
}

// Receive receives one or more messages from netlink.  Multi-part messages are
// handled transparently and returned as a single slice of Messages, with the
// final empty "multi-part done" message removed.
//
// If any of the messages indicate a netlink error, that error will be returned.
func (c *Conn) Receive() ([]Message, error) {
	// Wait for any concurrent calls to Execute to finish before proceeding.
	c.mu.RLock()
	defer c.mu.RUnlock()

	return c.lockedReceive()
}

// lockedReceive implements Receive, but must be called with c.mu acquired for reading.
// We rely on the kernel to deal with concurrent reads and writes to the netlink
// socket itself.
func (c *Conn) lockedReceive() ([]Message, error) {
	msgs, err := c.receive()
	if err != nil {
		c.debug(func(d *debugger) {
			d.debugf(1, "recv: err: %v", err)
		})

		return nil, err
	}

	c.debug(func(d *debugger) {
		for _, m := range msgs {
			d.debugf(1, "recv: %+v", m)
		}
	})

	// When using nltest, it's possible for zero messages to be returned by receive.
	if len(msgs) == 0 {
		return msgs, nil
	}

	// Trim the final message with multi-part done indicator if
	// present.
	if m := msgs[len(msgs)-1]; m.Header.Flags&Multi != 0 && m.Header.Type == Done {
		return msgs[:len(msgs)-1], nil
	}

	return msgs, nil
}

// receive is the internal implementation of Conn.Receive, which can be called
// recursively to handle multi-part messages.
func (c *Conn) receive() ([]Message, error) {
	// NB: All non-nil errors returned from this function *must* be of type
	// OpError in order to maintain the appropriate contract with callers of
	// this package.
	//
	// This contract also applies to functions called within this function,
	// such as checkMessage.

	var res []Message
	for {
		msgs, err := c.sock.Receive()
		if err != nil {
			return nil, newOpError("receive", err)
		}

		// If this message is multi-part, we will need to perform an recursive call
		// to continue draining the socket
		var multi bool

		for _, m := range msgs {
			if err := checkMessage(m); err != nil {
				return nil, err
			}

			// Does this message indicate a multi-part message?
			if m.Header.Flags&Multi == 0 {
				// No, check the next messages.
				continue
			}

			// Does this message indicate the last message in a series of
			// multi-part messages from a single read?
			multi = m.Header.Type != Done
		}

		res = append(res, msgs...)

		if !multi {
			// No more messages coming.
			return res, nil
		}
	}
}

// A groupJoinLeaver is a Socket that supports joining and leaving
// netlink multicast groups.
type groupJoinLeaver interface {
	Socket
	JoinGroup(group uint32) error
	LeaveGroup(group uint32) error
}

// JoinGroup joins a netlink multicast group by its ID.
func (c *Conn) JoinGroup(group uint32) error {
	conn, ok := c.sock.(groupJoinLeaver)
	if !ok {
		return notSupported("join-group")
	}

	return newOpError("join-group", conn.JoinGroup(group))
}

// LeaveGroup leaves a netlink multicast group by its ID.
func (c *Conn) LeaveGroup(group uint32) error {
	conn, ok := c.sock.(groupJoinLeaver)
	if !ok {
		return notSupported("leave-group")
	}

	return newOpError("leave-group", conn.LeaveGroup(group))
}

// A bpfSetter is a Socket that supports setting and removing BPF filters.
type bpfSetter interface {
	Socket
	bpf.Setter
	RemoveBPF() error
}

// SetBPF attaches an assembled BPF program to a Conn.
func (c *Conn) SetBPF(filter []bpf.RawInstruction) error {
	conn, ok := c.sock.(bpfSetter)
	if !ok {
		return notSupported("set-bpf")
	}

	return newOpError("set-bpf", conn.SetBPF(filter))
}

// RemoveBPF removes a BPF filter from a Conn.
func (c *Conn) RemoveBPF() error {
	conn, ok := c.sock.(bpfSetter)
	if !ok {
		return notSupported("remove-bpf")
	}

	return newOpError("remove-bpf", conn.RemoveBPF())
}

// A deadlineSetter is a Socket that supports setting deadlines.
type deadlineSetter interface {
	Socket
	SetDeadline(time.Time) error
	SetReadDeadline(time.Time) error
	SetWriteDeadline(time.Time) error
}

// SetDeadline sets the read and write deadlines associated with the connection.
//
// Deadline functionality is only supported on Go 1.12+. Calling this function
// on older versions of Go will result in an error.
func (c *Conn) SetDeadline(t time.Time) error {
	conn, ok := c.sock.(deadlineSetter)
	if !ok {
		return notSupported("set-deadline")
	}

	return newOpError("set-deadline", conn.SetDeadline(t))
}

// SetReadDeadline sets the read deadline associated with the connection.
//
// Deadline functionality is only supported on Go 1.12+. Calling this function
// on older versions of Go will result in an error.
func (c *Conn) SetReadDeadline(t time.Time) error {
	conn, ok := c.sock.(deadlineSetter)
	if !ok {
		return notSupported("set-read-deadline")
	}

	return newOpError("set-read-deadline", conn.SetReadDeadline(t))
}

// SetWriteDeadline sets the write deadline associated with the connection.
//
// Deadline functionality is only supported on Go 1.12+. Calling this function
// on older versions of Go will result in an error.
func (c *Conn) SetWriteDeadline(t time.Time) error {
	conn, ok := c.sock.(deadlineSetter)
	if !ok {
		return notSupported("set-write-deadline")
	}

	return newOpError("set-write-deadline", conn.SetWriteDeadline(t))
}

// A ConnOption is a boolean option that may be set for a Conn.
type ConnOption int

// Possible ConnOption values.  These constants are equivalent to the Linux
// setsockopt boolean options for netlink sockets.
const (
	PacketInfo ConnOption = iota
	BroadcastError
	NoENOBUFS
	ListenAllNSID
	CapAcknowledge
	ExtendedAcknowledge
)

// An optionSetter is a Socket that supports setting netlink options.
type optionSetter interface {
	Socket
	SetOption(option ConnOption, enable bool) error
}

// SetOption enables or disables a netlink socket option for the Conn.
func (c *Conn) SetOption(option ConnOption, enable bool) error {
	conn, ok := c.sock.(optionSetter)
	if !ok {
		return notSupported("set-option")
	}

	return newOpError("set-option", conn.SetOption(option, enable))
}

// A bufferSetter is a Socket that supports setting connection buffer sizes.
type bufferSetter interface {
	Socket
	SetReadBuffer(bytes int) error
	SetWriteBuffer(bytes int) error
}

// SetReadBuffer sets the size of the operating system's receive buffer
// associated with the Conn.
func (c *Conn) SetReadBuffer(bytes int) error {
	conn, ok := c.sock.(bufferSetter)
	if !ok {
		return notSupported("set-read-buffer")
	}

	return newOpError("set-read-buffer", conn.SetReadBuffer(bytes))
}

// SetWriteBuffer sets the size of the operating system's transmit buffer
// associated with the Conn.
func (c *Conn) SetWriteBuffer(bytes int) error {
	conn, ok := c.sock.(bufferSetter)
	if !ok {
		return notSupported("set-write-buffer")
	}

	return newOpError("set-write-buffer", conn.SetWriteBuffer(bytes))
}

// A filer is a Socket that supports retrieving its associated *os.File.
type filer interface {
	Socket
	File() *os.File
}

var _ syscall.Conn = &Conn{}

// TODO(mdlayher): mutex or similar to enforce syscall.RawConn contract of
// FD remaining valid for duration of calls?

// SyscallConn returns a raw network connection. This implements the
// syscall.Conn interface.
//
// On Go 1.12+, all methods of the returned syscall.RawConn are supported and
// the Conn is integrated with the runtime network poller. On versions of Go
// prior to Go 1.12, only the Control method of the returned syscall.RawConn
// is implemented.
//
// SyscallConn is intended for advanced use cases, such as getting and setting
// arbitrary socket options using the netlink socket's file descriptor.
//
// Once invoked, it is the caller's responsibility to ensure that operations
// performed using Conn and the syscall.RawConn do not conflict with
// each other.
func (c *Conn) SyscallConn() (syscall.RawConn, error) {
	fc, ok := c.sock.(filer)
	if !ok {
		return nil, notSupported("syscall-conn")
	}

	return newRawConn(fc.File())
}

// fixMsg updates the fields of m using the logic specified in Send.
func (c *Conn) fixMsg(m *Message, ml int) {
	if m.Header.Length == 0 {
		m.Header.Length = uint32(nlmsgAlign(ml))
	}

	if m.Header.Sequence == 0 {
		m.Header.Sequence = c.nextSequence()
	}

	if m.Header.PID == 0 {
		m.Header.PID = c.pid
	}
}

// nextSequence atomically increments Conn's sequence number and returns
// the incremented value.
func (c *Conn) nextSequence() uint32 {
	return atomic.AddUint32(c.seq, 1)
}

// Validate validates one or more reply Messages against a request Message,
// ensuring that they contain matching sequence numbers and PIDs.
func Validate(request Message, replies []Message) error {
	for _, m := range replies {
		// Check for mismatched sequence, unless:
		//   - request had no sequence, meaning we are probably validating
		//     a multicast reply
		if m.Header.Sequence != request.Header.Sequence && request.Header.Sequence != 0 {
			return newOpError("validate", errMismatchedSequence)
		}

		// Check for mismatched PID, unless:
		//   - request had no PID, meaning we are either:
		//     - validating a multicast reply
		//     - netlink has not yet assigned us a PID
		//   - response had no PID, meaning it's from the kernel as a multicast reply
		if m.Header.PID != request.Header.PID && request.Header.PID != 0 && m.Header.PID != 0 {
			return newOpError("validate", errMismatchedPID)
		}
	}

	return nil
}

// Config contains options for a Conn.
type Config struct {
	// Groups is a bitmask which specifies multicast groups. If set to 0,
	// no multicast group subscriptions will be made.
	Groups uint32

	// NetNS specifies the network namespace the Conn will operate in.
	//
	// If set (non-zero), Conn will enter the specified network namespace and
	// an error will occur in Dial if the operation fails.
	//
	// If not set (zero), a best-effort attempt will be made to enter the
	// network namespace of the calling thread: this means that any changes made
	// to the calling thread's network namespace will also be reflected in Conn.
	// If this operation fails (due to lack of permissions or because network
	// namespaces are disabled by kernel configuration), Dial will not return
	// an error, and the Conn will operate in the default network namespace of
	// the process. This enables non-privileged use of Conn in applications
	// which do not require elevated privileges.
	//
	// Entering a network namespace is a privileged operation (root or
	// CAP_SYS_ADMIN are required), and most applications should leave this set
	// to 0.
	NetNS int

	// DisableNSLockThread disables package netlink's default goroutine thread
	// locking behavior.
	//
	// By default, the library will lock the processing goroutine to its
	// corresponding OS thread in order to enable communication over netlink to
	// a different network namespace.
	//
	// If the caller already knows that the netlink socket is in the same
	// namespace as the calling thread, this can introduce a performance
	// impact. This option disables the OS thread locking behavior if
	// performance considerations are of interest.
	//
	// If disabled, it is the responsibility of the caller to make sure that all
	// threads are running in the correct namespace.
	//
	// When DisableNSLockThread is set, the caller cannot set the NetNS value.
	DisableNSLockThread bool
}


text:
define(function(require) {
    "use strict";

    var Am = require("../../../ampedjs");

    var Predicate = require("./models/predicate");
    var Promise = require("./models/promise");
    var FunctionHelper = require("./helpers/function-helper");
    var ModelHelper = require("./helpers/model-helper");
    var StorageHelper = require("./helpers/storage-helper");
    var StringHelper = require("./helpers/string-helper");
    var UuidHelper = require("./helpers/uuid-helper");

    /*
        @class Ajax

        @classdesc Ajax module.
    */

    return Am.Module.create("Util", {
        Predicate: Predicate,
        Promise: Promise,
        FunctionHelper: FunctionHelper,
        ModelHelper: ModelHelper,
        StorageHelper: StorageHelper,
        StringHelper: StringHelper,
        UuidHelper: UuidHelper
    });
});


text:
/*************************************************************************/
/*  spatial_player.h                                                     */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                    http://www.godotengine.org                         */
/*************************************************************************/
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur.                 */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/
#ifndef SPATIAL_PLAYER_H
#define SPATIAL_PLAYER_H

#include "scene/3d/spatial.h"
#include "scene/main/node.h"
#include "scene/resources/sample_library.h"
#include "servers/spatial_sound_server.h"
#include "scene/main/viewport.h"

class SpatialPlayer : public Spatial {

	OBJ_TYPE(SpatialPlayer,Spatial);
public:

	enum Param {

		PARAM_VOLUME_DB=SpatialSoundServer::SOURCE_PARAM_VOLUME_DB,
		PARAM_PITCH_SCALE=SpatialSoundServer::SOURCE_PARAM_PITCH_SCALE,
		PARAM_ATTENUATION_MIN_DISTANCE=SpatialSoundServer::SOURCE_PARAM_ATTENUATION_MIN_DISTANCE,
		PARAM_ATTENUATION_MAX_DISTANCE=SpatialSoundServer::SOURCE_PARAM_ATTENUATION_MAX_DISTANCE,
		PARAM_ATTENUATION_DISTANCE_EXP=SpatialSoundServer::SOURCE_PARAM_ATTENUATION_DISTANCE_EXP,
		PARAM_EMISSION_CONE_DEGREES=SpatialSoundServer::SOURCE_PARAM_EMISSION_CONE_DEGREES,
		PARAM_EMISSION_CONE_ATTENUATION_DB=SpatialSoundServer::SOURCE_PARAM_EMISSION_CONE_ATTENUATION_DB,
		PARAM_MAX=SpatialSoundServer::SOURCE_PARAM_MAX
	};

private:

	float params[PARAM_MAX];
	RID source_rid;

	virtual bool _can_gizmo_scale() const;
	virtual RES _get_gizmo_geometry() const;

protected:

	_FORCE_INLINE_ RID get_source_rid() const { return source_rid; }

	void _notification(int p_what);

	static void _bind_methods();

public:

	void set_param( Param p_param, float p_value);
	float get_param( Param p_param) const;

	SpatialPlayer();
	~SpatialPlayer();

};

VARIANT_ENUM_CAST( SpatialPlayer::Param );
#endif // SPATIAL_PLAYER_H


text:
namespace LetterService.ConsoleClient
{
    using System;

    public class EntryPoint
    {
        static void Main()
        {
            var client = new LetterServiceClient();
            var text = "This is text. Just some text. Some, text, Text.";
            var searchedWord = "text";

            Console.WriteLine("Test text: " + text);
            Console.WriteLine("Test searched word: " + searchedWord);
            Console.WriteLine();
            Console.WriteLine("Press any key to get the occurences of the word in the text.");
            Console.WriteLine();

            Console.ReadKey();

            var occurences = client.GetOccurences(text, searchedWord);

            Console.WriteLine("Number of occurences of the searched word " + occurences);
            Console.WriteLine();
            Console.WriteLine("Press any key to exit the program.");

            Console.ReadKey();

            client.Close();
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.wso2.sample</groupId>
    <artifactId>jaxb</artifactId>
    <version>1.0-SNAPSHOT</version>

</project>


text:
package org.springframework.security.web.access.expression;

import java.util.List;

import org.springframework.expression.BeanResolver;
import org.springframework.expression.ConstructorResolver;
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.MethodResolver;
import org.springframework.expression.OperatorOverloader;
import org.springframework.expression.PropertyAccessor;
import org.springframework.expression.TypeComparator;
import org.springframework.expression.TypeConverter;
import org.springframework.expression.TypeLocator;
import org.springframework.expression.TypedValue;

/**
 * An instance of {@link EvaluationContext} that delegates to another implementation.
 *
 * @author Rob Winch
 * @since 4.1
 */
class DelegatingEvaluationContext implements EvaluationContext {
	private final EvaluationContext delegate;

	public DelegatingEvaluationContext(EvaluationContext delegate) {
		super();
		this.delegate = delegate;
	}

	@Override
	public TypedValue getRootObject() {
		return this.delegate.getRootObject();
	}

	@Override
	public List<ConstructorResolver> getConstructorResolvers() {
		return this.delegate.getConstructorResolvers();
	}

	@Override
	public List<MethodResolver> getMethodResolvers() {
		return this.delegate.getMethodResolvers();
	}

	@Override
	public List<PropertyAccessor> getPropertyAccessors() {
		return this.delegate.getPropertyAccessors();
	}

	@Override
	public TypeLocator getTypeLocator() {
		return this.delegate.getTypeLocator();
	}

	@Override
	public TypeConverter getTypeConverter() {
		return this.delegate.getTypeConverter();
	}

	@Override
	public TypeComparator getTypeComparator() {
		return this.delegate.getTypeComparator();
	}

	@Override
	public OperatorOverloader getOperatorOverloader() {
		return this.delegate.getOperatorOverloader();
	}

	@Override
	public BeanResolver getBeanResolver() {
		return this.delegate.getBeanResolver();
	}

	@Override
	public void setVariable(String name, Object value) {
		this.delegate.setVariable(name, value);
	}

	@Override
	public Object lookupVariable(String name) {
		return this.delegate.lookupVariable(name);
	}
}


text:
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][deps-svg]][deps-url]
[![dev dependency status][dev-deps-svg]][dev-deps-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]

[![npm badge][npm-badge-png]][package-url]

An ES2015 spec-compliant `Reflect.ownKeys` shim. Invoke its "shim" method to shim `Reflect.ownKeys` if it is unavailable or noncompliant.

This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES3-supported environment and complies with the [spec](https://tc39.es/ecma262/#sec-reflect.ownkeys).

Most common usage:
```js
var assert = require('assert');
var ownKeys = require('reflect.ownkeys');

var obj = { a: 1, b: 2, c: 3 };
var expected = ['a', 'b', 'c'];

if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') {
	// for environments with Symbol support
	var sym = Symbol();
	obj[sym] = 4;
	obj.d = sym;
	expected.push(sym, 'd');
}

assert.deepEqual(ownKeys(obj), expected);

if (!Reflect.ownKeys) {
	ownKeys.shim();
}

assert.deepEqual(Reflect.ownKeys(obj), expected);
```

## Tests
Simply clone the repo, `npm install`, and run `npm test`

[package-url]: https://npmjs.com/package/reflect.ownkeys
[npm-version-svg]: https://versionbadg.es/es-shims/Reflect.ownKeys.svg
[deps-svg]: https://david-dm.org/es-shims/Reflect.ownKeys.svg
[deps-url]: https://david-dm.org/es-shims/Reflect.ownKeys
[dev-deps-svg]: https://david-dm.org/es-shims/Reflect.ownKeys/dev-status.svg
[dev-deps-url]: https://david-dm.org/es-shims/Reflect.ownKeys#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/reflect.ownkeys.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/reflect.ownkeys.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/reflect.ownkeys.svg
[downloads-url]: https://npm-stat.com/charts.html?package=reflect.ownkeys
[codecov-image]: https://codecov.io/gh/es-shims/Reflect.ownKeys/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/es-shims/Reflect.ownKeys/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/es-shims/Reflect.ownKeys
[actions-url]: https://github.com/es-shims/Reflect.ownKeys/actions


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Verrucaria atroviridis Servít ex J. Nowak & Tobol.

### Remarks
null


text:
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

        <title>Moby-Dick</title>
        <link rel="stylesheet" type="text/css" href="css/stylesheet.css" />
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.orbital.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.orbital.models.SpacecraftLink;
import com.azure.resourcemanager.orbital.models.SpacecraftsPropertiesProvisioningState;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** List of Spacecraft Resource Properties. */
@Fluent
public final class SpacecraftsProperties {
    /*
     * The current state of the resource's creation, deletion, or modification.
     */
    @JsonProperty(value = "provisioningState")
    private SpacecraftsPropertiesProvisioningState provisioningState;

    /*
     * NORAD ID of the spacecraft.
     */
    @JsonProperty(value = "noradId", required = true)
    private String noradId;

    /*
     * Title line of the two-line element set (TLE).
     */
    @JsonProperty(value = "titleLine")
    private String titleLine;

    /*
     * Line 1 of the two-line element set (TLE).
     */
    @JsonProperty(value = "tleLine1")
    private String tleLine1;

    /*
     * Line 2 of the two-line element set (TLE).
     */
    @JsonProperty(value = "tleLine2")
    private String tleLine2;

    /*
     * Immutable list of Spacecraft links.
     */
    @JsonProperty(value = "links")
    private List<SpacecraftLink> links;

    /**
     * Get the provisioningState property: The current state of the resource's creation, deletion, or modification.
     *
     * @return the provisioningState value.
     */
    public SpacecraftsPropertiesProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Set the provisioningState property: The current state of the resource's creation, deletion, or modification.
     *
     * @param provisioningState the provisioningState value to set.
     * @return the SpacecraftsProperties object itself.
     */
    public SpacecraftsProperties withProvisioningState(SpacecraftsPropertiesProvisioningState provisioningState) {
        this.provisioningState = provisioningState;
        return this;
    }

    /**
     * Get the noradId property: NORAD ID of the spacecraft.
     *
     * @return the noradId value.
     */
    public String noradId() {
        return this.noradId;
    }

    /**
     * Set the noradId property: NORAD ID of the spacecraft.
     *
     * @param noradId the noradId value to set.
     * @return the SpacecraftsProperties object itself.
     */
    public SpacecraftsProperties withNoradId(String noradId) {
        this.noradId = noradId;
        return this;
    }

    /**
     * Get the titleLine property: Title line of the two-line element set (TLE).
     *
     * @return the titleLine value.
     */
    public String titleLine() {
        return this.titleLine;
    }

    /**
     * Set the titleLine property: Title line of the two-line element set (TLE).
     *
     * @param titleLine the titleLine value to set.
     * @return the SpacecraftsProperties object itself.
     */
    public SpacecraftsProperties withTitleLine(String titleLine) {
        this.titleLine = titleLine;
        return this;
    }

    /**
     * Get the tleLine1 property: Line 1 of the two-line element set (TLE).
     *
     * @return the tleLine1 value.
     */
    public String tleLine1() {
        return this.tleLine1;
    }

    /**
     * Set the tleLine1 property: Line 1 of the two-line element set (TLE).
     *
     * @param tleLine1 the tleLine1 value to set.
     * @return the SpacecraftsProperties object itself.
     */
    public SpacecraftsProperties withTleLine1(String tleLine1) {
        this.tleLine1 = tleLine1;
        return this;
    }

    /**
     * Get the tleLine2 property: Line 2 of the two-line element set (TLE).
     *
     * @return the tleLine2 value.
     */
    public String tleLine2() {
        return this.tleLine2;
    }

    /**
     * Set the tleLine2 property: Line 2 of the two-line element set (TLE).
     *
     * @param tleLine2 the tleLine2 value to set.
     * @return the SpacecraftsProperties object itself.
     */
    public SpacecraftsProperties withTleLine2(String tleLine2) {
        this.tleLine2 = tleLine2;
        return this;
    }

    /**
     * Get the links property: Immutable list of Spacecraft links.
     *
     * @return the links value.
     */
    public List<SpacecraftLink> links() {
        return this.links;
    }

    /**
     * Set the links property: Immutable list of Spacecraft links.
     *
     * @param links the links value to set.
     * @return the SpacecraftsProperties object itself.
     */
    public SpacecraftsProperties withLinks(List<SpacecraftLink> links) {
        this.links = links;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (noradId() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property noradId in model SpacecraftsProperties"));
        }
        if (links() != null) {
            links().forEach(e -> e.validate());
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(SpacecraftsProperties.class);
}


text:
package position

// Position holds offset into the input
type Position struct {
	Line   int // current line in the input (first line is 1, not 0).
	Column int // current column in the input (in runes, not bytes, first column is 1, not 0)
	Offset int // offset in bytes of the current rune.
}


text:
namespace COA.Game.UI.Controls {
  partial class ArchiveControl {
    /// <summary>
    /// Required designer variable.
    /// </summary>
    private System.ComponentModel.IContainer components = null;

    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    protected override void Dispose(bool disposing) {
      if(disposing && (components != null)) {
        components.Dispose();
      }
      base.Dispose(disposing);
    }

    #region Component Designer generated code

    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent() {
      this.structuralTable = new System.Windows.Forms.TableLayoutPanel();
      this.infoTable = new System.Windows.Forms.TableLayoutPanel();
      this.title = new System.Windows.Forms.Label();
      this.description = new System.Windows.Forms.Label();
      this.detailsTable = new System.Windows.Forms.TableLayoutPanel();
      this.version = new System.Windows.Forms.Label();
      this.license = new System.Windows.Forms.Label();
      this.url = new System.Windows.Forms.LinkLabel();
      this.author = new System.Windows.Forms.Label();
      this.buttonTable = new System.Windows.Forms.TableLayoutPanel();
      this.play = new System.Windows.Forms.Button();
      this.delete = new System.Windows.Forms.Button();
      this.structuralTable.SuspendLayout();
      this.infoTable.SuspendLayout();
      this.detailsTable.SuspendLayout();
      this.buttonTable.SuspendLayout();
      this.SuspendLayout();
      //
      // structuralTable
      //
      this.structuralTable.ColumnCount = 1;
      this.structuralTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
      this.structuralTable.Controls.Add(this.infoTable, 0, 0);
      this.structuralTable.Controls.Add(this.buttonTable, 0, 1);
      this.structuralTable.Dock = System.Windows.Forms.DockStyle.Fill;
      this.structuralTable.Location = new System.Drawing.Point(0, 0);
      this.structuralTable.Name = "structuralTable";
      this.structuralTable.RowCount = 2;
      this.structuralTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 75F));
      this.structuralTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 25F));
      this.structuralTable.Size = new System.Drawing.Size(533, 191);
      this.structuralTable.TabIndex = 0;
      //
      // infoTable
      //
      this.infoTable.ColumnCount = 1;
      this.infoTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
      this.infoTable.Controls.Add(this.title, 0, 0);
      this.infoTable.Controls.Add(this.description, 0, 1);
      this.infoTable.Controls.Add(this.detailsTable, 0, 3);
      this.infoTable.Controls.Add(this.author, 0, 2);
      this.infoTable.Dock = System.Windows.Forms.DockStyle.Fill;
      this.infoTable.Location = new System.Drawing.Point(3, 3);
      this.infoTable.Name = "infoTable";
      this.infoTable.RowCount = 4;
      this.infoTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 20F));
      this.infoTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
      this.infoTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 15F));
      this.infoTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 15F));
      this.infoTable.Size = new System.Drawing.Size(527, 137);
      this.infoTable.TabIndex = 1;
      //
      // title
      //
      this.title.AutoSize = true;
      this.title.Dock = System.Windows.Forms.DockStyle.Fill;
      this.title.Font = new System.Drawing.Font("Microsoft Sans Serif", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
      this.title.Location = new System.Drawing.Point(3, 0);
      this.title.Name = "title";
      this.title.Size = new System.Drawing.Size(521, 27);
      this.title.TabIndex = 1;
      this.title.Text = "Title!";
      this.title.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
      //
      // description
      //
      this.description.AutoSize = true;
      this.description.Dock = System.Windows.Forms.DockStyle.Fill;
      this.description.Location = new System.Drawing.Point(3, 27);
      this.description.Name = "description";
      this.description.Size = new System.Drawing.Size(521, 68);
      this.description.TabIndex = 2;
      this.description.Text = "this is a description!";
      //
      // detailsTable
      //
      this.detailsTable.ColumnCount = 3;
      this.detailsTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
      this.detailsTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
      this.detailsTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33333F));
      this.detailsTable.Controls.Add(this.version, 0, 0);
      this.detailsTable.Controls.Add(this.license, 1, 0);
      this.detailsTable.Controls.Add(this.url, 2, 0);
      this.detailsTable.Dock = System.Windows.Forms.DockStyle.Fill;
      this.detailsTable.Location = new System.Drawing.Point(3, 118);
      this.detailsTable.Name = "detailsTable";
      this.detailsTable.RowCount = 1;
      this.detailsTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
      this.detailsTable.Size = new System.Drawing.Size(521, 16);
      this.detailsTable.TabIndex = 0;
      //
      // version
      //
      this.version.AutoSize = true;
      this.version.Dock = System.Windows.Forms.DockStyle.Fill;
      this.version.Location = new System.Drawing.Point(3, 0);
      this.version.Name = "version";
      this.version.Size = new System.Drawing.Size(167, 16);
      this.version.TabIndex = 0;
      this.version.Text = "Version: 0.0.1";
      this.version.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
      //
      // license
      //
      this.license.AutoSize = true;
      this.license.Dock = System.Windows.Forms.DockStyle.Fill;
      this.license.Location = new System.Drawing.Point(176, 0);
      this.license.Name = "license";
      this.license.Size = new System.Drawing.Size(167, 16);
      this.license.TabIndex = 1;
      this.license.Text = "License: Public Domain";
      this.license.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
      //
      // url
      //
      this.url.AutoSize = true;
      this.url.Dock = System.Windows.Forms.DockStyle.Fill;
      this.url.Location = new System.Drawing.Point(349, 0);
      this.url.Name = "url";
      this.url.Size = new System.Drawing.Size(169, 16);
      this.url.TabIndex = 2;
      this.url.TabStop = true;
      this.url.Text = "updateme.com";
      this.url.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
      //
      // author
      //
      this.author.AutoSize = true;
      this.author.Dock = System.Windows.Forms.DockStyle.Fill;
      this.author.Location = new System.Drawing.Point(3, 95);
      this.author.Name = "author";
      this.author.Size = new System.Drawing.Size(521, 20);
      this.author.TabIndex = 3;
      this.author.Text = "Author(s): ";
      this.author.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
      //
      // buttonTable
      //
      this.buttonTable.ColumnCount = 2;
      this.buttonTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
      this.buttonTable.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
      this.buttonTable.Controls.Add(this.play, 0, 0);
      this.buttonTable.Controls.Add(this.delete, 1, 0);
      this.buttonTable.Dock = System.Windows.Forms.DockStyle.Fill;
      this.buttonTable.Location = new System.Drawing.Point(3, 146);
      this.buttonTable.Name = "buttonTable";
      this.buttonTable.RowCount = 1;
      this.buttonTable.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
      this.buttonTable.Size = new System.Drawing.Size(527, 42);
      this.buttonTable.TabIndex = 0;
      //
      // play
      //
      this.play.Dock = System.Windows.Forms.DockStyle.Fill;
      this.play.Location = new System.Drawing.Point(3, 3);
      this.play.Name = "play";
      this.play.Size = new System.Drawing.Size(257, 36);
      this.play.TabIndex = 0;
      this.play.Text = "Play!";
      this.play.UseVisualStyleBackColor = true;
      this.play.Click += new System.EventHandler(this.Play);
      //
      // delete
      //
      this.delete.Dock = System.Windows.Forms.DockStyle.Fill;
      this.delete.Location = new System.Drawing.Point(266, 3);
      this.delete.Name = "delete";
      this.delete.Size = new System.Drawing.Size(258, 36);
      this.delete.TabIndex = 1;
      this.delete.Text = "Delete this";
      this.delete.UseVisualStyleBackColor = true;
      this.delete.Click += new System.EventHandler(this.Delete);
      //
      // ArchiveControl
      //
      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
      this.Controls.Add(this.structuralTable);
      this.Name = "ArchiveControl";
      this.Size = new System.Drawing.Size(533, 191);
      this.structuralTable.ResumeLayout(false);
      this.infoTable.ResumeLayout(false);
      this.infoTable.PerformLayout();
      this.detailsTable.ResumeLayout(false);
      this.detailsTable.PerformLayout();
      this.buttonTable.ResumeLayout(false);
      this.ResumeLayout(false);

    }

    #endregion

    private System.Windows.Forms.TableLayoutPanel structuralTable;
    private System.Windows.Forms.TableLayoutPanel buttonTable;
    private System.Windows.Forms.TableLayoutPanel infoTable;
    private System.Windows.Forms.TableLayoutPanel detailsTable;
    private System.Windows.Forms.Button play;
    private System.Windows.Forms.Button delete;
    private System.Windows.Forms.Label version;
    private System.Windows.Forms.Label license;
    private System.Windows.Forms.LinkLabel url;
    private System.Windows.Forms.Label title;
    private System.Windows.Forms.Label description;
    private System.Windows.Forms.Label author;
  }
}


text:
function rootpath = m2troot(varargin)
    % M2TROOT produces paths inside the matlab2tikz repository
    %
    % Usage:
    %   There are two ways to call this function, the base syntax is:
    %
    %       * rootpath = m2troot()
    %
    %   where |rootpath|  points towards the root of the repository.
    %
    %   The other syntax:
    %
    %       * path = m2troot(...)
    %
    %    is equivalent to |fullfile(m2troot, ...)| and as such allows to
    %    easily produce a path to any file within the repository.

    m2t = which('matlab2tikz');
    if isempty(m2t)
        error('M2TRoot:NotFound', 'Matlab2tikz was not found on the PATH!')
    end

    [srcpath] = fileparts(m2t);  % this should be $(m2troot)/src
    [rootpath, srcdir] = fileparts(srcpath); % this should be $(m2troot)
    assert(strcmpi(srcdir,'src'));

    if nargin >= 1
        rootpath = fullfile(rootpath, varargin{:});
    end
end


text:
* Add support for negative groups in `format` function.
* Add support for processing of nested groups in `format` function.
* Support of weeks.

### 1.0.0 / 2018-12-22

* Add support for conditional groups in `format` function.
* Add types declaration file.
* Remove JAM and SPM support.

### 0.1.0 / 2015-01-11

* Fix Bower config.
* Migration to [Component](https://github.com/componentjs/component) 1.0.


text:
package io.pivotal.spring.cloud.service.eureka;

import java.util.HashMap;
import java.util.Map;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.Mockito;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.client.loadbalancer.LoadBalancerRequestFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpRequest;
import org.springframework.http.client.ClientHttpRequestExecution;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.web.client.RestTemplate;

import static org.hamcrest.Matchers.contains;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.verify;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = SurgicalRoutingRequestTransformerIntegrationTest.TestConfig.class, properties = {
		"vcap.application.uris[0]=www.route.local"
})
public class SurgicalRoutingRequestTransformerIntegrationTest {
	@Mock
	private HttpRequest originalRequest;
	@Mock
	private ClientHttpRequestExecution execution;
	@Mock
	private ServiceInstance instance;

	private byte[] body = new byte[] {};

	@Autowired
	private LoadBalancerRequestFactory lbReqFactory;

	@Test
	public void transformer() throws Exception {
		Map<String, String> metadata = new HashMap<>();
		metadata.put("cfAppGuid", "123");
		metadata.put("cfInstanceIndex", "4");
		HttpHeaders originalHeaders = new HttpHeaders();
		originalHeaders.add("foo", "bar");
		originalHeaders.add("foo", "baz");
		Mockito.when(instance.getMetadata()).thenReturn(metadata);
		Mockito.when(originalRequest.getHeaders()).thenReturn(originalHeaders);

		lbReqFactory.createRequest(originalRequest, body, execution).apply(instance);

		ArgumentCaptor<HttpRequest> httpRequestCaptor = ArgumentCaptor.forClass(HttpRequest.class);
		verify(execution).execute(httpRequestCaptor.capture(), eq(body));
		HttpRequest transformedRequest = httpRequestCaptor.getValue();
		assertThat(transformedRequest.getHeaders().get("foo"), contains("bar", "baz"));
		assertEquals("123:4", transformedRequest.getHeaders().getFirst("X-CF-APP-INSTANCE"));
	}

	@SpringBootApplication
	@EnableDiscoveryClient
	static class TestConfig {

		@LoadBalanced
		@Bean
		public RestTemplate restTemplate() {
			return new RestTemplate();
		}
	}

}


text:
CREATE TABLE [dbo].[AdditionalTrip] (
    [Id]           INT            IDENTITY (1, 1) NOT NULL,
    [RegularId]    INT            NOT NULL,
    [AdditionalId] INT            NOT NULL,
    [Number]       INT            NOT NULL,
    [Notes]        NVARCHAR (225) NULL,
    CONSTRAINT [PK_dbo.AdditionalTrip] PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_dbo.AdditionalTrip_dbo.Additional_AdditionalId] FOREIGN KEY ([AdditionalId]) REFERENCES [dbo].[Additional] ([Id]) ON DELETE CASCADE,
    CONSTRAINT [FK_dbo.AdditionalTrip_dbo.Regulars_RegularId] FOREIGN KEY ([RegularId]) REFERENCES [dbo].[Regulars] ([Id]) ON DELETE CASCADE
);

GO
CREATE NONCLUSTERED INDEX [IX_RegularId]
    ON [dbo].[AdditionalTrip]([RegularId] ASC);

GO
CREATE NONCLUSTERED INDEX [IX_AdditionalId]
    ON [dbo].[AdditionalTrip]([AdditionalId] ASC);


text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.airlift.security.jwks;

import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableList;
import io.airlift.json.JsonCodec;
import io.airlift.log.Logger;

import java.math.BigInteger;
import java.security.PublicKey;
import java.security.spec.ECParameterSpec;
import java.security.spec.ECPoint;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;

import static com.google.common.collect.ImmutableMap.toImmutableMap;
import static java.util.Base64.getUrlDecoder;
import static java.util.Objects.requireNonNull;

public final class JwksDecoder
{
    private static final Logger log = Logger.get(JwksDecoder.class);
    private static final JsonCodec<JsonKeys> KEYS_CODEC = JsonCodec.jsonCodec(JsonKeys.class);

    private JwksDecoder() {}

    public static Map<String, PublicKey> decodeKeys(String jwksJson)
    {
        JsonKeys keys = KEYS_CODEC.fromJson(jwksJson);
        return keys.getKeys().stream()
                .map(JwksDecoder::tryDecodeJwkKey)
                .filter(Optional::isPresent)
                .map(Optional::get)
                .collect(toImmutableMap(JwkPublicKey::getKeyId, Function.identity()));
    }

    public static Optional<? extends JwkPublicKey> tryDecodeJwkKey(JsonKey key)
    {
        // key id is required to index the key
        if (!key.getKid().isPresent() || key.getKid().get().isEmpty()) {
            return Optional.empty();
        }
        String keyId = key.getKid().get();
        switch (key.getKty()) {
            case "RSA":
                return tryDecodeRsaKey(keyId, key);
            case "EC":
                return tryDecodeEcKey(keyId, key);
            default:
                // ignore non unknown keys
                return Optional.empty();
        }
    }

    public static Optional<JwkRsaPublicKey> tryDecodeRsaKey(String keyId, JsonKey key)
    {
        // alg field is optional so not verified
        // use field is optional so not verified
        Optional<BigInteger> modulus = key.getStringProperty("n").flatMap(encodedModulus -> decodeBigint(keyId, "modulus", encodedModulus));
        if (!modulus.isPresent()) {
            return Optional.empty();
        }
        Optional<BigInteger> exponent = key.getStringProperty("e").flatMap(encodedExponent -> decodeBigint(keyId, "exponent", encodedExponent));
        if (!exponent.isPresent()) {
            return Optional.empty();
        }
        return Optional.of(new JwkRsaPublicKey(keyId, exponent.get(), modulus.get()));
    }

    public static Optional<JwkEcPublicKey> tryDecodeEcKey(String keyId, JsonKey key)
    {
        // alg field is optional so not verified
        // use field is optional so not verified
        Optional<String> curveName = key.getStringProperty("crv");
        Optional<ECParameterSpec> curve = curveName.flatMap(EcCurve::tryGet);
        if (!curve.isPresent()) {
            log.error("JWK EC %s curve '%s' is not supported", keyId, curveName);
            return Optional.empty();
        }
        Optional<BigInteger> x = key.getStringProperty("x").flatMap(encodedX -> decodeBigint(keyId, "x", encodedX));
        if (!x.isPresent()) {
            return Optional.empty();
        }
        Optional<BigInteger> y = key.getStringProperty("y").flatMap(encodedY -> decodeBigint(keyId, "y", encodedY));
        if (!y.isPresent()) {
            return Optional.empty();
        }

        ECPoint w = new ECPoint(x.get(), y.get());
        return Optional.of(new JwkEcPublicKey(keyId, curve.get(), w));
    }

    private static Optional<BigInteger> decodeBigint(String keyId, String fieldName, String encodedNumber)
    {
        try {
            return Optional.of(new BigInteger(1, getUrlDecoder().decode(encodedNumber)));
        }
        catch (IllegalArgumentException e) {
            log.error(e, "JWK %s %s is not a valid number", keyId, fieldName);
            return Optional.empty();
        }
    }

    public static class JsonKeys
    {
        private final List<JsonKey> keys;

        @JsonCreator
        public JsonKeys(@JsonProperty("keys") List<JsonKey> keys)
        {
            this.keys = ImmutableList.copyOf(requireNonNull(keys, "keys is null"));
        }

        public List<JsonKey> getKeys()
        {
            return keys;
        }
    }

    public static class JsonKey
    {
        private final String kty;
        private final Optional<String> kid;
        private final Map<String, Object> other = new HashMap<>();

        @JsonCreator
        public JsonKey(
                @JsonProperty("kty") String kty,
                @JsonProperty("kid") Optional<String> kid)
        {
            this.kty = requireNonNull(kty, "kty is null");
            this.kid = requireNonNull(kid, "kid is null");
        }

        public String getKty()
        {
            return kty;
        }

        public Optional<String> getKid()
        {
            return kid;
        }

        public Optional<String> getStringProperty(String name)
        {
            Object value = other.get(name);
            if (value instanceof String && !((String) value).isEmpty()) {
                return Optional.of((String) value);
            }
            return Optional.empty();
        }

        @JsonAnySetter
        public void set(String name, Object value)
        {
            other.put(name, value);
        }
    }
}


text:
require([
	"app/controllers/MoviesController",
	"app/controllers/MovieController",
	"dojo/parser"
]);


text:
<?php
include_once ('header.php');
?>

Return Penjualan

    <form method="post" enctype="multipart/form-data">

                ID Transaksi

                    <input class="form-control" type="text" name="idnya" placeholder="cari id transaksi" required/>

                    <input class="button-a button-a-background" type="submit" name="cari_tr" value="Cek transaksi"/>

    </form>
    <?php
    if (isset($_POST['cari_tr'])) {
        $idnya = $_POST['idnya'];
        $qcr = "select detail_penjualan.id_transaksi,barang.id_barang,detail_penjualan.id_detail, barang.nama_barang, detail_penjualan.jumlah from detail_penjualan left join barang on detail_penjualan.id_barang = barang.id_barang where id_transaksi='$idnya'";
        $ex = mysqli_query($kon, $qcr);
        while ($datacari = mysqli_fetch_array($ex)) {
            ?>
            <form method="post" enctype="multipart/form-data">

                    <input type="hidden" name="id_detail[]" value="<?php echo $datacari['id_detail']; ?>">
                    <input type="hidden" name="id_barang[]" value="<?php echo $datacari['id_barang']; ?>">
                    <input type="text" name="nama_barang[]" value="<?php echo $datacari['nama_barang']; ?>" readonly>
                    <input type="text" name="jumlah[]" value="<?php echo $datacari['jumlah']; ?>" readonly>
                    <input type="number" name="jumlah_return[]" max="<?php echo $datacari['jumlah']; ?>" min="0">

                <?php
            }
            ?>
            <input type="submit" name="breturn" >
        </form>
    <?php }
        if (isset($_POST['breturn'])) {
            echo 'udh diklik';
            $idbreturn = $_POST['id_detail'];
            $idbbarang = $_POST['id_barang'];
            $jumlahreturn = $_POST['jumlah_return'];
            $Id_trx = mysqli_insert_id($kon);
            $jadinya = 0;
            $jadinya2 = 0;
            for ($i = 0; $i < count($idbreturn); $i++) {
                $Id_return = $idbreturn[$i];
                $idbrg = $idbbarang[$i];
                $Jml = $jumlahreturn[$i];
                $q = "select stok from barang where id_barang='$idbrg'";
                $detail = "update barang set stok=stok+'$Jml' where id_barang='$idbrg'";
                $a = mysqli_query($kon, $detail);
                $detail2 = "update detail_penjualan set jumlah=jumlah-'$Jml' where id_detail='$Id_return'";
                $a2 = mysqli_query($kon, $detail2);
            }
        }
    ?>
    <?php include_once ('footer.php'); ?>


text:
**_Puzzle: Assuming that Bob is willing to follow simple instructions, is there any way you can guarantee that tomorrow you will eat lunch before Bob?_**

Yes, you can have Bob wait to eat until you call him and then you can eat and then call Bob.

**_Puzzle: What path yields output 5 and final value 5?
Puzzle: What path yields output 7 and final value 7?
Puzzle: Is there a path that yields output 7 and final value 5? Can you
prove it?_**

b1->a1->a2

a1->b1->a2

No, the statements in A must occur sequentially.

**_What is the largest possible value of count after all threads have completed?
What is the smallest possible value?_**

1000000; 100