text:
---
external help file: aws-toolbox-help.xml
Module Name: aws-toolbox
online version: https://github.com/fireflycons/aws-toolbox/tree/master/docs/en-US/Read-ATEC2LoadBalancerLogs.md
schema: 2.0.0
---

# Read-ATEC2LoadBalancerLogs

## SYNOPSIS
Read Load Balancer logs into a list of PowerShell custom objects

## SYNTAX

### LastX (Default)
```
Read-ATEC2LoadBalancerLogs [-LoadBalancer <Object>] [-AccountId <String>] [-Last <Int32>] [-LimitSize <Int64>]
 [<CommonParameters>]
```

### Range
```
Read-ATEC2LoadBalancerLogs [-LoadBalancer <Object>] [-AccountId <String>] [-StartTime <DateTime>]
 [-EndTime <DateTime>] [-LimitSize <Int64>] [<CommonParameters>]
```

## DESCRIPTION
Read load balancer logs into a list of PowerShell custom objects and emits this as the result of the script.
The various fields of the flow log are parsed out and can be accessed as properties of the returned
object simplifying sorting and searching of the log events.

You can pipe the output to Out-GridView to view quickly or Export-Csv for further analysis in Excel.

Logs can be very large especially on high traffic sites so you should keep time constraints small.
If you need to analyse logs over a large period, you'll be better off doing it with Athena.

## EXAMPLES

### EXAMPLE 1
```
Read-ATEC2LoadBalancerLogs.ps1 -LoadBalancer my-loadbalancer -Last 30
```

Read all events for the last 30 minutes.

### EXAMPLE 2
```
Read-ATEC2LoadBalancerLogs.ps1 -LoadBalancer my-loadbalancer -StartTime ([DateTime]::UtcNow.AddHours(-1)) -EndTime ([DateTime]::UtcNow.AddMinutes(-30))
```

Read all events for the given range.

### EXAMPLE 3
```
$lb = Get-ELBLoadBalancer -LoadBalancerName my-loadbalancer ; Read-ATEC2LoadBalancerLogs.ps1 -LoadBalancer $lb -StartTime ([DateTime]::UtcNow.AddHours(-1)) -EndTime ([DateTime]::UtcNow.AddMinutes(-30))
```

Read all events for Classic ELB for the given range with a load balancer object as input.

### EXAMPLE 4
```
$lb = Get-ELB2LoadBalancer -LoadBalancerName my-loadbalancer ; Read-ATEC2LoadBalancerLogs.ps1 -LoadBalancer $lb -StartTime ([DateTime]::UtcNow.AddHours(-1)) -EndTime ([DateTime]::UtcNow.AddMinutes(-30))
```

Read all events for ALB for the given range with a load balancer object as input.

## PARAMETERS

### -LoadBalancer
Nome of load balancer, or object returned by Get-ELBLoadBalancer or Get-ELB2LoadBalancer
Load balancer to get logs for.

```yaml
Type: Object
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -AccountId
AWS Account id of the account that contains the load balancer.
If not specified it will be detected from the account you are running this command under.

```yaml
Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -StartTime
The start of the time range.
Events with a time stamp equal to this time or later than this time are included.
Events with a time stamp earlier than this time are not included.

```yaml
Type: DateTime
Parameter Sets: Range
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -EndTime
The end of the time range.
Events with a time stamp equal to or later than this time are not included.

```yaml
Type: DateTime
Parameter Sets: Range
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Last
Sets the time range to the last X minutes from now.

```yaml
Type: Int32
Parameter Sets: LastX
Aliases:

Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
```

### -LimitSize
Limit the size of the log download.
If the combined size of all the logs to download exceeds this size in bytes, the command will abort.

```yaml
Type: Int64
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: 524288000
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

## OUTPUTS

### [object]
### List of parsed log entries. Fields depend on whether the target load balancer is classic or application.
### Both LB types have an additional field:
### - elb_node_ip: IP of the load balancer node that handled the request
## NOTES
IAM permissions required to run this command
- sts:GetCallerIdentity (when -AccountId is not specified)
- ec2:DescribeLoadBalancers (when -LoadBalancer is a name)
- ec2:DescribeLoadBalancerAttributes
- s3:GetBucketLocation
- s3:GetObject
- s3:ReadObject

## RELATED LINKS

[https://github.com/fireflycons/aws-toolbox/tree/master/docs/en-US/Read-ATEC2LoadBalancerLogs.md](https://github.com/fireflycons/aws-toolbox/tree/master/docs/en-US/Read-ATEC2LoadBalancerLogs.md)

[https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/access-log-collection.html](https://docs.aws.amazon.com/elasticloadbalancing/latest/classic/access-log-collection.html)

[https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-access-logs.html](https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-access-logs.html)

repository: fireflycons/aws-toolbox

repo_name: fireflycons/aws-toolbox


text:
<!--
Thanks for sending a pull request!

Please make sure you've read our contributing guidelines and how to submit a pull request (https://github.com/containers/podman/blob/main/CONTRIBUTING.md#submitting-pull-requests).

In case you're only changing docs, make sure to prefix the pull-request title with "[CI:DOCS]".  That will prevent functional tests from running and save time and energy.

Finally, be sure to sign commits with your real name.  Since by opening
a PR you already have commits, you can add signatures if needed with
something like `git commit -s --amend`.
-->

#### What this PR does / why we need it:

<!---
Please put your overall PR description here
-->

#### How to verify it

<!---
Please specify the precise conditions and/or the specific test(s) which must pass.
-->

#### Which issue(s) this PR fixes:

<!--
Please uncomment this block and include only one of the following on a
line by itself:

None

-OR-

Fixes #<issue number>

*** Please also put 'Fixes #' in the commit and PR description***

-->

#### Special notes for your reviewer:

repository: mairin/libpod

branch_name: refs/heads/master

extension: md

gha_language: Go

license_type: permissive

repo_name: mairin/libpod


text:
# Adafruit-Fingerprint-Sensor-Library [![Build Status](https://github.com/adafruit/Adafruit-Fingerprint-Sensor-Library/workflows/Arduino%20Library%20CI/badge.svg)](https://github.com/adafruit/Adafruit-Fingerprint-Sensor-Library/actions)[![Documentation](https://github.com/adafruit/ci-arduino/blob/master/assets/doxygen_badge.svg)](http://adafruit.github.io/Adafruit-Fingerprint-Sensor-Library/html/index.html)

Secure your project with biometrics - this all-in-one optical fingerprint sensor will make adding fingerprint detection and verification super simple. These modules are typically used in safes - there's a high powered DSP chip that does the image rendering, calculation, feature-finding and searching. Connect to any microcontroller or system with TTL serial, and send packets of data to take photos, detect prints, hash and search. You can also enroll new fingers directly - up to 162 finger prints can be stored in the onboard FLASH memory. There's a red LED in the lens that lights up during a photo so you know its working.

The Rugged Panel Mount Fingerprint Sensor with Bi-Color LED Ring even has an LED ring built around the detection pad, which can be set to red, blue or purple (as well as some fading/blinking effects) for a great user experience.

Designed specifically to work with the Adafruit Fingerprint sensors
  * http://www.adafruit.com/products/751
  * https://www.adafruit.com/product/4651

Pick one up today in the adafruit shop!

These sensors use TTL Serial to communicate, 2 pins are required to interface

Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

Written by Limor Fried/Ladyada  for Adafruit Industries.
BSD license, check license.txt for more information
All text above must be included in any redistribution

branch_name: refs/heads/main

gha_license_id: MIT


text:
# `SCF`
Suil C++ Framework - a mordern `C++` micro framework packaged in various libraries that can be used to develop micro service components.

[SCF Documentation](https://suilteam.com)

## Hello World
```c++
#include "suil/http/server/endpoint.hpp"

namespace hs   = suil::http::server;
namespace net  = suil::net;

int main(int argc, char *argv[])
{
    using Server = hs::Endpoint<>;
    // Create an http endpoint that uses default configurations
    Server ep("/");

    // GET http://localhost/hello
    Route(ep, "/hello")
    ("GET"_method, "OPTIONS"_method)
    (Desc{"Route returns hello world"})
    .attrs(opt(ReplyType, "text/plain"))
    ([&]() {
        // body will be cleared after response
        return "Hello World!";
    });

    // GET http://localhost/echo
    Route(ep, "/echo")
    ("GET"_method, "OPTIONS"_method)
    (Desc{"Route returns whatever was given in the request body"})
    .attrs(opt(ReplyType, "text/plain"))
    ([&](const hs::Request& req, hs::Response& res) {
        // Chunked response buffer to support zero copy
        res.chunk({const_cast<char *>(req.body().data()), req.body().size(), 0});
    });

    return ep.start();
}

```

# `SCF` Features
Everything in `suil` is developed with coroutines in mind (thanks to Libmill). Imagine go but in C++
| Features | What's up |
|:-----------|:-------------|
| **[Suil Code Compiler](/documentation/scc)** | `scc` is a plugin base tool that can transform a **defined** subset of `C++` header file content to a syntax tree that can be crunched by plugins (`generators`) to generate code. |
| **[Logging](/documentation/libs/base/logging)** | Customizable `printf` style logging |
| **[Mustache](/documentation/libs/base/mustache)** | `SCF` includes a cached mustache template parser and renderer |
| **[JSON](/documentation/libs/base/json)** | Includes a static JSON decoder/encoder from IOD and dynamic parser/encoder |
| **[Cryptography wrappers](/documentation/libs/base/crypto)** | Wrappers around OpenSSL API's - mostly the the kind you will find in blockchain implementations |
| **[Binary Serialization protocol](/documentation/libs/base/wire)** | A custom binary serialization protocol (currently work in progress and open for major improvements) which is dubbed `suil` |
| **[PostgreSQL database](/documentation/libs/database/postgres)** | A very easy to use  PostgreSQL client. This client is based on coroutines and provides a nice API. Supports cached connections and statements
| **[Redis Database Client](/documentation/libs/database/redis)** | A hand written Redis client based on the spec. Provides cached connections and implements most features of Redis. It is easy to add features to this client to keep up with redis |
| **[Sockets Library](/documentation/libs/network/socket)** | Libmill provide some API's that abstract Unix socket API's. `SCF` Sockets Library provide easy to use `C++` abstractions of top of libmill abstractions |
| **[ZMQ Abstraction](/documentation/libs/network/zmq)** | A very beautiful and easy to use ZMQ API abstraction on to of the `C` ZMQ library |
| **[SMTP Client and Server](/documentation/libs/network/zmq)** | A fully fledged SMTP client which can be used to send emails to SMTP servers. The server implementation is minimal and can be used to prototype an SMTP servers for testing environments. An `SmtpOutbox` is provided to avoid having to wait for mail server to respond when sending SMTP emails |
| **[RPC Framework](/documentation/libs/scf)** | `SCF` provides A gRPC like easy to use framework but very light weight based on **[`Suil Code Compiler`](/documentation/scc)** and corresponding `rpc` generator written for `scc`. |
| **[JSON RPC](/documentation/libs/rpc/json)** | Clean and easy to use JSON RPC framework and is compliant with JSON RPC 2.0 spec. |
| **[Suil RPC](/documentation/libs/rpc/suil)** | An RPC which custom `suil` binary serialization protocol (binary) for encoding data that goes on the wire |
| **[`scc` RPC generator](/documentation/libs/rpc/generator)** | An `scc` generator which generates RPC services from `.scc` code files. i.e this generator transforms a `C++` class definition (with some syntactic sugar) into either `SRPC`/`JRPC` client API and server API' |
| **[HTTP/1 Web API](/documentation/libs/http/server)** | The backbone of this project started it all. This API tries to simplify developing HTTP web applications and features with `C++`; See the HTTP features below |
| **[HTTP/1 Client](/documentation/libs/http/client)** | A clean session based HTTP/1 client |
| **[WebSocket Server](/documentation/libs/http/websocket)** | Provides API's that can be used to develop robust websocket servers |
| **[HyperLedger Sawtooth SDK](/documentation/libs/sawtooth)** | A fully fledged and easy to use HyperLedger sawtooth client |
| **[Mongo DB CLient](/documentation/libs/database/mongo)** | Coming soon...  building from spec... |

## `SCF` HTTP/1 Web API Features
- An easy to use [parameter based static and dynamic routing](/documentation/libs/http/server/routing) API
- Middleware based endpoints
- [Application Initialization Middleware](/documentation/libs/http/server/app-init) which can be used to provide an initialization route for the API while blocking all the other routes
- [System Attributes Middleware](/documentation/libs/http/server/sysattrs) can be added to the endpoint to allow adding features that toggle options on the endpoint (e.g enabling/disabling authentication on specific route)
- One-line method call for [Route Administration and API documentation](/documentation/libs/http/server/route-admin), this expose's routes that can be used to administer the endpoint, including enabling/disabling routes and querying route metadata (Admin Only)
- [JSON Web Token](/documentation/libs/http/jwt) API's which can be used to create JWT tokens and verify them
- [JWT Authorization Middleware](/documentation/libs/http/server/jwtauth) is available for JWT authentication. When added to an endpoint, it will validate all routes marked with `Authorize` attribute and reject all unauthorized requests
- [JWT Session Middleware](/documentation/libs/http/server/jwtsession) builds on top of JWT Authorization  and Redis Middlewares by implementing session based JWT (i.e the refresh/accept token ideology)
- [Redis](/documentation/libs/http/server/redis-mw) and [PostgreSQL](/documentation/libs/http/server/postgres-mw) middlewares which when attached to an endpoint, can be used as database connection providers for the endpoint
- [File Server](libraries/http/server/fs) which can be used to serve the contents of any directory. This is still missing some features but thrives to be **very** fast and reliable.
  * Supports cached files, i.e files are cached in an `L.R.U` cache
  * Range based requests
  * Cache headers
  * Easy configuration API. e.g `fs.mime("js", opt(allowCache, true))` will allow the server to cache javascript files
  * _There is still some of work to here but current implementation serves basic needs_

## Benchmarking (in progress)
This will be done right once the docs site is done. But for an overview,
testing on my laptop yields the following results
##### Environment
* OSX BigSur LTS (application running on docker container)
* 2.8 GHz Quad-Core Intel Core i7
  - 4 cores, 8 threads
  - 12Gb RAM
* Application configured with 6 threads
* [wrk2](https://github.com/giltene/wrk2) master running on same machine

### Application output
```shell
curl -i http://localhost:8000/hello ; echo
HTTP/1.1 200 OK
Connection: Keep-Alive
KeepAlive: 300000
Strict-Transport-Security: max-age 3600; includeSubdomains
Content-Type: application/json
Server: Suil-Http-Server
Date: Wed, 21 Apr 2021 01:12:38 GMT
Content-Length: 11

Hello World
```

### Benchmark results
```bash
wrk -t3 -c1000 -R1M http://<IP_ADDRESS>:8000/hello
Running 10s test @ http://<IP_ADDRESS>:8000/hello
  3 threads and 1000 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     3.32s     1.96s    7.35s    58.71%
    Req/Sec       -nan      -nan   0.00      0.00%
  2003273 requests in 10.00s, 473.80MB read
Requests/sec: 200347.19
Transfer/sec:     47.38MB
```

## Giving credits where they are due
The following list of open source libraries are used in `SCF` is third party dependencies

| Library | How it is used |
|:--------|:---------------|
|**[Libmill](http://libmill.org)** | Libmill is the core of this project. It provides the the coroutine concurrency used across the the project. `SCF` uses a modified version of this library [Suil/Libmill](https://gitlab.com/sw-devel/thirdparty/libmill). The main modification introduced in the aforementioned repo is multi threading and API's that are commonly used in multi thread applications |
| **[IOD](https://github.com/matt-42/iod)** | IOD is a library that enhances `C++` meta programing. `suil` uses this library intensively more specifically around it's `json` encoding/decoding features and it's symbol types. An extensible code generator ([`scc` or Suil Code Compiler](https://gitlab.com/sw-devel/tools/scc)), was created to support generating IOD symbols and `suil` meta types. |
| **[Crow](https://github.com/ipkn/crow)** | Crow provides the routing and middleware dispatch magic that is used in the HTTP server code. See [suil/http/server/crow.hpp](https://github.com/dccarter/suil/blob/main/libs/http/include/suil/http/server/crow.hpp), [suil/http/server/rch.hpp](https://github.com/dccarter/suil/blob/main/libs/http/include/suil/http/server/rch.hpp) which includes code copied from crow and modified accordingly |
| **[Catch](https://github.com/catchorg/Catch2)** | Catch is used across the project for writing unit tests |

Any other code that might have been used, either modified or copied as is, the original licence text kept at the top of the file or comment with a link to the source of the snippet is included

license: MIT

repository: dccarter/suil

repo_name: dccarter/suil


text:
# TusDotNetClient
.Net client for [tus.io](http://tus.io/) Resumable File Upload protocol.

## Features
- Supports tus v1.0.0
- Protocol extensions supported: Creation, Termination
- Upload progress events

## Usage
```c#
var file = new FileInfo(@"path/to/file.ext");
var client = new TusClient();
var fileUrl = await client.CreateAsync(Address, file.Length, metadata);
await client.UploadAsync(fileUrl, file, chunkSize: 5D);
```

### Progress updates
`UploadAsync` returns an object of type `TusOperation`, which exposes an event which will report the progress of the upload.

Store the return object in a variable and subscribe to the `Progressed` event for updates. The upload operation will not start until `TusOperation` is `await`ed.

```c#
var file = new FileInfo(@"path/to/file.ext");
var client = new TusClient();
var fileUrl = await client.CreateAsync(Address, file.Length, metadata);
var uploadOperation = client.UploadAsync(fileUrl, file, chunkSize: 5D);

uploadOperation.Progressed += (transferred, total) =>
    System.Diagnostics.Debug.WriteLine($"Progress: {transferred}/{total}");

await uploadOperation;
```

## License
MIT

repository: jonstodle/TusDotNetClient

gha_language: C#

repo_name: jonstodle/TusDotNetClient


text:
# Crc32

`Zend\Validator\File\Crc32` allows you to validate if a given file's hashed
contents matches the supplied crc32 hash(es). It is subclassed from the [Hash
validator](hash.md) to provide a validator that only supports the `crc32`
algorithm.

> ### Requires the hash extension
>
> This validator requires the PHP [Hash extension](http://php.net/hash) with the
> `crc32` algorithm.

## Supported Options

The following options are supported:

- `hash`: Single string hash to test the file against, or array of filename/hash
  pairs.

## Usage Examples

```php
// Does file have the given hash?
$validator = new \Zend\Validator\File\Crc32('3b3652f');

// Or, check file against multiple hashes
$validator = new \Zend\Validator\File\Crc32(['3b3652f', 'e612b69']);

// Perform validation with file path
if ($validator->isValid('./myfile.txt')) {
    // file is valid
}
```

## Public Methods

### getCrc32

```php
getCrc32() : array
```

Returns an array of all currently registered hashes to test against.

### addCrc32

```php
addCrc32(string|array $options) : void
```

Add a single hash to test against, or a set of filename/hash pairs to test
against.

### setCrc32

```php
setCrc32(string|array $options): void
```

Overwrite the current list of registered hashes with the one(s) provided.

gha_language: PHP


text:
---
layout: function
title: get_try
brief: Returns the result of the future.
defined-in-header: stlab/concurrency/future.hpp
tags:
  - function
overloads:
  stlab::optional<T> get_try():
    description: If `T` is not `void`, it returns an initialized `optional` if the future has succeeded, otherwise an empty `optional<T>`. In case that an error occurred it rethrows the captured exception.
    return: __OPTIONAL__
    signature_with_names: stlab::optional<T> get_try()
  bool get_try():
    description: If `T` is void it returns `true` if the future succeeded, otherwise `false`. In case that an error occurred it rethrows the captured exception.
    return: __OPTIONAL__
    signature_with_names: bool get_try()
---
If `T` is of type `void`, it returns `true` if the future is fulfilled; if `T` is a non-`void` type then it returns an `optional<T>` with the result of the future if the future is already fulfilled, otherwise an empty `optional<T>`

repository: stlab/libraries

repo_name: stlab/libraries


text:
# Welcome!

We're so glad you're thinking about contributing to a DTO project. This is an evolving project and relies on help and feedback to improve.

**Found a bug while using the framework or guide?**
Let us know by [raising an issue](#submitting-an-issue).

**Have a suggestion for a new feature?**
If you can reach us on Slack, message us and let us know. If you're not on Slack, that's fine, just [open an issue](#submitting-an-issue)

If your suggestion is not already in our roadmap, we'll probably suggest that you make a fork of our repo and then [open a pull request](submitting-a-pr) so that we can review your changes or additions and hopefully merge them in.

We encourage you to read our [Contributor Code of Conduct](). By ensuring that all staff and contributors follow this guide we can maintain an inclusive and friendly environment.

We've also put together some [Coding Convention guidelines]() which explain our code style and linting.

Finally, if you're unsure about anything, just ask — or submit your issue or pull request anyway. The worst that can happen is we'll politely ask you to change something. We appreciate all friendly contributions.

## Guidelines

### Submitting an issue

### Submitting a pull request

To help us get a better understanding of the issue you're submitting, follow our [ISSUE TEMPLATE]() and the guidelines it describes.

### Submitting a pull request

Here are a few guidelines to follow when submitting a pull request:

1. Create a GitHub account or sign in to your existing account.
1. Fork this repo into your GitHub account (or just clone it if you're an AusDTO team member). Read more about forking a repo here on GitHub:
[https://help.github.com/articles/fork-a-repo/](https://help.github.com/articles/fork-a-repo/)
1. Create a branch that lightly defines what you're working on, prefixed with '/feature' (for example, feature/add-styles).
1. Ensure that your contribution passes a production build.
1. Once you're ready to submit a pull request, fill out the PULL REQUEST template provided.
1. Submit your pull request against the main development branch.

Have questions or need help with setup? [Open an issue]().

---

This guide is adapted from [18F's Contributing Guide](https://github.com/18F/open-source-policy/blob/master/CONTRIBUTING.md)

repository: AusDTO/development-at-dto

repo_name: AusDTO/development-at-dto


text:
# Setting up a test deployment
Lets go over a typical setup using [docker](https://www.docker.com/) and
[docker-compose](https://docs.docker.com/compose/).

### Have questions?
- Open an issue
- Ask on [gitter](https://gitter.im/jeffjen/ambd?utm_source=share-link&utm_medium=link&utm_campaign=share-link)

### Composition and definition
Create a custom bridge network with docker
```
docker network create --driver bridge isolated_nw
```

Service stack is defined in [docker-compose.yml](docker-compose.yml).

### Starting up
Launch the stack by executing `docker-compose up`.  This will take a while to
download necessary images and building our test app.

Your app after staring will be complaining it could not reach a Redis node.
Lets fix this by configuring `ambassador` to point to a Redis endpoint.

In another terminal, copy `ambctl` from the container
```
docker cp ambassador:/ambctl ./ambctl
```

Configure a route to Redis node
```
./ambctl create --name redis --src :6379 --dst redis:6379
```

Your app should quickly start reporting the role of the Redis it connected to,
but why go through all this trouble when you could specify `redis:6379` to
connect in your app?

The reason is configurability and moving between environment.  When I ship my
service, it needs to talk to our production Redis node, but I don't want to
stop my service to change code and/or redeploy.  I could configure `ambd` by
```
./ambctl cancel --name redis
./ambctl create --name redis --src :6379 --dst production-redis:6379
```

After a little hiccup, the app starts talking to `production-redis:6379`
without code change nor deployment.

### Advanced Configuration
`ambd` true triumphs comes from integrating with popular discovery backend
[etcd](https://github.com/coreos/etcd).  Static IP based route assignment is
greate for testing, but it quickly becomes hard to track which host represents
what service as you add more nodes in your infrastructure.  A common strategy
is to tag or group services by name, and in `etcd`, you place nodes
representing a service under a directory (a service key) e.g. /srv/redis/debug, or
/srv/mongodb/staging.

`ambd` allows you to set route to these services by referring to the directory
they are in.  Whenever a node joins or leaves it's service, `ambd` will get
notification to obtain the latest set of available nodes.  Thereby removing the
need to reconfigure `ambd`.

To demonstrate `ambd` with discovery backend, stop and remove the stack we
initiated by `Ctrl-C`, followed by `docker-compose rm -f`.

### Composition and definition
In order for the test to work, please add `<IP_ADDRESS> ambassador` to your
`/etc/hosts`.  This is required because we are testing on a single machine, and
advertising becomes difficult with containers when not knowing interface IP
ahead of time.

Service stack is defined in [docker-compose.etcd.yml](docker-compose.etcd.yml).

### Starting up
Launch the stack with `docker-compose -f docker-compose.etcd.yml up`.

Again upon launch your app will start complaining it could not reach a Redis
node.  Fix this by configuring `ambd` to point to a Redis endpoint.
```
./ambctl create --name redis --src :6379 --srv /srv/redis/debug
```

Notice that we have a little help with
[docker-monitor](https://github.com/jeffjen/docker-monitor), which provides
regitration to discovery backend if service declare themselves by label.  If
you disable docker-montior, you need to register Redis node to
`/srv/redis/debug` manually through `etcdctl` command.
```
docker cp discovery:/etcdctl ./etcdctl
etcdctl set /srv/redis/debug/<IP_ADDRESS>:16379 <IP_ADDRESS>:16379
```

### Using config key for consistent deployment
You are statisfied with the configuration, now its time to go big.  Set a
config key for `ambd` to obtain and follow.

Suppose our runtime environment is required to be:
```
[
    {
        "name": "cache",
        "net": "tcp4",
        "src": ":6379",
        "srv": "/srv/redis/cache"
    },
    {
        "name": "db",
        "net": "tcp4",
        "src": ":27017"
        "dst": [
            "mongo-router-01:27017",
            "mongo-router-02:27017",
            "mongo-router-03:27017"
        ]
    },
]
```

Store this document to `cfg.json`

**Tip**: use jq to manipulate json documents on the command line:
```
curl -sSL https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 -o jq
chmod +x ./jq
```

Send config to discovery backend:
```
./etcdctl set /proxy/myapp/v1 "$(jq -c . <cfg.json)"
```

Launch ambassador to run with config key:
```
docker run -d --name ambassador -m 128M -p 29091:29091 \
    jeffjen/ambd \
        --addr <IP_ADDRESS>:29091 \
        --cluster debug \
        --advertise HostIP:29091 \
        --proxycfg /proxy/myapp/v1 \
        etcd://discovery-001:2379,discovery-002:2379,discovery-003:2379
```

If chanages are made to config key `/proxy/maypp/v1`, all `ambd` following that
key will react to obtain the latest setting.  If you prefer strict
versioning, submit new config with key `/proxy/myapp/v2`, and execute the
following command:
```
ambctl volly --cluster debug --dsc http://discovery-001:2379 config /proxy/config/v2
```

All `ambd` nodes registered under cluster `debug` will obtain and follow new
configuration from `/proxy/config/v2`.

repository: jeffjen/ambd

repo_name: jeffjen/ambd


text:
# Progressive-Budget

 ![Badge](https://img.shields.io/badge/license-MIT-blue)

  ## Description

  As a user, I can add my daily transactions and keep track of my weekly budget. I can add and subtract transactions daily to make sure that all my transactions are registered. I can also add my transactions offline using indexedDB. Once back online, the transactions are then registered again in my mongoDB database.

## Table of Contents

* [Description](#Description)
* [Demo](#demo)
* [links](#links)
* [Usage](#Usage)
* [tech](#tech)
* [licenses](#licenses)
* [Questions](#Questions)

## Demo

![demo](/assets/budget.gif)

## Links

https://github.com/adeha047/Progressive-Budget

https://tranquil-taiga-50357.herokuapp.com/

## Usage

## Tech Used

1. MongoDB
2. IndexedDb
2. Express
3. Node
4. HTML
5. CSS

## Licenses

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

Please click on the license tab or please check out the URL here for more information on the requested license: https://choosealicense.com/licenses/mit/

## Questions

Please reach out to me if you have any further questions

github: https://github.com/adeha047

email: dehaven777@gmail.com


text:
Contributing
============

To contribute please fork and submit a pull request.

Please ensure all tests and pmd/checkstyle pass before submitting a pull request by doing,

    mvn verify

Add tests as appropriate.  Most tests will run against the default file system
implementation as well to ensure we match the implementation of the real file system.
You can do this by annotating test classes with,

    @RunWith(MultiFsRunner.class)

repository: sbridges/ephemeralfs

repo_name: sbridges/ephemeralfs


text:
# Let Your Users Decide the Plot Height

When you create a `shiny` app you rarely know the size of the screen on which your users will use the app. It could be a small 12'' laptop or a desktop with a 20'' screen. Thus, the single default value that you can provide for the height of your `plotOutput()` will inevitably be a bad choice for somer users.

How to tackle this issue? A solution is to enable your users to adjust the plot height dynamically. To do so first add a `sliderInput()` to your UI. Make sure to set the post argument to `"px"` as `plotOutput()` expects a string like `"200px"` for its height argument. Next, instead of your usual `plotOutput(inputId = "plot")` place `uiOutput(inputId = "plot_placeholder")` inside `ui.R`.

Now comes the more difficult part. Here's a worked example from my demo app's `server.R` file:

```r
output$plot <- renderPlot({
  ggplot(mtcars) +
    aes_string(input$x, input$y) +
    geom_point() +
    geom_smooth(method = "lm")
})

output$plot_placeholder <- renderUI({
  plotOutput("plot", height = input$plot_height)
})
```

As you can see from this example you need to first render your plot and then call `plotOutput()` - which you would usually place in `ui.R` - inside of `renderUI()`. Basically `uiOutput()` in `ui.R` serves as a container for an output you define inside `server.R`.

To see this in action run the following commands in your `R` console:

```r
required_pkgs <- c("shiny", "ggplot2")
installed_pkgs <- installed.packages()
for (pkg in required_pkgs) {
  if (!pkg %in% installed_pkgs) install.packages(pkg)
}
shiny::runGitHub("shiny-demo-apps", "thomas-neitmann", subdir = "adjust-plot-height")
```

repository: thomas-neitmann/shiny-demo-apps

repo_name: thomas-neitmann/shiny-demo-apps


text:
[CI-Badge]: https://github.com/gaelrenoux/tranzactio/actions/workflows/ci.yml/badge.svg
[CI-Link]: https://github.com/gaelrenoux/tranzactio/actions?query=branch%3Amaster
[SonatypeReleases-Link]: https://oss.sonatype.org/content/repositories/releases/io/github/gaelrenoux/tranzactio_2.13/
[SonatypeReleases-Badge]: https://img.shields.io/nexus/r/https/oss.sonatype.org/io.github.gaelrenoux/tranzactio_2.13.svg

# TranzactIO

[![CI][CI-Badge]][CI-Link]
[![Releases][SonatypeReleases-Badge]][SonatypeReleases-Link]

TranzactIO is a ZIO wrapper for some Scala database access libraries (Doobie and Anorm, for now).

If the library comes with an IO monad (like Doobie's `ConnectionIO`), it lifts it into a `ZIO[Connection, E, A]`.
If the library doesn't have an IO monad to start with (like Anorm), it provides a `ZIO[Connection, E, A]` for the role.

Note that `Connection` is **not** Java's `java.sql.Connection`, it's a TranzactIO type.

When you're done chaining ZIO instances (containing either queries or whatever code you need), use TranzactIO's `Database` module to provide the `Connection` and execute the transaction.
`Database` can also provide a `Connection` in auto-commit mode, without a transaction.

TranzactIO comes with a very small amount of dependencies: only ZIO and ZIO-interop-Cats are required.

Any constructive criticism, bug report or offer to help is welcome. Just open an issue or a PR.

### Why ?

If I want to run that logic within a transaction, I have to wrap it with Doobie's `ConnectionIO`.
But I'm already using ZIO as my effect monad! I don't want another one...
In addition, IO monads in DB libraries (like Doobie's `ConnectionIO`) miss quite a bit of the operations that ZIO has.

That's where TranzactIO comes from. I wanted a way to use ZIO everywhere, and run the transaction whenever I decided to.

## Getting started

### Sbt setup

TranzactIO is available on the Sonatype Central Repository (see the Nexus badge on top of this README to get the version number). In your build.sbt:
```sbt
// Add this if you use doobie:
libraryDependencies += "io.github.gaelrenoux" %% "tranzactio-doobie" % TranzactIOVersion
// Or this if you use anorm:
libraryDependencies += "io.github.gaelrenoux" %% "tranzactio-anorm" % TranzactIOVersion
```

### Imports

Most of the time, you will need to import two packages.
The first is `io.github.gaelrenoux.tranzactio._` and contains Tranzactio's generic classes, like `DbException`.

The second one is specific to the DB-library you are using.
The names of most entities are the same for each DB-library: for instance, you'll always have the `tzio` function, or the `Connection` and `Database` classes.
The package is always named after the DB-library it is used with, e.g.:
- `io.github.gaelrenoux.tranzactio.doobie._`
- `io.github.gaelrenoux.tranzactio.anorm._`

### Wrapping a query

Just use `tzio` to wrap your usual query type!

#### Doobie

```scala
import zio._
import doobie.implicits._
import io.github.gaelrenoux.tranzactio._
import io.github.gaelrenoux.tranzactio.doobie._

val list: ZIO[Connection, DbException, List[String]] = tzio {
    sql"SELECT name FROM users".query[String].to[List]
}
```

#### Anorm

Since Anorm doesn't provide an IO monad (or even a specific query type), `tzio` will provide the JDBC connection you need to run a query. The operation will be wrapped in a ZIO (as a blocking effect).

```scala
import zio._
import anorm._
import io.github.gaelrenoux.tranzactio._
import io.github.gaelrenoux.tranzactio.anorm._

val list: ZIO[Connection, DbException, List[String]] = tzio { implicit c =>
    SQL"SELECT name FROM users".as(SqlParser.str(1).*)
}
```

### Running the transaction (or using auto-commit)

The `Database` module (from the same package as `tzio`) contains the methods needed to provide the `Connection` and run the transactions.

Here are some examples with Doobie.
The code for Anorm is identical, except it has a different import: `io.github.gaelrenoux.tranzactio.anorm._` instead of `io.github.gaelrenoux.tranzactio.doobie._`.

```scala
import io.github.gaelrenoux.tranzactio._
import io.github.gaelrenoux.tranzactio.doobie._
import zio._
import zio.console.Console

// Let's start with a very simple one. Connection exceptions are transformed into defects.
val zio: ZIO[Connection, String, Long] = ???
val simple: ZIO[Database, String, Long] = Database.transactionOrDie(zio)

// If you have an additional environment, it would end up on the resulting effect as well.
val zioEnv: ZIO[Connection with Console, String, Long] = ???
val withEnv: ZIO[Database with Console, String, Long] = Database.transactionOrDie(zioEnv)

// Do you want to handle connection errors yourself? They will appear on the Left side of the Either.
val withSeparateErrors: ZIO[Database, Either[DbException, String], Long] = Database.transaction(zio)

// Are you only expecting errors coming from the DB ? Let's handle all of them at the same time.
val zioDbEx: ZIO[Connection, DbException, Long] = ???
val withDbEx: ZIO[Database, DbException, Long] = Database.transactionOrWiden(zioDbEx)

// Or maybe you're just grouping all errors together as exceptions.
val zioEx: ZIO[Connection, java.io.IOException, Long] = ???
val withEx: ZIO[Database, Exception, Long] = Database.transactionOrWiden(zioEx)

// You can also commit even on a failure (only rollbacking on a defect). Useful if you're using the failure channel for short-circuiting!
val commitOnFailure: ZIO[Database, String, Long] = Database.transactionOrDie(zio, commitOnFailure = true)

// And if you're actually not interested in a transaction, you can just auto-commit all queries.
val zioAutoCommit: ZIO[Database, String, Long] = Database.autoCommitOrDie(zio)
```

### Providing the Database

The `Database` methods return a ZIO instance which requires a `Database` as an environment.
This module is provided as usual through a `ZLayer`.

The most common way to construct a `Database` is using a `javax.sql.DataSource`, which your connection pool implementation (like HikariCP) should provide.
Alternatively (e.g. in a test environment), you can create a `DataSource` manually.

The layer to build a `Database` from a `javax.sql.DataSource` is on the `Database` object.
Here's an example for Doobie.
Again, the code for Anorm is identical, except it has a different import: `io.github.gaelrenoux.tranzactio.anorm._` instead of `io.github.gaelrenoux.tranzactio.doobie._`.

```scala
import io.github.gaelrenoux.tranzactio.doobie._
import javax.sql.DataSource
import zio._
import zio.clock.Clock

val dbLayer: ZLayer[Has[DataSource], Nothing, Database] = Database.fromDatasource
```

### More code samples
Find more in `src/main/samples`, or look below for some details.

## Detailed documentation

### Version compatibility

The table below indicates for each version of TranzactIO, the versions of ZIO or libraries it's been built with.
Check the backward compatibility information on those libraries to check which versions TranzactIO can support.

| TranzactIO | Scala       | ZIO          | Doobie       | Anorm        |
|------------|-------------|--------------|--------------|--------------|
| 0.1.0      |      2.13   | 1.0.0-RC17   | 0.8.6        | -            |
| 0.2.0      |      2.13   | 1.0.0-RC18-2 | 0.8.6        | -            |
| 0.3.0      |      2.13   | 1.0.0-RC18-2 | 0.8.6        | 2.6.5        |
| 0.4.0      |      2.13   | 1.0.0-RC19-2 | 0.9.0        | 2.6.5        |
| 0.5.0      |      2.13   | 1.0.0-RC20   | 0.9.0        | 2.6.5        |
| 0.6.0      |      2.13   | 1.0.0-RC21-1 | 0.9.0        | 2.6.5        |
| 1.0.0      |      2.13   | 1.0.0        | 0.9.0        | 2.6.7        |
| 1.0.1      |      2.13   | 1.0.0        | 0.9.0        | 2.6.7        |
| 1.1.0      |      2.13   | 1.0.3        | 0.9.2        | 2.6.7        |
| 1.2.0      |      2.13   | 1.0.3        | 0.9.2        | 2.6.7        |
| 1.3.0      |      2.13   | 1.0.5        | 0.9.4        | 2.6.10       |
| 2.0.0      |      2.13   | 1.0.5        | 0.12.1       | 2.6.10       |
| 2.1.0      | 2.12 2.13   | 1.0.9        | 0.13.4       | 2.6.10       |
| 3.0.0      | 2.12 2.13   | 1.0.11       | 1.0.0-RC2    | 2.6.10       |
| 4.0.0      | 2.12 2.13   | 2.0.0        | 1.0.0-RC2    | 2.6.10       |
| 4.1.0      | 2.12 2.13 3 | 2.0.2        | 1.0.0-RC2    | 2.7.0        |
| 4.2.0      | 2.12 2.13 3 | 2.0.13       | 1.0.0-RC2    | 2.7.0        |
| master     | 2.12 2.13 3 | 2.0.13       | 1.0.0-RC2    | 2.7.0        |

### Some definitions

#### Database operations

You will find reference through the documentation to ***Database operations***.
Those are the specific operations handled by Tranzactio, that are necessary to interact with a database:
- ***openConnection***
- ***setAutoCommit***
- ***commitConnection***
- ***rollbackConnection***
- ***closeConnection***

They correspond to specific methods in the `ConnectionSource` service.
You would not usually address that service directly, going through `Database` instead.

#### Error kinds

In TranzactIO, we recognize two kinds of errors relating to the DB: query errors, and connection errors:

**Query errors** happen when you run a specific query.
They can be timeouts, SQL syntax errors, constraint errors, etc.
When you have a `ZIO[Connection, E, A]`, E is the type for query errors.

**Connection errors** happen when you manage connections or transactions: opening connections, creating, commiting or rollbacking transactions, etc.
They are not linked to a specific query.
They are always reported as a `DbException`.

### Running a query (detailed version)

There are two families of methods on the `Database` class: `transaction` and `autoCommit`.
I'll only describe `transaction` here, keep in mind that there's an identical set of operations with `autoCommit` instead.

 When providing the `Connection` with `Database`, you have three variants of the `transaction` method, which will handle unrecovered connection errors differently.
- With `transaction`, the resulting error type is an `Either`: `Right` wraps a query error, and `Left` wraps a connection error. This is the most generic method, leaving you to handle all errors how you see fit.
- With `transactionOrDie`, connection errors are converted into defects, and do not appear in the type signature.
- With `transactionOrWiden`, the resulting error type will be the closest supertype of the query error type and `DbException`, and the error in the result may be a query error or a connection error. This is especially useful if your query error type is already `DbException` or directly `Exception`, as in the example below.

```scala
val zio: ZIO[Connection, E, A] = ???
val result1: ZIO[Database, Either[DbException, E], A] = Database.transaction(zio)
val result2: ZIO[Database, E, A] = Database.transactionOrDie(zio)
// assuming E extends Exception:
val result3: ZIO[Database, Exception, A] = Database.transactionOrWiden(zio)
```

A frequent case is to have an additional environment on your ZIO monad, e.g.: `ZIO[ZEnv with Connection, E, A]`.
All methods mentioned above will carry over the additional environment:
```scala
val zio: ZIO[ZEnv with Connection, E, A] = ???
val result1: ZIO[Database with ZEnv, Either[DbException, E], A] = Database.transaction(zio)
val result2: ZIO[Database with ZEnv, E, A] = Database.transactionOrDie(zio)
// assuming E extends Exception:
val result3: ZIO[Database with ZEnv, Exception, A] = Database.transactionOrWiden(zio)
```

All the `transaction` methods take an optional argument `commitOnFailure` (which defaults to `false`).
If `true`, the transaction will be committed on a failure (the `E` part in `ZIO[R, E, A]`), and will still be rollbacked on a defect.
Obviously, this argument does not exist on the `autoCommit` methods.

Finally, all those methods take an optional implicit argument of type `ErrorStrategies`. See **Handling connection errors** below for details.

### Handling connection errors (retries and timeouts)

TranzactIO provides no specific error handling for query errors.
Since you, as the developer, have direct access to the ZIO instance representing the query (or aggregation of queries), it's up to you to add timeouts or retries, recover from errors, etc.
However, you do not have access to the connection errors, which are hidden in the `ConnectionSource` and `Database` modules.

The error handling on connection errors is set up through an `ErrorStrategies` instance.
An `ErrorStrategies` is a group of `ErrorStrategy` instances, one for each of the database operations (`openConnection`, `setAutoCommit`, etc.)

#### Passing ErrorStrategies

TranzactIO looks for an `ErrorStrategies` in three different places, in order:
- You can pass an implicit `ErrorStrategies` parameter when calling the `Database` methods. If no implicit value is provided, it will defer to the next mechanism.
- When declaring the `Database` or `ConnectionSource` layer, you can pass an `ErrorStrategies` as a parameter.
- If no `ErrorStrategies` is defined either as an implicit parameter or in the layer definition, default is `ErrorStrategies.Nothing`: no retries and no timeouts.

```scala
implicit val es: ErrorStrategies = ErrorStrategies.retryForeverFixed(10.seconds)
Database.transaction(???) // es is passed implicitly to the method
```

```scala
val es: ErrorStrategies = ErrorStrategies.retryForeverFixed(10.seconds)
val dbLayerFromDatasource: ZLayer[Has[DataSource] with Clock, Nothing, Database] = Database.fromDatasource(es)
```

#### Defining an ErrorStrategies instance

To define an `ErrorStrategies`, start from the companion object, then add the retries and timeouts you want to apply.
Note that the operations are applied in the order you gave them (a timeout defined after a retry will apply a maximum duration to the retrying effect).
```scala
val es: ErrorStrategies = ErrorStrategies.timeout(3.seconds).retryCountExponential(10, 1.second, maxDelay = 10.seconds)
val es2: ErrorStrategies = ErrorStrategies.timeout(3.seconds).retryForeverFixed(1.second).timeout(1.minute)
```

If you want a specific strategy for some operation, you can set the singular `ErrorStrategy` manually:
```scala
val es: ErrorStrategies =
  ErrorStrategies.timeout(3.seconds).retryCountExponential(10, 1.second, maxDelay = 10.seconds)
    .copy(closeConnection = ErrorStrategy.retryForeverFixed(1.second)) // no timeout and fixed delay for closeConnection
```

#### Important caveat regarding timeouts

I strongly recommend that for timeouts, you use the mechanisms on your data source (or database) as you primary mechanism, and only use Tranzactio's timeouts as a backup if needed.

This is ***especially important*** for the `openConnection` operation: you should never have a timeout over this in TranzactIO, as it could lead to connection leaks!
For example, your app may encounter a timeout and abort the effect, but the data source is still going through and ends up providing a connection, which is lost.
Therefore, timeouts defined at the top-level of error strategies (as the first examples above) will ***not*** apply to `openConnection` (note that this only applies to timeouts, retries will indeed be applied to `openConnection`).

If after everything I said you find yourself wanting a headache, you can still define a timeout on `openConnection` by defining the corresponding `ErrorStrategy` manually.
```scala
// THIS IS A BAD IDEA, DON'T DO THIS.
val es: ErrorStrategies =
  ErrorStrategies.timeout(3.seconds).retryForeverFixed(1.second)
    .copy(openConnection = ErrorStrategy.timeout(3.seconds).retryForeverFixed(1.second))
```

### Single-connection Database

In some cases, you might want to have a `Database` module representing a single connection.
This might be useful for testing, or if you want to manually manage that connection.

For that purpose, you can use the layer `ConnectionSource.fromConnection`.
This layer requires a single JDBC `Connection`, and provides a `ConnectionSource` module.
You must then use the `Database.fromConnectionSource` layer to get the `Database` module.

Note that this ConnectionSource does not allow for concurrent usage, as that would lead to undeterministic results.
For example, some operation might close a transaction while a concurrent operation is between queries!
The non-concurrent behavior is enforced through a ZIO semaphore.

### Unit Testing

When unit testing, you typically use `ZIO.succeed` for your queries, instead of an actual SQL query.
However, the type signature still requires a Database, which you need to provide.
`Database.none` exists for this purpose: it satisfies the compiler, but does not provide a usable Database (so don't try to run any actual SQL queries against it).
```scala
import zio._
import doobie.implicits._
import io.github.gaelrenoux.tranzactio.DbException
import io.github.gaelrenoux.tranzactio.doobie._
import zio.clock.Clock

val liveQuery: ZIO[Connection, DbException, List[String]] = tzio { sql"SELECT name FROM users".query[String].to[List] }
val testQuery: ZIO[Connection, DbException, List[String]] = ZIO.succeed(List("Buffy Summers"))

val liveEffect: ZIO[Database, DbException, List[String]] = Database.transactionOrWiden(liveQuery)
val testEffect: ZIO[Database, DbException, List[String]] = Database.transactionOrWiden(testQuery)

val willFail: ZIO[Clock, Any, List[String]] = liveEffect.provideLayer(Database.none) // THIS WILL FAIL
val testing: ZIO[Clock, Any, List[String]] = testEffect.provideLayer(Database.none) // This will work
```

## FAQ

### I've got a compiler error: a type was inferred to be Any

Happens quite a lot when using ZIO, because Any is used to mark an 'empty' environment.
The best thing to do is to drop this warning from your configuration.
See https://github.com/zio/zio/pull/6455.

### I'm getting NoClassDefFoundError on cats/FlatMapArityFunctions

Check that your project has `org.typelevel:cats-core` as a dependency.
See https://github.com/zio/interop-cats/issues/669 for more details about this issue.

### When will tranzactio work with <insert DB library here>?

I want to add wrappers around more database access libraries.
Anorm was the second one I did, next should probably be Quill (based on the popularity of the project on GitHub),
but I'm completely unfamiliar with it.

Slick, however, is a problem. I know it quite well, tried to implement a TranzactIO module for it, and couldn't.
Transactions cannot be handled externally using Slick.
I don't think it's doable until this ticket is done: https://github.com/slick/slick/issues/1563

### How do I migrate to 5.x?

Versions starting at 5.0.0 have split artifacts for Anorm and Doobie. If you were using a 4.x version or below, you need
to update your project's dependencies.

```sbt
// Before
// libraryDependencies += "io.github.gaelrenoux" %% "tranzactio" % TranzactIOVersion

// For Doobie
libraryDependencies += "io.github.gaelrenoux" %% "tranzactio-doobie" % TranzactIOVersion

// For Anorm
libraryDependencies += "io.github.gaelrenoux" %% "tranzactio-anorm" % TranzactIOVersion
```

repository: gaelrenoux/tranzactio

gha_language: Scala

gha_license_id: NOASSERTION

repo_name: gaelrenoux/tranzactio


text:
---
layout: kanji-remain
v4: 2349
kanji: 莉
keyword: hawthorn
strokes: 10
on-yomi: リ
permalink: /rtk/莉/
---

## Koohii stories:

1) [mantixen] 24-7-2009(24): Thanks to Nathaniel Hawthorne, the hawthorn flower is now profitable.

2) [astridtops] 31-12-2006(16): A hawthorn is a flower that stands in the way of profit as it has to be taken out of the wheat fiels by farmers.

3) [timcampbell] 14-12-2008(5): There is a lot of profit in the flowery prose of Nathaniel Hawthorne.

4) [cameron_en] 13-11-2008(4): The Hawthorn footy club were forced to sell flowers in order to gain any profit, nobody would care about them otherwise.

5) [koohiikun] 26-8-2010(3): The hawthorn flower brings in great profit as an immune system booster.


text:
# e_commerce_backend
![license](https://img.shields.io/github/license/raquellee/e_commerce_backend)

E-commerce site backend using MySQL workbench to create a database, Sequelize for database management, and an Express.js server. Includes Category, Product, and Tag models with API routes so data can be created, displayed, updated, and deleted as needed. Seeds are included for API testing in applications such as Insomnia or Postman.

## ToC
* [Technologies](#Technologies-Used)
* [Installation](#Installation)
* [Usage](#Usage)
* [Credits](#Credits)
* [License](#License)

## Technologies Used
* MySQL
* Express.js
* Sequelize
* Node.js
* Dotenv

## Installation
After cloning to your local machine, include .env file with all relevant variables.

Use schema.sql in db directory to create the database in MySQL workbench.

Install all dependencies required
```md
npm i --y
```

Seed the database
```md
npm run seed
```

Sync sequelize to the database on server start
 ```md
node server
```

## Usage
![functionalitygif](https://github.com/RaquelLee/e_commerce_backend/blob/main/assets/images/ecommbackend.gif?raw=true)

[View Video](https://drive.google.com/file/d/1U8ZK8ZQW2Wpcvhyr_3KsiL22R6LUw8C1/view)

## Credits
Raquel Scofield ![followme](https://img.shields.io/github/followers/raquellee?label=Follow&style=social)

[:eyes: Raquel's Portfolio](https://raquellee.github.io/)

[Raquel's Github](http://github.com/raquellee)

:email<EMAIL_ADDRESS>

## License
MIT License

:copyright: 2021 Raquel Scofield


text:
# JS Challenge Vue App

## Requirments

To be able to build and test this Vue.js application you have two possible ways:

**Option 1**

Build the application locally and then serve it in a web server. Make sure to have these tools installed in your system:

- [Node.js (v12+ )](https://nodejs.org/it/download/)

- A Web server like Nginx / Apache2 or a simple [http-server](https://www.npmjs.com/package/http-server)

- A modern browser like [Google Chrome](https://www.google.com/intl/en/chrome/) / [Mozilla Firefox](https://www.mozilla.org/en/firefox/new/) / Microsoft Edge / Opera / Safari

**Option 2**

Build the application in a docker container and then serve it in a docker container with Nginx. Make sure to have [Docker](https://www.docker.com/products/docker-desktop) installed in your system.

## Installation guide

### Option 1

Follow these steps if you want to build, test and serve this application locally.

Download the source code from GitHub or clone this [repository](https://github.com/Schengatto/js_challenge_enrico_schintu)

Access to the folder `./es_musement_app` via [command line terminal](https://en.wikipedia.org/wiki/Command-line_interface) and run the command:

> `npm install`

It will install all the dependencies required by this project.

Wait until the process ends and then execute the command:

> `npm run build`

> This command will execute the unit test and then it will build the vue.js application

Now you should be able to see a `./dist` folder inside the project folder.

If you have a web server like Apache2 or Nginx you can copy this folder inside the folder served by the server (it depends by your server configuration). More info [here](https://medium.com/@thucnc/deploy-a-vuejs-web-app-with-nginx-on-ubuntu-18-04-f93860219030).

Otherwise, if you just want to do a quick test of this application you can use [http-server](https://www.npmjs.com/package/http-server) to serve the application. In this case, you have to access into the ./dist folder and run the following command:

> `http-server`

> It is also possible to specify which is the port to use to serve the application by passing the argument `-p` and the port number. Example: `http-server -p 5000` will serve the application on the port 5000.

Now open your browser and access to the page:

> http://localhost:8080

You should be able to see the application.

### Option 2

Follow these steps if you want to build and serve this application inside a docker container.

Download the source code from GitHub or clone this [repository](https://github.com/Schengatto/js_challenge_enrico_schintu)

Access to the folder `./es_musement_app` via [command line terminal](https://en.wikipedia.org/wiki/Command-line_interface) and run the command:

> `docker build -t js-challenge-app/enrico-schintu:latest .`

> This command will create the docker image that handles the building stage (running also the unit tests) and then the dist package will be moved into a clean image which has Nginx installed.

Once the process is completed run the following command:

> `docker run -it -p 8080:80 --rm --name js-challenge-app js-challenge-app/enrico-schintu`

> This command will run a docker container which serves the application on port 8080. You can use a different port just changing the 8080 value declared in the -p argument.

Now open your browser and access to the page:

> http://localhost:8080

You should be able to see the application.

## Tests

### Unit test

To execute the unit tests written using [Jest](https://jestjs.io/) you should access to the folder `./es_musement_app` via command line terminal and run the command:

> `npm run test:unit`

> This command executes all the unit test and it will show the coverage report at the end of the process.

### E2E Test

To execute the e2e tests written using [Nightwatch](https://nightwatchjs.org/) you should access to the folder `./es_musement_app` via command line terminal and run the command:

> `npm run test:unit`

> This command executes all the unit test and it will show the coverage report at the end of the process.

## Demo

A demo of this application is available at the URL

> https://schengatto.net:4000

## Contacts

Feel free to contact me for any needs at

><EMAIL_ADDRESS>


text:
# python-utils

So maybe I stop writing the same things over and over.

## Installation

```sh
# Python 3.9+ only (due to PEP 585 type annotations)
pip install mbforbes-python-utils
```

## Usage

```python
from mbforbes_python_utils import read, write, flatten

# read() removes leading/trailing whitespace.
contents = read("foo.txt")

# write() creates intermediate directories if needed.
# Pass `info_print = False` to disable printing.
write("bar/baz.txt", contents)

# flatten() flattens lists.
flatten([[1, [2, [3]]]])  # -> [1, 2, 3]
```

## Tests

```sh
python test_mbforbes_python_utils.py
```

## Releasing

I don't do this enough to remember how to do it

```sh
# Increment version in setup.py. Then,
pip install twine wheel
python setup.py sdist bdist_wheel
twine check dist/*
# If the above failed, `rm -rf build/ dist/ *.egg-info` before retrying
twine upload dist/*
```

repository: mbforbes/python-utils

repo_name: mbforbes/python-utils


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]

- Convert site back to Jekyll. Jekyll just feels like home.

## [2.0.0][2.0.0]

- Complete redesign including:
	- Moved my blog from [hisaac.blog](https://hisaac.blog) to [hisaac.net](http://hisaac.net/).
	- Transitioned blog engine from [Jekyll](https://jekyllrb.com) to [Hexo](https://hexo.io)

## 1.5.0

- Replaced profile image
- Added [Letterboxd](http://letterboxd.com) SVG icon to social icons
- Removed spacing between social icons
- Changed order of social icons to work better on mobile devices

## 1.3.0

- Added profile image

## 1.2.0

- Simplify styling and add social media icons to footer

## 1.0.0, 1.1.0

- Original styling of new home page

[Unreleased]: https://github.com/hisaac/hisaac.net/compare/
[2.0.0]: https://github.com/hisaac/hisaac.net/compare/

gha_language: SCSS


text:
# Ansible Role: Swap

[![CI](https://github.com/geerlingguy/ansible-role-swap/workflows/CI/badge.svg?event=push)](https://github.com/geerlingguy/ansible-role-swap/actions?query=workflow%3ACI)

An Ansible Role that configures swap space on Linux.

## Requirements

None.

## Role Variables

Available variables are listed below, along with default values (see `defaults/main.yml`):

    swap_file_path: /swapfile

The location of the swap file on the server.

    swap_file_size_mb: '512'

How large (in mebibytes) to make the swap file.

    swap_swappiness: '60'

The `vm.swappiness` value to be configured in sysconfig.

    swap_file_state: present

If you wish to _remove_ your swapfile, and disable swap, set this to `absent`. Generally you'd probably want to set this to `present`.

    swap_file_create_command: "dd if=/dev/zero of={{ swap_file_path }} bs=1M count={{ swap_file_size_mb }}"

The command used to create the swap file. You could switch to using `fallocate` to write the swap file more quickly, though there may be inconsistencies if not writing the file with `dd`.

## Dependencies

None.

## Example Playbook

    - hosts: all

      vars:
        swap_file_size_mb: '1024'

      roles:
        - geerlingguy.swap

## License

MIT / BSD

## Author Information

This role was created in 2018 by [Jeff Geerling](https://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).

repository: geerlingguy/ansible-role-swap

repo_name: geerlingguy/ansible-role-swap


text:
# no-identical-functions

When two functions have the same implementation, either it was a mistake - something else was intended - or the
duplication was intentional, but may be confusing to maintainers. In the latter case, the code should be refactored.

## Noncompliant Code Example

```javascript
function calculateCode() {
  doTheThing();
  doOtherThing();
  return code;
}

function getName() { // Noncompliant
  doTheThing();
  doOtherThing();
  return code;
}
```

## Compliant Solution

```javascript
function calculateCode() {
  doTheThing();
  doOtherThing();
  return code;
}

function getName() {
  return calculateCode();
}
```

## Configuration

This rule has a numeric option (defaulted to 3) to specify the minimum number of lines to trigger an issue. Lines between curly braces are taken into consideration.

```json
{
  "no-identical-functions": "error",
  "no-identical-functions": ["error", 5]
}
```

repository: codacy/codacy-eslint

gha_language: TypeScript

repo_name: codacy/codacy-eslint


text:
# Gradient-View
A Swift 4 UIView class with a gradient customizable in the storyboard (colors, direction, shadows, cornerRadius...)

GradientView: UIView is a @IBDesignable class so that it's rendered in your storyboard, and all its properties are @IBInspectable so that you can customize your gradient view inside the storyboard in the Attributes inspector.

# Quick install:
* Just drag this class into your project
* In your storyboard, select a UIView
* Go the the identity inspector and in the class field, type GradientView instead of UIView
* Play with the attributes inspector with real-times results!
  * you can select two colors for the gradient
  * and one color for the shadow
  * you can choose the shadow position (x/y) and its blur
  * the direction of the gradient (top left is 0,0 and bottom right is 1,1) from the start point to the end point
  * the corner radius of your view
  * you can animate the gradient to another one by calling the `animate(duration: TimeInterval, newTopColor: UIColor, newBottomColor: UIColor)`method

![Image of Gradient View](https://raw.githubusercontent.com/matvdg/Gradient-View/master/example.png)

repository: arstasczak/TorunskiPrzewodnik

repo_name: arstasczak/TorunskiPrzewodnik


text:
---
layout: post
title:      "My First Project #the_joy_of_scraping"
date:       2019-07-15 08:52:42 -0400
permalink:  my_first_project_the_joy_of_scraping
---

For four years I have been on the other end of this education game. And thank God for that! I've had to tell so many students to persevere that it has become suprisingly simple to do so myself. On this (my first) project, that meant scraping and re-scraping to perfection.

The requirements of this project were to create a CLI that would provide access to data from a web page based on user input using well-implemented object-oriented programming.

I decided to make a CLI that would retrieve data on candidates for the 2020 Democratic Presidential Nomination. Going into this project I felt like I had a pretty solid grasp on variable scope and using classes– certainly still making mistakes, but at least getting to the point where I could read the error message and know how it happened instead of searching google to understand why this might be a mistake.

Anyway, that simply meant that my big struggle would be the scraping. At the weediest point, that meant a couple hours trying to pull out a particular row off of a table in wikipedia pages conatining the same row title but in a different spot depending on the particular page requested. It took me at least an hour to get it right in this messy form:

```
def find_education
    @doc.css("tbody tr td a").each do |link|
      if ["niversity", "ollege"].any? {|word| link.text.include? (word)}
        @education << link.text
      end
    end
  end
```

This was so rough (and it lost the degree designation, like BA or JD). It was only looking for links in the table that happened to have most of the word University or College. But even this was an accomplishment. After creating a few other scrapers, I cam back to this and realized I now knew how to go down the HTML one level at a time as necessary and then come back up for what I needed and what had taken an hour to create poorly took 5 minutes to create cleanly.

```
  def find_education
    @doc.css("tbody tr").each do |tr| #makes a list of each link text under education (including degree designations)
      tr.css("th").each do |th|
        if th.text == "Education"
          tr.css("td a").each do |link|
            @education << link.text
          end
        end
      end
    end
    @education.each_with_index do |school,i|
      if i > 0 && school.length < 5
        @education[i-1] = "#{@education[i-1]} (#{school})" # adds on their BA or JD designation to that school
        @education.delete(school) # removes their BA or JD designation as a separate school
      end
    end
  end
```

Through this project, I found the joy of scraping and solidified many of the ins and outs of object-oriented programming. And I'm looking forward to continuing to sharpen those skills. Overall, I'm thrilled with how this first 1/5 of my flatiron experience has gone and eagerly await the next challenge ahead!

extension: markdown


text:
## Required of third party softwares
- JDK 6+（instruments application can run in jdk6）
- JDK8  ( SkyWalking collector and SkyWalking WebUI )
- Elasticsearch 5.x, cluster mode or not
- Zookeeper 3.4.10

## Download released version
- Go to [released page](https://github.com/apache/incubator-skywalking/releases)

## Deploy Elasticsearch server
- Modify `elasticsearch.yml`
  - Set `cluster.name: CollectorDBCluster`
  - Set `node.name: anyname`, this name can be any, it based on Elasticsearch.
  - Add the following configurations to

```
# The ip used for listening
network.host: <IP_ADDRESS>
thread_pool.bulk.queue_size: 1000
```

- Start Elasticsearch

### Deploy collector servers
1. Run `tar -xvf skywalking-dist.tar.gz`
2. Config collector in cluster mode.

Cluster mode depends on Zookeeper register and application discovery capabilities. So, you just need to adjust the IP config items in `config/application.yml`. Change IP and port configs of naming, remote, agent_gRPC, agent_jetty and ui,
replace them to the real ip or hostname which you want to use for cluster.

- `config/application.yml`
```
cluster:
# The Zookeeper cluster for collector cluster management.
  zookeeper:
    hostPort: localhost:2181
    sessionTimeout: 100000
naming:
# Host and port used for agent config
    jetty:
        host: localhost
        port: 10800
        context_path: /
remote:
  gRPC:
    host: localhost
    port: 11800
agent_gRPC:
  gRPC:
    host: localhost
    port: 11800
agent_jetty:
  jetty:
    host: localhost
    port: 12800
    context_path: /
analysis_register:
  default:
analysis_jvm:
  default:
analysis_segment_parser:
  default:
    buffer_file_path: ../buffer/
    buffer_offset_max_file_size: 10M
    buffer_segment_max_file_size: 500M
ui:
  jetty:
    host: localhost
    port: 12800
    context_path: /
# Config Elasticsearch cluster connection info.
storage:
  elasticsearch:
    cluster_name: CollectorDBCluster
    cluster_transport_sniffer: true
    cluster_nodes: localhost:9300
    index_shards_number: 2
    index_replicas_number: 0
    ttl: 7
```

3. Run `bin/collectorService.sh`

### Deploy UI servers

1. Run `tar -xvf skywalking-dist.tar.gz`
2. Config UI in cluster mode.

The config items of UI is saved in `bin/webappService.sh` (`bin\webappService.bat` for windows).

| Config                           | Description                                                                                |
|----------------------------------|------------------------------------------------------------------------------------------------------|
| `server.port`                    | Port to listen on                                                                                |
| `collector.ribbon.listOfServers` | Address to access collector naming service.(Consist with `naming.jetty` in `config/application.yml`). Multiple collector addresses are split by ',' |

3. Run `bin/webappService.sh`


text:
LiveRebel Deploy Plugin for Bamboo
==================================
LiveRebel Deploy Plugin helps to run updates to your JEE containers faster. LiveRebel is a tool for hot updates without downtime, lost sessions and OutOfMemoryErrors. You have to have a running LiveRebel installed to use this plugin.
More information on the official [website](http://liverebel.com)

Installation for development
----------------------------
1. Clone the repository
2. Install [Atlassian SDK](https://developer.atlassian.com/display/DOCS/Installing+the+Atlassian+Plugin+SDK)
3. Run `atlas-run` in plugin directory
4. Setup LiveRebel
    * Open `http://<bamboo>/`
    * Go to `Administration > LiveRebel Configuration`
    * Enter `URL` and `authentication token` for LiveRebel Command Center
5. Make changes to code
6. Refresh `http://<bamboo>/plugins/servlet/fastdev` to reload your changes

repository: ekabanov/bamboo-liverebel-plugin

repo_name: ekabanov/bamboo-liverebel-plugin


text:
# The NDIS Driver Library (NDL)

The NDIS Driver Library (NDL) is a header-only library that makes it easier to write NDIS drivers.

Features:

 * **Easy to integrate**: just drop a header into your C or C++ code and you're ready to go
 * **Wide support**: you can use this library in a driver that targets any version of Windows since Windows Vista
 * **Fast**: all these routines are designed for speed, and compete well with their hand-written equivalents
 * **Battle-hardened**: parts of the OS — including NDIS.SYS itself — use these headers
 * **Written by the experts**: these headers were written and tested by the OS Networking team at Microsoft

## Example usage

If your LWF injects packets on the send path, you must pluck them back out of the send-complete path.
But cutting apart NBL chains is a tiresome chore — why not let the library do it for you?

```
#include <ndis.h>
#include <ndis/ndl/nblqueue.h>
#include <ndis/ndl/nblclassify.h>

NDIS_NBL_CLASSIFICATION_INDEX_CALLBACK IsMyNbl;

VOID FilterSendNetBufferListsComplete(NDIS_HANDLE FilterContext, NET_BUFFER_LIST *NblChain, ...)
{
    MY_FILTER *Filter = (MY_FILTER*)FilterContext;

    NBL_QUEUE Mine;
    NBL_QUEUE Theirs;

    NdisInitializeNblQueue(&Mine);
    NdisInitializeNblQueue(&Theirs);

    //
    // Demux the NBL chain into 2 queues, by SourceHandle
    //
    NdisClassifyNblChain2(NblChain, IsMyNbl, Filter, &Theirs, &Mine);

    if (!NdisIsNblQueueEmpty(&Theirs)) {
        NdisFSendNetBufferListsComplete(Filter->NdisHandle, NdisGetNblChainFromNblQueue(&Theirs), ...);
    }

    if (!NdisIsNblQueueEmpty(&Mine)) {
        MyReturnNbls(Filter, NdisGetNblChainFromNblQueue(&Mine));
    }
}

ULONG_PTR IsMyNbl(PVOID Filter, NET_BUFFER_LIST *Nbl)
{
    return (Nbl->SourceHandle == Filter);
}
```

Compare that to what a typical LWF might do, when writing the same algorithm by hand:
```
#include <ndis.h>

VOID FilterSendNetBufferListsComplete(NDIS_HANDLE FilterContext, NET_BUFFER_LIST *NblChain, ...)
{
    MY_FILTER *Filter = (MY_FILTER*)FilterContext;

    NET_BUFFER_LIST *Current = NblChain;
    NET_BUFFER_LIST *TheirFirst = NULL;
    NET_BUFFER_LIST *TheirLast = NULL;
    NET_BUFFER_LIST *MyFirst = NULL;
    NET_BUFFER_LIST *MyLast = NULL;

    while (Current) {
        NET_BUFFER_LIST *Next = Current->Next;

        if (Current->SourceHandle == Filter) {
            //
            // Append to My chain
            //
            if (MyFirst == NULL) {
                MyFirst = Current;
            } else {
                MyLast->Next = Current;
            }
            MyLast = Current;
        } else {
            //
            // Append to Their chain
            //
            if (TheirFirst == NULL) {
                TheirFirst = Current;
            } else {
                TheirLast->Next = Current;
            }
            TheirLast = Current;
        }

        Current = Next;
    }

    if (TheirFirst != NULL) {
        NdisFSendNetBufferListsComplete(pFilter->FilterHandle, TheirFirst, SendCompleteFlags);
    }

    if (MyFirst != NULL) {
        MyReturnNbls(Filter, MyFirst);
    }
}
```
I think you'll agree that the first version is easier to read, and definitely easier to spot any logic bugs in.
Happily, NdisClassifyNblChain2 is even faster than the hand-written code below it, since it uses fewer branches, prefetches list entries, and is careful to avoid redundant writes to memory.
So you don't have to feel guilty about a performance tradeoff here: the simpler code is also the faster code.

You can either make this repository a git submodule of your own driver's repository, or just grab the files and copy them directly into your code — whichever is most convenient for you.

From there, you only need to include the header file(s) you want to use.

## Header overview

### `#include <ndis/ndl/nblchain.h>`

[nblchain.h](https://github.com/microsoft/ndis-driver-library/blob/main/src/include/ndis/ndl/nblchain.h) has a few basic helper routines for dealing with a linked list of NBLs.
For example:

 * `NdisNumNblsInNblChain` counts the NBLs in an NBL chain
 * `NdisNumDataBytesInNblChain` counts the number of bytes of packet payload in the NBL chain
 * `NdisSetStatusInNblChain` sets an `NDIS_STATUS` code in each NBL in the chain

You get the idea.
It's really simple stuff — you could have easily written it yourself.
But now you don't have to.

### `#include <ndis/ndl/nblqueue.h>`

[nblqueue.h](https://github.com/microsoft/ndis-driver-library/blob/main/src/include/ndis/ndl/nblqueue.h) introduces the `NBL_QUEUE`, which is a fancy version of an NBL chain.
While an ordinary NBL chain is just a singly-linked list, the `NBL_QUEUE` tracks the end of the list too, so it supports fast O(1) append.

If you're starting out with an NBL chain, you can convert it into a queue:

```
void ExampleNblQueue(NET_BUFFER_LIST *NblChain)
{
    NBL_QUEUE NblQueue;
    NdisInitializeNblQueue(&NblQueue);

    //
    // Convert the NBL queue into an NBL chain.
    //
    // This operation is O(n), but any future append operations on the queue
    // will be fast O(1).
    //
    NdisAppendNblChainToNblQueue(&NblQueue, NblChain);

    . . . use the NblQueue . . .
}
```

From there, you can efficiently append two NBL queues with `NdisAppendNblQueueToNblQueueFast` or append 1 loose NBL to the queue with `NdisAppendSingleNblToNblQueue`.

The header also offers a variation on the above in `NBL_COUNTED_QUEUE`.
As with an ordinary `NBL_QUEUE`, the `NBL_COUNTED_QUEUE` supports fast O(1) append operations, but it also keeps a running count of the number of NBLs in the queue.
Every time you append, push, or pop from an `NBL_COUNTED_QUEUE`, its count is automatically updated appropriately.
This is useful for the receive path, which needs to carry along a NumberOfNetBufferLists parameter.

## `#include <ndis/ndl/nblclassify.h>`

[nblclassify.h](https://github.com/microsoft/ndis-driver-library/blob/main/src/include/ndis/ndl/nblclassify.h) has routines for demuxing NBL chains.
This means taking a chain of NBLs, and splitting it into 2 or more queues, based on any criterion that you provide.
We used this in our example LWF to pull our own NBLs out of the send-complete path.

Rather than providing one highly-generic classification routine, this library has a family of very similar routines.
This allows each routine to be micro-optimized for performance.
So you only pay for what you actually need.

The simplest classification routine is `NdisClassifyNblChain2`, which splits 1 NBL chain into 2 NBL queues.
You provide a function that takes an NBL and returns 0 or 1 to select which queue it should go into.

If you want to bucket NBLs into *several* queues, use `NdisClassifyNblChainByIndex`.
Your classification function returns a number from 0 to N-1 which selects which queue the NBL should go into.

But sometimes, you can't exactly predict in advance how many queues there will be.
For example, suppose you're classifying packets by destination IP address.
You don't know how many distinct IP addresses appear in the NBL chain — you just know that if 2 NBLs have different destination IP addresses, they should go into different queues.
This is where `NdisClassifyNblChainByValue` shines: it accumulates similar NBLs, allowing you to process them in batches.

If batching is *really* important to your driver, you can use `NdisClassifyNblChainByValueLookahead`.
This is a drop-in replacement for `NdisClassifyNblChainByValue`, but it tries harder to group similar NBLs together.
For example, if you have a pathological NBL chain of [A, B, A, B, A, B]; then `NdisClassifyNblChainByValue` will not recover any batching; each NBL will be processed separately.
But `NdisClassifyNblChainByValueLookahead` looks ahead enough to rearrange the NBL chain into [A, A, A, B, B, B], so it can process the whole thing in 2 big batches.

Sometimes it's inconvenient to process NBL queues in a callback function.
As an alternative, `NdisPartialClassifyNblChainByValue` allows you to keep your processing logic inline.
It accumulates as many similar NBLs as it can, then returns back to you to let you process them.
Typical usage might look like this:

```
VOID ExamplePartialClassify(NET_BUFFER_LIST *NblChain)
{
    while (NblChain != NULL)
    {
        NBL_QUEUE Nbls;
        ULONG_PTR IPv4Address;
        NdisPartialClassifyNblChainByValue(&NblChain, GetIPv4Address, NULL, &IPv4Address);

        //
        // Every NBL in the queue has the same IP address, so we can process
        // them all in one batch.
        //

        if (FirewallAllowDestinationIpAddress(IPv4Address)) {
            IndicateNbls(&Nbls);
        } else {
            DropNbls(&Nbls);
        }
    }
}
```

By way of comparison, here's how the same logic would work with `NdisClassifyNblChainByValue`:

```
NDIS_NBL_FLUSH_CALLBACK ProcessNbls;

VOID ExampleCallbackClassify(NET_BUFFER_LIST *NblChain)
{
    NdisClassifyNblChainByValue(&NblChain, GetIPv4Address, NULL, ProcessNbls, NULL);
}

VOID
ProcessNbls(PVOID FlushContext, ULONG_PTR IPv4Address, NBL_QUEUE *Queue)
{
    if (FirewallAllowDestinationIpAddress(IPv4Address)) {
        IndicateNbls(Queue);
    } else {
        DropNbls(Queue);
    }
}
```

`NdisPartialClassifyNblChainByValue` keeps everything in the same function, which is convenient and efficient if you have a lot of local state.
`NdisClassifyNblChainByValue` might be a tiny bit more efficient if the classification routine is expensive, since it avoids redundant classifications.
Use whichever one fits your code the best.

## Versioning

Current version: 1.0.0

This project uses semantic versioning (semver.org).

We may make any breaking changes to these header files, for example: renaming routines, removing routines, adding/removing parameters, or changing the size of structures.
We commit to two limitations:

 * If make any breaking change, we'll change the major version number.
 * We will not make a breaking change that causes silent bad behavior.  For example, if v1.0 permits a NULL parameter, we wouldn't change v2.0 to crash if given NULL — we would rename the routine to draw your attention to the change in behavior.

Because of this, we recommend that you take a dependency on a specific version of these header files, and not just build against the rolling HEAD of the repository.

## Contributions

We gladly accept issues here on GitHub.
[File an issue](https://github.com/microsoft/ndis-driver-library/issues/new/choose) if you spot a bug, need clarification on documentation, or have an idea for a new feature that would be a good fit for this library.

For legal reasons, we can only accept pull requests from Microsoft employees.

## Code of Conduct

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode<EMAIL_ADDRESS>with any additional questions or comments.

## Security

**Please do not report security vulnerabilities through public GitHub issues.**

Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).

If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com).
If possible, encrypt your message with our PGP key; please download it from the the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).

You should receive a response within 24 hours.
If for some reason you do not, please follow up via email to ensure we received your original message.
Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).

## Legal

**Trademarks** This project may contain trademarks or logos for projects, products, or services.
Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines.
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
Any use of third-party trademarks or logos are subject to those third-party's policies.

repository: mtfriesen/ndis-driver-library

repo_name: mtfriesen/ndis-driver-library


text:
# Changelog

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [0.0.11](https://github.com/nuxt-contrib/h2/compare/v0.0.10...v0.0.11) (2020-11-21)

### Features

* `useAsync` ([236e979](https://github.com/nuxt-contrib/h2/commit/236e97953ac014dffa8977c4bf8cd6f2fa369eb7))
* custom matcher and improved docs ([1c4f9d1](https://github.com/nuxt-contrib/h2/commit/1c4f9d138dde212486d1aa7acb0e2df9a8cb8aca))

### [0.0.10](https://github.com/nuxt-contrib/h2/compare/v0.0.9...v0.0.10) (2020-11-20)

### Features

* rewrite with much sexier API ([0d3680e](https://github.com/nuxt-contrib/h2/commit/0d3680eacab44d6a40c10b94cfba2036afc571d9))

### [0.0.9](https://github.com/nuxt-contrib/h2/compare/v0.0.8...v0.0.9) (2020-11-20)

### Features

* createError ([1a80bd9](https://github.com/nuxt-contrib/h2/commit/1a80bd9432b0585a474d6888e7035636307eead8))

### Bug Fixes

* throw 404 only when writableEnded is not set ([1c42a07](https://github.com/nuxt-contrib/h2/commit/1c42a07e3ecc175c96dff026967298a107314f5e))

### [0.0.8](https://github.com/nuxt-contrib/h2/compare/v0.0.7...v0.0.8) (2020-11-19)

### Bug Fixes

* don't log 404 ([541ede0](https://github.com/nuxt-contrib/h2/commit/541ede03edc6526b953c8a0bb7f31f0dc5fc21d3))

### [0.0.7](https://github.com/nuxt-contrib/h2/compare/v0.0.6...v0.0.7) (2020-11-19)

### [0.0.6](https://github.com/nuxt-contrib/h2/compare/v0.0.5...v0.0.6) (2020-11-19)

### Features

* add debug option to app ([b0891cd](https://github.com/nuxt-contrib/h2/commit/b0891cd13d4a7b8ed0fb981ae878185c6728b618))

### [0.0.5](https://github.com/nuxt-contrib/h2/compare/v0.0.4...v0.0.5) (2020-11-19)

### Features

* expose unsafeHandle ([f1245f1](https://github.com/nuxt-contrib/h2/commit/f1245f13c1a4ec1f9e1ecb4b0b73c50047ee4d3a))

### [0.0.4](https://github.com/nuxt-contrib/h2/compare/v0.0.3...v0.0.4) (2020-11-19)

### Features

* rewrite promisify logic ([a40aa81](https://github.com/nuxt-contrib/h2/commit/a40aa81aa80da3ba418061338bcaa6286357ab67))

### Bug Fixes

* keep top level trailing slash ([2fb92ef](https://github.com/nuxt-contrib/h2/commit/2fb92efdf462f3c4098af3cac6594599839f7cde))
* stop middleware when writableEnded flag is set ([d87d8e5](https://github.com/nuxt-contrib/h2/commit/d87d8e5f7a426409565d1a008b8231c793ec61ef))

### [0.0.3](https://github.com/nuxt-contrib/h2/compare/v0.0.2...v0.0.3) (2020-11-19)

### Features

* improve error util ([5504f4e](https://github.com/nuxt-contrib/h2/commit/5504f4e53dfb19cceb6580b00077f8c80d0b5dc5))

### [0.0.2](https://github.com/nuxt-contrib/h2/compare/v0.0.1...v0.0.2) (2020-11-19)

### Bug Fixes

* remove dependency on process.env ([eb018f5](https://github.com/nuxt-contrib/h2/commit/eb018f5e23a5f797a4b5d24fdbfe591994c39aef))

### 0.0.1 (2020-11-18)

### Features

* de-default loazy handles ([0cb8c0c](https://github.com/nuxt-contrib/h2/commit/0cb8c0c74647278806a53f7920f8678bb47749e5))
* update docs and caller utility ([0ef0020](https://github.com/nuxt-contrib/h2/commit/0ef0020da1931b8c08344008253703b91b318559))

### Bug Fixes

* **app:** handle returning promise ([2169f92](https://github.com/nuxt-contrib/h2/commit/2169f92142d2e92e143913fff945628f17203779))
* **writable:** set writableEnded and writableFinished ([7058fdc](https://github.com/nuxt-contrib/h2/commit/7058fdcf38a31edd1ce2afe4b05eb0b050adea78))


text:
PhpGrowler
==========

A simple library to send growl messages to a remote server.

An indirect fork of [php-growl](https://github.com/tylerhall/php-growl) with some tweaks, based on the work of [TylerHall](https://github.com/tylerhall).

Usage
-----

Create a new connection:
```
$conn = new GrowlConnection(
  'Test App',      // App Title
  '<IP_ADDRESS>'  // Address of Growl server
);
```

Add some notification types to send:
```
$conn->addNotification('success');
```

Register the connection: (This only needs to be done once, before any growls are sent)
```
$conn->register();
```

Create a growler:
```
$growl = new Growler();
```

Send a notification:
```
$growl->notify(
    'success',
    'Notification Title,
    'You just sent a remote growl!'
);
```

Complete Example
================

```
require 'PhpGrowler.php';
require 'GrowlConnection.php';

use Khill\PhpGrowler\PhpGrowler;
use Khill\PhpGrowler\GrowlConnection;

$conn = new GrowlConnection('Test App', '<IP_ADDRESS>');
$conn->addNotification('success');
$conn->register();

$growl = new PhpGrowler($conn);
$growl->notify(
    'success',
    'Notification Title,
    'You just sent a remote growl!'
);
```

repository: kevinkhill/php-growler

repo_name: kevinkhill/php-growler


text:
Artifactory Maven Snapshot Cleanup When Release
=====================================

This plugin deletes Maven SNAPSHOT artifacts when the release version is published.

Features
--------

Consider the Maven snapshots repository `maven-local-lib-snapshots` populated like that:

    org/jfrog/test/my-artifact/1.0.0-SNAPSHOT/my-artifact-1.0.0-20170101.080829-1.pom
    org/jfrog/test/my-artifact/1.0.0-SNAPSHOT/my-artifact-1.0.0-20170101.080829-1.jar
    org/jfrog/test/my-artifact/1.0.0-SNAPSHOT/my-artifact-1.0.0-20170101.080829-2.pom
    org/jfrog/test/my-artifact/1.0.0-SNAPSHOT/my-artifact-1.0.0-20170101.080829-2.jar

    org/jfrog/test/my-artifact/1.1.0-SNAPSHOT/my-artifact-1.1.0-20170202.080829-1.pom
    org/jfrog/test/my-artifact/1.1.0-SNAPSHOT/my-artifact-1.1.0-20170202.080829-1.jar

When the **pom file** of `my-artifact` version `1.0.0` is deployed into `maven-local-lib-releases` (Maven releases repository), the associated snapshot is deleted.

e.g: folder `org/jfrog/test/my-artifact/1.0.0-SNAPSHOT/` of `maven-local-lib-snapshots` repository.

Installation
------------

To install this plugin:

* Place files `mavenSnapshotCleanupWhenRelease.groovy` and `mavenSnapshotCleanupWhenRelease.properties` under the master Artifactory server `${ARTIFACTORY_HOME}/etc/plugins`.

* Configure the file `mavenSnapshotCleanupWhenRelease.properties` with the repositories couples *releases <-> snapshots*. In a couple, the first should be the *release* repository and the second the *snapshot* repository:
```
    repositories =  [ ["maven-local-lib-releases","maven-local-lib-snapshots"], ["maven-local-plugin-releases","maven-local-plugin-snapshots"] ]
```

* Configure the logger in `${ARTIFACTORY_HOME}/etc/logback.xml` with level wanted:

```
    <configuration ...>
        ...
        <logger name="mavenSnapshotCleanupWhenRelease">
            <level value="info"/>
        </logger>
    </configuration>
```

* Verify in the `${ARTIFACTORY_HOME}/logs/artifactory.log` that the plugin and configuration loaded correctly.

Execution
---------

The plugin deletion process is called when an artifact (pom and associated files like a jar, ...) is deployed in a configured Maven release repository, precisely when POM file is deployed.

The plugin configuration could be updated dynamically, using `api/plugins/execute/mavenSnapshotCleanupWhenReleaseConfig` URL with `params`:

- `repositories`: The list of couple like in `mavenSnapshotCleanupWhenRelease.properties`, but with braquet/quote/comma URL encoded
- `action`: (Optional) `reset`current configuration before do the `add` (default action)

Example:

    curl -i -uadmin:password -X POST "http://localhost:8081/artifactory/api/plugins/execute/mavenSnapshotCleanupWhenReleaseConfig?params=action=reset;repositories=%5B%5B%22maven-local-lib-releases%22%2C%22maven-local-lib-snapshots%22%5D%5D"

repository: jfrog/artifactory-user-plugins

gha_language: Groovy

repo_name: jfrog/artifactory-user-plugins


text:
---
layout: post
title: "Let's Paint"
date: 2012-12-05 14:04
comments: true
categories: aquarium reef tank
---

Yesterday night I finished painting the back side of the tank. I went with a matte black, only because I'm not a fan of the glossy paints and I think it would look a little cheesy under heavy lighting. I see a lot of people doing blue, or other "wallpaper" sort of effects, and in my opinion they just end of looking cheesy. You can't go wrong with black in my book.

The paint I decided to go with was a spray paint. I debated using a brush, but from previous experiences from painting on glass, I knew that it's sort of difficult. Brushes tend to leave streaks because the paint doesn't really adhere to the glass that well. If you do decide to paint with spray paint, a couple tips:

<!--more-->

- Light coats. I did about 6 light coats over the course of several hours. The first coat barely sticks, the rest go on easier.
- Don't forget to mask/block off the inside of the tank with paper towels (or something). Spray paint has a tendency to make particles that get everywhere.
- Clearly we're painting the outside here. **Never** paint inside the tank where your water could have contact with it.

Overall, I think it turned out great. Here's a picture just after the last coat went on: (No masking, I was just doing the edges)

{% img /images/paint-tank-1.jpg %}

I went a little heavier around the edges, because that's where most of the light could bleed through. I tested the overall coverage with an LED flashlight from the inside, and nothing came through.

I will post some more pictures when it's back upstairs and on the tank stand - hopefully tomorrow!

repository: dmackerman/Personal-Site

repo_name: dmackerman/Personal-Site


text:
[runtime-shared](../../index.md) / [org.rewedigital.konversation](../index.md) / [Output](index.md) / [suggestions](./suggestions.md)

# suggestions

`val suggestions: `[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`>`

The list of suggestions which should been displayed.

repository: rewe-digital/Konversation

repo_name: rewe-digital/Konversation