text:
Using pre-defined Splunk sourcetypes, the nozzle automatically parses the events and enriches them with additional metadata before forwarding to Splunk. For detailed descriptions of each Firehose event type and their fields, refer to underlying [dropsonde protocol](https://github.com/cloudfoundry/dropsonde-protocol). Below is a mapping of each Firehose event type to its corresponding Splunk sourcetype. Refer to [Searching Events](#searching-events) for example Splunk searches.

| Firehose event type | Splunk sourcetype | Description
|---|---|---
| Error | `cf:error` | An Error event represents an error in the originating process
| HttpStartStop | `cf:httpstartstop` | An HttpStartStop event represents the whole lifecycle of an HTTP request
| LogMessage | `cf:logmessage` | A LogMessage contains a "log line" and associated metadata
| ContainerMetric | `cf:containermetric` | A ContainerMetric records resource usage of an app in a container
| CounterEvent | `cf:counterevent` | A CounterEvent represents the increment of a counter
| ValueMetric | `cf:valuemetric` | A ValueMetric indicates the value of a metric at an instant in time

In addition, logs from the nozzle itself are of sourcetype `cf:splunknozzle`.

### Setup

The Nozzle requires a client with the authorities `doppler.firehose` and `cloud_controller.admin_read_only` (the latter is only required if `ADD_APP_INFO` is enabled) and grant-types `client_credentials` and `refresh_token`. If `cloud_controller.admin_read_only` is not
available in the system, switch to use `cloud_controller.admin`.

You can either
* Add the client manually using [uaac](https://github.com/cloudfoundry/cf-uaac)
* Add the client to the deployment manifest; see [uaa.scim.users](https://github.com/cloudfoundry/uaa-release/blob/master/jobs/uaa/spec)

Manifest example:

```yaml

# Clients
uaa.clients:
    splunk-firehose:
      id: splunk-firehose
      override: true
      secret: splunk-firehose-secret
      authorized-grant-types: client_credentials,refresh_token
      authorities: doppler.firehose,cloud_controller.admin_read_only
```

`uaac` example:
```shell
uaac target https://uaa.[system domain url]
uaac token client get admin -s [admin client credentials secret]
uaac client add splunk-firehose --name splunk-firehose
uaac client add splunk-firehose --secret [your_client_secret]
uaac client add splunk-firehose --authorized_grant_types client_credentials,refresh_token
uaac client add splunk-firehose --authorities doppler.firehose,cloud_controller.admin_read_only

```

`cloud_controller.admin_read_only` will work for cf v241
or later. Earlier versions should use `cloud_controller.admin` instead.

- - - -
#### Environment Parameters
You can declare parameters by making a copy of the scripts/nozzle.sh.template.
* `DEBUG`: Enable debug mode (forward to standard out instead of Splunk). (Default: false).

__Cloud Foundry configuration parameters:__
* `API_ENDPOINT`: Cloud Foundry API endpoint address. It is required parameter.
* `CLIENT_ID`: UAA Client ID (Must have authorities and grant_types described above). It is required parameter.
* `CLIENT_SECRET`: Secret for Client ID. It is required parameter.

__Splunk configuration parameters:__
* `SPLUNK_TOKEN`: [Splunk HTTP event collector token](http://docs.splunk.com/Documentation/Splunk/latest/Data/UsetheHTTPEventCollector/). It is required parameter.
* `SPLUNK_HOST`: Splunk HTTP event collector host. example: https://example.cloud.splunk.com:8088. It is required parameter.
* `SPLUNK_INDEX`: The Splunk index events will be sent to. Warning: Setting an invalid index will cause events to be lost. This index must match one of the selected indexes for the Splunk HTTP event collector token used for the SPLUNK_TOKEN parameter. It is required parameter.

__Advanced Configuration Features:__
* `JOB_NAME`: Tags nozzle log events with job name. It is optional. (Default: 'splunk-nozzle')
* `JOB_INDEX`: Tags nozzle log events with job index. (Default: -1)
* `JOB_HOST`: Tags nozzle log events with job host. (Default: "")
* `SKIP_SSL_VALIDATION_CF`: Skips SSL certificate validation for connection to Cloud Foundry. Secure communications will not check SSL certificates against a trusted certificate authority.
This is recommended for dev environments only. (Default: false)
* `SKIP_SSL_VALIDATION_SPLUNK`: Skips SSL certificate validation for connection to Splunk. Secure communications will not check SSL certificates against a trusted certificate authority. (Default: false)
This is recommended for dev environments only.
* `FIREHOSE_SUBSCRIPTION_ID`: Tags nozzle events with a Firehose subscription id. See https://docs.pivotal.io/pivotalcf/1-11/loggregator/log-ops-guide.html. (Default: splunk-firehose)
* `FIREHOSE_KEEP_ALIVE`: Keep alive duration for the Firehose consumer. (Default: 25s)
* `ADD_APP_INFO`: Enrich raw data with app info. A comma separated list of app metadata (AppName,OrgName,OrgGuid,SpaceName,SpaceGuid). (Default: "")
* `ADD_TAGS`: Add additional tags from envelope to splunk event. (Default: false)
    (Please note: Adding tags / Enabling this feature may slightly impact the performance due to the increased event size)
* `IGNORE_MISSING_APP`: If the application is missing, then stop repeatedly querying application info from Cloud Foundry. (Default: true)
* `MISSING_APP_CACHE_INVALIDATE_TTL`:  How frequently the missing app info cache invalidates (in s/m/h. For example, 3600s or 60m or 1h). (Default: 0s) (see below for more details)
* `APP_CACHE_INVALIDATE_TTL`: How frequently the app info local cache invalidates (in s/m/h. For example, 3600s or 60m or 1h). (Default: 0s) (see below for more details)
* `ORG_SPACE_CACHE_INVALIDATE_TTL`: How frequently the org and space cache invalidates (in s/m/h. For example, 3600s or 60m or 1h). (Default: 72h)
* `APP_LIMITS`: Restrict to APP_LIMITS the most updated apps per request when populating the app metadata cache. keep it 0 to update all the apps. (Default: 0)
* `BOLTDB_PATH`: Bolt database path. (Default: cache.db)
* `EVENTS`: A comma separated list of events to include. It is a required field. Possible values: ValueMetric,CounterEvent,Error,LogMessage,HttpStartStop,ContainerMetric. If no eventtype is selected, nozzle will automatically select LogMessage to keep the nozzle running. (Default: "ValueMetric,CounterEvent,ContainerMetric")
* `EXTRA_FIELDS`: Extra fields to annotate your events with (format is key:value,key:value). (Default: "")
* `FLUSH_INTERVAL`: Time interval (in s/m/h. For example, 3600s or 60m or 1h) for flushing queue to Splunk regardless of CONSUMER_QUEUE_SIZE. Protects against stale events in low throughput systems. (Default: 5s)
* `CONSUMER_QUEUE_SIZE`: Sets the internal consumer queue buffer size. Events will be pushed to Splunk after queue is full. (Default: 10000)
* `HEC_BATCH_SIZE`: Set the batch size for the events to push to HEC (Splunk HTTP Event Collector). (Default: 100)
* `HEC_RETRIES`: Retry count for sending events to Splunk. After expiring, events will begin dropping causing data loss. (Default: 5)
* `HEC_WORKERS`: Set the amount of Splunk HEC workers to increase concurrency while ingesting in Splunk. (Default: 8)
* `ENABLE_EVENT_TRACING`: Enables event trace logging. Splunk events will now contain a UUID, Splunk Nozzle Event Counts, and a Subscription-ID for Splunk correlation searches. (Default: false)
* `SPLUNK_LOGGING_INDEX`: The Splunk index where logs from the nozzle of the sourcetype `cf:splunknozzle` will be sent to. Warning: Setting an invalid index will cause events to be lost. This index must match one of the selected indexes for the Splunk HTTP event collector token used for the SPLUNK_TOKEN parameter. When not provided, all logging events will be forwarded to the default SPLUNK_INDEX. The default value is `""`
* `STATUS_MONITOR_INTERVAL`: Time interval (in s/m/h. For example, 3600s or 60m or 1h) for Enabling Monitoring (Metric data of insights with in the connectors). Default is 0s (Disabled).
* `SPLUNK_METRIC_INDEX`: Index in which metric data will be ingested when monitoring module is enabled
* `SELECTED_MONITORING_METRICS`: Name of the metrics that you want to monitor and add using comma seprated values. List of the metrics that are supported in the metrics modules are given below

__About app cache params:__

When ADD_APP_INFO config is enabled, the nozzle will enrich the event with app metadata. For this, the nozzle maintains a cache of all the apps locally so that it doesn’t need to query from remote every time.

Now, when there is a change in this app data in remote, the nozzle has to update this local cache. For this, the config has APP_CACHE_INVALIDATE_TTL parameter. At every APP_CACHE_INVALIDATE_TTL interval, the nozzle will update the local cache by querying the remote (CF APIs).

If APP_CACHE_INVALIDATE_TTL is set to 10s, the nozzle will refresh the local cache at every 10s. So, AppCacheTTL should be set based on how frequently the app data is expected to change.

When the nozzle receives events from the doppler, it will check the local cache for the given app-id. But on cache-miss, it will query remote for that specific app. If it doesn’t find the app data from remote too, then the nozzle will add that app to MissingAppCache (if IGNORE_MISSING_APP config is **enabled**. so that the nozzle does not waste time in querying the remote for an app which is likely not to be found). So, from the next time onwards, the nozzle will first check in the MissingAppCache, if found then it will ignore the app and move on to the next event with a warning.

MISSING_APP_CACHE_INVALIDATE_TTL is used to clear the MissingAppCache so nozzle can retry querying from remote.

For example, given MISSING_APP_CACHE_INVALIDATE_TTL is set to 60s, when nozzle receives event from app that is not available in local cache and remote, it’ll add it to MissingAppCache. Until next MISSING_APP_CACHE_INVALIDATE_TTL, nozzle will not query from remote for the missing app.

- - - -

### Push as an App to Cloud Foundry

Push Splunk Firehose Nozzle as an application to Cloud Foundry. Please refer to **Setup** section for details
on user authentication.

1. Download the latest release

    ```shell
    git clone https://github.com/cloudfoundry-community/splunk-firehose-nozzle.git
    cd splunk-firehose-nozzle
    ```

1. Authenticate to Cloud Foundry

    ```shell
    cf login -a https://api.[your cf system domain] -u [your id]
    ```

1. Copy the manifest template and fill in needed values (using the credentials created during setup)

    ```shell
    vim .github/workflows/ci_nozzle_manifest.yml
    ```

1. Push the nozzle

    ```shell
    make deploy-nozzle
    ```

#### Dump application info to boltdb ####
If in production there are lots of CF applications(say tens of thousands) and if the user would like to enrich
application logs by including application meta data,querying all application metadata information from CF may take some time.
For example if we include, add app name, space ID, space name, org ID and org name to the events.
If there are multiple instances of Spunk nozzle deployed the situation will be even worse, since each of the Splunk nozzle(s) will query all applications meta data and
cache the meta data information to the local boltdb file. These queries will introduce load to the CF system and could potentially take a long time to finish.
Users can run this tool to generate a copy of all application meta data and copy this to each Splunk nozzle deployment. Each Splunk nozzle can pick up the cache copy and update the cache file incrementally afterwards.

Example of how to run the dump application info tool:

```
$ cd tools/dump_app_info
$ go build dump_app_info.go
$ ./dump_app_info --skip-ssl-validation --api-endpoint=https://<your api endpoint> --user=<api endpoint login username> --password=<api endpoint login password>
```

After populating the application info cache file, user can copy to different Splunk nozzle deployments and start Splunk nozzle to pick up this cache file by
specifying correct "--boltdb-path" flag or "BOLTDB_PATH" environment variable.

### Disable logging for noisy applications
Set F2S_DISABLE_LOGGING = true as a environment variable in applications's manifest to disable logging.

## Index routing
Index routing is a feature that can be used to send different Cloud Foundry logs to different indexes for better ACL and data retention control in Splunk.

### Per application index routing via application manifest
To enable per app index routing,
* Please set environment variable `SPLUNK_INDEX` in your application's manifest ([example below](#example-manifest-file))
* Make sure Splunk nozzle is configured with `ADD_APP_INFO` (Select at least one of AppName,OrgName,OrgGuid,SpaceName,SpaceGuid) to enable app info caching
* Make sure `SPLUNK_INDEX` specified in app's manifest exist in Splunk and can receive data for the configured Splunk HEC token.

> **WARNING**: If `SPLUNK_INDEX` is invalid, events from other apps may also get lost as splunk will drop entire event batch if any of the event from batch is invalid (i.e. invalid index)

There are two ways to set the variable:

In your app manifest provide an environment variable called `SPLUNK_INDEX` and assign it the index you would like to send the app data to.

#### Example Manifest file
```
applications:
- name: <App-Name>
  memory: 256M
  disk_quota: 256M
  ...
  env:
    SPLUNK_INDEX: <SPLUNK_INDEX>
    ...
```

You can also update the env on the fly using cf-cli command:
```
cf set-env <APP_NAME> SPLUNK_INDEX <ENV_VAR_VALUE>
```
#### Please note
> If you are updating env on the fly, make sure that `APP_CACHE_INVALIDATE_TTL` is greater tha 0s. Otherwise cached app-info will not be updated and events will not be sent to required index.

### Index routing via Splunk configuration
Logs can be routed using fields such as app ID/name, space ID/name or org ID/name.
Users can configure the Splunk configuration files props.conf and transforms.conf on Splunk indexers or Splunk Heavy Forwarders if deployed.

Below are few sample configuration:

1.  Route data from application ID `95930b4e-c16c-478e-8ded-5c6e9c5981f8` to a Splunk `prod` index:

*$SPLUNK_HOME/etc/system/local/props.conf*
```
[cf:logmessage]
TRANSFORMS-index_routing = route_data_to_index_by_field_cf_app_id
```

*$SPLUNK_HOME/etc/system/local/transforms.conf*
```
[route_data_to_index_by_field_cf_app_id]
REGEX = "(\w+)":"95930b4e-c16c-478e-8ded-5c6e9c5981f8"
DEST_KEY = _MetaData:Index
FORMAT = prod
```

2. Routing application logs from any Cloud Foundry orgs whose names are prefixed with `sales` to a Splunk `sales` index.

*$SPLUNK_HOME/etc/system/local/props.conf*
```
[cf:logmessage]
TRANSFORMS-index_routing = route_data_to_index_by_field_cf_org_name

```

*$SPLUNK_HOME/etc/system/local/transforms.conf*
```
[route_data_to_index_by_field_cf_org_name]
REGEX = "cf_org_name":"(sales.*)"
DEST_KEY = _MetaData:Index
FORMAT = sales
```

3. Routing data from sourcetype `cf:splunknozzle` to index `new_index`:

*$SPLUNK_HOME/etc/system/local/props.conf*
```
[cf:splunknozzle]
TRANSFORMS-route_to_new_index = route_to_new_index
```

*$SPLUNK_HOME/etc/system/local/transforms.conf*
```
[route_to_new_index]
SOURCE_KEY = MetaData:Sourcetype
DEST_KEY =_MetaData:Index
REGEX = (sourcetype::cf:splunknozzle)
FORMAT = new_index
```

Note:Moving from version 1.2.4 to 1.2.5,timestamp will use nanosecond precision instead of milliseconds.

__Monitoring(Metric data Ingestion):__

| Metric Name |  Description
|---|---
|  `nozzle.queue.percentage` | Shows how much internal queue is filled
|  `splunk.events.dropped.count` | Number of events dropped from splunk HEC
|  `splunk.events.sent.count` | Number of events sent to splunk
|  `firehose.events.dropped.count` | Number of events dropped from nozzle
|  `firehose.events.received.count` | Number of events received from firehose(websocket)
|  `splunk.events.throughput` | Average Payload size
|  `nozzle.usage.ram` | RAM Usage
|  `nozzle.usage.cpu` | CPU Usage
|  `nozzle.cache.memory.hit` | How many times it has successfully retrieved the data from memory
|  `nozzle.cache.memory.miss` | How many times it has unsuccessfully tried to retreive the data from memory
|  `nozzle.cache.remote.hit` | How many times it has successfully retrieved the data from remote
|  `nozzle.cache.remote.miss` | How many times it has unsuccessfully tried to retrieve the data from remote
|  `nozzle.cache.boltdb.hit` | How many times it has successfully retrieved the data from BoltDB
|  `nozzle.cache.boltdb.miss` | How many times it has unsuccessfully tried to retrieve the data from BoltDB

![event_count](https://user-images.githubusercontent.com/89519924/200804220-1adff84c-e6f1-4438-8d30-6e2cce4984f5.png)

![nozzle_logs](https://user-images.githubusercontent.com/89519924/200804285-22ad7863-1db3-493a-8196-cc589837db76.png)

Note:Select value Rate(Avg) for Aggregation from Analysis tab on the top right.

##  Troubleshooting
This topic describes how to troubleshoot Splunk Firehose Nozzle for Cloud Foundry.

#### 1. I can't find my data!

  Are you searching for events and not finding them or looking at a dashboard and seeing "No result found"? Check Splunk Nozzle app logs.

  To view the nozzle's logs running on CF do the following:

Log in as an admin via the CLI.

Target the org created by the tile.

cf target -o SPLUNK-NOZZLE-ORG

View the recent app Splunk Nozzle logs (the version number installed by the tile will vary).

cf logs --recent splunk-firehoze-nozzle

Alternatively, you can stream the app logs as they're emitted.

cf logs splunk-firehose-nozzle

### Here are a few common errors and possible resolutions:

#### Splunk configuration related errors:

{"timestamp":"<time>","source":"splunk-nozzle-logger","message":"splunk-nozzle-logger.Unable to talk to Splunk","log_level":2,"data":{"error":"Post http://localhost:8088/services/collector: read tcp <IP_ADDRESS>:62931-\u003elocalhost:8088: read: connection reset by peer"}}

This error usually occurs when SSL is enabled on the Splunk HEC endpoint. Confirm that you're using https' in the Splunk HEC URL.

{"timestamp":"<time>","source":"splunk-nozzle-logger","message":"splunk-nozzle-logger.Unable to talk to Splunk","log_level":2,"data":{"error":"Non-ok response code [400] from splunk: {\"text\":\"Incorrect index\",\"code\":7,\"invalid-event-number\":1}"}}

This usually means the index value specified in the configuration doesn't exist on Splunk Host. Confirm that you're using the correct Splunk index value.

{"timestamp":"<time>","source":"splunk-nozzle-logger","message":"splunk-nozzle-logger.Unable to talk to Splunk","log_level":2,"data":{"error":"Non-ok response code [403] from splunk: {\"text\":\"Invalid token\",\"code\":4}"}}

This can occur when the Splunk HEC Token value is invalid. Confirm that you're using a valid token.

{"timestamp":"<time>","source":"splunk-nozzle-logger","message":"splunk-nozzle-logger.Unable to talk to Splunk","log_level":2,"data":{"error":"Post https://localhost:8088/services/collector: x509: cannot validate certificate for localhost because it doesn't contain any IP SANs"}}

This usually means that there was no valid SSL certificate found. Confirm that you're using a valid SSL certificate for the Splunk server, or set 'Skip SSL Validation' to `true` under Splunk settings.

Note:Disabling SSL validation is not recommended for production environments.

{"timestamp":"<time>","source":"splunk-nozzle-logger","message":"splunk-nozzle-logger.Unable to talk to Splunk","log_level":2,"data":{"error":"Post https://localhost:8088/services/collector: dial tcp localhost:8088: getsockopt: connection refused"}}

This error can occur when the Splunk server is offline or when the Splunk HEC URL is not valid. Confirm that both the Splunk server is running and that you're using a valid URL.

#### Cloud Foundry configuration related errors:

{"timestamp":"<time>","source":"splunk-nozzle-logger","message":"splunk-nozzle-logger.Failed to run splunk-firehose-nozzle","log_level":2,"data":{"error":"Error getting token: oauth2: cannot fetch token: 401 Unauthorized\nResponse: {\"error\":\"unauthorized\",\"error_description\":\"Bad credentials\"}"}}

This error can occur when the credentials provided for CF environment are invalid. Confirm that the API User and API Password each have access to the CF environment.

{"timestamp":"<time>","source":"splunk-nozzle-logger","message":"splunk-nozzle-logger.Failed to run splunk-firehose-nozzle","log_level":2,"data":{"error":"Could not get api /v2/info: Get https://api.cfendpoint.com/v2/info: x509: certificate signed by unknown authority"}}

This means that no valid SSL certificate was found. To remediate this error, provide a valid SSL certificate for Cloud Foundry or set 'Skip SSL Validation' to true under Cloud Foundry Settings.

Note:Disabling SSL validation is not recommended for production environments.

The following troubleshooting tips assume you have access to Splunk to run basic searches against index `_internal` and the user-specified index for Firehose events.

### 2. Ensure Splunk Nozzle is forwarding events from the Firehose:

Search app logs of the Nozzle to confirm correct behavior:

sourcetype="cf:splunknozzle"

A correct setup logs a start message with configuration parameters of the Nozzle logged as a JSON object, for example:

  data:	{
     add-app-info: AppName,OrgName,OrgGuid,SpaceName,SpaceGuid
     api-endpoint: https://api.endpoint.com
     app-cache-ttl: 0
     app-limits: 0
     batch-size: 1000
     boltdb-path: cache.db
     branch: null
     buildos: null
     commit: null
     debug:	 false
     extra-fields:
     flush-interval:<PHONE_NUMBER>
     hec-workers: 8
     ignore-missing-apps: true
     job-host:
     job-index: -1
     job-name: splunk-nozzle
     keep-alive:<PHONE_NUMBER>0
     missing-app-cache-ttl:	 0
     queue-size: 10000
     retries: 2
     skip-ssl: true
     splunk-host: http://localhost:8088
     splunk-index: atomic
     subscription-id: splunk-firehose
     trace-logging: true
     status-monitor-interval: 0s
     version:
     wanted-events: ValueMetric,CounterEvent,Error,LogMessage,HttpStartStop,ContainerMetric
  }
  ip: <IP_ADDRESS>
  log_level: 1
  logger_source: splunk-nozzle-logger
  message: splunk-nozzle-logger.Running splunk-firehose-nozzle with following configuration variables
  origin: splunk_nozzle

  Search app logs of the Nozzle for any errors:

sourcetype="cf:splunknozzle" data.error=*

Errors are logged with corresponding message and stacktrace.

### 3. Check for dropped events due to HTTP Event Collector availability:

As the Splunk Firehose Nozzle sends data to Splunk via HTTPS using the HTTP Event Collector, it is also susceptible to any network issues across the network path from point to point. Run the following search to determine if Splunk has indexed any events indicating issues with the HEC Endpoint.

  sourcetype="cf:splunknozzle" "dropping events"

### 4. Check for dropped events due to slow downstream(Network/Splunk):

If the nozzle emits the ‘dropped events’ warning saying that downstream is slow, then the network or Splunk environment might needs to be scaled. (eg. Splunk HEC receiver node, Splunk Indexer, LB etc)

Run the following search to determine if Splunk has indexed any events indicating such issues.

  sourcetype="cf:splunknozzle" "dropped Total of"

### 5. Check for data loss inside the Splunk Firehose Nozzle:

If "Event Tracing" is enabled, extra metadata will be attached to events. This allows searches to calculate the percentage of data loss inside the Splunk Firehose Nozzle, if applicable.

Each instance of the Splunk Firehose Nozzle will run with a randomly generated UUID. The query below will display the message success rate for each UUID (Please update the index value based on your nozzle configuration).

index=main | stats count as total_events, min(nozzle-event-counter) as min_number, max(nozzle-event-counter) as max_number by uuid | eval event_number =  max_number - min_number | eval success_percentage = total_events/event_number*100 | stats max(success_percentage) by uuid

### 6. Authentication is not working even if correct CF Client ID/secret is configured: (applicable in v1.2.3)

Due to a known issue in an indirect dependency (an OAuth library), if the client secret has any special characters (eg. *!#$&@^) then it will not work. For now, user has to configure a client secret without any of this characters. Once the library in question is updated in the next release it will work even with the special characters.

#### Searching Events

Here are two short Splunk queries to start exploring some of the Cloud Foundry events in Splunk.

```
sourcetype="cf:valuemetric"
    | stats avg(value) by job_instance, name
```

```
sourcetype="cf:counterevent"
    | eval job_and_name=source+"-"+name
    | stats values(job_and_name)
```

### 7. Nozzle is not collecting any data with 'websocket' (bad handshake) error

If the nozzle reports below error, then check if the configured "subscription-id" has '#' as a prefix. Please remove the prefix or prepend any other character than '#' to fix this issue.
```
Error dialing trafficcontroller server: websocket: bad handshake.\nPlease ask your Cloud Foundry Operator to check the platform configuration (trafficcontroller is wss://****:443).
```

### Development

#### Software Requirements

Make sure you have the following installed on your workstation:

| Software | Version
| --- | --- |
| go | go1.17.x

Then make sure that all dependent packages are there:

```
$ cd <REPO_ROOT_DIRECTORY>
$ make installdeps
```

#### Environment

For development against [bosh-lite](https://github.com/cloudfoundry/bosh-lite),
copy `tools/nozzle.sh.template` to `tools/nozzle.sh` and supply missing values:

```
$ cp script/dev.sh.template tools/nozzle.sh
$ chmod +x tools/nozzle.sh
```

Build project:

```
$ make VERSION=1.2.4
```

Run tests with [Ginkgo](http://onsi.github.io/ginkgo/)

```
$ ginkgo -r
```

Run all kinds of testing

```
$ make test # run all unittest
$ make race # test if there is race condition in the code
$ make vet  # examine GoLang code
$ make cov  # code coverage test and code coverage html report
```

Or run all testings: unit test, race condition test, code coverage etc
```
$ make testall
```

Run app

```
# this will run: go run main.go
$ ./tools/nozzle.sh
```

# Maintenance And Support

Splunk Firehose Nozzle project is supported through Splunk Support assuming the customer has a current Splunk support entitlement.  For customers that do not have a current Splunk support entitlement, please file an issue at [create a new issue](https://github.com/cloudfoundry-community/splunk-firehose-nozzle/issues/new/choose)

branch_name: refs/heads/develop


text:
A set of tasks based on the versioning sample script to version stamp assemblies shown in the [VSTS documentation](https://msdn.microsoft.com/Library/vs/alm/Build/scripts/index
). These allow versioning of

* VersionAssemblies - sets the version in the assemblyinfo.cs or .vb (used pre build)
* VersionDotNetCoreAssemblies - sets the version in the .csproj (used pre build)
* VersionAPPX - sets the version in the Package.appxmanifest (used pre build)
* VersionVSIX - sets the version in the source.extension.vsixmanifest (used pre build)
* VersionDacpac - sets the version in a SQL DACPAC (used pre or post build)
* VersionNuspec - sets the version in a Nuget Nuspec file (used pre packing)
* VersionSharePoint - sets the version in a SharePoint 2013/2016/O365 Add-In
* VersionWix - sets the version in a Wix Project
* VersionAndroidManifest - Sets the versionName and versionCode values in an Android project
* VersionJSONFile - Sets the version in a named field in a JSON file (tested in NPM package.json file)
* VersionAngularFile - Sets the version in a named field in an enviroment.ts Angular file
* VersionPowerShellModule - Sets the ModuleVersion property in any module psd1 files.
* VersionIOSPlistManifest - Sets the CFBundleShortVersionString and CFBundleVersion properties in iOS Plist files.

All these tasks take at least two parameters, which are both defaulted

* Path to files to version: Defaults to $(Build.SourcesDirectory)
* Version number: Defaults to $(Build.BuildNumber)
* [Advanced] Inject Version: If true then the build number will be used without regex processing
* [Advanced] Version Regex: The filter used to extract the version number from the build. Default to '\d+\.\d+\.\d+\.\d+'
* [Output] OutputVersion: Outputs the actual version number extracted from build number.

The Assembly & .NET Core versioner also takes the following Advanced option

* [Advanced] Field: The name of the version field to update, if blank updates all. Default is empty

The .NET Core versioner also takes the following Advanced option

* [Advanced] FilenamePattern: The filename pattern to update. Default to .csproj or can be directory.build.props
* [Advanced] SDKNames: A comma separated list of SDK namespaces to use to match .csproj file. Ignored if filename pattern is directory.build.props
* [Advanced] versionFields: Default version fields to update if no specific field is specified. Defaults to Version, VersionPrefix, AssemblyVersion

The WIX versioner also takes the following Advanced options

* [Advanced] FieldsToMatch: The list of five field names that will be updated in the wxi file, defaults to 'MajorVersion,MinorVersion,BuildNumber,Revision,FullVersion'

The DACPAC versioner also takes the following Advanced option

* The task can now be run pre-build similar to the other versioning tasks and will set the DacVersion property in the SqlProj file to the required version number.
* ToolPath: The path to the folder containing the files Microsoft.SqlServer.Dac.dll and Microsoft.SqlServer.Dac.Extensions.dll. This should be used if these files are not in the default location and hence cannot be found by the task. This value takes precedence over the automated means of finding the DLL
* VSVersion: A filter for the Visual Studio version to scan for the SQL DAC SDK e.g 2017, 2015, 2022. if not set will scan for all versions and the newest used.
* SDKVersion: A filter for the SQL DAC SDK e.g 130, 150. if not set will scan for all versions and the newest used.

The VSIX versioner also takes the following parameters

* If the versionumber parameter is treated as a version number or a build number (from which the version needs to be extracted)
* If the discovered version should be trimmed to 2 digit field

The Android manifest versioner takes the following extra parameters:

* [Advanced] Inject Version Code: If true then the provided version code will be used as opposed generating from the build number will regex processing
* Version Code - A number between 1 and<PHONE_NUMBER> as required by the Google Play Store
* Version Name Pattern - This is the pattern you'd like the publicly visible version name to take in. This should be in the format {1}.{2} or similar but will also work with 1.2.3 etc.
* Version Code Pattern - This is the elements that you'd like to use to store the internal version number that Google uses for detecting if a version of the app is newer than an existing version, both in the play store and on the device. This will concatenate any specifies parts together into a single integer. It Accepts single values like {3} or multiple like {1}{2}{3}, delmiting with `{x}` is optional and should work with 123.

See the blog post [Making sure when you use VSTS build numbers to version Android Packages they can be uploaded to the Google Play Store](https://blogs.blackmarble.co.uk/rfennell/2018/05/12/making-sure-when-you-use-vsts-build-numbers-to-version-android-packages-they-can-be-uploaded-to-the-google-play-store/) for more details on using this task

The JSON and Angular versioners use the same form of format parameter as the android versioner for the version number to write to the file

The Plist manifest version takes the following extra parameters:
* [Advanced] Inject CFBundleShortVersionString: If true then the provided CFBundleShortVersionString will be used as opposed generating from the build number will regex processing
* [Advanced] Inject CFBundleVersion: If true then the provided CFBundleVersion will be used as opposed generating from the build number will regex processing
* CFBundleShortVersionString Pattern - This is the pattern you'd like the publicly visible version name to take in. This should be in the format {1}.{2} or similar but will also work with 1.2.3 etc.
* CFBundleVersion Pattern - This is the pattern you'd like the publicly visible version name to take in. This should be in the format {1}.{2} or similar but will also work with 1.2.3 etc.
* Version Code Pattern - This is the elements that you'd like to use to store the internal version number that Google uses for detecting if a version of the app is newer than an existing version, both in the play store and on the device. This will concatenate any specifies parts together into a single integer. It Accepts single values like {3} or multiple like {1}{2}{3}, delmiting with `{x}` is optional and should work with 123.

license: MIT

repository: arychlicki/AzurePipelines

branch_name: refs/heads/main

extension: md

gha_license_id: MIT

license_type: permissive

repo_name: arychlicki/AzurePipelines


text:
---
layout: page
title: [Rev](/new-testament/rev.html) 19
---

# [Rev](/new-testament/rev.html) 19

[New Testament](/new-testament.html)

[prev](/new-testament/rev/rev-18.html)

[next](/new-testament/rev/rev-20.html)

1 _After this I heard a loud sound in heaven. It sounded like many people calling. They said,  Praise our God! He saves people. He is great and power belongs to him._

2 _The way God punishes is true and right. He has punished the bad woman who spoiled the earth with her wrong ways. He has made her pay for the killing of his servants._

3 _They said again, Praise God! The smoke where she burns goes up for ever and ever!_

4 _Then the twenty-four leaders and the four living beings kneeled down.  Yes, it is so! Praise God!_

5 _A voice from the throne said, Praise our God, all his servants, all who respect and honour him: you who are great and you who are not great, praise him!_

6 _Then I heard a sound in heaven. It sounded like many people and much water flowing and like loud thunder. They said, Praise God! The Lord our God, who has all power,  rules!_

7 _We will be glad and very happy! We will praise him. The time has come for the Lamb to marry. The woman who will marry him is ready._

8 _She was given the right to wear fine linen, shining and clean. The fine linen means the good things Gods people have done._

9 _The angel said to me, Write this: God blesses those who are called to come to the wedding feast of the Lamb. And he said to me, These are the true words of God._

10 _Then I kneeled down in front of him to worship him. But he said to me, You must not do that! I am only a servant like you and like your brothers who tell about Jesus. Worship God! Those who tell about Jesus have the spirit of a prophet._

11 _Then I saw heaven open, and I saw a white horse! The One who rode him is called One who can be Trusted and The True One.He punishes and makes war in the right way._

12 _His eyes were like a flame of fire. On his head were many crowns. He had a name written on him, but no man knew what it was but he himself._

13 _He wore clothes that had been dipped in blood. His name is The Word of God._

14 _The armies of heaven followed him on white horses and they were dressed in fine linen,  shining and clean._

15 _A long knife or sword comes from his mouth. With it he will punish and control the people of the nations. He will rule them with an iron stick. He is like the winepress that presses the water out of the fruit. It is the place where God, who has all power, shows his great anger._

16 _A name is written on his clothes and on his leg: it is King of kings, and Lord of lords._

17 _I saw an angel standing in the sun. He called in a loud voice to all the birds that fly across the sky. He said, Come, gather for Gods big feast._

18 _Come to eat the bodies of kings, the bodies of captains, the bodies of strong men, the bodies of horses and those who ride them, the bodies of all free men and of slaves, those who are great and those who are not great._

19 _I saw the beast and the kings of the earth and their armies. They were gathered to fight against the One riding the horse and his army._

20 _Then the beast was caught and the prophet who is not true was caught. The prophet had done big works for the beast to see. By the things which he did, he had fooled the people who had the mark of the beast and who worshipped its idol. The beast and the prophet were thrown alive into the big fire which burns with dust that chokes people._

21 _Their armies were killed by the man riding the horse. He killed them with the sword that came out of his mouth. All the birds ate all they wanted of their dead bodies._

license: Unlicense

branch_name: refs/heads/master


text:
---
layout: index
---

#### Overview

Data management systems are the corner-stone of modern applications, businesses, and science (including data).  If you were excited by the topics in 4111,  this graduate level course in database systems research will be a deep dive into classic and modern database systems research.  Topics will range from classic database system design, modern optimizations in single-machine and multi-machine settings, data cleaning and quality, and application-oriented databases.   This semester's theme will look at how learning has affected many classic data management systems challenges, and also how data management systems support and extends ML needs.

See [FAQ](./syllabus#faq) for difference between 6113 and the other database courses.

#### Information

* Class: Th 2-4PM in 829 Mudd
* Instructor: [Eugene Wu](http://www.eugenewu.net), OH: Thurs 12-1PM 421 Mudd
* [Syllabus & FAQ](./syllabus),
[Slack](https://w6113-s23.slack.com),
[Project](./projects),
[Papers](./papers)
* Prereqs: W4111 Intro to DB (required), W4112 DB Implementations (recommended).  Ugrads OK; see Prof Wu

#### Grading

* Discussion Prep 30%
* Class participation 30%
* [Project](./projects) 40%:
   Final Presentation 10%,
   Paper 30%

#### Recent Announcements

#### Tentative Schedule

 Date

 Topic

 Notes

{% assign idx = 0 %}

{% for r in site.data.schedule %}
  {% assign idx = idx | plus: 1  %}

    C{{idx}}: {{r.date}}

      {% if r.link %}
        {{r.slug}}
      {% else %}
        {{r.slug}}
      {% endif %}

      {% if r.papers %}

      {% for p in r.papers %}

{{p.title}}

      {% endfor %}

      {% endif %}

      {% if r.presenter %}

        Presenter: {{r.presenter}}
      {% endif %}

      {% if r.misc %}

 {{r.misc|raw}}

      {% endif %}

      {% if r.notes %}
        {{r.notes|raw}}
      {% endif %}

{% endfor %}

Course design inspired by

* [Cal's CS286](https://cs286berkeley.net/)
* [Waterloo's CS848](https://cs.uwaterloo.ca/~kmsalem/courses/cs848S19/schedule.shtml)
* Colin Raffel's [Role playing seminar](https://colinraffel.com/blog/role-playing-seminar.html)
* Carl Vondrick's self supervision graduate seminar

gha_language: JavaScript


text:
# firestudio default boilerplate

A highly opinionated boilerplate for developing apps using NextJS and Firebase.

## Set Up

### Step 1: Setup firebase:

You will need to configue firebase to serve the app locally and deploy.

* create a project through the [firebase web console](https://console.firebase.google.com/)
* grab the project's ID from the web consoles URL: https://console.firebase.google.com/project/<projectId>
* install Firebase Tools: `npm i -g firebase-tools`
* login to the Firebase CLI tool with `firebase login`

### Step 2: Update you app's next.config.js file with your firebase projectId:

```javascript
withSPA = require('next-spa').withSPA

module.exports = withSPA({
  nextFire: {
    projectId: <projectId>
  }
})

```

### Step 3: Start developing

The `package.json` file comes with some with all the scripts you need to get started.

- Dev: `npm run dev`
- Build: `npm run build`
- Serve Build Locally: `npm run serve`
- Deploy: `npm run deploy`

repository: guessty/firepress

repo_name: guessty/firepress


text:
# BitClout
Tools and analytics data for the BitClout blockchain

![Screenshot](/Docs/public_key_connections.gif)

### 1. The blockchain datamodel:
![Screenshot](/Docs/Screenshot.png)

### 2. Some Services, Managers and Tools I built:

- `NetworkClient`: Used to fetch all transactions given a `blockHeight` or an account `publicKey`
- `StorageClient`: Used to save, read or check that a block has been saved on disk
- `QueryManager`: Combine the `NetworkClient` &  `StorageClient` to provide a higher level API to fetch all blocks from `blockHeight` to the last available one. Persist the result on disk to not fetch the same block again if it's already been fetched.
- `StateManager`: Use the previous Classes to provide higher level API.
    - `refresh(completion:)`: To update the locally stored blocks with the newly available ones
    - `printAllTransactionForCreatorCoins(privateKey:)`: To print all the buy/sell that happened to a creator coin, given it's public key. This is printed in csv format where each line is `blockHeight,coinsValueChange`.
- `Tools`: Contains math functions to convert from $BitClout prices to number of coins given the existing coins in circulation and vice versa.

Here is an example of how this can be used:

```
let stateManager = StateManager()
stateManager.refresh() { error in
    guard error == nil else { return }

    let creatorKeyToFind = "BC1YLiWgKXYrpTkUZHyCbhfxU1bgJCQGcBvsQvPWuAwiVWnDFsvxudi" // @ludo
    stateManager.printAllTransactionForCreatorCoins(privateKey: creatorKeyToFind)
}
```

### 3. More to come...

In the meantime, feel free to play with this, and contribute back you findings if you think this might help others :)

My profile: [@ludo](https://bitclout.com/u/ludo)

repository: hellyeah/BitClout

repo_name: hellyeah/BitClout


text:
<!-- DO NOT EDIT: generated by ./Build/prepareDocumentation.ps1 for .\AltCover.Toolkit\OpenCover.fsi -->

# namespace `AltCover`
```
namespace AltCover
```
## module `OpenCover`
```

  [<RequireQualifiedAccess>]
  module OpenCover = begin
    val PostProcess :
      document:System.Xml.Linq.XDocument -> ordinal:BranchOrdinal -> unit
```
Updates summary and related coverage-derived data based on visit counts.  Argument `ordinal` indicates which XML attribute should be used to associate branches with sequence points.
```

    val FormatFromCoverlet :
      report:System.Xml.Linq.XDocument ->
        files:string array -> System.Xml.Linq.XDocument
```
Adds summary data and other items to report in `coverlet`'s OpenCover dialect, particularly giving somewhat meaningful start and end column values for its line-based paradigm, as well as npath coverage and branch exits.  Arguments `files` indicates the assemblies used in the report, which are used to provide sopme of the missing information.
```

    val CompressBranching :
      document:System.Xml.Linq.XDocument ->
        withinSequencePoint:bool -> sameSpan:bool -> System.Xml.Linq.XDocument
```
Takes output from the OpenCover program, and adjust from OpenCover's liberal idea of significant branches towards AltCover's more restricted approach -- chose either or both of `sameSpan` to unify branches that go from the same start, and take the same trajectory to the same end (OpenCover issue #786 being one instance of this) and `withinSequencePoint` to remove branches interior to a statement (compiler generated things like stashing of lambdas, the hidden conditional `Dispose()` after a `using`, or inside F# inlines -- OpenCover issues #657, #807 being instances of this).
```
    val Merge :
      documents:System.Xml.Linq.XDocument seq -> System.Xml.Linq.XDocument
```
Takes a set of OpenCover reports and creates a composite.  It handles
both strict (`OpenCover`, `AltCover --reportFormat=OpenCover`) and more relaxed (`coverlet`,
`ConvertFrom-CoverageJson`, `Write-OpenCoverDerivedState -Coverlet`) interpretations of the
format, which may lead to a not-quite strict result.  Note -- Module records are merged only
if their hash values match, so output from different builds and possibly different source will
be kept distinct.
```
    val JsonToXml :
      document:string -> System.Xml.Linq.XDocument
```
Takes JSON output from coverlet or AltCover's own native JSON format and converts it to a minimal OpenCover style XML document.
```

repository: SteveGilham/altcover

gha_language: F#

repo_name: SteveGilham/altcover


text:
```@cfg
title = "Running Examples Locally"
weight = 0
```

All examples can be found as Julia scripts and Jupyter notebooks in a
self-contained Julia project which is available here:
[`examples.tar.gz`](https://docs.lyceum.ml/dev/static/examples.tar.gz).

Once downloaded, extract the archive with your tool of choice. On Linux machines, you can run:

```
tar xzf examples.tar.gz
```

which will produce a folder in the same directory named "LyceumExamples". Inside, you'll
find a `README.md`, reproduced below, with further instructions.

---

@__EXAMPLES_README__

gha_language: Julia


text:
# `numpy.ndarray` manuals

## Arithmetic, matrix multiplication, and comparison operations

- https://docs.scipy.org/doc/numpy-1.14.0/reference/arrays.ndarray.html#arithmetic-matrix-multiplication-and-comparison-operations

Arithmetic and comparison operations on `ndarray`s are defined as element-wise operations, and
generally yield `ndarray` objects as results.

Each of the arithmetic operations (`+`, `-`, `*`, `/`, `//`, `%`, `divmod()`, `**` or `pow()`, `<<`,
`>>`, `&`, `^`, `|`, `~`) and the comparisons (`==`, `<`, `>`, `<=`, `>=`, `!=`) is equivalent to
the corresponding universal function (or `ufunc` for short) in NumPy.

repository: Mecreal/manuals

repo_name: Mecreal/manuals


text:
Notes 13.2
---
Express is an Unopinionated (lot of configuration options) web framework
Assist as middleware to handle routes

Today's Request Methods:
Get: Server will provide information
Post: Server is expecting information

Routing, Parsing, Listening, Sending, Receiving

###  New Packages

body-parser
https://www.npmjs.com/package/body-parser

node path
https://nodejs.org/api/path.html

###  Instructions
---
# Students Do: Add Route to server1.js (0:07)

server1.js (08-StarWars-1)

Instructions:

Work with those around you to confirm your server1.js file working. This means figuring out: what dependencies to install, how to run the file, and how to view the resulting website in your browser. This step requires you to make ZERO changes to the code file. At this point, you are just getting the file you are given to run.

Then, once you've gotten the original code to display in the browser, create a new Obi Wan Kenobi  route to display Kenobi's information. (Note: Might want to create route without spaces) Use the comments and the previous code in the file as a guide.

Help those around you when done.
---

# Partners Do: Dissect req.params (0:05)

server2.js (09-StarWars-2)

Instructions:

Examine the code sent to you. Once again, run the server2.js file and view the page in the browser. Troubleshoot any issues that arise. Again NO CODE CHANGES required.

Then once you have a working server instance, begin to examine the file. Try to explain to yourself and those around you what the significance of /:character and req.params.character is.

Create a test case to check your hypothesis.
---

Students Do: Postman Exercise (0:10)

server5.js (12-StarWars-5)

Instructions:

Use Postman to send a POST request to the server you've been provided. Confirm that your character has been added to the database correctly.

---

Students Do: Dissect .get view.html (0:07)

server6.js (13-StarWars-6)

Instructions:

Look at the file sent to you then explain to the person next to you what the res.sendFile line does. Then try creating a new HTML file and routing to that one instead.

---

21.	Students Do: Dissect .post (add.html)	(0:07)
Slack out a zipped copy of 14-FinalStarWarsApp. Then task students with the following:

Instructions:

Spend a few moments looking over the code sent to you. First, get the server running, then begin to dissect the JavaScript code found at the bottom of add.html.

Explain to one another what the code does, what its for, and why its relevant to the application so far. Be sure to explain to one another what the $.post code is doing.

 ---

Students Do: Deploy to Heroku (0:30)

Create/login to  Heroku accounts .

File:

01-Activities/14-FinalStarWarsApp (solution, zipped)

03-Supplemental/HerokuGuide (slacked out or link to class repo posted)
Instructions:

Push the finished Star Wars app to heroku following the steps from the guide.

BONUS: Begin making the below additional page for your Star Wars app. Push those changes up as you build the new feature. Specifically, this will require:

Create a new page on your Star Wars website that displays a table of ALL characters in the database. This will involve at minimum:
Creating a route in the server.js file for displaying data
Creating a route in the server.js file for sending users a new HTML file
Creating an HTML file that grabs data from the server.
Be sure to walk around and help students as they hit snags or have problems pushing to heroku, consulting the troubleshooting tips below as needed.

## Use heroku
$ git init
$ heroku git:remote -a starwarscoolness

## Re-Group (0:05)

# What is a web server?
# What is the difference between a request and a response.
# What are some examples of web servers we use every day?
# What are the different types of request methods, and how are they used?


text:
net-transitions
===============

A library for animated UI transitions for .NET

This is the an independent further-development of the original library [hosted on Google Code](https://code.google.com/p/dot-net-transitions/), since the original author has discontinued the development of this library.

The aim of this project is to improve the architechture and make it compliant to the [Class Library Guidelines](http://msdn.microsoft.com/en-us/library/vstudio/ms229042.aspx).
Feel free to request enhancements.

repository: micaelbergeron/net-transitions

repo_name: micaelbergeron/net-transitions


text:
# EFG Designs
This webpage is based off of [Ghost](https://github.com/TryGhost/Ghost)
## Copyright & License

Copyright (c) 2013-2014 Ghost Foundation - Released under the [MIT license](LICENSE).


text:
Network Moniter
==============

The network management module of an energy management system for Android phones

## Version 14.04:

1. Modify the target SDK version as 19 (Android 4.4.2) and the minimum SDK version as 15 (Android 4.0.3)
2. Modify GUI as fullscreen theme.
3. Add English version for GUI.
4. Change source code encoding from GBK to UTF-8.

## License

Copyright (c) 2014 Tianwei Liu. See the [LICENSE](https://github.com/TLiu2014/NetworkMoniter/blob/master/LICENSE) file for license rights and limitations (MIT).


text:
slock
=====

This is my own version of [slock](http://tools.suckless.org/slock), the
*Simple X display locker*:

* it shows random pastel colors each time you lock instead of having fixed ones;
* it validates your password everytime you press a key so the Return key is not needed.

Requirements
------------
In order to build slock, you need the Xlib header files.

Installation
------------
Edit `config.mk` to match your local setup (slock is installed into
the `/usr/local` namespace by default).

Afterwards, enter the following command to build and install slock
(if necessary as `root`):

    # make clean install

Running
-------
Simply invoke the `slock` command. To get out of it,
enter your password. You can press Escape to erase
what you typed if you don't want to hit Backspace like crazy.

repository: eepp/slock

repo_name: eepp/slock


text:
# Gilded Rose Refactoring Challenge

This is being used as a playground to practice safe refactorings in small steps.

See the [requirements](https://github.com/emilybache/GildedRose-Refactoring-Kata/blob/master/GildedRoseRequirements.txt)

repository: Egga-zz/gilded-rose-challenge

repo_name: Egga-zz/gilded-rose-challenge


text:
# DataTinder application

This repository is a React Native application for https://github.com/jussihayha/DataTinderit -project.
You need to be aware that this application is highly tailored for the backend we used.

You can check https://github.com/bgf122/dataTinderBack on how to deploy your own backend.

This is a basic application that uses localStorage to identify user (using uuid) and demonstrates a backend serving
recommendations in a "Tinder"-kind of way.

Our original authentication method was Firebase, but that was scrapped for creating a no-fuss kind
scenario for the enduser.

HomeScreen | ListScreen | ProgramDetails
--- | --- | ---
![](./components/images/HomeScreen.png) | ![](./components/images/ListScreen.png) | ![](./components/images/ProgramDetails.png)

## Getting Started

These instructions give you an overview on how to take advantage of this repository.
Your mileage may wary though and some heavy forking might be necessary to get this up and running for your needs.

### Prerequisites

Before you start, you need to setup your own backend.
You need atleast these packages to develop on your local machine

* Expo
* NPM
* Android emulator (recommended)

### Installation

A step by step guide that will tell you how to get the development environment up and running.

```
$ git clone https://github.com/laurahyvari/DataTinderiFront
$ npm install
$ npm start
```

## Userflow

The app is designed so that when the user opens it for the first time, it gives a small explanation
on how it works.

After the introscreen you are greeted with a Tinderlike swipeable screen that you can use to give votes
on items that the backend server gives you.

There is a second tab where the app fetches recommendations and popular items from the backend.
The second tab has a stacknavigator also so that you can open itemdetails.

This is a POC project so the main functionality of this app is to demonstrate how the backend recommender works
and validate its success.

### Branches

* Master branch is the working version and other branches might have content that are no longer viable.

repository: laurahyvari/DataTinderiFront

repo_name: laurahyvari/DataTinderiFront


text:
# Auto-Type v0.1.0
 * Initial commit
 * Features beyond the basic typing animation:
   * Style individual code blocks, by giving have each one be its own component
   * Pass multiple strings at once, to be animated sequentially
   * Alter the dynamics of the animation
   * Skip the animation with a user-defined event


text:
The contents of this directory are from the MAPI Stub Library, formerly
Outlook MAPI Headers.

The files were downloaded from https://github.com/stephenegriffin/MAPIStubLibrary
at revision 01f9bf8cd2ac39078aabfc4662c873159efd75d6.

The files have been renamed to lower-cased filenames for cross-compiling
compatibility.

The content of the imported files was validated by comparing them to the
ones found in the Outlook2010MAPIHeaders.exe that was previously available
from MSDN. No differences were found that affect the code (mostly whitespace).

MIT License

Copyright (c) 2018 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

 IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

repository: mozilla/releases-comm-central

repo_name: mozilla/releases-comm-central


text:
## Summary

**mruby_nginx_module** is the powerful extension by mruby for Nginx.

## Concept

The concept of **mruby_nginx_module** is following.

 * Give developers to develop nginx module by mruby
 * Usability that higher affinity with Nginx
 * More features

## Examples

```nginx
location /mruby {
    mruby_content_handler_code "
        sum = 0
        (1..10).each { |i| sum += i }
        Nginx.rputs(sum.to_s + "\n") #=> 55
    ";
}
```

## How to use

Please see [Documents](http://cubicdaiya.github.io/mruby_nginx_module/).

## Dependencies

  - [Nginx](http://nginx.org/)
  - [mruby](https://github.com/mruby/mruby)
  - [ngx_devel_kit](https://github.com/simpl/ngx_devel_kit) (optional)

## Build

```sh
hg clone http://hg.nginx.org/nginx/
https://github.com/cubicdaiya/mruby_nginx_module.git
cd mruby_nginx_module
git submodule update --init
cd mruby
rake ENABLE_GEMS="true" CFLAGS="-O2 -fPIC"
cd ../../nginx
./configure --with-pcre --add-module=../mruby_nginx_module
make
make install
```

If you want to use **mruby_set** and **mruby_set_code**, you may embed [ngx_devel_kit](https://github.com/simpl/ngx_devel_kit) when executing configure with --add-module.

## Difference from ngx_mruby

**mruby_nginx_module** is forked from [ngx_mruby](https://github.com/matsumoto-r/ngx_mruby) at July 2013.

Though I used to develop [ngx_mruby](https://github.com/matsumoto-r/ngx_mruby) with ngx_mruby's developers,
what I want to develop were gradually departured from what they want to develop.

What I want to develop are as previously noted concepts.

 * Give developers by mruby to develop nginx module
 * Usability that higher affinity with Nginx
 * More features

[ngx_mruby](https://github.com/matsumoto-r/ngx_mruby) is a part of unified web server extension developing support institution(like mod_mruby).

But what I want to develop is the product that is more specialized for Nginx.

To that end **mruby_nginx_module** needs to equip more features than **ngx_mruby** and I must implement drastic mechanism.

In detail, **mruby_nginx_modules** has the following features currently. These are not included in **ngx_mruby**.

 * Regexp
  * built-in regular expression engine
 * Nginx::Context
  * hash table for sharing data in each request processing phase
 * Nginx::Time
  * Nginx time API binding
 * Nginx::Digest
  * Nginx Digest API binding
 * Nginx::Base64
  * Nginx Base64(en|de)coding API binding
 * mruby_require
  * The directive for requiring external mruby script

Additionally I'm going to implement the following features.

 * Nginx::Shared
  * Nginx shared memory API biding
 * Nginx::Subrequest
  * Nginx sub-request API biding
 * Nginx::Socket
  * Nginx non-blocking socket API biding

## How to test

Execute the following command. Note that [echo-nginx-module](https://github.com/agentzh/echo-nginx-module) is requierd.

```sh
rake NGINX_BIN=#{nginx_bin}
```

The default NGINX_BIN is */usr/sbin/nginx*.


text:
What is it?
===========
`imageRotator.js` is a lightweight (1 KB) [jQuery][] plugin that crossfades through a series of images.

Dependencies
============
`imageRotator.js` uses the [jQuery][] library for DOM manipulation.

How do I use it?
================

1. Create a `<div>` with `<img>` tags for all the images you would like to display.
2. Create a jQuery object for the `<div>`, and invoke the `imageRotator()` method on it to instantiate and return the image rotator. Optional: pass configuration parameters to specify animation timing.
3. Call the `start()` method on the image rotator to start cycling through the images.

For example:
```javascript
var $imageDiv = $("#imageRotator");
var $imageRotator = $imageDiv.imageRotator({
    imageTime: 3000,
    fadeTime: 2000
});
$imageRotator.start();
```

Function reference
==================

Options and Defaults
--------------------
The `imageRotator()` method optionally takes an options object that you can use to specify animation timings.

* **imageTime**: The total amount of time (in milliseconds) that each image will be displayed. The default is 1 second.
* **fadeTime**: The amount of time (in milliseconds) for the crossfade animation. This value should be less than or equal to image time. The default is 0.5 seconds.

Alternatively, if you decide you want *all* new instances of `imageRotator` to use the same timing, then you can set default values. For example:

```javascript
$.fn.imageRotator.defaults.imageTime = 2000;
```

`imageRotator` Methods
----------------------

###imageRotator(options)###
Creates a new image rotator and binds it to the `<div>` on which this method is called. If invoked more than once on the same jQuery object, will return a single instance; however, if you create a new jQuery object for the same div, you will end up with more than one image rotator.

**parameters**
*options* (object): Configuration options for the image rotator instance. See "Options and Defaults" for details.

**returns**
The image rotator instance.

###getOptions()###
Retrieves the options for this image rotator instance.

**parameters**
(none)

**returns**
An object containing the configuration parameters for the instance.

###getImages()###
Returns an array of jQuery objects, each wrapping one of the `<img>` tags within the image rotator `<div>`.

**parameters**
(none)

**returns**
An array of jQuery-wrapped `<img>` elements.

###getCurrentIndex()###
Determines the current index (i.e., currently displayed image) within the image rotator.

**parameters**
(none)

**returns**
An integer pointing to the index of the image currently being displayed. The value will be -1 if there are no images to display.

###setCurrentIndex(index)###
Sets the control's current index property and displays the image at that index. If the requested index is outside the upper bound of the image array, the last image will be displayed. If the requested image is outside the lower bound of the image array (i.e., negative), then no image will be displayed.

**parameters**
*index* (integer): The new desired index for the control.

**returns**
(none)

###start()###
Initiates animation. Once started, changes to the rotator options will not affect the animation unless you stop and then restart the animation.

**parameters**
(none)

**returns**
(none)

###stop()###
Stops animation.

**parameters**
(none)

**returns**
(none)

###refresh()###
Refreshes the control's list of images. Call this method if you modify the contents of the image rotator `<div>`. NOTE: it is unsafe to remove an image from the `<div>` while the animation is in progress. It is therefore best practice to call the `stop()` method before modifying the `<div>` contents, and then call `start()` again once you are finished making changes.

**parameters**
(none)

**returns**
(none)

License
=======
`imageRotator.js` is free to use under the MIT license, which is included at the top of the un-minified version of the source. If you use the un-minified version, please include the license text as provided.

I wrote this plugin while working for [Intuit][]'s [QuickBase][] team; Intuit is the copyright holder.

[jQuery]: http://jquery.com/
[Intuit]: http://www.intuit.com/
[QuickBase]: http://quickbase.intuit.com/

repository: ken-sayama/imageRotator

repo_name: ken-sayama/imageRotator


text:
# Troubleshooting

If you have problems you can try:

- Running Clean in Xcode.
- Deleting Xcode's derived data.
- Removing `node_modules` then reinstalling dependencies. (`rm -rf node_modules && yarn`)
- Clearing watchman's watches. (`watchman watch-del-all`)
- Clearing React Native's packager cache. (`react-native start --reset-cache`)
- Clearing React Native's iOS build folder. (`rm -rf ios/build`)
- Updating Pod repos. (`cd ios && pod repo update`)
- Reinstalling Pods. (`cd ios && pod install`)

repository: sabinayakc/react-native-fast-image

repo_name: sabinayakc/react-native-fast-image


text:
# file-metadata-manager

A simple web-based file and file metadata management admin system.

## Overview

This standalone admin web app can be used to manage (add/remove/update) file system stored assets, while at the same time manage any associated (custom) metadata. Custom metadata fields are defined via config files. When adding/updating files, metadata can be added/updated as well. All metadata is database stored, so it can be easily retrieved by any third party system that needs to work with this metadata. This system just provides a way to manage files and their associated metadata; it doesn't provide any additional functionality for using the stored files and metadata.

## Technical

- Meteor based web app built using React for the view layer.
- Works with Mongo DB to store file metadata.
- Works with any custom file system location to store uploaded files.

## Installation

Make sure you have [Meteor](https://www.meteor.com/install) installed, then:

```
git clone https://github.com/hwillson/file-metadata-manager.git
cd file-metadata-manager
meteor npm install
meteor
```

The running application can then be accessed at: [http://localhost:3000/files]()

## Testing

Unit tests can be run with `meteor npm test`, then by visiting [http://localhost:3100]().

## Settings

Application settings (stored in `config/settings.json`) are explained below:

```json
{
  "public": {
    TODO
  },
  "private": {
    TODO
  }
}
```

repository: hwillson/file-metadata-manager

repo_name: hwillson/file-metadata-manager


text:
# discord-akka

A [Discord](http://discordapp.com) client for Scala+Akka.

Currently under development.

## Features

* Provides an actor that maintains client state.
* Notifies a listener actor on message events.

### TODO

* Everything else.

## Building

Use [sbt](http://www.scala-sbt.org) to build and test.

## Dependencies

* Scala 2.11
* [Akka HTTP Experimental](http://akka.io) - Currently requires a snapshot.

## License

This project is licensed under the [MIT License](LICENSE)

repository: eaceaser/discord-akka

repo_name: eaceaser/discord-akka


text:
---
layout:     post
title:      Spring Security - Authentication with a Database-backend UserDetailsService
subtitle:   Understanding Spring Security Context Propagation
date:       2019-01-18
author:     Mr.Humorous 🥘
header-img: img/springFramework/header.jpg
catalog: true
tags:
    - Spring Framework
    - Spring MVC
---

## 1. Overview
The example to create a custom database-backend _UserDetailsService_ for authentication with Spring Security is on [Github](https://github.com/eugenp/tutorials/tree/master/spring-security-mvc-boot).

## 2. UserDetailsService
The _UserDetailsService_ interface is used to retrieve user-related data. It has one method named _loadUserByUsername()_ which finds a user entity based on the username and can be overridden to customize the process of finding the user.

It is used by the _DaoAuthenticationProvider_ to load details about the user during authentication.

## 3. The User Model
For storing users, we will create a _User_ entity that is mapped to a database table, with the following attributes:
```java
@Entity
public class User {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    @Column(nullable = false, unique = true)
    private String username;

    private String password;

    //standard getters and setters
}
```

## 4. Retrieving a User
For the purpose of retrieving a user associated with a username, we will create a _DAO_ class using _Spring Data_ by extending the _JpaRepository_ interface:
```java
public interface UserRepository extends JpaRepository<User, Long> {

    User findByUsername(String username);
}
```

## 5. The UserDetailsService
In order to provide our own user service, we will need to implement the _UserDetailsService_ interface.

We’ll create a class called _MyUserDetailsService_ that overrides the method _loadUserByUsername()_ of the interface.

In this method, we retrieve the _User_ object using the DAO, and if it exists, wrap it into a _MyUserPrincipal_ object, which implements _UserDetails_, and returns it:
```java
@Service
public class MyUserDetailsService implements UserDetailsService {

    @Autowired
    private UserRepository userRepository;

    @Override
    public UserDetails loadUserByUsername(String username) {
        User user = userRepository.findByUsername(username);
        if (user == null) {
            throw new UsernameNotFoundException(username);
        }
        return new MyUserPrincipal(user);
    }
}
```

The _MyUserPrincipal_ class is defined as follows:
```java
public class MyUserPrincipal implements UserDetails {
    private User user;

    public MyUserPrincipal(User user) {
        this.user = user;
    }
    //...
}
```

## 6. Spring Configuration

## 6.1. Annotation Configuration
Using Spring annotations, we will define the _UserDetailsService_ bean, and set it as a property of the _authenticationProvider_ bean, which we inject into the _authenticationManager_:
```java
@Autowired
private MyUserDetailsService userDetailsService;

@Override
protected void configure(AuthenticationManagerBuilder auth)
  throws Exception {
    auth.authenticationProvider(authenticationProvider());
}

@Bean
public DaoAuthenticationProvider authenticationProvider() {
    DaoAuthenticationProvider authProvider
      = new DaoAuthenticationProvider();
    authProvider.setUserDetailsService(userDetailsService);
    authProvider.setPasswordEncoder(encoder());
    return authProvider;
}

@Bean
public PasswordEncoder encoder() {
    return new BCryptPasswordEncoder(11);
}
```

## 6.2. XML Configuration
For the XML configuration, we need to define a bean with type _MyUserDetailsService_, and inject it into Spring’s _authentication-provider_ bean:
```xml
<bean id="myUserDetailsService"
  class="org.baeldung.security.MyUserDetailsService"/>

<security:authentication-manager>
    <security:authentication-provider
      user-service-ref="myUserDetailsService" >
        <security:password-encoder ref="passwordEncoder">
        </security:password-encoder>
    </security:authentication-provider>
</security:authentication-manager>

<bean id="passwordEncoder"
  class="org.springframework.security
  .crypto.bcrypt.BCryptPasswordEncoder">
    <constructor-arg value="11"/>
</bean>
```