text:
---
#
# Use the widgets beneath and the content will be
# inserted automagically in the webpage. To make
# this work, you have to use › layout: frontpage
#
layout: frontpage
header:
  image_fullwidth: header_unsplash_12.jpg
widget1:
  title: "Easy to use"
  url: '/getting-started/'
  text: 'TQL provides a very intuitive Rust-like syntax to do SQL queries and shows good error messages similar to the ones emitted by the compiler itself.'
widget2:
  title: "Efficient"
  url: '/documentation#code-generation'
  text: 'TQL generates the SQL queries at compile-time and thus checks that the good types and identifiers are used at the same time.'
widget3:
  title: "Easy to learn"
  url: '/documentation/'
  text: 'There are extensive resources and examples (not yet) to learn how to use tql.'
#
# Use the call for action to show a button on the frontpage
#
# To make internal links, just use a permalink like this
# url: /getting-started/
#
# To style the button in different colors, use no value
# to use the main color or success, alert or secondary.
# To change colors see sass/_01_settings_colors.scss
#
callforaction:
  url: /getting-started/
  text: Start using TQL now ›
  style: info
permalink: /index.html
#
# This is a nasty hack to make the navigation highlight
# this page as active in the topbar navigation
#
homepage: true
---


text:
# UCloud SDK External Configuration Example

## What is the goal

Load configuration from external storage, sharing configurations across applications built on sdk.

## Setup Environment

```go
export UCLOUD_PUBLIC_KEY="your public key"
export UCLOUD_PRIVATE_KEY="your private key"
```

## How to run

```sh
go run main.go
```

repository: ucloud/ucloud-sdk-go

branch_name: refs/heads/master

extension: md

gha_language: Go

license_type: permissive

repo_name: ucloud/ucloud-sdk-go


text:
# OpenShift Monitoring Scripts

This folder contains a set of scripts related to monitoring / checking of OpenShift or OpenShift-deployed resources.

## check_urls

This script dynamically pulls in the set of routes across all projects in OpenShift and checks them.

Requirements:

* python 3+
* requests lib (eg. ```pip install requests```)

To run:

``` bash
./check_urls.sh
```

There will be "false negatives" due to orphaned routes or broken apps, but the purpose of this script is mainly to check whether the router is experiencing problems, not to test specific apps.

Sample output (names, etc. changed to protect the guilty...):

``` bash
=================
Starting a run.
=================
time='2017-01-07 10:08:45.218158',error=Failed with Exception, project=xyz, route_name=xyz, route=https://xyz.gov.bc.ca, exception='('Connection aborted.', RemoteDisconnected('Remote end closed connection without response',))''
time='2017-01-07 10:07:12.953645', error=Failed with bad status, project=pqr, route_name=pqr, route=http://pqr.gov.bc.ca, response_code=503
=================
Run complete... Grabbing a coffee before next run...
=================
```

## Cluster Pruning jobs

### Registry Prune via OS Cron script (prune.sh)

This script will prune the builds, deployments, and images from the registry. Set up as a cron on one of the master servers.

To create the pruner user for the script

```bash
oc project default
echo '{"kind":"ServiceAccount","apiVersion":"v1","metadata":{"name":"pruner"}}' | oc create -f -
oadm policy add-cluster-role-to-user system:image-pruner system:serviceaccount:default:pruner
oadm policy add-cluster-role-to-user cluster-admin system:serviceaccount:default:pruner
secret=$(oc get sa/pruner --template '{{index .secrets 0 "name"}}')
token=$(oc get secret $secret --template '{{.data.token}}' | base64 -d)
oc login --token $token
oc config view --minify --flatten > pruner.kubeconfig
```

Script will have no output, but will email on error.

### Registry Pruning via Cluster cronjob

Intent is to migrate cluster prune tasks to cluster cronjobs.

* [openshift/cronjobs/README.md](openshift/cronjobs/README.md)

## List of things to be monitored

### critical (alert on issues)

* CPU - reservations per node (alert at 80%?) `oc describe nodes -l region=app | grep -A4 'Allocated resources:' | grep '%' | awk '{print $2, $6}'`
* Gluster thin pool usage
* Gluster volumes for registry, logging, and metrics
* Docker Pool usage - Currently monitored on all hosts with `lvs --noheadings -o data_percent /dev/docker-vg/docker-pool | tr -d [:space:]` and critical alerts at 90% (where docker will break)

### warning (needs a warning to the groups)

* Build times (what should be the threshold?)
* Number of items needing pruning. This can also let us know if the prune cron is failing

### notice (more things to track)

* Disk - How many of each size of persistant volumes are available (Daily/Weekly report?) `oc get pv | grep Available | awk '{print $2}' | sort | uniq -c`

### trending (long term perfomance data)

CPU/MEM/IOPS per project

CPU/MEM/IOPS per pod

repository: riyazuddinsyed/openshift-tools

repo_name: riyazuddinsyed/openshift-tools


text:
## FaceTed backend
[![Build Status](https://travis-ci.com/Ohtu-FaceTed/FaceTed-Backend.svg?branch=master)](https://travis-ci.com/Ohtu-FaceTed/FaceTed-Backend)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/b15f2e53897b445a9b1853cec5797de2)](https://www.codacy.com/manual/kotommi/FaceTed-Backend?utm_source=github.com&utm_medium=referral&utm_content=Ohtu-FaceTed/FaceTed-Backend&utm_campaign=Badge_Grade)
[![Coverage Status](https://coveralls.io/repos/github/Ohtu-FaceTed/FaceTed-Backend/badge.svg?branch=master)](https://coveralls.io/github/Ohtu-FaceTed/FaceTed-Backend?branch=master)

### Front end repo
https://github.com/StatisticsFinland/rakennusluokkahaku-front-end

### Quick Start
```
python -m venv venv/
source venv/bin/activate
pip install -r requirements.txt
python app.py
```

### Documentation

[Developement guide](https://github.com/Ohtu-FaceTed/FaceTed-Search/blob/master/doc/development.md)
[Production guide](https://github.com/Ohtu-FaceTed/FaceTed-Backend/blob/master/documentation/production.md)
[Admin panel documentation](https://github.com/Ohtu-FaceTed/FaceTed-Backend/blob/master/documentation/adminpanel.md)

Database Model
![ModelImage](https://github.com/Ohtu-FaceTed/FaceTed-Backend/blob/master/documentation/dbmodel.PNG)

repository: StatisticsFinland/rakennusluokkahaku

gha_language: Python

repo_name: StatisticsFinland/rakennusluokkahaku


text:
![Banner](https://banners.beyondco.de/laravel-autowire-configs.png?theme=light&packageManager=composer+require&packageName=melchiorkokernoot%2Flaravel-autowire-config&pattern=circuitBoard&style=style_1&description=Allows+configuration+injection+through+auto-wired+constructor+arguments&md=1&showWatermark=0&fontSize=100px&images=https%3A%2F%2Flaravel.com%2Fimg%2Flogomark.min.svg)

# Configuration autowiring and injection

[![Latest Version on Packagist](https://img.shields.io/packagist/v/melchiorkokernoot/laravel-autowire-config.svg?style=flat-square)](https://packagist.org/packages/melchiorkokernoot/laravel-autowire-config)
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/melchiorkokernoot/laravel-autowire-config/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/melchiorkokernoot/laravel-autowire-config/actions?query=workflow%3Arun-tests+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/melchiorkokernoot/laravel-autowire-config.svg?style=flat-square)](https://packagist.org/packages/melchiorkokernoot/laravel-autowire-config)

Enable laravel configuration injection through auto-wired constructor arguments.

```php
class Foo {
    public function __construct(
        #[Config('app.name')]
        public string $myConfiguredAppName,
    ){}
}
```

  * [Installation](#installation)
  * [Configuration](#configuration)
  * [Usage](#usage)
    + [Usage through Custom Application class (Recommended)](#usage-through-custom-application-class-recommended)
    + [Usage through Service provider](#usage-through-service-provider)
      - [Usage through attribute autowiring (AttributeStrategy)](#usage-through-attribute-autowiring-attributestrategy)
      - [Usage through constructor property name autowiring (PropNameStrategy)](usage-through-constructor-property-name-autowiring-propnamestrategy)
      - [Accessing the config values](#accessing-the-config-values)
      - [Typed config classes](#typed-config-classes)
      - [Pitfalls](#pitfalls)
  * [Testing](#testing)
  * [Roadmap](#roadmap)
  * [Changelog](#changelog)
  * [Contributing](#contributing)
  * [Security Vulnerabilities](#security-vulnerabilities)
  * [Credits](#credits)
  * [License](#license)

## Installation

You can install the package via composer:

```bash
composer require melchiorkokernoot/laravel-autowire-config
```

## Configuration

The package will automatically register itself.
You can publish the config file with:

```bash
php artisan vendor:publish --provider="MelchiorKokernoot\LaravelAutowireConfig\LaravelAutowireConfigServiceProvider"
```

> Note that it is not necessary to publish the config file, nor is it necessary to configure the package.
Only change the config file when you know why you are doing it.

This is the contents of the published config file:

```php
return [
    //Either AttributeStrategy::class  or AutowiredPropNameStrategy::class
    'strategy' => PropNameStrategy::class,
];
```

You can choose between two strategies:

- `AttributeStrategy` : Uses attributes to inject the config value.
- `PropNameStrategy` (default): Uses constructor promoted property names to inject the config values.

More on the strategies below.

## Usage
### Usage through Custom Application class (Recommended)

Starting from version 3.0.0, the package can be used through a custom `Application` class. This is the recommended way
of using the package, as it will offer a more "natural" way of using the package.

The only thing one needs to do to enable this behaviour, is to swap out the default `Application` class in
bootstrap/app.php
with the `MelchiorKokernoot\LaravelAutowireConfig\Application` class.

So change this:

```php
$app = new Illuminate\Foundation\Application(
    $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__),
);
```

Into this:

```php
use MelchiorKokernoot\LaravelAutowireConfig\Application;

$app = new Application(
    $_ENV['APP_BASE_PATH'] ?? dirname(__DIR__),
);
```

Advantages of using the custom application class:

- Allows for primitive datatypes (int, float, bool, string) to be injected directly into the constructor, without a
  default value. No more need for wrapping the config value in a typed config class!
- Allows using readonly properties in the constructor

Currently this only works with the attribute strategy, but you do not need to configure this. Once you start using the
new `Application` class, the package will automatically disable old way of using the package, so no resources are wasted
on duplicate resolution.

To demonstrate this, let's take a look at the following example:

```php
class Foo {
    public function __construct(
        #[Config('app.name','default value')]
        public string $myConfiguredAppName,
    ){}
}
```

When resolving this `Foo` class from the container, the package will automatically resolve the config value for
`app.name` and inject it into the `$myConfiguredAppName` property.

### Usage through Service provider

Starting from Version 2.0.0 the package can be used in two ways:

#### Usage through attribute autowiring (AttributeStrategy)

Firstly, implement the `AutowiresConfigs` interface on your class.
Typehint one of the [typed config classes](#typed-config-classes) in your constructor, and use that typehint as an
attribute on the property, finally pass the config key as the attribute value.

```php
class Foo implements AutowiresConfigs{
    public function __construct(
        #[StringConfig('app.name')]
        public StringConfig $appName,
    ){}
}
```

> Note you do not have to name the variable to match the config key now, but you still have to type-hint the config
> class.

When using this class from the container (through dependency injection e.g.), the config value will be injected as if
you do this:

```php
$foo = new Foo(config('app.name'));
```

#### Usage through constructor property name autowiring (PropNameStrategy)

Firstly, implement the `AutowiresConfigs` interface on your class.
Typehint one of the [typed config classes](#typed-config-classes) in your constructor, and use the camelCase version of
the config key as the
property name.

```php
class Foo implements AutowiresConfigs{
    public function __construct(
        public StringConfig $appName,
    ){}
}
```

> You need to match the config key to the property name, so `app.name` will become `appName`.

When using this class from the container (through dependency injection e.g.), the config value will be injected as if
you do this:

```php
$foo = new Foo(config('app.name'));
```

The benefit of this, is that you keep a clear separation between your application logic and your configuration layer.
No more service locators, no more `config()` calls in your code, just clean dependencies.

#### Accessing the config values

```
This way of access is only required when NOT using the custom Application strategy
```

Because the config values are wrapped in a typed config class, you cannot access the value directly. Instead, you can
access the value through the `value` method. For convenience, the `__toString` magic method is also implemented, so you
can use the config value as a string (in the case of a value that can be casted to a string,of course) directly.
Furthermore, the shorthands `$object->config->v()`and `$object->config->v()` are also available for accessing the value.

```php
class Foo implements AutowiresConfigs{
    public function __construct(
        public StringConfig $appName,
    ){}

    public function bar(){
        //Casting to string
        (string) $this->appName

        //Shorthand method call
        $this->appName->value->v();

        //Shorthand property access
        $this->appName->value->v;

        //Ordinary method call
        return $this->appName->value();
    }
}
```

#### Typed config classes

The following config classes are available:

- `ArrayConfig`
- `BooleanConfig`
- `IntegerConfig`
- `NullableArrayConfig`
- `NullableIntegerConfig`
- `NullableStringConfig`
- `StringConfig`

#### Pitfalls

This package hooks into the afterResolving callback, which means that it will only work for classes that are resolved
through the container. This that the config values will only be populated after the constructor has been called, so the
values will not be available in the constructor.

## Testing

```bash
composer test
```

## Roadmap

- [X] Add support for primitive types when using the custom `Application` class
- [X] Add support for readonly properties when using the custom `Application` class
- [ ] Add support for configuring the way values should be unwrapped (disable shorthand `v()` for example)

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

## Security Vulnerabilities

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

## Credits

- [MelchiorKokernoot](https://github.com/MelchiorKokernoot)
- [All Contributors](../../contributors)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

license: MIT

branch_name: refs/heads/main

gha_language: PHP

gha_license_id: MIT


text:
---
layout: post
title: John Hu's Bugzilla
description: "Mozilla job retrospective: bugzilla logs"
modified: 2015-09-24
tags: [mozilla]
image:
  path: /images/mozilla-bugzilla-logs.png
  feature: mozilla-bugzilla-logs.png
---

## September 2015

I left mozilla at September 2015. It's a special adventure at the mozilla. I learned the mozilla's JavaScript coding styles, review rules, module owner/peer system, automation tests, tree tacking, and the most important open web culture. The best part at mozilla is to know a lot of talent engineer.

At mozilla, I did a small amount of jobs. The best retrospective is to see the Bugzilla statistics. It shows the works done during these 3 years:

1. 309 bugs, 0.5 bugs filed per day

2. 3366 comments, 5 comments made per day

3. 183 patches submitted, 0.25 patches submitted per day

4. 239 patches reviewed, 0.33 patches reviewed per day


text:
[![Build Status](https://travis-ci.org/regwez/Bezr.svg?branch=master)](https://travis-ci.org/regwez/Bezr)
![macOS](https://img.shields.io/badge/os-macOS-green.svg?style=flat)
![Linux](https://img.shields.io/badge/os-linux-green.svg?style=flat)
<!-- ![Platforms](https://img.shields.io/badge/platforms-Linux%20%7C%20iOS%20%7C%20macOS%20%7C%20watchOS%20%7C%20tvOS-lightgrey.svg?style=flat) -->
![Swift 3.0.x](http://img.shields.io/badge/Swift-3.0.x-orange.svg?style=flat)

[![License](https://img.shields.io/github/license/regwez/Bezr.svg)](https://github.com/regwez/Bezr/blob/master/LICENSE)

# Bezr

An ultra-fast compact data structure and sorting package written in pure swift. The idea is to build a library that is focused on high speed data manipulations with a small memory foot print.

Current it includes array searching, sorting and set operations. It works with objects as well as primitive types.

The name Bezr (bb-zz-r) is Arabic for seeds.

Prerequisites
-------------

 - Current Version requires Swift 3.0 or better

To build the project you need XCode 8.2 and command line tools or Swift for linux tools.

TODO
-----------
*   Pick better naming

Contributing
------------

Contributions are invited.

License
-------
Apache 2.0

repository: regwez/Bezr

repo_name: regwez/Bezr


text:
[ReadMe URL](https://josh-been.github.io/Webinar-Mapping-2016-Presidential-Election-Using-Tableau-Desktop/)

# Webinar Description

**Date/Time**: January 12, 11am

**Title**: Hands-On Tableau Desktop: Mapping the 2016 Presidential Election

**Description**: Participants of this introductory webinar will gain hands-on experience generating interactive maps and map-centric dashboards using Tableau Desktop. The content we will focus on during this webinar will be 2016 Presidential election results by voter tabulation district in Texas and Census data from the American Community Survey. (Unfortunately, it is too early to obtain 2020 results by VTD. Stayed tuned for future mapping workshops when 2020 data is released.)
 - Click to Explore Finished Product
 -
  - [Download TWBX](https://github.com/Josh-Been/Webinar-Mapping-2016-Presidential-Election-Using-Tableau-Desktop/blob/main/Files/TDL%20GISIG%20Dashboard%20-%20Mapping%202016%20Election.twbx) - Requires Tableau Professional to Use (*not Tableau Public*)

**Participation**: Participants can follow along or sit back and watch. To follow along, please install Tableau Desktop prior to the webinar starting.

**Presenters**:
 - Leading - [Joshua Been, Baylor University](https://www.baylor.edu/library/index.php?id=969726)
 - Assisting - [Kristina Claunch, Sam Houston State University](https://shsulibraryguides.org/prf.php?account_id=249033)

# Tableau Software

**Tableau Desktop Software Options** Either Tableau Desktop Public (freely available) or Tableau Desktop Professional (fee-based, free to students and teachers) will work perfectly for this webinar.
1. [Tableau Desktop Public](https://public.tableau.com/en-us/s/)
2. [Tableau Desktop Professional (student license)](https://www.tableau.com/academic/students)
3. [Tableau Desktop Professional (teacher license)](https://www.tableau.com/academic/teaching)

# Webinar Data

[Zip Archive of All 3 Files](https://github.com/Josh-Been/Webinar-Mapping-2016-Presidential-Election-Using-Tableau-Desktop/raw/main/Files/Tableau-I-Data.zip)
 - [Backup on Baylor's OneDrive](https://baylor0-my.sharepoint.com/:u:/g/personal/joshua_been_baylor_edu/ESl_zYE_vJVLghLNpaZOAdMBRsvNRz3vkNyj3hn7Ugv3hA?download=1)

*Data from Texas Legislative Council*
1. [Texas Voter Tabulation District (VTD) Shapefile](https://data.capitol.texas.gov/dataset/vtds)
2. [2016 General Election Data](https://data.capitol.texas.gov/dataset/2016_general) - The election data included in the *zip archive* has been pre-processed. The complete 2016 election data was filtered and pivoted for Presidential votes and then percent votes were calculated for each candidate.

*Data from U.S. Census*

3. [Census American Community Survey (5 year, 2012-2016)](https://www.census.gov/programs-surveys/acs/data.html) - This Census data included in the *zip archive* has been pre-processed. Data was downloaded for Census Block Groups and approximated to VTD polygons using an area-weighted spatial join approach using ArcGIS.

# Webinar Steps

## Step #1: Explore 3 Prepared Datasets
1. Download [Zip Archive of All 3 Files](https://github.com/Josh-Been/Webinar-Mapping-2016-Presidential-Election-Using-Tableau-Desktop/raw/main/Files/Tableau-I-Data.zip)
2. Unzip the contents [help unzipping](https://www.wikihow.com/Unzip-a-File)
3. Explore (preview) the demographics.xlsx file using Excel.

## Step #2: Visualize Census Data

1. Load demographics.xlsx File into Tableau Desktop
 - Launch Tableau (*can be either Tableau Public or Professional*)
 - Click *Connect/To a File/Microsoft Excel* and browse to the demographics.xlsx file.
 - Click the orange *Sheet 1* button
2. Create Treemap Visualization Showing Income by County
 - Select County under Dimensions
 - Hold CTRL and select Income under Measures
 - Under Show Me on the right, click TreeMap
3. This is not correct, is it? Let's correct the aggregation.
 - Click the Undo button at the top left of the screen
 - Right-click Income, under Measures, and select Deafult Properties/Aggregation/Average
 - Now recreate Treemap
3. Change Visualization to Packed Bubbles
 - Click the Packed Bubbles button on the Show Me tab
 - Drag Income under Measures to the Color box
 - Click the Color box and then click Edit Colors to adjust the color scheme.
4. Change Visualization to Highlight Table
 - Click the *Highlight Table* icon on the Show Me tab
 - Click the *Descending* button on the top toolbar.
5. Rename and Duplicate Sheet 1
 - Right-click *Sheet 1* and select *Rename*
 - Raname to *Highlight Table*
 - Right-click *Highlight Table* and select *Duplicate*
 - Rename the new sheet County Map
6. Change Visualization to County Map (*finally, right?*)
 - Change visualization to Map (polygons)
 - Click the Map button on the Show Me tab
 - Click the 99 Unknown tag that appears on the bottom right of the map
 - Select *Edit Locations*
 - Under State/Province, select Fixed and then Texas.
 - OK
7. Change map colors from Income to % Hispanic
 - Don't forget to change aggregation to *Average*!
8. Adjust Basemap Layers
 - On the top toolbar, click Map and then *Map Layers*
 - Style can be adjusted
 - Individual layers can be adjusted within any style

## Step #3: Integrate Election Data

1. Load Pres2016.xlsx File
 - Explore the pres2016.xlsx table using Excel.
 - Click Data Source on the bottom left of the screen
 - Click the blue Add button and click Microsoft Excel
 - Select the pres2016.xlsx file
 - Drag *presidential* to the window next to *demographics*. This should automatically connect to the *demographics* table and the Edit Relationship window will appear.
 - The default Cntyvtd will connect to the Cntyvtd1 column.
 - Click the *County Map* tab
 - Now both tables are available.
2. View % Votes for Trump in 2016 by County
 - Aggregation fix is necessary again!
 - Drag *Trump* to Color Box.

## Step #4: Integrate VTD Boundaries

1. Load VTDs.shp Shapefile
 - Click Data Source on the bottom left of the screen
 - Click the blue Add button and click Spatial file
 - Browse and select the VTDs.shp shapefile
 - Drag *VTDs* to the window next to *demographics*.
 - The default relationship is perfect
2. Create a New Sheet
 - Rename the New Sheet *VTD Map*
3. Map Data Using VTD Boundaries
 - In the Table of Contents on the left, double-click *Geometry* under VTDs.
 - Drag CNTYVTD to the Detail Box
 - Drag % Votes for Clinton to the Color Box
4. Remove polygon booundaries to view urban VTDs
 - Click the Color Box
 - Change *Border* to *None*
5. Add Filter for County
 - Right-click *County* under the demographics table and select *Show Filter*
 - Hide the Show Me tab if visible
 - Under the County filter options, select *Multiple Values Dropdown*

## OPTIONAL Step #5: Dynamic Dropdown to Adjust Color
1. Create a new *Parameter* to hold color background choices
 - Name the Parameter Choose Variable
 - Data Type: String
 - Allowable Values: List
 - Under List of Values, enter *Income*, *% Clinton*, *% Trump*
 - OK
 - From the new *Parameters* list on the bottom left, right-click Choose Variable and click *Show Parameter*
2. Create a new *Calculated Field* to hold values of selection
 - Name the Calculated Field *Variable Placeholder*
 - Formula:

      IF [Choose Variable]="Income" THEN [Income]

      ELSEIF [Choose Variable]="% Clinton" THEN [Clinton]

      ELSEIF [Choose Variable]="% Trump" THEN [Trump]

      END

3. Drag Variable Placeholder to the Color Box
4. Nice, huh?
5. Navigate to the *Highlight Table* sheet
 - Set default aggregation for *Variable Placeholder* to Average
 - Drag *Value Placeholder* to the Color Box
5. Navigate to the *County Map*
 - Drag *Value Placeholder* to the Color Box

## Step #6: Create & Publish Dashboard
1. Set the Page Size
 - Click the *New Dashboard* icon
 - Under *Size* click the size suggested
 - Change *Fixed* to *Automatic*
2. Drag Sheets to arrange as you see fit
3. Set the *County* filter to Apply to Worksheets/All
4. **Publish Steps - If Using Tableau Professional**
 - CLick Data/demographics/Extract Data
 - Click Extract
 - Click Server/Tableau Public/Save to Tableau Public
5. **Publish Steps - If Using Tableau Public**
 - Click File/Save to Tableau Pubic


text:
DashProject
===========

An amateur 2D action game for Android touchscreen.

(Please, excuse my english. Corrections for both english and code are welcome!)

The idea is to provide a frantic experience using a very simple control. The atmosphere mixes sci-fi technology and medieval features.

Each level consists in a top-down tiled map where you can freely move the hero looking for enemies (with a simple radar support) to defeat them in a race against time. The hero moves teleporting to nearby places. He attacks automatically to nearby enemies using swords.

There are high and low obstacles. The hero can take cover behind low obstacles only when he is near to them.

There will be combos and special attacks.

If development progresses fast enough (what's this?) the game will have an adventure context with some brief cutscenes.

This game is developed using LibGdx (thanks Mr. Zechner). It can be tested on desktop machines with Java (Windows, Linux and Mac OS X) using the mouse but the target platform is Android touchscreen.

The current prototype is still being expanded. Then, it will be entirely refactored.

-------------
Another game from the author is "Boo & Marung":
https://play.google.com/store/apps/details?id=devnatres.android.boomarung
It was made in Java completely from scratch, without third-party libraries nor frameworks (not even OpenGL).

repository: devnatres/DashProject

repo_name: devnatres/DashProject


text:
# Saad and Issa's use of AI in journalism

Go back to [[Week 3 - Introduction]]

---

	Now there are 5 uses of artificial intelligence in journalism
	1. Tracking breaking news to alert journalists with new information related to the event.
	2. Conducting a search faster and  more accurately, linking information  quickly and  efficiently, and converting it into graphic forms.
	3. Automatically correctlanguagespelling and grammar.
	4. Quickly and reliably examine facts and discover fake news, such as the algorithms that Facebookbegan using in order to get rid of fake news.
	5. Automatically generate short news on topics based on statistical data.

(Page 10)

---

Integration or Replacement: Journalism in the Era of Artificial Intelligence and Robot Journalism

Go back to the [[Readings list]] or the [[Master of Philosophy - Main Page]]

Reference: Saad Saad, D., & Issa, T. A. (2020). Integration or Replacement: Journalism in the Era of Artificial Intelligence and Robot Journalism. International Journal of Media, Journalism and Mass Communications. 6(3).

The [relevant section is available here.](https://www.researchgate.net/profile/Saad_Saad13/publication/343263293_International_Journal_of_Media_Journalism_and_Mass_Communications_IJMJMC_Page_1_Integration_or_Replacement_Journalism_in_the_Era_of_Artificial_Intelligence_and_Robot_Journalism/links/5f203ecd92851cd5fa4e48e1/International-Journal-of-Media-Journalism-and-Mass-Communications-IJMJMC-Page-1-Integration-or-Replacement-Journalism-in-the-Era-of-Artificial-Intelligence-and-Robot-Journalism.pdf).

#AIBusinessCase

url: https://raw.githubusercontent.com/KGBicheno/KGB_Agora/70ea95c9d38ab2f31abbd510691bb4c050a6cb3b/Artificial Intelligence/Introduction to AI/Week 3 - Introduction/Saad and Issa's use of AI in journalism.md


text:
---
layout: index
title: Text formatting
---

Up until now, our Quest game has been entirely plain text. In this section, we'll look at jazzing things up a bit, and, on the next section, including pictures, sounds and video.

Setting the Default Font and Colours
------------------------------------

To change the default font and colours used throughout your game, select "game" from the tree and go to the Display tab.

Here you can set the initial font, foreground, background and hyperlink colours.

Changing Fonts and Colours during the Game
------------------------------------------

You can also change the font and colours while the game is in progress. You can do this using script commands. The commands are all in the "Output" category - you can change the foreground and background colour, and also the font and font size.

Bold, Italic, Underline
-----------------------

You can use HTML-style formatting to set bold, italic and underline. For example, when printing a message, you can type this:

     This text is bold. This text is italic. This text is underlined.

This will output:

This text is bold. This text is italic. This text is underlined.

Other Options
-------------

Quest allows players to interact using hyperlinks, via the panes on the right and the command bar. You might feel this is overkill, and would prefer to have only one or two of these options in your game. You can turn these features off on the game object. Hyperlinks can be turned off on the Features tab, whilst the command bar and panes can be turned off on the Interface tab (just make sure your game can be completed if you choose to turn off the command bar!).

The Room Descriptions tab gives a lot of options for what the player sees upon entering a room. You might prefer to have the object list after the description, for example.

There are a host of options there to make your game stand out.

[Next: Multimedia](multimedia.html)

repository: timgen/quest

repo_name: timgen/quest


text:
# docker-nginx-static

Docker container for serving static content using nginx

## Executing

    docker run --name "my-nginx" -P -v $(pwd)/example-content:/var/www jojomi/nginx-static

Find your container:

    docker ps | grep "my-nginx"
    CONTAINER ID        IMAGE                           COMMAND                CREATED             STATUS              PORTS                   NAMES
    ba00b5c238fc        jojomi/nginx-static:latest   "nginx -D -f /etc   1 second ago        Up 1 second         <IP_ADDRESS>:49153->80/tcp   my-nginx

Check if it works:

    curl localhost:49153
    This is your content.

## Building The Image Yourself (optional)

    docker build -t jojomi/nginx-static .

The image is conveniently small at **below 7 MB** thanks to [alpine](http://gliderlabs.viewdocs.io/docker-alpine):

    docker images | grep nginx
    jojomi/nginx-static   latest              b2e7a8364baa        1 second ago      6.498 MB

repository: Pinaute/docker-nginx-static

repo_name: Pinaute/docker-nginx-static


text:
# Pizza Order Form

#### Order form for pizza business, 11/6/17

#### By Kevin Babcock

## Description

This application is a pizza order form. It has an option for the user to select a delivery or not, size, curst, sauce, crust, flavor, and both meat and veggie toppings. After a pizza is complete, the user submits the form and the pizza is displayed, along with an address form if delivery is requested. The user may see the details of each pizza by clicking on the pizza. The bottom on the page shows the total cost of all pizzas for the order and delivery details if applicable.

## Setup/Installation Requirements

* go to github.com/kevinmbabcock
* Select 'Repositories'
* Open pizza-order
* Fill out the form

## Known Bugs

* If multiple pizzas are added before delivery address is submitted, delivery address will appear more than once
* If multiple toppings are added, forms won't hide after submission.

## Support and contact details

Email<EMAIL_ADDRESS>
## Technologies Used

JavaScript, HTML, CSS

### License

MIT

Copyright (c) 2017 **Kevin Babcock, Epicodus**

repository: kevinmbabcock/pizza-order

repo_name: kevinmbabcock/pizza-order


text:
# Object Fit Picture Tag Polyfill [![badge-size]](#no-link) [![npm version][badge-version]][link-npm]

[badge-size]: http://img.badgesize.io/chrisboakes/object-fit-picture-tag-polyfill/master/dist/object-fit-picture-tag-polyfill.min.js
[badge-version]: https://img.shields.io/npm/v/object-fit-picture-tag-polyfill.svg
[link-npm]: https://www.npmjs.com/package/object-fit-picture-tag-polyfill

> Cross browser CSS object-fit support for picture tags

- Fast and lightweight
- No framework dependencies
- Works with both ```<picture>``` and ```<img>``` tags

## Installation
However you like:
```html
<script src="dist/object-fit-picture-tag-polyfill.min.js"></script>
```

```sh
npm install --save object-fit-picture-tag-polyfill
```

## Usage
1. Append your ```<picture>``` tags with either ```data-object-fit-cover``` or ```data-object-fit-contain```

2. Import the plugin
    ```js
        import objectFitPolyfill from 'object-fit-picture-tag-polyfill';
    ```
3. Instantiate the class and pass it any options
    ```js
        new objectFitPolyfill({
            fitPosition: 'center center'
        });
    ```
4. (optional) if you want to reinitialise the script you can call the ```init()``` method directly (after the class has been initialised)
    ```js
        let polyfill = new objectFitPolyfill();

        polyfill.init();
    ```

## Parameters
### `(fitPosition, addContainer)`

        parameter
        description

        fitPosition

            Type: string

            Default: 'center center'

            The background-position of background-image

        addContainer

            Type: boolean

            Default: true

            If set to true, the div which has your background-image will be wrapped in a parent div with relative positioning. The parent div will keep the class and id of your picture tag. If set to false, there will be no wrapping div and your background-image div will keep the class and id of your picture tag.

MIT © [Chris Boakes](https://twitter.com/cboakes)


text:
# npm-package-mixed-multiple-versions-demo

Demo project for mixing multiple version of the same npm package in a project.

## Installation

    npm install

## Usage

1. Create local package `lodash3` and `lodash4`
    - These wrap of `lodash@3` and `lodash@4`
2. Install as local dependencies(`file:`)
    - `npm i -S packages/lodash3 packages/lodash4`
3. Use it!

```js
"use strict";
var assert = require("assert");
var lodash3 = require("lodash3");
var lodash4 = require("lodash4");

assert(lodash3.VERSION.includes("3"));
assert(lodash4.VERSION.includes("4"));
```

## Real UseCase

- [Add support for ESLint v2 by Daniel15 · Pull Request #107 · fkling/astexplorer](https://github.com/fkling/astexplorer/pull/107/files#diff-b9cfc7f2cdf78a7f4b91a753d10865a2R52 "Add support for ESLint v2 by Daniel15 · Pull Request #107 · fkling/astexplorer")

## Tests

    npm test

## Contributing

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3.  Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

## License

MIT


text:
# Java - TarotCards

 ## Context
 TarotCards is a Java school project carried out in December 2020.

## Architecture
-----------
| **Classes**   | **Methodes**  |
| ------------- | -----:        |
| TarotCard     | getCars, addCard, removeCard, searchCards, save |
| Card          | setDescription, setDescription |
| Action        | displayCard, addCard, editCard, removecard, searchCard, save |
| Menu          | displayChoices, quickMenu (calls an action), executeAction |
| MinorCard     | toString, editCard, getCardImage |
| MajorCard     | toString, editCard, getCardImage |
| ButtonAction  | displayChoices, quickMenu (calls an action), executeAction |

**Main :**
This class initialize and modifies the Main view and define event handlers for the objects.

**Menu :**
This class initialize and modifies the Deck view .

**Tarot :**
This class creates a tarot deck using the a List/ArrayList as a data structure to store all the cards .

**TarotCards :**
This class creates a tarot deck using the a List/ArrayList as a data structure to store all the cards .

**Actions :**
This class initialize and modifies the Reading view and define event handlers for the objects.

**Card :**
This class is used to create two types of cards a major card and a minor card.

**MajorCard :**
This class is a concrete implementation of the Card class it adds a cardMessage object, that is unique to major cards.

**MinorCard :**
This class is a concrete implementation of the Card class it adds a cardDomain object, that is unique to major cards.

**Window :**
This class initialize and modifies the Main view and define event handlers for the objects.

## Difficulty and solution
The biggest difficulty was making the interaction between interfaces and the underlying code.
The serialization works well but the deserialization JSON to object has been abandoned.
I spent a lot of time to achieve an unconvincing result. The program with the console works very well but the interface is not yet finished due to lack of time.

## Conclusion
It's a very interesting project, it allowed me to understand a lot of things like serialization, interfaces and also many other functionalities that Eclipse hides.


text:
---
layout: post
title: Weekly Readings 2022-15
categories: [notes]
excerpt: All the good stuff of the week.
last_modified_at:
---

- Migrations Guides
    - [Migrations Done Well: Typical Migration Approaches](https://blog.pragmaticengineer.com/typical-migration-approaches/)
    - [Migrations Done Well: Executing Migrations]([https://blog.pragmaticengineer.com/migrations-done-well-executing-them/)

- [Beyond Lean and Agile](https://svpg.com/beyond-lean-and-agile/)
    - Sometimes you get stuck in a project for so long that you become tied to an specific way of working. You start to create attachments to things you shouldn't: sprints, tasks, code, plannings. Our work as software engineers is dynamic, products are expected to change in order to find market fit and our work is to allow this change. Always remember:
        - 1. Tackle the big risks early – especially value risk and business risk
        - 2. Figure out solutions collaboratively – engineering, design, and product, working side-by-side
        - 3. Focus on solving problems – it’s not about features or a roadmap; it’s about delivering results

- [Searching for outliers](https://www.benkuhn.net/outliers/)
    - When working on problems, it's usefull to think about heavy-tailed/light-tailed distributions. On light-tailed distributions the difference between the best and the average is small, however, for heavy-tailed distribution the difference between the best and the average can be 50x, 100x. The knowledge of the distribution type is crucial to make the judgement call to stop or keep searching for the outlier.
    <img src="/images/2022-04-12-what-i-read-this-15week/plot.svg" alt="Distributions" style="width:400px;"/>

- [The Saff Squeeze](https://blog.thecodewhisperer.com/permalink/the-saff-squeeze)
    - Here is the Saff Squeeze in one sentence: inline parts of a failing test until the reason for the failure becomes obvious.

gha_language: SCSS


text:
# TIME SERIES ANALYSIS
# INTRODUCTION
* Time series analysis is a statistical technique that deals with time series data, or trend analysis.  Time series data means that data is in a series of  particular time periods or intervals.
* Most of business houses work on time series data to analyze sales number for the next year, website traffic, competition position etc.
# WHAT IS TIME SERIES DATA?
* A time series is a series of data points indexed (or listed or graphed) in time order. Thus it is a sequence of discrete-time data.
* A time is a sequence taken at successive equally spaced points in time.
# WHAT IS TIME SERIES FORECASTING ?
* Time Series Forecasting is the use of statistical models to predict future values based on past results.
* What kind of variables can we forecast? : Any variable that can be tracked and collected over the time.
# COMPONENTS OF TIME SERIES DATA?
* Time Series data collected over a period of time is influenced by a variety of factors.
* Classified mainly four types
  - Trend
  - Seasonality
  - Cycling
  - Irregularity
* First three components - deterministic — also known as “signals”.
* Last component - random variable — also called “noise” - ‘in-deterministic’ component.
* For proper forecast — one must know to what extent each component is present— remove / analyze the component
### 1. ***TRENDS***
  * Trend is a gradual shift or movement to relatively high and low values over a long period of time.
  * Higher lows to higher highs in the plot signify uptrend.
  * Lower highs to lower lows in the plot signify downtrend.
  * If there is no trend it is called horizontal or stationary trend.
### 2. ***SEASONALITY***
  * Seasonality refers to periodic fluctuations.
  * For example, electricity consumption is high during the day and low during night, or online sales increase during Christmas before slowing down again.
### 3. ***CYCLING***
  * Patterns in data that do not fall in the same calendar year.
  * Cyclical patterns exist when data exhibits rises and falls that are not of a fixed period.
  * Examples are business like cycles, lasting several years, length of the current cycle is unknown before hand.

# TIME SERIES FORECASTING METHODS
### 1. ***Average Method***:
* The forecast of all future values are equal to the average of all past vales.
* In essence, what will happen tomorrow is the average of everything that has happened till now.
### 2. ***Moving Average Method***:
* The forecast of all future values are equal to the average of the time series for a defined number of time periods.
* In essence, what will happen tomorrow is the average of everything that has happened in last 3 months.
*  We can decide the duration of time period for averaging.
### 3. ***Naive Method***:
* The forecast of all future values are equal to the value of the last observation.
* In essence, what will happen tomorrow is what happened yesterday.
### 4. ***Seasonal Naive Method***:
* The forecast of all future values are equal to the value of the last year’s observation in the same month.
* In essence, what will happen tomorrow is what happened same day last year.
* Assumes magnitude of the seasonal pattern will remain constant.
### 5. ***Simple Linear Model***:
* Similar to linear regression
* Does not take trend into account.
* Does not take Variance into account.
* Does not take Seasonality into account.
### 6. ***Weighted Moving Average***:
* A Moving average where some time periods are weighted differently than others is called as weighted moving average.
* Sometimes (especially when the trend is too high or too low), we may need to give extra weightage for a particular time period data.
* It will be more meaningful if the weights for older time period is smaller than the weights for recent time period.

### 7. *Exponential smoothing*:
* Exponential smoothing method compares past data from previous time periods with exponentially decreasing importance in the forecast so that the most recent data carries more weight in the moving average.
* Simple exponential smoothing method is helpful in forecasting the value for the present time period X, using an exponential smoothing constant a (falling between 0 and 1).

# ACCURACY OF FORECAST
If , represents the forecast and , represents demand for a period , then following measures are used to check accuracy of the forecast.
* The forecast error for the period  is given as :

* Average error over n period is given as :

* Another terminology bias is used show the sum of errors :

* As the average error cancels positive and negative errors, in most of the situations, mean absolute deviation error is used:

* A measure which is closely related to the MAD, but which expresses the magnitude of the error relative to the magnitude of the demand is known as the mean absolute percentage error, or MAPE.

* Another measure of average error is known as the mean squared error, or MSE.

* The square-root of MSE is called as RMSE, and least RMSE is always expected for a better accuracy in forecasting.
* To automatically detect when a forecast model is no longer producing good forecasts, a measure known as a ***tracking signal*** is often used.

* This tracking signal is a measure that can be used in a control-chart-like manner so that when an out-of-control state is reached, the forecasting model can be revised to get things back in control.
* By dividing the bias by the MAD, the control limits for this “unit-less” measure are the same for every product being forecast and therefore separate control limits need not be kept for each product.
* Instead, a common rule of thumb is **when the tracking signal reaches a value of positive or negative “6”, it is time to investigate the forecasting model**.

# ARIMA MODEL
* ARIMA, short for ***‘Auto Regressive Integrated Moving Average’*** is actually a class of models that ‘explains’ a given time series based on its own past values, that is, its own lags and the lagged forecast errors, so that equation can be used to forecast future values
### Step 1 : Checking the data for Stationarity
* One way is looking the plot of the data - check whether it looks like a white noise
* Second method is - a statstical test called as Augmented Dickey -Fuller test
* **Augmented Dickey -Fuller test**
  - We will take Null Hypothesis as : The time series data is stationary.
  - Alternative Hypothesis is : The Time series data is non-stationary.
  - If the test-statistic value of Dickey Fuller test is lesser than the critical value (at 1% or 5% or 10% confidence interval),then we can say that null hypothesis is accepted at a particular confidence level.
  - If the test-statistic is greater, we have to reject null hypothesis
### Step-2 : Making the data for Stationarity
* One of the tricks to reduce trend can be transformation. For example, in the current example, we can clearly see that the there is a significant positive trend. So we can apply log-transformation which penalize higher values more than smaller values.
* Then we can go for differencing the time-series data.
### *Step 3*: Plot PACF and ACF
* **ACF**
  - It is an (complete) auto-correlation function which gives us values of auto-correlation of any series with its lagged values.
  - In simple terms, it describes how well the present value of the series is related with its past values.
  - A time series can have components like trend, seasonality, cyclic and residual.
  - ACF considers all these components while finding correlations hence it’s a ‘complete auto-correlation plot’.
* **PACF**
  - PACF is a partial auto-correlation function.
  - Basically instead of finding correlations of present with lags like ACF, it finds correlation of the residuals (which remains after removing the effects which are already explained by the earlier lag(s)) with the next lag value hence ‘partial’ and not ‘complete’ as we remove already found variations before we find the next correlation.
  - So if there is any hidden information in the residual which can be modeled by the next lag, we might get a good correlation and we will keep that next
### STEP 4 : Build ARIMA Model
* An ARIMA model is characterized by 3 terms: p, d, q

where,

  p is the order of the AR(Auto Regressive) term

  q is the order of the MA(Moving Average) term

  d is the number of differencing required to make the time series stationary
### Step 5 :Forecasting for future time period


text:
# jenkins
jenkins

Find initial passowrd (token) in console log after first start.

## Note

If an error occurred during installation: No such plugin: cloudbees-folder
see: http://stackoverflow.com/questions/37358775/jenkins-2-5-installation-error-an-error-occurred-during-installation-forbidden
`http://jenkins.internal:18083/restart`

## References

[https://github.com/jenkinsci/docker](https://github.com/jenkinsci/docker)
[https://hub.docker.com/_/jenkins/](https://hub.docker.com/_/jenkins/)

repository: ci-and-cd/docker-ci

repo_name: ci-and-cd/docker-ci


text:
---
layout: post
title: "Strategies to architect AI Safety: Defense to guard AI from Adversaries"
date: 2019-06-08 14:34:47
categories: arXiv_AI
tags: arXiv_AI Adversarial Represenation_Learning Inference RNN Deep_Learning
author: Rajagopal. A, Nirmala. V
mathjax: true
---

* content
{:toc}

##### Abstract
The impact of designing for security of AI is critical for humanity in the AI era. With humans increasingly becoming dependent upon AI, there is a need for neural networks that work reliably, inspite of Adversarial attacks. The vision for Safe and secure AI for popular use is achievable. To achieve safety of AI, this paper explores strategies and a novel deep learning architecture. To guard AI from adversaries, paper explores combination of 3 strategies:
 1. Introduce randomness at inference time to hide the representation learning from adversaries.
 2. Detect presence of adversaries by analyzing the sequence of inferences.
 3. Exploit visual similarity.
 To realize these strategies, this paper designs a novel architecture, Dynamic Neural Defense, DND. This defense has 3 deep learning architectural features:
 1. By hiding the way a neural network learns from exploratory attacks using a random computation graph, DND evades attack.
 2. By analyzing input sequence to cloud AI inference engine with LSTM, DND detects attack sequence.
 3. By inferring with visual similar inputs generated by VAE, any AI defended by DND approach does not succumb to hackers.
 Thus, a roadmap to develop reliable, safe and secure AI is presented.

##### Abstract (translated by Google)

##### URL
[http://arxiv.org/abs/1906.03466](http://arxiv.org/abs/1906.03466)

##### PDF
[http://arxiv.org/pdf/1906.03466](http://arxiv.org/pdf/1906.03466)


text:
# Entity Relationship Diagram for Brewed Awakenings

Look in the `database.js` module and identify the resources, the fields/attributes on each resource, and the relationship between the three resources used by the application.

1. Products
1. Employees
1. Orders

Use dbdiagram to visualize your database.

There should be two 1 -> many relationships visualized in your ERD. They both will converge on a single entity.

This is a great opportunity to discuss these concepts with your teammates and your instruction team, because if you don't understand your data structure, data types, and relationships, then it simply doesn't matter how much knowledge you have of a programming language.

All programming languages are written with one goal in mind - how to manipulate and represent data that is stored in a database.

It is crucial that you spend time **now** to get the basic vocabulary and understanding of these concepts.

gha_language: Shell


text:
# Assassin Game Conceptualizations

Billy Uglieur creates a new game. He calls it "Billy's Epic Game." In the description, he writes "Please see my website for the rules."

Internally, the client ought to tell the server about this. Perhaps a POST request to `/assassin/new-game` with Billy's session ID and:

```json
{
  "name": "Billy's Epic Game",
  "description": "Please see my website for the rules."
}
```

The server creates the game. This is stored in a separate database mapping a game ID to its object. The game ID also gets put in Billy's user object so he can access a list of his games. The server returns the game ID, and the client opens to the game settings page.

When creating the game object, it needs to store the following:

```json
{
  "name": "Game name",
  "description": "Game description; can list rules, etc. so should support newlines. Might want to consider Markdown formatting, but that's a job for the client.",
  "players": {
    "player-username": {
      "target": "target-username",
      "assassin": "another-username",
      "kills": 0,
      "code": "kill code"
    }
  },
  "codes": [
    "join code"
  ],
  "started": false,
  "ended": false
}
```

I think I'll keep this simple. When the game hasn't started, people can join and leave. The targets are not assigned nor shown. Participants are always publicly listed. Once the game starts, which cannot be undone, targets will be assigned to each player, and new players can't join anymore. At any time, the name and description can be changed, and players can be removed by the game creator.

I want join and kill codes to be something with high uniqueness but also is easy to remember. Maybe it could be four English words or something (eg "correct horse battery staple").

~~On game creation, a join code is automatically created. Join codes can be created or revoked, and all can be revoked at once.~~ Actually, I think I will make this a settable password or something. Apparently assassingame.com has a 4-digit join code and a password.

Mr. Uglieur sees the game settings page, with a "start" button, which is disabled because there's no one in the game yet. It displays the game name and description, which are still editable. When he updates the description, it automatically saves. One join code is listed: *happy otter random code*. He sends this to his friends.

Sulijen Kesupo receives the code and goes to the site to enter it in. His name will appear on Mr. Uglieur's game settings page with an option to remove. Mr. Uglieur can join the game if he wants.

Eventually, a couple other people join, so Mr. Uglieur starts the game. Now the players can access their kill code and target's name and profile.

It is a peaceful day in Jan Puli's neighbourhood. Jan Puli lies comfortably on his beach chair in his front yard, listening to the birds chirping and the occasional gentle breeze rustling the leaves.  He jumps out of his chair and swivels around, revealing Sulijen, dressed from head to toe in black, holding a spoon. They pause, then Sulijen strikes with his spoon. Before Jan Puli reacts, he finds Sulijen's spoon pressing on his forehead. In Sulijen's other hand is his phone.

"Your code, please," he asks, sneering at Jan Puli.

"Epic panda sample code," Jan Puli recites. Sulijen retracts his spoon-holding hand and stows it in his pocket, then types in the code on his phone. Jan Puli has been assassinated.

Internally, this marks Jan Puli as dead and gives Jan Puli's target to Sulijen. This also increments Sulijen's kill count by one. If Jan Puli were the second-to-last person alive, the game ends, but he isn't, so the game doesn't end.

At some point, activity becomes stagnant, so Mr. Uglieur decides to shuffle targets. There's a button on the game settings page that allows him to do this.

It turns out an unknown person named `Gamepro5` doesn't actually exist, so Mr. Uglieur kicks him. Sulijen had that user as a target, so their target is set to Gamepro5's target.

When the penultimate person is killed, the game ends.

This all requires:

- POST `/create-game` Create new game (session, name, description) -> game ID
- Create join code (session, game) -> join code
- Revoke join code (session, code) -> ok
- POST `/game-settings` Set game settings (session, game, info...) -> ok
- GET `/game-settings` Get game settings (session, game) -> info...
- GET `/game` Get game info (game) -> info...

repository: SheepTester/web-server

gha_language: JavaScript

repo_name: SheepTester/web-server


text:
# Marine

[中文文档](README.md)

Marine is a minimalist implementation of Flux that simplifies the definition of Action and Store, optimizes methods for calling different Actions, and the flow of Store listen events.

[![Build Status](https://travis-ci.org/zmofei/marine.svg?branch=master)](https://travis-ci.org/zmofei/marine)
[![npm version](https://img.shields.io/npm/v/marine.svg?style=flat-square)](https://www.npmjs.com/package/marine)

## With so many similar libraries, why is there a Marine?

### 1. props vs state

Suppose we have such a Div in the page. We can modify the color, size, border, etc. of any information that can be described by CSS by mouse or code. We need to control the props by:

**Write all the properties in props and inherit all the properties of props in Div's Style.**

![props](doc/image/props.png)

This will result in:

1. The data source is huge: we need to put all the modified properties on the props may be extremely large.
2. Excessive rendering process: Every time we modify any of the properties, we have to notify the data source, and then pass the props to the current module, and then perform secondary rendering. This is especially common in scenarios where the user can interact. Imagine dragging the position of the div. Each time the mousemove, the location is passed to the data source and then passed back to the current module via props.
3. Too many invalid notifications: If a data source becomes a props for multiple components, each component that modifies the data source needs to respond to changes in the props to determine if changes are needed.

Such a list of problems can make it difficult to control data in an interactive scenario. We need to think about the question: Does the property modification in each module need to notify the root data source? Do you need to know every relevant module?

![props](doc/image/props2.png)

In order to solve these problems, a good Pub/Sub can be solved. For example, we automatically listen to a channel during the initialization of each module, telling the channel what information I only accept, every time I receive new data, the information I will get will be in my own state, if I need to notify other The module modification can also be sent to the other party through this pipe. Marine does not need to notify the data source of every property change, which is the most basic implementation of Marine.

![props](doc/image/marine.png)

In Marine, each module can listen to the channel it wants to listen to. When there is an update in this channel, the module will receive it in the first time (and other channels will be automatically filtered by Marine to be quiet and not disturbed). ), while the module can send the necessary messages to a channel at any time if needed.

In Marine, modules only need to focus on their own data, process and receive their own related data, and notify other modules when necessary, and can successfully complete many tasks. We have designed a lot of super simple and efficient APIs to use, let's try it.

## Quick example

#### Step 1 Define Action

```javascript
// import  Action, Store
import { Action } from 'marine';

// Define an action named Demo
Action.def('Demo');
```

#### Step 2 listen for messages

We can listen to messages from Action on any page via Store.on

```javascript
// import  Action, Store
import { Store } from 'marine';

// Listen to the hello channel of the Demo Action
Store.on('Demo.hello', StoreDate =>{
    console.log(StoreDate.data)
});
```

#### step 3 分发消息

After the Action is defined, you can send a message via the Action[ActionName].emit method in any file.

```javascript
// import  Action, Store
import { Action } from 'marine';

// send message
Action.Demo.emit('hello', 'Hello Marine');

// After the message is distributed, all callbacks that are listening to the channel will be called.
// The console.log(StoreDate.data) of the second step after the trigger is triggered.
```

## Simple example

In addition to the quick example above, we can also specify the Action method via the regular Action.def method and call it via Action[ActionName][fnName]

#### 1. Definition Action

```javascript
// import Action, Store
import { Action, Store } from 'marine';

/**
  * Each Action has a name and multiple methods
  * Action can be defined by Action.def
  *
  * The name of the Action in the following example is ‘Demo’. It has a test method that can be called with Action.Demo.test() when called.
  */

Action.def('Demo', {
     // In the quick example, we don't have a way to define Demo.
     // Here we define the hello method via the Action method.
     'hello': (action, name) => {
         // The first parameter of the Action method is the action object, and the subsequent parameters are passed in by the user.
         action.emit({
             channel: 'homechannel',
             data: name || 'Mofei'
         });
         // Here we can also simply write action.emit('homechannel', name)
         // In the quick example, we got the action object through Action.Demo and then passed the message via the emit method, as follows:
         // Action.Demo.emit('hello', 'Hello Marine');
         // Actually this sentence is equivalent to Action.Demo.hello('Hello Marine'),
         // The Action.Demo.hello method is the hello method we now define.
         // Although this method is not as simple as a quick example, what is brought to us is that all Action methods can be defined in the same place for easy management.
     }
});
```

#### 2. Listening to the action through the Store

```javascript
// a.js

// import Action, Store
import { Action, Store } from 'marine';

/**
  * I want to listen to an event can be monitored through Store.on
  * on accepts 2 parameters, the first parameter is the channel you want to listen to, there are 3 cases below
  * 1. Listening to a channel under an Action, such as 'Demo.homechannel', will listen to events from the Action Demo homechannel channel.
  * 2. Listen to all channels under an Action, such as 'Demo', which will listen to all channel events under Demo.
  * 3. Listen to all channels under all Actions, omitting the first parameter, it will listen to all channel events under Demo.
  **/

// Listen to the test event
Store.on('Demo.homechannel', (data) => {
    // When you execute Action.Demo.homechannel(), you can receive it here.
    console.log(data);
});

// Listen to all channel events under Demo
Store.on('Demo', (data) => {
     // When you execute any channel under Action.Demo, you can receive it here.
     console.log(data);
});

// listen to all channels of all Actions
Store.on((data) => {
     // When you execute any channel under any Action, you can receive it here.
     console.log(data);
});
```

#### 3.Trigger events through Action in View
```javascript
// b.js

// import Action, Store
import { Action, Store } from 'marine';
/**
  * You want to call a method of an Action. After you have defined the related Action, you can call it directly through Action.[ActionName].[ActionFunction]
  **/

// Trigger the test event, at which point all three listeners in a.js can receive messages at the same time.
Action.Demo.test('I am Marine');

// In the quick example we are using
// Action.Demo.emit('hello', 'I am Marine')
// Omit the definition of the action method hello, but relatively increased the management cost of the action.
```

## API

### 1. Action

#### 1.1 Action.def(ActionName, ActionFunctions)

This method is used to define the Action, which is a syntactic sugar that quickly defines the Action.

##### 1.1.1 ActionName [String]

ActionName is the name of the currently created Action. After the declaration is completed, you can get the corresponding Action through `Action[ActionName]`.

For example, we declare an Action called Mofei (which will be introduced later in ActionFunctions):

```javascript
import { Action } from 'marine';

action.def('Mofei', ActionFunctions)
```

After the definition, you can get the Action object by introducing Action in any page and then calling Action.Mofei, for example:

```javascript
import { Action } from 'marine';

// At this point Action.Mofei is the Action we just defined via def.
console.log(Action.Mofei);
```

##### 1.1.2 ActionFunctions [Object]

Next, we introduce ActionFunctions, which are JSON type key-value pairs, where key is the method name of the current Action instance, and value is the specific Action method corresponding to the Function. In the Action instance method, the first parameter is our current Action instance object, for example

For example, in an Action named Mofei, we want to add 2 methods `coding` and `sleep`:

```javascript
import { Action } from 'marine';

// Define the Mofei instance, which can be obtained later via Action.Mofei
Action.def('Mofei', {
    // Define the instance method, which can be called later via Action.Mofei.coding('javascript')
    // The first instance of the instance method is automatically passed to the current Action instance, which is Action.Mofei,
    // The second parameter starts to customize the parameters passed in for the user.
    // For example, the second parameter here is the `javascirpt` in Action.Mofei.coding('javascript').
    coding: (action, language)=>{
        // In the instance method we can? Any method directly through Aciton
        // Here we call the emit method of the action
        action.emit({
            channel: 'coding',
            data: `I am coding with ${language}`
        })
    },
    sleep: (action,place)=>{
        action.emit({
            channel: 'coding',
            data: `I am sleeping at ${place}`
        })
    }
})
```

After the statement is completed, we can call the corresponding method through Action.Mofei, such as:

```javascript
// Introduce Action
import { Action } from 'marine';

Action.Mofei.coding('javascript');
Action.Mofei.sleep('home');
```

#### 1.1.3 Comparison of Action.def and new Action() methods.

In the above example, we quickly defined the Action instance through Action.def. If it is defined by Action.def, our writing should be as follows:

```javascript
let mofeiAction = new Action('Mofei');

let conding(language) => {
    mofeiAction.emit({
        channel: 'coding',
        data: `I am sleeping at ${place}`
    })
}

let sleep(palce) => {
    mofeiAction.emit({
        channel: 'coding',
        data: `I am sleeping at ${place}`
    })
}

export {coding, sleep};
```

We need to introduce `coding` or `sleep` when calling.

```javascript
import {coding, sleep} from 'path';

coding('javascript')
sleep('home')
```

Relatively, the instance method defined by def will automatically hang on the global variable of Action. You don't need to introduce specific methods in each page. Just introduce Marine Action and then use Action[ActionName][functionName]. Calling can improve a lot of development efficiency. For the traditional new Action method, you need to export these class methods and then import the method in the place you need to use it, which may be a little more troublesome.

#### 1.2 Action.coustructor(name)
#### 1.3 action.emit(emitParam)

Action.emit is used to distribute messages, and all events that listen to the channel being distributed can receive the message.

| Param | Type | Explain |
|:---:|:---:|:---:|
|emitParam.channel|[String]|Name of the distributed channel|
|emitParam.data|[Object]|Distributed data data|
|emitParam.stores|[Array]|Distributed to other store listeners, usually only the store listener with the same name can receive the message, after the store is specified, the message can be distributed to other stores, such as Robin|

Usage is as follows

```javascript
Action.def('Mofei', {
    Coding: (action, language)=>{
        // emit method
        action.emit({
            dhannel: 'coding',
            data: `I am coding with ${language}`,
            stores: ['Mofei', 'Robin']
        })
    }
});

// trigger
Action.Mofei.coding('javascript');

// At this point, all objects listening to the coding channel can get the message.
// Store.on('Mofei.coding', (data)=>{
// console.log(data)
//})

// Since the store:['Mofei', 'Robin'] is created above, Robin's listener can also receive the message.
// Store.on('Robin.coding', (data)=>{
// console.log(data)
//})
```

Or

```javascript
let Mofei = new Action('Mofei');
Mofei.emit({
    channel: 'coding',
    data: `I am coding with javascirpt`
})
```

**Syntactic sugar**

You can also use the action.echo(channel, data, options) to quickly call the echo method.

```JavaScript
action.emit({
    channel: 'coding',
    data: `I am coding with ${language}`,
    stores: ['Mofei', 'Robin']
})
```

Equivalent to

```JavaScript
action.emit('coding', `I am coding with ${language}`, {
    Stores: ['Mofei', 'Robin']
})
```

#### 1.4 action.echo(echoParam)
#### 1.5 action.[emit|echo].reduice(reduiceParam)
#### 1.6 action.[emit|echo].reduice(reduiceParam)
#### 1.7 action.[emit|echo].channel(channelNames) [String|Array]
#### 1.8 action.[emit|echo].stores(storesNames) [Array]

### 2. Store

#### 2.1 Store.on(ChannelName, callback)

#### 2.2 Store()

repository: zmofei/marine

repo_name: zmofei/marine


text:
# Secrets store

This tutorial shows you how to use the Dapr secrets API to access secrets from secret stores. This sample uses a Node application to access a Kubernetes secret store.

## Prerequisites
This sample requires you to have the following installed on your machine:
- [Docker](https://docs.docker.com/)
- [Node.js version 8 or greater](https://nodejs.org/en/)
- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
- A Kubernetes cluster, such as [Minikube](https://github.com/dapr/docs/blob/master/getting-started/cluster/setup-minikube.md), [AKS](https://github.com/dapr/docs/blob/master/getting-started/cluster/setup-aks.md)
- [Postman](https://www.getpostman.com/) [Optional]

Also, unless you have already done so, clone the repository with the samples and ````cd```` into the right directory:
```
git clone [-b <dapr_version_tag>] https://github.com/dapr/samples.git
cd samples
```
> **Note**: See https://github.com/dapr/samples#supported-dapr-runtime-version for supported tags. Use `git clone https://github.com/dapr/samples.git` when using the edge version of dapr runtime.

## Step 1 - Setup Dapr on your Kubernetes Cluster

The first thing you need is an RBAC enabled Kubernetes cluster. This could be running on your machine using Minikube, or it could be a fully-fledged cluser in Azure using [AKS](https://azure.microsoft.com/en-us/services/kubernetes-service/).

Once you have a cluster, follow the steps below to deploy Dapr to it. For more details, look [here](https://github.com/dapr/docs/blob/master/getting-started/environment-setup.md#installing-dapr-on-a-kubernetes-cluster)

> Please note, that using the CLI does not support non-default namespaces.
> If you need a non-default namespace, Helm has to be used (see below).

```
$ dapr init --kubernetes
ℹ  Note: this installation is recommended for testing purposes. For production environments, please use Helm

⌛  Making the jump to hyperspace...
✅  Deploying the Dapr Operator to your cluster...
✅  Success! Dapr has been installed. To verify, run 'kubectl get pods -w' in your terminal
```

## Step 2 - Configure a Secret in the Secret Store

Dapr can use a number of different secret stores (AWS Secret Manager, Azure Key Vault, GCP Secret Manager, Kubernetes, etc) to retrieve secrets. For this demo, you'll use the [Kubernetes secret store](https://kubernetes.io/docs/concepts/configuration/secret/) (For instructions on other secret stores, please refer to [this documentation](https://github.com/dapr/docs/tree/master/howto/setup-secret-store)).

1. Add your secret to a file ./secret. For example, if your password is "abcd", then the contents of ./secret should be "abcd"
2. Create the secret in the Kubernetes secret store. Note, the name of our secret here is "mysecret" and will be used in a later step.
    ```
    kubectl create secret generic mysecret --from-file ./secret
    ```
3. You can check that the secret is indeed stored in the Kubernetes secret store by running the command:
    ```
    kubectl get secret mysecret -o yaml
    ```
   You can see the output as below where the secret is stored in the secret store in Base64 encoded format
   ```
    % kubectl get secret mysecret -o yaml
        apiVersion: v1
        data:
        secret: eHl6OTg3Ngo=
        kind: Secret
        metadata:
        creationTimestamp: "2020-05-20T20:20:09Z"
        name: mysecret
        namespace: default
        resourceVersion: "2031800"
        selfLink: /api/v1/namespaces/default/secrets/mysecret
        uid: 64c60c3e-dce4-4c02-b5c1-8d4dbb7cbb8f
        type: Opaque
    ```

## Step 3 - Deploy the Node.js App with the Dapr Sidecar

```
kubectl apply -f ./deploy/node.yaml
```

This will deploy our Node.js app to Kubernetes.

You'll also see the container image that is being deployed. If you want to update the code and deploy a new image, see **Next Steps** section.

This deployment provisions an external IP.
Wait until the IP is visible: (may take a few minutes)

```
kubectl get svc nodeapp
```

> Note: Minikube users cannot see the external IP. Instead, you can use `minikube service [service_name]` to access loadbalancer without external IP.

Once you have an external IP, save it.
You can also export it to a variable:

**Linux/MacOS**:

```
export NODE_APP=$(kubectl get svc nodeapp --output 'jsonpath={.status.loadBalancer.ingress[0].ip}')
```

**Windows**:

```
for /f "delims=" %a in ('kubectl get svc nodeapp --output 'jsonpath={.status.loadBalancer.ingress[0].ip}') do @set NODE_APP=%a
```

## Step 4 - Access the secret
Make a request to the node app to fetch the secret. You can use the command below:
```
curl -k http://$NODE_APP/getsecret
```
The output should be your base64 encoded secret

## Step 5 - Observe Logs

Now that the node app is running, let's watch messages come through.

Get the logs of the Node.js app:

```
kubectl logs --selector=app=node -c node
```

If all went well, you should see logs like this:

```
% kubectl logs --selector=app=node -c node
Node App listening on port 3000!
Fetching URL: http://localhost:3500/v1.0/secrets/kubernetes/mysecret?metadata.namespace=default
Base64 encoded secret is: eHl6OTg3Ngo=
```

In these logs, you can see that the node app is making a request to dapr to fetch the secret from the secret store. Note: mysecret is the secret that you created in Step 2

## Step 6 - Cleanup

Once you're done using the sample, you can spin down your Kubernetes resources by navigating to the `./deploy` directory and running:

```bash
kubectl delete -f ./deploy/node.yaml
```

This will spin down the node app.

## Next Steps

If you want to update the node app, you can do the following:

1. Update Node code as you see fit!
2. Navigate to the node app directory you want to build a new image for.
3. Run `docker build -t <YOUR_IMAGE_NAME> . `. You can name your image whatever you like. If you're planning on hosting it on docker hub, then it should start with `<YOUR_DOCKERHUB_USERNAME>/`.
4. Once your image has built you can see it on your machines by running `docker images`.
5. To publish your docker image to docker hub (or another registry), first login: `docker login`. Then run`docker push <YOUR IMAGE NAME>`.
6. Update your .yaml file to reflect the new image name.
7. Deploy your updated Dapr enabled app: `kubectl apply -f node.yaml`.

## Related Links
- [Secret store overview](https://kubernetes.io/docs/concepts/configuration/secret/)
- [Secret store API reference](https://github.com/dapr/docs/blob/master/reference/api/secrets_api.md)
- [Setup a secret store](https://github.com/dapr/docs/blob/master/howto/setup-secret-store/README.md)
- [Code snippets in different programming languages](https://github.com/dapr/docs/blob/master/howto/get-secrets/README.md)

repository: dairlair/samples

repo_name: dairlair/samples


text:
# Continuous Integration Workflows

This package implements different workflows for CI.
They are organized as follows.

### Documentation

The `documentation` workflow triggers on any push to master, builds the documentation and pushes it to the `gh-pages` branch (if the build is successful).
It runs on `ubuntu-latest` and one of our supported version, currently `Python 3.9`.

### Testing Suite

Tests are ensured in the `tests` workflow, in two stages.
The first stage runs our simple tests on all push events (except to `master`), and the second one runs the rest of the testing suite (the `extended` tests).
Tests run on a matrix of all supported operating systems (`ubuntu-20.04`, `ubuntu-22.04`, `windows-latest` and `macos-latest`) for all supported Python versions (currently `3.8` to `3.11`).

### Test Coverage

Test coverage is calculated in the `coverage` workflow, which triggers on pushes to `master` and any push to a `pull request`.
It runs on `ubuntu-latest` and `Python 3.9`, and reports the coverage results of the test suite to `CodeClimate`.

### Regular Testing

A `cron` workflow triggers every Monday at 3am (UTC time) and runs the full testing suite, on all available operating systems and supported Python versions.
It also runs on `Python 3.x` so that newly released Python versions that would break tests are automatically included.

### Publishing

Publishing to `PyPI` is done through the `publish` workflow, which triggers anytime a `release` is made of the GitHub repository.
It builds a `wheel`, checks it, and pushes to `PyPI` if checks are successful.


text:
# SystemVerilog Formatter Developer Guide

<!--*
freshness: { owner: 'hzeller' reviewed: '2022-09-16' }
*-->

## Design

This section describes the various subsystems of the Verilog formatter.

### Inter-Token Annotation

Between every pair of adjacent tokens in the to-be-formatted text, there are a
set of attributes that influence spacing and line wrapping decisions,
[InterTokenInfo], such as minimum spacing between tokens.

The role of the [token annotator] is to populate [InterTokenInfo] based on the
attributes, types, and syntactic context of adjacent pairs of tokens. Formatting
rules around punctuation tokens like parenthesis and brackets often depend on
syntactic context.

#### Rules and Reasons

The main functions that determine inter-token attributes are written as
_priority-ordered rules_, i.e. series of `if (condition) return ...;`. There may
be an _O(N^2)_ number of inter-token pair combinations, however, we aim to cover
as much of that space as possible with few rules.
[Test cases](https://cs.opensource.google/verible/verible/+/master:verilog/formatting/token_annotator_test.cc),
however, should cover as much as possible explicitly, to prevent accidental
regression.

When running with logging enabled, you will observe that every value or
attribute returned by these functions is accompanied with a _reason_ string like
_"Always insert a space after X"_. This not only tells you the value returned
but the exact line or rule that triggered it, which is critical for debugging.
When fixing issues, don't immediately think of what code to add to solve an
issue, consider whether a re-ordering of the rules may work. In some case, code
can be simplified by grouping similar case conditions together, or by
generalizing rules more broadly.

### Token Partition Tree

[TokenPartitionTree] is a language-agnostic hierarchical representation of
(formatting) token ranges. The data represented by each node is an
[UnwrappedLine], which contains a range of formatting tokens and indentation
information. [TokenPartitionTree] has the following properties:

*   The range spanned by a node in the tree is equal to the range spanned by its
    children, if there are any.
*   The end points of the tokens ranges of adjacent siblings are equal, or put
    another way, there are no gaps in token ranges between adjacent sibling
    nodes.

The role of the [TreeUnwrapper] is to convert a SystemVerilog concrete syntax
tree into a [TokenPartitionTree]. Once in [TokenPartitionTree] form, the
original syntax structure has been abstracted away and is no longer relevant to
the rest of the formatter. If one chose to implement the formatter without
relying on a valid syntax tree, one only has to produce a [TokenPartitionTree]
form to reuse everything else that follows. For example, one could just as well
produce a [TokenPartitionTree] directly from a lexical token stream. Such a
strategy could better accomodate preprocessing-heavy code which might otherwise
be rejected by the parser before producing a syntax tree, at the expense of
having to do some pseudo-parsing.

Think of each node in the [TokenPartitionTree] representing a formatting
subproblem: _Given a box width constraint, what are the best ways to format a
region of text?_ Leaf partitions of the [TokenPartitionTree] represents a unit
of work that is currently handled by the line-wrapping optimization phase.

### Tree unwrapping

The implemention of [TreeUnwrapper] is split into
[language-agnostic library functions](https://cs.opensource.google/verible/verible/+/master:common/formatting/tree_unwrapper.cc)
and [Verilog-specific](https://cs.opensource.google/verible/verible/+/master:verilog/formatting/formatter.cc) code.

Simplified class inheritance diagram is shown below:
![Inheritance diagram](./formatter_simplified_class_diagram.png)
<!-- class diagram can be regenerated with yEd tool https://www.yworks.com/products/yed -->

[TreeUnwrapper] class exploits
the [Visitor](https://cs.opensource.google/verible/verible/+/master:common/text/visitors.h?q=class:SymbolVisitor&ss=verible%2Fverible)
pattern to recursively process the input CST tree:
```cpp
// SymbolVisitor is an abstract visitor class from which visitors can be derived
// SymbolVisitor only visits a single Symbol, and does not recurse on nodes
//
// Usage:
//  SymbolPtr tree = ...
//  SymbolVisitorSubclass visitor;
//  tree->Accept(visitor);
//
class SymbolVisitor {
 public:
  virtual ~SymbolVisitor() {}
  virtual void Visit(const SyntaxTreeLeaf& leaf) = 0;
  virtual void Visit(const SyntaxTreeNode& node) = 0;
};
```

It builds the [TokenPartitionTree] (i.e. `VectorTree<UnwrappedLine>`) with a set of helper methods to simplify the process:
* [`TraverseChildren()`](https://cs.opensource.google/verible/verible/+/master:common/formatting/tree_unwrapper.cc?q=function:TraverseChildren&ss=verible%2Fverible) - only traverses the CST
* [`VisitIndentedSection()`](https://cs.opensource.google/verible/verible/+/master:common/formatting/tree_unwrapper.cc?q=function:VisitIndentedSection&ss=verible%2Fverible) - creates indented section and traverses the CST
* [`VisitNewUnwrappedLine()`](https://cs.opensource.google/verible/verible/+/master:verilog/formatting/tree_unwrapper.cc?q=function:VisitNewUnwrappedLine&ss=verible%2Fverible) - begins a new partition of tokens and traverses the CST

### Custom policies application

The next stage of code formatting is to apply custom functions that would
reshape the partition tree according to the selected policy.
An example of that are the [kTabularAlignment](#alignment) and the
[kAppendFittingSubPartitions](https://cs.opensource.google/verible/verible/+/master:common/formatting/unwrapped_line.h?q=kAppendFittingSubpartitions&ss=verible)
policies.

### Wrapping

Line wrapping optimization is currently done as a Dijsktra shortest-path search
over the space of append/wrap decisions spanning a range of formatting tokens.
When a wrap (line break) is used, the optimization state incurs a penalty value
determined in the token annotation phase. This algorithm is not very scalable,
but there are plans to replace it with something like dynamic programming.

### Disable Control and Preservation

## Troubleshooting

This section provides tips about how to triage formatter issues.

`verible-verilog-syntax --printtree` shows the concrete syntax tree
representation of source code. Many formatting decisions are based on syntax
tree node types, which are shown as constants like `kPackageDeclaration`.

`verible-verilog-format --show_token_partition_tree` shows the
[TokenPartitionTree] subdivision of formatting token ranges and relative
indentation. Add `--show_inter_token_info` to show even more information about
InterTokenInfo before each token.

A lot of other details are traced by running with environment variables
`VERIBLE_LOGTHRESHOLD=0 VERIBLE_VLOG_DETAIL=8`. The log threshold
indicates that we want to see info logs and up (there are four levels: INFO=0,
WARNING=1, ERROR=2, FATAL=3) printed to stderr (without that we wouldn't see
any vlog outputs as they go to INFO), and vlog detail is logging all verbose
logging commands (`VLOG()`) up to and including VLOG detail 8; the higher the
number, the more details.

(TODO: introduce `VERIBLE_VLOG_MODULE` once vmodule available in absl log).
Real world [TreeUnwrapper] example:
```
echo 'module m; initial a = b + c; endmodule' | \
  VERIBLE_LOGTHRESHOLD=0 \
  VERIBLE_VLOG_DETAIL=8 \
  bazel run //verilog/tools/formatter:verible-verilog-format -- -show_token_partition_tree -
```

### Alignment

The tabular alignment feature can be summarized as: _Given a block of code with
syntax-structure similarity, insert spacing needed to achieve vertical alignment
among the same substructure elements._

The implementation of tabular alignment for code is split into
[language-agnostic library functions](https://cs.opensource.google/verible/verible/+/master:common/formatting/align.h)
and
[Verilog-specific](https://cs.opensource.google/verible/verible/+/master:verilog/formatting/align.cc)
uses of alignment functions.

To trigger alignment for a block of code, the [TreeUnwrapper] marks a
[TokenPartitionTree] node with
[`kTabularAlignment`](https://cs.opensource.google/verible/verible/+/master:common/formatting/unwrapped_line.h?q=file:unwrapped_line.h%20usage:kTabularAlignment&ss=verible%2Fverible):
this says that a particular node has some children partitions that _could_ be
aligned.

Once a [TokenPartitionTree] enters the top-level alignment handler, alignment is
done in the following phases:

1.  **Language-specific:** Depending on the syntax tree node type that
    corresponds to each partition, a
    [function](https://cs.opensource.google/verible/verible/+/master:verilog/formatting/align.cc?q=file:align.cc%20usage:kAlignHandlers&ss=verible%2Fverible)
    is chosen that is responsible for finding [AlignablePartitionGroup]s, blocks
    of children partitions that are candidates for aligned formatting. Think of
    these as groups of _rows_ that constitute a table.

    *   The [AlignablePartitionGroup]s returned by from a single parent node
        could cover different syntax constructs, e.g. from a single node
        representing statement elements, you could have groups of declarations,
        and groups of assignment statements.
    *   [AlignablePartitionGroup]s may be sparsely populated if they span
        non-aligned text such as comments.
    *   Each [AlignablePartitionGroup] is assigned a function that is
        responsible for partitioning rows of tokens into _column_ cells.
    *   Finding the start and end points of these candidate alignment groups
        could be based on a number of factors, such as syntax tree node types,
        comments, blank lines.
    *   Every subpartition that is not selected for alignment undergoes
        non-aligned formatting by default.

1.  **Language-agnostic:** Each alignment group analyzes and transforms its rows
    and columns, essentially calculating the maximum width of each column, and
    adjusting [InterTokenInfo] spacing, taking into account left/right flushing.

    *   Each row is scanned to partition its tokens into cells that will be
        binned into columns. This works best when the rows have the same or
        similar syntax structure.
    *   Columns may be empty. Optional syntax construct are blank cells in this
        case.
    *   To bin columns correctly, every cell of tokens is assigned a key that
        corresponds to its position within the parent syntax tree node, a
        _path_, like `[N,M,P]`. This makes it easy to accommodate empty cells in
        each row, and also accommodates a _dynamic_ number of columns. For
        example, data declarations could have any number of columns based on
        dimensions. The path-hierarchical nature and lexicographical ordering of
        keys faciliates dynamic column generation.
    *   Binning cells into columns creates a _column schema_, which compute
        column widths.
    *   Column widths translate to [InterTokenInfo] spacing adjustments.

Should the resulting column widths exceed the column limit (style parameter),
then attempting to align a block of code is abandoned, falling back to
non-aligned formatting.

<!-- TODO: align vs. flush left behavior inferral -->
<!-- reference links -->

[UnwrappedLine]: https://cs.opensource.google/verible/verible/+/master:common/formatting/unwrapped_line.h
[token annotator]: https://cs.opensource.google/verible/verible/+/master:verilog/formatting/token_annotator.h
[InterTokenInfo]: https://cs.opensource.google/verible/verible/+/master:common/formatting/format_token.h;l=59?q=InterTokenInfo
[TreeUnwrapper]: https://cs.opensource.google/verible/verible/+/master:verilog/formatting/tree_unwrapper.h
[TokenPartitionTree]: https://cs.opensource.google/verible/verible/+/master:common/formatting/token_partition_tree.h
[AlignablePartitionGroup]: https://cs.opensource.google/verible/verible/+/master:common/formatting/align.h?q=file:align.h%20class:AlignablePartitionGroup&ss=verible%2Fverible

repository: antmicro/verible

repo_name: antmicro/verible


text:
# Fend Nano Degree project 6

## Restaurant review: Stage 1

The project is an application providing a map area of New York with a simulated database of restaurants (a json file) where data are stored and accessed asynchroneously. Under the map known restaurants are briefly presented with a view more button. A click on this button loads a new page showing the restaurant's details and a list of review of the restaurants.

### Specification

We have been provided the code for a restaurant reviews website. The code has a lot of issues.

The project consist in changing the code to add the following features:

- Grid type display of the restaurants on main page to have more useable.
- Responsive with all modern devices
- Accessiblity with keyboard navigation and pertinent focus
- Available offline with the use of a service worker

### What has been done

- __Service Worker__

A service worker is registered, static resources are cached on installation of it. It then serve an offline-first policy
Offline state is detected with navigator.online and a static map is displayed as Google Map cannot be cached as per the terms of usage of Google.

- __Responsiveness__

  - Flexbox design
  - Relative units
  - Media queries and appropriate breakpoints

- __Acssessibility__

  - Color sheme change to have a better contrast and pass aXe accessiblity audit
  - Hidden link to skip focusing the map and in the map if wanted.
  - tabIndex=0 added at proper elements to manage focus adequatly
  - alt text added to pictures. Choice has been made to add the alt text to the json "datababase" to be able to have a specific text for each restaurant and not only a generic one like "photo of $RESTAURANT-NAME restaurant"
  - Title added to google map iframe. The html tag without a language can't be fixed

### version

_V 0.9_ 05/15/2018

### Installation

Clone repository or download files.
Go to the project directory.
You need a localserver to be able to run the service worker.

Python can setup one very simple, To set it up:

- Check your Python version. In a terminal type: `python -V`.
  - If you have Python 2.x, type `python -m SimpleHTTPServer 8000` (or some other port, if port 8000 is already in use. If you need to use another port you must change the `const = 8000` iat the beginning of dhelper.js file according to the port you use).
  - For Python 3.x, you can use `python3 -m http.server 8000`.

If you don't have Python installed, navigate to Python's [website](https://www.python.org/) to download and install the software.

- With your server running, visit the site: `http://localhost:8000` to laucnch the project.

### Authors

Realisation of project: Alain CADENAT

### Credits

- _Original code:_  [Udacity](https://www.udacity.com)
- _Cartography data_: Google

### Limitations

- Program uses ES6 JavaScript instruction set, browser must be compatible. or visit [babel](https://babeljs.io/) to transpile it.
- The project uses JSON, browser must be of a sufficiently recent verion to be able to store and restore data.
- To run offline the project uses a serviceworker. If your browser doesn't support service workers it will run but won't be able to run offline. You can check browser compatibility on [Jake Archibald's service worker page](https://jakearchibald.github.io/isserviceworkerready/)

### License

MIT License

Copyright (c) 2018 Alain CADENAT

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

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

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


text:
# What is Subsampling ?
Language models assign probabilities to sequences of words. They are widely used in many natural language processing applications.
The probability of a sequence can be modeled as a product of local probabilities as shown in

### Where:
'wi' is the ith word, and
'hi' is the word history preceding 'wi'.

'i' starts from 0.

Therefore the task of language modeling reduces to estimating a set of conditional distributions {P(w|h)}.

For complex models, this poses a computational challenge for learning, because the resulting objective functions are expensive to normalize.

Subsampling is a simple solution to get around
the constraint of computing resources. For the purpose of language modeling, it amounts to taking only part of the text corpus to train the Language Model.
For complex models, it has been shown that subsampling can speed up training greatly, at the cost of some degradation in predictive performance, allowing for trade-off between computational cost and Language Model quality
## In Simple words:
Subsampling is also one of the techniques that we use when we are building word pairs which removes the most frequently used words.

Generally thses words are:
* Prepositions (eg. of, on, for)
* Articles (a, an, the)
## Advantages of Subsampling are:
* Reduces the Training time for Model
* Reduces the bias of the model towards training data.
## Disadvantages of Subsampling are:
* Reduces the overall Model accuracy.


text:
---
weight:             10
title:              "These Pictures"
date:               2017-11-13T15:33:35+01:00
resImgTeaser:  teaserpics/pixabay.com/paint-2985569_640.jpg
description: >
  Pixabay is a vibrant community of creatives, sharing copyright free
  images and videos. All contents are released under Creative Commons
  CC0, which makes them safe to use without asking for permission or
  giving credit to the artist - even for commercial purposes.
tags:
  - license
  - pictures
categories:
  - legal
---

# Where did the pictures came from?

* See [Images taken from...](../hugo-theme-w3css-basic/images-taken-from/).
* https://pixabay.com/

# What is Pixabay?

Pixabay is a vibrant community of creatives, sharing copyright free
images and videos. All contents are released under Creative Commons
CC0, which makes them safe to use without asking for permission or
giving credit to the artist - even for commercial purposes.

See more: https://pixabay.com/en/service/faq/

# Are there any restrictions?

All images and videos on Pixabay are released under the Creative
Commons CC0. Thus, they may be used freely for almost any purpose -
even commercially and in printed format. Attribution in appreciated,
but not required.

**Exceptions**

* Identifiable people may not appear in a bad light or in a way that
  they may find offensive, unless they give their consent.

* Do not suggest endorsement of products, services, etc. by depicted
  people or organizations. For example: do not use an image of NASA and
  place it adjacent to your own product in a way that suggests NASA
  would recommend the product.

In addition to these common sense regulations, there is more to know:

**Model- and Property Release**

See more here: https://pixabay.com/en/blog/posts/public-domain-images-what-is-allowed-and-what-is-4/

gha_language: HTML