text:
The Glasgow Subgraph Solver
===========================

This is a solver for subgraph isomorphism (induced and non-induced) problems, based upon a series of
papers by subsets of Blair Archibald, Ciaran McCreesh, Patrick Prosser and James Trimble at the
University of Glasgow, and Fraser Dunlop and Ruth Hoffmann at the University of St Andrews. A clique
decision / maximum clique solver is also included.

If you use this software for research, please cite [icgt/McCreeshP020]. If you use this solver in a
non-research setting, please get in touch if you can. This software is an output of taxpayer funded
research, and it is very helpful for us if we can demonstrate real-world impact when we write grant
applications.

Please contact [Ciaran<EMAIL_ADDRESS>with any queries.

Compiling
---------

To build, you will need a C++20 compiler, such as GCC 10.3, as well as Boost (use
``libboost-all-dev`` on Ubuntu).

```shell
cmake -S . -B build
cmake --build build
```

Running
-------

To run:

```shell session
$ ./build/glasgow_subgraph_solver pattern-file target-file
```

If you would like induced subgraph isomorphisms rather than non-induced (that is, if non-adjacent
vertices must be mapped to non-adjacent vertices), you must request it:

```shell session
$ ./build/glasgow_subgraph_solver --induced pattern-file target-file
```

The default mode is to display the first found solution, or to prove unsatisfiability if no solution
exists. To count or print all solutions, use one of:

```shell session
$ ./build/glasgow_subgraph_solver [ --count-solutions | --print-all-solutions ] pattern-file target-file
```

Note that printing all solutions can be exponentially slower than counting solutions.

The solver supports parallel search. Usually you should enable this, as follows:

```shell session
$ ./build/glasgow_subgraph_solver --parallel ...
```

Note that parallel search, in its default configuration, is non-deterministic.

File Formats
------------

We try to auto-detect the input format, but it's best to specify it using, for example:

```shell session
$ ./build/glasgow_subgraph_solver --format lad pattern-file target-file
```

In particular, note that auto-detection can easily fail if, for example, the first vertex in the
graph has no neighbours.  We can read LAD, Labelled LAD (labels on vertices, and optionally also on
edges), CSV, and DIMACS 2 formatted graphs. [The LAD
format](https://perso.liris.cnrs.fr/christine.solnon/SIP.html) is a nice simple choice. If you need
to support named vertices, labels on vertices and / or edges, or directed edges, consider using the
CSV format. To specify a directed edge, use a greater-than sign rather than a comma as the delimiter
between the first two columns.  To specify an edge label, include a third column in the file. To
specify a vertex label, leave the second column empty and use the third column for the label. For
example, the following describes a graph with four vertices, with colours for edge labels and shapes
for vertex labels.

```
first>second,red
second>first,blue
first,third,purple
first>first,green
first,,circle
second,,circle
third,,square
fourth,,square
```

Symmetries
----------

Symmetry elimination support is currently very experimental, only usable on pattern symmetries, and
is probably only useful for solution counting. To use it, you must have the GAP computer algebra
system in your PATH as 'gap', with the 'digraph' library installed. Then, do:

```shell session
$ ./build/glasgow_clique_solver --pattern-symmetries --count-solutions pattern-file target-file
```

Proof Logging
-------------

As a highly experimental feature, the solver can output a proof log. First, install the following
program:

* VeriPB from https://gitlab.com/MIAOresearch/software/VeriPB

And then you can produce and verify a log like this:

```shell session
$ ./build/glasgow_subgraph_solver --no-supplementals --no-clique-detection --no-nds \
    --prove myproof --proof-solutions pattern-file target-file
$ veripb myproof.opb myproof.log
```

Note that most features are not yet supported with proof logging. This is a "not yet implemented"
problem, not a fundamental restriction.

Clique Solving
--------------

To run the clique solver, use:

```shell session
$ ./build/glasgow_clique_solver graph-file
```

Details on the Algorithms
-------------------------

The subgraph solver is a constraint programming style backtracker, which recursively builds up a
mapping from pattern vertices to target vertices. It includes inference based upon paths (not just
adjacency) and neighbourhood degree sequences, has a fast all-different propagator, and uses
sophisticated variable- and value-ordering heuristics to direct a slightly-random restarting search.

Chronologically, our first subgraph isomorphism solver is [cp/McCreeshP15]. We introduced new
variants of this solver in [lion/KotthoffMS16], and described a refactored version (which can solve
an optimisation variant of the problem) in [aaai/HoffmannMR17]. We also investigated search ordering
heuristics in more detail in [jair/McCreeshPST18], and [cpaior/ArchibaldDHMPT19] describes its new
restarting search algorithm. There is currently no paper describing the entire algorithm, but
[icgt/McCreeshP020] summarises the main aspects of it.

The clique solver (with its default configuration) is a branch and bound solver that uses a greedy
colouring both as the bound function, and as a branching heuristic. It is based upon the "domains of
size two first" variant described in [cp/McCreeshP14], which is in turn derived from the "MCSa1"
algorithm described by [algorithms/Prosser12] combined with the bit-parallelism techniques discussed
by [ol/SegundoMRH13]; this in turn is a simplification of "MCS" described by [walcom/TomitaSHTW10].
The solver also incorporates the fast clique detection technique described by [jco/BatsynGMP14].

Funding Acknowledgements
------------------------

This work was supported by the Engineering and Physical Sciences Research Council (grant numbers
EP/P026842/1, EP/M508056/1, and EP/N007565). This work used the Cirrus UK National Tier-2 HPC
Service at EPCC (http://www.cirrus.ac.uk) funded by the University of Edinburgh and EPSRC
(EP/P020267/1).

References
----------

* [walcom/TomitaSHTW10]: https://dblp.org/rec/html/conf/walcom/TomitaSHTW10
  **walcom/TomitaSHTW10**:
  Etsuji Tomita, Yoichi Sutani, Takanori Higashi, Shinya Takahashi, Mitsuo Wakatsuki:
  A Simple and Faster Branch-and-Bound Algorithm for Finding a Maximum Clique. WALCOM 2010: 191-203.
  DBLP: [walcom/TomitaSHTW10]

* [algorithms/Prosser12]: https://dblp.org/rec/html/journals/algorithms/Prosser12
  **algorithms/Prosser12**:
  Patrick Prosser: Exact Algorithms for Maximum Clique: A Computational Study. Algorithms 5(4):
  545-587 (2012). DBLP: [algorithms/Prosser12].

* [ol/SegundoMRH13]: https://dblp.org/rec/html/journals/ol/SegundoMRH13
  **ol/SegundoMRH13**:
  Pablo San Segundo, Fernando Matía, Diego Rodríguez-Losada, Miguel Hernando: An improved bit
  parallel exact maximum clique algorithm. Optimization Letters 7(3): 467-479 (2013). DBLP:
  [ol/SegundoMRH13].

* [cp/McCreeshP14]: https://dblp.org/rec/html/conf/cp/McCreeshP14
  **cp/McCreeshP14**:
  Ciaran McCreesh, Patrick Prosser: Reducing the Branching in a Branch and Bound Algorithm for the
  Maximum Clique Problem. CP 2014: 549-563. DBLP: [cp/McCreeshP14].

* [jco/BatsynGMP14]: https://dblp.org/rec/html/journals/jco/BatsynGMP14
  **jco/BatsynGMP14**:
  Improvements to MCS algorithm for the maximum clique problem. J. Comb. Optim. 27(2): 397-416
  (2014). DBLP: [jco/BatsynGMP14]

* [cp/McCreeshP15]: https://dblp.org/rec/html/conf/cp/McCreeshP15
  **cp/McCreeshP15**:
  Ciaran McCreesh, Patrick Prosser: A Parallel, Backjumping Subgraph Isomorphism Algorithm Using
  Supplemental Graphs. CP 2015: 295-312. DBLP: [cp/McCreeshP15].

* [lion/KotthoffMS16]: https://dblp.org/rec/html/conf/lion/KotthoffMS16
  **lion/KotthoffMS16**:
  Lars Kotthoff, Ciaran McCreesh, Christine Solnon: Portfolios of Subgraph Isomorphism Algorithms.
  LION 2016: 107-122. DBLP: [lion/KotthoffMS16].

* [aaai/HoffmannMR17]: https://dblp.org/rec/html/conf/aaai/HoffmannMR17
  **aaai/HoffmannMR17**:
  Ruth Hoffmann, Ciaran McCreesh, Craig Reilly: Between Subgraph Isomorphism and Maximum Common
  Subgraph. AAAI 2017: 3907-3914. DBLP: [aaai/HoffmannMR17].

* [jair/McCreeshPST18]: https://dblp.org/rec/html/journals/jair/McCreeshPST18
  **jair/McCreeshPST18**:
  Ciaran McCreesh, Patrick Prosser, Christine Solnon, James Trimble: When Subgraph Isomorphism is
  Really Hard, and Why This Matters for Graph Databases. J. Artif. Intell. Res. 61: 723-759 (2018).
  DBLP: [jair/McCreeshPST18].

* [cpaior/ArchibaldDHMPT19]: http://dblp.org/rec/html/conf/cpaior/ArchibaldDHMP019
  **cpaior/ArchibaldDHMPT19**:
  Blair Archibald, Fraser Dunlop, Ruth Hoffmann, Ciaran McCreesh, Patrick Prosser and James Trimble:
  Sequential and Parallel Solution-Biased Search for Subgraph Algorithms. CPAIOR 2019: 20-38.
  DBLP: [cpaior/ArchibaldDHMPT19].

* [icgt/McCreeshP020]: http://dblp.org/rec/html/conf/gg/McCreeshP020
  **icgt/McCreeshP020**:
  Ciaran McCreesh, Patrick Prosser, James Trimble:
  The Glasgow Subgraph Solver: Using Constraint Programming to Tackle Hard Subgraph Isomorphism
  Problem Variants. ICGT 2020: 316-324.
  DBLP: [icgt/McCreeshP020].

<!-- vim: set tw=100 spell spelllang=en : -->

repository: ciaranm/glasgow-subgraph-solver

repo_name: ciaranm/glasgow-subgraph-solver


text:
# Translation
A file based translation component without dependencies.

[![Build Status](https://travis-ci.org/michaelspiss/translation.svg?branch=master)](https://travis-ci.org/michaelspiss/translation)
[![Coverage Status](https://coveralls.io/repos/github/michaelspiss/translation/badge.svg?branch=master)](https://coveralls.io/github/michaelspiss/translation?branch=master)
[![Latest Stable Version](https://poser.pugx.org/michaelspiss/translation/v/stable)](https://packagist.org/packages/michaelspiss/translation)
[![License](https://poser.pugx.org/michaelspiss/translation/license)](https://packagist.org/packages/michaelspiss/translation)

It supports **every file format** you throw at it, **pluralization**,
**placeholders**, is **fully tested** and **documented**.

## Installation

To install the package with Composer, simply run the following command:
```
$ composer require michaelspiss/translation
```

## Basic usage
Instantiating a new Translator is easy: Simply pass it the default locale
('en' in this case) and the path to your translations directory!

```php
require 'vendor/autoload.php'; // composer autoloader

use MichaelSpiss\Translation\Translator;

$translator = new Translator('en', 'path/to/translations');
```

The component uses keys in the dot-notation to identify which string to load.
To get a string in a specific language use the trans() method and pass it the key:
```php
$translator->trans('message.hello_world');
```
In this case the string would be found in `path/to/translations/en/message.php`.
The file itself would look like "message.php" below.

## Folder structure
Language strings are stored in files in the directory you passed the Translator
during initialization. Within this directory each subfolder represents a supported
language and holds the translation files.
```
translations/
 |- en/
 |   |- message.php
 |- de/
 |- fr/
```
A translation file would simply look like the following:

###### message.php
```php
<?php

return [
    'hello_world' => 'Hello World!'
];
```
Even though only .php files are supported out-of-the-box, translation files
can be of every format. For more information, please see the [corresponding wiki article](https://github.com/michaelspiss/translation/wiki/Custom-Loader).

## Setting the locale
Normally, the locale is only set once, at the initialization.
But the component also allows you to change the locale mid-way, of course:
```php
$translator->setLocale('de');
```
Additionally you can request single translation strings in a specific language
without setting a new locale and resetting it afterwards:
```php
$translator->trans('message.hello_world', [], 'de');
// or:
$translator->transChoice('message.choice', 1, [], 'de');
```

## Using placeholders
In your translation files, a placeholder is defined by putting curly braces
around the placeholder name (upper- and lowercase letters only):

###### message.php
```php
<?php

return [
    'with_placeholder' => 'Hello {placeholder}!'
];
```
Now you can add an array to your trans() call containing values for the
placeholders:
```php
$translator->trans('message.with_placeholder', ['placeholder' => 'World']);
// returns "Hello World!"
```
You can have as many placeholders in a string as you like!

## Pluralization
To enable pluralization for a string simply add a pipe-character between
the singular and plural form in your translation file:

###### message.php
```php
<?php

return [
    'simple_pluralization' => 'Dog | Dogs'
];
```
The second option is a bit more advanced and actually allows you to set
your own rules:
```php
<?php

return [
    'advanced_pluralization' => '{0} None | [1,10] Some | [11,*] Many'
];
```
You can use the following expressions:

| Expression | Meaning|
| :---: | --------------- |
| {3} | match exactly 3 |
| [1,10] | match everything from 1 to 10, **including** 1 and 10 |
| [11,*] | match everything from 11 to infinite **including** 11 |
| ]10,20] | match everything from 10 to 20, **excluding** 10, **including** 20 |
| ]10,20[ | match everything from 10 to 20, **excluding** 10 and 20 |
| [10,20[ | match everything from 10 to 20, **including** 10, **excluding** 20 |

Expressions also support integers and floats!

To get the string use the transChoice() method, which takes an additional
`number` argument (type int or float):
```php
$translator->transChoice('message.simple_pluralization', 4);
// returns "Dogs"

$translator->transChoice('message.advanced_pluralization', 8);
// returns "Some"
```
## Read more
If you want further information on the [`Translator`'s methods](https://github.com/michaelspiss/translation/wiki/Method-overview)
or [how to use other file formats than .php](https://github.com/michaelspiss/translation/wiki/Custom-Loader)
check out [this project's wiki](https://github.com/michaelspiss/translation/wiki)!

### PHP Requirements
* PHP >= 7.0.0

### License
MIT

license: MIT

repository: michaelspiss/translation

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: michaelspiss/translation


text:
[![Build Status](https://travis-ci.org/apache/geode-benchmarks.svg?branch=develop)](https://travis-ci.org/apache/geode-benchmarks)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/apache/geode-benchmarks.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/apache/geode-benchmarks/alerts/)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)

# Apache Geode Benchmarks

This project contains a benchmarking framework and benchmarks for
[Apache Geode](https://geode.apache.org/). It is based on the
[yardstick framework](https://github.com/gridgain/yardstick), but with a java based
test configuration and test execution framework.

These benchmarks are under development.

## Running the benchmarks
The benchmarks require machines with passwordless ssh enabled in order to run, so ensure that the authentication key pair for SSH does not have a passphrase. If you have previously created a key pair with a passphrase, you can create a different key pair which
is of a different type than the previously created one. Be sure to backup your existing key pair before creating a new one. The public key needs to be in PEM format, but some newer OpenSSH
versions default to a new format. PEM format can be forced by using `-m PEM`:
```
ssh-keygen -m PEM -t rsa
```
While running a test on a single machine (i.e. localhost) add the generated key to `authorized_keys` to authorize the user:
```
cat <your_public_key_file> >> ~/.ssh/authorized_keys
```
Test if you can ssh to localhost:
```
ssh localhost
```
As long as that works, we are good to go.

Get your local hosts name:
```
hostname
```
Edit /etc/hosts and add the local host name with and without domain to localhost entries.
```
<IP_ADDRESS> localhost mycomputer mycomputer.mydomain
::1       localhost mycomputer mycomputer.mydomain
```

To run all benchmarks, run the benchmark task and pass in a list of hosts.

For example:
```
./gradlew benchmark -Phosts=localhost,localhost,localhost,localhost
```

### Options
The benchmarks can take configuration options. Some using Gradle's `-P` flag and other, which adjust
benchmark behavior, via Java system properties using `-D`.

| Option            | Description                                                                                |
|-------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `-Phosts`         | Hosts used by benchmarks on the order of client,locator,server,server (-Phosts=localhost,localhost,localhost,localhost)                                                                                |
| `-PoutputDir`     | Results output directory (-PoutputDir=/tmp/results)                                                                                |
| `-Pbenchmark.X`   | Where X is a benchmark configuration, defined below.                                                                                |
| `-Pbenchmark.R.X` | Applies properties to specific roles. Where R is the role, "client", "server", "locator", X is a benchmark configuration, defined below.                                                                                |
| `--tests`         | Specific benchmarks to run (--tests=PartitionedPutBenchmark)                                                                                |
| `-d`              | Debug                                                                                |
| `-i`              | Info                                                                                |
| ~~`-PtestJVM`~~   | (Deprecated, use `-Pbenchmark.withToolchainVersion`) ~~Path to an alternative JVM for running the client, locator, and servers. If not specified JAVA_HOME will be used. Note all compilation tasks will still use JAVA_HOME.~~ |

#### Benchmark Configuration
##### Common
These options may apply to all benchmarks.

| Option               | Description                                                                                |
|----------------------|----------------------------------------------------------------------------------------------------------------------------------|
| withToolchainVersion | Version number of alternative JVM for running benchmarks, 8 (default), 11, 17.                                                   |
| withGc               | Select which GC to use. Valid values CMS (default), G1, Z, Shenandoah, Epsilon. (optionally per-role)                            |
| withHeap             | Specify how large a heap the benchmark VMs should use, default "8g". Accepts any `-Xmx` value, like "32g". (optionally per-role) |
| withThreads          | Specify how many threads to use when executing the benchmark. Default varies by benchmark.                                       |
| withWarmup           | Specify how long to warm up the benchmark in seconds. Default is 60 seconds.                                                     |
| withDuration         | Specify how long to run the benchmark in seconds. Default is 300 seconds.                                                        |
| withMinKey           | The minimum key value in the key range. Default is 0.                                                                            |
| withMaxKey           | The maximum key value in the key range. Default varies by benchmark.                                                             |
| withLocatorCount     | Number of locators a topology should use. Typically defaults to 1.                                                               |
| withServerCount      | Number of servers a topology should use. Typically defaults to 2.                                                                |
| withClientCount      | Number of clients a topology should use. Typically defaults to 1.                                                                |
| withReplicas         | Number of region replicas.                                                                                |
| withAsyncReplication | Enable asynch region replication.                                                                                |
| withNettyThreads     | Number of threads Netty IO Services should have.                                                                                |

##### Geode Benchmarks
These options only apply to Geode benchmarks.

| Option              | Description                                                                         |
|---------------------|-------------------------------------------------------------------------------------|
| withSsl             | Flag to run geode with SSL. A self-signed certificate will be generated at runtime. |
| withSslProtocols    | Specifies enabled SSL protocols. See Geode property `ssl-protocols`                 |
| withSslCiphers      | Specifies enabled SSL chipher suites. See Geode property `ssl-ciphers`              |
| withSecurityManager | Flag to start Geode with the example implementation of SecurityManager              |
| withSniProxy        | Use SNI proxy topology.                                                             |
| withSniProxyImage   | Provide an alternative Docker image coordinate for SNI proxy.                       |
| withRouter          | Use router with SNI proxy topology.                                                 |
| withRouterImage     | Provide an alternative Docker image coordinate for router.                          |

##### Debugging
These options should not be used when measuring benchmarks.

| Option               | Description                                                              |
|----------------------|--------------------------------------------------------------------------|
| withValidation       | Enable validation of operations. Default disabled.                       |
| withGcLogging        | Enable GC logging. Default disabled.                                     |
| withSafepointLogging | Enable Safepoint logging. Default disabled.                              |
| withStrace           | Launch remote JVM via strace for tracing system calls. Default disabled. |

### Scripts for running in aws and analyzing results

This project includes some scripts to automate running benchmarks in AWS and analyzing the results produced (as well as the results produced from running locally). See the
[README.md](infrastructure/scripts/aws/README.md) in the infrastructure/aws directory.

## Project structure

The project is divided into two modules
* harness - Contains test framework code for running benchmarks. Does not depend on Apache Geode.
* geode-benchmarks - Individual benchmarks of Apache Geode.

## Sample benchmark

Benchmarks are defined in declarative configuration classes. Each configuration class is run as
a junit test which calls the configure method and passes it to the TestRunner, which executes
the test on the provided TEST_HOSTS.

Benchmarks are composed of `before` tasks, `after` tasks, and `workload` tasks. Each seperate `before` and `after`
task is run once. `Workload` tasks are run repeatedly and their execution time is measured and
reported by the yardstick framework.

```java
/**
* Benchmark configuration class, which defines the topology of the test and
* the initialization tasks and workload tasks for the test.
*/
public class PartitionedPutBenchmark extends AbstractPerformanceTest {

  @Test
  public void run() throws Exception {
    TestRunners.defaultRunner().runTest(this::configure);
  }

  /**
  * Declare the configuration of the test by calling methods
  * on TestConfig.
  */
  public TestConfig configure() {
    TestConfig testConfig = new TestConfig();
    int locatorPort = 10334;

    //This test has three roles, a geode locator, server, and client
    config.role("locator", 1);
    config.role("server", 2);
    config.role("client", 1);

    //Define how the locator,server and client are initialized
    config.before(new StartLocator(locatorPort), "locator");
    config.before(new StartServer(locatorPort), "server");
    config.before(new StartClient(locatorPort), "client");
    config.before(new CreatePartitionedRegion(), "server");
    config.before(new CreateClientProxyRegion(), "client");
    //Define the benchmarked workload, which runs in a client
    config.workload(new PutTask());

    return config;
  }
}
```

```java
/**
* Workload task, which extends the yardstick BenchmarkDriverAdapter
*
* Workload tasks should execute a single unit of work, and will be run repeatedly
* for the duration of the test.
*/
public class PutTask extends BenchmarkDriverAdapter implements Serializable {
  private Region<Object, Object> region;

  @Override
  public void setUp(BenchmarkConfiguration cfg) throws Exception {
    super.setUp(cfg);
    ClientCache cache = ClientCacheFactory.getAnyInstance();
    region = cache.getRegion("region");
  }

  @Override
  public boolean test(Map<Object, Object> ctx) throws Exception {
    region.put(1,2);
    return true;
  }
}
```

## SNI Proxy

You can run any benchmark on a topology that routes all client-server communication through an SNI proxy.

The `withSniProxy` property accepts:
 * `HAProxy` for HAProxy based SNI proxy (default).
 * `Envoy` for Envoy based SNI proxy.
 * `Manual` for providing your own SNI proxy and managing its lifecycle.

The `withSniProxyImage` property can be used to provide an alternative Docker image to one of the
supported proxy implementations. The value should be set to a valid Docker image coordinate.

To run a test, e.g. `PartitionedGetBenchmark`, with default SNI Proxy:
```console
./run_tests.sh -t anytagname -- -Pbenchmark.withSniProxy --tests=PartitionedGetBenchmark
```

Since SNI is a feature of TLS, running with the SNI topology incurs TLS overheads with implied `-Pbenchmark.withSsl`.

Enabling the router implies `-Pbenchmark.withSniProxy`.

The `withRouter` property accepts:
 * `HAProxy` for HAProxy based router (default).
 * `Manual` for providing your own router and managing its lifecycle.

Example:
```console
./run_tests.sh -t anytagname -- -Pbenchmark.withRouter --tests=PartitionedGetBenchmark
```

repository: apache/geode-benchmarks

branch_name: refs/heads/develop

gha_language: Java

repo_name: apache/geode-benchmarks


text:
You can ask the families to enroll themselves as well as theirs members

# Activate the self-registration

- Go to settings

![Screenshot](../../../img/family/admin/auto-inscription1.png)

- Go to "family administration"

![Screenshot](../../../img/family/admin/auto-inscription2.png)

- Activate : "bEnableSelfRegistration"

![Screenshot](../../../img/family/admin/auto-inscription3.png)

- Set "bEnableSelfRegistration" to "true"

![Screenshot](../../../img/family/admin/auto-inscription4.png)

- Validate at the bottom of the page

![Screenshot](../../../img/family/admin/auto-inscription5.png)

- Leave the session to see the end result

![Screenshot](../../../img/family/admin/auto-inscription6.png)

# Families registration

On CRM the login window will be

![Screenshot](../../../img/family/admin/auto-inscription7.png)

Use "register a new family"

![Screenshot](../../../img/family/admin/auto-inscription8.png)

Enter the last name, and the data needed, with the number of children

Validate each members (spouse and children)

![Screenshot](../../../img/family/admin/auto-inscription9.png)

The new family is now registered

![Screenshot](../../../img/family/admin/auto-inscription10.png)

# See the new registrants as administrator

- Go to

![Screenshot](../../../img/family/admin/auto-inscription11.png)

- then choose

![Screenshot](../../../img/family/admin/auto-inscription12.png)

- The administrator will see all the families registered

![Screenshot](../../../img/family/admin/auto-inscription13.png)

- to visualize the family, or delete it click on the Family ID : 18 for example

> Note : It is possible to visualize each family individually and to activate or deactivate it, depending on the needs

gha_language: PHP

gha_license_id: MIT


text:
---
layout: post
comments: true
title: March 2022 Goals
tags: goals
---

![life](https://user-images.githubusercontent.com/22335838/156244073-fd28792d-ab01-486a-9eb2-f70fe9787c38.png)

Just when I thought I had things under control, I have a slight change to the projects I'm working on!

### [February Goals Recap](https://yaaminiv.github.io/February-2022-Goals/)

**Gigas Gonad Methylation**:

- [Clarified role of C->T SNP removal](https://yaaminiv.github.io/WGBS-Analysis-Part37/)
- [Uploaded data to NCBI SRA](https://yaaminiv.github.io/Uploding-to-NCBI-SRA/)
- FINISHED THE MANUSCRIPT!
- Waiting on a few clarifications prior to submission to a journal and bioRXiv

**Coral Transcriptomics**:

- Continued testing the extraction protocol

**Killifish Methylation and Expression**:

- [Started QC for trimeed methylation data, but ran into a corrupted file issue](https://yaaminiv.github.io/Killifish-Hypoxia-RRBS-Part2/)

**Ocean Acidification and Reproduction Review**:

- Revised the discussion section
- Started a full read-through of the main text and supplementary material

**Other**:

- Contributed to eelgrass transcriptomics paper
- Worked more on potential project logistics with Neel and Chris

### March goals

**Gigas Gonad Methylation**:

- Submit manuscript!

**Coral Transcriptomics**:

- Identify a reliable extraction protocol
- Extract all samples possible

**Killifish Methylation and Expression**:

- Figure out issue with corrupted sample
- Start mapping methylation data

**Virginica Methylation and Expression**:

- Update extraction methods
- Update extraction results
- Work on `mixOmics` SPLS

**Other**:

- Submit ocean acidification and reproduction review
- Submit eelgrass transcriptomics abstract
- Finalize logistics for zebrafish and silverside projects
- Send out postdoctoral mentorship survey
- Coordinate pre-application postdoctoral mentoring program
- Apply to any relevant faculty positions, funding opportunities, or postdocs

### Deep Freeze

Things that are not immediate enough to be on the backburner, so they're stuck in the deep freeze.

**Hawaii Gigas Methylation**:

- Address Rajan's edits
- Review `DSS` script and determine if I should go back to `methylKit` for better interpretation
- Extract SNPs with `EpiDiverse` and create a relatedness matrix
- Look at methylation islands and non-methylated regions
- Examine overlaps between DML and other epigenomic datasets from Sascha

{% if page.comments %}

Please enable JavaScript to view the comments powered by Disqus.

{% endif %}

gha_language: CSS


text:
# Rails Project Checklist of Requirements

- A summary of the application:
  - The application allows users write reviews for and to rate wines.  A logged
    in user can view the wines that they’ve reviewed or view the reviews other
    users have submitted for a given wine.

- What will your models and associations be and why? You will need a has_many
  and belongs_to relationship as well as a many to many relationship.
  - User
    - Has many reviews
    - Has many wines through reviews
  - Review
    - Belongs to user
    - Belongs to wine
  - Wine
    - Has many reviews
    - Has many users through reviews
    - Belongs to variety
  - Variety
    - Has many wines

- How will you implement a user submittable attribute on the join table of the
  many to many relationship?
  - Reviews is a join table with multiple user submittable attributes such as
    review_content (text), dryness (integer), sweetness (integer),
    overall_rating (integer).

- What it is an ActiveRecord scope method and what is your implementation plan?
  - A scope method is a class method for retrieving objects from the database
    using frequently used search parameters.  I plan on implementing filter
    options on the wine/index page to allow the user to search for wines based
    on parameters such as color and variety

- What validations will you have for your models?
  - Users
    - Username – validates presence and uniqueness
  - Reviews
    - User – validates presence and uniqueness (maximum of one review per wine
      per user – I don’t know if ActiveRecord validations will work for this or
      if I’ll have to create a method to validate)
    - Overall rating – validates presence and value between 1 and 5 (inclusive)
    - All integer ratings (dryness, sweetness, etc) – validate presence and
      value between 1 and 5 (inclusive)
  - Wine
    - Name – validates presence and uniqueness
  - Variety
    - Name - validates presence and uniqueness
    - Color - validates presence

- How will you implement an authentication system?
  - Authentication will be via username and bcrypt secure password OR Google
    login via OmniAuth

- What 3rd party login service will you use?
  - Google via OmniAuth

- With the way your models are setup what nested routes will you use to meet the
  requirement?
  - A user will be able to view reviews for a particular wine via the nested
    route: wines/:id/reviews and will be able to view a particular review for a
    particular wine via the nested route: wines/:id/reviews/:review_id

- Additional features:
  - Once the minimum project requirements are met, I plan to add the following
    additional features as time permits:
    - Responsive CSS layout
    - Add a restaurants model and a restaurant_wine model
      - Restaurants have many wines through restaurant_wine and wines have many
        restaurants through restaurant_wine
      - This feature, combined with the “users with similar tastes” feature will
        allow restaurants to upload their wine list to allow users to view the
        wine list with ratings based on the reviews of users with similar
        tastes.
      - This feature is what necessitates having a responsive CSS layout – users
        will be accessing the app via mobile devices at restaurants when
        selecting wines from restaurant wine lists.
        Wines are suggested for a user based on the reviews of users with similar
          tastes
    - This feature will require an alternate rating algorithm that determines
      which other users have similar tastes and weights their reviews more
      heavily than those of others

gha_language: Ruby


text:
# Ovec

Ovec is a linter for Czech TeX documents inspired by the capabilities of Vlna by Petr Olšák (http://petr.olsak.net/).

## Installation

Add this line to your application's Gemfile:

    gem 'ovec'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install ovec

## Usage

Use the installed binary `ovec` as a filter.
Usage example:

    $ cat input.tex | ovec > output.tex

You may also pass input files as command-line arguments. If you pass multiple files, they will be concatenated, and filtered as one file.

    $ ovec input1.tex input2.tex input3.tex > output.tex

You can use the `-o` (`--output`) option to specify an output file:

    $ ovec input.tex -o output.tex

Other options include `-d` (or `--[no-]debug`) for showing debugging messages on STDERR,
`-v` (`--version`), which tells you the installed version of Ovec, and `-h` (`--help`),
which shows a concise summary of available options and flags.

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

repository: agentydragon/ovec

repo_name: agentydragon/ovec


text:
# ProceduralContentGenerationBasics
Demo project for Procedural Generation Basics

Learn the basics of procedural generation for Unity in C#.

Topics include:

- Picking a random item from an array
- Randomizing 3D object position
- Randomizing 3D object rotation
- Spawning objects on the ground / surfaces with raycasts
- Combining spawned meshes
- A low poly forest scene
- Spawning with random seeds

This project is intended as a reference to accompany the video series published here: https://www.youtube.com/playlist?list=PLuldlT8dkudoNONqbt8GDmMkoFbXfsv9m


text:
First, I will need to create a lab in order to start testing network and operating system security. To do this, I have installed Kali Linux and Metasploitable into Virtualbox.

After getting these set up I ran Zenmap to check for open ports on Metasploitable. Many were found but I focused on the first one, the FTP service on port 21. Zenmap showed that this was running version vsftpd 2.3.4. I searched online and Rapid7 showed that an exploit existed for this version called VSFTPD v2.3.4 Backdoor Command Execution.

I started the Metasploit Framework and ran the command 'use exploit/unixx/ftp/vsftpd_234_backdoor. I set the target to 0 and RHOST to the IP of the Metasploitable VM and ran the exploit. I was able to the get a shell on the Metaploitable VM. I ran commands such as ifconfig, whoami and uname -r to confirm.

The VSFTPD website was compromised back in 2011 and the attacker uploaded a malicious version of VSFTPD which contained a backdoor that listens on TCP port 6200. The code implanted into the source code was

            else if((p_str->p_buf[i]==0x3a)
            && (p_str->p_buf[i+1]==0x29))
            {
              vsf_sysutil_extra();
             }

This allows an attacker to send certain bytes into the network buffer and if they match 0x3a) and 0x29, then the vsf_sysutil_extra function is triggered.


text:
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

- None

## [1.0.1] -2020-07-12

### Fixed

- Tone peer dependency

## [1.0.0] - 2020-07-12

### Changed

- Use new piece interface v4

## [0.2.0] - 2020-06-11

### Added

- `record.isSupported`

## [0.1.3] - 2020-06-2

### Fixed

- Fix abrupt fade in/out

## [0.1.2] - 2020-06-02

### Fixed

- Fix fade out scheduling

## [0.1.1] - 2020-04-26

### Fixed

- Pass an actual Tone Context implementation to the recorded piece.

[unreleased]: https://github.com/generative-music/web-recorder/compare/v1.0.1...HEAD
[1.0.1]: https://github.com/generative-music/web-recorder/compare/v1.0.0...v1.0.1
[1.0.0]: https://github.com/generative-music/web-recorder/compare/v0.2.0...v1.0.0
[0.2.0]: https://github.com/generative-music/web-recorder/compare/v0.1.3...v0.2.0
[0.1.3]: https://github.com/generative-music/web-recorder/compare/v0.1.2...v0.1.3
[0.1.2]: https://github.com/generative-music/web-recorder/compare/v0.1.1...v0.1.2
[0.1.1]: https://github.com/generative-music/web-recorder/compare/v0.1.0...v0.1.1

repository: generative-music/web-recorder

gha_language: JavaScript

repo_name: generative-music/web-recorder


text:
---
layout:     post
title:      Solutions to Other Problems in LeetCode(3)
subtitle:   LeetCode Problem No.371 and No.150
date:       2020-04-01
author:     JYW
header-img: img/post-200401-LeetCode1-01.jpg
catalog: true
tags:
    - LeetCode
    - Python
    - Algorithm
---

>Learn a bit of algorithms everyday!

# Problem No.371 Pascal's Triangle

#### Problem Statement

Calculate the sum of two integers a and b, but you are not allowed to use the operator `+` and `-`.

-**Example**：
```
Input: a = 1, b = 2
Output: 3

Input: a = -2, b = 3
Output: 1
```

#### Solution

The first thought is using `sum()` HAHAHA!
```
class Solution:
    def getSum(self, a: int, b: int) -> int:
        return sum([a,b])
```
Or we can use bit manipulation.
```
class Solution:
    def adder(self,x,y):
        carry = 0
        while y:
            carry = x & y
            x ^= y
            y = carry << 1
        return x

    def subtractor(self,x,y):
        borrow = 0
        while y:
            borrow = (~x) & y
            x ^= y
            y = borrow << 1
        return x

    def getSum(self, a: int, b: int) -> int:
        a, b = max(a,b), min(a,b)
        if b >= 0:
            return self.adder(a,b)
        if a < 0:
            return -self.adder(-a,-b)
        if b < 0 and a >= 0:
            if -b > a:
                return -self.subtractor(-b, a)
            else:
                return self.subtractor(a, -b)
```

# Problem No.150 Evaluate Reverse Polish Notation

#### Problem Statement

Evaluate the value of an arithmetic expression in **Reverse Polish Notation**.

Valid operators are `+`, `-`, `*`, `/`. Each operand may be an integer or another expression.

-**Note**:

1. Division between two integers should truncate toward zero.
2. The given RPN expression is always valid. That means the expression would always evaluate to a result and there won't be any divide by zero operation.

-**Example**
```
Input: ["2", "1", "+", "3", "*"]
Output: 9
Explanation: ((2 + 1) * 3) = 9

Input: ["4", "13", "5", "/", "+"]
Output: 6
Explanation: (4 + (13 / 5)) = 6

Input: ["10", "6", "9", "3", "+", "-11", "*", "/", "*", "17", "+", "5", "+"]
Output: 22
Explanation:
  ((10 * (6 / ((9 + 3) * -11))) + 17) + 5
= ((10 * (6 / (12 * -11))) + 17) + 5
= ((10 * (6 / -132)) + 17) + 5
= ((10 * 0) + 17) + 5
= (0 + 17) + 5
= 17 + 5
= 22
```

#### Solution

I used the concept of stack to solve the problem.
```
class Solution:
    def evalRPN(self, tokens: List[str]) -> int:
        operators = ["+", "-", "*", "/"]
        numbers = []
        for each in tokens:
            if each not in operators:
                numbers.append(int(each))
            else:
                after = numbers.pop()
                before = numbers.pop()
                if each == "+":
                    numbers.append(before + after)
                elif each == "-":
                    numbers.append(before - after)
                elif each == "*":
                    numbers.append(before * after)
                else:
                    numbers.append(int(before / after))
        return numbers[0]
```
We can also use `dict` and `lambda`.
```
op = {'+': lambda x, y: x + y,
      '-': lambda x, y: x - y,
      '*': lambda x, y: x * y,
      '/': lambda x, y: int(x / y)}

class Solution:
    def evalRPN(self, tokens: List[str]) -> int:
        num_stack = []
        for t in tokens:
            if len(t) > 1 or t.isdigit():
                num_stack.append(int(t))
            else:
                b = num_stack.pop()
                a = num_stack.pop()
                num_stack.append(op[t](a, b))
        return num_stack[0]
```


text:
---
title: Interception
category: cards
subcategory: Communications
---
The Interception card takes a bit of back and forth from the FD. The FD can check the "incterception" checkbox on the InterceptionCore which will allow the comm's officer to select a button to start intercepting the message. The comm's officer will then match the incoming frequencies to lock on to the signal. Once this is complete, the FD will receive a notification that the signal is locked. At this point the FD can send an incoming message via the long-range comm's or print out a coded message via the printer (if it is configured.) After the code is decoded, the FD will want to uncheck the "Interception" checkbox to allow for future messages to be intercepted when that time comes. The FD should communicate to the crew that there is a possiblitiy to intercept a message.

![](/img/screen-shot-2019-03-16-at-1.13.44-pm.png)


text:
# Kommander

**Kommander** is a *Java* asynchronous [Command Pattern](https://en.wikipedia.org/wiki/Command_pattern) implementation, specially recommended
to solve **Android UI Thread Issue**.

## Usage

**Kommander** is designed to be really simple to use. First of all, you need to create a ```Kommander``` instance.

```java
Kommander kommander = Kommander.getInstance();
```

That was easy, right? Now, let's launch an asynchronous execution.

#### Kommands

```java
kommander.makeKommand(() -> interactor.searchMovie("Titanic"))
    .setOnCompleted(this::paintMovies)
    .kommand();
```

This example is executing an asynchronous search of a movie and releases the result on ```paintMovies()``` when all has worked fine.

  + Let's see each step in detail:

	* Making a **Kommand**

    ```java
    Kommand<List<Movie>> kommand = kommander.makeKommand(new Action<List<Movie>>() {
        @Override
        public List<Movie> action() throws Throwable {
            return interactor.searchMovie("Titanic");
        }
    });
    ```

    A ```Kommand``` is an asynchronous context builder of an ```Action```, where it can be defined like a piece of code to be executed in the future
	that returns a value or throws an exception.

    * Setting up the callback **Response**

    ```java
    kommand = kommand.setOnCompleted(new Response.OnCompleted<List<Movie>>() {
        @Override
        public void onCompleted(List<Movie> response) {
            paintMovies(response);
        }
    });

    // ...

    private void paintMovies(List<Movie> movies) {
    // do something
    }
    ```

	In this step a ```Response.OnCompleted``` is being set up, that is who is going to handle the ```Action``` result. Also, in a similar way, is
	possible setting up the ```Response.OnError``` when something is not going fine in the ```Action``` execution.

	```java
    kommand = kommand.setOnError(new Response.OnError() {
        @Override
        public void onError(Throwable error) {
            showMessage("Something failed!");
        }
    });
    ```

    * Launch the **Kommand**

    ```java
    KommandToken token = kommand.kommand();
    ```

    When a ```Kommand``` is fully defined, it can be launched to an asynchronous execution with ```kommand()```.
    A ```KommandToken``` is returned, you can use it to cancel the ```Kommand``` execution. A canceled ```Kommand```, will never be executed if the
    execution has not started yet, try to stop the execution if that is running, or at least, the response is not delivered when the execution finish.

  + **Delay** You can define a delay time, in milliseconds, to kommand execution.

    ```java
    long millisecondDelay = 60_000L;
    kommand = kommand.delay(millisecondDelay);
    ```

  + A **Deliverer** is just a way to define how and when ```Kommander``` will deliver the result of an asynchronous execution.

    ```java
    kommand = kommand.setDelivered(new Deliverer() {
        @Override
        public void deliver(Runnable runnable) {
            // How do you want to deliver the response? Your code here!
        }
    });
    ```

    For instance, using ```Kommander``` on Android, you could use the next ```Deliverer``` to release the results on the Android's UI Thread.

    ```java
    @Provides(singleton = true)
    Deliverer provideAndroidDeliverer() {
        Handler handler = new Handler(Looper.getMainLooper());
        return handler::post;
    }
    ```

#### KommandTokenBox

  When you make ```Kommand.kommand()``` you receive a ```KommandToken``` instance to take control of the kommand cancellation with
  ```KommandToken.cancel()```, but often managing these tokens is a few unpleasant. So you can take advance of ```KommandTokenBox``` to easy the
  cancel control.

  + Add tokens to box

    ```java
    KommandTokenBox box = new KommandTokenBox();    // TokenBox
	Kommand<Integer> kommand = kommander.makeKommand(() -> 1);

    // Explicit appendToken
	KommandToken token = kommand.kommand();
    box.append(token);                             // AppendToken to the box
	box.append(token, "VIEW_SCOPE_TAG");           // AppendToken to the box with tag

    // Implicit appendToken
    kommand.kommand(box);                          // AppendToken to the box
    kommand.kommand(box, "VIEW_SCOPE_TAG");        // AppendToken to the box with tag
    ```

  + Cancelling tokens

    ```java
    box.cancel("VIEW_SCOPE_TAG");                  // Cancel previously appended tokens with this tag
    box.cancelAll();                               // Cancel all tokens appended tokens
    ```

## Download

Kommander is available on jcenter. Please ensure that you are using the latest version
checking here.

**Maven:**

```xml
<dependency>
  <groupId>com.wokdsem.kommander</groupId>
  <artifactId>kommander</artifactId>
  <version>1.3.0</version>
</dependency>
```

**Gradle:**

```groovy
compile 'com.wokdsem.kommander:kommander:1.3.0'
```

## License

	Copyright 2017 Wokdsem

    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.

repository: Wokdsem/Kommander

repo_name: Wokdsem/Kommander


text:
# RESOURCES

* [Markdown CheatSheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)
* [https://www.w3schools.com/nodejs/](https://www.w3schools.com/nodejs/)
* [Node.js Tutorial for Beginners: Learn Node in 1 Hour | Mosh](https://www.youtube.com/watch?v=TlB_eWDSMt4)
* [JavaScript Date Time Object Tutorial](https://www.youtube.com/watch?v=Kt3AuWZWUQ0)
* [Auto-Open Markdown Preview](https://marketplace.visualstudio.com/items?itemName=hnw.vscode-auto-open-markdown-preview)
* [VS Code Keyboard shortcuts](https://code.visualstudio.com/shortcuts/keyboard-shortcuts-windows.pdf)
* [What Makes A Great Programmer? 10 Characteristics](https://www.youtube.com/watch?v=OwW0_7p_j84)
* [The Most Powerful Mindset for Success](https://www.youtube.com/watch?v=qjBdcyueom8)

## MUSIC
* [5 Hours of Relaxing Psychedelic Space Rock - Travel Dos](https://www.youtube.com/watch?v=ors0wpcVDcc)
* [Code Radio 🎧 + 💻 24/7 concentration music for programmers 🔥 jazzy beats from freeCodeCamp.org](https://www.youtube.com/watch?v=mXRfApkMYZU)
* [Metallica - Orion (Cliff Burton Bass Really Loud)](https://www.youtube.com/watch?v=5HeV6uN5f5o&list=RD5HeV6uN5f5o&start_radio=1)

repository: tbaglioni/LearnToCode

repo_name: tbaglioni/LearnToCode


text:
---
title: "R Notes for QRM"
author: "Shih-Sheng Chang"
date: "2021-05-17T17:29:15Z"
tags: [Tutorial]
link: "https://bookdown.org/shihshengch/r_notes_for_qrm/"
length_weight: "9.7%"
pinned: false
---

R Notes for QRM [...] This is a note based on the book “Quantitative Risk Management: Concepts, Techniques and Tools” by Alexander J. McNeil, Rüdiger Frey and Paul Embrechts, published by Princeton University Press in 2015 (revised 2nd edition, 1st edition 2005) and the book “The Quantitative Risk Management Exercise Book” by Marius Hofert and Rüdiger Frey and Alexander J. McNeil, published by Princeton University Press in 2020. The note contains theoretical definitions and R codes based on QRM Tutorial by Marius ...

branch_name: refs/heads/main

gha_language: R


text:
### [CVE-2023-3844](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-3844)
![](https://img.shields.io/static/v1?label=Product&message=mooDating&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=%3D%201.2%20&color=brighgreen)
![](https://img.shields.io/static/v1?label=Vulnerability&message=CWE-79%20Cross%20Site%20Scripting&color=brighgreen)

### Description

A vulnerability was found in mooSocial mooDating 1.2. It has been declared as problematic. Affected by this vulnerability is an unknown functionality of the file /friends of the component URL Handler. The manipulation leads to cross site scripting. The attack can be launched remotely. The associated identifier of this vulnerability is VDB-235195. NOTE: We tried to contact the vendor early about the disclosure but the official mail address was not working properly.

### POC

#### Reference
- http://packetstormsecurity.com/files/173691/mooDating-1.2-Cross-Site-Scripting.html
- https://vuldb.com/?id.235195

#### Github
No PoCs found on GitHub currently.

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve


text:
# Pleiochaeta albiziae (Petch) S. Hughes, 1951 SPECIES

#### Status
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Mycol. Pap. 36: 39 (1951)

#### Original name
Ceratophorum albiziae Petch, 1917

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# Content Security Policy (CSP) support for PHP

Installation:

```
composer require elgg/content-security-policy
```

Example usage:

```php
use Elgg\ContentSecurityPolicy\Directive;
use Elgg\ContentSecurityPolicy\Header;
use Elgg\ContentSecurityPolicy\Policy;
use Elgg\ContentSecurityPolicy\Source;

$policy = new Policy();
$policy = $policy->withSource(Directive::DEFAULT_SRC(), Source::SELF)
            ->withSource(Directive::IMAGE_SRC(), Source::DATA);

header(Header::STANDARD . ": $policy");
// Sends "Content-Security-Policy: default-src 'self'; img-src data:"
```

By default, the policy blocks everything it possibly can.
This is by design to ensure that your site only allows what you want to allow,
not what someone else thinks is a reasonable default.

```php
$policy = new Policy();
echo $policy; // default-src 'none'; sandbox
```

Features:

```
Elgg\ContentSecurityPolicy\Policy
 [x] Instances are immutable
 [x] Supports configuring all standard src directives
 [x] Can be stringified into standard csp format
 [x] The default policy value allows nothing
```

repository: Elgg/content-security-policy

repo_name: Elgg/content-security-policy


text:
---
layout: post
title: Student visa renewal experience in Munich, Germany
subtitle: Process to renew your student visa in Munich, Germany
---

This post aims to provide information about the process of renewing student visa based on my  personal experience.

If you are studying in Technical University Of Munich (TUM) or LMU or any other university based in Munich you should process all your government related works (eg. renew visa, address registration, applying residence permit etc ) from Kreiseverwaltungsreferat(KVR) located in Rupperstrasse 19, 80337 Munich.

According to the opening schedule of KVR on Tuesday ( 8.30 – 12 Uhr und 14 – 18 ) , I reached KVR at 8:40 am and asked reception about the place to renew my student visa. It was Wartezone 8 on 2nd floor. Reception in Wartezone 8 asked me show my passport, enrolment paper and bank statement just to confirm that I had all the required documents. She gave me a form to fill up and a token no. to wait for my turn.
After certain time, I went to the room near by the Wartezone 8 as mentioned in the digital notice board. I was asked to show following documents

- passport
- existing residence permit
- enrolment certificate from the university
- transcript with credits from the university
- bank statement
- student job contract(optional)
- health insurance card

After verifying these documents, she gave me an application letter and asked me to submit it to the reception in area number 1073 on first floor. She kept my existing residence permit because it was supposed to be printed on my passport. I asked her, is it ok to carry photo copy of visa while travelling within munich and she said we are allowed to so.  Finally, I had to submit this application letter with 30 EUR and passport and I was give a token number to wait for my turn. After 10 min I received visa on my passport with 1 year of extension.

I was lucky that all these process only took  1 and half hours.

I hope this post will be helpful to others with similar situation.

For detailed information please visit this
[link]( http://www.muenchen.de/rathaus/home_en/Department-of-Public-Order/Foreigners-Office/student-visa-residence/visa-for-academic-studies )


text:
---
layout: default
---

# 1993-04-18 - What Clinton's proposal will mean to the Rest of the World

## Header Data

From<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 3503f2aaf28d3ea7f8e006902d083548df7da322478d10200f2061e11873d991

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1993-04-18 14:46:56 UTC

Raw Date: Sun, 18 Apr 93 07:46:56 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>Date: Sun, 18 Apr 93 07:46:56 PDT
To<EMAIL_ADDRESS>Subject: What Clinton's proposal will mean to the Rest of the World
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Cypherpunkers,

Having just digested the press release, and the subsequent
followups on sci.crypt and on here, I am beginning to wonder what
ramifications this might have in other countries, specifically the
"Superpowers". Surely setting such a precedent in his own country will
spark off a flurry of activity in places such as the UK, Germany,
France et al, so that they are not "left behind", so-to-speak?

To be quite honest, I can't see the English government taking such
radical steps about secure telecommunications, quite simply, because
BT have such a lacsidasical [sp?] approach to new and emerging
technologies. Take for instance, IDSN. Their philosophy of marketing
and "selling" ISDN is laughable - I once read a newspaper article
which related a tale of a Corporation who wanted to learn if ISDN
could be useful to it's business practices, and it seems that BT
just kept jostling them between department (Dept X: "Phone Dept Y",
Dept Y: "Phone Dept X" etc).

Can anyone really see that the US government (or whoever) will
completely outlaw all strong data encryption? This violates the
basic human right of free communications/privacy.

--
Rick M. Tait                                Bell Northern Research Europe
Tel: +44-81-945-3352, Fax: +44-81-945-3352     Network Management Systems
<PGP 2.2 public key available on request>       New Southgate, London. UK
email<EMAIL_ADDRESS>||<EMAIL_ADDRESS>||<EMAIL_ADDRESS>

{% endraw %}
```

## Thread

+ Return to [April 1993](/archive/1993/04)

+ Return to "[R.Tait@bnr.co.uk](/authors/r_tait_at_bnr_co_uk)"

+ 1993-04-18 (Sun, 18 Apr 93 07:46:56 PDT) - What Clinton's proposal will mean to the Rest of the World -<EMAIL_ADDRESS>


text:
# Model Based Controllers

 Model-based control uses information about the dynamics of the system's structure and its behavior in time to obtain a better control result regarding stability and performance of the controlled system. Take the following simple example:

Let $\frac{d^2x}{dt^2}= f(x)+u$

be the system to be controlled, where x - state vector, f(x) - nonlinear vector function, u - control vector. Suppose we have some estimation est(x) than we use a control law like

$u = -est(x)+u_{st}$

where ust be some maybe linear PID control law

$u_{st} = K_px + K_d\frac{dx}{dt} + K_i\int xdt$

So we get

$\frac{d^2x}{dt^2} = \Delta f + K_px + K_d\frac{dx}{dt} + K_i\int xdt$

where

$\Delta f =f(x) - est(x)$

If the model uncertainties are small enough we get a linear system with a disturbance Delta f which can be stabilized using appropriate control gains Kp, Kd, KI. Above given is just an example of model based controller in real life model based controller are way more complex than this.

**Model Predictive Control(MPC)** is the most widely known model based controller. Model Predictive Controllers rely on the dynamic models of the process, most often linear empirical models obtained by system identification.

Model predictive control offers several important advantages:

(1) the process model captures the dynamic and static interactions between input, output, and disturbance variables,

(2) constraints on inputs and outputs are considered in a systematic manner,

(3) the control calculations can be coordinated with the calculation of optimum set points, and

(4) accurate model predictions can provide early warnings of potential problems.

The mathematics and concepts involved in MPC are a bit complex and require a decent understanding of mathematics of control theory.

To study more about MPC controller read [this](http://folk.ntnu.no/skoge/vgprosessregulering/papers-pensum/seborg-c20ModelPredictiveControl.pdf) material by NTNU

You can also check [this](https://www.youtube.com/watch?v=YwodGM2eoy4) video by Steve Brunton to get a more detailed idea

Some of the other resources you should check to understand control theory and various controllers in more detail are:

1. Control Bootcamp [playlist](https://www.youtube.com/playlist?list=PLMrJAkhIeNNR20Mz-VpzgfQs5zrYi085m) by Steve Brunton
2. Control Systems [Lectures](https://www.youtube.com/user/ControlLectures) by Brian Douglas
3. Control of Mobile Robots [course](https://www.my-mooc.com/en/mooc/control-of-mobile-robots/) by Georgia Tech University on Coursera
4. Modern Robotics - Mechanical, Planning and Control by Kevin.M.Lynch and Frank.C.Park
5. MIT Courseware Control Theory [Notes](https://ocw.mit.edu/courses/mechanical-engineering/2-017j-design-of-electromechanical-robotic-systems-fall-2009/lecture-notes/MIT2_017JF09_control.pdf)


text:
# Broadcaster

`service`

A service responsible to broadcast events.
Whenever `_broadcast()` on a `Joint` is called, this service will be responsible to deliver it
to every node in the hierarchy.

The service maybe be accessed by requiring `services/broadcaster`.
You can replace this service by your own if it obeys the public interface.

```js
define(['services/broadcaster'], function (broadcaster) {
    //..
});

```

## broadcaster.on()

`public method` _on(event, fn, [context])_

Adds a new event listener.
If the listener is already attached, it won't get duplicated.

**Parameters**

|                    |          |                                                                               |
| ------------------ | -------- | ----------------------------------------------------------------------------- |
| event              | String   | The event name.                                                               |
| fn                 | Function | The listener.                                                                 |
| context (optional) | Object   | The context in which the function will be executed, defaults to the instance. |

**Returns**

Broadcaster - The instance itself to allow chaining.

## broadcaster.once()

`public method` _once(event, fn, [context])_

Adds a new event listener that is removed automatically afterwards.
If the listener is already attached, it won't get duplicated.

**Parameters**

|                    |          |                                                                               |
| ------------------ | -------- | ----------------------------------------------------------------------------- |
| event              | String   | The event name.                                                               |
| fn                 | Function | The listener.                                                                 |
| context (optional) | Object   | The context in which the function will be executed, defaults to the instance. |

**Returns**

Broadcaster - The instance itself to allow chaining.

## broadcaster.off()

`public method` _off([event], [fn], [context])_

Removes an existent event listener.
If no fn and context is passed, removes all event listeners of a given name.
If no event is specified, removes all events of all names.

**Parameters**

|                    |          |                                        |
| ------------------ | -------- | -------------------------------------- |
| event (optional)   | String   | The event name.                        |
| fn (optional)      | Function | The listener.                          |
| context (optional) | Object   | The context passed to the on() method. |

## broadcaster.broadcast()

`public method` _broadcast(event, [args])_

Emits a broadcast event.

**Parameters**

|                  |          |                 |
| ---------------- | -------- | --------------- |
| event (optional) | String   | The event name. |
| args (optional)  | ...mixed | The listener.   |

**Returns**

Boolean - True if the event was handled by at least one listener, false otherwise.

repository: IndigoUnited/spoonjs-www

repo_name: IndigoUnited/spoonjs-www


text:
# keyboard-sound
Improve the sound of your keyboard.

Inspired by Glarses' video ["How To Make Any Keyboard Sound AMAZING."](https://www.youtube.com/watch?v=P_9vXJZVT54)
The sound clips used here are his.

Should work on all operating systems, with Python 3.4 or higher.
(Though at the moment, this is only tested on Linux with Python 3.8.)

It also works in the background; just leave the program running in the terminal and type in another program!

# How to use
This tries to assume no development knowledge, but reading a tutorial on basic usage of the terminal/command prompt will be helpful.
1. Install [Python 3](https://www.python.org/) if it isn't already.
   (Windows does not come with it preinstalled. macOS does, and Linux usually does.)
   This will run keyboard-sound.
1. Download this code using the green button at the top right of this page, and unzip it.
1. Open a terminal/command prompt.
1. Install pipenv with `pip3 install --user pipenv`.
   This is a program that will manage some of the code that keyboard-sound needs.
1. Change directories to where you unzipped the files.
1. Run `pipenv update`.
1. Run `pipenv run python3 keyboard-sound.py`
1. Voila!


text:
# application-simulator
A web application simulator with configurable delays and payloads

## Prerequisites
* Node.js - Download and Install [Node.js](http://www.nodejs.org/download/). You can also follow [this gist](https://gist.github.com/isaacs/579814) for a quick and easy way to install Node.js and npm

### Tools Prerequisites
* NPM - Node.js package manager should be installed when you install node.js.

## Quick Install
  The quickest way to get started with application-simulator is to install the dependencies using npm.

  Install application-simulator:

    $ cd application-simulator && npm install

## Run
  Run the server using the following command

    $ node app.js

  The server will be hoisted on port 3000 (This can be changed in /config/env/all.js)

repository: mikeldking/application-simulator

repo_name: mikeldking/application-simulator


text:
#  [![LOGO][logo-image]][logo-url] React Most Wanted
[![Build Status][travis-image]][travis-url]
[![Dependency Status][daviddm-image]][daviddm-url]
[![License][license-image]][license-url]
[![Code Coverage][coverage-image]][coverage-url]
[![Code Style][code-style-image]][code-style-url]

This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app).

This is a `shell` for my future applications with the minimum features I would like them to have. Because of this I have designed it to be as simple as possible and without regrets about feature implementations.

You can find an example of this project in this [DEMO](https://www.react-most-wanted.com/).

I tried to make the project as clean as possible and to use all libraries in their pure ways.

## Table of Contents

- [Features](#features)
- [Folder Structure](#folder-structure)
- [Usage](#usage)
  - [Simple run](#simple-run)
  - [Reuse for own project](#reuse-for-own-project)
- [Customatisation](#customatisation)
  - [Internationalization](#internationalization)
  - [Theming](#theming)
  - [Firebase lists](#firebase-lists)
  - [Drawer width](#drawer-width)
  - [Authorisation](#authorisation)
- [TO DO](#to-do)
- [License](#license)
- [Logo](#logo)

## Features

`React Most Wanted` is a "base project", "starter kit", "boilerplate" (call it whatever you like) project with my **personal** "Most Wanted" features:
* **easy to maintain**
* ***PWA** - has Progressive Web App features
* **responsive** - included with PWA
* **material-ui**
* **routing**
* **theming**
* **forms** - with realtime sync of untouched fields
* **internationalization**
* **authentication**
* **authorisation**
* **code splitting**
* **CI** and **CD**

All these features can be programmed from scratch. But why should anyone do this? There are so many great developers out there creating great applications, libraries and tools to help them and you to develop fast and easily. This is my small contribution to help others have an easier time beginning to use React.

If all that is true, then why did I create this project? There must already be a great starter kit for React applications! Well, there are lots of them but unfortunately none of them was as I would like it to be. Some don't have enough features to just start and some have so many that I had to delete features I don't need. I want to create a starting point that has, as said before, my **personal** "Most Wanted" features. If someone likes it, great :)

There are also other cool features:
* **realtime database**
* **realtime forms**
* **messaging/notifications** - every logged user that approved messaging on login will receive notifications for new tasks created
* **full authentication** - with Google, Facebook, Twitter, GitHub, email and **phone**
* **online and last time offline state for users**
* **file uploads to the firebase storage**

The further text explains which libraries/modules are used, and why. Some of them are installed and used in their `pure` way as described in their documentation. In those cases we will just show the link to the official documentation to avoid outdated descriptions of their usage.

## Folder Structure

The project has following folder structure:

```
react-most-wanted/
  .gitignore
  README.md
  node_modules/
  package.json
  sw-precache-config.js
  public/
    icons/
    index.html
    favicon.ico
    manifest.json
  src/
    components/
    containers/
    firebase/
    utils/
    locales/
    store/
      index.js
      reducers.js
    themes/
    config.js
    index.js
```

All application parts and code should be stored in the `src` folder.

All `react` components should be separated in presentational and container components. This great [article](https://www.fullstackreact.com/p/using-presentational-and-container-components-with-redux/) describes the why and how. For this purpose we have the `components` and `containers` folders.

All `redux` related files are in the `store` folder. You can find more about redux [here](http://redux.js.org/docs/introduction/).

The folders `locales` and `themes` are used to store data for different locales and themes.

## Usage

### Simple run

To just run the project on you own device you should have installed: git, node and npm. Let's assume that this is the case.

Now in your console go to the destination where you want to save the project and run this command:

```js
git clone https://github.com/TarikHuber/react-most-wanted
```

or

```js
git clone https://github.com/TarikHuber/react-most-wanted my_project
```

if you want to save the project into a specific folder (in this example "my_project"). The folder must be empty!

Now go with the console into the folder. If you haven't provided a name like "my_project" then it will be the default "react-most-wanted".

In he folder run this command to start the development mode of the project:

```js
npm run dev
```

For publishing run:

```js
npm run build
```

After it finished follow the instructions or publish the project build folder to your preferred  provider or own server.

### Reuse for own project

You can either fork this project or clone it into your own repo. I use the second for new projects. You can find [here](https://help.github.com/articles/duplicating-a-repository/) more information about how to clone/duplicate a repo into your own.

After cloning the repo into your own you should change the configurations like project name and the firebase config. Here is a list of all changes you should make:
* **package.json**  - here you should change the name and version
* **src/config.js**  - here you should change all firebase data and other options
* **public/index.html**  - change the title (it will be overridden, but it looks better)
* **public/firebase-messaging-sw.js**  - change the ``messagingSenderId``

After setting up the code we need to deploy our application to Firebase. As first create an application build by running `npm run build`.

To use firebase we need to install the firebase tools by running `npm install -g firebase-tools` and after that login to firebase with `firebase login`.

After the login run `fribease init` to setup the Firebase project. Override the existing project and select yours from your Firebase console.
Override only the '.firebasesrc' file and leave the other as they are because the database and storage rules, functions and firebase settings should stay as they are. If you override them the project will probably not work as it should.

Don't forget to setup the email configs into the firebase functions using `firebase functions:config:set<EMAIL_ADDRESS>gmail.password="secretpassword"`.

You should now be able to deploy your application to your Firebase using `firebase deploy`.

##Customatisation

### Internationalization

Internationalization is very important. Even if you use just a single language your application should be prepared for more of them. It is easier to apply this from the start than to refactor the whole application afterwards.

The only thing you'll have to do to add a new language is that you have to add the localisationData in the locales [index.js](https://github.com/TarikHuber/react-most-wanted/blob/master/src/locales/index.js) folder like in the code sniped below. Here we add the language for to the project:

```js

import fr from 'react-intl/locale-data/fr';
import fr_messages from './fr';

//... other code

const locales = [
  {
    locale: 'en',
    messages: en_messages,
    data: en
  },
  {
    locale: 'de',
    messages: de_messages,
    data: de
  },
  {
    locale: 'bs',
    messages: bs_messages,
    data: bs
  },
  {
    locale: 'fr',
    messages: fr_messages,
    data: fr
  },

]

```

We also need to create a file 'fr.js' into the 'locales' folder. I would recommend to juts copy the 'en.js' file and to translate the strings.

To add more translated strings just add them to every language file you have in the 'locales' folder.

### Theming

To change or to add a new theme you would have to add or edit a theme file into the 'themes' folder and a reference to it into the 'index.js' file.

For example we crate a file 'my_theme.js' and change the 'index.j' file like below. You can use the 'ics_theme' as bootstrap for new projects or get a new one from the official 'material-ui' documentation.

```js

import ics_theme from './ics_theme';
import my_theme from './my_theme';

const themes= [
  {
    id: 'light',
    source: lightBaseTheme,
  },
  {
    id: 'dark',
    source: darkBaseTheme,
  },
  {
    id: 'ics',
    source: ics_theme,
  },
  {
    id: 'my_theme',
    source: my_theme,
  },
];

```

### Firebase lists

To add a new list that is synced with Firebase there are more steps to take.
First we need to create a component that will represent the list. You can use the 'Tasks.js' component as example.

In that you should change following code parts to make it work:

```js
//....code before
const actions = new ListActions('your_list').createActions();
//....code after

```

In the folder 'store' you should add the generated reducers into the 'reducers.js' file, like so:

```js
//....code before
const reducers = combineReducers({
  browser: responsiveStateReducer,
  responsiveDrawer,
  form: formReducer,
  auth,
  connection,
  dialogs,
  messaging,
  locale,
  theme,
  tasks: getListReducers('public_tasks'),
  companies: getListReducers('companies'),
  your_list: getListReducers('your_list'), //your new list
  users: getListReducers('users')
})
//....code after

```

That is all you have to do to add a new list. It is up to you how the lists will be presented. Just don't forget to leave into the mounting and unmounting part of you component following code parts:

```js
//....code before
componentDidMount() {
  const {initialiseList}=this.props;
  initialiseList();
}

componentWillUnmount() {
  const {unsubscribeList}=this.props;
  unsubscribeList();
}
//....code after

```

These are initializing the list and unsubscribing from it if we leave the component. You can add other code to those functions or move those calls to other places of your component life cycle if you wish.

### Drawer width

To change the drawer (left menu) width go to the 'config.js' file and change the value of  'drawer_width' :)

### Authorisation

Note that authentication and authorization are not the same thing! With authentication we identify who we have as user and with authorization we identify what that user can do in our application. In this project authorization is managed over `grants` and `roles`. Every grant gives the user the authorization to do a specific action (read, create, edit or delete) in the database.  They are just for managing large number of grants easily. Every grant can still be managed separately.

Only administrators have access to add or remove grants and roles to a user. Only administrators can make other users to administrators.

**WARNING:** In this demo the rules are manipulated such that everyone can make other users admins, and a user can even become an admin on their own. Everyone can see how this part works. In production a change should be made in the database.rules file.

From:

```js
"admins":{
  ".read": "auth != null",
  "$uid":{
    ".write": "auth != null || root.child('admins/'+auth.uid).exists()"
  }
},

```

To:

```js
"admins":{
  ".read": "auth != null",
  "$uid":{
    ".write": "auth != null && root.child('admins/'+auth.uid).exists()"
  }
},

```

## TO DO

- [X] implement all or most firebase functionalities
- [X] implement [redux-offline](https://github.com/jevakallio/redux-offline) with examples
- [X] implement code splitting
- [X] implement continuous integration
- [ ] update to material-ui@next
- [ ] finish tests

## License

MIT

## Logo

Thanks to @SiradDev for creating the logo for this project :)

[logo-image]: https://www.react-most-wanted.com/favicon-32x32.png
[logo-url]: https://github.com/TarikHuber/react-most-wanted/blob/master/README.md
[travis-image]: https://travis-ci.org/TarikHuber/react-most-wanted.svg?branch=master
[travis-url]: https://travis-ci.org/TarikHuber/react-most-wanted
[daviddm-image]: https://img.shields.io/david/TarikHuber/react-most-wanted.svg?style=flat-square
[daviddm-url]: https://david-dm.org/TarikHuber/react-most-wanted
[coverage-image]: https://img.shields.io/codecov/c/github/TarikHuber/react-most-wanted.svg?style=flat-square
[coverage-url]: https://codecov.io/gh/TarikHuber/react-most-wanted
[license-image]: https://img.shields.io/npm/l/express.svg
[license-url]: https://github.com/TarikHuber/react-most-wanted/master/LICENSE
[code-style-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[code-style-url]: http://standardjs.com/

repository: project-wingman/webapp

repo_name: project-wingman/webapp


text:
---
title: "Java Key Store Setup"
linkTitle: "Java Key Store Setup"
#weight:
date: 2021-08-20
tags:
  - TODO
description: >

---

{{% todo %}}
This is out of date for stroom 7.
{{% /todo %}}

In order that the java process communicates over https (for example Stroom Proxy forwarding onto Stroom) the JVM requires relevant keystore's setting up.

As the processing user copy the following files to a directory stroom-jks in the processing user home directory :

- CA.crt     - Certificate Authority
- SERVER.crt - Server certificate with client authentication attributes
- SERVER.key - Server private key

As the processing user perform the following:

- First turn your keys into der format:

```bash
cd ~/stroom-jks

SERVER=<SERVER crt/key PREFIX>
AUTHORITY=CA

openssl x509 -in ${SERVER}.crt -inform PEM -out ${SERVER}.crt.der -outform DER
openssl pkcs8 -topk8 -nocrypt -in ${SERVER}.key -inform PEM -out ${SERVER}.key.der -outform DER
```

- Import Keys into the Key Stores:

```bash
Stroom_UTIL_JAR=`find ~/*app -name 'stroom-util*.jar' -print | head -1`

java -cp ${Stroom_UTIL_JAR} stroom.util.cert.ImportKey keystore=${SERVER}.jks keypass=${SERVER} alias=${SERVER} keyfile=${SERVER}.key.der certfile=${SERVER}.crt.der
keytool -import -noprompt -alias ${AUTHORITY} -file ${AUTHORITY}.crt -keystore ${AUTHORITY}.jks -storepass ${AUTHORITY}
```

- Update Processing User Global Java Settings:

```bash
PWD=`pwd`
echo "export JAVA_OPTS=\"-Djavax.net.ssl.trustStore=${PWD}/${AUTHORITY}.jks -Djavax.net.ssl.trustStorePassword=${AUTHORITY} -Djavax.net.ssl.keyStore=${PWD}/${SERVER}.jks -Djavax.net.ssl.keyStorePassword=${SERVER}\"" >> ~/env.sh
```

Any Stroom or Stroom Proxy instance will now additionally pickup the above JAVA_OPTS settings.


text:
[![CircleCI](https://circleci.com/gh/Kamil-IT/do-everyday/tree/master.svg?style=svg)](https://circleci.com/gh/Kamil-IT/do-everyday/tree/master)
# do-everyday
Getting and presenting necessary information every day.
This project uses friendly GUI which you can apply after running this project on your machine. The default main page is available on http://localhost:8080/.

## Parts of project
- Weather
- Todo list
- API for Todo list
- Budget manager
- Spotify searcher
- In future more...

## How to run

### Use h2 database in memory

#### Windows

Open cmd in web module directory(`.../do-everyday/do-everyday-web`) and run:

```mvnw.cmd spring-boot:run -Dspring-boot.run.profiles=default```

#### Linux

Open terminal in web module directory(`.../do-everyday/do-everyday-web`) and run:

```mvnw spring-boot:run -Dspring-boot.run.profiles=default```

### Use MySql database

Scripts to configure MySQL(database and users) are in `.../do-everyday/do-everyday-web/src/main/scripts/*`.
Information about MySQL users are keeping in '`.../do-everyday/do-everyday-web/src/main/resources/application-mysql.yml`

#### Windows

Open cmd in web module directory(`.../do-everyday/do-everyday-web`) and run:

```mvnw.cmd spring-boot:run -Dspring-boot.run.profiles=mysql```

#### Linux:

Open terminal in web module directory(`.../do-everyday/do-everyday-web`) and run:

```mvnw spring-boot:run -Dspring-boot.run.profiles=mysql```

## Descripe parts of project

### Weather

This application takes information about actual weather conditions and forecast from [DarkSky](https://darksky.net/dev).
To convert geographical coordinates for particular country and city names the module exploits [OpenCage Geocoder](https://opencagedata.com/).

### Todo list

This module handles stuff referring to tasks and boards.
It allows you to create e.g. a shopping list, manage task todo and more.
All boards and tasks are stored in database (including the done ones).

### API for Todo list

Base API path is `api/v1/*`. It supports JSON format.

 TaskManagersDto
e.g. POST `api/v1/single_name_of_stuff` id is creared by Hibernate

#### PUT

To update boards, tasks, tasks managers you have to add body which is in JSON format and compatible with boardDto, taskDto. TaskManagersDto e.g.
e.g. POST `api/v1/single_name_of_stuff/id`

#### DELETE

Delete boards, tasks, tasks managers e.g. DELETE `api/v1/single_name_of_stuff/id`

## Budget manager

Budget manager stores all your transfers in one place and can generate PDF documentation along with aggregates of spent money which are segregated as regards their currency

## Spotify searcher

Spotify searcher is used for search artist, albums and tracks which are available on spotify

repository: Kamil-IT/do-everyday

repo_name: Kamil-IT/do-everyday


text:
---
layout: single
title: "Updating Ubiquiti NVR Container on a Synology"
date: 2019-01-13
category: [Other]
excerpt: "Updating the pducharme Docker Container on a Synology NAS"
---
# Introduction

I use [Ubiquiti UniFi cameras](https://www.ubnt.com/products/#unifivideo) around my home as the CCTV solution. I didn't want to shell out for the NVR since I had a Synology NAS with plenty of storage.

I use an image maintained by [pducharme](https://hub.docker.com/r/pducharme/unifi-video-controller/) and there are a few guides available on setup of this on a Synology. A good example is [here](https://community.ubnt.com/t5/UniFi-Video/Setup-Guide-Unifi-Video-in-Docker-on-Synology/m-p/2461750/highlight/true#M108835) on the Ubiquiti Forums. However I keep seeing people asking how to update to the latest version when already setup. I have written this post to help others and some self documentation for myself so I remember the commands when I perform the upgrade.

## Pre-requisites

This assumes you already have Docker running and the pducharme container working. The NVR UI will alert you when an upgrade is required.

The SSH service should be running on the Synology and you have a SSH client such as [PuTTY](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html) available.

## Procedure

The main outline of the steps is:

1. SSH in and elevate permissions
2. Stop the NVR container
3. Remove the container
4. Remove the image
5. Startup the new container

SSH into the Synology and enter and elevated prompt with something like `sudo -i`.

First we need to list the running containers with the command `docker ps`:

~~~ bash
root@NAS-01:~# docker ps
CONTAINER ID        IMAGE                              COMMAND             CREATED             STATUS              PORTS                                                                                NAMES
822f33a4009c        pducharme/unifi-video-controller   "/run.sh"           5 days ago          Up 5 days           <IP_ADDRESS>:1935->1935/tcp, <IP_ADDRESS>:6666->6666/tcp, <IP_ADDRESS>:7080->7080/tcp, <IP_ADDRESS>:7442-7447->7442-7447/tcp, 7004/udp   unifi-video
~~~

This gives us the container id for NVR - in this case `822f33a4009c`. We now need to stop this container with `docker stop`:

~~~ bash
root@NAS-01:~# docker stop 822f33a4009c
822f33a4009c
~~~

Now it's stopped time to remove it with `docker rm`:

~~~ bash
root@NAS-01:~# docker rm 822f33a4009c
822f33a4009c
~~~

Now the container is gone, time to find the image id using `docker image list`:

~~~ bash
root@NAS-01:~# docker image list
REPOSITORY                         TAG                 IMAGE ID            CREATED             SIZE
pducharme/unifi-video-controller   latest              80c5675cbbf2        7 weeks ago         666MB
~~~

We have the image ID of `80c5675cbbf2` so we can now remove it:

~~~ bash
root@NAS-01:~# docker image rm 80c5675cbbf2
~~~

You may be worried that all the settings and recordings are gone but they are stored on a volume on the Synology.

Lastly let us download and start a new container with the latest build of the NVR from Docker Hub using `docker run`:

~~~ bash
root@NAS-01:~# docker run --restart always --name unifi-video --cap-add SYS_ADMIN --cap-add DAC_READ_SEARCH -p 1935:1935 -p 6666:6666 -p 7080:7080 -p 7442:7442 -p 7443:7443 -p 7444:7444 -p 7445:7445 -p 7446:7446 -p 7447:7447 -v /volume1/docker/unifi-video:/var/lib/unifi-video -e TZ=Europe/London -e PUID=99 -e PGID=100 -e DEBUG=1 --security-opt apparmor:unconfined pducharme/unifi-video-controller
~~~

Please note the part `-v /volume1/docker/unifi-video:/var/lib/unifi-video`. This is specific to my Synology and the volume\folder I setup for holding the NVR settings and recordings. Pleas change it to fir your setup.

Once the image is downloaded and the container is running the camera firmware is upgraded automatically so it will take a few minutes.

### Wrap Up

Using the NVR docker image was my first use of docker and containers and I Love how easy and quick it is to bring up a service or system. I am looking forward to seeing what other containers I can run on my Synology.

I hope this helps the Ubiquiti community on using the great image pducharme has made available.


text:
<!--Generated by WRITEME on 2023-04-12 00:07:51.717452 (UTC)-->
# Amazon SQS code examples for the SDK for Python

## Overview

Shows how to use the AWS SDK for Python (Boto3) to work with Amazon Simple Queue Service (Amazon SQS).

<!--custom.overview.start-->
<!--custom.overview.end-->

*Amazon SQS is a fully managed message queuing service that makes it easy to decouple and scale microservices, distributed systems, and serverless applications.*

## ⚠ Important

* Running this code might result in charges to your AWS account.
* Running the tests might result in charges to your AWS account.
* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege).
* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services).

<!--custom.important.start-->
<!--custom.important.end-->

## Code examples

### Prerequisites

For prerequisites, see the [README](../../README.md#Prerequisites) in the `python` folder.

Install the packages required by these examples by running the following in a virtual environment:

```
python -m pip install -r requirements.txt
```

<!--custom.prerequisites.start-->
<!--custom.prerequisites.end-->

### Single actions

Code excerpts that show you how to call individual service functions.

* [Create a queue](queue_wrapper.py#L23) (`CreateQueue`)
* [Delete a batch of messages from a queue](message_wrapper.py#L143) (`DeleteMessageBatch`)
* [Delete a message from a queue](message_wrapper.py#L124) (`DeleteMessage`)
* [Delete a queue](queue_wrapper.py#L92) (`DeleteQueue`)
* [Get the URL of a queue](queue_wrapper.py#L51) (`GetQueueUrl`)
* [List queues](queue_wrapper.py#L70) (`ListQueues`)
* [Receive messages from a queue](message_wrapper.py#L94) (`ReceiveMessage`)
* [Send a batch of messages to a queue](message_wrapper.py#L51) (`SendMessageBatch`)
* [Send a message to a queue](message_wrapper.py#L24) (`SendMessage`)

### Scenarios

Code examples that show you how to accomplish a specific task by calling multiple
functions within the same service.

* [Send and receive batches of messages](message_wrapper.py)

### Cross-service examples

Sample applications that work across multiple AWS services.

* [Create a messenger application](../../cross_service/stepfunctions_messenger)
* [Create an Amazon Textract explorer application](../../cross_service/textract_explorer)

## Run the examples

### Instructions

<!--custom.instructions.start-->
<!--custom.instructions.end-->

#### Send and receive batches of messages

This example shows you how to do the following:

* Create an Amazon SQS queue.
* Send batches of messages to the queue.
* Receive batches of messages from the queue.
* Delete batches of messages from the queue.

<!--custom.scenario_prereqs.sqs_Scenario_SendReceiveBatch.start-->
<!--custom.scenario_prereqs.sqs_Scenario_SendReceiveBatch.end-->

Start the example by running the following at a command prompt:

```
python message_wrapper.py
```

<!--custom.scenarios.sqs_Scenario_SendReceiveBatch.start-->
<!--custom.scenarios.sqs_Scenario_SendReceiveBatch.end-->

### Tests

⚠ Running tests might result in charges to your AWS account.

To find instructions for running these tests, see the [README](../../README.md#Tests)
in the `python` folder.

<!--custom.tests.start-->
<!--custom.tests.end-->

## Additional resources

* [Amazon SQS Developer Guide](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/welcome.html)
* [Amazon SQS API Reference](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/Welcome.html)
* [SDK for Python Amazon SQS reference](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sqs.html)

<!--custom.resources.start-->
<!--custom.resources.end-->

---

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0

repository: awsdocs/aws-doc-sdk-examples

repo_name: awsdocs/aws-doc-sdk-examples


text:
# [Basic Measurements Trivia](http://alexa.amazon.com/#skills/amzn1.ask.skill.3618a0a3-abc1-4734-bfd0-fbd2c573ce4a)
![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png)![0 stars](../../images/ic_star_border_black_18dp_1x.png) 0

To use the Basic Measurements Trivia skill, try saying...

* *Alexa Open basic measurements trivia*

* *my answer is one*

* *is it four*

A simple, fun trivia game designed to test your knowledge of some basic US measurements.

***

### Skill Details

* **Invocation Name:** basic measurements trivia
* **Category:** null
* **ID:** amzn1.ask.skill.3618a0a3-abc1-4734-bfd0-fbd2c573ce4a
* **ASIN:** B01N4BZ953
* **Author:** Timothy Aaron
* **Release Date:** December 10, 2016 @ 01:19:28
* **In-App Purchasing:** No


text:
# AiBfScatter

like Ai5, This algorithm is based on Ai Pogrammer: an Ai developed in C# by Kory Becker using Genetic Algorithms to generate brainfuck code.
See the Github repository which refers to the Becker's article: https://github.com/primaryobjects/AI-Programmer.

AiBfScatter uses in its core a Scatter Search Algorithm (SSA) whereas Ai5 and Ai Programmer uses a Genetic one. We don't extend brainfuck language to the extended-III Brainfuck.

## The architecture of the algorithm :

 List of modules of the SSA:

GeneticAlgorithms: this module is the SSA Manager. It does every operation of the global algorithm: evaluate and crossover population, write on the log file, decide when the genome size has to be expanded and when the algorithm has to stop.

bfga: this module performs all unit operations on individuals: creates, mutates individuals, decodes the Brainfuck from genome.

Bf: the embedded Brainfuck interpreter.

bfgaAdd: this type of file represents the fitness function associated with the "addition" operation. It also contains the initial parameters of individuals (genome size, etc). The SSA can be started from this file by calling the "test\_serial" method.

Types.jl : This file contains 2 types: GAmodel which is used by GeneticAlgorithms to manage the SSA and GAParams, used by the different fitness functions to give the desired initial parameters.

## Use the algorithm :

### The fitness function
To use the algorithm, you must implement the fitness function corresponding to your task. For the illustration, we will use the fitness function of length(::String) which we call bfgaLengthString in the src/ folder.

It is then necessary to implement 4 functions:

fitness: assigns a score to a program according to its execution within the embedded interpreter :

	```
	output, m_Ticks = execute(ent.program, input, instructionsSet)
	score = 256 - abs(output[1] - goal)
	ent.bonus += (2000 - m_Ticks)
	abs(score)
	```

A bonus can be earned according to criteria you choose. Here it's about the number of executions within the interpreter.

simulate_entity: the simulation function that will display performances of the best algorithms every 1000 generations.

getTargetFitness() : return the target fitness

getParams(): returns a GAParams object (see Types.jl) that specifies the initial parameters of the algorithm: population size, maximum number of generations, genome size and its maximum, log file, etc.

 If the task is not complex, please begin with small size of genome and expand it if desired during executions.

Do not forget to build the input/output set illustrating the task to be accomplished. If a fitness has been correctly coded, the solution generated should perform the wanted task. E.g, if your set of I/O examples only contain strings of lengths less than 9, the fitness ”reverse string” can give a program unable to reverse a string of length 11 (encountered
issue). Hence the importance of the presence of a tests set.

To start the GA with your fitness function, you call ```GeneticAlgorithms.runga(bfga, bfgaLengthString)```. GeneticAlgorithms will use the bfga module for program unit operations (mutations, crossover with an other program, etc.) and bfgaLengthString for the fitness function.

### Change unit operations
To change unit operations, you can copy (or not) bfga.jl and change the body of functions that interest you.

### Run Tests
Finally, you can write a test file in the test/ folder to check the partial correctness of the returned program. In those given in this repository, the format is runtestLengthString.

## Results

The algorithm has been successful in producing programs for several functions:

For the display of  "hi":
```
+++++++++++++[++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[+--++++++++.------]]

performed in 99 s with 79 iterations
```

For the display of  "Hi!":
```
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[.++++++++++[+++++++++++++++++++++++.->++++++++++]+++++.[>]>]

in 165 s, 42 iterations
```
These two programs are not very optimized because SSA explores a lot the neighbourhood of its refSet to find a new trial program. So he found that adding'+' or a'-' was the fastest way to get closer to the target ("hi" or "Hi!").

Logical XOR :
```
,+->,[<[,.][[>>]]>..>][+[>[<<[>-]]]]<.

in 124 s with 165 iterations

```

Program to reverse any string :
```
+[>,],++<[[<[-+>.<[.<],<-+>.]+][,<><<+]]

in 362 s, 383 iterations

also

-,[-+>,]<.<+-[.+-+-++<]
in  181 s, with 222 iterations
```