text:
---
title: "Segment Routing over UDP(SRoU)"
abbrev: Segment Routing over UDP(SRoU)
docname: draft-zartbot-sr-udp-01
date: {DATE}
category: exp
ipr: trust200902
area: Transport
workgroup: SPRING

stand_alone: yes
pi: [toc, sortrefs, symrefs, docmapping]

author:
  -
    ins: K. Fang
    name: Kevin Fang
    org: Cisco Systems, Inc.
    email<EMAIL_ADDRESS>  -
    ins: Y. Li
    name: Yinghao Li
    org: Google, Inc.
    email<EMAIL_ADDRESS>  -
    ins: F. Cai
    name: Feng Cai
    org:  Cisco Systems, Inc.
    email<EMAIL_ADDRESS>
--- abstract

This document defines the Segment Routing Header{{!RFC8754}} extension
in UDP transport protocol with Network Address Translation Traversal.

--- middle

# Introduction

Many UDP based transport protocol(eg, IPSec/DTLS/QUIC) could provide a secure
transportation layer to handle overlay traffic. How ever it does not flexible
for source based path enforcement.

This document defines a new Segment Routing Header in UDP payload to enable
segment routing over UDP(SRoU) for IPSec/DTLS/QUIC or other UDP based traffic.

Segment Routing over UDP(SRoU) interworking with QUIC could provide a generic
programmable and secure transport layer for next generation applications.

Discussion of this work is encouraged to happen on GitHub repository which
contains the draft: <https://github.com/zartbot/draft-quic-sr>

## Specification of Requirements

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in BCP 14
{{?RFC2119}} {{?RFC8174}} when, and only when,
they appear in all capitals, as shown here.

## Motivation

Segment Routing provides source-based path enforcement and transportation level
programmability but lacks of IPv4 support for transport over internet.

MPLS-over-UDP{{!RFC7510}} and MPLS Segment Routing over IP{{!RFC8663}}
defined SR-MPLS over IPv4 network, but it lacks of NAT traversal capabilities.

Many SDWAN vendors defined their private protocols for routing control over
multiple public cloud and internet, it’s hard for interop with multi-vendors.

Many applications may require intelligence traffic steering(CDN/LB case),
SRoU with QUIC could be used in these cases.

# SR over UDP(SRoU) Packet encapsulation

The SRoU defined a generic segment routing enabled transport layer,the SR Header
insert in UDP payload.

~~~

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           IP Header                           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           UDP Header                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                          SRoU Header                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                            Payload                            +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

~~~
{: #srou-encap title="SRoU encapsulation"}

## SR over UDP(SRoU) Header

SR over UDP must be present at the head of UDP payload. The basic header
shows as below:

~~~
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    MagicNum   |  SRoU Length  |H|T|S| F |   Reserve   |ProtoID|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  SegmentType  |   SRH Length  |   LastEntry   |  Segment Left |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|          SegmentList[0](Length Based on Segment Type)         |
+                               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~~~
{: #srh-basic-format title="SRoU Basic Header"}

The full header shows as below which extend 3 fields:

1.FlowID: Flow tracing and connection migration.

2.SourceAddress and Port: used for NAT-T.

3.HMAC: used for Header integrity check.

~~~
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|    MagicNum   |  SRoU Length  |H|T|S| F |   Reserve   |ProtoID|
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|                       Flow ID(Optional)                       |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|  SegmentType  |   SRH Length  |   LastEntry   |  Segment Left |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+               Source Address and Port(Optional)               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+          SegmentList[0](Length Based on Segment Type)         +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                                                               +
|                               ...                             |
+                                                               +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+          SegmentList[N](Length Based on Segment Type)         +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                    Optional Data (Variable)                   +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                                               |
+                       HMAC(If H-bit set)                      +
|                                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

~~~
{: #srh-full-format title="SRoU Full Header"}

Magic Number:
      1 Byte field
      For QUIC: could set to ALL ZERO to diffenciate with original header.
      For IPSec: could set to 0xFE value and avoid SPI allocation in
                 this range.
                 *0x00 may conflict with NON-ESP HEADER.
                 *0xFF may conflict with KeepAlive Message.

SRoU Length:
      1 Byte, The byte length of a SRoU header.

H-Bit:
      1 Bit, request HMAC based Authentication Header.

T-Bit:
      1 Bit, request per-hop based inband telemetry.

S-Bit:
      1 Bit, indicate Source Address and Port exist in SRH.

F-Bit:
      2 Bits, Flow ID Type

| Type | Name        |Flow ID Length(bits)       |
|-----:|:------------|:--------------------------|
|  0x0 | NO Flow     | 0                         |
|  0x1 | Short ID    | 64                        |
|  0x2 | Long ID     | 128                       |
|  0x3 | Variable ID | variable length           |
{: #flow-id-type title="Flow ID type field"}

Protocol-ID:

| Type | Name        |Section                              |
|-----:|:------------|:------------------------------------|
|  0x0 | OAM         | for Link state probe and other OAM  |
|  0x1 | IPv4        | Indicate inner payload is IPv4 pkt  |
|  0x2 | IPv6        | Indicate inner payload is IPv6 pkt  |
{: #protocol-id title="Protocol ID field"}

Source Address:
       Protocol-ID = 1, this field is 4-Bytes IPv4 address
       Protocol-ID = 2, this field is 16-Bytes IPv6 address

Source Port:
       Source UDP Port Number

Segment Type:

| Type | Name                          | Len  |Section                 |
|-----:|:------------------------------|:-----|:-----------------------|
|  0x0 | Reserved                      |      |                        |
|  0x1 | IPv4 Address+ Port            | 48b  |{{ipv4-locator}}        |
|  0x2 | SRv6                          | 128b |{{srv6-locator}}        |
|  0x3 | Compressed Segment List       | 128b |{{cSID}}                |
{: #segment-types title="Segment Types"}

SR Hdr Len:
: SR Header length, include the SR Header flags  Segment-List and Optional TLV.

Last Entry:
: contains the index(zero based), in the Segment List, of
  the last element of the Segment List.

Segments Left:
: 8-bit unsigned integer. Number of route segemnts remaining,
  i.e., number of explicitly listed intermediate nodes still
  to be visited before reaching the final destination.

Segment List[0..n]:
: 128-bit/48-bit/144-bit addresses to represent the SR Policy.
  Detailed forwarding behavior will be defined in {{pkt-proccessing}}

TLV:
: Opptional TLV used for future extension.currently only defined
  the following TLV.

| Type | Value               | Len      |Section                 |
|-----:|:--------------------|:---------|:-----------------------|
|  0x1 | Micro Segment Policy| variable |{{useg-policy}}         |
|  0x2 | End.PacketInfo      | variable |{{end-packet-info}}     |
{: #optional-tlv-types title="Optional TLV"}

VXLAN Replacement

Most Efficient Header shows

# Packet Processing {#pkt-proccessing}

This section describe the packet proccessing procedure. The following
topology will be used in this section.

~~~
H1---R1----------I1------R3----------+---R4---H2
     |                               |
     |-----------R2------------------|
                 |
                 |
                 I2

I1,I2: Interim Node that support SRoU
R1~R4: Traditional Router
H1,H2: Host
~~~
{: #pp-topology title="Topology for packet proccesing"}

| Host | Address                  | SRoU Port| Post NAT         |
|-----:|:-------------------------|:---------|:-----------------|
|  H1  | <IP_ADDRESS>              | 5111     |  <IP_ADDRESS>:23456  |
|  R1  | <IP_ADDRESS>/<IP_ADDRESS>     |          |                  |
|  R2  | <IP_ADDRESS>                 |          |                  |
|  R3  | <IP_ADDRESS>                 |          |                  |
|  R4  | <IP_ADDRESS>                 |          |                  |
|  H2  | <IP_ADDRESS>                | 443      |  <IP_ADDRESS>:443    |
|  I1  | <IP_ADDRESS>                | 8811     |                  |
|  I2  | <IP_ADDRESS>             | 8822     |  <IP_ADDRESS>:12345  |
{: #ipv4-addr title="IP address table"}

## Type:0x1, IPv4 Locator Mode {#ipv4-locator}

In this mode, the endpoint could directly insert the interim node IPv4
addresses and port into the segment-list.

### General forwarding case
For example, H1 intend to send packet to H2 via R1-->I2---->H2,
In this case SRoU packet will be NATed twice to show the NAT traversal workflow.
I2's public address could use STUN{{!RFC5389}} protocol detected and sync to all
SRoU enabled devices.

H1 send packet with SRoU Header as below, H1 could use STUN detect it's source
public address, but consider the simplicity, the 1st hop SRoU forwarder cloud
update the source ip/port field in SRoU header.

~~~
IP/UDP Header {
  Source IP: <IP_ADDRESS>,
  Destination IP: <IP_ADDRESS>(SegmentList[1],I2 Pre-NAT public address),
  Source Port: 5111,
  Destination Port: 12345(SegmentList[1],I2 Pre-NAT public port),
}
SRoU Header {
  Magic Num = 0x0
  SRoU Length = 29
  FlowID Length = 0x3
  Protocol-ID = 0x1(IPv4),
  FlowID =  0x123,
  Source Address = <IP_ADDRESS>,
  Source Port = 5111,
  Segment Left = 0x1,
  Last Entry   = 0x1,
  SegmenetList[0] = <IP_ADDRESS>:443(H2),
  SegmenetList[1] = <IP_ADDRESS>:12345(I2),
}
~~~
{: #type-1-h1-i2 title="Type:0x1 H1-->I2 Packet Header"}

R1 is a NAT Device it will change the Source IP/Port to <IP_ADDRESS>:23456.
But this router may not have ALG function to modify SRoU Header.Then packet
will send to <IP_ADDRESS>:12345. It will be NAT again to I2.

After twice NAT, I2 Recieved packet as below:

~~~
IP/UDP Header {
  Source IP: <IP_ADDRESS>(H1 post NAT addr),
  Destination IP: <IP_ADDRESS>(I2 private addr),
  Source Port: 23456(H1 post NAT port),
  Destination Port: 8822(I2 private port),
}
SRoU Header {
  Magic Num = 0x0
  SRoU Length = 29
  FlowID Length = 0x3
  Protocol-ID = 0x1(IPv4),
  FlowID =  0x123,
  Source Address = <IP_ADDRESS>,
  Source Port = 5111,
  Segment Left = 0x1,
  Last Entry   = 0x1,
  SegmenetList[0] = <IP_ADDRESS>:443(H2),
  SegmenetList[1] = <IP_ADDRESS>:12345(I2),
}
~~~
{: #type-1-i2-recieved title="Type:0x1 H1-->I2, I2 Recieved Packet Header"}

if the (LastEntry == Segment Left) indicate I2 is the 1st hop SRoU forwarder,
It MUST apply ALG to update the Source Address/Port field by the IP/UDP header.
Then it will execute Segment Left - 1, and copy SegmentList[0] to DA/Dport.
Consider some interim router like R2 has URPF checking, the SA/Sport will also
updated to I2 SRoU socket address.

I2--->H2 packet:

~~~
IP/UDP Header {
  Source IP: <IP_ADDRESS>(I2 Private),
  Destination IP: <IP_ADDRESS>(SegmentList[0]),
  Source Port: 8822(I2 Private),
  Destination Port: 443(SegmentList[0]),
}
SRoU Header {
  Magic Num = 0x0
  SRoU Length = 29
  FlowID Length = 0x3
  Protocol-ID = 0x1(IPv4),
  FlowID =  0x123,
  Source Address = <IP_ADDRESS>(update by I2 ALG),
  Source Port = 23456(update by I2 ALG),
  Segment Left = 0x0(SL--),
  Last Entry   = 0x1,
  SegmenetList[0] = <IP_ADDRESS>:443(H2),
  SegmenetList[1] = <IP_ADDRESS>:12345(I2),
}
~~~
{: #type-1-i2h2 title="Type:0x1 I2-->H2 Packet Header"}

H2 will recieve the packet, and if the segment left == 0, it MUST copy the
Source Address and Port into IP/UDP Header and strip out the SRoU Header and
send to udp socket. It may cache the reversed segmentlist for symmetric routing.

H2 send to UDP socket

~~~
IP/UDP Header {
  Source IP: <IP_ADDRESS>(Copied from SRoU Src field),
  Destination IP: <IP_ADDRESS>(Static NAT by R4),
  Source Port: 23456(Copied from SRoU Src field),
  Destination Port: 443(SegmentList[0]),
}
UDP Payload {
}
~~~
{: #type-1-h2tx title="Type:0x1 H2 Send to UDP socket"}

### Programable forwarding case

In type:0x1 mode, each segment has 48bit(32bit IPv4 address with 16bit port).
It could be defined for programable forwarding with special IPv4 prefix( ie.
<IP_ADDRESS>/8):

Prefix:<32bit functions and args>

For exmaple we could defined EVPN/VPNv4/VPNv6 function in SRoU header by SID:

255:<16bit End.X function>:<24bit VPN ID>

## Type:0x2, SRv6 format {#srv6-locator}

IPv6 does not need to consider the NAT traversal case, In this mode almost
forwarding action is same as SRv6. This is only used for application driven
traffic steering(like CDN/LB usecase.). It has some benefit interworking with
QUIC, the pure userspace implementation could provide additional flexibility.

For example some IOT sensor with legacy kernel stack does not support SRv6 could
use SRoU insert SRH in UDP payload, the 1st hop SRoU forwarder could convert it
to standard SRv6 packet.

## Type:0x3, Compressed Segment List {#cSID}

### Service Registration & Mapping
I1,I2 use SRoU port as source port to inital STUN{{!RFC5389}} session to SR
mapping server, the mapping server could detect the Post NAT address and assign
SID for each host, and distribute IP/port--SID mapping database to all the SRoU
enabled host.

|Host  |  Socket                | SID      |
|-----:|:-----------------------|:---------|
|  I1  | <IP_ADDRESS>:8811         | 1111     |
|  I2  | <IP_ADDRESS>:12345         | 2222     |
{: #sid_map title="sid mapping"}

In this mode the socket information could combined with IPv4 and IPv6.

## Optional TLV

### SR Integrity TLV {#sr-integrity}
 SR Integrity Tag to validate the SRH. All fields in the SRH except
 Segments Left fields need to be checked.

### Micro-segmentation(uSeg) {#useg-policy}
Option-TLV could defined Sub-TLV to support Micro-segmentation Security policy

~~~
  OptionTLV {
    0x1, uSeg{
        0x0, SRC_GROUP_ID,
        0x1, DST_GROUP_ID,
        0x2, APP_GROUP_ID,
        0x3, SRC_DEVICE_ID,
        0x4, DST_DEVICE_ID,
        0x5, APP_ID,
    }
  }
~~~

Customer also could encode this microsegment policy header in flowID field.

###  End.PacketInfo {#end-packet-info}
This optional TLV defines extened packet info and Segment-end packet edit
function. Sub-TLV defines as below:

#### Type:0x0, VPN-ID
 The SDWAN Router could use {{!I-D.ietf-quic-datagram}} as VPN tunnel, This
 Sub-TLV defined the VPN-ID inside the tunnel.

 If SRoU header has this sub-TLV, the device MUST decrypt inner payload and
 use the VPN-ID for inner packet destination lookup.

#### Type:0x1, Orginal Destination Address/Port
In SR Type 0x3, The original destination address/port cloud not encode in 128bit
field, it could be store in option TLV.

# OAM

SRoU OAM Packet format is defined as below:

~~~
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | Magic Number  |  SRoU Length  | Flow ID Length|  P-ID  =0x0   |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                                                               |
 |                 Flow ID( Variable length)                     |
 |                                                               |
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | OAM-Type      |   OAM Payload(Variable Length based on Type)  |
 +-+-+-+-+-+-+-+-+                                               +
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~~~
{: #oam-format title="SRoU OAM Header"}

OAM-Type:

|ID    | Type                   | Usage                                       |
|-----:|:----------------------:|:--------------------------------------------|
|  0   | PM                     | Latency & Loss & Jitter Measurement         |
|  1   | IPv4 STUN Request      |                                             |
|  2   | IPv4 STUN Response     |                                             |
|  3   | IPv6 STUN Request      | *Reserved for NAT66 Case(Not implement yet) |
|  4   | IPv6 STUN Response     | *Reserved for NAT66 Case(Not implement yet) |
{: #oam_type title="oam message type"}

## Performance Measurement

The performance measurement message is follow TWAMP algorithm.This OAM message
could be used for Authentication mode( with HMAC-SHA256) or
Crypt mode(AES-GCM-256).
Crypto key could be synchonized via out-of-band channel.

PMType:

|ID    | Type            | Usage                                       |
|-----:|:---------------:|:--------------------------------------------|
|  0   | PM_Request      | Performance Measurement                     |
|  1   | PM_Response     | Performance Measurement                     |
{: #oam_pm_type title="oam perf measurement message type"}

### PM_Request Message
The initiator send packet with PMType = 0, and it contains sending
timestamp.

~~~
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | OAM Type=0    |PMType=0      |    MBZ                         |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                         Sequence Number                       |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                          TimeStamp                            |
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                        HMAC(Optional)                         |
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~~~
{: #oam-ls-req-format title="SRoU OAM Perf Measurement Request Message"}

Sequence Number:
    Start from zero, add one after send request packet.

TimeStamp:
    Packet sending timestamp.

HMAC(Optional):
    HMAC-SHA256 used for message authentication.

### PM_Response Message
The responder message is with PMType = 1, and it contains:

~~~
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | OAM Type=0    |PMType=1      |    MBZ                         |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                       Sequence Number                         |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                         TimeStamp                             |
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                     Recieved TimeStamp                        |
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                    Sender Sequence Number                     |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                       Sender TimeStamp                        |
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                        HMAC(Optional)                         |
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~~~
{: #oam-pm-resp-format title="SRoU OAM Perf Measurement Response Message"}

Sequence Number:
    Start from zero, add one after send response packet.

TimeStamp:
    sending timestamp.

Recieved Timestamp:
    The correspond request message recieved timestamp.

Sender Sequence Number:
    Exactly copied from the correspond request message

Sender Timestamp:
    Exactly copied from the correspond request message

HMAC(Optional):
    HMAC-SHA256 used for message authentication.

## STUN Service

SRoU forwarding endpoint may stay behind NAT, it request STUN service to
discover the public network address.

Initiator send address and port with ALL-ZERO to STUN Server, STUN server
copy the recieve source address and port in this payload, and generate HMAC.
The STUN Server's key could be propogate to initiator by a out-of-band channel.

~~~
  0                   1                   2                   3
  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 | OAM Type=0    |                   MBZ                         |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                       IP Address                              |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |    Port                       |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 |                          HMAC                                 |
 |                                                               |
 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~~~
{: #oam-stun-format title="SRoU OAM STUN Header"}

# Usage

## Traffic engineering over Internet

~~~
Client-------R1------------Internet--------------R2-----------Server
             |                                    |
             |                                    |
             R3----V1----PubliCloud--------V2-----|
~~~
{: #use-1 title="Traffic Engineering over internet"}

Many video/conferencing application requires traffic engineering over IPv4
Internet, Webex/Zoom/Teams may setup V1,V2 in public cloud, The client and
server could encode the V1/V2 information in SRoU header for traffic engineering

## Multipath forwarding

Same as previously topoloy {{use-1}}, customer cloud ask server transmit packet
over different path, two path have same Flow-ID, QUIC could be used in this case
to provide multistream/multihoming support.

## Micro Segmentation

Same as previously topoloy {{use-1}}, the interim Router: R1/R2/R3, V1,V2 could
insert uSeg Sub-TLV based on client and server uSeg identity, and other interim
network equipment could based on this sub-TLV implement security policy or QoS
policy.

## Container Network

~~~
C1----SideCar1-----L1-----S1------L2----SideCar2-------C2
                   |               |
                   |------S2-------|
C1,C2: Container
L1,L2: Leaf switch
S1,S2: Spine switch
~~~
{: #use-3 title="Service-Mesh & Container Network"}

SRoU with QUIC also could be used for container network interface, especially
for service-mesh sidecar. The sidecar could aware the Datacenter underlay
topology by BGP-LinkState, and use SRH select best path to avoid congestion.
At the same time, all traffic are encrypted by {{!I-D.ietf-quic-tls}}.

## MPLS-SR with SDWAN

~~~
S1---INET(ipv4)----PE1------MPLS------PE2----S2

S1,S2: SDWAN Router
PE1,PE2: SR enabled MPLS PE
~~~
{: #sr-sdwan-topology title="MPLS-SR with SDWAN"}

S1 will setup IPSec SA with S2 for end-to-end encryption,
And it will use BSID between PE1--PE2 for traffic engineering.

MPLS based BSID and IPv4 based locator could be encoded in uSID.A distributed
mapping table could be used to translate uSID to packet action.

~~~
IP/UDP Header {
  Source IP: H1,
  Destination IP: PE1,
  Source Port: srcport,
  Destination Port: IPSec,
}
SRoU Header {
  SegmentType = 0x1,
  SR_HDR_Len = 2,
  Last Entry = 0x0,
  Segment Left = 0,
  SegmenetList[0] = uSID: FC0:2222:3333:4444::
}
~~~
{: #type-1-s1-pe1 title="Type:0x1 S1-->PE1 Packet Header"}

## Cloud Native Network platform

Each of the SRoU forwarder only rely on a UDP socket, it could be implement
by a container. Customer could deploy such SRoU enable container in multiple
cloud to provide a cloud-angonostic solution. All containers could be managed
by K8S.

A distributed K-V store could be used for SRoU forwarder service registration,
routing(announce prefix), all the SRoU forwarder could measue peer's
reachability/jitter/loss and update link-state to the K-V store. forwarding
policy also could be sync by the K-V store. Detailed information will be
provided in another I.D(ETCD based disaggregated SDN control plane).

SRoU forwarder also could be implement by BPF for container communication. It
will provide host level traffic engineering for massive scale datacenter to
reduce the West-East traffic congestion.

The best practice for SRoU is working with QUIC.
SRoU with QUIC transport protocol provides the following benefit for SDWAN :

 * Stream multiplexing
 * Stream and connection-level flow control
 * Low-latency connection establishment
 * Connection migration and resilience to NAT rebinding
 * Authenticated and encrypted header and payload

SRoU add traffic-engineering and VPN capabilites for SDWAN.
Many existing SDWAN features could gain the benefits like:

 * TCP optimization
 * Packet duplication

# Security Considerations

The SRoU forwarder must validate the packet, FlowID could be used for source
validation. It could be a token based solution, this token could be assigned
by controller with a dedicated expire time. Source/Dest device ID and group
cloud encode in flowid and signed by controller, just like JWT.

A blacklist on controller k-v store could be implemented to block device when
the token does not expire.

# IANA Considerations

## SRoU with QUIC

The magic number in SRoU must be ZERO to distiguish with QUIC Long/Short
packet format.

# Acknowledgements
{:numbered="false"}

The following people provided substantial contributions to this document:

- Bin Shi, Cisco Systems, Inc.
- Yijen Wang, Cisco Systems, Inc.
- Pix Xu, Cisco Systems, Inc.

repository: ruta-io/rfc-draft

repo_name: ruta-io/rfc-draft


text:
# Toy Problem Solutions

![Icon Preview](http://i.imgur.com/XmZW2q3.png)

### Author 👨🏾
 **Maxwell Waiyaki**

 ## License 📝
![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)

##
[![forthebadge](https://forthebadge.com/images/badges/built-with-science.svg)](https://forthebadge.com)
[![forthebadge](https://forthebadge.com/images/badges/made-with-javascript.svg)](https://forthebadge.com)
[![forthebadge](https://forthebadge.com/images/badges/made-with-python.svg)](https://forthebadge.com)

license: MIT

repository: maxwaiyaki/toy-solutions

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: maxwaiyaki/toy-solutions


text:
# Amida Homework

Programming exercise for new dev team candidates.

Spend no more than two hours on this assignment. Create a GitHub repo for your code, and at the end of the two hours please send us the link.

## Part 1: Parsing Data

Write a parser that converts a Blue Button CMS data file (ASCII format) into JSON.

* Sample file: [parse/cms_sample.txt](./parse/cms_sample.txt).
* You only need to parse the "Demographics" section of the file.
* The parser should return data in the following format:

```
{
    "name": {
        "first_name": "JOHN",
        "last_name": "DOE"
    },
    "dob": "01/01/1910",
    "address": ["123 ANY ROAD"],
    "city": "ANYTOWN",
    "state": "VA",
    "zip": "00001",
    "phone": "123-456-7890",
    "email"<EMAIL_ADDRESS>    "coverage": [{
        "type": "Part A",
        "effective_date": "01/01/2012"
    }, {
        "type": "Part B",
        "effective_date": "01/01/2012"
    }]
}
```

## Part 2: API

Create a basic REST API to serve content via HTTP GET requests.

* Sample file: [api/sample.json](./api/sample.json).
* The API should run as a standalone HTTP server.
* An HTTP GET request to `http://localhost:4000/api/sample` should return the following JSON structure with a 200 OK HTTP code:

```
{
    "data": {
    	//content of api/sample.json file goes here
    },
    "metadata": {
        "generated": "07/20/2015 10:49AM" //current date and time
    }
}
```

## Part 3: Ingest and Parse Data

Implement a simple page to allow HTTP POST.

Using your existing HTTP server, add a route to POST data to `http://localhost:4000/api/parse`.
The route should take a CMS `.txt` file (from part 1) as a payload, and should then parse the file
(using your parser), saving the resultant JSON to `post.json`.

Create a simple webpage, using any framework(s) of your chosing, to allow a user to pick
a file and POST it to your HTTP server.

* Include instructions for running both the client and server. They should run as separate services.
* The POST should return 200 if the parsing was successful; otherwise, return some sort of error.
* You may display the returned HTTP code and error information on your webpage, if you wish.

### Last updated

October 5, 2016

repository: amida-tech/homework

repo_name: amida-tech/homework


text:
CHANGELOG
=========
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### [Unreleased]
#### Added
- Nothing to report.

#### Fixed
- Nothing to report.

#### Changed
- Nothing to report.

#### Deprecated
- Nothing to report.

#### Removed
- Nothing to report.

#### Security
- Nothing to report.

### [1.0.0] - 2019-09-18
#### Added
- Default configuration file generate by publish artisan command.
  See [#951a844](https://github.com/tbitencourt/laravel-repository-eloquent/commit/951a8445b018ef54b46b34f4bb316e840e92971c).
- First version of RepositoryEloquent abstract class using Illuminate\Database\Eloquent\Builder as base.
  See [#ff330aa](https://github.com/tbitencourt/laravel-repository-eloquent/commit/ff330aac6f189ae7cacd27d748f3409209bbf8c7).
- MIT License.
  See [#12c1d48](https://github.com/tbitencourt/laravel-repository-eloquent/commit/12c1d48ed736a5e830778530d9e6a408b6397550).
- Add function "customWhere" on RepositoryEloquent, to filter using a array with "where" parameters.
  See [#c1a2f8d](https://github.com/tbitencourt/laravel-repository-eloquent/commit/c1a2f8d3dcf729acdaf92a94440a4f2a9f4efd0e).

### [1.1.0] - 2019-11-18
#### Added
- Added laravel framework 6.0 (or later).
  See [#29b810f](https://github.com/tbitencourt/laravel-repository-eloquent/commit/29b810fadd3a1b59372080dc346ba68c8736f509).
  See [#992ec66](https://github.com/tbitencourt/laravel-repository-eloquent/commit/992ec66b4c78864e7bf73b345440cb6b8101a6ea).

#### Fixed
- Config filename fixed.
  See [#055a094](https://github.com/tbitencourt/laravel-repository-eloquent/commit/055a0941f35cd9a3b1ff79e5351d33ed1e5eba06).
- The "customWhere" function on RepositoryEloquent wasn't accepting more then one relation's filter. It has been fixed.
  See [#78f63a5](https://github.com/tbitencourt/laravel-repository-eloquent/commit/78f63a55f4d87c12579afdd7f631cd14c48cc016).

### [1.1.1] - 2019-11-18
#### Fixed
- Changed "tilde version range" to "caret version range" to accept all laravel 6.0 versions.
  See [#9950e0f](https://github.com/tbitencourt/laravel-repository-eloquent/commit/9950e0f53fb5070985615bd1bfd854e2e0d1830d).

### [1.1.2] - 2019-11-18
#### Fixed
- Changed "str_contains" helper to "Str::contains" to accept laravel 6.0 versions.
  See [#2e30dd9](https://github.com/tbitencourt/laravel-repository-eloquent/commit/2e30dd982d7dab3d05cc7e6335fd184d3f67386c).

### [1.2.0] - 2020-04-16
#### Added
- Added laravel framework 7.0 (or later).
  See [#41b19ca](https://github.com/tbitencourt/laravel-repository-eloquent/commit/41b19ca79f50fb2973656e1f618f4dc131081910).

### [1.2.1] - 2020-04-17
#### Removed
- Temporarily removed PHP 7.2.x support.
  See [#0a362ea](https://github.com/tbitencourt/laravel-repository-eloquent/commit/0a362ea9fcb07eb40d7fb0b2278fccc6c26a0c13).

repository: tbitencourt/laravel-repository-eloquent

repo_name: tbitencourt/laravel-repository-eloquent


text:
# EPD - Encrypted Password Database

EPD is a tool to archive personal credentials (mostly passwords) and
store them safely in file. It is designed to be secure, lightweighted,
portable, and convenient.

Supported platform: Windows (Mingw/MSVC), *nix (tested on Linux)

> NOTE AND UPDATE: This software is still under development. Minor changes
may be applied to the file structures and functionalities. Backward
capability is not garuenteed.

> WARNING: This tool is not approved by any authorities on data security
or cryptography. The author of this software is not an expert in security
related fields. Please be informed that any use of this software is at users
own risk and the author is not responsible for any property or data losses.

## Installation

EPD provides no installation by itself as it emphasizes portability. The
below instruction covers only the building process. The resulted binary will
be in `build` directory.

### Windows

There is two ways to build on Windows. If you can either build with Mingw or
MSVC. Building with Mingw requires the installation of
[Mingw-w64](https://sourceforge.net/projects/mingw-w64/). Building
with MSVC requires the installation of Visual Studio Build Tool. This tool is
installed automatically if you have installed any version of Visual Studio.
If you don't want to install Visual Studio, please see
[this](https://msdn.microsoft.com/en-us/library/f35ctcxw.aspx) one.

#### Mingw

Open a command prompt with all necessary environmental variables set (for
example, put the Mingw installation path in `path` variable), redirect to
the project directory, and use the below command.

    $ make -f Makefile.mingw epd

#### MSVC

Open the Visual Studio Build Tool command prompt, see
[this](https://msdn.microsoft.com/en-us/library/f35ctcxw.aspx), redirect to
the project directory and use the below command.

    $ nmake -f Makefile.win epd

### Linux (and Unix, untested)

Open the terminal and redirect to the project directory. Use below command.

    $ make -f Makefile.nix epd

## Usage

The brief documentation is located in `doc.h`, which will be printed out
if you run the binary with `-h`. Full documentation is not yet finished.

## Data Structure

EPD will create two kinds of file, the key file and the database file.
The key file is generated by `keygen` command and is required for all the
database operation (feed in by `-k` option). The database file will ends with
`.edb` and contains the data.

### Key file

```
[Public Key (32)][Secret key* (64)][Signature (64)]
```

*The secret key is 32 bytes long by itself, and there are some addtional
information (iv, protective hash). The total length is 64 bytes.

### Database file

The database structure is slightly complicated.

```
[IV (8)][Ephermeral Public Key (32)][ENC 1][Checksum 1 (32)][ENC 2][Checksum 2 (32)]
```

IV is 8 bytes, Keys are 32 bytes, Checksums are 32 bytes.

ENC 1 is the block of header, index, and tags.

ENC 2 is the block of data.

Although the `Checksum 1` is inserted in the middle, the encryption runs
through `ENC 1` and `ENC 2`. This is an important security measure against
Reuse key/iv attack.

#### ENC 1

Suppose there are totally `n` entries, and `m` tags (the maximum is 64)

```
[Header (84)][n Table entries (n * 80)][Tag (8)][m Tags (m * 64)]
```

##### Header

```
[Program name (10)][Program Version (6)][DB name (64)][nentry (4)]
```
nentry is the number of entries in the database

##### Table

```
[HTAG (8)][Tag (8)][Entry Name (16)][Encryption Key/Ephermeral Public Key (32)][Public key Fingerprint (16)]
```

##### Tags

The first part of tags are 8 bytes, which is 64 bits, each representing the
availability of the that tag. If there are `m` tags available, there should
be `m` `1`s in this section.

The second part of tags are `m` 64 bytes block placed in order, which contains
the tag name, a `char *` type C-style string, the maximum character length is
63 (termination byte is always needed).

#### ENC 2

```
[n Data entryies (n * 528)]
```
```
[HTAG (8)][Tag (8)][Full name (128)][Note (256)][Value (128)]
```

The data contains the same `HTAG` entry and `Tag` entry with the corresponding
entry in `table`. The Full name of each entry is 128 bytes, and the name stored
in table is the first 16 bytes of these 128 bytes.

Data entries (not including HTAG) are encrypted seperately using the key in
table entry (even in memory). The value encapsulated in the data entry is
encrypted seperately as well.

## NOTE

1. Though the author has limited expertise in developing this kind of software,
the security model should work and may be redudent. This may affect the
performance of this software. It is normal for it to take several seconds to
complete one operation (without compiler optimization).

2. There may be some minor issues/bugs of this software, since there is not
enough tests to prove its robostness. It is welcome to test this program and
provide issues/bug reports and suggestions for further improvements.

## TODOs

The below items are unordered

1. Better customization support in `config.h`
2. Unfinished features (add/delete tags, change data entry, change key password)
3. Better looking UI (not GUI)
4. Interactive Design (with mini terminal built-in)
5. Bug fix (currently not yet Valgrind free)
6. Better documentation
7. ...

## Special thanks

This program is largely inspired by
[skeeto/enchive](https://github.com/skeeto/enchive), which provides the data
securitycmodel for this program. The `ed.c` is a amalgamation of
[kc1212/ref10_extract](https://github.com/kc1212/ref10_extract), which
provides the functionality of ed25519 signature using Curve25519 key pairs.

repository: lewisxy/epd

repo_name: lewisxy/epd


text:
---
name: "\U0001F41B Bug Report"
about: "Bugs, missing documentation, or unexpected behavior \U0001F914."
title: ''
labels: bug
assignees: ''
---

<!--

* Please fill out this template with all the relevant information so we can
  understand what's going on and fix the issue. We appreciate bugs filed and PRs
  submitted!

* Please make sure that you are familiar with and follow the Code of Conduct for
  this project (found in the CODE_OF_CONDUCT.md file).

* You can get the installed version of an NPM package by running `npm ls <insert package name>` in your terminal.

-->

- `react-hooks-testing-library` version:
- `react` version:
- `react-dom` version (if applicable):
- `react-test-renderer` version (if applicable):
- `node` version:
- `npm` (or `yarn`) version:

### Relevant code or config:

```js
let your = (code, tell) => `the ${story}`
```

### What you did:

<!-- What you were doing -->

### What happened:

<!-- Please provide the full error message/screenshots/anything -->

### Reproduction:

<!--
If possible, please create a repository that reproduces the issue with the
minimal amount of code possible.

Or if you can, try to reproduce the issue in a Codesandbox. You can fork the one
here: https://codesandbox.io/s/ypml1r8l8j?module=%2Fsrc%2F__tests__%2FuseHello.js&previewwindow=tests
-->

### Problem description:

<!-- Please describe why the current behaviour is a problem -->

### Suggested solution:

<!--
It's ok if you don't have a suggested solution, but it really helps if you could
do a little digging to come up with some suggestion of how to improve things.
-->

branch_name: refs/heads/main

gha_language: TypeScript

gha_license_id: MIT


text:
---
title: "Shiny finally has a colour picker - use colourInput to select colours in Shiny apps"
tags: [rstats, shiny, packages, shinyjs]
date: 2015-06-28 13:00:00 -0700
permalink: /2015/06/28/introducing-shinyjs-colourinput/
share-img: /assets/img/blog/colourInput/colourInputDemo.png
gh-repo: daattali/colourpicker
gh-badge: [star, watch, follow]
last-updated: 2016-08-15
---

**NOTE: the colour input described here is no longer part of `shinyjs` and is now available in the `colourpicker` package instead.**

> I don't always think Shiny is missing anything, but when I do - I fill in the gap myself.

That was meant to be read as The Most Interesting Man In The World, but now that I think about it - maybe he's not the type of guy who would be building Shiny R packages...

Shiny has many useful input controls, but there was one that was always missing until today - a colour picker.  The package [**`colourpicker`**](https://github.com/daattali/colourpicker) now offers a **`colourInput()`** function and, of course, a corresponding **`updateColourInput()`**. There have been many times when I wanted to allow users in a Shiny app to select a colour, and I've seen that feature being requested multiple times on different online boards, so I decided to make my own such input control.

**UPDATE 2016-03-27:** There is now an awesome RStudio addin/gadget that lets you select multiple colours interactively if you need help picking colours. [Read more here](https://github.com/daattali/colourpicker#to-select-colours-to-use-in-your-r-code-colourpicker).

## Table of contents

- [Demo](#demo)
- [Availability](#availability)
- [Features](#features)
  - [Simple and familiar](#simple)
  - [Allowing "transparent"](#transparent)
  - [How the chosen colour is shown inside the input](#showColour)
  - [Limited colour selection](#limited)
  - [Updating a colourInput](#update)
  - [Flexible colour specification](#colour-spec)
  - [Works on any device](#compatibility)
- [Misc](#misc)

## Demo {#demo}

[Click here for a Shiny app showing several demos of colourInput](https://daattali.com/shiny/colourInput/).   You can either install it [from GitHub](https://github.com/daattali/colourpicker) with `devtools::install_github("daattali/colourpicker")` or from CRAN with `install.packages("colourpicker")`.

## Features {#features}

### Simple and familiar {#simple}

Using `colourInput` is extremely trivial if you've used Shiny, and it's as easy to use as any other input control.  It was implemented to very closely mimic all other Shiny inputs so that using it will feel very familiar. You can add a simple colour input to your Shiny app with `colourInput("col", "Select colour", value = "red")`. The return value from a `colourInput` is an uppercase HEX colour, so in the previous example the value of `input$col` would be `#FF0000` (#FF0000 is the HEX value of the colour red). The default value at initialization is white (#FFFFFF).

### Allowing "transparent" {#transparent}

Since most functions in R that accept colours can also accept the value "transparent", `colourInput` has an option to allow selecting the "transparent" colour. By default, only real colours can be selected, so you need to use the `allowTransparent = TRUE` parameter. When this feature is turned on, a checkbox appears inside the input box.

If the user checks the checkbox for "transparent", then the colour input is grayed out and the returned value of the input is `transparent`. This is the only case when the value returned from a `colourInput` is not a HEX value. When the checkbox is unchecked, the value of the input will be the last selected colour prior to selecting "transparent".

By default, the text of the checkbox reads "Transparent", but you can change that with the `transparentText` parameter. For example, it might be more clear to a user to use the word "None" instead of "Transparent". Note that even if you change the checkbox text, the return value will still be `transparent` since that's the actual colour name in R.

This is what a colour input with transparency enabled looks like

[![allowTransparent demo](/assets/img/blog/colourInput/allowTransparent.png)](/assets/img/blog/colourInput/allowTransparent.png)

### How the chosen colour is shown inside the input {#showColour}

By default, the colour input's background will match the selected colour and the text inside the input field will be the colour's HEX value. If that's too much for you, you can customize the input with the `showColour` parameter to either only show the text or only show the background colour.

Here is what a colour input with each of the possible values for `showColour` looks like

[![showColour demo](/assets/img/blog/colourInput/showColour.png)](/assets/img/blog/colourInput/showColour.png)

### Limited colour selection {#limited}

If you want to only allow the user to select a colour from a specific list of colours, rather than any possible HEX colour, you can use the `palette = "limited"` parameter.  By default, the limited palette will contain 40 common colours, but you can supply your own list of colours using the `allowedCols` parameter. Here is an image of the default limited colour palette.

[![colourInput demo](/assets/img/blog/colourInput/limited-palette.png)](/assets/img/blog/colourInput/limited-palette.png)

### Updating a colourInput {#update}

As with all other Shiny inputs, `colourInput` can be updated with the `updateColourInput` function.  Any parameter that can be used in `colourInput` can be used in `updateColourInput`. This means that you can start with a basic colour input such as `colourInput("col", "Select colour")` and completely redesign it with

```r
updateColourInput(session, "col", label = "COLOUR:", value = "orange",
  showColour = "background", allowTransparent = TRUE, transparentText = "None")
```

### Flexible colour specification {#colour-spec}

Specifying a colour to the colour input is made very flexible to allow for easier use. When giving a colour as the `value` parameter of either `colourInput` or `updateColourInput`, there are a few ways to specify a colour:

- Using a name of an R colour, such as `red`, `gold`, `blue3`, or any other name that R supports (for a full list of R colours, type `colours()`)
- If transparency is allowed in the `colourInput`, the value `transparent` (lowercase) can be used. This will update the UI to check the checkbox.
- Using a 6-character HEX value, either with or without the leading `#`.  For example, initializing a `colourInput` with any of the following values will all result in the colour red: `ff0000`, `FF0000`, `#ff0000`.
- Using a 3-character HEX value, either with or without the leading `#`. These values will be converted to full HEX values by automatically doubling every character. For example, all the following values would result in the same colour: `1ac`, `#1Ac`, `11aacc`.

### Works on any device {#compatibility}

If you're worried that maybe someone viewing your Shiny app on a phone won't be able to use this input properly - don't you worry. I haven't quite checked every single device out there, but I did spend extra time making sure the colour selection JavaScript works in most devices I could think of. `colourInput` will work fine in Shiny apps that are viewed on Android cell phones, iPhones, iPads, and even Internet Explorer 8+.

## Misc {#misc}

In order to build `colourInput`, I needed to use a JavaScript colour picker library. After experimenting with many different colour pickers, I decided to use [this popular jQuery colour picker](https://github.com/claviska/jquery-minicolors) as a base, and extend it myself to make it geared to work with Shiny. I simplified much of the code and added some features that would make it integrate with Shiny much easier. You can see the exact changes I've made in the [README for my version of the library](https://github.com/daattali/jquery-colourpicker). The main features I added were the support for a "transparent" checkbox, the complete look of the input field was redesigned, and I also changed the colour picker colours to render completely in CSS instead of using images.

The colour picker functions were initially developed in the `shinyjs` package but it has been pointed out by many people that these functions are not exactly in-line with the general `shinyjs` idea, so they eventually graduated into the `colourpicker` pacakge.

---

If anyone has any comments or feedback, both negative or positive, I'd love to [hear about it](/contact)! Feel free to open issues [on GitHub](https://github.com/daattali/colourpicker) if there are any problems.

gha_language: HTML


text:
# Read08

## API Design Best Practices

### What does REST stand for?
- REST is an architectural style for building distributed systems based on hypermedia.

### REST APIs are designed around a ____.
- resources.

### What is an identifer of a resource? Give an example.
- Identifer is a URI that uniquely identifies that resource. https://adventure-works.com/orders/1

### What are the most common HTTP verbs?
- GET, POST, PUT, PATCH, and DELETE.

### What should the URIs be based on?
- Should be based on nouns.

### Give an example of a good URI.
- https://adventure-works.com/orders/1

### What does it mean to have a ‘chatty’ web API? Is this a good or a bad thing?
- ‘Chatty’ web API expose a large number of small resources. Such an API may require a client application to send multiple requests to find all of the data that it requires, so it’s a bad thing.

### What status code does a successful GET request return?
- 200(OK)

### What status code does an unsuccessful GET request return?
- 404( not found)

### What status code does a successful POST request return?
- Code 201 (Created)

### What status code does a successful DELETE request return?
- Code 204

[Go Back ](README.md)


text:
History
=======

latest
------

Major changes:
- Added NullTimer to use for default Timer value, it is a disabled timer which cannot be enabled (raises NotImplementedError)

Fixes:
- Fixed bug where ZarrMonitor depended on dict `.items()` always returning items in the same order

v0.6.0
------

Major changes:
- Use `cftime.datetime` objects to represent datetimes instead
of `datetime.datetime` objects.  This results in times stored in a format compatible with
the fortran model, and accurate internal representation of times with the calendar specified
in the `coupler_nml` namelist.
- `Timer` class is added, with methods `start` and `stop`, and properties `clock` (context manager), and `times` (dictionary of accumulated timing)
- `CubedSphereCommunicator` instances now have a `.timer` attribute, which accumulates times for "pack", "unpack", "Isend", and "Recv" during halo updates
- make `SubtileGridSizer.from_tile_params` public API
- New method `CubedSphereCommunicator.synchronize_vector_interfaces` which synchronizes edge values on interface variables which are duplicated between adjacent ranks
- Added `.sel` method to corner views (e.g. `quantity.view.northeast.sel(x=0, y=1)`) to allow indexing these corner views with arbitrary dimension ordering.
- Halo updates now use tagged send/recv operations, which prevents deadlocks in certain situations
- Quantity.data is now guaranteed to be a numpy or cupy array matching its `.np` module, and will no longer be a gt4py Storage
- Quantity accepts a `gt4py_backend` on initialize which is used to create its `.storage` if one was not used on initialize
- parent MPI rank now referred to as "root" rank in variable names and documentation
- Added TILE_DIM constant for tile dimension of global quantities
- Added Partitioner base class implementing features necessary for scatter/gather
- Moved scatter and gather from TileCommunicator to the Communicator base class, so its code can be re-used by the CubedSphereCommunicator
- Implemented subtile_slice, global_extent, and subtile_extent routines on CubedSpherePartitioner necessary for scatter/gather in CubedSphereCommunicator
- Renamed argument `tile_extent` and `tile_dims` to `global_extent` and `global_dims` in routines to refer generically to the tile in the case of tile scatter/gather or cube in the case of cube scatter/gather
- Fixed a bug where initializing a Quantity with a numpy array and a gpu backend would give CPUStorage
- raise TypeError if initializing a quantity with both a storage and a gt4py_backend argument
- eagerly create storage object when initializing Quantity
- make data type of quantity and storage reflect the gt4py_backend chosen, instead of being determined based on the data type being numpy/cupy

Fixes:
- If `only_names` is provided to `open_restart`, it will return those fields and nothing more.  Previously it would include `"time"` in the returned state even if it was not requested.
- Fixed a bug where quantity.storage and quantity.data could be out of sync if the quantity was initialized using data and a gt4py backend string
- Default slice for corner views when not given at all as an index (e.g. when providing one index to a 2D view) now gives the same result as providing an empty slice (:)
- Fixed a bug where quantity.view could refer to a different array than quantity.data if the quantity was initialized using data and a gt4py backend string, and then quantity.storage was accessed

v0.5.1
------

- enable MPI tests on CircleCI

v0.5.0
------

Breaking changes:
- `send_buffer` and `recv_buffer` are modified to take in a `callable`, which is more easily serialized than a `numpy`-like module (necessary because we serialize the arguments to re-use buffers), and allows custom specification of the initialization if zeros are needed instead of empty.

Major changes:
- Added additional regional views to Quantity as attributes on Quantity.view, including `northeast`, `northwest`, `southeast`, `southwest`, and `interior`
- Separated fv3util into its own repository and began tracking history separately from fv3gfs-python
- Added getters and setters for additional dynamics quantities needed to call an alternative dynamical core
- Added `storage` property to Quantity, implemented as short-term shortcut to .data until gt4py GDP-3 is implemented

Deprecations:
- `Quantity.values` is deprecated

v0.4.3 (2020-05-15)
-------------------

Last release of fv3util with history contained in fv3gfs-python.

gha_language: Python

gha_license_id: NOASSERTION


text:
# Project

Write a Shell in C/C++.

## Objective:

It’s easy to view yourself as “not a real programmer.” There are programs out there that everyone uses, and it’s easy to put their developers on a pedestal.  Implementing it yourself is a fun way to show that you have what it takes to be a real programmer.

## Description:
A shell does three main things in its lifetime.
(1)  Initialize
(2)  Interpret
(3)  Terminate

The shell should support pipe (|), service (&), and file redirection (<, >, >>).
The following commands (with their traditional objective)should be implemented:
cd:
```bash
cd [directory]
```
‘~’, `..`, ‘/’ are valid (along with alphanumeric characters) and stand for traditional meaning.
pwd:
```bash
pwd [OPTION]
```
ls:
```bash
ls [OPTION]... [FILE]...
```
Option: -l, -r, -s, --file-type (match file extension).
Exit:
```bash
exit
```
Quite the shell (Terminate).

Find:
```bash
find path -name filename
```
for example,
```bash
find . -name a.txt
find . -name *.txt
```

File Redirection(>,>>,<):
```bash
ls -l > a.txt
ls -l >> a.txt
ls -l < b.txt (in b.txt we have filename, for example ./shell)
find . -name b.txt > a.txt
```
Service(&):
```bash
find . -name a.txt &
```

History:
```bash
history
```

Pipeline
```bash
ls | pwd
```

Interrupt(Ctrl+C)

## Programming Language used
C++

## Contributors
Weili, Shi
Sixiang, Zhang

## How to run
run the following command.
```bash
./shell
```
## License
[License](https://github.com/DamoSWL/8000_Shell/blob/master/LICENSE)


text:
# FirebaseUI for web - Auth Demo

Accessible here:
[https://fir-ui-demo-84a6c.firebaseapp.com](https://fir-ui-demo-84a6c.firebaseapp.com).

## Prerequisite

You need to have created a Firebase Project in the
[Firebase Console](https://firebase.google.com/console/) as well as configured a web app.

## Installation

Install the Firebase command line tool with `npm install -g firebase-tools` (See
[docs](https://firebase.google.com/docs/cli/#setup)).

Enable the Auth providers you would like to offer your users in the console, under
Auth > Sign-in methods.

Run:

```bash
git clone https://github.com/firebase/firebaseui-web.git
cd firebaseui-web
npm install
cd demo
```

This will clone the repository in the current directory.

If you want to be able to deploy the demo app to one of your own Firebase Hosting instance,
configure it using the following command:

```bash
firebase use --add
```

Select the project you have created in the prerequisite, and type in `default` or
any other name as the alias to use for this project.

Copy `public/sample-config.js` to `public/config.js`:

```bash
cp public/sample-config.js public/config.js
```

Then copy and paste the Web snippet code found in the console (either by clicking "Add Firebase to
your web app" button in your Project overview, or clicking the "Web setup" button in the Auth page)
in the `config.js` file.

## Integrate One-tap sign-up with FirebaseUI (optional)

If you want to integrate with
[One-tap sign-up](https://developers.google.com/identity/one-tap/web/overview),
you will also need the Google OAuth web client ID corresponding to that project
which can be retrieved from the Google Cloud Console. This value will need to be
populated in `CLIENT_ID`.
The domain of the page has to also be whitelisted. Learn more on how to
[get started with One-tap sign-up](https://developers.google.com/identity/one-tap/web/get-started).
Skip this step, if you don't want to use One-tap sign-up with FirebaseUI.

## Deploy

### Option 1: Compile and use local FirebaseUI files

To deploy the demo app, run the following command in the root directory of FirebaseUI (use `cd ..`
first if you are still in the `demo/` folder):

```bash
npm run demo
```

This will compile all the files needed to run FirebaseUI, and start a Firebase server locally at
[http://localhost:5000](http://localhost:5000).

### Option 2: Use CDN hosted FirebaseUI files

If you would prefer to use a CDN instead of locally compiled FirebaseUI files, you can instead
locate the following in the `<head>` tag of `public/index.html` and `public/widget.html`:

```html
    <script src="dist/firebaseui.js"></script>
    <link type="text/css" rel="stylesheet" href="dist/firebaseui.css" />
```

Then replace that with the snippet provided in the CDN installation section found at
[https://github.com/firebase/firebaseui-web/blob/master/README.md](https://github.com/firebase/firebaseui-web/blob/master/README.md).

Finally, ensure you are in the `demo/` folder (and not the root directory of FirebaseUI), and run:
```bash
firebase serve
```

This will start a Firebase server locally at [http://localhost:5000](http://localhost:5000).

repository: firebase/firebaseui-web

gha_language: JavaScript

repo_name: firebase/firebaseui-web


text:
<p align="center">
  <img<EMAIL_ADDRESS>alt="DaVid logo"/>
</p>

## About
DaVid is a simple cross-platform GUI for annotating robotic and endoscopic surgical actions for use in deep-learning research.

#### Features
* Simple and lightweight interface for loading and annotating surgical frames for Windows, Linux and macOS.
* Joystick controls for intuitive and rapid action annotation.
* Keyboard shortcuts support.
* Hassle-free data export.

## Installation
In order to run DaVid, you'll first have to make sure you're running Python 3.5 or above.
``` sh
python -V
```
After downloading and unzipping the contents of this repository, navigate to the destination folder and install dependencies using:
``` sh
cd DaVid-main
pip install –upgrade pip
pip install -r requirements.txt
```
You can now launch DaVid with:
``` sh
python DaVid.py
```

## Download (Coming soon)
Alternatively, you can download pre-compiled versions of the application for macOS and Windows from [here](https://github.com/cyrilzakka/DaVid/releases).

## Usage
1. After launching DaVid, select a video file and wait while frames are extracted and saved. Note that this process only happens once per video and should take up to a few minutes.
2. For the current frame move the controls accordingly.
3. That's it! Move on to the next frame.

repository: cyrilzakka/DaVid

repo_name: cyrilzakka/DaVid


text:
[![](http://slack.xcomponent.com/badge.svg)](http://slack.xcomponent.com/)
[![CircleCI](https://circleci.com/gh/xcomponent/koordinator-kafka-demo/tree/master.svg?style=svg)](https://circleci.com/gh/xcomponent/koordinator-kafka-demo/tree/master)
[![TypeScript](https://badges.frapsoft.com/typescript/love/typescript.png?v=101)](https://github.com/ellerbrock/typescript-badges/)

# Koordinator Kafka Demo

This repository demos the use of Koordinator to integrate batch and stream
based jobs. In this example, we have a batch job `image-search`, that given some
search terms generate a list of urls of images matching the terms; and
`download-image`, a Kafka producer/consumer written in Java that allows one to
download the images in parallel.

## Requirements

* A Kafka broker, in our tests we use [this](https://hub.docker.com/r/spotify/kafka/) docker container
* Set the variables `WORKER_USERNAME` and `WORKER_PASSWORD` as your credentials
  in the Koordinator server, `KOORDINATOR_URL` as the url of your server and `KAFKA_BROKER` as the name of your Kafka broker.

## Build

1. Install the dependencies of the `image-search` worker: `cd image-search && yarn install && cd ..`
2. Build the `download-image` worker: `cd download-image && ./build.sh && cd ..`

## Run

Just run the script `./test.sh`. It will start the workers and the workflow.
You should be able to monitor its execution in the Koordinator frontend.

### Submit a Pull Request

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

## License

[Apache License V2](https://raw.githubusercontent.com/xcomponent/koordinator-kafka-demo/master/LICENSE)

repository: xcomponent/koordinator-kafka-demo

gha_language: Java

repo_name: xcomponent/koordinator-kafka-demo


text:
# Common Expression Language

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)

This is an experimental project that provides support for Common Expression Language (CEL) in Tekton Pipelines.
The functionality is provided by a controller that implements the Custom Task interface. Its use cases include
evaluating complex expressions to be used in [`WhenExpressions`](https://github.com/tektoncd/pipeline/blob/master/docs/pipelines.md#guard-task-execution-using-whenexpressions)
in subsequent `Tasks` to guard their execution.

- [Install](#install)
- [Usage](#usage)
- [Uninstall](#uninstall)

## Migration Notice for upgrade to tekton/pipelines version v0.44.0 and above.

The custom task `CEL` has been upgraded to `v1beta1.CustomRun`.
Current version no longer support `v1alpha1/Run`, last commit that supported `v1alpha1/Run` is [commit](https://github.com/tektoncd/experimental/commit/76fbe8831f486a04765bc681de7e301ff84a4585).

## Install

Install and configure [`ko`](https://github.com/google/ko).

```
ko apply -f config/
```

This will build and install the `CEL Controller` on your cluster, in the namespace `tekton-cel-run`.

```commandline
$ k get pods -n tekton-cel-run

NAME                              READY   STATUS    RESTARTS   AGE
cel-controller-654bdc4cc8-7bvvn   1/1     Running   0          3m4s
```

Alternatively, install it from the nightly release using:

```commandline
kubectl apply --filename https://storage.cloud.google.com/tekton-releases-nightly/cel/latest/release.yaml
```

## Usage

To evaluate a CEL expressions using `Custom Tasks`, we need to define a [`CustomRun`](https://github.com/tektoncd/pipeline/blob/main/docs/customruns.md)
type with `apiVersion: cel.tekton.dev/v1alpha1` and `kind: CEL`. The `CustomRun` takes the CEL expressions to be evaluated
as `Parameters`. If executed successfully, the `CustomRun` will produce the evaluation results as `Results` with names
corresponding with the `Parameters` names. See the [examples](examples) folder for `CEL` `Custom Tasks` to run or use as
samples.

### Configuring a `CEL` `Custom Task`

The `CEL` `Custom Task` is defined in a `CustomRun`, which supports the following fields:

- [`apiVersion`][kubernetes-overview] - Specifies the API version, `tekton.dev/v1alpha1`
- [`kind`][kubernetes-overview] - Identifies this resource object as a `CustomRun` object
- [`metadata`][kubernetes-overview] - Specifies the metadata that uniquely identifies the `CustomRun`, such as a `name`
- [`spec`][kubernetes-overview] - Specifies the configuration for the `CustomRun`
- [`ref`][kubernetes-overview] - Specifies the `CEL` `Custom Task`
  - [`apiVersion`][kubernetes-overview] - Specifies the API version, `cel.tekton.dev/v1alpha1`
  - [`kind`][kubernetes-overview] - Identifies this resource object as a `CEL` object
- [`params`](#specifying-cel-expressions) - Specifies the CEL expressions to be evaluated as parameters

The example below shows a basic `CustomRun`:

```yaml
apiVersion: tekton.dev/v1beta1
kind: CustomRun
metadata:
  generateName: celrun-
spec:
  customRef:
    apiVersion: cel.tekton.dev/v1alpha1
    kind: CEL
  params:
  - name: expression
    value: "type(1)"
```

### Configuring a `CEL` `Custom Task` in a `Pipeline`

The `CEL` `Custom Task` can be specified within a `Pipeline`, as such:

```yaml
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
  generateName: pipeline-
spec:
  tasks:
    - name: get-red
      taskRef:
        apiVersion: cel.tekton.dev/v1alpha1
        kind: CEL
      params:
        - name: red
          value: "{'blue': '0x000080', 'red': '0xFF0000'}['red']"
```
### Configuring a `CEL` `Custom Task` in a `PipelineRun`

The `CEL` `Custom Task` can be specified within a `PipelineRun`, as such:

```yaml
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  generateName: pipelinerun-
spec:
  pipelineSpec:
    tasks:
      - name: get-blue
        taskRef:
          apiVersion: cel.tekton.dev/v1alpha1
          kind: CEL
        params:
          - name: blue
            value: "{'blue': '0x000080', 'red': '0xFF0000'}['blue']"
```

### Specifying CEL expressions

The CEL expressions to be evaluated by the `CustomRun` are specified using parameters. The parameters can be specified
in the `CustomRun` directly or be passed through from a `Pipeline` or `PipelineRun`, as such:

```yaml
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  generateName: pipelinerun-
spec:
  pipelineSpec:
    params:
    - name: is-red-expr
      type: string
    tasks:
      - name: is-red
        taskRef:
          apiVersion: cel.tekton.dev/v1alpha1
          kind: CEL
        params:
          - name: is-red-expr
            value: $(params.is-red-expr)
  params:
    - name: is-red-expr
      value: "{'blue': '0x000080', 'red': '0xFF0000'}['red'] == '0xFF0000'"
```

For more information about specifying `Parameters`, read [specifying parameters](https://github.com/tektoncd/pipeline/blob/master/docs/pipelines.md#specifying-parameters).

### Monitoring execution status

As the `CustomRun` executes, its `status` field accumulates information about the execution status of the `CustomRun` in general.

If the evaluation is successful, it will also contain the `Results` of the evaluation under `status.results` with the
corresponding names of the CEL expressions as provided in the `Parameters`.

```yaml
Name:         celrun-get-type-tchmh
Namespace:    default
Labels:       <none>
Annotations:  <none>
API Version:  tekton.dev/v1beta1
Kind:         CustomRun
Metadata:
  Creation Timestamp:  2023-03-02T09:41:20Z
  Generate Name:       celrun-get-type-
  Generation:          1
#[...]
Spec:
  Custom Ref:
    API Version:  cel.tekton.dev/v1alpha1
    Kind:         CEL
  Params:
    Name:                expression
    Value:               type(1)
  Service Account Name:  default
Status:
  Completion Time:  2023-03-02T09:41:20Z
  Conditions:
    Last Transition Time:  2023-03-02T09:41:20Z
    Message:               CEL expressions were evaluated successfully
    Reason:                EvaluationSuccess
    Status:                True
    Type:                  Succeeded
  Extra Fields:            <nil>
  Observed Generation:     1
  Results:
    Name:      expression
    Value:     int
  Start Time:  2023-03-02T09:41:20Z
Events:
  Type    Reason               Age   From            Message
  ----    ------               ----  ----            -------
  Normal  CustomRunReconciled  6s    cel-controller  CustomRun reconciled: "default/celrun-get-type-tchmh"
```

If no CEL expressions are provided, any CEL expression is invalid or there's any other error, the `CEL` `Custom Task`
will fail and the details will be included in `status.conditions` as such:

```yaml
Name:         celrun-is-red-jpxsg
Namespace:    default
Labels:       <none>
Annotations:  <none>
API Version:  tekton.dev/v1beta1
Kind:         CustomRun
Metadata:
  Creation Timestamp:  2023-03-02T09:44:27Z
  Generate Name:       celrun-is-red-
  Generation:          1
#[...]
  Resource Version:  3901466
  UID:               fb1d859c-b2eb-4e7b-a187-431fb78027f4
Spec:
  Custom Ref:
    API Version:         cel.tekton.dev/v1alpha1
    Kind:                CEL
  Service Account Name:  default
Status:
  Completion Time:  2023-03-02T09:44:27Z
  Conditions:
    Last Transition Time:  2023-03-02T09:44:27Z
    Message:               CustomRun can't be run because it has an invalid spec - missing field(s): params
    Reason:                CustomRunValidationFailed
    Status:                False
    Type:                  Succeeded
  Extra Fields:            <nil>
  Observed Generation:     1
  Start Time:              2023-03-02T09:44:27Z
Events:                    <none>
```

For more information about monitoring `CustomRun` in general, read [monitoring execution status](https://github.com/tektoncd/pipeline/blob/main/docs/customruns.md#monitoring-execution-status).

### Using the evaluation results

A successful `CustomRun` contains the `Results` of evaluating the CEL expressions under `status.results`, with the name of
each evaluation `Result` matching the name of the corresponding CEL expression as provided in the `Parameters`.
Users can reference the `Results` in subsequent `Tasks` using variable substitution, as such:

```yaml
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
  generateName: pipelinerun-
spec:
  pipelineSpec:
    params:
      - name: is-red-expr
        type: string
    tasks:
      - name: is-red
        taskRef:
          apiVersion: cel.tekton.dev/v1alpha1
          kind: CEL
        params:
          - name: is-red-expr
            value: $(params.is-red-expr)
      - name: echo-is-red
        when:
          - input: "$(tasks.is-red.results.is-red-expr)"
            operator: in
            values: ["true"]
        taskSpec:
          steps:
            - name: echo
              image: ubuntu
              script: echo RED!
  params:
    - name: is-red-expr
      value: "{'blue': '0x000080', 'red': '0xFF0000'}['red'] == '0xFF0000'"
```

For more information about using `Results`, read [using results](https://github.com/tektoncd/pipeline/blob/master/docs/pipelines.md#using-results).

## Uninstall

```
ko delete -f config/
```

This will delete the `CEL Controller` and related resources on your cluster.

## Contributions

Read an overview of our processes in [Tekton Community](https://github.com/tektoncd/community).

[kubernetes-overview]:
https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/#required-fields

repository: tektoncd/experimental

repo_name: tektoncd/experimental


text:
# Working with Orchestrations
## Handling Exceptions inside BizTalk Orchestrations
Project explaining how to Handling Exceptions inside BizTalk Orchestrations. Handling exceptions inside orchestration is the equivalent of doing a “catch { }” block in C#, of course, there are some little differences, but the idea is the same.

## Accessing and change message values inside orchestration
Project explaining how to accessing and change message values inside orchestration. There are 3 ways that we can read and set values of the message inside orchestration: Using Property promotion, Using XPath expressions or Using C#/VB.NET object (serialization).

## How to call a SQL Stored procedure without inputs
In this proof-of-concept (PoC) we will have a simple SQL Server table called Codes that only contains a code identifier that is unique in the system, as you can see picture bellow and, once again, we will try to call a stored procedure that gets all the existing codes.

## How to call Orchestration from another project or from another BizTalk Application
Project explaining how to call Orchestration from another project or from another BizTalk Application.

## How to Call Orchestrations developed in a different Visual Studio Solution
In the past, I developed a demo on “How to Call Orchestration from another project or from another BizTalk Application” that you can read here and download the source code from Code Gallery here.

However, there were a few questions about how we can accomplish that using two different solutions… well is the exact same process, but to help clarify this topic and to better help the community members that placed the questions I decide to create a different demo.

## Customize filename dynamically inside BizTalk Orchestration
Project explaining how to Customize filename dynamically inside BizTalk Orchestration. This is a basic step and to accomplish this you only have to define the message context property of the output message.

## POC: BizTalk - Count XML Nodes Inside Orchestrations
Often you will want to count a certain node to add some business logic inside your Orchestrations. This project explaining how to use XPath count() function inside Orchestrations to count number of nodes.

## POC: BizTalk - Advanced Filter With XPath Inside Orchestrations
Often you will want to count or filter certain nodes to add some business logic inside your Orchestrations. This project explaining how to use XPath count() function inside Orchestrations to count number of nodes with advance filters.

# About Me
**Sandro Pereira** | [DevScope](http://www.devscope.net/) | MVP & MCTS BizTalk Server 2010 | [https://blog.sandro-pereira.com/](https://blog.sandro-pereira.com/) | [@sandro_asp](https://twitter.com/sandro_asp)

repository: sandroasp/BizTalk-Server-Learning-Path

repo_name: sandroasp/BizTalk-Server-Learning-Path


text:
---
name: Bug report
about: Is something broken?
title: ''
labels: 'bug'
assignees: ''

---

* `zsh-autocomplete` version: <!-- `git -C /path/to/zsh-autocomplete rev-parse @` -->
* Zsh version: <!-- `print $ZSH_PATCHLEVEL` -->
* Framework: <!-- Oh My Zsh, Prezto, Zimfw, etc. or just "none" -->
* Plugin manager: <!-- Znap, Zinit, Antigen, etc. or just "none" -->

<!-- Please use the following template to put together a minimal test case with which I can
reproduce the bug. If I cannot reproduce the bug, then I cannot fix it! -->
```zsh
 # Make sure you always test with the `main` branch.
$ git -C /path/to/zsh-autocomplete switch main

# Update to the latest commit.
$ git -C /path/to/zsh-autocomplete pull

# Create a temp dir and enter it.
$ cd $(mktemp -d)

# Restart Zsh without config files in this dir.
$ ZDOTDIR=$PWD HOME=$PWD exec zsh -f

# Source the plugin.
% source /path/to/zsh-autocomplete/zsh-autocomplete.plugin.zsh

# Test and document the steps that reproduce the problem.
% <insert your steps to reproduce here>
```

repository: MenkeTechnologies/zsh-autocomplete

repo_name: MenkeTechnologies/zsh-autocomplete


text:
---
name: Bug report
about: Create a report to help us improve

---

### Description

A clear and concise description of what is wrong.

### To Reproduce

Please provide UnitTest in the form of:

```C#
[TestMethod]
public void SomeDescriptiveName()
{
    var container = new UnityContainer()
                .RegisterType<ISomeType, SomeType>();
    ...

    var res = container.Resolve<Func<ISomeType>>();

    AssertExtensions.IsInstanceOfType(res, typeof(SomeType));
}
```

**Additional context**

Add any other context about the problem here.

repository: youngkidchen/unity

repo_name: youngkidchen/unity


text:
# coffee/implicit-object

This rule disallows the use of implicit objects (i.e. objects that don't have enclosing curly braces `{`/`}`)

### Options

This rule has two options: the first is a string option that currently only has the value `"never"`.
The second is an object option whose default value is:
```
{
  "allowOwnLine": false
}
```

#### allowOwnLine

By default, this rule disallows *all* implicit objects. When using the `"allowOwnLine": true` option, it allows implicit
objects as long as they are written on their "own line" in the source code

#### :-1: Examples of **incorrect** code for this rule with the default `"allowOwnLine": false` option:
```
###eslint coffee/implicit-object: ["error", "never", {"allowOwnLine": false}]###

a: 1

f a: 1, b: 2

f
  a: 1
  b: 2

x =
  a: ->
  b: 2
```

#### :+1: Examples of **correct** code for this rule with the default `"allowOwnLine": false` option:
```
###eslint coffee/implicit-object: ["error", "never", {"allowOwnLine": false}]###

{
  a: 1
  b: 2
}

f {a: 1, b: 2}

class A
  a: 1
  b: ->

x = {
  a: ->
  b: 2
}
```

#### :-1: Examples of **incorrect** code for this rule with the `"allowOwnLine": true` option:
```
###eslint coffee/implicit-object: ["error", "never", {"allowOwnLine": true}]###

f a: 1, b: 2

x = a: 1
```

#### :+1: Examples of **correct** code for this rule with the `"allowOwnLine": true` option:
```
###eslint coffee/implicit-object: ["error", "never", {"allowOwnLine": true}]###

a: 1
b: 2

f
  a: 1
  b: 2

f(
  a: 1
  b: 2
)

x =
  a: ->
  b: 2
```

repository: helixbass/eslint-plugin-coffee

gha_language: CoffeeScript

repo_name: helixbass/eslint-plugin-coffee


text:
RHEL 7 DISA STIG Testing
================
Local testing of this role can be accomplished easily by using Vagrant. The included Vagrantfile has box definitions for a CentOS 7 and RHEL 7 based test machine. Additionally there are various playbooks in this directory for applying the STIG role to the boxes and there is a provision step in the Vagrantfile that will apply the role when the machine boots.

Testing the idempotence of the role can be acomplished by running the role_idempotent_check.yml playbook

Requirements
------------
vagrant>=2.0

ansible>=<IP_ADDRESS>

Galaxy Roles

samdoran.redhat-subscription

```shell
ansible-galaxy install -r requirements.yml
```

If testing the RHEL7 images and you are using the Galaxy role above `samdoran.redhat-subscription` you need to set the following vars. Default setting is shown below.
```
rhn_username: "{{ lookup('env', 'RHN_USERNAME') }}"
rhn_password: "{{ lookup('env', 'RHN_PASSWORD') }}"
```

`vagrant-inventory` file with proper values in it.
```ini
[baseline_hosts]
centos7 ansible_port=2200  ansible_ssh_private_key_file=.vagrant/machines/centos7-stig/virtualbox/private_key
rhel7 ansible_port=2201 ansible_ssh_private_key_file=.vagrant/machines/rhel7-stig/virtualbox/private_key

[baseline_hosts:vars]
ansible_host=<IP_ADDRESS>
ansible_user=vagrant
```

Example Testing
-----------------

Spin up a new CentOS and RHEL box in Vagrant to run the tests on and apply the STIG.

```shell
vagrant up
```

Or if you don't want to run the initial provision steps at this time.

```shell
vagrant up --no-provision
```

Not running the provision steps in vagrant is sometimes preferred because vagrant will not run the play in parallel on both hosts, it will run on each host in serial.

If you did not provision in the above step then run Ansible to provision the host.

```shell
ansible-playbook -i vagrant-inventory apply_role.yml -e @extra_vars_vagrant.yml
```

If there are no failures then we want apply the role again and test for idempotence.

```shell
ansible-playbook -i vagrant-inventory role_idempotent_check.yml
```
The idempotence check playbook runs the STIG role in silent mode (redirecting play/task output to JSON). You will not see each individual task run and it will take ~5min to complete.

After you are done you may see output like below if the idempotence check fails. The `assert` tasks give pass or fail for CentOS 7 and RHEL 7 respectively and give a list of the non-idempotent tasks from the run.

```
TASK [assert] ******************************************************************
fatal: [centos7]: FAILED! => {
    "assertion": "play_output.stats.centos7.changed == 0",
    "changed": false,
    "evaluated_to": false,
    "failed": true,
    "msg": "Role FAILED idempotent test on CentOS7: [u'MEDIUM | V-51363 | PATCH | The system must use a Linux Security Module configured to enforce limits on system services.', u'LOW | V-51369 | PATCH | The system must use a Linux Security Module configured to limit the privileges of system services.'] tasks reported change on second run."
}
fatal: [rhel7]: FAILED! => {
    "assertion": "play_output.stats.rhel7.changed == 0",
    "changed": false,
    "evaluated_to": false,
    "failed": true,
    "msg": "Role FAILED idempotent test on RHEL7: [u'MEDIUM | V-51363 | PATCH | The system must use a Linux Security Module configured to enforce limits on system services.', u'LOW | V-38567 | PATCH | The audit system must be configured to audit all use of setuid and setgid programs.', u'LOW | V-51369 | PATCH | The system must use a Linux Security Module configured to limit the privileges of system services.'] tasks reported change on second run."
}

PLAY RECAP ******************************************************************
centos7                    : ok=5    changed=1    unreachable=0    failed=1
rhel7                      : ok=5    changed=1    unreachable=0    failed=1
```

After you are done you should clean up.

```shell
ansible-playbook -i vagrant-inventory deregister.yml
vagrant destroy -f
```

branch_name: refs/heads/devel


text:
# Bagliettoa marmorea (Scop.) Gueidan & Cl. Roux SPECIES

#### Status
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mycol. Res. 111(10): 1157 (2007)

#### Original name
Lichen marmoreus Scop.

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
#### IP-week2
{Akan Name Generator}
#### A web application that generates Ghanaian Akan names, {23/02/2021}
#### By **{Kiok Sianto}**

## Description
The Akan names are derived from Ghanian culture. Frequently in Ghana, children are given their first
name as a 'day name' which corresponds to the day in the week they were born. This web application takes a user's birthday
on the form provided and calculates the day of the week they were born and then depending on their gender outputs
their Akan Name. This app will take in a user's year of birth, month of birth, day of birth and select gender.
Using a formula assigned to a variable in the scripts.js file, it will be possible to determine
the exact day of the week the user was born and give them an Akan name based on their gender.

## Setup/Installation Requirements

* Step 1 : Clone this repository using git clone or downloading a ZIP file of the code.

* Step 2 : The repository, if downloaded as a zip file will need to be extracted of your preferred location and opened.

* Step 3 : Open the index.html file to view the application on your preferred web browser.

## Known Bugs
Formula provided to determine day of birth shows inconsistency in its results.

## Features
Here are the features in summary:

* Input of year of birth.
* Input month of birth.
* Input day of birth.
* Select Gender.
* Output Akan name.

## Technologies Used

* HTML
* CSS
* Javascript

## Support/Contact details

You can provide feedback or raise any issues/ bugs through the following means:
<EMAIL_ADDRESS>
### License
MIT License

Copyright (c) [2021] [Kiok Sianto]

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.

 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.


text:
# Quiz Ninjas

- Quiz Ninjas is a trivia question database website.
- Users can create accounts and access a database of trivia questions.

### Link to site: http://advjsfinal.herokuapp.com/
### Link to Repo: https://github.com/Llemmert/ADVJSFinal

## Features

There are three main user types with different features:

### Quiz Master: Has access to:
- Questions
- Answers
- Adding Questions
- Deleting Questions
- Editing Questions

### Quiz Host: Has access to:
- Questions
- Answers

### Quiz Taker: Has access to:
- Questions

## Deliverables
- Has user signup functionality
- Has authentication service for users to log in
- User info is stored in MongoDB
- Questions are stored in MongoDB
- Used Bootstrap for most CSS
- Site is deployed on Heroku on the following link: http://advjsfinal.herokuapp.com/
- Accounts can change their own account type to test features

## Testing Screenshots
## Login Screen:
![image](https://user-images.githubusercontent.com/77998718/118460180-aea22900-b6b9-11eb-9ef3-1002304c596f.png)

## Dashboard:
![image](https://user-images.githubusercontent.com/77998718/118461815-4a806480-b6bb-11eb-8dc5-a385a22b5a09.png)

## Question View as Quiz Master:
![image](https://user-images.githubusercontent.com/77998718/118460522-0476d100-b6ba-11eb-8414-88f45cda2a13.png)

## Question View as Quiz Host:
![image](https://user-images.githubusercontent.com/77998718/118460769-3f790480-b6ba-11eb-843f-4118d287757c.png)

## Question View as Quiz Taker:
![image](https://user-images.githubusercontent.com/77998718/118460893-5881b580-b6ba-11eb-97f3-cc338884da7b.png)

## Adding Question: Before add button clicked:
![image](https://user-images.githubusercontent.com/77998718/118462403-e0b48a80-b6bb-11eb-90a7-a89f0ef1bf88.png)

## After add button clicked:
![image](https://user-images.githubusercontent.com/77998718/118461323-cded8600-b6ba-11eb-9ea0-8c8f72f5e8f0.png)

## Profile Page:
![image](https://user-images.githubusercontent.com/77998718/118461598-1147f480-b6bb-11eb-993d-bfed0c5447bc.png)

## Registering Account: Before Add:
![image](https://user-images.githubusercontent.com/77998718/118462665-28d3ad00-b6bc-11eb-830c-612ec08b857f.png)

## After add:
![image](https://user-images.githubusercontent.com/77998718/118462734-3be67d00-b6bc-11eb-84f7-634e50d929f1.png)

## Sources:
https://getbootstrap.com/docs/5.0/getting-started/introduction/
https://github.com/rambasnet/NodeJS

## License
[MIT](https://choosealicense.com/licenses/mit/)

repository: Llemmert/ADVJSFinal

repo_name: Llemmert/ADVJSFinal


text:
ApolloStats
================================================================================

Webpage for showing various stats from the Apollo Station SS13 game database.
With heavy inspiration from other servers' webpages such as [Goon](http://goonhub.com/) and [/vg/station](http://ss13.pomf.se/index.php/bans).

Requires a running Mysql/MariaDB server with the game's database.

Installation
================================================================================

Compile time dependencies
--------------------------------------------------------------------------------

- Go v1.5+ (Unknown if older versions works)
- [cli](https://github.com/codegangsta/cli)
- [gin](https://github.com/gin-gonic/gin)
- [go-humanize](https://github.com/dustin/go-humanize)
- [go-sql-driver/mysql](https://github.com/go-sql-driver/mysql)
- [gorm](https://github.com/jinzhu/gorm)

Build tool for embedding assets:
- [yaber](https://github.com/lmas/yaber)

Compilation
--------------------------------------------------------------------------------

Download the source code

    go get -u github.com/Apollo-Community/ApolloStats

Or from a [zipped archive](https://github.com/Apollo-Community/ApolloStats/releases).

Go to the directory with the unpacked source code and run `make build` to compile
the code to a stand alone binary, called `ApolloStats64`.

See the `Makefile` for more options.

Usage
================================================================================

```
$ ApolloStats -h
NAME:
   main - Run a web server, serving stats for Apollo.

USAGE:
   main [global options] command [command options] [arguments...]

VERSION:
   0.3

COMMANDS:
   run          Run the web server
   help, h      Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --addr, -a "<IP_ADDRESS>:8000"                  serve web pages on this address [$APOLLOSTATS_ADDR]
   --database, -d "user:password@/database"     database authentication string [$APOLLOSTATS_DBAUTH]
   --debug                                      run in debug mode
   --help, -h                                   show help
   --version, -v                                print the version
```

Environment variables
--------------------------------------------------------------------------------

You can set some environment variables instead of using the command line flags.
```
$ export APOLLOSTATS_ADDR="<IP_ADDRESS>:8000"
$ export APOLLOSTATS_DBAUTH="user:password@/database"
$ ./ApolloStats --debug run
```

License
================================================================================

MIT License, see the LICENSE file for details.

TODO
================================================================================

Info:
- Clarify that there are never info from a currently running round.
- Clarify total deaths.

Templates:
- Need to remake the custom CSS and make the pages prettier.
- Change the colors used in css.

Rounds:
- Show player death graph over round's duration.

Heat maps:
- Really nice if we could show a heatmap of deaths.
- Ask @HiddenKn how he made his python version.

Game map:
- Huge, zoomable map of the main station (only).
- Store the map as picture tiles?
- Investigate how goon made their map.
- Need to rebuild the map after any new map changes from a commit.

Tests:
- Must do unit tests.

repository: Artemis-Community/ApolloStats

repo_name: Artemis-Community/ApolloStats


text:
# YellowSnow

See where your fellow developers have left their mark.

## Introduction

This is a simple Flutter application that shows a file's version control history (blame, annotation) using colour gradient.

## User Interface

Opening a text file within a VCS shows each line highlighted according to how recently it has been edited.

On the right-hand side is a map of the entire file.

![Screenshot 1](https://github.com/jchown/YellowSnow/blob/master/assets/images/screen1.png?raw=true)

Along the bottom there is a slider for moving back though the timeline and looking at previous versions of the file.

There is also a dark colour scheme (Purple Stain)

![Screenshot 2](https://github.com/jchown/YellowSnow/blob/master/assets/images/screen2.png?raw=true)

## Supported VCSs

Just Git for now

repository: jchown/YellowSnow

repo_name: jchown/YellowSnow


text:
# localization_generator
localization_generator

## Usage
* Add `LocalizationGenerator.sh` to your project's `Supporting Files`
* Add a `Run Script` in `Build Phases`, copy next script

  ``` shell
  "${SRCROOT}/${PRODUCT_NAME}/LocalizationGenerator.sh"
  ```
* build project
* script will create `[ProjectName]String.h` and `[ProjectName]String.m` in your project folder

## Notice
You must name your `.string` file as `[ProjectName]Localization.string`


text:
# wercker api client

[![wercker status](https://app.wercker.com/status/36462973eb9bc9dd7a0f3b9568328af6/s "wercker status")](https://app.wercker.com/project/bykey/36462973eb9bc9dd7a0f3b9568328af6)

werckerclient is the official wercker client for the
[wercker API][api-docs].

> Caution: Both the API and this client are under active development. This
> client may introduce breaking changes, so be sure to vendor in this client.

# Usage

To start using this client, import this package and create a new client:

```golang
import "github.com/wercker/werckerclient"

client := werckerclient.NewClient(nil)
```

This will create a new client with the default config. If you want to override
the default config, then you need to create a `wercker.Config` object and
pass this `wercker.NewClient`:

```golang
import "github.com/wercker/werckerclient"

options := &werckerclient.Config{}
client := werckerclient.NewClient(options)
```

## Authentication

The client uses a `Provider` to get the credentials for the user. By default it
uses the following strategy:

- Retrieve the token from the environment variable`$WERCKER_TOKEN`
- Retrieve the token from file `~/.wercker/credentials`
- Fallback to anonymous user

If you retrieved your wercker token through other means, then you can use the
`credentials.Token` method to create a static `Provider`:

```golang
import "github.com/wercker/werckerclient"
import "github.com/wercker/werckerclient/credentials"

token := "... your token ..."
options := &werckerclient.Config{Credentials: credentials.Token(token)}
client := werckerclient.NewClient(options)
```

[More information][auth-docs]

# FAQ

...

[api-docs]: http://devcenter.wercker.com/api/index.html
[auth-docs]: docs/authentication.md