text:
---
# An instance of the Experience widget.
# Documentation: https://wowchemy.com/docs/page-builder/
widget: experience

# This file represents a page section.
headless: true

# Order that this section appears on the page.
weight: 40

title: Experience
subtitle:

# Date format for experience
#   Refer to https://wowchemy.com/docs/customization/#date-format
date_format: Jan 2006

# Experiences.
#   Add/remove as many `experience` items below as you like.
#   Required fields are `title`, `company`, and `date_start`.
#   Leave `date_end` empty if it's your current employer.
#   Begin multi-line descriptions with YAML's `|2-` multi-line prefix.
experience:
  - title: "Founder"
    company: "Madhu Akula"
    company_url: "https://madhuakula.com"
    company_logo:
    location: "Amsterdam, Netherlands"
    date_start: "2022-02-11"
    date_end: ""
    description: |2-
      https://madhuakula.com

  - title: "Product Security"
    company: "Miro"
    company_url: "https://miro.com"
    company_logo:
    location: "Amsterdam, Netherlands"
    date_start: "2020-10-01"
    date_end: "2022-06-30"
    description: |2-
      Leading & building the product security engineering for a hyper-growth online collaborative whiteboard platform. Things happened at Miro since I joined 😊

        * 📈 8M users, and now we have 35M+
        * 🎉 Built and managed Cloud Native Security, Security Ambassadors teams
        * 💵 $76M Series B Funding to $476M Series C with $17.5B valuation
        * ❤ Miro culture champion, helped to drive community, talent, tech branding
        * 🎯 99% of Fortune 500 are customers
        * 🎙 Did more than 80+ interviews at various levels across the organization
        * 🧑🏫 Shared my knowledge and research across multiple international conferences and communities
        * 👏 Headcount 500 to more than 1500
        * 🙌 Witnessed billions of requests scale and amazing culture
        * 🌍 5 hubs to 12 hubs around the globe
        * 🥳 New Logos, Customers, Integrations, Partnerships, etc.

  - title: "Advisor"
    company: "Stealth Startup"
    company_url: ""
    company_logo:
    location: "Online"
    date_start: "2020-09-01"
    date_end: "2021-10-31"
    description: |2-
      Research & Innovation, Technology Roadmap, Building awesome teams, culture & company

  - title: "Cloud Native Security"
    company: "Xebia"
    company_url: "https://xebia.com"
    company_logo:
    location: "Amsterdam, Netherlands"
    date_start: "2020-02-01"
    date_end: "2020-09-30"
    description: |2-
      Worked with wide variety of teams, clients and community to learn and share pragmatic security knowledge
        * Security Architecture, Engineering & Consulting
        * Cloud, Containers and Kubernetes security
        * Learning and sharing with the community

  - title: "Security"
    company: "Appsecco"
    company_url: "https://appsecco.com"
    company_logo:
    location: "Bangalore, India"
    date_start: "2016-05-16"
    date_end: "2020-01-17"
    description: |2-
      Joined as a 2nd member of the company. [Read More](https://blog.appsecco.com/a-fond-farewell-to-appsecco-8b5c4624ce1d)

      Appsecco is a specialist application security company that ‘gets’ web security and can advise you on the best route for your business.

      We provide simple solutions to problems and don’t confuse our clients with technicalities.

      Every team member shares a passion for providing the best possible security solutions that meet the commercial needs and challenges of the clients and organisations we work for.

      No matter where they are based they bring the same strategic and pragmatic thinking to ensure that security, operations and commercial goals are aligned to bring you the best possible results.

  - title: "Security Engineer II"
    company: "Walmart"
    company_url: "https://www.walmart.com"
    company_logo:
    location: "Bangalore, India"
    date_start: "2014-10-01"
    date_end: "2016-05-05"
    description: |2-
      Joined as a 1st member in the Fortune 1 Network Security team in India and worked collaboratively with the USA team and other teams around the globe.

      1. Responsible for the global network security for Walmart eCommerce.
      2. Part of Incident Response team. Worked on Palo Alto, ASA, FWSM firewalls.
      3. Responsible for assessment of automation tools, latest trends to enhance the current security testing practices,update and enhance the standards used in organisation.
      4. Followed Agile-Scrum methodologies for deployment and development activities.
      5. Built an in house automation Attack Monitoring & Proactive Analytics solution for Walmart using ELK stack.
      6. Acknowledged by CISO, VP for my contribution in improving organisation’s security posture by providing Critical￼ Vulnerabilities in applications and also for internal training among engineering teams in InfoSec.
      7. Won best organizational level awards including AOM (Associate Of the Month), Spot Award in entire InfoSec wing

  - title: "Security Consultant"
    company: "Payatu"
    company_url: "https://payatu.com"
    company_logo:
    location: "Dharamshala, India"
    date_start: "2013-10-01"
    date_end: "2014-10-31"
    description: |2-
      1. Done Pen testing on complete Network as well as all Internal Web Applications
      2. Installed & Configured Active Directory, Domain controller services and applied Group Policy Management
      3. Installed & Configured Layer 2 & 3 switches and Routers
      4. Installed & Configured Open Source Monitoring Servers, Inventory and Ticketing Systems
      5. Installed & Configured FTP, BACKUP and WEB Servers
      6. Did hardening for Windows, LINUX servers & Networks
      7. Configured SIEM Server for Centralized logging and installed Security Onion for Network Packet Capture and analysis
      8. Trained staff for configuration and maintenance of servers and systems
      9. Researched on Real time Scenarios, Architectures and Tools
      10. Worked with various International clients and completed the project successfully

  - title: "Information security researcher & Technical trainer - Part Time"
    company: "SourceNXT"
    company_url: "http://www.sourcenxt.in"
    company_logo:
    location: "Hyderabad, India"
    date_start: "2012-01-01"
    date_end: "2013-09-30"
    description: |2-
      1. Trained more than 3000 people in the field of Information security, Ethical Hacking and Cyber Security by various workshops and talks.
      2. Done research on latest online potential threats and security tools and frameworks.
      3. Prepared course content for Networking & Security Modules.

  - title: "Corporate trainer - Part Time"
    company: "Technosoft Solutions"
    company_url: "http://www.technosoftsolutions.co.in/"
    company_logo:
    location: "Visakhapatnam, India"
    date_start: "2012-01-01"
    date_end: "2013-04-30"
    description: |2-
      1. Trained INDIAN NAVY for 10 days Hands on Ethical Hacking & Information Security Boot Camp
      2. Worked with various clients and done corporate training on Network Security & Forensics
      3. Done Penetration Testing for Web Applications
      4. Done Hardening Networks and Servers for small organizations

  - title: "Internship"
    company: "Saviour Info Sol Pvt.Ltd"
    company_url: ""
    company_logo:
    location: "Hyderabad, India"
    date_start: "2012-05-01"
    date_end: "2012-06-30"
    description: |2-
      Created a server with all security tools to monitor and analyze the network.

design:
  columns: '2'
---


text:
# Walmart\Models\Supplier\US\DSVInventory\InventoryV2

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**productId** | **string** | Specifies the product identifier for the item.    This parameter can only be a global trade item number (GTIN).   The global trade item number (GTIN) is a 14-digit number, including the check digit, that is used worldwide and identifies the Each. If the user’s number is less than 14 digits, add zeros at the beginning. |
**shipNode** | **string** | Specifies the distributor identifier for the distribution facility, used to identify each facility. |
**availabilityCode** | **string** | Specifies the code that identifies how to manage the inventory update.   Codes include:   AC: The code used for standard inventory updates. Assign this code to an item with normal inventory.   AA: An item with infinite inventory. If users set AA as the `availabilityCode`, they do not need to provide inventory for the item. |
**quantity** | **int** | Specifies the item quantity available in the inventory. | [optional]

[[Back to Model list]](./) [[Back to API list]](../../../../../README.md#supported-apis) [[Back to README]](../../../../../README.md)

repository: highsidelabs/walmart-api-php

branch_name: refs/heads/main

extension: md

gha_language: PHP

license_type: permissive

repo_name: highsidelabs/walmart-api-php


text:
# QLazerDriveClient

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

## Integration example

To see the library in action, you can take a look at a project that I made: [lazerdrive-leaderboard-sniffer](https://github.com/vdechenaux/lazerdrive-leaderboard-sniffer)

## How to build it

You must have a Qt5 sdk installed (packages `qt5-qmake qt5-default`) with websockets support (`libqt5websockets5-dev`). To build it, you need the `build-essential` package.
```
qmake
make
make install
```
You can also use Qt Creator if you are not familiar with a shell.

license: MIT

repository: vdechenaux/QLazerDriveClient

branch_name: refs/heads/master

repo_name: vdechenaux/QLazerDriveClient


text:
# Changes in http-parser 2.x.x

## [2.0.0]
* Migrated to PHP 7.0, strong typing on functions returns and parameters.

## [2.1.0]
* Refactoring to use a collection instead an array of fields
* Separate HttpParser on HttpRequestParser and HttpResponseParser to accomplish in a better way the Single Responsability Principle.

## [2.2.0]
* Upgrade phpunit to version 6
* minor improvements for php 7.1
* header annotations are normalized

## [2.2.1]
* fix to upgrade php version to 7.1

## [2.2.2]
* improve headers information

repository: camoo/http-header-parser

gha_license_id: MIT

repo_name: camoo/http-header-parser


text:
## Atom Visual Studio Code UI theme [![Build Status](https://travis-ci.org/atom/one-dark-ui.svg?branch=master)](https://travis-ci.org/atom/one-dark-ui)

![Banner Atom Visual Studio Code UI](https://cloud.githubusercontent.com/assets/3357792/10440872/3af1d882-7143-11e5-9df9-2c1d0aa5e919.png)

This theme aims to reproduce the exact feeling of work with Visual Studio Code. So you don't need to renounce to the features of Atom to enjoy a great workflow. It looks even better with monokai syntax. If you prefer, there is an [alternative version](https://atom.io/themes/atom-visual-studio-code-light-ui) in light colors.

Made by [@Zeioth](https://twitter.com/Zeioth)

---

![atom-visual-studio-code-ui](https://cloud.githubusercontent.com/assets/3357792/10440991/538ad92e-7144-11e5-8a93-b4752fa40f2b.png)

### Install your toolbar

After you install this theme you'll only have the color scheme of __Visual Studio Code__. To enjoy the full experience you must install the next packages.

1. `tool-bar` by suda - This will enable the sidebar. You can set the position to left.
2. `flex-tool-bar` by cakecatz - It will allow us to configure the elements of the tool-bar.
3. `git-plus` by akonwi - Having this you can run git commands from your toolbar.

### Customize your toolbar

You can't see the toolbar yet. To configure it, you must press ctrl+shift+p and write "Flex Tool Bar: Edit Config File". Then paste this code and save it. You should be able to see your new toolbar after restart Atom.

```json
[
  {
    type: "button"
    iconset: "ion"
    icon: "ios-copy"
    callback: "tree-view:toggle"
    tooltip: "Toggle Project Tree"
  }
  {
    type: "button"
    iconset: "fa"
    icon: "columns"
    tooltip: "Split Screen"
    callback: ["pane:split-right"]
  }
  {
    type: "button"
    iconset: "devicon"
    icon: "git-plain"
    callback: "git-plus:menu"
    tooltip: "Git"
    style:
      color: "#0198E1"
  }
  {
    type: "url"
    iconset: "ion"
    icon: "bug"
    url: "http://localhost:8000"
    tooltip: "Debug Django Project"
    show: [ "Python", "HTML", "JavaScript" ]
  }
]
```

### FAQ
__Can I custumize this theme?__
Yes, you can change anything in your styles.less like this:
```css
.theme-atom-visual-studio-code-ui {
  atom-text-editor {
    background-color: #272822;
  }
}
```
__My toolbar icons are too small!__
You can edit the size of the icons in "Preferences > Packages > Tool-bar".

__Something has an incorrect color or size?__
Go to our Github repository, and open an issue uploading an image of your problem. I will fix it as soon as possible. Also, this theme is based on One Dark UI, so if you need further help, please refer to the documentation of said theme.

repository: Zeioth/atom-visual-studio-code-ui

gha_language: CSS

repo_name: Zeioth/atom-visual-studio-code-ui


text:
# minimod
A lightweight C library to wrap the https://mod.io API.

It supports the '*consuming*' part of the API only, it does not support uploading new mods (and related tasks).

- Works on Windows, macOS, Linux and FreeBSD
- No dependencies on non-system libraries during runtime, other than libcurl under Linux and FreeBSD.
- Small filesize of the library (~200 KiB for macOS)
- Allows installed mods to remain in their ZIP form or unzip them
- Includes functionality to simulate high latency connections and server failures
- API documentation in [`/docs`](https://morlad.github.io/minimod) folder
- Many examples in `/tests/examples.c`
- (GNU)make based build on all platforms, using GCC under Linux and clang everywhere else

## Example: Print all games currently on mod.io
```c
#include "minimod/minimod.h"
#include <stdio.h>

void get_games_callback(void *udata, size_t ngames, struct minimod_game const *games, struct minimod_pagination const *pagination)
{
	for (size_t i = 0; i < ngames; ++i)
	{
		printf("- %s {%llu}\n", games[i].name, games[i].id);
	}

	// signal waiting loop in main() that we are done.
	int *nrequests_completed = udata;
	*nrequests_completed += 1;
}

int main(void)
{
	minimod_init(
		MODIO_API_KEY, // your API key
		".modio", // local path for mods + data
		0, // flags like: use test-environment, unzip mods locally, ...
		MINIMOD_CURRENT_ABI); // used to detect incompatible ABIs

	printf("List of games on mod.io\n");

	int nrequests_completed = 0;
	minimod_get_games(NULL, get_games_callback, &nrequests_completed);

	// wait for the callback to finish
	while (nrequests_completed == 0) { /* sleep */ }

	minimod_deinit();
}
```

## Design

### Mega-structs vs. 'more'
Instead of having every minimod-struct map all of the (currently) available
data of the underlying JSON object, they only contain a subset of it.

However, the structs include a *more* field, which can be used together
with the `minimod_get_more_(string|int|bool|float)`-functions to access more fields.

This way neither memory nor time is spent on extracting/converting
fields of the underlying JSON object, which may not even be required
by the calling code.
But they are still accessible when the need arises.

This has *another advantage*: if the underlying API adds new fields
there is no need to update minimod, nor wait for minimod to be updated
but the API's new features can be exploited immediately.

### Caching
minimod does no caching of server responses internally. This would increase
the complexity of the code as well as introduce performance penalties
because of more memory allocations, processing overhead &c.
After all, minimod knows nothing about how often a query will happen,
and which data of the response is actually used by the client app.

So it is up to the client code to handle the caching, if, what and when it
is the right thing to do.

### Filtering: minimod vs. API
Most minimod functions take a *filter*-string, which is passed through to
the API call unaltered. There are a few shortcuts however, so that the client
does not have to construct a string solely for the most used queries.

i.e. `minimod_get_mods(filter, game_id, mod_id, ..)` also has an
argument *mod_id*, which is strictly not necessary as *filter* could be
set to `id=<mod_id>`. But constructing strings can be a nuisance sometimes
so `mod_id` is a regular parameter as well.

A similar approach is taken in other functions, like `minimod_get_mod_events`:
`game_id`, `mod_id`, `date_cutoff`.

### Low on dependencies
On **Windows** minimod only uses system libraries (*kernel32.dll* and *winhttp.dll*)
and links the C runtime statically, thus it is not necessary to bundle/install
a specific version of the msvcrt with your product. Just copy and use the DLL.

minimod on **macOS** only uses system libraries and frameworks, so it is just
about copying the *dylib* along with your project to use it.

The **Linux** and **FreeBSD** builds of minimod require [libcurl](https://curl.haxx.se/libcurl/) to be available,
since there is no system library to make HTTPS requests.

#### Source Dependencies
minimod depends on 3 other MIT licensed libraries when compiling:
- [richgel999/miniz](https://github.com/richgel999/miniz) to handle compression and ZIP files.
	Its amalgamated source is included in this repo.
- [DeHecht/qajson4c](https://github.com/morlad/qajson4c) to parse JSON.
	Its repository is cloned automatically during the build process.
- [morlad/netw](https://github.com/morlad/netw) for cross-platform HTTPS connectivity.
	Its repository is cloned automatically during the build process.

### Unzip or Not
Depending on how an application integrates mods, it is either possible
to use them directly as ZIP file or they need to be unpacked.
minimod supports both by selecting the modus operandi during initialisation
by setting `minimod_init()`'s `MINIMOD_INITFLAG_UNZIP` flag.

### Testing & Debugging
minimod includes the awkwardly named function `minimod_set_debugtesting()`,
which instructs minimod to introduce random delays in its responses to
simulate a bad network connection, i.e. latency.

Further more it can be used to set a rate for simulating internal server
errors (server responding with HTTP status code 500), to test how the
client code copes with those.

repository: morlad/minimod

repo_name: morlad/minimod


text:
# trackable-input

This is a proof of concept, for tracking input text for animation.

**Known problems:**
 - inputs cant have shadowdom,
 - copying the css style for the helper element from the input looks bad

**possible solutions:**
    create another webcomponent for the helper element, so global css wont effect it, or check for an another way to make the custom element send it's data with the form.(without using ajax)

repository: huniddqd/trackable-input

repo_name: huniddqd/trackable-input


text:
# ELF: An Extensive, Lightweight and Flexible Platform for Game Research

Overview
===============

ELF is an **E**xtensive, **L**ightweight and **F**lexible platform for game research, in particular for real-time strategy (RTS) games. On the C++-side, ELF hosts multiple games in parallel with C++ threading. On the Python side, ELF returns one batch of game state at a time, making it very friendly for modern RL. In comparison, other platforms (e.g., OpenAI Gym) wraps one single game instance with one Python interface. This makes concurrent game execution a bit complicated, which is a requirement of many modern reinforcement learning algorithms.

Besides, ELF now also provides a Python version for running concurrent game environments, by Python multiprocessing with ZeroMQ inter-process communication. See `./ex_elfpy.py` for a simple example.

For research on RTS games, ELF comes with an fast RTS engine, and three concrete environments: MiniRTS, Capture the Flag and Tower Defense. MiniRTS has all the key dynamics of a real-time strategy game, including gathering resources, building facilities and troops, scouting the unknown territories outside the perceivable regions, and defend/attack the enemy. User can access its internal representation and can freely change the game setting.

![Overview](./overview.png)

ELF has the following characteristics:

* *End-to-End*: ELF offers an end-to-end solution to game research. It provides miniature real-time strategy game environments, concurrent simulation, intuitive APIs, web-based visualzation, and also comes with a reinforcement learning backend empowered by [Pytorch](https://github.com/pytorch/pytorch) with minimal resource requirement.

* *Extensive*: Any game with C/C++ interface can be plugged into this framework by writing a simple wrapper. As an example, we already incorporate Atari games into our framework and show that the simulation speed per core is comparable with single-core version, and is thus much faster than implementation using either multiprocessing or Python multithreading. In the future, we plan to incorporate more environments, e.g., DarkForest Go engine.

* *Lightweight*: ELF runs very fast with minimal overhead. ELF with a simple game (MiniRTS) built on RTS engine runs **40K frame per second per core** on a MacBook Pro. Training a model from scratch to play MiniRTS **takes a day on 6 CPU + 1 GPU**.

* *Flexible*: Pairing between environments and actors is very flexible, e.g., one environment with one agent (e.g., Vanilla A3C), one environment with multiple agents (e.g., Self-play/MCTS), or multiple environment with one actor (e.g., BatchA3C, GA3C). Also, any game built on top of the RTS engine offers full access to its internal representation and dynamics. Besides efficient simulators, we also provide a lightweight yet powerful Reinforcement Learning framework. This framework can host most existing RL algorithms. In this open source release, we have provided state-of-the-art actor-critic algorithms, written in [PyTorch](https://github.com/pytorch/pytorch).

Documentation
=================
Check [here](http://yuandong-tian.com/html_elf) for detailed documentation. You can also compile your version in `./doc` using `sphinx`.

Basic Usage
==============
ELF is very easy to use. The initialization looks like the following:

```python
# We run 1024 games concurrently.
num_games = 1024

# Wait for a batch of 256 games.
batchsize = 256

# The return states contain key 's', 'r' and 'terminal'
# The reply contains key 'a' to be filled from the Python side.
# The definitions of the keys are in the wrapper of the game.
input_spec = dict(s='', r='', terminal='')
reply_spec = dict(a='')

context = Init(num_games, batchsize, input_spec, reply_spec)
```

The main loop is also very simple:

```python
# Start all game threads and enter main loop.
context.Start()
while True:
    # Wait for a batch of game states to be ready
    # These games will be blocked, waiting for replies.
    batch = context.Wait()

    # Apply a model to the game state. The output has key 'pi'
    # You can do whatever you want here. E.g., applying your favorite RL algorithms.
    output = model(batch)

    # Sample from the output to get the actions of this batch.
    reply['a'][:] = SampleFromDistribution(output)

    # Resume games.
    context.Steps()

# Stop all game threads.
context.Stop()
```

Please check `train.py` and `eval.py` for actual runnable codes.

Dependency
===============
C++ compiler with C++11 support (e.g., gcc >= 4.9) is required. The following libraries are required `tbb` (can be installed with `sudo yum install tbb-devel` in CentOS). CMake is also required.

Python 3.x is required. In addition, you need to install following package: [PyTorch](http://pytorch.org/) version 0.2.0+, `tqdm`, `zmq`, `msgpack`, `msgpack_numpy`

How to train
===============
To train a model for MiniRTS, please first compile `./rts/game_MC` (See the instruction in `./rts/` using `cmake`). Note that a compilation of `./rts/backend` is not necessary for training, unless you want to see visualization.

Then please run the following commands in the current directory (you can also reference `train_minirts.sh`):

```bash
game=./rts/game_MC/game model=actor_critic model_file=./rts/game_MC/model \
python3 train.py
    --num_games 1024 --batchsize 128                                                                  # Set number of games to be 1024 and batchsize to be 128.
    --freq_update 50                                                                                # Update behavior policy after 50 updates of the model.
    --players "fs=50,type=AI_NN,args=backup/AI_SIMPLE|delay/0.99|start/500;fs=20,type=AI_SIMPLE"      # Specify AI and its opponent, separated by semicolon. `fs` is frameskip that specifies How often your opponent makes a decision (e.g., fs=20 means it acts every 20 ticks)
                                                                                # If `backup` is specified in `args`, then we use rule-based AI for the first `start` ticks, then trained AI takes over. `start` decays with rate `decay`.
    --tqdm                                                                  # Show progress bar.
    --gpu 0                                                                 # Use first gpu. If you don't specify gpu, it will run on CPUs.
    --T 20                                                                  # 20 step actor-critic
    --additional_labels id,last_terminal
    --trainer_stats winrate                                                 # If you want to see the winrate over iterations.
                                                                            # Note that the winrate is computed when the action is sampled from the multinomial distribution (not greedy policy).
                                                                            # To evaluate your model more accurately, please use eval.py.
```

Note that long horizon (e.g., `--T 20`) could make the training much faster and (at the same time) stable. With long horizon, you should be able to train it to 70% winrate within 12 hours with 16CPU and 1GPU.  You can control the number of CPUs used in the training using `taskset -c`.

Here is one [trained model](http://yuandong-tian.com/model-minirts-212808.bin) with `T = 16`. Another [trained model](http://yuandong-tian.com/model-minirts-361745.bin) with 80% winrate against `AI_SIMPLE` for `fs_opponent=50`. Here is one game [replay](https://www.youtube.com/watch?v=YgZyWobkqfw).

The following is a sample output during training:
```
Version:  bf1304010f9609b2114a1adff4aa2eb338695b9d_staged
Num Actions:  9
Num unittype:  6
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5000/5000 [01:35<00:00, 52.37it/s]
[2017-07-12 09:04:13.212017][128] Iter[0]:
Train count: 820/5000, actor count: 4180/5000
Save to ./
Filename = ./save-820.bin
Command arguments run.py --batchsize 128 --freq_update 50 --fs_opponent 20 --latest_start 500 --latest_start_decay 0.99 --num_games 1024 --opponent_type AI_SIMPLE --tqdm
0:acc_reward[4100]: avg: -0.34079, min: -0.58232[1580], max: 0.25949[185]
0:cost[4100]: avg: 2.15912, min: 1.97886[2140], max: 2.31487[1173]
0:entropy_err[4100]: avg: -2.13493, min: -2.17945[438], max: -2.04809[1467]
0:init_reward[820]: avg: -0.34093, min: -0.56980[315], max: 0.26211[37]
0:policy_err[4100]: avg: 2.16714, min: 1.98384[1520], max: 2.31068[1176]
0:predict_reward[4100]: avg: -0.33676, min: -1.36083[1588], max: 0.39551[195]
0:reward[4100]: avg: -0.01153, min: -0.13281[1109], max: 0.04688[124]
0:rms_advantage[4100]: avg: 0.15646, min: 0.02189[800], max: 0.79827[564]
0:value_err[4100]: avg: 0.01333, min: 0.00024[800], max: 0.06569[1549]

 86%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉                    | 4287/5000 [01:23<00:15, 46.97it/s]
```

To evaluate a model for MiniRTS, try the following command (you can also reference `eval_minirts.sh`):
```bash
game=./rts/game_MC/game model=actor_critic model_file=./rts/game_MC/model \
python3 eval.py
    --load [your model]
    --batchsize 128
    --players "fs=50,type=AI_NN;fs=20,type=AI_SIMPLE"
    --num_games 1024
    --num_eval 10000
    --tqdm                          # Nice progress bar
    --gpu 0                         # Use GPU 0 as the evaluation gpu.
    --additional_labels id          # Tell the game environment to output additional dict entries.
    --greedy                        # Use greedy policy to evaluate your model. If not specified, then it will sample from the action distributions.
```

Here is an example output (it takes 1 min 40 seconds to evaluate 10k games with 12 CPUs):
```
Version:  dc895b8ea7df8ef7f98a1a031c3224ce878d52f0_
Num Actions:  9
Num unittype:  6
Load from ./save-212808.bin
Version:  dc895b8ea7df8ef7f98a1a031c3224ce878d52f0_
Num Actions:  9
Num unittype:  6
100%|████████████████████████████████████████████████████████████████████████████████████████████| 10000/10000 [01:40<00:00, 99.94it/s]
str_acc_win_rate: Accumulated win rate: 0.735 [7295/2628/9923]
best_win_rate: 0.7351607376801297
new_record: True
count: 0
str_win_rate: [0] Win rate: 0.735 [7295/2628/9923], Best win rate: 0.735 [0]
Stop all game threads ...
```

SelfPlay
=============
Try the following script if you want to do self-play in Minirts. It will start with two bots, both starting with the pre-trained model. One bot will be trained over time, while the other is held fixed. If you just want to check their winrate without training, try `--actor_only`.
```
sh ./selfplay_minirts.sh [your pre-trained model]
```

Visualization
==============

To visualize a trained bot, you can specify `--save_replay_prefix [replay_file_prefix]` whn running `eval.py` to save (lots of) replays. Note that the same flag can also be applied to training/selfplay.

All replay files contain action sequences, are in `.rep` and should reproduce the exact same game when loaded. To load the replay in the command line, using the following:
```bash
./minirts-backend replay --load_replay [your replay] --vis_after 0
```
and open the webpage `./rts/frontend/minirts.html` to check the game. To load and run the replay in the command line only (e.g, if you just want to quickly see who win the game), try:
```bash
./minirts-backend replay_cmd --load_replay [your replay]
```

Reference
=============

When you use ELF, please reference the associated arXiv [paper](https://arxiv.org/abs/1707.01067).

repository: fairinternal/ELF

repo_name: fairinternal/ELF


text:
---
layout: post
title: "Uncertainty is in the map, not in the territory"
tags: [math]
---
{% include JB/setup %}

In my mathematics pre-board exam (which I gave today), there was an
interesting question on
[Bayes' Theorem](https://en.wikipedia.org/wiki/Bayes%27_theorem).
The same question was asked in the previous year's board exam in Delhi.
I'll be discussing that question here.

**Ques) Assume that the chances of a patient having a heart attack is 40%.
It is also assumed that a meditation and yoga course reduces the risk of
heart attack by 30% and prescription of a certain drug reduces its chances
by 25%. At a time a patient can choose any one of the two options with
equal probabilities. It is given that after going through one of the two
options the patient selected at random suffers a heart attack. Find the
probability that the patient followed a course of meditation and yoga.**

There is nothing wrong with the problem statement; the error I want to discuss
comes in play while solving it.
The error goes unnoticed because we arrive at the right final answer;
that is what we are taught to do, right?

```
Let us define the following events:
H: The patient suffers a heart attack
Y: The patient follows a course of Yoga/Meditation
D: The patient takes the certain drug

Then,
P(H) = 40%
P(Y) = P(D) = 1/2 (Patient chooses one of the options with equal probabilites)

P(H|Y) = Probability that patient suffers a heart attack, given that he
         followed a course of Yoga/Meditation
       = (100%-30%) X 40%
       = 28%

P(H|D) = Probability that patient suffers a heart attack, given that he
         takes the certain drug
       = (100%-25%) X 40%
       = 30%

We need to find the probability that the patient had followed a course of
Yoga/Meditiation given that he suffers a heart attack.
That would be P(Y|H)

Bayes' Theorem to the rescue,

               P(H|Y).P(Y)
P(Y|H) = -------------------------
         P(H|Y).P(Y) + P(H|D).P(D)

              28% X 1/2
       = ---------------------
         28% X 1/2 + 30% X 1/2

       = 14/29

So, 14/29 is the final answer

```

The final answer is correct. But some steps in this solution aren't
correct. Still this is the widely circulated solution and is being
taught in schools and getting published in various practice papers
found in help books.

Did you notice that I didn't use the simple form of Bayes' Theorem
in the solution?
If you've been studying under CBSE using the NCERT's Math Book, chances are
you didn't notice.

```
The simple form of Bayes' Theorem:

         P(B|A).P(A)
P(A|B) = -----------
            P(B)

The solution uses an alternative form, which is derived using Law of total
probability:
(https://en.wikipedia.org/wiki/Law_of_total_probability)

P(B) = summation(P(B|Ai).P(Ai))
where {Ai: i = 1,2,3,...} is a partition of the sample space

For example A and A' (complement of A) are a partition of the sample space
because either A will happen (x)or A' will, both can't happen simultaneously.
And together they cover up the entire sample space
P(A) + P(A') = 1

Therefore using Law of total probabilites, we can write
P(B) = P(B|A).P(A) + P(B|A').P(A')

In the solution, if we had applied the simple form we would write:

          P(H|Y).P(Y)
P(Y|H) = -------------
             P(H)

Because Y and D parition the sample space into two parts, i.e. the patient
can only choose one of the two options for reducing the risk of heart
attack, and has to choose at least one.

We expanded P(H) using Law of total probabilites:
P(H) = P(H|Y).P(Y) + P(H|D).P(D)
     = 28% X 1/2 + 30% X 1/2
     = 29%

But we already know P(H) to be 40%
```

How did this happen? How can **P(H)** have two different values? Is Law of
total probability wrong? Nope. It works just fine. It is we who did
something wrong here.

In the solution we define H as
**H: The patient suffers a heart attack**

We can't deny that **P(H)** = 40%, because that is given in the problem
statement.

We defined the probability that patient suffers a heart attack, given
that he took a course of Yoga/Medication as **P(Y|H)**

The total probability of **P(H)** we get doesn't match up because we haven't taken
a little piece of extra information into account:
_The patient needs to choose one of the two options. He can't say that I
choose none of the two preventive measures **Y** and **D**_

The value of 29% we're equating to **P(H)** is not **P(H)**,
it is **P(X)** where X is the event
**X: The patient suffers a heart attack after choosing one of the two
preventive measures**

40% is the _raw probability_ (for lack of a better word) of any patient
having a heart attack irrespective of going through any of the preventive measures.
But once we're given the extra information that the patient has gone through one
preventive measure from Y and D, we assign a lower probability of 29%, that the
patient will suffer a heart attack

Sample space on which H (with probability 40%) is defined is a superset of
the sample space which is partitioned by D and Y. That's because there's no
information given whether the patients with 40% chance of heart attack went
through a preventive measure. So the biggest misstep in our previous
solution was to apply Law of total probability on P(H).

That's why we need an event X, which is completely partitioned by D and Y
so that we can apply Law of total probability.

The confusion arises because P(X|Y) and P(X|D) are computed using P(H).
Because the question states that the chance of a heart attack is reduced by
"30%" or "25%" by following Y or D.

The correct solution would be

```
Redefining our events
H: The patient suffers a heart attack
X: The patient suffers a heart attack after going through
   one of the two preventive measures
Y: The patient follows a course of Yoga/Meditation
D: The patient takes the certain drug

P(X|Y) = Probability that patient suffers a heart attack, given that he
         went through a preventive measure, which was a course of Yoga/Meditation
       = 28%

P(X|D) = Probability that patient suffers a heart attack, given that he
         went through a preventive measure, which was taking a certain drug
       = 30%

And we need to find P(Y|X)
P(Y|X) = Probability that a patient went through a course of Yoga/Meditation,
         given that he suffers a heart attack (even after going through one of
         the preventive measures)

We use Law of total probability to find

P(X) = P(X|Y).P(Y) + P(X|D).P(D)
     = 29%

Then using Bayes' Theorem

P(Y|X) = 14/29
```
As you can see, getting some extra information about an event affects the
probability of it. To quote Eliezer Yudkowsky, [Probability is in the mind]
(http://lesswrong.com/lw/oj/probability_is_in_the_mind/).

If we have a device that can detect whether a person will have a heart
attack in near future, probability of that person having a heart attack
will be either 1 or 0 depending on what the device tells.
The event of having a heart attack isn't inherently random. The probability
we assign is a number representing *our lack of information*

When we toss a coin, if we are able to measure the exact value of force,
the position where we apply it, the initial position of the coin extremely
precisely; we can predict the outcome of the toss that is,
P(heads) will be either 1 or 0.

Our currently assigned probabilities of 1/2 and 1/2 to the event of getting
tails and heads are *our lack of information* and not because of some
spooky randomness inside the coin.

**Uncertainity isn't in the territory, it's in the map**

Therefore, when we get some extra information about an event with some
prior probability, this information can affect the probability of the
event. This is what Bayes' Theorem is all about.

gha_language: HTML


text:
Python TMCL client library
==========================

Python wrapper around Trinamic's TMCL serial interface for controlling TMCM stepper modules
via a serial-to-rs485 converter.

Installation
------------

### Install using pip
```sh
> pip install tmcl
```

### Install without pip
```sh
> git clone https://github.com/NativeDesign/python-tmcl.git
> cd python-tmcl
> python setup.py install
```

Usage
-----

Use an RS485-to-serial adapter to connect your PC to one or more TMCM modules.
Before starting you should check the modules' serial-address and baud-rate is
a known value. Out of the box (_warning: anecdotal_) modules usually have an address
of `1` and a baud-rate of `9600` but this is not guarenteed. The easiest way to check
these values is by using the [TMCL IDE][1] on a windows machine.

If using multiple TMCM modules attached to the same rs485 bus you __must__ ensure that
each module is set to a _different_ serial-address so that they don't clash.

### Example usage (single-axis modules)
```python
from serial import Serial
from time import sleep
import TMCL

## serial-address as set on the TMCM module.
MODULE_ADDRESS = 1

## Open the serial port presented by your rs485 adapter
serial_port = Serial("/dev/tty.usbmodem1241")

## Create a Bus instance using the open serial port
bus = TMCL.connect(serial_port)

## Get the motor
motor = bus.get_motor(MODULE_ADDRESS)

## From this point you can start issuing TMCL commands
## to the motor as per the TMCL docs. This example will
## rotate the motor left at a speed of 1234 for 2 seconds
motor.rotate_left(1234)
sleep(2)
motor.stop()
```

### Example usage (multi-axis modules)
```python
from serial import Serial
import TMCL

## Open the serial port presented by your rs485 adapter
serial_port = Serial("/dev/tty.usbmodem1241")

## Create a Bus instance using the open serial port
bus = TMCL.connect(serial_port)

## Get the motor on axis 0 of module with address 1
module = bus.get_module( 1 )

a0 = module.get_motor(0)
a1 = module.get_motor(1)
a2 = module.get_motor(2)

```

API Overview
------------

#### class Motor (bus, address, axis)

##### `move_absolute (position)`
Move the motor to the specified _absolute_ position.

##### `move_relative (offset)`
Move the motor by the specified offset _relative to current position_.

##### `reference_search (rfs_type)`
Start a reference search routine to locate limit switches.

##### `rotate_left (velocity)`
Rotate the motor left-wards at the specified velocity.

##### `rotate_right (velocity)`
Rotate the motor right-wards at the specified velocity.

##### `run_command (cmd)`
Execute a predefined user subroutine written to TMCM module firmware

##### `send (cmd, type, motorbank, value)`
Send a raw TMCL command to the motor.

##### `stop ()`
Stop the motor

[1]: https://www.trinamic.com/support/software/tmcl-ide/

repository: apcro/python-tmcl

gha_language: Python

repo_name: apcro/python-tmcl


text:
jquery-nav-menu
===============

A jQuery navigation menu that stores the URLs and corresponding data in an array.  The nav menu populates automatically, regardless of how many items there are.

This requires jQuery and the Cycle plugin, along with Cycle Carousel plugin.

repository: nebulousecho/jquery-nav-menu

repo_name: nebulousecho/jquery-nav-menu


text:
# stateless-chat

> Simple stateless chat built with HapiJs, Socket.io and some CSS Grids for frontend. For fun.

Actually, built to learn a bit of Socket.io and having fun with new CSS grids.

## Install

```
$ git clone https://github.com/LasaleFamine/stateless-chat
```

## Usage

Just run the server and go to http://localhost:3000

```
$ yarn && yarn start
```

## License

MIT © [LasaleFamine](https://godev.space)

repository: LasaleFamine/stateless-chat

repo_name: LasaleFamine/stateless-chat


text:
# Distillery

Talk to a remote API without needing to expose your secret token or all the API endpoints

## The problem

Distillery was created to __secure the communication with a remote APIs from the browser__.

To talk to public APIs, (i.e.: Instagram, Twitter, etc.) you need a secret token which gives you access to the API endpoints. You __can't__ let other people know about this secret token, or they could do nasty things to your account.

Distillery is a NodeJS library that proxies the API calls through, while hiding your secret token. You can also specify what methods and specific endpoints you want to deny or allow access to.

## Install

Use __npm__ to install it in your project:

```
$ npm install distillery
```

Or __clone__ it using git:
```
$ git clone git@github.com:jorgepedret/distillery.git
```

Or __download__ it from github [https://github.com/jorgepedret/distillery/archive/master.zip](https://github.com/jorgepedret/distillery/archive/master.zip)

## Instagram API Example Server

Example configuration:

```
// config.json
{
  "services": {
    "instagram": {
      "remoteUrl": "https://api.instagram.com/v1/",
      "auth": {
        "method": "get",
        "key": "client_id",
        "value": "cfxxxxxxxxxxxxxxxxxxxxxxxxxxxx13"
      },
      "rules": {
        "deny": {
          "methods": ["post", "put"],
          "paths": ["users/search"]
        }
      }
    }
  }
}
```

Run the server:

```
$ node server.js
Express + Distillery server is running on port 3000
```

Or use it like a library:

```
var express     = require("express"),
    app         = express(),
    config      = require("./config"),
    Distillery  = require("distillery");

var distillery_app = new Distillery(config, app);
distillery_app.start();

app.listen(3000);
```

Consume the API:

```
// http://instagram.com/developer/endpoints/media/#get_media_popular
$ curl "http://localhost:3000/instagram/media/popular"
{
  "meta": {
    "code": 200
  },
  "data": [
    {
      "attribution": null,
      "tags": [],
      "location": null,
      "comments": {
        "count": 48,
        "data": [
        ...
```

View example in codepen: [http://codepen.io/jorgepedret/pen/rHvgj](http://codepen.io/jorgepedret/pen/rHvgj) (You must be locally running the distillery server on port 3000)

Trying to access __blocked paths or methods__ will return a 404 error:

```
// http://instagram.com/developer/endpoints/users/#get_users_search
$ curl "http://localhost:3000/instagram/users/search?q=jorge"
{
  "error": "Endpoint not found"
}
```

## Documentation
TODO (See the `test` directory for implementation details)

## TODO
- Support standard (and popular APIs) ways of authenticating
- Improve the way deny/allow works
- Switch to a lighter HTTP server (replace express)

## License
MIT

repository: jorgepedret/distillery

repo_name: jorgepedret/distillery


text:
## Build the docs:

### Dependencies:
1. Python 3
2. Remove "tensorflow" from `requirements.txt` since you probably prefer to install TensorFlow by yourself.
3. `pip install -r requirements.txt`. Note that these requirements are different from tensorpack dependencies.

### Build HTML docs:
`make html`
will build the docs in `build/html`.

### Build Dash/Zeal docset

1. `pip install doc2dash`
2. `make docset` produces `tensorpack.docset`.

### Subscribe to docset updates in Dash/Zeal:

Add this feed in Dash/Zeal: `https://github.com/tensorpack/tensorpack/raw/master/docs/tensorpack.xml`.

repository: tensorpack/tensorpack

repo_name: tensorpack/tensorpack


text:
# CP-Profiler
Profiling and Visualisation for Constraint Programming

Most recent binaries for Linux and Mac are available [here](https://github.com/cp-profiler/cp-profiler/releases/tag/0.2).

## Table of Contents
- [Building from Source](#building-from-source)
- [How to Use](#how-to-use)
  - [Connecting with a Solver](#connecting-with-a-solver)
  - [Basic Search Tree Visualisation](#basic-search-tree-visualisation)
    - [Node Actions](#node-actions)
    - [Changing *display refresh rate*](#changing-display-refresh-rate)
  - [Alternative Ways of Displaying the Search](#alternative-ways-of-displaying-the-search)
    - [Hiding by size](#hiding-by-size)
    - [Pixel Tree view](#pixel-tree-view)
    - [Icicle Tree view](#icicle-tree-view)
  - [Analysis Techniques](#analysis-techniques)

### Building from Source

Dependencies:

  * 5.4.x ≤ Qt < 5.6.x

Compiling Linux/Mac:

    git submodule update --init
    mkdir build && cd build
    qmake .. && make

### How to Use:
#### Connecting to a solver
1. Start CP-Profiler

  (from *cp-profiler/build* directory):

  `cp-profiler.app/Contents/MacOS/cp-profiler` (Mac)

2. Run a solver of interest. The solver must support the protocol for profiling. We provide integration libraries if you wish to add the support for a new solver (see [C++](https://github.com/cp-profiler/cpp-integration) and [Java](https://github.com/cp-profiler/java-integration) integration libraries).

  For example, to use integrated version of Gecode ([source code](https://github.com/cp-profiler/gecode-profiling) and [binaries](https://github.com/cp-profiler/cp-profiler/releases)), just execute a model normally with CP-Profiler running in the background:

    `tools/flatzinc/fzn-gecode my-model.fzn`

3. If CP-Profiler is running in the background, the solver will start *sending* information about the execution in real time, which CP-Profiler will use to incrementally *draw* the *search tree*. If a connection to CP-Profiler could not be established (e.g. CP-Profiler is closed), the solver will execute normally without profiling.

Note: Because every new *node* can potentially cause the entire *search tree* layout to be recalculated (and slow down the drawing), it is recommended that ***display refresh rate*** is set to a reasonably high number (>1000), unless the rate at which the solver explores the nodes is low as well.

![Execution Manager](https://raw.githubusercontent.com/msgmaxim/profiler_pictures/master/profiler_menu.png "Execution Manager View")

Multiple executions can be analysed at the same time (e.g. for the purpose of comparison) and will be listed in the *execution manager* above.

During a solver execution, **CP-Profiler** will be constructing the search tree in the background by default. Selecting an execution from the list and clicking *show tree* will display the corresponding search tree (updating it in real time if the solver is still running).

#### Basic Search Tree Visualisation

![Search Tree Example](https://github.com/msgmaxim/profiler_pictures/raw/master/alpha_tree.png "Search Tree Example")

##### Node Actions
When a node is selected (a selected node will be displayed in yellow colour), some actions will become available for the user. These actions can be found under *Node* menu. Some these actions have keyboard shortcuts assigned. For example, pressing `L` on the keyboard will display search decisions for the subtree under the selected node, while `Shift+L` will display search decisions for nodes on the path from the root to the current node.

Some other common actions:

| Key       | Description               |
| :---------------: | ----------------------------------- |
| `F`       | Collapse descendant subtrees with no solutions |
| `H`       | Collapse the entire subtree |
| `U`       | Undo any collapsing done under selected node |

##### Changing *display refresh rate*
***Display refresh rate*** determines how many nodes should be received between any two consecutive updates of the search tree drawing.

The property is available under *Preferences...* sub-menu and its value will persist for any further solver executions.

#### Alternative Ways of Displaying the Search

##### Hiding by size

##### Pixel Tree view

In *Pixel Tree view* nodes are represented by *squares* (pixels), and edges only implicitly by the indentation between the *squares*. Parent nodes are placed immediately to the left of their subtree and the leaves of each subtree are grouped to the rightmost position.

The image below shows a correspondence between nodes in a *traditional view* and those in a *Pixel Tree* view. Note that a *green vertical line* indicates a *solution* found at the corresponding node.

![Pixel Tree View Basic Example](https://raw.githubusercontent.com/msgmaxim/profiler_pictures/master/basic_pt.png "Pixel Tree View Basic Example")

One of the main advantages of the pixel tree view is the ability to **compress it while preserving large scale patterns** and thus providing a good overview of the search. The compression is done by simply allowing multiple nodes on the same horizontal position.

The example below shows a tree with around *100K* nodes with *compression* set to `500` (`500` nodes for every horizontal position).

![Pixel Tree View Larger Example](https://raw.githubusercontent.com/msgmaxim/profiler_pictures/master/pixel_tree.png "Pixel Tree View Larger Example")

TODO: talk about histograms underneath

This view is available under *Tree* submenu.

##### Icicle Tree view
todo

#### Analysis Techniques
##### Similar Subtree Analysis
##### Search Tree Comparison

The following example demonstrates a comparison of two executions of the *Golomb Ruler* problem with 5 marks: one with a *symmetry breaking constraint* and one without. Here the two executions have been captured by the profiler and their search tree visualised (currently visualising is required prior to comparing).

![Two executions](https://raw.githubusercontent.com/msgmaxim/profiler_pictures/master/comparison_conductor.png "Two executions")

![Golomb 5](https://raw.githubusercontent.com/msgmaxim/profiler_pictures/master/golomb5.png "Golomb 5")
![Golomb 5 with symmetry breaking](https://raw.githubusercontent.com/msgmaxim/profiler_pictures/master/golomb5_sym_brk.png "Golomb 5 with symmetry breaking")

Clicking **compare trees** button from *execution conductor* menu will initiate the comparison of the two selected executions.

![Merged Tree](https://raw.githubusercontent.com/msgmaxim/profiler_pictures/master/golomb5merged.png "Merged Tree")

The resulting **merged** tree will consist of:
- the part that is common for both executions

- (multiple) *pentagon subtrees* indicated by pentagons ![Pentagon Image](https://raw.githubusercontent.com/msgmaxim/profiler_pictures/master/pentagon_icon.png "pentagon image")

A *pentagon* is found where the two executions diverge. It is a parent node for two subtrees:  one for each of the executions compared.

 The two subtrees represent exploration of the same search space. For example, the right-most pentagon on the image above has one failure node on the right that corresponds to the execution with a symmetry breaking constraint. Without the constraint, the solver had to do significantly more work as indicated by the highlighted subtree on the left.

**Pentagon list** option under *Analysis* submenu will bring up a list of pentagons. Each pentagon is displayed along with the information about the size of the subtrees it contains (*left* subtree, and *right* subtree). The list is sorted by the difference in the number of nodes each pair of subtrees contain. Clicking on a row will navigate to the corresponding pentagon node on the tree view.

repository: blockspacer/cp-profiler-deprecated-

repo_name: blockspacer/cp-profiler-deprecated-


text:
# Installation

1. Make sure you have nix installed, if not run `sh <(curl -L https://nixos.org/nix/install) --daemon`
2. Clone this repo with `git clone https://github.com/antotocar34/dotfiles.git`
3. `nix --extra-experimental-features nix-command --extra-experimental-features flakes develop .`
4. Install ssh private key in `~/.ssh'
5. `export NIXPKGS_ALLOW_UNFREE=1; home-manager switch -b old --impure --flake .`


text:
# What is GitVersion

GitVersion is a tool to help you achieve *Semantic Versioning* on your project.

* [GitVersion Project homepage](https://github.com/GitTools/GitVersion)

# How to use this image

This image will run GitVersion Command Line tool. It expects the git rempository to be bound at /src

    $ docker run --rm -v "$PWD:/src" ilucker/gitversion /h

repository: dpoblacion/docker-gitversion

repo_name: dpoblacion/docker-gitversion


text:
# Welcome to The Aci Unity Tools Documentation.

The ACI Unity Tools are a collection of unity scripts to provide several high-level functionalities.
The tools are provided and maintained by the [Affective & Cognitive Institute](https://affective-lab.org). It is distributed under the terms of the MIT license agreement.

For information on how to set up your unity project for use with the head over to [the setup page](setup.md).
Information on how to use the provided Assets can be found in [the manuals section](manual/index.md).
An API overview is provided via the automatically generated [source code documentation](api/index.md).


text:
# Intro to Brain Computer Interfaces

These are the course materials for [Intro to Brain Computer Interfaces](http://neurotechberkeley.org/course/info.html).

The course consists of labs and lectures. We will host all the labs here. The lectures will be linked on the [course website](http://neurotechberkeley.org/course/schedule.html).

### Labs
The planned labs are as follows:

- [Lab 1: Getting started with EEG](http://docs.openbci.com/Tutorials/02-Ganglion_Getting%20Started_Guide)
- Lab 2: Sensory extension
- [Lab 3: Detecting event-related potentials](lab3)
- [Lab 4: Neurofeedback](lab4)
- Lab 5: Steady-state visually evoked potentials
- Lab 6: Detecting stress using biosignals
- Lab 7: Cross-brain correlations, reward using event-related potentials
- Lab 8: Detecting arm movements neck tension from EMG
- Lab 9: Detecting stages of sleep using EEG

repository: rayrc/bci-course

repo_name: rayrc/bci-course


text:
Say what you want about Barack Obama's 'change' message, just know if you go with J.o.hn M.c.Cain you're saying yes to four more years of Bush style politics.  While he's still hawking that 'maverick' tag, don't believe the hype, instead, let's look at some statements by the senator.  Recently M.c.Cain perked my interest when he came out _in favor _of FISA, warrantless wiretapping/eavesdropping and executive power.  Funny thing is, he had the [exact opposite opinion on these topics](http://www.salon.com/opinion/greenwald/2008/06/06/mccain/print.html) when he was asked in December 2007!

> On Wednesday, I documented J.o.hn **M.c.Cain's complete reversal of views -- in the last six months alone -- on FISA, warrantless eavesdropping and executive power**. M.c.Cain's diametrically opposite views were contained in a questionnaire M.c.Cain completed for _The Boston Globe_ last December (wherein **he rejected many of the Bush/Cheney theories** of presidential omnipotence and warrantless eavesdropping) and then a statement M.c.Cain issued this week to _National Review_ (wherein **he embraced those same theories in order to persuade the Right** that he approves of and would continue Bush's lawless surveillance policies).

Another source states more of [what transcribed at the National Review:](http://www.huffingtonpost.com/2008/06/06/mccain-supports-bushs-war_n_105610.html)

> A top adviser to Senator J.o.hn M.c.Cain says Mr. **M.c.Cain believes that President Bush's program of wiretapping without warrants was lawful**, a position that appears to bring him into closer alignment with the sweeping theories of executive authority pushed by the Bush administration legal team.

In a letter posted online by National Review this week, the adviser, Douglas Holtz-Eakin, said Mr. **M.c.Cain believed that the Constitution gave Mr. Bush the power to authorize the National Security Agency to monitor Americans' international phone calls and e-mail without warrants**, despite a 1978 federal statute that required court oversight of surveillance...

<!-- more -->Furthermore, [M.c.Cain sounds like Bush Lite when discussing the war in Iraq](http://www.huffingtonpost.com/joseph-a-palermo/john-mccain-and-iraq---a_b_106071.html), witness these pontifications:

> On March 20, 2003, J.o.hn M.c.Cain said on television: "The Iraqi people will greet us as liberators." Three days later he said: "This conflict is . . . going to be relatively short." Thereafter M.c.Cain has become one of those guys, like Thomas Friedman, who sees the looming American victory in Iraq in six-month intervals. On September 10, 2003, M.c.Cain said: "I would argue that the next three to six months will be critical." On February 4, 2007, he said: "We can know fairly well in a few months." On September 12, 2007, he said: "The next six months are going to be critical."

M.c.Cain claims to have seen for himself all of the wonderful progress being made in Iraq. He doesn't like to dwell on the 4,100 American lives lost, and the 500,000 to 1 million Iraqi deaths. Neither does he wish to acknowledge the 2 million internally displaced people, nor the 2 million refugees who have fled the country since 2003, nor the gutted infrastructure, nor the profiteering from Haliburton and KBR and other American contractors, nor the hatred and animosity the occupation of Iraq has engendered throughout the world.

Nice eh?  So next, look how often M.c.Cain (you know, the maverick) [voted in line with the President’s position](http://www.progressivemediausa.org/2008/05/27/john-mcsame/) recently:

> [...] it is a well known fact that Senator M.c.Cain misses the most votes in the Senate. In fact, he was crowned the most absent Senator in 2008. Therefore, **_when J.o.hn M.c.Cain even bothered to show up and vote in the Senate - which wasn’t often - he voted with Bush 100% of the time._**

Ok, so that's got to be some anomaly, surely a maverick senator wouldn't agree with the most unpopular president in history all the time, let's look at some earlier years:

>

>
>

>
>

> 2007
>

> 95%
>

> 5%
>

>
>

> 2006
>

> 89%
>

> 11%
>

>
>

> 2005
>

> 77%
>

> 23%
>

>
>

> 2004
>

> 92%
>

> 8%
>

>
>

> 2003
>

> 91%
>

> 9%
>

>
>

> 2002
>

> 90%
>

> 10%
>

>
>

> 2001
>

> 91%
>

> 9%
>

Of course this all makes more sense when you realize that Karl Rove [is an adviser to the M.c.Cain Campaign](http://www.huffingtonpost.com/2008/06/03/fox-news-finally-identifi_n_104976.html).  Ah, so M.c.Cain would be like a new puppet, but with the same puppetmaster pulling the strings.  Is this what we want from our next president?  If not,  check out the Huffington Post's [OffTheBus](http://www.huffingtonpost.com/off-the-bus/) project, now it "..._is launching [the John M.c.Cain News Hunt](http://www.huffingtonpost.com/amanda-michel/join-the-john-mccain-news_b_104629.html), an investigative project designed to get the real story on the media's coverage of M.c.Cain -- and document the ways the media is giving him a free ride_."  More on McSame as the days go on...  Meanwhile, Barack Obama continues to set him self apart from M.c.Cain - it's a real difference, and a real change between the two men.


text:
# Weather Dashboard
  [![License](https://img.shields.io/badge/license-MIT-green)](./LICENSE)
  ## Description
  A site that allows the user to search a city and recieve the current weather along with the five day forecast of that city.

  ## Table of Contents
  - [Usage](#usage)
  - [License](#license)
  - [Contributing](#contributing)
  - [Questions](#questions)
  ## Usage
  Enter a city name in the search bar and press submit.

  ## How to Contribute
  Please provide feedback with the links below

  ## Questions
  Want to reach me or see more of my work and projects? My Github is linked below and my Email is listed as well.
  * [Github](https://github.com/Colon182)
  *<EMAIL_ADDRESS>
  # License
    Licensed under MIT license.


text:
[<< previous](07-inversion-of-control.md) | [next >>](09-templating.md)

### Dependency Injector

A dependency injector resolves the dependencies of your class and makes sure that the correct objects are injected when the class is instantiated.

There is only one injector that I can recommend: [Auryn](https://github.com/rdlowrey/Auryn). Sadly all the alternatives that I am aware of are using the [service locator antipattern](http://blog.ploeh.dk/2010/02/03/ServiceLocatorisanAnti-Pattern/) in their documentation and examples.

Install the Auryn package and then create a new file called `Dependencies.php` in your `src/` folder. In there add the following content:

```php
<?php declare(strict_types = 1);

$injector = new \Auryn\Injector;

$injector->alias('Http\Request', 'Http\HttpRequest');
$injector->share('Http\HttpRequest');
$injector->define('Http\HttpRequest', [
    ':get' => $_GET,
    ':post' => $_POST,
    ':cookies' => $_COOKIE,
    ':files' => $_FILES,
    ':server' => $_SERVER,
]);

$injector->alias('Http\Response', 'Http\HttpResponse');
$injector->share('Http\HttpResponse');

return $injector;
```

Make sure you understand what `alias`, `share` and `define` are doing before you continue. You can read about them in the [Auryn documentation](https://github.com/rdlowrey/Auryn).

You are sharing the HTTP objects because there would not be much point in adding content to one object and then returning another one. So by sharing it you always get the same instance.

The alias allows you to type hint the interface instead of the class name. This makes it easy to switch the implementation without having to go back and edit all your classes that use the old implementation.

Of course your `Bootstrap.php` will also need to be changed. Before you were setting up `$request` and `$response` with `new` calls. Switch that to the injector now so that we are using the same instance of those objects everywhere.

```php
$injector = include('Dependencies.php');

$request = $injector->make('Http\HttpRequest');
$response = $injector->make('Http\HttpResponse');
```

The other part that has to be changed is the dispatching of the route. Before you had the following code:

```php
$class = new $className($response);
$class->$method($vars);
```

Change that to the following:

```php
$class = $injector->make($className);
$class->$method($vars);
```

Now all your controller constructor dependencies will be automatically resolved with Auryn.

Go back to your `Homepage` controller and change it to the following:

```php
<?php declare(strict_types = 1);

namespace Example\Controllers;

use Http\Request;
use Http\Response;

class Homepage
{
    private $request;
    private $response;

    public function __construct(Request $request, Response $response)
    {
        $this->request = $request;
        $this->response = $response;
    }

    public function show()
    {
        $content = '<h1>Hello World</h1>';
        $content .= 'Hello ' . $this->request->getParameter('name', 'stranger');
        $this->response->setContent($content);
    }
}
```

As you can see now the class has two dependencies. Try to access the page with a GET parameter like this `http://localhost:8000/?name=Arthur%20Dent`.

Based on the `http` documentation. To actually display the output in a browser, you have to add `getContent` method to the existing `show` method.
```
  public function show()
    {
        $content = '<h1>Hello World</h1>';
        $content .= 'Hello ' . $this->request->getParameter('name', 'stranger');
        $this->response->setContent($content);

        foreach ($this->response->getHeaders() as $header) {
            header($header, false);
        }

        echo $this->response->getContent();
    }
   ```

Congratulations, you have now successfully laid the groundwork for your application.

[<< previous](07-inversion-of-control.md) | [next >>](09-templating.md)

repository: njokdan/no-framework-tutorial

repo_name: njokdan/no-framework-tutorial


text:
# flaky-tracker

Project that scans and extract flaky tests from Buildkite pipelines

## Installation

1. Create an S3 bucket
1. Upload the Buildkite token to s3 Bucket:
    1. The S3 object key name should be of the form `<Organization Name>/config.json`
    1. The content should be

        ```json
        {
          "buildkite_api_key": "<Buildkite API Key>"
        }
        ```

1. Install library: `yarn add flaky-tracker`

## Usage

1. Call the `extractFlakySpec`. For Example:

    ```typescript
      import extractFlakySpec, {
        aggregateArtifactStrategy,
        flakyJobsOutputStrategy,
      } from "flaky-tracker";

      await extractFlakySpec(
        "<S3 bucket Name>",
        "<Organization Name>",
        "<Pipeline Name>",
        "<Pipeline Slug>",
        flakyJobsOutputStrategy,
      );
    ```

1. The above function will scan the builds from the last 2 days and upload the flaky specs to the S3 Bucket. You can use Quicksight to create graphs/tables using the S3 Bucket.

## Supported strategies

1. `flakyJobsOutputStrategy`

    This strategy scans the rspec output of jobs that passed on retry. It works if you use the default rspec output, and do not retry inside the same job

1. `aggregateArtifactStrategy`

    This strategy works if you aggregate all failures in an artifacts `tmp/non-deterministic-and-failures.json`, even when the build passes

repository: arturopie/flaky-tracker

repo_name: arturopie/flaky-tracker


text:
# rainbow

Unweaving the rainbow — recovering data from scientific images with unknown colourmaps.

I think this bot will be called `keats`. From John Keats's poem _Lamia_

```
Do not all charms fly
At the mere touch of cold philosophy?
There was an awful rainbow once in heaven:
We know her woof, her texture; she is given
In the dull catalogue of common things.
Philosophy will clip an Angel's wings,
Conquer all mysteries by rule and line,
Empty the haunted air, and gnomèd mine—
Unweave a rainbow, as it erewhile made
The tender-person'd Lamia melt into a shade.
```

repository: kwinkunks/rainbow

gha_language: Jupyter Notebook

repo_name: kwinkunks/rainbow


text:
# Wltoys-v202
## Goal
Send or receive wltoys v202 paquets with NRF24L01 chip.

This arduino library can thanks to a nrf24L01 chip :
* Receive and decodes frames from the v202/v222/v262/v282... transmitter.
* Create and send v202 frames from transmitter to the original Wltoys receiver.

I want to thank execuc, Rivig and deviationTX community for sharing their code :
* https://github.com/execuc/v202-receiver
* https://bitbucket.org/rivig/v202/src
* https://github.com/DeviationTX/deviation/blob/master/src/protocol/v202_nrf24l01.c

This code has not been tested enough and it is not reliable. So don't use it with dangerous rc model as planes, helicopters, cars...

## Hardware
You juste need an arduino uno/pro mini/nano and a nrf24l01+ chip.  Connect SCK, MISO, MOSI on pins D13, D12 and D11.   Then connect CE and CS on digital pins you have chosen in the code (see the `wireless.setPins()` method below).  Finally connect nrf24l01 VCC and GND to arduino 3.3V and GND pins.

## Use
There are two classes :

 * CustomNRF24 :    handle the spi protocol to communicate with the nrf24l01p chip (rx and tx)
 * V202 :           handle the v2xx protocol

You need to initilize these class like that :

    CustomNRF24 nrfChip;
    V202 protocolV202;

The nrf24l01 pins must be defined in arduino setup function. `setPins` method arguments define the nrf24L01 CE (chip enable) and CS (SPI chip select) pins in this order. In my example, I did not use SS arduino pin as CS but D7 but SS pin must be set to output to activate the SPI mode to master.

    void setup() {
      // SS pin must be set as output to set SPI to master !
      pinMode(SS, OUTPUT);
      Serial.begin(115200);
      // Set CS pin to D7 and CE pin to D8
      nrfChip.setPins(8,7);
      protocolV202.init(&nrfChip);
      ...
    }

SPI wrapper (CustomNRF24 class) are linked to the protocol in the setup function

    protocolV202.init(&nrfChip);

In the loop function0, v202Protocol Run() method must be called at most every 4ms with & `rx_values_t` structure:

    uint8_t value = protocolV202.run(&rxValues);

This function has several kind of returns from an enum :

    enum rxReturn
    {
       BOUND_NEW_VALUES = 0,   // Bound state, frame received with new TX values
       BOUND_NO_VALUES,        // Bound state, no new frame received
       NOT_BOUND,              // Not bound, initial state
       BIND_IN_PROGRESS,       // Bind in progress, first frame has been received with TX id, wait no bind frame.
       ERROR_SIGNAL_LOST,      // Signal lost
       UNKNOWN                 // Not used for moment
    };

When a frame is received (`BOUND_NEW_VALUES`), `rx_values_t` structure can be read :

    typedef struct __attribute__((__packed__)) {
      uint8_t throttle;
      int8_t yaw;
      int8_t pitch;
      int8_t roll;
      int8_t trim_yaw;
      int8_t trim_pitch;
      int8_t trim_roll;
      uint8_t flags;
    } rx_values_t;

Four axis, 3 trims values and flags are available. Last value depends on buttons pushed on the transmitter.

## Improvements
There are many improvements to do :
- [ ] Make more reliable code, first.
- [ ] Handle signal lost : return to initial state for example.
- [ ] Make a better state machine for this protocol with a re-factor of the code and a smaller footprint.
- [ ] Reduce execution time. State machine takes 120us when a frame arrived and 32ms when there are nothing to do.
- [ ] Implement this protocol in the multiwii project, if it useful.
- [ ] Configure AETR or TAER order.


text:
# Coded by Jesse Nebling (@bashexplode)

#### Summary

pmap.py utilizes the API from censys.io to pull open services from a repository of scans that are performed on a regular basis by the University of Michigan, and shodan.io. This allows us to pull information on client resources without actively scanning them for the first few days of an external pentest, allowing for much greater stealth and a lesser likelihood of being caught by an IDS. Because the scans only cover the ports below, pmap.py is great for the start of external pentests, but if the results do not give a foothold it would be smart to still perform an nmap scan on ports outside of the censys.io scope.

Censys.io ports: 21, 22, 23, 25, 53, 80, 102, 110, 143, 443, 465, 502, 993, 995, 1911, 7547, 20000, 47808

Shodan.io ports: 21, 22, 23, 80, UDP:161, 443, 554, 5060, 8080, 8443

#### Usage:

python pmap.py [-h] (-q QUERY | -iL FILENAME) [-oA OUTPUTALL | -oS OUTPUTSTANDARD | -oC OUTPUTCSV | -oX OUTPUTNMAPXML] [-sV]

Parameters/Flags:

-q <query> : A single query that can be an IP address, a hostname, or an IP range [e.g. 192..0.0.1, www.microsoft.com, <IP_ADDRESS>/24, <IP_ADDRESS> - <IP_ADDRESS>]

-iL <filename> : A list of queries from a file with above queries separated by new lines. [works best with CIDR ranges because of API rate limits]

-oS <filename> : Designates an output file for the standard output of the script.

-oX <filename> : Designates an output file in an xml format based on the nmap xml format that can be easily imported to a metasploit workspace.

-oC <filename> : Designates an output file in a csv format for easy readability.

-oA <filename> : Creates all available output file types.

-sV : Pulls additional services information that censys.io collects [not recommended for use with very large host files because of API rate limit]

-c : Only pull results from Censys.io

-s : Only pull results from Shodan.io

-p <proxy> : Specify SOCKS5 proxy (i.e. <IP_ADDRESS>:8123)

-T <threads> : Specify the number of threads to use. Unstable with verbose standard logging. [Default = 1]

-v : Verbose mode

#### Requirements:

Your API keys for Shodan and Censys.io

Python 3

##### if you are using a new version of openSSL you may need to downgrade. here's an easy script to do so: https://gist.github.com/bmaupin/8caca3a1e8c3c5686141

#### License:
This script is under the [BSD 3-Clause license](https://raw.githubusercontent.com/bashexplode/Invoke-LateralMovement/master/LICENSE).

repository: bashexplode/pacifist-toolkit

repo_name: bashexplode/pacifist-toolkit


text:
GeoGate Simulator
=================

GeoGate is an opensource GPS/AIS tracking server framework, that enable easy
integration of multiple GPS trackers in WEB applications. It provides data
acquisition drivers for typical tracker devices or phone's GPS apps.
It handle multiple database backend, and support GeoJSON, AIS & NMEA encoding/decoding.
It embed support for multiple classes of trackers, phone-apps, as well an NMEA & AIS simulator.

GeoGate-SmsGateway
==================

SmsGateway provides a REST/HTTP interface to GeoGate SmsClient.

In order to use this module, you need a working Gammu SMS gateway and GeoGate SmsClient module
configure with MySQL backend. For details check http://fr.wammu.eu/smsd/

Install
=======
       npm install ggsmsg   [will install ggsmsc dependency]
       cd node_modules/ggsmsg

Command line
=============
       # Edit SmsRestGateway.js to reflect your SmsClient config
       node ./bin/SmsRestGateway.js

repository: fulup-bzh/GeoGate

gha_language: JavaScript

repo_name: fulup-bzh/GeoGate


text:
---
title: 'Automated Reservation'
permalink: /browse-all-solutions-Food-Services/Automated-Reservation
---

## Automated Reservation
## Overview

**Support Level and Conditions**

Up to 80% for SMEs, N.A. for non-SMEs

This solution is supported by Enterprise Singapore (EnterpriseSG). For more information, please refer to [https://www.enterprisesg.gov.sg/financial-assistance/grants/for-local-companies/productivity-solutions-grant](https://www.enterprisesg.gov.sg/financial-assistance/grants/for-local-companies/productivity-solutions-grant){:target="_blank"}{:rel="noopener"}

**Recommended courses**

When adopting the solutions under this sub-category, you might wish to think about how to invest in developing the right skillsets to complement the new solution for better performance. Here are three SSG-approved courses to start with:

1. Digital Transformation -Emerging Technology Synthesis

2. Digital Customer Experience Management

3. Practical Approach to Cloud Computing

1. Digital Transformation -Emerging Technology Synthesis

2. Digital Customer Experience Management

3. Practical Approach to Cloud Computing

## Pre-Approved Solutions

- ChopeBook

repository: isomerpages/govtech-gobusiness

branch_name: refs/heads/staging

gha_license_id: NOASSERTION

repo_name: isomerpages/govtech-gobusiness


text:
![Logo](https://avatars3.githubusercontent.com/u/30268214?v=4&s=200)
[![Build Status](https://travis-ci.org/AlloyTools/org.alloytools.alloy.svg?branch=master)](https://travis-ci.org/AlloyTools/org.alloytools.alloy)
# Alloy

Alloy 4 is a self-contained executable, which includes the Kodkod
model finder and a variety of SAT solvers, as well as the standard
Alloy library and a collection of tutorial examples. The same jar file
can be incorporated into other applications to use Alloy as an API,
and includes the source code. See the release notes for details of new
features.

More documentation can be found at: http://alloytools.org/documentation.html.

# Requirements

Alloy runs on all operating systems with a recent JVM (Java 8 or later).
It is made available as a runnable jar file with both a cross-platform SAT solver
([Sat4j](http://www.sat4j.org/) and more efficient native SAT solvers ([minisat](http://minisat.se), [lingeling/plingeling](http://fmv.jku.at/lingeling/), [glucose](http://www.labri.fr/perso/lsimon/glucose/)).

Note however that starting with macOS High Sierra, it is necessary to install a dedicated
JVM to run Alloy on macOS. A `.pkg` file is provided for that purpose.

# TL;DR

Checkout the project and type `./gradlew alloyCVC4`. You find the executable JAR in bin/alloy_cvc4.jar after the build has finished.

     $ java -version
     java version "11.0.1" 2018-10-16 LTS
     Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
     Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)
     $ git clone https://github.com/CVC4/org.alloytools.alloy
     $ cd org.alloytools.alloy
     $ ./gradlew alloyCVC4
     $ cd bin
     $ chmod +x cvc4_linux
     $ java -jar alloy_cvc4.jar
     # opens GUI

Note: if you are behind a proxy, the call to `gradlew` is likely to fail, unless you pass it further options about the http and https proxies (and possibly your login and password on this proxy). There are several ways to pass these options, a simple one is to type (replace the `XXXXX`'s by the adequate settings):

     $ ./gradlew -Dhttps.proxyHost=XXXXX -Dhttp.proxyHost=XXXXX -Dhttp.proxyPort=XXXXX \
          -Dhttps.proxyPort=XXXXX -Dhttp.proxyUser=XXXXX -Dhttp.proxyPassword=XXXXX \
          -Dhttps.proxyUser=XXXXX -Dhttps.proxyPassword=XXXXX \
          build

## Building Alloy

The Alloy build is using a gradle wrapper `./gradlew build` which will install gradle or `./gradle build` if it is already installed.

To build alloy without running the tests use the command `./gradlew alloyCVC4` in Linux and `gradlew.bat alloyCVC4` in Windows. When the build finishes, a jar file `bin/alloy_cvcr.jar` will be generated.

To get a clean build run `./gradlew clean build` or `./gradlew clean alloyCVC4`

### Projects

The workspace is divided into a number of projects:

* [org.alloytools.alloy.application](org.alloytools.alloy.application) – Main application code includes the parser, ast, visualiser, and application code
* [org.alloytools.alloy.extra](org.alloytools.alloy.extra) – Models and examples
* [org.alloytools.kodkod.core](org.alloytools.kodkod.core) – Kodkod without native code
* [org.alloytools.kodkod.native](org.alloytools.kodkod.native) – The native code libraries for kodkod
* [SMT-Extension](SMT-Extension) – The translator from alloy model to [CVC4](http://cvc4.github.io) smt-lib

### Projects dependency graph
![Dependency graph](dependency-graph.png)
### Gradle

In the root of this workspace type `./gradlew build`. This is a script that will download the correct version of gradle and run the build scripts. For settings look at [settings.gradle].

### Eclipse

### IntelliJ IDEA

1. Choose "Import Project"
2. Select the `org.alloytools.alloy` directory.
3. Choose "Import project from external model: Gradle" and click "Next"
4. For project SDK, Choose at least "1.8", Click Finish

To run the Alloy GUI within IDEA, navigate to
org.alloytools.alloy.application/src/main/java/edu/mit/csail/sdg/alloy4whole/SimpleGUI and run the SimpleGUI class.

Alternatively you can use gradle to build the project and then run the jar file `bin/alloy_cvc4.jar`

### Continuous Integration

The workspace is setup to build after every commit using Travis. It releases snapshots to `https://oss.sonatype.org/content/repositories/snapshots/org/alloytools/` for every CI build on Travis.

### Building the DMG file for OSX systems

## CONTRIBUTIONS

Please read the [CONTRIBUTING](CONTRIBUTING.md) to understand how you can contribute.

[javapackager]: https://docs.oracle.com/javase/8/docs/technotes/guides/deploy/packager.html


text:
## Flow Diagram Usage

For generation of a flow diagram you need to add annotations in the code (this is different to call/structure diagram generation that works out of the box). They will indicate which
of the methods should be included in the diagram and which labels to be used. The basis of the generation is the call hierarchy.
Every found method annotated with @FlowDiagramTerminal/@FlowDiagramAction/@FlowDiagramCondition will be displayed in the diagram.
A chain of calls can be interrupted by placing a @FlowDiagramStop annotation at the call to avoid cycles in the diagram.
The main complexity lies in the branching logic. In general a branch in the diagram is created when ever a @FlowDiagramCondition
is placed at a method. Every following action inside the method will be placed under this branch. A second branch must
follow directly after the first branch under the same condition node. Problematic are actions which cannot be placed in
a method to be tagged as a branch. In this case the 'alternativeBranch' can be used to treat every following action to be under this branch.

Just copy the following annotations inside your code base. The diagram generator will only check the annotation's name and read the parameters dynamically.

FlowDiagramTerminal

```java
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Similar to an action but indicates the begin or ending of a flow. When a generation is triggered, a diagram is generated
 * for every method containing a Terminal annotation in the same class.
 */
@Target({ ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE_USE, ElementType.LOCAL_VARIABLE })
@Retention(RetentionPolicy.RUNTIME)
public @interface FlowDiagramTerminal {

    /**
     * @return optional, name of the diagram element or the method name if blank
     */
    String value() default "";
}
```

FlowDiagramAction

```java
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * One step in the diagram flow.
 */
@Target({ ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE_USE, ElementType.LOCAL_VARIABLE })
@Retention(RetentionPolicy.RUNTIME)
public @interface FlowDiagramAction {

    /**
     * @return optional, name of the diagram element or the method name if blank
     */
    String value() default "";
}
```

FlowDiagramCondition

```java
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * With a condition, the execution flow is divided in two or more branches.
 */
@Target({ ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE_USE, ElementType.LOCAL_VARIABLE })
@Retention(RetentionPolicy.RUNTIME)
public @interface FlowDiagramCondition {

    /**
     * @return name of the condition element
     */
    String value() default "";

    /**
     * @return name of the branch/arrow
     */
    String branch() default "";

    /**
     * The alternative branch contains all actions after the main branch is finished. E.g. if the main branch is a dead end.
     *
     * @return optional, name of the alternative branch/arrow
     */
    String alternativeBranch() default "";
}
```

FlowDiagramStop

```java
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * The Stop is no diagram element but a marker to stop the processing of a flow. This is required to avoid cycles in the
 * diagram when generic methods are used twice.
 */
@Target({ ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE_USE, ElementType.LOCAL_VARIABLE })
@Retention(RetentionPolicy.RUNTIME)
public @interface FlowDiagramStop {

}
```

**Example**

```java
public class DiagramExample {

    @FlowDiagramTerminal
    public void mainMethod(){
        condition1Branch1();
        condition1Branch2();
    }

    @FlowDiagramCondition(value = "check", branch = "branch1")
    private void condition1Branch1() {
        branch1Action();
    }

    @FlowDiagramAction
    private void branch1Action() {
    }

    @FlowDiagramCondition(value = "check", branch = "branch2")
    private void condition1Branch2() {
        branch2SingleBranchCondition();
    }

    private void branch2SingleBranchCondition() {
        validate();
        mainLogic();
    }

    @FlowDiagramCondition(branch = "not OK", alternativeBranch = "proceed with main logic")
    @FlowDiagramAction("throw error")
    private void validate() {
    }

    @FlowDiagramAction // placed under alternativeBranch!
    private void mainLogic() {
    }

}
```

The resulting diagram looks like that:

![](howto_flow_diagram.png)


text:
# ModTeamHelper

Stack Overflow Teams displays each moderator's real name field as their username, not their display name. This can be confusing, so here's a userscript to turn this:

![Aurora's Real Name](https://i.imgur.com/89OaVXa.png)

into this:

![Aurora's Username and Sites](https://i.imgur.com/F084DlD.png)

By default, the original layout will be shown. Upon hovering over the username, a `(who?)` link will appear. After that is clicked, you
should see the user's network username and moderated sites.

## Troubleshooting, known issues and design faults
### I clicked (who?), but it just says "Loading..."
Please file an issue; this is a bug. Apologies for the inconvenience.

### (who?) doesn't appear on hover
Please file an issue; this is a bug. Apologies for the inconvenience.

Don't worry - the script just needs to request that user's network profile from stackexchange.com. As this is considered a different origin than stackoverflow.com, Tampermonkey just wants to check with you that nothing bad is happening.  Click "Always allow domain" and you won't be bothered again.

The script won't work if you deny this.

license: Unlicense

repository: TheIoTCrowd/ModTeamHelper

repo_name: TheIoTCrowd/ModTeamHelper