text:
# WIP: Docker Targets guide

**THE FOLLOWING DOCUMENT IS STILL A WORK IN PROGRESS**

The following guide will help in creating, building and deploying new targets to your infrastructure.

The general outline of the steps required to build a target are

1. Prepare your environment
2. Decide on your scenario
3. Develop the target
4. Test the target
5. Deploy the target

Before we start with actual commands we need to understand a few more details.

Each target has its own folder with files needed for building the container as
well as files to assist in various tasks such as flag generation.

The targets have their own playbook (autoregister.yml) with specific tasks
needed during build and its own `variables.yml` that is used during build as
well as the main playbooks (such as build-images.yml, feed-targets.yml and others)

## Prepare your environment
Prepare the repository for targets building by creating the respective inventory
```sh
mkdir -p inventories/targets/{host_vars,group_vars}
echo "[targets]"> inventories/targets/hosts
```

On the system that will perform the actual docker build make sure you enable non SSL registry support by adding `insercure-registries` to the `/etc/docker/daemon.json` like so
```json
{
  "insecure-registries" : ["myregistryip:5000"]
}
```

More details about insecure registries can be found at https://docs.docker.com/registry/insecure/

**NOTE:** Keep in mind that you will have to add this setting on any system you
will be attempting to `docker push` the image from.

## Decide on your scenario
This is the most important step, as it will determine how you will proceed with
any of the other steps.

For the purposes of this guide we will start with a simple target scenario. We
will implement a set of vulnerable applications based, among others, on the amazing paper [Smashing the stack for fun and profit from AlephOne](http://phrack.org/issues/49/14.html)

The target will be named `alephone` and will include programs that implement the following

1. a stack based overflow vulnerability
2. a format string vulnerability
3. a buffer overflow

The following flags will be included

1. /root/ETSCTF: User is able to read any file in the filesystem. This usually
means the user got root access

2. env ETSCTF: User is able to read environment variables, either cause he/she
gained user access or is able to read information of running processes through
other means

3. /etc/shadow: User is able to read any file or is able to retrieve the
password hash for the `ETSCTF` user.

4. /etc/passwd: User is able to retrieve gecos information from the system

NOTE: In this case we don't really need that many flags but they are included
to better illustrate the capabilities of the provided tools.

The players will have to connect to a tcp port (eg, 666/tcp) and they will be
presented with a direct prompt to the entry vulnerable binary. Once exploited
they will be presented with a local suid binary implementing another of the
examples to gain root access.

## Developing your target
During the development stages you will need to build and re-build the target
multiple times. For this reason the development is advised to take place on a
linux workstation. You could use any of the existing systems to build your
images (eg build them from within dockerd160) but is not advisable as it may
leave traces behind that you dont want to.

The general development cycle goes something like this:

1. modify files
2. build docker (build not ok goto 1)
3. run target (run not ok goto 1)
4. push image to local registry or docker server
5. Profit

Start by copying the example target to a folder named as our target `alephone`
```sh
cp -r Dockerfiles/example Dockerfiles/alephone
cd Dockerfiles/alephone
```

Create the source code for the vulnerable examples

1. `stack_overflow.c`
```c
  /*
   * Author: http://phrack.org/issues/49/14.html
   */
  // EXAMPLE_REPLACE_PLACEHOLDER
  void main(int argc, char *argv[]) {
    char buffer[512];
    char ETSCTF_FLAG[]="EXAMPLE_FLAG_PLACEHOLDER";

    if (argc > 1)
      strcpy(buffer,argv[1]);
  }
```

2. `format_string.c`
```c
  /*
   * Author: http://www.cis.syr.edu/~wedu/Teaching/cis643/LectureNotes_New/Format_String.pdf
   */
  int main(int argc, char *argv[])
  {
    char user_input[100];
    scanf("%99s", user_input); /* getting a string from user */
    printf(user_input); /* Vulnerable place */
    return 0;
  }
```

3. `bof.c`
```c
  /*
   * Author: https://www.thegeekstuff.com/2013/06/buffer-overflow/
   */
  #include <stdio.h>
  #include <string.h>

  int main(void)
  {
    char buff[15];
    int pass = 0;

    printf("\n Enter the password : \n");
    gets(buff);

    if(strcmp(buff, "thegeekstuff"))
    {
        printf ("\n Wrong Password \n");
    }
    else
    {
        printf ("\n Correct Password \n");
        pass = 1;
    }

    if(pass)
    {
       /* Now Give root or admin rights to user*/
        printf ("\n Root privileges given to the user \n");
    }

    return 0;
  }
```

Modify `Dockerfile` to add our files. Add the following after line 28
```
COPY *.c /usr/src/
```

Edit and modify the `variables.yml`
```yml
---
ansible_host: <IP_ADDRESS>
DOCKER: dockerd160
mac: "02:42:0a:00:a0:03"
hostname: alephone
fqdn: alephone.example.com
rootable: 0 # 1 for yes
difficulty: 0
#scheduled_at: "YYYY-mm-dd HH:MM:SS"
container:
  name: "{{hostname}}"
  hostname: "{{fqdn}}"
  build: "alephone" # The current folder name
  image: "alephone" # The current folder name
...
...
...
ETSCTF_TREASURES:
  - {
      name: "Discovered the ETSCTF flag from <code>stack_overflow.c</code>",
      pubname: "Discovered an ETSCTF flag on {{fqdn}}",
      points: 100,
      player_type: offense,
      stock: -1,
      code: "THIS_IS_MY_EXAMPLE_ETSCTF_FLAG",
      replace: "EXAMPLE_FLAG_PLACEHOLDER",
      file: "/usr/src/stack_overflow.c",
    }
...
BUILD_COMMANDS:
  exec:
  - { cmd: "gcc -o /usr/local/bin/stack_overflow /usr/src/stack_overflow.c" }
  - { cmd: "gcc -o /usr/local/bin/bof /usr/src/bof.c" }
  - { cmd: "gcc -o /usr/local/bin/format_string /usr/src/format_string.c" }
  replace:
  - { #0
      pattern: "EXAMPLE_REPLACE_PLACEHOLDER",
      file: "/usr/src/stack_overflow.c",
      value: "This was compiled for {{fqdn}}",
    }
  - { #1
      pattern: "ENVFLAG_HASH",
      file: "/usr/local/sbin/healthcheck.sh",
      value: "{{envhash}}",
    }
...
...
```

Test build the image
```sh
docker build . -t alephone
...
... lots of output
Successfully built 02d07353faa7
Successfully tagged alephone:latest
```

Test run the image
```sh
docker run -it alephone
```

Once you're done tag appropriately and push your image to your registry
```sh
docker tag alephone <IP_ADDRESS>:5000/mytargets/alephone:v0.1
docker tag alephone <IP_ADDRESS>:5000/mytargets/alephone:latest
docker push <IP_ADDRESS>:5000/mytargets/alephone:v0.1
docker push <IP_ADDRESS>:5000/mytargets/alephone:latest
```

Now you are ready to add your target to the `backend` and have it deployed by
the system.

gha_language: PHP


text:
#
 Lists - Exercises

## Array Manipulator
Write a program that r**eads an array of integers** from the console and **set of commands** and **executes them over the array**. The commands are as follows:
- **add <index> <element>** – adds element at the specified index (elements right from this position inclusively are shifted to the right).
- **addMany <index> <element 1> <element 2> … <element n>** – adds a set of elements at the specified index.
- **contains <element>** – prints the index of the first occurrence of the specified element (if exists) in the array or -1 if the element is not found.
- **remove <index>** – removes the element at the specified index.
- **shift <positions> – shifts every element** of the array the number of positions **to the left** (with rotation).
For example, [1, 2, 3, 4, 5] -> shift 2 -> [3, 4, 5, 1, 2]
- **sumPairs** – sums the elements in the array by pairs (first + second, third + fourth, …).
For example, [1, 2, 4, 5, 6, 7, 8] -> [3, 9, 13, 8].
- **print** – stop receiving more commands and print the last state of the array.

#### Examples

|**Input**|**Output**|
|---|---|
|1 2 4 5 6 7
 add 1 8
 contains 1
 contains -3
 print|0
 -1
 [1, 8, 2, 4, 5, 6, 7]|
|1 2 3 4 5
 addMany 5 9 8 7 6 5
 contains 15
 remove 3
 shift 1
 print|-1
 [2, 3, 5, 9, 8, 7, 6, 5, 1]|
|2 2 4 2 4
 add 1 4
 sumPairs
 print|[6, 6, 6]|
|1 2 1 2 1 2 1 2 1 2 1 2
 sumPairs
 sumPairs
 addMany 0 -1 -2 -3
 print|[-1, -2, -3, 6, 6, 6]|

## Bomb Numbers
Write a program that **reads sequence of numbers** and **special bomb number** with a certain **power**. Your task is to **detonate every occurrence of the special bomb number** and according to its power **his neighbors from left and right**. Detonations are performed from left to right and all detonated numbers disappear. Finally print the **sum of the remaining elements** in the sequence.

#### Examples

|**Input**|**Output**|**Comments**|
|---|---|---|
|1 2 2 4 2 2 2 9
 4 2	|12|	Special number is 4 with power 2. After detontaion we left with the sequence [1, 2, 9] with sum 12.|
|1 4 4 2 8 9 1
 9 3	|5|	Special number is 9 with power 3. After detontaion we left with the sequence [1, 4] with sum 5. Since the 9 has only 1 neighbour from the right we remove just it (one number instead of 3).
|1 7 7 1 2 3
 7 1	|6|	Detonations are performed from left to right. We could not detonate the second occurance of 7 because its already destroyed by the first occurance. The numbers [1, 2, 3] survive. Their sum is 6.|
|1 1 2 1 1 1 2 1 1 1
 2 1	|4|	The red and yellow numbers disappear in two sequential detonations. The result is the sequence [1, 1, 1, 1]. Sum = 4.|

integers from the console and set of commands and executes them over
// the array. The commands are as follows:
// add index element – adds element at the specified index (elements right from this position inclusively
// are shifted to the right).
// addMany index element1 element2 elementN – adds a set of elements at the specified index.
// contains element – prints the index of the first occurrence of the specified element (if exists) in the array
// or -1 if the element is not found.
// remove index – removes the element at the specified index.
// shift positions – shifts every element of the array the number of positions to the left (with rotation).
// sumPairs – sums the elements in the array by pairs (first + second, third + fourth, …).
// print – stop receiving more commands and print the last state of the array.

## Append Lists
Write a program to **append several lists** of numbers.
- Lists are separated by **‘|’**.
- Values are separated by **spaces** (‘ ’, **one or several**)
- Order the lists from the **last to the first**, and their values from **left to right**.

#### Examples

|**Input**|**Output**|
|---|---|
|1 2 3 \|4 5 6 \|  7  8	|7 8 4 5 6 1 2 3|
|7 \| 4  5\|1 0\| 2 5 \|3	|3 2 5 1 0 4 5 7|
|1\| 4 5 6 7  \|  8 9	|8 9 4 5 6 7 1|

> #### Hints
> - Create a new empty list for the results.
> - Split the input by ‘|’ into array of tokens.
> - Pass through each of the obtained tokens from tight to left.
> For each token, split it by space and append all non-empty tokens to the results.
> - Print the results.

## Sum Adjacent Equal Numbers
Write a program to **sum all adjacent equal numbers** in a list of decimal numbers, starting from **left to right**.
- After two numbers are summed, the obtained result could be equal to some of its neighbors and should be summed as well (see the examples below).
- Always sum the **leftmost** two equal neighbors (if several couples of equal neighbors are available).

#### Examples

|**Input**|**Output**|**Explanation**|
|---|---|---|
|3 3 6 1	|12 1|	3 3 6 1 -> 6 6 1 -> 12 1|
|8 2 2 4 8 16	|16 8 16|	8 2 2 4 8 16 -> 8 4 4 8 16 -> 8 8 8 16 -> 16 8 16|
|5 4 2 1 1 4	|5 8 4|	5 4 2 1 1 4 -> 5 4 2 2 4 -> 5 4 4 4 -> 5 8 4|

> #### Hints
> 1.	Read the **input** and parse it to **list of numbers**.
> 2.	Find the **leftmost** two **adjacent equal cells**.
> 3.	**Replace** them with their **sum**.
> 4.	**Repeat** (1) and (2) until no two equal adjacent cells survive.
> 5.	*Print** the processed list of numbers.

## Split by Word Casing
Read a **text**, split it into words and distribute them into **3 lists**.
- **Lower-case** words like “programming”, “at” and “databases” – consist of lowercase letters only.
- **Upper-case** words like “PHP”, “JS” and “SQL” – consist of uppercase letters only.
- **Mixed-case** words like “C#”, “SoftUni” and “Java” – all others.
Use the following **separators** between the words: **, ; : . ! ( ) " ' \ / [ ] space**

#### Examples

|**Input**|**Output**|
|---|---|
|Learn programming at SoftUni: Java, PHP, JS, HTML 5, CSS, Web, C#, SQL, databases, AJAX, etc.|	Lower-case: programming, at, databases, etc
 Mixed-case: Learn, SoftUni, Java, 5, Web, C#
 Upper-case: PHP, JS, HTML, CSS, SQL, AJAX|

> #### Hints
> - **Split** the input text using the above described **separators**.
> - **Process** the obtained **list of words** one by one.
> - Create 3 lists of words (initially empty): lowercase words, mixed-case words and uppercase words.
> - Check each word and append it to one of the above 3 lists:
> Count the **lowercase letters** and **uppercase letters**.
> If all letters are **lowercase**, append the word to the lowercase list.
> If all letters are **uppercase**, append the word to the uppercase list.
> Otherwise the word is considered mixed-case -> append it to the mixed-case list.
> - Print the obtained 3 lists as shown in the example above.

## 06.Square Numbers
Read a **list of integers** and **extract all square numbers** from it and print them in **descending order**. A **square number** is an integer which is the square of any integer. For example, 1, 4, 9, 16 are square numbers.

#### Examples

|**Input**|**Output**|
|---|---|
|3 16 4 5 6 8 9 	|16 9 4|
|12 1 9 4 16 8 25 |49 16	49 25 16 16 9 4 1|

> #### Hints
> - To find out whether an integer is **“square number”**, check whether its square root is integer number (has no fractional part):
> **if (√num == (int)√num) …**
> - To order the results list in descending order use sorting by lambda function:
> **squareNums.Sort((a, b) => b.CompareTo(a));**

## Count Numbers
Read a **list of integers** in range [0…1000] and **print them in ascending order** along with their **number of occurrences**.

#### Examples

|**Input**|**Output**|
|---|---|
|8 2 2 8 2 2 3 7|2 -> 4
 3 -> 1
 7 -> 1
 8 -> 2|
|10 8 8 10 10|8 -> 2
 10 -> 3|

> #### Hints
> Several algorithms can solve this problem:
> - Use an **array count[0…1000]** to count in **counts[x]** the occurrences of each element **x**.
> - *Sort** the numbers and count occurrences of each number.
> - Use a dictionary **counts<int, int>** to count in **counts[x]** the occurrences of each element **x**.

### Counting Occurrences Using Array
1.	Read the input elements in array of integers **nums[]**.
2.	Assume **max** holds the largest element in **nums[]**.
- **max = nums.Max()**
3.	Allocate an array **counts[0 … max+1]**.
- It will hold for each number x its number of occurrences **counts[x]**.
4.	**Scan** the input elements and for each element x increase counts[x].
- For each value **v** in **[0…max]**, print **v -> count[v]**.
- Skip all values which do not occur in **nums[]**, i.e. **counts[v] == 0**.
This algorithm has a serious drawback:
- It depends on **mapping numbers to array indexes**.
- It will work well for input values in the range [0…1000].
- It will **not work** for very large and very small values, e.g. if the input holds -100 000 000 or 100 000 000.
- It will **not work** for real numbers, e.g. 3.14 or 2.5.

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
---
layout: default
---

# 1996-12-31 - Re: Hardening lists against spam attacks

## Header Data

From<EMAIL_ADDRESS>(Peter Hendrickson)

To: Douglas Barnes<EMAIL_ADDRESS>Message Hash: d57ab795b11bf3bde05f2830ed07a800fac978542a8810f4625be42600c0cfa6

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1996-12-31 23:51:57 UTC

Raw Date: Tue, 31 Dec 1996 15:51:57 -0800 (PST)

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Peter Hendrickson)
Date: Tue, 31 Dec 1996 15:51:57 -0800 (PST)
To: Douglas Barnes<EMAIL_ADDRESS>Subject: Re: Hardening lists against spam attacks
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

At 2:04 PM 12/31/1996, Douglas Barnes wrote:
> The problem with payment schemes like this is that they're hard
> to rationalize (as Lucky points out here).

> A direct mail piece (via snail mail) can easily cost the sender
> more than a dollar when all costs are taken into account. This
> does not seem to have appreciably slowed down junk mailers IRL.

> Spam to a large mailing list has a multiplicative effect (although
> it's also easier to throw out and/or ignore.) Certainly if someone
> had a real product, it would be worth anywhere from $1 to $25 to
> post an advertisement to a sizeable mailing list.

> On the other hand, a blanket charge would serve as a disincentive
> to people who make valuable contributions, unless it were a
> completely negligible cost, in which case the advertisers would
> have no problem coughing up the money. There's a serious imbalance
> between how annoying spam is and how much we're willing to pay
> to post (most of us would like to see them charged to the point
> where they wouldn't do it at all.)

It won't be worthwhile for a year or two for spam artists to go to the
trouble of figuring out how to do this.  I'm not sure I have a good
solution to this problem in the long term, however.

If our custom was to send money to people who make good posts, then
you could imagine the fee being quite high, say $20, since most of
the money will be made back.  Voila! We have a wonderful feedback
system for how much contribution we have made.

People who want to make sure that they are putting in at least as
much as they take out can make a little rule for themselves: I won't
take money out of my cypherpunks e-cash account.    In effect, this is
a fully distributed tokening system without the choke point of
a single token administrator.

> In general it seems very difficult to balance the various aspects
> of maintaining a lively discussion, fostering a sense of community,
> allowing anonymous postings, and keeping the whole thing simple
> enough to actually implement.

I agree that we should keep it sweet and simple.  That's one nice
aspect of the e-cash scheme.  All the software is already out there,
except (maybe) the majordomo part which I have volunteered to do.

Keep in mind that if the list brings in, say, $1000/month that buys
a lot of food.  I have to think that this will liven up the
monthly meetings and create many positive and lasting relationships.

> I've been on the verge of responding to certain posters over the last
> few months, and I've realized before I've hit the "send" key that
> I'd be giving them just what they want -- attention -- while further
> degrading the signal to noise ratio.

This is exactly the sort of process which is facilitated by paying
a dollar.  In your case it won't make a difference, but most people
will find their presence on the list becomes much more responsible
when they have to put up a buck.

Peter Hendrickson
<EMAIL_ADDRESS>

{% endraw %}
```

## Thread

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

+ Return to<EMAIL_ADDRESS>(Peter Hendrickson)](/authors/ph_at_netcom_com_peter_hendrickson_)"
+ Return to "[Toto <toto@sk.sympatico.ca>](/authors/toto_toto_at_sk_sympatico_ca_)"

+ 1996-12-31 (Tue, 31 Dec 1996 15:51:57 -0800 (PST)) - Re: Hardening lists against spam attacks -<EMAIL_ADDRESS>(Peter Hendrickson)_
  + 1997-01-04 (Fri, 3 Jan 1997 21:37:05 -0800 (PST)) - [Re: Hardening lists against spam attacks](/archive/1997/01/20b2a17040b5ab698e469f5e6f29c466c1721c414f7a775a67cd553c151511b4) - _Toto<EMAIL_ADDRESS>

gha_license_id: MIT


text:
[![Build Status](https://snap-ci.com/ashwanthkumar/finder/branch/master/build_image)](https://snap-ci.com/ashwanthkumar/finder/branch/master)

# finder
Finder is a hobby project to build a [Wayback](https://github.com/iipc/openwayback/) like system without converting our existing crawled data which are in SequenceFiles to WARC / ARC formats. Architecture is very much inspired from Wayback but with a few changes. Finder not only supports HTML but can provide key+timestamp based access to any dataset. These are very typical in the [λ Architecture](http://lambda-architecture.net/) world, where raw immutable dataset is the fundamental assumption.

## Getting Started
* Run the `SampleDatagenerator` program from your fav. IDE
* By default it would create a folder in the project structure called "example-user-data"
* Run the `FinderService` from `services` module
* Example Queries
  * [http://localhost:7070/user/search/Tanek](http://localhost:7070/user/search/Tanek)
  * [http://localhost:7070/user/get/Tanek/timestamp_from_previous_search](http://localhost:7070/user/get/Tanek/timestamp_from_previous_search)

## Dependencies
To build datasets for your models, use the following dependency on finder-core.

For Maven,
```xml
<dependency>
  <groupId>in.ashwanthkumar</groupId>
  <artifactId>finder-core_2.10</artifactId>
  <version>0.0.1</version>
</dependency>
```

For SBT,
```sbt
libraryDependencies += "in.ashwanthkumar" %% "finder-core" % "0.0.1"
```

## Finder HTTP Service
Finder comes with a simple microservice that gives you access to the dataset.
```
GET  /:dataset/search/:key  Searches for a given key in the given dataset. Key is prefix matched with the key that's used in the dataset while indexing.
GET  /:dataset/get/:key/:timestamp Returns the underlying record from the Dataset.
```

## More Info
You can define a custom Dataset like
```scala
import finder.spec.Dataset
import finder.util.JSONUtil

case class User(name: String, age: Int, timestamp: Long)

class UserDataset extends Dataset[User] {
  override def key(input: User): String = input.name
  /**
   * Timestamp of the record in UTC timezone
   */
  override def timestamp(input: User): Long = input.timestamp
  override def serialize(input: User): Array[Byte] = JSONUtil.toJson(input).getBytes
  override def deserialize(input: Array[Byte]): User = JSONUtil.readAs(classOf[User])(new String(input))
}
```

All the dataset goes with a configuration in `application.conf` like
```hocon
finder {
  datasets {
    descriptors: [{
      name: "user"
      impl: "finder.models.UserDataset"
      index {
        params {
          db-location: "user-db"
        }
      }
    }]
  }
}
```

Finder uses an Index to store and retrieve metadata information regarding every record. By default we use LevelDB backed index, but again it is pluggable. Most likely we could use something like [ElephantDB](https://github.com/nathanmarz/elephantdb) to query the index.

## TODOs
- <s>Build a HTTP service to provide access to these datasets</s>
- ElephantDB Adaptors
- Partitioned Indexes - Comes for free with ElephantDB but for local LevelDB instances we might want to build something on our own
- Versioned datasets - Each version could be a different run of the view in Batch Layer

## License
Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

repository: ashwanthkumar/finder

repo_name: ashwanthkumar/finder


text:
---
Module Name: PnP.PowerShell
schema: 2.0.0
applicable: SharePoint Online
online version: https://pnp.github.io/powershell/cmdlets/Copy-PnPItemProxy.html
external help file: PnP.PowerShell.dll-Help.xml
title: Copy-PnPItemProxy
---

# Copy-PnPItemProxy

## SYNOPSIS
Copies an item from one location to another. It is an alias of the `Copy-Item` cmdlet.

## SYNTAX

```powershell
Copy-Item
    [-Path] <String[]>
    [[-Destination] <String>]
    [-Container]
    [-Force]
    [-Filter <String>]
    [-Include <String[]>]
    [-Exclude <String[]>]
    [-Recurse]
    [-PassThru]
    [-Credential <PSCredential>]
    [-WhatIf]
    [-Confirm]
    [-FromSession <PSSession>]
    [-ToSession <PSSession>]

```

## DESCRIPTION

**This cmdlet is an alias of the `Copy-Item` cmdlet that is natively available with PowerShell**.

The `Copy-PnPItemProxy` cmdlet copies an item from one location to another location in the same namespace. For instance, it can copy a file to a folder, but it can't copy a file to a certificate drive.

This cmdlet doesn't cut or delete the items being copied. The particular items that the cmdlet can copy depend on the PowerShell provider that exposes the item. For instance, it can copy files and directories in a file system drive and registry keys and entries in the registry drive.

This cmdlet can copy and rename items in the same command. To rename an item, enter the new name in the value of the Destination parameter. To rename an item and not copy it, use the Rename-Item cmdlet.

For more information and details, please refer to the official PowerShell documentation [here](https://learn.microsoft.com/powershell/module/microsoft.powershell.management/copy-item).

## EXAMPLES

### EXAMPLE 1
```powershell
Copy-PnPItemProxy "C:\Users\Admin\seattle.master" -Destination "C:\Presentation"
```

This example copies the `seattle.master` file to the `C:\Presentation` directory. The original file isn't deleted.
For more examples, please refer to the link mentioned above.

## RELATED LINKS

[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)

repository: radityoardi/PnP-PowerShell

branch_name: refs/heads/dev

gha_license_id: NOASSERTION

repo_name: radityoardi/PnP-PowerShell


text:
====================
JOBHUNTERS
---------------------
[![Gem Version](https://badge.fury.io/rb/jobhunters.svg)](http://badge.fury.io/rb/jobhunters)
[![Build Status](https://travis-ci.org/rojotic26/jobhunters.svg?branch=master)](https://travis-ci.org/rojotic26/jobhunters)

home: [https://github.com/rojotic26/jobhunters.git](https://github.com/rojotic26/jobhunters.git)
Gem to obtain the recent job offers from Tecoloco, a job search offer website in Central America.

## Usage

This gem may be used as a command line utility to obtain information of some job offers in CA by passing a category.

## CLI

To use the Executable File:
In order to run the executable file, just include a valid category, in this example we are requesting the marketing and sales offers, so use as a parameter the "marketing-ventas" value.

	jobhunters 'marketing-ventas'

Other category examples to try are:

>informatica-internet,
>administrativo,
>call-center.

## Code Example:

	require 'jobhunters'
	jobs_found = JobSearch::Tecoloco.getjobs('marketing-ventas')
	jobs_found.each do |title, date, city|
  	puts "Job offer:#{title} in #{city} until #{date}."
	end

## More Details

This gem is based on the website: [http://www.tecoloco.com/](https://github.com/soumyaray/citesight)
A website to see job offers in Central America.

>lib/JobSearch: This class get the category of jobs you are looking for and return a hash of job offers information.
>
>bin/jobhunters: This file is our executable file.
>
>GemFile: This file is just to specified which gems we are using.

Our team-members are:

>Mauricio Jaime -<EMAIL_ADDRESS>/ Nicaragua
>
>Roger Gomez -<EMAIL_ADDRESS>/ Nicaragua
>
>Edwin Mejia -<EMAIL_ADDRESS>/ El Salvador


text:
## Motivation

When Ruby decided to reverse the order of exception backtraces, I finally gave up using the built in logging and decided restore sanity to the output of my programs once and for all\!

## Installation

Add this line to your application's Gemfile:

``` ruby
gem 'console'
```

And then execute:

    $ bundle

## Usage

As your code executes, it generates interesting events which you want to know about. The general approach is to use an `Console::Logger` which outputs text to the terminal. The text is generated by inspecting the console that occurred.

Capturing structured information allows it to be used in different ways. These events can be sent to a logger or some other system (e.g. web browser, syslog) and analysed in more detail.

### Default Logger

Generally speaking, use `Console.logger` which is suitable for logging to the user's terminal.

### Environment Variables

#### `CONSOLE_LEVEL=debug`

Control the default logger level. You can set it to any of the supported log levels: `debug`, `info`, `warn`, `error`, `fatal`.

#### `CONSOLE_DEBUG=MyClass,MyModule::MyClass`

Enable debug logging for the specified class names. You can specify one or more class names which will be resolved at runtime.

### Module Integration

``` ruby
require 'console'

# Set the log level:
Console.logger.debug!

module MyModule
	extend Console

	def self.test_logger
		logger.debug "GOTO LINE 1."
		logger.info "5 things your doctor won't tell you!"
		logger.warn "Something didn't work as expected!"
		logger.error "The matrix has two cats!"
	end

	test_logger
end
```

### Class Integration

``` ruby
require 'console'

# Set the log level:
Console.logger.debug!

class MyObject
	include Console

	def test_logger
		logger.debug "GOTO LINE 1."
		logger.info "5 things your doctor won't tell you!"
		logger.warn "Something didn't work as expected!"
		logger.error "The matrix has two cats!"
	end
end

MyObject.new.test_logger
```

### Subject Logging

The first argument to the log method is the subject.

``` ruby
class Thing
	def call
		Console.logger.info(self) {"Something is going on"}
	end
end
```

Using this approach, you can turn on and off specific subjects by using the class name:

``` ruby
$ CONSOLE_DEBUG=Thing ./script.rb
```

This will conditionally enable all log statements which have a subject of class `Thing`.

### Console Formatting

Console classes are used to wrap data which can generate structured log messages:

``` ruby
require 'console'

class MyConsole < Console::Generic
	def format(output, terminal, verbose)
		output.puts "My console text!"
	end
end

Console.logger.info("My Console", MyConsole.new)
```

#### Failure Events

`Console::Event::Failure` represents an exception and will log the message and backtrace recursively.

#### Spawn Events

`Console::Event::Spawn` represents the execution of a command, and will log the environment, arguments and options used to execute it.

### Custom Log Levels

`Console::Filter` implements support for multiple log levels.

``` ruby
require 'console'

MyLogger = Console::Filter[noise: 0, stuff: 1, broken: 2]

# verbose: true - log severity/name/pid etc.
logger = MyLogger.new(Console.logger, name: "Java", verbose: true)

logger.broken("It's so janky.")
```

### Multiple Outputs

Use `Console::Split` to log to multiple destinations.

``` ruby
require 'console/terminal'
require 'console/serialized/logger'
require 'console/logger'
require 'console/split'

terminal = Console::Terminal::Logger.new
file = Console::Serialized::Logger.new(File.open("log.json", "a"))

logger = Console::Logger.new(Console::Split[terminal, file])

logger.info "I can go everywhere!"
```

### Custom Logger Output

`Console::Logger` provides a default interface which is a drop in replacemnet for `Logger` and other similar implementations. The only method required for output is `#call(*arguments, **options, &block)`.

``` ruby
require 'console/logger'

output = proc do |*arguments, **options, &block|
	puts "arguments: #{arguments.inspect} options: #{options.inspect} block: #{block.call}"
end

logger = Console::Logger.new(output)

logger.info("Hello World!", meta: "data") {"block"}
# => arguments: ["Hello World!"] options: {:severity=>:info, :meta=>"data"} block: block
```

## Contributing

1.  Fork it
2.  Create your feature branch (`git checkout -b my-new-feature`)
3.  Commit your changes (`git commit -am 'Add some feature'`)
4.  Push to the branch (`git push origin my-new-feature`)
5.  Create new Pull Request

repository: madleech/console

repo_name: madleech/console


text:
# Py* : Python Based Modelling Module For Requirements Engineering
#### - George Mathew<EMAIL_ADDRESS>
## Abstract
In early phase of software development, mapping functional requirements are critical
since this gives a high level insight on the feasibility of the software. UML diagrams
were used initially for modelling, but UML often focuses on organisational objects,
which are not so important in the early phase, when the emphasis should be on helping
stakeholders gain better understanding of the various possibilities for using information
systems in their organizations. The i* model was proposed in 2005 to provide an early
understanding of the organizational relationships in a business domain. The Use Case
development from organizational modeling using i* allows requirement engineers to
establish a relationship between the functional requirements of the intended system
and the organizational goals. Constructing these models using the current state of the
art (OpenOME developed in 2008) is cumbersome, time consuming and makes it hard
to perform predictive analysis and optimization on the models. In this project a simple
python based module is proposed which can be easily used to create and update the
models by the business user based on his requirements. At the same time Py* also
reduces the effort of the requirements engineer to predict the outcome of the models
and optimize for its feasibility

## I - Introduction
Modeling in the early stage of system analysis is critical for understanding stakeholders, their needs, problems, and different viewpoints. Eric Yu et.al proposed the i* framework[1] to address this modeling problem. Although the i* model helps the analyst perform comprehensive analysis on requirements, constructing the models is cumbersome and representing them in a program requires a lot of manual effort from a software developer. Py* was born out this problem and is a python based modeling language to represent the i* models which can help both the analysts and the engineers.

The following report is organized as follows; Section II gives a brief background on the i* modeling language, Section III describes Py* model, Section IV highlights the setup for our experiment on optimizing a requirements engineering model, Section V shows the results for the experiment, Section VI describes the how the model can be improved and the future work.

## II - Background
The i* framework[2] proposes an agent-oriented approach to requirements engineering centering on the intentional characteristics of the agent.  Agents attribute intentional properties (such as goals, beliefs, abilities, commitments) to each other and reason about strategic relationships.  Dependencies between agents give rise to opportunities as well as vulnerabilities.  Networks of dependencies are analyzed using a qualitative reasoning approach.  Agents consider alternative configurations of dependencies to assess their strategic positioning in a social context.
The framework is used in contexts in which there are multiple parties (or autonomous units) with strategic interests which may be reinforcing or conflicting in relation to each other.  Examples of such contexts include: business process redesign, business redesign, information systems requirements engineering, analyzing the social embedding of information technology, and the design of agent-based software systems.
The framework consists of nodes and edges with **Tasks** and **Resources** representing input nodes, while **Goals** and **SoftGoals** representing output nodes. Edges are used to propogate values from one node to another. Edges are of four types
* **Dependency** : Parent depends on child. ie If the child is satisfied, then the parent is also satisfied
* **Contribution** : Quantitates softgoals. This edge can be of 4 types: **Make**, **Help**, **Hurt** and **Break**.
* **Decomposition** : Represents logical AND edges.
* **Means-Ends** : Represents logical OR edges.
*
The figure below highlights the model with an example

![I star](img/istar.png)

In the above figure "Restrict Structure of Password" and "Ask for Secret Question" are identified as unsatisfied and satisfied respectively. These values are propagated through the edges to compute the value of each node. The satisifability of each node is highlighted on it as the values are propogated.

## III - Py*
 Py* is developed in python where each node/edge is represented as a python class. The class hierachy with each base class followed by their child classes is as follows

 ```
 Component
 |.. Node
 |.. |.. Task
 |.. |.. Resource
 |.. |.. Goal
 |.. |.. Softgoal
 |.. Edge
 |.. |.. Dependency
 |.. |.. Decomposition
 |.. |.. |.. AND
 |.. |.. |.. OR
 |.. |.. Contribution
 |.. |.. |.. Make
 |.. |.. |.. Help
 |.. |.. |.. Hurt
 |.. |.. |.. Break
```

The graph is evaluated as follows:
* A node is selected at random from the graph.
* The incoming edges of the node are identified and all the child nodes are recursively evaluated.
* Two kinds of conflicts can arise while evaluating the nodes
  * The incoming edges can be conflicting. For example, one incoming edge can be **help**, while the other can be **hurt**. In such cases a random value(satisfied or unsatisfied) is assigned to the node.
  * A loop can exist. i.e While propagating through the nodes, we notice that the same node is visited again. In such cases too, a random value is assigned to the node.

![Witness SR](img/witness.png)

A sample model shown above is represented as follows

```python
from template import *

N = Many()
# Nodes
n1 = N + SoftGoal(name = "Provide accurate Information", container="Witnesses")
n2 = N + SoftGoal(name = "To know what to do", container="Witnesses")
n3 = N + Task(name = "Follow instructions from firemen", container="Witnesses")
n4 = N + Task(name = "Provide crisis related info", container="Witnesses")
n5 = N + Task(name = "Provide to fireman", container="Witnesses")
n6 = N + Task(name = "Provide info to police", container="Witnesses")
n7 = N + HardGoal(name = "Receive instructions", container="Witnesses")
n8 = N + Resource(name = "Crisis-related information", container="Fire")
n9 = N + Resource(name = "Instructions", container="Fire")
n10 = N + Resource(name = "Instructions", container="Police")
n11 = N + Task(name = "Crisis-related information", container="Police")

E = Many()
#Edges
e1 = E + SomePlus(source = n7,target = n2)
e2 = E + Or(source = n7,target = n3)
e3 = E + And(source = n5,target = n4)
e4 = E + And(source = n6,target = n4)
e5 = E + Dep(source = n5,target = n8)
e6 = E + Dep(source = n9,target = n7)
e7 = E + Dep(source = n10,target = n7)
e8 = E + Dep(source = n6,target = n11)

graph = Graph(name="bCMS_SR_Witness", nodes=N.all, edges=E.all)
```

## IV - Experimental Setup

We perform Differential Evolution[3] on a Counselling Services model[4] which contains 263 nodes and 484 edges. The objective of the experiment is to maximize the number of softgoals satisfied, maximize the number of goals satisfied and minimize the total cost of choosing the decisions.
The rig is designed as follows:
* Each input node(Task or Resource) is assigned a random value between 1 and 5.
* Nodes are visited within the graph at random and evaluated.
* Once all nodes are evaluated, each objective is computed.
* Settings of Differential Evolution is as follows

|     Setting     |                                       Value                                      |
|:---------------:|:--------------------------------------------------------------------------------:|
|   Generations   |                                        100                                       |
|    Canditates   |                            10 * (number of decisions)                            |
|  Crossover Rate |                                        0.3                                       |
| Mutation Factor |                                       0.75                                       |
|    Objectives   | Number of Softgoals - Max
 Number of Goals - Max
 Total Cost of Decisions - Min
|
|   Random Seed   |                                         1                                        |

## V - Results
The generational ranking of the perecentage of satisfiability of softgoals is shown in the table below

```
rank ,      name ,     med   ,   iqr
----------------------------------------------------
   1 ,      gen0 ,    54.84  ,   9.14 (   -------  *  |--            ),43.01, 51.08, 54.84, 57.53, 61.83
   2 ,     gen20 ,    59.68  ,   6.99 (           --- | *----        ),53.23, 56.99, 60.22, 62.37, 67.74
   2 ,     gen40 ,    60.22  ,   6.99 (            ---| * -----      ),54.84, 58.06, 60.75, 63.44, 69.89
   2 ,     gen60 ,    61.29  ,   7.52 (            ---| *  -----     ),54.84, 58.06, 61.29, 64.52, 71.51
   3 ,     gen80 ,    62.37  ,   7.53 (              -|  *  -----    ),56.99, 59.68, 62.37, 65.59, 72.58
   3 ,    gen100 ,     62.9  ,   6.99 (               |-  * -----    ),57.53, 60.22, 63.44, 65.59, 72.58
```
The table ranks the median and Inter-Quartile Range(IQR) of generations 0-100 at intervals of 20 generations using Scott-Knott technique suggested by Mittas & Angelis[5]. To rank the generations, A12 statistical test[6] along with bootstrap sampling was used.
Column 1 represents the rank of the generation, Column 2 represents the name of the generation, Columns 3 and 4 represent the median and IQR of the percentage of softgoals satisfied, Column 5 represents the quartile chart. "__*__" represents the median value, the blank spaces between __-__ and __*__ represents the 25th to 75th percentile and __-__ represents the 10th to 25th percentile and 75th to 90th percentile. Columns 6 through 10 represents values at 10%, 30%, 50%, 70% and 90% respectively.

The table below represents the generational ranking of the percentage of satisfiability of goals
```
rank ,      name ,    med   ,   iqr
----------------------------------------------------
   1 ,      gen0 ,    69.57  ,  30.43 (--           * |  -------     ),43.48, 47.83, 69.57, 78.26, 91.30
   2 ,     gen20 ,    78.26  ,  13.04 (-------------  |  * -----     ),43.48, 69.57, 78.26, 82.61, 91.30
   2 ,     gen40 ,    78.26  ,  13.04 (      ---------|  * -----     ),56.52, 73.91, 78.26, 82.61, 91.30
   2 ,     gen60 ,    78.26  ,    8.7 (      ---------|  * -----     ),56.52, 73.91, 78.26, 82.61, 91.30
   2 ,     gen80 ,    78.26  ,  13.05 (             --|  * -------   ),69.57, 73.91, 78.26, 82.61, 95.65
   2 ,    gen100 ,    78.26  ,  13.05 (             --|  * -------   ),69.57, 73.91, 78.26, 82.61, 95.65
```

The table below represents the generational ranking of the costs of making the decisions
```
rank ,        name ,    med   ,   iqr
----------------------------------------------------
   1 ,      gen100 ,     64.0  ,   13.0 (    ----  * ---|              ),53.00, 60.00, 64.00, 69.00, 77.00
   1 ,       gen80 ,     65.0  ,   11.0 (     ----  * --|              ),54.00, 62.00, 66.00, 70.00, 77.00
   1 ,       gen60 ,     66.0  ,   10.0 (      ---  * --|---           ),56.00, 63.00, 66.00, 71.00, 82.00
   2 ,       gen40 ,     68.0  ,   12.0 (      ----  *  |----          ),56.00, 64.00, 68.00, 75.00, 84.00
   2 ,       gen20 ,     69.0  ,   14.0 (      ----   * |-----         ),56.00, 64.00, 70.00, 75.00, 86.00
   2 ,        gen0 ,     75.0  ,   14.0 (       ----    * -----        ),59.00, 66.00, 75.00, 79.00, 88.00
```

As we can see, as the number of generations increases, the percentage of softgoals increases. The percentage of goals satisfied plateaus after 20 generations while the cost required to make the decisions reduces as the number of generations increases. Thus we can see that Differential Evolution can be seen to optimize the Requirement Engineering model

## VI - Future Work
The modeling language can be extended to handle
* Extend model to support Agents and Actors
* Support for other optimizers like NSGA2, IBEA etc
* Model evaluation can be expensive hence optimization should be parallelized.

## Repository
The repository for the code can be found here https://goo.gl/EMjl3q

## Acknowledgements
This report is part of CSC-791 Automated Software Engineering. I would like to express my gratitude towards the instructor Dr Tim Menzes and the Teaching Assisant Rahul Krishna for the their support in pursuing this project. Additionally, I would like to thank the instructor for allowing me to use his script for scott-knott test.

## References
[1] Yu, E. Towards Modelling and Reasoning Support for Early-Phase Requirements Engineering. Proceedings of the 3rd IEEE Int. Symp. on Requirements Engineering (RE'97) Jan. 6-8, 1997, Washington D.C., USA. pp. 226-235.

[2] _i*_, URL: http://www.cs.toronto.edu/km/istar/

[3] R. Storn, and K. Price, "Differential Evolution: A Simple and Efficient Heuristic for Global Optimization Over Continuous Spaces", in Journal of Global Optimization, vol. 11, no. 4, pages 341-359, December, 1997

[4] CS Counselling Service, URL: http://tiny.cc/cs_services

[5] Nikolaos Mittas and Lefteris Angelis.  Ranking and clustering softwarecost estimation models through a multiple comparisons algorithm.IEEETrans. Software Eng., 39(4):537–551, 2013.

[6] Andras Vargha and Harold D. Delaney, "A Critique and Improvement of the CL Common Language Effect Size Statistics of McGraw and Wong", in Journal of Educational and Behavioural Statistics, vol 25, no. 2, pages 101-132, June 2000


text:
---
layout: post
title: "Hope Springs Disappointment"
excerpt: "Pop Culture"
categories: popculture
comments: false
share: true
---

![](http://pds26.egloos.com/pds/201508/23/00/c0054500_55d9245b73af2.jpg)

A few weeks ago, all over social media was this trailer for a new Star Wars video game:

[Click here if you want to see it:](https://www.youtube.com/watch?v=R51LMIAJtsc)

It is a very good teaser for this addition to the Star Wars universe, but what caught my eye was this:

**'The Old Republic'**

Remember that game, 'Knights of the Old Republic'? It was made about 10 years ago and recounted old tales of the Jedi vs Sith set about 4,000 pre New Hope. It was such a great game (mainly due to the awesome storyline that was introduced), not only was the a sequel made, but some of the characters front he game were integrated into the Expanded Universe books, or as I like to call it 'fan fiction for profit'.

Anyway, the sequel of 'Knights of the Old Republic' left us all at a cliffhanger. With a promise of a third installment, that didn't seem so out-of-bonds at the time.

But NO!! There was no third game. There was no completion to the tale of Darth Revan. Nope.

What those bastards did was created an online multi-player universe that has no story line. Yes, you had to pay an monthly fee. And the worst.......you had to play with other people.

Now I am an old man playing a video game, but I still have some self-respect.  I just want to play a game on my own with a good story line and not get a tongue-lashing from a pre-pubescent spazz who I would love to throw through the wall if it was legally and socially acceptable.

So guess what? I didn't play that Star Wars game. And apparently no one else did either. It died out in about 4 months.

So is there any completion to the tales of the Old Republic? IS someone going to pick up the rights to this wildly popular game and do us right?

Well, we waited. We waited and waited and waited.

And finally........................................

We wait longer because this new game has nothing to do with the previous storyline.

gha_language: JavaScript


text:
# Bloom

### Author
* Robert Allison - http://github.com/rob-allison

### Proposal
By using a kind of binary DNA (bDNA) I can treat colour as the expression of a process. Previous experimentation can be found [here](http://www.robertallison.co.uk "Robert Allison").

I propose to create digital flowers, 'grown' from bDNA. There would be a population of such flowers. Visitors would be able to select flowers to breed together and the resulting offspring would be added to the population. Flowers would have a lifespan, and would 'die' after a certain time. During the course of the exhibition the nature of the flower population will shift and change as a result of this visitor directed 'pollination'.

The proposal will explore:
* growth - how a simple genetic sequence is translated into a complex structure.
* breeding - how two sequences combine to produce a third that expresses characteristics from its parents.
* selection - how a population as a whole evolves under a selection pressure.

I hope to draw a parallel between DNA and source code, and to show how something almost natural can emerge from the purely computational when sufficiently complex.

This imagery is built up of over-sized pixels or blocks of colour, there is no anti-aliasing or similar attempt to mimic the analogue. Its essential discrete, *pixelated,* nature is celebrated, not hidden.

### Growth

Three strands of bDNA, or chromosomes, are used to define each flower - one for the outer colour, one the inner, and one to control the transition between inner and outer as the flower grows. The chromosomes are shown as vertical strips with black=1 and white=0:

![Growth](project_images/flowergrow4.png?raw=true "Growth")

https://www.youtube.com/watch?v=TEU08z6RXc4

The bDNA is translated one 4 bit codon at a time, each codon coding for a digital 'acid' - the acids are then joined to make a digital 'protein' - the properties of the proteins determine the colours and growth parameters.

```
class Dna extends ListBase<bool> {

  final BitList sequence;

  // iterate codon by codon, building acids and appending to proteins
  List<Protein> decode() {
    List<Protein> proteins = new List();
    int i = 0;
    Protein p = new Protein();
    CodonIterator iter = codonIterator;
    while (iter.moveNext()) {
      p.acids[i] = iter.current.decode();
      i++;
      if (i == Protein.length) {
        proteins.add(p);
        i = 0;
        p = new Protein();
      }
    }
    return proteins;
  }

  // returns an iterator that treats the bDNA as a sequence of 4-bit codons
  Iterator<Codon> get codonIterator {
    return new CodonIterator(this);
  }
  ...
}
```
### Breeding

By interchanging fragments of bDNA between two flowers, offspring may share traits from their parents:

![Breeding](project_images/breed6.png?raw=true "Breeding")

```
List<Dna> breed(Random rng, List<Dna> a, List<Dna> b) {

  // interchange 40% from a, 40% from b, 20% from both
  List<Dna> result = new List(a.length);
  for (int i = 0; i < a.length; i++) {
    int x = rng.nextInt(100);
    if (x < 40) {
      result[i] = a[i];
    } else if (x < 80) {
      result[i] = b[i];
    } else {
      result[i] = intermingle(rng, a[i], b[i]);
    }
  }

  // mutate 10% of the time
  if (rng.nextInt(100) < 10) {
    int i = rng.nextInt(result.length);
    result[i] = mutate(rng, result[i]);
  }

  // swap 10% of the time
  if (rng.nextInt(100) < 10) {
    int i = rng.nextInt(result.length);
    int j = rng.nextInt(result.length);
    Dna x = result[i];
    result[i] = result[j];
    result[j] = x;
  }

  return result;
}
```

### Simulation

This animation simulates a population of flowers, pollinated at random:

http://youtu.be/B_uH1Exdfhw

A Dart cmd line app is also provided at https://github.com/rob-allison/devart-template/blob/master/project_code/bloom/bin/cmdlinepop.dart - pass a directory as a cmd line arg and the app will interactively populate it, allowing you to choose which flowers to breed.

### User Interface

The simplest UI would have the population projected onto a screen, with tablets allowing visitors to make their selections. However, a more ambitious approach would use pedestals - 'flower pots' - laid out in the gallery. The top of the pedestal would display the flower as it grows, whilst its sides would show the bDNA.

Each visitor would be given an RFID card that they tap against two chosen parent flowers, before tapping on one (or more!) empty pots to grow the child flowers. The history of the population could be projected onto screens:

![Population](project_images/froom5.png?raw=true "Population")

Visitors become 'worker bees', pollinating this population of flowers as it grows and evolves.

repository: rob-allison/devart-template

repo_name: rob-allison/devart-template


text:
# Academic_ArtificialIntelligence

AI algorithms implemented in C++.

Code developed for academic purposes in 2017.

Main code structure (and graphic interfaces) provided by Félix Miguel Trespaderne (professor at Universidad de Valladolid).

## Compilation

Projects can be compiled using build scripts (`.compile.sh` ) or VisualStudio.

Some of them require SFML and TGUI libraries.

VS settings expect them to be located at `C:/External/sfml` and `C:/External/tgui`.

Compiled versions of them (for VS2017) can be found at:

* [SFML-2.5.1](https://github.com/eduherminio/SFML)
* [TGUI-0.8](https://github.com/eduherminio/TGUI)


text:
# dlc

Frre, open-source, self-hosted content distribution service.

Next.js based downloadable contents (DLC) distribution service.

## Usage

1.  Put your goodies on `/contents` directory.
2.  Create an app with `heroku create` and setup code and files via `heroku config`.

```
heroku create
heroku config:set DLC_CODE=SecretDownloadCode DLC_FILENAME=goodies.zip
```

3.  Deploy your app with `git push`.

```
git add .
git commit -m 'dlc'
git push heroku master
```

Now you can download the content with code `SecretDownloadCode`:

```
curl -O http://<heroku-app-url>/download?code=SecretDownloadCode
```

## Development

```
yarn install
yarn run dev
```

repository: uetchy/dlc

repo_name: uetchy/dlc


text:
Starlette applications can register a lifespan handler for dealing with
code that needs to run before the application starts up, or when the application
is shutting down.

```python
import contextlib

from starlette.applications import Starlette

@contextlib.asynccontextmanager
async def lifespan(app):
    async with some_async_resource():
        print("Run at startup!")
        yield
        print("Run on shutdown!")

routes = [
    ...
]

app = Starlette(routes=routes, lifespan=lifespan)
```

Starlette will not start serving any incoming requests until the lifespan has been run.

The lifespan teardown will run once all connections have been closed, and
any in-process background tasks have completed.

Consider using [`anyio.create_task_group()`](https://anyio.readthedocs.io/en/stable/tasks.html)
for managing asynchronous tasks.

## Lifespan State

The lifespan has the concept of `state`, which is a dictionary that
can be used to share the objects between the lifespan, and the requests.

```python
import contextlib
from typing import TypedDict

import httpx
from starlette.applications import Starlette
from starlette.requests import Request
from starlette.responses import PlainTextResponse
from starlette.routing import Route

class State(TypedDict):
    http_client: httpx.AsyncClient

@contextlib.asynccontextmanager
async def lifespan(app: Starlette) -> typing.AsyncIterator[State]:
    async with httpx.AsyncClient() as client:
        yield {"http_client": client}

async def homepage(request: Request) -> PlainTextResponse:
    client = request.state.http_client
    response = await client.get("https://www.example.com")
    return PlainTextResponse(response.text)

app = Starlette(
    lifespan=lifespan,
    routes=[Route("/", homepage)]
)
```

The `state` received on the requests is a **shallow** copy of the state received on the
lifespan handler.

## Running lifespan in tests

You should use `TestClient` as a context manager, to ensure that the lifespan is called.

```python
from example import app
from starlette.testclient import TestClient

def test_homepage():
    with TestClient(app) as client:
        # Application's lifespan is called on entering the block.
        response = client.get("/")
        assert response.status_code == 200

    # And the lifespan's teardown is run when exiting the block.
```

repository: encode/starlette

gha_language: Python

repo_name: encode/starlette


text:
# Styrax platanifolius subsp. texanus (Cory) P.W. Fritsch SUBSPECIES

#### Status
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Ann. Missouri Bot. Gard. 84:744. 1997

#### Original name
Styrax texanus Cory

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# module for hash-like objects

My problem was that I wanted to create classes with the same interface as Ruby core hashes. What I don't wanted was to implement each method of Ruby `Hash` each time when I needed somelike this. So I wrote this Ruby module with only one method I have to keep an eye on to implement hash-like classes.

 But now we only have a class that behaves like a hash without being an instance of `Hash` - not really useful. Let's build a translation class!
```ruby
class GermanTranslation
  include Enumerable
  include Hashlike

  def initialize(orig)
    @english = orig
    @german = translate(orig)
  end

  def orig
    @english
  end

  # this is the most important method
  # because all other methods are implemented via this method
  def to_h
    @german
  end

  def [](key)
    key_en = translate_to_en(key)
    super(key) if key_en
  end

  def []=(key, value)
    key_en = translate_to_en(key)

    if key_en
      orig[key_en] = value
      super(key, value)
    end
  end

  private

  def translate(hash)
    hash.reduce({}) do |memo, (key, value)|
      key = translate_to_de(key)
      memo[key] = value if key
      memo
    end
  end

  def translate_to_de(key)
    case key
    when :first_name then :vorname
    when :last_name then :nachname
    when :age then :alter
    end
  end

  def translate_to_en(key)
    case key
    when :vorname then :first_name
    when :nachname then :last_name
    when :alter then :age
    end
  end
end

en = { first_name: "Zepartzat", last_name: "Gozinto", age: 42 }
de = GermanTranslation.new(en)

de[:vorname] # => "Zepartzat"
de.to_h # => { vorname: "Zepartzat", nachname: "Gozinto", alter: 42 }

de[:vorname] = "Foobarz"
de.to_h # => { vorname: "Foobarz", nachname: "Gozinto", alter: 42 }
de.orig # => { first_name: "Foobarz", last_name: "Gozinto", age: 42 }
```
## Interface
There are only some method that are important to override (if neccessary):
* `#delete(key)` : deletes the value with the key `key`
* `#[](key)` : returns the value associated to the key `key` (or nil if not defined)
* `#[]=(key, value)` : defines `value` to the key `key`
* `#key?(key)` : returns `true` if key `key` is defined, else `false`
* `#value?(value)` : returns `true` if any key-value-pair exists with a defined value like `value`, else `false`
* `#to_h` : returns all current key-value-pairs as a `Hash`

Everything else should not be overriden. You don't need it. Consider them as `final` (as in Java). The six methods above are the interface methods you have to implement.

repository: MeiKatz/ruby-hashlike

repo_name: MeiKatz/ruby-hashlike


text:
# Concepts

Servant is a next-gen web framework that is built on ASP.Net 5 with these core values in mind:

1. Security
2. Performance
3. Maintainability
4. and Convention based Configuration for fast-paced development

Each of the sections below will discuss one of these core values in detail.

## Security

Ever heard of sites being hacked (or "pwnd" as the _cool_ kids say)? Nowadays, the ability of attackers to gain unauthorized to websites is at an all time high. Vulnerabilities like [SQL Injection](https://www.owasp.org/index.php/SQL_Injection), [Cross-Site Scripting (XSS)](https://www.owasp.org/index.php/Cross-site_Scripting_(XSS)), and [Cross-Site Request Forgery](https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)) or [Insecure Authentication and Session Mechanisms](https://www.owasp.org/index.php/Top_10_2013-A2-Broken_Authentication_and_Session_Management) provide backdoors to the data that you are entrusted to protect.

Servant focuses on providing you with the tools required to make a secure website without obscene amounts of work. Most of these security features will be built into the Servant libraries, making them easy to take advantage of, but some others will be optional, but highly encouraged.

## Performance

Servant is a .Net library. Simply put, a compiled language should be fast, much faster than you could ever get with an interpreted language.

Servant takes this a step further by intentionally doing the least amount of work required for a task. On top of that, Servant encourages you to write performant code by providing performance-central libraries for you to use in your application code.

## Maintainability

They say that in the long run software maintenance costs more than development. This is certainly true in the case of large enterprise-level systems like Google, Amazon, Facebook, Github, etc.

Servant makes maintaining your application easy by providing you with an extensible framework that is composed of simple interchangeable components. Don't like the router? Swap it out for another. Don't like the view renderer? Get rid of it. Want extra features? Extend the current implementations.

## Convention based Configuration

In a lot of new application frameworks, there's this concept of "Convention _over_ configuration". Which essentially means that the framework developer picks the right configuration for you and builds it into the framework. This either makes the framework unable to cope with specific configuration requirements or more difficult due to the documentation around configuration being scarce.

Servant gives you sane configuration defaults if you just want to get going quickly, but also gives you a rich, easy-to-use API for configuring the framework to fit your needs.

This feature is especially important for migrating an existing system to Servant. If you need to keep behavior that was critical to the existing system, it is easy to get Servant to comply. Also, because Servant is built on OWIN, it is easy to relegate Servant to a certain portion of your application, allowing you to keep the old system while working on a new system.

## Is Servant just another MVC Framework?

Considering how popular MVC frameworks are now, that is not a bad question. I would say no, Servant is not a MVC framework, and here's why:

> MVC wasn't designed with web frameworks in mind.

MVC, while a nice, usable pattern, was simply not designed with certain web concepts in mind such as the request-response cycle, routing, and API versioning. As such, frameworks that use the MVC pattern generally suffer from having a less optimized system for handling problems like resource based routing, API discovery, input validation, and most importantly, a security first mindset.

repository: KallynGowdy/Servant

repo_name: KallynGowdy/Servant


text:
# JekyllPlus

[![Gem Version](https://img.shields.io/gem/v/jekyll-plus.svg)](https://rubygems.org/gems/jekyll-plus)
[![Build Status](https://img.shields.io/travis/ashmaroli/jekyll-plus/master.svg?label=Build%20Status)][travis]

[travis]: https://travis-ci.org/ashmaroli/jekyll-plus

JekyllPlus is now a tool that simplifies the installation and usage of a Jekyll Site linked to a gem-based Jekyll Theme.
*Disclaimer: This plugin works best with gem-based themes that are [serve-ready packages](#gem-recommendation).*

## Installation

Simply run:

    $ gem install jekyll-plus

## Usage

This gem installs an executable `jekyll+` that takes a couple of new commands to enrich the Jekyll experience.

**Note:** Along with the following commands, all existing Jekyll Commands are available to be used with the executable.

The new additions are :

### `new-site`

```
jekyll+ new-site -- Creates a custom Jekyll site scaffold in PATH

Usage:

  jekyll+ new-site PATH

Options:
          --classic          Classic Jekyll scaffolding
          --theme GEM-NAME   Scaffold with a custom gem-based theme
          --force            Force creation even if PATH already exists
          --verbose          Output messages while creating

```

#### Overview

`jekyll+ new-site` is very much like `jekyll new` in that it generates a static-site precursor to be processed into an HTML website. But its also very different in the sense that `new-site` **deviates from Jekyll's no-magic philosophy**

A default site generated by `new-site` will have the site's `title` configured based on the `PATH` argument supplied.

```sh

$ jekyll+ new-site my blog
# => New jekyll site (titled) My Blog installed in ~/my blog.

```

```sh

$ jekyll+ new-site blogs/summer rain
# => New jekyll site (titled) Summer Rain installed in ~/blogs/summer rain.

```
If the user has Git installed and configured on their system, another set of keys are automatically defined — `name:` and `email:`, both of which will now be populated with the corresponding Git credentials.

This auto-populate feature extends to sites generated with `--classic` and `--theme` switches **if the theme-gem doesn't bundle a `_config.yml` within it**.

--

The `--theme` switch is for those who have decided what **theme-gem** to use with their site.

Simply provide the theme's `gem-name`.

  e.g. To install a site with the **gem-based version** of the popular theme [Minimal Mistakes](https://github.com/mmistakes/minimal-mistakes), (`minimal-mistakes-jekyll`), simply run

    $ jekyll+ new-site awesome blog --theme minimal-mistakes-jekyll

If you have an older version of the theme-gem already installed on your system, then though a new site will be immediately installed at `./awesome blog`, with the `_config.yml` and `Gemfile` already set to use this theme, the downside is that you'll still have to manually download the Minimal-Mistakes-config-file from the theme repo to be *serve-ready*

But if you have installed the [**serve-ready**](#gem-recommendation) version of the theme-gem, then by simply running the command stated above, the new site installed at `./awesome blog` will have the minimum required elements to let you serve and preview the site immediately — a Minimal-Mistakes-config-file that has all the settings for your site and the associated template files.

The data files need not be copied over to the `source` unless they need to be customized. Data files within the theme-gem will be read like the remaining template files via the built-in [`jekyll-data`](https://github.com/ashmaroli/jekyll-data) plugin.

If you dont have any version of the theme installed, then `new-site` will automatically run `bundle install` and install the latest version available if you're connected to the internet.

--

When the `--classic` switch is used, the generated site will contain all the directories expected in a Jekyll installation prior to Jekyll v3.2

The `--classic` and `--theme` switch can be used together to install a classic-style site with the template files and directories extracted to your `source` from the theme-gem.

#### Key Points:

  * `new-site` when passed without the `--classic` or the `--theme` switch doesn't run `bundle install` at the end.

  * if either `--classic` or `--theme` is used, JekyllPlus will first check if the theme-gem (defaults to "minima") is installed in the system. If not found, then it'll initiate `bundle install` to install the theme-gem.

  * the `--classic` switch will run the `extract-theme` command (described below) and copy the theme's template directories and files to the site's default `source` directory. Additionally, if the theme-gem has included a `_config.yml` within it, it will be copied over too, **replacing the one currently present at `source`.**

  * the `--theme` switch will initialize a `Gemfile` and a `_config.yml` with the provided `GEM-NAME`. Additionally, this too will **replace the `_config.yml` at `source` if a namesake is present at the root of the theme-gem.**

--

### `extract-theme`

```
jekyll+ extract-theme -- Extract files and directories from theme-gem to source

Alias: extract

Usage:

  jekyll+ extract-theme [DIR (or) FILE-PATH]
  jekyll+ extract [DIR (or) FILE-PATH]

Options:
          --force     Force extraction even if file already exists
          --list      List the contents of the specified [DIR]
          --lax       Continue extraction process if a file doesn't exist
          --quiet     Swallow info messages while extracting
          --verbose   Additional info messages while extracting

```
`extract-theme` or `extract` does just one thing — ***copy** files or entire directories from the configured theme-gem to the site's `source` directory.* You can *extract* any combination of files and directories *within the theme-gem* as long as you know their path, relative to the theme-gem.

**Example scenario: — Extracting the theme's layouts**

  * Lets first inspect the contents of the `_layouts` directory.

  ```sh
  $ bundle exec jekyll+ extract-theme _layouts --list
  # =>
      Listing: Contents of '/_layouts' in theme gem...

             * /_layouts/default.html
             * /_layouts/home.html
             * /_layouts/page.html
             * /_layouts/post.html
               ..done
  ```

  * Now I know what layouts are available. To *extract* the entire `_layouts` directory

  ```sh
  bundle exec jekyll+ extract-theme _layouts
  ```

  * Or, to simply *extract* the layouts for posts and pages:

  ```sh
  bundle exec jekyll+ extract-theme _layouts/page.html _layouts/post.html
  ```

  * To *extract* whatever is available under the `assets` directory and the `post.html` layout:

  ```sh
  bundle exec jekyll+ extract-theme assets _layouts/post.html
  ```

  * Any file within the theme-gem can be *extracted* to `source`.

  ```sh
  bundle exec jekyll+ extract-theme read-me.html
  ```

## Gem Recommendation

The only functional difference between `jekyll new` and **`jekyll+ new-site`** is that the latter's `--theme` and `--classic` switches revolve around a jekyll theme-gem (either the default theme-gem "minima" or the string passed to `--theme`.)

The following are a set of recommendations directed at theme-gem developers to make their themes **serve-ready**:

  * **Serve-ready theme-gems contain all the minimum elements that are required to let the consumer easily preview their site by simply running `bundle exec jekyll+ serve`**

  * If your theme is dependent on a custom **`_config.yml`** that declares necessary plugins and other settings, then please don't hesitate from bundling that file within your theme-gem. `jekyll+ new-site` will then automatically **replace** the **`_config.yml`** at `source` with your bundled file. **You just need to make sure that the `theme` key is properly defined.**

  * If your theme-gem requires a set of data files that impart locale-configuration (they seldom require customization), bundle them into the gem. They will be *read-in* via the included [`jekyll-data`](https://github.com/ashmaroli/jekyll-data) plugin if the user decides to `build` their site locally using `jekyll+ build` or `jekyll+ serve`.

  * If your theme-gem requires certain *customizable* `data files` to exist at `source`, again, pack in the `_data` directory. It can be easily sent to your user's `source` by having them simply run `jekyll+ extract-theme _data` or `jekyll+ extract _data`. Your theme's documentation may need to instruct the user to use that command.

  * Except for `index.html`, files generated by `jekyll+ new-site` do not have the `layout:` key hard-coded in the FrontMatter and hence one can easily bootstrap a site with a theme-gem provided that the theme-gem's `_config.yml` has the **Front Matter Defaults** defined, for example:

  ```yaml
  defaults:
    - scope:
        path: ""
        type: posts
      values:
        layout: post
    - scope:
        path: ""
        type: pages
      values:
        layout: page
  ```

  * `index.html` will take on the values defined for `pages` and hence the `layout` is set to `home` by default.

## Plugins & Patches

  * Includes the [`jekyll-data`](https://github.com/ashmaroli/jekyll-data) plugin that enables reading of data files and `_config.yml` within the theme-gem.
  * Includes patches to various modules and classes used by `Jekyll` adapted from certain existing pull-requests at their respective repos and will be altered / removed as required in future releases.
  For details, please [refer this file](https://github.com/ashmaroli/jekyll-plus/blob/master/lib/jekyll-plus.rb#L9-L28).

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/ashmaroli/jekyll-plus.

This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

repository: ashmaroli/jekyll-plus

gha_language: Ruby

repo_name: ashmaroli/jekyll-plus


text:
# TYDSP
Real-time audio for Gamemaker : studio by PISSENWYY

![WOWW](https://imgur.com/Cn8suhK.png)

----

# What's this?

TYDSP is DSP / realtime audio.

You can pend / shove intergers into your audio device using gamemaker's audio buffer functions!

# Quick references

```tydsp_init( RATE, VOLUME )``` - Initializes the TYDSP system with desired rate and volume.

```tydsp_pend( INT )``` - Shoves / pends the integer into audio queue.

```tydsp_update()``` - Updates the TYDSP system.

```tydsp_change_rate( RATE )``` - Changes the TYDSP system's desired sample rate.

```tydsp_reset()``` - Re-sets the TYDSP system.

```tydsp_feedroom()``` - Put this into AUDIO PLAYBACK (async) event. (for telling the system that one buffer has ended playing)

```tydsp_end()``` - Execute this when TYDSP is no more needed, for preventing memory leaks.

```tydsp_setvolume( VOLUME, TIME )``` - basically audio_sound_gain for TYDSP.

license: Unlicense


text:
# Screen Recorder

Simple screen recorder app made with [electronjs](https://electronjs.org).

## Setup and run

Install dependencies:

```sh
npm install
```

Run start script:

```sh
npm start
```

repository: thesosa/screen-recorder

repo_name: thesosa/screen-recorder


text:
# Important about docker
Tested with `docker-compose version 1.27.1, build 509cfb99; Docker version 19.03.12, build 48a66213fe`

## Installation
Docker Compose uses environment variables to create the database and bind the services, therefore it's important to create the **.env** file before running any docker commands.

1. Create .env file in this dir to hold environment variables. See .env.example for required variables.
1. Link or copy the whised *docker-compose* depending on your enviroment
   * **When running on server:** Use the *docker-compose-prod.yml* to generate ssl certs and expose the service to a domain. This can be done with `ln -s docker-compose-prod.yml docker-compose.yml` in UN\*X.
   * **When running on locally with localhost:** Use the *docker-compose-dev.yml* to set up the service with ports mapped to `localhost`. Payara, PostgreSQL will work, Traefik will not be invoked.
3. Set the required enviroment variables for the JavaEE Application (*"the server"*) by creating `src/main/resources/META-INF/microprofile-config.properties`. A template is available named `src/main/resources/META-INF/microprofile-config.properties.default`.

## Operation
* **Build & run detached :** `COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose up -d --build`
* **Run detached :** `docker-compose up -d`
* **Follow detached logs:** `docker-compose logs -f`

### Dropping the database
1. **Stop:** `docker-compose down`
1. **Delete volume:** `docker volume rm mobapp4_database-data`

branch_name: refs/heads/main


text:
[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)
# StarCraft II replay analyzer

## Description
 This application analyzes replays and parses the information to a file.
## Table of contents
1. [Installation](#installation)
2. [Usage](#usage)
3. [License](#license)
4. [Contributing members](#contributing)
5. [Tests](#tests)
6. [Questions](#questions)

### Installation:
 Clone the repo and run 'npm i' in the main directory
### Usage:
 Run 'node index.js' in the main directory
### License:
 This application is covered under the "Mozilla Public License 2.0" license.
### Contributing members:
 Robert Jarrell
### Tests:
 N/A
### Questions:
If you have any questions or concerns, my github is [jarrellrn](https://github.com/jarrellrn). Or, you can email me at jarrellrn@gmail.com.

license: ISC


text:
[kakao](../../index.md) / [com.agoda.kakao.screen](../index.md) / [Screen](./index.md)

# Screen

`open class Screen<out T : `[`Screen`](./index.md)`<`[`T`](index.md#T)`>> : `[`ScreenActions`](../-screen-actions/index.md)

Container class for UI elements.

This class groups UI elements and grants access to basic actions,
such as tapBack() and closeSoftKeyboard()

### Parameters

`T` - type of your screen, done to enable invoke() for its children

**See Also**

[ScreenActions](../-screen-actions/index.md)

### Constructors

| Name | Summary |
|---|---|
| [<init>](-init-.md) | `Screen()`
Container class for UI elements. |

### Properties

| Name | Summary |
|---|---|
| [rootView](root-view.md) | `open var rootView: `[`KBaseView`](../../com.agoda.kakao.common.views/-k-base-view/index.md)`<*>?`
The visibility of rootView will be checked when entering the screen |
| [view](view.md) | `open val view: `[`ViewInteractionDelegate`](../../com.agoda.kakao.delegate/-view-interaction-delegate/index.md)
ViewInteractionDelegate on which all actions are performed (root view by default) |

### Functions

| Name | Summary |
|---|---|
| [intercept](intercept.md) | `fun intercept(configurator: `[`Interceptor.Configurator`](../../com.agoda.kakao.intercept/-interceptor/-configurator/index.md)`.() -> `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
Sets the interceptors for the screen. Interceptors will be invoked on all interactions while the screen is active. |
| [invoke](invoke.md) | `operator fun invoke(function: `[`T`](index.md#T)`.() -> `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
Operator that allows usage of DSL style |
| [reset](reset.md) | `fun reset(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
Removes the interceptors from the screen. |

### Inherited Functions

| Name | Summary |
|---|---|
| [closeSoftKeyboard](../-screen-actions/close-soft-keyboard.md) | `open fun closeSoftKeyboard(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
Closes soft keyboard, if opened |
| [pressBack](../-screen-actions/press-back.md) | `open fun pressBack(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
Performs click on device's back button |
| [pressKey](../-screen-actions/press-key.md) | `open fun pressKey(keyCode: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
Presses a key with corresponding KeyCode`open fun pressKey(key: EspressoKey): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
Presses a key with correspondingKeyCode and modifiers |
| [pressMenuKey](../-screen-actions/press-menu-key.md) | `open fun pressMenuKey(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
Presses the hardware menu key |

### Companion Object Functions

| Name | Summary |
|---|---|
| [idle](idle.md) | `fun idle(duration: `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` = 1000L): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
Idles for given amount of time |
| [onScreen](on-screen.md) | `fun <T : `[`Screen`](./index.md)`<`[`T`](on-screen.md#T)`>> onScreen(function: `[`T`](on-screen.md#T)`.() -> `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)`): `[`T`](on-screen.md#T)
Initializes instance of the screen class provided and invokes given tail lambda on it. |