text:
# Welcome to the DPDirect Services Framework

### Summary
The DPDirect Services Framework is an XML driven DataPower Web Services framework.
DataPower GUI familiartiy or domain knowledge is not essential. Service development is pure XML, requiring only an XML editor to develop:
- WSDL and XSD interfaces
- XML service configuration
- XSL stylesheet XML transformation

### Overview
The DPDirect Services Framework provides a robust, flexible service chain, enabling any number of optional and easily configurable processing steps in any order, including AAA, schema validation, XML-to-any transformation, MTOM encoding and decoding, and conditional service calls. The framework supports multiple transport protocols and data formats.

![Services1](https://github.com/mqsysadmin/DPDirectServicesFramework/blob/master/distribution/doc/images/xmlservices.png)

### Rapid, XML-Only Development ###
Typically, defining a new service consists of the following steps:

1) Service WSDLs (and referenced schemas, if any) are placed in the service-schema directory.

2) A service configuration is created for each WSDL, constrained by a service configuration schema, and can be built from a template. The service configuration will contain a relative path reference to the associated WSDL. Each service operation will be defined in the service config. Configuration for a particular operation may contain any number of optional steps, in any order, including transformation, schema validation, MTOM encoding and decoding, service calls and aggregation. A request configuration might look like the following:
~~~
<RequestPolicyConfig schemaValidate="true">
	<Transform>
		<Stylesheet>local:///framework-soa-esb/services/RetrieveSomething/V1.0/ChangeSomething.xsl</Stylesheet>
	</Transform>
	<BackendRouting provider="SomethingService">
		<HTTPEndpoint>
			<Address>${somethingHttpEndpoint}</Address>
		</HTTPEndpoint>
		<TimeoutSeconds>10</TimeoutSeconds>
	</BackendRouting>
</RequestPolicyConfig>
~~~
3) If transformation, aggregation etc is required, xslt stylesheet(s) are placed in the services directory, and referenced in the service config.

#### Assuming your environment variables (hostnames etc) have already beed defined, all that is left is build and deploy. ####

Use the pre-defined Verify Service as a WSDL and Service Configuration template, and explore the ServiceConfig schema, or a schema aware editor to discover supported service chain operations.

### Multi-Protocol Gateway ###

Optionally deploy a multi-tenancy aware Multi-Protocol Gateway to enable service invocation via MQ, SFTP etc, or to provide mediation services to XML consumers that are not SOAP aware. The gateway is configuration free - and is created at build-time from the information contained in existing service WSDLs and configuration files.

### API Gateway: Present an JSON/REST Service Facade ###

Optionally deploy a fast, lightwieight API gateway to provide a AAA protected JSON/REST API interface to services. The API Gateway supports several authentication and authorization schemas, and is readily extensible to integrate in any way you need it to.

### Build and Deploy ###

The project provides Maven and Ant build configurations, and may be deployed via a dedicated ant task, or via any script capable of command-line execution. Example scripts are provided. For more details on the DPDirect command-line and ant-task utility, see the aligned DPDirect project at https://github.com/SysIntAu/dpdirect.

---------------------------------------------

This project is currently under active development. This page, and accompanying guides, will be augmented<EMAIL_ADDRESS>

repository: SysIntAu/DPDirectServicesFramework

gha_language: XSLT

repo_name: SysIntAu/DPDirectServicesFramework


text:
---
layout: post
title:  Link & Thought Dump September '22
date:   2022-09-24 15:01:35 +0300
image:  links/dolomites.jpg
tags:   Blog
---

Recent thought loops - posture, VR, health, agency

I've been considering my remote work setup a lot recently. I think I've diverged somewhat from societal consensus on this, which is interesting, but it means I should probably post my thinking publicly to ensure my contrarianism isn't bullshit. I'd like to write something more comprehensive, but for now -

* You shouldn't sit on a chair
* You need to be active very frequently, with eye breaks, every 20 minutes or so
* Stretching doesn't work, neither does actively correcting your posture
* Posture has mental components which need to be addressed
* To fix posture, strengthen your body in the correct way
* Varied motion and sensory input is key

Associated content
[Nutritious Movement](https://www.nutritiousmovement.com/move-more-without-exercise/)
The book Deskbound by Kelly Starrett (some parts)
[Kneesovertoesguy](https://www.youtube.com/c/TheKneesovertoesguy)

During college I had a major software upgrade to my thought process regarding money / life / career. I hadn't found a great way to explain it in words though, until I found [this patio11 article which gets about 80% of they way there for me!](https://www.kalzumeus.com/2011/07/08/business-psychology/) It's about how running a business changes the way your brain works, but specifically it's about how increasing agency through running a business changes your brain.

I really liked [this post which lists 20 modern heresies](https://www.secretorum.life/p/20-modern-heresies?s=r&utm_campaign=post&utm_medium=web). It's great because it's difficult to see past the water in which we all swim - reading this shakes the mind in a good way.

[Thread about high agency](https://twitter.com/tweet_librarian/status/1418334127317680130)

[An article about a monk in Japan who has dedicated his life to fighting suicide](https://www.newyorker.com/magazine/2013/06/24/last-call-3). I'm not sure what my takeaway from this article was, but I think it's beautiful and I reread it frequently.

>Once, a man walked for five hours to get to Nemoto’s temple. The walk was a heroic journey for this man, because he had been living as a hikikomori, and now suddenly he was outside in the sun, sweating and feeling his body move. As he walked, he thought about what he was going to say. It had been so long since he had really spoken to anyone, and now he was going to be expected to explain his most intimate feelings to a stranger. He sweated and thought as he walked, and when at last, after five hours, he arrived at the temple he announced that he had achieved understanding and no longer needed Nemoto’s help. He turned around and walked back home.

[Technical debt of the West](https://meltingasphalt.com/technical-debt-of-the-west/). The following quote gives you an idea of what this is about.

> Here's a recipe for discovering new ideas:
> * Examine the frames that give structure (but also bias) to your thinking.
> * Predict, on the basis of #1, where you're likely to have blind spots.
> * Start groping around in those areas.
>
> If you can do this with the very deepest frames — those that constrain not just your own thinking, but your entire civilization's — you can potentially unearth a treasure trove of insight. You may not find anything 100% original (ideas that literally no one else has ever seen), but whatever you find is almost guaranteed to be underappreciated.

[Incredible photos of Mauritania](https://m1key.me/photography/mauritania_part_1/). Sometimes I forget how different life can look. Tuaregs got the drip.

license: MIT

branch_name: refs/heads/master

extension: markdown

license_type: permissive


text:
# iolinker

Web: http://jinvent.de/iolinker

## The iolinker Chips

Every iolinker chip functions as a dynamically configurable IO matrix. Its main functionality, besides IO extension, is to dynamically set up a matrix of GPIO connections, that allow direct pass-through of high-frequency signals. Circuits can thereby be configured and programmed on the fly. There are UART / SPI / I2C versions that allow for easy integration of up to 127 chips connected in parallel. PWM signal output is possible as well.

You can find the datasheet at http://jinvent.de/resources/iolinker_datasheet.pdf.

## The iolinker Library

The iolinker library allows easy interfacing of the iolinker chips, on a PC, a Raspberry Pi or on an Arduino. It works with UART, SPI and I2C chips.

## Install

To use the library on a PC, simply switch into the iolinker library directory and use *make clean test* to compile and run the unit tests, or *make clean pcserial* to compile the serial test program.

To use the library on an Arduino, download the IOLinker.zip file, and use Sketch -> Import Library -> Add Library. Then paste below code examples into your main program.

To compile it on a Raspberry Pi, please install the WiringPi library first (http://wiringpi.com/download-and-install/). Also run *sudo apt-get install g++-4.8*. *make -f Makefile.pi clean pi* in the iolinker library directory is enough to compile a test program afterwards. Run it with *sudo ./iolinker_pi*.

## Example usage

Note that wherever the examples use *Serial.println()*, the code may seem Arduino specific. But you could as well change the appropriate lines into a *printf()* statement for Raspberry or PC usage. The iolinker specific code is universal.

### Initialization on PC and Raspberry

First include the library header and create a class object:

```c++
#include <IOLinker.h>

IOLinker iolinker;
```

Setting up the serial interface on a Raspberry or PC, to communicate with an UART iolinker chip:

```c++
iolinker.beginSerial("/dev/ttyAMA0"); // or ttyUSB0 or the like
```

Setting up the SPI interface on a Raspberry, to communicate with an SPI iolinker chip:
```c++
iolinker.beginSPI(0); // Channel 0
```

Setting up the I2C interface, for I2C chips:
```c++
iolinker.beginI2C();
```

Please make sure to run the wiringPi setup functions, e.g. *wiringPiSetup()*, before you use the iolinker library on the Raspberry.

### Initialization on an Arduino:

Setting up the serial interface to communicate with UART iolinker chips:

```c++
Serial.begin(IOLINKER_BAUDRATE); // Use Serial1 on Arduino Leonardo!
while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
}
iolinker.beginStream(Serial);
```

Setting up the SPI interface, for SPI chips:
```c++
iolinker.beginSPI();
```

Setting up the I2C interface, for I2C chips:
```c++
iolinker.beginI2C();
```

### Slave address set-up

You can connect up to 127 chips in parallel. Their addresses are set through their hardware slave address port (IN1 to IN7).

When using multiple, address collision obviously has to be avoided. I suggest you start with address 1 and go up from there.

```c++
iolinker.targetAddress(1);
```

When using only one chip, you can cheat if you aren't sure about its slave address:

```c++
/* Walk through possible slave addresses and use first one that works */
iolinker.targetAddress(iolinker.firstAddress());
Serial.print("The first slave address is ");
Serial.println(iolinker.firstAddress(), DEC);
```

### TYP: Changing pin types

By default, all pins on the iolinker chip are Tristate (open collector) inputs. Change those easily:

```c++
iolinker.setPinType(IOLinker::IOLINKER_OUTPUT, 1); // P1 is an output
iolinker.setPinType(IOLinker::IOLINKER_OUTPUT, 2); // P2 is an output
iolinker.setPinType(IOLinker::IOLINKER_INPUT, 2); // P2 is a tristate input now
iolinker.setPinType(IOLinker::IOLINKER_OUTPUT, 6, 64); // P6 to P64 are outputs
```

Outputs are low, until their output value is changed with the SET command.

### SET: Change pin output value

```c++
// Don't forget to set pin types first, see TYP section.

iolinker.setOutput(true, 1); // P1 is high
iolinker.setOutput(false, 2); // P2 is low
iolinker.setOutput(true, 6, 48); // P6 to P48 are high

uint8_t s[] = { 0x00, 0xff };
iolinker.setOutput(s, sizeof(s), 49, 64); // P49 to P56 are low, P57 to P64 are high
```

### REA: Read pin states

The *readInput()* method allows to determine pin states. On an Arduino this would work:

```c++
// Don't forget to set pin types first, see TYP section.

if (iolinker.readInput(3)) {
    Serial.println("P3 is high!");
} else {
    Serial.println("P3 is low!");
}
```

### LNK: Link pins

Link two pins, and configure your circuit dynamically! The pin link allows to transfer MHz signals from one iolinker pin to another.

```c++
// Don't forget to set pin types first, see TYP section.

iolinker.link(3, 1); // P1 outputs all values from P3
iolinker.link(iolinker.invert(3), 2); // P2 outputs all values from
                                      // P3's inverted pin state
iolinker.link(3, 9, 11); // P9 to 11 output all values from P3
iolinker.link(IOLinker::IOLINKER_VIRTUAL_CLK256, 12); // P12 outputs the internal iolinker clock divided by 256
```

For more virtual pins, check out the iolinker datasheet, section "Pin addresses".

### PWM: Activate pulse width modulation

```c++
// Don't forget to set pin types first, see TYP section.

iolinker.pwm(127, 6); // P6 is 100% on -- equals normal high state
iolinker.pwm(0, 7); // P7 is 0% on
iolinker.pwm(64, 8, 15); // P8 to P15 are ~50.4% on

iolinker.setOutput(true, 6, 15); // PWM output is only active when the pins are set to output type, and their output state is set to high

iolinker.setOutput(false, 12); // Turn PWM output on P12 back off, just for demonstration
```

### Synchronizing pin updates

If you are updating a lot of pins individually and want the effect to be simultaneous, the iolinker chips allow to buffer pin settings. For that purpose, you first use the SYN command with *iolinker.beginBuffering()*, then run your pin update commands, and then trigger the simultaneous pin update using the TRG command with *iolinker.executeBuffer()*.

```c++
// Prepare buffered pin update
iolinker.beginBuffering();

// Your commands
iolinker.pwm(13, 8); // P8 will be ~10.23% on
iolinker.setOutput(true, 9); // P9 will be high
iolinker.setOutput(false, 10); // P10 will be low

/* Note that the last four commands did not have any effect on the
   actual pin states yet! We activate them all at once now: */

iolinker.executeBuffer(); // Simultaneous pin update!
```

### CLR: Clear PWM output and link settings for pins

If you want to turn pin links back off for a pin and reuse it for something else, use the *iolinker.clearPinFunctions(firstpin, lastpin)* method.

```c++
iolinker.clearPinFunctions(1); // Reset settings for P1
iolinker.clearPinFunctions(2, 10); // Reset settings for P2 to P10
```

### Listen for IO interrupts

The *iolinker.registerInterrupt(pin)* method on Arduino activates the pin change interrupt for the given pin number. The pin number is that on which you connected the INT line from the iolinker chip.

The *iolinker.registerInterrupt(pin, callback_function)* method on Raspberry activates the pin change interrupt and calls the function pointer provided on pin change. The callback function takes no parameters and returns void.

The simplest way to listen for interrupts on the iolinker input pins on an Arduino goes like this:

```c++
void setup() {
    // ...

    // INT pin connected to Arduino pin 9
    iolinker.registerInterrupt(9);
}

ISR (PCINT0_vect) {
    Serial.println("One of the input pins just switched!");
}
```

A more elaborate approach with some debouncing would use the interrupt only to record events, and let the main program handle them periodically, such as this Arduino code:

```c++
#include <IOLinker.h>

IOLinker iolinker;
volatile uint8_t interrupt_event = 0;

ISR (PCINT0_vect) {
    interrupt_event = 1;
}

void setup() {
    Serial.begin(9600);
    while (!Serial) {
        ; // wait for serial port to connect. Needed for Leonardo only
    }

    iolinker.beginSPI(); // Connect to SPI chip
    iolinker.targetAddress(1); // Address 1
    iolinker.setPinType(IOLinker::IOLINKER_INPUT, 3); // P3 is our input
    iolinker.registerInterrupt(9); // INT is connected to Arduino pin 9

    Serial.println("Now listening for pin interrupts on P3!");
}

void loop() {
    if (interrupt_event != 0) {
        Serial.println("New interrupt event!");
        Serial.print("My favorite pin is ");
        if (iolinker.readInput(3)) {
            Serial.println("high.");
        } else {
            Serial.println("low.");
        }

        delay(300); // debounce button by ignoring events for 300ms
        interrupt_event = 0;
    }
}
```

### Reset chip state

```c++
iolinker.reset();
```

### Storing long command sequences in string buffer

If you want to save long command sequences more efficiently, e.g. to read a
configuration from flash on boot, and to then write it out, the
*sendBuf(buf, len)* method may be of use to you. The passed byte string
contains only command bytes and arguments. The method takes care of adding
target address and CRC and writes out the messages in the string one by one.

```c++
uint8_t iolinker_config[] = {
    0x82, 0x00, 0x01, 0x00, 0x0f, 0x03, /* TYP P1 to P15 as output */
    0x82, 0x00, 0x10, 0x00, 0x1f, 0x00, /* TYP P16 to P33 as input */
    0x83, 0x00, 0x01, 0x00, 0x07, 0x7f, /* SET P1 to P7 high */
    0x84, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x0f, /* LNK P16 to P15 */
};

iolinker.targetAddress(1);
iolinker.sendBuf(iolinker_config, sizeof(iolinker_config));
```

## Dependencies

* Raspberry
  * Installed WiringPi (http://wiringpi.com/download-and-install/)
  * g++-4.8 (apt-get install g++-4.8)

extension: md


text:
# CarND-PID-Controller

## Implementation of PID algorithm

### Choosing hyperparameters
I manually tuned the PID coefficients, starting each with 0.

At the end, the hyperparameters Kp_ = -0.15, Ki_ = 0, Kd_ = -2 worked well for the project.

## The effect of the P, I, D component of the PID algorithm

* The P component tries to make the vehicle turn towards the intended path in proportion to the CTE.
* The D component tries to avoid the overshoot by noticing the reduced error.
* The I component tries to adjust the bias created by the vehicle.


text:
# Overview

This bundle provides a complete deployment of the core components of the Apache
Hadoop platform.  This document describes how the components of this deployment
are connected and how to connect additional services to the deployment to add
functionality.

# Building on this Bundle

This bundle supports two ways to extend its functionality via additonal charms:
by relating to the subordinate `apache-hadoop-plugin` charm, or by using a
stand-alone charm connecting to HDFS and YARN via standard relations.

## Subordinate Charm Connection

By connecting to the [plugin charm](https://jujucharms.com/apache-hadoop-plugin)
via the `hadoop-plugin` subordinate relation, a charm will get access to a
pre-configured Apache Hadoop environment, including Java libraries and the
`hdfs` command-line utility.  The `/etc/environment` file on the unit will
have all of the path and configuration variables defined.

The details of the interface protocol used by this relation are documented in
the DEV-README.md of the [plugin charm](https://jujucharms.com/apache-hadoop-plugin).

For example, to deploy [apache-hive](https://jujucharms.com/apache-hive) with
this bundle, you would use:

    juju quickstart apache-core-batch-processing
    juju deploy cs:trusty/apache-hive
    juju add-relation apache-hive plugin

This workflow has been bundled and is available as
[apache-analytics-sql](https://jujucharms.com/apache-analytics-sql).

## Stand-alone Charm Connection

If a charm does not need the Java libraries, environment config, etc., and only
needs the address information for the NameNode and ResourceManager, then it
can connect to the [hdfs-master](https://jujucharms.com/apache-hadoop-hdfs-master)
and [yarn-master](https://jujucharms.com/apache-hadoop-yarn-master) services via the
`namenode` and `resourcemanager` relations, respectively.

The details of the interface protocols used by these relations are documented
in the DEV-README.md of the respective charms.

For example, to deploy [apache-hue](https://jujucharms.com/apache-hue) with
this bundle, you would use:

    juju quickstart apache-core-batch-processing
    juju deploy cs:trusty/apache-hue
    juju add-relation apache-hue hdfs-master

# Component Services

This bundle deploys five services on a total of seven units
(for detailed information, including relation specifications,
see each charm's DEV-README.md):

* [**hdfs-master**](https://jujucharms.com/apache-hadoop-hdfs-master)
  This service runs the NameNode component.

* [**secondary-namenode**](https://jujucharms.com/apache-hadoop-hdfs-secondary)
  This service runs the Secondary NameNode component.

* [**yarn-master**](https://jujucharms.com/apache-hadoop-yarn-master)
  This service runs the ResourceManager component.

* [**compute-slave**](https://jujucharms.com/apache-hadoop-compute-slave)
  Each of the three units of this service runs both the DataNode and NodeManger components.

* [**client**](https://jujucharms.com/apache-hadoop-client)
  This service provides an endpoint from which to run jobs, whether manually or via connected services.


text:
# xooa-starters
Starter codes for Hyperledger Fabric and Ethereum blockchains using respective languages. i.e. nodejs, golang and java for Hyperledger Fabric and solidity for Ethereum.

You can quickly get started developing your blockchain applications with starter codes available in zip files.
You can use command line tool [xooa-cli](https://www.npmjs.com/package/xooa-cli) to generate your starter repository and to deploy and test on Xooa blockchain network.

If you are a VSCode fan then [Xooa Extension](https://marketplace.visualstudio.com/items?itemName=Xooa.xooa-extension) will help you create, deploy and manage your blockchain applications.


text:
# VEGA Token V2
This repository contains all of the smart contracts and tests for both VEGA Token V2 and ERC20 Vesting. VEGA V2 is the replacement ERC20 token used for staking and governance on the Vega network. It replaces an earlier V1 token that was issued to early investors and contained a single unlock mechanism. V2 and Vesting was created to allow for multiple "vesting tranches" that linearly unlock tokens over time. This allows different investor classes and holders to be assigned different unlock schedules in a way that is provably and securely issued to the target investor/holder.

To view the tranches, visit https://token.vega.xyz.

## VEGA Token
### Standard ERC20 Token
The core of VEGA V2 is the standard [OpenZeppelin ERC20 contract](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol) with only a single custom function: Mint Lock.

For functions and more details on ERC20, see the official [Ethereum Improvement Proposal's EIP-20 documentation](https://eips.ethereum.org/EIPS/eip-20).

### Mint Lock
Just about every aspect of Vega Protocol is controlled by governance (enabled by VEGA tokens) and as such the community should be able to increase the token supply as necessary through governance actions. While this is a potential action they can take, more VEGA V2 tokens cannot be minted until the mint lock expires at Sunday, December 31, 2023 11:59:59 PM GMT (timestamp<PHONE_NUMBER>). This date was selected to be after all currently planned vesting is complete.

## ERC20 Vesting
The ERC20 Vesting contract holds all of the initial 64m+ VEGA tokens and manages their vesting and withdrawals. The contract allows permitted issuers to issuer any number of VEGA tokens (provided there is still an unissued balance) to a target Ethereum address into a provided tranche which will unlock according to that tranche's particular schedule. This contract also manages staking of locked VEGA token by implementing the IStake interface. Since Vega token v1 has been replaced by v2, all v1 balances are automatically issued into a non-vesting "tranche 0" which can never be taken from the holder, but must be issued into an appropriate vesting tranche before being withdrawn.

Events:
* `Tranche_Created(uint8 indexed tranche_id, uint256 cliff_start, uint256 duration)`
* `Tranche_Balance_Added(address indexed user, uint8 indexed tranche_id, uint256 amount)`
* `Tranche_Balance_Removed(address indexed user, uint8 indexed tranche_id, uint256 amount)`
* `Issuer_Permitted(address indexed issuer, uint256 amount)`
* `Issuer_Revoked(address indexed issuer)`
* `Controller_Set(address indexed new_controller)`

Views:
* `total_locked()` - returns the total amount of tokens "on" this contract that are locked into a tranche
* `v1_address()` - returns the address for Vega's v1 ERC20 token
* `v2_address()` - returns the address for Vega's v2 ERC20 token that replaces v1
* `accuracy_scale()` - returns the multiplier to assist in integer division (Solidity is dumb)
* `default_tranche_id()` - returns the tranche_id for the default tranche
* `address_migration(address v1_address)` - returns mapping of new address => old address for a 1-time v1->v2 mapping completed when contract was deployed
* `tranches(uint8 tranche_id)` - returns the tranche details for given tranche_id (cliff_start and duration)
* `permitted_issuance(address issuer)` - returns the amount of tokens the issuer is permitted to issue, this is reduced with every issue transaction
* `get_tranche_balance(address user, uint8 tranche_id)` - returns the amount of VEGA locked in target tranche for provided user address
* `get_vested_for_tranche(address user, uint8 tranche_id)` - returns the amount of VEGA in target tranche for provided user address that is vested and ready for withdrawal
* `v1_bal(address user)` - returns the v1 balance for the given user. Returns zero if the balance has been "migrated" by having tokens issued into a tranche
* `user_total_all_tranches(address user)` - returns the total amount of tokens in all tranches (vested or locked) that have yet to be withdrawn

Functions:
* `create_tranche(uint256 cliff_start, uint256 duration)` - Allows controller (admin) to create a new tranche
* `issue_into_tranche(address user, uint8 tranche_id, uint256 amount)` - Allows issuer or controller to issue tokens into the given tranche
* `move_into_tranche(address user, uint8 tranche_id, uint256 amount)` - Allows controller to move Vega from the default tranche into the provided tranche, tokens must be in default tranche first
* `withdraw_from_tranche(uint8 tranche_id)` - Allows a user to withdraw any vested tokens to their Ethereum address from the given tranche. This will fail if "user_total_all_tranches" - "amount" is less than total - staked tokens
* `assisted_withdraw_from_tranche(uint8 tranche_id, address target)` - Allows controller to run the withdraw on behalf of given target address in case of user having a dApp-incompatible ETH wallet. For emergency use only.
* `stake_tokens(uint256 amount, bytes32 vega_public_key)` - Stakes tokens (see IStake below)
* `remove_stake(uint256 amount, bytes32 vega_public_key)` - Unstakes tokens (see IStake below)
* `permit_issuer(address issuer, uint256 amount)` - Allows the controller to permit an Ethereum address to issue VEGA into tranches for users
* `revoke_issuer(address issuer)` - Allows the controller to revoke a given issuer
* `set_controller(address new_controller)` - Allows the controller to hand over control to another Ethereum address

## IStake Interface
The IStake interface contains the events and a couple helper views that every staking contract must implement to be compatible.
ERC20_Vesting smart contract implements this interface.

Events:
* `Stake_Deposited(address indexed user, uint256 amount, bytes32 indexed vega_public_key)`
* `Stake_Removed(address indexed user, uint256 amount, bytes32 indexed vega_public_key)`
* `Stake_Transferred(address indexed from, uint256 amount, address indexed to, bytes32 indexed vega_public_key)`

Views:
* `staking_token()` - returns the address of the token that is able to be staked in the implementing contract
* `stake_balance(address target, bytes32 vega_public_key)` - returns the number of tokens staked for that target address and vega_public_key pair
* `total_staked()` - returns the total tokens staked from all users in the implementing contract

## Deployment Details
### Mainnet Ethereum
* VEGA V1 Token (burned owner): [0xd249b16f61cb9489fe0bb046119a48025545b58a](https://etherscan.io/token/0xd249b16f61cb9489fe0bb046119a48025545b58a)
* VEGA V2 Token: [0xcB84d72e61e383767C4DFEb2d8ff7f4FB89abc6e](https://etherscan.io/token/0xcB84d72e61e383767C4DFEb2d8ff7f4FB89abc6e)
* ERC20 Vesting: [0x23d1bFE8fA50a167816fBD79D7932577c06011f4](https://etherscan.io/address/0x23d1bFE8fA50a167816fBD79D7932577c06011f4)

### Ropsten Ethereum Testnet
* VEGA Token: [0x16480156222D4525f02F0F2BdF8A45A23bd26431](https://ropsten.etherscan.io/token/0x16480156222D4525f02F0F2BdF8A45A23bd26431)
* ERC20 Vesting: [0x08C06ECDCf9b8f45e3cF1ec29B82eFd0171341D9](https://ropsten.etherscan.io/address/0x08C06ECDCf9b8f45e3cF1ec29B82eFd0171341D9)

## Tests
* `ganache-cli`
* `truffle test`

# License
[MIT](LICENSE)

branch_name: refs/heads/main


text:
### List of tasks for organizing committee

AA = Anthony; RF = Rob; CK = Catherine; RL = Randy

#### Space

- [X] [book](http://www.lib.washington.edu/ougl/learning-spaces/active-learning-classrooms) active learning classroom (RL)
- [ ] other options include 5th floor Phys/Astron, [health sciences rooms](https://depts.washington.edu/hsasf/instructional-support/hsrr/)

#### Instructors

Who want to help with this?

- [ ] prepare description of what we require from instructors (wiki)
- [ ] finalize invite list
- [ ] send out invite list and track who will attend and fit into schedule

#### Attendees

- [X] generate form for code of conduct page for anonymous complaints following [this example from neurohackweek](https://neurohackweek.wufoo.com/forms/neurohackweek-code-of-conduct-violation/)_
- [X] generate participant application form (RF! AA dependency)
- [ ] invite someonfrom Vipin Kumar's group (RF)
- [ ] Recruit Will G-M for hard labor (RF)

#### Travel/logistics

- [ ] travel logistics page (wiki) (?)

#### Budget

- [X] prepare budget; consult with other hackathons (AA)
- [x] set up [eventbrite page](https://www.eventbrite.com/e/geohackweek-2016-tickets-26664692814)
- [X] how to link eventbrite to UW budget account? (AA)

#### Teaching material

- [ ] prepare tutorials (all)
- [ ] prepare sample data (all)
- [ ] coordinate Google Earth Engine API development (CK)
- [ ] install and test as student proxy the GEE Python API stuff (RF, CK dependency sorta)
- [ ] coordinate a dataset with W G-M (RF)
- [ ] integrate the Minnesota (UMN) use of GEE: Dams and meandering stream geomorphology (RF)

#### Advertising and Outreach

- [ ] Twitter feed
- [ ] contact various groups to publicize the event
- [ ] advertise around UW campus

#### Misc.

- [x] consult with Ariel for general advice and attend some of neurohack (AA)
- [X] consult with Brittany/Anissa for feedback on hackathon planning/implementation? See [Brittany's post](http://astrohackweek.org/blog/ethnographic-notes.html)
- [ ] reach out to data librarian : Rob suggest Jenn at Suzallo
- [ ] create 'how to hack' page (?)
- [ ] create 'hackpad' page (?)
- [ ] create 'breakouts' page (?)

### Confirm Dataset Ready To Go

- [ ] Baboon problem (RF)


text:
# ZNU-Timetable

Site with university timetable and REST API service for applications

## Installation

Clone the repository and install dependencies.

```
git clone https://github.com/Vadimkin/ZNU-Timetable.git
cd ZNU-Timetable
pip install -r requirements.txt
```

Then rename config file and set up config to db

```
cd znu
mv settings_secret.py.EXAMPLE settings_secret.py
nano settings_secret.py
```

## Run server

Database sync

```
python manage.py syncdb
```

Server running with command

```
python manage.py runserver
```

repository: Vadimkin/ZNU-Timetable

repo_name: Vadimkin/ZNU-Timetable


text:
### [CVE-2015-4518](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2015-4518)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

The Reader View implementation in Mozilla Firefox before 42.0 has an improper whitelist, which makes it easier for remote attackers to bypass the Content Security Policy (CSP) protection mechanism and conduct cross-site scripting (XSS) attacks via vectors involving SVG animations and the about:reader URL.

### POC

#### Reference
- http://www.oracle.com/technetwork/topics/security/bulletinapr2016-2952098.html
- https://bugzilla.mozilla.org/show_bug.cgi?id=1136692
- https://bugzilla.mozilla.org/show_bug.cgi?id=1182778

#### Github
No PoCs found on GitHub currently.

repository: trickest/cve

gha_language: HTML

gha_license_id: MIT

repo_name: trickest/cve


text:
---
title: "Troubleshooting"
description: "This guide describes and helps users provide information during troubleshooting including sanitization etc"
lead: "This guide describes and helps users provide troubleshooting information."
date: 2023-05-01T12:36:02+10:00
draft: false
images: []
menu:
  reference:
    parent: "guides"
weight: 220
toc: true
aliases:
  - /r/sanitize
  - /r/troubleshoot
  - /r/troubleshooting
---

## Frequently Asked Questions

See the [Frequently Asked Questions](frequently-asked-questions.md) reference guide for links to frequently asked
question documentation.

## Logs

It's really important when troubleshooting and even more important when reporting a bug that users provide complete
log files. In addition the [log level](../../configuration/miscellaneous/logging.md#level) should always be set to
`debug` at minimum, if not `trace`.

Complete logs means at minimum from the [log severity line](#log-severity-line) until the actual issue occurs. Though
more than this may be included at the users discretion.

### Output

Logging can be [configured](../../configuration/miscellaneous/logging.md) to output to both a file and stdout / console
/ docker logs.

- If you configure the [file_path] option with the [keep_stdout] configuration option enabled then you will only be
  required to supply the stdout / console / docker logs and should ignore the file logs.
- If you configure the [file_path] option without the [keep_stdout] configuration option enabled then you will be
  required to join the stdout / console / docker logs with the file logs.

[keep_stdout]: ../../configuration/miscellaneous/logging.md#keepstdout
[file_path]: ../../configuration/miscellaneous/logging.md#filepath

### Large Amount of Logs

In instances where the logs are substantial we will accept truncated logs. There are however some very intentional rules
about truncation of logs.

1. You must show more than 1 minute of logs prior to the issue occurring (i.e. show every log line that is within 1
   minute of the log line where the issue occurred plus one additional line outside the minute).
2. The level rule still applies.
3. You must show:
   1. The [log severity line](#log-severity-line).
   2. The [listening line](#listening-line) and the 10 log lines which follow this line.
   3. The lines between these two lines, which should also include the [starting line](#starting-line).
4. No warning or error that is potentially related to the issue should be truncated.

### Important Log Lines

The following log lines are important and are referenced by other sections of this document.

#### Log Severity Line

The log severity line will have a message which is similar to the following examples:

- `Log severity set to debug`
- `Log severity set to trace`

#### Starting Line

The starting line will have a message which is similar to the following examples:

- `Authelia v4.37.5 is starting`
- `Authelia v4.38.0 is starting`
- `Authelia untagged-v4.38.0 (master, 50d8b4a) is starting`

#### Listening Line

The listening line will have a message which is similar to the following examples:

- `Listening for non-TLS connections on '<IP_ADDRESS>:9091' path '/'`
- `Listening for TLS connections on '<IP_ADDRESS>:9091' path '/'`
- `Listening for non-TLS connections on ':9091' path '/'`
- `Listening for non-TLS connections on ':9091' path '/' and '/authelia'`

## Sanitization

Some users may wish to hide their domain in files provided during troubleshooting. While this is discouraged, if a user
decides to perform this action it's critical for these purposes that you hide your domain in a very specific
way. Most editors allow replacing all instances of a value, utilizing this is essential to making troubleshooting
possible.

### General Rules

1. Only replace the purchased portion of domains:
   - For example if you have `auth.abc123.com` and `app.abc123.com` they
   should become `auth.example.com` and `app.example.com`, i.e. replace all instances of `abc123.com` with `example.com`.
2. Make sure value replaced is replaced with a unique value:
   - For example if you replace `abc123.com` with `example.com` DO NOT replace any other value other than `abc123.com` with
   `example.com`. The same rule applies to IP addresses, usernames, and groups.
3. Make sure the value replaced is replaced across logs, configuration, and any references:
   - For example if you replace `abc123.com` with `example.com` in your configuration, make exactly the same replacement
   for the log files.
4. Make sure this consistency is followed for all communication regarding a single issue.

### Multiple Domains

*__Replacement Value:__* `example#.com` (where `#` is a unique number per domain)

In instances where there are multiple domains it's recommended these domains are replaced with `example1.com`,
`example2.com`, etc.

repository: authelia/authelia

gha_language: Go

repo_name: authelia/authelia


text:
### Cases

**Files**

- `covid-19_cases_raw.csv`: CSV with processed cases file
- `covid-19_cases_raw.RDS`: RDS format version

**Data structure**:

- continent: Geographical continent
- who_region: WHO region
- country_region: Country (or region)
- iso3c: ISO 3166-1 alpha-3 country code
- province_state: Province/State/Subnational division
- confirmed: Cummulative number of confirmed cases
- dead: Cummulative number of deaths
- recovered: Cummulative number of recovered cases
- lat: Latitude
- lon: Longitude
- update: Entry timestamp update in "YYYY-MM-DD hh:mm:ss" format
- data_update: Data file update date in "YYYY-MM-DD" format
- who_region_code: WHO region code
- who_region: WHO region
- world_bank_income_group: World Bank Income Group
- world_bank_income_group_code: World Bank Income Group code
- world_bank_income_group_gni_reference_year: World Bank Income Group GNI reference year
- world_bank_income_group_release_date: World Bank Income Group release year

### Timeseries data

**Files**

- `covid-19_ts_combined.csv`: CSV with combined timeseries data
- `covid-19_ts_combined.rds`: RDS version (`tsibble`)
- `covid-19_ts_confirmed.csv`: CSV file with confirmed cases
- `covid-19_ts_confirmed.rds`: RDS version (`tsibble`)
- `covid-19_ts_deaths.csv`: CSV file with deaths
- `covid-19_ts_deaths.rds`: RDS version (`tsibble`)
- `covid-19_ts_recovered.csv`: CSV file with recovered cases
- `covid-19_ts_recovered.rds`: RDS version (`tsibble`)

**Data structure**:

- continent: Geographical continent
- iso3c: ISO 3166-1 alpha-3 country code
- country_region: Country (or region)
- province_state: Province/State/Subnational division
- ts: UTC date in "YYYY-MM-DD" format
- confirmed: number of confirmed cases at ts (in combined and confirmed timeseries)
- deaths: number of deaths at ts (in combined and deaths timeseries)
- recovered: number of recovered cases at ts (in combined and recovered timeseries)
- lat: Latitude
- lon: Longitude
- who_region: WHO region
- who_region_code: WHO region code
- world_bank_income_group: World Bank Income Group
- world_bank_income_group_code: World Bank Income Group code
- world_bank_income_group_gni_reference_year: World Bank Income Group GNI reference year
- world_bank_income_group_release_date: World Bank Income Group release year

### WHO situation report data:

**Files**:

- `covid-19_who_sitrep_raw.rds`: Lightly cleaned WHO situation report in RDS format
- `covid-19_ts_who_sitrep.csv`: Timeseries from WHO situation reports
- `covid-19_ts_who_sitrep.rds`: RDS version (`tsibble`)

**Data structure**:

- continent: Geographical continent
- iso3c: ISO 3166-1 alpha-3 country code
- country_region: Country (or region)
- province_state: Province/State/Subnational division
- ts: UTC date in "YYYY-MM-DD" format
- cases: number of cases at ts
- who_region: WHO region
- who_region_code: WHO region code
- world_bank_income_group: World Bank Income Group
- world_bank_income_group_code: World Bank Income Group code
- world_bank_income_group_gni_reference_year: World Bank Income Group GNI reference year
- world_bank_income_group_release_date: World Bank Income Group release year

### WHO metadata

**Source**: https://apps.who.int/gho/data/node.metadata.COUNTRY?lang=en (CSV Xmart format)

**Files**:

- `xmart.csv`: CSV Xmart format (downloaded on 2020-03-09)
- `who_metadata.Rdata`: Rdata format version

**Data structure**:

- continent: Geographical continent
- who_region: WHO region
- country_region: Country (or region)
- iso3c: ISO 3166-1 alpha-3 country code
- province_state: Province/State/Subnational division
- ts: UTC timestamp in "YYYY-MM-DD hh:mm:ss" format
- cases: Number of cases
- who_region_code: Code for WHO region
- world_bank_income_group: World Bank Income Group
- world_bank_income_group_code: World Bank Income Group code
- world_bank_income_group_gni_reference_year: World Bank Income Group GNI reference year
- world_bank_income_group_release_date: World Bank Income Group release year

### World Bank popilation estimate for 2020

**Source**: https://databank.worldbank.org/source/population-estimates-and-projections

**Files**:
  - `Data_Extract_From_Population_estimates_and_projections.zip`: data and metadata from World Bank (dowloaded on 2020-03-14)
  - `wb_population.Rdata`: Rdata format

**Data Structure** (Rdata file):

- country_name: Country name
- country_code: ISO 3166-1 alpha-3 country code
- series_name: World Bank variable name
- series_code: World Bank variable code
- population_2020: Estimated polution for 2020


text:
# jspicl Sample project
This is a sample project demonstrating how you can use [jspicl](https://github.com/AgronKabashi/jspicl) to write your PICO-8 games in Javascript.

![](https://i.imgur.com/b3rAt6t.gif)

## Usage
```Shell
npm start
```

This will create a cartridge and automatically launch it in PICO-8. Whenever source files are changed, a rebuild will take place and reload PICO-8 with the new cartridge for you.

![](https://i.imgur.com/QYj4Xga.gif)

If a cartridge already exists in the build folder then all the assets, sans lua code, will be reused and included in the newly build cartridge.

For more advanced build options, please look at [rollup-plugin-jspicl](https://github.com/AgronKabashi/rollup-plugin-jspicl)'s options and modify rollup.config.js accordingly.

```
npm run restore-cart
```

This will take the game.p8 cartridge in the project root and put it in the build directory for you.
**CAUTION**: This will overwrite any existing cartridge in the destination folder so make sure you do a backup first.

## Updating spritesheet
With the jspicl build tool you don't need to draw your sprites in PICO-8 anymore. Simply edit the spritesheet file, save and the cart will be reloaded with the new changes.

![](https://github.com/AgronKabashi/assets/raw/814f6efe24bc9aca5d9d6ca6259279733529e300/rollup-plugin-jspicl/spritesheetLiveReload.gif)

## Other `jspicl` games
* [https://github.com/topics/jspicl-sample](https://github.com/topics/jspicl-sample)


text:
---
layout: page
title: Details in the Novel
permalink: /projects/details
date: 2021-09-14
plaindate: Fall 2021 - Fall 2022
description: Applied Natural Language Processing (INFO 256) project
---

My semester project for David Bamman's Fall 2021 Applied Natural Language Processing ([INFO 256](https://people.ischool.berkeley.edu/~dbamman/info256.html)) course explores details in narrative fiction. I expanded this work during an independent study supervised by David in Fall 2022.

I was invited to present my work at the 2022 UC Berkeley Digital Humanities fair. Here is my poster!

Code, data and visualizations can be found on github.

You can read through my report here:

<embed src="https://timschott.com/documents/details-in-the-novel.pdf" type="application/pdf"
style="min-height:100vh;width:100%"/>


text:
To train:
=========
python train.py --scenario [scenario root name] --save-dir "./[scenario root name]/model"

To display:
===========
python train.py --scenario [scenario root name] --display --load-dir "[scenario root name]/model"

optional arguments:
====================

```
  -h, --help            show this help message and exit
  --scenario SCENARIO   name of the scenario script
  --max-episode-len MAX_EPISODE_LEN
                        maximum episode length
  --num-episodes NUM_EPISODES
                        number of episodes
  --num-adversaries NUM_ADVERSARIES
                        number of adversaries
  --good-policy GOOD_POLICY
                        policy for good agents
  --adv-policy ADV_POLICY
                        policy of adversaries
  --lr LR               learning rate for Adam optimizer
  --gamma GAMMA         discount factor
  --batch-size BATCH_SIZE
                        number of episodes to optimize at the same time
  --num-units NUM_UNITS
                        number of units in the mlp
  --exp-name EXP_NAME   name of the experiment
  --save-dir SAVE_DIR   directory in which training state and model should be
                        saved
  --save-rate SAVE_RATE
                        save model once every time this many episodes are
                        completed
  --load-dir LOAD_DIR   directory in which training state and model are loaded
  --restore
  --display
  --benchmark
  --benchmark-iters BENCHMARK_ITERS
                        number of iterations run for benchmarking
  --benchmark-dir BENCHMARK_DIR
                        directory where benchmark data is saved
  --plots-dir PLOTS_DIR
                        directory where plot data is saved
```

repository: jarbus/multiagent-particle-envs

gha_language: Python

repo_name: jarbus/multiagent-particle-envs


text:
# Neural Electrophyiosology Toolbox
## This started as [NSKToolbox](https://github.com/corticodes/NSKToolbox) and has morphed into a fully fledged visual stimulation, spike sorting and analysis tool.

_More info to follow_

repository: neural-electrophysiology-tool-team/NET

gha_language: Jupyter Notebook

repo_name: neural-electrophysiology-tool-team/NET


text:
# MCFS [AMPScript]: Virtual filesystem for Marketing Cloud, syntax highlighting, code snippets and more

![AMPScript](https://raw.githubusercontent.com/Bizcuit/vscode-ampscript/master/images/mcfs.gif)

AMPScript is the language used to program emails, content blocks, webpages and script activities in the Salesforce Marketing Cloud. It is not a simple task to write code directly in the UI of MC. This extensions helps you solve this problem.

This extension allows you to connect Visual Studio Code directly to your MC Account, enables syntax highlighting for AMPScript, has built-in documentation for all AMPScript functions and also adds code snippets for language elements and functions. Each snippet includes a detailed description of the function and its parameters. Snippets also show up when you hover a function name.

With direct connection to MC you can: easily change content in MC without leaving your text editor, save time and avoid frequent copy-pasting. It also helps you to better control the content of your emails, content blocks and cloud pages by exposing additional content attributes that are not available in the UI of MC.

### How to enable syntax highlighting

You have two options on how to enable syntax highlighting:

* Open a file that has an ".amp" or an ".ampscript" file extension
* Manually set the language of the file to "AMPscript" (check the video below)

![AMPScript](https://raw.githubusercontent.com/Bizcuit/vscode-ampscript/master/images/screenshot_video_howto.gif)

### How to connect to Marketing Cloud

As of now, you **can only edit existing assets** (content blocks, emails, cloudpage, json message, sql queries and dataextensions). Functionality that is not supported at the moment: create new asset, rename asset, move asset to a different folder, delete asset.

* In your MC accout, create a new installed package and add a 'Server-to-Server' API integration Component
* Add the following permissions:
	* CHANNELS: Email (Read and Write)
	* CHANNELS: Web (Read, Write, Publish)
	* ASSETS: Saved Content (Read and Write)
	* AUTOMATION: Automations (Read, Write, Execute)
	* DATA: Data Extensions (Read, Write)
* Grant access to all required BUs
* Provide package details in the connection manager below, save it and connect
* You'll find the entire Content Builder library in your File Explorer tab
* To open Connection Manager next time press F1 (or 'CMD+Shift+P' on Mac and 'CTRL+Shift+P' on Windows) and start typing 'MCFS'. Find 'MCFS Connecton Manager' and then hit Enter

Detailed instructions with screenshots are available directly in the Connection Manager. To open Connection Manager press F1 (or 'CMD+Shift+P' on Mac and 'CTRL+Shift+P' on Windows) and start typing 'MCFS'. Find 'MCFS Connecton Manager' and then hit Enter.

### How to edit Content Builder assets directly from Visual Studio Code

Each asset is presented as a folder that starts with an 'Ω' symbol. You can easily distinguish different asset types based on the colored square that goes after 'Ω':
* 🟥 - blocks
* 🟦 - emails
* 🟨 - templates
* 🟩 - cloudpages
* 🟪 - mobile messages

Each asset folder includes a readonly '__raw.readonly.json' file. This is an API representation of the asset. You can not modify. Instead you can modify all other files available under the asset folder. Each file represents a specific part of the asset. For the template based email you will see for example smth like:
* _htmlcontent.amp - template used to create an email
* _subject.amp - subject line of the email
* _preheader.amp - preheader of the email
* s01.b01.content.amp - content of the first content block (b01) that is located in the first template stack/placeholder (s01)
* s01.b01.super.amp - super content of the block above. Learn more about super content [here](https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/design_super_content.htm)
* s01.b02.content.amp - content of the second block in the first template stack
* s01.b02.super.amp - super content of the second block in the first template stack
* s02.b01.content.amp - content of the first block in the second template stack
* s02.b01.super.amp - super content of the first block in the second template stack

### How to run an SQL query
* Connect to your MC account
* Find your SQL Query asset in the "SQL Queries" folder and open a "query.sql" file
* Click a "Run SQL Query" button located in the top right corner of the editor (or run a "MCFS: Run SQL Query" command from the Command Pallet)

![SQL Queries](https://raw.githubusercontent.com/Bizcuit/vscode-ampscript/master/images/mcfs_runquery.jpg)

### How to filter a Dataextension
* Connect to your MC account
* Find your Dataextension asset in the "Dataextensions" folder and open a "rows.csv" file
* Click a "Filter a Dataextension" button located in the top right corner of the editor (or run a "MCFS: Filter a Dataextension" command from the Command Pallet)
* Set the filter and hit enter
* Filter example: OrderID = 'ORD2123F2' AND SubscriberKey = 'ABC'

![Dataextensions](https://raw.githubusercontent.com/Bizcuit/vscode-ampscript/master/images/mcfs_filterde.jpg)

### How it looks and works

#### Demo

![Demo](https://raw.githubusercontent.com/Bizcuit/vscode-ampscript/master/images/screenshot_video.gif)

#### Hover snippets

![Hover snippets](https://raw.githubusercontent.com/Bizcuit/vscode-ampscript/master/images/screenshot_hoversnippets.jpg)

#### Code snippets

![Function snippets](https://raw.githubusercontent.com/Bizcuit/vscode-ampscript/master/images/screenshot_snippets.png)

#### Syntax highlighting

![Syntax highlighting](https://raw.githubusercontent.com/Bizcuit/vscode-ampscript/master/images/screenshot.png)

#### Copyright 2017-2021 Sergey Agadzhanov

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

repository: Bizcuit/vscode-ampscript

gha_language: TypeScript

repo_name: Bizcuit/vscode-ampscript


text:
# Dip

[Website](http://www.dip-lang.org)

Dip is a dynamically typed interpreted programming language written in Python, which gives emphasis to readability and ease of use, while also providing the power of all of python’s libraries. Dip is aimed at beginners, looking to start with programming.

# Working with Dip

Dip gives you access to a development environment which comes bundled with Dip - The DDE, short for Dip Development Environment. It gathers inspiration from Python’s IDLE, and has a text editor for you to edit and create dip programs, and an interactive shell, where you can execute and see the output of your programs.

You can evaluate expressions by writing them after `Dip>`.

```dip
Dip> 1 + 2
3
Dip> 1 - 3
-2
Dip> 3 + 9
12
```

# Evaluating external files

It's possible to load external files written in Dip by calling the ‘run’ function inside the DDE interface by executing the run function followed by the relative path of the files that you want to be evaluated.

```dip
Dip Beta (Version 0.1)
Type in 'exit' to exit the shell
Dip> run("/Users/raghav/Desktop/hello_dip.dip")
Hello, Dip
0
```

# Dip basics

Most of Dip’s functions are either reminiscent of Python, or build off them, so people getting started with programming (or even Python programmers for that matter) won’t have any trouble understanding them. These basics are divided into three different categories, data types, builtin functions and the standard library.

## Dip’s Data Types

Dip contains 5 data types which you will generally interact with. These are Numbers, Strings, Lists, Functions and Errors.

### Numbers

Dip supports integers and decimals, called ints and floats in python. Note that anything following a ‘#’ on the same line is interpreted as a comment and not evaluated.

```dip
Dip Beta (Version 0.1)
Type in 'exit' to exit the shell

Dip> 10 / 2
5.0
Dip> 1 + 3
4
Dip> 34 * 34
1156
```

Note that in case of recurring decimals, they are left at 15 decimal places.

```dip
Dip> 100 / 6
16.666666666666668
```

Some functions you can perform on numbers are sin, cos, and tan. The pi constant is available.

```dip
Dip> sin(45)
0.8509035245341184
Dip> cos(45)
0.5253219888177297
Dip> tan(45)
1.6197751905438615
Dip> pi
3.141592653589793
```

### Strings

A string is a combination of zero or more characters contains inside double-quotes.

```dip
Dip> "Hello, Dip!"
Hello, Dip!
```

There are many things that you can do with strings, including adding them, iterating through them, and joining them.

```dip
Dip> join("Hello ", "Dip!")
Hello Dip!
Dip> print("I am dip, an interpreted programming language")
I am dip, an interpreted programming language
Dip> variable str = "string!"
string!
Dip> for i = 0 to length(str) then print(str / i)
s
t
r
i
n
g
!
```

### Lists

A list is a combination of values inside square braces, separated by commas.

```dip
Dip> ["l", "i", "s", "t"]
l, i, s, t
```

Lists can contain integers, strings, functions and even other lists.

```dip
Dip> [[1, 2], [3, 4], [5, 6]]
1, 2, 3, 4, 5, 6
```

There are many things that you can do with lists, including `join`, which joins two lists, `add`, which adds an element to a list, `remove`, which removes an element at an index from a list.

```dip
Dip> variable new_list = join([1, 2, 3], [4, 5, 6])
1, 2, 3, 4, 5, 6
Dip> new_list
1, 2, 3, 4, 5, 6
Dip> add(new_list, 7)
1, 2, 3, 4, 5, 6, 7
Dip> new_list
1, 2, 3, 4, 5, 6, 7
Dip> remove(new_list, 4)
5
Dip> new_list
1, 2, 3, 4, 6, 7
```

Note that the ‘remove’ function removes the element from the 4th index in this case, which is 5.

### Functions

Functions can be defined using the 'function' keyword, followed by the name of the function, and then its arguments in parenthesis. For a single line function, you can use `->` and then type what you want it to do. For a multi-line function, enter a new line and end the function with an end statement.

```dip
Dip> function add(a, b) -> print(a + b)
<function add>
Dip> add(4, 5)
9
```

```dip
function odd_or_even(number)
    if number % 2 == 0 then print("even") else print("odd")
end
```

Read more about functions in the builtin functions section!

### Errors

Errors are generated automatically when the user tries to evaluate invalid code. Dip contains 5 different error types, Illegal Character Error, Expected Character Error, Runtime Errors, Invalid Syntax Errors and Custom Errors. Custom errors can also be generated using the `error` function followed by a string inside parenthesis. The string will be the message of the error. Errors in the interpreter can help the user by providing insightful commentary.

#### Illegal Character Errors - Called when an illegal character is found

```dip
Dip> @
Illegal Character: '@'
File Dip Shell, line 1
@
^
```

#### Expected Character Errors - Called when a character is not found

```dip
Invalid Syntax / Character Not Found: Expected 'end'
File <Dip Shell>, line 1
function add(a, b); return a + b^
```

#### Runtime Errors - A range of errors that might be raised at runtime

```dip
Runtime Error: Illegal operation - check you are comparing two different data types (eg. integer and string)
File <Dip Shell>, line 1

1 - "1"
^^^^^^^
```

#### Invalid Syntax Errors - Called when the syntax is invalid

```dip
Invalid Syntax / Character Not Found: Expected int, float, identifier, '+', '-', '(', '[', if, for, while or function
File <Dip Shell>, line 1

5 === 5
       ^
```

#### Custom Errors - User Defined errors that can be called any time

```dip
Dip> error("test error")
Custom Error: test error
```

These errors can then be used like the built-in errors.

## Dip’s Built-in Functions

### What is a Builtin Function?

How do these functions actually work under the hood? In reality, they are nothing more than a function written in Python, that the interpreter calls when evaluating the symbol associated to it. That's how I inserted basic functionalities into the language like arithmetic operations and list manipulation, but it doesn't stop here, from very simple builtin operations you can write complex functions like the ones in the std library and expand the functionalities of the language without writing a single line of Python.

### Print

Prints text to the screen.

```dip
Dip> print("I am dip, an interpreted programming language")
I am dip, an interpreted programming language
```

### Say

Uses the Operating System’s ‘say’ command and says whatever is passed into it. Returns nothing.

```dip
Dip> say("hi!")
0
```

### Random Int

Selects a random integer from the range given to it.

```dip
Dip> random_int(0, 10)
10
Dip> random_int(0, 10)
9
Dip> random_int(0, 10)
0
```

### Root

Gets the square root of the number given to it.

```dip
Dip> root(4)
2.0
```

### Sin

Calculates the sine of a given number.

```dip
Dip> sin(45)
0.8509035245341184
```

### Cos

Calculates the cosine of a given number.

```dip
Dip> cos(45)
0.5253219888177297
```

### Tan

Calculates the tangent of a given number.

```dip
Dip> tan(45)
1.6197751905438615
```

### Input

Gets User Input.

```dip
Dip> input("User Input...")
ok
```

### Input_Integer

Gets User Input and ensures it is an integer.

```dip
Dip> input_integer("User Input...")
23
```

```dip
Dip> input_integer("User Input...")
Must be an integer, try again
Dip> input_integer("User Input...")
```

### is_number

Checks if the argument passed is a number.

```dip
Dip> is_number(34)
1
Dip> is_number("F")
0
```

### is_string

Checks if the argument passed is a string.

```dip
Dip> is_string("string")
1
Dip> is_string(34)
0
```

### is_list

Checks if the argument passed is a list.

```dip
Dip> is_list([3, 4, 5])
1
Dip> is_list(34)
0
```

### is_function

Checks if the argument passed is a function.

```dip
Dip> variable x = function add(a, b) -> a + b
<function add>
Dip> x
<function add>
Dip> is_function(x)
1
Dip> is_function("F")
0
Dip>
```

### add

Adds an element to a list.

```dip
Dip> variable lst = [0]
0
Dip> add(lst, 1)
0, 1
Dip> lst
0, 1
Dip>
```

### remove

Removes the element at index in a list.

```dip
Dip> remove(lst, 0)
0
Dip> lst
1
Dip>
```

### join

Joins two lists or strings.

```dip
Dip> join(lst, [2, 3])
1, 2, 3
Dip> join("hi", " there")
hi there
Dip>
```

### integer

Converts argument to an integer.

```dip
Dip> integer("4")
4
Dip> integer("definitely not an integer")

Runtime Error: ValueError: Invalid literal for integer() with base 10: 'definitely not an integer'
File <Dip Shell>, line 1

integer("definitely not an integer")
```

### decimal

Converts argument to a decimal.

```dip
Dip> decimal("34.3434")
34.3434
Dip> decimal("definitely not an decimal")

Runtime Error: ValueError: Could not convert string to decimal: 'definitely not an decimal'
File <Dip Shell>, line 1

decimal("definitely not an decimal")
```

### string

Converts argument to a string.

```dip
Dip> string(3434343)
3434343
```

### wait

Freezes the program for the number of seconds provided in the argument.

```dip
Dip> wait(3)
```

### open

Opens the website name given in the argument.

```dip
Dip> open("google.com")
```

## Dip’s Standard Library

The standard library is a collection of custom functions written in Dip that gets automatically loaded when you run the Dip interface.

### Loops in Dip

There are two major types of loops in Dip, for loops and while loops.

#### For Loops

Each for loop begins with the word ‘for’ and then defines its range. This is done like this:

```dip
Dip> for i = 0 to 5
```

After this, using the then keyword, users can specify what needs to be done for each of these values.

```dip
Dip>  for i = 0 to 5 then print(i)
0
1
2
3
45
```

Note that only ‘i’ can be used as an iterable in for loops in Dip.

#### While Loops

```dip
Dip>  variable x = 0
0
Dip>  while x < 5 then; print(x); variable x = x + 1 end
0
1
2
3
4
```

Note that a ‘;’ defines a new line. Note that while loops can use any variable as an iterable.

#### Recursion in Dip

Here is an example of a recursive program in Dip - A function to calculate the factorial of a number.

```dip
# factorial function

function factorial(term)

    variable fact = 1
    if term >= 1 then
        for i = 1 to term + 1 then
            variable fact = fact * i
        end
    end
    say(fact)
end
```

Another function in Dip - the famous Fibonacci function.

```dip
# Fibonnaci Function

function fib(nterms)

    variable n1 = 0
    variable n2 = 1
    variable count = 0

    if nterms <= 0 then print("Input a positive integer")
    if nterms == 1 then
        print("Fibonnaci sequence upto" + " 1" + ":")
        print(n1)
    else
        print("Fibonacci sequence:")
        while count < nterms then
            print(n1)
            variable nth = n1 + n2
            variable n1 = n2
            variable n2 = nth
            variable count = count + 1
        end
    end
end
```

# Installation

Install Dip at <http://dip-lang.org/install>.

# Thanks!

Thanks to Robert Nystrom for his great book [Crafting Interpreters](https://craftinginterpreters.com/), [CodePulse](https://www.youtube.com/channel/UCUVahoidFA7F3Asfvamrm7w) for his video tutorials, and Daniel Holden for his book [Build your own lisp](http://www.buildyourownlisp.com/), all of which helped a lot in the making of Dip!

repository: raghavnautiyal/Dip

repo_name: raghavnautiyal/Dip


text:
# EnumIT
This tool was created in order to automate some basic OSINT tasks for penetration testing assingments. The main feature that I haven't seen much anywhere is the downloadd google dork function where this function first perform basic google dorking to find the targets public documents. These documents will then be downloaded to the attackers computer and can be used further to identify metadata about the client.

## Installation
- Create virtual enviroment: `python3 -m venv enumit`
- Activate the virtual enviroment: `source enumit/bin/activate`
- Install the required packages: `pip install -r requirements.txt`

# Basic Usage
## Google Dorking
### Download the files found
```bash
python3 run.py --domain example.com --google --filetypes pdf --download-files
```

### Create json list, no download
```bash
python3 run.py --domain example.com --google --filetypes pdf docx jpg
```

## Certificates
This function will query https://crt.sh for the domain name, and create a de-duplicated list for further proccessing.
```bash
python3 run.py --domain example.com --cert
```

## DNS
Perform dns lookup on the domain flag, can be used with the flag `--cert` to find DNS records of subdomains.
```bash
python3 run.py --domain example.com --dns --dns-records A AAAA MX NS
```

## Shodan
In order to use the shodan function, you must have the shodan and api key flag enabled.
```bash
python3 run.py --domain example.com --shodan --shodan-api-key <KEY>
```

### Portscan
This function will take all the ipv4 addresses previsuly found and perform a shodan lookup on them to find open ports. by default, it will only scan the IPv4 address resolved by the `--domain` flag. This flag is recomended if you've used the other functions with it.
```bash
python3 run.py --domain example.com --shodan --shodan-api-key <KEY> --portscan
```

## Bananas
```bash
python3 run.py --domain example.com --cert --dns --dns-types A AAAA NS MX --shodan --shodan-api-key <KEY> --portscan --ssl
```

# Notice!
- When you perform a scan, the result will be saved under `.<example.com>\` in the folder.
- You might be ratelimited by google if you use the function heavly.
- Using the portscan function will not quaranty that all ports has been scanned on the host, but will rather give a indication on what to expect on the hosts.


text:
# BoilerKey Extension
This is a Chrome/Firefox/Opera extension that circumvents BoilerKey. The code is based heavily off of [u/elnardu](https://www.reddit.com/r/Purdue/comments/9ulfj2/local_boilerkey_script/)'s [Python script](https://github.com/elnardu/local-boilerkey).

## Chrome Installation Instructions

### FIX FOR CHROME 72+
Due to Google testing out something experimental in Chrome 72, the setup process doesn't work. To disable it, go to:
chrome://flags/#network-service
in the URL bar, and then select **Disabled** for the 'Enable Network Service' option, and relaunch Chrome. This should fix it!
We're currently working on a fix to this issue.

#### Install from Chrome Web Store
[BoilerKey Helper - Chrome Web Store](https://chrome.google.com/webstore/detail/boilerkey-helper/infadhgmajhpaoejgbennpkjnobdbkij)

#### Install signed extension
Download the signed extension from [GitHub Releases](https://github.com/nalderto/BoilerKeyExtension/releases/).

#### Install from source
1. Clone the extension.
2. Navigate to chrome://extensions in Google Chrome.
3. Enable Developer mode in the top right corner.
4. Click "Load unpacked".
5. Select the BoilerKeyExtension folder which you cloned.
6. Navigate to the [Blackboard login page](https://mycourses.purdue.edu), and follow the instructions in the dialogs.

## Firefox Installation Instructions

#### Install signed extension
Download the signed extension from [GitHub Releases](https://github.com/nalderto/BoilerKeyExtension/releases/).

#### Install from source
1. Clone the extension.
2. Navigate to about:debugging in Mozilla Firefox.
3. Click "Load Temporary Add-on".
4. Select the manifest.json file from the cloned folder.
5. Navigate to the [Blackboard login page](https://mycourses.purdue.edu), and follow the instructions in the dialogs.

## Opera Installation Instructions
Install instructions for Opera are not available, but feel free to fork, add them, and make a pull request!

#### Free Will Donation
[Vemno](https://venmo.com/bscholer)

To see how bad BoilerKey really is, read [this article](https://www.purdueexponent.org/campus/article_9835af07-3c1c-579f-937f-200093767267.html) published by the Exponent, Purude's newspaper.

repository: jeremywgleeson/BoilerKeyExtension

repo_name: jeremywgleeson/BoilerKeyExtension


text:
# MASAIDiscoveryRequest

## Properties
|===
|Name | Type | Description | Notes

|**location** | link:MASAILocation.html[**MASAILocation***] | Location information | [optional]
|**price** | link:MASAIPrice.html[**MASAIPrice***] | Price range information | [optional]
|**rating** | link:MASAIRating.html[**MASAIRating***] | Rating range information | [optional]
|**groupOfModule** | **NSString*** | Group of module information (taxi/accomodation/train/flight/bus/tourism/all/car_sharing/bike_sharing/train_station_elevator/train_station_parking/car_rental/restaurant/coworkingspace/public_transport) |
|**accessKey** | **NSString*** | Google Custom Search Engine Access Key | [optional]
|**providers** | **NSArray<NSString*>*** | Search engines selected to search for (If none is selected, then the Service Discovery will search on all search engines) | [optional]
|**serviceType** | link:MASAIDiscoveryRequestServiceType.html[**MASAIDiscoveryRequestServiceType***] |  |
|===

link:../README.html#documentation-for-models[[Back to Model list]] link:../README.html#documentation-for-api-endpoints[[Back to API list]] link:../README.html[[Back to README]]

repository: MASAICommunity/ServiceDiscovery

repo_name: MASAICommunity/ServiceDiscovery


text:
---
layout: page
title: Acerca de
---

<p class="message">
  My name is Israel Gaytán. I'm an ordinary Software Developer and frustrated Graphic Designer. Welcome to the place where there is almost always good things.
</p>

Come in and enjoy the ride through this site. You will see some interesting things, unfinished projects and the attempt to make a good blog that will not progress much.

Text in spanish, text in english... I know nothing about chinese.

Learn more about what I do (attempt to do) and what I like to talk:

[GitHub](https://github.com/MrGaytan).
[Behance](https://www.behance.net/MrGaytan).
[Twitter](https://twitter.com/MrGaytan).

Blog license [here](https://github.com/poole/hyde/blob/master/LICENSE.md). Thank you!

Thanks for taking the time to stop by.


text:
## Supplementary scripts used in "Genomic remnants of ancestral hydrogen and methane metabolism in Archaea drive anaerobic carbon cycling." by Adam, Kolyfetis, et al., 2021

## License

The scripts within this repository are supplied under the MIT license (see associated LICENSE file).

## Contact Information

For any questions, please consult Panagiotis Adam (panagiotis.adam@uni-due.de).

## Table of Contents

- LICENSE
- ASR_parser.py
- distributions_uniprot.py
- fuse_sequences.py

## Dependencies

- All scripts are written in python3
- Required non-standard python3 modules:
	- Biopython (fuse_sequences.py and distributions_uniprot.py)

## Usage instructions

- ASR_parser.py
	- This script parses the output .state file produced by IQ-TREE ancestral sequence reconstruction. For each node in the tree, it outputs the most probable reconstructed sequence containing the most probable state/amino acid for each position, and the probability of the reconstructed sequence as the mean probability of the individual positions. It can function on part of an alignment/supermatrix.
	- Usage: python ASR_parser.py {input.state} X Y Z {output.faa}
		- input.state: output .state file from IQ-TREE
		- X: start position of wanted gene (find it from the input alignment)
		- Y: stop position of wanted gene (find it from the input alignment)
		- Z: gene length (do the substraction) Z=(Y-X)+1
		- output.faa: Output fasta file with every node sequence

- distributions_uniprot.py
	- This script starts by searching each accession from a list of Pfam accessions (given by the user as a text file) in a Uniprot records file (given again by the user). For each Pfam accession it outputs the number for each Domain of life (plus Viruses and Unclassified organisms) this accession can be found in, plus the percentage of Archaea in each of those records.
	- Usage: python distributions_uniprot.py {pfam_accessions.txt} {uniprot_records.txt}
		- pfam_accessions.txt: user-supplied list of Pfam accessions
		- uniprot_records.txt: uniprot records file
	- Prints to STDOUT

- fuse_sequences.py
	- This script fuses (interactively) sequences from an alignment. It is used for sequences that are split (e.g. due to sequencing or ORF prediction errors), using their accession numbers as a guide.
	- Usage: python fuse_sequences.py {fasta_file.faa} {logfile.txt} {outfile.faa}
		- fasta_file.faa: Alignment file with possible split sequences
		- logfile.txt: log file detailing cases of fusing of split genes
		- outfile.faa: edited alignment output file with fused and not fused genes


text:
# Mokasfoci (Bet Game)

This is a React based bet game application you can play with friends. It communicates with a NodeJs server with MongoDb. This repository contains only client app.

I use the [Black Dashboard React](https://demos.creative-tim.com/black-dashboard-react/#/admin/dashboard) template for application.

## Install client

- Clone the repo: `git clone https://github.com/blaskodaniel/mokasfoci.git`.
- npm install
- npm start

repository: blaskodaniel/mokasfoci

repo_name: blaskodaniel/mokasfoci


text:
# Act Two
---

The second act of [[dnd]] is titled [dnd (act 2)](https://docs.google.com/document/d/1XGPpMqvEd2hSP8LiRHx5d5PAKzn03T1_CHXm2rx7tS0/edit). The act continues the exploration of Dave and Day's relationship as it progresses. It is mostly comprised of letters from Day with intermittent updates from Dave.

repository: Quandrant/davetura

path: /Act Two.md

filename: Act Two.md

gha_language: CSS

repo_name: Quandrant/davetura


text:
# Getting Start 学习记录

首先下载 wireshark, 我是 MacOS 在官网下载安装包.

除了安装 Wireshark, 安装包内部还有一些依赖项和将 Wireshark 加入系统路径. 操作结束后即可打开运行 Wireshark

# 初始界面

![5EFE8EEA-EAA8-4C23-B3B0-D5372818F278](img/initial.png)

双击击`Wi-Fi: en0`开始监听, 进入监听界面

# 跟踪第一个 URL

在 Wireshark 开始抓包(packet capture)的时候, 在浏览器输入

http://gaia.cs.umass.edu/wireshark-labs/INTRO-wireshark-file1.html

然后通过 HTTP 标签过滤出对 HTTP协议包的计息结果, 结果如图

![47513F33-CFC8-42EF-A8AD-13BDC4FA3341](img/fig1.png)

GET 对应的数据报如下

```
Hypertext Transfer Protocol
    GET /wireshark-labs/INTRO-wireshark-file1.html HTTP/1.1\r\n
    Host: gaia.cs.umass.edu\r\n
    Connection: keep-alive\r\n
    Cache-Control: max-age=0\r\n
    Upgrade-Insecure-Requests: 1\r\n
    User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36\r\n
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9\r\n
    Accept-Encoding: gzip, deflate\r\n
    Accept-Language: en-US,en;q=0.9,zh;q=0.8,zh-CN;q=0.7\r\n
    If-None-Match: "51-5a50893dfa37e"\r\n
    If-Modified-Since: Thu, 07 May 2020 05:59:02 GMT\r\n
    \r\n
    [Full request URI: http://gaia.cs.umass.edu/wireshark-labs/INTRO-wireshark-file1.html]
    [HTTP request 1/1]
    [Response in frame: 72]

```

服务器返回的数据报如下

```
Hypertext Transfer Protocol
    HTTP/1.1 304 Not Modified\r\n
    Date: Thu, 07 May 2020 08:57:17 GMT\r\n
    Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16 mod_perl/2.0.11 Perl/v5.16.3\r\n
    Connection: Keep-Alive\r\n
    Keep-Alive: timeout=5, max=100\r\n
    ETag: "51-5a50893dfa37e"\r\n
    \r\n
    [HTTP response 1/1]
    [Time since request: 0.254257000 seconds]
    [Request in frame: 63]
    [Request URI: http://gaia.cs.umass.edu/wireshark-labs/INTRO-wireshark-file1.html]

```

我将结果保存在了`captured_packet.pcapng`这里, 可以从 Wireshark 里面打开这个文佳回复当时的抓包.

# 其他作业题

>List 3 different protocols that appear in the protocol column in the unfiltered packet-listing window in step 7 above.

MDNS, TCP, SSDP, ARP, STP,  ICMP

> How long did it take from when the HTTP GET message was sent until the HTTP OK reply was received? (By default, the value of the Time column in the packetlisting window is the amount of time, in seconds, since Wireshark tracing began. To display the Time field in time-of-day format, select the Wireshark View pull down menu, then select Time Display Format, then select Time-of-day.)

![4694D9F4-474C-459E-9FE7-4DF07787DD5C](img/fig2.png)

> What is the Internet address of the gaia.cs.umass.edu (also known as wwwnet.cs.umass.edu)? What is the Internet address of your computer?

<IP_ADDRESS>

<IP_ADDRESS>

> Print the two HTTP messages (GET and OK) referred to in question 2 above. To do so, select Print from the Wireshark File command menu, and select the “Selected Packet Only” and “Print as displayed” radial buttons, and then click OK.

![C37B588E-8731-4CCD-AC26-BA0E1896DFD6](img/fig3.png)

path: /WiresharkLab/1 Getting Started/1 实验记录.md

filename: 1 实验记录.md


text:
+++
title = "How to build a pipeline"
date = 2021-08-30T08:30:00-06:00
weight = 20
+++

The best way to automate the creation of CI/CD pipelines is by provisioning them programmatically via Infrastructure as Code. This is specially useful in a microservices environment, where you have a pipeline per microservice, which potentially means dozens of pipelines, if not more. Having an automated way to create these pipelines enables developers to create as many as necessary without building them manually from the console every time.

### Different ways to create pipelines
We see customers using different mechanisms for creating pipelines programmatically. Nowadays developers have many choices to pick from, but the most common ones we see are the following:

- [AWS CloudFormation](https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials.html)
- [AWS CDK](https://docs.aws.amazon.com/cdk/latest/guide/codepipeline_example.html)
- [Terraform](https://www.terraform.io/docs/providers/aws/r/codepipeline.html)
- [AWS Serverless App Repository](https://serverlessrepo.aws.amazon.com/applications/arn:aws:serverlessrepo:us-east-1:646794253159:applications~aws-sam-codepipeline-cd)

### Introducing the AWS CDK
In this workshop, we are going to use the AWS Cloud Development Kit (also known as CDK), as the pipeline vending mechanism. The AWS CDK is a software development framework for defining cloud infrastructure in code and provisioning it through AWS CloudFormation.

That's right! You can describe your infrastructure by writing code in TypeScript, C#, Python, or Java. Your code is then synthesized into CloudFormation and using the CDK CLI you can deploy it to an AWS account.

### How do SAM and CDK play together?

Serverless developers use the SAM framework to define their applications, SAM CLI to build them and deploy them and AWS CDK to provision any infrastructure related resources, like their CI/CD Pipeline. The nice thing about these tools is that they all share a common ground: CloudFormation.

repository: mmondino/aws-serverless-cicd-workshop

repo_name: mmondino/aws-serverless-cicd-workshop


text:
# RCH::Oscillators
#### A library of DSP oscillators in pure C++

-------------------------------------------------------------------------------------------------------

## Index

1. [Introduction](https://github.com/rcliftonharvey/rchoscillators/blob/master/README.md#introduction)
2. [Included oscillators](https://github.com/rcliftonharvey/rchoscillators/blob/master/README.md#included-oscillators)
3. [A note on band-limiting](https://github.com/rcliftonharvey/rchoscillators/blob/master/README.md#a-note-on-band-limiting)
4. [How to use](https://github.com/rcliftonharvey/rchoscillators/blob/master/README.md#how-to-use)
5. [Simplified use](https://github.com/rcliftonharvey/rchoscillators/blob/master/README.md#simplified-use)
6. [Example project](https://github.com/rcliftonharvey/rchoscillators/blob/master/README.md#example-project)
7. [Notes](https://github.com/rcliftonharvey/rchoscillators/blob/master/README.md#notes)
8. [License](https://github.com/rcliftonharvey/rchoscillators/blob/master/README.md#license)
9. [Credits](https://github.com/rcliftonharvey/rchoscillators/blob/master/README.md#credits)

-------------------------------------------------------------------------------------------------------

## Introduction

This is a pure C++ library that implements all sorts of *naive* oscillator types, as well as their *band-limited* flavours, in fast and easy to use classes.

This library is compatible with frameworks like [JUCE](https://juce.com/) or [WDL](https://www.cockos.com/wdl/), but it was written with no dependencies, which means you can use it by itself and in any application, without being bound to any such 3rd party frameworks at all.

I have done my best to comment the sources as much as I could (or made sense to me), so by reading through the headers you should get a good enough idea of what things can do or what you need to do with them.

The original repository for RCH::Oscillators is right here:

[https://github.com/rcliftonharvey/rchoscillators]

-------------------------------------------------------------------------------------------------------

## Included oscillators

Included *naive* oscillators:
+ sine
+ triangle
+ saw (rising and falling)
+ square
+ square-pulse (square with variable width)
+ pulse

Included *band-limited* oscillators:
+ triangle
+ saw (rising and falling)
+ square
+ square-pulse (square with variable width)
+ pulse

I will probably be adding more oscillators and generation methods to this library over time...

The included oscillators come both as single-channel per-sample "templates", as well as multi-channel capable processors that can fill entire sample buffers with a sound wave in just one short line of code.

-------------------------------------------------------------------------------------------------------

## A note on band-limiting

It's probably worth mentioning that since the *band-limited* oscillators are created by progressively generating and adding multiple sine waves, they **can** come at a price.

While they are guaranteed to be aliasing-free, their accuracy depends on how many harmonic sine waves are calculated. For some wave shapes you can get away with generating just a few harmonic overtones to get a fairly smooth oscillation, and for others it's necessary to calculate quite a lot of harmonics until they start looking close to what they should look like.

> A *harmonic overtone* is essentially a multiple of the base frequency. The lower the frequency of the wave, the more harmonics have to be generated to fill the spectrum, and the higher the frequency of the wave, the less harmonics have to be generated. This means that a simple saw wave could hardly touch the CPU at really high frequencies, but possibly bring your machine to a near halt at 1 Hz.

**Example**

A saw wave should oscillate at 1.000 Hz. With a sample rate of 44.100 Hz, the highest frequency that can be calculated is 22.050 Hz. Since saw waves contain even and odd harmonics, to get an accurate band-limited saw wave, an additional sine wave at every multiple of the base frequency needs to be generated and added. One at 2.000 Hz (2x 1.000 Hz), one at 3.000 Hz (3x 1.000 Hz), one at 4.000 Hz (4x 1.000 Hz), and so on until it reaches the 1/2 sample rate nyquist limit at, in this case, 22.050 Hz.

> Overall, including the sine wave at the base frequency, it's necessary to calculate and add **22** sine waves to get a clean band-limited saw wave at 1.000 Hz.

Now, if the saw wave were to oscillate at 10 Hz, at the same sample rate of 44.100 Hz and the same nyquist cutoff at 22.050 Hz, things would get tricky. The same rule applies: to generate a clean saw wave, every multiple of the base frequency up to the 1/2 sample rate nyquist limit has to be calculated and added in. This means we need an additional sine wave at 20 Hz (2x 10 Hz), one at 30 Hz (3x 10 Hz), one at 40 Hz (4x 10 Hz) and so on, again until we hit the 22.050 Hz limit.

> Overall, including the sine wave at the base frequency, it's necessary to calculate and add **2.205** sine waves to get a clean band-limited saw wave at 10 Hz.

2.205 in contrast to 22 before... quite a jump.

Since triangle and square waves consist of only odd-order harmonics, it's sufficient to calculate only every second harmonic on top of the base frequency. So these wave shapes will probably be a bit lighter on CPU, as they only have to calculate and add half the amount of harmonic sine waves compared to, say, a sawtooth.

I built an accuracy setting into the band-limited oscillators, check the [skeleton_bl.h](https://github.com/rcliftonharvey/rchoscillators/tree/master/library/helpers/skeleton_bl.h) header file for the exact limit definitions. An accuracy of 7 will guarantee that all harmonics up to 22.050 Hz will be calculated for even a 1 Hz wave. You may want to go higher than that, since a project sample rate of 192 kHz could handle frequencies up to 96.000 Hz and stopping at 22.050 Hz could look (and sound) truncated... eventually, it all depends on how accurate you want it to be.

But for most applications, you should probably be able to get away with an accuracy setting of 5, making 88.2 Hz the lowest frequency to still get harmonics up to 22.050 Hz nyquist. As a reference: the lowest (useful) MIDI note is A0, equivalent to a frequency of 27.5 Hz. Using the 22.050 Hz nyquist limit for 44.100 Hz sample rate, that would mean generating 801 sine waves, which is the case if you set accuracy to 6.

Because of this difficulty, I would recommend using these additively band-limited oscillators for synthesis only, and falling back to naive oscillators for modulation applications like LFOs.

-------------------------------------------------------------------------------------------------------

## How to use

Include the [library](https://github.com/rcliftonharvey/rchoscillators/tree/master/library) folder in your project, and include the main header file into your own main project header(s).

If you use JUCE, add all the files from the library folder into a group in your JUCE project. The easiest way to do this is via the "add existing files" option in the files pane of the Projucer app.

Depending on your compiler and workspace settings, you will probably have to adjust the include path for this file. But once the include path is sorted out, this is the only line you should need:
```c++
#include "rch_oscillators.h"
```

To avoid possible collisions with other libraries you may be using in your projects, all the classes in this library reside in the **RCH::** namespace by default. You're of course welcome to change the namespace in the [rch_oscillators.h](https://github.com/rcliftonharvey/rchoscillators/tree/master/library/rch_oscillators.h) main include.

> **IMPORTANT** *Since I remember struggling with this myself in the early years...

> These oscillators are **stateful**. This means one oscillator instance stays alive all the time, and no matter how many sample blocks you need to fill, you always do it with the same oscillator instance. If you want to have a continuous oscillator wave without any distortion or phase jumps, do not instantiate these in your per-block processing methods, but instantiate them as lasting variables in your header files.* :)

To get started, go ahead and instantiate a simple mono sine oscillator class. In JUCE, you would do this in the **PluginProcessor.h** file, for WDL it would be in your main project .h file.
```c++
RCH::Oscillators::Templates::Sine oscSine;
```

This will create an oscillator that can produce a continuous sine wave for a single channel of audio, and you will have to poll it on a per-sample basis.

Now that your oscillator is instantiated, you need to inform it about essential values, like the sample rate to operate at and the center frequency to generate the sine wave at, otherwise the oscillator can't process correctly. Set the oscillator up somewhere in your per-block processing call, in JUCE it would be the **processBlock** method in the **PluginProcessor.cpp** file, in WDL it would be the **ProcessDoubleReplacing** method in the main project .cpp file:
```c++
oscSine.setSampleRate(sampleRateInHz);
oscSine.setFrequency(frequencyInHz);
oscSine.setAmplitude(volumeInFloatGain);   // if you use float gain factors (type float)
/* --- or --- */
oscSine.setVolume(volumeInDoubleDecibels); // if you use Decibel values (type double)
```

The *SAW* and *PULSE* oscillators have special properties that are not handled by the regular setup routine. It is not required to set these up to get sound out of the oscillators, but these parameters do offer extended control over the sound, so it's worth mentioning them.
```c++
oscSaw.setDirection(-1.0); // wave falls from high to low
oscSaw.setDirection(1.0);  // wave rises from low to high

oscPulse.setWidth(0.125);  // very narrow pulses
oscPulse.setWidth(0.85);   // nearly square wave
```

Finally, run a loop that fetches one tick from the oscillator for every sample in a channel array.
```c++
for (unsigned int sample=0; sample<NumSamples; ++sample)
{
  channel[sample] =  oscSine.tick();   // This will replace the incoming signal with the sine wave
  /* --- or --- */
  channel[sample] += oscSine.tick();   // This will add the sine wave on top of the incoming signal
}
```

Your channel of samples will now be filled with a sine wave, and that's all you need to get going.

-------------------------------------------------------------------------------------------------------

## Simplified use

Now, I'm a lazy guy, so I don't always want to cycle through all the channels and all the samples of a buffer by hand, that just takes up time and space. So I've included a set of wrapper classes that deal with this pesky task automatically. You just pass a C array of **double**s or **float**s into the oscillator, as well as two **unsigned int**s with the number of channels and samples in that C array, and the oscillator will handle it from there.

In their current state, these wrapper classes will generate a **single mono oscillator**, and insert or add that mono signal onto **all** the buffer's channels equally. I see no need to have a different oscillator for each channel, it would just make this library needlessly complex to handle.

Theoretically, there is no limitation to the number of channels that could be processed, a buffer block could have a single channel, or over 200 channels, the oscillators don't care. Your CPU might, at some point. :)

To create an example triangle wave oscillator that offers this simple processing method, just instantiate it in your header file like this:
```c++
RCH::Oscillators::Triangle oscTriangle;
```

Then set it up somewhere in your processing methods...
```c++
oscTriangle.setup(sampleRateInHz,frequencyInHz,amplitudeInFloatGain);   // if you use float gain factors (type float) or
oscTriangle.setup(sampleRateInHz,frequencyInHz,volumeInDoubleDecibels); // if you use Decibel values (type double)
```

...and send a buffer of **float** or **double** samples into it:
```c++
oscTriangle.fill(buffer,numChannels,numSamples);  // if you want to completely overwrite the buffer
oscTriangle.add (buffer,numChannels,numSamples);  // if you want to add the triangle to the buffer
```

The **fill** or **add** methods expect an array of channels, where each channel is an array of samples. In native C++ lingo, this means the buffer needs to be of type **float**** or **double****, the most common types of sample & channel arrays.

If you're using WDL, your **ProcessDoubleReplacing** will provide you a variable named **input** that's already in the correct format.

If you're using JUCE, your **processBlock** method will present you with a variable named **buffer** in a JUCE specific datatype, the **AudioBuffer**. Despite being an abstraction, it still offers direct access to its channels and samples in the format required for the **fill** and **add** methods of these oscillators. Since the oscillator writes directly into the passed buffer, just make sure you go for WritePointers, not ReadPointers:
```c++
oscTriangle.fill(buffer.getArrayOfWritePointers(),numChannels,numSamples); // JUCE specific in processBlock
```

And that's just about all there's to it... :)

By the way: *don't worry about constantly pushing values into the setup() methods, e.g. in **processBlock**. The oscillators are designed to only ever bother with updating their settings internally if the incoming values actually change. If you send identical sample rate, center frequency and volume values into a setup() method 200 times, the oscillators won't care. If one of the values changes on the 201st time, then the oscillators will update.*

-------------------------------------------------------------------------------------------------------

## Example project

For a real world example, check out the included [RCHOscillatorsDemo](https://github.com/rcliftonharvey/rchoscillators/tree/master/demo) project. Yes, it's JUCE based, so you'd need that to build it. But it's also fine to just look into the [PluginProcessor.h](https://github.com/rcliftonharvey/rchoscillators/tree/master/demo/Source/PluginProcessor.h) and [PluginProcessor.cpp](https://github.com/rcliftonharvey/rchoscillators/tree/master/demo/Source/PluginProcessor.cpp) files, they should give you a good enough idea of how easy it is to work with this library.

-------------------------------------------------------------------------------------------------------

## License

This source code is provided under the [MIT License](https://en.wikipedia.org/wiki/MIT_License).

A copy of the MIT license in written form comes in the download of this library.

The JUCE framework itself is shipped and licensed separately, see the [JUCE website](https://juce.com) for more information.

JUCE is only required to compile the demo project, nothing more.

-------------------------------------------------------------------------------------------------------

## Credits

The oscillators in this library were inspired by **Alan Wolfe**'s example code at [Demofox.org](http://demofox.org/). By *inspired*, I don't mean that I merely copied his code snippets 1:1. I much rather used them to understand how they work, and then heavily optimized, extended and also in places simplified his concepts. Without reading the comments in my source code, you probably wouldn't notice much of a relation.

-------------------------------------------------------------------------------------------------------

Enjoy!

Rob Clifton-Harvey

repository: rcliftonharvey/rchoscillators

repo_name: rcliftonharvey/rchoscillators


text:
# ImJoy RPC

## Usage

Load the library to the browser
```html
<script
  type="text/javascript"
  onload="imjoyRPC.setupRPC()"
<EMAIL_ADDRESS>></script>
```

Or, you can use the npm module:
```bash
npm install imjoy-rpc
```

```js
import { imjoyRPC } from 'imjoy-rpc';

imjoyRPC.setupRPC({name: 'My Awesome App'}).then(api => {

})

```

### `imjoyRPC.waitForInitialization`

This function is used to setup a base frame for running plugins.
It will send `imjoyRPCReady` signal to the imjoy-core and listen for the `initialize` signal.
Once received, it will call `setupRPC` with the `config` from the imjoy-core:
```html
<script
  type="text/javascript"
  onload="imjoyRPC.waitForInitialization()"
<EMAIL_ADDRESS>></script>
```

If needed, the authentication will also be done in this step (see config below).

#### config
You can optionally pass a config object into the function `imjoyRPC.waitForInitialization(config)`

 * `config.credential_required`: `boolean`, whether your RPC app requires credentials
 * `config.credential_fields`: `array`(of `object`), what are the fields required for the credentials, the properties of the objects will be used to generate HTML `<input>` field, it should contain `label`, `id`, `value`(the default value), `type`(any type supported by `<input>`, e.g.: `text`, `number`, `password`). For example: `[{id: 'username', label: 'User Name', value: '', type: 'text'}, {id: 'password', label: 'Password', value: '', type: 'password'}]`.
 * `config.verify_credential`: `function`, a function to check if the submitted credential is valid
 * `config.target_origin`: `string`, the target origin required to connect to the RPC app, it's mandatory to set an explicit origin.

### `imjoyRPC.setupRPC`

Setup ImJoy RPC manually:
```js
imjoyRPC.setupRPC({name: 'My Awesome App'}).then((api)=>{
    // use the api object to interact with imjoy-core
})
```

### Configuration for `setupRPC`
 * name
  Name of your app

  **Required**

 * description
  Short description of your app

  Default: `[TODO: add description for YOUR APP]`

 * version
  Version of your app

  Default: `"0.1.0"`

 * allow_execution
  Allow code execution

  Default: `false`

 * target_origin
  Set the target origin for postMessage

  Default: `*`
 * enable_service_worker
  Enable service worker for cachine requirements

  Default: `false`

 * cache_requirements
  A callback function for caching requirements in the service worker

  Default: `null`

 * forwarding_functions
  A list of function names which will be exported automatically and forwarded to the remote api.
  Default: `["close", "on", "off", "emit"]` for all plugins, window plugins will include additional ones: `["resize", "show", "hide", "refresh"]`

### Connect to Hypha
```javascript
import { hyphaWebsocketClient } from "imjoy-rpc";

hyphaWebsocketClient.connectToServer({
  server_url: 'https://ai.imjoy.io',
}).then(async (api)=>{
  await api.register_service(
      {
          "id": "echo-service",
          "config":{
              "visibility": "public"
          },
          "type": "echo",
          echo( data ){
              console.log("Echo: ", data)
              return data
          }
      }
  )
})
```

repository: imjoy-team/imjoy-rpc

repo_name: imjoy-team/imjoy-rpc