text:
# **Build a Serverless app using API Gateway, Lambda and DynamoDB**

## Overview

The .NET serverless application provides a basic web service using [Amazon API Gateway](https://aws.amazon.com/api-gateway/) and [AWS Lambda](https://aws.amazon.com/lambda/) to retrieve reading list details stored in [Amazon DynamoDB](https://aws.amazon.com/dynamodb/).

The application uses Amazon API Gateway to provide a simple RESTful API that can be called from client applications to display or act on the data. The API Gateway passes requests on to an AWS Lambda function which queries  an Amazon DynamoDB table for the reading list data. The AWS Lambda function converts data returned from DynamoDB into JSON, and then returns the converted data back to the API Gateway for initial request. To use .NET 5, the application leverages Lambda's support for container images. For more details see the [.NET 5 AWS Lambda Support with Container](https://aws.amazon.com/blogs/developer/net-5-aws-lambda-support-with-container-images/) Images blog post.

The application demonstrates how .NET can be used to quickly create serverless applications, allowing teams to develop, deploy and run code without provisioning or managing servers, and only paying for the compute time and storage consumed by the application.
The code for this tutorial is available to download from a git repository, although downloading it is optional since all the steps are listed to create the code from scratch.

### Architecture

The application architecture uses Amazon API Gateway to communicate with an AWS Lambda function written in .NET, which calls Amazon DynamoDB, with AWS Identity and Access Management (IAM) providing access control between the components, as shown below:

![Serverless Application Architecture](media/figure01.png "Serverless Application Architecture")

### Deployment

Deployment of the application components is handled by AWS CloudFormation which uses the AWS Serverless Application Model (AWS SAM) to simplify the template.

The CloudFormation template contains configuration details for each component, and also references an S3 bucket used to stage deployment artifacts, such as the .NET assembly. On execution, CloudFormation uses the template and the S3 bucket to create a CloudFormation stack which then deploys the application components.

![Deployment Diagram](media/figure02.png "Deployment Diagram")

### Modules
This workshop is broken up into four modules. You must complete each module before proceeding to the next.

1. Setup Environment
1. Create a Basic Lambda Function
1. Integrate Lambda with DynamoDB
1. Delete Serverless Resources

### Prerequisites

*    AWS Experience—Beginner
*    Time to Complete—60 mins
*    Cost to Complete—Each service used in this architecture is eligible for the AWS Free Tier. If you are outside the usage limits of the Free Tier, completing this learning path will cost you less than $0.25\*.
*    Tutorial Prereqs—To complete this learning path, you will need:
    * An AWS Account\*\*
    * An IAM user with access key credentials\*\*\*
    * (Optionally) Visual Studio 2019 for Windows

\* This estimate assumes you follow the recommended configurations throughout the tutorial and terminate all resources within 24 hours.

\*\* Accounts that have been created within the last 24 hours might not yet have access to the resources required for this learning. If you don’t have an account visit https://aws.amazon.com and click Sign Up.

\*\*\* You must have a set of valid AWS credentials, consisting of an access key and a secret key, which are used to sign programmatic requests to AWS. You can obtain a set of account credentials when you create your account, although we recommend you do not use these credentials and instead create an IAM user and use those credentials.

## Module 1: Setup Environment

In this module, you'll configure your development environment for working with AWS Lambda functions. These instructions provide 2 different options to choose from for your development environment, Visual Studio 2019 for Windows, or the .NET CLI on Windows, Mac, or Linux, using an editor of your choice.

### Things to Note
* Time to Complete - 10 mins

### Implementation Instructions

#### Step 1: Setup Visual Studio 2019 for Windows
If your development environment is Visual Studio 2019 on Windows, you will need to ensure the following components are installed:

1. .NET 5 for Windows: https://dotnet.microsoft.com/download/dotnet
1. Visual Studio 2019
1. The AWS Toolkit for Visual Studio: https://aws.amazon.com/visualstudio/
1. The AWS CLI https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html

#### Step 2: Setup .NET CLI on Windows, Mac, or Linux

If you are using .NET CLI on Windows, Mac, or Linux, you will need to install a few components, as follows:

1. .NET 5 for Windows, Mac, or Linux: https://dotnet.microsoft.com/download/dotnet
1. Install the AWS Lambda templates with the AWS Lambda NuGet package by running the following in a terminal window.
    ```shell
    dotnet new -i Amazon.Lambda.Templates::*
    ```
1. Verify the new AWS Lambda templates have been installed by running the following in a terminal window.
    ```shell
    dotnet new lambda.EmptyFunction -l
    ```
    If the command returns details of a single Lambda Empty Function template then the templates have been installed correctly.
1. Install the [.NET Global Tools for AWS](https://aws.amazon.com/blogs/developer/net-core-global-tools-for-aws/). To install Amazon.Lambda.Tools use the dotnet tool install command.
   ```shell
   dotnet tool install -g Amazon.Lambda.Tools
   ```

You will also need a text editor or an IDE for modifying, such as vi, emacs, nano, [Visual Studio for Mac](https://www.microsoft.com/net/download/), or [Visual Studio Code](https://code.visualstudio.com/) for Windows, Mac, or Linux.

## Module 2: Create a Basic Lambda Function

In this module you'll create a project for your Lambda function, write the code for a basic Lambda function, and finally deploy and test the Lambda function.
These instructions provide options for 2 different development environments: Visual Studio 2019 for Windows, or .NET CLI on Windows, Mac, or Linux.

### Things to Note
* Time to Complete - 20 mins

### Implementation Instructions

#### Step 1: Create Project using Visual Studio 2019 for Windows
If you are using Visual Studio 2019 on Windows as your development environment, you can create a solution as follows:

1. In Visual Studio, from the menu, select *File > New > Project* to launch the New Project dialog.
1. In the New Project dialog, click on *AWS* in the Platform dropdown

    ![Platform in New Project Dialog](media/figure06.png "New AWS Serverless Application in New Project Dialog")

2. Select the *AWS Serverless Application (.NET Core - C#)* project type.

    ![New AWS Serverless Application in New Project Dialog](media/figure03.png "New AWS Serverless Application in New Project Dialog")

3. Select a name for your project, and then click the **Create** button.

    ![Configure your new project Dialog](media/figure04.png "Configure your new project Dialog")

4. On the Select Blueprint dialog, select the *.NET 5 (Container Image) Serverless* blueprint then click the **Finish** button. Visual Studio will take a few moments to create the solution and will then open the **Solution Explorer** window containing a variety of files.

    ![AWS Lambda Blueprints Dialog](media/figure05.png "AWS Lambda Blueprints Dialog")

#### Step 1: Create Project using .NET CLI

You can also build and deploy .NET Lambda functions to AWS from the command line, which works equally well on Windows, Mac OS X and Linux.

For this walk-through, we’ll make use of the same blueprint (template) that we used in the previous section in Visual Studio.

Follow the steps below to create your Lambda function.
1. Open a command line or terminal window.
2. Create a folder to contain your new project. The folder name becomes the name of your .NET project, so choose something meaningful. For this walk-through, we are using *TestServerless* as the folder name.
3. Navigate to the folder created above and to create the new Lambda project enter the command
    ```shell
    dotnet new serverless.image.EmptyServerless
    ```
    This creates two subfolders-*src* and *test*-each of which has a .NET project folder inside. We won’t use the *test* project in this walk-through.

#### Step 2: Open Solution Files in Visual Studio 2019 for Windows
The solution will already contain the skeleton code required to build and deploy a basic Lambda function and an API Gateway.

1. In the *Solution Explorer* pane, expand the **TestServerless** project node for the app and double-click **Function.cs**, which contains the code for our basic Lambda function, to open it in an editing pane.
1. In the *Solution Explorer* pane, double-click **serverless.template**, which contains the CloudFormation template for deployment, to open it in an editing pane.

#### Step 2: Open Solution Files using .NET CLI
The solution will already contain the skeleton code required to build and deploy a basic Lambda function and an API Gateway.

1. Change directory into the *src* folder, and then into the project folder. For example:
    ```shell
    cd src/TestServerless
    ```
1. Use the editor of your choice to review the code in the file **Function.cs**, which contains the code for our basic Lambda function, and **serverless.template**, which contains the CloudFormation template for deployment.

#### Step 3: Review Lambda Function Code
The **Function.cs** file contains the C# code for the auto-generated Lambda function.

1. Look through the *Functions* class and locate the *Get* method. This is the method that will be called when your Lambda function is invoked and contains the logic you want to execute.

    > Note: You can create other methods and classes to hold your logic and call them from Get, as well as referencing other .NET Standard libraries. You can also change the name of the Get method, as the name of the method is part of the Lambda configuration. For this walk-through, we’ll keep the default name.

The top of the file contains a number of using statements, after which is an assembly attribute that enables automatic deserialization of requests from the API Gateway into `APIGatewayProxyRequest` objects and also automatically serializes responses from `APIGatewayProxyResponse` objects.

```csharp
[assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.SystemTextJson.DefaultLambdaJsonSerializer)]
```

The rest of the file contains the Function class, which contains a single `Get` method to handle requests from the API Gateway and return a static response, `"Hello AWS Serverless"`.

```csharp
public APIGatewayProxyResponse Get(APIGatewayProxyRequest request, ILambdaContext context)
{
    context.Logger.LogLine("Get Request\n");

    var response = new APIGatewayProxyResponse
    {
        StatusCode = (int)HttpStatusCode.OK,
        Body = "Hello AWS Serverless",
        Headers = new Dictionary<string, string> { { "Content-Type", "text/plain" } }
    };

    return response;
}
```

This is all the barebones code we need to create a basic Lambda function.

#### Step 4: Edit serverless.template

Use the editor of your choice to review the code in the file *serverless.template* file. This file contains the CloudFormation template that can be used for deploying the solution’s components.

While by default the template contains all the details for creating the API Gateway and Lambda components, there are a couple of changes you’ll need to make to make customize the Lambda function’s settings.

First of all, you’ll add a `FunctionName` parameter with a value of **TestServerless**,

Secondly, since our Lambda function is very simple it won’t need much memory to run so we can reduce the requested memory down from 256MB to **128MB** by editing the `MemorySize` parameter.
Both these changes are shown below:

```json
{
  "AWSTemplateFormatVersion" : "2010-09-09",
  "Transform" : "AWS::Serverless-2016-10-31",
  "Description" : "An AWS Serverless Application.",
  "Resources" : {
    "Get" : {
      "Type" : "AWS::Serverless::Function",
      "Properties": {
        "FunctionName": "TestServerless",
        "PackageType": "Image",
        "ImageConfig": {
          "EntryPoint": [
            "/lambda-entrypoint.sh"
          ],
          "Command": [
            "TestServerless::TestServerless.Functions::Get"
          ]
        },
        "ImageUri": "",
        "MemorySize": 128,
        "Timeout": 30,
        "Role": null,
        "Policies": [ "AWSLambdaBasicExecutionRole" ],
        "Events": {
          "RootGet": {
            "Type": "Api",
            "Properties": {
              "Path": "/",
              "Method": "GET"
            }
          }
        }
      },
      "Metadata": {
        "Dockerfile": "Dockerfile",
        "DockerContext": ".",
        "DockerTag": ""
      }
    }
  },
  "Outputs" : {
    "ApiURL" : {
      "Description" : "API endpoint URL for Prod environment",
      "Value" : { "Fn::Sub" : "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/" }
    }
  }
}
```
Save your changes to the file and you are now ready to build the solution and deploy to AWS.

#### Step 5: Build and Deploy using Visual Studio 2019 for Windows

Now, we’ll use the Lambda publishing wizard in the AWS Toolkit for Visual Studio to publish the function to AWS Lambda, and then test it using the toolkit’s built-in testing functionality.

> Before starting the Lambda publishing wizard, make sure that Docker has been configured to use Linux containers.

1. Right-click the project node in the Visual Studio Solution Explorer pane, and select, **Publish to AWS Lambda**. This launches the publishing wizard.

    <img src="media/figure07.png" alt="Publish" width="500px" />

2. In the first step of the wizard, ensure the Region drop-down shows the region to which you want to publish and run the Lambda function. Type in the stack name and S3 bucket.

> If you already have a suitable S3 bucket for storing deployment files you can select it in the drop-down, otherwise create a new S3 bucket by clicking New next the S3 Bucket drop-down, entering a suitable name, and then clicking Ok.

![Publish AWS Serverless Application Wizard](media/figure08.png "Publish AWS Serverless Application Wizard")

3. Click the **Publish** button to finish the deployment. The dialog will display a Publishing progress bar and will show all the deployment actions as it carries them out.

![Publish AWS Serverless Application Wizard Publishing Progress](media/figure09.png "Publish AWS Serverless Application Wizard Publishing Progress")

4. Visual Studio will now display details of the CloudFormation stack in a Stack window, and you can use the window to review including the CloudFormation actions that were executed, and the resources created during deployment.

![CloudFormation Stack](media/figure10.png "CloudFormation Stack")

You are now ready to test the deployed solution.

### Step 5: Deploy to AWS using .NET CLI

Now we will use the [.NET Global Tools for AWS](https://aws.amazon.com/blogs/developer/net-core-global-tools-for-aws/) to deploy the Lambda function to AWS. The tools were installed in Module 1. Before deploying the solution you will need to choose a region to deploy the resources to, and you will also need an S3 bucket in that region for storing the deployment assets. When you’ve chosen a region and an S3 bucket, you can deploy your serverless application as follows:

1. Replace `<BUCKET NAME>` in the commands below with the s3 bucket you will be using.
    ```shell
    aws s3 mb s3://<BUCKET NAME> --region us-west-2
    ```

2. Use the dotnet lambda deploy-serverless function command to deploy your function. You can either enter it without any arguments, in which case you will be prompted for the name of the stack, the region, and S3 bucket, or you can supply them as arguments like this:
    ```shell
    dotnet lambda deploy-serverless --region us-west-2 --stack-name TestServerless --s3-bucket <BUCKET NAME>
    ```

    The command will then display progress as it deploys the components to AWS, and on successful completion will print the message shown below.

    ![CloudFormation Stack](media/figure11.png "CloudFormation Stack")

You are now ready to test the deployed solution.

#### Step 6: Test API Gateway and Lambda using Visual Studio 2019 for Windows

To test the deployed solution, expand the **AWS Explorer** window in Visual Studio, and then under **AWS Lambda** double-click on the **TestServerless** Lambda function to open its *Function* window. Refresh the pane if it isn’t showing in the list.

The window contains a number of tabs, and you can use the Test Function tab to test the function by clicking the Invoke button.

![Test Function tab](media/figure12.png "Test Function tab")

Now, we’ll test our function with sample input from the View Function pane and view the result.
The window contains a number of tabs such as "Test Function" and Configuration on the left side of the pane.,You can use the **Test Function** tab to test the function by clicking the **Invoke** button.

![Test Function Resutls](media/figure13.png "Test Function Resutls")

After the call to the API Gateway and the Lambda function completes, you will see the full JSON response in the Response area of the screen, and the Log output area shows details of the request, including its execution time.

Congratulations! You’ve now created a working Lambda function and deployed it along with an API Gateway endpoint to AWS.

If you want to play with the function you can easily change the message returned in the Function.cs file, re-deploy the solution, and then test it again.

### Step 6: Test API Gateway and Lambda using .NET CLI

Now we will use the AWS Lambda tools for .NET to test the Lambda function.

1. Use the lambda invoke-function command to execute the test. You can either enter the command without any arguments, in which case you will be prompted for the name of the function and the region, or you can supply them as arguments like this, replacing the region with the region code you selected previously:

    ```shell
    dotnet lambda invoke-function TestServerless -–region us-west-2
    ```

1. When the command completes successfully you should see a Payload message displayed in the terminal or command-line window that contains the body provided by your Lambda function, `"Hello AWS Serverless"`.

![Test Function Resutls](media/figure14.png "Test Function Resutls")

Congratulations! You’ve now created a working Lambda function and deployed it along with an API Gateway endpoint to AWS.

If you want to play with the function you can easily change the message returned in the Function.cs file, re-deploy the solution again, and then test it as above.

## Module 3: Integrate Lambda with DynamoDB

In this module you'll extend the solution from Module 2 by creating a DynamoDB table to store reading list details, and then updating the Lambda function to retrieve the reading list data from DynamoDB.

These instructions provide options for 2 different development environments: Visual Studio 2019 for Windows, or .NET CLI on Windows, Mac, or Linux.

### Things to Note
* Time to Complete - 25 mins

### Implementation Instructions

#### Step 1: Add NuGet Packages using Visual Studio 2019 for Windows

First of all, you need to add some additional NuGet packages to the Visual Studio solution, one to provide access to DynamoDB, and the other to carry out some rudimentary JSON formatting.
To add the required NuGet packages:

1. Open the solution from Module 2 in Visual Studio.
1. Open the Package Manager Console by going to **Tools > NuGet Package Manager > Package Manager Console**
1. In the Package Manager Console window, enter the following command to install the Newtonsoft JSON package:
    ```shell
    Install-Package Newtonsoft.Json
    ```
1. Once it has successfully installed, add the AWS SDK's DynamoDBv2 package by running the following command in the Package Manager Console window
    ```shell
    Install-Package AWSSDK.DynamoDBv2
    ```

#### Step 1: Add NuGet Packages using .NET CLI

Before updating the solution code, you first of all need to add some additional NuGet packages to the solution, one providing access to DynamoDB, and the other to help format the reading list results as JSON.

To add the required NuGet packages:

1. Open a command-line or terminal window.
1. Navigate to the **/TestServerless/src/TestServerles**s directory
1. Run the following command
    ```shell
    dotnet add package Newtonsoft.Json
    ```
1. Once it has successfully completed, run the command
    ```shell
    dotnet add package AWSSDK.DynamoDBv2
    ```
#### Step 2: Integrate code with DynamoDB

Use the editor of your choice to edit the code in the file **Function.cs**, which contains the code for our basic Lambda function

1. Once the NuGet packages have been added to the solution, you’ll need to update the **Function.cs** file. Start by adding the following using statements at the top of the file:

    ```csharp
    using Amazon.DynamoDBv2;
    using Amazon.DynamoDBv2.Model;
    using Newtonsoft.Json;
    ```

1. You’ll then need to create a new asynchronous function, `ScanReadingListAsync`, to call DynamoDB, to scan the table for data, and convert the results into JSON:

    ```csharp
    private async Task<string> ScanReadingListAsync()
    {
        using var client = new AmazonDynamoDBClient(Amazon.RegionEndpoint.USWest2);

        var response = await client.ScanAsync(new ScanRequest("readingList"));

        return JsonConvert.SerializeObject(response.Items);
    }
    ```

    > Since the code scans the DynamoDB table without setting a filter, it will return all the data contained in the table, which is fine for this example, but would *need proper consideration for a production system to reduce the data retrieved by the Lambda function*.

1. Next, you need to change the Get method by making it asynchronous so it can call the `ScanReadingListAsync` method. You do this by first of all adding an `async` modifier to the method declaration, then changing its return type to `Task< APIGatewayProxyResponse>`, and finally changing its name to `GetAsync` to fit with .NET naming conventions. The method signature should look like the following:

    ```csharp
    public async Task<APIGatewayProxyResponse> GetAsync(APIGatewayProxyRequest request, ILambdaContext context)
    ```

2. You then need to change the line that sets the Body of the response to call the new method, ScanReadingListAsync, remembering to add an await to its call, since it’s an asynchronous method. The method should now be:

    ```csharp
    public async Task<APIGatewayProxyResponse> GetAsync(APIGatewayProxyRequest request, ILambdaContext context)
    {
        context.Logger.LogLine("Get Request\n");

        var response = new APIGatewayProxyResponse
        {
            StatusCode = (int)HttpStatusCode.OK,
            Body = await ScanReadingListAsync(),
            Headers = new Dictionary<string, string> { { "Content-Type", "text/plain" } }
        };

        return response;
    }
    ```

    Those are the only code changes needed in the Lambda function.

2. You also need to ensure the DynamoDB table is created when the solution is deployed, which can be done by making the following changes to the **serverless.template** file:

    * Change the **Command** in the **AWS::Serverless::Function** section to **GetAsync**, since we updated the name of the method in the Function.cs file.
    * Change the permissions granted to the Lambda function by updating the Policies parameter to include **dynamodb:Scan**, since it’ll now need permission to call the DynamoDB table. The sample below shows a policy providing just that permission for the readingList DynamoDB table created.
    * Finally, you need to add a new resource section containing settings for the DynamoDB table.

    The **serverless.template** file should now look like the following:

```json
{
  "AWSTemplateFormatVersion" : "2010-09-09",
  "Transform" : "AWS::Serverless-2016-10-31",
  "Description" : "An AWS Serverless Application.",
  "Resources" : {
    "Get" : {
      "Type" : "AWS::Serverless::Function",
      "Properties": {
        "FunctionName": "TestServerless",
        "PackageType": "Image",
        "ImageConfig": {
          "EntryPoint": [
            "/lambda-entrypoint.sh"
          ],
          "Command": [
            "TestServerless::TestServerless.Functions::GetAsync"
          ]
        },
        "ImageUri": "",
        "MemorySize": 128,
        "Timeout": 30,
        "Role": null,
        "Policies": [
          "AWSLambdaBasicExecutionRole",
          {
            "Version": "2012-10-17",
            "Statement": [
              {
                "Effect": "Allow",
                "Action": [ "dynamodb:Scan" ],
                "Resource": { "Fn::GetAtt": [ "readingListDynamoDBTable", "Arn" ] }
              }
            ]
          }
        ],
        "Events": {
          "RootGet": {
            "Type": "Api",
            "Properties": {
              "Path": "/",
              "Method": "GET"
            }
          }
        }
      },
      "Metadata": {
        "Dockerfile": "Dockerfile",
        "DockerContext": ".",
        "DockerTag": ""
      }
    },
    "readingListDynamoDBTable" : {
      "Type" : "AWS::DynamoDB::Table",
      "Properties" : {
        "TableName" : "readingList",
        "AttributeDefinitions" : [
          {
            "AttributeName" : "ItemId",
            "AttributeType" : "S"
          },
          {
            "AttributeName" : "Title",
            "AttributeType" : "S"
          }
        ],
        "KeySchema" : [
          {
            "AttributeName" : "ItemId",
            "KeyType" : "HASH"
          },
          {
            "AttributeName" : "Title",
            "KeyType" : "RANGE"
          }
        ],
        "ProvisionedThroughput" : {
          "ReadCapacityUnits" : "1",
          "WriteCapacityUnits" : "1"
        }
      }
    },
  },
  "Outputs" : {
    "ApiURL" : {
      "Description" : "API endpoint URL for Prod environment",
      "Value" : { "Fn::Sub" : "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/" }
    }
  }
}
```
#### Step 3: Build and Deploy to AWS using Visual Studio 2019 for Windows

Now, we’ll use the Lambda publishing wizard in the AWS Toolkit for Visual Studio to publish the function to AWS Lambda, and then test it using the toolkit’s built-in testing functionality. Deploying the solution is almost exactly the same as before

1. Before deploying the solution you will need to build the application. You can do this by right-clicking the project node in the Visual Studio Solution Explorer pane, and select, **Build**.

    ![Build Menu](media/figure15.png "Build Menu")

    Once the build has completed successfully you are ready to deploy the solution.

1. Right-click the project node in the Visual Studio Solution Explorer pane, and select, **Publish to AWS Lambda**. This launches the publishing wizard.

    <img src="media/figure07.png" alt="Publish" width="500px" />

1. In the first step of the wizard, the dialog should now be pre-populated with the answers you entered last time.

    ![Publish AWS Serverless Application Wizard](media/figure08.png "Publish AWS Serverless Application Wizard")

2. Click the **Publish** button to finish the deployment. The dialog will display a Publishing progress bar and will show all the deployment actions as it carries them out.

    ![Publish AWS Serverless Application Wizard Publishing Progress](media/figure09.png "Publish AWS Serverless Application Wizard Publishing Progress")

3. Visual Studio will now display details of the CloudFormation stack in a Stack window, and you can use the window to review including the CloudFormation actions that were executed, and the resources created during deployment.

    ![CloudFormation Stack](media/figure10.png "CloudFormation Stack")

You are now ready to test the deployed solution.

### Step 3: Build and Deploy to AWS using .NET CLI

Now we will use the [.NET Global Tools for AWS](https://aws.amazon.com/blogs/developer/net-core-global-tools-for-aws/) to deploy the Lambda function to AWS. The tools were installed in Module 1.

1. Before deploying the solution you will need to build the application. You can do this by executing the following command in the terminal or command-line window:

    ```shell
    dotnet build
    ```

    ![Build Output](media/figure20.png "Build Output")

2. Use the dotnet lambda deploy-serverless function command to deploy your function. You can either enter it without any arguments, in which case you will be prompted for the name of the stack, the region, and S3 bucket, or you can supply them as arguments when executing the command. Replace `<BUCKET NAME>` in the commands below with the s3 bucket you created in the previous module.

    ```shell
    dotnet lambda deploy-serverless --region us-west-2 --stack-name TestServerless --s3-bucket <BUCKET NAME>
    ```

    The command will then display progress as it deploys the components to AWS, and on successful completion will print the message shown below.

    ![CloudFormation Stack](media/figure21.png "CloudFormation Stack")

You are now ready to test the deployed solution.

#### Step 4: Test API Gateway and Lambda using Visual Studio 2019 for Windows

To test the deployed solution, expand the **AWS Explorer** window in Visual Studio, and then under **AWS Lambda** double-click on the **TestServerless** Lambda function to open its *Function* window. Refresh the pane if it isn’t showing in the list.

The window contains a number of tabs, and you can use the Test Function tab to test the function by clicking the Invoke button.

![Test Function tab](media/figure12.png "Test Function tab")

Now, we’ll test our function with sample input from the View Function pane and view the result.
The window contains a number of tabs such as "Test Function" and Configuration on the left side of the pane.,You can use the **Test Function** tab to test the function by clicking the **Invoke** button.

![Test Function Results](media/figure16.png "Test Function Results")

After the call to the API Gateway and the Lambda function completes, you will see the full JSON response in the Response area of the screen, although since there’s no data in the DynamoDB table the response will be minimal. To make it a bit more interesting you can add some data as follows:

1. In the AWS Explorer expand the Amazon DynamoDB section and then double-click on the **readingList** table to open a Table window. Refresh the pane if it isn’t showing in the list.

    ![Dynamo DB Table](media/figure17.png "Dynamo DB Table")

1. The Table window is split into two parts, the top past allowing you to set Scan settings, and the bottom part showing you items in the table. Since the table is empty we’re going to add an item. Click on the row under ItemId and enter a value **A1** for ItemId, and **Cross-platform .NET** for the title. To save the item to DynamoDB click Commit Changes at the top of the window. Once the item has been added it will change colour, and you can add some other rows.

    ![Dynamo DB Table with Data](media/figure18.png "Dynamo DB Table with Data")

1. If you now go back to the Function window and invoke the Test Function again, your response will be full on JSON containing details of the items you just added to DynamoDB.

    ![Test Function Results](media/figure19.png "Test Function Results")

Congratulations! You’ve now extended your Lambda function to call Dynamo DB, deployed the updated Lambda function and DynamoDB table to AWS, and demonstrated that they’re working seamlessly together.

### Step 4: Test API Gateway and Lambda using .NET CLI

Now we will use the AWS Lambda tools for .NET to test the Lambda function.

1. Use the lambda invoke-function command to execute the test. You can either enter the command without any arguments, in which case you will be prompted for the name of the function and the region, or you can supply them as arguments like this, replacing the region with the region code you selected previously:

    ```shell
    dotnet lambda invoke-function TestServerless -–region us-west-2
    ```

1. When the command completes successfully you should see a Payload message displayed in the terminal or command-line window that contains the body provided by your Lambda function, `although since there’s no data in the DynamoDB table the response will be minimal.

    ![Test Function Results](media/figure22.png "Test Function Results")

1. To make the test a bit more interesting you can add an item to the DynamoDB table by running the following command in a terminal or command-line window, remembering to change the region for your chosen region:

    On a Mac, or Linux shell use the following command

    ```shell
    aws dynamodb put-item --region us-west-2 --table-name readingList --item '{ "ItemId": {"S": "A1"}, "Title": {"S": "Cross-platform.NET"} }'
    ```

    On a Windows Command prompt the syntax for the --item parameter is slightly different

    ```shell
    aws dynamodb put-item --region us-west-2 --table-name readingList --item {\"ItemId\":{\"S\":\"A1\"},\"Title\":{\"S\":\"Cross-platform.NET\"}}
    ```

1. If you now go re-run the test command in the terminal or command-line window, the payload displayed will now be full of JSON containing details of the items you added to DynamoDB.

    ![Test Function Results](media/figure23.png "Test Function Results")

Congratulations! You’ve now extended your Lambda function to call Dynamo DB, deployed the updated Lambda function and DynamoDB table to AWS, and demonstrated that they’re working seamlessly together.

## Module 4: Delete Serverless Resources

Once you’ve had enough playing with the solution you created in Modules 1–3, deleting the AWS resources is simply a matter of deleting the CloudFormation stack, which automatically deletes the associated resources.

These instructions provide options for 2 different development environments: Visual Studio 2017 for Windows, or .NET CLI on Windows, Mac, or Linux.

### Things to Note
* Time to Complete - 5 mins

### Implementation Instructions

#### Step 1: Deleting the CloudFormation Stack using Visual Studio 2019 for Windows

Once you’ve had enough playing with the solution, deleting the AWS resources is simply a matter of deleting the CloudFormation stack, which automatically deletes the associated resources.

To delete a CloudFormation stack from Visual Studio:

1. In **AWS Explorer**, expand the **AWS Cloud Formation** entry. Right-click on the **TestServerless** stack and then select Delete.

    ![CloudFormation on AWS Explorer](./media/figure24.png "CloudFormation on AWS Explorer")

1. A dialog will pop-up asking you if you’re sure you want to delete the stack. Click **Yes** to confirm deletion of the stack.

    ![Delete CloudFormation Stack Dialog](media/figure25.png "Delete CloudFormation Stack Dialog")

While it might seem a shame to delete a working solution, one of the great advantages of Cloud Formation is that recreating the resources is simply a matter of executing the publish command from Visual Studio and waiting briefly as the resources are automatically created by Cloud Formation.

#### Step 1: Deleting the CloudFormation Stack using .NET CLI

Once you’ve had enough playing with the solution, deleting the AWS resources is simply a matter of deleting the CloudFormation stack, which automatically deletes the associated resources.

1. In the terminal or command-line window, execute the following command:
    ```shell
    dotnet lambda delete-serverless --stack-name TestServerless --region us-west-2
    ```

1. On successful deletion the command will print the message `CloudFormation stack TestServerless deleted`

    ![Delete CloudFormation Stack Command](media/figure26.png "Delete CloudFormation Stack Command")

One of the great advantages of CloudFormation is creating and deleting resources can be execute through commands, so if you want to re-create the serverless application, you just need to re-run the dotnet lambda deploy-serverless command and waiting briefly as the resources are automatically provisioned by CloudFormation.

repository: aws-samples/aws-net-guides

path: /Serverless/Serverless App with Dynamo-Example/Readme.md

repo_name: aws-samples/aws-net-guides


text:
# Segmentation images augmentation
This repository provides tools for augmentation images accompanied by segmentation masks.

![Sample](https://github.com/NesterukSergey/segmentation_image_augmentation/blob/master/data/examples/simple_mpa_example.jpg)

![Sample](https://github.com/NesterukSergey/segmentation_image_augmentation/blob/master/data/examples/mpa_example.jpg)

It provides easy ways to:
* Modify target image and segmentation mask simultaneously
* Create boolean, multi-object, multi-part, semantic and class masks simultaneously
* Find bounding boxes
* Add background
* Move, flip and rotate object
* Add noise (salt, pepper, Gauss)
* Smooth image
* Apply perspective transform

## Measured time
* ~ 0.05s per scene for 777x565x3 final scene; 6 input objects; 1 type of output masks
* ~ 0.7s per scene for 777x565x3 final scene; 6 input objects; 4 types of output masks + bounding boxes

## Usage
You can find examples at [Demos.ipynb](https://github.com/NesterukSergey/segmentation_image_augmentation/blob/master/Demos.ipynb)

## Dataset

For plant images sample [IPPN](http://www.plant-phenotyping.org/datasets) dataset is used.

See more about the dataset at:

Massimo Minervini, Andreas Fischbach, Hanno Scharr, Sotirios A. Tsaftaris, Finely-grained annotated datasets for image-based plant phenotyping, Pattern  Recognition Letters (2015), doi: 10.1016/j.patrec.2015.10.013

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# Microsoft_Malware_Prediction_using_classical_machine_learning_algorithms

This repository contains solution for the topic which I have selected as part of case study using classical machine learning algorithms to solve problem on predicting probability for whether a machine will be soon hit by malware, topic selected from kaggle.

Link :- https://www.kaggle.com/c/microsoft-malware-prediction/overview

# 1.  According to NetMarketShare firm(source Wikipedia), as per
their survey on desktop os market share in September 2019,
Microsoft Windows OS rules the market by 87%, so here comes the
biggest challenge for Microsoft to provide antivirus defender or other
security products which provides accurate and efficient results
whether machine will be infected with malware or not to keep their
data secured and remain non-vulnerable from such kind of attacks.

Main agenda of this problem is to come up with a ML technique
which can be able to predict the probability for a machine
to be likely infected from malware.

# 2. Performance metrics:
For checking the performance of model, I had used  area under the ROC curve between the predicted probability and the observed label. And achieved 0.74 AUC score for the best selected model.

# 3. Solution Description:
To solve this problem I had implemented 2 models and compared their performance based on AUC score and selected the best model to be used on test data to predict the  final probabilities.

 * Model 1 : First I implemented Lightgbm model on train dataset and hypertuned its hyperparameters using optuna library.
 * Model 2: Implemented my own custom stacking models using different classifiers and hypertuned number of base models using gridsearch cv scikit library.

 # 4. Data:

Dataset can be found from https://www.kaggle.com/c/microsoft-malware-prediction/data which consist of both train dataset with class labels and test dataset

 # 5. Hardware:
  Because of huge dataset for training purpose and computation limitations, deployed my own jupyter server on Google cloud platform with below specs:

   * 8 vCPUs
   * 64 GB RAM

 # 6. Libraries:
 Below libraries used for solving this problem
  * numpy
  * pandas
  * dask
  * phik (library for finding correlation amongst the features)
  * scipy
  * lightgbm
  * scikit learn library of various classifiers
  * optuna (for hyperparameter tuning)
  * xgboost
  * And many more

branch_name: refs/heads/main

gha_license_id: MIT


text:
---
title: 'UX Design'
process_order: 2
---

## UX Design

A key goal of this project is to combine different content types like images, text, tables, and lists on the different pages to make the content more interesting for students. However, the overall design needed to remain relatively minimal to keep students focus on the core content without adding additional distractions. To achieve this, the website layout and organization took advantage of Bootstrap's grid system and components to combine text and images onto the page in a way that was easy to read and understand.

#### Home Page

The Home Page design included introductory text along with a hero image and a call to action buttons. Further down the page, there are several header, text, image combinations that are intended to briefly introduce students to the main themes of the website that are explored in more detail on the website sub-pages. The intent of the home page is to draw students into the website visually and show them how to get started.

![Wireframe - Primary Sources Home Page](../../assets/img/project/primary-sources-home-page.png){:class="project-detail-image--full"}
{:class="project-detail-container"}

Wireframe - Primary Sources Home Page
{:class="project-detail-caption"}

#### Sub-Pages

The sub-pages of the website explore different ways to combine content, text and images or text as tabular content in the example here. Lines of text are also kept short to improve readability. The sub-pages were the core "instructional" spaces of the website, therefore the design focused on highlighting key concepts and providing multiple examples using images and different text combinations. Bootstrap offers several different components - tables, images with captions, etc. to present content attractively.

![Wireframe - Primary Sources Sub-Page](../../assets/img/project/primary-sources-sub-page.png){:class="project-detail-image--full"}
{:class="project-detail-container"}

Wireframe - Primary Sources Sub-Page
{:class="project-detail-caption"}

#### Card Component

One of the most versatile Bootstrap components is the [card component](https://getbootstrap.com/docs/5.1/components/card/). There are many different ways to combine content on a card component. For the design of this website, the card component is used for the examples of primary sources and included images along with textual details within each card.

![Wireframe - Primary Sources Content Card](../../assets/img/project/primary-sources-content-card.png){:class="project-detail-image--full"}
{:class="project-detail-container"}

Wireframe - Primary Sources Content Card
{:class="project-detail-caption"}

Also making use of the card component, the website's quiz page presents a card that contains an image and question with a vertical button group that contained multiple choices for students to select.

![Wireframe - Primary Sources Quiz Card](../../assets/img/project/primary-sources-quiz-card.png){:class="project-detail-image--full"}
{:class="project-detail-container"}

Wireframe - Primary Sources Quiz Card
{:class="project-detail-caption"}

gha_language: HTML


text:
# Assembler

A Hack language assembler written in Swift

## Installation

Make sure you are running swift 5

Build with `swift build -c release`. This will output a binary to  `bin/Assembler`.

## Usage

To output to disk provide input and output files:

```
Assembler file.asm file.hack
```

To simply output to the terminal just provide an input file:
```
Assembler file.asm
```


text:
---
title: TrailerVote Documentation

language_tabs: # must be one of https://git.io/vQNgJ
  - java

toc_footers:
  - © TrailerVote. CONFIDENTIAL.

search: true
---

# Introduction
The TrailerVote is a innovative software service that enables movie-ticketing apps to increases user engagement and customer understanding by encouraging moviegoers to rate trailers as they are played on the big screen of the cinema. Users are later sent notifications as a reminder that tickets for the movie they wanted see are now on sale.

Features include:

- Theatre-Optimized Audio Recognition: Optimized for complex cinema environments including 7+ speakers, reverb, echo, deep bass
- Branding & Styling: Custom branding for listening experience with your choice of background colors and logo.
- Offline audio recognition: Minimizes the need for network connectivity at the cinema.
- Custom Recognition: Identify trailer content, loyalty program promotions, or advertisements and serve the corresponding interactions.

# Requirements

In order to use TrailerVote technology, you must have the following:

- A movie-related mobile app
- Android 4.4 (API 19) or higher

# Android
## Installation
- Contact TrailerVote for the the latest iOS SDK.

- Copy com directory into your project libraries directory. Example, YourAppDir/app/libs/.
  ![alt text](img_sdk_location.png "TrailerVote SDK in Android Project")

- In you project gradle file add libraries directory to repositories list.

```
# project gradle file

allprojects {
    repositories {
        maven {
            url "libs"
        }
    }
}
```

- In your app module gradle file add TrailerVote SDK dependency.

```
# app module gradle

dependencies {
    implementation "com.trailervote:trailervotesdk:1.0.0@aar"
}
```

## Configuring and initializing the TrailerVote SDK
The initialization process of the SDK begins immediately at the first call of `TrailerVoteSdk.init(context, authority, backendEndpoint, username, password);`. All internal dependencies are initialized as well as public singleton instances.

To start the pre-loading process of the trailer recognition data, call the `TrailerVoteSdk.instance().loadData();` method.

Once the data is downloaded, the trailer recognition feature will be available in offline, but please keep the data pre-load call triggered on your app launch so that the SDK could update the recognition data.

## Enabling the TrailerVote In-Theatre feature
The main feature of the SDK is the audio recognition of movie trailers. We use the `TrailerVoteRecognitionActivity` for presenting a full-screen user interface and for handling the audio recognition process.
  ![alt text](img_recognition_screen.jpg "TrailerVote Listening Screen")

```java
boolean success = TrailerVoteSdk.instance().openRecognitionScreen(context);
if (!success) {
  // error
}
```

Navigate to recognition screen by calling the -TrailerVoteSdk.instance().openRecognitionScreen(Context) method of the main SDK class.

Note that after a trailer is recognized the SDK will render the voting buttons automatically and prompt the user to vote.
  ![alt text](img_recognition_screen_voting.jpg "TrailerVote Listening Screen")

After a user votes, the feedback is recorded internally in the SDK and transmitted to TrailerVote. This means that this information is visible in the voted trailers feed and any API that exposes the vote.

_Note: Special advertisement clips are handled differently - the fullscreen WebView is presented with the corresponding url being loaded._

The SDK provides the ways to set the logo image displayed at the trailer recognition screen. To set the logo image, add the drawable with the name `img_tv_recognition_screen_partner_logo`. You can override the default voting card background as well by adding the drawable with the name `img_tv_recognition_screen_partner_background`.

## Enabling the TrailerVote Video Player
Because moviegoers watch trailers in your movie app, we recommend replacing your video player with the TrailerVote Video Player. The **TrailerVote Video Player** will provide a prompt during the video playback.
  ![alt text](img_player_screen.png "TrailerVote Video Player")

To launch the video player, call the

```java
TrailerVoteSdk.instance().openVideoPlayerForTrailer(context, trailerUrl, runnableOnError);
```

The video player will automatically manage the playback queue and present the voting UI in order for user to vote on shown movies.

## Enabling the Analytics and the Remote Notifications capabilities
```java
TrailerVoteSdk.instance().setRemoteAnalyticsToken(YOUR_ANALYTICS_TOKEN);
```

Both the analytics and the remote notifications capanilities require the client token to be provided to the SDK. To begin the setup, provide your token by calling the `setRemoteAnalyticsToken(YOUR_ANALYTICS_TOKEN)` method. The key events will be sent automatically by the SDK.

```java
FirebaseInstanceId.getInstance().getInstanceId().addOnCompleteListener(new OnCompleteListener<InstanceIdResult>() {
    @Override
    public void onComplete(@NonNull Task<InstanceIdResult> task) {
        if (task.isSuccessful()) {
            TrailerVoteSdk.instance().enablePushNotifications(task.getResult().getToken());
            TrailerVoteSdk.instance().setClassForNotificationIntent(MainActivity.class);
        }
    }
}
```

For enabling the remote notifications capability, start by calling `enablePushNotifications(deviceToken)` and `setClassForNotificationIntent(class)` methods.

```java
if (intent.getAction() == Intent.ACTION_MAIN) {
  Bundle extras = intent.getExtras();
  if (extras.containsKey("trailervote_notification") {
    TrailerVoteSdk.instance().onNotificationReceived(extras, new NotificationActionListener() {
      @Override
      void onNotificationAction(@NonNull NotificationAction action, @Nullable String movieId) {
        switch (action) {
          case NotificationAction.OPEN_RECOGNITION:

            break;
          case NotificationAction.OPEN_MOVIE_DETAILS:

            break;
          case NotificationAction.OPEN_MOVIE_SHOWTIMES:

            break;
          case default:

            break;
        }
      }
    });
  }
}
```

When the notification is received, call the `onNotificationReceived(intentExtras, listener)` method. In order to communicate back to your app after processing the notification’s extras, the SDK provides `NotificationActionListener` interface. Implement this interface to react to the notification processing result.

In some time later, when you wish to stop the remote notifications capability, call the `disablePushNotifications` method to remove current device token from the notifications recipients list.

To track analytics events, the SDK provides several methods:

- `TrailerVoteSdk.instance().logTicketPurchasedEvent(movieId, showtimeTimestamp, quantity, totalPrice, convenienceFees, currencyCode);`

- `TrailerVoteSdk.instance().logShowtimesPageShownEvent(movieId);`

Call these methods in corresponding places in your app to submit the corresponding events.

When recognition screen is opened, the event will be submitted automatically.

repository: TrailerVote/slate-android

repo_name: TrailerVote/slate-android


text:
![image](https://user-images.githubusercontent.com/54318487/128631380-55c8a60f-99d1-4886-8870-d818fa4a4156.png)
# 👋Hi!
### My name is Sami Ullah Saleem. I have created this awesome character counter.
## Live Preview
#### www.bit.ly/3ywmCgA

## How can you adjust styling?
* You can add font size in the font size box.
* You can add the background color of the character counter box.
* You can add the font color in the font color box.

#### I am hopeful you will like my project.
## Wanna Connect
[Facebook]("www.facebook.com/samiullah.saleem.5036")
[Linkedin]("www.linkedin.com/in/samiullahsaleem/")
<EMAIL_ADDRESS>

repository: samiullahsaleem/charactercounter

repo_name: samiullahsaleem/charactercounter


text:
# Writing EventCollections

Import Dispike interactions, this is a module that contains functions, decorators and classes you'll need to create a collection.

```python
from dispike import interactions
```

Create your EventCollection. Create a class and inherit ``interactions.EventCollection``.

```python
class SampleCollection(interactions.EventCollection):
  def __init__(self, ...):
    ...
```

???+ info
	An `__init__` may be used, but you'll need to let Dispike know to initialize it, or initialize it yourself before passing to dispike.

Add your callbacks..

```python

class SampleCollection(interactions.EventCollection):
  def __init__(self, ...):
    ...

	@interactions.on("sampleInteractionCommand"):
	async def incoming_interactions_command(ctx: IncomingDiscordInteraction):
		...

	@interactions.on("sampleInteractionCommand2"):
	async def incoming_interactions_command_two(ctx: IncomingDiscordInteraction):
	...

	@interactions.on("sampleInteractionButton", type=EventTypes.COMPONENT):
	async def inomcing_interaction_button(ctx: IncomingDiscordButtonInteraction):
	...

	@interactions.on("sampleInteractionSelectMenu", type=EventType.COMPONENT):
	async def incoming_select_menu_interaction(ctx: IncomingDiscordSelectMenuInteraction):
	...
```

If you followed the tutorial before, this should look extremely familiar.

## Adding commands.

You can also add commands..  You must expose a function named ``.command_schemas`` and provide a ``List`` containing either ``PerCommandRegistrationSettings`` or ``DiscordCommand`` items.

Dispike offers a helper class called ``PerCommandRegistrationSettings`` located in interactions. This class allows you to select where (guild) command will be registered.

```python

    def command_schemas() -> typing.List[
        typing.Union[PerCommandRegistrationSettings, "DiscordCommand"]
    ]:
        return [
        	DiscordCommand(
    					name="...", description="...", options=[]
					),
					PerCommandRegistrationSettings(schema=DiscordCommand(...), guild_id=1111)

        ]
```

You can see in the example above that ``PerCommandRegistrationSettings`` is used to target a specific guild.

url: https://raw.githubusercontent.com/ryuuzake/dispike/bd3ffb28fc03307077d647ee233f4f0e5c594434/docs/tutorial/Bigger Applications/Writing your first Collection.md

repository: ryuuzake/dispike

filename: Writing your first Collection.md

repo_name: ryuuzake/dispike


text:
# stripe-create-customer

Creates a new Stripe customer with Graphcool Functions ⚡

Gets triggered after a new customer is created in Graphcool and updates it with the new Stripe customer id.

## Getting Started

```sh
npm -g install graphcool
graphcool init --schema customer.graphql
```

## Setup Stripe

* You need a Stripe account so create one for free [here](https://dashboard.stripe.com/register).

* Replace `__STRIPE_KEY__` in `stripe-create-customer.js` with your **test Stripe key** and `__PROJECT_ID__` with your **project id**.

* Create a new server-side subscription function and set `Customer` type as the trigger.

* Paste the code from `subscription.graphql` to the subscription query panel

* Paste the code from `stripe-create-customer.js` to the inline code panel.

## Test the Code

Go to the Graphcool Playground and run this mutation to create a new customer:

```graphql
mutation {
<EMAIL_ADDRESS>{
    id
    stripeCustomerId
    email
  }
}
```

This should return the `id` of the new customer and a null `stripeCustomerId` because it has not been created yet. Remember, our function is triggered after the mutation.

Run the query below to see that our function has run and updated the new customer node with the Stripe customer id:

```graphql
query {
  allCustomers {
    id
    stripeCustomerId
  }
}
```

This should return the new customer with a valid Stripe customer id. That's it!

repository: yusinto/functions

gha_language: JavaScript

repo_name: yusinto/functions


text:
# Project Euler - Rust

Solving Project Euler with Rust.

[![Project Euler](https://projecteuler.net/profile/Misch.png)](https://projecteuler.net/)

Playing with [Travis CI](https://travis-ci.org/) and rust testing

[![Build Status](https://travis-ci.org/Misch-/ProjectEulerRust.png?branch=master)](https://travis-ci.org/Misch-/ProjectEulerRust)

As well as [KCov](https://simonkagstrom.github.io/kcov/) with [Coveralls](https://coveralls.io/) to experiment with code coverage of created tests! Starts a build a on travis CI and uploads coverage results to coveralls for each Rust branch, nightly, beta, and stable.

[![Coverage Status](https://coveralls.io/repos/github/Misch-/ProjectEulerRust/badge.svg?branch=master)](https://coveralls.io/github/Misch-/ProjectEulerRust?branch=master)

## Try it out

Run specific problem:

```
cargo run --bin 1
```

## Rust's generated documentation
https://misch-.github.io/ProjectEulerRust/

WORK IN PROGRESS

repository: cmische/ProjectEulerRust

repo_name: cmische/ProjectEulerRust


text:
# abcTests

This testing framework runs a set of ui tests and api tests.

Test Framework Used:- mocha
Build Tool Used:- gulp
UI Automation Tool Used:- webdriverio

API Test Workflow:-

node => gulp => mocha

UI Test Workflow:-

node => gulp => wdio (webdriver test runner) => mocha

Installation Instructions:-

All the required libraries are in the repo. So cloning the library is sufficient.

Pre-requisites for running the UI tests:-

Chrome should be installed. The tests are presently set up to run in chrome.

After cloning the repository - the chromedriver needs to be installed for the very first time.

To install chromedriver =>

Run the following command => ./node_modules/.bin/selenium-standalone install

Commands to run the tests =>

for the ui news page  tests => npm run uiNewsTests
for the ui radio page tests => npm run uiRadioTests
for the api tests in production => npm run apiTestsInProduction

Please Note:- at present there is no task to run the api tests in test or staging as the webservice urls do not work in those environments. But they can be easily added in future by adding environment specific config files.

repository: PriyoBh/abcTests

repo_name: PriyoBh/abcTests


text:
#PHP4Noobs
The noob friendly PHP library.

## What does it do?
PHP4Noobs aims to simplify common tasks within PHP such as writing to files, connecting to and using a database, etc.

The package manager you need to install this PHP library.

#### What is a package manager?
Are you sure you are supposed to be doing PHP?

## Samples
Simple usage of the database class
```
$db = new PHP4Noobs\Database();

// Establish a connection
$db->connect("localhost", "username", "password", "database", $port=3306);

// Insert a row
$db->insert("users", "'username', 'password', 'email'", "'test', 'test', 'test'");

// Print some strings for all users
while($row = $db->fetchArray("users")) {
	echo $row['username'] . "<br>";
}

// Close the database connection
$db->close();
```

There's nothing else in this library right now other than the Database class.

## Standards
This library may or may not be PSR compliant, but then again it's for beginners so who gives a shit?


text:
I spoke with a source at the Oakland School District who
>said they would not allow papers to be turned in written in ebonics.
>It is just an effort for educators to better understand how their
>students may communicate.  So everyone who liked Tim May's
>fake sarcasm are now sad that they made fools of themselves.

I suggest you read the written resolution of the Oakland school board,
rather than listen to the spin control the district was forced to use after
their idiotic plan blew up in their face.

The resolution finds that "ebonics is the primary language" of a majority
of students in the district. The resolutions then requires teachers to
"provide instructions to students in their primary language".

The school board mandates in writing that at least some classes be taught
in Ebonics (ghetto slang).

-- Lucky Green<EMAIL_ADDRESS>PGP encrypted mail preferred
   Make your mark in the history of mathematics. Use the spare cycles of
   your PC/PPC/UNIX box to help find a new prime.
   http://www.mersenne.org/prime.htm

{% endraw %}
```

## Thread

+ Return to [January 1997](/archive/1997/01)

+ Return to "[Lucky Green <shamrock<span>@</span>netcom.com>](/authors/lucky_green_shamrock_at_netcom_com_)"

+ 1997-01-01 (Tue, 31 Dec 1996 18:09:09 -0800 (PST)) - Re: Just another government fuckover: New crypto regulation - _Lucky Green<EMAIL_ADDRESS>


text:
uNvEncoder
==========

**uNvEncoder** is a simple wrapper of [NVENC](https://developer.nvidia.com/nvidia-video-codec-sdk) for Unity.

Platforms
---------

- Windows 10
- NVIDIA GPU that supports NVENCODE API

Install
-------

- Unity Package
  - Download the latest .unitypackage from [Release page](https://github.com/hecomi/uNvEncoder/releases).
- Git URL (UPM)
  - Add `https://github.com/hecomi/uNvEncoder.git#upm` to Package Manager.
- Scoped Registry (UPM)
  - Add a scoped registry to your project.
    - URL: `https://registry.npmjs.com`
    - Scope: `com.hecomi`
  - Install uNvEncoder in Package Manager.

repository: hecomi/uNvEncoder

gha_language: C

repo_name: hecomi/uNvEncoder


text:
---
layout: post
title: "Building a Sketchy Website 101"
date: 2015-04-25 17:42:10 -0400
comments: true
categories: [hacking, web, sysadmin]
---

Back in April, I won a free ".club" domain through gandi.net's
[anniversary](https://15.gandi.net) prize giveaway. I really didn't need
a ".club" domain in particular, so I thought it would be pretty fun to
register a stereotypical "sketchy" domain and set it up as a drive-by
download site or something, because while I've *heard* of doing this kind of
thing, I've never actually done it before. Here's a blog post walking through
what I did. The usual disclaimer applies here: I did this purely for my
own education and learning experience and am not responsible for anything
you do with it.

### Step 1: Register your sketchy domain

I chose [http://freemoviedownload.club](http://freemoviedownload.club).

### Step 2: Set up drive-by downloads

This involves configuring your web server to automatically set the
`Content-Type` header of the resource you want to force download
to `application/octet-stream`. That should make most web browsers trigger
a download file prompt to actually download the file. Safari curiously
doesn't support prompts for downloaded file location like Chrome and Firefox,
so in that case, it will immediately download the file to `~/Downloads`.

I'm going to try to force a drive-by download of a jpg file, so I added
the below config to my `.htaccess` file in Apache's `DocumentRoot`.

```xml .htaccess
<Files *.jpg>
        ForceType application/octet-stream
</Files>
```

That will force browers to download the image, rather than rendering it
when a browser tries to access `http://freemoviedownload.club/image.jpg`, for
example.

At this point, we're technically done. We can send someone a link to a file
and, assuming they say yes to the prompt (or use Safari), download it to their
computer.  But for some extra polish, I want to have an actual website with
content and have the download come from *that* page.

### Step 3: Redirect

We can accomplish this with a trivial Javascript redirect that executes
after the page has loaded. We can even add a delay before the download happens
to give them time to read the website or whatever. The redirect will need
to be to the path configured in step 2, but this will give the illusion that
the download is coming from the `index.html` page.

```html index.html
you have arrived at the official free movie download club! enjoy your download
<script type="text/javascript" charset="utf-8">
    function f() { document.location = 'dickbutt.jpg' }
    setTimeout(f, 2000);
</script>
```

That's it! Anyone that browses to the website will automatically get a nice
"dickbutt.jpg" image downloaded to their machine. Again, particularly effective
against Safari and Chrome for Android, in my testing.

![](/images/sketchy.gif)


text:
---
# SPDX-FileCopyrightText: the secureCodeBox authors
#
# SPDX-License-Identifier: Apache-2.0

title: "ADR-0003: How can we introduce a mechanism to start specialized scans on the results of previous scans?"
sidebar_label: "ADR-0003"
---
# ADR-0003: How can we introduce a mechanism to start specialized scans on the results of previous scans?

| <!-- -->       | <!-- --> |
|----------------|----------|
| **Status**:    | ACCEPTED |
| **Date**:      | 2020-05-20 |
| **Author(s)**: | Jannik Hollenbach<EMAIL_ADDRESS>Robert Seedorff<EMAIL_ADDRESS>Sven Strittmatter<EMAIL_ADDRESS>|

## Context

### Status Quo

Currently scans by the secureCodeBox are single focused on a specific tool. Combining multiple scans requires manual or scripting by the user to use the results of a scan (e.g. Nmap) as a input for another scanner (e.g. SSLyze)

### Problem and Question

How can the results of a scan be used to automatically configure subsequent specialized scans for identified targets.

In general we want to describe cascading scans like:

```text
+--------+             +--------+             +--------+
| scan 1 |-- result -->| scan 2 |-- result -->| scan 3 |
+--------+             +--------+       |     +--------+
                                        |
                                        |     +--------+
                                        +---->| scan 4 |
                                              +--------+
```

A concrete example:

```text
+----------------+         +-----------------+               +-----------+
|    <<nmap>>    |         |     <<nmap>>    |               |  <<SSL>>  |
| find all hosts |-- IP -->| find open ports |-- port 443 -->| check TLS |
+----------------+         +-----------------+      |        +-----------+
                                                    |
                                                    |        +-------------+
                                                    |        |  <<nikto>>  |
                                                    +------->| check HTTPd |
                                                             +-------------+
```

The solution should fulfill the following criteria:

- The "rules" used to describe which subsequent scans can be executed should be modular, so that they can be packaged together with the scan types.
- It should be possible for a user to select which scan rules should be applied
- Protections should be in place to ensure that the clusters are not completely overwhelmed by these automatically created scans. Especially circular structures which create a infinite number of scans should be prevented.

## Decision

It was decided to implement these rules as Custom Resource Definitions (CRDs) in Kubernetes. This allows the Helm Charts of the scanners to package related rules for the scanner together with their ScanTypes.

### Defining CascadingRule

The so called "CascadingRules" consist of a "matches" section which contains one or multiple rules which are compared against findings. When a finding matches a rule the "scanSpec" section will then be used to create a new scan. To customize the scan to match the finding, the \[mustache\](<https://github.com/janl/mustache.js>) templating language
can be used to reference fields of the finding.

```yaml
apiVersion: "cascading.securecodebox.io/v1"
kind: CascadingRule
metadata:
  name: "tls-scans"
  labels:
    # Described how "invasive" the scan is.
    # Possible values: "invasive" or "non-invasive"
    # CascadingRules are considered "invasive" when the Scan they start actively sends out packages with attack payloads.
    securecodebox.io/invasive: non-invasive
    # Described the intensiveness level on a scanning and computational resource level.
    # Possible values: "ligh", "medium", "intense"
    # CascadingRules are considered more "intensive" when the Scan they start consumes lots of computational resources like RAM, CPU, or Network
    securecodebox.io/intensive: light
spec:
  matches:
    # CascadingRule triggers if a finding matches at least one of the anyOf matchers
    # With the first version of this implementation only anyOf would be supported.
    # If this turns out to be lacking and other operators (like `allOf` can be introduced without breaking changes)
    anyOf:
      # define an explicit "port" as finding and a given port number
      - category: "Open Port"
        attributes:
          port: 443
          service: "https"
      # define an "port service" finding (any port)
      - category: "Open Port"
        attributes:
          service: "https"
  scanSpec:
    name: "sslyze"
    parameters: ["--regular", "{{attributes.hostname}}"]
```

### Using CascadingRules

By default no cascading Rules will be used.

```yaml
# Nmap Scan without cascading rules
apiVersion: "execution.securecodebox.io/v1"
kind: Scan
metadata:
  name: "portscan-berlin-wifi"
  label:
    office: berlin
    vlan: wifi
spec:
  name: "nmap"
  parameters: ["-sV", "<IP_ADDRESS>/16"]
```

To enable cascading rules you need to specify a label selector to select
the cascading rules you’d like

```yaml
apiVersion: "execution.securecodebox.io/v1"
kind: Scan
metadata:
  name: "portscan-berlin-wifi"
  label:
    office: berlin
    vlan: wifi
spec:
  cascades:
    matchLabels:
      # Uses all CascadingRules in the namespace which are labelled as "non-invasive" and a intensiveness level of "light"
      securecodebox.io/invasive: non-invasive
      securecodebox.io/intensive: light
  name: "nmap"
  parameters: ["-sV", "<IP_ADDRESS>/16"]
```

To implicitly enable all cascading rules (not-recommended) a empty label
selector can be used

```yaml
apiVersion: "execution.securecodebox.io/v1"
kind: Scan
metadata:
  name: "portscan-berlin-wifi"
  label:
    office: berlin
    vlan: wifi
spec:
  cascades:
    # Uses all `CascadingRules` in the namespace
    matchLabels: {}
  name: "nmap"
  parameters: ["-sV", "<IP_ADDRESS>/16"]
```

The label selectors also allow the more powerful [matchExpression](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#set-based-requirement) selectors:

```yaml
apiVersion: "execution.securecodebox.io/v1"
kind: Scan
metadata:
  name: "example.com"
spec:
  scanType: nmap
  parameters:
    - -p22,80,443
    - example.com
  cascades:
    # Using matchExpression instead of matchLabels
    matchExpression:
      key: "securecodebox.io/intensive"
      operator: In
      # This select both light and medium intensity rules
      values: [light, medium]
```

repository: shsingh/secureCodeBox

repo_name: shsingh/secureCodeBox


text:
- authentication - identity verification
- authorization - defining set of services for authenticated user
### methods of proving identity
- knowledge (PIN, password)
- possession (Key, token)
- biometrics (fingerprint)
### features of remote authentication
- risk of eavesdropping
    - solution: one time password, cryptography for secure channel
- extending protocols SASL(Simpole authentication and security layer)
- centralised authentication
    - authentication server (identity provider)
### one time password
- offline list of OTPs
- challenge-response
- synchronised authentication token

### symmetric cryptography
- examples: DES, Blowfish, AES, RC4
- fast
### asymmetric cryptography
- multiplication vs factoring, discrete log
- examples: RSA, DSA
- slow
- issue: public key must be verified

### hash functions
- examples: (CRC, MD5,) SHA

### data encryption
![img](dataencryption.png)
![img2](signature.png)

### Diffie-Hellman algorithm
1. Alice picks secret number a and public primes p,q
2. Alice computes $A=p^a$ mod q, sends p,q,A to Bob

3. Bob picks secret number b, computes $B=p^b$ mod q sends B to Alice

4. Alice computes $s=B^a$ mod q and Bob the same $s=A^b$ mod q
- without knowing a and b when choosing big p,q, computing s is hard

### public key authentication
- web of trust (PGP)
- certification authority (CA)
### certificate
- key with owner ID tag issued by CA
- if we trust CA we can trust key (chain of trust)

### SSL, TLS
- between transport and application layer
- for many protocols
1. client requests SSL connection+parameters
2. server responds with parameters and own certificate
3. client verifies server generates key basis encrypts by server public key and sends back
4. server decrypts key basis, using the basis both client and server generate keys
5. now both can encrypt by this key

## application layer in tcp/ip
- covers OSI layers 5,6,7
    - communication rules between client and server
    - dialog status
    - data interpretation
- defines:
    - dialog control flow (who starts, what can be requested, what can be responses)
    - message format (text, binary data, struct)
    - message type (request, response)
    - message fields semantics (descriptions)
    - transport layer interaction (depends on TCP/UDP)

### DNS
- resolving domain names to addresses
- resource record
    - name
    - ttl
    - type and data
- EDNS - bigger allowed UDP chunks
- binary protocol
- client queries known servers until obtaining answer
    - increasing timeouts
#### DNS resuorce records
- SOA - start of authority, initial record, general domain attributes
- NS - domain nameserver name, usually more than one
- A - host IPv4 for given name
- AAAA - host IPv6 for given name
- PTR - reverse record
- CNAME - alias creation (alias name | canonical name)
- MX (Mail eXchanger) - which server receives mail for given domain/computer

### DNS servers
- primary: manages domain RR database
- secondary: backups, download contents of primary database
- caching
- p and s are authority servers
![alt](dnsquery.png)

### DNS security
- cache poisioning attack
- DNSSEC - signing all recoreds with key stored in parent domain
    - very complex
### tools
- nslookup - we can query servers and resolve names
- dig (UNIX)

repository: JanProvaznik/Matfyz

repo_name: JanProvaznik/Matfyz


text:
---
layout: page
title: Courses
subtitle: Course Offerings & Resources
desc: Current courses offered in rotation at the Atlantic School of Theology.
permalink: /courses/
---

I teach a variety of courses at [Atlantic School of Theology](http://www.astheology.ns.ca/).
In addition to covering the basics for graduate-level survey and
language requirements, I try to offer a representative rotation of
courses from the three parts of Tanakh by covering selections from the
Law, the Prophets, and the Writings.

## Courses at AST

{::nomarkdown}

BF 1001

Hebrew Bible (Fall 2023): One of two requirements in the Biblical Foundations series, this course surveys the Hebrew Bible/Old Testament and explores its historic role as Jewish and Christian Scripture.

HB 2201

Beginning Biblical Hebrew I (Summer 2022): An introduction to the basic principles of biblical Hebrew with emphasis on morphology, phonology, and syntax, this course opens the door to classical Hebrew.

HB 2202

Beginning Biblical Hebrew II (Fall 2022): A more detailed study of Hebrew grammar and syntax through the reading of selected biblical texts, this course is designed as a continuation of HB 2201.

HB 3111

The Book of Genesis (Fall 2023): A study of the histories of Genesis that seeks to understand the book’s foundational role as scripture from antiquity down through the present day.

HB 3112

Psalms in Interpretation (Winter 2021): An overview of current research on the shape and shaping of the Psalter, and a seminar on the reception history of about a dozen particular psalms.

HB 3113

The Ten Commandments (Winter 2022): A careful look at the ten words spoken directly by God to Israel at Mount Sinai, along with their significance in biblical and post-biblical tradition.

HB 3114

The Twelve Prophets (Winter 2024): An overview of twelve Hebrew prophets (sometimes called “minor”) and the canonical associations that have caused some to speak of The Book of the Twelve.

HB 3115

Exodus and the Life of Moses (Summer 2018): A look at the Moses story in the Book of Exodus, this course also locates the figure of Moses in contemporary Jewish and Christian understanding.

HB 3116

Ecclesiastes (Winter 2019): A close reading of Ecclesiastes, also known as Qoheleth, in the context of the Writings, and in connection with the book’s extraordinarily rich history of interpretation.

HB 3117

Creation and Canon (Fall 2021): A study of creation connected to biblical and theological rules, and organized around four themes: creation, counter-creation, de-creation, and re-creation.

HB/ST 3001

Christian Doctrine and the Old Testament (Winter 2022): An exploration of the relationship of scripture and theology through the study of recent approaches to the OT as a source for Christian Doctrine.

ST/HB 3101

The Eucharist in Ecumenical Perspective (Winter 2019): Co-taught by Anglican and Roman Catholic faculty members, this is a biblical and theological look at the Eucharist in an ecumenical setting.

{:/}

## Student Resources

See my [resources page]({{ site.baseurl }}/resources/) for advice for
students at AST, including guidance on course selection in the MDiv
Program (Anglican Church of Canada stream), and general help on research
and writing in biblical studies and theology (with an emphasis on Hebrew
Bible/Old Testament).

---

## Previous Courses Taught

### Tyndale University College, 2008--2016

- Old Testament Scripture (BSTH 101)
- The Pentateuch (BSTH 310)
- Genesis (T&I: RLGS 321)
- The Ten Commandments (T&I: RLGS 311/BSTH 321)
- Jonah/Micah/Nahum in the Book of the XII (T&I: RLGS 314)
- Psalms (T&I: RLGS 326/BSTH 314)
- Ecclesiastes (BSTH 315/440)
- The Fate of the Dead (BTT: RLGS 445)
- Canon and the Rule of Faith (BTT: RLGS 446)
- The Old Testament at Christian Scripture (BTT: RLGS 448)
- Creation and the Old Testament (TOBITH: BSTH 440)
- Forgiveness (TOBITH: BSTH 440)
- The Historical Geography of Israel (RLGS 307/BIBL 060)
- Directed Study in: Leviticus (RLGS 450)
- Honours Thesis in Religious Studies I & II (RLGS 497 & 499)
- Introduction to Biblical Hebrew I & II (HEBR 201 & 202)
- Readings in Biblical Hebrew I & II (HEBR 301 & 302)

### University of St Andrews, 2005--2008

- The History and Religion of Ancient Israel (Postgraduate Tutor)
- Scripture and Theology Seminar (Postgraduate Coordinator)

### CPLS College Preparatory School, 2002--2004

- Classics of Western Literature (9th grade)
- U.S. History (10th grade)
- Moral Philosophy: Truth, Beauty, Goodness (11th–12th grade)
- Political Philosophy: Liberty, Justice, Equality (11th–12th grade)
- Creative Writing (12th grade)
- Yearbook (9th–12th grade)


text:
# CardMenu

http://www.getmdl.io/components/index.html#cards-section

## Usage

```javascript
import Card from 'material-design-react/card';

let myCard = (
  <Card shadow="2">
    {/* ... */}
    <Card.Menu>
      {/* ... */}
    </Card.Menu>
    {/* ... */}
  </Card>
);
```

You may also import and use `CardMenu` directly.

```javascript
// import { CardMenu } from 'material-design-react';
import CardMenu from 'material-design-react/card/menu';

let myCardMenu = (
  <CardMenu>
    {/* ... */}
  </CardMenu>
);
```

## Properties

*none*

## Parent

[Card](../README.md)

## Notes
*none*


text:
---
title: Returning to Gradient
keywords:
sidebar: home_sidebar
---

To return to your notebook, the basic steps will be:

1. Start your instance
1. Update the course repo
1. Update the fastai library
1. When done, shut down your instance

## Step by step guide

### Start your instance

In your [console notebooks](https://www.paperspace.com/console/notebooks) choose the notebook you want to run and click on the button 'Start' under action.

You can choose a different Virtual Machine type on which you'd like to run your Notebook. This can be extremely useful when you want to start on a lower-end machine type, test everything is okay, then move to a more powerful GPU. Also, sometimes the GPU type that you started the notebook on will be unavailable, in which case you can easily fire it up on a different GPU.

Click on 'Start notebook' when you're ready and wait a few seconds for it to be ready.

Click on the open button when it's ready and you'll be back in your jupyter notebook page.

### Update the course repo
 To update the course repo, launch a new terminal from the jupyter notebook menu.

This will open a new window, in which you should run those two instructions:

``` bash
cd course-v3
git pull
```

This should give you the latest of the course notebooks. If you modified some of the notebooks in course-v3/nbs directly, GitHub will probably throw you an error. You should type `git stash` to remove your local changes. Remember you should always work on a copy of the lesson notebooks.

### Update the fastai library
To update the fastai library, open the terminal like before and type
``` bash
pip install fastai --upgrade
```

### Stop your instance
Once you're finished, go back to your [console notebook page](https://www.paperspace.com/console/notebooks) and find your running notebook. Under Action, click stop, this will end the billing session.

 **NOTE: you *will* be charged for the time that your notebook is running. You must stop the notebook to stop incurring charges.**


text:
# Terra App Delegate

The AppDelegate is an object that provides a set of functions used to facilitate communcation between Containers and
their consuming Containers/Applications.

## Getting Started

- Install with [npmjs](https://www.npmjs.com):
  - `npm install terra-app-delegate`
  - `yarn add terra-app-delegate`

## Usage

```js
import AppDelegate from 'terra-app-delegate';

const newAppDelegateInstance = AppDelegate.create({
  disclose: (data) => {
    // Perform disclose action (open modal, inline panel, etc.)
  },
  dismiss: (data) => {
    // Dismiss current Container
  },
  closeDisclosure: (data) => {
    // Close entire disclosure method, regardless of other content
  },
  goBack: (data) => {
    // Dismiss current Container
  },
  maximize: (data) => {
    // Maximize the disclosure method
  },
  minimize: (data) => {
    // Minimize the disclosure method
  },
  releaseFocus: (data) => {
    // The calling component is releasing focus.
  },
  requestFocus: (data) => {
    // The calling component is requesting to gain focus.
  }
});

const clonedAppDelegateInstance = AppDelegate.clone(newAppDelegateInstance, {
  disclose: (data) => {
    // Override disclose function from newAppDelegateInstance
  },
});

```

The implementations of the AppDelegate APIs are completely determined by the component creating the AppDelegate instance. However,
the suggested use of each function is as follows:

|Name|Status|Description|
|---|---|---|
|`disclose`|Required|Used to progressively disclose content in various ways (modal, inline, etc.)|
|`dismiss`|Optional|Used to remove the calling component from the application. Dismiss may additionally close the calling component's disclosure mechanism. Dismiss should only be present if the component is dismissible (i.e. presented within a disclosure mechanism).|
|`closeDisclosure`|Optional|Used to close the calling component's disclosure mechanism. Should only be present if the component is presented within a disclosure mechanism.|
|`goBack`|Optional|Used to dismiss the calling component. Should only be present if the ability to go back is available (for example, due to a navigation structure present in the disclosure mechanism).|
|`maximize`|Optional|Used to maximize the calling component. Should only be present if the disclosure method is maximizable and not currently maximized.|
|`minimize`|Optional|Used to minimize the calling component. Should only be present if the disclosure method is minimizable and not currently minimized.|
|`releaseFocus`|Optional| The calling component, typically a popup or date picker component that can display over the container, is ready to release focus so that other components can gain focus.|
|`requestFocus`|Optional| The calling component, typically a popup or date picker component that can display over the container, is requesting to gain focus.|

### Disclose Argument API

While the other functions have generic Object-based argument APIs, the `disclose` function has an extensible argument API designed to support Redux-based workflows.

Disclose API:

|Key|Type|Description|
|---|---|---|
|preferredType|String|A String describing the component's desired disclosure method. This may or may not be honored, depending on the consuming Application's configuration.|
|content|Object|An Object containing data describing the component that is to be disclosed.|

Disclose Content API:

|Key|Type|Description|
|---|---|---|
|key|String|An identifying String that will be used as the React `key` for the disclosed component. Should be as specific as possible.|
|name|String|The String value that will be used to retrieve the Component class from the AppDelegate component registry.|
|props|Object|An Object containing the props for the disclosed component. These should be serializable.|

The above structure allows us to disclose components dynamically without having to actually pass complex refs/functions through the API. This allows the parameters to be serializable and stored in Redux stores easily.

The AppDelegate exposes two functions (`registerComponentForDisclosure` and `getComponentForDisclosure`) that allows components to be registered for and retrieved by an arbitrary key. Those functions should be used by components to build the disclosable components from the `disclose` arguments.

An example implementation would look like this:

```jsx
// ExampleDisclosureComponent.jsx

import AppDelegate from 'terra-app-delegate';

const ExampleDisclosureComponent = () => {
  // This is the component that will be disclosed.
};

ExampleDisclosureComponent.propTypes = {
  prop1: ...,
  prop2: ...,
}

export default ExampleDisclosureComponent;

// Register the ExampleDisclosureComponent with the AppDelegate. We'll also export the disclosureName so that
// consuming components have access to it. By doing that, we ensure that consumers will import this file,
// thus ensuring that the component is registered for use.

const disclosureName = 'ExampleDisclosureComponent';
AppDelegate.registerComponentForDisclosure(disclosureName, ExampleDisclosureComponent);
export { disclosureName };

```

```jsx
// ExampleRootComponent.jsx

import AppDelegate from 'terra-app-delegate';
import ExampleDisclosureComponent, { disclosureName as exampleDisclosureName } from './ExampleDisclosureComponent';

class ExampleRootComponent extends React.Component {
  discloseComponent() {
    this.props.app.disclose({
      preferredType: 'modal',
      content: {
        key: `COMPONENT-${CONCEPT_IDENTIFIER_HERE}`,
        name: exampleDisclosureName,
        props: {
          prop1: 'value',
          prop2: 'another value'
        },
      },
    })
  }

  render() {}
}

ExampleRootComponent.propTypes = {
  app: AppDelegate.propType,
}

```

repository: dylanklohr/terra-core

repo_name: dylanklohr/terra-core


text:
Javascript Console Admin Console component for Alfresco Share
=============================================================

Author: Florian Maul

This project defines a Javascript Console component for Share's Administration Console,
that enables the execution of arbitrary javascript code in the repository.

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

The component has been developed to install on top of an existing Alfresco
4.0, 4.1 or 4.2 installation. The javascript-console-share-<version>.amp needs
to be installed into the Alfresco Share webapp using the Alfresco Module Management Tool:

    java -jar alfresco-mmt.jar install javascript-console-share-<version>.amp /path/to/share.war

You can also use the Alfresco Maven SDK to install or overlay the AMP during the build of a
Share WAR project. See https://artifacts.alfresco.com/nexus/content/repositories/alfresco-docs/alfresco-lifecycle-aggregator/latest/plugins/alfresco-maven-plugin/advanced-usage.html
for details.

Building
--------

To build the module and its AMP / JAR files, run the following command from the base
project directory:

    mvn install

The command builds two JAR files named javascript-console-share-<version>.jar and
javascript-console-share-<version>-sources.jar as well as javascript-console-share-<version>.amp
in the 'target' directory within your project.

To hotdeploy to a local alfresco installation you can use the alfresco:install
command to deploy the Javascript Console directly to a WAR file or an exploded war folder:

    mvn package alfresco:install -Dmaven.alfresco.warLocation=/path/to/tomcat/webapps/share.war

If you want to build the module so it can be installed and run in an Alfresco 4.0 / 4.1 server
running on Java 6 you need to have a Java 6 JDK available. Either make sure that your JDK 6 is set
as the default Java environment (PATH / JAVA_HOME environment variable) or run the build with the
following command from the base project directory:

    mvn install -P Java6-crossCompile -Djdk6.executable=/path/to/javac

Using the component
-------------------

Log in to Alfresco Share as an admin user and navigate to the Administration
page. Click 'Javascript Console' in the left hand side navigation.

repository: jecicorp/js-console

gha_license_id: NOASSERTION

repo_name: jecicorp/js-console


text:
---
templateKey: 'refund-page'
path: /refund
---
# Returns and Refunds Policy

Thank you for shopping at Candid Labs.

Please read this policy carefully. This is the Return and Refund Policy of Candid Labs.

## Digital products

We do not issue refunds for digital products once the order is confirmed and the product is sent.

We recommend contacting us for assistance if you experience any issues receiving or downloading our products.

## Contact us

If you have any questions about our Returns and Refunds Policy, please contact us:

*   By email<EMAIL_ADDRESS>

repository: candidpartners/candid-labs-site

repo_name: candidpartners/candid-labs-site


text:
# Python 101 Week 1
--------------------
Please remember the following:

1. Setup the Python Environment: https://www.python.org/downloads/release/python-342/
2. Setup GitExtensions: http://sourceforge.net/projects/gitextensions/
3. Read the Gitextensions manual, if you have time... :  You can reach it from Classes Github account
4. Create a GitHub account: https://github.com/
5. Follow me on GitHub with your account: https://github.com/eneskemalergin
6. Bring Laptops to next week's class

Here is the Course link in the GitHub: https://github.com/NAU-Python-Class/Py101-Spring-15

> Next Week We will start coding, please bring your laptops to be able to attend the hands- on practices...

repository: NAU-ACM/IntroductionToPython

path: /Week 1/README.md

gha_language: Python

repo_name: NAU-ACM/IntroductionToPython