text:
---
layout: post
title: Event Driven Map
date: 2020-08-14 09:00:00
summary: After implementing maps in react applications a few times, I have found that map components and react have have quite different, and largely incompatible abstractions.
---

## The Problem

After implementing maps in react applications a few times, I have found that map components
and react have have quite different, and largely incompatible abstractions.

A typical map control is initialised, with a DIV element it uses to render the map:

{% highlight js %}

const position = [51.505, -0.09]
const map = L.map('map').setView(position, 13)
{% endhighlight %}

You can then call methods on the map to change it's position and be notified of user interaction
such as panning and zooming:

{% highlight js %}
map.panTo(new L.LatLng(40.737, -73.923));
map.on('moveend', () => console.log('the user moved the map'))
{% endhighlight %}

There are react component that wrap up this API, and provide a component instead:

{% highlight js %}
<Map center={[51.505, -0.09]} zoom={13} />
{% endhighlight %}

There are 3rd party components that do this to varying degrees of success. I have even been
guilty of building similar components within a project to do the same thing.

At first glance this looks much easier, neater and more reacty. For a simple map this is
absolutely fine.

The problems start to occur with user interaction. If we want to manipulate the map
from code (say to zoom or pan it) we can update the props. However, the user can also manipulate
the map, so we'd need event handlers for `onZoom`, `onPan` etc... which update the state of the
parent component accordingly.

We then find ourselves duplicating the internal state of the map control as state in the react component.

There can be quite a bit of state, and this grows in complexity as we start using markers/popups,
additional layers, etc...

We also have to start writing code in the map component that looks at changes in the props to figure out
what methods to call on the map.

So we find ourselves updating state to move a map, which the map component then has to do a diff
on to figure out what method to call on the map control.

Writing lots of unnecessary code is a good sign that you're going wrong.

## The Solution

I have found a simple solution to this problem by using events instead of state. I guess they're a
lower level 'common denominator' abstraction.

Libraries such as [pubsub-js](https://www.npmjs.com/package/pubsub-js) make it easy to decouple your
application code into components that can send and subscribe to events.

In short, rather than propagating state to update the map position,
you raise a `map_move` event (or whatever you wish to call it) which a component that contains
the map control will subscribe to. It will then call the map API to adjust the map position. Likewise it
raises events when the map is moved by the user, and any component that wishes to update in response
to that event can subscribe.

This removes the need to hold the value for the map centre as state.

Likewise we can provide the same technique for zooming, adding/removing layers, displaying/hiding popups,
etc...

It means we end up with a map component that looks like this (simplified example) which doesn't
require any props:

{% highlight js %}
class MapComponent extends React.Component {

  componentDidMount() {

    // initialise the map
    const position = [51.505, -0.09]
    this.map = L.map('map').setView(position, 13)
    map.on('moveend', newPosition => PubSub.publish('map_moved', newPosition))

    // subscribe to requests to move the map
    PubSub.subscribe('move_map', this.handleMoveMap)
  }

  handleMoveMap = (_, newPosition) => {
    this.map.panTo(newPosition);
  }

  render() {
    return

  }
}
{% endhighlight %}

Other components can then request the map to be moved by raising the `move_map` event:

{% highlight js %}
PubSub.publish('move_map', newPosition)
{% endhighlight %}

Likewise, they can subscribe to changes in the map:

{% highlight js %}
PubSub.subscribe('map_moved', this.handleMoveMap)
{% endhighlight %}

I have implemented a simple example application which display earthquake locations.

[Example application](https://richorama.github.io/event-driven-map/)

[Example source code](https://github.com/richorama/event-driven-map)

Enjoy!

gha_language: SCSS


text:
# modernizr-server-dotnet

A library for accessing browser capabilities by [Modernizr](http://modernizr.com) on the server.

Adapted from James Pearce's [modernizr-server](https://github.com/jamesgpearce/modernizr-server) into ASP.NET 4.0 with C# code-behind. Currently this is ASP.NET forms version. I plan on making an MVC version as well (see to-do's below).

## How to Use
For existing projects, include the server-side code on Default.aspx.cs in the Page_Load method of your default page. For new projects, you can simply copy Default.aspx and Default.aspx.cs and use that as a start to your default page.

For new or existing projects, copy the ModernizrCookie.aspx and ModernizrCookie.aspx.cs files to your project. Also, grab the latest modernizr JS file from [Modernizr.com](http://modernizr.com) and include it in your project in the /js folder.

In your web.config file, make sure to configure the session state if you have a particular preference on the session state mode. See [MSDN](msdn.microsoft.com/en-us/library/ms972429.aspx) for a brief overview of the session state configurations. I have the following (pretty close to default) configuration in the project:

	<sessionState mode="InProc" cookieless="false" timeout="30" />

This mode is the fastest, and uses a cookie to store the SessionId. I also have a sliding timeout of 30 minutes.

After you have completed the above, on any page in your site, you can retrieve the Modernizr session object and store it in a dynamic variable like so:

	dynamic Modernizr = Session["Modernizr"];

You can see an example of this in VideoTest.aspx:

	dynamic Modernizr = Session["Modernizr"];
	if (Modernizr != null)
	{
		// Session object was succesfully retrieved and set
		if (Modernizr.video != null)
		{
			// at least one video property is supported
			if (Modernizr.video.h264)
			{
				// browser supports h.264
			}
			if (Modernizr.video.webm)
			{
				// browser supports webm
			}
			if (Modernizr.video.ogg)
			{
				// browser supports ogg
			}
		}
	}

## How it Works
Much like the PHP implementation, the .NET version uses a combination of a cookie and the user's browsing session. The first time a user visits the site (specifically the default.aspx page), the server will redirect to a ModernizrCookie.aspx page, which is responsible for running the Modernizr JS and creating a serialized cookie that holds the browsers capabilities. This cookie is set to expire after 24 hours.

After a cookie has been created (and on any new sessions for that particular user on that particular machine while the cookie is still valid) the server parses the cookie's data and places it in a dynamic object. The object is then stored in session and is available to any requests in that session.

A bit of an improvement from the PHP version...If a cookie cannot be created the first time during a particular session, it will try again up to a set number of times. If it is still unsuccesful, the Modernizr capabilities will simply not be available to use. Therefore, it is important to always have a fallback in case the Modernizr session object is not available, or a particular

## To-do's, etc.
1. This is not compatible with earlier versions of .NET (3.5, 2.0, etc.). The dynamic object I am using was introduced in .NET 4.0
2. Use with caution. I have not evaluated this for speed and efficiency in a production environment. This is merely for demonstration.
3. I plan on making an MVC version of this so it can be used in MVC applications.

license: MIT

repository: mrwaynelewis/modernizr-server-dotnet

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: mrwaynelewis/modernizr-server-dotnet


text:
---
layout: default
---

# 1996-03-13 - Re: Bell, Detweiler, Ravings, and Whatnot

## Header Data

From<EMAIL_ADDRESS>(Anonymous)

To<EMAIL_ADDRESS>Message Hash: 1ad36aa4e5de1685b5209e6fd09021d8701c6504ff0934be94f0523636b784b1

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1996-03-13 00:43:38 UTC

Raw Date: Wed, 13 Mar 1996 08:43:38 +0800

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Anonymous)
Date: Wed, 13 Mar 1996 08:43:38 +0800
To<EMAIL_ADDRESS>Subject: Re: Bell, Detweiler, Ravings, and Whatnot
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Timothy C. May writes in answer to jim bell -

|Screaming insults at people, resorting to ad hominem attacks on their
|personality (such as Jim did with Padgett Peterson), ranting about how
|people are fools and worse, and generally foaming at the mouth...these are
|behaviors which cause people to be dismissed as jerks, paranoids, and
|killfile occuppants.

|I have nothing against you, Jim Bell, but you are coming across as a loon,
|as someone who clearly needs some kind of anti-psychotic medication.
This is not supposed to be an insult??

|You rant, you quote excessively, you dissect short comments with
|pages-long diatribes
Says the one complaining of jim making ad hominem attacks.

{% endraw %}
```

## Thread

+ Return to [March 1996](/archive/1996/03)

+ Return to<EMAIL_ADDRESS>(Anonymous)](/authors/nobody_at_replay_com_anonymous_)"

+ 1996-03-13 (Wed, 13 Mar 1996 08:43:38 +0800) - Re: Bell, Detweiler, Ravings, and Whatnot -<EMAIL_ADDRESS>(Anonymous)_

gha_license_id: MIT


text:
# JSONStub

[![CI Status](http://img.shields.io/travis/Rafael da Silva Ferreira/JSONStub.svg?style=flat)](https://travis-ci.org/Rafael da Silva Ferreira/JSONStub)
[![Version](https://img.shields.io/cocoapods/v/JSONStub.svg?style=flat)](http://cocoapods.org/pods/JSONStub)
[![License](https://img.shields.io/cocoapods/l/JSONStub.svg?style=flat)](http://cocoapods.org/pods/JSONStub)
[![Platform](https://img.shields.io/cocoapods/p/JSONStub.svg?style=flat)](http://cocoapods.org/pods/JSONStub)

## Example

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements

## Installation

JSONStub is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod "JSONStub"
```

## Author

Rafael da Silva Ferreira<EMAIL_ADDRESS>
## License

JSONStub is available under the MIT license. See the LICENSE file for more info.

repository: Swift-Yah/JSONStub

repo_name: Swift-Yah/JSONStub


text:
## Bmi Calculator in React

This is a BMI-Calculator that we creating using React 16.12.0.
The user can calculate their BMI with both Metric and Imperial system.

### Link:
https://bmicalcwithreact.netlify.com/

### Tested with:
- We have used Cypress for acceptance test
- We have used Jest with Enzyme for component testing

### User Stories:
- As a user
In order to get my BMI index
I would like to be able to put in my personal height and weight

- As a user
In order to know what value that BMI index has
I would like to be presented with the message explaining the index

- As a user
In order to calculate my index in both Metric and Imperial systems
I would like to be able to choose what system I want to use

### Improvements/Updates:
- As a user
In order to have my personal account
I would like to be able to log in

- As a user
In order to keep track of my development
I would like to be able to see a list of previous BMI index

- We would also need to add styling to the page to make it more user friendly and better looking.

### License:
#### MIT-license


text:
The official implementation of Mask-aware IoU and maYOLACT detector. Our implementation is based on [mmdetection](https://github.com/open-mmlab/mmdetection).

> [**Mask-aware IoU for Anchor Assignment in Real-time Instance Segmentation**](https://arxiv.org/abs/2110.09734),
> [Kemal Oksuz](https://kemaloksuz.github.io/), Baris Can Cam, Fehmi Kahraman, Zeynep Sonat Baltaci, [Emre Akbas](http://user.ceng.metu.edu.tr/~emre/), [Sinan Kalkan](http://www.kovan.ceng.metu.edu.tr/~sinan/),
> *BMVC 2021. ([arXiv pre-print](https://arxiv.org/abs/2110.09734))*

## Summary

**Mask-aware IoU:** Mask-aware IoU (maIoU) is an IoU variant for better anchor assignment to supervise instance segmentation methods. Unlike the standard IoU, Mask-aware IoU also considers the ground truth masks while assigning a proximity score for an anchor. As a result, for example, if an anchor box overlaps with a ground truth box, but not with the mask of the ground truth, e.g. due to occlusion, then it has a lower score compared to IoU. Please check out the examples below for more insight. Replacing IoU by our maIoU in the state of the art ATSS assigner yields both performance improvement and efficiency (i.e. faster inference) compared to the standard YOLACT method.

**maYOLACT Detector:** Thanks to the efficiency due to ATSS with maIoU assigner, we incorporate more training tricks into YOLACT, and built maYOLACT Detector which is still real-time but significantly powerful (around 6 AP) than YOLACT. Our best maYOLACT model reaches SOTA performance by 37.7 mask AP on COCO test-dev at 25 fps.

## How to Cite

Please cite the paper if you benefit from our paper or the repository:
```
@inproceedings{maIoU,
       title = {Mask-aware IoU for Anchor Assignment in Real-time Instance Segmentation},
       author = {Kemal Oksuz and Baris Can Cam and Fehmi Kahraman and Zeynep Sonat Baltaci and Sinan Kalkan and Emre Akbas},
       booktitle = {The British Machine Vision Conference (BMVC)},
       year = {2021}
}
```

## Specification of Dependencies and Preparation

- Please see [get_started.md](docs/install.md) for requirements and installation of mmdetection.
- Please refer to [introduction.md](docs/getting_started.md) for dataset preparation and basic usage of mmdetection.

## Trained Models
Here, we report results in terms of AP (higher better) and oLRP (lower better).

### Multi-stage Object Detection

#### Comparison of Different Assigners (on COCO minival)

|    Scale     |  Assigner  | mask AP |  mask oLRP |  Log  | Config | Model |
| :-------------: | :-----: | :------------: | :------------: | :-------: | :-------: |:-------: |
|    400    |  Fixed IoU  | 24.8 | 78.3 |[log](https://drive.google.com/file/d/1WxebikClTJIaHYxTfw7BUSOS3wZFlOOh/view?usp=sharing) | [config](configs/mayolact/yolact_r50_4x8_coco_scale400.py) | [model](https://drive.google.com/file/d/1juGIBsbyxb-FPKpssSSYQniTDUt8XRac/view?usp=sharing)  |
|    400    |  ATSS w. IoU  | 25.3 | 77.7 |[log](https://drive.google.com/file/d/1R-uHrZtvZ3loei0cP2FN8higOnP2ERgv/view?usp=sharing) | [config](configs/mayolact/yolact_r50_4x8_coco_scale400_ATSSwIoU.py) | [model](https://drive.google.com/file/d/1ZofI86srVyHwhEeOKGg8gIbGJiTZjW2f/view?usp=sharing)  |
|    400    |  ATSS w. maIoU  | 26.1 | 77.1 |[log](https://drive.google.com/file/d/1nkHcvveQSrVhPzMIsmDjhUZagfbg4NF7/view?usp=sharing) | [config](configs/mayolact/yolact_r50_4x8_coco_scale400_ATSSwmaIoU.py) | [model](https://drive.google.com/file/d/1ZM6izGY_zPDwuPSTienYpJCW9zFxZKIk/view?usp=sharing)  |
|    550    |  Fixed IoU  | 28.5 | 75.2 |[log](https://drive.google.com/file/d/1FGR-uxeABGcvX8GSy56vCiowQZWbl5F8/view?usp=sharing) | [config](configs/mayolact/yolact_r50_4x8_coco_scale550.py) | [model](https://drive.google.com/file/d/1nUyT2rhnYxVa4vNd3BccOwchWKYAnLJp/view?usp=sharing)  |
|    550    |  ATSS w. IoU  | 29.3 | 74.5 |[log](https://drive.google.com/file/d/1MLzwxnKLrYT3rJ17QciOFTEVvMYR2vMY/view?usp=sharing) | [config](configs/mayolact/yolact_r50_4x8_coco_scale550_ATSSwIoU.py) | [model](https://drive.google.com/file/d/1j2eqLPWzmNOtD5M5E1igMDgVhllQGezk/view?usp=sharing)  |
|    550    |  ATSS w. maIoU  | 30.4 | 73.7 |[log](https://drive.google.com/file/d/1x1Rqh9CP-XxfU3LKqVfXCe438KtEN8jM/view?usp=sharing) | [config](configs/mayolact/yolact_r50_4x8_coco_scale550_ATSSwmaIoU.py) | [model](https://drive.google.com/file/d/16Q_MjLsA-vMHpvU_CNxG94Qd4U2P1kjA/view?usp=sharing)  |
|    700    |  Fixed IoU  | 29.7 | 74.3 |[log](https://drive.google.com/file/d/17fFPT_40tAFjwbmdlgQrBRfdo4txpc8p/view?usp=sharing) | [config](configs/mayolact/yolact_r50_4x8_coco_scale700.py) | [model](https://drive.google.com/file/d/1X6iwNV39-1juMfzbwaJxBqLcrERleiQK/view?usp=sharing)  |
|    700    |  ATSS w. IoU  | 30.8 | 73.3 |[log](https://drive.google.com/file/d/1QQQhD_47vkYZYEXKCliC9fzJHabaXEpY/view?usp=sharing) | [config](configs/mayolact/yolact_r50_4x8_coco_scale700_ATSSwIoU.py) | [model](https://drive.google.com/file/d/1jOoiPLguZ4x6dihDNuHurI4iTLawCtVw/view?usp=sharing)  |
|    700    |  ATSS w. maIoU  | 31.8 | 72.5 |[log](https://drive.google.com/file/d/1YuglESo8gt8fEbDavaCKoPd-gSAVDLs6/view?usp=sharing) | [config](configs/mayolact/yolact_r50_4x8_coco_scale700_ATSSwmaIoU.py) | [model](https://drive.google.com/file/d/1uUMUOQoes-biTIMx3JeFcwMnhGMIBxYH/view?usp=sharing)  |

### maYOLACT Detector (on COCO test-dev)

|    Scale     |  Backbone  | mask AP | fps |  Log  | Config | Model |
| :-------------: | :-----: | :------------: | :------------: | :-------: | :-------: | :-------: |
| maYOLACT-550 |    ResNet-50 |   35.2  |   30  | Coming Soon | |
| maYOLACT-700 |    ResNet-50 |   37.7  |   25  | Coming Soon | |

## Running the Code

### Training Code
The configuration files of all models listed above can be found in the `configs/mayolact` folder. You can follow [get_started.md](docs/get_started.md) for training code. As an example, to train maYOLACT using images with 550 scale on 4 GPUs as we did, use the following command:

```
./tools/dist_train.sh configs/mayolact/mayolact_r50_4x8_coco_scale550.py 4
```

### Test Code
The configuration files of all models listed above can be found in the `configs/mayolact` folder. You can follow [get_started.md](docs/getting_started.md) for test code. As an example, first download a trained model using the links provided in the tables below or you train a model, then run the following command to test a model model on multiple GPUs:

```
./tools/dist_test.sh configs/mayolact/mayolact_r50_4x8_coco_scale550.py ${CHECKPOINT_FILE} 4 --eval bbox segm
```
You can also test a model on a single GPU with the following example command:
```
python tools/test.py configs/mayolact/mayolact_r50_4x8_coco_scale550.py ${CHECKPOINT_FILE} --eval bbox segm
```


text:
## Currency Converter

A Currency Converter App Which can convert indian currency into 8 other Currencies which includes

+ Dollar
+ Australian Dollar
+ Canadian Dollar
+ Bitcoin
+ Peso
+ Yen
+ Diram
+ Sterling

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

![](https://s3.amazonaws.com/poly-screenshots.angel.co/Project/76/1056860/2183914391d541e7c32d4d03e40ec9f2-original.png)


text:
# MyPerf4J
![Markdown](https://raw.githubusercontent.com/ThinkpadNC5/Pictures/master/MyPerf4J_LOGO_V3_com.jpeg)
> A high performance and non-intrusive real-time Java performance monitoring and statistical tool designed for high-concurrency, low-latency applications. Inspired by [perf4j](https://github.com/perf4j/perf4j) and [TProfiler](https://github.com/alibaba/TProfiler).

MyPerf4J has the following features:
*  No intrusion: using JavaAgent mode, no intrusion to the application, no need to modify the application code.
*  High performance: Very low performance consumption, only 73ns per record, can be used in production environment for a long time.
*  Low memory: With memory multiplexing, only a small number of temporary objects are generated throughout the life cycle, and the GC of the application is not affected.
*  High precision: using nanoseconds to calculate response time.
*  Real-time: Supports second level monitoring, minimum 1s!

## Multilingual document
* English [Document](https://github.com/ThinkpadNC5/MyPerf4J/wiki/English-Doc)
* [中文README](https://github.com/ThinkpadNC5/MyPerf4J/blob/develop/README.CN.md) [中文文档](https://github.com/ThinkpadNC5/MyPerf4J/wiki/Chinese-Doc)

## What does it monitor?
MyPerf4J collects dozens of metrics per application. All these metrics are collected and visualized in real-time.

This is a list of what it currently monitors:
* **[Method](https://grafana.com/dashboards/7766)**

RPS，Count，Avg，Min，Max，StdDev，TP50, TP90, TP95, TP99, TP999, TP9999, TP99999, TP100
![Markdown](https://raw.githubusercontent.com/ThinkpadNC5/Pictures/master/MyPerf4J-InfluxDB-Method_Show_Operation.gif)
![Markdown](https://raw.githubusercontent.com/ThinkpadNC5/Pictures/master/MyPerf4J-InfluxDB-Method_Just_Record.gif)

* **[JVM Thread](https://grafana.com/dashboards/7778)**

TotalStarted，Runnable，Blocked，Waiting，TimedWaiting，Terminated，Active，Peak，Daemon，New
![Markdown](https://raw.githubusercontent.com/ThinkpadNC5/Pictures/master/MyPerf4J-InfluxDB-JVM-Thread_Just_Record.gif)

* **[JVM Memory](https://grafana.com/dashboards/7775)**

HeapInit，HeapUsed，HeapCommitted，HeapMax，NonHeapInit，NonHeapUsed，NonHeapCommitted，NonHeapMax
![Markdown](https://raw.githubusercontent.com/ThinkpadNC5/Pictures/master/MyPerf4J-InfluxDB-JVM-Memory_Just_Record.gif)

* **[JVM GC](https://grafana.com/dashboards/7772)**

CollectCount，CollectTime
![Markdown](https://raw.githubusercontent.com/ThinkpadNC5/Pictures/master/MyPerf4J-InfluxDB-JVM-GC_Just_Record.gif)

* **[JVM Class](https://grafana.com/dashboards/7769)**

Total，Loaded，Unloaded
![Markdown](https://raw.githubusercontent.com/ThinkpadNC5/Pictures/master/MyPerf4J-InfluxDB-JVM-Class_Just_Record.gif)

> Want to know how to achieve the above effect? Please start the application according to the description of [Quick Start](https://github.com/ThinkpadNC5/MyPerf4J/blob/develop/README.EN.md#quick-start), and then follow the instructions in [here](https://github.com/ThinkpadNC5/MyPerf4J/wiki/InfluxDB) to install and configure.

## Quick start
MyPerf4J adopts JavaAgent configuration mode, **transparent** access application, and the application code is completely **no-intrusive**.

### Build
* git clone git@github.com:ThinkpadNC5/MyPerf4J.git
* mvn clean package
* Rename MyPerf4J-ASM-${MyPerf4J-version}.jar to MyPerf4J-ASM.jar

### Configure
Add the following two parameters to the JVM startup parameters
> -javaagent:/your/path/to/MyPerf4J-ASM.jar
> -DMyPerf4JPropFile=/your/path/to/myPerf4J.properties

Among them, the configuration of `MyPerf4JPropFile` is as follows:

```
#Application name
AppName=MyPerf4JTest

#Configure MetricsProcessors type 0:Output to stdout.log in a standard formatted structure 1:Output to disk in standard formatted structure  2:Output to disk in InfluxDB LineProtocol format
MetricsProcessorType=1

#Config metrics log file, option
MethodMetricsFile=/data/logs/MyPerf4J/method_metrics.log
#ClassMetricsFile=/data/logs/MyPerf4J/class_metrics.log
#GCMetricsFile=/data/logs/MyPerf4J/gc_metrics.log
#MemMetricsFile=/data/logs/MyPerf4J/memory_metrics.log
#ThreadMetricsFile=/data/logs/MyPerf4J/thread_metrics.log

#Configure the log file scrolling interval, which has three values: MINUTELY, HOURLY, and DAILY.
LogRollingTimeUnit=HOURLY

#Configure the number of backup Recorders. The default is 1, the minimum is 1, and the maximum is 8. When you need to count a large number of method performance data in a smaller MillTimeSlice, you can configure a larger number.
BackupRecordersCount=1

#configure RecordMode，accurate/rough
RecorderMode=accurate

#configure TimeSlice，time unit: ms，min:1s，max:600s
MillTimeSlice=60000

#config show method params type
ShowMethodParams=true

#configure packages，separated with ';'
IncludePackages=cn.perf4j;org.myperf4j

#configure packages，separated with ';'
ExcludePackages=org.spring;

#configure methods，separated with ';'
ExcludeMethods=equals;hash

#true/false
ExcludePrivateMethod=true

#General method execution time threshold in ms
ProfilingTimeThreshold=1000

#The number of times the method execution time threshold is exceeded in a time slice, valid only when RecorderMode=accurate
ProfilingOutThresholdCount=10
```

### Run
* The output is to /data/logs/MyPerf4J/method_metrics.log:

    ```
    MyPerf4J Performance Statistics [2018-07-01 23:40:23, 2018-07-01 23:40:24]
    Api[2/3]                    RPS  Avg(ms)  Min(ms)  Max(ms)   StdDev     Count     TP50     TP90     TP95     TP99    TP999   TP9999  TP99999    TP100
    DemoServiceImpl.getId1  7454181     0.00        0        0     0.00   7454181        0        0        0        0        0        0        0        0
    DemoServiceImpl.getId2  7454180     0.00        0        0     0.00   7454180        0        0        0        0        0        0        0        0
    ```

### Uninstall
Remove the following two parameters from the JVM startup parameters and restart to uninstall the tool.
> -javaagent:/your/path/to/MyPerf4J-ASM.jar
> -DMyPerf4JPropFile=/your/path/to/myPerf4J.properties

## Issues
If you encounter any issues or if you have a question, don't hesitate to [create an issue](https://github.com/ThinkpadNC5/MyPerf4J/issues/new) : )

## More Information
For more information about the project, please see [https://github.com/ThinkpadNC5/MyPerf4J/wiki/English-Doc](https://github.com/ThinkpadNC5/MyPerf4J/wiki/English-Doc).


text:
Wayback Frontned
## HTTP API

### GET :3001/version
Returns the current version string (from package.json)

### GET :3001/healthz
Returns 200 with no content if healthy
Returns 500 with error message if not healthy

### GET /

Requests the homepage


text:
# Exporting to Windows Store (UWP, HoloLens)

This SDK has a dependency on `sqlite` which has to be installed seperately after building the `Windows Store` solution:

* Open exported `Windows Store` solution
* `Tools -> Extensions and Updates`
  * Search for `sqlite`
  * Install `SQLite for Universal Windows Platform`
* Right click on `References` of the default project
  * `Add Reference`
  * Expand `Universal Windows` on the left
  * Click `Extensions`
  * Check `SQLite for Universal Windows Platform`

The `Windows Store` solution should build successfully now.

repository: simonbroggi/mapbox-unity-sdk

branch_name: refs/heads/develop

gha_license_id: NOASSERTION

repo_name: simonbroggi/mapbox-unity-sdk


text:
---
title: 'Twenty-Three: Identity Risk'
date: 2020-08-03 00:00:00 Z
permalink: identity-risk
tags:
- twenty-third-week
layout: post
author: Brennan Brown
comment: true
---

# August 3rd

**Week Twenty-three!** I know I said this entry would be late, but I couldn't help myself. I'm currently in a rather comfortable hotel room that I managed to book last minute as I make my way back to the city and back to work.

I tried my best to prepare Beeminder accordingly, but I'm afraid that it seems like I found out about my impromptu trip a little too late, and had a handful of derailments occur when I was out in the woods and couldn't do much about them. I feel like that might have to do with me being forgetful about auto-ratcheting overriding breaks, I think? Regardless, I need to plan better.

 I either work really hard, or I'm resolved to absolute laziness. Structuring my relaxation in general is entirely new to me. But I think it's really great, as I am really biting to get back into the swing of things unlike when I procrastinate or otherwise neglect work for a handful of days (or longer).

It's probably a problem that a lack of progress is so bothersome to me. In full transparency, looking at the flat lines that now encompass all of my beeminders begrudges me. I don't think it's the work itself, but rather the consistency of the work. Perhaps I am moreso wary of my own behaviour of letting the dying off of momentum beget less and less momentum.

Anyways, enough about the minutiae!

I wanted to thank you for your insights, Adam. I'm glad I take a week to respond and meditate on such helpful advice instead of replying quickly and having it thrown into the ether with the insurmountable amount of other information that I find myself surrounded with.

It allows me to take the time to look into your work, and I simply have great admiration for what you do. I'm very grateful to get advice from somebody so experienced and I'd like to respond to your thoughts in detail.

<q>If you are interested in FOSS stuff, I would recommend a few things, most of which are applicable to all of life, not just FOSS:</q>

- Be careful about what you tie your identity to. If you define yourself as a developer and then isn’t right for you or the world or it turns bad or just isn’t purposeful anymore, you can spend a lot of valuable time towards something unhelpful.
- Be careful about others, especially about security. Just because tech and programming can make the world a better place doesn’t mean that it always does, and there are folks out there who aren’t like the programmers at all who will use software in ways the programmers don’t intend.

First and foremost, identity: This is something I have had a reckoning with my whole long life. There are many labels that I associate myself with--be it out of voluntary want, or the realization that there's an inability to escape them.

Specifically, I originally went to college to be a software developer four years ago. Three years before that is when I first began tinkering with makeshift themes on Tumblr, and installed [Crunchbang!](https://en.wikipedia.org/wiki/CrunchBang_Linux) and began to fall in love with ability to create and destroy just by typing things.

I have realized at this point, whether I like it or not, I am a developer. ¯\_(ツ)_/¯ It's just too much fun to make websites and write out documentation and learn new technologies. Of course I don't think I'm a *good* developer, but I develop.

Second, and I'm sure this can be attributed to my lack of experience and naïve attitude, but I frankly am not worried about being careful. I understand (or at least think I do) the consequences of the openness in open-source, and the weight of dependencies others inevitably cause. Even with worst-case scenarios, time you enjoy wasting is not wasted time.

I sincerely recognize where you're coming from, but these are things that I'm steadfast in, whether that's a good or bad thing.

(PS. Related to Beeminder this time, my girlfriend suggested I refer to my entire group of Beeminder systems as a *Beehive*. I'm really not sure if that's too clever or too cheesy.)

repository: brennanbrown/journalbar

gha_language: HTML

repo_name: brennanbrown/journalbar


text:
# PlotMaker MKII

![Alt text](screenshots/Plotmaker.png "PlotMaker")

PlotMaker MK2 is a processing application I created that allows the user to take advantage of the generative power of their computer. The application reads image data and displaces a predetermined set of lines to “draw” the image onto 4 separate CMYK layers. But the real power comes in the abstraction of the original form through this process.

Images can be sourced from Unsplash.com directly or the user can drag and drop their own into the window. With variable resizing of the output, any specific sizing can be generated using just a few clicks.
The application also adds elements of randomness and noise to the final output to create a remix of the original image.

This final output can be exported and plotted using a pen plotter such as the iDraw or the Axidraw easily because of the spliced layer output.

## Requirements
```bash
import processing.svg.*;
import de.ixdhof.hershey.*;
import controlP5.*;
import drop.*;
import milchreis.imageprocessing.*;
import milchreis.imageprocessing.utils.*;
import at.mukprojects.console.*;
```
The sketch needs the processing SVG library, HersheyText library, ControlP5 library, the Drop library, The Image Processing Algorithms library, and the Console library. All are available within the native processing library manager. Install before use and then run!

## Output Examples
![Alt text](Output/Image-5_5_2021_12_45_18.png "example image 1")
![Alt text](Output/Image-5_5_2021_12_51_37.png "example image 2")
![Alt text](Output/Image-5_5_2021_12_52_56.png "example image 2")

## Usage
### Image
![Alt text](screenshots/frame1ui.png "Frame 1")

The IMAGE UI controls the image used to displace the lines in the final output. The unsplash keyword is the search term used to source images from unsplash. NEWIMAGE gets a new image from unsplash. The image will automatically fit to the window but if you resize it, FITIMAGE will return it to its best size. IMAGEXPOS and IMAGEYPOS allow you to move the image in the window. IMAGESCALE allows you to zoom in and out, however, edges of the image may be visible. EXPOSURE raises and lowers the overall brightness of the image. CONTRAST raises and lowers the contrast. CONTRAST is destructive unfortunatly so raising it and then lowering it doesnt return to exactly the same visual quality of the original image.

### Text
![Alt text](screenshots/frame2ui.png "Frame 2")

The TEXT UI controls the the text added to create a knockout effect in the final output. TEXTXPOS and TEXTYPOS allow you to move the text around. TEXTROTATION allows you to rotate the text and it snaps to 40 degree incriments. LEADING increases or decreases line spacing. TEXTBOXWIDTHOFFSET allows you to decrease the width of the text box so you can force multiple lines of text. INPUT is the input box for text input. FONTSELECTION allows you to change the font of the text.

### Output
![Alt text](screenshots/outputui.png "Output")

The OUTPUT UI controls the parameters on which the lines drawn to the final image operate. This is where the fun is. YELLOWTOLERANCE, MAGENTATOLERANCE, CYANTOLERANCE,BLACKTOLERANCE control the tolerance range between which lines are drawn on their respective color layers. each layer only samples the underlying color of the pixels in their color space. TOLERANCERANGE is the range above and below the average tolerance that is sampled. MARGIN is the white space around the drawn image. LINESPACING is how closly the line are drawn to eachother (anything less than two will severly slow down the program, it still works but be patient.) LAYER1, LAYER2, LAYER3, LAYER4 open a color picker that lets you change the color of that layer. RANDOMCOLOR generates random colors for each layer.

### Viewport
![Alt text](screenshots/viewportui.png "Viewport")

The VIEWPORT section allows you to changes the size and scope of the panels found in the window. VIEWPORTSCALER will zoom in an out on each frame. This setting will automatically resize to fit the canvas in the window. HIDECONSOLE will hide the terminal window at the bottom of the screen. VIEWPORTPRESET allows you to see 1 specific frame or all 3 at the same time.

### Export
![Alt text](screenshots/exportui.png "Export")

The EXPORT UI controls the size of the image that is rendered out. OUTPUTWIDTH and OUTPUTHEIGHT are the actual pixel dimensions of the output canvas. After changing these, the user needs to press UPDATEBUFFERSIZE to trigger the change and the auto resizing of the image. SIZEPRESET allows you to pick from some common plotting sizes. SAVESVG renders out and SVG to the sketch folder titled output. SAVEPNG renders out a png to the same folder.

## Known Issues

Since we are dealing with vector shapes instead of pixels, the computational power needed is higher than you might expect. At the "postcard" size, everything runs at speed, however, at the larger sizes you might notice a bit of loading time. Also, decreasing the LINESPACING to 1 rather than 2 or higher GREATLY slows the program down because it has to check every single pixel in the image and draw a control point for it instead of simply half or a third.

## License
MIT License

Copyright (c) 2021 Adam Dworetzky

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

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

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

repository: adworetzky/PlotMaker

repo_name: adworetzky/PlotMaker


text:
#Installing and setting up the backend

##Step 1: Fowarding ports
Modify Vagrantfile to forward python server and Influx ports.
```
node.vm.network "forwarded_port", guest: 4000, host: 4000
node.vm.network "forwarded_port", guest: 8086, host: 8086
```
In the nginx.conf file, add the following location directives:
```
location /visualization/influx/{
    proxy_pass http://contiv215:8086/;
}
location /visualization/service {
    proxy_pass http://contiv215:4000;
}
```

##Step 2: Setup containers and services
If you have no containers running, you can run serviceInit.sh to start some sample services.
On Node 1:
```
$ ./serviceInit.sh
```
And to add endpoint containers on other nodes:
```
./serviceInit.sh -c
```

##Step 3: Setting up the python servers
On all nodes, run:
```
$ python telegrafdatasource.py
```

##Step 4: Installing and Running telegraf and InfluxDB:
On Node 1:
```
$ sudo ./backendConfig.sh
```

repository: contiv/contiv-ui

gha_language: JavaScript

repo_name: contiv/contiv-ui


text:
# Architecture Design of BaudSQL

MySQL driver --> BaudSQL --> BaudEngine

## Compatible with MySQL
BaudSql is compatible with mysql protocol,uses could connect to baudsql through mysql driver.

## Support pluggable Engine

BaudSQL is native supported by BaudEngine,and we suggest users use BaudEngine  which  engine we will give priority to support.

BaudSQL is designed to be decoupled with specified engine.So far we can only support BaudEngine,but we will eventually support multiple engines.

We will provide a unified engine interface specification, users can also implement their own engine according to the interface specification which we provide.

## Distributed Transaction

BaudSQL implement distributed transactions based on two-phase commit.

## Data Model Mapping

table vs space

space = tables sharing the same partitioning key

row vs object

object fields = row fields + the field of 'tableid'

## Metadata Management

There is a 'system' DB on BaudEngine.

The partitioning key,partitioning algorithm,tables,databases,baudegines are included in the 'system' db.

## BaudSqlService

BaudSqlService is primarily responsible for metadata management, modification, presentation, notification, and provides metadata management and browsing interfaces.

## SQL Parsing, Planning, and Executing


text:
# Contributing

The contributor understands that any contributions, if accepted by the OGC Membership, shall be incorporated into OGC standards documents and that all copyright and intellectual property shall be vested to the OGC.

The OGC Features and Geometries JSON Standards Working Group (SWG) is the group at OGC responsible for the stewardship of the standard, but is working to do as much work in public as possible.

* [Open issues](https://github.com/opengeospatial/OGC-feat-geo-json/issues)
* [Copy of License Language](https://raw.githubusercontent.com/opengeospatial/OGC-feat-geo-json/master/LICENSE)

## Propose a change to a draft of a specification document

GitHub is used to develop the specification(s) using the following process:

* The "master" branch is the editors' draft.
* To propose a change, edit the AsciiDoc files for the draft document in a branch or fork of the master branch.
  * If you want to propose multiple changes, use separate branches so that the working group can discuss and accept or reject changes individually.
* Commit the changes to a branch on GitHub.
* Create a pull request for the branch or fork and submit it.
* The working group will discuss pull requests and approved pull requests will be merged by the editors. The editors will also regenerate the HTML document to keep the AsciiDoc and HTML versions of the editors' draft in sync.

## How to submit pull requests

This assumes that you are familiar with *git* and *GitHub*. GitHub offers training courses, for example, [Introduction to GitHub](https://services.github.com/on-demand/intro-to-github/).

One of the following two workflows are recommended. In both cases the AsciiDoc and other files are edited locally in a branch. The difference is whether the git command line interface is used or the GitHub Desktop tools.

### Use the GitHub Desktop tools

The steps below link to a tutorial from GitHub. Please keep in mind that you will not edit pages of some website, but the AsciiDoc files of the OGC Features and Geometries JSON standard.

* [Install GitHub Desktop](https://services.github.com/on-demand/github-desktop/)
* [Clone the Repository](https://services.github.com/on-demand/github-desktop/clone-repository-github-desktop), use https://github.com/opengeospatial/OGC-feat-geo-json as the repository
* [Create Local Branches](https://services.github.com/on-demand/github-desktop/create-branches-github-desktop)
* [Make Local Changes](https://services.github.com/on-demand/github-desktop/make-changes-github-desktop), ignore the specific discussion related to GitHub Pages.
* [Add Local Commits](https://services.github.com/on-demand/github-desktop/add-commits-github-desktop)
* [Open a Pull Request](https://services.github.com/on-demand/github-desktop/pull-request-github-desktop)

Note that as the editors' draft is updated after the merge of a pull request into the master branch, you should [update your local copy](https://services.github.com/on-demand/github-desktop/push-with-github-desktop) before making new edits to lower the risk of conflicts.

### Use the Git command line interface

If the Mac Git Bash command-line tool is preferred, consider learning the steps described at the [Code School Git Tutorial](https://try.github.io/levels/1/challenges/1).

repository: gitter-badger/ogc-feat-geo-json

branch_name: refs/heads/main

repo_name: gitter-badger/ogc-feat-geo-json


text:
A-star Pathfinding Algorithm
=============================

Deliverables
--------------

The entire root directory for A6 including the app/ templates/ static/
directories zipped.

Due:
-------

April 25, 2014 11:59AM

This project will teach you how to use a simple heuristic in order to
efficiently search for a path through a map and avoiding obstacles.

Refer to the following guide: [A star for
Beginners](http://www.policyalmanac.org/games/aStarTutorial.htm)

Overview of the steps are as follows:

- Create a PriorityQueue class in the astar package
- Create a pathfinding routine in astar package
- Make sure the web framework can find your routines and classes
- run: python run.py

You may modify any source file if you want to customize your application to
work differently from my design. However, to make things easier, I took my
working implementation, deleted some source code in certain functions and ask
that you implement those sections yourself.


text:
title= Overview
date=2013-08-25
type=overview
tags=blog
status=published
~~~~~~

# IPGeolocation

IPGeolocation provides three APIs:
[IP Geolocation API](https://ipgeolocation.io/documentation/ip-geolocation-api-201812061140)
IP Geolocation API can be used to get real-time and accurate geolocation for any IP address. You can geolocate your online visitors and provide them customized experience accordingly.
* [Timezone API](https://ipgeolocation.io/documentation/timezone-api-201812061213)
The Timezone API can be used to get accurate, real-time date, time and timezone information.
* [Astronomy API](https://ipgeolocation.io/documentation/astronomy-api-201812061214)
The Astronomy API can used to get the location-based rise and set times for the Sun and the Moon, including current position, angle, and distance of the Sun and the Moon for a date.

This documentation provides complete details of features and available options in the above APIs. For information related to our IP Geolocation API Database, please [contact](https://ipgeolocation.io/contact) our support.

## Authorization

We provide two ways of authorization which are, by using the:
* API Key
* Request Origin

In order to use the APIs, [sign up](https://ipgeolocation.io/signup) for a desired plan.

All of our paid plans come with 7 days free trial. We also have a free plan which gives you 1500 requests per day. We provide the same API response in our free as well as paid plans over https. _Response in multiple languages_, _Bulk IP Geolocation Lookup_ and _Request Origin Support_ are not available for free plans, however.

Here is an overview of both authorization methods.

### API Key

You can make authorized requests to our API by passing API key as a query parameter. To get your API key, login to our API console and get your API key from there. We strongly discourage the use of API key in client-side JavaScript as it will expose your API key to the public.

In order to use API key in the client-side JavaScript, use the _Request Origin_ approach.

### Request Origin

This feature is available for paid plans only. The purpose of this feature is to call our API from the client-side JavaScript without using your API key.

To use this feature, go to application console and click on `Add New` button in the dashboard section. A popup will open up. Enter the domain name of the website from where you'll be making requests.

Once saved successfully, you can make requests from the main domain as well as all of the subdomains of the main website.

#### Limit on No. of Request Origins

The number of request origins is limited based on the user's plan.

|Subscription Plan|No. of Request Origins|
|-----------------|----------------------|
|Bronze|1|
|Bronze+|1|
|Silver|2|
|Silver+|2|
|Gold|3|
|Platinum|3|
|Diamond|3|

To add more request origin than your limit, you can leave a message at [contact us](https://ipgeolocation.io/contact). Extra request origins are charged $2.5 per month each.

## Get IP

Get IP endpoint returns the IP address of the client from where it's called. So if you call it from your server, it returns IP address of the server. If it's called from your website like using JavaScript, it will return the IP address of the person viewing your website. This endpoint does not require any authentication and you can use this endpoint without creating an account. Here is a ```curl``` example:

```curl
$ curl 'https://api.ipgeolocation.io/getip'

{
    "ip": "<IP_ADDRESS>"
}
```

## JSON and XML Response Formats

All the endpoints of IPGeolocation API can respond in JSON and XML formats, JSON is the default response format.

### XML Format

You can get API response in XML format in two ways:
1. Pass **output=xml** as a URL parameter.
2. Set **Accept** HTTP Header to **application/xml** or **text/xml**.

Here are a few examples of XML response:

```curl
$ curl 'https://api.ipgeolocation.io/ipgeo?apiKey=API_KEY&ip=<IP_ADDRESS>&fields=city&output=xml'

<?xml version="1.0" encoding="UTF-8"?>
<result>
    <ip><IP_ADDRESS></ip>
    <city>South Brisbane</city>
</result>

$ curl 'https://api.ipgeolocation.io/ipgeo?apiKey=API_KEY&ip=<IP_ADDRESS>&fields=currency' -H 'Accept: text/xml'

<?xml version="1.0" encoding="UTF-8"?>
<result>
    <ip><IP_ADDRESS></ip>
    <currency>
        <code>AUD</code>
        <name>Australian Dollar</name>
        <symbol>A$</symbol>
    </currency>
</result>
```

If you don't set **output** URL parameter or **Accept** header, the API will respond in JSON format.

## Security / SSL

We take security seriously and all of our API endpoints are served over a secure HTTPS connection for all users, even if you are on the free plan.

## Rate Limits

We don't have any daily, hourly or monthly rate limit on any of our paid plans. If you increase from your monthly quota, we'll keep serving your requests and add a surcharge amount on top of your monthly price. Surcharge rate varies from plan to plan.

We have a hard limit of 1500 requests per day on our Free plan and 100,000 requests for 7 days on trial accounts.

## API SDKs

To facilitate the developers, we have added some SDKs for various programming languages. The detailed documentation on how to use these SDKs is available in the respective SDK's documentation page linked below.

Our SDKs are also available on Github. Feel free to help us improve them. SDKs. Following are the available SDKs:

* [IP Geolocation API Java SDK](https://ipgeolocation.io/documentation/ip-geolocation-api-java-sdk-20180807094025)
* [IP Geolocation API .NET SDK](https://ipgeolocation.io/documentation/ip-geolocation-api-c-sharp-dot-net-sdk-201809031216)
* [IP Geolocation API Typescript SDK](https://ipgeolocation.io/documentation/ip-geolocation-api-typescript-sdk-201809051239)
* [IP Geolocation API Javascript SDK](https://ipgeolocation.io/documentation/ip-geolocation-api-javascript-sdk-201809051421)
* [IP Geolocation API PHP SDK](https://ipgeolocation.io/documentation/ip-geolocation-api-php-sdk-201809051255)
* [IP Geolocation API JQuery SDK](https://ipgeolocation.io/documentation/ip-geolocation-api-jquery-sdk-201809051507)

repository: ihsaanofficial/jbakeproject

repo_name: ihsaanofficial/jbakeproject


text:
# Inspect In Index #
A quick and easy way to inspect EPiServer content in the EPiServer Find index, without having to use the EPiServer Find Explore view.

When installed, you may select a new view called Inspect In Index. This will show the current content's raw form in the EPiServer Find Index, with the options to index, re-index or delete content from the index.

![](https://raw.githubusercontent.com/BVNetwork/InspectInIndex/master/doc/img/iii.png)

## Installation ##
Run the following command in the NuGet Package Manager Console for your web site:
```
install-package EPiCode.InspectInIndex
```
You need to add the EPiServer NuGet Feed to Visual Studio (see http://nuget.episerver.com/en/Feed/)

## Configuration ##

By default, only users with the "CmsAdmins" or "SearchAdmins" role will have access to the view. You may override this by adding the following to appSettings in web.config:

```
<add key="EPiCode.InspectInIndex.AllowedRoles"
     value="developers,searchfanatics,Administrators,CmsAdmins" />
```

repository: BVNetwork/InspectInIndex

gha_language: C#

repo_name: BVNetwork/InspectInIndex


text:
# Deploying a ciao cluster

## Prerequisites

Prior to deploying ciao the following prerequisites must be met:

1. Ensure that there is a user account on the system accessed by key
authentication with **passwordless** sudo access.

2.  Docker in particular needs special configuration for network
proxies.

3. A running ceph cluster along with a ceph keyring that can access rbd
installed on all machines in the cluster. The [Ceph
Deployment](http://docs.ceph.com/docs/master/rados/deployment/) tool can be
used to both build the cluster and deploy the keyring to all nodes.

## Setting up the master node of the cluster

All deployment is driven from the master node of the cluster. On this machine
you will need to install Go 1.8. Instructions for doing this can be found [on
the Go website](https://www.golang.org)

Next download, install and build ciao:

```
go get -u github.com/01org/ciao/...
```

Please ensure you have `$GOPATH/bin` in your `$PATH`. If you have not specified
a `$GOPATH` this will default to `$HOME/go`

Now setup the master node using `ciao-deploy`. The parameters below are the
minimum that you will need to specify to have a working setup.

`--https-cert and --https-ca-cert` are the private and public keychains needed
to operate the HTTPS server in Ciao.
.

```
ciao-deploy setup \
	--https-cert=/etc/pki/ciao/controller_key.pem \
	--https-ca-cert=/etc/pki/ciao/controller_cert.pem \
```

In your setup you may need to change other flags. `ciao-deploy setup --help`
provides detailed information on all the flags.

Upon successful completion this tool will report the environment variables that
can be used to access the cluster. For example:

```
Environment variables to access cluster:

export CIAO_CONTROLLER="ciao-ctl"
export CIAO_ADMIN_CLIENT_CERT_FILE="/etc/pki/ciao/auth-admin.pem"
```

Make a note of these as we will use them to test the cluster.

## Joining nodes to the cluster

Provisioning nodes into the cluster requires key driven access to the nodes.
You will need to SSH into each node and check its host key as the
`.ssh/known_hosts` file is relied upon for trusting nodes. You will also need
to run `ssh-agent` and ensure that the key required to access the nodes is
added.

You will need to join two types of node to the cluster. Network nodes are
special nodes that are used to host network concentrators and used for cluster
ingress and egress.

Add a network node to the cluster with a command like the following. Where you
have replaced ciao-nn with your network node hostname:

```
ciao-deploy join --network ciao-nn
```

Next add all your compute nodes. The join command can take multiple hostnames
and they will be configured in parallel.

```
ciao-deploy join ciao-cn01 ciao-cn02 ciao-cn03
```

## Validating that the cluster is functioning

The easiest way to validate the the cluster is functioning as expected is to
create a test instance. The deployment tool has a built-in tool that can
populate the cluster with some sample images and workloads.

```
ciao-deploy create-bat-workloads
```

Will download the image, upload to the cluster and create the workloads. You
will need both `CIAO_ADMIN_CLIENT_CERT_FILE` and `CIAO_CLIENT_CERT_FILE` set.
The latter with a non-admin user that you've added with `ciao-deploy auth create`

Once workloads are created you can create a new instance and experiment with
the ciao cluster.

```
ciao-cli instance add -workload <workload id>
```

## Updating the cluster

To update to a newer version ciao. Download and compile it as above and then
run the following commands.

To update the master use:

```
ciao-deploy update
```

To update the nodes run the same command as to join them:

```
ciao-deploy join ciao-cn01 ciao-cn02 ciao-cn03
```

## Teardown

To remove ciao from the worker nodes in the cluster `ciao-deploy unjoin` can be
used.

```
ciao-deploy unjoin ciao-nn ciao-cn01 ciao-cn02 ciao-cn03
```

The same command can be used for both network and compute nodes without
differentiation.

Teardown of the master node is not currently supported.

## Support

The ciao development team can be reached via our [mailing
list](https://lists.clearlinux.org/mailman/listinfo/ciao-devel) and on IRC
in channel #ciao-project on [Freenode](https://freenode.net/kb/answer/chat).

repository: egernst/ciao

repo_name: egernst/ciao


text:
# go-json-talk
Presentation on JSON parsing for Denver Gophers

View online at [go-talks.appspot.com](https://go-talks.appspot.com/github.com/aodin/go-json-talk/advanced-json.slide)

This slide deck was made using [present](https://godoc.org/golang.org/x/tools/present)

    present advanced-json.slide

- aodin, 2015

repository: DavidNix/go-json-talk

repo_name: DavidNix/go-json-talk


text:
![Docker pulls](https://img.shields.io/docker/pulls/prodrigestivill/postgres-backup-local)
![GitHub actions](https://github.com/prodrigestivill/docker-postgres-backup-local/actions/workflows/ci.yml/badge.svg?branch=main)

# postgres-backup-local

Backup PostgresSQL to the local filesystem with periodic rotating backups, based on [schickling/postgres-backup-s3](https://hub.docker.com/r/schickling/postgres-backup-s3/).
Backup multiple databases from the same host by setting the database names in `POSTGRES_DB` separated by commas or spaces.

Supports the following Docker architectures: `linux/amd64`, `linux/arm64`, `linux/arm/v7`, `linux/s390x`, `linux/ppc64le`.

Please consider reading detailed the [How the backups folder works?](#how-the-backups-folder-works).

## Usage

Docker:

```sh
docker run -u postgres:postgres -e POSTGRES_HOST=postgres -e POSTGRES_DB=dbname -e POSTGRES_USER=user -e POSTGRES_PASSWORD=password  prodrigestivill/postgres-backup-local
```

Docker Compose:

```yaml
version: '2'
services:
    postgres:
        image: postgres
        restart: always
        environment:
            - POSTGRES_DB=database
            - POSTGRES_USER=username
            - POSTGRES_PASSWORD=password
         #  - POSTGRES_PASSWORD_FILE=/run/secrets/db_password <-- alternative for POSTGRES_PASSWORD (to use with docker secrets)
    pgbackups:
        image: prodrigestivill/postgres-backup-local
        restart: always
        user: postgres:postgres # Optional: see below
        volumes:
            - /var/opt/pgbackups:/backups
        links:
            - postgres
        depends_on:
            - postgres
        environment:
            - POSTGRES_HOST=postgres
            - POSTGRES_DB=database
            - POSTGRES_USER=username
            - POSTGRES_PASSWORD=password
         #  - POSTGRES_PASSWORD_FILE=/run/secrets/db_password <-- alternative for POSTGRES_PASSWORD (to use with docker secrets)
            - POSTGRES_EXTRA_OPTS=-Z6 --schema=public --blobs
            - SCHEDULE=@daily
            - BACKUP_KEEP_DAYS=7
            - BACKUP_KEEP_WEEKS=4
            - BACKUP_KEEP_MONTHS=6
            - HEALTHCHECK_PORT=8080
```

For security reasons it is recommended to run it as user `postgres:postgres`.

In case of running as `postgres` user, the system administrator must initialize the permission of the destination folder as follows:
```sh
# for default images (debian)
mkdir -p /var/opt/pgbackups && chown -R 999:999 /var/opt/pgbackups
# for alpine images
mkdir -p /var/opt/pgbackups && chown -R 70:70 /var/opt/pgbackups
```

### Environment Variables

Most variables are the same as in the [official postgres image](https://hub.docker.com/_/postgres/).

| env variable | description |
|--|--|
| BACKUP_DIR | Directory to save the backup at. Defaults to `/backups`. |
| BACKUP_SUFFIX | Filename suffix to save the backup. Defaults to `.sql.gz`. |
| BACKUP_KEEP_DAYS | Number of daily backups to keep before removal. Defaults to `7`. |
| BACKUP_KEEP_WEEKS | Number of weekly backups to keep before removal. Defaults to `4`. |
| BACKUP_KEEP_MONTHS | Number of monthly backups to keep before removal. Defaults to `6`. |
| BACKUP_KEEP_MINS | Number of minutes for `last` folder backups to keep before removal. Defaults to `1440`. |
| HEALTHCHECK_PORT | Port listening for cron-schedule health check. Defaults to `8080`. |
| POSTGRES_DB | Comma or space separated list of postgres databases to backup. Required. |
| POSTGRES_DB_FILE | Alternative to POSTGRES_DB, but with one database per line, for usage with docker secrets. |
| POSTGRES_EXTRA_OPTS | Additional [options](https://www.postgresql.org/docs/12/app-pgdump.html#PG-DUMP-OPTIONS) for `pg_dump` (or `pg_dumpall` [options](https://www.postgresql.org/docs/12/app-pg-dumpall.html#id-<IP_ADDRESS>.6) if POSTGRES_CLUSTER is set). Defaults to `-Z6`. |
| POSTGRES_CLUSTER | Set to `TRUE` in order to use `pg_dumpall` instead. Also set POSTGRES_EXTRA_OPTS to any value or empty since the default value is not compatible with `pg_dumpall`. |
| POSTGRES_HOST | Postgres connection parameter; postgres host to connect to. Required. |
| POSTGRES_PASSWORD | Postgres connection parameter; postgres password to connect with. Required. |
| POSTGRES_PASSWORD_FILE | Alternative to POSTGRES_PASSWORD, for usage with docker secrets. |
| POSTGRES_PASSFILE_STORE | Alternative to POSTGRES_PASSWORD in [passfile format](https://www.postgresql.org/docs/12/libpq-pgpass.html#LIBPQ-PGPASS), for usage with postgres clusters. |
| POSTGRES_PORT | Postgres connection parameter; postgres port to connect to. Defaults to `5432`. |
| POSTGRES_USER | Postgres connection parameter; postgres user to connect with. Required. |
| POSTGRES_USER_FILE | Alternative to POSTGRES_USER, for usage with docker secrets. |
| SCHEDULE | [Cron-schedule](http://godoc.org/github.com/robfig/cron#hdr-Predefined_schedules) specifying the interval between postgres backups. Defaults to `@daily`. |
| TZ | [POSIX TZ variable](https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html) specifying the timezone used to evaluate SCHEDULE cron (example "Europe/Paris"). |
| WEBHOOK_URL | URL to be called after an error or after a successful backup (POST with a JSON payload, check `hooks/00-webhook` file for more info). Default disabled. |
| WEBHOOK_EXTRA_ARGS | Extra arguments for the `curl` execution in the webhook (check `hooks/00-webhook` file for more info). |

#### Special Environment Variables

This variables are not intended to be used for normal deployment operations:

| env variable | description |
|--|--|
| POSTGRES_PORT_5432_TCP_ADDR | Sets the POSTGRES_HOST when the latter is not set. |
| POSTGRES_PORT_5432_TCP_PORT | Sets POSTGRES_PORT when POSTGRES_HOST is not set. |

### How the backups folder works?

First a new backup is created in the `last` folder with the full time.

Once this backup finish succefully then, it is hard linked (instead of coping to avoid use more space) to the rest of the folders (daily, weekly and monthly). This step replaces the old backups for that category storing always only the latest for each category (so the monthly backup for a month is always storing the latest for that month and not the first).

So the backup folder are structured as follows:

* `BACKUP_DIR/last/DB-YYYYMMDD-HHmmss.sql.gz`: all the backups are stored separatly in this folder.
* `BACKUP_DIR/daily/DB-YYYYMMDD.sql.gz`: always store (hard link) the **latest** backup of that day.
* `BACKUP_DIR/weekly/DB-YYYYww.sql.gz`: always store (hard link) the **latest** backup of that week (the last day of the week will be Sunday as it uses ISO week numbers).
* `BACKUP_DIR/monthly/DB-YYYYMM.sql.gz`: always store (hard link) the **latest** backup of that month (normally the ~31st).

And the following symlinks are also updated after each successfull backup for simlicity:

```
BACKUP_DIR/last/DB-latest.sql.gz -> BACKUP_DIR/last/DB-YYYYMMDD-HHmmss.sql.gz
BACKUP_DIR/daily/DB-latest.sql.gz -> BACKUP_DIR/daily/DB-YYYYMMDD.sql.gz
BACKUP_DIR/weekly/DB-latest.sql.gz -> BACKUP_DIR/weekly/DB-YYYYww.sql.gz
BACKUP_DIR/monthly/DB-latest.sql.gz -> BACKUP_DIR/monthly/DB-YYYYMM.sql.gz
```

For **cleaning** the script removes the files for each category only if the new backup has been successfull.
To do so it is using the following independent variables:

* BACKUP_KEEP_MINS: will remove files from the `last` folder that are older than its value in minutes after a new successfull backup without affecting the rest of the backups (because they are hard links).
* BACKUP_KEEP_DAYS: will remove files from the `daily` folder that are older than its value in days after a new successfull backup.
* BACKUP_KEEP_WEEKS: will remove files from the `weekly` folder that are older than its value in weeks after a new successfull backup (remember that it starts counting from the end of each week not the beggining).
* BACKUP_KEEP_MONTHS: will remove files from the `monthly` folder that are older than its value in months (of 31 days) after a new successfull backup (remember that it starts counting from the end of each month not the beggining).

### Hooks

The folder `hooks` inside the container can contain hooks/scripts to be run in differrent cases getting the exact situation as a first argument (`error`, `pre-backup` or `post-backup`).

Just create an script in that folder with execution permission so that [run-parts](https://manpages.debian.org/stable/debianutils/run-parts.8.en.html) can execute it on each state change.

Please, as an example take a look in the script already present there that implements the `WEBHOOK_URL` functionality.

### Manual Backups

By default this container makes daily backups, but you can start a manual backup by running `/backup.sh`.

This script as example creates one backup as the running user and saves it the working folder.

```sh
docker run --rm -v "$PWD:/backups" -u "$(id -u):$(id -g)" -e POSTGRES_HOST=postgres -e POSTGRES_DB=dbname -e POSTGRES_USER=user -e POSTGRES_PASSWORD=password  prodrigestivill/postgres-backup-local /backup.sh
```

### Automatic Periodic Backups

You can change the `SCHEDULE` environment variable in `-e SCHEDULE="@daily"` to alter the default frequency. Default is `daily`.

More information about the scheduling can be found [here](http://godoc.org/github.com/robfig/cron#hdr-Predefined_schedules).

Folders `daily`, `weekly` and `monthly` are created and populated using hard links to save disk space.

## Restore examples

Some examples to restore/apply the backups.

### Restore using the same container

To restore using the same backup container, replace `$BACKUPFILE`, `$CONTAINER`, `$USERNAME` and `$DBNAME` from the following command:

```sh
docker exec --tty --interactive $CONTAINER /bin/sh -c "zcat $BACKUPFILE | psql --username=$USERNAME --dbname=$DBNAME -W"
```

### Restore using a new container

Replace `$BACKUPFILE`, `$VERSION`, `$HOSTNAME`, `$PORT`, `$USERNAME` and `$DBNAME` from the following command:

```sh
docker run --rm --tty --interactive -v $BACKUPFILE:/tmp/backupfile.sql.gz postgres:$VERSION /bin/sh -c "zcat /tmp/backupfile.sql.gz | psql --host=$HOSTNAME --port=$PORT --username=$USERNAME --dbname=$DBNAME -W"
```

gha_language: Shell


text:
---
title: REST API Troubleshooting
---

-   [Swagger UI: Can\'t read from
    server\...](#swagger-ui-cant-read-from-server...)
    -   [Problem](#problem)
    -   [Answer](#answer)

Here is a list of common problems you can encounter with Wazo REST APIs.

Swagger UI: Can\'t read from server\...
=======================================

Problem
-------

When trying to access Swagger UI via `http://wazo/api`, I get:

    Can't read from server. It may not have the appropriate access-control-origin settings.

Answer
------

This is a very generic error message from Swagger UI. It can have a
variety of causes, most commonly:

-   the HTTPS certificate of the API you\'re trying to get is not
    trusted
-   the daemon that serves the API is not running

What you can do:

-   check that the Swagger API spec is accessible: when choosing an API
    in the Swagger menu, copy-paste the URL of the top text box ending
    with `api.yml` into your browser.
-   check the HTTP requests/answers in your browser debugging tools
-   check that the daemon is running: in a console, type:
    `wazo-service status`
-   check the log files of the daemon in `/var/log/<daemon>.log` (see
    also: [Log Files](/uc-doc/system/log_files))


text:
[![Build Status](https://travis-ci.org/DataDog/dd-agent.svg?branch=master)](https://travis-ci.org/DataDog/dd-agent)

The Datadog Agent faithfully collects events and metrics and brings
them to [Datadog](https://app.datadoghq.com) on your behalf so that
you can do something useful with your monitoring and performance data.

You're looking at the source code right now. We provide a number of
[pre-packaged binaries](https://app.datadoghq.com/account/settings#agent) for your convenience.

# [Change log](https://github.com/DataDog/dd-agent/blob/master/CHANGELOG.md)

# How to contribute code

First of all and most importantly, **thank you** for sharing.

If you want to submit code, please fork this repository and submit pull requests against the `master` branch.
For more information, please read our [contributing guidelines](CONTRIBUTING.md).

Please note that the Agent is licensed for simplicity's sake
under a simplified BSD license, as indicated in the `LICENSE` file.
Exceptions are marked with LICENSE-xxx where xxx is the component name.
If you do **not** agree with the licensing terms and wish to contribute code nonetheless,
please email us at<EMAIL_ADDRESS>before submitting your
pull request.

## Setup your environment

Required:
- python 2.6 or 2.7
- bundler

```
# Clone the repository
git clone git@github.com:DataDog/dd-agent.git

# Create a virtual environment and install the dependencies:
cd dd-agent
bundle install
rake setup_env

# Activate the virtual environment
source venv/bin/activate

# Lint
bundle exec rake lint

# Run a flavored test
bundle exec rake ci:run[apache]
```

## Test suite

More about how to write tests and run them [here](tests/README.md)

# How to configure the Agent

If you are using packages on linux, the main configuration file lives
in `/etc/dd-agent/datadog.conf`. Per-check configuration files are in
`/etc/dd-agent/conf.d`. We provide an example in the same directory
that you can use as a template.

# How to write your own checks

Writing your own checks is easy using our checks.d interface. Read more about
how to use it on our [Guide to Agent Checks](http://docs.datadoghq.com/guides/agent_checks/).

# Contributors

```bash
git log --all | gawk '/Author/ {print}' | sort | uniq
```

repository: zendesk/dd-agent

gha_language: Python

repo_name: zendesk/dd-agent


text:
## Uport android signer

[![](https://jitpack.io/v/uport-project/uport-android-signer.svg)](https://jitpack.io/#uport-project/uport-android-signer)
[![CircleCI](https://circleci.com/gh/uport-project/uport-android-signer.svg?style=svg)](https://circleci.com/gh/uport-project/uport-android-signer)

This library is used to create and manage keys for uport account.
It supports creating keyPairs from seed phrases,
protecting these keys with authenticated encryption (android lock-screen / fingerprint),
signing ETH transactions and signing uPort specific JWTs.

Where available, keys and seeds created by this lib will be protected by
encryption backed by ARM Trusted Execution Environment (TEE).

Note: The curve used for ETH signing is not backed by the TEE,
therefore private keys exist in memory while in use but are encrypted with TEE keys at rest.

[FAQ and helpdesk support](http://bit.ly/uPort_helpdesk)

### Import

in your main `build.gradle`:
```groovy

allprojects {
    repositories {
        //...
        maven { url 'https://jitpack.io' }
    }
}
```
in your app `build.gradle`:
```groovy
uport_signer_version = "0.4.0"
dependencies {
    //...
    implementation "com.github.uport-project:uport-android-signer:$uport_signer_version"
}
```

### Usage

#### Key protection

When creating or importing keys/seeds, you must specify the protection `KeyProtection.Level` desired.
When using such a key/seed, the protection level is enforced based on the option used during creation.

Keys and seeds are always protected with hardware backed keys, where available.
This option is for choosing user authentication requirements.

The options are:
* SIMPLE - usable without user authentication
* PROMPT - when fingerprint sensor is available and configured will prompt for fingerprint whenever used.
            otherwise it will default to normal android lockscreen using pin/pattern/password
* SINGLE_PROMPT - uses android lockscreen to confirm user authentication
            only if the user has not authenticated in the last 30 seconds.
* CLOUD - reserved/unused - defaults to SIMPLE

> #### Important notes:
> * On KitKat, all `KeyProtection.Level` options default to `SIMPLE`
> * On Lolipop, the 30 second timeout window for `SINGLE_PROMPT` is not enforced by the
`AndroidKeyStore` API, it is emulated by this library

#### Create a seed:

This creates a seed that is used for future key derivation and signing:
The seed is representable by a bip39 mnemonic phrase.

```kotlin
UportHDSigner().createHDSeed(activity, KeyProtection.Level.SIMPLE, { err, seedHandle, publicKey ->
    if (err != null) {
        //handle error
        println(err)
    } else {
        //seed has been created and is accessible using seedHandle
        // * the handle is `seedHandle` - save this so you can use the seed later
        // * `publicKey` - a publicKey in base64 encoding,
        // corresponding to the private key derived using the `UPORT_ROOT_DERIVATION_PATH` "m/7696500'/0'/0'/0'"
        println(publcKey)
    }
})
```

You can also import bip39 mnemonic phrases:

```kotlin

//bip39 mnemonic phrase:
val phrase = "vessel ladder alter ... glass valve picture"

UportHDSigner().importHDSeed(activity, KeyProtection.Level.SIMPLE, phrase, { err, seedHandle, publicKey ->

    if (err != null) {
        //handle error
    } else {
        assertEquals("0x794a...e96ac8", seedHandle)
        //seed has been imported and
        // * the handle is `seedHandle`
        // * the corresponding publicKey in base64 is `publicKey`
    }

})
```

#### Signing

You can use this lib to calculate ETH transaction signatures.
Building and encoding transaction objects into `ByteArray`s is not in the scope of this lib.

You can sign transactions using keys derived from a previously imported seed.
To refer to that seed you must use the `seedHandle` from the seed creation/import callback
Based on the `KeyProtection.Level` used during seed import/creation, a prompt may be shown to the user
on the lock-screen / fingerprint dialog.

```kotlin

val seedHandle = "0x123..." //seedHandle received when creating/importing the seed

//bip32 key derivation
val derivationPath = "m/44'/60'/0'/0/0"

//the transaction payload, base64 encoded
val txPayloadB64 = Base64.encodeToString( transaction.rlpEncode(), Base64.DEFAULT )

//gets shown to the user on fingerprint dialog or on lockscreen, based on `KeyProtection.Level` used
val prompt = "Unlock your key to sign this transaction"

UportHDSigner().signTransaction(activity, seedHandle, derivationPath, txPayloadB64, prompt, { err, sigData ->
    if (err != null) {
        //handle error
    } else {
        //use sigData r,s,v components
        println(sigData)
    }
})

```

Note: The requirement to encode the transaction payload as a base64 string is subject to change in future releases

##### uPort specific JWTs

This lib can also produce signatures for uPort specific JWTs:
The method signature is the same but the signing method differs.

Also, do note that in the current version of this API,
 `data` is a Base64 encoded string (not a serialized JSON) - this is subject to change in future releases

```kotlin

val prompt = "Unlock your key to sign this credential"

UportHDSigner().signJwtBundle(activity, seedHandle, derivationPath, data, prompt, { err, sigData ->
    if (err != null) {
        //process the error
    } else {
        //use sigData r,s,v components
        println(sigData)
    }
})

```

### Changelog

#### 0.4.0
* [support] bump kethereum to 0.81.4 (#24)
* [support] migrate project to androidX (cc817722)
* [refactor] reformat code & enforce detekt linter (#25)

#### 0.3.6
* [support] bump kethereum to 0.76.2 and use lowercase imports ( a4ae6c16 )

#### 0.3.5
* [feat] add `suspend` extension for `UportHDSigner.signTransaction()` (#21)

#### 0.3.4
* [support] upgrade to kethereum 0.76.1 (#19)

#### 0.3.3
* [bugfix] erratic `UserNotAuthenticatedException` when using `prompt` with pattern keyguard (#18)

#### 0.3.2
* [bugfix] IllegalStateException on devices without fingerprint sensor (#17)
* [support] add test coverage (#16)

#### 0.3.1
* [bugfix] silent errors when signing JWTs (#14)

#### 0.3.0
* key management codebase moved back to this repo
* [breaking] updated to kotlin 1.3.x, kethereum 0.75.1 - will require some import changes

#### v0.2.x
* the signer library was moved to [uport-android-sdk](https://github.com/uport-project/uport-android-sdk)

#### v0.2.2
* [feature] enable recoverable signature in JOSE encoding (#11)

#### v0.2.1
* [bugfix] incorrect exception when activity context was needed (#5)
* [feature] add functionality to delete keys/seeds (#8)

#### v0.2.0
* lowered minSDK requirements to 19
    All eth keys and seeds are encrypted with RSA provided by the AndroidKeyStore API, but before SDK 23 that API does not enforce user authentication at runtime so the Keyguard requirement is emulated on Lolipop and not possible on KitKat
* no longer depending on all of kethereum, only using the `crypto` and `bip39` libraries
* no longer forwarding the kethereum API to integrating modules.
    If you were depending on that, please add a direct dependency to kethereum.
* also, updated the kethereum dependency to v0.53. If you were depending on an older version, you need to update too

#### v0.1.1
* to make the `v` recovery param available to calling classes, JWT signing produces `SignatureData` instead of a JOSE encoded signature String

#### v0.0.1
* initial release


text:
# Toast notifications for Elm apps

This is a fork of [toasty-bootstrap](https://github.com/andrewjackman/toasty-bootstrap) as an attempt to upgrade to the latest vesrion
of elm and elm-bootstrap.

[![Build Status](https://travis-ci.org/mc706/toasty-bootstrap.svg?branch=master)](https://travis-ci.org/mc706/toasty-bootstrap)

A configurable toast notification package for Elm apps following The Elm Architecture.

See a [demo](http://mc706.github.io/toasty-bootstrap) using `Toasty.Defaults` styling.

## Installation

From your top-level directory - the one with `elm-package.json` in - call:

```
$ elm package install andrewjackman/toasty-bootstrap
```

## Documentation

[See the Elm package for full usage docs](http://package.elm-lang.org/packages/mc706/toasty-bootstrap/latest).

## License

Distributed under the BSD3 license.


text:
# Configuring OpenID Connect Single Logout

The [OpenID Connect Session Management
specification](http://openid.net/specs/openid-connect-session-1_0.html)
, provides a way for a Relying Party (RP) to monitor the login status of
an end user with an OpenID Connect Provider (OP) so that the RP
application can log-out any end users that have logged out of the OP
(i.e., the WSO2 Identity Server). For instance, if there are two RP
applications relying on WSO2 Identity Server, when an end user logs-out
of one of the applications, he/she can be automatically logged out of
the other one as well.

## How it works

OpenID Connect session management works with two hidden iframes where
both reside at the RP. One is from the RP itself and the other is from
the OP. When authenticating, the OP sends an iframe to the RP. The RP
embed this OP-provided iframe into the RP. The RP checks the session
state via the RP iframe by continuously polling the embedded OP provided
iframe, without causing network traffic. Thereby, the RP is notified
when the session state of the end-user has changed. The flow of this is
as follows.

1.  The RP iframe polls the OP iframe for a session status.
2.  The OP iframe sends back a message (by using HTML5
    Winodw.postMessage()) about the session state as 'changed,
    'unchanged' or 'error'.
3.  If the session state is 'changed', the RP sends a passive request
    for re-authentication.
4.  If the end user has logged out from the OP, the RP will receive an
    authentication failure message along with a new session state value.
    The RP handles this as a end user logout.
5.  If the end user has not logged out, the RP will receive a successful
    authentication response along with a new session state value.

**Related Links**

To test this feature with WSO2 Playground sample, see the [Session
Management with Playground](../../learn/session-management-with-playground) topic.

repository: NipuniBhagya/docs-is

repo_name: NipuniBhagya/docs-is


text:
# PixelViewer
This is a simple executable app to run & display 'framed' pixel animations  to easily help me as I learn to improve my pixel art ability.
I am primarily pulling pixel tutorials from ![Miniboss](https://blog.studiominiboss.com/pixelart"Miniboss")

## Download exe & content here : ![Link](https://github.com/StarshipladDev/PixelViewer/raw/master/Anime.zip)

## Creating Your Own Animations
PixelPlayer will open & run any animation image(.PNG,.JPG ect. ect.) that has the following format:

Image 'Slides', drawn left-to right, going down. Only 4 'slides' per row.

Image'slides' being the same width&height.

Image 'slides' beign squares

Images 'slides' being surrounded by overlapping gaps, that are exactly (slide width /20)px thick.

A good way to create a pixel image is to create a new 84px x 43px image.
Create a 4x2 grid of 20x20px boxes surrounded by 1 px borders.

![Picture of Grid](Tutorial1.PNG "Tutorial1")

Going left to right, create the animtion frame-by-frame within those boxes

![Picture of Grid Color](Tutorial2.PNG "Tutorial2")

Resize the image to 1680 x 860 px.

Voila, you have created an 8 frame animation!

## Features(Planned In Brackets)

* Divides PNG/JPG images and plays the resulting set of images as a pixel animation *

* Plays selected .WAV files over animation *

* File selection of animation *

* Custom Image sizes *

* Custom frame ammounts  *

* Variable animation frame speeds  *

*Output Image as a .GIF file *

## Latest  Build

1.0 - 19/05/20

## Latest Update
1.1 (UI update) - 12/11/20
	> Overall Project Add a Among Us Animation PNG to 'Anime'
	> Form1.Designer.cs Add handling of iamges to toolbar menu items to make nicer UI
	> Form1.Designer.cs Add background color to match toolbar iamges
	>Overall Project Add toolbar iamge resources

## View Of Latest Update:
![Latest](Latest.PNG)

## Next Update

N/A

## Next Build

N/A

## Skill developing

I plan on this project improving my skills in the following:

> Pixel art/animation primarily

> Quick, effective coding to solve problems.

> A post-COVD refresher on .md documentation.

> Windows Forms graphics.

## Installing and Compiling:

**Requires a Windows operating system! As far as I know **

All files other than Anime.zip are for development purposes to look through my code.
To run the program, download Anime.zip, uncompress it and run PixelPlayer.exe

The folder 'Anime.zip' ( That can be downloaded : ![here](https://github.com/StarshipladDev/PixelViewer/raw/master/Anime.zip)) ,contains some sample .WAV files and compatible animation PNGs
as well as the .exe file to run the program.

To open an animation, press 'animation' in the toolbar, and select an appropriate image that follows guideline mentioned above.

To play audio over the animation, press the 'Sound' button ![Pic Of Audio Button](Audio.PNG "Audio") in the tool bar, and select a compatible .wav file.

This program will work with animations you create yourself, and some base files are included

repository: StarshipladDev/PixelViewer

repo_name: StarshipladDev/PixelViewer


text:
# Redux Persist API
---
## Standard API
- [persistReducer](#persistreducerconfig-reducer)([config](#type-persistconfig), reducer)
- [persistStore](#persiststorestore-config-callback)(store)
- [createMigrate](#createmigratemigrations-config)([migrations](#type-migrationmanifest))
### `persistReducer(config, reducer)`

```js
persistReducer(
  config: PersistConfig,
  reducer: Reducer,
): Reducer
```

Where Reducer is any reducer `(state, action) => state` and PersistConfig is [defined below](#type-persistconfig)

### `persistStore(store, config, callback)`
```js
persistStore(
  store: Store,
  config?: { enhancer?: Function },
  callback?: () => {}
): Persistor
```

Where Persistor is [defined below](#type-persistor)

### `createMigrate(migrations, config)`
```js
createMigrate(
  migrations: MigrationManifest,
  config?: { debug: boolean }
)
```

### `type Persistor`
```js
{
  purge: () => Promise<void>,
  flush: () => Promise<void>,
}
```

The Persistor is a redux store unto itself, plus
1. the `purge()` method for clearing out stored state.
2. the `flush()` method for flushing all pending state serialization and immediately write to disk

`purge()` method only clear the content of the storage, leaving the internal data of `redux` untouched. To clean it instead, you can use the [redux-reset](https://github.com/wwayne/redux-reset) module.

### `type PersistConfig`
```js
{
  key: string, // the key for the persist
  storage: Object, // the storage adapter, following the AsyncStorage api
  version?: number, // the state version as an integer (defaults to -1)
  blacklist?: Array<string>, // do not persist these keys
  whitelist?: Array<string>, // only persist these keys
  migrate?: (Object, number) => Promise<Object>,
  transforms?: Array<Transform>,
  throttle?: number, // ms to throttle state writes
  keyPrefix?: string, // will be prefixed to the storage key
  debug?: boolean, // true -> verbose logs
  stateReconciler?: false | StateReconciler, // false -> do not automatically reconcile state
  serialize?: boolean, // false -> do not call JSON.parse & stringify when setting & getting from storage
  writeFailHandler?: Function, // will be called if the storage engine fails during setItem()
}
```

Persisting state involves calling setItem() on the storage engine. By default, this will fail silently if the storage/quota is exhausted.
Provide a writeFailHandler(error) function to be notified if this occurs.

### `type MigrationManifest`
```js
{
  [number]: (State) => State
}
```
Where the keys are state version numbers and the values are migration functions to modify state.

---
## Expanded API
The following methods are used internally by the standard api. They can be accessed directly if more control is needed.
### `getStoredState(config)`
```js
getStoredState(
  config: PersistConfig
): Promise<State>
```

Returns a promise (if Promise global is defined) of restored state.

### `createPersistoid(config)`
```js
createPersistoid(
  config
): Persistoid
```
Where Persistoid is [defined below](#type-persistoid).

### `type Persistoid`
```js
{
  update: (State) => void
}
```

### `type PersistorConfig`
```js
{
  enhancer: Function
}
```
Where enhancer will be sent verbatim to the redux createStore call used to create the persistor store. This can be useful for example to enable redux devtools on the persistor store.

### `type StateReconciler`
```js
(
  inboundState: State,
  originalState: State,
  reducedState: State,
) => State
```
A function which reconciles:
- **inboundState**: the state being rehydrated from storage
- **originalState**: the state before the REHYDRATE action
- **reducedState**: the store state *after* the REHYDRATE action but *before* the reconcilliation
into final "rehydrated" state.

gha_language: TypeScript


text:
# Mark as Read

Avoid wasting time rereading pages you've already read - mark them as done forever.

## How to Install

You'll need to be in Developer Mode.

## How to Use

Notice the new icon on the Chrome toolbar.

![Image of unchecked page](https://github.com/edoreld/mark-as-read/blob/master/markasread/notvisited.png?raw=true)

When you tick it off, the item will look like the following:

![Image of checked page](https://github.com/edoreld/mark-as-read/blob/master/markasread/icon_128.png?raw=true)

The extension will remember the "tick off state" for each page you visit and will show you the right image when you come back.

If you click on the extension icon, it will change from unchecked to checked or vice versa.

## Keyboard Shortcut
You can toggle the marked as read functionality on a page using Ctrl+Shift+Z rather than clicking on the icon.

## Features

- Mark pages as read
- Import & Export visited links

repository: davidshq/mark-as-read

repo_name: davidshq/mark-as-read


text:
# COX CARS
Using the provided API, create a program that retrieves a datasetID, retrieves all vehicles and dealers for that dataset, and successfully posts to the answer endpoint. Each vehicle and dealer should be requested only once. You will receive a response structure when you post to the answer endpoint that describes status and total ellapsed time; your program should output this response.

The server has a built in delay that varies between 1 and 4 seconds for each request for a vehicle or for a dealer. Focus on optimizing for low total elapsed time between retrieving the datasetid and posting the answer. A successful submission will complete in significantly less than 30 seconds.

## To run:
```
pip install -r requirements.txt
python main.py
```


text:
A DSL for extracting data from a web page. The DSL serves two purposes: finds elements and extracts their text or attribute values. The main reason for developing this is to have all the CSS selectors for scraping a site in one place (I prefer CSS selectors over anything else).

The DSL wraps [cheerio](http://cheeriojs.github.io/cheerio/#selectors) in node and [jQuery](http://api.jquery.com/category/selectors/) in the browser.

A few links:

-   [Github repository](https://github.com/tiffon/take-js)
-   [npm package](http://npmjs.com/package/take-dsl)
-   [Discussion group](https://groups.google.com/forum/#!forum/take-dsl)

Example
=======

Given the following take template:

    $ h1 | text
        save: h1_title
    $ ul
        save each: uls
            $ li
                | 0 [title]
                    save: title
                | 1 text
                    save: second_li
    $ p | 1 text
        save: p_text

And the following HTML:

```HTML
<div>
    <h1>Le Title 1</h1>
    <p>Some body here</p>
    <h2 class="second title">The second title</h2>
    <p>Another body here</p>
    <ul id="a">
        <li title="a less than awesome title">A first li</li>
        <li>A second li</li>
        <li>A third li</li>
    </ul>
    <ul id="b">
        <li title="some awesome title">B first li</li>
        <li>B second li</li>
        <li>B third li</li>
    </ul>
</div>
```

The following data will be extracted (presented in JSON format):

```JSON
{
    "h1_title": "Le Title 1",
    "p_text": "Another body here",
    "uls": [
        {
            "title": "a less than awesome title",
            "second_li": "A second li"
        },
        {
            "title": "some awesome title",
            "second_li": "B second li"
        }
    ]
}
```

Take templates always result in a single JavaScript `Object`.

The template can also be written in the following, more concise, syntax:

    $ h1 | text ;                   : h1_title
    $ ul
        save each                   : uls
            $ li
                | 0 [title] ;           : title
                | 1 text ;              : second_li
    $ p | 1 text ;                  : p_text

For a more complex example, see the [reddit sample](https://github.com/tiffon/take-js/blob/master/sample/reddit.take), which also has a [more concise version](https://github.com/tiffon/take-js/blob/master/sample/reddit_inline_saves.take).

## Install

### Node

```SHELL
npm  install take-dsl
```

### Browser

Include the [web_dist script](https://github.com/tiffon/take-js/blob/master/web_dist/take.js) in your page. If your page has [jQuery](https://jquery.com/) loaded, you should be good to go. See the [web_dist/index.html](https://github.com/tiffon/take-js/blob/master/web_dist/index.html) for a dead-simple demo. It can be served via `npm start`.

## Usage

### Creating a Take Template

A take template is created from an `Array` of `string`s with each `string` being one line of the take template.

To create a template:

```JavaScript
var TakeTemplate = require('take-dsl').TakeTemplate,
    TMPL = [
        '$ nav a',
        '    save each: nav',
        '        | text',
        '            save: text',
        '        | [href]',
        '            save: link'
    ],
    tt = new TakeTemplate(TMPL);
```

### Using a Take Template

Pass a HTML string to the `.take()` method:

```JavaScript
data = tt.take('<div>hello world</div>')
```

## Take Templates

Take templates are whitespace sensitive and are comprised of three types of lines:

-   Queries
    -   `$ h1`
    -   `| text`
    -   `$ h1 | 0 text`
-   `save` directives
    -   `save: h1_title`
    -   `save: time.exact`
-   `save each` directives
    -   `save each: entries`
    -   `save each: popular.movies`

There are also inline sub-contexts, which are described in the [Inline Sub-Contexts section](#inline-sub-contexts).

### Queries

There are two main types of queries in take templates:

-   CSS selector queries
-   Non-CSS selector queries

The reason they’re divided like this is because CSS Selectors always go first on the line and they can be followed by non-CSS non-CSS Selector queries. Non-CSS selector queries can’t be followed by CSS selector queries. Seems easier to read this way, but it’s arbitrary and the syntax can be changed if something else makes more sense.

#### CSS Selector queries

CSS selector queries start with `$` and end either at the end of the line or at the `|` character. The `|` character delimits non-CSS selector queries.

-   `$ #siteTable .thing | text`
-   `$ .domain a`

In the first example above, the CSS selector query is `#siteTable .thing`. The second is `.domain a`.

The CSS selectors are passed to [cheerio](http://cheeriojs.github.io/cheerio/#selectors) in node and [jQuery](http://api.jquery.com/category/selectors/) in the browser (jQuery is an external dependency in the browser distribution). So, anything cheerio or jQuery can accept can be used.

#### Non-CSS Selector queries

Non-CSS selector queries start with `|` and continue for the rest of the line. There are three non-CSS Selector queries:

-   Element indexes
    -   Syntax: an integer
    -   `| 0` will return the first element in the current context
    -   `| 1` will return the second element in the current context
-   Text retrieval
    -   Syntax: `text`
    -   `| text` will return the text of the current context
    -   `| 1 text` will first get the second element in the current context and then return it’s text
-   Attribute retrieval
    -   Syntax: `[attr]`
    -   `| [href]` will return the value of the `href` attribute of the first element in the current context
    -   `| 1 [href]` will return the value of the `href` attribute of the second element in the current context

**Order matters**: Index queries should precede text or attribute retrieval queries. Only one of text or attribute queries can be used; they can’t both be used on one line.

### Whitespace

The level of indentation on each line defines the context for the line.

The root context of a take template is the current HTML document being processed. Every statement that is not indented is executed against the document being processed.

Each line that is indented more deeply has a context that is the result of the last query in the parent context. For example:

    $ #some-id
        $ li
        $ div

The query on the first line is executed against the document being processed. The query on the second line is executed against the result of the first line. So, the second line is synonomous with `$ #some-id li`. The query on the third line is also executed against the result of the first line. So, it can be re-written as `$ #some-id div`.

Another example:

    $ a
        | 0
            | text
            | [href]

The third and fourth lines retrieve the text and href attribute, respectively, from the first `<a>` in the document being processed. This could be rewritten as:

    $ a | 0
        | text
        | [href]

### Save Directives

Save directives save the context into the result `Object`. These are generally only intended to be applied to the result of a `text` or `[attr]` retrieval.

The syntax is:

    save: identifier

Any non-whitespace characters can be used as the identifier. Also, the identifier can contain dots (`.`), which designate sub-`Object`s for saving.

For example, the following take template:

    $ a | 0
        | text
            save: first_a.text
        | [href]
            save: first_a.href

And the following HTML:

```HTML
<div>
    <a href="http://www.example.com">fo sho</a>
    <a href="http://www.another.com">psych out</a>
</div>
```

Will result in the following `Object`:

```JavaScript
{
    first_a: {
        text: 'fo sho',
        href: 'http://www.example.com'
    }
}
```

### Save Each Directives

Save each directives produce an `Array` of `Object`s. Generally, these are used for repeating elements on a page. In the [reddit sample](https://github.com/tiffon/take-js/blob/master/sample/reddit.take#L3), a save each directive is used to save each of the reddit entries on the reddit homepage.

The syntax is:

    save each: identifier

Any non-whitespace characters can be used as the identifier. Also, the identifier can contain dots (`.`), which designate sub-`Object`s for saving.

Save each directives apply the next sub-context to each of the elements of their context. Put another way, save each directives repeatedly process each element of thier context.

For example, in the following take template, the `| text` and `| [href]` queries (along with saving the results) will be applied to every `<a>` in the document.

    $ a
        save each: anchors
            | text
                save: text
            | [href]
                save: href

Applying the above take template to the following HTML:

```HTML
<div>
    <a href="http://www.example.com">fo sho</a>
    <a href="http://www.another.com">psych out</a>
</div>
```

Will result in the following `Object`:

```JavaScript
{
    anchors: [{
            text: 'fo sho',
            href: 'http://www.example.com'
        },{
            text: 'psych out',
            href: 'http://www.another.com'
        }
    ]
}
```

### Inline Sub Contexts

Very often take templates contain statements like the following:

    $ h1 | text
        save: section_title

Inline sub-contexts can make statements like these more succinct. Inline sub-contexts allow you to create a sub-context on the same line as a query.

The syntax is:

    query ; sub-context-statement

For example, the template above that saves the `h1` text can be re-written as:

    $ h1 | text ; save: section_title

This can be handy for larger templates. The sample at the beginning of this document becomes:

    $ h1 | text ;                   : h1_title
    $ ul
        save each                   : uls
            $ li
                | 0 [title] ;           : title
                | 1 text ;              : second_li
    $ p | 1 text ;                  : p_text

For additional samples with inline sub-contexts, see the stackoverflow example which scrapes user activity for questions on stackoverflow.com. The example uses the Python package, but the syntax of the templates is identical.

- [Example overview](https://github.com/tiffon/take-examples/tree/master/samples/stackoverflow)
- [Question listing page](https://github.com/tiffon/take-examples/blob/master/samples/stackoverflow/questions-listing.take)
- [Question detail page](https://github.com/tiffon/take-examples/blob/master/samples/stackoverflow/question-page.take)

repository: tiffon/take-js

repo_name: tiffon/take-js


text:
FltkHs - A Haskell Binding to the FLTK GUI Library
=============================================

FltkHs aims to be a complete Haskell binding to the [FLTK GUI library] [1].

It also comes with the requisite C-wrappers around FLTK. These wrappers will be published as independent library but for now they are bundled because the API is not yet suitable for C programmers.

The ``c-src'' directory contains the C-wrappers around the FLTK widgets and functions.

The ``c-examples'' directory contains C ports of some of the examples provided with the FLTK distribution.

The ``src'' directory contains the Haskell bindings.

Building
________

The standard Cabal install command ``cabal install'' from the top-level directory should build and install all the is required including the C-wrappers.

The C and Haskell bindings are not installed seperately but linked into one big library ``fltkhs-<version-number>.a''.

This README will be more complete once the bindings are ready for release.

  [1]: http://www.fltk.org/index.php      "FLTK"

repository: scottbale/fltkhs

repo_name: scottbale/fltkhs