text:
# Methods

Any public methods annotated with the [[Coalesce]](/modeling/model-components/attributes/coalesce.md) attribute that are placed on your model classes will have API endpoints and Typescript generated by Coalesce. Both instance methods and static methods are supported. Additionally, any instance methods on [Services](/modeling/model-types/services.md) will also have API endpoints and TypeScript generated.

These custom methods allow you to implement any custom server-side functionality in your Coalesce application that falls outside of the standard CRUD functions that are generated for your entities.

[[toc]]

## Declaring Methods

### Instance Methods

Instance Methods can be declared on your [Entity classes](/modeling/model-types/entities.md). For example:

``` c#
public class User
{
    public int UserId { get; set; }

    public string Email { get; set; }

    [Coalesce]
    public async Task<ItemResult> SendMessage(
        [Inject] SmtpClient client,
        ClaimsPrincipal sender,
        string message
    ) {
        if (string.IsNullOrWhitespace(Email)) return "Recipient has no email";
        if (string.IsNullOrWhitespace(message)) return "Message is required";

        await client.SendMailAsync(new MailMessage(
            from: sender.GetEmailAddress(),
            to: Email,
            subject: "Message from MyApp",
            body: message
        ));
        return true;
    }
}

```

When an instance method is invoked, the target model instance will be loaded using the data source specified by an attribute `[LoadFromDataSource(typeof(MyDataSource))]` if present. Otherwise, the model instance will be loaded using the default data source for the model's type. If you have a [Custom Data Source](/modeling/model-components/data-sources.md#defining-data-sources) annotated with `[DefaultDataSource]`, that data source will be used. Otherwise, the [Standard Data Source](/modeling/model-components/data-sources.md#standard-data-source) will be used. The consequence of this is that a user cannot call a method on an instance of entity that they're not allowed to see or load.

Instance methods are generated onto the TypeScript ViewModels.

#### When should I use Instance Methods?
Instance methods, as opposed to [static](#static-methods) or [service](#service-methods) methods, are a good fit when implementing an action that directly acts on or depends upon a specific instance of one of your entity types. One of their biggest benefits is the automatic row-level security from data sources as described above.

### Static Methods

Static Methods can be declared on your [Entity classes](/modeling/model-types/entities.md). For example:

``` c#
public class Person
{
    public int PersonId { get; set; }

    public string FirstName { get; set; }

    [Coalesce]
    public static ICollection<string> NamesStartingWith(
        AppDbContext db,
        string characters
    ) {
        return db.People
            .Select(p => p.FirstName)
            .Where(f => f.StartsWith(characters))
            .ToList();
    }
}
```

Static methods are generated onto the TypeScript ListViewModels. All of the same members that are generated for instance methods are also generated for static methods.

#### When should I use Static Methods?
Static methods are a good fit for actions that don't operate on a specific instance of an entity type, but whose functionality is still closely coupled with a specific, concrete entity type.

For example, imagine you have a File entity class. You could make a static method on that class that accepts a file as a parameter. This method would persist that file to storage and then save a new entity to the database. You would then [disable Create](/topics/security.md#endpoint-security) on that entity, since the default `/save` endpoint cannot accept file uploads.

Or, imagine an Invoice class. You might make a static method that returns a summary of sales information for a given time range. Since this summarization would be performing aggregate functions against your Invoice entities and is therefore tightly coupled to Invoices, a static method would be suitable.

### Service Methods

Service methods can be declared on a [Coalesce Service](/modeling/model-types/services.md) class:

``` c#
[Coalesce, Service]
public class MyService
{
  [Coalesce]
  public string MyServiceMethod() => "Hello, World!";
}
```

Or, they can be declared via a [Coalesce Service](/modeling/model-types/services.md) *interface* that has an implementation registered with dependency injection:

``` c#
[Coalesce, Service]
public interface IMyService
{
  string MyServiceMethod() => "Hello, World!";
}
```

When declaring service methods by interface, a [Coalesce] attribute on each method is not needed - the entire interface is exposed by Coalesce.

#### When should I use Service Methods?
[Services](/modeling/model-types/services.md) are a catch-all feature and can be used for almost any conceivable purpose in Coalesce to implement custom functionality that needs to be invoked by your front-end app.

However, there are some reasons why you might *not* want to use a service:
* If the method logically operates on a single entity instance, and/or if using an instance method would let you utilize the row-level security already implemented by one of your data sources to authorize who can invoke the method.
* If the service would only have one or two methods and would logically make sense as a static or instance method. In other words, if adding a new service class would be detrimental to the organization of your codebase and create "file sprawl".

On the other hand, services have some benefits that instance and static methods cannot provide:
* Coalesce Services can be declared with an interface, rather than a concrete type, allowing for their implementation to be substituted more easily. For example, a service providing an external integration that you want to mock or stub during automated testing and/or local development.

## Parameters

The following parameters can be added to your methods:

Type	Description

Primitives, Dates, and other Scalars

Most common built-in primitive and scalar data types (numerics, strings, booleans, enums, `DateTime`, `DateTimeOffset`), and their nullable variants, are accepted as parameters to be passed from the client to the method call.

[Entity Models](/modeling/model-types/entities.md)

When invoking the method on the client, the object's properties will only be serialized one level deep. If an entity model parameter has additional child object properties, they will not be included in the invocation of the method - only the object's primitive & date properties will be deserialized from the client.

[External Types](/modeling/model-types/external-types.md)

Unlike entity model parameters, external type parameters will be serialized and sent by the client to an arbitrarily deep level, excluding any entity model properties that may be nested inside an external type.

Files

Methods can accept file uploads by using a parameter of type `IntelliTect.Coalesce.Models.IFile` (or any derived type, like `IntelliTect.Coalesce.Models.File`).

[ICollection<T>](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.icollection-1), [IEnumerable<T>](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)

Collections of any of the above valid parameter types above are also valid parameter types.

[DbContext](https://learn.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.dbcontext)

If the method has a parameter assignable to `Microsoft.EntityFrameworkCore.DbContext`, then the parameter will be implicitly `[Inject]`ed.

[ClaimsPrincipal](https://learn.microsoft.com/en-us/dotnet/api/system.security.claims.claimsprincipal)

If the method has a parameter of type ClaimsPrincipal, the value of `HttpContext.User` will be passed to the parameter.

[[Inject]](/modeling/model-components/attributes/inject.md)

If a parameter is marked with the [[Inject]](/modeling/model-components/attributes/inject.md) attribute, it will be injected from the application's `IServiceProvider`.

`out` [IncludeTree](/concepts/include-tree.md)

Deprecated. If you need to return an [Include Tree](/concepts/include-tree.md) to shape the serialization of the method's return value, you should use an `ItemResult<T>` return value and populate the `IncludeTree` property on the `ItemResult` object.

## Return Values

You can return virtually anything from these methods:

Type	Description

Primitives, Dates, and other Scalars

Most common built-in primitive and scalar data types (numerics, strings, booleans, enums, `DateTime`, `DateTimeOffset`), and their nullable variants, may be returned from methods.

[Entity Models](/modeling/model-types/entities.md)

Any of the types of your models may be returned.

[External Types](/modeling/model-types/external-types.md)

Any [External Types](/modeling/model-types/external-types.md) you define may also be returned from a method.

When returning custom types from methods, be careful of the types of their properties. Coalesce will **recursively** discover and generate code for all public properties of your [External Types](/modeling/model-types/external-types.md). If you accidentally include a type that you do not own, these generated types could get out of hand extremely quickly.

Mark any properties you don't want generated with the [[InternalUse]](/modeling/model-components/attributes/internal-use.md) attribute, or give them a non-public access modifier. Whenever possible, don't return types that you don't own or control.

[ICollection<T>](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.icollection-1), [IEnumerable<T>](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)

Collections of any of the above valid return types above are also valid return types. IEnumerables are useful for generator functions using `yield`. `ICollection` is highly suggested over `IEnumerable` whenever appropriate, though.

[IQueryable<T>](https://learn.microsoft.com/en-us/dotnet/api/system.linq.iqueryable)

Queryables of the valid return types above are valid return types. The query will be evaluated, and Coalesce will attempt to pull an [Include Tree](/concepts/include-tree.md) from the queryable to shape the response.

When [Include Tree](/concepts/include-tree.md) functionality is needed to shape the response but an `IQueryable<>` return type is not feasible, an `ItemResult` return value with an `IncludeTree` set on it will do the trick as well.

[Files](#file-downloads)

Methods can return file downloads using type `IntelliTect.Coalesce.Models.IFile` (or any derived type, like `IntelliTect.Coalesce.Models.File`).

Please see the [File Downloads](#file-downloads) section below for more details

`ItemResult<T>`, `ItemResult`, `ListResult<T>`

An `IntelliTect.Coalesce.Models.ItemResult<T>` of any of the valid return types above, including collections, is valid, as well as its non-generic variant `ItemResult`, and its list variant `ListResult<T>`.

Use an `ItemResult` whenever you might need to signal failure and return an error message from a custom method. The `WasSuccessful` and `Message` properties on the result object will be sent along to the client to indicate success or failure of the method. The type `T` will be mapped to the appropriate DTO object before being serialized as normal.

An [Include Tree](/concepts/include-tree.md) can be set on the object's `IncludeTree` parameter to shape the serialization of the method's returned value.

## Security

You can implement role-based security on a method by placing the [[Execute]](/modeling/model-components/attributes/execute.md) on the method. Placing this attribute on the method with no roles specified will simply require that the calling user be authenticated.

Security for instance methods is also controlled by the data source that loads the instance - if the data source can't provide an instance of the requested model, the method won't be executed.

See the [Security](/topics/security.md#custom-methods-and-services) page to read more about custom method security, as well as all other security mechanisms in Coalesce.

## Generated TypeScript

See [API Callers](/stacks/vue/layers/api-clients.md#api-callers) and [ViewModel Layer](/stacks/vue/layers/viewmodels.md) for details on the code that is generated for your custom methods.

::: tip Note
Any Task-returning methods with "Async" as a suffix to the C# method's name will have the "Async" suffix stripped from the generated Typescript.
:::

## Method Annotations

Methods can be annotated with attributes to control API exposure and TypeScript generation. The following attributes are available for model methods. General annotations can be found on the [Attributes](/modeling/model-components/attributes.md) page.

### `[Coalesce]`
The [[Coalesce]](/modeling/model-components/attributes/coalesce.md) attribute causes the method to be exposed via a generated API controller. This is not needed for methods defined on an interface marked with `[Service]` - Coalesce assumes that all methods on the interface are intended to be exposed. If this is not desired, create a new, more restricted interface with only the desired methods to be exposed.

### `[ControllerAction(Method = HttpMethod, VaryByProperty = string)]`
The [[ControllerAction]](/modeling/model-components/attributes/controller-action.md) attribute controls how this method is exposed via HTTP. Can be used to customize the HTTP method/verb for the method, as well as caching behavior.

### `[Execute(string roles)]`
The [[Execute]](/modeling/model-components/attributes/execute.md) attribute specifies which roles can execute this method from the generated API controller.

### `[LoadFromDataSource(Type dataSourceType)]`
The [[LoadFromDataSource]](/modeling/model-components/attributes/load-from-data-source.md) attribute specifies that the targeted model instance method should load the instance it is called on from the specified data source when invoked from an API endpoint. By default, the default data source for the model's type will be used.

## File Downloads

Coalesce supports exposing file downloads via custom methods. Simply return a `IntelliTect.Coalesce.Models.IFile` (or any derived type, like `IntelliTect.Coalesce.Models.File`), or an `ItemResult<>` of such.

### Consuming file downloads

There are a few conveniences for easily consuming downloaded files from your custom pages.

<CodeTabs>
<template #vue>

The [API Callers](/stacks/vue/layers/api-clients.md#api-callers) have a property `url`. This can be provided directly to your HTML template, with the browser invoking the endpoint automatically.

``` ts
import { PersonViewModel } from<EMAIL_ADDRESS>
var viewModel = new PersonViewModel();
viewModel.$load(1);
```
``` html
<img :src="downloadPicture.url">
```
----
Alternatively, the [API Callers](/stacks/vue/layers/api-clients.md#api-callers) for file-returning methods have a method `getResultObjectUrl(vue)`. If the method was invoked programmatically (i.e. via `caller()`, `caller.invoke()`, or `caller.invokeWithArgs()`), this method returns an [Object URL](https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL) that can be set as the `src` of an `image` or `video` HTML tag.

``` ts
import { PersonViewModel } from<EMAIL_ADDRESS>
var viewModel = new PersonViewModel();
await viewModel.$load(1);
await viewModel.downloadPicture();
```
``` html
<img :src="downloadPicture.getResultObjectUrl()">
```

</template>
<template #knockout>

The [TypeScript Method Objects](/stacks/ko/client/methods.md) for HTTP GET methods have a property `url`. This can be provided directly to your HTML, with the browser invoking the endpoint as normal.

``` ts
var viewModel = new ViewModels.Person();
viewModel.load(1);
```
``` html
<img data-bind="attr: {src: downloadPicture.url }">
```

----
Alternatively, the [TypeScript Method Objects](/stacks/ko/client/methods.md) for file-returning methods have a property `resultObjectUrl`. If the method is invoked programmatically (i.e. via `.invoke()` or `.invokeWithArgs()`), this property contains an [Object URL](https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL) that can be set as the `src` of an `image` or `video` HTML tag.

``` ts
var viewModel = new ViewModels.Person();
viewModel.load(1, () => {
    viewModel.downloadPicture.invoke();
});
```
``` html
<img data-bind="attr: {src: downloadPicture.resultObjectUrl }">
```

</template>
</CodeTabs>

### Database-stored Files

When storing large `byte[]` objects in your EF models, it is important that these are never loaded unless necessary. Loading these can cause significant garbage collector churn, or even [bring your app to a halt](https://github.com/dotnet/SqlClient/issues/593). To achieve this with EF, you can either utilize [Table Splitting](https://docs.microsoft.com/en-us/ef/core/modeling/table-splitting), or you can use an entire dedicated table that only contains a primary key and the binary content, and nothing else.

::: warning
Storing large binary objects in relational databases comes with significant drawbacks. For large-volume cloud solutions, it is much more costly than dedicated cloud-native file storage like Azure Storage or S3. Also of note is that the larger a database is, the more difficult its backup process becomes.
:::

For files that are stored in your database, Coalesce supports a pattern that allows the file to be streamed directly to the HTTP response without needing to allocate a chunk of memory for the whole file at once. Simply pass an EF `IQueryable<byte[]>` to the constructor of `IntelliTect.Coalesce.Models.File`. This implementation, however, is specific to the underlying EF database provider. Currently, only SQL Server and SQLite are supported. Please open a Github issue to request support for other providers. An example of this mechanism is included in the `DownloadAttachment` method in the code sample below.

The following is an example of utilizing Table Splitting for database-stored files. Generally speaking, metadata about the file should be stored on the "main" entity, and only the bytes of the content should be split into a separate entity.

``` c#
public class AppDbContext : DbContext
{
    public DbSet<Case> Cases { get; set; }

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder
            .Entity<Case>()
            .ToTable("Cases")
            .HasOne(c => c.AttachmentContent)
            .WithOne()
            .HasForeignKey<CaseAttachmentContent>(c => c.CaseId);
        modelBuilder
            .Entity<CaseAttachmentContent>()
            .ToTable("Cases")
            .HasKey(d => d.CaseId);
    }
}

public class Case
{
    public int CaseId { get; set; }

    [Read]
    public string AttachmentName { get; set; }

    [Read]
    public long AttachmentSize { get; set; }

    [Read]
    public string AttachmentType { get; set; }

    [Read, MaxLength(32)] // Adjust max length based on chosen hash algorithm.
    public byte[] AttachmentHash { get; set; } // Could also be a base64 string if so desired.

    [InternalUse]
    public CaseAttachmentContent AttachmentContent { get; set; } = new();

    [Coalesce]
    public async Task UploadAttachment(AppDbContext db, IFile file)
    {
        if (file.Content == null) return;

        var content = new byte[file.Length];
        await file.Content.ReadAsync(content.AsMemory());

        AttachmentContent = new () { CaseId = CaseId, Content = content };
        AttachmentName = file.Name;
        AttachmentSize = file.Length;
        AttachmentType = file.ContentType;
        AttachmentHash = SHA256.HashData(content);
    }

    [Coalesce]
    [ControllerAction(HttpMethod.Get, VaryByProperty = nameof(AttachmentHash))]
    public IFile DownloadAttachment(AppDbContext db)
    {
        return new IntelliTect.Coalesce.Models.File(db.Cases
            .Where(c => c.CaseId == this.CaseId)
            .Select(c => c.AttachmentContent.Content)
        )
        {
            Name = AttachmentName,
            ContentType = AttachmentType,
        };
    }
}

public class CaseAttachmentContent
{
    public int CaseId { get; set; }

    [Required]
    public byte[] Content { get; set; }
}
```

### Other File Storage

For any other storage mechanism, implementations are similar to the database storage approach above. However, instead of table splitting or using a whole separate table, the file contents are simply stored elsewhere. Continue storing metadata about the file on the primary entity, and implement upload/download methods as desired that wrap the storage provider.

For downloads, prefer directly providing the underlying `Stream` to the `IFile` versus wrapping a `byte[]` in a `MemoryStream`. This will reduce server memory usage and garbage collector churn.

For cloud storage providers where complex security logic is not needed, consider having clients consume the URL of the cloud resource directly rather than passing the file content through your own server.

repository: IntelliTect/Coalesce

branch_name: refs/heads/dev

repo_name: IntelliTect/Coalesce


text:
### Requirements
Python 3.7.*

### mytts
Django app for Cantonese synthesizer

### Compile Ossian
Run this in Ossian directory
```shell script
./scripts/setup_tools.sh mirfan899 Tqveb=Be
```

### IP of Allowed Hosts.
After cloning the repository add IP address in settings in allowed hosts.

### Install NGINX
```shell script
sudo apt-get install nginx
```
### Gunicorn
copy `gunicorn.socket` to `/etc/systemd/system/`
```shell script
cp ./unicorn/gunicorn.socket /etc/systemd/system/
cp ./unicorn/gunicorn.service /etc/systemd/system/
```

Now enable the service
```shell script
sudo systemctl start gunicorn.socket
sudo systemctl enable gunicorn.socket
sudo systemctl status gunicorn.socket
```

### NGINX configuration
copy mytts to `/etc/nginx/sites-available/`
test it
enable site
```shell script
sudo ln -s /etc/nginx/sites-available/mytts /etc/nginx/sites-enabled
```

Other NGINX, GUNICORN commands
```shell script
sudo nginx -t
sudo systemctl restart nginx
sudo systemctl restart gunicorn
sudo systemctl restart gunicorn.socket gunicorn.service
```
### Free Django port
```shell script
sudo lsof -t -i tcp:8000 | xargs kill -9
```

### AppEngine
`main.py` is for AppEngine

license: MIT

branch_name: refs/heads/master

extension: md

gha_language: Python

gha_license_id: MIT

license_type: permissive


text:
## Changelog

#### 0.0.3

* Added support for flash cache when using the 3PAR StoreServ backend.

#### 0.0.2

* Added the ability to choose different provisioning
  types during volume creation. (thin, full, dedup)

#### 0.0.1

* Initial release of the python-hpedockerplugin.
* APIs added for the following features:
  * Create Volume
  * Remove Volume
  * Mount a Volume
  * Unmount a Volume
  * Get a Volume
  * List Volumes
* Support for CHAP added for volumes.
* Documentation added for setting up the plugin.

#### 1.0
* Managed Plugin implementation (available in Docker Store as certified plugin)

#### 1.0.1
* Include support for specifying the folder for the secure etcd certificates
* Includes support for Multipath
* Minor bug fixes.

repository: hpe-storage/python-hpedockerplugin

repo_name: hpe-storage/python-hpedockerplugin


text:
---
layout: post
title: "Earley Parsing Variety Show"
date: 2013-02-16 18:06
comments: true
published: false
categories: parsing proglang
---

I have been meaning to explore how one might implement a paritcular
algorithm atop a host of languages that have struck my fancy lately.

<!-- more -->

In particular, I have wanted to explore Clojure and Rust some more,
and perhaps compare them with e.g. (Larceny) Scheme and (Mozilla)
Javascript.

```scheme
;; fib : Nat -> Nat
(define (fib n)
  (cond ((< n 2) 1)
        (else (+ (fib (- n 1)) (fib (- n 2))))))
```

```javascript
// fib : Nat -> Nat
function fib(n)
  (< n 2) ? 1 : (fib(n - 1) + fib(n - 2))
```

```javascript
// fib : Nat -> Nat
function fib(n) {
  if (< n 2) {
    return 1;
  } else {
    return fib(n - 1) + fib(n - 2);
  }
}
```

# Reminder of first thought on rust:
# This:
```text
fib.rs:7:8: 7:28 error: unresolved name
fib.rs:7     use std::time::get_time;
                 ^~~~~~~~~~~~~~~~~~~~
fib.rs:7:8: 7:28 error: failed to resolve import: std::time::get_time
fib.rs:7     use std::time::get_time;
                 ^~~~~~~~~~~~~~~~~~~~
error: failed to resolve imports
error: aborting due to 3 previous errors
```
# does not help remind me that I need this somewhere:
```rust
extern mod std;
```
# I think the error message could be improved here.

repository: pnkfelix/pnkfx-blog

extension: markdown

repo_name: pnkfelix/pnkfx-blog


text:
# AWS Networking Infrastructure
This terraform module creates networking infrastructure like VPC, Subnet, Internet Gateway, NAT Gateway, Route Table,
Routing Rules etc.

# Documentation
Documentation of this module is inside **docs** directory, written using **Sphinx**. To generate **HTML**, enter into
**docs** directory and then run the command `make html`. It will create static documentation found in *docs/build/html*
directory.

# Commands To Manipulate Resources
First enter into **terraform** directory to run the following commands.

- Installs required terraform plugins. See more details
[**here**](https://www.terraform.io/docs/commands/init.html)
```
terraform init
```
- **View execution plan**
```
terraform plan --var-file input_value.tfvars
```

- **Apply the configurations**
```
terraform apply --var-file input_value.tfvars --auto-approve
```
Remove `--auto-approve` option from the above command to approve manually (by inputting prompt).

If the input file is named exactly `terraform.tfvars` or any variation of `*.auto.tfvars`, those
will be loaded automatically, you don't need to pass `--var-file` option with the command. In this
case the command is as following.
```
terraform apply --auto-approve
```
And, the **JSON** version of the input files follows the same above rules.

- **Destroy all resources**
```
terraform destroy --var-file input.tfvars --auto-approve
```
Remove `--auto-approve` option from the above command to approve manually (by inputting prompt).


text:
---
title: Perform an inner join
description: >
  Use [`join.inner()`](/flux/v0.x/stdlib/join/inner/) to perform an inner join of two streams of data.
  Inner joins drop any rows from both input streams that do not have a matching
  row in the other stream.
menu:
  flux_0_x:
    name: Inner join
    parent: Join data
weight: 101
related:
  - /flux/v0.x/join-data/troubleshoot-joins/
  - /flux/v0.x/stdlib/join/
  - /flux/v0.x/stdlib/join/inner/
list_code_example: |
  ```js
  import "join"

  left = from(bucket: "example-bucket-1") |> //...
  right = from(bucket: "example-bucket-2") |> //...

  join.inner(
      left: left,
      right: right,
      on: (l, r) => l.column == r.column,
      as: (l, r) => ({l with name: r.name, location: r.location}),
  )
  ```
---

Use [`join.inner()`](/flux/v0.x/stdlib/join/inner/) to perform an inner join of two streams of data.
Inner joins drop any rows from both input streams that do not have a matching
row in the other stream.

{{< svg svg="static/svgs/join-diagram.svg" class="inner" >}}

{{< expand-wrapper >}}
{{% expand "View table illustration of an inner join" %}}
{{< flex >}}
{{% flex-content "third" %}}
#### left
|     |                                      |                                      |
| :-- | :----------------------------------- | :----------------------------------- |
| r1  | ● | ● |
| r2  | ● | ● |
{{% /flex-content %}}
{{% flex-content "third" %}}
#### right
|     |                                      |                                      |
| :-- | :----------------------------------- | :----------------------------------- |
| r1  | ▲ | ▲ |
| r3  | ▲ | ▲ |
| r4  | ▲ | ▲ |
{{% /flex-content %}}
{{% flex-content "third" %}}
#### Inner join result

|     |                                      |                                      |                                      |                                      |
| :-- | :----------------------------------- | :----------------------------------- | :----------------------------------- | :----------------------------------- |
| r1  | ● | ● | ▲ | ▲ |
{{% /flex-content %}}
{{< /flex >}}
{{% /expand %}}
{{< /expand-wrapper >}}

## Use join.inner to join your data

1. Import the `join` package.
2. Define the **left** and **right** data streams to join:

    - Each stream must have one or more columns with common values.
      Column labels do not need to match, but column values do.
    - Each stream should have identical [group keys](/flux/v0.x/get-started/data-model/#group-key).

    _For more information, see [join data requirements](/flux/v0.x/join-data/#data-requirements)._

3. Use `join.inner()` to join the two streams together.
    Provide the following required parameters:

    - `left`: Stream of data representing the left side of the join.
    - `right`: Stream of data representing the right side of the join.
    - `on`: [Join predicate](/flux/v0.x/join-data/#join-predicate-function-on).
      For example: `(l, r) => l.column == r.column`.
    - `as`: [Join output function](/flux/v0.x/join-data/#join-output-function-as)
      that returns a record with values from each input stream.
      For example: `(l, r) => ({l with column1: r.column1, column2: r.column2})`.

The following example uses a filtered selection from the
[**machineProduction** sample data set](/flux/v0.x/stdlib/influxdata/influxdb/sample/data/#set)
as the **left** data stream and an ad-hoc table created with [`array.from()`](/flux/v0.x/stdlib/array/from/)
as the **right** data stream.

{{% note %}}
#### Example data grouping

The example below ungroups the **left** stream to match the grouping of the **right** stream.
After the two streams are joined together, the joined data is grouped by `stationID`.
{{% /note %}}

```js
import "array"
import "influxdata/influxdb/sample"
import "join"

left =
    sample.data(set: "machineProduction")
        |> filter(fn: (r) => r.stationID == "g1" or r.stationID == "g2" or r.stationID == "g3")
        |> filter(fn: (r) => r._field == "oil_temp")
        |> limit(n: 5)

right =
    array.from(
        rows: [
            {station: "g1", opType: "auto", last_maintained: 2021-07-15T00:00:00Z},
            {station: "g2", opType: "manned", last_maintained: 2021-07-02T00:00:00Z},
        ],
    )

join.inner(
    left: left |> group(),
    right: right,
    on: (l, r) => l.stationID == r.station,
    as: (l, r) => ({l with opType: r.opType, maintained: r.last_maintained}),
)
    |> group(columns: ["stationID"])
```

{{< expand-wrapper >}}
{{% expand "View example input and output" %}}

{{% note %}}
_`_start` and `_stop` columns have been omitted from example input and output._
{{% /note %}}

### Input

#### left {#left-input}

| _time                   | _measurement | stationID | _field   | _value |
| :---------------------- | :----------- | :-------- | :------- | -----: |
| 2021-08-01T00:00:00Z    | machinery    | g1        | oil_temp |   39.1 |
| 2021-08-01T00:00:11.51Z | machinery    | g1        | oil_temp |   40.3 |
| 2021-08-01T00:00:19.53Z | machinery    | g1        | oil_temp |   40.6 |
| 2021-08-01T00:00:25.1Z  | machinery    | g1        | oil_temp |  40.72 |
| 2021-08-01T00:00:36.88Z | machinery    | g1        | oil_temp |   40.8 |

| _time                   | _measurement | stationID | _field   | _value |
| :---------------------- | :----------- | :-------- | :------- | -----: |
| 2021-08-01T00:00:00Z    | machinery    | g2        | oil_temp |   40.6 |
| 2021-08-01T00:00:27.93Z | machinery    | g2        | oil_temp |   40.6 |
| 2021-08-01T00:00:54.96Z | machinery    | g2        | oil_temp |   40.6 |
| 2021-08-01T00:01:17.27Z | machinery    | g2        | oil_temp |   40.6 |
| 2021-08-01T00:01:41.84Z | machinery    | g2        | oil_temp |   40.6 |

| _time                   | _measurement | stationID | _field   | _value |
| :---------------------- | :----------- | :-------- | :------- | -----: |
| 2021-08-01T00:00:00Z    | machinery    | g3        | oil_temp |   41.4 |
| 2021-08-01T00:00:14.46Z | machinery    | g3        | oil_temp |  41.36 |
| 2021-08-01T00:00:25.29Z | machinery    | g3        | oil_temp |   41.4 |
| 2021-08-01T00:00:38.77Z | machinery    | g3        | oil_temp |   41.4 |
| 2021-08-01T00:00:51.2Z  | machinery    | g3        | oil_temp |   41.4 |

#### right {#right-input}

| station | opType |      last_maintained |
| :------ | :----- | -------------------: |
| g1      | auto   | 2021-07-15T00:00:00Z |
| g2      | manned | 2021-07-02T00:00:00Z |

### Output {#example-output}

| _time                   | _measurement | stationID | _field   | _value | opType | maintained           |
| :---------------------- | :----------- | :-------- | :------- | -----: | :----- | :------------------- |
| 2021-08-01T00:00:00Z    | machinery    | g1        | oil_temp |   39.1 | auto   | 2021-07-15T00:00:00Z |
| 2021-08-01T00:00:11.51Z | machinery    | g1        | oil_temp |   40.3 | auto   | 2021-07-15T00:00:00Z |
| 2021-08-01T00:00:19.53Z | machinery    | g1        | oil_temp |   40.6 | auto   | 2021-07-15T00:00:00Z |
| 2021-08-01T00:00:25.1Z  | machinery    | g1        | oil_temp |  40.72 | auto   | 2021-07-15T00:00:00Z |
| 2021-08-01T00:00:36.88Z | machinery    | g1        | oil_temp |   40.8 | auto   | 2021-07-15T00:00:00Z |

| _time                   | _measurement | stationID | _field   | _value | opType | maintained           |
| :---------------------- | :----------- | :-------- | :------- | -----: | :----- | :------------------- |
| 2021-08-01T00:00:00Z    | machinery    | g2        | oil_temp |   40.6 | manned | 2021-07-02T00:00:00Z |
| 2021-08-01T00:00:27.93Z | machinery    | g2        | oil_temp |   40.6 | manned | 2021-07-02T00:00:00Z |
| 2021-08-01T00:00:54.96Z | machinery    | g2        | oil_temp |   40.6 | manned | 2021-07-02T00:00:00Z |
| 2021-08-01T00:01:17.27Z | machinery    | g2        | oil_temp |   40.6 | manned | 2021-07-02T00:00:00Z |
| 2021-08-01T00:01:41.84Z | machinery    | g2        | oil_temp |   40.6 | manned | 2021-07-02T00:00:00Z |

#### Things to note about the join output
- Because the [right stream](#right-input) does not have a row with the `g3` station tag,
  the joined output drops all rows with the `g3` stationID tag from the [left stream](#left-input).
  `join.inner()` drops any rows that do not have a matching row in the other
  data stream.

{{% /expand %}}
{{< /expand-wrapper >}}


text:
# Composite pattern

## Intent

* Compose objects into tree structures to represent whole-part hierarchies.
* Composite pattern lets clients treat **individual objects and compositions of objects uniformly**.
* In a hierarchy, we can have simple objects as well as composite objects. For instance in a file system, files are simple/primitive objects and folders are composite objects. Directories contain entries, each of which could be a directory.

![Composite design pattern](./composite.png)

## Examples

> The composite pattern is extremely useful for a variety of tree-like structures, including GUI widget hierarchies, file hierarchies, tree sets, graphs, and HTML DOM. - [Python 3 OOP][1]

* [GOF Design patterns](https://infinitescript.com/2014/10/the-23-gang-of-three-design-patterns/)
* [Composite pattern example](https://github.com/faif/python-patterns/blob/master/patterns/structural/composite.py)

## Implementation Checklist

* Create a **lowest common denominator** interface that makes your containers and containees interchangeable. It should specify the behavior that needs to be exercised uniformly across all containee and container objects.
* All container and containee classes declare an "is a" relationship to the interface.
* All container classes declare a one-to-many "has a" relationship to the interface.
* Container classes leverage polymorphism to delegate to their containee objects.

> It can be a useful pattern in Python when implemented according to the traditional implementation. Sometimes, if only a shallow tree is being created, we can get away with a list of lists or a dictionary of dictionaries, and do not need to implement custom component, leaf, and composite classes. Other times, we can get away with implementing only one composite class, and treating leaf and composite objects as a single class. - [Python 3 OOP][1]

## Python Implementation

[This article][2] explains the composite pattern in python with implementation details.

> The art of using the Composite Pattern is determining where to break the symmetry.
> The question of return type will serve as a very important guardrail when you are designing in Python: if your desire to create symmetry between container and content leads you to engineer calls that require an if statement or isinstance() to safely handle their return value, then the desire for symmetry has led you astray.

---

> Python supports many approaches:
>
> * The classic common superclass architecture.
> * Making the superclass an abstract base class with the tools inside Standard Library’s `abc` module.
> * Having the two classes share an interface, like those supported by the old [**zope.interface**](https://github.com/zopefoundation/zope.interface) package.
> * You could spin up a type checking library like **MyPy** and use annotations to ask for hard guarantees that all of the objects processed by your code — both container and contents — implement the runtime behaviors that your code requires.
> * You could duck type

**NOTE**: [zope.interface](https://github.com/zopefoundation/zope.interface) implements **interface** semantically similar to what we have in Java or C#. Its documentation can be found [here](https://zopeinterface.readthedocs.io/en/latest/)

---

## References

Read the following references in the same order as listed below to gain a better understanding of this pattern.

* [Composite Design Pattern](https://sourcemaking.com/design_patterns/composite)
* [Python3 Object oriented programming by Dusty Phillips][1]
* [Composite pattern : Python patterns guide Brandon Rhodes][2]

[1]: https://www.amazon.in/dp/B005O9OFWQ/ref=dp-kindle-redirect?_encoding=UTF8&btkr=1
[2]: https://python-patterns.guide/gang-of-four/composite/


text:
# README Generator

  ![MIT License](https://img.shields.io/static/v1?label=License&message=MIT%20License&color=green)

  ## Description
  ---
  This is an application that allows users to generate README files.

  ## Table of Contents
  ---
  * [Installation](#installation)
  * [Usage](#usage)
  * [Contribution](#contribution)
  * [License](#license)
  * [Test](#test)
  * [Questions](#questions)
  * [Walkthrough](#walkthrough)

  ## Installation
  ---
  To install, clone the repository, then install node and inquirer.

  ## Usage
  ---
  To use, open an integrated terminal in the project. Type in "node index.js", then press enter. Answer all of the prompts and a README file containing the answers will be generated.

  ## Contribution
  ---
  Anyone can contribute.

  ## License
  ---
  The license used in this project was MIT License. More information about this license can be found at [MIT License](https://choosealicense.com/licenses/mit/).

  ## Test
  ---
  Answer prompts and preview generated README file in output folder.

  ## Questions
  ---
  My other work can be found at sean-elliott-97. If you have any additional questions, you can email me at [sean.elliott.33197@gmail.com](mailto:sean.elliott.33197@gmail.com).

  ## Walkthrough
  ---
  https://watch.screencastify.com/v/ooRZfHpg7hVZ6mL7ptwr.

branch_name: refs/heads/main


text:
# Variational Inference with Normalizing Flows

## Introduction

This is a PyTorch implementation of several normalizing flow, including a variational autoencoder.

## Implemented Flows

* Planar flow ([Rezende & Mohamed, 2015](https://arxiv.org/abs/1505.05770))
* Radial flow ([Rezende & Mohamed, 2015](https://arxiv.org/abs/1505.05770))
* NICE ([Dinh et al., 2014](https://arxiv.org/abs/1410.8516))
* Real NVP ([Dinh et al., 2016](https://arxiv.org/abs/1605.08803))
* Glow ([Kingma & Dhariwal, 2018](https://arxiv.org/abs/1807.03039))
* Residual flow ([Chen et al., 2019](https://arxiv.org/abs/1906.02735))

## Methods of Installation

The latest version of the package can be installed via pip

```
pip install --upgrade git+https://github.com/VincentStimper/normalizing-flows.git
```

Alternatively, download the repository and run

```
python setup.py install
```

repository: rushi-the-neural-arch/normalizing-flows

repo_name: rushi-the-neural-arch/normalizing-flows


text:
# PyMotor

## Overview

PyMotor is a tool for electric motor selection. It generates force and torque plots from linear motion profiles and physical parameters describing motors, drivetrains, and loads.

## Development Status

PyMotor is being developed with Python 3.7 using packages described in requirements.txt.

**This is Alpha phase software.** This means that features and usage are not fixed, the documentation is most likely incomplete, and there may be bugs.

Some versions of this package are uploaded to pypi.org and can be installed, at your own risk, like this:

``` bash
$ pip install numpy
$ pip install pandas
$ pip install pymotor
```

## Physics Equations

The math used to calculate force, inertia and torque is shown below. Note that angular velocity and angular acceleration in the equations below are in rad/s and rad/s2, respectively. Internally, the software stores these values as Hz and Hz/s.

![Equation Image](https://raw.githubusercontent.com/rmrubin/pymotor/master/readme/equations.png)

## Physical Units

The native physical units used by the package are shown in the table below. Functions in the module conversions.py are provided so parameters can be entered in other units.

Parameter | Internal Symbol | Unit
--|--|--
Time | t | s
Length | x | m
Linear Velocity | v | m/s
Linear Acceleration | a | m/s2
Force | f | N
Rotations | revs | Revolutions
Angular Velocity | hz | Hz
Angular Acceleration | hzps | Hz/s
Torque | tau | N*m
Moment of Inertia | j | kg*m2
Angle | incline_angle | °

## Usage

### Creating a Linear Motion Profile

Code to import the pymotor package and configure the LinearMotion object is shown below. Linear motion profiles are created from three segments: acceleration from zero, constant velocity, and deceleration to zero.

fs is Fsample, or the sample rate in Hz of the generated profiles.

Acceleration and deceleration segments can be defined by their time, distance, or acceleration. The constant velocity segment can be defined by time or distance.

If the smoothing options are set True, the acceleration and deceleration segments use Hann windows to create smoothed velocity profiles. If set False, triangular windows are used to create a trapezoidal velocity profile with constant acceleration.

The conversion functions ipm() and inch() have been used to convert from inches/min and inches, respectively, to native units.

``` python
import pymotor as pm

lm_settings = {
    'fs': 10000.0,
    'max_velocity': pm.ipm(40),
    'acc_mode': 'time',
    'acc_value': 0.06,
    'acc_smooth': True,
    'con_mode': 'distance',
    'con_value': pm.inch(.02),
    'dec_mode': 'acceleration',
    'dec_value': 0.25,
    'dec_smooth': False,
}

lm = pm.LinearMotion(lm_settings)
lm.plot()
```
![Motion Profile Image](https://raw.githubusercontent.com/rmrubin/pymotor/master/readme/motion.png)

### Converting to a Linear Force Profile

LinearForce objects take a settings dictionary and LinearMotion object as arguments, and generates a plot of force and velocity versus time.

The safety factor defined here is also used in the AngularTorque objects.

``` python
lf_settings = {
    'safety_factor': 2,
    'moving_mass': 100,
    'preload_force': 0.1,
    'efficiency': 0.9,
    'incline_angle': 45,
    'friction_coef': 0.1,
    'gravity': 9.8,
}

lf = pm.LinearForce(lf_settings, lm)
lf.plot()
```
![Force Profile Image](https://raw.githubusercontent.com/rmrubin/pymotor/master/readme/force.png)

### Defining a Motor Object

Motor objects contain torque curve and moment of inertia data. The method Motor.tau(hz) returns an interpolated torque value for a given angular velocity, which is used by AngularTorque objects to plot available motor torque vs required torque. Motor.plot() generates a plot of the torque curve which can be used for verification.

The curve_hz list defines the X axis values of the curve. The values must be positive, unique, and ascending.

The curve_tau list defines the Y axis values of the curve. The values must be positive.

``` python
curve_hz = [
    0,
    pm.rpm(300),
    pm.rpm(600),
    pm.rpm(900),
    pm.rpm(1200),
    pm.rpm(1500),
    pm.rpm(1800),
]

curve_tau = [
    2.5,
    2.2,
    1.3,
    0.9,
    0.7,
    0.6,
    0.5,
]

motor = pm.Motor(curve_hz=curve_hz, curve_tau=curve_tau, j=pm.gcm2(460))
motor.plot()
```
![Motor Torque Curve Image](https://raw.githubusercontent.com/rmrubin/pymotor/master/readme/motor.png)

### Defining Other Drivetrain Objects

Other necessary drivetrain objects are created in the following code. Gear ratios, drive screw lead, and moments of inertia are used in the torque generation process. The conversion functions gcm2() and inch() have been used to convert from g*cm2 and inches, respectively, to native units.

``` python
coupler = pm.Coupler(j=pm.gcm2(5))
gear = pm.Gear(ratio=2, j_in=pm.gcm2(10), j_out=pm.gcm2(15))
screw = pm.Screw(lead=pm.inch(.05), j=pm.gcm2(20))
```

### Generating a Torque Profile

AngularTorque objects take LinearForce, Motor, and drivetrain objects as arguments. The generated torque profile uses the safety factor defined in the LinearForce object.

The required torque plot includes an overlay of available motor torque. The velocity profile is also plotted.

``` python
at = pm.AngularTorque(lf, motor=motor, coupler=coupler, gear=gear, drivetrain=screw)
at.plot()
```
![Torque Profile Image](https://raw.githubusercontent.com/rmrubin/pymotor/master/readme/torque.png)

## Planned Changes
- [ ] More complete conversions.py module.
- [ ] Complete functions to output profile statistics.
- [ ] Reduction of pandas DataFrame copy operations.
- [ ] Configurable plot units.
- [ ] Stepper motor table and three-phase motor signal generation.

repository: rmrubin/pymotor

repo_name: rmrubin/pymotor


text:
# Code of Conduct

Like the technical community as a whole, the Insomnia community is made up of a mixture
of professionals and volunteers from all over the world, working on every aspect of the
mission – including mentorship, teaching, and connecting people.

Diversity is a huge priority, but it can also lead to communication issues and
unhappiness. To that end, we have a few ground rules that we ask people to adhere to. This
code applies equally to founders, mentors and those seeking help and guidance.

This isn’t an exhaustive list of things that you can’t do. Rather, take it in the spirit
in which it’s intended - a guide to make it easier to enrich all of us and the technical
communities in which we participate.

This code of conduct applies to all spaces managed by the Insomnia project, including Slack,
the issue tracker, and any other forums created for the project which the community uses
for communication. In addition, violations of this code outside these spaces may affect
a person's ability to participate within them.

If you believe someone is violating the code of conduct, we ask that you report it by
emailing [support@insomnia.rest](mailto:support@insomnia.rest). For more details
please see our Reporting Guidelines

- **Be friendly and patient.**
- **Be welcoming.** We strive to be a community that welcomes and supports people of all
  backgrounds and identities.
- **Be considerate.** Your work will be used by other people, and you in turn will
  depend on the work of others. Any decision you take will affect users and colleagues,
  and you should take those consequences into account when making decisions. Remember
  that we're a world-wide community, so you might not be communicating in someone
  else's primary language.
- **Be respectful.** Not all of us will agree all the time, but disagreement is no
  excuse for poor behavior and poor manners. We might all experience some frustration
  now and then, but we cannot allow that frustration to turn into a personal attack.
  It’s important to remember that a community where people feel uncomfortable or
  threatened is not a productive one. Members of the Insomnia community should be respectful
  when dealing with other members as well as with people outside the Insomnia community.
- **Be careful in the words that you choose.** We are a community of professionals,
  and we conduct ourselves professionally. Be kind to others. Do not insult or put
  down other participants. Harassment and other exclusionary behavior aren't acceptable.
  This includes, but is not limited to:
  - Violent threats or language directed against another person.
  - Discriminatory jokes and language.
  - Posting sexually explicit or violent material.
  - Posting (or threatening to post) other people's personally identifying information ("doxing").

  - Unwelcome sexual attention.
  - Advocating for, or encouraging, any of the above behavior.
  - Repeated harassment of others. In general, if someone asks you to stop, then stop.
- **When we disagree, try to understand why.** Disagreements, both social and technical,
happen all the time and Insomnia is no exception. It is important that we resolve
disagreements and differing views constructively. Remember that we’re different. The
strength of Insomnia comes from its varied community, people from a wide range of backgrounds.
Different people have different perspectives on issues. Being unable to understand why
someone holds a viewpoint doesn’t mean that they’re wrong. Don’t forget that it is human
to err and blaming each other doesn’t get us anywhere. Instead, focus on helping to resolve
issues and learning from mistakes.

Original text courtesy of the
[Speak Up! project](http://web.archive.org/web/20141109123859/http://speakup.io/coc.html).

## Questions?

Please send all questions or concerns to [support@insomnia.rest](mailto:support@insomnia.rest).

repository: nicholasraphael/insomnia

branch_name: refs/heads/develop

repo_name: nicholasraphael/insomnia


text:
# Change Log
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 0.1.3 2017-02-16
### Changed
- Analyzer warning clean

## 0.1.2 2016-12-17
### Changed
- cdm\_createChildManagedObjectContext renamed to cdm\_createBackgroundContext

## 0.1.1 - 2016-11-16
### Added
- First complete release. Push it to CocoaPods repository.

gha_language: Objective-C


text:
---
layout: default
---

# 1993-11-15 - Re: Should we oppose the Data Superhighway/NII?

## Header Data

From<EMAIL_ADDRESS>(Harry S. Hawk)

To<EMAIL_ADDRESS>Message Hash: 64f61f13ed0f6f8232a6b63f9d1a8519b6cbae5bf386b58b0fae0146477d115f

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1993-11-15 10:44:01 UTC

Raw Date: Mon, 15 Nov 93 02:44:01 PST

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Harry S. Hawk)
Date: Mon, 15 Nov 93 02:44:01 PST
To<EMAIL_ADDRESS>Subject: Re: Should we oppose the Data Superhighway/NII?
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

The FCC can already regulate what is on any broadcast medium that
is FCC regulated, (Tobacco Ads, for example).

The ONLY way, IMHO, to have a national data highway (not regulated
and thus censored by the FCC) is to have it operated by the post office.

Since I don't want the government opperating any data network I feel
the result will be freedom of "broadcast" IS DEAD.

E.g., I can send Tim live porno from my home, but as soon as I make it
available on a point to multi-point basis, the FCC steps in....

--
Harry S. Hawk  -  Extropian
<EMAIL_ADDRESS>In Service to Extropians since 1991

{% endraw %}
```

## Thread

+ Return to [November 1993](/archive/1993/11)

+ Return to<EMAIL_ADDRESS>(Harry S. Hawk)](/authors/habs_at_panix_com_harry_s_hawk_)"

+ 1993-11-15 (Mon, 15 Nov 93 02:44:01 PST) - Re: Should we oppose the Data Superhighway/NII? -<EMAIL_ADDRESS>(Harry S. Hawk)_


text:
# bitcoin-scripting 0.2.0

## Disclaimer

This is **ALPHA** software.  We make no claims to API stability or correctness.  We do encourage input from downstream users!

## Overview

This package aims to support application developers working with miniscript, and script descriptors.  The following features are available:

* Miniscript: parser, printer, compiler, type checker, and witness calculator
* Script descriptors: parser + printer, address and script calculations

## Development

Hackage hosts our [documentation][hackage].  Be sure to click the "source" links for highlighted source code with links to definitions.  To get started with the repository:

``` bash
git clone https://github.com/bitnomial/bitcoin-scripting
cd bitcoin-scripting
cabal build && cabal test
```

This software only builds with `GHC == 8.10.4` and we recommend using [ghcup][ghcup] to manage GHC versions.

Please format using `ormolu` or `fourmolu` (with default configuration).

[hackage]: https://hackage.haskell.org/package/bitcoin-scripting-0.2.0
[ghcup]: https://gitlab.haskell.org/haskell/ghcup

repository: Tomas-AJF/bitcoin-scripting

repo_name: Tomas-AJF/bitcoin-scripting


text:
---
title: "Symbolic Execution"
date: 2022-12-04
tags:
- seed
---

Helps with analysis where there are infinitely many initial states / executions. A (terminating) [[thoughts/program analysis]] can’t precisely explore them all!

**All-executions property: are there any executions of the program which violate the desired condition?** Equivalently, is there any way to reach a statement such that its Failure Condition is true?

Questions that value-dependent all-executions correctness analysis tries to answer:
1. `assert x == 42;` Can assert statements in this code ever fail?
2. `x = a[y];` Can execution of this code ever raise exceptions?
3. `throw new RuntimeException(...);` is this ever reached?
4. Will my function always satisfy its intended postcondition? etc.

1. We will input/unknown values as symbolic values; we give names to these unknowns.
    We track a symbolic state in our analysis, mapping program variables to symbolic expressions.
2. We will additionally track a set of path conditions: constraints representing the conditions which must be true in order to reach the current program point.

We can do something similar for loops by doing bounded unrolling.

## Program Reachability Example
- For loops
	- Find the set of variables assigned to in the loop body
	- Copy symbolic state before the loop, updating each assigned-to variable to map to a fresh symbolic value
		- Do this once for the start of the loop and once for right after the loop
	- Inside the loop, set the path condition to the loop condition
	- Outside the loop, set the path condition to the inverse of the loop condition
	- Continue both analyses

path: /content/thoughts/symbolic execution.md

branch_name: refs/heads/hugo

filename: symbolic execution.md

gha_language: SCSS


text:
# IP2Location Ruby Library

This is IP2Location Ruby library that enables the user to find the country, region or state, district, city, latitude and longitude, ZIP/Postal code, time zone, Internet Service Provider (ISP) or company name, domain name, net speed, area code, weather station code, weather station name, mobile country code (MCC), mobile network code (MNC) and carrier brand, elevation, usage type, address type, IAB category and ASN from IP address using IP2Location database. The library reads the geo location information from IP2Location BIN data file or web service.

Supported IPv4 and IPv6 address.

## Table of contents
 ```{eval-rst}
 .. toctree::

   self
   quickstart
   code
 ```

gha_language: Ruby


text:
# shiftybloke.github.io

Test all pages for working on:
- Desktop
- Tablet
- Phablet
- Phone
- Small Phone

New Page:
- Create a page which allows client to edit parts of the website with a good UX and UI design.

Militaria Page:
- Create a sidebar for choosing categories of products (filtering).
- Update page to work well in Desktop Version.
- Make the page more responsive to user action.
- Add a photo slider, allowing for more than one image per product.
- Get feedback relating to what the client wants to display on each product.

Shows Page:
- Get information from client regarding content.
- Update map to be more responsive to user action.

About Page:
- Get information from client regarding content.

https://getbootstrap.com/docs/4.0/components/modal/

https://bootstrapious.com/p/bootstrap-sidebar


text:
# AAR RailroadPM 2.0 Placeholder Site

This site was originally created by cloning the [Netlify One-Click Hugo CMS project](https://github.com/netlify-templates/one-click-hugo-cms). The relevant information from the original README file appears below, with a few edits to clarify and adapt the content to the **RailroadPM** project.

## Hugo Template for Netlify CMS with Netlify Identity

The original template for this site was built with [Victor Hugo](https://github.com/netlify/victor-hugo) and [Netlify CMS](https://github.com/netlify/netlify-cms), designed and developed by [Darin Dimitroff](http://www.darindimitroff.com/), [spacefarm.digital](https://www.spacefarm.digital).

### How We Got Started With This RailroadPM Site

First we installed [Node.js](https://nodejs.org/en/download/), [Hugo](https://gohugo.io/getting-started/installing/) and [Yarn](https://yarnpkg.com/lang/en/docs/install/). Then we kicked-off development of this site by cloning [this repository](https://github.com/netlify-templates/one-click-hugo-cms), and then running `yarn` from the new folder to install all required dependencies.

We then opened the project in [VSCode](https://code.visualstudio.com/) and started the development server with `npm start`.

### Layouts

The template is based on small, content-agnostic partials that can be mixed and matched. The pre-built pages showcase just a few of the possible combinations. Refer to the original `site/layouts/partials` folder for all available partials.

Use Hugo’s `dict` functionality to feed content into partials and avoid repeating yourself and creating discrepancies.

### CSS

The template uses a custom fork of Tachyons and PostCSS with cssnext and cssnano. To customize the template for your brand, refer to `src/css/imports/_variables.css` where most of the important global variables like colors and spacing are stored.

### SVG

All SVG icons stored in `site/static/img/icons` are automatically optimized with SVGO (gulp-svgmin) and concatenated into a single SVG sprite stored as a a partial called `svg.html`. Make sure you use consistent icons in terms of viewport and art direction for optimal results. Refer to an SVG via the `<use>` tag like so:

```
<svg width="16px" height="16px" class="db">
  <use xlink:href="#SVG-ID"></use>
</svg>
```

repository: railroadpm/placeholder-site

repo_name: railroadpm/placeholder-site


text:
{{{
  "title": "How do I escalate a ticket?",
  "date": "11-12-2014",
  "author": "Gavin McMurdo",
  "attachments": [],
  "contentIsHTML": true
}}}

Description (goal/purpose)

I have submitted a support request and need it to be executed immediately.

I have submitted a ticket and would like to escalate it.

CenturyLink Cloud did not deliver or perform what they committed to deliver in a ticket.

Audience

Customers who have a paid support contract

Pre-Requisites

Please DO NOT forward a previous ticket to this mechanism because the automation will add your email to that ticket.

Ticket number of the ticket that describes the issue in detail.

Please review the ticket prioritization matrix that can be found here:  https://t3n.zendesk.com/entries/21651149-Ticket-Prioritization-Matrix

Please ensure that this issue being escalated requires escalation. The majority of the escalation team reside in Seattle and please be aware of the time when you escalate.

Please have someone available to respond to any information request from CenturyLink Cloud. The majority of the time, these requests will be made via the original ticket. Not having someone available could delay the resolution of the issue
    and defeats the purpose of the escalation mechanism.

Detailed Steps

Please review the Ticket Prioritization Matrix so that you understand what priority your ticket should be.

email escalation@t3n.zendesk.com with the following information:

Subject: ESCALATION: Ticket - <your ticket number>

Message Body: Your message and a brief explanation of why you are escalating the ticket.

A ticket will be created in our system for your escalation and it will be automatically escalated to the CenturyLink Cloud operations management.

Q & A

Q - Is this capability available 24x7?

A - Yes, while the management team that responds to these requests is based on the USA West Coast, they do respond to escalations within 15 minutes. **The exception is an escalation for Service Tasks, which are only acknowledged
    from 7am-7pmPT.

Q - What criteria are used to evaluate a Service Request escalation request?

A - The members of the escalation team are members of the CenturyLink Cloud Support Management team. They will review the age of the original ticket, clarity of information in the original ticket, scope, skill level and
      time of day of the request.

Q - Will I be charged for escalating a ticket?

A - In general no; however for parties that misuse the escalation mechanism, CenturyLink Cloud does reserve the right to charge.

Q - I do not have a paid support contract, what will happen when I use this mechanism?

A - The automation will check to validate your contract and if you do not have a support contract, your escalation will not complete successfully.

repository: jeffmeacham/PublicKB

repo_name: jeffmeacham/PublicKB


text:
# Advice for fresh meat

- "The Two Things"
  - The Customer is Always Right  : Otherwise you wouldn't need them
  - The Customer is Usually Wrong : Otherwise they wouldn't need you

- Asking for help
  - When
    - Next step seems risky or risk level is uncertain
    - Stuck on what appears to be a contradiction
      - Customer asking for the impossible
      - System behavior not explained by available models
  - How
    - Minimize impact on them
    - Provide as much relevant information as possible up front
    - Express your questions with as little assumption about the answer as possible
    - Often preparation will reveal the answer before asking for help

- Have your own goals and plans

# Definitions

## Science

Science converts phenomena into predictive Models. The investment of Time into
Science increases the value of future time spent informed by Models that time
produces.

## Technology

Technology creates Tools from Science.

A Tool is a repeatable solution to a class of problems.

## Engineering

Engineering solves specific problems with Tools.

## Operations

Operations is a continuous process of developing and managing (or 'operating')
systems which provide a Service to a Customer. It is a subset of Business.

# Minimalism

Operations is an art of laziness.

As a facet of the game that is life, Operations seeks to minimize costs.
Everything, even inaction, will have a cost. gg

# The Seven Habits

## Be Proactive

Don't wait for monitoring, vendors or customers to tell you about challenges
and opportunities. Strive to reserve 10% of your time for identifying and
addressing such challenges and opportunities before anyone else notices them.

## Start With the End in Mind

While there is such a thing as too much planning, the better you understand
and document your ideal end conditions, the easier and cheaper it is to make
the best choices along the way.

## Put First Things First

You don't have to do everything, just the next thing.

At any given instant there are a limited number of choices available to you,
each of which will take you closer or farther from your identified End in
Mind. You will never know in advance exactly how each choice will affect your
progress; your best guess will necessarily suffice. It is, by definition, not
possible to improve on your best guess.

More often than many would predict, "Figure out the best next action" and
"chill" are sometimes the best next actions. The risk is that you will either
find yourself in Analysis Paralysis or miss out on a time-constrained
opportunity. This is one area where "Be Proactive" helps out: by performing
such analyses in advance, you can choose to spend less expensive time in these
ways.

## Seek First to Understand, Then to be Understood

This applies equally well to both systems and people.

Obviously any action taken to improve a system in complete ignorance of how
the system will respond to that action is of maximum possible risk. A given
investment of time in modeling a system and testing assumptions will pay out
as some degree of reduced risk.

## Think Win-Win or No Deal

## Synergize

## Sharpen the Saw

# The Variable Costs of Time

The cost of devoting time to a given activity depends on the time in question.

  - The cost of a person's time when they are impaired, such as having not
    rested, is higher. Or more accurately, the value of _their_ time when they
    are impaired is lower.
  - The cost of time increases in the face of a deadline
  - Spending time reducing the impact or urgency of a deadline may reduce that
    cost

repository: thatsnice/ops-dojo

repo_name: thatsnice/ops-dojo


text:
TOML
====

See also https://github.com/mojombo/toml

Python module which parses and emits TOML.

Released under the MIT license.

Current Version of the Specification
------------------------------------

https://github.com/mojombo/toml/blob/e3656ad493400895f4460f1244a25f8f8e31a32a/README.md

TO DO
-----

-Write a function to emit toml.

-Make sure the parser keeps up with the spec as it evolves.

repository: beygi/toml

repo_name: beygi/toml


text:
CartoDB-SQL-API metrics
=======================

## Timers
- **sqlapi.query**: time to return a query resultset from the API, splitted into:
    + **sqlapi.query.init**: time to prepare params from the request
    + **sqlapi.query.getDatabaseName**: time to retrieve the database associated to the query
    + **sqlapi.query.verifyRequest_apikey**: time to retrieve user and verify access with api key
    + **sqlapi.query.verifyRequest_oauth**: time to retrieve user and verify access with oauht
    + **sqlapi.query.getUserDBHost**: time to retrieve the host for the database
    + **sqlapi.query.getUserDBPass**: time to retrieve the user password for the database connection
    + **sqlapi.query.queryExplain**: time to retrieve affected tables from the query
    + **sqlapi.query.setHeaders**: time to set the headers
    + **sqlapi.query.sendResponse**: time to start sending the response.
    + **sqlapi.query.finish**: time to handle an exception
    + **sqlapi.query.startStreaming**: (json) time to start streaming, from the moment the query it was requested.
        * It's not getting into graphite right now.
    + **sqlapi.query.gotRows**: (json) Time until it finished processing all rows in the resultset.
        * It's sharing the key with pg so stats in graphite can have mixed numbers.
    + **sqlapi.query.endStreaming** (json) Time to finish the preparation of the response data.
        * It's not getting into graphite right now.
    + **sqlapi.query.generate**: (ogr) Time to prepare and generate a response from ogr
    + **sqlapi.query.gotRows**: (pg) Time until it finished processing all rows in the resultset.
        *  It's sharing the key with json so stats in graphite can have mixed numbers.
    + **sqlapi.query.packageResult**: (pg) Time to transform between different formats
        * It's not getting into graphite right now.
    + **sqlapi.query.eventedQuery**: (pg) Time to prepare and execute the query

## Counters
- **sqlapi.query.success**: number of successful queries
- **sqlapi.query.error**: number of failed queries

repository: kathypennacchio/CartoDB-SQL-API

repo_name: kathypennacchio/CartoDB-SQL-API


text:
# AESTD tag library
# v1.1-alpha for 20w15a

## Entity type flags

- `aligned_to_block_grid`
Entities that snap to the block grid unless they are a passenger of another entity. Does not include armour stands, which can be summoned at any position or moved outside of the block grid with pistons/water.

- `all`
All entities. Can be used with mods to only select vanilla entities.

- `arthropods`
Mobs in this tag take more damage when hurt with an item with the Bane of Arthropods enchantment.

- `bosses`
Mobs that are unaffected by potion effects from the effect command. Does not include elder guardians.

- `breedable`
Mobs that can be bred by players to create babies of the same type. Does not include villagers.

- `can_grief`
Mobs that can affect the blocks in the world when mobGriefing is set to true.

- `display_armor`
Entities that have armour slots which can display armour models.

- `end`
Mobs that can spawn in the end.

- `flying`
Mobs that are able to fly or to float, not including chickens.

- `hostile`
Mobs that will attack players in survival mode if possible.

- `living_base`
Entities that extend the LivingBase entity class: mobs, players and armour stands.

- `mobs`
All mobs, including boss mobs.

- `nether`
Mobs that can spawn in the nether, including mobs that are not only found in the nether (skeletons and endermen).

- `neutral`
Mobs that can but will not always attack players, including mobs that retaliate against player attacks or whose anger behaviour depends on age such as polar bears.

- `partial_invisibility`
Mobs that display part of their model when invisible, not including those who can only display armour or hand items such as zombies.

- `passive`
Mobs that will not attack players no matter what.

- `projectiles`
Moving entities that have motion or direction and can be cast by players or mobs, not exclusive to those that can deal damage to other mobs. Not including primed TNT or falling blocks.

- `rideable`
Entities that can be mounted and directed by players, including mobs that can be ridden using items (pigs and striders) and non-mob vehicles (boats and minecarts).

- `rideable_mobs`
Mobs that can be mounted and directed by players, including mobs that can be ridden using items (pigs and striders) but not non-mob vehicles.

- `swimming`
Mobs that are able to swim, not including those that can only float.

- `undead`
Mobs that are not attacked by withers, that are healed by the instant damage effect and hurt by the instant health effect, and that take extra damage when hurt with an item with the Smite enchantment.

- `vehicles`
Non-mob entities that can be mounted and directed by players.

- `zombies`
Undead mobs that can attack and convert villagers. Not including giants, zoglins and zombie piglins.

## Block tags

- `air`
Air blocks: air, cave air and void air.

- `all`
All blocks, including air and liquids. Can be used to only select vanilla blocks in fill or clone commands when mods are used.

- `all_but_air`
All blocks, excluding air, cave air and void air.

- `all_corals`
Coral fans and coral plants, dead or not. Does not include coral blocks, to be consistent with the #minecraft:corals tag which includes non-dead coral fans and plants.

- `block_entities`
Block entities, not including moving piston heads.

- `can_emit_light`
Blocks that can emit light, including blocks that always do (eg. glowstone) and blocks that have off and on states (eg. furnace)

- `command_blocks`

- `concrete`
Concrete blocks, does not including concrete powder.

- `concrete_powder`

- `contact_damage`
Blocks that deal contact damage to players who touch them. Does not include sweet berry bush which does not deal damage to players standing still.

- `coral_fans`
Does not include dead coral fans.

- `cubic`
Blocks with a 1x1x1 collision box.

- `dead_coral_blocks`
Does not include dead coral, dead coral plants and dead coral fans

- `dead_coral_fans`

- `dead_coral_plants`

- `dead_corals`
Comprises of dead coral fans and dead coral plants, for consistency with the #minecraft:corals block tag.

- `double_blocks`
Blocks whose collision box extends on the space of two blocks (eg. beds, doors). Does not include banners, whose collision box is contained in a single block's space.

- `emit_light`
Blocks that always emit light; does not include blocks with an off state such as furnaces.

- `end_blocks`
Blocks that can be found in the end, including in end cities and end ships.

- `end_stone_brick_blocks`
Blocks derived from end stone bricks

- `falling_blocks`
Blocks that can fall when placed or updated, including scaffolding and excluding TNT.

- `fence_gates`

- `flammable_blocks`
Blocks that can be consumed by fire. Includes TNT.

- `flammable_fence_gates`
Fence gates made from overworld planks

- `flammable_fences`
Fences made from overworld planks, excluding fence gates.

- `flammable_planks`
Overworld wooden planks

- `flammable_signs`
Signs made from overworld planks

- `flammable_slabs`
Slabs made from overworld planks

- `flammable_stairs`
Stairs made from overworld planks

- `flammable_wood`
Blocks made out of overworld wood. Not limited to wood blocks ("bark blocks") and excludes non flammable wood blocks made from nether wood.

- `fortune_changes_drops`
Blocks whose drops can be affected by fortune enchantments if their loot table is unmodified.

- `fungi`
Nether fungus blocks.

- `furnaces`
Block entities which can cook items.

- `glass`
Does not include glass panes.

- `glazed_terracotta`

- `heads`
Mob and player heads.

- `infested`
Blocks that spawn silverfish when mined.

- `infinite_fire`
Blocks on which fire can be lit and does not extinguish.

- `invisible`
Blocks that do not render a texture.

- `liquids`

- `mushroom_blocks`
Blocks that generate as part of huge mushrooms. Does not include mushrooms.

- `mushrooms`
Brown/red mushrooms. Does not include nether fungus or mushroom blocks.

- `natural_logs`
Logs that generate naturally, including nether stems. Unlike #minecraft:logs, does not include wood, hyphae and stripped variants.

- `nether_blocks`
Blocks that can be found in the Nether, including as part of Nether fortresses.

repository: Aeldrion/AESTD

gha_language: mcfunction

repo_name: Aeldrion/AESTD


text:
# NO LONGER MAINTAINED

I'm now running my own private/on-premise registry and am no longer using GCR. If you are interested in maintaining this, let me know.

# GCLOUD Service Account Command (Google Cloud SDK)

This image is designed to execute [gcloud](https://cloud.google.com/sdk/) commands authenticated by a [Google service account](https://cloud.google.com/storage/docs/authentication#service_accounts) (using JSON), without having to install the commands on each Docker host.

This was inspired by the need to automate container deployments from a private [Google Container Registry](https://cloud.google.com/tools/container-registry/) on virtual machines hosted with SoftLayer, AWS, & Linode (probably works with others too, but I didn't have time to test every host).

The image is based on alpine linux, giving it a very small footprint compared to other containers that do something similar.

 This is the equivalent of running:

```sh
gcloud auth activate-service-account \
  --key-file /path/to/projectkey.json \
  --project my-google-project \
  -q

gcloud components list
```

This will output something that looks similar to:

```sh
---------------------------------------------------------------------------------------------------------
|                                         Individual Components                                         |
|-------------------------------------------------------------------------------------------------------|
| Status        | Name                                          | ID                         |     Size |
|---------------+-----------------------------------------------+----------------------------+----------|
| Not Installed | App Engine Command Line Interface (Preview)   | app                        |   < 1 MB |
| Not Installed | App Engine SDK for Go                         | gae-go                     |          |
| Not Installed | App Engine SDK for Java                       | gae-java                   | 156.9 MB |
| Not Installed | App Engine SDK for Python and PHP             | gae-python                 |   < 1 MB |
| Not Installed | gcloud Alpha Commands                         | alpha                      |   < 1 MB |
| Not Installed | gcloud Beta Commands                          | beta                       |   < 1 MB |
| Not Installed | gcloud app Go Extensions (Linux, x86_64)      | app-engine-go-linux-x86_64 |  26.4 MB |
| Not Installed | gcloud app Java Extensions                    | app-engine-java            |  94.5 MB |
| Not Installed | gcloud app Python Extensions                  | app-engine-python          |   6.9 MB |
| Installed     | BigQuery Command Line Tool                    | bq                         |   < 1 MB |
| Installed     | Cloud DNS Admin Command Line Interface        | dns                        |   < 1 MB |
| Installed     | Cloud SDK Core Libraries                      | core                       |   1.9 MB |
| Installed     | Cloud SQL Admin Command Line Interface        | sql                        |   < 1 MB |
| Installed     | Cloud Storage Command Line Tool               | gsutil                     |   2.5 MB |
| Installed     | Compute Engine Command Line Interface         | compute                    |   < 1 MB |

To install new components or update existing ones, run:
 $ gcloud components update COMPONENT_ID
| Installed     | Compute Engine Command Line Tool (deprecated) | gcutil                     |   < 1 MB |
| Installed     | Default set of gcloud commands                | gcloud                     |   < 1 MB |
| Installed     | Developer Preview gcloud Commands             | preview                    |   < 1 MB |
---------------------------------------------------------------------------------------------------------
```

Notice te preview cloud commands are installed, because this image was really designed to use the Google Container Registry and Google Container Engine.

## Breakdown

#### PROJECT (Environment variable)

This is the name of the Google project, as found in the [developer console](https://console.developers.google.com) (Click on the project, then go to the Overview section).

#### /path/to/projectkey.json (volume)

To authenticate a service account, a key file (JSON) must be provided. Download the JSON file from the Google developer console (APIs & Auth > Credentials... assumes you've created a Client ID for a service account.). This key can be physically located anywhere on the server.

This image expects a volume to be mounted, mapping to a file called `/key/credentials.json`. So, if your key exists at `/path/to/my-service-account.json`, the volume can be mounted as `-v /path/to/my-service-account.json:/key/credentials.json`.

#### --privileged

This allows the command to execute as though it's on the phyiscal server.

### Using Docker with GCloud

This image was originally created in an effort to pull docker images onto a host machine from a private Google Container Registry. To do this, you must map the host Docker socket to the container. Just add `-v /var/run/docker.sock:/var/run/docker.sock` to the command to make this work.

## Automation

We use this image on our servers as part of an automatic deployment process, specifically to pull new images of our applications from our private Google Container Registry. To simplify this process, we usually create a script on the host server in the `/usr/bin` directory called `gcloud` to mimic the gcloud command. It looks like:

```sh
docker run \
  -e PROJECT=ecorproject \
  -v /keys/ecorprojectjwt.json:/key/credentials.json \
  -v /var/run/docker.sock:/var/run/docker.sock \
  --privileged \
  --rm \
  ecor/gcloud preview docker $*
```

Since the `/usr/bin` directory is already on the `PATH`, we can issue commands like `gcloud pull gcr.io/ecorproject/node-test`, which pulls our node.js test environment down from our private registry.

repository: ecorventures/docker-gcloud

repo_name: ecorventures/docker-gcloud


text:
# Random
> Module built over [jsonRPC](jsonRPC) module required for generating secure [_true_](https://random.org) random numbers

## Structure
Main entities in the model are [RandomOrgAPI](src/main/kotlin/me/y9san9/random/RandomOrgAPI.kt) and [RandomOrgClient](src/main/kotlin/me/y9san9/random/RandomOrgClient.kt). <br>

The first one is internal and used only as random.org RPC client implementation, and the second one is a high-level API which used by bot.

There are also [rpc](src/main/kotlin/me/y9san9/random/rpc) package with rpc requests generators

### Cons
You can see, the api implementation is a little bit 'low level' as it uses JsonObjects everywhere instead of serializers, it is because I'm lazy to implement custom serializer like that:
```kotlin
@JRPCMethod (
    // Optional, by default should be extracted as [ClassName.camelCaseToSnakeCase]
    name = "generateIntegers"
)
class GenerateIntegersMethod (
    // Marker of rpc id property
    @JRPCId
    val rpcId: Int,
    val apiKey: String,
    val n: Int,
    val min: Int,
    val max: Int
)
```

So PRs with implementation are welcome


text:
# FedRAMPup!

How annoying is it to get an inventory of AWS resources for FedRAMP and then put that into the SSP formatted CSV? Very. `fedrampup` will handle all of this for you. It can be run on it's own from a Docker container or in AWS in Fargate with S3 output.

FedRAMP requires a full list of assets in the cloud and quite a bit of data around it in the form of an Excel template called the SSP. This asset identification process can be tedious and expensive especially if you have multiple cloud accounts. Fedrampup allows you to automate asset collection by running a container that can automatically update an S3 CSV file in the exact you need for FedRAMP.

# Permissions/Setup

The example in `examples/terraform-ec2` shows creating two policies: one for S3 and then attaching the AWS Managed `SecurityAudit` policy. Since FedRAMPup can be run either in the account where it lives, or STS into other accounts, the permissions will have to be slightly different, so we'll handle both those cases:

### Single Account - Run FedRAMPup in the account that you're scanning
The policies attached to the role of the instance running FedRAMPup should be:

1. Create a Role with the following trust relationship
```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowEC2RoleAssumption",
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "ec2.amazonaws.com"
      },
      "Effect": "Allow"
    }
  ]
}
```
2. Create a policy for Bucket Write permissions (only if your output is S3) and attach it to the Role created in step 1.
```json
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "",
            "Effect": "Allow",
            "Action": "s3:PutObject",
            "Resource": [
                "[BUCKET_ARN]/*",
                "[BUCKET_ARN]"
            ]
        }
    ]
}
```

3. Attach the AWS Managed `SecurityAudit` policy to the Role created in Step 1.
4. Use that Role to attach to an EC2 instance, ECS Task, etc.

### Multiple Accounts - Run FedRAMPup in a different account than those you are scanning

1. Follow Steps 1 and 2 from the above section. Before you move on, you should have a Role in the account where FedRAMPup lives into other accounts that will be used for the resource (EC2 or ECS) running FedRAMPup.

2. Create a policy in the account where FedRAMPup lives to grant AssumeRole permissions to each of the accounts you want to access.

```json
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "AllowAssumeRole",
            "Effect": "Allow",
            "Action": [
                "sts:AssumeRole"
            ],
            "Resource": [
                "arn:aws:iam::111111111111:role/security_audit",
                "arn:aws:iam::222222222222:role/security_audit",
                ...
            ]
        }
    ]
}
```

3. Attach this policy to your FedRAMPup role.
4. Create a role in each account that you want to Assume Role into that corresponds with the policy for AssumeRole you just created. This role should have the following Trust Policy

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::[FedRAMPup Account ID]:root"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}
```

5. With the new role created allowing FedRAMPup to AssumeRole, you'll need to give this role that same `SecurityAudit` permission we talked about in the "Single Account" section.
6. Repeat step 5 and 6 for every account specified in the policy for FedRAMPup

# Configuration

Everyone's environment is different. That's why `fedrampup` has an extensive configuration framework based in environments in keeping with a [12 factor application](https://12factor.net/).

FedRAMP SSP expects the assets in a CSV with the rows:

- Unique Asset Identifier
- IPv4 or IPv6 Address
- Virtual
- Public
- DNS Name or URL
- NetBIOS Name
- MAC Address
- Authenticated Scan
- Baseline Configuration Name
- OS Name and Version
- Location
- Asset Type
- Hardware Make/Model
- In Latest Scan
- Software/Database Name
- Software/Database Version
- Patch Level
- Function
- Comments
- Serial Number/Asset Tag Number
- VLAN/Network ID
- System Administrator/Owner
- Application Administrator/Owner

There are several things you can configure, mainly what tags you use to identify assets. A full table of environment variables that can be passed in is below:

| Env Var | Default Value | Description |
| --- | --- | --- |
|REGIONS | `us-gov-west-1` | Comma separated list of AWS regions |
|ROLES | | Comma separated list of AWS Role ARNs of separate accounts that will be scanned. If empty only the account with the EC2 Role for the host this is running on will be run. If not running on EC2, it will take credentials from Env |
|OUTPUT_FILE | `output.csv` | Output file name. If this starts with `s3://` it will be treated as an S3 URI. Output format can be one of: csv |
|AWS_REGION | `us-gov-west-1` | If S3 output is desired, this is the region of the S3 bucket.
|SCAN_INTERVAL | `24h` | How often security scans are run in your organization in [Go duration format](https://golang.org/pkg/time/#ParseDuration) (i.e. 1h10m, 5m, etc.) |
|TAG_NETBIOS | `NetBIOS`| EC2 tag used for NetBIOS name for Windows hosts|
|TAG_ASSET_TYPE | `AssetType` | EC2 tag used for Asset Type |
|TAG_BASELINE_CONFIG | `BaselineConfiguration` | EC2 tag used for Baseline Configuration|
|TAG_AUTHENTICATED_SCAN_PLANNED | `AuthenticatedScanPlanned` | EC2 tag used for if and authenticated scan is planned |
|TAG_LAST_SCANNED | `LastScanned` | EC2 tag used for when the last scan was run on the host. Should be in RFC822 Format: "02 Jan 06 15:04 MST" (https://www.w3.org/Protocols/rfc822/ "Date and Time Specification") |
|TAG_APPLICATION_VENDOR | `ApplicationVendor` | EC2 tag used for Software/Database Vendor Name|
|TAG_APPLICATION_NAME_VERSION | `ApplicationNameAndVersion` | EC2 tag used for Software/Database Application Name and Version|
|TAG_APPLICATION_PATCH_LEVEL | `ApplicationPatchLevel` | EC2 tag used for Software/Database Patch Level |
|TAG_APPLICATION_FUNCTION | `ApplicationFunction` | EC2 tag used for Software/Database Function|
|TAG_COMMENTS | `Comments` | EC2 tag used for Comments|
|TAG_SERIAL_NUMBER | `SerialNumber` | EC2 tag used for the asset's serial number|
|TAG_SYSADMIN | `SysAdmin` | EC2 tag used for the asset's sysadmin or team|
|TAG_APPADMIN | `AppAdmin` | EC2 tag used for the asset's appadmin or team|

# Development

1. Make changes
2. Add tests
3. Run go tests with `make test`
4. If you want to run locally, `make run`
5. Push your change to a fork and open a PR


text:
TETRIS GAME

The Game that kids play and programmers love to code

 VERSION 1.0.1

Tetris is a tile-matching puzzle video game originally designed and programmed by Soviet Russian game designer Alexey Pajitnov. The first playable version was completed on June 6, 1984, while he was working for the Dorodnitsyn Computing Centre of the Academy of Science of the Soviet Union in Moscow. He derived its name from the Greek numerical prefix tetra- (all of the game's pieces contain four segments) and tennis, Pajitnov's favorite sport. The name is also used in-game to refer to the play where four lines (the maximum simultaneous clearance number) are cleared at once.

## ![image](docs/icon.ico) DEPENDENCIES

* javac compiler
* [RAINBOW package](https://github.com/GauravWalia19/RAINBOW)
* LINUX/UNIX Command Line Interface

## ![image](docs/icon.ico) Documentation

working...

## ![image](docs/icon.ico) BUILD

### BUILD IN LINUX / UNIX

Move to build directory

```bash
cd build
```

For building run build script using

```bash
bash build.bash
```

### BUILD IN WINDOWS

Move to build directory

```powershell
Set-Location build
```

For building run build script using

```powershell
pwsh build.ps1
```

## ![image](docs/icon.ico) TEST

### Testing in Linux / Unix

Move to test directory

```bash
cd test
```

For testing in linux use test script

```bash
bash test.bash
```

### Testing in Windows

Move to test directory

```powershell
Set-Location test
```

For testing in windows use test script

```powershell
pwsh test.ps1
```

## ![image](docs/icon.ico) RUN

### Running in Linux/Unix

Run the **tetris.bash** for running the updated version.

```bash
bash tetris.bash
```

### Running in Windows

Run the **tetris.ps1** for running the updated version.

```powershell
pwsh tetris.ps1
```

### For running the release jar

Use these commands

```bash
cd release                  # go to release directory
java -jar Tetris.jar        # run the jar file
```

## ![image](docs/icon.ico) CONTRIBUTION

See [contribution details](CONTRIBUTING.md)

### LICENSE

[MIT License](LICENSE)

:copyright: 2019 Gaurav Walia

gha_language: Java


text:
---
layout: page
title:  "Book Review: Antifragile - by Nassim Taleb"
breadcrumb: true
categories:
    - bookreview
tags:
    - blog
    - content
    - post
    - post format
header:
    image_fullwidth: gallery-example-1.jpg
---
**Antifragile - by Nassim Nicholas Taleb**

**Summary:**

Some interesting and out-there ideas, written in his usual punchy, combative way. The key theme is that some things are "fragile" and we should strive for things that are the opposite. Key examples provide in government, financial markets & business, health etc.

**Notes:**

- Some things do well when exposed to volatility/ randomness/ stress. Examples include evolution, technological innovation, culture, ideas etc.

- Anything that has more upside than downside from random events is "antifragile" but only up a certain amount of tolerable stress.

- Many modern problems (health, parenting) due to lack of suitable stressors.

- We can live happily in a world we don’t understand.

- Heuristics - simplified rules of thumb that make things simple and we know they're not perfect.

- Humans often fail to recognize situations outside the contexts they originally encountered them.

- To innovate, get in trouble.  “Necessity is the mother of invention.”

- Most people squander their free time - makes them lazy and unmotivated.

- Layers of redundancy are the main risk management property of natural systems.

- Machines are harmed by low-level stressors, organisms are harmed by the absence of low-level stressors (hormesis). Humans do better with acute than with chronic
stressors, but need time for recovery.

- Language learning is best when you need to communicate under pressure, or situational difficulty, suspending one’s fear of making mistakes.

- Some parts inside of a system may need to be fragile to make the system antifragile.

- Having a word for something helps spread awareness of it.

- It’s much easier to sell “Look what I did for you” than “Look what I avoided for you.” Bonus system based on “performance” exacerbates this.

- Antifragile doesn’t need to have as accurate a picture of the world as the fragile. Make things more robust to defects and forecast errors.

- Seneca was the richest man in the Roman Empire. He focused on the practical aspect of Stoicism, dealing with adversity, poverty and wealth.

- Success is asymmetric, you have more to lose than to gain. You become fragile. Possessions make us worry about downside. Seneca’s method was mental exercises to write off possessions. Stoicism is about the domestication, not necessarily the elimination, of emotions.

- If you have less to lose than to gain, more upside than downside, then you like volatility and are antifragile.

- Never ask people what they want, or where they want to go, or where they think they should go.
- What is learnt in the classroom stays largely in the classroom.

- "Only the autodidacts are free."


text:
# lingval

Tool for making Russian text analysis - paragraphs, sentences and words count, word clouds, dialogues percentage, sentiment and POS analysis and even more.

## Requirements

This tool uses Python 3 so you need to have Python 3 and pip for build and run it. To install them use instructions for your OS.

It also needs some extra libraries (see file [requirements.txt](requirements.txt)). Use pip to install them. For example:

``` bash
pip3 install -r requirements.txt --user
```

On some systems you should also install *python3-dev* package.

## Usage

It's a console tool. You can run it using these commands:

```bash
python main.py
#or
python3 main.py
```

Lingval has some command line attributes:

```
usage: lingval [-h] [--file FILE] [--lang LANG] [--about]

Tool for analyzing Russian fiction texts.

optional arguments:
  -h, --help   show this help message and exit
  --file FILE  File for analyze
  --lang LANG  Set locale
  --about      Show about info
```

For example to analyse file text.txt and make output in Russian run:

```bash
python main.py --file text.txt --lang ru
#or
python3 main.py --file text.txt --lang ru
```

Files must be in **UTF-8** encoding.

When completed there will be a folder named "output/text" containing these files:

- **collocations.csv** - 10 top collocations;
- **common_data.csv** - paragraphs, sentences, words and symbols count;
- **dialogues_info.csv** - dialogues percentage;
- **pos_data.csv** - POS count and percentage;
- **sentences_data.csv** - sentences count, max, average, median and mode lengths;
- **sentiments.csv** - sentiments percentage;
- **topwords_data.csv** - 20 top words;
- **longest_sentence.txt** - longest sentence;
- **words.png** - wordcloud with words;
- **lemmas.png** - wordcloud with lemmas.

## Examples

Here are some lingval results (in Russian).

[Anna Karenina by Leo Tolstoy, Crime and Punishment by Fyodor Dostoevsky and Prisoners of Power, also known as Inhabited Island by Arkady and Boris Strugatsky](examples/common.md).

## Credits

This tool uses some libs and packages:

- Yandex Mystem - tool for lemmatizing Russian texts;
- pymystem3 - Python wrapper for Yandex Mystem;
- nltk - toolkit for processing natural languages;
- dostoevsky - tool for making sentiment analysis for Russian texts;
- wordcloud - package for making word clouds;
- tabulate - package for printing tables;
- argparse - package for parsing command line args;
- stop_words - package with list of stop words.

## Contact

You are welcome to open [new issue](https://github.com/qiray/lingval/issues/new) if you have any questions, suggestions or bugs.

If you like this project you can star it [here](https://github.com/qiray/lingval).

## License

This program uses MIT license. For more information see the LICENSE file.

repository: qiray/lingval

repo_name: qiray/lingval


text:
---
# Display name
title: Gilles P.P.L. Otten

# Username (this should match the folder name)
authors:
- admin

# Is this the primary user of the site?
superuser: true

# Role/position
role: Postdoctoral Researcher

# Organizations/Affiliations
organizations:
- name: CNRS
  url: "https://www.cnrs.fr"
- name: LAM
  url: "https://www.lam.fr"

# Short bio (displayed in user profile at end of posts)
bio: My research interests include high contrast imaging, high resolution spectroscopy and interferometry.

interests:
- Astronomical instrumentation
- Exoplanets
- Achromatic optics
- Coronagraphy
- High dispersion spectroscopy
- Wavefront sensing
- Genealogy
- Genetics
- History

education:
  courses:
  - course: PhD in Astronomical Instrumentation
    institution: Leiden Observatory
    year: 2016
  - course: MSc in Astronomy
    institution: Leiden University
    year: 2011
  - course: BSc in Astronomy
    institution: Leiden University
    year: 2009

# Social/Academic Networking
# For available icons, see: https://sourcethemes.com/academic/docs/page-builder/#icons
#   For an email link, use "fas" icon pack, "envelope" icon, and a link in the
#   form<EMAIL_ADDRESS>or "#contact" for contact widget.
social:
- icon: envelope
  icon_pack: fas
  link<EMAIL_ADDRESS># For a direct email link, use<EMAIL_ADDRESS>- icon: "orcid"
  icon_pack: ai
  link: "https://orcid.org/0000-0002-6717-1977"
- icon: google-scholar
  icon_pack: ai
  link: https://scholar.google.com/citations?user=C1TE22wAAAAJ
- icon: "linkedin"
  icon_pack: "fab"
  link: "https://www.linkedin.com/in/gilles-otten-a68b8b93/"
# Link to a PDF of your resume/CV from the About widget.
# To enable, copy your resume/CV to `static/files/cv.pdf` and uncomment the lines below.
# - icon: cv
#   icon_pack: ai
#   link: files/cv.pdf

# Enter email to display Gravatar (if Gravatar enabled in Config)
email: ""

# Organizational groups that you belong to (for People widget)
#   Set this to `[]` or comment out if you are not using People widget.
#user_groups:
#- Researchers
#- Visitors
---

Astronomer at Laboratoire d’Astrophysique de Marseille in France working on the combination of high contract imaging and high dispersion spectroscopy. Involved in the MASCARA project at Leiden Observatory which searches for transiting exoplanets around the brightest stars. PhD on the prototyping, lab-testing and on-sky demonstration of a new type of broad-band coronagraphs. Amateur-genealogist with an interest in genetics as a tool to research family history.

repository: gotten/academic-kickstart

repo_name: gotten/academic-kickstart