text:
RegiSAPIP
===================

Repositori ini digunakan untuk melakukan pengumpulan data peserta SPIP sesuai dengan template output peserta SA-SPIP untuk nantinya diimpor pada aplikasi SA-SPIP BPKP.

Installation
-------------------
>I am assuming that you know how to: install and use Composer, and install additional packages/drivers that may be needed for you to run everything on your system. In case you are new to all of this, you can check my guides for installing default yii2 application templates, provided by yii2 developers, on Windows 8 and Ubuntu based Linux operating systems, posted on www.freetuts.org.

1. Create database that you are going to use for your application (you can use phpMyAdmin or any other tool that you like).

2. Now open up your console and ```cd``` to your web root directory, for example: ``` cd /var/www/html/ ```

3. Run the Composer ```create-project``` command:

   ``` composer create-project hoaaah/regisapip ```

4. Now you need to tell your application to use database that you have previously created.
Open up db.php config file in ```regisapip/_protected/config/db.php``` and adjust your connection credentials.

5. Back to the console. Inside your newly installed application, ```cd``` to the ```_protected``` folder.

7. Execute yii migration command that will install necessary database tables:

   ``` ./yii migrate ``` or if you are on Windows ``` yii migrate ```

8. Execute _rbac_ controller _init_ action that will populate our rbac tables with default roles and
permissions:

   ``` ./yii rbac/init ``` or if you are on Windows ``` yii rbac/init ```

You are done, you can start your application in your browser.

> Note: Ubah konfigurasi wilayah, tahun, dan nama-nama unit peserta sesuai dengan daerah masing-masing.

```php
<?php

return [
    // ....
    'dinilai' => 'Kabupaten Simulasi',
    'tahun' => 2018,
    'unit' => [
        1 => "Inspektorat",
        2 => "Badan Kepegawaian dan Pengembangan SDM",
        3 => "Badan Pengelola Keuangan ",
        4 => "Badan Perencanaan Pembangunan Daerah",
        5 => "Dinas Pekerjaan Umum dan Penataan Ruang",
        6 => "Dinas Kesehatan",
        7 => "Dinas Komunikasi dan Informatika",
        8 => "Dinas Penanaman Modal dan Perizinan",
        9 => "Dinas Pertanian",
        10 => "Dinas Pendidikan",
        11 => "Sekretariat Daerah"
    ]

    //......
];
```

Testing
-------------------

If you want to run tests you should create additional database that will be used to store
your testing data. Usually testing database will have the same structure like the production one.
I am assuming that you have Codeception installed globally, and that you know how to use it.
Here is how you can set up everything easily:

1. Let's say that you have created database called ```regisapip```. Go create the testing one called ```regisapip_tests```.

2. Inside your ```db.php``` config file change database you are going to use to ```regisapip_tests```.

3. Open up your console and ```cd``` to the ```_protected``` folder of your application.

4. Run the migrations again: ``` ./yii migrate ``` or if you are on Windows ```yii migrate```

5. Run rbac/init again: ``` ./yii rbac/init ``` or if you are on Windows ```yii rbac/init```

6. Now you can tell your application to use your ```regisapip``` database again instead of ```regisapip_tests```.
Adjust your ```db.php``` config file again.

7. Now you are ready to tell Codeception to use ```regisapip_tests``` database.

   Inside: ``` _protected/tests/codeception/config/config.php ``` file tell your ```db``` to use
```regisapip_tests``` database.

8. Start your php server inside the root of your application: ``` php -S localhost:8080 ```
(if the name of your application is regisapip_, then root is ```regisapip``` folder)

9. Move to ```_protected/tests``` , run ```codecept build``` and then run your tests.

Directory structure
-------------------

```
_protected
    assets/              contains assets definition
    components/          contains custom made application components
    config/              contains application configurations
    console              contains console commands (controllers and migrations)
    controllers/         contains Web controller classes
    helpers/             contains helper classes
    mail/                contains view files for e-mails
    models/              contains model classes
    rbac/                contains role based access control classes
    runtime/             contains files generated during runtime
    tests/               contains various tests for the regisapip application
    translations/        contains application translations
    views/               contains view files for the Web application
    widgets/             contains widgets
assets                   contains application assets generated during runtime
themes                   contains your themes
uploads                  contains various files that can be uploaded by application users
```

repository: hoaaah/regisapip

repo_name: hoaaah/regisapip


text:
---
id: 1357
title: Takeaway Materials From PharmaSUG SDE, Cary, NC
date: 2014-09-29T21:59:02+00:00
author: Jiangtang Hu
layout: post
guid: http://www.jiangtanghu.com/blog/?p=1357
permalink: /2014/09/29/takeaway-materials-from-pharmasug-sde-cary-nc/
categories:
  - CDISC
  - SAS
tags:
  - CDISC
  - SAS
---
It’s the first PharmaSUG event I ever attended and it’s great and I plan to submit a paper for PharmaSUG 2015.

Honors belonged to Mike Molter and Lex Jansen for their hardcore talks on XML and CDISC Dataset-XML respectively. Dataset-XML is basically ODM based replacement of currently wildly used SAS Version 5 Transport File. It’s an emerging technology and it’s nice to check it out:

> CDISC Dataset-XML Resources @CDISC
>
> Support for Dataset-XML v1.0 @SAS

license: MIT

repository: rbind/jiangtang

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: rbind/jiangtang


text:
# Spring Cloud Eureka Server Getting Started

Eureka Server holds the information about all client-service applications, which is applications' port and IP address. Every application registers int the Eureka server.

## Description
### Dependency
- spring-cloud-starter-netflix-eureka-server

### Related Repository

- https://github.com/shinyay/spring-cloud-getting-started
- https://github.com/shinyay/spring-cloud-gateway-gs
- https://github.com/shinyay/spring-cloud-loadbalancer-gs
- https://github.com/shinyay/spring-cloud-config-gs
- https://github.com/shinyay/spring-cloud-config-client-gs

### Enable Spring Cloud Eureka Server
```kotlin
@SpringBootApplication
@EnableEurekaServer
class SpringCloudEurekaServerGsApplication
```

### Eureka Configuration

- eureka.client
  - `register-with-eureka`
    - Flag for registering its self to Eureka
  - `fetch-registry`
    - Flaf for fetching the Eureka registry

|property|value|
|--------|-----|
|service-url.defaultZone|http://localhost:${server.port}/eureka|
|register-with-eureka|false|
|fetch-registry|false|

## Demo

## Features

- feature:1
- feature:2

## Requirement

## Usage

## Installation

## Licence

Released under the [MIT license](https://gist.githubusercontent.com/shinyay/56e54ee4c0e22db8211e05e70a63247e/raw/34c6fdd50d54aa8e23560c296424aeb61599aa71/LICENSE)

## Author

[shinyay](https://github.com/shinyay)

repository: shinyay/spring-cloud-eureka-server-gs

repo_name: shinyay/spring-cloud-eureka-server-gs


text:
Converts value to a string. An empty string is returned for undefined values. The sign of `-0` is preserved.

## Arguments
value (*): The value to convert.

## Returns
(boolean): Returns the converted string.


text:
<properties
	pageTitle="Log on to a Linux VM in Azure | Microsoft Azure"
	description="Learn how to log on to an Azure virtual machine running Linux by using a Secure Shell (SSH) client."
	services="virtual-machines"
	documentationCenter=""
	authors="squillace"
	manager="timlt"
	editor=""
	tags="azure-service-management"/>

<tags
	ms.service="virtual-machines"
	ms.workload="infrastructure-services"
	ms.tgt_pltfrm="vm-linux"
	ms.devlang="na"
	ms.topic="article"
	ms.date="12/08/2015"
	ms.author="rasquill"/>

#How to Log on to a Virtual Machine Running Linux #

> [AZURE.IMPORTANT] Azure has two different deployment models for creating and working with resources:  [Resource Manager and classic](../resource-manager-deployment-model.md).  This article covers using the classic deployment model. Microsoft recommends that most new deployments use the [Resource Manager deployment model](virtual-machines-linux-tutorial-portal-rm.md).

You'll need to install an SSH client on the computer you want to use to log on to the virtual machine. There are many SSH client programs that you can choose from. The following are possible choices:

- On a computer running a Windows operating system, you might want to use an SSH client such as PuTTY. For more information, see the [PuTTY Download Page](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html).
- For a virtual machine running a Linux operating system, you use a Secure Shell (SSH) client to log on; it is hard to think of a distribution that doesn't already have this installed by default. See [How to use SSH](virtual-machines-linux-use-ssh-key.md) for a bit more information about Linux.

>[AZURE.NOTE] For more requirements and troubleshooting tips, see [Connect to an Azure virtual machine with RDP or SSH](http://go.microsoft.com/fwlink/p/?LinkId=398294).

This procedure shows you how to use the PuTTY program to access the virtual machine.

1. Find the **Host Name** and **Port information** from the [Management Portal](http://manage.windowsazure.com). You can find the information that you need from the dashboard of the virtual machine. Click the virtual machine name and look for the **SSH Details** in the **Quick Glance** section of the dashboard.

	![Obtain SSH details](./media/virtual-machines-linux-how-to-log-on/sshdetails.png)

2. Open the PuTTY program.

3. Enter the Host Name and the Port information that you collected from the dashboard, and then click **Open**.

	![Open PuTTY](./media/virtual-machines-linux-how-to-log-on/putty.png)

4. Log on to the virtual machine using the account that you specified when the machine was created. For more details on how to create a virtual machine with user name and password, see [Create a Virtual Machine Running Linux](virtual-machines-linux-tutorial.md).

	![Log on to the virtual machine](./media/virtual-machines-linux-how-to-log-on/sshlogin.png)

>[AZURE.NOTE] The VMAccess extension can help you reset the SSH key or password if you've forgotten it. If you've forgotten the user name, you can use the extension to create a new one with sudo authority. For instructions, see the [How to Reset a Password or SSH for Linux Virtual Machines].

You can now work with the virtual machine just as you would with any other server.

<!-- LINKS -->
[How to Reset a Password or SSH for Linux Virtual Machines]: http://go.microsoft.com/fwlink/p/?LinkId=512138

repository: wacncontent/MooncakePortal

repo_name: wacncontent/MooncakePortal


text:
# EnumTools

[![Build Status](https://travis-ci.org/dn-m/EnumTools.svg?branch=master)](https://travis-ci.org/dn-m/EnumTools)

Tools for Swift Enum

***

## Integration

### Carthage
Integrate **EnumTools** into your OSX or iOS project with [Carthage](https://github.com/Carthage/Carthage).

1. Follow [these instructions](https://github.com/Carthage/Carthage#installing-carthage) to install Carthage, if necessary.
2. Add `github "dn-m/EnumTools"` to your [Cartfile](https://github.com/Carthage/Carthage/blob/master/Documentation/Artifacts.md#cartfile)
3. Follow [these instructions](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application) to integrate **EnumTools** into your OSX or iOS project.

***

## Usage

The implementation of this is from [here](http://stackoverflow.com/a/28341290).

```Swift
enum TestEnum { case A, B, C }
```

```Swift
var allEnums: [TestEnum] = []
for e in iterateEnum(TestEnum) { allEnums.append(e) }
// [.A, .B, .C]
```

repository: ThePowerOfSwift/Archive

repo_name: ThePowerOfSwift/Archive


text:
# FireEye Red Team Exploit + Sunburst Exploit Scanner
Powershell script to automate deployment of Yara to scan files for FireEye Exploit and Sunburst Exploit by supplying urls for appropiate Yara rules.

## CREDITS
Credit to VirusTotal for their yara scan tool:
* https://github.com/VirusTotal/yara

Credit to FireEye for their yara rules files:
* https://github.com/fireeye/red_team_tool_countermeasures
* https://github.com/fireeye/sunburst_countermeasures

Credit to Datto and Seagull for inspiration:
* https://github.com/datto/fireeye-red-team-countermeasure-scanner

## ABOUT
This is a powershell script that can be run locally on any device running Windows OS with Powershell to scan processes or files against supplied download urls of FireEye's Red Team Exploit and Sunburst yara rules.

It can also be used to match any Yara rules.

Matches may not necessarily mean the file is an actual exploit or that you are at risk. Always ensure you have the latest AV and EDR signatures and that you have proper security measures in place.

The script will log the script actions to a log file specified in the variable **$Script:POpsLogFile**.
The script will gather the results from all files scanned with Yara and output to a csv file located in the folder that is specified in the variable **$Script:DestinationFolder**

The only function you need to specify parameters for is **"Invoke-POpsYaraScan"** function, called at the bottom of the script.

## SCRIPT VARIABLES
The script itself doesn't have any parameters, instead, there are functions within the script that are called with pre-defined parameters.

You will also need to define **$Script variables** between lines **1040 - 1060**.

If using with an RMM, set up RMM input and output variables to map to the following script variables:

**Input variables**
* $InScanLevel
* $InFileType

**Output variables**
* $OutExploitFound
* $OutLogFolder

### $InScanLevel (1 | 2 | 3 | 4)
Default should be 1 if using as a RMM monitor.

If you would like to scan entire drive, then run it as an RMM task instead of a monitor to prevent execution timeouts.

* 1: Scans currently running processes - takes about 10 minutes
* 2: Scans home drive
* 3: Scans all fixed drives
* 4: Scans all accessible drives

### $InFileType (1 | 2)
Default is 1.
* 1: Scan only exe files - default if $InScanLevel = 1
* 2: Scan exe and dll files

## REQUIREMENTS
Yara requires VC++, if yara doesn't run AND VC++ is missing, the script will auto download and install VC++ 2015-2019 bundle and will attempt to download first from Microsoft. You can provide fall back urls for download in the following script variables:
* $Script:POpsVCx64Url
* $Script:POpsVCx86Url

The script has only been tested with Powershell on Windows 7 and up and Windows Server 2008 R2 and up.

You will need to grab the latest Yara64.exe and Yara32.exe from the win zip files hosted here:
https://github.com/VirusTotal/yara/releases/

You will need extract the yara32.exe and yara64.exe from each respective zip.
You will only need these yara files (you do not need the "yarac32.exe" nor "yarac64.exe"):
* yara64.exe
* yara32.exe

Then, host/upload the yara64.exe and yara32.exe files somewhere safe and secure that allows https download. Highly recommend a secure cloud object storage for this. Do not upload to consumer cloud drives as they will limit the amount of traffic and downloads.

Keep note of the download urls for both the yara64.exe, and yara32.exe as you will have to provide the urls as parameter values for the **"Invoke-POpsYaraScan"** function, called at the bottom of the script.

## USAGE
After you have edited the **Invoke-POPsYaraExploitScan.ps1** file with the appropiate script variables and setting the splat parameters at the bottom of the script:

    .\Invoke-POPsYaraExploitScan.ps1

## SCAN RESULTS CSV OUTPUT
![CSV OUTPUT](Yara_Exploit_CSV_Output.PNG)

## SCRIPT LOG
```
2020-12-25 15:44:50.254 [VERBOSE]: OS Bitness architecture is [64]
2020-12-25 15:44:50.264 [VERBOSE]: Getting Yara rules
2020-12-25 15:44:50.276 [VERBOSE]: Downloading file from url [https://raw.githubusercontent.com/fireeye/red_team_tool_countermeasures/master/all-yara.yar]
2020-12-25 15:44:50.389 [VERBOSE]: File downloaded successfully to: [C:\Yara_Scanner\yararule_1.yar]
2020-12-25 15:44:50.399 [VERBOSE]: Unblocking file: [C:\Yara_Scanner\yararule_1.yar]
2020-12-25 15:44:50.410 [VERBOSE]: Downloading file from url [https://raw.githubusercontent.com/fireeye/sunburst_countermeasures/main/all-yara.yar]
2020-12-25 15:44:50.515 [VERBOSE]: File downloaded successfully to: [C:\Yara_Scanner\yararule_2.yar]
2020-12-25 15:44:50.525 [VERBOSE]: Unblocking file: [C:\Yara_Scanner\yararule_2.yar]
2020-12-25 15:44:50.536 [VERBOSE]: Scan scope set to [1]
2020-12-25 15:44:50.546 [VERBOSE]: Initializing Yara test run to ensure it can run on this system
2020-12-25 15:44:50.600 [OUTPUT]:

Output       : 4.0.2

Id           : 11276
ArgumentList : {-v}
Error        :
ProcessName  :
Name         :
StartTime    : 12/25/2020 3:44:50 PM
FilePath     : C:\Yara_Scanner\yara64.exe
ExitTime     : 12/25/2020 3:44:50 PM
ExitCode     : 0

2020-12-25 15:44:50.611 [VERBOSE]: Retrieving list of currently running processes
2020-12-25 15:44:51.977 [VERBOSE]: Scanning total of [44] files
2020-12-25 15:44:59.644 [VERBOSE]: No exploits found. Review yara log for scan details
2020-12-25 15:44:59.661 [VERBOSE]: Yara scan log exported to: [C:\Yara_Scanner\Logs\PCNAME_20201225-154459_yara_scan.csv]
```

repository: DanPhoaser/FireEyeExploitScanner

branch_name: refs/heads/main

repo_name: DanPhoaser/FireEyeExploitScanner


text:
My subclasses represent specific point of view on system environment.
I am managed by navigation environment to produce queries over system:

	scope := ClyNavigationEnvironment currentImage selectScope: ClyPackageScope of: {#Kernel asPackage}.

Or you can create me manually:

	scope := ClyClassScope of: env basis: { Object. Point }

I am always created within list of basis objects which restrict what could be retrieved from environment from my point of view. In previous example scope will allow to see only methods of Object or Point classes.

I provide query operation to retrieve specific environment content:

	scope query: ClySortedMethods.
	scope query: ClySortedMethodGroups

Argument of #query: message is instance of ClyEnvironmentQuery or compatible object (inside it is asked for #asEnvironmentQuery).
In example concrete class of requested content is used. But it could be direct instance of query like:

	scope query: (ClyAllItemsQuery requestedContent: ClySortedMethods).
	scope query: (ClyEnvironmentFilterQuery for: ClySortedMethods by: (ClyItemNameSubstringFilter pattern: 'test')).
	scope query: (ClyMessageSenders of: #do:).

There is most global scope where user can retrieve items. It is ClySystemScope. You can ask it from current image navigation environment:

	scope := ClyNavigationEnvironment currentImageScope.

And you can query it directly:

	ClyNavigationEnvironment queryCurrentImageFor: ClySortedPackages.

I also provide suitable methods to create modified scopes. For example to create similar scope with extra basis object or without it:

	scope withExtraBasisObject: Collection.
	scope withoutBasisObject: Point

Or you can ask me for another kind of scope but with same basis:

	classScope asScope: ClyClassSideScope.
	classScope asScope: ClyInstanceSideScope.

Look at queries protocol for more.

My subclasses should implement a couple of methods which used in double dispatch logic to call typed message according to my basis objects:

- buildContent: anEnvironmentContent

For example ClyPackageScope will ask content for:
	anEnvironmentContent buildFromPackages: basisObjects

- class side resolvePropertiesOf: anEnvironmentItem by: anEnvironmentPlugin

For example ClyClassScope will ask plugin for:
	anEnvironmentPlugin resolvePropertiesOfClass: anEnvironmentItem

I maintain weak cache of all executed queries. So any duplicated queries are performed fast and memory efficient.
This cache is a dictionary where keys are queries and values are result instances (anEnvironmentContent).

If my environment is attached to system I receive each system change to fix all my cached queries (method handleSystemChange:).

Public API and Key Messages

- query: anEnvironmentQueryOrEnvironmentContentClass
- withExtraBasisObject: anObject
- withoutBasisObject: anObject
- withCachedQueriesDo: aBlock

Internal Representation and Key Implementation Points.

    Instance Variables
	basisObjects:		<Array>
	environment:		<ClyNavigationEnvironment>
	queryCache:		<Dictionary of<EnvironmentQuery, EnvironmentContent>>

repository: estebanlm/Calypso

repo_name: estebanlm/Calypso


text:
# Serialization #

Torch provides 4 high-level methods to serialize/deserialize arbitrary Lua/Torch objects.
These functions are just abstractions over the [File](#torch.File) object, and were created
for convenience (these are very common routines).

The first two functions are useful to serialize/deserialize data to/from files:

  - `torch.save(filename, object [, format])`
  - `[object] torch.load(filename [, format])`

The next two functions are useful to serialize/deserialize data to/from strings:

  - `[str] torch.serialize(object)`
  - `[object] torch.deserialize(str)`

Serializing to files is useful to save arbitrary data structures, or share them with other people.
Serializing to strings is useful to store arbitrary data structures in databases, or 3rd party
software.

### torch.save(filename, object [, format]) ###

Writes `object` into a file named `filename`. The `format` can be set
to `ascii` or `binary` (default is binary). Binary format is platform
dependent, but typically more compact and faster to read/write. The ASCII
format is platform-independent, and should be used to share data structures
across platforms.

```
-- arbitrary object:
obj = {
   mat = torch.randn(10,10),
   name = '10',
   test = {
      entry = 1
   }
}

-- save to disk:
torch.save('test.dat', obj)
```

### [object] torch.load(filename [, format]) ###

Reads `object` from a file named `filename`. The `format` can be set
to `ascii` or `binary` (default is binary). Binary format is platform
dependent, but typically more compact and faster to read/write. The ASCII
format is platform-independent, and should be used to share data structures
across platforms.

```
-- given serialized object from section above, reload:
obj = torch.load('test.dat')

print(obj)
-- will print:
-- {[mat]  = DoubleTensor - size: 10x10
--  [name] = string : "10"
--  [test] = table - size: 0}
```

### [str] torch.serialize(object [, format]) ###

Serializes `object` into a string. The `format` can be set
to `ascii` or `binary` (default is binary). Binary format is platform
dependent, but typically more compact and faster to read/write. The ASCII
format is platform-independent, and should be used to share data structures
across platforms.

```
-- arbitrary object:
obj = {
   mat = torch.randn(10,10),
   name = '10',
   test = {
      entry = 1
   }
}

-- serialize:
str = torch.serialize(obj)
```

### [object] torch.deserialize(str [, format]) ###

Deserializes `object` from a string. The `format` can be set
to `ascii` or `binary` (default is binary). Binary format is platform
dependent, but typically more compact and faster to read/write. The ASCII
format is platform-independent, and should be used to share data structures
across platforms.

```
-- given serialized object from section above, deserialize:
obj = torch.deserialize(str)

print(obj)
-- will print:
-- {[mat]  = DoubleTensor - size: 10x10
--  [name] = string : "10"
--  [test] = table - size: 0}
```


text:
# Slice layout

Slice layouts are re-usable templates. A slice layout lays itself out according to a
set of self-defined rules. The slice layout also provides a suggested default
configuration that can be applied to the given components that are to be laid
out within the template - this configuration is provided in the form of CSS
class names and JS objects. The consumer of
slice layout can opt-in or out of utilising these suggested default configurations

## Contributing

Please read [CONTRIBUTING.md](./CONTRIBUTING.md) before contributing to this
package

## Running the code

Please see our main [README.md](../README.md) to get the project running locally

## Development

The code can be formatted and linted in accordance with the agreed standards.

```
yarn fmt
yarn lint
```

## Testing

This package uses [yarn](https://yarnpkg.com) (latest) to run unit tests with [jest](https://facebook.github.io/jest/).

```
yarn test:web
```

Visit the official
[storybook](http://components.thetimes.co.uk/?selectedKind=Primitives%2FSlice&selectedStory=Default%20template%20with%20one%20item&full=0&addons=1&stories=1&panelRight=0&addonPanel=storybooks%2Fstorybook-addon-knobs)
to see our available slice layout templates.

## Future

Template creation could be done using a CLI to create default files in the
accepted architectural format

repository: newsuk/times-components

gha_language: JavaScript

repo_name: newsuk/times-components


text:
# myems-cleaning
MyEMS Cleaning Service

MyEMS 数据清洗服务

### Introduction

This service is a component of MyEMS and it cleans the historical data.

### Prerequisites

mysql.connector

### Installation

Download and install MySQL Connector:
```bash
cd ~/tools
wget https://dev.mysql.com/get/Downloads/Connector-Python/mysql-connector-python-8.0.20.tar.gz
tar xzf mysql-connector-python-8.0.20.tar.gz
cd ~/tools/mysql-connector-python-8.0.20
sudo python3 setup.py install
```

Install myems-cleaning service
```bash
cd ~
git clone https://github.com/MyEMS/myems.git
cd myems
sudo git checkout master (or the latest release tag)
sudo cp -R ~/myems/myems-cleaning /myems-cleaning
```
Open config file and edit database configuration
```bash
sudo nano /myems-cleaning/config.py
```
Setup systemd service:
```bash
sudo cp myems-cleaning.service /lib/systemd/system/
```
Enable the service:
```bash
sudo systemctl enable myems-cleaning.service
```
Start the service:
```bash
sudo systemctl start myems-cleaning.service
```
Monitor the service:
```bash
sudo systemctl status myems-cleaning.service
```
View the log:
```bash
cat /myems-cleaning.log
```

### References

1.  https://myems.io
2.  https://dev.mysql.com/doc/connector-python/en/

repository: winnerineast/myems

gha_language: Python

gha_license_id: MIT

repo_name: winnerineast/myems


text:
# standards #

Project and python specific standards that have been chosen and not otherwise
explicitly recommended.

## project layout ##

This project loosely follows the conventions established by the most popular
open source project for bootstrapping a new django project, to provide a
reasonable layout and structure.

See [cookiecutter-django](https://github.com/pydanny/cookiecutter-django) for
reference.

## best practices ##

Where possible, follow established best practices.  See:

  1. [django-best-practices](https://wsvincent.com/django-best-practices/)

## test-driven software development ##

Generally use [Robert Martin's](https://en.wikipedia.org/wiki/Robert_C._Martin) [three laws of TDD](https://www.youtube.com/watch?v=qkblc5WRn-U):

  1. Only write enough of a unit test to fail.
  2. Only write production code to make a failing unit test pass.

## dependencies ##

Where possible, minimize the number of package dependencies used to get the job
done.  If it's a complex task and someone else has an appropriately licensed
solution which is carefully maintained and largely established, then it's
a good idea.

repository: lakesite/django-prospect

repo_name: lakesite/django-prospect


text:
# Steps in creating a REST services client

The REST Services client code relies on the FluentForms library for a lot of its functionality.  This document assumes that whatever service is
being implemented already has a corresponding FluentForms interface implemented in that library.

There are three parts to any implementation of a service:
* `rest-services.server` - This is the server side implementation.  It consists of a Sling servlet per service method.  That servlet accepts
    parameters that represent the method's arguments and turns those parameters into the corresponding Java object before calling the service
    method.  It returns the results of calling the service as a response to the servlet call.
* `rest-services.client` - This is the client side of the implementation.  It turns calls to FluentForms service methods into a REST call to `rest-services.server` servlets.  It converts service arguments to servlet parameters before calling the servlet.  It turns the response from
    the servlet into Java objects that are returned from the method call.
* `rest-services.it.test` - This is a set of integration tests that make use of a running AEM server that has `fluentforms` and `rest-services.server`
    bundles installed on them.  There are test for both the `rest-services.server` code and the `rest-services.client`/`rest-services.client` code operating together.

The steps involved in implementing a new service in the REST Services codebase is as follows:

### 1. Create the servlet code in the rest-services.server project
1. Create a new package for this service (with the same name the service uses in fluentforms)
1. Create a servlet for each method in the service.  The servlet accepts the method's parameters and makes a call to AEM via the fluentforms library.  it
     returns the result from AEM in the response.

### 2. Create the ServiceAdapter in the rest-services.client project
1. Create a new package for this service (with the same name the service uses in fluentforms)
1. Create a `RestServicesWhateverServiceAdapter` class that implements `TraditionalWhateverService` interface.  This piece used JAX-RS HTTP client
     to create a multipart/forms-data POST to the servlet created in step 1.

### 3. Create integration tests in the rest-services.it.tests project
1. Create two new packages for this service (with the same name the service uses in fluentforms) under the src/test/java.
     One package should be under client.whatever and the other under server.whatever
1. Create tests under `server.whatever` that test the service on the AEM server by calling the servlet directly.  This ensures that a client
     does not need to necessarily use the client libraries but can initiate the REST calls directly from their code if they wish.
1. Create tests under client.whatever that test the service on the AEM server by calling the servlet via the `rest-services.client` library.  This
     ensures that the client/server/aem combination works as expected.

This guide does not specifically talk about the creation of unit tests, but this is assumed to be part of "being done".  When the guide discusses creation of classes, the
creation of unit tests that test those classes is assumed.

gha_language: Java


text:
---
morea_id: reading-textbook-31-33
morea_type: reading
title: "Text: 3.1 and 3.3"
published: True
morea_summary: "Stacks"
morea_start_date: "2016-10-10"
morea_labels:
  - "Textbook"
  - "Exercises"
---

Read Sections 3.1 and 3.3 of
[Data Structures, Abstraction and Design using Java](http://www.wiley.com/WileyCDA/WileyTitle/productCd-EHEP001607.html).

**Chapter 3.**

1. **Stack Abstract Datatype**
2. Stack Application
3. **Implementing a Stack**
4. Additional Stack Applications

Be able to answer the self-check questions at the end of each section.

repository: cammoore/MoreaNextSemester

repo_name: cammoore/MoreaNextSemester


text:
## Rewriting history

#### Intro

This tutorial will cover various methods of rewriting and altering Git history. Git uses a few different methods to record changes. We will discuss the strengths and weaknesses of the different methods and give examples of how to work with them. This tutorial discusses some of the most common reasons for overwriting committed snapshots and shows you how to avoid the pitfalls of doing so.

Git's main job is to make sure you never lose a committed change. But it's also designed to give you total control over your development workflow. This includes letting you define exactly what your project history looks like; however, it also creates the potential of losing commits. Git provides its history-rewriting commands under the disclaimer that using them may result in lost content.

Git has several mechanisms for storing history and saving changes. These mechanisms include: `commit --amend`, `git rebase` and `git reflog`. These options give you powerful work flow customization options. By the end of this tutorial, you'll be familiar with commands that will let you restructure your Git commits, and be able to avoid pitfalls that are commonly encountered when rewriting history.

 It lets you combine staged changes with the previous commit instead of creating an entirely new commit. It can also be used to simply edit the previous commit message without changing its snapshot. But, amending does not just alter the most recent commit, it replaces it entirely, meaning the amended commit will be a new entity with its own ref. To Git, it will look like a brand new commit, which is visualized with an asterisk (`*`) in the diagram below.  We'll cover usage examples in the following sections.

![](rewriting-history-01.png)

![](rewriting-history-02.png)

##### Change most recent Git commit message

```
git commit --amend
```

Let's say you just committed and you made a mistake in your commit log message. Running this command when there is nothing staged lets you edit the previous commit’s message without altering its snapshot.

Premature commits happen all the time in the course of your everyday development. It’s easy to forget to stage a file or to format your commit message the wrong way. The `--amend` flag is a convenient way to fix these minor mistakes.

```
git commit --amend -m "an updated commit message"
```

Adding the `-m` option allows you to pass in a new message from the command line without being prompted to open an editor.

##### Changing committed files

The following example demonstrates a common scenario in Git-based development. Let's say we've edited a few files that we would like to commit in a single snapshot, but then we forget to add one of the files the first time around. Fixing the error is simply a matter of staging the other file and committing with the `--amend` flag:

```
# Edit hello.py and main.py git add hello.py git commit
# Realize you forgot to add the changes from main.py git add main.py
git commit --amend --no-edit
```

The `--no-edit` flag will allow you to make the amendment to your commit without changing its commit message. The resulting commit will replace the incomplete one, and it will look like we committed the changes to `hello.py` and `main.py` in a single snapshot.

##### Don’t amend public commits

Amended commits are actually entirely new commits and the previous commit will no longer be on your current branch. This has the same consequences as resetting a public snapshot. Avoid amending a commit that other developers have based their work on. This is a confusing situation for developers to be in and it’s complicated to recover from.

##### Recap

To review, `git commit --amend` lets you take the most recent commit and add new staged changes to it. You can add or remove changes from the Git staging area to apply with a `--amend` commit. If there are no changes staged, a `--amend` will still prompt you to modify the last commit message log. Be cautious when using `--amend` on commits shared with other team members. Amending a commit that is shared with another user will potentially require confusing and lengthy merge conflict resolutions.

#### Changing older or multiple commits

To modify older or multiple commits, you can use `git rebase` to combine a sequence of commits into a new base commit. In standard mode, `git rebase` allows you to literally rewrite history — automatically applying commits in your current working branch to the passed branch head. Since your new commits will be replacing the old, it's important to not use `git rebase` on commits that have been pushed public, or it will appear that your project history disappeared.

In these or similar instances where it's important to preserve a clean project history, adding the `-i` option to `git rebase` allows you to run `rebase interactive`. This gives you the opportunity to alter individual commits in the process, rather than moving all commits. You can learn more about interactive rebasing and additional rebase commands on the [git rebase](#git-rebase) page.

 These messages provide valuable insight into the project history. During a rebase, you can run a few commands on commits to modify commit messages.
- Reword or 'r' will stop rebase playback and let you rewrite the individual commit message during.
- Squash or 's' during rebase playback, any commits marked s will be paused on and you will be prompted to edit the separate commit messages into a combined message. More on this in the squash commits section below.
- Fixup or 'f' has the same combining effect as squash. Unlike squash, fixup commits will not interrupt rebase playback to open an editor to combine commit messages. The commits marked 'f' will have their messages discarded in-favor of the previous commit's message.

##### Squash commits for a clean history

The s "squash" command is where we see the true utility of rebase. Squash allows you to specify which commits you want to merge into the previous commits. This is what enables a "clean history." During rebase playback, Git will execute the specified rebase command for each commit. In the case of squash commits, Git will open your configured text editor and prompt to combine the specified commit messages. This entire process can be visualized as follows:

![](rewriting-history-03.png)

Note that the commits modified with a rebase command have a different ID than either of the original commits. Commits marked with pick will have a new ID if the previous commits have been rewritten.

Modern Git hosting solutions like Bitbucket now offer "auto squashing" features upon merge. These features will automatically rebase and squash a branch's commits for you when utilizing the hosted solutions UI. For more info see "[Squash commits when merging a Git branch with Bitbucket](https://bitbucket.org/blog/git-squash-commits-merging-bitbucket)."

 This creates the freedom to make and correct errors and refine your work, while still maintaining a clean, linear project history.

#### The safety net: git reflog

Reference logs, or "reflogs" are a mechanism Git uses to record updates applied to tips of branches and other commit references. Reflog allows you to go back to commits even though they are not referenced by any branch or tag. After rewriting history, the reflog contains information about the old state of branches and allows you to go back to that state if necessary. Every time your branch tip is updated for any reason (by switching branches, pulling in new changes, rewriting history or simply by adding new commits), a new entry will be added to the reflog. In this section we will take a high level look at the git reflog command and explore some common uses.

##### Usage

````
git reflog
````

This displays the reflog for the local repository.

````
git reflog --relative-date
````

This shows the reflog with relative date information (e.g. 2 weeks ago).

##### Example

To understand git reflog, let's run through an example.

```
0a2e358 HEAD@{0}: reset: moving to HEAD~2
0254ea7 HEAD@{1}: checkout: moving from 2.2 to master
c10f740 HEAD@{2}: checkout: moving from master to 2.2
```

The reflog above shows a checkout from master to the 2.2 branch and back. From there, there's a hard reset to an older commit. The latest activity is represented at the top labeled `HEAD@{0}`.

 This provides a safety net in case the history was accidentally changed.

It's important to note that the reflog only provides a safety net if changes have been committed to your local repository and that it only tracks movements of the repositories branch tip. Additionally reflog entries have an expiration date. The default expiration time for reflog entries is 90 days.

For additional information, see our [git reflog](#git-reflog) page.

#### Summary

In this article we discussed several methods of changing git history, and undoing git changes. We took a high level look at the git rebase process. Some Key takeaways are:
- There are many ways to rewrite history with git.
- Use `git commit --amend` to change your latest log message.
- Use `git commit --amend` to make modifications to the most recent commit.
- Use `git rebase` to combine commits and modify history of a branch.
- `git rebase -i` gives much more fine grained control over history modifications than a standard git rebase.

Learn more about the commands we covered at their individual pages:
- [git rebase](#git-rebase)
- [git reflog](#git-reflog)

repository: igorbotian/atlassian-git-tutorials

repo_name: igorbotian/atlassian-git-tutorials


text:
# mas-password-generator

Client request was to create a mini application that will generate a random password between 8 and 128 characters. Users must have a choice to include different elements in their password including lowercase letters, upercase letters, numbers and special characters. Once these choices are made the final password must output onto the screen.

![password-generator-clip](./Assets/password-generator-clip.PNG)

## Instructions

1. The user must click the generate password button.
2. The user will be prompted with a choice of password length. They must choose between 8 and 128 or the program will restart.
3. The user must confirm that they want to use certain classes of characters. lowercase, uppercase, numbers, special characters. If they do not choose any the generator will ask them to start over.
4. Once appropriate choices have been made the program will present a password to the user in the box above the generate password button.
## Built With

* [VSCode](https://code.visualstudio.com/) - Code editing software
* [GitBash](https://gitforwindows.org/) - Command line interface

## Lessons Learned

THis project was chalanging. I wavered between lows of not knowing what to do next to highs of Eureka! I fanally figured it out! This is the first time I've ever gotten a JS to actually do something practical and interact with and HTML document.

## Authors

* **Mitch Schimmoeller** - *Programmer* - [Schimmoellerm](https://github.com/Schimmoellerm)

## Acknowledgments

* The OSU coding boot camp, its Instructor and TAs who fielded questions regarding this assignment.
* My fellow classmates for providing thoughts and ideas on how to get the JS code working how I needed it to.

repository: Schimmoellerm/mas-password-generator

repo_name: Schimmoellerm/mas-password-generator


text:
# Landstrasse

> Strongly typed (TypeScript) [WAMP](https://wamp-proto.org/) Client for browsers.

## Install

```bash
# - NPM
$ npm install landstrasse

# - Yarn
$ yarn add landstrasse
```

## Features

- Configurable "failover" / auto-reconnection support.
- Progress support for calls.
- Call cancellation support.
- Pub / Sub support.
- RPC support.

## Getting started

Before using this lib, you should have a working WAMP Router to which this lib. will be connected.
Please follow the official [Crossbar.io guide](https://crossbar.io/docs/Getting-Started/) if you haven't one.

Please also note that this lib has been designed to be as small as possible, without dependencies and is intended to be used in a browser context.
Your target environnement should have `WebSocket` and `Promise` globals API available.

This lib must be used in a bundled context (Webpack, etc.) thanks to which you will be able to benefit from Tree Shaking
and the possibility to import only what you need (Auth, Serializer).

Once this is done, all you need to do is:

```js
import Landstrasse from 'landstrasse';

const webSocket = new Landstrasse('ws://localhost:3000', 'my-realm');
await webSocket.open();

//
// - Subscription
//

const mySubscription = await webSocket.subscribe('my.notification', ([message]) => {
    console.log('New notification received', message);
});
// -> mySubscription.id - Contain the unique subscription id.
// -> myRegistration.uri - The subscribed URI (same as the first param passed above).
// -> mySubscription.unsubscribe(); - Allow to cancel the subscription afterwards.

//
// - Call
//

const [myCallPromise, myCallCancel] = webSocket.call('my.log', null, { type: 'error', message: 'A log message' });
// -> myCallPromise - Contains the promise that will be resolved when the call will have been performed.
// -> myCallCancel(); - For cancelling the call while in progress.
const myCallResult = await myCallPromise;

//
// - Registration
//

const myRegistration = await webSocket.register('my.refresh', () => {
    window.location.reload();
});
// -> myRegistration.id - Contain the unique registration id.
// -> myRegistration.uri - The registration URI (same as the first param passed above).
// -> myRegistration.unregister(); - Allow to cancel the registration afterwards.

//
// - Publication
//

const myPublicationId = await webSocket.publish('my.chat.message', ['Hello :)'], { acknowledge: true });
// - If `published` is called with the `acknowledge` option, the promise will be resolved when
//   the router will hav received the publication and you will have access to the publication id.

await webSocket.publish('my.chat.message', ['Hello :)']);
// - If the `acknowledge` option is not used, the `publish` method will resolve the promise without
//   waiting for the router to return (so you won't have access to the publication id)
```

*__Note:__ In a real app it would be necessary to manage the cases where the calls
return an error via a try / catch for example.*

## Acknowledgment

This lib started as a fork of [kraftfahrstrasse](https://github.com/verkehrsministerium/kraftfahrstrasse), but removed the Node support which was voluntarily not desirable
and added new features (e.g. failover) and a redesign of the API.


text:
this calculation run using :
- cyclus branch: develop -- commit e94a5a3b10131d39c88e77a21dfc36074b0d29d6

- cycamore fork: https://github.com/jlittell/cycamore.git -- branch:cleanstore -- commit bc2eade822fce9f51464324b607ab4227bc7150a

the Output.xlsm file have been filled using the CYCLUS2FCO tool:
- https://github.com/Baaaaam/CYCLUS2FCO, branch: master -- commit 4ab084587538af7b2bad4bf7da05bba3b7610748

the present simulation includes :

Bo-Feng - ANL - EG23 deployement schedule for all reactors.
the lifetime of each reactor have been set to 80y.

Separation of the LWR fuel are made in a commun facility (R.Carlsen number https://github.com/rwcarlsen/eg23-sim), 3 are deployed : 2 in 2030, 1 in 2040.

Separation for FBR are greedy... (throughput 5e6, Pu output buffer 5e6 so about 1000 batch of MOX)

SFR fuel Fabrication are not gready : 1 fab for 10 SFR reactor deployement schedule, the internal parameters allow a little bit more than 10 MOX batch/y

The main difference between SFR & LWR is the 2 SFR type (A or B) did not share the same FAB and SEPARATION, when the LWR do.

each fuel type (UOX-A/B and SFR-A/B) have they own dedicated cooling storage (7y) and storage.

I have try to put all communs archetypes and recipes in the recycle.xml file, and each reactor type dedicaced ones in the other xml file...

this version is suppose to improve 2015_LWR-group-SEP_SFR-Dedi-SEP version, include a dedicated storage for Recyled Uranium and depleted uranium..


text:
---
title: '[CQRS Journey] Journey 4 : Extending and Enhancing the Orders and Registrations Bounded Context'
layout: post
categories: cqrs
---

## Changes to the bounded context
- topics
  - Improvements to the way message correlation works with the RegistrationProcessManager class
  - Implementing a record locator to enable a registrant to retrieve an order that she saved during a previous session
  - Adding a countdown timer to the UI to enable a registrant to track how much longer they have to complete an order
  - Supporting orders for multiple seat types simultaneously
  - CQRS command validation

#### Working definitions for this chapter
- Command
  - A request for the system to perform an action that changes the state of the system
  - A single recipient processes a command
  - Sending a command is an asynchronous operation with no return value.
- Event
  - Event describes something that has happened in the system, typically as a result of a command
  - Multiple subscribers can handle a specific event
- Process manager
  - Process manager coordinates the behavior of the aggregates in the domain
  - The process manager does not contain any business logic, only logic to determine the next command to send

#### User stories
- Implement a login using a record locator
- Tell the registrant how much time remains to complete an order
- Enable a registrant to create an order that includes multiple seat types

#### Architecture
![](/asset/images/cqrs/journey4_01.PNG)

## Patterns and concepts

#### Record locators
The system needs to be able to retrieve order information quickly based on the registrant’s email address and access code

#### Querying the read side
To minimize the work that the queries on the read side must perform, these SQL views provide a denormalized version of the data

###### Storing denormalized views in a database
![](/asset/images/cqrs/journey4_02.PNG)

###### implementing the ViewRepository class
- Using the IQueryable interface
```cs
var ordersummary = repository.Query<OrderSummary>().Where(LINQ query to retrieve order summary);
var orderdetails = repository.Query<OrderDetails>().Where(LINQ query to retrieve order details);
```
  - Simplicity
    - This approach uses a thin abstraction layer over the underlying database
  - Testability
    - You can use LINQ to Objects for mocking
- Using non-generic DAOs
```cs
var ordersummary = dao.FindAllSummarizedOrders(userId);
var orderdetails = dao.GetOrderDetails(orderId);
var ordersummary = OrderSummaryDAO.FindAll(userId);
var orderdetails = OrderDetailsDAO.Get(orderId);
```
  - Simplicity
    - Dependencies are clearer for the client
  - Flexibility
    - The Get and Find methods hide details
      - the partitioning of the data store
      - the data access methods such as an object relational mapping
      - This makes it easier to change these choices in the future
  - Performance
    - You can easily optimize the queries that the Find and Get methods run
  - Testability
    - It is easier to specify unit tests for the Find and Get methods than to create suitable unit tests for the range of possible LINQ queries that a client could specify
  - Maintainability
    - All of the queries are defined in the same location, the DAO classes, making it easier to modify the system consistently

#### CQRS command validation
- error
  - retrying the operation
- business failure
    - A business failure should have a predetermined business response
    - If the system cannot reserve a seat because there are no seats left, then it should add the request to a wait list

gha_license_id: NOASSERTION


text:
---
build: 180503
stage: preview
---

* [conemu#1539](https://github.com/Maximus5/ConEmu/issues/1539): Resize fixes for auto-hidden Taskbar and caption-less mode.
* [conemu#1545](https://github.com/Maximus5/ConEmu/issues/1545): Fix paste problems in Windows 10 1803 on texts with spaces or CR/LF.
* Maximized ConEmu was not sized properly after display changes.
* Default Task: create `{bash}` if either `bash.exe` or `wsl.exe` are found.
* Improve Windows version detection in dlls.

gha_language: HTML


text:
# Boids
2D boids with settings and UI.

## Screenshots
![1](screenshots/screen.png)

### Adding circular obstacle
![2](screenshots/add_circle.png)
![3](screenshots/circles_added.png)

repository: NamorNiradnug/Boids

repo_name: NamorNiradnug/Boids


text:
# [The Bartender](http://alexa.amazon.com/#skills/amzn1.echo-sdk-ams.app.0b5f3350-db8a-4754-a8dc-0ca8bbfd5d29)
![3.4 stars](../../images/ic_star_black_18dp_1x.png)![3.4 stars](../../images/ic_star_black_18dp_1x.png)![3.4 stars](../../images/ic_star_black_18dp_1x.png)![3.4 stars](../../images/ic_star_half_black_18dp_1x.png)![3.4 stars](../../images/ic_star_border_black_18dp_1x.png) 90

To use the The Bartender skill, try saying...

* *Alexa, ask the bartender, what's in a Tom Collins?*

* *Alexa, ask the bartender, for a drink with pineapple juice*

* *Alexa, ask the bartender to surprise me*

This skill will give Alexa access to over 12,000 cocktail recipes. When you ask her what's in a cocktail, she will give you the ingredients, the amounts, and the instructions for mixing the ingredients together. If you have some ingredients and are looking for inspiration, you can ask her for drink that's made with your ingredient. If you're feeling adventurous, you can also ask Alexa to surprise you for a random drink recipe.

NOTICE:
This skill may not be suitable for all ages. This skill provides instructions for how to make alcoholic drinks, in addition, some drink recipes returned by Alexa may include offensive content.

***

### Skill Details

* **Invocation Name:** the bartender
* **Category:** null
* **ID:** amzn1.echo-sdk-ams.app.0b5f3350-db8a-4754-a8dc-0ca8bbfd5d29
* **ASIN:** B019D6LR8U
* **Author:** Midnight Signal
* **Release Date:** December 14, 2015 @ 17:24:54
* **In-App Purchasing:** No


text:
<!-- README.md is generated from README.Rmd. Please edit that file -->

# trendbreaker

<!-- badges: start -->

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3888494.svg)](https://doi.org/10.5281/zenodo.3888494)
[![R build
status](https://github.com/reconhub/trendbreaker/workflows/R-CMD-check/badge.svg)](https://github.com/reconhub/trendbreaker/actions)
<!-- badges: end -->

The *trendbreaker* package implements tools for detecting changes in
temporal trends of a single response variable. It provides a coherent
interface to several modeling tools, alongside functions for model
selection and outlier detection. It implements the **A**utomatic
**S**election of **M**odels and **O**utlier **De**tection for
**E**pidemmics (ASMODEE), an algorithm originally designed for detecting
changes in COVID-19 case incidence.

ASMODEE proceeds by:

1.  defining a training set excluding the last *k* data points
2.  identifying the temporal trend in the training set by fitting a
    range of (user-specified) models to the data and retaining the best
    predicting / fitting model
3.  calculating the prediction interval (PI) of the temporal trend
4.  classifying any data point outside the PI as outlier

The algorithm can be applied with fixed, user-specified value of *k*, so
as to monitor potential changes in this recent time period.
Alternatively, the optimal value of *k* can be determined automatically.

**Disclaimer:** this is work in progress. Please reach out to the
authors before using this package. Also note this package may soon be
renamed to avoid clashes with other projects and reflect a more general
scope.

## Getting started

Once it is released on [CRAN](https://CRAN.R-project.org), you will be
able to install the stable version of the package with:

``` r
install.packages("trendbreaker")
```

The development version can be installed from
[GitHub](https://github.com/) with:

``` r
if (!require(remotes)) {
  install.packages("remotes")
}
remotes::install_github("reconhub/trendbreaker")
```

The best place to start for using this package is to read the
documentation of the function `asmodee` and run its example:

``` r
library(trendbreaker)
?asmodee
example(asmodee)
```

## Main features

The package implements the following main functions

  - `asmodee`: implements the Automatic Selection of Models and Outlier
    DEtection for Epidemics

  - `select_model`: a function to select the
    best-fitting/best-predicting model from a range of user-specified
    models

  - `detect_changepoint`: a function to detect the points at which
    recent data deviate from previous temporal trends using a fitted
    model and data

  - `detect_outliers`: a function to identify outliers using a fitted
    model and data

### ASMODEE

We illustrate ASMODEE using publicly available NHS pathways data
recording self-reporting of potential COVID-19 cases in England (see
`?nhs_pathways_covid19` for more information). ASMODEE would typically
be more useful to investigate shifts in temporal trends from a large
number of time series (e.g. at a fine geographic scale), but is this is
purely for illustrative purposes, we use the full dataset for England.
See `?asmodee` for further example stratified by geographic units.

``` r

library(trendbreaker)
library(tidyverse)
#> ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ──
#> ✔ ggplot2 3.3.1     ✔ purrr   0.3.4
#> ✔ tibble  3.0.1     ✔ dplyr   1.0.0
#> ✔ tidyr   1.1.0     ✔ stringr 1.4.0
#> ✔ readr   1.3.1     ✔ forcats 0.5.0
#> ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
#> ✖ dplyr::filter() masks stats::filter()
#> ✖ dplyr::lag()    masks stats::lag()

# load data
data(nhs_pathways_covid19)

# select last 6 weeks of data
first_date <- max(nhs_pathways_covid19$date, na.rm = TRUE) - 6*7
pathways_recent <- nhs_pathways_covid19 %>%
  filter(date >= first_date)

# define candidate models
models <- list(
  regression = lm_model(count ~ day),
  poisson_constant = glm_model(count ~ 1, family = "poisson"),
  negbin_time = glm_nb_model(count ~ day),
  negbin_time_weekday = glm_nb_model(count ~ day + weekday)
)

# analyses on all data
counts_overall <- pathways_recent %>%
  group_by(date, day, weekday) %>%
  summarise(count = sum(count))
#> `summarise()` regrouping output by 'date', 'day' (override with `.groups` argument)

# results with automated detection of 'k'
res <- asmodee(counts_overall, models, method = evaluate_aic)
res
#> $k
#> [1] 7
#>
#> $model
#> $model
#>
#> Call:  MASS::glm.nb(formula = count ~ day + weekday, data = data, init.theta = 76.80468966,
#>     link = log)
#>
#> Coefficients:
#>    (Intercept)             day   weekdaymonday  weekdayweekend
#>       10.81062        -0.02057         0.24398        -0.11588
#>
#> Degrees of Freedom: 35 Total (i.e. Null);  32 Residual
#> Null Deviance:       186.5
#> Residual Deviance: 36.09     AIC: 665.4
#>
#> $predict
#> function (newdata, alpha = 0.05)
#> {
#>     suppressWarnings(res <- add_prediction_interval(data = newdata,
#>         model = model, alpha = alpha))
#>     col_name <- as.character(formula[[2]])
#>     append_observed_column(res, res[[col_name]])
#> }
#> <bytecode: 0x55aca770b160>
#> <environment: 0x55acad36c0a8>
#>
#> attr(,"class")
#> [1] "trendbreaker_model_fit" "list"
#>
#> $n_outliers
#> [1] 9
#>
#> $n_outliers_train
#> [1] 2
#>
#> $n_outliers_recent
#> [1] 7
#>
#> $p_value
#> [1] 4.076898e-05
#>
#> $results
#> # A tibble: 43 x 10
#> # Groups:   date, day [43]
#>    date         day weekday count   pred lower upper observed outlier
#>    <date>     <int> <fct>   <int>  <dbl> <dbl> <dbl>    <int> <lgl>
#>  1 2020-04-16    29 rest_o… 29497 27288. 21520 33729    29497 FALSE
#>  2 2020-04-17    30 rest_o… 27007 26733. 21082 33043    27007 FALSE
#>  3 2020-04-18    31 weekend 25453 23323. 18392 28829    25453 FALSE
#>  4 2020-04-19    32 weekend 23387 22848. 18018 28243    23387 FALSE
#>  5 2020-04-20    33 monday  29287 32078. 25299 39648    29287 FALSE
#>  6 2020-04-21    34 rest_o… 23134 24621. 19417 30434    23134 FALSE
#>  7 2020-04-22    35 rest_o… 21803 24120. 19021 29815    21803 FALSE
#>  8 2020-04-23    36 rest_o… 22298 23629. 18634 29208    22298 FALSE
#>  9 2020-04-24    37 rest_o… 22027 23148. 18254 28613    22027 FALSE
#> 10 2020-04-25    38 weekend 18861 20196. 15925 24965    18861 FALSE
#> # … with 33 more rows, and 1 more variable: classification <fct>
#>
#> attr(,"class")
#> [1] "trendbreaker" "list"
plot(res, "date")
```

<img src="man/figures/README-asmodee-1.png" width="75%" />

### Model selection

You can define a number of different regression models using a common
interface. Once defined you can use different strategies to select the
best-fitting/best-predicting model.

As an example we try to predict `hp` of the famous `mtcars` dataset. Of
course, this is just a toy example. Usually you would use the package to
predict counts data in a time series.

First we define some potential models:

``` r
library(trendbreaker)
stan_cache <- tempfile() # stan compile to c++ and we cache the code
models <- list(
  null = lm_model(hp ~ 1),
  glm_poisson = glm_model(hp ~ 1 + cyl + drat + wt + qsec + am, poisson),
  lm_complex = lm_model(hp ~ 1 + cyl + drat + wt + qsec + am),
  negbin_complex = glm_nb_model(hp ~ 1 + cyl + drat + wt + qsec + am),
  brms_complex = brms_model(
    hp ~ 1 + cyl + drat + wt + qsec + am,
    family = brms::negbinomial(),
    file = stan_cache
  )
)
```

Then we evaluate them using [N-Fold cross
validation](https://en.wikipedia.org/wiki/Cross-validation_\(statistics\)).

``` r
# we do CV and evaluate three loss function:
# Root-mean-squared error, the huber-loss and mean absolute error.
# The package works with `yardstick` by default.
out <- capture.output( # no log output in readme :)
  auto_select <- select_model(mtcars, models,
    method = evaluate_resampling,
    metrics = list(yardstick::rmse, yardstick::huber_loss, yardstick::mae)
  )
)
auto_select$leaderboard
#> # A tibble: 5 x 4
#>   model          huber_loss   mae  rmse
#>   <chr>               <dbl> <dbl> <dbl>
#> 1 brms_complex         18.2  18.7  18.7
#> 2 glm_poisson          21.2  21.7  21.7
#> 3 negbin_complex       22.8  23.3  23.3
#> 4 lm_complex           26.2  26.7  26.7
#> 5 null                 57.8  58.3  58.3
```

repository: stephaneghozzi/trendbreaker

repo_name: stephaneghozzi/trendbreaker


text:
# Trust Agent Simulator
The Trust Agent Simulator could be used for simulating Trust Agents for performance testing of ISecl compoonents - in particular the HVS. The Trust Agent Simulator can simulate thousands of hosts in a single process. A single process hosts multiple `https servers` with one port per simulated host. Typically, you could simulate upto 25,000 hosts on a single Linux server. The number of servers and starting port number can be configured through the config file.

## Building from Source code
The Trust Agent Simulator is written in Go and the only tool that is needed for building it is Go

- Requires Go Version 1.14 or later

Simplest way to build the Trust Agent invoke the make commands from the commandline. This will produce an installer that will be located in deployments/installer/

```shell
cd tools/ta-sim
make installer
cp deployments/installer/ta-sim-v3.3.1.bin <target_directory>
```

If this is the first time that you are installing the Trust Agent Simulator, a helper .env file is also provided that can be used to automate the install of the product. Copy the .env file to the home directory of the user installing the simulator. Details about environment variables are documented in go-ta-env section below.

```shell
cp deployments/installer/go-ta-sim.env ~
```

There are advanced options to build the simulator such as the `ta-sim` binary alone. Please refer to the `Makefile` in the source.

## Installing

Copy installer to a machine that has access to the HVS privacy CA certificate and private key. Please refer to the env file documentation for further details. Use the `go-ta-sim.env` for easier setup and avoiding prompts during installation. Please refer to [go-ta-sim.env section](#go-ta-sim.env-File-Environment-variables)

Run the installer

```shell
cp go-ta-sim.env ~
./ta-sim-v3.3.1.bin
```

Some of the required values will be prompted for by the installer if they are not set via the .env file. For others that are needed, the installer will error out. Please check the documentation of the .env file for setting the necessary ones.

After successfull installation, make configuration changes in the configuration file located at `/opt/go-ta-simulator/configuration/config/yml'

Some of the value are discussed here
``` shell
# PortStart - starting port number of the ports where web servers are listening on - one for each unique simulated host
PortStart : 10000

# Servers - Number of servers. PortStart and Servers should be set appropriately to make sure that there are no conflicting servers in the port range. For instance. In this example, the simulator will have a https server running on ports from 10000 to  10099 - make sure no other services are occupying ports in this range
Servers : 100

# Number of unique Platform and OS flavors that will be created. In this example, 5 Platform and 5 OS flavors will be created
DistinctFlavors : 5

# Number of milliseconds that simulates the TPM response time on the Node
QuoteDelayMs : 500

# Number of simulataneous threads - will wait for response to these to complete before sending another batch
RequestVolume : 50

# Indicates the Percentage of Hosts for which unique flavors are created. In this case, only 99 Host unique flavors would be registered since we have 100 servers - All 100 hosts would still be registered
TrustedHostsPercentage : 99
```

## Using the Trust Agent Simulator

Once configured, the Trust Agent simulator can be used to create flavors, and register hosts to support simulation.

```shell

cd /opt/go-ta-simulator
# start the simulator using the helper script. This script will set the ulimit and keep the process in the background
./tagent-sim start
# Create Flavors. In order for hosts to be trusted, it needs the software flavors as well (TA simulator does not generate software flavors). To address this problem, import flavors into HVS from a real Trust Agent which will import the necessary flavors into the "automatic" flavorgroup.
./ta-sim create-all-flavors

# Create Hosts.
./ta-sim create-all-hosts

# Leave the simulator running so that HVS can contact the simulated host to create and refresh hosts.
```

To stop the simulator, use helper script which looks for the process running the simulator and kills it

```shell
cd /opt/go-ta-simulator
./tagent-sim stop
```

## Uninstalling Trust Agent Simulator

Uninstalling the Trust Agent Simulator is as simple as stopping the TA simulator and removing the contents from the installed directory

```shell
/opt/go-ta-simulator/tagent-sim stop
rm -rf /opt/go-ta-simulator
```

## Moving Simulator to another server

The Simulator can be moved from one machine to another (as long as it is communicating with the same HVS and AAS) by copying the contents of the /opt/go-ta-simulator folder. If running multiple TA simulators, make sure the hardware uuids do not conflict. This can be done by zeroing out or deleting the hw_uuid_map.json file
```shell
cd /opt/go-ta-simulator
# Edit contents of config.yml
vi configuration/config.yml
# change the SimulatorIP to reflect the IP of the new system
#save the file
cat /dev/null > configuration/hw_uuid_map.json
# rm configuration/hw_uuid_map.json
# start the server and create flavor and hosts as explained previously
```

The Simulator can be stopped and restarted as needed. The simulator stores the simulated hardware uuids in a file in configuration/hw_uuid_map.json file. This ensures that when the Simulator is restarted, the hardware uuid and the connection strings (based on port numbers) matches.

### go-ta-sim.env File Environment variables
The following are contents of the env file
```shell
# Some variables will be prompted if they are not set. The ones that are prompted will be indicated in this
# document. For those variables that are not set and does not have default values, set them in the env file or export them from the terminal

# TA_IP is used to indicate the IP address of the a real trust agent where information can be copied from.
# Leave this as blank if the default response file can be used
TA_IP=<IP_ADDRESS>

# TA_PORT - default port 8443 - set if it needs to be overridden
TA_PORT=1443

# TA_SIM_IP - IP address where the TA simulator will be installed. Use IP address of machine where it is being installed.
TA_SIM_IP=<IP_ADDRESS>

# AAS_IP - IP address where AAS is installed - used to get the token to request certificate. If commented, installer will prompt
AAS_IP=<IP_ADDRESS>

# AAS_PORT - default port 8444 - set if it needs to be overridden
AAS_PORT=8444

# CMS_IP - IP address of CMS. If commented, installer will prompt and default response is to use AAS IP address
CMS_IP=<IP_ADDRESS>

# CMS_PORT - default port 8445 - set if it needs to be overridden
CMS_PORT=8445

# HVS_IP - IP address of HVS. If commented, installer will prompt and default response is to use AAS IP address
HVS_IP=<IP_ADDRESS>

# HVS_PORT - leave commented if default port of 8443 is being used.
HVS_PORT=8443

# SIM_TLS_CERT_CN - Common name for Simulator TLS certificate. default value - "TA Simulator TLS Certificate"
SIM_TLS_CERT_CN="TA Simulator TLS Certificate"

# SIM_TLS_CERT_SAN - Subject alternative name/ IP address where TA simulator is running. Default value - '*'.
# Default value enables installer to request any SAN in the CSR sent to CMS.
SIM_TLS_CERT_SAN="*"

# AAS_USERNAME - Installer will prompt if not set. User needs access to AAS, HVS and TA APIs. The Global Admin may be used for this purpose
AAS_USERNAME=<user with access to AAS, HVS and TA APIs>

# AAS_PASSWORD - if not set, installer will prompt.
AAS_PASSWORD=<password for user>

# PRIVACY_CA_CERT_PATH - - default value - /etc/hvs/certs/trustedca/privacy-ca/privacy-ca-cert.pem
# The installer needs access to the HVS Privacy CA and private key in order to create an AIK certificate that can be used by the Trust Agent simulator.
PRIVACY_CA_CERT_PATH=<path to HVS Privacy CA>

# PRIVACY_CA_KEY_PATH - Path to Privacy CA key that corresponds to the Privacy CA cert.
# default value - /etc/hvs/trusted-keys/privacy-ca.key
PRIVACY_CA_KEY_PATH=<path to HVS Privacy CA Private Key>

# An existing AIK certificate, Aik private key and Binding key from from another
# TA simulator could be used instead of generating a new one. However, the AIK certificate
# and binding key would only valid for the same HVS. Different HVS will have a different
# Privacy CA and therefore the these will need to be regenerated.
# Use the below AIK_CERT_PATH, AIK_KEY_PATH, BINDING_KEY_CERT_PATH to set these.

# AIK_CERT_PATH - don't set if PRIVACY_CA_CERT_PATH and PRIVACY_CA_KEY_PATH are set.
# copy from a valid TA simulator and set AIK_CERT_PATH
AIK_CERT_PATH=<path to existing aik certificate that has been signed by Privacy CA>

# AIK_KEY_PATH - corresponding private key
# don't set if PRIVACY_CA_CERT_PATH and PRIVACY_CA_KEY_PATH are set.
# copy from a valid TA simulator and set AIK_KEY_PATH
AIK_KEY_PATH=<path to Private Key for the AIK certificate>

# BINDING_KEY_CERT_PATH - Binding key certificate copied from another TA simulator that is in
# the same set as the AIK.
# copy from a valid TA simulator and set BINDING_KEY_CERT_PATH
# don't set if PRIVACY_CA_CERT_PATH and PRIVACY_CA_KEY_PATH are set.
BINDING_KEY_CERT_PATH=<path to Binding Key Certificate that is created using the AIK>

```

repository: pkumarex/utils

repo_name: pkumarex/utils


text:
# AAAI21-ConsistentMoSeg
Matlab implementation for AAAI 2021 paper `What to Select: Pursuing Consistent Motion Segmentation from Multiple Geometric Models`.

## Acknowledge
The implementation is based on [Subset model](https://github.com/alex-xun-xu/MultiViewMoSeg). We sincerely thank the authors for their work.

## Data
Original data can be found in [Hopkins155/Hopkins12](http://www.vision.jhu.edu/data/), [MTPV62](http://pami.xmu.edu.cn/∼wlzhao), [KT3DMoSeg](https://github.com/alex-xun-xu/MultiViewMoSeg).

We provide a reformatted version in `Data/` according to `KT3DMoSeg` dataset. Please unzip the compressed files before run the codes.

## Run
Uncomment corresponding `Dataset`, `select_visible`, `Params` for different datasets in the following codes and then run them.
- Run hypotheses generation code for each geometric model: `./script/Hypo/script_AHF_Hypo_RandSamp.m`
- Run ORK kernel computing code: `./script/Kernel/script_AHF_ORK_RandSamp.m`
- Run single-view (`script_X_MoSeg_RandSamp.m`, where X is Affine/Homography/Fundamental) or multi-view (`script_AHF_X_RandSamp.m`, where X is `KerAdd/CoReg/Subset/ConsistenMoSeg`) motion segmentation under `./script/MoSeg/`

## Citation
Please cite our paper if you use our code in your own work:

```
@inproceedings{jiang2021consistentmoseg,
  title={What to Select: Pursuing Consistent Motion Segmentation from Multiple Geometric Models},
  author={Jiang, Yangbangyan and Xu, Qianqian and Ke, Ma and Yang, Zhiyong and Cao, Xiaochun and Huang, Qingming},
  booktitle={AAAI Conference on Artificial Intelligence},
  year={2021}
}
```


text:
# Tourist_Guide
A tourist guidance software in JAVA

Explanation:

Tourist Guide :: TouristGuide:
It creates the welcome interface of Tourist Guide application. There is a navigation menu with different buttons of different categories. Whenever users press any button, they are navigated to that particular interface.

Tourist Guide :: Hotels: This is the navigation interface of different hotels. There is a JComboBox in which the names of different hotels are included. According to the text selected in the JComboBox, the respective text is shown in the JTextFields. Each hotel has the the following attributes.

Name

Features

Rating

Address

Contact

Tourist Guide :: Transports: Here is the navigation menu of different modes of transports, i.e. Stations, Bus Stops, Airports. There are 3 JComboBoxes for them respectively and whenever any of the options are selected, the menu is navigated to the next menu.
Stations: There we can view the details of different stations. Name, Address, No. of platforms and contact details are available.
Airport: There we can view the details of different Airports. Name, Address, elevation and contact details are available.
Bus Stop: There we can view the details of different Bus Stops. Name, Address and contact details are available.

Tourist Guide :: TouristSpots: This is the navigation interface of different tourist spots. There is a JComboBox in which the names of different tourist spots. According to the text selected in the JComboBox, the respective text is shown in the JTextFields. Each spot has the the following attributes.

Name

Rating

Address

Tourist Guide :: Hospitals: This is the navigation interface of different hospitals. There is a JComboBox in which the names of different hospitals. According to the text selected in the JComboBox, the respective text is shown in the JTextFields. Each hospitals has the the following attributes.

Name

Address

Contact

Tourist Guide :: Shopping: This is the navigation interface of different shopping malls and stores. There is a JComboBox in which the names of different malls and stores. According to the text selected in the JComboBox, the respective text is shown in the JTextFields. Malls has the the following attributes.

Name

Type

Address

Contact


text:
# rancher-icinga

**rancher-icinga** registers Rancher resources in Icinga2 for monitoring. Right now, each rancher agent, stack and service
is individually monitored. Rancher environments are created as Icinga2 hostsgroups. Rancher agents are monitored
as hosts, and a rancher-agent service check is added.
Rancher stacks are hosts and services are created as services for those hosts.

Requires Rancher 1.2.0 or later.

## Getting started

You will need a running Icinga2 that uses https://github.com/Nexinto/check-rancher. See examples/rancher.conf for how to
configure the check_rancher commands. (You can configure alternative check commands using the XXX_CHECK_COMMAND environment variables
(see below).

## Configuration

Use the following environment variables to configure rancher-icinga:

Required:

- **RANCHER_URL** Rancher API URL. Uses the v2-beta API.
- **RACHER_ACCESS_KEY** / **RANCHER_SECRET_KEY** API Keys with enough access to monitor all environments.
- **ICINGA_URL** Icinga2 API URL
- **ICINGA_USER** / **ICINGA_PASSWORD** Icinga2 API username, password

Optional:

- **ENVIRONMENT_NAME_TEMPLATE** Go Template for the name of Icinga2 hostgroups that represent Rancher environments (default: `{{.RancherEnvironment}}`)
- **STACK_NAME_TEMPLATE** Go Template for the name of Icinga2 hosts that represent Rancher stacks (default: `{{.RancherEnvironment}}.{{.RancherStack}}`)
- **HOST_CHECK_COMMAND** Name of the command Icinga2 uses to check the health of hosts (default: hostalive)
- **STACK_CHECK_COMMAND** Name of the check command used to monitor a Rancher stack (default: check_rancher_stack)
- **SERVICE_CHECK_COMMAND** Name of the check command used to monitor a Rancher service (default: check_rancher_stack)
- **RANCHER_INSTALLATION** If you would like to register more than one Rancher installation with Icinga2, give each of them a name.
- **REFRESH_INTERVAL** If 0 (the default), update Icinga once and then exit. If > 0, run in an endless loop and update every that many seconds.
- **ICINGA_DEBUG** Add debug output (default: disabled). 1 for output of write operations, 2 for checks, 3 for tracing of API requests.
- **ICINGA_INSECURE_TLS** Set to 1 to disable strict TLS cert checking when connection to the Icinga2 API (default: disabled)
- **FILTER...** See below (Filtering)
- **REGISTER_CHANGES** See below (Registering change events)

The following values are available for name templates:

- Hostname
- RancherUrl
- RancherAccessKey
- RancherSecretKey
- RancherEnvironment
- RancherStack
- RancherService

## Icinga Vars and additional attributes

Certain attributes for Icinga2 objects can be created using rancher-icinga. Currently, support for Notes URL and
all generic Variables is available. These values can be set for Rancher hosts(agents), stacks and services.

The following defaults can be set as environment variables:

- **HOSTGROUP_DEFAULT_ICINGA_VARS** default Vars for all Icinga2 hostgroups (Rancher environments)
- **HOST_DEFAULT_ICINGA_VARS** default Vars for all Icinga2 hosts that represent rancher agents
- **STACK_DEFAULT_ICINGA_VARS** default Vars for all Icinga2 hosts that represent rancher stacks
- **SERVICE_DEFAULT_ICINGA_VARS** default Vars for all Icinga2 services that represent rancher services

For individual Rancher hosts, stacks and services, labels can be set:

- **icinga.host_vars** on Rancher hosts will create these Vars on the corresponding Icinga2 host
- **icinga.stack_vars** set on one of the services of a Rancher stack will create these Vars on the Icinga2 host
  representing the stack
- **icinga.service_vars** set on a Rancher service will create these Vars on the corresponding Icinga2 service

The syntax is a comma separated list of key=value entries, with not fancy special characters, like

    myvar1=something,anothervar=something_else

Similarly, custom Notes URL entries in Icinga can be created using the following labels:

- **icinga.host_notes_url** on Rancher hosts will create the Notes URL on the corresponding Icinga2 host and the
  service representing the rancher-agent
- **icinga.stack_notes_url** set on one of the services of a Rancher stack will create the Notes URL on the Icinga2 host
  representing the stack
- **icinga.service_notes_url** set on a Rancher service will create the Notes URL on the corresponding Icinga2 service

Note that since Rancher stacks do not support labels, you will have to set the label for the stack on a service
for that stack.

## Custom checks

A service can deploy additional Icinga2 checks. If you would like to check for more than what
Racher considers the state of your service, you can add any number of checks that will be run by Icinga2 as
additional services for your Rancher. These checks are configured as the Rancher service
label **icinga.custom_checks**. The format is a YAML array of services with the attributes name, check name as
used by Icinga2, notes URL and a map with Vars. For example, this deploys an nginx service with two additional
HTTP checks:

```
version: '2'
services:
  nginx:
    image: nginx
    labels:
      io.rancher.container.pull_image: always
      icinga.custom_checks: |
        - name: http
          command: http
          notes_url: http://docs.mysite.com/internal_service.html
          vars:
            http_address: nginx.mysite.rancher.internal
            http_port: 80
            http_uri: /health_int
        - name: http_xt
          command: http
          notes_url: http://docs.mysite.com/external_service.html
          vars:
            http_address: www.mysite.com
            http_port: 80
            http_uri: /health
```

## Filtering

By default, all Rancher environments, agents, stacks and services are added to Icinga. Filters can be set to limit which objects
are monitored. These are set using environment variables:

- **FILTER_ENVIRONMENTS**
- **FILTER_HOSTS**
- **FILTER_STACKS**
- **FILTER_SERVICES**

Each value is a comma-seperated list of filter expressions. Match is last. Use a suffix of `!L` to stop processing at that rule.
A `-` prefix negates the filter expression.

The most obvious way to filter is using labels. Unfortunately, only hosts and services support labels, stacks don't.

The following filters are supported:

- `*` matches everything.
- A glob expression matches the name of the agent / stack / service.
- `LABEL=VALUE` matches a label value. glob is supported for both LABEL and VALUE.
- `%SYSTEM` matches a system stack or service.
- `%ENV=ENVNAME` matches is the host, stack or service is deployed in the environment ENVNAME. glob is supported.
- `%HAS_SERVICE(SERVICENAME)` matches a stack that has a service named SERVICENAME. glob is supported.
- `%HAS_SERVICE(LABEL=VALUE)` matches a stack that has a service that has a label LABEL with value VALUE. glob is supported for both LABEL and VALUE.
- `%STACK=STACKNAME` matches if the service is a member of the stack STACKNAME. glob is supported for both LABEL and VALUE.

If a stack does not match a filter, no services will be monitored for this stack. There is no similar behaviour for
hosts.

Example 1:

Two environments, "prod" and "dev". We would like to monitor all hosts in all environments, all stacks and services in "prod",
but only system stacks in "dev".

```
FILTER_HOSTS="*"
FILTER_STACKS="*,-%ENV=dev,%SYSTEM"
FILTER_SERVICES="*,-%ENV=dev,%SYSTEM"
```

FILTER_SERVICES can be left empty or set to "*" in this example, because there are no services that should not be monitored in a stack
that is monitored.

FILTER_STACKS could also be written as:

```
FILTER_STACKS="*,%SYSTEM!L,-%ENV=dev"
```

Example 2:

One environment "prod", where all hosts should be monitored. All System stacks should be monitored. Only
services labeled "monitor=true" should be monitored. Stacks that have such services should be monitored).

```
FILTER_HOSTS="*"
FILTER_STACKS="-*,%SYSTEM,%HAS_SERVICE(monitor=true)"
FILTER_SERVICES="-*,%SYSTEM,monitor=true"
```

(see filter_test.go for more about these two examples)

## Registering change events

Set the environment variable REGISTER_CHANGES to an URL that will receive a POST request with every change that
rancher-icinga makes. A JSON object will be posted with the following fields:
- **operation** - the type of the change (created, delete, update, delete-cascade)
- **name** - the name of the object being created or deleted
- **type** - the object type
- **vars** - the "vars" of the icinga object
- **object** - the whole icinga object

The URL supports the<EMAIL_ADDRESS>syntax.

## Testing

There are tests for filtering and for updating icinga2 objects. If run with an empty environment, mocks are used.

To test with a running Icinga2, set the environment variable ICINGA_TEST_RESET_SCRIPT to a file containing a
script that is run before every single test to initialize/reset the Icinga2 instance. Some tests expect an exact
number of objects in the target Icinga2 and would fail if there is anything else. When testing in this mode,
the environment variables ICINGA_URL, ICINGA_USER and ICINGA_PASSWORD are used.

An example reset script can be found in `examples/reset-icinga.sh`.

Be careful to use this mode only with a dummy testing instance.

## FAQ

### Why does a new Rancher environment not show up in Icinga2?

The user that owns the rancher access/secret key needs read access in the new environment.

### Can I monitor more than one Rancher installation (not environment) in a single Icinga2?

Yes, but you need to set RANCHER_INSTALLATION, ENVIRONMENT_NAME_TEMPLATE and STACK_NAME_TEMPLATE so that the
names of all Icinga2 objects created are unique.

repository: plusserver/rancher-icinga

repo_name: plusserver/rancher-icinga


text:
# Mnesiaex

Elixir ecto 3 adapter for mnesia.

Docs can be found at [https://hexdocs.pm/mnesiaex](https://hexdocs.pm/mnesiaex).

**_NOTICE:_** Mnesiaex, is considered pre `1.0`. This means the API can, and may, change at any time. Please ensure you review the docs and changelog prior to updating.

**_NOTICE:_** Please ensure you've done your due diligence when using this library, or Mnesia itself for that matter. It isn't a silver bullet and it shouldn't be treated as one.

## Installation

Simply add `mnesiaex` to your list of dependencies in `mix.exs`:

```elixir
def deps do
  [
    {:mnesiaex, "~> 0.1"}
  ]
end
```

## Development

Ensure you have the proper language versions installed. To do this, an `asdf` tools file has been provided. Run the following:

```shell
git clone https://github.com/beardedeagle/mnesiaex.git
git checkout -b MyFeature
asdf install
mix local.hex --force
mix local.rebar --force
mix deps.get --force
mix deps.compile --force
mix compile --force
```

**_NOTICE:_** You can find the `asdf` tool [here][1].

## Notice

This library was built standing on the shoulders of giants. A big thanks goes out to Andrew Dryga and patatoid, from which this library was inspired.

Happy coding!

[1]: https://github.com/asdf-vm/asdf

repository: beardedeagle/mnesiaex

repo_name: beardedeagle/mnesiaex


text:
# Ember Phoenix Chan

Elixir has a great web framework called Phoenix that ships with support for real-time communication (via sockets / long poll). Ember, being a front-end framework, can benefit a lot from gaining real-time capabilities.

This addon grabs phoenix.js from the Phoenix framework and puts it into your Ember app.

## How to use

Directly import where needed:

```js
import Phoenix from 'ember-phoenix-chan';
const {Socket, Channel, LongPoll, Ajax, Presence} = Phoenix;
```
To get started on building a Phoenix Elixir app, consult the good guide on Phoenix here:

[http://www.phoenixframework.org/docs/channels](http://www.phoenixframework.org/docs/channels)

Chris McCord has written a good example of how to use the js sockets exposed by phoenix.js:

[https://github.com/chrismccord/phoenix_chat_example/blob/master/web/static/js/app.js](https://github.com/chrismccord/phoenix_chat_example/blob/master/web/static/js/app.js)

The source code for phoenix.js is here:

[https://github.com/phoenixframework/phoenix/blob/master/web/static/js/phoenix.js](https://github.com/phoenixframework/phoenix/blob/master/web/static/js/phoenix.js)

Starting in Phoenix 1.2, you now have access to this thing called "Presence" which is some CRDT-based distributed state synchronization tool built natively into Phoenix. Read about it here:

[https://hexdocs.pm/phoenix/1.2.0-rc.1/Phoenix.Presence.html#summary](https://hexdocs.pm/phoenix/1.2.0-rc.1/Phoenix.Presence.html#summary)

## Testing and Development

You'll need Elixir, Erlang, and the OTP on your local computer.

You can get those things at the elixir website:

[http://elixir-lang.org/install.html](http://elixir-lang.org/install.html)

Once you have the tools for the backend, you can boot them up like so:

```shell
cd ..
npm install && bower install

# Alternatively, use ./bin/phoenix
cd bower_components/phoenix_chat_example
mix local.hex
mix deps.get
iex -S mix phoenix.server

ember s
```
And navigate to localhost:4200 in your browser.

In order to properly test, you'll need to open up 2 tabs. Try filling out the form and creating a new camera object, you'll see that it propages to the other tab nicely. Clicking on the created camera objects deletes them (this also propagates).

The reason this isn't automated is because it's a lot of work rigging out phantomjs (or Capybara) to use multiple tabs to test (lol), but I need this addon right now.

## TODOs

1. Implement query filtering in the channel-store
2. Decouple phoenix.js from ChannelStore to allow for other WebSocket methods
3. Rig up automated tests with either Phantom or Capybara
4. More error handling and sensible error messages
5. Conform to more of DDP's specifications
6. Draw a mai-waifu-moe-am-i-kawaii-uguu~ logo

## Installation

* `git clone` this repository
* `npm install`
* `bower install`

## Running

* `ember server`
* Visit your app at http://localhost:4200.

## Running Tests

* `ember test`
* `ember test --server`

## Building

* `ember build`

For more information on using ember-cli, visit [http://www.ember-cli.com/](http://www.ember-cli.com/).

repository: raksonibs/ember-phoenix-chan

repo_name: raksonibs/ember-phoenix-chan


text:
# Snake Solver

This repo is under heavy development.

Snake Solver is an AI-played Snake game, looking for perfect solution in shortest steps. The GUI is implemented with PyGame. The algorithm is a mixed method of BFS, Hamiltonian path, A* searching and forward checking.

# Algorithms

* A* algorithm:

Calculate gscore and heuristic distance, then add them up as tentative gscore. Comparing T-gscore of possible moves to find best move.

* Forward checking:

1) Find shortest Path(Based on BFS) between head and apple.

2) After the snake eats apple, Whether it can find its tail. If yes, then return the path from 1); If no, continue.

3) Let the snake move to its tail along the longest path (Adding steps into the shortest path to make it as longest as possible).

* Mixed Strategy(Forward Checking&BFS):

1) Find shortest Path between head and apple.

2) After the snake eats apple, Whether it can find its tail. If yes, then return the path from 1); If no, continue.

3) Let the snake move one step (Choose one direction). After this move, the snake should find its tail and is farest from apple then the other three directions.

# Future works

* Almighty move:

Automatically construct a path or combination of pathes which covers the whole area of the graph.

## References
1. Al Sweigart. (2012). Wormy. Making Games with Python & Pygame. Retrieved from https://github.com/asweigart/making-games-with-python-and-pygame/blob/master/wormy/wormy.py
2. Shu Kong, Joan Aguilar Mayans. (2014). Automated Snake Game Solvers via AI Search Algorithms. Retrieved from http://sites.uci.edu/joana1/files/2016/12/AutomatedSnakeGameSolvers.pdf
3. Chuyangliu. Path solver. Retrieved from https://github.com/chuyangliu/Snake/blob/master/docs/algorithms.md

repository: mdecourse/SnakeSolver

repo_name: mdecourse/SnakeSolver


text:
# cheapstream

Brings AceStream engine to Linux ARM.

This is a build system for creating AceStream distributable
for Linux ARM target. It uses the last version of AceStream
for Android as the base with some patches. The output
distributable is suitable for running in chroot environment.

## Requirements

  - ARMv7+/x86 CPU
  - systemd-enabled Linux distribution
  - systemd-nspawn for running AceStream engine in chroot-ed environment

## Usage

1. Clone the repo and build a distributable.

    ```bash
    $ git clone https://github.com/miltador/cheapstream
    $ cd cheapstream
    $ ./build.sh [arm|x86]
    ```

2. Edit `dist/start_acestream.sh` according to your needs.
3. Run AceStream engine.

    ```bash
    $ cd dist
    $ ./start_acestream.sh
    ```

## TODO

  - Make x86 port usable (probably need to find perfect donor)
  - Revise and complete android.py RPC responses emulation
  - Set timezone for systemd container properly
  - Pack dnspython lib (`mods/python27/dns`) into an egg
  - etc... Open issues if you have any idea!

## Thanks

Special thanks to [Pepsik](http://mytalks.ru/index.php?action=profile;u=27164) for providing full set of arm libs and improved starting script.

Also thanks to those people who made it possible by providing first ports.

repository: ezequielv/cheapstream

repo_name: ezequielv/cheapstream


text:
# OpenCL Kernel Static Feature Extractor

This program is able to extract static code features such as *number of basic blocks* or *number of compute operations* from an OpenCL kernel. The intent behind it is to collect static code features of multiple kernels to generate training data for machine learning models.

## Feature Extraction Approach

Rather than walking the abstract syntax tree of an OpenCL kernel to collect feature statistics, this program uses *llvm's* C frontend *clang* to translate an OpenCL C file into llvm [bit code](http://llvm.org/docs/BitCodeFormat.html). With *llvm's* [bit code reader API](http://llvm.org/docs/doxygen/html/ReaderWriter_8h.html) the generated code is then parsed and evaluated.

#### Extracted Features
* Functions
* Basic Blocks
* Binary Operations
* Bitwise Binary Operations
* Vector Operations
* Aggregate Operations
* Memory Load Operations
* Memory Store Operations
* Other Operations
* Global Memory Accesses
* Local Memory Accesses
* Private Memory Accesses
* Total Operations

#### Detailed Steps

1. Get OpenCL C kernel file (.cl) from target program.

2. Instrument kernel file with necessary macros to mark global and local memory accesses.

    ```
    #define __global __attribute__((address_space(1)))
    #define __local __attribute__((address_space(2)))
    int get_global_id(int index);
    ```

3. Compile the kernel to llvm bit code using clang and [libclc](https://github.com/llvm-mirror/libclc) header files. For the project clang version 3.8.0 was used.

    LLVM Bitcode:

    ```
    $ clang -include $LIBCLC_HOME/generic/include/clc/clc.h -I $LIBCLC_HOME/libclc/generic/include/ -DBLOCK_SIZE=16 -Dcl_clang_storage_class_specifiers nw.cl -o nw.bc -emit-llvm -c -O3 -x cl
    ```

    LLVM Assembly:

    ```
    $ clang -include $LIBCLC_HOME/libclc/generic/include/clc/clc.h -I $LIBCLC_HOME/libclc/generic/include/ -DBLOCK_SIZE=16 -Dcl_clang_storage_class_specifiers nw.cl -o nw.ll -emit-llvm -S -O3 -x cl
    ```

4. Use LLVM [bitcode reader](http://stackoverflow.com/questions/1838304/call-llvm-jit-from-c-program
) to parse LLVM bc file and extract features using library calls.

#### Example

1. Build the feature extractor with make

    ``` $ make ```

2. Execute it
    ```
    $ ./oclFeatureExt.out -f ./res/kernelSample/nw.bc -o features.csv
    Bitcode file loaded: ./res/kernelSample/nw.bc
    Bitcode parsed successfully!

    ###############################
    #Functions: 6
    #Basic Blocks: 23

    #Bin Ops: 206
    #Bit Bin Ops: 20
    #Vec Ops: 0
    #Agg Ops: 0
    #Load Ops: 86
    #Store Ops: 74
    #Other Ops: 271

    #Global Mem Access: 90
    #Local Mem Access: 70
    #Private Mem Access: 0
    -------------------------------------------
    #Total Ops: 657

    Writing to file: features.csv
    ```

## Python script to find and evaluate multiple kernels
Features are extracted from all kernels found in a subdirectory by running the provided tool after building the feature extractor with make.

```
$ ./tools/collectKernelFeatures.py -d ./res -o ./staticKernelFeatures.csv -l ../llvm_3.7.1/libclc/
```

repository: goesjaya/openCLFeatureExtract

repo_name: goesjaya/openCLFeatureExtract


text:
# MsgPack Java

This is a repackaging of the MessagePack library for Java as a Eclipse Plugin.
I can't take any credit for any Code in this repo!
See https://github.com/msgpack/msgpack-java for details.

This Eclipse plugin is a requirement for the MsgPackEditor plugin that can be
found under https://github.com/m-wichmann/org.freenono.msgpack


text:
### [CVE-2012-1879](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-1879)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

Microsoft Internet Explorer 6 through 9 does not properly handle objects in memory, which allows remote attackers to execute arbitrary code by attempting to access an undefined memory location, aka "insertAdjacentText Remote Code Execution Vulnerability."

### POC

#### Reference
- https://docs.microsoft.com/en-us/security-updates/securitybulletins/2012/ms12-037

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

repository: trickest/cve

repo_name: trickest/cve


text:
# Prefer _.matches

When writing an expression like `a.foo === 1 && a.bar === 2 && a.baz === 3`, it can be more readable to use _.matches.

## Rule Details

This rule takes one argument - the minimal length of the condition (default is 3).

The following patterns are considered warnings:

```js

if (a.foo === 1 && a.bar === 2 && a.baz === 3) {
  //...
}

var bool = a.b === value1 && a.c === value2 && a.d === value3

```

The following patterns are not considered warnings:

```js

var bool = a.b === val1 && a.c === val2 //when length is 3

if (_.matches(a, {foo:1, bar:2, baz:3}) {
  //...
}

```

## When Not To Use It

If you do not want to enforce using `matches`, you should not use this rule.

repository: codacy/codacy-eslint

gha_language: TypeScript

repo_name: codacy/codacy-eslint


text:
# I School Illustrations

A collection of vectors and a 3d model related to Berkeley I School.

![CC0 License Button](https://i.creativecommons.org/p/zero/1.0/88x31.png)
To the extent possible under law, [Soravis Prakkamakul](https://soravis.com) has waived all copyright and related or neighboring rights to I School Illustrations.

## South Hall Line Illustration
![Line Illustration of South Hall](southhall/southhall.png)

## Campanile Line Illustration
![Line Illustration of Campanile](campanile/campanile-berkeley-blue.png)

## Littlest Bear Facade
![Illustration of Littlest Bear](littlest-bear-facade/littlest-bear-facade.png)

## 3D Printed South Hall
![3D Printed Model of South Hall](southhall-3d-print/southhall-3d-print-preview.jpg)
The model could be printed with Jacob Hall's Type A 3D Printer. Consult Jacob Institute design specialists for more details.

repository: imsaberkeley/ischool-illustrations

repo_name: imsaberkeley/ischool-illustrations