text:
# Rusty GL

Note: This is a work in progress.

Crate: https://crates.io/crates/rgl

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

## Summary

Very thin wrapper over gl-rs, aiming to make code more "rust-like" and safer, while still allowing the control you have with classic OpenGL code.

# Current features

* Vertex buffer objects
* Vertex array objects
* Shaders
* Texture 2D
* Single-tuple struct such as `VAO(GLuint)` to enforce correct OpenGL object type is passed in functions

# Tuple Struct

Current tuple structs:

* `pub struct VBO(GLuint);` for vertex buffer objects
* `pub struct VAO(GLuint);` for vertex array objects
* `pub struct GLTexture(GLuint);` for texture objects
* `pub struct GLShader(GLuint);` for programs/ shader object

These structs have no implemention (assosiated function), they are just there to enforce that the correct OpenGL functions are passed into functions.
For example:

```rust
let mut vao = gl_gen_vertex_array();
gl_bind_buffer(GLTarget::ArrayBuffer, vao);
```

would not work, as `gl_bind_buffer` expects type `struct VBO(GLuint)`, but vao is of type `VAO(GLuint)`.

# Roadmap

* Framebuffer objects
* More OpenGL functions (Right now there is basically only the minimum!)

# Usage
```toml
[dependancies]
rgl = "0.2.0"
gl = "0.6.0"
```

The `gl-rs` create (`gl`) is still needed for certain things such as window proc address and types (eg `GLuint`, `GLfloat` etc)

## Examples

As mentioned above, this crate aims to be a more rust-like alternative to gl-rs.

For example, code from gl-rs such as:

```rust
let mut vao = 0;
let mut vbo = 0;

unsafe {
    // Create Vertex Array Object
    gl::GenVertexArrays(1, &mut vao);
    gl::BindVertexArray(vao);

    // Create a Vertex Buffer Object and copy the vertex data to it
    gl::GenBuffers(1, &mut vbo);
    gl::BindBuffer(gl::ARRAY_BUFFER, vbo);
    gl::BufferData(
        gl::ARRAY_BUFFER,
        (VERTEX_DATA.len() * mem::size_of::<GLfloat>()) as GLsizeiptr,
        mem::transmute(&VERTEX_DATA[0]),
        gl::STATIC_DRAW,
    );
    gl::EnableVertexAttribArray(0);
    gl::VertexAttribPointer(
        0,
        2,
        gl::FLOAT,
        gl::FALSE as GLboolean,
        0,
        ptr::null(),
    );
}
```

Is instead written like

```rust
    //Create a vertex array object and a vertex buffer object
    let mut vao = rgl::gen_vertex_array();
    let mut vbo = rgl::gen_buffer();

    //Generate and bind the VAO
    rgl::gl_bind_vertex_array(vao);

    //Generate and bind the VBO
    rgl::gl_bind_buffer(rgl::Target::ArrayBuffer, vbo);

    //Buffer the vertex data and tell OpenGL the structure
    rgl::buffer_data(rgl::Target::ArrayBuffer, &VERTEX_DATA, rgl::Usage::StaticDraw);
    rgl::enable_vertex_attrib_array(0);
    rgl::vertex_attrib_pointer(0, 2, rgl::Type::Float, false, 0);
```

Changes include:

* snake_case over PascalCase for function names
* rgl crate
* No need for the `unsafe {...}` blocks
* Strongly typed enums over the error-prone GLenum (Where you can easily pass the incorrect enum)
* No need to cast types to `std::os::raw::c_void`, rusty-gl will do this for you
* No need to cast string to `std::ffi::CString`, rusty-gl will do this for you

## More examples

Examples on using this crate can be found in the examples folder: https://github.com/Hopson97/rusty-gl/tree/master/Examples

Run the examples with `cargo run`.

gha_language: Rust


text:
CallFlow 1.0
============

CallFlow is a visualization tool to view and analyze Calling Context Tree (CCT)
data provided by HPCToolkit. CallFlow uses Sankey diagrams to display the CCT
hierarchy.

### Requirements

You will need to install the latest version of Node.js (v7.7.2 or higher).

### Installation

To install, change directory to the src/ folder and run:
```
 $ npm install
 $ bower install
```
If you get a libtool related error during libxlmjs build in the first step on
Mac OSX, you should try again after removing the macports version of libtool
from your path.

### To Run

In the src/ directory, run:
```
 $ node main.js -d /path/to/datasetinfo.json
```
Point browser to http://localhost:8500

### Inputs

The application requires 3 files with 1 optional file:

1. Dataset information file: This is a json file that specifies where to look
for the data. It requires 3 fields with 1 optional field. The format is as
follows:
```
{
    "path" : /path/to/directory/contains/dataset/ (Note the '/' at the end of the path)
    "experiment" : Name of the xml file
    "nodeMetric" : Name of the json file that contains the metrics for each call tree node. Detail of the format for this file is bellow.
    "config" : Name of the config file. This is optional. Detail of the format for this file is bellow.
}
```

2. XML file : This is the xml file for the call tree data.

3. Node metric file: A json file that contains the metrics for each call tree
node Each line in the file contains the following information:
```
{
    "id" : The call tree node id
    "inc" : An array of inclusive runtimes
    "exc" : An array of exclusive runtimes
}
```

4. Configuration file: A configuration file to tell the parser how to parse
some problematic load modules (this is optional). The format of the file is
follows:
```
"load module name" : {
    "id" : The id of the load module, taken form the xml file
    "files" : An array of file prefixes
    "functions" : {
        "name of function" : An array of name prefixes to match under this function
	}
}
```

### Reference

Any published work that utilizes this software should include the following
reference:

```
Huu Tan Nguyen, Abhinav Bhatele, Peer-Timo Bremer, Todd Gamblin, Martin Schulz,
Lai Wei, David Böhme, and Kwan-Liu Ma. VIPACT: A visualization interface for
analyzing calling context trees. In Proceedings of the 3rd Workshop on Visual
Performance Analysis, VPA '16, November 2016. LLNL-CONF-704659.
```

### Copyright

Copyright (c) 2017, Lawrence Livermore National Security, LLC.
Produced at the Lawrence Livermore National Laboratory.

Written by Huu Tan Nguyen<EMAIL_ADDRESS>
LLNL-CODE-740862. All rights reserved.

license: MIT

repository: huutnguyen/CallFlow

branch_name: refs/heads/master

extension: md

gha_language: JavaScript

license_type: permissive

repo_name: huutnguyen/CallFlow


text:
# Manage alarm contacts and alarm contact groups {#concept_dm3_dnb_5db .concept}

Contact and contact group information is the basis for sending alarm notifications. You need to create a contact and a contact group before you can select the contact group when creating an alarm rule, to receive alarm notifications.

## Manage an alarm contact {#section_fcm_x4n_vdb .section}

You can create, edit, or delete the contact information, such as the email address.

-   Create an alarm contact
    1.  Log on to the [CloudMonitor console](https://partners-intl.console.aliyun.com/#/cms).
    2.  In the left navigation pane, click **Alarm contacts** under **Alarms**. The Alarm Contact Management page is displayed.
    3.  Click **Create Alarm Contact** in the upper-right corner of the page. In the displayed dialog box, enter the contact email address and other information.

        The email address will be verified in case that you enter incorrect information and cannot receive alarm notifications.

-   Edit an alarm contact
    1.  Log on to the [CloudMonitor console](https://partners-intl.console.aliyun.com/#/cms).
    2.  In the left navigation pane, click **Alarm contacts** under **Alarms**. The Alarm Contact Management page is displayed.
    3.  Click **Edit** in the **Actions** column to edit the contact information.
-   Delete an alarm contact
    1.  Log on to the [CloudMonitor console](https://partners-intl.console.aliyun.com/#/cms).
    2.  In the left navigation pane, click **Alarm contacts** under **Alarms**. The Alarm Contact Management page is displayed.
    3.  Click **Delete** in the **Actions** column.

**Note:** After you delete a contact, no CloudMonitor alarm notification is sent to the contact.

## Manage an alarm contact group {#section_lcm_x4n_vdb .section}

An alarm contact group may contain one or more alarm contacts. The same alarm contact can be added to multiple alarm contact groups. In alarm rule setting, all alarm notifications are sent through the alarm contact group.

-   Create an alarm contact group
    1.  Log on to the [CloudMonitor console](https://partners-intl.console.aliyun.com/#/cms).
    2.  In the left navigation pane, click **Alarm contacts** under **Alarms**. The Alarm Contact Management page is displayed.
    3.  Click the **Alarm Contact Group** tab at the top of the page to switch to the alarm contact group list.
    4.  Click **Create Alarm Contact Group** in the upper-right corner to open the Create Alarm Contact dialog box.
    5.  Enter a group name and select the contacts you want to add to the group.
-   Edit an alarm contact group
    1.  Log on to the [CloudMonitor console](https://partners-intl.console.aliyun.com/#/cms).
    2.  In the left navigation pane, click **Alarm contacts** under **Alarms**. The Alarm Contact Management page is displayed.
    3.  Click the **Alarm Contact Group** tab at the top of the page to switch to the alarm contact group list.
    4.  Click **Edit** in the **Actions** column to edit the contact group information.
-   Delete an alarm contact group
    1.  Log on to the [CloudMonitor console](https://partners-intl.console.aliyun.com/#/cms).
    2.  In the left navigation pane, click **Alarm contacts** under **Alarms**. The Alarm Contact Management page is displayed.
    3.  Click the **Alarm Contact Group** tab at the top of the page to switch to the alarm contact group list.
    4.  Click **Delete** in the **Actions** column to delete the contact group.
-   Add contacts to a contact group in batches
    1.  Log on to the [CloudMonitor console](https://partners-intl.console.aliyun.com/#/cms).
    2.  In the left navigation pane, click **Alarm contacts** under **Alarms**. The Alarm Contact Management page is displayed.
    3.  Select the contacts that you want to add from the alarm contact list.
    4.  Click **Add to a contact group** at the bottom of the page.
    5.  In the displayed dialog box, select the target contact group and click OK.

url: https://raw.githubusercontent.com/theharveyz/cms/43ba55570152c2c5b0b418814c6ee64bb3c4a634/intl.en-US/User Guide/Alarm Service/Manage alarm contacts and alarm contact groups.md

repository: theharveyz/cms

gha_license_id: MIT

repo_name: theharveyz/cms


text:
# This project will be deprecated

Garena+ will be replace with [new Garena](https://platform.garena.in.th/plus/) in 18 December, so there are no TalkTalk anymore.

# Garena Loader

GarenaLoader is an awesome loader that loaded only GarenaMessenger without GarenaTalk (TalkTalk) cause TalkTalk eat more your RAM!.

# Binaries

[Lastest Release](https://github.com/blackSourcez/GarenaLoader/releases)

# Features

No more GarenaTalk (TALKTALK)

![alt text](https://github.com/blackSourcez/GarenaLoader/blob/master/screenshots/notalktalk.png)

![alt text](https://github.com/blackSourcez/GarenaLoader/blob/master/screenshots/notalktalk_process.png)

# How to use ?

1. Open a GarenaLoader.exe file
1.1 If your setup file is doesn't exist the program will be ask for your GarenaMessenger.exe installed path.
![alt text](https://raw.githubusercontent.com/blackSourcez/GarenaLoader/master/screenshots/choose_garena_path.png)
2. Let's enjoy Garena that without TalkTalk.

repository: ayuthmang/GarenaLoader

repo_name: ayuthmang/GarenaLoader


text:
# Working with Azure Virtual Machines #

---

## Overview ##

The Azure Virtual Machine service provides access to a seemingly immeasurably large array of hardware, networking, operating system (OS), and software combinations that you can use to support your custom workloads in the cloud.  Virtual Machines (VMs) fall into the the Infrastructure-as-a-Service (IaaS) model of Cloud Computing resources, abstracting away the management of the physical hardware, while allowing access to the computing resources.  This arrangement allows you the greatest flexibility and control, while at the same time incurring the responsibility for maintenance and upkeep tasks (such as applying OS and Security patches) necessitated by the operating system.  You can learn more about IaaS and other cloud computing models [here](https://en.wikipedia.org/wiki/Cloud_computing#Infrastructure_as_a_service_.28IaaS.29).

It has been widely reported that Microsoft has gone through profound changes in the past several years.  One facet of these changes is an embrace of both Linux and Open Source technologies.  The VMs that you create and manage in Microsoft Azure are not limited to just Windows Server images, but also include a wide selection of Linux VMs, including Ubuntu, Red Hat, Debian, SUSE, Oracle, and CentOS distributions.  If those do not meet your needs, you can also follow [these instructions](https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-classic-create-upload-vhd) to upload your own VM image.

In this lab, you will learn how you can use the gallery of proconfigured VM images in the Azure Portal to provision an Ubuntu Linux VM.  You will then see how you can use a Secure Shell (SSH) terminal to log in to your VM and perform several installation and customization tasks in order to allow it act as a simple web server.  You will also see how you can work with Network Security Group rules to govern the network traffic to and from your VM.

### Objectives ###

In this hands-on lab, you will learn how to:

- Provision a Linux virtual machine in Azure using the Azure Marketplace images
- Connect to the virtual machine using SSH
- Install a web server on the virtual machine
- Define a network security group rule to allow incoming network traffic on the HTTP port
- Stop the virtual machine to suspend any further usage charges
- Use the Azure Resource Manager to delete the virtual machine and its related resources

### Prerequisites ###

The following are required to complete this hands-on lab:

- An active Microsoft Azure subscription. Use the Azure Pass you activated earlier, or [sign up for a free trial](http://aka.ms/WATK-FreeTrial).
- [PuTTY](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) (Windows users only)

## Exercises ##

This hands-on lab includes the following exercises:

- [Exercise 1: Provision the Virtual Machine](#Exercise1)
- [Exercise 2: Set up a Web Server on the Virtual Machine](#Exercise2)
- [Exercise 3: Configure Access to the HTTP Port](#Exercise3)
- [Exercise 4: Suspend the virtual machine](#Exercise4)
- [Exercise 5: Delete the lab resources](#Exercise5)

Estimated time to complete this lab: **60** minutes.

## Exercise 1: Provision the Virtual Machine ##

The [Azure Portal](https://portal.azure.com) allows you to perform many of the operations you will need to do in order to create and manage your virtual machines.  It also provides access to a browsable marketplace that you can use to find the virtual machine images you want to deploy.  In this exercise, you'll use the Azure Portal to find a virtual machine image in the Azure Marketplace and use it to create a new virtual machine instance.

1. Go to the [Azure Portal](https://portal.azure.com/) and sign in using your Azure credentials.
1. Click **+ New** in the ribbon on the left. Then select **Compute** followed by **See All**.

    ![Adding a virtual machine](Images/provision-newcompute.png)

     _Adding a virtual machine_

1. In the **Compute** blade, type **Ubuntu** into the **Search virtual machines** box and press Enter.

    ![Searching available virtual machine images](Images/provision-searchubuntu.png)

     _Searching available virtual machine images_

1. Click on **Ubuntu Server 16.04 LTS** from the results list.

    ![Selecting the Ubuntu machine image](Images/provision-selectubuntu.png)

     _Selecting the Ubuntu machine image_

1. In the details blade that appears for the _Ubuntu Server 16.04 LTS_ image, make sure that **Resource Manager** is selected under **Select a deployment model** and click the **Create** button.

    ![Opening the VM creation blade](Images/provision-create.png)

     _Opening the VM creation blade_

1. Enter the basic settings information for your virtual machine in the **Basics** settings blade:

	- Enter a name that identifies this virtual machine in the **Name** box (_VMLab_ is recommended.)
	- Select **SSD** in the **VM disk type** box
	- Enter **azureuser** into the **User name** box.  This is the name of the administrator account on the virtual machine.
	- Select **Password** for **Authentication type**
	- Enter **Azure4Research** for the **Password** and **Confirm password** boxes.
	- Select **Create new** under **Resource group** and enter the name **VMLabResourceGroup**. Under **Location**, select the location nearest you.
	- Click the **Ok** button to confirm these settings

    ![Basic virtual machine settings](Images/provision-settings-basics.png)

     _Basic virtual machine settings_

1. In the **Choose a size** blade, select **DS1_V2 Standard** and click the **Select** button to confirm this as the desired size for the VM you are provisioning.

    ![Virtual machine size selection](Images/provision-settings-choosesize.png)

     _Virtual machine size selection_

1. In the **Settings** blade, click on the **Storage account** entry.  In the **Create storage account** blade, change the **Name** value to better reflect its purpose.  Note that this is an Azure Storage Account, so it requires a unique name.  Choose a name that begins with **vmlabdisks**, and then add some characters to make it unique (for example, use your initials and birthdate, as in _vmlabdisksjg1110_)  Click the OK button to accept the name change.

    ![Virtual machine storage account name](Images/provision-rename-vmstorage.png)

     _Virtual machine storage account name_

	Back in the **Settings** blade, scroll down to the bottom and click to the **Diagnostics storage account** entry.  Repeat the process above in the **Create storage account** blade, changing the **Name** value to also better reflect its purpose.  Choose a name that begins with **vmlabdiagnostics**, and then add some characters to make it unique (for example, use your initials and birthdate, as in _vmlabdiagnosticsjg1110_)  Click the OK button to accept the name change.

	Click the **Ok** button to accept the default values in the **Settings** blade.

1. Click the **OK** button in the **Summary** blade to accept the settings entered to this point and provision the virtual machine.

    ![Virtual machine provisioning summary](Images/provision-settings-reviewsummary.png)

     _Virtual machine provisioning summary_

	Provisioning the virtual machine and its related resources should just take a couple of minutes.

1. When the VM provisioning process completes, the **VMLab** blade should automatically appear.  Click on the **VMLabResourceGroup** link to open the resource group that contains all of the resources related to this VM.

    ![The VM Lab blade](Images/provision-vmlab-blade.png)

     _The VM Lab blade_

1. Examine the contents of the **VMLabResourceGroup** blade.  This blade shows all of the resources that were provisioned as part of creating the virtual machine.  *(Note - you may want to expand the TYPE column to better see the resource type name for each entry.)*  Key resources include:

- The actual _virtual machine_.
- A _network interface_ entry, indicating the NIC used by the VM for communication.
- A _network security group_ entry.  The NSG contains a list of port-access restrictions that govern communication types into and out of the network interface with which the NSG is associated.
- A _public IP address_.
- A _virtual network_.
- Two _storage account_ entries.  One will be the storage account the virtual machine uses for diagnostic information, the other will be the storage account on which the VM disk images are stored.

    ![The VM Lab resources](Images/provision-vmlab-resourcegroup.png)

     _The VM Lab resources_

	Close this blade to return to the _VMLab_ virtual machine blade.

## Exercise 2: Set up a Web Server on the Virtual Machine##

In this exercise, you will configure your virtual machine to handle web requests using the Node.js runtime.  work on the VM remotely, you will use a Secure Shell terminal application.  On Mac and Linux systems, SSH is built into the operating system and available for you to use.  On Windows, you will use the popular Windows SSH client named PuTTY.

1. The deployment template that you used to create the virtual machine created a public IP address for the virtual machine.  Open the blade for the **VMLab** virtual machine if it is not already open and click on the IP address under the **Public IP address/DNS name label** section to open the blade for the Public IP address resource.

    ![Opening the IP address blade](Images/webserver-open-ipaddress.png)

    _Opening the IP address blade_

2. In the **VMLab-ip** blade, hover your mouse over the **IP address** entry.  When the **Click to copy** icon appears, click it to copy the IP address to the clipboard.

    ![Copying the public IP address](Images/webserver-copy-ipaddress.png)

    _Copying the public IP address_

### Connecting with MacOS/Linux ###
Perform these steps to establish a connection to the virtual machine if you are using MacOS or Linux.  If you're running Windows, skip ahead to the *Connecting with Windows* section.

1. Open a terminal window to use to log into the virtual machine. Execute the following command.  If you chose a different VM administrator name than "_azureuser_" in Exercise 1, replace _azureuser_ with the name you chose.  Replace _IP-Address_ with the IP address that you copied into the clipboard in the previous step.

    ssh -l azureuser IP-Address

	> Because this is the first time you have connected to the virtual machine, you may be prompted with a warning dialog asking if you trust this host. Since the host is one you created, type "yes" (without the quotes).

	When prompted, enter the password "_Azure4Research_" (without the quotes) or the value you provided in Exercise 1 if you chose to use a differnet password.

### Connecting with Windows ###
If you already installed PuTTY, [download the installer MSI file](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) and install it now.

1. Start PuTTY and paste the IP Address into the **Host Name (or IP address)** field. Then click the **Open** button to initiate a Secure Shell (SSH) connection.

	> Because this is the first time you have connected to the virtual machine, you may be prompted with a warning dialog asking if you trust this host. Since the host is one you created, click **Yes**.

    ![Connecting with PuTTY](Images/webserver-putty-connect.png)

    _Connecting with PuTTY_

1. A PuTTY terminal window will appear and you will be prompted to **login as**. Log in with the the VM administrator user name ("azureuser") and password ("Azure4Research") you previously entered in [Exercise 1](#Exercise1).

### Configuring the virtual machine ###

1. In the SSH terminal, execute the commands below to update the package lists, install the Node.js runtime, install the NPM package manager, and update the internal firewall to allow port 80 communication on the virtual machine. If you are prompted to continue, type "Y" (without the quotes) to indicate "yes".

    sudo apt-get update

    sudo apt-get install nodejs

	sudo apt-get install npm

    sudo ufw allow 80

1. Edit the node content file in the SSH terminal by typing the following command:

    vi labvm.js

1. Press the "i" (without quotes) key to enter _Insert Mode_ in VI.  The bottom left corner of your screen should display the text

	> -- INSERT --

1. Paste the following text into the VI editor:

	var http = require('http');

	var server = http.createServer(function(req, res) {
	  res.writeHead(200);
	  res.end('Hello Azure VM Lab!');
	});
	server.listen(80);

1. To finish editing, press the Escape (ESC) key on your keyboard, then the following key sequence to save and exit.
	- Esc (escape key)
	- : (colon)
	- wq
	- Enter key

1. Enter the following command in your SSH terminal to run the the node program you just wrote.  This program will listen for web request on port 80 returning a fixed block of text for each request.

	sudo nodejs labvm.js

## Exercise 3: Configure Access to the HTTP port ##

Even though you configured the firewall in the VM to allow network traffic on port 80, there is still one more step you have to perform in order to be able to serve web content.  That is because the _Virtual Network_ (VNET) that your machine resides in includes a _Network Security Group_ (NSG).  The NSG includes rules that define the kinds of inbound and outbound communications that are allowed, and you have yett o tell it that it should allow communication on port 80, the HTTP port.  In this exercise, you will configure a rule that will allow external traffic to reach your virtual machine's _Network Interface Card_ (NIC).

1. In the Azure Portal, open the blade for your lab VM if it is not already open.  Click on **Network Interfaces** to bring up the blade for your VM's NIC, then click on the NIC for your VM in the list that is shown.

    ![Open the NIC blade for the VM](Images/portconfig-open-nic.png)

    _Open the NIC blade for the VM_

1. In the **Network Interface** blade, click on the **Network security group** entry, and then on the name of the network security group to bring up its blade.

    ![Open the network security group](Images/portconfig-open-nsg.png)

    _Open the network security group_

1. Click on **Inbound security rules** and then on **Add** to add a new rule.

    ![Add a new inbound rule](Images/portconfig-add-innboundrule.png)

    _Add a new inbound rule_

1. Enter the following information for the new rule:
	- Enter "Lab-VM-HTTP" (without the quotes) in the **Name** box
	- Leave the **Priority** box set to **1010**
	- Leave the **Source** box set to **Any**
	- Under **Service**, select **HTTP**
	- Leave the **Action** selection set to **Allow**

	Press the **OK** button to create the rule.

    ![Define the new inbound rule](Images/portconfig-set-inboundrule.png)

    _Define the new inbound rule_

	You may need to wait a minute or two for the new rule to be created.

1. Open a new browser window and enter the IP address of your VM into the address bar.  It should show the content you entered in the Node program in the previous exercise.

    ![Browse the web page](Images/portconfig-final-sitedisplay.png)

    _Browse the web page_

## Exercise 4: Suspend the Virtual Machine ##

When virtual machines are running, you are being charged — even if the VM is idle. Therefore, it is advisable to stop virtual machines when they are not in use. You will still be charged for storage, but that cost is typically insignificant compared to the cost of an active VM. The Azure Portal makes it easy to stop virtual machines. VMs that you stop are easily started again later so you can pick up right where you left off.

1. In the Azure Portal, open the blade for your lab VM if it is not already open.

1. Click the **Stop** button to stop the virtual machine.

    ![Stopping the virtual machine](Images/suspend-stop-vm.png)

    _Stopping the virtual machine_

You can stop and start virtual machines in the Azure portal, but if you have a lot of VMs, that's not very efficient. In the real world, you might prefer to use an Azure CLI or PowerShell script to enumerate all of the VMs in a resource group and start or stop them all. For more information on scripting the Azure CLI, see the section entitled "How to script the Azure CLI for Mac, Linux, and Windows" in [Install and Configure the Azure CLI](https://azure.microsoft.com/en-us/documentation/articles/xplat-cli/). If you prefer visual tools to command-line tools, you can use [Azure Automation](https://azure.microsoft.com/en-us/services/automation/) to automate VM operations.

## Exercise 5: Delete the Lab Resources ##
Resource groups are a useful feature of Azure because they simplify the task of managing related resources. One of the most practical reasons to use resource groups is that deleting a resource group deletes all of the resources it contains. Rather than delete those resources one by one, you can delete them all at once.

In this exercise, you'll delete the resource group created in [Exercise 1](#Exercise1) when you provisioned the virtual machine. Deleting the resource group deletes everything in it and prevents any further charges from being incurred for it.

1. In the Azure Portal, open the blade for the "VMLabResourceGroup" resource group that holds the virtual machine. Then click the **Delete** button at the top of the blade.

	![Deleting a resource group](Images/delete-delete-resourcegroup.png)

	_Deleting a resource group_

1. For safety, you are required to type in the resource group's name. (Once deleted, a resource group cannot be recovered.) Type the name of the resource group. Then click the **Delete** button to remove all traces of this lab from your account.

After a few minutes, the virtual machine and all of its resources will be deleted. Billing stops when you click the **Delete** button, so you're not charged for the time required to delete the virtual machine. Similarly, bulling doesn't start until a virtual machine has been fully and successfully deployed.

## Summary ##

In this hands-on lab, you learned how to:

- Provision a Linux virtual machine in Azure using the Azure Marketplace images
- Connect to the virtual machine using SSH
- Install a web server on the virtual machine
- Define a network security group rule to allow incoming network traffic on the HTTP port
- Stop the virtual machine to suspend any further usage charges
- Use the Azure Resource Manager to delete the virtual machine and its related resources

The Azure Virtual Machine service gives you a lot of powerful options for configuring and deploying virtual machines into the Cloud.  But remember, "with great power, comes great responsibility."  Although VM's allow you to the greatest options for custom configuration, you are also signing up for the related responsibility of managing the VM, especially including timely application of OS and security patches.

---

url: https://raw.githubusercontent.com/farukc/TechnicalCommunityContent/1ac30d49fca50f4e15d14c7f949c6303abf1f5c2/Cloud Computing/Azure IaaS/Session 2 - Hands On (Draft)/Azure VM HOL.md

repository: farukc/TechnicalCommunityContent

filename: Azure VM HOL.md

repo_name: farukc/TechnicalCommunityContent


text:
OS Flash
==

https://nextthingco.zendesk.com/hc/en-us/categories/200881468-C-H-I-P-

## Linux Host

### Dependencies

    # apt-get update
    # sudo apt-get install u-boot-tools android-tools-fastboot git build-essential libusb-1.0-0-dev

### SunXi Tools

    $ git clone http://github.com/linux-sunxi/sunxi-tools
    $ cd sunxi-tools
    $ make
    # sudo rm -f /usr/local/bin/fel
    # ln -s $PWD/fel /usr/local/bin/fel
    or
    # cp fel /usr/local/bin/

### Build Tools

    # exit
    $ cd ..
    $ git clone http://github.com/NextThingCo/CHIP-tools
    $ cd CHIP-tools
    $ git pull

### Flash Buildroot

    # ./chip-update-firmware.sh
    ...
    589824 bytes (590 kB) copied, 0.0244674 s, 24.1 MB/s
    12+0 records in
    12+0 records out
    196608 bytes (197 kB) copied, 0.0348495 s, 5.6 MB/s
    Image Name:   flash CHIP
    Created:      Sat Oct 10 07:49:05 2015
    Image Type:   ARM Linux Script (uncompressed)
    Data Size:    856 Bytes = 0.84 kB = 0.00 MB
    Load Address: 00000000
    Entry Point:  00000000
    Contents:
       Image 0: 848 Bytes = 0.83 kB = 0.00 MB
    == upload the SPL to SRAM and execute it ==
    == upload images ==
    == execute the main u-boot binary ==
    $ cu -l /dev/ttyACM0 -s 115200
    Connected.

    The source code can be downloaded from:
    http://opensource.nextthing.co/chip/buildroot/stable/68/build68.tar.gz

    chip login: root
    Password:
    # hwtest

    ############################################################
    # [ CHIP HW TEST ]                                         #
    ############################################################

    # Turn on wlan0...OK
    # Turn on wlan1...OK
    # Hardware list...OK
    # I2C bus 0...OK
    # I2C bus 1...OK
    # I2C bus 2...OK
    # testing AXP209 on I2C bus 0...OK
    # GPIO expander test...OK
    # Doing 10s stress test...OK
    # Wifi enumeration test...OK
    ### ALL TESTS PASSED ###
    #

### Flash Debian

    # ./chip-update-firmware.sh -d
    debian selected
    ROOTFS_URL=http://opensource.nextthing.co.s3.amazonaws.com/chip/debian/stable/38
    BUILD=38
    ...
    BUILDROOT_OUTPUT_DIR = /home/xe1gyq/Projects/chip/CHIP-tools/.firmware
    == preparing images ==
    /home/xe1gyq/Projects/chip/CHIP-tools /home/xe1gyq/Projects/chip/CHIP-tools
    gcc    -c -o spl-image-builder.o spl-image-builder.c
    gcc -o spl-image-builder spl-image-builder.o
    /home/xe1gyq/Projects/chip/CHIP-tools
    ...
    == upload the SPL to SRAM and execute it ==
    waiting for fel...............................OK
    == upload spl ==
    == upload u-boot ==
    == upload u-boot script ==
    == upload ubi ==
    100% [============================================================]
    == execute the main u-boot binary ==
    == write ubi ==
    flashing............................OK
    ...
    $ sudo cu -l /dev/ttyACM17 -s 115200
    [sudo] password for xe1gyq:
    Connected.
    ebian GNU/Linux 8 chip ttyGS0

    chip login: root
    Password:
    Linux chip 4.2.0-rc1 #1 SMP Wed Oct 21 20:43:17 UTC 2015 armv7l

    The programs included with the Debian GNU/Linux system are free software;
    the exact distribution terms for each program are described in the
    individual files in /usr/share/doc/*/copyright.

    Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
    permitted by applicable law.
    root@chip:~#

### At CHIP

    # hwtest

    ############################################################
    # [ CHIP HW TEST ]                                         #
    ############################################################

    # Turn on wlan0...OK
    # Turn on wlan1...OK
    # Hardware list...OK
    # I2C bus 0...OK
    # I2C bus 1...OK
    # I2C bus 2...OK
    # testing AXP209 on I2C bus 0...OK
    # GPIO expander test...OK
    # Doing 10s stress test...OK
    # Wifi enumeration test...OK
    ### ALL TESTS PASSED ###


text:
#Spine Runtime

Try it here:
<http://www.stagexl.org/example/extension/spine>

### More samples

* <http://www.stagexl.org/show/spine/raptor/example.html>
* <http://www.stagexl.org/show/spine/spineboy/example.html>
* <http://www.stagexl.org/show/spine/goblins-ffd/example.html>
* <http://www.stagexl.org/show/spine/powerup/example.html>

### Get Spine Runtime

* <https://github.com/bp74/StageXL_Spine>
* <https://pub.dartlang.org/packages/stagexl_spine>


text:
---
title: Usage Log Tracking for Analysis Workspace
description: Under Admin - Logs - Usage & Access, you can better understand your users' usage of Adobe Analytics. This video focuses specifically on measuring Workspace project usage.
feature: Data Configuration and Collection
topics:
activity: use
doc-type: feature video
team: Technical Marketing
kt: 4024

topic: Administration
role: Admin
level: Beginner
exl-id: 397cfb51-7d7d-49dd-8b54-e928fe77d39e
---
# Usage Log Tracking for Analysis Workspace

Under [!UICONTROL Admin] - [!UICONTROL Logs] - [!UICONTROL Usage & Access], you can better understand your users' usage of Adobe Analytics. This video focuses specifically on measuring [!DNL Workspace] project usage. Note: Since this video was released, a product tip about how to do robust usage analysis in Analysis Workspace was published at adobe.ly/aausage.

>[!VIDEO](https://video.tv.adobe.com/v/29768/?quality=12&learn=on)

For more information, visit the [documentation](https://experienceleague.adobe.com/docs/analytics/admin/admin-tools/logs.html?lang=en).

branch_name: refs/heads/main


text:
# Alicio Tree

![Alicio Sapling](block:betterwithaddons:sapling_luretree@0)

Alicio Trees can be planted on any suitable soil. They will make a terrifying sound when they grow to maturity. Alicio Trees secrete a blood-red sap that attracts animals.
In order for them to attract animals, its grotesque face must be fed with items. See below for a table of food values.

![250 Munches](item:betterwithaddons:rotten_food@0)
![250 Munches](item:minecraft:rotten_flesh@0)
![500 Munches](item:minecraft:glowstone_dust@0)
![1000 Munches](item:betterwithaddons:material@3)
![(Mystery Meat) 4000 Munches](item:betterwithmods:mystery_meat@0)

The wood that Alicio Trees produce when chopped is unfortunately too spongy to be used for anything but fuel, but its terrifying face can be placed elsewhere as decoration.

repository: DaedalusGame/BetterWithAddons

gha_language: Java

repo_name: DaedalusGame/BetterWithAddons


text:
# Amber Cloud Image Bakery
Copyright 2020 Fluid Numerics LLC

This repository contains scripts for creating VM images on Microsoft Azure and Google Cloud with Packer.
The build scripts provided under `scripts/` build Amber with GPU acceleration enabled and without MPI. GPU acceleration requires installation of Nvidia's CUDA-Toolkit. Use of the resulting image requires you agree to the terms and condition in the [CUDA-Toolkit EULA](https://docs.nvidia.com/cuda/eula/index.html)

## Getting Started
1. [Download and install Packer](https://www.packer.io/downloads)
2. Visit the [Amber Project website](https://ambermd.org/GetAmber.php) to download AmberTools20 and Amber20. For Amber20, you will need to purchase a site-license.
3. Once you have downloaded the `AmberTools20.tar.bz` and `Amber20.tar.bz` files from the Amber Project, move these files to the AmberDownloads directory in this repository.

## Create a VM image for Azure

The instructions in this section are based on the Azure documentation ["How to use Packer to create Linux virtual machine images in Azure"](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/build-image-with-packer).

1. Navigate to the azure subdirectory
```
cd azure/
```
2. Create a resource group. In this example, the resource group is named "amber". The name you choose here will be passed to the "resource_group" variable in Step 5.
```
az group create -n amber -l westus
```
3. Create service principal credentials. The output of this command will provide you with the `client_id`, `client_secret`, and `tenant_id` needed when running packer in Step 5.
```
az ad sp create-for-rbac --query "{ client_id: appId, client_secret: password, tenant_id: tenant }"`.
```
4. Obtain your subscription id. This will provide the `subscription_id` needed when running packer in Step 5.
```
az account show --query "{ subscription_id: id }"
```
5. Run packer using the appropriate variable substitutions. The resulting image name will be called "amber20".
```
packer build -force -var client_id="CLIENT ID" \
                    -var client_secret="CLIENT SECRET"\
                    -var tenant_id="TENANT ID"\
                    -var subscription_id="SUBSCRIPTION ID"\
                    -var resource_group="RESOURCE GROUP"\
                    ./packer.json
```

This build process installs AmberTools20, Amber20, and Amber dependencies (including CUDA Toolkit). Amber is installed under /apps/amber20. Amber binaries are made available to all user's search path upon login through the addition of `amber.sh` to `/etc/profile.d`.

### Testing you Amber VM Image on Azure
You can create an instance with a GPU attached (1x V100 in this case) using the following command :
```
az vm create \
    --resource-group "RESOURCE GROUP" \
    --name "amberVM" \
    --image "amber20" \
    --admin-username azureuser \
    --size "NC6s_v3" \
    --generate-ssh-keys
```

Once you SSH into the instance, navigate to `/apps/amber20` and run `make test.cuda_serial` to verify the installation of Amber20 on this image

## Create a VM image for Google Cloud
These instructions will show you how to build a Google Compute Engine (GCE) image that has Amber20 and AmberTools20 installed.

### Prerequisites
Complete the steps in "Getting Started" shown above. Then, [follow these instructions to set up a service account and obtain service account credentials (JSON)](https://www.packer.io/docs/builders/googlecompute.html#running-without-a-compute-engine-service-account). You will need to provide the service account `Compute Instance Admin (v1)` and `Service Account User` IAM roles on the Google Cloud project you will build the image on. This allows the service account to create GCE instances and save disk images on Google Cloud.

1. Navigate to the azure subdirectory
```
cd google/
```
2. Run packer using the appropriate variable substitutions. The resulting image name will be called `SOURCE_IMAGE-amber20`, where `SOURCE_IMAGE` is the name of the image you used as a starting point for your build. At a minimum, you must provide the `project_id`. [Default parameters](./google/packer.json) will create an image based on CentOS-7.
```
packer build -force -var project_id="PROJECT ID" \
                    -var subnet="SUBNETWORK"\
                    -var zone="ZONE"\
                    -var source_image="SOURCE IMAGE"\
                    -var source_image_project_id="SOURCE IMAGE PROJECT ID"\
                    -var amber_startup_script="STARTUP SCRIPT"\
                    ./packer.json
```
The `amber_startup_script` can be one of `scripts/centos/startup-script.sh` for CentOS-7 source image operating systems or `scripts/ubuntu/startup-script.sh` for Ubuntu operating systems.

This build process installs GPU Accelerated AmberTools20, Amber20, and Amber dependencies (including CUDA Toolkit). Amber is installed under /apps/amber20. Amber binaries are made available to all user's search path upon login through the addition of `amber.sh` to `/etc/profile.d`.

### Easy HPC Cluster Image
If you want to run Amber20 on an elastic, cloud-native HPC cluster, you can use [Fluid Numerics' fluid-slurm-gcp](https://console.cloud.google.com/marketplace/details/fluid-cluster-ops/fluid-slurm-gcp) CentOS-7 or Ubuntu compute images as the `source_image` to start from.

**CentOS :** To create an image that you can use with the [CentOS solution](https://console.cloud.google.com/marketplace/details/fluid-cluster-ops/fluid-slurm-gcp), set `source_image="fluid-slurm-gcp-compute-centos-v2-4-0" and `source_image_project_id="fluid-cluster-ops"`.

**Ubuntu :** To create an image that you can use with the [Ubuntu solution](https://console.cloud.google.com/marketplace/details/fluid-cluster-ops/fluid-slurm-gcp-ubuntu), set `source_image="fluid-slurm-gcp-compute-ubuntu-v2-4-0" and `source_image_project_id="fluid-cluster-ops"`.

Once the image is created, you can [modify your cluster-config](https://github.com/FluidNumerics/fluid-slurm-gcp_custom-image-bakery#substituting-custom-images-in-your-compute-partitions) so that a compute partition uses your new custom image. Reach out to<EMAIL_ADDRESS>at any time for assistance in getting started with Amber20 on Fluid-Slurm-GCP.

This image will allow you to easily use Amber20 the elastic click-to-deploy [Fluid-Slurm-GCP HPC Cluster](https://console.cloud.google.com/marketplace/details/fluid-cluster-ops/fluid-slurm-gcp) on Google Cloud.

repository: shunsunsun/Amber-Cloud-Image-Bakery

repo_name: shunsunsun/Amber-Cloud-Image-Bakery


text:
[![Build Status](https://travis-ci.org/AnayoOleru/POLITICO.svg?branch=develop)](https://travis-ci.org/AnayoOleru/POLITICO)
[![Maintainability](https://api.codeclimate.com/v1/badges/ae19724fed3af03714eb/maintainability)](https://codeclimate.com/github/AnayoOleru/POLITICO/maintainability)
[![Coverage Status](https://coveralls.io/repos/github/AnayoOleru/POLITICO/badge.svg?branch=ch-163356628-integrate-coveralls)](https://coveralls.io/github/AnayoOleru/POLITICO?branch=ch-163356628-integrate-coveralls)

![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg)

# POLITICO
 > :ng: Politico is a web-app that enables both citizens give their mandate to politicians running for different government offices. POLITICO also enables politicians to express interest to run for an office, while building trust in the process through transparency. :slot_machine:

#  API Documentation
https://app.swaggerhub.com/apis-docs/Anayo-Oleru/politico/1.0

 # UI
https://anayooleru.github.io/POLITICO/

 ## UI Pages
 User profile: `../POLITICO/UI/parties.html`

 Admin: `../POLITICO/UI/admin/govOffice.html`

 ## UI Implemented features
* Users can sign up or sign in
* Registered users can reset password
* Registered users can view political parties
* Registered users can view all politicians running for a specific government
* Registered users can vote politician
* Registered user can view history containing a list of political offices   and candidates the user has voted for
* Politician can express interest to run for a specific government office
* Politician can create a petition against a concluded election
* Admin can view and create a political party
* Admin can view and edit a political party
* Admin can delete a political party
* Admin can view and create a government office, which politicians can express interest to run for.

## App on Heroku
https://trustpolitico.herokuapp.com/api/v1/

## Technologies Used

* [NodeJS](https://nodejs.org/en/) - A Javascript runtime built on chrome V8 engine that uses an event-driven non-blocking I/O model that makes it lightweight and efficient.
* [ExpressJs](https://expressjs.com/) - A minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.
* [EsLint](https://eslint.org/) - An open source project to provide a pluggable linting utility for javascript
* [Mocha](https://mochajs.org/) - A feature-rich javascript test framework running Node.js and in the browser, making asynchronous testing simple and fun, flexible and accurate reporting.

## Installation

1. Install [`node`](https://nodejs.org/en/download/)

2. Clone the repository

    ```
    git clone https://github.com/AnayoOleru/POLITICO.git
    ```

3. Navigate to the project directory

    ```
    cd ~/path/to/POLITICO
    ```

4. Install all dependencies

    ```
    npm install
    ```

5. Start the app

    ```
    npm start dev-start
    ```

6. Run the application on browser

    ```
    http://localhost:3000/
    ```

#### Server-side tests

- Uses `Chai` and `Chai-Http`

```
    npm run test
```

## API Usage

API BASE URL https://trustpolitico.herokuapp.com/api/v1/. It's recommended to attach a `authorization` Header containing the generated `token` from `/api/auth/login` to all requests.

### Parties endpoints `/api/v1/parties`

| method | route          | description             | data                                 |
| ------ | -------------- | ----------------------- | ------------------------------------ |
| GET    | /parties         | Get all politcal parties      |
| GET    | /parties/:partyid | Get a specific political party record          |
| POST   | /parties         | Create/Add parties    | `{name, hqaddress, logoUrl}` |
| PATCH   | /parties/:partyid | Edit the name of a specific political party        |
| DELETE | /parties/:partyid | Delete a specific political party |

### Office endpoints `/api/v1/office`

| method | route            | description          | data                            |
| ------ | ---------------- | -------------------- | ------------------------------- |
| POST   | /offices/         | Create a political office | `{type, name}` |
| GET    | /offices/ | Fetch all political parties records         |
| GET    | /offices/:officeid | Fetch a specific office     |
| POST | /office/:userid/register  | Register a user as a candidate  | `{office, prt}`
| GET | /office/:officeid/result  | Collate and fetch the result of specicific office  |

### Authentication endpoints `/api/v1/auth`

| method | route        | description               | data                      |
| ------ | ------------ | ------------------------- | ------------------------- |
| POST   | /auth/login  | Sign In                   | `{email, password}`       |
| POST   | /auth/signup | Sign up or create account | `{firstname, lastname, othername, email, phonenumber, passportUrl, password}` |

### Authentication endpoints `/api/v1/votes`

| method | route        | description               | data                      |
| ------ | ------------ | ------------------------- | ------------------------- |
| POST   | /votes  | Vote for a candidate                   | `{created_by, office, candidate}`       |

```javascript

// login as admin
{
  email<EMAIL_ADDRESS>  password: "anayokyleoleru"
}
```

repository: AnayoOleru/POLITICO

branch_name: refs/heads/develop

gha_language: CSS

repo_name: AnayoOleru/POLITICO


text:
---
title: "Events"
---

### Message Create

Called with a `Message` object when a message is sent in a guild or private channel.
Requires the `Intents::GUILD_MESSAGES` intent.

```php
$discord->on(Event::MESSAGE_CREATE, function (Message $message, Discord $discord) {
    // ...
});
```

### Message Update

Called with two `Message` objects when a message is updated in a guild or private channel.
The old message may be null if `storeMessages` is not enabled _or_ the message was sent before the bot was started.
Discord does not provide a way to get message update history.
Requires the `Intents::GUILD_MESSAGES` intent.

```php
$discord->on(Event::MESSAGE_UPDATE, function (Message $newMessage, Discord $discord, $oldMessage) {
    // ...
});
```

### Message Delete

Called with a `Message` object _or_ the raw payload when a message is deleted.
The `Message` object may be the raw payload if `storeMessages` is not enabled _or_ the message was sent before the bot was started.
Discord does not provide a way to get deleted messages.
Requires the `Intents::GUILD_MESSAGES` intent.

```php
$discord->on(Event::MESSAGE_DELETE, function ($message, Discord $discord) {
    if ($message instanceof Message) {
        // Message is present in cache
    }
    // If the message is not present in the cache:
    else {
        // {
        //     "id": "", // deleted message ID,
        //     "channel_id": "", // message channel ID,
        //     "guild_id": "" // channel guild ID
        // }
    }
});
```

### Message Delete Bulk

Called with a `Collection` of `Message` objects _or_ the raw payload when bulk messages are deleted.
The `Message` object may be the raw payload if `storeMessages` is not enabled _or_ the message was sent before the bot was started.
Discord does not provide a way to get deleted messages.
Requires the `Intents::GUILD_MESSAGES` intent.

```php
$discord->on(Event::MESSAGE_DELETE_BULK, function (Collection $messages, Discord $discord) {
    foreach ($messages as $message) {
        if ($message instanceof Message) {
            // Message is present in cache
        }
        // If the message is not present in the cache:
        else {
            // {
            //     "id": "", // deleted message ID,
            //     "channel_id": "", // message channel ID,
            //     "guild_id": "" // channel guild ID
            // }
        }
    }
});
```

### Message Reaction Add

Called with a `MessageReaction` object when a reaction is added to a message.
Requires the `Intents::GUILD_MESSAGE_REACTIONS` intent.

```php
$discord->on(Event::MESSAGE_REACTION_ADD, function (MessageReaction $reaction, Discord $discord) {
    // ...
});
```

### Message Reaction Remove

Called with a `MessageReaction` object when a reaction is removed from a message.
Requires the `Intents::GUILD_MESSAGE_REACTIONS` intent.

```php
$discord->on(Event::MESSAGE_REACTION_REMOVE, function (MessageReaction $reaction, Discord $discord) {
    // ...
});
```

### Message Reaction Remove All

Called with a `MessageReaction` object when all reactions are removed from a message.
Note that only the fields relating to the message, channel and guild will be filled.
Requires the `Intents::GUILD_MESSAGE_REACTIONS` intent.

```php
$discord->on(Event::MESSAGE_REACTION_REMOVE_ALL, function (MessageReaction $reaction, Discord $discord) {
    // ...
});
```

### Message Reaction Remove Emoji

Called with an object when all reactions of an emoji are removed from a message.
This event is still to be implemented.

Requires the `Intents::GUILDS` intent.

```php
$discord->on(Event::CHANNEL_CREATE, function (Channel $channel, Discord $discord) {
    // ...
});
```

### Channel Update

Called with two `Channel` objects when a channel is updated.
Requires the `Intents::GUILDS` intent.

```php
$discord->on(Event::CHANNEL_UPDATE, function (Channel $new, Discord $discord, Channel $old) {
    // ...
});
```

### Channel Delete

Called with a `Channel` object when a channel is deleted.
Requires the `Intents::GUILDS` intent.

```php
$discord->on(Event::CHANNEL_DELETE, function (Channel $channel, Discord $discord) {
    // ...
});
```

### Channel Pins Update

Called with an object when the pinned messages in a channel are updated. This is not sent when a pinned message is deleted.
Requires the `Intents::GUILDS` intent.

```php
$discord->on(Event::CHANNEL_PINS_UPDATE, function ($pins, Discord $discord) {
    // {
    //     "guild_id": "",
    //     "channel_id": "",
    //     "last_pin_timestamp": ""
    // }
});
```

### Guild Create

Called with a `Guild` object in one of the following situations:

1. When the bot is first starting and the guilds are becoming available.
2. When a guild was unavailable and is now available due to an outage.
3. When the bot joins a new guild.

Requires the `Intents::GUILDS` intent.

```php
$discord->on(Event::GUILD_CREATE, function (Guild $guild, Discord $discord) {
    // ...
});
```

### Guild Update

Called with two `Guild` object when a guild is updated.
Requires the `Intents::GUILDS` intent.

```php
$discord->on(Event::GUILD_UPDATE, function (Guild $new, Discord $discord, Guild $old) {
    // ...
});
```

### Guild Delete

Called with a `Guild` object in one of the following situations:

1. The bot was removed from a guild.
2. The guild is unavailable due to an outage.

Requires the `Intents::GUILDS` intent.

```php
$discord->on(Event::GUILD_DELETE, function (Guild $guild, Discord $discord, bool $unavailable) {
    // ...
    if ($unavailable) {
        // the guild is unavailabe due to an outage
    } else {
        // the bot has been kicked from the guild
    }
});
```

### Guild Member Add

Called with a `Member` object when a member joins a guild.
Requires the `Intents::GUILD_MEMBERS` intent. This intent is a priviliged intent, it must be enabled in your Discord bot developer settings.

```php
$discord->on(Event::GUILD_MEMBER_ADD, function (Member $member, Discord $discord) {
    // ...
});
```

### Guild Member Update

Called with two `Member` objects when a member is updated in a guild. Note that the old version of the member _may_ be null if `loadAllMembers` is disabled.
Requires the `Intents::GUILD_MEMBERS` intent. This intent is a priviliged intent, it must be enabled in your Discord bot developer settings.

```php
$discord->on(Event::GUILD_MEMBER_UPDATE, function (Member $new, Discord $discord, $old) {
    // ...
});
```

### Guild Member Remove

Called with a `Member` object when a member leaves a guild (leave/kick/ban). Note the member object may be null if `loadAllMembers` is disabled.
Requires the `Intents::GUILD_MEMBERS` intent. This intent is a priviliged intent, it must be enabled in your Discord bot developer settings.

```php
$discord->on(Event::GUILD_MEMBER_REMOVE, function (Member $member, Discord $discord) {
    // ...
});
```

### Guild Role Create

Called with a `Role` object when a role is created in a guild.
Requires the `Intents::GUILDS` intent.

```php
$discord->on(Event::GUILD_ROLE_CREATE, function (Role $role, Discord $discord) {
    // ...
});
```

### Guild Role Update

Called with two `Role` objects when a role is updated in a guild.
Requires the `Intents::GUILDS` intent.

```php
$discord->on(Event::GUILD_ROLE_UPDATE, function (Role $new, Discord $discord, Role $old) {
    // ...
});
```

### Guild Role Delete

Called with a `Role` object when a role is deleted in a guild.
Requires the `Intents::GUILDS` intent.

```php
$discord->on(Event::GUILD_ROLE_DELETE, function (Role $role, Discord $discord) {
    // ...
});
```

### Guild Integrations Update

Called with a `Guild` object when a guild's integrations are updated.
Requires the `Intents::GUILD_INTEGRATIONS` intent.

```php
$discord->on(Event::GUILD_INTEGRATIONS_UPDATE, function (Guild $guild, Discord $discord) {
    // ...
});
```

### Invite Create

Called with an `Invite` object when an invite is created.
Requires the `Intents::GUILD_INVITES` intent.

```php
$discord->on(Event::INVITE_CREATE, function (Invite $invite, Discord $discord) {
    // ...
});
```

### Invite Delete

Called with an object when an invite is created.
Requires the `Intents::GUILD_INVITES` intent.

```php
$discord->on(Event::INVITE_DELETE, function ($invite, Discord $discord) {
    // {
    //     "channel_id": "",
    //     "guild_id": "",
    //     "code": "" // the unique invite code
    // }
});
```

### Presence Update

Called with a `PresenceUpdate` object when a members presence is updated.
Requires the `Intents::GUILD_PRESENCES` intent. This intent is a priviliged intent, it must be enabled in your Discord bot developer settings.

```php
$discord->on(Event::PRESENCE_UPDATE, function (PresenceUpdate $presence, Discord $discord) {
    // ...
});
```

### Typing Start

Called with a `TypingStart` object when a member starts typing in a channel.
Requires the `Intents::GUILD_MESSAGE_TYPING` intent.

```php
$discord->on(Event::TYPING_START, function (TypingStart $typing, Discord $discord) {
    // ...
});
```

### Voice State Update

Called with a `VoiceStateUpdate` object when a member joins, leaves or moves between voice channels.
Requires the `Intents::GUILD_VOICE_STATES` intent.

```php
$discord->on(Event::VOICE_STATE_UPDATE, function (VoiceStateUpdate $state, Discord $discord) {
    // ...
});
```

repository: Ixiter/DiscordPHP

repo_name: Ixiter/DiscordPHP


text:
# AudioTTS
> A text to speech software utilizing Google's WaveNet technology.

![](header.png)

Having struggled with ADHD, I often find myself using audio books for reading, but am often unable to find them for
textbooks. Unsatisfied with traditional TTS software, and not wanting to pay a tramendous amount for premium software,
I decided to make my own using Google's WaveNet technology.

## Getting Started

### Installing

A step by step series of examples that tell you how to get a development env running

Say what the step will be

```
Give the example
```

And repeat

```
until finished
```

End with an example of getting some data out of the system or using it for a little demo

## Created With

* [Maven](https://maven.apache.org/) - Dependency Management
* [OpenJFX](https://openjfx.io/) - GUI framework
* [Google Cloud](https://cloud.google.com/) - TTS and OCR framework
* [JFoeniX](http://www.jfoenix.com/) - GUI theming

## Authors

* **Nicolas Newman** - *Creator* - [NicolasNewman](https://github.com/NicolasNewman)

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

repository: NicolasNewman/AudioTTS

repo_name: NicolasNewman/AudioTTS


text:
---
header:
    teaser: assets/images/showcase/netbeans/netbeans_2019-10-19_Spotlight[rloc,mcc,mcc].png
title: "NetBeans"
excerpt: "5 034 211 RLoC"

sidebar:
    - title: Source Code
      text: On Github
    - title: "Size"
      text: "5 034 211 RLoC"
    - title: "Highest Complexity (mcc)"
      text: "Css3Parser.java"
    - title: "Highest Average Code Churn (changed lines)"
      text: "Css3Parser.java"
    - title: "Max Nesting Level"
      text: "S2bConfig.java"
    - title: "Utilized Importers"
      text: SourceCodeParser
GitLogParser
gallery:
    - url: /assets/images/showcase/netbeans/netbeans_2019-10-19[rloc,mcc,mcc].png
      image_path: assets/images/showcase/netbeans/netbeans_2019-10-19[rloc,mcc,mcc].png
      title: "NetBeans Metrics 2019 for Rloc, Mcc, Mcc"
    - url: /assets/images/showcase/netbeans/netbeans_2019-10-19_Spotlight[rloc,mcc,mcc].png
      image_path: assets/images/showcase/netbeans/netbeans_2019-10-19_Spotlight[rloc,mcc,mcc].png
      title: "NetBeans Metrics 2019 with presentation mode for Rloc, Mcc"
---

{% include gallery caption="Example Images for NetBeans." %}

Download cc.json at 2019-10-19

Download cc.json at 2018-10-19

repository: MaibornWolff/codecharta

gha_language: TypeScript

repo_name: MaibornWolff/codecharta


text:
# Description
A Docker container for an open source MPEG DASH packager featuring
 - Single period MPEG DASH for VOD and Live
 - Multi period MPEG DASH for VOD and Live

The MPEG DASH packager is built on:
 - Ubuntu
 - Apache2 (https://httpd.apache.org)
 - ffmpeg (https://ffmpeg.org)
 - Bento4 (https://www.bento4.com)
 - hls2dash (https://pypi.python.org/pypi/hls2dash)

|      | Input           | Output                  | Supported |
| ---- | --------------- | ----------------------- | --------- |
| Live | HLS             | Single Period MPEG-DASH | Yes       |
| Live | HLS EXT-CUE     | Multi Period MPEG-DASH  | Yes       |
| VOD  | MP4             | Single Period MPEG-DASH | Planned   |
| VOD  | MP4 w cue sheet | Multi Period MPEG-DASH  | Planned   |

# Deploying DASH Packager

## Running on localhost

Start DASH packager listening on port 3000:

    docker run -d -p 3000:80 --restart=always --name packager eyevinntechnology/packager:0.1.0

Verify it is up and running by entering http://localhost:3000/ in your web browser

Now configure an encoder to post HLS to:

    http://localhost:3000/ingest/event/

And you would then access the HLS here

    http://localhost:3000/live/event/master.m3u8

and the MPEG DASH stream here

    http://localhost:3000/live/event.mpd/manifest.mpd

To stop the packager you would:

    docker stop packager && docker rm -v registry packager

## Using Docker Compose

You could also use a Docker compose config:

```
packager:
  restart: always
  image: eyevinntechnology/packager:0.1.0
  ports:
    - 3000:80
  volumes:
    - /tmp/data:/data
```

And simply start it by running:

    docker-compose up -d

Shut down the packager by running:

    docker-compose down

# License

Licensed under The MIT License (MIT)

Copyright (c) 2016 Eyevinn Technology

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.

repository: yagosys/docker-dash-packager

repo_name: yagosys/docker-dash-packager


text:
# Udemy Course Docker Mastery: with Kubernetes+Swarm from a Docker Captain

> Build, test, deploy containers with the best mega-course on Docker, Kubernetes, Compose, Swarm and Registry using DevOps

This repo is what i'm using for Udemy Courses "Docker Mastery" and "Swarm Mastery" from Bret Fisher, https://www.udemy.com/course/docker-mastery/.

repository: colac/Docker-Udemy

repo_name: colac/Docker-Udemy


text:
# Discussions X for Google Search

A simple Chrome extension to add back old filters to Google Search, including discussions, blogs, recipes, and patents.

# Installation

For now, simply download the repository and load the extension folder in Chrome as an unpacked extension.

Will be added to Chrome store when more progress is made.

# About

Forked from [Discussions Button for Google Search](https://chrome.google.com/webstore/detail/discussions-button-for-go/igjiggoeheaondbmhmilpmbdkpgcjmdn) with permission from the author, and licensed under the MIT license.

repository: mehmetsuci/discussions-button

repo_name: mehmetsuci/discussions-button


text:
**You're viewing a file in the SMAPI mod dump, which contains a copy of every open-source SMAPI mod
for queries and analysis.**

**This is _not_ the original file, and not necessarily the latest version.**
**Source repository: https://github.com/isaacs-dev/Minidew-Mods**

----

# Speedy Paths

Current Version: 1.0.0-beta

Dependancies: SMAPI 2.10.2
Note: This is a singleplayer and client-side mod.

Download: Unrelesed

## Notice

I am currently too busy to work on/release many of these mods. I welcome anyone
to take them (especially the unreleased ones!).

## Configuration:
Most of the options in config.json have to do with specific flooring boosts and
boosts designed to occur in the world map. Specific flooring boosts should
hopefully be obvious from the file.

The condition for various world boosts:
* BathHouseBoost: inside the bath house
* DesertRoadBoost: on the road at the bus stop and desert
* DockBoost: on the dock (and that small bridge between beaches)
* WoodBridgeBoost: on the large bridge to the quarry
* DirtPathBoost: on the world's dirt paths (JojaMart & Railroad)
* TownSquareBoost: on the stone paths in the town square

Other options:
* EnableStatusEffect: Whether the status effect icon should show up on screen.
* GeneralBoost: The boost given by default if no other takes presedent. Any boost
with a value of 0 will be ignored and use the general boost instead. If the general
boost is 0, you will walk at vanilla speeds when off-path.
* UnknownFloorBoost: The boost given to any unknown flooring type. This value
should never be used by the mod unless a new version of Stardew (or a mod) adds
a new type of flooring.
* EnableCommand: Enables the sp_floorinfo command that prints three things:
  * the location name
  * the flooring id (if it exists)
  * the tile index underneath the player. These values are useful for adding new
    speed locations to the mod.

#### Other Info:
This mod technically supports negative values as well (it will even change the
effect icon).

#### Thanks to:
Entoarox for the FasterPaths mod and EntoaroxFramework.

repository: Pathoschild/smapi-mod-dump

gha_language: C#

repo_name: Pathoschild/smapi-mod-dump


text:
# ssw_lab_4sem
Set of laboratory tasks for course of system software (4 semester)

## lab_01

Implementation of stack (LIFO)/queue(FIFO)/vector.

## lab_02

Implementation of single/double linked list, circular buffer.

## lab_03

Implementation of general tree and binary search tree.

## lab_04

Implementation of map and hash-table.

What we will be do:

- build different structures of data;
- compare our realization with STL;
- implement arithmetic parser;

## How work with this repository

You have to **fork** this repository, create your **branch** and complete tasks. **All changes** you will be **commit** and **push** in your **forked repository**. After you make sure that everything works, you send **pull request** to **this** repository. For updating (synchronize) your copy (fork) repository, you have to **set upstream** to this repository, **fetch** changes **from the upstream** (this) repository, **merge** the changes **into your local** repository and **push** them **to your remote** repository.

To work with *git* you should to use [Github client](https://desktop.github.com/) (*nix systems already have git CLI client) and [Git CLI](https://gitforwindows.org/). Google next terms:

- `git clone`
- `git add`
- `git commit -m`
- `git checkout`
- `git merge`
- `git pull`
- `git push`
- `git rebase`
- `git log`
- `git diff`
- `git fetch`
- `git remote`

## Useful

- [Git How To](https://githowto.com/ru/setup)
- [Git Bash](https://gitforwindows.org/)
- [Git Update fork](https://help.github.com/en/articles/syncing-a-fork)
- [Google Code Style Guide](https://google.github.io/styleguide/cppguide.html)
- [C++ Core Guidelines](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines)
- [C++ FAQ](https://isocpp.org/faq)
- [Multi language online documentation](https://docs.w3cub.com/cpp/)
- [Online C++ Benchmark](http://quick-bench.com/)
- [Jetbrain Student License](https://www.jetbrains.com/shop/eform/students)
- [MinGW](http://mingw-w64.org/doku.php)
- [Cygwin](https://www.cygwin.com/)
- [CMake](https://cmake.org/download/)
- [Online BST constructor](https://www.cs.usfca.edu/~galles/visualization/BST.html)
- [CppCheck](http://cppcheck.sourceforge.net/)
- [Valgrind](https://valgrind.org/)
- [WSL](https://docs.microsoft.com/ru-ru/windows/wsl/install-win10)

## Issues

- [How to update your fork](https://stackoverflow.com/questions/20984802/how-can-i-keep-my-fork-in-sync-without-adding-a-separate-remote/21131381#21131381)
- [How to setup Git in CLion](https://stackoverflow.com/questions/35087523/git-exe-error-while-loading-shared-libraries-cannot-open-shared-object-file)
- [How to generate Visual Studio project files via CMake](https://preshing.com/20170511/how-to-build-a-cmake-based-project/)
- [How to make friends our CMake with Visual Studio](https://www.youtube.com/watch?v=gYmgbqGfv-8)
- [How to make friends CMake and Visual Studio[2]](https://docs.microsoft.com/ru-ru/cpp/build/cmake-projects-in-visual-studio?view=vs-2019)
- [How to import CMake project in Qt Creator](https://codeyarns.com/2016/01/26/how-to-import-cmake-project-in-qt-creator/)

# [Wiki](https://github.com/GOOD-Stuff/ssw_lab_4sem/wiki)

- [Как сделать "форк" репозитория?](https://github.com/GOOD-Stuff/ssw_lab_4sem/wiki);
- [А как мне обновить свой "форк"?](https://bit.ly/3fFPgFz);
- [Не могу обновить свой форк из-за конфликта](https://bit.ly/3fIHRoR);
- [FAQ и прочее по работам](https://github.com/GOOD-Stuff/ssw_lab_4sem/wiki);

gha_language: Makefile


text:
---
title: Fish Rules Day 13
date: 12-22-2020
published: true
---

Sent out that email I mentioned yesterday to 80k email subscribers, about new web app features.  We’ll see how that impacts things on the web app.

This morning consisted entirely of updating the Commercial app Alpha based on feedback from a call a week ago.  [Here’s a video][1] of it in its current state.  Release notes:
- Area locations now are grouped by a state/region and those without one are lumped in a "General" group
- Search bars are now full width
- Add fuzzy search to species list
- Empty-state instructions on main screen
- Layout tweaks

Built out our sitemap for the web app and was expecting it to take a little longer.  However, I found this [super sweet package][2] for NextJS that makes this so easy.

Our first lead from our new advertiser’s form came in today!

For v6 of the mobile app, got to flesh out more of the location selection UI and functionality:
- React context around the location selection, lat/lon settings, etc.
- UI handling of the location selection
- Caching via AsyncStorage

[1]:	https://twitter.com/rblalock/status/1341385020896927745
[2]:	https://github.com/iamvishnusankar/next-sitemap


text:
---
title: "Hungry"
date: 2021-06-17T13:58:33+07:00
draft: false
project_type: Sales Platform
project_banner_url: /images/projects/hungry/banner.png
project_categories: ['Desktop App', 'Mobile App']
project_in_progress: false
project_roles: ['Designer', 'UI/UX Designer', 'Programmer']
project_tags: ['C#', 'WPF', 'Xamarin Forms', 'MongoDB', 'Networking']
---

##### Description

A smart stunning application for Cafe, Restaurant, and many more business place about food and coffee. Design for Android and Windows platform make this application can handled for everyone. Ease to operate, just touch and your business run more controlled.

##### Ordering

Figure 1. Hungry Waiter

Take your costumers order with this application, it can be made with a single touch without fear of going error in typing order.
Other advantages are booking data will be immediately forwarded to the posts that require such data as the kitchen, the cashier and manager. Not only that, this application can display a wide range of the latest notifications each day. Then it will greatly help a waiter for looking how far the process of making food in the kitchen, and it would help also in the list of guests who had booked a table before. This app presented with an elegant display menu, nice color and easy to operate for everyone.

##### Cook It!

Figure 2. Hungry Chef

Kitchen had a hot atmosphere, strong and everything doing fast. Never use printed paper order again!, with this kithcen application your chefs wouldn't spare their energy too much to manage printed paper order, the order will be shown all.
Every order displayed coherently one by one among table. Your chefs wouldn't miss any single order or mess an order. There are history order too, it very useful if sometime your chefs want to check the finished food.

##### Count & Get The Money

Figure 3. Hungry Cashier

When your ordered data confirmed and had cooked, it automatically became bill for the consumer. That billing data will be shown in this cashier app without input manually. Don't worry if the consumer ask for split billing, because this application can handle tha request.

  <video class="width-1/1" controls>
    <source src="https://dl.dropboxusercontent.com/s/xee89f88dgverd7/Tutorial%20-%20How%20To%20Billing.mp4" type="video/mp4">
    Your browser does not support the video tag.
  </video>

Figure 4. How to billing

Displayed with accurate information for pricing and calculating, plus feature for making reservation and packing order.  Your billing data for that day will be automatically continued to manager application, so it's not take more time again to have accountancy.

##### Be a Manager

Figure 5. Hungry Manager

Managers responsibilities in larger organisations may be mostly office-based, whereas managers of smaller establishments often have frequent contact with both customers and employees.

  <video class="width-1/1"controls>
    <source src="https://dl.dropboxusercontent.com/s/wakppowoptz2qwp/Tutorial%20-%20How%20To%20Add%20Preparation%20and%20Reservation.mp4" type="video/mp4">
    Your browser does not support the video tag.
  </video>

Figure 6. How to add preparation and reservation

With this application, a manager can mantain lot of things, like agreeing and managing budget, planning menus, promoting and marketing the business, overseeing stock levels, taking reservation, keeping statistical and financial records, and much more duties would handled easier.


text:
> "There's a pervasive elitism at work in the programming community. Add anonymity to the mix, and everyone is suddenly elite."

Everybody wants to look smart and there's a lot of reasons why. Why do people like to buy stuff endorsed by celebrities? It's in your instinct to find people to idolize and we want to latch on to the simple behaviors/materials who remind us of them.

We have this myth of hey, here's a genius and they lock themselves in a cave. Those folks are super rare.

There is a desire to "be a genius to shock the world". We also don't want people to see our mistakes. Some people want to be seen as being clever, and they work in a cave. How long would you drive before asking directions?

The problem is it inhibits personal and project progress. You should have many people get familiar with the different parts of the code as much as possible.

license: Unlicense

repository: daryllxd/lifelong-learning

gha_language: Elixir

gha_license_id: Unlicense

repo_name: daryllxd/lifelong-learning


text:
# Styleguide and Naming conventions

Please follow this style guide and naming conventions when sending your submissions. Thank you!

## Code :coffee:

+ Use **TABS** and not spaces for indentation. We just had to choose one.
+ Interfaces may contain static factories for known implementations. Examples:
```java
	Value.of(123);      // creates a value
	List.arrayList();   // creates new array list
	Component.get();    // returns default singleton implementation
```

+ _The common sense_ is assumed! We do not have extra code to prevent mis-usages of the API.
+ Check for `null` using `Objects.requireNonNull()`, but only where it is really needed. Again, if code itself throws NPE, no need for additional checks.
+ `*Util` classes do not have `private` constructor (_common sense principle_).
+ Returning `null` should be generally avoided for the public methods.
+ Only beans have accessors (`getFoo()` and `setFoo()` methods). Method should not be named with e.g. `get` if it is not a bean.
+ Util static methods that return new instance should be named e.g. `create()` or `createFooBar()` if there is no argument or `fooBarOf(argument)` if there is an argument provided; but _never_ `getFooBar()`. Getters should never create a new instance of anything.
+ _Builder_ pattern function should be named `create()`. Final builder method (that actually returns instance that is building) should be named `get()` or `buildFoo()`.
+ Use `_this()` for base abstract classes of some fluent interfaces API:
```java
	@SuppressWarnings("unchecked")
	protected T _this() {
		return (T) this;
	}
```
+ Use `final` method arguments.

### Singletons, implementations and defaults

_Singletons_ are generally avoided. Singletons have static method `get()` used to fetch the singleton instange:

```java
public class MyFoo {
    private static final MyFoo MY_FOO = new MyFoo();

    public static MyFoo get() {
        return MY_FOO;
    }
}
```

_Default implementations_ of some interface are stored in static class named `Implementation`.
To emphasize the changing of the value, the `set()` method is part of the `Implementation` inner class.

```java
public static interface MyFoo {
    class Implementation {
    	private static MyFoo myFoo = new DefaultMyFoo();
    	public static void set(MyFoo myFoo) {
    		this.myFoo = myFoo;
    	}
    }

    public static MyFoo get() {
        return Implementation.myFoo;
    }
}
```

_Defaults_ is configuration for classes that are created by user directly (such as `JsonParser` or `HttpRequest`).
Those classes may have some defaults so you don't need to change them all the time. Default configuration
does not have sense on singletons! Inner class `Defaults` should contain only public static fields of common types.

```java
public class MyFoo {
	public static class Defaults {
		public static boolean someFlag = false;
	}
}
```

### About deprecation and @Since tag

For now, we are _not_ able to maintain deprecated methods and the use of `@Since` tag versions. We simply don't have enough resources for that atm, sorry. It's better not to have it, but to have it all wrong.

## Test :hearts:

+ Test classes ends with `*Test`, e.g. `StringUtilTest`.
+ Test methods starts with `test*`, e.g. `testReplace()`.
+ Test methods and classes are package scoped.
+ It is it OK to use experimental features of Junit 5 - as long as you keep maintaining it.
+ Nested test classes do not have the suffix in their names.
+ Use static import for `Assert` methods.
+ Use static import for optional `Assume` methods.
+ Try to have one test method per feature.

### Test class example

```java
class FooTest {

	@Test
	void testSomething() {
	  // test code
	}

	@Nested
	@DisplayName("tests for a feature set")
	class FeatureSet {

		@Test
		void testFeature_with_null() {
		  // test code
		}

		@Test
		void testFeature_with_something_else() {
		  // test code
		}
	}
}
```

## Benchmarks :zap:

+ Each benchmark is stored in separated `*Benchmark` class.
+ Benchmarks are executed via [JMH](http://openjdk.java.net/projects/code-tools/jmh/).
+ Benchmark methods are annotated with an annotation.
+ Don't use `BlackHole` argument if you can return the value.
+ Each benchmark class must contain results in the Javadoc of the class: just copy/paste whatever is the JMH output.

repository: moh-sushi/jodd

repo_name: moh-sushi/jodd


text:
# Face recognition example

based on https://www.superdatascience.com/opencv-face-recognition/

Images by: the web, [sklearn eigenface example](http://scikit-learn.org/0.15/auto_examples/applications/face_recognition.html) and me.

![output](output.jpg)

## Installation instructions

### On Windows

- Install Python 3
- `pip install opencv-contrib-python`

### On Linux

- Run the installation script from [here](https://milq.github.io/install-opencv-ubuntu-debian/)

## Running the code

Simply run **face_recognition.py.**

There are 48 images in the training data (12 for each person) and 4 pictures in the test data.

The script trains a LBPH FaceRecognizer with the 48 pictures and then predicts who's in the test pictures.

Try with your own pictures!


text:
---
layout: post
title: Leetcode 0207. Course Schedule
permalink: /Leetcode Problems/0207/
---

This is the classical problem about **topological sort**: (for more details you can look https://en.wikipedia.org/wiki/Topological_sorting). The basic idea of topological for directed graphs is to check if there cycle in this graph. For example if you have in your  schedule dependencies like `0 -> 5, 5-> 3` and `3 -> 0`, then we say, that **cycle** exists and in this case we need to return `False`.

There are different ways to do topological sort, I prefer to use dfs. The idea is to use classical `dfs` traversal, but color our nodes into `3` different colors, `0 (white)` for node which is not visited yet, `1 (gray)` for node which is in process of visiting (not all its neibours are processed), and `2 (black)` for node which is fully visited (all its neibours are already processed). The proof can be found for example in classical Cormen book.

So, basically we have two variables:  `self.Visited = [0] * numCourses` where we keep our colors and define `self.FoundCycle = 0`, we keep it for early stopping, if we found cycle we do not need to continue and we can iterrurupt earlier. Not, that graph is not necessarily connected, so we need to start our dfs from all nodes.

**Comlexity.** We use classical dfs, so time comlexity is `O(E+V)`, where `E` is number of edges and `V` is number of vertices. Space complexity is also `O(E+V)` because we work with adjacency lists.

```
class Solution:
    def canFinish(self, numCourses, prerequisites):
        self.adj_dict = defaultdict(set)
        for i, j in prerequisites:
            self.adj_dict[i].add(j)

        self.Visited = [0] * numCourses
        self.FoundCycle = 0

        for i in range(numCourses):
            if self.FoundCycle == 1: break   # early stop if the loop is found
            if self.Visited[i] == 0:
                self.DFS(i)

        return self.FoundCycle == 0

    def DFS(self, start):
        if self.FoundCycle == 1:   return     # early stop if the loop is found
        if self.Visited[start] == 1:
            self.FoundCycle = 1               # loop is found
        if self.Visited[start] == 0:           # node is not visited yet, visit it
            self.Visited[start] = 1             # color current node as gray
            for neib in self.adj_dict[start]:   # visit all its neibours
                self.DFS(neib)
            self.Visited[start] = 2             # color current node as black
```

path: /Leetcode Problems/0207.md


text:
A rule-change is any of the following:

1. the enactment, repeal, or amendment of a mutable rule;
2. the enactment, repeal, or amendment of an amendment of a mutable rule; or
3. the transmutation of an immutable rule into a mutable rule or *vice versa*.

(Note: This definition implies that, at least initially, all new rules are
mutable; immutable rules, as long as they are immutable, may not be amended or
repealed; mutable rules, as long as they are mutable, may be amended or
repealed; any rule of any status may be transmuted; no rule is absolutely
immune to change.)

repository: audiodude/tiny-nomic

repo_name: audiodude/tiny-nomic


text:
---
layout: page
title: Projects
---

#### [WeatherBar](http://footle.org/WeatherBar/) ([code](https://github.com/bgreenlee/WeatherBar))

A walk-through creating an OS X menu bar app in Swift.

#### [Squeeler](http://footle.org/Squeeler/) ([code](https://github.com/bgreenlee/Squeeler))

A Mac OS X app that sits quietly in your menu bar and alerts you when it sees something hogging CPU.

#### [JobTracker](http://footle.org/JobTracker/) ([code](https://github.com/bgreenlee/JobTracker))

A Mac menu bar app interface to the Hadoop JobTracker. It gives you easy access to jobs in JobTracker, and provides Growl/Notification Center notices of starting, completed, and failed jobs.

#### [sublime-github](https://github.com/bgreenlee/sublime-github)

Github Gist plugin for [Sublime Text 2/3](http://www.sublimetext.com/)

#### [Mute Tweets](http://mutetweets.com) ([code](https://github.com/bgreenlee/mutetweets))

Allows users to temporarily un-follow someone who's being noisy, re-following them after a given period of time.

#### [pygtail](https://github.com/bgreenlee/pygtail)

Pygtail reads log file lines that have not been read. It will even handle log files that have been rotated. Based on logcheck's [logtail2](http://logcheck.org)

#### [virtualmethod](https://github.com/bgreenlee/virtualmethod)

Python decorator to prevent base class methods from being called directly.

#### [HAAsyncMutableArray](https://github.com/hackarts/HAAsyncMutableArray)

A subclass of NSMutableArray that allows callers to register blocks to receive the value of an element in the array, even if that element does not exist yet.

#### [wesabot](https://github.com/hackarts/wesabot)

Campfire bot framework.

#### [Wesabe](https://github.com/wesabe)

The open-sourced remains of Wesabe, a personal financial site.

#### [PassKeeper](http://passkeeper.com) ([code](https://github.com/bgreenlee/PassKeeper))

An ancient Windows utility that allows you to keep an encrypted list of accounts with usernames, passwords, and notes.


text:
# Hooks

Hooks are going to be the interface between you and your Graphql API. Currently there are two types of hook `useFetch` and `usePush`.

> Before diving into this section, it's advised that you take a look at how [domains](./Domains.md) and [configuration](./Configuration.md) work in Tipple.

## useFetch

This is your go-to interface for information retrieval (`GET` requests). Below is an example of a component using `useFetch` which retrieves a collection of users.

By default, the request for `useFetch` will be executed immediately. Subsequent requests can be triggered via the refetch function (below) or from triggering a `usePush` operation to any of the specified domains.

```tsx
import { useFetch } from 'tipple';
import { GetUsersResponse, Domain } from './types';
import { ErrorCard, Spinner, UserCard } from './components';

export const Users: FC = () => {
  const [req, refetch] = useFetch<GetUsersResponse, Domain>('/users', {
    domains: ['users'],
  });

  if (req.fetching) {
    return <Spinner />;
  }

  if (req.error) {
    return <ErrorCard error={data.error} refetch={refetch} />;
  }

  return req.data.users.map(u => <UserCard user={u} />);
};
```

### Type arguments

Type arguments are optional but advised.

`T`: The type of data being returned from the hook assuming a successful response.

`D`: The valid domains which can be passed to the `domains` argument.

### Arguments

#### URL

The first argument is the route for your request. You'll more than likely have already set your [baseUrl](./Configuration.md#baseurl) so just specify the route within the API.

#### Additional options

##### domains

The domain of the data being retrieved. This is a required array of strings which may need to [comply to a domain type](#type-arguments).

##### cachePolicy

The way in which data is retrieved from the cache or network:

- _cache-first (default)_ - cached data is returned and the fetch request is triggered.
- _network-first_ - cached data is not returned until the fetch request returns and the cache is updated.
- _cache-only_ - cached data is returned and no network request is made.
- _network-only_ - the request is made in isolation and there is no attachment to the cache.

> Note: When using the _network-only_ cache policy, you will not be able to specify a domain as the cache is not being used.

##### autoFetch

Whether the fetch should automatically be triggered on initial mount and whenever arguments change (defaults to true).

##### fetchOptions

The [fetch 'init' argument](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch) for the request. This can override globally configured options.

##### parseResponse

Expects a function which receives the API response and returns a parsed value of type `T`.

> Note: The argument to the parser should be casted in order to ensure type safety (e.g. `parseResponse: (arg: ApiResponse) => arg[0]`).

##### baseUrl

An optional baseUrl which overrides the default given to the provider.

### Response

If this is your first time working with hooks, we advise that you take a look at the [official documentation](https://reactjs.org/docs/hooks-state.html) before moving forward. The below examples are documented in the order that they are returned (e.g. `[request, refetch]`).

#### [request, ...]

An object containing metadata about the network request and the resulting response. The properties are as follows.

##### fetching

Whether or not a fetch request is in-flight.

##### error

The resulting error in the case where the request has failed.

##### data

The parsed JSON response from the server assuming the request was successful.

#### [..., refetch]

No surprises here, this function will re-execute the API call and update the state of your data.

> Note: This is only for a manual refetch, remember that a refetch will occur whenever the domain is invalidated.

## usePush

This is used for pushing changes which to the server (methods such as `POST`, `PATCH`, `DELETE` .etc). Below is an example of a component using `usePush` to add a comment to a post.

```tsx
import { usePush } from 'tipple';
import { AddCommentResponse, Domain } from './types';
import { Spinner } from './components';

export const AddComment: FC = () => {
  const [inputState, setState] = useState('');
  const [req, execute, clear] = usePush<AddCommentResponse, Domain>(
    '/posts/1/comments',
    {
      domains: ['comments'],
      fetchOptions: {
        method: 'POST',
        body: JSON.stringify(inputState),
      },
    }
  );

  if (req.fetching) {
    return <Spinner />;
  }

  if (req.error) {
    alert('Unable to add comment');
    clear();
  }

  if (req.data) {
    alert('Comment successfully added');
    clear();
  }

  return (
    <>
      <input value={inputState} onChange={e => setState(e.target.value)} />
      <button onClick={execute}>Add comment</button>
    </>
  );
};
```

> Note: On completion, any data dependent on the specified domain will be refetched.

### Type arguments

Type arguments are optional and can be used to specify the type of data being returned (assuming a successful request) and the valid domains which can be specified.

### Arguments

#### URL

The endpoint URL (as [described for useFetch](#Arguments)).

#### Additional options

All the arguments for `usePush` are identical to that of `useFetch` with the exception of `cachePolicy`, `autoFetch` and `parseResponse`.

### Response

The below examples are documented in the order that they are returned (e.g. `[request, execute]`).

#### [request, ...]

See the request definition for [useFetch](#Response).

#### [..., execute]

This function triggers API call and updates the request state with fetching, response and error values. The execute function also returns a promise for use-cases where an immediate side-effect needs to be triggered.

> Note: For most use cases, we've found it makes more sense to use `execute` and `clear` functions rather than the async functionality.

#### [..., ..., clear]

Clears request object back to its initial state. Triggering this will often be useful following the handling of an error/response data.

repository: andyrichardson/tipple

repo_name: andyrichardson/tipple


text:
# hubot-github-comment-notifier

A GitHub pull request and issue comment notifier for hubot

See following for full documentation.

- [`src/hubot-github-pull-request.coffee`](src/github-pull-request.coffee)
- [`src/hubot-github-issue.coffee`](src/github-issue.coffee)

## Assumptions

`hubot-github-comment-notifier` makes the following assumptions:

- Pull request and issue comments should be notified with assignee and mentions when they are specified
- Pull request and issue comments may be notified in different rooms
- May limit notifications only when there are mentions in comments
  - Currently other conditions like labels and milestones are not supported to limit notifications
  - Your pull requests are welcomed to add more control to the notification limitation
- Other GitHub events than pull request and issue comment should be supported in other modules
  - Use [hubot-github-repo-event-notifier](https://github.com/hubot-scripts/hubot-github-repo-event-notifier), for example, if you need support for other events
- Only sends notifications when
  - pull request
    - pull request is (re)opened
    - comment is added to pull request
    - pull request is closed
  - issue
    - issue is (re)opened
    - comment is added to issue
    - issue is closed

## Installation

In hubot project repo, run:

`npm install hubot-seen --save`

Then add **hubot-github-comment-notifier** to your `external-scripts.json`:

```json
["hubot-github-comment-notifier"]
```

## Configuration

| Variable | Description |
| -------- | ----------- |
| `HUBOT_TEAM_PATH` | *(Optional)* If you want to convert GitHub's `@` mention to another services's (Slack and etc.) mention, you can specify a json file to describe the conversion rule. |

### HUBOT_TEAM_PATH

The json file should looks like this:

```
{
  "@github_mention": "<@slack_mention>"
}
```

See [`_team.json`](_team.json) for its example

### [Webhooks](https://developer.github.com/webhooks/)

#### Pull Request

You need to add `HUBOT_URL/hubot/github-pull-request?room=ROOM[&only-mentioned=1][&randm-mention=1]` to your repository's webhooks.

| Parameter | Description |
| -------- | ----------- |
| `HUBOT_URL` | Your Hubot server's url |
| `ROOM` | To which room you want to send notification |

- When `&only-mentioned=1` is added, it sends notifications only when there are `@` mentions.
- When `&random-mention=1` is added, it picks-up a user from team.json and send notification.
  - You can specify more than `2` in the value to pick-up more than two users.

#### Issue

You need to add `HUBOT_URL/hubot/github-issue?room=ROOM[&only-mentioned=1]` to your repository's webhooks.

| Parameter | Description |
| -------- | ----------- |
| `HUBOT_URL` | Your Hubot server's url |
| `ROOM` | To which room you want to send notification |

- When `&only-mentioned=1` is added, it sends notifications only when there are `@` mentions.

repository: tsohara/hubot-github-comment-notifier

repo_name: tsohara/hubot-github-comment-notifier


text:
# Testing

[Cutest](cutest) is used for testing.

Running the tests is simple: `cutest test/*/*.rb`.

[cutest]: https://github.com/djanowski/cutest

repository: britishtea/stig

repo_name: britishtea/stig


text:
# Vectors

Vectors are one of the most-used Rust data structures. In other programming
languages, they'd simply be called Arrays, but since Rust operates on a
bit of a lower level, an array in Rust is stored on the stack (meaning it
can't grow or shrink, and the size needs to be known at compile time),
and a Vector is stored in the heap (where these restrictions do not apply).

Vectors are a bit of a later chapter in the book, but we think that they're
useful enough to talk about them a bit earlier. We shall be talking about
the other useful data structure, hash maps, later.

## Further information

- [Storing Lists of Values with Vectors](https://doc.rust-lang.org/stable/book/ch08-01-vectors.html)
- [`iter_mut`](https://doc.rust-lang.org/std/primitive.slice.html#method.iter_mut)
- [`map`](https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.map)

repository: rust-lang/rustlings

repo_name: rust-lang/rustlings


text:
# Exercise 0-3

## Problem
The string literal `"\t"` represents a tab character; different C++ implementations display tabs in different ways. Experiment with your implementation to learn how it treats tabs.
## Solution

### Code
```Cpp
#include <iostream>

int main()
{
	std::cout << "One \t Tab" << std::endl;
	std::cout << "Two \t\t Tabs" << std::endl;
	std::cout << "Three \t\t\t Tabs" << std::endl;
	return 0;
}
```