text:
---
layout: post
title: Speeding up your UI5 app with a Component preload file
tags:
- grunt
- openui5
- performance
- preload
---

**[30 Days of UI5](/blog/posts/2015/07/04/30-days-of-ui5/) — Day 14 by [John Murray](http://jmurray.me/)**

In this post we’ll be looking at how you can speed up the load times of your UI5 applications by using a Component preload file. Those of you who are familiar with SAP Fiori applications will probably already know what a Component preload file is, however those of you who aren’t will almost definitely have all seen a reference to this file before. This file is referenced in an error message that appears in the console whenever you load a UI5 app, which is lacking a Component preload file.

![Chrome preload error]( {{ "/images/2018/02/Screen-Shot-2015-07-14-at-20.54.47-624x31.png" | url }})

**So just what is this preload file and why should I care?**

The preload file is essentially all of the files which make up your application, so that’s the Component itself, Controllers, Views, Fragments and so on, all compressed and inserted into one file, the preload file. If this file exists then UI5 will only load that file, and it won’t load of all of the other various files which it ordinarily would have done. The error we saw earlier is caused because UI5 looks for a preload file early in the execution flow, but of course did not find one, and so carried on loading all of the files individually.

Now that we’ve cleared up what the file actually is, and why that error appears, just why should exactly should we worry about it? After all we’ve ignored that error up until now and all our apps have worked just fine. Well, the reason we should care is that it dramatically decreases page load time. This is due to the app only having to make one call to get the preload file, rather than all of the individual calls for each file, but also because in the preload file the code is “minified”, which means the file size is also very small relative to the full size individual files. This is especially important when developing UI5 applications which are to be used over a mobile data connection, where size has a very large impact on initial load performance. As an anecdotal example, on the simple UI5 app which I have just created a preload file for my initial load time went from 8-9 seconds down to 3-4 seconds, which is tremendous improvement!

**Sounds great! So how can I make a preload file for my UI5 app?**

For this next section you will need to have installed on your machine [NodeJS](https://nodejs.org/), [npm](https://www.npmjs.com/) and [Grunt](http://gruntjs.com/). If you don’t know how to install and use these things then do [reach out to me on Twitter](http://twitter.com/johnbmurray).

After you have all of the above installed, you’ll need to create a `package.json` file in your UI5 app’s root directory. Open the file up and paste in the contents below and don’t forget to edit them accordingly:

```javascript
{
  "name": "barcode-test",
  "version": "0.0.1",
  "description": "",
  "main": "index.html",
  "author": "John Murray",
  "license": "Apache License, Version 2.0",
  "devDependencies": {
    "grunt": "^0.4.5"
  }
}
```

After creating and saving this file, install the [Grunt OpenUI5 tools](https://github.com/SAP/grunt-openui5) which are made by the UI5 team at SAP. To install these tools open a terminal session in your UI5 root directory and run this command ‘npm install grunt-openui5 –save-dev’. This will download and install the tools, and also add them to the “devDependencies” section of your ‘package.json’ file.

Next, again in the UI5 app root directory, create a file called ‘Gruntfile.js’. Into this file copy and paste the contents below, and we’ll go through what it all means in a moment.

```javascript
module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    openui5_preload: {
      component: {
        options: {
          resources: {
            cwd: '',
            prefix: '',
            src: [
              'webapp/**/*.js',
              'webapp/**/*.fragment.html',
              'webapp/**/*.fragment.json',
              'webapp/**/*.fragment.xml',
              'webapp/**/*.view.html',
              'webapp/**/*.view.json',
              'webapp/**/*.view.xml',
              'webapp/**/*.properties'
            ]
          },
          dest: '',
          compress: true
        },
        components: true
      }
    }
  });

  grunt.loadNpmTasks('grunt-openui5');

}
```

This is quite a simple example but it will suffice in most use cases. What we are doing here first of all is reading in the ‘package.json’ file created earlier which provides the dependency list. Then we are setting the configuration options for ‘openui5_preload’ which is the specific tool we are going to be using from the OpenUI5 toolset.

- The ‘cwd’ parameter allows you to provide a base directory for finding the files and the ‘prefix’ parameter lets you prefix all files with a path of your choosing; in this instance we are not using either of these parameters so we are leaving them blank.
- The ‘src’ parameter lets you provide an array of paths, which it will use to try and match files in your directory and then for those matches it will minify and add them to the preload. I have all of my UI5 application files within a subdirectory called ‘webapp’ which is why my paths all begin with ‘webapp’. I have all my UI5 files located in this directory because I can then keep all of my other files and folders such as ‘node_modules’, PhoneGap config files, IDE folders, etc back in the root directory. I do this because it allows me to use this simple “get everything” approach you see above in the ‘src’ without worrying about accidentally including non-UI5 app files.
- The ‘dest’ parameter specifies the path to the destination you wish to save the preload file. In this case we just want to save it in the same place as the `Component.js` file and therefore can leave it blank.
- The ‘compress’ parameter sets whether or not you wish to minify the files as well as add them to the preload file. I would personally recommend always setting this to ‘true’ unless you have a good reason not to.
- The ‘components’ parameter here with a value of ‘true’ sets the tool to automatically find all components and create a preload for each.

Finally, we load the ‘grunt-openui5′ toolkit from the plugin as previously installed and specified in ‘package.json’.

*For the full documentation and parameter list I’d recommend looking at the [Grunt OpenUI5 tools](https://github.com/SAP/grunt-openui5) GitHub page.*

That’s all the configuration set up, now it’s time to generate our preload file! Fire up a terminal session in the same directory as your ‘Gruntfile.js’ and run the following command ‘grunt openui5_preload’ and you should see the following output along with a ‘Component-preload.js’ file alongside your ‘Component.js’ file.

![preload generation output]( {{ "/images/2018/02/Screen-Shot-2015-07-15-at-00.48.10-624x88.png" | url }})

**Final thoughts**

Congratulations, you’ve just made your first preload file and are now well on the way to creating even better apps with UI5!


text:
---
title: MySQLTuner mentioned at the O’Reilly MySQL Conference
author: Major Hayden
type: post
date: 2011-04-16T01:56:31+00:00
url: /2011/04/15/mysqltuner-mentioned-at-the-oreilly-mysql-conference/
dsq_thread_id:
  -<PHONE_NUMBER>
categories:
  - Blog Posts
tags:
  - command line
  - database
  - mysql
  - mysqltuner
  - perl

---
<iframe title="YouTube video player" width="560" height="349" src="http://www.youtube.com/embed/L1V5T5rknq0?rel=0#t=14m40s" frameborder="0" allowfullscreen></iframe>

If you push play, the video should scoot out to about the 14m40s mark where MySQLTuner appears on one of the slides. Thanks to [Trent Hornibrook][1] for letting me know!

 [1]: http://twitter.com/#!/trenthornibrook

branch_name: refs/heads/main

extension: md

license_type: permissive


text:
# random_choices

This is similar in functionality to `random.choices` built into the standard Python library,
with improvements to speed and readability.

## Why this over `random.choices`?

First off, it improves readability over even a simple implementation of `random.choices`. Let's say
I have four choices, each with the same probability of being picked except the last, which has
double the relative probability of being picked. This is how one would use `random.choices` to
accomplish this:

```python
import random

population = ["first choice", "second choice", "third choice", "fourth choice"]
weights = [1.0, 1.0, 1.0, 2.0]

result = random.choices(population=population, weights=weights, k=1)
```

The main problem with this solution is that the weights are not visually represented alongside the
values to be picked. This decreases readability, and forces the reader to speculate that the indices
of the population members and weights are significant.

A secondary problem is that if you need to pick again and neither the population nor weights have
changed, you'll find internally that a lot of unnecessary calculation is done. Namely, the
accumulation of the weights.

`random_choices` solves both of these problems, allowing the population to be initialized
visually alongside their weights and caching the calculation-intensive steps so that if
you have to make another selection when the population or weights have not changed there will
not be a significant increase in runtime.

## How do I use it?

This is a simple solution to the above problem:

```python
from random_choices import Randomizer, WeightedChoice

population = [
    WeightedChoice("first choice",  weight=1.0),
    WeightedChoice("second choice", weight=1.0),
    WeightedChoice("third choice",  weight=1.0),
    WeightedChoice("fourth choice", weight=2.0)
]
randomizer = Randomizer(population)

randomizer.choices(1, replace=True)
```

license: MIT


text:
[![Build Status](https://travis-ci.org/OpenTSDB/opentsdb-rpc-kafka.svg?branch=master)](https://travis-ci.org/OpenTSDB/opentsdb-rpc-kafka) [![Coverage Status](https://coveralls.io/repos/github/OpenTSDB/opentsdb-rpc-kafka/badge.svg?branch=master)](https://coveralls.io/github/OpenTSDB/opentsdb-rpc-kafka?branch=master)

# Kafka RPC Plugin

This plugin allows OpenTSDB to consume messages from a Kafka cluster and write them directly to storage, bypassing the Telnet style or HTTP APIs. It includes a Storage Exception Handler plugin that will post messages back to a Kafka queue if writing to storage fails.

**NOTE:** This branch is compatible with OpenTSDB 2.4.x. For 2.3.x please use the `2.3` branch from Git.

## Installation

1. Download the source code and run ``mvn package -Pshaded`` to create the shaded jar in the ``target/`` directory. Copy this file to your OpenTSDB plugin directory as defined in the opentsdb config via ``tsd.core.plugin_path`` (Note that without the `-P` flag it will simply build a basic jar without the Kafka libraries. Those will need to be on your class path.).
1. Setup the appropriate Kafka topics and partitions. More on that later.
1. Add configuration settings to your ``opentsdb.conf`` file as described later on.
1. Restart the TSD and make sure the plugin was loaded and associated with the proper ID. E.g. look in the logs for lines like:

```
2017-07-10 23:08:58,264 INFO  [main] RpcManager: Successfully initialized plugin [net.opentsdb.tsd.KafkaRpcPlugin] version: 2.4.0
2017-07-10 23:08:57,790 INFO  [main] TSDB: Successfully initialized storage exception handler plugin [net.opentsdb.tsd.KafkaStorageExceptionHandler] version: 2.4.0

```

## Usage

The plugin can accept various message formats using classes implementing the `net.opentsdb.data.deserializers.Deserializer` interface. A `Deserializer` must be defined per consumer group and all messages in the topics must be of the same format.

For default JSON formatted messages, use the `net.opentsdb.data.deserializers.JSONDeserializer`. Each JSON message *must* include a ``type`` field with the value being one of the following:

* **Metric** A single numeric measurement.
* **Aggregate** A single numeric measurement that may be a pre-aggregate, a rolled up data point or both.
* **Histogram** A single histogram measurement.

Each message is similar to the HTTP JSON messages in the OpenTSDB API with the addition of the ``type`` field so that the JSON deserializer can figure out what the message contains.

The deserialization class must return a list of typed objects as defined below (with JSON provided as an example).

###Metric

The metric message appears as follows:

```javascript
{
	"type": "Metric",
	"metric": "sys.cpu.user",
	"tags": {
		"host": "web01"
	},
	"timestamp":<PHONE_NUMBER>,
	"value": 42
}

```

For field information, see [/api/put] (http://opentsdb.net/docs/build/html/api_http/put.html).

###Aggregate

Aggregate messages are the same as those documented in [/api/rollup] (http://opentsdb.net/docs/build/html/api_http/rollup.html).

###Histogram

Histogram messages are documented at [/api/histogram] (http://opentsdb.net/docs/build/html/api_http/histogram.html).

## Configuration

The following properties can be stored in the ``opentsdb.conf`` file:

|Property|Type|Required|Description|Default|Example|
|--------|----|--------|-----------|-------|-------|
|tsd.rpc.plugins|String|Required|The full class name of the plugin. This must be ``net.opentsdb.tsd.KafkaRpcPlugin``||net.opentsdb.tsd.KafkaRpcPlugin|
|KafkaRpcPlugin.kafka.zookeeper.connect|String|Required|The comma separated list of zookeeper hosts and ports used by the Kafka cluster.||localhost:2181|
|KafkaRpcPlugin.groups|String|Required|A comma separated list of one or more consumer group names.||TsdbConsumer,TsdbRequeueConsumer|
|KafkaRpcPlugin.\<GROUPNAME\>.topics|String|Required|A comma separated list of one or more topics for the ``<GROUPNAME>`` to consume from.||TSDB_1,TSDB_2|
|KafkaRpcPlugin.\<GROUPNAME\>.consumerType|String|Required|The type of messages written to the queue. TODO. For now, leave it as ``raw``||raw|
|KafkaRpcPlugin.\<GROUPNAME\>.deserializer|String|Required|The deserialization class to use for parsing messages from the Kafka topic.||net.opentsdb.data.deserializers.JSONDeserializer|
|KafkaRpcPlugin.\<GROUPNAME\>.rate|Integer|Required|How many messages per second to throttle the total of consumer threads at for the consumer group||250000|
|KafkaRpcPlugin.\<GROUPNAME\>.threads|Integer|Required|The number of consumer threads to create per group||4|
|tsd.http.rpc.plugins|String|Optional|A comma separated list of HTTP RPC plugins to load. Included with this package is a plugin that allows for fetching stats from the Kafka plugin as well as viewing or modifying the write rate during runtime.||net.opentsdb.tsd.KafkaHttpRpcPlugin|
|tsd.core.storage\_exception\_handler.enable|Boolean|Optional|Whether or not to enable the storage exception handler plugin.|false|true|
|tsd.core.storage\_exception\_handler.plugin|String|Optional|The full class of the storage exception handler plugin.||net.opentsdb.tsd.KafkaStorageExceptionHandler|
|KafkaRpcPlugin.kafka.metadata.broker.list|String|Optional|The comma separated list of Kafka brokers and ports used to write messages to for the storage exception handler plugin||localhost:9092|
|KafkaRpcPlugin.seh.topic.default|String|Optional|The topic used to write messages to for the storage exception handler.||TSDB_Requeue|

Note the ``KafkaRpcPlugin.groups`` and ``<GROUP_NAME>`` entries above. Kafka consumers belong to a particular group. The Kafka RPC plugin can launch multiple groups consuming from multiple topics so that OpenTSDB messages can be organized by type or source for more efficient control over rate limits and priorities. When setting the ``KafkaRpcPlugin.groups`` value, make sure you have a complete set of ``KafkaRpcPlugin.<GROUP_NAME>.*`` parameters per group or initialization will fail.

## Testing

To generate some test data, you can run the `KafkaDummyDataGenerator` method
passing in a config via `--config=dummy.conf`. It will write 5 metrics with 5
different hostnames every minute by default. And example config to tell it to
write to Kafka every 15 seconds is:

```
kafka.dummyProducer.topic=test
kafka.dummyProducer.kafka.metadata.broker.list=localhost:9092
kafka.dummyProducer.frequency=15s
```

Data is written in a format for the `JSONDeserializer` to parse.

repository: OpenTSDB/opentsdb-rpc-kafka

branch_name: refs/heads/master

gha_language: Java

repo_name: OpenTSDB/opentsdb-rpc-kafka


text:
Artifactory Build Promotion User Plugin
=======================================

A REST executable build promotion.

This plugin promotes a snapshot build to release. It does the following:

1. The build is copied with a "-r" suffix added to the build number to indicate
   release.
2. The produced artifacts and the dependencies are copied to the target release
   repository and renamed from snapshot to release version (using the repository
   layout or the snapExp parameter).
3. Descriptors (ivy.xml or pom.xml) are modified by replacing the versions from
   snapshot to release (including dependencies) and deployed to the target
   release repository.

Parameters
----------

- snapExp - Snapshot version regular expression. This is used as a fallback to
  determine how to transform a snapshot version string to a release one, in case
  repository layout information can't be used for this purpose (e.g. the layout
  doesn't match).
- targetRepository - The name of the repository to put the promoted build
  artifacts into.

For example:

For Artifactory 4.x:

`curl -X POST -uadmin:password http://localhost:8080/artifactory/api/plugins/build/promote/snapshotToRelease/gradle-multi-example/1?params=snapExp=d%7B14%7D|targetRepository=gradle-release-local`

For Artifactory 5.x:

`curl -X POST -uadmin:password http://localhost:8080/artifactory/api/plugins/build/promote/snapshotToRelease/gradle-multi-example/1?params=snapExp=d%7B14%7D;targetRepository=gradle-release-local`

repository: jfrog/artifactory-user-plugins

gha_language: Groovy

repo_name: jfrog/artifactory-user-plugins


text:
# Welcome to ProxyBuilder
# Welcome to ProxyBuilder

Here we will describe the ProxyBuilder
from [github.com/ProxyBuilder/proxybuilder](https://github.com/ProxyBuilder/proxybuilder)

## What are Proxies ?
If you want to have an overview of the Proxy-Pattern itself I can recommend
the following sources.

[JavaOne 2015 Tutorial - Proxy DeepDive](https://de.slideshare.net/svenruppert/proxy-deepdive-javaone20151027001)

## What goal we want to reach?
This project was born, because I had to work a lot with old huge projects. The only thing I could rely on, is the pure JDK.
So I started playing with different Design Patterns and figured out, that Proxies are one of the most powerful pattern group for me.
During the time I was writing the german Book ***"Dynamic Proxies"*** with [Dr. Heinz Kabutz](http://www.javaspecialists.eu/) I started to write examples. Step by step the examples are more generic and the ***ProxyBuilder*** - project was born.

## Some Examples
To have an idea what you could do with the ***ProxyBuilder*** I will show here some examples. The more detailed
information you can find in the special sections of this website. This project is based on ***Java8***.

### Some Examples with DynamicProxies
Here are some examples based on the ***DynamicProxy***. But we have created ***generated static*** versions too...
#### Virtual Proxy
```java
final DemoLogic original = new DemoLogic();
final DemoInterface demoLogic = VirtualProxyBuilder
        .createBuilder(DemoInterface.class, original)
        .build();
```

#### Security Proxy
```java
final DemoLogic original = new DemoLogic();
final DemoInterface demoLogic = VirtualProxyBuilder
        .createBuilder(DemoInterface.class, original)
        .addSecurityRule(() -> false)
        .build();
```

```java
final InnerDemoClass original = new InnerDemoClass();
    final InnerDemoInterface demoLogic = VirtualProxyBuilder
        .createBuilder(InnerDemoInterface.class, original)
        .addSecurityRule(() -> true)
        .addSecurityRule(() -> true)
        .addSecurityRule(() -> false)
        .build();
```

#### Metrics Proxy
```java
    final InnerDemoClass original = new InnerDemoClass();
    final InnerDemoInterface demoLogic = VirtualProxyBuilder
        .createBuilder(InnerDemoInterface.class, original)
        .addMetrics()
        .build();

```

## How to bootstrap your project?
If you want to be as near as possible at the actual development version, you could use this. If you need a more stable version
change the version numbers to the last stable one.

If you want to start with the ***DynamicProxyBuilder*** creating for example ***VirtualProxies*** bundled with some other things
you need the following dependency in your pom.xml:

```xml
    <dependency>
      <groupId>org.rapidpm.proxybuilder</groupId>
      <artifactId>rapidpm-proxybuilder-modules-dynamic</artifactId>
      <version>${rapidpm.version}</version>
    </dependency>
```

The ***ProxyBuilder*** includes the ***Kotlin*** runtime libs and ***Metrics*** from Dropwizard.

### VirtualProxy with one PreAction
This will be a ***VirtualProxy*** with a ***PreAction***. You can add as many ***PreActions*** as you need.
Every ***PreAction*** will be executed before every method invocation in the order the ***PreAction*** was added.

```java
public class ProxyDemoV001 {

  public static void main(String[] args) {

    final Service service = DynamicProxyBuilder
        .createBuilder(Service.class, new ServiceImpl())
        .addIPreAction((original, method, args1)
                        -> System.out.println(" PreAction = " + System.nanoTime()))
        .build();

    System.out.println("proxy created " + System.nanoTime());
    System.out.println("s = " + service.doWork("Go.."));
  }

  public interface Service {
    String doWork(String str);
  }

  public static class ServiceImpl implements Service {
    public ServiceImpl() {
      System.out.println(" ServiceImpl => constructor... " + System.nanoTime());
    }

    @Override
    public String doWork(final String str) {
      return str + " orig..";
    }
  }

}

```

### VirtualProxy with Metrics

```java
public class ProxyDemoV002 {

  public static void main(String[] args) {
    RapidPMMetricsRegistry.getInstance().startConsoleReporter();

    final Service service = DynamicProxyBuilder
        .createBuilder(Service.class, new ServiceImpl())
        .addMetrics()
        .build();

    System.out.println("proxy created " + System.nanoTime());
    final long count = IntStream.range(0, 10_000_000)
        .boxed()
        .map(i -> service.doWork("Go.." + i))
        .count();
    System.out.println("s = " + service.doWork("Go.."));
    System.out.println("count = " + count);
  }

  public interface Service {
    String doWork(String str);
  }

  public static class ServiceImpl implements Service {
    public ServiceImpl() {
      System.out.println(" ServiceImpl => constructor... " + System.nanoTime());
    }
    @Override
    public String doWork(final String str) {
      return str + " orig..";
    }
  }
}
```

To bootstrap your project with the latest SNAPSHOT you need to add the SNAPSHOT-repository that is available at maven - central.
Here our ***TeamCity*** will push regularly the binaries.
If you are using maven you could add the following to your ***settings.xml*** to get the snapshots that are available at maven-central.

```xml
   <profile>
      <id>allow-snapshots</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <repositories>
        <repository>
          <id>snapshots-repo</id>
          <url>https://oss.sonatype.org/content/repositories/snapshots</url>
          <releases>
            <enabled>false</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
          </snapshots>
        </repository>
      </repositories>
    </profile>
```

# Static Proxies
Compared to the DynamicProxies we are now generating static proxies. This could be done with
***AnnotationProcessing*** during the compile process or at runtime.

## Generated
Using ***AnnotationProcessing*** to generate the Proxies will give you the possibility to get
proxies without the overhead of Reflection. On the other side you will generate maybe a lot of code, that must be compiled.

## Runtime Generated
Compared to the way of using ***AnnotationProcessing*** this one will create and compile at runtime the static proxies. This
is possible if you have access to the Compiler (tools.jar) during runtime and will mostly lead you to use Unsafe to put your new classes to the SystemClassLoader.

## Static Generated VirtualProxy
With the Annotation ***@StaticVirtualProxy*** you can generate Static - VirtualProxies during the clean compile process. This Annotation have a parameter called ***strategy***. The Strategy is used to define the right time to call the ***InstanceFactory***
See [DynamicProxies - CreationStrategies](/dynamicproxy/#creationstrategies)

## Static Generated MetricsProxy
With the static ***MetricsProxy*** we will get generated MetricsProxies that are using Dropwizard-Metrics to measure the
usage of the methods. The generated static MetricsProxies are generating Methods for all declared Methods in the inheritance including ***hashCode()*** and ***equals()***. You can use the Annotation  ***@StaticMetricsProxy*** in combination with interfaces and classes.

There is one difference between the generated classes based on interfaces and classes. If you annotate an interface you will only get Metrics for the declared Methods, not for ***hashCode*** and ***equals*** if it is not explicitly declared. But for annotated classes you will get the Metrics for methods from Object, too.

```java
@StaticMetricsProxy
public interface Service {
  String doWork(String txt);

  String doMoreWorkA(String txt);

  String doMoreWorkB(String txt);

  String doMoreWorkC(String txt);

  String doMoreWorkD(String txt);
}
```

You can use the MetricsProxy easily by creating an instance and setting the Delegator. After this
every Methodcall will be counted by DropwizardMetrics. For every Method, you will get a separate Histogram, named with the full Classname and Methodname. In my case you will get a Histogram with the name
***org.rapidpm.demo.proxybuilder.staticproxy.v002.Service.doMoreWorkC***

```java
    final ServiceStaticMetricsProxy proxy = new ServiceStaticMetricsProxy();
    proxy.withDelegator(new ServiceImpl());

    final Service service = proxy;

    RapidPMMetricsRegistry.getInstance().startConsoleReporter();
    try (final IntStream intStream = IntStream.range(0, 10_000_000)) {
      intStream
          .onClose(() -> out.println("Stream will be closed now..."))

          .forEach(i -> service.doMoreWorkC("aaahhhhhh " + i));
    }

    RapidPMMetricsRegistry
        .getInstance()
        .getMetrics()
        .getHistograms()
        .forEach((s, histogram) -> {
          out.println("s = " + s);
          out.println("histogram - get999thPercentile= " + histogram.getSnapshot().get999thPercentile());
        });
```

## Static Generated LoggingProxy
Quite often I could find source code like the following.
```java
public void doWork(String str){
    logger.debug("doWork -> " + str);
    //some work....
}
```

The target is a logging of the methodcalls and the values. OK, we don´t want to discuss why or why not. But if you have to do it, you could
now use the ***LoggingProxy***. The Logging is implemented with ***slf4j***. Every method call will be logged with
the methodname, the name of the params and the param values itself. With this information you could find the corresponding source code very easy.

Based on the following definition of a method...
```java
    public <T extends List> T unwrapList(final T type, final String str);
```
you will get an implementation like the follwoing.

```java
  public <T extends List> T unwrapList(final T type, final String str) {
    if (logger.isInfoEnabled()) {
      logger.info("delegator.unwrapList(type, str) values - " + type + " - " + str);
    }
    T result = delegator.unwrapList(type, str);
    return result;
  }
```

This implementation will asume, that the values are using a proper ***toString()*** implementation itself.

If you want to generate a StaticLoggingProxy, please add the Annotation ***@StaticLoggingProxy*** to the target class or interface.

Here you will get the full example.
```java
@StaticLoggingProxy
public interface MyLoggingInterface {
  <T extends List> T unwrapList(T type, String str);
}

//generated code
@Generated(
    value = "StaticLoggingProxyAnnotationProcessor",
    date = "2016-05-09T14:40:56.22",
    comments = "www.proxybuilder.org"
)
@IsGeneratedProxy
@IsLoggingProxy
public class MyLoggingInterfaceStaticLoggingProxy implements MyLoggingInterface {
  private static final Logger logger = getLogger(MyLoggingInterface.class);

  private MyLoggingInterface delegator;

  public MyLoggingInterfaceStaticLoggingProxy withDelegator(final MyLoggingInterface delegator) {
    this.delegator = delegator;
    return this;
  }

  public <T extends List> T unwrapList(final T type, final String str) {
    if(logger.isInfoEnabled()) {
      logger.info("delegator.unwrapList(type, str) values - " + type + " - " + str);
    }
    T result = delegator.unwrapList(type, str);
    return result;
  }
}

// demo code usage
public class MainV008 {
  public static void main(String[] args) {
    final MyLoggingInterface demo
        = new MyLoggingInterfaceStaticLoggingProxy()
        .withDelegator(new LoggerExample());
    final List<Integer> list = demo.unwrapList(asList(1,2,3,4), "AEAEA");
  }

  public static class LoggerExample implements MyLoggingInterface {
    @Override
    public <T extends List> T unwrapList(final T type, final String str) {
      return null;
    }
  }
}
```

The logging output will be ```delegator.unwrapList(type, str) values - [1, 2, 3, 4] - AEAEA```

## Static Runtime VirtualProxy
partly implemented until now.. stay tuned

## Static Runtime MetricsProxy
partly implemented until now.. stay tuned

#DynamicProxy

Since jdk1.3 the DynamicProxy is part of the JDK.
The official documentation/API-Doc for JDK8 you can find
[here](http://docs.oracle.com/javase/8/docs/api/java/lang/reflect/Proxy.html)

To create Proxies based on the DynamicProxy you have to add the following dependency to your project.
'''xml
 <dependency>
      <groupId>org.rapidpm.proxybuilder</groupId>
      <artifactId>rapidpm-proxybuilder-modules-dynamic</artifactId>
      <version>${rapidpm.version}</version>
    </dependency>
'''

If you are working with this kind of Proxies, you need always an interface. If you don´t have an interface in your code and you could not create one, you have to use the ***StaticVirtualProxies***.

##VirtualProxy

#### pure VirtualProxy
```java
final DemoLogic original = new DemoLogic();
final DemoInterface demoLogic = VirtualProxyBuilder
        .createBuilder(DemoInterface.class, original)
        .build();
```
With this you can generate at runtime a ***VirtualProxy*** based on the ***DynamicProxy***. This you can use beginning from Java 1.3 if you need it. (You have to backport the code by yourself, but we would like to add this as legacy module) The Sourcelevel we are using in this project is Java8.

#### Security Proxy
```java
final DemoLogic original = new DemoLogic();
final DemoInterface demoLogic = VirtualProxyBuilder
        .createBuilder(DemoInterface.class, original)
        .addSecurityRule(() -> false)
        .build();
```
This is a SecureVirtalProxy. The SecurityRules are invoked before the VirtualProxy is activated. This means, the real Subject will be created after the first time all SecurityRules are OK.

```java
final InnerDemoClass original = new InnerDemoClass();
    final InnerDemoInterface demoLogic = VirtualProxyBuilder
        .createBuilder(InnerDemoInterface.class, original)
        .addSecurityRule(() -> true)
        .addSecurityRule(() -> true)
        .addSecurityRule(() -> false)
        .build();
```

#### Metrics Proxy

If you need the possibility to get Metrics out of your application, you could create a MetricsProxy. In this example we are creating a pure ***MetricsProxy*** you could do the following:

```java
    final InnerDemoInterface demoLogic = VirtualProxyBuilder
        .createBuilder(InnerDemoInterface.class, new InnerDemoClass())
        .addMetrics()
        .build();

```
 You could combine this with a ***VirtualProxy*** to get a ***VirtualMetricsProxy***:

```java
    final Service service = DynamicProxyBuilder
        .createBuilder(Service.class, ServiceImpl.class, CreationStrategy.SOME_DUPLICATES)
        .addMetrics()
        .build();

```

## PreAction -- PostAction
Sometimes you want to have the possibility to do something before or after a Methodinvocation. For this we have the
***PreAction*** and ***PostAction***. The Actions are executed in the order they are added to the Proxy.

```java
    final Service service = DynamicProxyBuilder
        .createBuilder(Service.class, new ServiceImpl())
        .addIPreAction((original, method, args1) -> out.println("001 = " + method.getName()))
        .addIPreAction((original, method, args1) -> out.println("002 = " + method.getName()))
        .addIPreAction((original, method, args1) -> out.println("003 = " + method.getName()))
        .build();
```

A ***VirtualProxy*** with ***PreActions*** will lead to the execution of all ***PreActions*** before the real Subject will be created.

```java
    final Service service = DynamicProxyBuilder
        .createBuilder(Service.class, ServiceImpl.class, CreationStrategy.SOME_DUPLICATES)
        .addIPreAction((original, method, args1) -> out.println("001 = " + method.getName()))
        .addIPreAction((original, method, args1) -> out.println("002 = " + method.getName()))
        .addIPreAction((original, method, args1) -> out.println("003 = " + method.getName()))
        .build();
```

If you combine it with a ***SecurityVirtualProxy*** with ***PreActions*** the Security-Rule will be invoked first.

```java
    final Service service = DynamicProxyBuilder
        .createBuilder(Service.class, ServiceImpl.class, CreationStrategy.SOME_DUPLICATES)
        .addIPreAction((original, method, args1) -> out.println("001 = " + method.getName()))
        .addIPreAction((original, method, args1) -> out.println("002 = " + method.getName()))
        .addIPreAction((original, method, args1) -> out.println("003 = " + method.getName()))
        .addSecurityRule(() -> {
          out.println("sec 001");
          return true;
        })
        .build();
```

## CreationStrategies
With the ***CreationStrategies*** you can choose what will be the right way of synchronization for you if you are using ***VirtualProxies***. You can implement some other by yourself, if needed. With ***CreationStrategies*** you can do different things. Not only the creation of one Element is possible, you can e.g. create a pool of instances used randomly or you can do something like ***MethodScoped***.

### MethodScoped
This ***CreationStrategy*** will create for every method invocation a new instance.

```java
public class ServiceStrategyFactoryMethodScoped<T> implements ServiceStrategyFactory<T> {

  @Override
  public synchronized T realSubject(ServiceFactory<T> factory) {
    return factory.createInstance();
  }
}
```

### NONE
If you choose nothing or ***CreationStrategy.NONE*** you will get the ***NotThreadSafe*** version.

```java
public class ServiceStrategyFactoryNotThreadSafe<T> implements ServiceStrategyFactory<T> {

  private T service;

  @Override
  public T realSubject(ServiceFactory<T> factory) {
    if (service == null) {
      service = factory.createInstance();
    }
    return service;
  }

}
```

### SomeDuplicates

```java
public class ServiceStrategyFactorySomeDuplicates<T> implements ServiceStrategyFactory<T> {
  private final AtomicReference<T> ref = new AtomicReference<>();

  @Override
  public T realSubject(ServiceFactory<T> factory) {

    T service = ref.get();
    if (service == null) {
      service = factory.createInstance();
      if (!ref.compareAndSet(null, service)) {
        service = ref.get();
      }
    }
    return service;
  }
}
```

### Synchronized

```java
public class ServiceStrategyFactorySynchronized<T> implements ServiceStrategyFactory<T> {

  private T service;

  @Override
  public synchronized T realSubject(ServiceFactory<T> factory) {
    if (service == null) {
      service = factory.createInstance();
    }
    return service;
  }
}
```

### NoDuplicates

```java
public class ServiceStrategyFactoryNoDuplicates<T> implements ServiceStrategyFactory<T> {

  private final Lock initializationLock = new ReentrantLock();
  private volatile T realSubject;

  @Override
  public T realSubject(ServiceFactory<T> factory) {
    T result = realSubject;
    if (result == null) {
      initializationLock.lock();
      try {
        result = realSubject;
        if (result == null) {
          result = realSubject = factory.createInstance();
        }
      } finally {
        initializationLock.unlock();
      }
    }
    return result;
  }
}
```

# Object Adapter
In this section we want to describe the ObjectAdapter Pattern that is realized in this module.
We can use a dynamic and a static version of the ***ObjectAdapter*** Pattern. The dynamic version is based on the DynamicProxy from jdk1.3 and the static version is purely generated via Annotation Processing.

## DynamicObjectAdapter
If you want to use the ***DynamicObjectAdapter*** you need at leaset one Interface you can cast to. To create the ***DynamicObjectAdapter*** you can use the Annotation ***@DynamicObjectAdapterBuilder***. This will create via Annotation Processing the ***DynamicObjectAdapter*** and the corresponding ***Builder*** that you can use for convenience and type safety. Let´s assume you have the following interface ***Service***:

```java
@DynamicObjectAdapterBuilder
public interface Service {
  String doWork(String txt);
  String doMoreWorkA(String txt);
  String doMoreWorkB(String txt);
  String doMoreWorkC(String txt);
  String doMoreWorkD(String txt);
}
```

With the Annotation we are generating the corresponding parts, used for the typesafe generated DynamicObjectAdapterBuilder.
You will get a FunctionalInterface for every Method declared in your interface, and an typed InvocationHandler and the Builder itself.

To use the ***DynamicObjectAdapter*** you can do the following:

```java
    final Service service = ServiceAdapterBuilder
        .newBuilder()
        .setOriginal(new ServiceImpl())
        .withDoWork(new ServiceMethodDoWork() {
          @Override
          public String doWork(final String txt) {
            return "mocked";
          }
        })
        .withDoMoreWorkC(new ServiceMethodDoMoreWorkC() {
          @Override
          public String doMoreWorkC(final String txt) {
            return "mocked again";
          }
        })
        .buildForTarget(Service.class);

```

Also you can use the Lambda-Expressions for this. So your code will be shorter.
```java
    final Service serviceJDK8 = ServiceAdapterBuilder
        .newBuilder()
        .setOriginal(new ServiceImpl())
        .withDoWork(txt -> "mocked")
        .withDoMoreWorkC(txt -> "mocked again")
        .buildForTarget(Service.class);
```

You can use this for mocking too, if you want. For this you could adapt the methods you need and set the original to null.

```java
    final Service serviceJDK8Mock = ServiceAdapterBuilder
        .newBuilder()
        .setOriginal(null)
        .withDoWork(txt -> "mocked")
        .withDoMoreWorkC(txt -> "mocked again")
        .buildForTarget(Service.class);
```

If you can not use AnnotationProcessing, you are able to use the DynamicObjectAdapter itself.

```java
    final ExtendedInvocationHandler<Service> extendedInvocationHandler
        = new ExtendedInvocationHandler<Service>() { };

    extendedInvocationHandler.addAdapter(new Object() {
      public String doMoreWorkB(String txt) {
        return "mocked";
      }
    });

    final AdapterBuilder<Service> adapterBuilder = new AdapterBuilder<Service>() {
      @Override
      protected ExtendedInvocationHandler<Service> getInvocationHandler() {
        return extendedInvocationHandler;
      }
    };

    final Service service = adapterBuilder.buildForTarget(Service.class);
```

Or if you want to write it even more compact..

```java
final Service service = new AdapterBuilder<Service>() {
      protected ExtendedInvocationHandler<Service> getInvocationHandler() {
        return new ExtendedInvocationHandler<Service>() {
          {
            addAdapter(new Object() {
              public String doMoreWorkB(String txt) {
                return "mocked";
              }
            });
          }
        };
      }
    }
    .buildForTarget(Service.class);
```

## StaticObjectAdapter
If you want, you can use the static ObjectAdapter nearly in the same way. But here you will get no Builder. You only will get the functional interfaces and the Adapter itself. Add the Annotation ***@StaticObjectAdapter*** to an Interface or Class.

```java
@StaticObjectAdapter
public interface Service {
  String doWork(String txt);
  String doMoreWorkA(String txt);
  String doMoreWorkB(String txt);
  String doMoreWorkC(String txt);
  String doMoreWorkD(String txt);
}
```

After a ***mvn clean compile*** you will get the Functionalinterfaces and the StaticObjectAdapter itself.

```java
final Service service = new ServiceStaticObjectAdapter()
        .withService(new ServiceImpl())
        .withServiceMethodDoMoreWorkC(new ServiceMethodDoMoreWorkC() {
          @Override
          public String doMoreWorkC(final String txt) {
            return "mocked";
          }
        })
        .withServiceMethodDoMoreWorkD(new ServiceMethodDoMoreWorkD() {
          @Override
          public String doMoreWorkD(final String txt) {
            return "mocked";
          }
        });

```

And here again, you can write it with short Lambda-syntax:

```java
final Service service = new ServiceStaticObjectAdapter()
        .withService(new ServiceImpl())
        .withServiceMethodDoMoreWorkC(txt -> "mocked")
        .withServiceMethodDoMoreWorkD(txt -> "mocked");
```

repository: svenruppert/proxybuilder

branch_name: refs/heads/develop

repo_name: svenruppert/proxybuilder


text:
# React Scrollama

React Scrollama is a simple library for scrollytelling in React, utilizing the IntersectionObserver. It's adapted from [Russel Samora's](https://russellsamora.github.io/) [Scrollama](https://github.com/russellgoldenberg/scrollama).

Some examples:

    17 interactive visualization

      stories using React Scrollama

    for scrollytelling

 Comment Tati a imprimé
 sa marque à Barbès
 by Fabien Casaleggio

 The scramble to secure
 America’s voting machines
 by Beatrice Jin

 Sex Diversity Among Grad
 Students is Stagnating
 by Jason Kao

## Demo

A live demo [lives here](https://jsonkao.github.io/react-scrollama), presented at [ReactNYC](https://www.youtube.com/watch?v=zR_LDPLMUvE).

    Basic step triggers
    Sticky graphic on the side

## Install

React Scrollama can be installed as an [npm package](https://www.npmjs.com/package/react-scrollama):
```
$ npm install react-scrollama
```

**Note: Version 2.2.0 removed the [IntersectionObserver polyfill](https://www.npmjs.com/package/intersection-observer) from the build. If you want [cross-browser support](https://caniuse.com/#feat=intersectionobserver), you should include it yourself.**

## Usage

A `Scrollama` component wraps a set of steps. Each `Step` component [must](https://github.com/jsonkao/react-scrollama/issues/19#issuecomment-624861326) wrap a DOM element (i.e. not just text).

```jsx
<Scrollama onStepEnter={callback} offset={0.5}>
  <Step data={1}>
    <div>...</div>
  </Step>
  <Step data={2}>
    <div>...</div>
  </Step>
</Scrollama>
```

`<Scrollama>` provides an interface for listening in on scroll triggers like entering or exiting a step. (Here's [a full list](#scrollama) of available props.)

A basic example:

```jsx
import React, { useState } from 'react';
import { Scrollama, Step } from 'react-scrollama';

const ScrollamaDemo = () => {
  const [currentStepIndex, setCurrentStepIndex] = useState(null);

  // This callback fires when a Step hits the offset threshold. It receives the
  // data prop of the step, which in this demo stores the index of the step.
  const onStepEnter = ({ data }) => {
    setCurrentStepIndex(data);
  };

  return (
    <div style={{ margin: '50vh 0', border: '2px dashed skyblue' }}>
      <div style={{ position: 'sticky', top: 0, border: '1px solid orchid' }}>
        I'm sticky. The current triggered step index is: {currentStepIndex}
      </div>
      <Scrollama offset={0.5} onStepEnter={onStepEnter} debug>
        {[1, 2, 3, 4].map((_, stepIndex) => (
          <Step data={stepIndex} key={stepIndex}>
            <div
              style={{
                margin: '50vh 0',
                border: '1px solid gray',
                opacity: currentStepIndex === stepIndex ? 1 : 0.2,
              }}
            >
              I'm a Scrollama Step of index {stepIndex}
            </div>
          </Step>
        ))}
      </Scrollama>
    </div>
  );
};

export default ScrollamaDemo;
```

## API

React Scrollama components do not render into the DOM. They are meant to set up Intersection Observers on the elements inside the `<Step>` components. In the code above, only the `<div>` elements would show up in the DOM.

### `Scrollama`

These are the props you can set on the `Scrollama` component itself:

| Prop           | Type                      | Default | Description                                                                             |
|----------------|---------------------------|---------|-----------------------------------------------------------------------------------------|
| offset         | `number` (from 0 to 1) or pixel value (e.g. "300px")    | 0.3     | How far from the top of the viewport to trigger a step (as a proportion of view height) |
| threshold      | `number` (greater than 1) | 4       | Granularity of the progress interval in pixels (smaller = more granular)                |
| onStepEnter    | `function`                |         | Callback that fires when the top or bottom edge of a step enters the offset threshold.  |
| onStepExit     | `function`                |         | Callback that fires when the top or bottom edge of a step exits the offset threshold.   |
| onStepProgress | `function`                |         | Callback that fires the progress a step has made through the threshold.                 |
| debug          | `boolean`                 | false   | Whether to show visual debugging tools.                                                 |

The `onStepEnter` and `onStepExit` callbacks receive one argument, an object, with the following properties:

```js
{
  element, // The DOM node of the step that was triggered
  data, // The data supplied to the step
  direction, // 'up' or 'down'
  entry, // the original `IntersectionObserver` entry
}
```

The `onStepProgress` callback receives one argument, an object, with the following properties:

```js
{
  element, // The DOM node of the step that was triggered
  data, // The data supplied to the step
  progress, // The percent of completion of the step (0 to 1)
  direction, // 'up' or 'down'
  entry, // the original `IntersectionObserver` entry
}
```

To create a fixed graphic with text scrolling beside/over it, use `position: sticky;`. [How to use position sticky.](https://pudding.cool/process/scrollytelling-sticky/)

### `Step`

A `Step` element can contain one child, which must be a DOM element. To use a React component as the child node, it [must be wrapped with a DOM element](https://github.com/jsonkao/react-scrollama/issues/19#issuecomment-624861326) like `<div>`.

These are the props you can set on the `Step` component:

| Prop | Type | Default | Description                                                      |
|------|------|---------|------------------------------------------------------------------|
| data | any  |         | Data to be given to `<Scrollama>` callbacks when step triggered. |

You will also probably want to set a `key` prop on each `Step` if you're transforming an array of data into a list of `Step` elements (see [Lists and Keys](https://reactjs.org/docs/lists-and-keys.html)).

## Thank you to everyone who made this possible!

* [jsonkao](https://github.com/jsonkao)
* [maerzhase](https://github.com/maerzhase)
* [NicholasLYang](https://github.com/NicholasLYang)
* [jonesbp](https://github.com/jonesbp)
* [kennethormandy](https://github.com/kennethormandy)
* [cedricdelpoux](https://github.com/cedricdelpoux)
* [davidnmora](https://github.com/davidnmora)
* [jefffriesen](https://github.com/jefffriesen)
* [paolocorti](https://github.com/paolocorti)
* [elbertwang3](https://github.com/elbertwang3)
* [michaelgrotton](https://github.com/michaelgrotton)
* [jjrchrds](https://github.com/jjrchrds)
* [goleary](https://github.com/goleary)
* [danieleguido](https://github.com/danieleguido)
* [Lane](https://github.com/Lane)
* [jkjustjoshing](https://github.com/jkjustjoshing)

## Features roadmap

* Currently, there is no way to throttle/customize React Scrollama's [resize listener](https://github.com/jsonkao/react-scrollama/blob/master/src/Scrollama.js#L104) 😢. We're working on this in [#44](https://github.com/jsonkao/react-scrollama/issues/44).
* Fire previous step triggers if they were jumped

Lmk if you need these features ASAP.

repository: jsonkao/react-scrollama

gha_language: JavaScript

gha_license_id: MIT

repo_name: jsonkao/react-scrollama


text:
# RecordOnTheGo
Portable health record for long term refugee health care

## Gitflow - rules to follow when making changes to this project

The main 'branches' of this project are
* Master - where the code is always in a production-ready state i.e. functional, no major bugs (that we know of), and could be distributed to a wider audience.
* Develop - always contains code with the latest 'delivered development changes' i.e. this is the main branch where we develop the overall application; it can have unfinished work and not-yet-fixed bugs in it.

Other, supporting branches that can be used are (and of which we can have multiple):
* Feature - where new individual features for upcoming or future releases are developed.
* Release - where we do some last-minute dotting of the i's and crossing of the t's to get our 'Develop' code ready for the 'Master' branch
* Hotfix - where we respond quickly to an undesired state of a current 'Master' branch e.g. a major bug needs fixing. These branches are unplanned!

For a full guide to the model we're using to manage our code development, see ['A successful Git branching model'](http://nvie.com/posts/a-successful-git-branching-model/)

## Prototype site
[empowerhack.github.io/RecordOnTheGo](http://empowerhack.github.io/RecordOnTheGo/prototype/)

There is a gh-pages prototype site. This is kept on a `gh-pages` branch. Never ake changes to this branch, it is only meant to host the pages site. To update the pages site:

```
## Make sure you're on the master branch and pull the latest changes:
git checkout master && git pull

## Checkout gh-pages branch and merge master in:
git checkout gh-pages && git merge master

## Push changes to gh-pages:
git push origin gh-pages

## Switch back to master (or the branch you are working on) to ensure gh-pages doesn't get any local changes:
git checkout master
```

repository: empowerhack/RecordOnTheGo

repo_name: empowerhack/RecordOnTheGo


text:
# OpenTelemetry AWS Lambda Extension
*NOTE: This repo has been moved to: https://github.com/open-telemetry/opentelemetry-lambda-extension*

*NOTE: This is an experimental AWS Lambda Extension for OpenTelemetry*

The OpenTelemetry Lambda Extension provides a mechanism to export telemetry aynchronously from AWS Lambdas. It does this by embedding an [OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-collector) inside an [AWS Extension Layer](https://aws.amazon.com/blogs/compute/introducing-aws-lambda-extensions-in-preview/). This allows lambdas to use the OpenTelemetry Collector Exporter to send traces and metrics to any configured backend.

## Installing

To install the OpenTelemetry Lambda Extension to an existing Lambda function using the `aws` CLI:

```
aws lambda update-function-configuration --function-name Function --layers arn:aws:lambda:<AWS REGION>:297975325230:layer:opentelemetry-lambda-extension:8
```

Alternatively, to configure the OpenTelemetry Lambda Extension via SAM, add the following configuration:

```yaml
  Function:
    Type: AWS::Serverless::Function
    Properties:
      Layers:
        - arn:aws:lambda:<AWS REGION>:297975325230:layer:opentelemetry-lambda-extension:8
      ...
      Environment:
        Variables:
          OPENTELEMETRY_COLLECTOR_CONFIG_FILE: /var/task/collector.yaml
```

## Configuration

The OpenTelemetry Collector uses yaml for configuration. To configure the collector, add a `collector.yaml` to your function and specifiy its location via the `OPENTELEMETRY_COLLECTOR_CONFIG_FILE` environment file.

Here is a sample configuration file:

```yaml
receivers:
  otlp:
    protocols:
      grpc:
      http:
exporters:
  otlp:
    endpoint: destination:1234
    headers: {"header1":"value1"}
processors:
  batch:

service:
  extensions:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlp]
```

Once the file has been deployed with a Lambda, configuring the `OPENTELEMETRY_COLLECTOR_CONFIG_FILE` will tell the OpenTelemetry extension where to find the collector configuration:

```
aws lambda update-function-configuration --function-name Function --environment Variables={OPENTELEMETRY_COLLECTOR_CONFIG_FILE=/var/task/collector.yaml}
```

You can configure environment variables via yaml as well:

```yaml
  Function:
    Type: AWS::Serverless::Function
    Properties:
      ...
      Environment:
        Variables:
          OPENTELEMETRY_COLLECTOR_CONFIG_FILE: /var/task/collector.yaml
```

------
*Made with* ![:heart:](https://a.slack-edge.com/production-standard-emoji-assets/10.2/apple-medium/2764-fe0f.png) *@ [Lightstep](http://lightstep.com/)*


text:
# utl-extract-a-word-from-a-sentence-and-return-the-shorter-list-call-transtrn
Extract a word from a sentence and return the shorter list call transtrn.

    Extract a word from a sentence and return the shorter list call transtrn

    Problem remove the word 'cat' from the sentence below.


text:
# automox_console_sdk.WorkletsApi

All URIs are relative to *https://console.automox.com/api*

Method | HTTP request | Description
------------- | ------------- | -------------
[**get_community_worklet**](WorkletsApi.md#get_community_worklet) | **GET** /community-worklets/{id} | Retrieve Community Worklet by ID
[**get_community_worklets**](WorkletsApi.md#get_community_worklets) | **GET** /community-worklets | Retrieve Community Worklets

# **get_community_worklet**
> WorkletDetails get_community_worklet(id)

Retrieve Community Worklet by ID

Retrieves details for a specific Community Worklet by ID

### Example
```python
from __future__ import print_function
import time
import automox_console_sdk
from automox_console_sdk.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = automox_console_sdk.WorkletsApi(automox_console_sdk.ApiClient(configuration))
id = 56 # int | The ID of the Community Worklet to retrieve

try:
    # Retrieve Community Worklet by ID
    api_response = api_instance.get_community_worklet(id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling WorkletsApi->get_community_worklet: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **int**| The ID of the Community Worklet to retrieve |

### Return type

[**WorkletDetails**](WorkletDetails.md)

### Authorization

[bearerAuth](../README.md#bearerAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **get_community_worklets**
> Worklet get_community_worklets(page=page, limit=limit)

Retrieve Community Worklets

Retrieves a list of Community Worklets

### Example
```python
from __future__ import print_function
import time
import automox_console_sdk
from automox_console_sdk.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = automox_console_sdk.WorkletsApi(automox_console_sdk.ApiClient(configuration))
page = 0 # int | The page of results you wish to be returned with page numbers starting at 0. (optional) (default to 0)
limit = 25 # int | A limit on the number of results to be returned, between 1 and 500 with a default of 25. Use with page parameter. (optional) (default to 25)

try:
    # Retrieve Community Worklets
    api_response = api_instance.get_community_worklets(page=page, limit=limit)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling WorkletsApi->get_community_worklets: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **page** | **int**| The page of results you wish to be returned with page numbers starting at 0. | [optional] [default to 0]
 **limit** | **int**| A limit on the number of results to be returned, between 1 and 500 with a default of 25. Use with page parameter. | [optional] [default to 25]

### Return type

[**Worklet**](Worklet.md)

### Authorization

[bearerAuth](../README.md#bearerAuth)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

repository: ax-ncolyer/automox-console-sdk-python

repo_name: ax-ncolyer/automox-console-sdk-python


text:
# TACACS+
[Terminal Access Controller Access-Control System Plus (TACACS+)](https://en.wikipedia.org/wiki/TACACS) is a protocol developed by Cisco to handle remote authentication and related services for networked access control through a centralized server. In specific, TACACS+ provides authentication, authorization and accounting (AAA) services. AWX currently utilizes its authentication service.

TACACS+ is configured by settings configuration and is available under `/api/v2/settings/tacacsplus/`. Here is a typical configuration with every configurable field included:
```
{
    "TACACSPLUS_HOST": "<IP_ADDRESS>",
    "TACACSPLUS_PORT": 49,
    "TACACSPLUS_SECRET": "secret",
    "TACACSPLUS_SESSION_TIMEOUT": 5,
    "TACACSPLUS_AUTH_PROTOCOL": "ascii",
    "TACACSPLUS_REM_ADDR": "false"
}
```
Each field is explained below:

| Field Name                   | Field Value Type    | Field Value Default | Description                                                        |
|------------------------------|---------------------|---------------------|--------------------------------------------------------------------|
| `TACACSPLUS_HOST`            | String              | '' (empty string)   | Hostname of TACACS+ server. Empty string disables TACACS+ service. |
| `TACACSPLUS_PORT`            | Integer             | 49                  | Port number of TACACS+ server.                                     |
| `TACACSPLUS_SECRET`          | String              | '' (empty string)   | Shared secret for authenticating to TACACS+ server.                |
| `TACACSPLUS_SESSION_TIMEOUT` | Integer             | 5                   | TACACS+ session timeout value in seconds.                          |
| `TACACSPLUS_AUTH_PROTOCOL`   | String with choices | 'ascii'             | The authentication protocol used by TACACS+ client (choices are `ascii` and `pap`).                |
| `TACACSPLUS_REM_ADDR`        | Boolean             | false               | Enable the client address sending by TACACS+ client.               |

Under the hood, AWX uses [open-source TACACS+ python client](https://github.com/ansible/tacacs_plus) to communicate with the remote TACACS+ server. During authentication, AWX passes username and password to TACACS+ client, which packs up auth information and sends it to the TACACS+ server. Based on what the server returns, AWX will invalidate login attempt if authentication fails. If authentication passes, AWX will create a user if she does not exist in database, and log the user in.

## Test Environment Setup

The suggested TACACS+ server for testing is [shrubbery TACACS+ daemon](http://www.shrubbery.net/tac_plus/). It is supposed to run on a CentOS machine. A verified candidate is CentOS 6.3 AMI in AWS EC2 Community AMIs (search for `CentOS 6.3 x86_64 HVM - Minimal with cloud-init aws-cfn-bootstrap and ec2-api-tools`). Note that it is required to keep TCP port 49 open, since it's the default port used by the TACACS+ daemon.

We provide [a playbook](https://github.com/jangsutsr/ansible-role-tacacs) to install a working TACACS+ server. Here is a typical test setup using the provided playbook:

1. In AWS EC2, spawn the CentOS 6 machine.
2. In Tower, create a test project using the stand-alone playbook inventory.
3. In Tower, create a test inventory with the only host to be the spawned CentOS machine.
4. In Tower, create and run a job template using the created project and inventory with parameters setup as below:

![Example tacacs+ setup jt parameters](../img/auth_tacacsplus_1.png?raw=true)

The playbook creates a user named 'tower' with ascii password default to 'login' and modifiable by `extra_var` `ascii_password` and pap password default to 'papme' and modifiable by `extra_var` `pap_password`. In order to configure TACACS+ server to meet custom test needs, we need to modify server-side file `/etc/tac_plus.conf` and `sudo service tac_plus restart` to restart the daemon. Details on how to modify config file can be found [here](http://manpages.ubuntu.com/manpages/xenial/man5/tac_plus.conf.5.html).

## Acceptance Criteria

* All specified in configuration fields should be shown and configurable as documented.
* A user defined by the TACACS+ server should be able to log into AWX.
* User not defined by TACACS+ server should not be able to log into AWX via TACACS+.
* A user existing in TACACS+ server but not in AWX should be created after the first successful log in.
* TACACS+ backend should stop an authentication attempt after configured timeout and should not block the authentication pipeline in any case.
* If exceptions occur on TACACS+ server side, the exception details should be logged in AWX, and AWX should not authenticate that user via TACACS+.

repository: ansible/awx

branch_name: refs/heads/devel

gha_language: Python

gha_license_id: NOASSERTION

repo_name: ansible/awx


text:
## Mazes in Rust

This repository is an implementation of the code from the book `Mazes for Programmers` (https://pragprog.com/book/jbmaze/mazes-for-programmers) in Rust with a web front end. I'm building the maze algorithms as I go through the book. Note that I'm still learning Rust, so my code is likely not "idiomatic" from a Rust perspective.

See https://rbudnar.github.io/rust-mazes/ for a demo.

This repo was forked from: https://github.com/rustwasm/rust-webpack-template
* Install wasm-pack (you might have to switch to the nightly rust build)
* `npm run start` -- Serve the project locally for development at
  `http://localhost:8080`.

* `npm run build` -- Bundle the project (in production mode).

repository: rbudnar/rust-mazes

repo_name: rbudnar/rust-mazes


text:
# FortuneMC-Withers
A little plugin I made for the factions server FortuneMC to nerf withers so that they would better fit with the factions climate. The plugin is made to run on Spigot 1.12.2.
Changes the following for withers on FortuneMC:

1. Withers will spawn with 50% of their normal, vanilla max health.
2. Withers will not naturally regenerate health.

The plugin also includes a customizable, modular, hot-swappable system which allows any of the above changes to be enabled or disabled from in-game with commands.

repository: patrickeharris/FortuneMC-Withers

repo_name: patrickeharris/FortuneMC-Withers


text:
# libergit

The goal is to create a git based history record of the books you read and movies you watch.

Thus a distributed, diff-able, mergable, machine readable social network based on interest instead of commercial website profiles.

`liber` means book in latin.

BSD license

2017-12-27

repository: lambdaq/libergit

repo_name: lambdaq/libergit


text:
# PlayFab CLI
PlayFab CLI is a command line interface that can be used to perform various admin actions on a title and do title migrations.

## Community Support

This is a community supported tool.

For new and existing users, you can use the current version as it is. The team at Microsoft is no longer providing support or making updates to this tool. You can continue to get community support and publish your own updates at [PlayFab forums](https://community.playfab.com/index.html).

What you have to do:
* Fork this repo
* Push your updates
* Make sure you follow the Apache License, Version 2.0 guidelines for reproduction and modification, and document that Microsoft PlayFab is the original creator
* Go to [PlayFab forums](https://community.playfab.com/index.html)
* Write a post with a link to your forked repo so everyone knows about it

We're excited to hear from you. Thank you for your support and happy coding.
## Supported Platforms
**Currently for Windows Only**

## Installation
Installation of PlayFab CLI is simple.

1. Extract the folder to any directory of your choosing.
2. Modify your environment path to point to that folder.
	1. **start** --> type: **environment** --> **Click Edit the system environment variables**  and modify your "path" to include your PFPT CLI directory.

## Modes
There are currently two modes for the PF CLI,  there is a CLI mode and a Console mode.

1. Console Mode: To enter into console mode just open up "cmd" and type PlayFabPowerTools
2. CLI Mode: Any command can be executed directly from CLI mode,  open "cmd" and type PlayFabPowerTools [command] [args]

**CLI Example:**
1. Windows Key + R
2. type: cmd
3. type: PlayFabPowerTools login<EMAIL_ADDRESS>mypassword

in this example, you can login using your credentials and it will log you in and pull all the data related to your login.

## Commands
There are currently only a few commands that the tool can do right now.

1. Login - This allows you to login with a username & password.  Login will download all Titles that you have access to, you only need to do this once or any time you add titles to your PlayFab Account.
2. SetStores - This allows you to specify which stores you want to import when using migrate.
3. Migrate - This allows you to migrate from one title to another title.
4. Help - Display a help screen
5. Exit - Exit Console Mode

repository: PlayFab/PlayFabCLI

gha_language: C#

repo_name: PlayFab/PlayFabCLI


text:
---
layout: post
title:  "Day 4"
date:   2016-10-04 08:40:00 -0500
categories: 30days writing
---
Ego.

Why do I run knowing I will never be the fastest?

It is a silly question, but one I must answer. If I’m not going to be the best, why do it at all?

This question hits me hard when I’m being passed on the trail. Ego yells at me, “Run! Run faster!”

I believe this is a response developed in the human mind through thousands of years of survival. Being faster than threats and faster than competition was the only way to survive. In modern society, this response is a leftover annoyance I need to recognize and carefully address.

I have one goal. I run so I will be a fit dad. In 10 years my sons will start to surpass me in speed and agility. It is important to me that I am able to challenge them in sports and teach through my example of daily routines.

I run so I am my best self. I run so I am 1% better today than I was yesterday. I race against my past. I strive for personal records. There is an upper limit for me. My goal is to find my limit.

 I enjoy the strength and rhythm found in running.

extension: markdown


text:
---
layout: default
---

# 1997-07-06 - nsa+gchq spying operation

## Header Data

From: "Vladimir Z. Nuri"<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: cda5678666ef8bed4471bb234781b6bafef27e1b3753fc19656024e777c63d26

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1997-07-06 21:57:44 UTC

Raw Date: Mon, 7 Jul 1997 05:57:44 +0800

## Raw message

```
{% raw  %}From: "Vladimir Z. Nuri"<EMAIL_ADDRESS>Date: Mon, 7 Jul 1997 05:57:44 +0800
To<EMAIL_ADDRESS>Subject: nsa+gchq spying operation
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

as I recall we have gotten early hints of this operation/book.

------- Forwarded Message

Date: Sat, 05 Jul 1997 21:37:30 -0600
To<EMAIL_ADDRESS><EMAIL_ADDRESS>From: Leander<EMAIL_ADDRESS>Subject: SNET: "Secret Power" by Nicki Hagar

- ->  SearchNet's   SNETNEWS   Mailing List

Forwarded from alt.2600.moderated by me.

Leander
<EMAIL_ADDRESS>
>"Secret Power" by Nicki Hagar
>The International Spying Networks UKUSA and ECHELON
>301pp ISBN: 0-908802-35-8
>
>According to this remarkable book, that has somehow escaped the flames of
>book banners crying "national security," the United States NSA and the
>United Kingdom's GCHQ (Government Communications Headquarters) operate a
>global spying network called UKUSA. To listen in on conversations across the
>planet, a massive eavesdropping apparatus was built, with tentacles which
>reach into dozens of different countries beyond the shores of either the US
>or UK as well as across the skies.
>
>Describing the nature of UKUSA, its global affiliations, and operations
>represents a huge effort on the part of author Nicki Hager. He states early
>on in 'Secret Power':
>
>  "Many people are vaguely aware that a lot of spying occurs, maybe even on
>  them, but how do we judge if it is ubiquitous or not a worry at all? Is
>  someone listening every time we pick up the telephone? Are all of our
>  Internet or fax messages being pored over continuously by shadowy figures
>  somewhere in a windowless building?
>
>  "What follows explains as precisely as possible - and for the first time
>  in public - how the worldwide [spy] system works, just how immense and
>  powerful it is and what it can and cannot do.
>
>  "The global system has a highly secret codename: ECHELON."
>
>And that is the foundation of a tremendous amount of research that describes
>in detail how the vast global spying network "collects all the telephone
>calls, faxes, telexes, Internet messages and other electronic communications
>that its computers have been pre-programmed to select," and then analyzes
>the contents and distributes it to members UKUSA and ECHELON partners
>world-wide.
>
>The operational details of how the US (NSA), UK (GCHQ), Canada (CSE),
>Australia (DSD) and New Zealand (GCSB) intercepts signals, throws high power
>computing behind ECHELON 'KeyWord' dictionary attacks and what they do with
>that information is potentially alarming; especially since so much of this
>decades old practice has been kept under the wraps of security.
>
>Secret Power names the names, provides the dates and the technical details
>on the world's largest, best financed and coordinated global spying
>apparatus ever conceived. Full of pictures, maps and charts, the reader will
>get a complete picture of just how much effort and resources go into
>international security, long distance eavesdropping, and spying.
>
>>From the Cold War to today, UKUSA and ECHELON have been fascinating and
>powerful intelligence functions to spy both on enemies and friends. "Secret
>Power" provides the first peek inside the world's most secretive and
>powerful electronic spy organization.
>
>"Secret Power" reads like a thriller, except that it's true. It should be
>read by everyone with an interest in intelligence, espionage and the
>technology that modern spies use.
>
>"An astonishing number of people have told him [author Nicki Hager] things
>that I, as Prime Minister in charge of the intelligence services, was never
>told...It is an outrage that I and other ministers were told so little."
>        -David Lange, Prime Minister of New Zealand 1984-89
>
>"...the most detailed and up to date account of the work of any signals
>intelligence agency in existence. It is a masterpiece of investigative
>reporting, and provides a wealth of information."
>        -Jeffrey T. Richelson, leading authority on United States
>intelligence agencies and author of America's Secret Eyes in the Sky, and
>co-author of 'The Ties that Bind.'
>
>------------------------------
>
>--
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>Graham-John Bullers                      Moderator of alt.2600.moderated
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    email<EMAIL_ADDRESS><EMAIL_ADDRESS>>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>         http://www.freenet.edmonton.ab.ca/~real/index.html
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>-- end of forwarded message --
>
>

- -> Send "subscribe   snetnews " to<EMAIL_ADDRESS>- ->  Posted by: Leander<EMAIL_ADDRESS>

------- End of Forwarded Message

{% endraw %}
```

## Thread

+ Return to [July 1997](/archive/1997/07)

+ Return to "["Vladimir Z. Nuri" <vznuri@netcom.com>](/authors/vladimir_z_nuri_vznuri_at_netcom_com_)"

+ 1997-07-06 (Mon, 7 Jul 1997 05:57:44 +0800) - nsa+gchq spying operation - _"Vladimir Z. Nuri"<EMAIL_ADDRESS>


text:
# hello-world-express-typescript
Minimal express.js app in typescript, deployable on heroku :rooster: :koala: :dragon:

## Introduction

Iterating on previous Hello World:
* https://github.com/Offirmo/hello-world-typescript
* https://github.com/Offirmo/hello-world-heroku

See also those related/expanded Hello Worlds:
* https://github.com/Offirmo/hello-world-express-typescript

References:
* https://expressjs.com/en/4x/api.html

## Installation and launch
```bash
nvm install
npm install
npm start
```

## Contributing
See CONTRIBUTING.md

license: Unlicense

repository: Offirmo/hello-world-express-typescript

gha_language: TypeScript

gha_license_id: Unlicense

repo_name: Offirmo/hello-world-express-typescript


text:
[![Build Status](https://travis-ci.org/blp1526/isac.svg?branch=travis)](https://travis-ci.org/blp1526/isac)
[![Go Report Card](https://goreportcard.com/badge/github.com/blp1526/isac)](https://goreportcard.com/report/github.com/blp1526/isac)
[![GoDoc](https://godoc.org/github.com/blp1526/isac?status.svg)](https://godoc.org/github.com/blp1526/isac)

# isac

Interactive [SAKURA Cloud](https://cloud.sakura.ad.jp/)

## Installation

Download a binary from [here](https://github.com/blp1526/isac/releases).

## Usage

1. Create your `$HOME/.usacloud/default/config.json` by below command.

```
$ isac init
```

2. Write your ACCESS TOKEN, ACCESS TOKEN SECRET and default ZONE to `$HOME/.usacloud/default/config.json`.

3. Run below command.

```
$ isac
```

![isac](https://user-images.githubusercontent.com/1040576/33887076-e12c7de8-df8b-11e7-9466-5af9b6af8904.gif)

## Keybindings

|Keys|Description|
|---|---|
|C-c                |exit|
|Arrow Up, C-p      |move current row up|
|Arrow Down, C-n    |move current row down|
|C-u                |power on current row's server|
|C-r                |refresh rows|
|BackSpace, C-b, C-h|delete a filter character|
|C-a                |delete all filter characters|
|C-s                |sort rows|
|C-/                |show help|
|Enter              |show current row's detail|

## Options

|Option|Description|
|---|---|
|help, h|show help|
|version, v|print the version|
|unanonymize|unanonymize personal data|
|zones|set `ZONES` (separated by ",", example: "is1a,is1b,tk1a")|

gha_language: Go


text:
# Nodedoc-ASuperCoolNodeJsApp
NodeDoc' is an example app using:
- NodeJS
- Express
- MongoDb (via Mongoose)
- Passport-local
- Body-parser (of course..)
- Nodemailer

This app demonstrate how easy is to create an app within few hours!

### HOW TO INSTALL

```bash
$ git clone https://github.com/btronquo/Nodedoc-ASuperCoolNodeJsApp.git
$ npm-install
$ node app.js
```

Visit http://localhost:3000 & voila !

### Features available:
* Bootstrap powered ! Awesome!
* Users can register/sign-in & logout
* Instant email notification when user register

### Comming soon:
* Users can modify their email adress & access password
* Users can add some settings (maybe Fiscal number or other, I have no idea yet)
* Users can take a "rendez-vous" to see doctorX (He's doctor.. you don't know him?)

*That's all (ATM)*

repository: btronquo/Nodedoc-ASuperCoolNodeJsApp

repo_name: btronquo/Nodedoc-ASuperCoolNodeJsApp


text:
# Lambda calculus :: Conventions

Conventions are generally accepted customs concerning the syntax of lambda calulus.

**Berenregt convention** means giving unique names to variables so that name-capturing substitution is not a concern.

**Contraction of binders** is a shorthand that allows contraction of consequtive binders. `λa.λd.λc.ac(dc)` may be written as `λadc.ac(dc)` instead.

**Fixity convention** determines the precedence and associativity of lambda terms. It assigns left associativity to application and right associativity to lambda abstraction. It also assigns higer precedence to application in relation to abstraction.

The lambda expression on the left is explicitly denoted as the term on the right as far as associativity of abs and app is concerned:
`λa. λd. λc. a c d c` ≅ `λa. (λd. (λc. (((a c) d) c)))`

App has higher precedence than abs (in cases the dot symbol is elided):
`λaba` = `λa(ba)` ≠ `(λab)a`
that is, with the explicit dot:
`λa.ba` = `λa.(ba)` ≠ `(λa.b)a`

What is `λaba`?
- `λa. b a`   ✔
- `λa b. a`   ✘

What is `λabca`?
1. `λa b c. a`    ✘
2. `λa b. c a`    ✘
3. `λa. b c a`    ✔
4. `λa. b (c a)`  ✘
5. `λa. (b c) a`  ✔

*Don't-be-a-jerk convention* stipulates that the dot symbol is obligatory.

*Let-be-cheap convention* commends the addition of extra spaces around the variables.

*Kill-the-outer-parens convention* encourages the removal of the outer parens if the resulting term is unambiguous.

*Be-concise convention* asks you to avoid being (delibrately) ambiguous, lauding the promotion of clarity.

*Don't-be-insane convention* applauds the substitution (of an arg `A` bound to a parameter `x` wrt a lambda body `B`) denoted thus:
- [x:=A]B    ✔
- [x⟼A]B    ✔
- [x/A]B     ✘
- [A/x]B     ✘

while also allowing for the body `B` to be written on the left, `B[x:=A]`

```hs
(λa d c. a c (d c)) A D C
= (λd c. A c (d c))  D C
                        (a c (d c))[a:=A]
= (λc. A c (D c)) C
                        (A c (d c))[d:=D]
= A C (D C)
                        (A c (D c))[c:=C]

-- again but with parallel substitution
(λa d c. a c (d c)) A D C
    -- right-side-body parallel substitution:
    (a c (d c))[a:=A,d:=D,c:=C]
    -- left-side-body parallel substitution:
    [c:=C]([d:=D]([a:=A](a c (d c))))
    -- or merging substitution:
    (((a c (d c))[a:=A])[d:=D])[c:=C]
-- all result in
= A C (D C)
```


text:
logan
=====

Logs analysis and metrics using principles of data-flows.

The principal idea is to define typed data-flows taking advantage of the flexibility of the Scala language as a DSL for the purpose of taking logs from several sources, transforming the logs into metrics and react to them throwing alerts or simply storing them into a database.

The underlaying implementation transforms the data-flow graph into an Akka ActorSystem. The sources, transforming operations and sinks are represented with actors, and the logs/metrics as typed messages which flow through them.

This is a hobby project, neither the name of the project (do a query in github for logan) nor the principal idea are brand new here. I get inspiration from other mature projects such as [logstash](http://logstash.net/), [Spark Streaming](https://spark.apache.org/streaming/), [RxJava](https://github.com/ReactiveX/RxJava), [Reactive Streams](http://www.reactive-streams.org/), and so forth. It is just that I want to understand them better and experiment by myself some of the solutions (specialy the Spark approach for defining data-flows), and of course, learning Scala.

I always look for an snippet of code when looking at a project so here it is a very simple example of how I pretend to be able to define data-flows and do all these amazing things with logs:

```Scala
package test

import org.streum.configrity.Configuration

import logan.core.Stdout._
import logan.core.InfluxDB._

object Example1 {

  val config = Configuration(
    "influxdb.host" -> "localhost",
    "influxdb.port" -> 8083,
    "influxdb.user" -> "root",
    "influxdb.password" -> "root"
  )

  val ctx = Context(config)

  val stdin = ctx.stdin()

  stdin
    .filter(_.startsWith("INFO"))
    .stdout()

  stdin
    .filter(_.startsWith("ERROR"))
    .map(log => 1)
    .toInfluxdb("series1", "col1")

  def main(args: Array[String]): Unit = {

    ctx.start()

    Thread.sleep(10000)

    ctx.stop()
  }
}
```

I have in mind adding several operations such as union, grouping by key, grouping by time, mean, median, stdev, percentile, ... and some more sources and sinks such as fromTail, fromFile and toFile.

repository: chris-zen/logan

repo_name: chris-zen/logan


text:
# Changelog
All notable changes to this add-on will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Unreleased
### Changed
- Update minimum ZAP version to 2.13.0.
- Maintenance changes.

## [15] - 2021-10-20
### Fixed
- Re-ordered variable initialization to prevent an NPE.

## [14] - 2021-10-07
### Added
- Add help and link to the code.
- Add info and repo URLs.
- OWASP Top Ten 2021/2017 mappings.

### Fixed
 - Terminology

### Changed
- Update minimum ZAP version to 2.11.0.
- Maintenance changes.
- Updated owasp.org references (Issue 5962).

## [13] - 2019-06-07

- Update minimum ZAP version to 2.5.0.
- Bundle JDOM library instead of relying on core.

## 12 - 2017-11-27

- Minor code changes.

## 11 - 2016-07-07

- Check all DB techs when evaluating if the scanner should be run.

## 10 - 2016-06-02

- Prevent XXE vulnerability.
- Log level adjustments.
- Internationalisation of scanner and alert's data.
- Check for skip/stop more often.
- Added EXP error based payloads
- Preserved the space in commented suffixes

## 9 - 2015-07-30

- Split boundary and plugin definition in two different files
- Updated all plugin and boundary files to the newest SQLMap database
- Changed to target DB technology (Issue 1618).

## 8 - 2015-04-20

- Improved execution time when a WAF or Reverse Proxy is in place disabling keep-alive for all request
- Enforced the time based statistical model taking in account also the wait time threshold
- Solved some wrong "escape" that happened on some time based SQLi
- Users can specify the technology of interest, enabling or disabling them using the Advanced Active Scan tab

## 7 - 2015-04-13

- Updated for ZAP 2.4

## 6 - 2014-04-10

- Updated add-on dir structure (Issue 1113).

## 5 - 2014-02-15

- Resolved some race conditions related to slow and not responding sites

## 4 - 2013-11-25

- Solved some bugs and updated the SQLi payload configuration file

## 3 - 2013-09-11

- Added support for HyperSQL DB

[15]: https://github.com/zaproxy/zap-extensions/releases/sqliplugin-v15
[14]: https://github.com/zaproxy/zap-extensions/releases/sqliplugin-v14
[13]: https://github.com/zaproxy/zap-extensions/releases/sqliplugin-v13

repository: zaproxy/zap-extensions

repo_name: zaproxy/zap-extensions


text:
Done (needs testing)
------------------------------------------------------------------------------

In Progress
------------------------------------------------------------------------------
- Implement context passing for weight modification
- Define data table spec
    - Figure out syntax/parser for weight parsing
    - Decide on a syntax for lists of values in an entity's attribute
    - Decide on a syntax for referencing attributes of the entity

To Do
------------------------------------------------------------------------------
- Allow for arbitrary ordering of attribute generation
- Build a command-line interface for generating things
- Change entity generation to pass-by-reference
- Autosort JSON alphabetically by "val"
- Figure out Doxygen/comments
- Write usage documentation for table spec
- Write/find JSON viewer to easily view data tables
- Write error handling that tests JSON tables for correctness
    - Invalid syntax/values for a field
    - Duplicate specifications for an attribute or resource
    - Determine if something can never be generated (requires an attribute that will not be present at the time of selection)

Feature Wishlist
------------------------------------------------------------------------------
- Generate relationships between objects
- Save a setting (all objects/relationships) to disk
- Allow for editing of a saved setting (individual regeneration of objects, values, etc)
- Build HTML wiki of all generated objects for a setting
- Host the generated HTML locally using Flask
- Enable or disable individual values for different fields using a GUI

repository: Riizade/Jormungandr

repo_name: Riizade/Jormungandr


text:
# Eclipse for JEE Developers (Luna 4.4.2)

The package contains the Eclipse for JEE Developers release in version 4.4.2. Install this SEU-as-code package using the following dependency:
```groovy
dependencies {
	software 'org.eclipse:eclipse-jee-luna:4.4.2:win'
}
```

gha_language: Roff


text:
## DESCRIPTION
The component is an easy representation of an animation of a component.

It could be useful for introductions or presentations with animations of texts or images or texts and images together.

## load animations into components in an easy way with app-component-animation-template
This project was generated with Angular CLI and is designed as a basic template combined with Angular.

You can find me at https://davidmartinezros.com or contact in the email<EMAIL_ADDRESS>
## youtube video
https://www.youtube.com/watch?v=hI7a4HskMIw

## demo using the component
https://davidmartinezros.com/Angular9/components-animations-project/

## how to use this component

You can use differents animation between, defining differents attributes:

```
<app-bounce-animation></app-bounce-animation>
<app-fade-animation></app-fade-animation>
<app-flip-animation></app-flip-animation>
<app-others-animation></app-others-animation>
<app-roll-animation></app-roll-animation>
<app-rotate-animation></app-rotate-animation>
<app-zoom-animation></app-zoom-animation>
```

You have to import the animation module into your app.module.ts file like this:

```
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { AppComponentAnimationTemplateModule } from 'app-component-animation-template';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AppComponentAnimationTemplateModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
```

And then, you can use the animations into the html of the component like this:

```
<app-bounce-animation showBounceIn="true" text="https://davidmartinezros.com"></app-bounce-animation>
or
<app-bounce-animation showBounceOutUp="true" text="https://davidmartinezros.com"></app-bounce-animation>
or
<app-fade-animation showFadeIn="true" image="assets/image.jpg"></app-fade-animation>
or
<app-fade-animation showFadeInRight="true" image="assets/image.jpg"></app-fade-animation>
```

## all possible options

The effects you can do are (indicating the attribute text or image in the component):

```
<app-bounce-animation></app-bounce-animation>
  showBounceIn, showBounceOut, showBounceInDown, showBounceOutDown, showBounceInUp, showBounceOutUp, showBounceInLeft, showBounceOutLeft, showBounceInRight, showBounceOutRight with the values true or false.
<app-fade-animation></app-fade-animation>
  showFadeIn, showFadeOut, showFadeInDown, showFadeOutDown, showFadeOutUp, showFadeOutUpBig, showFadeInUp, showFadeInDownBig, showFadeOutDownBig, showFadeInUpBig, showFadeInRightBig, showFadeOutLeftBig, showFadeInLeft, showFadeInLeftBig, showFadeInRight, showFadeOutLeft, showFadeOutRight, showFadeOutRightBig with the values true or false.
<app-flip-animation></app-flip-animation>
  showFlip, showFlipInX, showFlipOutX, showFlipInY, showFlipOutY with the values true or false.
<app-others-animation></app-others-animation>
  showFlash, showPulse, showRubberBand, showLightSpeedInRight, showLightSpeedOutRight, showLightSpeedInLeft, showLightSpeedOutLeft, showShake, showSwing, showTada, showWobble with the values true or false.
<app-roll-animation></app-roll-animation>
  showRollIn, showRollOut with the values true or false.
<app-rotate-animation></app-rotate-animation>
  showRotateIn, showRotateInDownLeft, showRotateInDownRight, showRotateInUpLeft, showRotateInUpRight, showRotateOutDownLeft, showRotateOutDownRight, showRotateOutUpLeft, showRotateOutUpRight, showRotateOut with the values true or false.
<app-zoom-animation></app-zoom-animation>
  showZoomIn, showZoomOutDown, showZoomOutUp, showZoomOutRight, showZoomOutLeft, showZoomInDown, showZoomInLeft, showZoomInRight, showZoomInUp, showZoomOut with the values true or false.
```

## Demo Example
You can find the demo here: https://davidmartinezros.com/portfolio-full-stack-developer-software-engineer/project/en/component-html-text-animations-angular


text:
# MyEAN_App
Custom editor for creating design patterns

CLone the project .
Run npm install for both frontend and backend.

start frontend using : ng-serve

start backend using : npm run dev

FUNCTIONALITY:

User will be able to upload multiple images.

To display uploaded image on canvas select the uploaded image.

User can rotate and scale images and text within the editor.

User can overlap multiple images.

The design can be saved locally and loaded multiple times.

Once finalized can be save to backend.

User can give custom background color to the canvas.

User will be able to load image on to the canvas by using any image URL.


text:
# Docker todo
[![Docker Image Version (latest by date)](https://img.shields.io/docker/v/nicholaswilde/todo)](https://hub.docker.com/r/nicholaswilde/todo)
[![Docker Pulls](https://img.shields.io/docker/pulls/nicholaswilde/todo)](https://hub.docker.com/r/nicholaswilde/todo)
[![GitHub](https://img.shields.io/github/license/nicholaswilde/docker-todo)](./LICENSE)
[![ci](https://github.com/nicholaswilde/docker-todo/workflows/ci/badge.svg)](https://github.com/nicholaswilde/docker-todo/actions?query=workflow%3Aci)
[![lint](https://github.com/nicholaswilde/docker-todo/workflows/lint/badge.svg?branch=main)](https://github.com/nicholaswilde/docker-todo/actions?query=workflow%3Alint)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)

A multi-architecture image for [todo](https://github.com/prologic/todo).

## Configuration

|user | uid |
|----:|:---:|
| abc | 911 |

See [todo](https://github.com/prologic/todo#configuration) for more configuration options.

## Development

See [docs](https://nicholaswilde.io/docker-docs/development/).

## Troubleshooting

See [docs](https://nicholaswilde.io/docker-docs/troubleshooting).

## Pre-commit hook

If you want to automatically generate `README.md` files with a pre-commit hook, make sure you
[install the pre-commit binary](https://pre-commit.com/#install), and add a [.pre-commit-config.yaml file](./.pre-commit-config.yaml)
to your project. Then run:

```bash
$ pre-commit install
$ pre-commit install-hooks
```
Currently, this only works on `amd64` systems.

## License

[Apache 2.0 License](./LICENSE)

## Author
This project was started in 2021 by [Nicholas Wilde](https://github.com/nicholaswilde/).

repository: lrxcy/docker-todo

repo_name: lrxcy/docker-todo


text:
---
title: "Swipyness of iPhone keyboards"
tags: "iphone mobile input keyboard"
layout: post
---

One of the first things I sorely missed from my Nexus 4 was the keyboard. Which
I knew was going to happen -- one of the things keeping me away from iPhones
was the lack of third party keyboards to enable swiping. That feature in iOS 8,
combined with the larger phone, wound up pulling me over.

Such a keyboard doesn't come with the phone, so you need to install one. There
are loads of reviews out there looking at multiple apps that do this
(just a few: [PCMag](http://www.pcmag.com/article2/0,2817,2471221,00.asp),
[Digital Trends](http://www.digitaltrends.com/mobile/ios8-keyboards-confirmed/),
[Forbes](http://www.forbes.com/sites/gordonkelly/2014/09/22/ios-8-the-best-apple-keyboard-replacements/)
[GeekWire](http://www.geekwire.com/2014/6-best-new-iphone-keyboards/),
[VentureBeat](http://venturebeat.com/2014/09/19/ios-8-keyboards-from-swiftkey-swype-fleksy-compared-everybody-wins/))
and of course they're of varying helpfulness. For my purposes, someone who had
used such a keyboard on Android was a better source than someone who had built
up quick habits on the iPhone keyboard over years.

In addition to writeups like the above there are, of course, reviews on the App
Store.  I don't have a lot of context about reviews
(beyond [hearing folks talk about it](http://atp.fm/)) -- how much
weight to give them, etc. Overall they weren't helpful at all, though
one part of them caught my eye. It seems like there are more people freaking
out than they would on Android because the phone can share things with a
server. Are Android folks just used to Google's algorithms consuming everything
you do to provide a better experience? Probably not.

Anyway, a few things about the couple keyboards I tried.

### Brilliant Keyboard

This had very good reviews. But the practical use was hugely frustrating. It
had a terrible time picking up intermediate letters on the swipe and the
recommendations were nonsensical. For example, trying to swipe the word
'points' was an exercise in futility. Not only did it only ever recognize
'pints', no matter how slowly I went, but it refused to offer up 'points' as a
suggestion.

To compensate I found myself swiping slower and slower, using the visual cues
(little blue dots over the keys) to ensure intermediate letters were captures.
And it was better. But the point of these keyboards is to type __faster__, so
slowing down just to make the app work made no sense.

Interface-wise, two things:

* I think it's a terrible idea to take up a key for theme switching -- do you
  really use that more often than say, a period? Are themes really that important?
* A trait it shares with the iPhone keyboard is not distinguishing the key
  faces between upper and lower case, forcing the user to look over to the
  lefthand shift indicator to tell you if you're in upper or lower case. This
  boggles my mind from Apple.

![Brilliant keyboard](/images/blog/keyboard_brilliant.png)

### SwiftKey

Some of the reviews referred to SwiftKey's Android heritage so, despite the
pretty terrible reviews, I had high hopes. And they were __redeemed__. Not only
is there a punctuation key ('.', which a long-press option for five other
common ones), the keycaps change to lower case! Predictions are excellent and
smart, and they take into account intermediate letters.

One of the only downsides is that there's no emoji keyset. The Android keyboard
integrates them with a long-press on return, maybe that's an option going
forward?

After using this for just a couple of minutes I was hooked. We'll see how well
it works over the long haul.

![SwiftKey keyboard](/images/blog/keyboard_swiftkey.png)

gha_language: CSS


text:
# StorageAccountPropertiesUpdateParameters

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**customDomain** | [***CustomDomain**](CustomDomain.md) |  | [optional] [default to nothing]
**encryption** | [***Encryption**](Encryption.md) |  | [optional] [default to nothing]
**accessTier** | **String** | Required for storage accounts where kind = BlobStorage. The access tier used for billing. | [optional] [default to nothing]
**azureFilesIdentityBasedAuthentication** | [***AzureFilesIdentityBasedAuthentication**](AzureFilesIdentityBasedAuthentication.md) |  | [optional] [default to nothing]
**supportsHttpsTrafficOnly** | **Bool** | Allows https traffic only to storage service if sets to true. | [optional] [default to nothing]
**networkAcls** | [***NetworkRuleSet**](NetworkRuleSet.md) |  | [optional] [default to nothing]
**largeFileSharesState** | **String** | Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. | [optional] [default to nothing]
**routingPreference** | [***RoutingPreference**](RoutingPreference.md) |  | [optional] [default to nothing]
**allowBlobPublicAccess** | **Bool** | Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property. | [optional] [default to nothing]
**minimumTlsVersion** | **String** | Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. | [optional] [default to nothing]

[[Back to Model list]](../README.md#models) [[Back to API list]](../README.md#api-endpoints) [[Back to README]](../README.md)

gha_language: Julia


text:
Neuronal Dynamics and Spiking Neural Networks
=============================================

Hi there! This playground contains all of my research into Spiking neural networks.

Resources:

 - [Neural Dynamics](https://neuronaldynamics.epfl.ch/online/index.html) by Gerstner, et al.
    - [Notes](./NeuralDynamics.md)

gha_language: Jupyter Notebook