text:
# Simplified Emmet plugin Atom editor

This is a fork of the [emmet-atom](https://github.com/emmetio/emmet-atom) package, and has one key-binding, and one key-binding only: the shift + space key for emmet expanding. This solves all keybinding conflicts with the Atom Core, such as the ctrl + shift + M for toggling the Markdown preview, the ctrl +  , for opening the Settings View, and tab for [Atom's new autocomplete](http://blog.atom.io/2015/05/15/new-autocomplete.html).

All functionality of the emmet-atom package is still here, which means that you have the freedom to manually add any other Emmet triggers you want. To do so, go to _Edit_ > _Open Your Keymap_ and refer to the [original default emmet-atom keymap](https://github.com/emmetio/emmet-atom/blob/master/keymaps/emmet.cson) for a complete list of commands.

This plugin will occasionally be synced with its upstream repository when new updates arrive. Furthermore, thanks to contributions, emmet expanding can also be triggered inside files with PHP and JS (for [React](https://facebook.github.io/react/)) grammar.

Note that you could also just enable emmet expanding everywhere, by opening your keymap (_Edit > Open Your Keymap_) and adding the following piece of text:

```
'atom-text-editor:not([mini])':
   'shift-space': 'emmet:expand-abbreviation-with-tab'
```

### Installation

In Atom, open Preferences > Packages, search for the `emmet-simplified` package. Once found, click install to install package. Alternatively, you could run `apm install emmet-simplified`.

### Manual installation

You can install the latest emmet-simplified version manually from console:

```bash
cd ~/.atom/packages
git clone https://github.com/Yatoom/emmet-atom-simplified emmet-simplified
cd emmet-simplified
npm install
```

Then restart Atom editor.

## Features:

* Expand abbreviations by shift + space.

## Shift-space key

Simplified Emmet expands abbreviations by shift-space key only for HTML, CSS, Sass/SCSS and LESS syntaxes.

## Default Keybindings

You can change these Preferences > Emmet.

Command | Darwin | Linux/Windows
------- | ------ | -------------
Expand Abbreviation | shift + space | shift + space

repository: notacouch/emmet-atom-simplified

repo_name: notacouch/emmet-atom-simplified


text:
# GH FOMO

What are the latest starred repositories from the people you follow in Github

## Installation

* `git clone git@github.com:nestoralonso/gh-fomo.git`
* cd gh-fomo
* yarn
* [add your own REACT_APP_GITHUB_TOKEN in .env file](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/)
  * scopes/permissions you need to check: repo, user
* yarn start
* visit `http://localhost:3000`

license: MIT

repository: nestoralonso/gh-fomo

branch_name: refs/heads/master

extension: md

gha_language: JavaScript

gha_license_id: MIT

license_type: permissive

repo_name: nestoralonso/gh-fomo


text:
# Scratch

Itching a scratch.

## Releases

### 5

* Moved to github as binkley/vertx-example

### 4

* Tests
* Less lacking extension for health endpoint

### 3

* Switch to Guice from Dagger
* Better Health endpoint

### 2

* Vert.x using META-INF/services and Dagger

### 1

* Example Vert.x server with health text vs json

### 0

* Basic Vert.x server
* Lombok extensions for HttpUrl

license: Unlicense

repository: binkley/vertx-example

repo_name: binkley/vertx-example


text:
# Missing explicit dependency injection
When AngularJS injects dependencies into a function that does not have an explicit dependency specification, it matches up dependencies with function parameters by name. This is dangerous, since some source code transformations such as minification may change the names of parameters. Such a renaming will break the AngularJS application.

## Recommendation
Do not use implicit annotations for dependency injected functions when the code is minified later.

## Example
The following example shows an AngularJS controller with implicit dependency annotations.

```javascript
angular.module('myModule', [])
    .controller('MyController', function($scope) { // BAD: implicit dependency name
        // ...
});

```
This is problematic, since the minified version of this controller could look like the following:

```javascript
angular.module('myModule', [])
    .controller('MyController', function(a) { // BAD: dependency 'a' does not exist
        // ...
});

```
This would mean that the function is dependency-injected with the dependency named "a", which does not exist, leading to a crash at runtime.

Instead, in order to support minification, specify the dependencies with explicit annotations:

```javascript
angular.module('myModule', [])
    .controller('MyController', ['$scope', function($scope) { // GOOD: explicit dependency name
        // ...
}]);

```

## References
* AngularJS Developer Guide: [Dependency Injection - Implicit Annotation](https://docs.angularjs.org/guide/di#implicit-annotation).

branch_name: refs/heads/main


text:
# sentry-php

This project is a fork of official [PHP SDK v1.7](https://github.com/getsentry/sentry-php) for [Sentry](https://getsentry.com) to work even with php5.2, php5.6
This project already have fix for https://github.com/getsentry/sentry-php/pull/615/commits/21e39a6bc4e27591dabe4118d9b996bbc109b3a0

## Features

- Automatically report (un)handled exceptions and errors
- Send customized diagnostic data
- Process and sanitize data before sending it over the network

## Installation

There are various ways to install the PHP integration for Sentry.  The
recommended way is to use:

    $ git clone https://github.com/streamtele/sentry-php.git

Alternatively you can manually install it:

1.  Download and extract the latest [sentry-php](https://github.com/streamtele/sentry-php/archive/master.zip) archive to your PHP project.
2.  Require the autoloader in your application:

```php
require_once '/path/to/Raven/library/Raven/Autoloader.php';
Raven_Autoloader::register();
```

## Usage

```php
// Instantiate a new client with a compatible DSN and install built-in
// handlers
$sentryClient = new Raven_Client('https://e9ebbd88548a441288393c457ec90441:399aaee02d454e2ca91351f29bdc3a07@app.getsentry.com/3235');
$sentryClient->install();

// Capture an exception
$event_id = $sentryClient->captureException($ex);

// Give the user feedback
echo "Sorry, there was an error!";
echo "Your reference ID is " . $event_id;
```

For more information, see the [documentation](https://docs.getsentry.com/hosted/clients/php/).

## Integration with frameworks

Other packages exists to integrate this SDK into the most common frameworks.

- [Symfony](https://github.com/getsentry/sentry-symfony)
- [Laravel](https://github.com/getsentry/sentry-laravel)

## Community

- [Documentation](https://docs.getsentry.com/hosted/clients/php/)

repository: streamtele/sentry-php

repo_name: streamtele/sentry-php


text:
---
title: WorkflowHub project
hide_sidebar: true
toc: false
permalink: /
---

[WorkflowHub](https://workflowhub.eu/) is a FAIR **workflow registry** sponsored by the European RI Cluster EOSC-Life,  the European Research Infrastructure ELIXIR and [multiple EU-wide projects](/project/acknowledgements/#funding). It is workflow management system agnostic: workflows may remain in their native repositories in their native forms.

This website describes the open source **project** for developing and running [WorkflowHub](https://workflowhub.eu/).

For more details, see [About WorkflowHub](/project), [FAIR Computational Workflows](https://workflows.community/groups/fair/), [Outreach and Publications](/project/outreach).

For any kind of questions or suggestions on using WorkflowHub, feel free to join our [community](/project/community)!

## Project resources

* **Production instance**: <https://workflowhub.eu/>
* **Sandbox instance**: <https://dev.workflowhub.eu/> (use for testing; occasionally wiped)
* **Source code**: [seek4science/seek](https://github.com/seek4science/seek)
* **API documentation**: <https://workflowhub.eu/api>
* **[Outreach and Publications](/project/outreach/)**
* **EOSC-Life Deliverable 2.3**: <https://doi.org/10.5281/zenodo.7886545>
* **Tasks**:
  * [WorkflowHub roadmap](/project/roadmap)
  * WorkflowHub implementation <https://github.com/seek4science/seek/projects/3> (SEEK)
  * General WorkflowHub <https://github.com/workflowhub-eu/about/issues>
* **Mailing list**: [`workflowhub😊elixir-europe.org`](https://lists.elixir-europe.org/mailman/listinfo/workflowhub_elixir-europe.org) ([subscribe](https://lists.elixir-europe.org/mailman/listinfo/workflowhub_elixir-europe.org)/[archive](https://mail.elixir-europe.org/pipermail/workflowhub_elixir-europe.org/))
* **Slack chat**:  [#workflows on seek4science.slack.com](https://seek4science.slack.com/archives/CPLLVV94L) ([join](https://join.slack.com/t/seek4science/shared_invite/zt-csqh94qb-kf~kFbZxuHl1Hpxhbc8avw))
* [Google Drive](https://drive.google.com/drive/folders/1_bZ63W4oRtWL5OnWJNYvE4u3A27VyGGe)
 (to request write-access, ask in Slack channel)
* **Slides/posters** (for complete list, see [Outreach](/project/outreach/)):
  * [WorkflowHub: FAIR Workflow Registry](https://doi.org/10.5281/zenodo.7323471). Justin Clark-Casey et al, EOSC Symposium 2022, 2022-11-14
  * [WorkflowHub – a FAIR registry for workflows](https://doi.org/10.7490/f1000research.1118984.1). Carole Goble, ELIXIR All Hands 2022
  * [WorkflowHub - a registry for workflows](https://doi.org/10.5281/zenodo.4012124). Carole Goble, ECCB 2020, 2020-09-02
  * [Poster: The WorkflowHub, a registry for Life Science Workflows](https://workflowhub.eu/presentations/1). Ambarish Kumar, ISMB, 2020-07-13
  * [WorkflowHub Introduction slides](https://drive.google.com/open?id=1hfBAjjRnL9jGoxHEvq66Wo-wuKqouR3C). Carole Goble, 2020-03-25

## Community

Regular meeting: **WorkflowHub Club** - all welcome!

Anyone is welcome to join the bi-weekly [WorkflowHub Club](/project/community) calls using Zoom.

* When: Alternate Wednesdays 10:00 current UK time zone / 11:00 current Central European time zone
* Agenda, telcon details and minutes: <https://s.apache.org/workflowhub-minutes>

See the list of club members on the [acknowledgement](/project/acknowledgements) page.

## Code of conduct

This project has a [Code of Conduct](https://github.com/workflowhub-eu/about/blob/master/CODE_OF_CONDUCT.md) to ensure interactions are friendly, respectful and inclusive. You can contact<EMAIL_ADDRESS>if you have any concerns or questions.

## Citation

{% include citation.md %}

## Acknowledgements

We are grateful for contributions from  [**EOSC-Life**](https://www.eosc-life.eu/), [ELIXIR Europe](https://elixir-europe.org/), [**EuroScienceGateway**](http://eurosciencegateway.eu/) and others (see complete [list of funders](/project/acknowledgements#funding)).

<!-- NOTE: Always update list above AND the acknowledgements.md page -->

repository: workflowhub-eu/about

gha_language: HTML

repo_name: workflowhub-eu/about


text:
# generator-ctools-layout [![Build Status](https://secure.travis-ci.org/pixelwhip/generator-ctools-layout.png?branch=master)](https://travis-ci.org/pixelwhip/generator-ctools-layout)

> [Yeoman](http://yeoman.io) generator

This is a Yeoman generator for Drupal's ctools layout plugins. This creates all the necessary files needed for a custom layout plugin. While you will be prompted for a list of regions, this generator makes no assumptions about the markup or CSS you'll need to actually style the layout. It simply creates an empty CSS file, a placeholder thumbnail image, a template with all the rendered regions and the include file to glue it all together. The rest is up to you.

## Getting Started

Install Yeoman if you haven't already.

```bash
npm install -g yo
```

To install generator-ctools-layout from npm, run:

```bash
npm install -g generator-ctools-layout
```

Create a new directory in your ctools layout plugins folder with the machine name of your layout. For example, if you have a layout named *Landing Page* you would type the following:

```bash
mkdir landing_page
```

Now go into your newly created layout plugin folder and let Yeoman do his thing.

```bash
cd landing_page
yo ctools-layout
```

Yeoman will ask you some questions about your layout then build everything out for you!

For more information about ctools layouts see (https://www.drupal.org/node/495654)[https://www.drupal.org/node/495654].

### Getting To Know Yeoman

Yeoman has a heart of gold. He's a person with feelings and opinions, but he's very easy to work with. If you think he's too opinionated, he can be easily convinced.

If you'd like to get to know Yeoman better and meet some of his friends, [Grunt](http://gruntjs.com) and [Bower](http://bower.io), check out the complete [Getting Started Guide](https://github.com/yeoman/yeoman/wiki/Getting-Started).

## License

MIT

repository: factorial-io/generator-ctools-layout

repo_name: factorial-io/generator-ctools-layout


text:
RangeSeekbar
============
### A seekbar contains two cursor and support multi-touch.

![Opps! Screen shot has missed](https://github.com/dolphinwang/RangeSeekbar/raw/master/Screenshot.png)

RangeSeekbar have left and right cursors, user can move cursor to make fliter.

How to use
--------------------------------------------------
RangeSeekbar support user to set difference parameters.

		1. seekbarHeight:        Height of seekbar.
		2. textSize: 	         Size of text mark.
		3. spaceBetween:         Space between seekbar and text mark.
		4. leftCursorBackground: Background drawable of left cursor, press state supported.
		5. rightCursorBackground:Similar with leftCursorBackground.
		6. markTextArray:        Text of marks. The most important parameter, must be set.
		7. textColorNormal:      Color of text mark in normal state.
		8. textColorSelected:    Color of text mark in selected state.
		9. seekbarColorNormal:   Similar with textColorNormal.
		10.seekbarColorSelected: Similar with textColorSelected.
		11.autoMoveDuration:     Time when a cursor move to a mark index without touch.

		Users can also set these in java code.

Other supported:

		1. setLeftSelection(int index): Set left cursor to any of text mark(besides the last one).
		2. setRightSelection(int index):Set right cursor to any of text mark(besides the first one).
		3. setOnCursorChangeListener:   Set it to listen when left cursor or right cursor is located on new index.

### Developed by:
Roy Wang<EMAIL_ADDRESS>
If you use this lib. Please let me know.

### License:
Copyright 2014 Roy Wang

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


text:
# A CLI WebDAV File Server Written in go

WebDAV is a common file server protocol supported by many file browers.

This lean but efficient server runs from the command line and holds all
its data just within a folder in your directory tree.
No database is required.

Features are simple but powerful:

- TLS support (https)
- SHA3 hashes used in its password file
- Multi-user functionality
- Configuration via simple config files
- All data is stored in the file system
- User credentials can be generated with the `go-webdav-hash` tool
- File locking (not persistent between individual server invocations)

## Running the Test Configuration

Clone this repo and build the code.

	go get -u ./...
	go build .

Create the folder where the server should store all its data.
(Temporary in tis case.)

	mkdir /tmp/srv

Now run the server by telling it where the config file is:

	./go-webdav -c test/go-webdav.hjson

You can now browse `webdavs://localhost:9999/webdav` with your avorite WebDAV client.

You have to accept the test certificate, which is in no way secure, but there for testing purposes.
Use either "alice" (pwd: alice) or "bob" (pwd: bob) for credentials.

You can see now that in the `/tmp/srv` folder the uploaded files are placed,
with a separate subdirectory for each user.

## Configuration

There is a general config file and a separate password file for user administration.
Both use a human readable json dialect.

For documentation, see the examples in the `test/` folder.

To generate the password hashes, use the `go-webdav-hash` tool.

## TODO / What is Missing

- Quota implementation
- Separate access and error logs
- Logging via syslog
- More sanity checks for the config files
- HTTPS redirection. Currently only HTTPS is supported, no HTTP.

## Tested Clients

- dolphin

repository: dudw/go-webdav

repo_name: dudw/go-webdav


text:
---
layout: post
title: "Houston: we lost a table"
description: ""
category:
tags: []
---
{% include JB/setup %}

For the last 4 months, we have been busy developing an application to manage sports league: [maligue.ca](https://www.maligue.ca/). We started dev with sails, waterline and mongodb. We then switched to postgres just before go live and the transition was smooth.

We are not using waterline anymore for two reasons:

1)
However, 1 week after the beginning of the beta testing, we lost all data in one table. After several hours of investigation, we found out that there is (was) a bug in waterline that generated a delete statement without where clause: https://github.com/balderdashy/waterline/issues/812
I can understand and live with the fact that there could be bugs in such a young open source library. I opened the issue which pointed to the source of the problem (didn't had a patch but pointed to the exact line of the issue) and 2 days later the issue was closed. However, this issue was discovered 2 weeks before and the only answer by the maintainer was "Yikes!".

I was disappointed by the lack of responsiveness from the maintainers. I would have expected the following:
* Investigation and release ASAP
* Notification to the sails maintainer so they update the dependency and release a new version. BTW, the latest sails 0.10.x release still depend on the bugged waterline version.
* Notification on the user mailing that a major issue was found and that update is required asap.

Nothing of that happened... so we decided to drop waterline.

2)
One reason we switched from mongodb to postgres is that we required an ACID transactional database. The switch to postgres went smooth... until we realized that there is no transaction support in waterline. I have read hacks here and there but it is not properly supported. We will be processing payments soon and we need to be rock solid on what data is persisted and when.

We are in the process of rewriting the whole model layer using Sequelize and it's just awesome.


text:
jExt - Spring
================================================================================

This module is an extension to [jExt][1] that provides a new `ExtensionLoader` connected to
the Spring bean management. This way, every bean managed by Spring would be retrieved by the
**jExt** `ExtensionManager`.

Usage
-----------------------------------------------------------------------------------------
Simply include this library as a dependency. No further configuration is required.

### Maven dependency
Include the following within the `<dependencies>` section of your `pom.xml` file:
```xml
<dependency>
    <groupId>jext</groupId>
    <artifactId>jext-spring</artifactId>
    <version>1.0.0</version>
</dependency>
```

Use the following repository to obtain this artifact:

```xml
<repositories>
    <repository>
        <id>github</id>
        <url>https://luiinge.github.io/maven-repo</url>
    </repository>
</repositories>
```

License
-----------------------------------------------------------------------------------------

```
    MIT License

    Copyright (c) 2020 Luis Iñesta Gelabert -<EMAIL_ADDRESS>
    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.
```

Authors
-----------------------------------------------------------------------------------------

- Luis Iñesta Gelabert  |<EMAIL_ADDRESS>

Contributions
-----------------------------------------------------------------------------------------
If you want to contribute to this project, visit the
[Github project](https://github.com/luiinge/jext-spring). You can open a new issue / feature
request, or make a pull request to consider. If your contribution is worthing, you will be added
as a contributor in this very page.

[1]: <https://github.com/luiinge/jext>

repository: luiinge/jext-spring

gha_language: Java

repo_name: luiinge/jext-spring


text:
# Detailed description of a few selected arguments

This list is not the full list, but a few arguments that were chosen.

## admin-access

`admin-access` controls the CIDR which can access the admin endpoints (SSH to each node, HTTPS to the master).

If not specified, no IP level restrictions will apply (though there are still restrictions, for example you need
a permitted SSH key to access the SSH service!).

Examples:

**CLI:**

`--admin-access=<IP_ADDRESS>/8` to restrict to IPs in the <IP_ADDRESS>/8 CIDR

`--admin-access=<IP_ADDRESS>/8 --admin-access=<IP_ADDRESS>/8` to restrict to IPs in the <IP_ADDRESS>/8 and <IP_ADDRESS>/8 CIDR blocks

**YAML:**

See the docs in [../cluster_spec.md#adminaccess](../cluster_spec.md#adminaccess)

## dns-zone

`dns-zone` controls the Route53 hosted zone in which DNS records will be created.  It can either be the name
of the hosted zone (`example.com`), or it can be the ID of the hosted zone (`Z1GABCD1ABC2DEF`)

Suppose you are creating a cluster named "dev.kubernetes.example.com`:

* You can specify a `--dns-zone=example.com` (you can have subdomains in a hosted zone)
* You could also use `--dns-zone=kubernetes.example.com`

You do have to set up the DNS nameservers so your hosted zone resolves.  kOps used to create the hosted
zone for you, but now (as you have to set up the nameservers anyway), there doesn't seem much reason to do so!

If you don't specify a dns-zone, kOps will list all your hosted zones, and choose the longest that
is a suffix of your cluster name.  So for `dev.kubernetes.example.com`, if you have `kubernetes.example.com`,
`example.com` and `somethingelse.example.com`, it would choose `kubernetes.example.com`.  `example.com` matches
but is shorter; `somethingelse.example.com` is not a suffix-match.

Examples:

`--dns-zone=example.com` to use the hosted zone with a name of example.com

## cloud-labels

`cloud-labels` specifies labels or tags for cloud provider resources managed by kOps. The supported format is a CSV list of key=value pairs.
Keys and values must not contain embedded commas but they may contain equals signs ('=') as long as the field is
quoted:

* `--cloud-labels "Project=\"Name=Foo Customer=Acme\",Owner=Jane Doe"` will be parsed as {Project:"Name=Foo Customer=Acme",
Owner: "Jane Doe"}

The exact allowed characters vary by cloud provider.

## UpdatePolicy

Cluster.Spec.UpdatePolicy

Values:

* `external` updates are performed by an external system (or manually), should not be automatically applied

* unset means to use the default policy, which is currently to apply OS security updates unless they require a reboot

Required packages are also updated during bootstrapping if the value is not set.

## out

`out` determines the directory into which kOps will write the target output for Terraform.  It defaults to `out/terraform`.

# API only Arguments

Certain arguments can only be passed via the API, eg, `kops edit cluster`. The following documents some of the more interesting or lesser-known options. See the [Cluster Spec](./../cluster_spec.md) page for more fields.

## kubeletPreferredAddressTypes

The apiserver can now select which type of kubelet-reported address to use for apiserver->node communications, using the --kubelet-preferred-address-types flag. (https://github.com/kubernetes/kubernetes/pull/35497, @liggitt)

Example:

```
kubeAPIServer:
	kubeletPreferredAddressTypes:
	- InternalIP
	- ExternalIP
```

More information about using YAML is available [here](../manifests_and_customizing_via_api.md).

repository: kubernetes/kops

gha_language: Go

repo_name: kubernetes/kops


text:
# Hackathon, 13 November 2019, Villach
## Decentralized Networking platform "ChainMeUp"

https://github.com/posseggs/ChainMeUp

# Hackathon 12, May 2019, Graz

## Streaming: "Ka Göd, ka Musi"
English: "No money, no music". lab10 managed to stream (in its semantic closest sense) “Streemable PLAY Tokens” (SPLY) as the music was playing. When the card is in touch with the NFC reader, the record player starts playing in exchange for tokens. When the card is removed, the streaming stops and so does the music. Quite rad, isn’t it? The PLAY tokens used here were minted in 2017 on Ethereum in the context of the Play4Privacy project. Therefore lab10 moved some of them over from the Ethereum chain to the ARTIS chain, converting them into “Streemable ERC20 Tokens” in the process. More details? check out: https://github.com/lab10-coop/kgkm-nfc

## BeerDentity
Blockchain identity verification using zero knowledge proofs: https://github.com/rekt0x/infineon_hackathon_2019

Usecase: The Infineon's Blockchain Security 2Go Starter Kit is used to store identity tokens using zero knowledge proofs in order to perform age verification without revealing any personal data. An user needs to go to a local authority with his hardware wallet smart card. The authority created a proof that the person is older than 18 years and issues an Identity Token to the users wallet. The user can then use the hardware wallet smart card at various locations to proof he is old enough to use certain services without revealing his real age or birthday to the 3rd party.

## Guardian Card
A novel social recovery scheme based on multi signature and smart contracts in combination with the Blockchain Security 2Go Starter Kit: https://github.com/lab10-coop/kgkm-power-switcher

## Document certification - Proof of existence
Due to the Blockchain technology there are more and more virtual notary services available: https://proofofexistence.com/, https://stampery.com/, https://poex.io/, https://chainy.info/ etc. With these services you are able to write data (e.g. a hash of a document) to the blockchain. The private key that was used to generate the transaction message allows you to proof the ownership, the existence but also the integrity of any kind of data without relying on trusted third parties. The service is also often used to proof that a specific recipient read your email at a certain point in time. A physical token, representing ownership of the data, maybe embedded in a real contract etc., does make sense.

Within this example the service "proofofexistence" for bitcoin was used to generate a transaction with the DOCPROOF attribute for the bitcoin network: https://www.blockchain.com/btc/tx/51bf2164bdf67e2a4fcf216dc2ec9f11778d177c58c2be9db6a8f017c996e95a

## Ethereum/Bitcoin Ring
The Blockchain Security 2Go card represents just one of the many form factors that can be supported by Infineon's security controller. Certainly other form factors which are using the contactless interface are feasible too. A nice example for innovative contactless chip integration is the Ethereum NFC ring.

## Physical representation of "Cryptokitties"
With this project a physical form of the Ethereum based Cryptokitties was generated. Therefore key1 of the card was read out and converted to an Ethereum address. Cryptokitties are non-fungible ERC-721 token, which allow for each entity to have specific attributes - in this case “Cattributes”. 6 Kitties were bought at the market and transferred to the prepared and printed card. All transfers can be checked at etherscan.io.

Daniela Fuzzyhands: https://etherscan.io/tx/0x39d8119652aaaa48980b0c36ad7294d933ad16ea64ab774e3f955f18f5db7bf4

Fabiano Lilsmoochie: https://etherscan.io/tx/0xa12fda9f27aa3e211dca80dfc07d3048cd4b22202ae3994d303955fe120ee522

Pepper Magicwump: https://etherscan.io/tx/0x396c2735c57e3526db052f2a4239ee7d58b2d97ecedfaf045a9d8d89585be762

Tundra Sister: https://etherscan.io/tx/0x65e4685a53efa804e976547b83abc1fe97b572c149dfa0dab03f2a297450dbf4

Lulu Scootchrum: https://etherscan.io/tx/0x147dcc8b343e7476a801bfac86337c5b7c34e9c968e532907cf944073d269a65

Moses Alldub: https://etherscan.io/tx/0x382532902ccf948738a2ca9e6c5c3d4e47c881d1e797855aa400ad3259750b47

## Bitcoin Bounty Vendingmachine
A vending machine is a nice example to showcase the cryptocurrency application: In this case the Blockchain Security 2Go Starter Kit is used to pay directly the vending machine in order to get a snack. Due to the machine to machine payment (without any trusted 3rd party or middleman) the vending machine now owns some cryptocurrency. As a result the vending machine could order new supply for its own when it is empty. Furthermore - imagine - why should anyone pay for the energy the vending machine is consuming? Certainly the vending machine should do it for its own - in future.

repository: Infineon/Blockchain

repo_name: Infineon/Blockchain


text:
Google authenticator for desktop
================================================

# Features

* add a secret and comment, the token will be shown on the menubar

* press ⌃ + 1/2/3 to copy the token into clipboard

# How to run

how to develop?

```shell
npm install
npm start # start electron app
npm run dev # run webpack dev server
```

how to build

```shell
npm install
npm run build #run webpack and electron package
```

# TODO

* language

repository: yangmls/authenticator

repo_name: yangmls/authenticator


text:
# LISRD - Local Invariance Selection at Runtime for Descriptors

This repository contains the implementation of the paper: [Online Invariance Selection for Local Feature Descriptors](https://arxiv.org/abs/2007.08988), R. Pautrat, V. Larsson, M. Oswald and M. Pollefeys (Oral at ECCV 2020).

LISRD offers the possibility to leverage descriptors with different invariances (e.g. invariant or variant to rotation and/or illumination) and to perform an online selection of the most adapted invariance when matching two images.

The following shows for example matches predicted with LISRD-SIFT that selects descriptors between SIFT (rotation invariant) and Upright SIFT (rotation variant):
![demo_lisrd_sift](assets/videos/demo_lisrd_sift.gif)

## Usage

### Installation

Clone the repository with its submodule:
```bash
git clone --recurse-submodules https://github.com/rpautrat/LISRD.git
```

We recommend using this code in a Python environment (e.g. venv or conda). The following script installs the necessary requirements and install the repository as a Python package locally:
```bash
make install
```

### Training your own model

All the training parameters should be present in a configuration file located in the folder `lisrd/configs`. The generic script to train your own model from the root folder is the following:
```bash
python -m lisrd.experiment train <path to your config file> <path to your experiment>
```

For example, training LISRD with the 4 types of invariance used in the paper would be:
```bash
python -m lisrd.experiment train lisrd/configs/lisrd.yaml ~/Documents/experiments/My_experiment
```
Use the config file `lisrd/configs/lisrd_sift.yaml` to instead train LISRD-SIFT that chooses between SIFT and Upright SIFT descriptors.

### Pretrained models

We provide two pretrained models:
- [lisrd_aachen](weights/lisrd_aachen.pth): version of LISRD used in the paper, trained on the [MS COCO](https://cocodataset.org) dataset, [Multi-Illumination Images in the Wild](https://projects.csail.mit.edu/illumination/) and [Aachen dataset images augmented with style-transfer or with optical flow information](https://github.com/naver/r2d2).
- [lisrd_vidit](weights/lisrd_vidit.pth): new version of LISRD, trained on the [MS COCO](https://cocodataset.org) dataset, [Multi-Illumination Images in the Wild](https://projects.csail.mit.edu/illumination/) and the [Virtual Image Dataset for Illumination Transfer (VIDIT)](https://github.com/majedelhelou/VIDIT). The results below are obtained using this model.

### How to use it

We provide a [notebook](notebooks/demo_lisrd.ipynb) showing how to use the trained models of LISRD. Additionally, `lisrd/export_features.yaml` is a script to export the LISRD descriptors with either SIFT or SuperPoint keypoints on a given set of images. It can be used as follows:
```bash
python -m lisrd.export_features <path to a txt file listing all your images> <name of the model (lisrd or lisrd_sift)> --checkpoint <path to checkpoint> --keypoints <type of keypoints (sift or superpoint)> --num_kp <number of keypoints (default: 2000)>
```

## Results on the RDNIM dataset

The Rotated Day-Night Image Matching (RDNIM) dataset originates from the [DNIM dataset](http://users.umiacs.umd.edu/~hzhou/dnim) and has been augmented with homographic warps with 50% of the images including rotations. The images used for evaluation in the paper are available [here](https://www.polybox.ethz.ch/index.php/s/P89YkZyOfdhmdPN).

Comparison to the state of the art on the RDNIM dataset, using SuperPoint keypoints for all methods and a correctness threshold of 3 pixels:

    Day reference
    Night reference

    Homography estimation
    Precision
    Recall
    Homography estimation
    Precision
    Recall

    Root SIFT
    0.134
    0.184
    0.125
    0.186
    0.239
    0.182

    HardNet
    0.249
    0.225
    0.224
    0.325
    0.359
    0.365

    SOSNet
    0.226
    0.218
    0.226
    0.252
    0.288
    0.296

    SuperPoint
    0.178
    0.191
    0.214
    0.235
    0.259
    0.296

    D2-Net
    0.124
    0.196
    0.145
    0.195
    0.265
    0.218

    R2D2
    0.190
    0.173
    0.180
    0.229
    0.237
    0.237

    GIFT
    0.225
    0.155
    0.149
    0.294
    0.240
    0.229

    LISRD (ours)
    0.318
    0.406
    0.439
    0.391
    0.488
    0.520

![mma_rdnim](assets/results/mma_rdnim.png)

## Bibtex

If you use this code in your project, please consider citing the following paper:
```bibtex
@InProceedings{Pautrat_2020_ECCV,
    author = {Pautrat, Rémi and Larsson, Viktor and Oswald, Martin R. and Pollefeys, Marc},
    title = {Online Invariance Selection for Local Feature Descriptors},
    booktitle = {Proceedings of the European Conference on Computer Vision (ECCV)},
    year = {2020},
}
```

repository: sunbirddy/LISRD

repo_name: sunbirddy/LISRD


text:
```@meta
EditURL = "<unknown>/cpss1.jl"
```

## Meanderline-Based CPSS
A "CPSS" is a circular polarization selective structure, i.e., a structure that reacts differently
to the two senses of circular polarization.
We'll first look at analyzing a design presented in the literature, and then proceed to optimize another
design using PSSFSS as the analysis engine inside the optimization objective function.
### Sjöberg and Ericsson Design
This example comes from the paper D. Sjöberg and A. Ericsson, "A multi layer meander line circular
polarization selective structure (MLML-CPSS)," The 8th European Conference on Antennas and Propagation
(EuCAP 2014), 2014, pp. 464-468, doi: 10.1109/EuCAP.2014.6901792.

The authors describe an ingenious structure consisting of 5 progressively rotated meanderline sheets, which
acts as a circular polarization selective surface: it passes LHCP (almost) without attenuation or
reflection, and reflects RHCP (without changing its sense!) almost without attenuation or transmission.

Here is the script that analyzes their design:

````@example cpss1
using PSSFSS
# Define convenience functions for sheets:
outer(rot) = meander(a=3.97, b=3.97, w1=0.13, w2=0.13, h=2.53+0.13, units=mm, ntri=600, rot=rot)
inner(rot) = meander(a=3.97*√2, b=3.97/√2, w1=0.1, w2=0.1, h=0.14+0.1, units=mm, ntri=600, rot=rot)
center(rot) = meander(a=3.97, b=3.97, w1=0.34, w2=0.34, h=2.51+0.34, units=mm, ntri=600, rot=rot)
# Note our definition of `h` differs from that of the reference by the width of the strip.
t1 = 4mm # Outer layers thickness
t2 = 2.45mm # Inner layers thickness
substrate = Layer(width=0.1mm, epsr=2.6)
foam(w) = Layer(width=w, epsr=1.05) # Foam layer convenience function
rot0 = 0 # rotation of first sheet
strata = [
    Layer()
    outer(rot0)
    substrate
    foam(t1)
    inner(rot0 - 45)
    substrate
    foam(t2)
    center(rot0 - 2*45)
    substrate
    foam(t2)
    inner(rot0 - 3*45)
    substrate
    foam(t1)
    outer(rot0 - 4*45)
    substrate
    Layer() ]
steering = (θ=0, ϕ=0)
flist = 10:0.1:20
#
results = analyze(strata, flist, steering, showprogress=false,
                  resultfile=devnull, logfile=devnull);
nothing #hide
````

Here are plots of the five meanderline sheets:

````@example cpss1
using Plots
plot(outer(rot0), unitcell=true, title="Sheet1")
````

````@example cpss1
plot(inner(rot0-45), unitcell=true, title="Sheet2")
````

````@example cpss1
plot(center(rot0-2*45), unitcell=true, title="Sheet3 (Center)")
````

````@example cpss1
plot(inner(rot0-3*45), unitcell=true, title="Sheet4")
````

````@example cpss1
plot(outer(rot0-4*45), unitcell=true, title="Sheet5")
````

Notice that not only are the meanders rotated, but so too are the unit cell rectangles.
This is because we used the generic `rot` keyword argument that rotates the entire unit
cell and its contents. `rot` can be used for any FSS or PSS element type.  As a consequence of
the different rotations applied to each unit cell, interactions between sheets due to higher-order
modes cannot be accounted for; only the dominant ``m=n=0`` TE and TM modes are used in cascading
the individual sheet scattering matrices.  This approximation is adequate for sheets that are
sufficiently separated.  We can see from the log file (saved from a previous run where it was not
disabled) that only 2 modes are used to model the interactions between sheets:

```
Starting PSSFSS 1.0.0 analysis on 2022-09-12 at 16:35:20.914
Julia Version 1.8.1
Commit afb6c60d69 (2022-09-06 15:09 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, skylake)
  Threads: 8 on 8 virtual cores
  BLAS: LBTConfig([ILP64] libopenblas64_.dll)

******************* Warning ***********************
   Unequal unit cells in sheets 1 and 2
   Setting #modes in dividing layer 3 to 2
******************* Warning ***********************

******************* Warning ***********************
   Unequal unit cells in sheets 2 and 3
   Setting #modes in dividing layer 5 to 2
******************* Warning ***********************

******************* Warning ***********************
   Unequal unit cells in sheets 3 and 4
   Setting #modes in dividing layer 7 to 2
******************* Warning ***********************

******************* Warning ***********************
   Unequal unit cells in sheets 4 and 5
   Setting #modes in dividing layer 9 to 2
******************* Warning ***********************

Dielectric layer information...

 Layer  Width  units  epsr   tandel   mur  mtandel modes  beta1x  beta1y  beta2x  beta2y
 ----- ------------- ------- ------ ------- ------ ----- ------- ------- ------- -------
     1    0.0000  mm    1.00 0.0000    1.00 0.0000     2  1582.7    -0.0    -0.0  1582.7
 ==================  Sheet   1  ========================  1582.7    -0.0    -0.0  1582.7
     2    0.1000  mm    2.60 0.0000    1.00 0.0000     0     0.0     0.0     0.0     0.0
     3    4.0000  mm    1.05 0.0000    1.00 0.0000     2  1582.7    -0.0    -0.0  1582.7
 ==================  Sheet   2  ========================   791.3  -791.3  1582.7  1582.7
     4    0.1000  mm    2.60 0.0000    1.00 0.0000     0     0.0     0.0     0.0     0.0
     5    2.4500  mm    1.05 0.0000    1.00 0.0000     2   791.3  -791.3  1582.7  1582.7
 ==================  Sheet   3  ========================     0.0 -1582.7  1582.7     0.0
     6    0.1000  mm    2.60 0.0000    1.00 0.0000     0     0.0     0.0     0.0     0.0
     7    2.4500  mm    1.05 0.0000    1.00 0.0000     2     0.0 -1582.7  1582.7     0.0
 ==================  Sheet   4  ========================  -791.3  -791.3  1582.7 -1582.7
     8    0.1000  mm    2.60 0.0000    1.00 0.0000     0     0.0     0.0     0.0     0.0
     9    4.0000  mm    1.05 0.0000    1.00 0.0000     2  -791.3  -791.3  1582.7 -1582.7
 ==================  Sheet   5  ======================== -1582.7     0.0     0.0 -1582.7
    10    0.1000  mm    2.60 0.0000    1.00 0.0000     0     0.0     0.0     0.0     0.0
    11    0.0000  mm    1.00 0.0000    1.00 0.0000     2 -1582.7     0.0     0.0 -1582.7

...
```

Note that PSSFSS prints warnings to the log file where it is forced to set the number of layer
modes to 2 because of unequal unit cells.  Also, in the dielectric layer list it can be seen
that these layers are assigned 2 modes each.  The thin layers adjacent to sheets are assigned 0
modes because these sheets are incorporated into so-called "GSM blocks" or "Gblocks" wherein
the presence of the thin layer is accounted for using the stratified medium Green's functions.
Analyzing this multilayer structure at 101 frequencies required about 22 seconds on my machine.

Here is the script that compares PSSFSS predicted performance with very
high accuracy predictions from CST and COMSOL that were digitized from figures in the paper.

````@example cpss1
using Plots, DelimitedFiles
RL11rr = -extract_result(results, @outputs s11db(r,r))
AR11r = extract_result(results, @outputs ar11db(r))
IL21L = -extract_result(results, @outputs s21db(L,L))
AR21L = extract_result(results, @outputs ar21db(L))

RLgoal, ILgoal, ARgoal  = ([0.5, 0.5], [0.5, 0.5], [0.75, 0.75])
foptlimits = [12, 18]
default(lw=2, xtick=10:20, xlabel="Frequency (GHz)", ylabel="Amplitude (dB)", gridalpha=0.3)

p = plot(flist,RL11rr,title="RHCP → RHCP Return Loss", label="PSSFSS",
         ylim=(0,2), ytick=0:0.25:2)
cst = readdlm("../src/assets/cpss_cst_fine_digitized_rl.csv", ',')
plot!(p, cst[:,1], cst[:,2], label="CST")
comsol = readdlm("../src/assets/cpss_comsol_fine_digitized_rl.csv", ',')
plot!(p, comsol[:,1], comsol[:,2], label="COMSOL")
plot!(p, foptlimits, RLgoal, color=:black, lw=4, label="Goal")
savefig("cpssa1.png"); nothing  # hide
````

![](cpssa1.png)

````@example cpss1
p = plot(flist,AR11r,title="RHCP → RHCP Reflected Axial Ratio", label="PSSFSS",
         xlim=(10,20), ylim=(0,3), ytick=0:0.5:3)
cst = readdlm("../src/assets/cpss_cst_fine_digitized_ar_reflected.csv", ',')
plot!(p, cst[:,1], cst[:,2], label="CST")
comsol = readdlm("../src/assets/cpss_comsol_fine_digitized_ar_reflected.csv", ',')
plot!(p, comsol[:,1], comsol[:,2], label="COMSOL")
plot!(p, foptlimits, ARgoal, color=:black, lw=4, label="Goal")
savefig("cpssa2.png"); nothing  # hide
````

![](cpssa2.png)

````@example cpss1
p = plot(flist,IL21L,title="LHCP → LHCP Insertion Loss", label="PSSFSS",
         xlim=(10,20), ylim=(0,2), ytick=0:0.25:2)
cst = readdlm("../src/assets/cpss_cst_fine_digitized_il.csv", ',')
plot!(p, cst[:,1], cst[:,2], label="CST")
comsol = readdlm("../src/assets/cpss_comsol_fine_digitized_il.csv", ',')
plot!(p, comsol[:,1], comsol[:,2], label="COMSOL")
plot!(p, foptlimits, ILgoal, color=:black, lw=4, label="Goal")
savefig("cpssa3.png"); nothing  # hide
````

![](cpssa3.png)

````@example cpss1
p = plot(flist,AR21L,title="LHCP → LHCP Transmitted Axial Ratio", label="PSSFSS",
         xlim=(10,20), ylim=(0,3), ytick=0:0.5:3)
cst = readdlm("../src/assets/cpss_cst_fine_digitized_ar_transmitted.csv", ',')
plot!(p, cst[:,1], cst[:,2], label="CST")
comsol = readdlm("../src/assets/cpss_comsol_fine_digitized_ar_transmitted.csv", ',')
plot!(p, comsol[:,1], comsol[:,2], label="COMSOL")
plot!(p, foptlimits, ARgoal, color=:black, lw=4, label="Goal")
savefig("cpssa4.png"); nothing  # hide
````

![](cpssa4.png)

The PSSFSS results generally track well with the high-accuracy solutions, but are less accurate
especially at the high end of the band, possibly because in PSSFSS metallization thickness is
neglected and cascading is performed for this structure using only the two principal Floquet modes.
As previosly discussed, this is necessary because the rotated meanderlines are achieved by rotating
the entire unit cell, and the unit cell for sheets 2 and 4 are not square.  Since the periodicity of
the sheets in the structure varies from sheet to sheet, higher order Floquet modes common to neighboring
sheets cannot be defined, so we are forced to use only the dominant (0,0) modes which are independent of
the periodicity.  This limitation is removed in a later example.
Meanwhile, it is of interest to note that their high-accuracy runs
required 10 hours for CST and 19 hours for COMSOL on large engineering workstations versus about 22
seconds for PSSFSS on my desktop machine.

gha_language: Julia


text:
[Back to health-ext](https://github.com/microprofile-extensions/health-ext/blob/main/README.md)

# System probes

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.microprofile-ext.health-ext/healthprobe-system/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.microprofile-ext.health-ext/healthprobe-system)
[![Javadocs](https://www.javadoc.io/badge/org.microprofile-ext.health-ext/healthprobe-system.svg)](https://www.javadoc.io/doc/org.microprofile-ext.health-ext/healthprobe-system)

## Adding System probes

In ```pom.xml```:

```xml

    <dependency>
        <groupId>org.microprofile-ext.health-ext</groupId>
        <artifactId>healthprobe-system</artifactId>
        <version>XXXXX</version>
        <scope>runtime</scope>
    </dependency>

```

## Configuration options

* health.system.load.max = 0.7 (default)

Once the system load is greater than this value, the health probe will report down. Default value is 0.7

## Example output

![](https://raw.githubusercontent.com/microprofile-extensions/health-ext/main/healthprobe-system/screenshot.png)

repository: microprofile-extensions/health-ext

repo_name: microprofile-extensions/health-ext


text:
# Ballista

***Ballista*** is a ***Express style*** webframwork for ***Igropyr***

### Igropyr : Ballista = Node : Express

> ***Ballista*** is repackaged on ***Catapult*** basis to make the application easier. But no longer purely functional.

## [Manual](https://guenchi.github.io/Ballista)

***easily to write the router***

```
(get     "/"             index)
(get     "/index"        index)
(get     "/blog/*/en"    blogEN)
(get     "/articles/*"   article)
(get     "/*"            handle404)
(post    "/users"        users)
(post    "/notes"        notes)
```

***easily to control the process***

application-level middleware:
```
(get-use middleware1)
(get-use middleware2)
(get-use middleware3)
...
```

router-level middleware:
```
(get  "/index"  middleware ...  index)
```

***easily to set up the server***

```
(staticpath "/usr/local/www/")
(listen-on "<IP_ADDRESS>")
(listen-on 8080)
(listen-on "<IP_ADDRESS>" 8080)
```

***[Igropyr](https://guenchi.github.io/Igropyr)*** is a async http-server for Chez Scheme

Ballista's sister framwork and its dependence: ***[Catapult](https://guenchi.github.io/Catapult)*** (purely functional)

repository: DavidAlphaFox/Ballista

repo_name: DavidAlphaFox/Ballista


text:
# HSLayers-NG mapping library

HSLayers-NG is a library which extends OpenLayers 6 functionality by providing a foundation to build map GUI and extra components such as layer manager, permalink generating, styling of vector features, including OpenGIS® Web Map Service Interface Standard (WMS) layers to the map in a user friendly way etc.

Check out the examples to get an idea:
* http://ng.hslayers.org/examples/
* http://opentransportnet.eu/create-maps
* http://sdi4apps.eu/spoi/

## Before You Start
HSLayers-NG is built on top of two major things: [OpenLayers](openlayers.org) library and [AngularJS](angularjs.org) framework. So in order to work with HSLayers you should have some understanding of both.
OpenLayers has a nice [tutorial workshop](https://openlayers.org/workshop/) to start with.

## Getting Started

After successfully installing [Node](https://nodejs.org/en/) along with [npm](https://www.npmjs.com/), run the following in terminal:

`npm install hslayers-ng`

Include the bundle file

```<script src="node_modules/hslayers-ng/dist/hslayers-ng.js"></script>```

### Configure the application

A global hslayersNgConfig function, which returns a configuration object, needs to be created before loading the hslayers-ng.js script. It returns a json object to configure applications looks, behaviour and data. See [Configuration options](https://github.com/hslayers/hslayers-ng/wiki/Config-parameters) for the available options.

```
<script>
    function hslayersNgConfig(ol) {
      return {
        default_layers: [
          new ol.layer.Tile({
            source: new ol.source.OSM(),
            title: "OpenStreetMap",
            base: true,
            visible: true,
            removable: false
          })
        ],

        default_view: new ol.View({
          center: ol.proj.transform([17.474129, 52.574000], 'EPSG:4326', 'EPSG:3857'), //Latitude longitude    to Spherical Mercator
          zoom: 4,
          units: "m"
        })
      }
    }
  </script>
  ```

Include in your html file, where the map should appear.

```
<div hs ng-controller="Main" style="position: relative;"></div>
```

To have more customization options which require programming you can also write your own entry module which in this example is named app.js, but can have any other file name.
app-js.ts file is where you specify which hslayers modules will be loaded for your specific
application, which map layers will be displayed and other configuration parameters.
You can also write some startup code here to load a map service, open some initial panels etc.

Some example html files are provided in https://github.com/hslayers/examples repository. The template app.js uses
png icons for layer groups which are included in https://github.com/hslayers/examples/tree/master/full directory.

For webpack bundling instructions see [Building with webpack](https://github.com/hslayers/hslayers-ng/wiki/Building-with-webpack)

### Proxy
To overcome CORS issues when adding external datasources, querying feature info or searching, we use a proxy.
Hslayers-ng bundles two proxy solutions inside its lib directory. We recommend Nodejs based solution which is based on [cors-anywhere](https://github.com/Rob--W/cors-anywhere).
To start it run:

```npm explore hslayers-ng -- npm run start-hsl-proxy```

Another possibility is to use a python cgi script, which you have to copy from `lib/hsproxy.cgi`
to your cgi-bin directory. It might be located in /usr/lib/ if you use Apache.

```
cp lib/hsproxy.cgi /usr/lib/cgi-bin/hsproxy.cgi
```

To enable cgi on ubuntu, use

```
sudo a2enmod cgi
sudo service apache2 restart
```

If you are using nginx, see [HsProxy configuration with uwsgi](https://github.com/hslayers/hslayers-ng/wiki/Hsproxy-configuration)

### Run the Application

If you dont plan to develop hslayers-ng, dont want to run tests and and server files through npm managed
http server, then you can skip all the following `npm` related steps.

We have preconfigured the project with a simple development web server, but you can always use a different web server.
The simplest way to start this server is:

```
npm start
```

Now browse to the app at `http://localhost:8000/`.

### Running Unit Tests

See [Testing](https://github.com/hslayers/hslayers-ng/wiki/Testing).

## Translating
Run
```
grunt nggettext_extract
```
from terminal to generate po file template in /po/template.po and for each example eg. examples/pilsen_traffic/template.pot .
Rename it to *.po, translate, generate mo file and compile it.
If you are using specific translations for your app or example merge the global po file into the specific one with msgcat before compiling.
Compiling is done with
```
grunt nggettext_compile
```
It will generate components/translations/js/translations.js or examples/pilsen_traffic/translations.js files.

translations.js which contains the strings and also translating functionality is loaded by default like any other angular module from components/translations/js/translations.js in HsCore module. To have it use your own generated translations.js file override the path in hslayers.js file:
```
translations: hsl_path + 'examples/pilsen_traffic/translations'
```
## Updating AngularJS

You can update all dependencies by running:

```
npm update
```

## Contact

<EMAIL_ADDRESS>

repository: cvpreddy/hslayers-ng

repo_name: cvpreddy/hslayers-ng


text:
# Quota
To limit disk access, the standard Linux quota system is used.
This is generally not enabled on new systems, so it must first be enabled for the devices that submitted programs can write to.
In the operations of the judge, they will only ever write to files in the `/var/lib/omogen/submissions` directory, so quota must be enabled for the device this directory is mounted at.

Quota first needs to be enabled on the correct device by editing `/etc/fstab`, finding the line corresponding to the correct device, and adding `usrquota` to the options.
After adding the option, remount the device.

Then, quota needs to be enabled on the system with the commands

```bash
sudo quotacheck -ugm /
sudo quotaon -v /
```

If the `/var/lib/omogen/submissions` directory is not mounted on the root device, be sure to replace `/` in the commands with the correct mount point.

repository: bilsen/omogenexec

repo_name: bilsen/omogenexec


text:
# Introduction
This Node-RED node allows IBM ODM decision services to be configured and executed from within a single node without having to resort to configuring a series of nodes within a flow.

The purpose is to hide away the complexities of calling decision services and extracting the various parts of the response such as execution trace information, whilst providing easy to use configuration options that deal with the specifics of ODM.

# Usage
The `Make Decision` node can be found in the IBM ODM palette. Simply drag onto the canvas to start configuring and using it. It can be found in the IBM ODM section of the node palette as shown below.

![](https://raw.githubusercontent.com/BP3/node-red-contrib-ibm-odm-make-decision/master/images/make-decision-palette.png)

When the decision service is called, the status of the service is displayed on the flow, as shown below.

![](https://raw.githubusercontent.com/BP3/node-red-contrib-ibm-odm-make-decision/master/images/test-flow-service-status.png)

The configuration of the node is split into two parts using configuration nodes. The first is the target decision server configuration including the host and authentication details, and the second is the configuration of the rule app and rule set path. This allows a mixture of configurations per node, for example if you want to call the same rule app/rule set but on different target decision servers. Examples can be seen below.

![](https://raw.githubusercontent.com/BP3/node-red-contrib-ibm-odm-make-decision/master/images/server-details-config.png)

![](https://raw.githubusercontent.com/BP3/node-red-contrib-ibm-odm-make-decision/master/images/ruleapp-details-config.png)

You can also set the decision service configuration dynamically by setting properties on the `msg` object, which can be mixed and matched with the defined configuration nodes. An example can be seen below.

![](https://raw.githubusercontent.com/BP3/node-red-contrib-ibm-odm-make-decision/master/images/dynamic-config.png)

There is full documentation on how to configure the node within the node help info. There is also an example flow which can be imported from the file `tests/make-decision-test-flow.json`.

# Testing
To run the unit tests, use the following command from the root of the project: `npm test`.

There is also a Docker Compose YML file `node-red/docker-compose.yml` that will create a basic Node-RED server. Once started you can then see the test flow with described earlier. To run the Node-RED container you will need to first install Docker, and then run the following command: `docker-compose up`.

# Limitations
The component currently only works with JSON/REST services. This decision was made due to the fact that JSON/REST is the most popular method of communicating with ODM decision services, and that natively Node-RED works with JSON and Javascript Objects. If there is a demand for SOAP or XML/REST, then we will look to build it into the component.

The execution trace currently only returns the following information. Again of more trace data is required then we will look into building it into the component:
- Decision Id
- Requested ruleset path
- Executed ruleset path
- Execution date
- Execution duration
- List of the rules fired

# Compatability
This component has been tested with the following ODM versions:
- ODM 8.9.2 & 8.10
- ODM On Cloud

However given the stable nature of the HTDS functionality in ODM, this should work OK with past versions of ODM that support JSON over REST.


text:
#Fledgling Maker

A quick and dirty blog site run by Chris Stack to document various DIY projects and other things that may be of interest to other nerdy people.

The base of Fledgling Maker is a fork of Jekyll Now.

**Jekyll** is a static site generator that's perfect for GitHub hosted blogs ([Jekyll Repository](https://github.com/jekyll/jekyll))

Jekyll Now is even simpler then Jekyll because no setup is required. Just fork the repository here:([Jekyll Now Repository]( https://github.com/barryclark/jekyll-now)) and follow the directions to get started.

## Other forkable themes - Haven't looked into these yet

You can use the [Quick Start](https://github.com/barryclark/jekyll-now#quick-start) workflow with other themes that are set up to be forked too! Here are some of  my favorites:

- [Hyde](https://github.com/poole/hyde) by MDO
- [Lanyon](https://github.com/poole/lanyon) by MDO
- [mojombo.github.io](https://github.com/mojombo/mojombo.github.io) by Tom Preston-Werner
- [Left](https://github.com/holman/left) by Zach Holman
- [Minimal Mistakes](https://github.com/mmistakes/minimal-mistakes) by Michael Rose
- [Skinny Bones](https://github.com/mmistakes/skinny-bones-jekyll) by Michael Rose

## Credits

- [Jekyll](https://github.com/jekyll/jekyll) - Thanks to it's creators, contributors and maintainers.
- [SVG icons](https://github.com/neilorangepeel/Free-Social-Icons) - Thanks, Neil Orange Peel. They're beautiful.
- [Solarized Light Pygments](https://gist.github.com/edwardhotchkiss/2005058) - Thanks, Edward.
- [Joel Glovier](http://joelglovier.com/writing/) - Great Jekyll articles. I used Joel's feed.xml in this repository.
- [David Furnes](https://github.com/dfurnes), [Jon Uy](https://github.com/jonuy), [Luke Patton](https://github.com/lkpttn) - Thanks for the design/code reviews.
- [Bart Kiers](https://github.com/bkiers), [Javier Cejudo](https://github.com/javiercejudo) - Thanks for your [fantastic contributions](https://github.com/barryclark/jekyll-now/commits/master) to the project!


text:
---
toc: true
layout: post
description: A better Q&A system based on knowledge retrieval
author: Shubham Gupta
categories: [nlp, bert, review]
image: images/realm/training.png
title: 'REALM: Retrieval-Augmented Language MOdel Pre-Training'
---

Introduction
============

-   REALM is a paper mentioned in the T5 paper titled: **How Much
    Knowledge Can You Pack Into The Parameters of a Language Model?**

-   TLDR: This paper retrieves documents that have the information
    present while solving Question-Answer type problems.

    > **NOTE**: This post is more like my running notes while reading the paper than a comprehensive blog. I will update this blog once I learn a little more about the transformer architecture.

-   Introduced a latent *knowledge retriever*, which can attend and
    retrieve documents over large corpus and can be trained in
    unsupervised manner using masked language modelling technique and
    backprop through retreiver which considers lots of docs.

    ![Training process for
    REALM[]{data-label="fig:training"}]({{site.baseurl}}/images/realm/training.png)

-   Key point: Train retriever using a performance-based signal from
    unsupervised text.

-   Retrieval based LM => Moar computational resources => Moar
    money

    -   Solution: Computation performed for each doc is cached and can
        be used again. Best doc selected using *Maximum Inner Product
        Search(MIPS)*. Read the paper
        [here](https://cs.stanford.edu/~ermon/papers/ICML_MIPS_Gumbel.pdf).

-   REALM retriever can be used on downstream tasks via transfer
    learning.

-   REALM is SOTA on NQ-Open, WQ and CuratedTrec.

Approach
========

*Retreive-then-predict generative process*
-------------------------------------------

- Training: Masked-LM. Fine-tuning: Open QA task

- Computing chance of the document given a question decomposed into two steps:
    -   Function to be computed: $$p(y\|x)$$

    -   Given $$x$$,retrive documents $$z$$ from corpus $$Z$$. Modelled as:
        $$p(z\|x)$$

    -   Condition of both $$z$$ and $$x$$ to generate output $$y$$ i.e
        $$p(y\|z, x)$$

    -   Overall likelihood $$y$$ is generated by treating $$z$$ as latent
        variable and marginalizing over all documents $$z$$

        $$
        p(y\|x) = \sum_{z \epsilon Z} p(y\|z, x) * p(z\|x)
        $$

# Architecture

- **Neural Knowledge Retriever** which models the distribution: $p(z\|x)$

- **Knowledge Augmented Encoder** which models the distribution $$p(y\|z, x)$$

Neural Knowledge Retriever
--------------------------

-   Dense inner product model.

    $$
    \begin{aligned}
        p(z\|x) = \frac{exp(f(x,z))}{\sum_{z'}{exp(f(x,z'))}} \\
        f(x,z) = Embed_{input}(x)^TEmbed_{doc}(z)
    \end{aligned}
    $$

-   $$Embed_{input}$$ and $$Embed_{doc}$$ are embedding functions

-   $$f(x,z)$$ is called **relevance score**. It is inner product of vector
    embeddings.

-   Relevant Distribution is softmax over all relevance scores

-   Embedding implement using BERT-style transformers. Join using
    <SEP>, prefix using <CLS> and append <SEP> as the
    end token.
        $$\begin{aligned}
            \\ join_{BERT}(x) = [CLS]x[SEP]
            \\ join_{BERT}(x_1, x_2) = [CLS]x_1[SEP]x_2[SEP]
        \end{aligned}$$

-   Pass above into transformer, which gives over vector for each token.
    Perform linear projection to reduce dimensionality of vector
    $$\begin{aligned}
        \\ Embed_{input}(x) = W_{input}BERT_{CLS}(join_{BERT}(x))
        \\ Embed_{doc}(z) = W_{doc}BERT_{CLS}(join_{BERT}(z_{title}, z_{body}))
    \end{aligned}$$

Knowledge-Augmented Encoder
---------------------------

-   Given input $$x$$ and relevant doc $$z$$, this defines $$p(y\|z,x)$$

-   Join $$x$$ and $$z$$ into single sequence and feed into transformer

-   Here, training is different for pre-training vs fine-tuning

    -   For pre-training, predict \[MASK\] token. Use same Masked
        LM(MLM) loss as in Transformer(Devlin et al.)

    -   For Open-QA, we need to produce string $$y$$.
    - **Assumption**: $$y$$ occurs as sequence of tokens in some document in the corpus.

Training
--------

-   Compute gradients in $$\theta$$ and $$\phi$$ and optimize using SGD.

-   Challenge: Computing $$p(y\|x)$$

-   Approx by summing over top $$k$$ documents with highest prob under
    $$p(z\|x)$$

-   Question: How to find top $$k$$ docs? Answer: Use MIPS

-   Need to precompute $$Embed_{doc}(x)$$ for all docs. Problem? It
    changes with each step of SGD.

-   *Solution*: Async refresh $Embed_{doc}$ every 500 steps

-   Use MIPS to select top $k$ docs. For these docs, recompute $p(z\|x)$
    using new $\theta$.

### Implementing async MIPS refreshes

-   Two jobs running in parallel:

    -   *Primary trainer*: Perform gradient updates on parameters

    -   *Secondary index builder*: Embeds and indexes the docs

        ![Async MIPS
        implementation[]{data-label="fig:async_mips"}]({{site.baseurl}}/images/realm/async_mips.png)

    -   Async refresh used only for pre-training

    -   For fine tuning, build index once from pre-trained $\theta$ and
        use it.

### What does retriever learn?

-   Retriever promotes docs that improve accuracy

-   This can be analyzed by analyzing gradient wrt the parameters

### Injecting inductive biases into pre-trianing

-   **Salient span masking**: Some questions require only local context.
    Select named entities and dates and mask one of them. Performs
    better.

-   **Null document**: Add null document to top $$k$$ documents to allow
    answers even when no context is required

-   **Prohibiting trivial retrievals**: If knowledge corpus $$Z$$ is the
    same as pre-training corpus $$X$$, it can predict $$y$$ by looking at
    $$x$$ in $$z$$. Exclude trivial candidate

-   **Initialization**: Warm up $$Embed_{input}$$ and $$Embed_{doc}$$ using
    Inverse Cloze Task(ICT) i.e model trained to retrieve the doc where
    the sentence came from.

Experiments
===========

-   REALM outperforms all approaches by a big margin.

Future Work
===========

-   Structured knowledge where we learn entities which are informative

-   Multi lingual setting. Retreiving knowledge in high resource
    language to better represent text in low resource language

-   Multi model setting. Retrieve images or videos that can provide
    knowledge not present in text

Comments
===========

Overall, I enjoyed reading this paper. However, there are two key points that concern me:

- The authors mention using MIPS for selecting the top $$k$$ documents, in order to simplify the task. However, would selecting only these documents from the entire dataset not lead to some information loss? I would like to see more experiments around this area.
- There are no experiments around trying out larger models. While I agree that T5 is the largest model available right now, there is no evidence given that a model larger than T5-large would not perform better than the current REALM model. I would like to see some more exploration around this area.

Resources
==========
There are a number of other resources you can use to learn more about this paper such as:

- The original paper available [here](https://arxiv.org/abs/2002.08909)
- Tweet summary by Adam Roberts available [here](https://twitter.com/ada_rob/status/1227062195671822336)
- Video summary by Václav Košař available [here](https://twitter.com/ada_rob/status/1227062195671822336)
- Huggingface Reading group summary by Joe Davidson available [here](https://joeddav.github.io/blog/2020/03/03/REALM.html)

repository: goodhamgupta/blog

gha_language: Jupyter Notebook

repo_name: goodhamgupta/blog


text:
---
layout: post
title: Developing Protean Application With Morpheus - Part 5
comments: true
permalink: developing-protean-applications-part5
---

###Protean Services

In contrast to the previous case study, this one focuses on behavioral
aspects of the adaptive applications development (i.e. protean applications).

Before delving into the analysis, let me introduce the subject by the
following narrative.

*A company plans to offer an email service for both its customers and
its employees. Although the functionality of the service is mostly the same for both types
of users, such as a virus scan, it differs in a couple of details, such as an insertion of
the employees's signature into the end of every email and a verification that
the customer's account is not expired.*

*For eligible users the email service may provide some extending functionality,
such as sending fax by email for premium customers.*

*A number of employees are also company's customers. Such employees are allowed
to use the service under their employee account when they are in the office,
otherwise they use the service under their customer account. To allow a continuous
usage for such users, the email service is able to switch transparently between
the accounts either automatically or manually.*

The description suggests that the service's behavior is very contextual. How it
actually works depends on several factors, such as the type of the current account (employee, customer),
the user's traits (e.g. premium), the message being sent and also time, since
the service can switch between the accounts in the background.

Additionally, the service's interface is also mutable, since at various times
it can provide various extending features. This fact puts some special requirements on
the service's user interface, which must be able to reflect these mutations.
For example, if a user is both an employee and a premium customer, then the
user interface should adapt its look when the service switches the account to the
premium customer one in the background so that the user could send faxes by email.

In the following paragraphs I am examining how such a service can be
designed on two platforms: the first having no concept of traits and the other
with traits.

#####Modelling the Service Without Traits

Before modeling the service itself, let us begin with the domain model. It consists
of two domain entities only: `RegisteredUser` and `Employee`. Since the two
entity classes have no common ancestor, it is necessary to add an adapter interface,
which will establish the common basis for the service, as shown in the following
diagram.

In order to promote the conversion of "IS" properties to types, there is
the `PremiumUser` interface so that the "isPremium" property could be determined
by the `instanceof` operator.

The `MailOwner` interface contains properties having their counterparts in
both entity classes. There are also two implementations of `MailOwner`, each for
one entity class.

Now, when the domain entities can be adapted to a common base, it is possible
to model the mail service.

The `UserMail` interface declares two methods. Method `sendEmail` is the core
method for sending emails. The other method, `validateEmail`, allows the user
to validate a message before sending it.

The default implementation `DefaultUserMail` works in the context of the current
user account, from which it retrieves the `from` field for emails, among others.
This user account is held in a reference attribute of `DefaultUserMail`.

The `sendEmail` method in `DefaultUserMail` invokes the `validateEmail` method
before the email is actually sent. It allows for subclasses to override the default
validation by adding more specific checks.

As mentioned above, the service's behavior reflects the type of the user account.
Therefore there are two specializations of `DefaultUserMail` for both account types.

`EmployeeUserMail` overrides method `sendEmail` so as to add the employee's
signature at the end of every email.

On the contrary, `RegisteredUserMail` overrides `validateEmail` in order to
check if the user's account is not expired.

The service also contains a stack of pluggable email processors forming
a processing pipeline. These processors implement `UserMail` interface and
are connected through delegation. One of such processors is `VirusDetector`.

Here, one important weakness related to the absence of traits is evident.
The `VirusDetector` class overrides `sendEmail` as well as `validateEmail`,
although it would make sense to override `validateEmail` only. The virus scan
in email attachments may be considered part of the validation performed before sending
the mail by `DefaultUserMail`.

Unfortunately, since the virus detector and the wrapped email service are
separate objects connected by a reference only, the invocation of `validateEmail`
in `DefaultUserMail` will always either remain in `DefaultUserMail` or jump to some
of its subclasses overriding `validateEmail`. Since `VirusDetector` is not a subclass
of `DefaultUserMail`, its implementation of `validateEmail` will never be called
from within the wrapped instance. Therefore this method must be explicitly
invoked from `sendEmail` in `VirusDetector`. Not only does it complicate the code
but it also introduces some inconsistency related to the semantics of `validateEmail`.
On one hand it may be desirable to implement the virus scan in this method, since
the client uses this method to check whether the email is valid. On the other hand,
the validations are supposed to be invoked from the "deepest" `sendEmail` method in a `UserMail`
implementation. It is the implementations's decision whether to invoke the validations
or not (even if it makes sense to do it always). In the case that the implementation
decides to skip the validations, the `VirusDetector` wrapper will ignore this
decision and will validate the email anyway, possibly throwing an exception if
it detects some virus.

This complication is just one of the unfortunate consequences of object schizophrenia.

In the following paragraph I am explaining that if the platform were equipped
with the concept of traits, the processors could be linked by means of the stacking of traits [LINK]
and the above-mentioned problem could be avoided elegantly.

Besides the general email service, there is also an extension offering sending
faxes by email. This service add-on is available to premium customers only.

The only method in `UserFaxByMail` sends faxes and has the same signature as
`sendEmail`. The default implementation also works in the context of the current
user account and holds a reference to `MailAccount`. It also implements `UserMail`
by delegation in order to facilitate the composition of `UserFaxByMail` and `UserMail`
interfaces.

On top of the model there is the `AlternatingUserMail` class, whose purpose is
to switch transparently between the two accounts if the user has both. `AlternatingUserMail`
contains two references to two instances of the mail services and the class is implemented
by means of the state pattern.[LINK]

This class also implements the `UserFaxByMail` interface, which is only a conditional
implementation, since unless the current mail service implements `UserFaxByMail`,
the `faxEmail` method throws an exception.

Whether the `faxEmail` is possible to invoke may be determined by `canFaxEmail`.
The positive test, however, does not guarantee that the invocation
of `canFaxEmail` will be pass, since the current mail service in the `AlternatingUserMail`
instance might change in the meantime.

Such design is error-prone, because it requires that the topmost wrapper in a
fax-by-mail service instance be one composing `UserMail` and `UserFaxByMail` interfaces, such as
`DefaultUserFaxByMail`, in order to indicate the presence of both interfaces.
The reason is that `AlternatingUserMail` determines whether a mail service instance
is `UserFaxByMail` by checking its type. It follows that it may happen that the topmost
wrapper of such a mail service is wrapped by another wrapper possibly hiding
the `UserFaxByMail` type.

Additionally, it would be practically impossible for the client to determine
the actual user account type without using some reflection tricks or introducing
a new `getUserAccount` method in the `UserMail` interface. Both solutions are bad.

The former would be a plain hack, while the latter purblindly introduces a backward
incompatible change to the general contract declared by the `UserMail` interface.
It would force all `UserMail` implementations to add the new method even if it would
make no sense for them, since some implementation may not wrap any user account
object at all. Such classes would have to return `null` as an indication there is
no underlying user account object. Moreover, the return type of the `getUserAccount`
method would have to be `Object`, since there is no common ground shared
by all potential user accounts; the diversity of user accounts is actually
the main presupposition of this case study.

#####Assembling the Service

The following code sketches how the email service may be assembled from individual
components.

```java
public static void useMailService(Map<String, Object> employeeData, Map<String, Object> regUserData) {

    Employee employee = initEmployee(employeeData);
    RegisteredUser registeredUser = initRegisteredUser(regUserData);

    // The client must be fixed to AlternatingUserMail through which it can determine whether the service supports fax.
    AlternatingUserMail userMail = initMailService(employee, registeredUser);

    Message msg = new Message();
    msg.setRecipients(Collections.singletonList("pepa@gmail.com"));
    msg.setSubject("Hello");
    msg.setBody("Hi, Pepa!");

    userMail.sendEmail(msg);
}

public static Employee initEmployee(Map<String, Object> employeeData) {
    Employee employee = new Employee();
    employee.load(employeeData);
    return employee;
}

public static RegisteredUser initRegisteredUser(Map<String, Object> regUserData) {
    RegisteredUser registeredUser;
    if (Boolean.TRUE.equals(regUserData.get("isPremium"))) {
        class Premium extends RegisteredUser implements PremiumUser {}
        registeredUser = new Premium();
    } else {
        registeredUser = new RegisteredUser();
    }
    registeredUser.load(regUserData);

    return registeredUser;
}

public static AlternatingUserMail initMailService(Employee employee, RegisteredUser registeredUser) {
    // We need to clone the state of both employee and registeredUser
    EmployeeAdapter employeeAdapter = new EmployeeAdapter(employee);
    final UserMail employeeMail = new VirusDetector(new EmployeeUserMail(employeeAdapter));

    final RegisteredUserAdapter registeredUserAdapter = new RegisteredUserAdapter(regUser);
    final UserMail regUserMail = new VirusDetector(new RegisteredUserMail(registeredUserAdapter));
    final UserMail regUserMailPremium = new DefaultFaxByMail(registeredUserAdapter, regUserMail);

    return new AlternatingUserMail() {
        @Override
        protected UserMail getDelegate() {
            Calendar c = Calendar.getInstance();
            int h = c.get(Calendar.HOUR_OF_DAY);
            if (!(h >= 8 && h < 17)) {
                return getEmployeeMail();
            } else {
                return getRegUserMail();
            }
        }

        UserMail getEmployeeMail() {
            return employeeMail;
        }

        UserMail getRegUserMail() {
            if (regUser.isPremium() &&
                    regUser.getValidTo() != null &&
                    regUser.getValidTo().compareTo(Calendar.getInstance().getTime()) >= 0)
                return regUserMailPremium;
            else
                return regUserMail;
        }
    };
}

```

It is assumed here that the user owns both types of accounts. The variables
`employee` and `registeredUser` are loaded from external data retrieved
from a persistent storage.

The `initRegisteredUser` method converts the `isPremium` attribute of the
data record into a "trait" by means of a local class `Premium`. If there were
more such "IS" properties, it would lead to the explosion of such local classes.

The two accounts are adapted to the the common ground by corresponding adapters
and used as the argument to `EmployeeUserMail` and `RegisteredUserAdapter` constructors.

Both particular service instances userMail1 and userMail2 are wrapped by `VirusDetector`.

If the user is a premium customer, then his email service is wrapped by `DefaultFaxByMail`
to provide the fax-by-mail extension. Unfortunately, the test on a premium customer
cannot use the `PremiumUser` type since it has gotten lost during the preceding adaptation
and wrapping.

Then `AlternatingUserMail` is implemented and instantiated. This instance is able to switch
the accounts in the background according to the current time. (If it is between 8am-17pm then
`employeeMail` is used.) When the account of the registered user is to be used,
the implementation also checks whether the registered user is a premium one
and whether his account is valid. If so, the `AlternatingUserMail` instance uses
the `regUserMailPremium` mail service.

`AlternatingUserMail` must be the topmost wrapper so as to preserve the `FaxByMail` type of
the resulting service instance.

The rest of the code creates an email message and switches the accounts.

The complete source code may be viewed [here](https://github.com/zslajchrt/morpheus-tutor/tree/master/src/main/java/org/cloudio/morpheus/mail).

#####Summary

Developing a protean service on a platform without traits significantly reduces
design options and tends to hide type information about the domain objects.

* As far as the two account adapters are concerned, there is no serious design flaw. The
combination of inheritance and interface implementation preserves both types
in instances (i.e. no object schizophrenia). Thus it is possible to check the type
of an instance and then to cast it to either `Employee` or `RegisteredUser` to
get access to the account specific members.

* A potential problem lurks behind the converting of the `isPremium` property into
the `PremiumUser` "trait". Such an approach does not scale with the growing number
of "IS" properties. This is, however, a limitation of the underlying "no-trait" platform.

* Another weakness is the cloning, because the state of the original account instances
must be copied to the new adapted instances.

* The implementations of `DefaultUserMail` as well as of its two specializations
`EmployeeUserMail` and `RegisteredUserMail` are pretty straightforward. The `DefaultUserMail`
is designed as a package private abstract class. Thus it cannot be instantiated
and only classes in from its package can extend it. The package contains only
two such classes: `EmployeeUserMail` and `RegisteredUserMail`.

* The only flaw is the `getMailOwner` public method introduced in `DefaultUserMail` mediating
the access to the underlying user account and which might indicate a loss of
user account type information in `DefaultUserMail`'s instances. However, since
the type of the account is indirectly carried by the only two subclasses
`EmployeeUserMail` and `RegisteredUserMail`, this issue is of a minor importance.

* On the contrary, the `VirusDetector` copes with serious complications caused
by the induced object schizophrenia, as described above. Further, until the mail service
instances are not wrapped by `VirusDetector`, they preserve their account type information.

* The implementation of the optional fax service `DefaultFaxByMail` also hides the account type.
Additionally, there is a possibly dangerous assumption that it must be the topmost
wrapper. Also, the test on premium user cannot be done by type.

* Probably the most problematic component is `AlternatingUserMail`. Besides its
serious object schizophrenia stemming from the state pattern used to implement
the switching, its most serious flaw is the conditional implementation of
`UserFaxByMail`. Further, it must be the final wrapper, which is handed over to the
mail service client, which is tightly coupled with `AlternatingUserMail`, through
which the client can determine the presence of the fax extension and access it.

* The preservation of types when adapting or extending other classes helps loosen
the coupling between the instances and their client. For example, the user interface
would be able to adapt itself to the type of the account and its functionality
extensions (such fax-by-mail) just on the basis of the mail service instance's type.

* The presence of various `isSomething` properties may be alarming since
it may indicate mixing of "has" and "is" aspects in the design. Such properties
often exist primarily in persistence models as boolean or enumeration columns since
there is no concept of traits in databases. In order to avoid the propagation
of object schizophrenia through the domain model, such properties should be
converted to traits or interfaces.


text:
# ColortexForms
WPF .NET desktop user interface for [Colortex](https://github.com/IgorZyktin/Colortex) python project.

## Getting Started
- Copy your images to **prepare** folder
- Launch ColortexForms.exe
- Set python interpretator path (loads from **config.txt** file automatically)
- Select source image, click **Resize** button multiple times if you need lower resolution
## Folders:
- **prepare** - source files. Accepted types: bmp, png, jpg and gif
- **input** - temporary folder for python script working
- **output** - converted files, saved as "png" or "gif"
- **used** - source files that were previously processed
---
![Demo Animation](/img/preview.jpg?raw=true)
![Demo Animation](/img/1.jpg?raw=true)
![Demo Animation](/img/2.png?raw=true)
![Demo Animation](/img/3.png?raw=true)
![Demo Animation](/img/4.png?raw=true)
![Demo Animation](/img/5.jpg?raw=true)
![Demo Animation](/img/6.png?raw=true)
![Demo Animation](/img/7.png?raw=true)
![Demo Animation](/img/8.png?raw=true)

repository: alexfcoding/ColortexWPF

repo_name: alexfcoding/ColortexWPF


text:
# TextFieldExtension1

[![CI Status](https://img.shields.io/travis/mohitgorakhiya/TextFieldExtension1.svg?style=flat)](https://travis-ci.org/mohitgorakhiya/TextFieldExtension1)
[![Version](https://img.shields.io/cocoapods/v/TextFieldExtension1.svg?style=flat)](https://cocoapods.org/pods/TextFieldExtension1)
[![License](https://img.shields.io/cocoapods/l/TextFieldExtension1.svg?style=flat)](https://cocoapods.org/pods/TextFieldExtension1)
[![Platform](https://img.shields.io/cocoapods/p/TextFieldExtension1.svg?style=flat)](https://cocoapods.org/pods/TextFieldExtension1)

## Example

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

## Requirements

## Installation

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

```ruby
pod 'TextFieldExtension1'
```

## Author

mohitgorakhiya<EMAIL_ADDRESS>
## License

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


text:
# [Citation Style Gallery](@id gallery)

The citation style is determined when instantiating the [`CitationBibliography`](@ref), via the `style` argument.

The built-in styles are:

* `style=:numeric` (default): [numeric style](@ref numeric_style)
* `style=:authoryear`: [author-year style](@ref author_year_style)
* `style=:alpha`: [alphabetic style](@ref alphabetic_style)

## [Numeric style](@id numeric_style)

This is the default style (`style=:numeric`) used throughout the other pages of this documentation, cf. the [Syntax](@ref) examples.

* `[GoerzQ2022](@cite)` renders as "[GoerzQ2022](@cite)"
* `[FuerstNJP2014](@cite)` renders as "[FuerstNJP2014](@cite)"
* `[GoerzQ2022](@citet)` renders as "[GoerzQ2022](@citet)"
* `[GoerzQ2022](@citep)` renders as "[GoerzQ2022](@citep)" — `@citep` is the same as `@cite` for this style
* `[GoerzQ2022; Eq. (1)](@cite)` renders as "[GoerzQ2022; Eq. (1)](@cite)"
* `[GoerzQ2022; Eq. (1)](@citet)` renders as "[GoerzQ2022; Eq. (1)](@citet)"
* `[GoerzQ2022](@citet*)` renders as "[GoerzQ2022](@citet*)"
* `[GoerzQ2022; Eq. (1)](@citet*)` renders as "[GoerzQ2022; Eq. (1)](@citet*)"
* `[WinckelIP2008](@citet)` renders as "[WinckelIP2008](@citet)"
* `[WinckelIP2008](@Citet)` renders as "[WinckelIP2008](@Citet)"
* `[arbitrary text](@cite GoerzQ2022)` renders as "[arbitrary text](@cite GoerzQ2022)"

**References:**

```@bibliography
Pages = ["gallery.md"]
Style = :numeric
Canonical = false
```

## [Author-year style](@id author_year_style)

The author-year style (`style=:authoryear`) formats citations with the author name and publication year. This is the citation style used, e.g., in [Rev. Mod. Phys.](https://journals.aps.org/rmp/) (`rmp` option in [REVTeX](https://www.ctan.org/tex-archive/macros/latex/contrib/revtex/auguide)). The bibliography is sorted alphabetically by author name. The default `@cite` command is parenthetical (`@cite` and `@citep` are equivalent) which is different from the `authoryear` style in [natbib](https://mirrors.rit.edu/CTAN/macros/latex/contrib/natbib/natnotes.pdf).

* `[GoerzQ2022](@cite)` renders as "[GoerzQ2022](@cite%authoryear%)"
* `[FuerstNJP2014](@cite)` renders as "[FuerstNJP2014](@cite%authoryear%)"
* `[GoerzQ2022](@citet)` renders as "[GoerzQ2022](@citet%authoryear%)"
* `[GoerzQ2022](@citep)` renders as "[GoerzQ2022](@citep%authoryear%)" — `@citep` is the same as `@cite` for this style
* `[GoerzQ2022; Eq. (1)](@cite)` renders as "[GoerzQ2022; Eq. (1)](@cite%authoryear%)"
* `[GoerzQ2022; Eq. (1)](@citet)` renders as "[GoerzQ2022; Eq. (1)](@citet%authoryear%)"
* `[GoerzQ2022](@cite*)` renders as "[GoerzQ2022](@cite*%authoryear%)"
* `[GoerzQ2022](@citet*)` renders as "[GoerzQ2022](@citet*%authoryear%)"
* `[GoerzQ2022; Eq. (1)](@cite*)` renders as "[GoerzQ2022; Eq. (1)](@cite*%authoryear%)"
* `[GoerzQ2022; Eq. (1)](@citet*)` renders as "[GoerzQ2022; Eq. (1)](@citet*%authoryear%)"
* `[WinckelIP2008](@citet)` renders as "[WinckelIP2008](@citet%authoryear%)"
* `[WinckelIP2008](@Citet)` renders as "[WinckelIP2008](@Citet%authoryear%)"
* `[arbitrary text](@cite GoerzQ2022)` renders as "[arbitrary text](@cite GoerzQ2022)"

**References:**

```@bibliography
Pages = ["gallery.md"]
Style = :authoryear
Canonical = false
```

## [Alphabetic style](@id alphabetic_style)

The `style=:alpha` formats citations and references like `:numeric`, except that it uses labels derived from the author names and publication year and sorts the references alphabetically.

* `[GoerzQ2022](@cite)` renders as "[GoerzQ2022](@cite%alpha%)"
* `[FuerstNJP2014](@cite)` renders as "[FuerstNJP2014](@cite%alpha%)"
* `[GoerzQ2022](@citet)` renders as "[GoerzQ2022](@citet%alpha%)"
* `[GoerzQ2022](@citep)` renders as "[GoerzQ2022](@citep%alpha%)" — `@citep` is the same as `@cite` for this style
* `[GoerzQ2022; Eq. (1)](@cite)` renders as "[GoerzQ2022; Eq. (1)](@cite%alpha%)"
* `[GoerzQ2022; Eq. (1)](@citet)` renders as "[GoerzQ2022; Eq. (1)](@citet%alpha%)"
* `[GoerzQ2022](@citet*)` renders as "[GoerzQ2022](@citet*%alpha%)"
* `[GoerzQ2022; Eq. (1)](@citet*)` renders as "[GoerzQ2022; Eq. (1)](@citet*%alpha%)"
* `[WinckelIP2008](@citet)` renders as "[WinckelIP2008](@citet%alpha%)"
* `[WinckelIP2008](@Citet)` renders as "[WinckelIP2008](@Citet%alpha%)"
* `[arbitrary text](@cite GoerzQ2022)` renders as "[arbitrary text](@cite GoerzQ2022)"

**References:**

```@bibliography
Pages = ["gallery.md"]
Style = :alpha
Canonical = false
```

## [Custom styles](@id custom_styles)

In the following, we show two examples for user-defined styles. See the [notes on customization](@ref customization) on how to generally define a custom style.

### Custom style: enumerated author-year

In this example, the `:authoryear` style is used, but the references are shown in an enumerated list.

~~~@eval
# custom styles are included in docs/make.jl, which is how we get around
# world-age issues.
using Markdown
custom_style = joinpath(@__DIR__, "..", "custom_styles", "enumauthoryear.jl")
if isfile(custom_style)
    Markdown.parse("""
    ```julia
    $(read(custom_style, String))
    ```
    """)
end
~~~

The important part of the definition is in the last line, indicating that the References should be shown as an enumeration (ordered list, `<ol>`, in HTML), see below. Meanwhile, citations render exactly as with `style=:authoryear`:

* `[GoerzQ2022](@cite)` renders as "[GoerzQ2022](@cite%enumauthoryear%)"
* `[FuerstNJP2014](@cite)` renders as "[FuerstNJP2014](@cite%enumauthoryear%)"
* `[WinckelIP2008](@Citet)` renders as "[WinckelIP2008](@Citet%enumauthoryear%)"

**References:**

```@bibliography
Pages = ["gallery.md"]
Style = :enumauthoryear
Canonical = false
```

### Custom style: Citation-key labels

In this less trivial example, a style similar to `:alpha` is used, using the citation keys in the `.bib` file as labels. This would be somewhat more appropriate with citation keys that are shorter that the ones used here (keys similar to those automatically generated with the `:alpha` style).

~~~@eval
# custom styles are included in docs/make.jl, which is how we get around
# world-age issues.
using Markdown
custom_style = joinpath(@__DIR__, "..", "custom_styles", "keylabels.jl")
if isfile(custom_style)
    Markdown.parse("""
    ```julia
    $(read(custom_style, String))
    ```
    """)
end
~~~

* `[GoerzQ2022](@cite)` renders as "[GoerzQ2022](@cite%keylabels%)"
* `[FuerstNJP2014](@cite)` renders as "[FuerstNJP2014](@cite%keylabels%)"
* `[GoerzQ2022](@citet)` renders as "[GoerzQ2022](@citet%keylabels%)"
* `[GoerzQ2022](@citep)` renders as "[GoerzQ2022](@citep%keylabels%)" — `@citep` is the same as `@cite` for this style
* `[GoerzQ2022; Eq. (1)](@cite)` renders as "[GoerzQ2022; Eq. (1)](@cite%keylabels%)"
* `[GoerzQ2022; Eq. (1)](@citet)` renders as "[GoerzQ2022; Eq. (1)](@citet%keylabels%)"
* `[GoerzQ2022](@citet*)` renders as "[GoerzQ2022](@citet*%keylabels%)"
* `[GoerzQ2022; Eq. (1)](@citet*)` renders as "[GoerzQ2022; Eq. (1)](@citet*%keylabels%)"
* `[WinckelIP2008](@citet)` renders as "[WinckelIP2008](@citet%keylabels%)"
* `[WinckelIP2008](@Citet)` renders as "[WinckelIP2008](@Citet%keylabels%)"
* `[arbitrary text](@cite GoerzQ2022)` renders as "[arbitrary text](@cite GoerzQ2022)"

**References:**

```@bibliography
Pages = ["gallery.md"]
Style = :keylabels
Canonical = false
```


text:
![logo](https://static.creatordev.io/logo-md-s.svg)

# Sesame - Creator garage door opener controller
* https://info.ba.imgtec.org/display/IM/WEB+API+specification
* https://info.ba.imgtec.org/pages/viewpage.action?spaceKey=IM&title=Sesame+-+Creator+garage+door+opener+controller
* https://tools.ietf.org/html/rfc6750

---

### Keywords:
* HATEOAS
* Heroku
* mLab

## Architecture
![Architecture](../images/sesame1.jpg)

## Jump Start

There are two ways to use the Webapp:

1. Cloud Deployment
2. Locally

---

## Cloud Deployment

This guide explains the process of cloud deploying the Webapp to Heroku and mLab,
using their free tiers. However the performance can be improved using a payed service,
or if you prefer different hosting services: AWS, Google Cloud, etc.

### 1. Get the project

1. Clone the project from git repository
2. Rename file **config.js.sample** **into config.js** located in project root directory

### 2. Developer Console - Create Account

1. Create a [Developer Console](https://console.creatordev.io) account
2. Generate a set of API Keys
3. Insert the API Keys into the **config.js file**

### 3. IFTTT - configure alerts via email/sms (optional)

You can receive email and/or sms notifications about door issues. For that you need create applets on IFTTT service.
1. Create an account on IFTTT service.
2. Connect your account with "Maker channel" service. Select the service from list, click "connect" button and follow instructions.
3. Once connected you can create your applet. From top menu select "my applets" and click "new applet".
4. As a trigger select Maker Channel applet.
5. As a event use one of two provided by sesame web app:
    * **doorstuck** is used to notify you when door couldn't reach end position
    * **maintenance** is used to notify you when door needs maintenance
6. As a action service choose anything you want. Eg you can use email service to get notifications via email or sms service to get them on your phone.
7. Create as many applets you want.
8. Go back to web app source code. Edit config.js file end enable ifttt module by setting flag **enabled** to true.
9. Also provide your ifttt key in config.js file. Key can be found under your ifttt acount in your profile -> services -> maker -> settings

### 4. mLab - Create the DB (Manual Setup)
1. Sign up for an [mlab free account](https://mlab.com/)
2. Create a new database (select Single Node, Sandbox for the free tier)
3. Add a user
4. Get the database URI (connection string) visible on the dashboard:
mongodb://`<`dbuser`>`:`<`dbpassword>@`<`dbuser`>`.mlab.com:`<`port`>`/`<`db_name`>`
5. Complete the connection string with your account details. Save the connection
string as mongo db configuration: **$ heroku config:set MONGOLAB_URI=your_db_uri**

### 5. Heroku - Push The Webapp Source Code

1. Create an [Heroku account](https://www.heroku.com/)
2. Install [Heroku Command Line Interface (CLI)](https://devcenter.heroku.com/articles/heroku-command-line)
3. Enter your Heroku credentials: **$ heroku login**
4. Create the application on Heroku: **$ heroku create**
5. Edit config.js file and set HOST to an url to Your heroku app instance.
5. Deploy the application on Heroku: **$ git push heroku master**
6. Test the live application: **$ heroku open**

---

## Start The Web App (Locally)

1. Get the project, by ZIP download or git clone
2. Install [**Node.js LTS**](https://nodejs.org/en/)
3. Install the Webapp's dependencies. On projects root directory, execute:
**$ npm install**
4. Insert the API Keys into the **config.js file**, located in your projects root
folder.
5. Insert your hostname in **config.js file**. Remember that you need a **proxy** in order to get notifications from Device Server.
5. Install MongoDB
6. Use a **proxy** (e.g. Ngrok) to expose the local application on an https server
7. Start the application: **$ npm start**

**Summary:**
* **$ npm install**
* **$ npm start**

---

## POSTMAN Collection

POSTMAN is a REST client useful to test the Webapp.The following button opens
the **REST API** on POSTMAN, designated by POSTMAN Collection.

**NOTE:** It can be necessary to adjust some variables on POSTMAN environment
to run the  collection.

[![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/69dffcacaa53e10ec306)

## REST Endpoints

Documentation of REST API can be generated right from source code. From root directory of the project call
```
npm install apidoc
apidoc -i ./api_v1
```

Generated documentation can be found in **doc** directory.

## Authentication
Web app uses [Json Web Token](https://jwt.io/) to authorize incoming request.
Each request sent to webapp needs an authorization header. This is
```
x-access-token : token
```

Token is based on your app secret from **config.js file** and can be generated either on above website or using script
from inside this project.

Just call:
```
node ./generateJsonToken.js
```
and use generated token to sign Your requests.

repository: CreatorDev/webapp-sesame

repo_name: CreatorDev/webapp-sesame