text:
# WebCatalog

[![Travis Build Status](https://travis-ci.org/webcatalog/webcatalog.svg?branch=master)](https://travis-ci.org/webcatalog/webcatalog)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/webcatalog/webcatalog?branch=master&svg=true)](https://ci.appveyor.com/project/webcatalog/webcatalog/branch/master)
[![Apache License](http://img.shields.io/:license-apache-blue.svg)](https://github.com/webcatalog/webcatalog/blob/master/LICENSE)
#### Homepage: https://getwebcatalog.com

## Introduction
WebCatalog is a desktop app which allows users to install and run any web app natively (See [site-specific browser](https://en.wikipedia.org/wiki/Site-specific_browser)). It works similarly to [Fluid](http://fluidapp.com/) and [Nativefier](https://github.com/jiahaog/nativefier) but offers more features and an user-friendly user interface.

## Development
1. Install [Node.js 6+](https://nodejs.org), [Yarn](https://yarnpkg.com), [node-gyp](https://github.com/nodejs/node-gyp#installation).

2. Run
```bash
git clone https://github.com/webcatalog/webcatalog.git
cd desktop
yarn
```

To run the app for development:
```bash
yarn dev
yarn start.store.dev # run store app
yarn start.shell.dev # run site-specific-browser app
```

To build the app for release:
```bash
yarn dist
```

repository: moondev/webcatalog

repo_name: moondev/webcatalog


text:
# mourodrigo-data-science-covid-data-br-rs
Jupyter notebook analysing the Covid-19 cases data from Health Ministry of Rio Grande do Sul state, in Brazil.

[Click here](https://github.com/mourodrigo/mourodrigo-data-science-covid-data-br-rs/blob/master/data_science_covid_data_br_rs.ipynb) to view it!

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
```
╭───╮╭─╮
│   ││ │╭─╮╭──┬──┬─╮╭───╮╭───╮
│   ││ │├─┤│ ╭╮ ╭╮ ││ ─ ││╭╮ │  ╭────────┬─────────────────────╮
╰╮  ╰╯╭╯│ ││ ││ ││ ││  ─┤│╰╯ │  | UPLOAD │ ▒▒▒▒▒▒▒▒▒▒▒░░░░ %75 |
 ╰────╯ ╰─╯╰─╯╰─╯╰─╯╰───╯╰───╯  ╰────────┴─────────────────────╯
```

## Install

Using Bower
```
bower install https://github.com/KimCalvin/vimeo-upload
```

Or npm

```
npm install https://github.com/KimCalvin/vimeo-upload
```

## Usage

Include `vimeo-upload.js` in your index.html.

```
<script src="bower_components/vimeo-upload/vimeo-upload.js"></script>
```

Create a new `VimeoUpload` initialized with a Blob or File and Vimeo Access Token then call `upload()` to start the upload process.

```javascript
var uploader = new VimeoUpload({
  file: file,
  token: accessToken,
});

uploader.upload();
```

Your access token need to be authorized by Vimeo. Create new Vimeo access token [here](https://developer.vimeo.com/apps).

Check `index.html` for details and additional parameters you can include when initializing `VimeoUpload`.

## Credits

Sample code for uploading files directly with XHR/CORS: [cors-upload-sample](https://github.com/googledrive/cors-upload-sample)

repository: demvsystems/vimeo-upload

repo_name: demvsystems/vimeo-upload


text:
---
order: 2
title: Applications
---

# Applications

Please ensure you've first read the spec for [ABCI Methods and Types](abci.md)

Here we cover the following components of ABCI applications:

- [Connection State](#connection-state) - the interplay between ABCI connections and application state
  and the differences between `CheckTx` and `DeliverTx`.
- [Transaction Results](#transaction-results) - rules around transaction
  results and validity
- [Validator Set Updates](#validator-updates) - how validator sets are
  changed during `InitChain` and `EndBlock`
- [Query](#query) - standards for using the `Query` method and proofs about the
  application state
- [Crash Recovery](#crash-recovery) - handshake protocol to synchronize
  Tendermint and the application on startup.
- [State Sync](#state-sync) - rapid bootstrapping of new nodes by restoring state machine snapshots

## Connection State

Since Tendermint maintains four concurrent ABCI connections, it is typical
for an application to maintain a distinct state for each, and for the states to
be synchronized during `Commit`.

### Concurrency

In principle, each of the four ABCI connections operate concurrently with one
another. This means applications need to ensure access to state is
thread safe. In practice, both the
[default in-process ABCI client](https://github.com/tendermint/tendermint/blob/v0.34.4/abci/client/local_client.go#L18)
and the
[default Go ABCI
server](https://github.com/tendermint/tendermint/blob/v0.34.4/abci/server/socket_server.go#L32)
use global locks across all connections, so they are not
concurrent at all. This means if your app is written in Go, and compiled in-process with Tendermint
using the default `NewLocalClient`, or run out-of-process using the default `SocketServer`,
ABCI messages from all connections will be linearizable (received one at a
time).

The existence of this global mutex means Go application developers can get
thread safety for application state by routing *all* reads and writes through the ABCI
system. Thus it may be *unsafe* to expose application state directly to an RPC
interface, and unless explicit measures are taken, all queries should be routed through the ABCI Query method.

### BeginBlock

The BeginBlock request can be used to run some code at the beginning of
every block. It also allows Tendermint to send the current block hash
and header to the application, before it sends any of the transactions.

The app should remember the latest height and header (ie. from which it
has run a successful Commit) so that it can tell Tendermint where to
pick up from when it restarts. See information on the Handshake, below.

### Commit

Application state should only be persisted to disk during `Commit`.

Before `Commit` is called, Tendermint locks and flushes the mempool so that no new messages will
be received on the mempool connection. This provides an opportunity to safely update all four connection
states to the latest committed state at once.

When `Commit` completes, it unlocks the mempool.

WARNING: if the ABCI app logic processing the `Commit` message sends a
`/broadcast_tx_sync` or `/broadcast_tx_commit` and waits for the response
before proceeding, it will deadlock. Executing those `broadcast_tx` calls
involves acquiring a lock that is held during the `Commit` call, so it's not
possible. If you make the call to the `broadcast_tx` endpoints concurrently,
that's no problem, it just can't be part of the sequential logic of the
`Commit` function.

### Consensus Connection

The Consensus Connection should maintain a `DeliverTxState` - the working state
for block execution. It should be updated by the calls to `BeginBlock`, `DeliverTx`,
and `EndBlock` during block execution and committed to disk as the "latest
committed state" during `Commit`.

Updates made to the `DeliverTxState` by each method call must be readable by each subsequent method -
ie. the updates are linearizable.

### Mempool Connection

The mempool Connection should maintain a `CheckTxState`
to sequentially process pending transactions in the mempool that have
not yet been committed. It should be initialized to the latest committed state
at the end of every `Commit`.

Before calling `Commit`, Tendermint will lock and flush the mempool connection,
ensuring that all existing CheckTx are responded to and no new ones can begin.
The `CheckTxState` may be updated concurrently with the `DeliverTxState`, as
messages may be sent concurrently on the Consensus and Mempool connections.

After `Commit`, while still holding the mempool lock, CheckTx is run again on all transactions that remain in the
node's local mempool after filtering those included in the block.
An additional `Type` parameter is made available to the CheckTx function that
indicates whether an incoming transaction is new (`CheckTxType_New`), or a
recheck (`CheckTxType_Recheck`).

Finally, after re-checking transactions in the mempool, Tendermint will unlock
the mempool connection. New transactions are once again able to be processed through CheckTx.

Note that CheckTx is just a weak filter to keep invalid transactions out of the block chain.
CheckTx doesn't have to check everything that affects transaction validity; the
expensive things can be skipped.  It's weak because a Byzantine node doesn't
care about CheckTx; it can propose a block full of invalid transactions if it wants.

#### Replay Protection

To prevent old transactions from being replayed, CheckTx must implement
replay protection.

It is possible for old transactions to be sent to the application. So
it is important CheckTx implements some logic to handle them.

### Query Connection

The Info Connection should maintain a `QueryState` for answering queries from the user,
and for initialization when Tendermint first starts up (both described further
below).
It should always contain the latest committed state associated with the
latest committed block.

`QueryState` should be set to the latest `DeliverTxState` at the end of every `Commit`,
after the full block has been processed and the state committed to disk.
Otherwise it should never be modified.

Tendermint Core currently uses the Query connection to filter peers upon
connecting, according to IP address or node ID. For instance,
returning non-OK ABCI response to either of the following queries will
cause Tendermint to not connect to the corresponding peer:

- `p2p/filter/addr/<ip addr>`, where `<ip addr>` is an IP address.
- `p2p/filter/id/<id>`, where `<is>` is the hex-encoded node ID (the hash of
  the node's p2p pubkey).

Note: these query formats are subject to change!

### Snapshot Connection

The Snapshot Connection is optional, and is only used to serve state sync snapshots for other nodes
and/or restore state sync snapshots to a local node being bootstrapped.

For more information, see [the state sync section of this document](#state-sync).

## Transaction Results

The `Info` and `Log` fields are non-deterministic values for debugging/convenience purposes
that are otherwise ignored.

The `Data` field must be strictly deterministic, but can be arbitrary data.

### Gas

Ethereum introduced the notion of `gas` as an abstract representation of the
cost of resources used by nodes when processing transactions. Every operation in the
Ethereum Virtual Machine uses some amount of gas, and gas can be accepted at a market-variable price.
Users propose a maximum amount of gas for their transaction; if the tx uses less, they get
the difference credited back. Tendermint adopts a similar abstraction,
though uses it only optionally and weakly, allowing applications to define
their own sense of the cost of execution.

In Tendermint, the [ConsensusParams.Block.MaxGas](../proto/types/params.proto) limits the amount of `gas` that can be used in a block.
The default value is `-1`, meaning no limit, or that the concept of gas is
meaningless.

Responses contain a `GasWanted` and `GasUsed` field. The former is the maximum
amount of gas the sender of a tx is willing to use, and the latter is how much it actually
used. Applications should enforce that `GasUsed <= GasWanted` - ie. tx execution
should halt before it can use more resources than it requested.

When `MaxGas > -1`, Tendermint enforces the following rules:

- `GasWanted <= MaxGas` for all txs in the mempool
- `(sum of GasWanted in a block) <= MaxGas` when proposing a block

If `MaxGas == -1`, no rules about gas are enforced.

Note that Tendermint does not currently enforce anything about Gas in the consensus, only the mempool.
This means it does not guarantee that committed blocks satisfy these rules!
It is the application's responsibility to return non-zero response codes when gas limits are exceeded.

The `GasUsed` field is ignored completely by Tendermint. That said, applications should enforce:

- `GasUsed <= GasWanted` for any given transaction
- `(sum of GasUsed in a block) <= MaxGas` for every block

In the future, we intend to add a `Priority` field to the responses that can be
used to explicitly prioritize txs in the mempool for inclusion in a block
proposal. See [#1861](https://github.com/tendermint/tendermint/issues/1861).

### CheckTx

If `Code != 0`, it will be rejected from the mempool and hence
not broadcasted to other peers and not included in a proposal block.

`Data` contains the result of the CheckTx transaction execution, if any. It is
semantically meaningless to Tendermint.

`Events` include any events for the execution, though since the transaction has not
been committed yet, they are effectively ignored by Tendermint.

### DeliverTx

DeliverTx is the workhorse of the blockchain. Tendermint sends the
DeliverTx requests asynchronously but in order, and relies on the
underlying socket protocol (ie. TCP) to ensure they are received by the
app in order. They have already been ordered in the global consensus by
the Tendermint protocol.

If DeliverTx returns `Code != 0`, the transaction will be considered invalid,
though it is still included in the block.

DeliverTx also returns a [Code, Data, and Log](../../proto/abci/types.proto#L189-L191).

`Data` contains the result of the CheckTx transaction execution, if any. It is
semantically meaningless to Tendermint.

Both the `Code` and `Data` are included in a structure that is hashed into the
`LastResultsHash` of the next block header.

`Events` include any events for the execution, which Tendermint will use to index
the transaction by. This allows transactions to be queried according to what
events took place during their execution.

## Updating the Validator Set

The application may set the validator set during InitChain, and may update it during
EndBlock.

Note that the maximum total power of the validator set is bounded by
`MaxTotalVotingPower = MaxInt64 / 8`. Applications are responsible for ensuring
they do not make changes to the validator set that cause it to exceed this
limit.

Additionally, applications must ensure that a single set of updates does not contain any duplicates -
a given public key can only appear once within a given update. If an update includes
duplicates, the block execution will fail irrecoverably.

### InitChain

The `InitChain` method can return a list of validators.
If the list is empty, Tendermint will use the validators loaded in the genesis
file.
If the list returned by `InitChain` is not empty, Tendermint will use its contents as the validator set.
This way the application can set the initial validator set for the
blockchain.

### EndBlock

Updates to the Tendermint validator set can be made by returning
`ValidatorUpdate` objects in the `ResponseEndBlock`:

```protobuf
message ValidatorUpdate {
  tendermint.crypto.keys.PublicKey pub_key
  int64 power
}

message PublicKey {
  oneof {
    ed25519 bytes = 1;
  }
```

The `pub_key` currently supports only one type:

- `type = "ed25519"`

The `power` is the new voting power for the validator, with the
following rules:

- power must be non-negative
- if power is 0, the validator must already exist, and will be removed from the
  validator set
- if power is non-0:
    - if the validator does not already exist, it will be added to the validator
    set with the given power
    - if the validator does already exist, its power will be adjusted to the given power
- the total power of the new validator set must not exceed MaxTotalVotingPower

Note the updates returned in block `H` will only take effect at block `H+2`.

## Consensus Parameters

ConsensusParams enforce certain limits in the blockchain, like the maximum size
of blocks, amount of gas used in a block, and the maximum acceptable age of
evidence. They can be set in InitChain and updated in EndBlock.

### BlockParams.MaxBytes

The maximum size of a complete Protobuf encoded block.
This is enforced by Tendermint consensus.

This implies a maximum transaction size that is this MaxBytes, less the expected size of
the header, the validator set, and any included evidence in the block.

Must have `0 < MaxBytes < 100 MB`.

### BlockParams.MaxGas

The maximum of the sum of `GasWanted` that will be allowed in a proposed block.
This is *not* enforced by Tendermint consensus.
It is left to the app to enforce (ie. if txs are included past the
limit, they should return non-zero codes). It is used by Tendermint to limit the
txs included in a proposed block.

Must have `MaxGas >= -1`.
If `MaxGas == -1`, no limit is enforced.

### EvidenceParams.MaxAgeDuration

This is the maximum age of evidence in time units.
This is enforced by Tendermint consensus.

If a block includes evidence older than this (AND the evidence was created more
than `MaxAgeNumBlocks` ago), the block will be rejected (validators won't vote
for it).

Must have `MaxAgeDuration > 0`.

### EvidenceParams.MaxAgeNumBlocks

This is the maximum age of evidence in blocks.
This is enforced by Tendermint consensus.

If a block includes evidence older than this (AND the evidence was created more
than `MaxAgeDuration` ago), the block will be rejected (validators won't vote
for it).

Must have `MaxAgeNumBlocks > 0`.

### EvidenceParams.MaxNum

This is the maximum number of evidence that can be committed to a single block.

The product of this and the `MaxEvidenceBytes` must not exceed the size of
a block minus it's overhead ( ~ `MaxBytes`).

Must have `MaxNum > 0`.

### Updates

The application may set the ConsensusParams during InitChain, and update them during
EndBlock. If the ConsensusParams is empty, it will be ignored. Each field
that is not empty will be applied in full. For instance, if updating the
Block.MaxBytes, applications must also set the other Block fields (like
Block.MaxGas), even if they are unchanged, as they will otherwise cause the
value to be updated to 0.

#### InitChain

ResponseInitChain includes a ConsensusParams.
If ConsensusParams is nil, Tendermint will use the params loaded in the genesis
file. If ConsensusParams is not nil, Tendermint will use it.
This way the application can determine the initial consensus params for the
blockchain.

#### EndBlock

ResponseEndBlock includes a ConsensusParams.
If ConsensusParams nil, Tendermint will do nothing.
If ConsensusParam is not nil, Tendermint will use it.
This way the application can update the consensus params over time.

Note the updates returned in block `H` will take effect right away for block
`H+1`.

## Query

Query is a generic method with lots of flexibility to enable diverse sets
of queries on application state. Tendermint makes use of Query to filter new peers
based on ID and IP, and exposes Query to the user over RPC.

Note that calls to Query are not replicated across nodes, but rather query the
local node's state - hence they may return stale reads. For reads that require
consensus, use a transaction.

The most important use of Query is to return Merkle proofs of the application state at some height
that can be used for efficient application-specific light-clients.

Note Tendermint has technically no requirements from the Query
message for normal operation - that is, the ABCI app developer need not implement
Query functionality if they do not wish too.

### Query Proofs

The Tendermint block header includes a number of hashes, each providing an
anchor for some type of proof about the blockchain. The `ValidatorsHash` enables
quick verification of the validator set, the `DataHash` gives quick
verification of the transactions included in the block, etc.

The `AppHash` is unique in that it is application specific, and allows for
application-specific Merkle proofs about the state of the application.
While some applications keep all relevant state in the transactions themselves
(like Bitcoin and its UTXOs), others maintain a separated state that is
computed deterministically *from* transactions, but is not contained directly in
the transactions themselves (like Ethereum contracts and accounts).
For such applications, the `AppHash` provides a much more efficient way to verify light-client proofs.

ABCI applications can take advantage of more efficient light-client proofs for
their state as follows:

- return the Merkle root of the deterministic application state in
`ResponseCommit.Data`. This Merkle root will be included as the `AppHash` in the next block.
- return efficient Merkle proofs about that application state in `ResponseQuery.Proof`
  that can be verified using the `AppHash` of the corresponding block.

For instance, this allows an application's light-client to verify proofs of
absence in the application state, something which is much less efficient to do using the block hash.

Some applications (eg. Ethereum, Cosmos-SDK) have multiple "levels" of Merkle trees,
where the leaves of one tree are the root hashes of others. To support this, and
the general variability in Merkle proofs, the `ResponseQuery.Proof` has some minimal structure:

```protobuf
message ProofOps {
  repeated ProofOp ops
}

message ProofOp {
  string type = 1;
  bytes key = 2;
  bytes data = 3;
}
```

Each `ProofOp` contains a proof for a single key in a single Merkle tree, of the specified `type`.
This allows ABCI to support many different kinds of Merkle trees, encoding
formats, and proofs (eg. of presence and absence) just by varying the `type`.
The `data` contains the actual encoded proof, encoded according to the `type`.
When verifying the full proof, the root hash for one ProofOp is the value being
verified for the next ProofOp in the list. The root hash of the final ProofOp in
the list should match the `AppHash` being verified against.

### Peer Filtering

When Tendermint connects to a peer, it sends two queries to the ABCI application
using the following paths, with no additional data:

- `/p2p/filter/addr/<IP:PORT>`, where `<IP:PORT>` denote the IP address and
  the port of the connection
- `p2p/filter/id/<ID>`, where `<ID>` is the peer node ID (ie. the
  pubkey.Address() for the peer's PubKey)

If either of these queries return a non-zero ABCI code, Tendermint will refuse
to connect to the peer.

### Paths

Queries are directed at paths, and may optionally include additional data.

The expectation is for there to be some number of high level paths
differentiating concerns, like `/p2p`, `/store`, and `/app`. Currently,
Tendermint only uses `/p2p`, for filtering peers. For more advanced use, see the
implementation of
[Query in the Cosmos-SDK](https://github.com/cosmos/cosmos-sdk/blob/v0.23.1/baseapp/baseapp.go#L333).

## Crash Recovery

On startup, Tendermint calls the `Info` method on the Info Connection to get the latest
committed state of the app. The app MUST return information consistent with the
last block it succesfully completed Commit for.

If the app succesfully committed block H, then `last_block_height = H` and `last_block_app_hash = <hash returned by Commit for block H>`. If the app
failed during the Commit of block H, then `last_block_height = H-1` and
`last_block_app_hash = <hash returned by Commit for block H-1, which is the hash in the header of block H>`.

We now distinguish three heights, and describe how Tendermint syncs itself with
the app.

```md
storeBlockHeight = height of the last block Tendermint saw a commit for
stateBlockHeight = height of the last block for which Tendermint completed all
    block processing and saved all ABCI results to disk
appBlockHeight = height of the last block for which ABCI app succesfully
    completed Commit

```

Note we always have `storeBlockHeight >= stateBlockHeight` and `storeBlockHeight >= appBlockHeight`
Note also Tendermint never calls Commit on an ABCI app twice for the same height.

The procedure is as follows.

First, some simple start conditions:

If `appBlockHeight == 0`, then call InitChain.

If `storeBlockHeight == 0`, we're done.

Now, some sanity checks:

If `storeBlockHeight < appBlockHeight`, error
If `storeBlockHeight < stateBlockHeight`, panic
If `storeBlockHeight > stateBlockHeight+1`, panic

Now, the meat:

If `storeBlockHeight == stateBlockHeight && appBlockHeight < storeBlockHeight`,
replay all blocks in full from `appBlockHeight` to `storeBlockHeight`.
This happens if we completed processing the block, but the app forgot its height.

If `storeBlockHeight == stateBlockHeight && appBlockHeight == storeBlockHeight`, we're done.
This happens if we crashed at an opportune spot.

If `storeBlockHeight == stateBlockHeight+1`
This happens if we started processing the block but didn't finish.

If `appBlockHeight < stateBlockHeight`
    replay all blocks in full from `appBlockHeight` to `storeBlockHeight-1`,
    and replay the block at `storeBlockHeight` using the WAL.
This happens if the app forgot the last block it committed.

If `appBlockHeight == stateBlockHeight`,
    replay the last block (storeBlockHeight) in full.
This happens if we crashed before the app finished Commit

If `appBlockHeight == storeBlockHeight`
    update the state using the saved ABCI responses but dont run the block against the real app.
This happens if we crashed after the app finished Commit but before Tendermint saved the state.

## State Sync

A new node joining the network can simply join consensus at the genesis height and replay all
historical blocks until it is caught up. However, for large chains this can take a significant
amount of time, often on the order of days or weeks.

State sync is an alternative mechanism for bootstrapping a new node, where it fetches a snapshot
of the state machine at a given height and restores it. Depending on the application, this can
be several orders of magnitude faster than replaying blocks.

Note that state sync does not currently backfill historical blocks, so the node will have a
truncated block history - users are advised to consider the broader network implications of this in
terms of block availability and auditability. This functionality may be added in the future.

For details on the specific ABCI calls and types, see the [methods and types section](abci.md).

### Taking Snapshots

Applications that want to support state syncing must take state snapshots at regular intervals. How
this is accomplished is entirely up to the application. A snapshot consists of some metadata and
a set of binary chunks in an arbitrary format:

- `Height (uint64)`: The height at which the snapshot is taken. It must be taken after the given
  height has been committed, and must not contain data from any later heights.

- `Format (uint32)`: An arbitrary snapshot format identifier. This can be used to version snapshot
  formats, e.g. to switch from Protobuf to MessagePack for serialization. The application can use
  this when restoring to choose whether to accept or reject a snapshot.

- `Chunks (uint32)`: The number of chunks in the snapshot. Each chunk contains arbitrary binary
  data, and should be less than 16 MB; 10 MB is a good starting point.

- `Hash ([]byte)`: An arbitrary hash of the snapshot. This is used to check whether a snapshot is
  the same across nodes when downloading chunks.

- `Metadata ([]byte)`: Arbitrary snapshot metadata, e.g. chunk hashes for verification or any other
  necessary info.

For a snapshot to be considered the same across nodes, all of these fields must be identical. When
sent across the network, snapshot metadata messages are limited to 4 MB.

When a new node is running state sync and discovering snapshots, Tendermint will query an existing
application via the ABCI `ListSnapshots` method to discover available snapshots, and load binary
snapshot chunks via `LoadSnapshotChunk`. The application is free to choose how to implement this
and which formats to use, but must provide the following guarantees:

- **Consistent:** A snapshot must be taken at a single isolated height, unaffected by
  concurrent writes. This can be accomplished by using a data store that supports ACID
  transactions with snapshot isolation.

- **Asynchronous:** Taking a snapshot can be time-consuming, so it must not halt chain progress,
  for example by running in a separate thread.

- **Deterministic:** A snapshot taken at the same height in the same format must be identical
  (at the byte level) across nodes, including all metadata. This ensures good availability of
  chunks, and that they fit together across nodes.

A very basic approach might be to use a datastore with MVCC transactions (such as RocksDB),
start a transaction immediately after block commit, and spawn a new thread which is passed the
transaction handle. This thread can then export all data items, serialize them using e.g.
Protobuf, hash the byte stream, split it into chunks, and store the chunks in the file system
along with some metadata - all while the blockchain is applying new blocks in parallel.

A more advanced approach might include incremental verification of individual chunks against the
chain app hash, parallel or batched exports, compression, and so on.

Old snapshots should be removed after some time - generally only the last two snapshots are needed
(to prevent the last one from being removed while a node is restoring it).

### Bootstrapping a Node

An empty node can be state synced by setting the configuration option `statesync.enabled =
true`. The node also needs the chain genesis file for basic chain info, and configuration for
light client verification of the restored snapshot: a set of Tendermint RPC servers, and a
trusted header hash and corresponding height from a trusted source, via the `statesync`
configuration section.

Once started, the node will connect to the P2P network and begin discovering snapshots. These
will be offered to the local application via the `OfferSnapshot` ABCI method. Once a snapshot
is accepted Tendermint will fetch and apply the snapshot chunks. After all chunks have been
successfully applied, Tendermint verifies the app's `AppHash` against the chain using the light
client, then switches the node to normal consensus operation.

#### Snapshot Discovery

When the empty node join the P2P network, it asks all peers to report snapshots via the
`ListSnapshots` ABCI call (limited to 10 per node). After some time, the node picks the most
suitable snapshot (generally prioritized by height, format, and number of peers), and offers it
to the application via `OfferSnapshot`. The application can choose a number of responses,
including accepting or rejecting it, rejecting the offered format, rejecting the peer who sent
it, and so on. Tendermint will keep discovering and offering snapshots until one is accepted or
the application aborts.

#### Snapshot Restoration

Once a snapshot has been accepted via `OfferSnapshot`, Tendermint begins downloading chunks from
any peers that have the same snapshot (i.e. that have identical metadata fields). Chunks are
spooled in a temporary directory, and then given to the application in sequential order via
`ApplySnapshotChunk` until all chunks have been accepted.

The method for restoring snapshot chunks is entirely up to the application.

During restoration, the application can respond to `ApplySnapshotChunk` with instructions for how
to continue. This will typically be to accept the chunk and await the next one, but it can also
ask for chunks to be refetched (either the current one or any number of previous ones), P2P peers
to be banned, snapshots to be rejected or retried, and a number of other responses - see the ABCI
reference for details.

If Tendermint fails to fetch a chunk after some time, it will reject the snapshot and try a
different one via `OfferSnapshot` - the application can choose whether it wants to support
restarting restoration, or simply abort with an error.

#### Snapshot Verification

Once all chunks have been accepted, Tendermint issues an `Info` ABCI call to retrieve the
`LastBlockAppHash`. This is compared with the trusted app hash from the chain, retrieved and
verified using the light client. Tendermint also checks that `LastBlockHeight` corresponds to the
height of the snapshot.

This verification ensures that an application is valid before joining the network. However, the
snapshot restoration may take a long time to complete, so applications may want to employ additional
verification during the restore to detect failures early. This might e.g. include incremental
verification of each chunk against the app hash (using bundled Merkle proofs), checksums to
protect against data corruption by the disk or network, and so on. However, it is important to
note that the only trusted information available is the app hash, and all other snapshot metadata
can be spoofed by adversaries.

Apps may also want to consider state sync denial-of-service vectors, where adversaries provide
invalid or harmful snapshots to prevent nodes from joining the network. The application can
counteract this by asking Tendermint to ban peers. As a last resort, node operators can use
P2P configuration options to whitelist a set of trusted peers that can provide valid snapshots.

#### Transition to Consensus

Once the snapshots have all been restored, Tendermint gathers additional information necessary for
bootstrapping the node (e.g. chain ID, consensus parameters, validator sets, and block headers)
from the genesis file and light client RPC servers. It also fetches and records the `AppVersion`
from the ABCI application.

Once the state machine has been restored and Tendermint has gathered this additional
information, it transitions to block sync (if enabled) to fetch any remaining blocks up the chain
head, and then transitions to regular consensus operation. At this point the node operates like
any other node, apart from having a truncated block history at the height of the restored snapshot.

repository: tendermint/tendermint

branch_name: refs/heads/main

gha_language: Go

repo_name: tendermint/tendermint


text:
---
layout: post
title: "Summer at the Edgerton Center"
date: 2014-8-25
extra_css: /css/post.css
---

During the 2014 summer I worked at the Edgerton Center. The center was started
in the name of Harold "Doc" Edgerton, an engineer who further developed the
field of photography through his work in stroboscopic photography, and who
encouraged his students to learn about engineering through a hands-on approach.

A part of the center is its K-12 outreach among the local Cambridge and Boston
students. During the summer, the center hosts several summer programs and also
assists other MIT departments' programs. The main focus of these programs are
engineering and science topics such as mechanical engineering, electrical
engineering, chemistry, biology, and optics.

As a summer worker, I was dealing with a variety of tasks.
Mainly, I interacted with the students and helped them on a one-on-one basis
whenever they needed help with the activities. The students ranged in age from
incoming middle school students to incoming high school students.

Behind the scenes, there was also database management; the student's data was
placed into a FileMaker database in order to easily manage name tags, forms,
and handouts. Different activities required different amount of preparing. For
example, an activity where students learn about the different states of matter
through making lip balm had a certain "recipe" that was taught to the students.
In past years, this recipe had been a difficult one because the final result
had caused the solid wax and butter to separate from the oil and pigment, or
for the final color to be dull, unlike what the original pigment looked like.
The preparation involved testing to see which ingredients were problematic and
to find better methods to prevent the dull color or separation. During the
different summer programs, I was also asked to photograph the
activities.

Slide show for photos of the Lego Car Rally activity

Some activities taught during the summer aren't offered during the year. These
usually have a large time requirement or are easier to teach to small groups,
such as glass fusing, the Traffic Light Activity, and Techno Threads, an
activity where students learn about circuits by sewing LEDs unto their
clothing or apparel. This summer included a new two-week program that
meant making an [underwater glider]({% post_url 2014-8-12-Seaglide %}).

Above: (Left) Final result of the Traffic Light activity. Students
learn about parallel and series circuits and capacitors. They make the circuit
on a breadboard and then transfer and solder unto the PCB. (Right) Students
design their own glass plate to fuse. This is my design.

Coming into MIT, I had very little knowledge regarding the field of electrical
engineering and computer science. I was forced to grow faster than I had ever
grown before in my knowledge of math and science during my first year at MIT.
My time at the Edgerton Center meant reinforcing what I had learned; teaching
other students the basics of the concepts I had learned in the past year and
fixing their mistakes allowed me to gain an intuition for those concepts. For
example, a common lesson taught during the school year at Edgerton included a
simple circuit with an LED, a battery, a switch, and a resistor. The amount and
variety of mistakes that a 10 year old can make trying to put the circuit
together is more than I had previously imagined. It
required me to see the circuit from the child's perspective and reword what I
knew from classes like 6.01 (Introduction to EECS 1) and 8.02 (Electricity and
Magnetism) so that I could explain to the student in his words what and why
things had gone wrong.


text:
## TAG Teleconference
##### 27 March 2018

Present: Peter, Sangwhan, David, Yves, Alex, Travis, Andrew (partial), Hadley (partial)

Scribe: David

Regrets:

---
## Agenda

### [Web Share Target API](https://github.com/w3ctag/design-reviews/issues/221) - David

David: Alex and I met with Matt recently, and there was a lot of good discussion on this

Alex: The shape of the API we discussed got rid of the URL substitution.  It's modeled as a GET or a POST.  Substitution of named parameters.  It's an evolution from where they started out.  Doesn't get rid of text-only sharing, but still gives URL in the manifest.

Alex: One other question is whether to require Service Worker for user experience.  Discussion suggested non-normative note.  Chrome won't allow unless you're installed as a PWA.

Alex: Proposal is now treating more like a form-encoded GET or POST, could be handled by the page or by a service worker.

Peter: When to discuss again?

Alex: About a month?

### [HTML General Review](https://github.com/w3ctag/design-reviews/issues/174) - Travis

Travis: This is my proposal to break it into bite-size chunks.  Had some feedback from folks at Microsoft.  Looking for feedback from this group on how the breakout is, or whether we should drop something from the review (e.g., appcache, microdata).  Given guidance, happy to take this to the next step and open issues.

[reads]

Alex: Outline algorithm is still here?

Travis: We do use it for something in our a11y code, though simpler version than what's in the spec.

Alex: W3C or WHATWG document?

Travis: I was looking at the WHATWG document; more in it.  e.g., server-sent events, websockets, cross-document messaging, web storage.

Travis: We already have a review open for two of them (offscreen canvas, ?).

David: seems like a reasonable breakdown; will reviewing them lead to useful outcomes?

Alex: Are there large piles of legacy APIs that can be rebuilt in terms of promises, generators (?), streams, etc.  Also some things here that require permissions not currently modeled in the Permissions API.

Travis: We also talked about looking for things that aren't explained well by the platform; forms and form submission is one area we talked about.  Identifying those could be useful.

Peter: Paths forward?  You suggested breaking up into individual issues.  Then we could spend time at the face-to-face triaging and assigning from there?  Maybe add labels to categorize the sorts of things we're looking at.

### [Vehicle Information Service Specification](https://github.com/w3ctag/design-reviews/issues/234) - Hadley
### [CSS ::part and ::theme pseudo elements](https://github.com/w3ctag/design-reviews/issues/230) - David

David: We asked when the spec changes would be done - hopefully would happen next week so let's revisit during the F2F.

### [ads.txt](https://github.com/w3ctag/design-reviews/issues/201) - Alex

Alex: No further interactions on this since we last talked about it.  Punt again.

Peter: Face-to-face or later?

Alex: I'll ping, and update at face-to-face.

### [ResizeObserver](https://github.com/w3ctag/design-reviews/issues/187) - Alex, David

Alex: Haven't had followup post Peter's comment about fragments vs. elements.  I can ping Aleks.

Peter: ...

Alex: I'll try to talk to Aleks this week and try to represent your view.

### [Privacy Mode](https://github.com/w3ctag/design-reviews/issues/101) - Hadley, Lukasz
### [Payment Handler](https://github.com/w3ctag/design-reviews/issues/231) - David

David: By today turned out ambitious, but I'll try to look this week to have something for face-to-face.

### [W3C DOM](https://github.com/w3ctag/design-reviews/issues/229) - Sangwhan, Travis

Travis: Haven't started anything yet.

Sangwhan: Nor I.

Travis: Punt this down the road a bit.

Peter: Face-to-face, or later?

Travis: I'm thinking after.

Sangwhan: Given the backlog, yeah, I don't think we'll have time during the face-to-face.

Alex: Can we do a triage?  Can we figure out what areas deserve attention so we can chew on a smaller piece when we get there.  I expect a lot of overlap between people for HTML and DOM reviews.  (??)So punt to later if we can't figure out how to split up?(??)

Travis: OK, (?) will do a triage and see if there's anything we want to split out and bite off during the face-to-face.

### [CSS Selectors 4](https://github.com/w3ctag/design-reviews/issues/219) - David

David: Looks like there was comment and response at London, nothing since.

Peter: Where do we go from here?  Is feedback addressed?

Alex: I'll respond.  Would love if David or Peter could weight in on question of explainer or in-document.  I would like to see motivations outlined.

Peter: CSS WG hasn't generally done that, but might be useful for insertions into old documents.

Alex: And seems good to have an explainer explaining insertions into older documents to explain the constraints.

Peter: Done after this response?

Alex: Check back in next week after I write the response.

### [Web Speech API](https://github.com/w3ctag/design-reviews/issues/214) - Hadley, Travis

Travis: I finally watched one of Brian's presentations linked from the issue.  I'm both happy we can do speech synthesis on the web (it's cool) and saddened by the shape of the API we have.  It seems simple and straightforward and first, then you get into it, there's a lot of magic happening, it's very hig-level ... wild-west in terms of having consistency between browsers.  Basic controls for pitch, volume, speed, but no way to connect to the rest of the platform.

Alex: Can you take the output and pipe it into web audio.

Travis: Zero connection between this API and the rest of the platform; pipes right to the speakers.  It's a rich area for refinement that way.  Honestly if a revised version were implemented in experiment, or a new shape we could expose, it would be fantastic and I'd love to see somethhing like that move forwad.  In terms of what to do next... we have some folks in a group at MS looking at the speech APIS.  Might be they have an interest in having more expressive power or pushing a few more requireents into the existing APIS, but if that's the case it might be enough to gather some interest among rest of browser vendors and start design work in WICG, which is I think where I'd like to see anything get started if we were to pick this up again.  I don't know that there's a future for a review of the existing APIs... worthwhile to document what we'd want to see in a future API, but assuming nobody's jumping the gun to implement a new thing, that would be where this ends.

Peter: Speech is one of those things where every so often a proposal pops out, but then dies.  Is lack of implementation due to lack of a good design yet, or lack of interest in implementation?

Travis: I'd love to chat with folks I've heard are interested in this ... API seems to be meeting their needs, which aren't complicated.

Peter: shipped?

Travis: text-to-speech part is nearly universally implemented, interoperable-ish.  speech-to-text (SpeechRecognition object) not as well deployed.

Peter: data on usage?

Alex: I can try to find.

Travis: I'd love to have folks from web audio group involved in design discussions.  High correlation between their expertise and what a community group would need to think about.  Thinking about a voice node you could plug in to the audio graph.

Alex: Or a source like for media streams or media tracks like with the various audio and video elements.

Peter: No current working group looking at this?

Sangwhan: right.

Alex: tens of millions of users per day of text-to-speech feature.

...

Alex: Seems low urgency, but seems like we should do the review so somebody later has something to build off of.

Travis: I'm happy to summarize, recap the high and low level issues I've seen so far and write it down in the issue.  Reaching out to some folks and finding if this is meeting their needs, or if there's interest in design work on a v2.

Peter: Milestone farther out?

### [Transform Streams](https://github.com/w3ctag/design-reviews/issues/211) - Sangwhan, Alex, David

Alex: I believe this was going through intent-to-ship in Chrome.  Has 3 LGTMs; probably will ship.

Alex: Didn't write feedback; I'll take that as an extra action item, before the face-to-face.

## Backlog (reached)

### [<link> rel=modulepreload](https://github.com/w3ctag/design-reviews/issues/213) - Alex, Andrew

Alex: There's a graph of resources you want to request off the network.  May or may not be traversable.  Want to load them as modules (with appropriate request parameters).  This is about preloading a graph of requested resources as opposed to a single resource.  There was a conversation about whether this makes sense to expand... e.g., grabbing `@import`s or fonts from a style sheet... but don't necessarily want to grab the fonts.  modulepreload sort of hints in that direction; not sure where we ended up in that conversation.

Travis: specific to module scripts?

Alex: modules of all sorts... there are puns with other features.

Andrew: The main motivation for modulepreload was that due... you mentioned the dependency thing... CSS has same situation (e.g., dependencies via `@import`s); that's the thing we were waiting for feedback on.  Anne also commented about fetch not doing recursive fetch; this isn't something you can easily layer in; not usre how to explain it.

Andrew: Theres' difficiltlty in the nuance of the semantics here.  We were unconvinced it needed a different name from preload.  If the difference is that it traverses dependency tree, maybe `deeppreload` or `recursivepreload`; `modulepreload` seems targeted towards a single use case.

Travis: That's the first thing I tripped over as well.

Travis: Does fetch get involved.. like a service worker... for the preload contents.

Alex: You sholud receive the `fetch` event.  You want the SW to get an early start at handing back those resources if they were in cache.

Travis: And a preload request would get them naturally if they were as well.

Travis: And this would be useful for HTML modules down the road.

Alex: That's the idea.  I can write something back to Anne.

Travis: Definitely.

[ Alex leaves ]

## Tokyo Face-to-face

Andrew: see my message about Friday-evening event

Peter: Any developer event planned.

No

Sangwhan: Keio host is getting us lunch.

Sangwhan: I'll consider bringing an extra computer for videoconferencing.

David: guessing no call next week

Peter: correct

## Backlog (unreached)

* [Clear Site Data](https://github.com/w3ctag/design-reviews/issues/213) - Andrew
* [Decentralized Identifiers](https://github.com/w3ctag/design-reviews/issues/216) - Hadley
* [import.meta.url and import.meta](https://github.com/w3ctag/design-reviews/issues/208) - Alex

---

branch_name: refs/heads/gh-pages

gha_language: HTML


text:
Pages
=====

<!-- toc -->

A “Kabootit page” defines the starting point for the Kabootit build
process. Meta data associated with the page defines whether a page is
published, what the theme template to use for the build, what section
files to map to template tags, etc.

Development process
-------------------

Once you have at least one theme template created, you can start
creating Kabootit pages.

1.  Create a Wakanda page in the `src/pages` directory (you may have to
    use the file menu to do this)
2.  Set up the Kabootit meta data in the pages property pane

Meta data
---------

1.  *Title*: we use the default Wakanda title property to fill in the
    meta title tag
2.  *Publish*: quick way to toggle whether a page is built or not.
3.  *Theme*: name of the theme.
4.  *Layout*: name of the theme layout file (.tpl file in
    `{{project}}/WebFolder/src/templates` directory or
    `{{Themes}}/{{client}}/{{themeName}}/templates` directory)
5.  *Resources path*: typically something along the lines of
    `../themes/<theme folder name>`
6.  *Sections*: use a json object to specify all section tags in the
    theme layout

![](../assets/page_meta_data.png)

The associated page `Resources path` data point looks like this
`/stratosphere/mars` (`/{{theme name}}/{{theme directory}}`)

Templates can either be stored in the theme or in projects. Templates
stored in the theme are available to all projects while templates stored
in project are only available to that project.

The page `Resources path` data point looks like this for:

-   theme location
-   project location

repository: datamosaic/data-sutra-wakanda

repo_name: datamosaic/data-sutra-wakanda


text:
# Examples #

1. **basic**: Compile a simple two file c project with clang on Linux/Macos.  Heavily commented.
2. **multi_compiler**: Compile a project with msvc, clang or gcc on Linux, Mac or Windows, stashing intermediates in a separate subdir for cleanliness.
3. **bgfx_shaders**: Compile project shaders for the excellent [bgfx](https://github.com/bkaradzic/bgfx) library.  Works on Windows, Linux and Macos.
4. **exp_demo**: Heavily commented demo showing how the powerful `exp()` (variable expand) function works in jfdi.
5. **latex**: Sample demonstrating the compilation of a latex document.

license: Zlib

repository: mlabbe/jfdi

repo_name: mlabbe/jfdi


text:
# Correction

## MySQL - Command line (4 pts)

- You can write `... id int NOT NULL AUTO_INCREMENT PRIMARY KEY, ...` instead of `... id int NOT NULL AUTO_INCREMENT,  PRIMARY KEY (id), ...`

**Total: 4 pts**

----
## PHP - Preparation (4 pts)

Good!

**Total: 4 pts**

----
## PHP - Handling users (8 pts)

- You don't check if you are on a post method in the profile page
- You don't check if `photo_url` exist in the session

**Total: 7 pts**

----
## PHP - The chat room (4 pts)

- The natural chat order is `ascendant` and not `descendant`

**Total: 3,5 pts**

----
# Your grade
**19 pts**

Very good job!

I hope you did it in the exam conditions as best as you can.
I feel that to be fair with your fellow colleagues, I will ceil your grades to 16

# Final grade
**16 pts**

repository: morgangiraud/ecvd-php

gha_language: PHP

repo_name: morgangiraud/ecvd-php


text:
User-visible changes to the compartment mapper:

## Next release

* *BREAKING*: All `import` methods now take an options bag that may contain
  `globals` and `modules` options if present, instead of these as positional
  arguments.
* The `import` options bag now also accepts `globalLexicals` and `transforms`,
  passing these without alteration to each `Compartment`.
* The `import` options bag now also accepts a `Compartment` constructor, to use
  instead of the one assumed to be present globally.

## Release 0.1.0 (2020-09-21)

* This initial relase supports importing, archiving, and importing archives
  with the same authorities delegated to every compartment in an application.
  Future releases will support the attenuation of authority per-compartment,
  broaden support for Node.js module conventions, address the issue
  of shimming, and orchestrate SES lockdown.

repository: ukstv/SES-shim

repo_name: ukstv/SES-shim


text:
---
id: jacoco
title: Jacoco
sidebar_label: Jacoco
slug: jacoco.html
---

Kotest integrates with [Jacoco](https://www.eclemma.org/jacoco/) for code coverage in the standard gradle way.
You can read gradle installation instructions [here](https://docs.gradle.org/current/userguide/jacoco_plugin.html).

1. In gradle, add jacoco to your plugins.

```kotlin
plugins {
   ...
   jacoco
   ...
}
```

2. Configure jacoco

```kotlin
jacoco {
    toolVersion = "0.8.7"
    reportsDirectory = layout.buildDirectory.dir('customJacocoReportDir') // optional
}
```

3. Add the jacoco XML report task.

```kotlin
tasks.jacocoTestReport {
    dependsOn(tasks.test)
    reports {
        xml.required.set(true)
    }
}
```

4. Change tests task to depend on jacoco.

```kotlin
tasks.test {
  ...
  finalizedBy(tasks.jacocoTestReport)
}
```

Now when you run `test`, the Jacoco report files should be generated in `$buildDir/reports/jacoco`.

:::note
You may need to apply the jacoco plugin to each submodule if you have a multi module project.
:::

repository: kotest/kotest

gha_language: Kotlin

repo_name: kotest/kotest


text:
# flat-mcmc

[![Build Status](https://secure.travis-ci.org/jtobin/flat-mcmc.png)](http://travis-ci.org/jtobin/flat-mcmc)
[![Hackage Version](https://img.shields.io/hackage/v/flat-mcmc.svg)](http://hackage.haskell.org/package/flat-mcmc)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/jtobin/flat-mcmc/blob/master/LICENSE)

*flat-mcmc* is a Haskell library for painless, efficient, general-purpose
sampling from continuous distributions.

*flat-mcmc* uses an ensemble sampler that is invariant to affine
transformations of space.  It wanders a target probability distribution's
parameter space as if it had been "flattened" or "unstretched" in some sense,
allowing many particles to explore it locally and in parallel.

In general this sampler is useful when you want decent performance without
dealing with any tuning parameters or local proposal distributions.  Check out
the paper describing the algorithm
[here](http://msp.org/camcos/2010/5-1/camcos-v5-n1-p04-p.pdf), and a paper on
some potential limitations [here](http://arxiv.org/abs/1509.02230), authored
by my friends David Huijser and [Brendon
Brewer](https://www.stat.auckland.ac.nz/~brewer/).  There is also also a robust
Python implementation [here](http://dan.iel.fm/emcee/current/) authored by [Dan
Foreman-Mackey](http://dan.iel.fm), a very nice dude who I once moved some
furniture with.

*flat-mcmc* exports an 'mcmc' function that prints a trace to stdout, as well
as a 'flat' transition operator that can be used more generally.

``` haskell
import Numeric.MCMC.Flat
import qualified Data.Vector.Unboxed as U (unsafeIndex)

rosenbrock :: Particle -> Double
rosenbrock xs = negate (5  * (x1 - x0 ^ 2) ^ 2 + 0.05 * (1 - x0) ^ 2) where
  x0 = U.unsafeIndex xs 0
  x1 = U.unsafeIndex xs 1

origin :: Ensemble
origin = ensemble [
    particle [negate 1.0, negate 1.0]
  , particle [negate 1.0, 1.0]
  , particle [1.0, negate 1.0]
  , particle [1.0, 1.0]
  ]

main :: IO ()
main = withSystemRandom . asGenIO $ mcmc 12500 origin rosenbrock
```

![trace](http://jtobin.ca/flat-mcmc/img/Rosenbrock_AIE.png)

repository: jtobin/flat-mcmc

gha_language: Haskell

repo_name: jtobin/flat-mcmc


text:
Python is a language which is flexible and easy to learn. And it has lots of convenient modules and  packages.

In this article, I summarized some useful modules and packages I have used for mackine learning and data science. Hope it will give you some help or guidance:smiley:.

# Valuable Websites
- [python3-cookbook](http://python3-cookbook.readthedocs.io/zh_CN/latest/index.html)

- [Unofficial Windows Binaries for Python Extension Packages](http://www.lfd.uci.edu/~gohlke/pythonlibs/)

# Modules:
## pickle:
1. What is pickle?

    [Offical introduction](https://docs.python.org/3/library/pickle.html) about pickle is

    >The pickle module implements binary protocols for serializing and de-serializing a Python object structure. “Pickling” is the process whereby a Python object hierarchy is converted into a byte stream, and “unpickling” is the inverse operation, whereby a byte stream (from a binary file or bytes-like object) is converted back into an object hierarchy.

    In my view, `pickel` means _a thick cold sauce that is made from pieces of vegetables preserved in vinegar_. The implication is that you can store things for a long time. Pickel module provide you a good way to store your python data into disk, which is a persistence management. Lost of dataset is save as this way.

2. Common function:
    - Save python object into file
    `pickle.dump(object, file)`

    - Load binary data in disk into python
    `loaded_data = pickle.load(file)`

## argparse
1. What is argparse?
    _argparse_ is a parser for command-line options, arguments and sub-commands.
    [Offical introduction](https://docs.python.org/3/library/argparse.html) is
    > The argparse module makes it easy to write user-friendly command-line interfaces. The program defines what arguments it requires, and argparse will figure out how to parse those out of sys.argv. The argparse module also automatically generates help and usage messages and issues errors when users give the program invalid arguments.

2. The Basics:
    [Offical _argparse_ tutorial](https://docs.python.org/3/howto/argparse.html#id1) is a good and easy way to learn basic uses of _argparse_. Here are some tips I summarized.

    - Basic format(maybe it is a template) of using _argparse_
        ```python
        import argparse
        parser = argparse.ArgumentParser()
        parser.parse_args()
        ```
    - Here are two kinds of arguments:
        - _positional arguments_
        A positional argument is any argument that's not supplied as a `key=value` pair.
        - _optional arguments_
        A optional argument is supplied as a `key=value` pair.

    - Basic command
        ```python
        import argparse
        parser = argparse.ArgumentParser(description='echo your input')
        # positional arguments
        parser.add_argument('echo')
        # optional arguments
        parser.add_argument('-n', '--name')
        args = parser.parse_args()
        print(args.echo)
        ```

        The input this in shell and get output
        ```
        $ python <script_name>.py 'It is a basic use of argparse' --name 'My name is Kevin Ho'
        [output]: It is a basic use of argparse
                  My name is Kevin Ho
        ```

        - Create a parser
            `parser = argparse.ArgumentParser(description=<>)`

        - Add arauments
            `ArgumentParser.add_argument(name or flags...[, action][, nargs][, const][, default][, type][, choices][, required][, help][, metavar][, dest])`

            For more details about the parameters you can browse [The add_argument() method](https://docs.python.org/3/library/argparse.html#argparse.ArgumentParser.add_argument)

        - Parse arguments
            `args = parser.parse_args()`

## collections
This module implements specialized container datatypes providing alternatives to Python’s general purpose built-in containers, dict, list, set, and tuple.

- Reference
    - [不可不知的Python模块: collections](http://www.zlovezl.cn/articles/collections-in-python/)

## codecs
This module defines base classes for standard Python codecs (encoders and decoders) and provides access to the internal Python codec registry, which manages the codec and error handling lookup process.

- Reference
    - [Offical Website](https://docs.python.org/3/library/codecs.html#standard-encodings)

    - [Standard Encodings](https://docs.python.org/3/library/codecs.html#standard-encodings)

## shutil
> The shutil module offers a number of high-level operations on files and collections of files. In particular, functions are provided which support file copying and removal.

How to rename a folder?
: - Using `os.rename(<old folder path>, <new folder path>)`
  - Using `shutil.move(<old folder path>, <new folder path>)`

**Reference**
: - [stackoverflow: How to rename a file using Python](https://stackoverflow.com/questions/2491222/how-to-rename-a-file-using-python)
  - [stackoverflow: When using python os.rmdir, get PermissionError: [WinError 5] Access is denied](https://stackoverflow.com/questions/36360167/when-using-python-os-rmdir-get-permissionerror-winerror-5-access-is-denied)

## random
This module implements pseudo-random number generators for various distributions.

- `random.shuffle(x)`
    Shuffle the squence x in place

    ```python
    a = [1, 2, 3, 4]
    random.shuffle(a)
    >>> [2, 1, 4, 3]
    ```

# Packages:
## Matplotlib

### Tips
- Draw heatmap
    ```python
    import matplotlib.pyplot as plt
    import numpy as np

    a = np.random.random((24, 24))
    plt.show(a, cmap='jet', interpolation='nearest')
    ```

- Refresh picture([\*ref](https://stackoverflow.com/questions/20936817/how-do-i-redraw-an-image-using-pythons-matplotlib))
    ```python
    fig, ax = plt.subplots(figsize=(12,8))
    fig.show()
    plt.pause(0.5)
    for i in range(100):
        ax.plot(<your data>)
        fig.canvas.draw()
    ```

- Change figure window name([\*ref](https://stackoverflow.com/questions/5812960/change-figure-window-title-in-pylab))
    ```python
    fig, ax = plt.subplots(figsize=(12,8))
    fig.canvas.set_window_title(<window title>)
    ```

- Reference
    - [Stackoverflow: Plotting a 2D heatmap with Matplotlib](http://stackoverflow.com/questions/33282368/plotting-a-2d-heatmap-with-matplotlib)
    - [Matplot: color example](https://matplotlib.org/examples/color/colormaps_reference.html)

# Python Tips:
## Change python packages download source.
pip
: - On Windows:
    - New a folder called `pip` under path `c:/user/<your user name>/`, and new a file name `pip.ini`, write followings in it:
        ```python
        [global]
        index-url = https://pypi.tuna.tsinghua.edu.cn/simple
        ```

: - On Linux:
    - New a folder called '.pip' under `~/`, create a file named `pip.conf` and write the same as Windows in the file.

conda
: Input followings in terminal
: ```python
  conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  conda config --set show_channel_urls yes
  ```

Reference
: - [csdn: 更改pip源至国内镜像，显著提升下载速度](http://blog.csdn.net/zhangchilei/article/details/53893002)

## How print in one with dynamically refresh in Python?
- Python3
    ```python
    print(data, end'\r', flush=True)
    ```

- Python2
    ```python
    import sys
    sys.stdout.write('.')
    # or from Python 2.6 you can import the `print` function from Python3
    from __future__ import print_function
    ```

## `enumerate` using details [(\*ref)](http://book.pythontips.com/en/latest/enumerate.html)
Common use is like followings,

```python
for counter, value in enumerate(some_list):
    print(counter, value)
```

`enumerate(iterable, start=0)`, optional parameters `start` decide the start number of counter,

```python
a = ['apple', 'banana', 'orange']
for counter, value in enumerate(a, 1)
    print(counter, value)
>>> 1 apple
>>> 2 banana
>>> 3 orange
```

## Create a directory/folder if it does not exist
```python
import os
if not os.path.exists(<directory_path>):
    os.makedirs(<directory_path>)
```

Reference
: - [stackoverflow: How can I create a directory if it does not exist?](https://stackoverflow.com/questions/273192/how-can-i-create-a-directory-if-it-does-not-exist)

## How to run `pip` in python script?
```python
import pip
pip.main(['install', '-r'. 'requirements.txt'])
```

Reference
: - [stackoverflow: use “pip install/uninstall” inside a python script](https://stackoverflow.com/questions/12937533/use-pip-install-uninstall-inside-a-python-script)
: - [stackoverflow: How to pip install packages according to requirements.txt from a local directory?](https://stackoverflow.com/questions/7225900/how-to-pip-install-packages-according-to-requirements-txt-from-a-local-directory)

## Parallel in Python
Reference
: - [知乎专栏： Python多核并行计算](https://zhuanlan.zhihu.com/p/24311810)

## C++ Embed Python
### Reference
- [Embedding Python in C/C++: Part I](https://www.codeproject.com/Articles/11805/Embedding-Python-in-C-C-Part-I)

- [CSDN Blog: C++调用python](http://blog.csdn.net/marising/article/details/2917892)

# Problems and Solutions:
- `UnicodeEncodeError: 'ascii' codec can't encode character '\u22f1' in position 242`
    - [解决Python3下打印utf-8字符串出现UnicodeEncodeError的问题](https://www.binss.me/blog/solve-problem-of-python3-raise-unicodeencodeerror-when-print-utf8-string/)

Continuously updated...

repository: MaluwaLMK/maluwalmk

path: /_posts/2017-3-6-Useful-Python-Modules, -Packages and-Tricks(Continuously updated).md

repo_name: MaluwaLMK/maluwalmk


text:
---
title: "Inject Secret"
description: "Inject a Azure Key Vault secret as environment variable into an application"
---

> **Note: The [prerequisites](../prerequisites) are required to complete this tutorial.**

This tutorial will cover how to inject a secret from Azure Key Vault directly into a container as environment variable.

We start by creating a definition for the Azure Key Vault secret we want to inject:

```yaml
# secret-inject.yaml

apiVersion: spv.no/v1alpha1
kind: AzureKeyVaultSecret
metadata:
  name: secret-inject
  namespace: akv-test
spec:
  vault:
    name: akv2k8s-test # name of key vault
    object:
      name: my-secret # name of the akv object
      type: secret # akv object type
```

Apply to Kubernetes:

```bash
$ kubectl apply -f secret-sync.yaml
azurekeyvaultsecret.spv.no/secret-sync created
```

List AzureKeyVaultSecret's:

```bash
$ kubectl -n akv-test get akvs

NAME          VAULT          VAULT OBJECT   SECRET NAME         SYNCHED
secret-sync   akv2k8s-test   my-secret
```

Then we deploy a Pod having a env-variable pointing to the secret above.

```yaml
# deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: akv2k8s-test-injection
  namespace: akv-test
  labels:
    app: akv2k8s-test-injection
spec:
  selector:
    matchLabels:
      app: akv2k8s-test-injection
  template:
    metadata:
      labels:
        app: akv2k8s-test-injection
    spec:
      containers:
      - name: akv2k8s-env-test
        image: spvest/akv2k8s-env-test
        env:
        - name: TEST_SECRET
          value: "secret-inject@azurekeyvault"
        - name: ENV_INJECTOR_LOG_LEVEL
          value: debug
```

Apply to Kubernetes:

```bash
$ kubectl apply -f deployment.yaml
azurekeyvaultsecret.spv.no/secret-inject created
```

Things to note from the Deployment yaml above:

```yaml
containers:
  - name: akv2k8s-env-test
    image: spvest/akv2k8s-env-test # 1.
    env:
    - name: TEST_SECRET # 2.
      value: "secret-inject@azurekeyvault" # 3.
    - name: ENV_INJECTOR_LOG_LEVEL # 3.
      value: debug
```

1. We use a custom built Docker image that only outputs the content of the env-variable `TEST_SECRET` to the console. Feel free to replace this with your own Docker image.

2. The env-variable this Docker image expects and will output. When using your own Docker image, set the env-variables your image expects using convention in 3.

3. We use the akv2k8s injector convention to reference the AzureKeyVaultSecret `secret-inject` we created earlier ([akvs-name]@azurekeyvault). The env-injector will download this secret from Azure Key Vault and inject into the executable running in your Container.

4. A optional env-variable you can pass to your container to set the log-level of the env-injector and optionally get detailed log output during startup of your pod.

To see the log output from your Pod, execute the following command:

`kubectl -n akv-test logs deployment/akv2k8s-test-injection`

### Cleanup

```bash
kubectl -n akv-test delete AzureKeyVaultSecret secret-inject
kubectl -n akv-test delete deployment akv2k8s-test-injection
```


text:
SublimeLinter-jshint
=========================

[![Build Status](https://travis-ci.org/SublimeLinter/SublimeLinter-jshint.svg?branch=master)](https://travis-ci.org/SublimeLinter/SublimeLinter-jshint)

This linter plugin for [SublimeLinter](https://github.com/SublimeLinter/SublimeLinter) provides an interface to [jshint](http://www.jshint.com/docs/). It will be used with files that have the “JavaScript” syntax, or within `<script>` tags in HTML files.

## Installation
SublimeLinter must be installed in order to use this plugin.

Please use [Package Control](https://packagecontrol.io) to install the linter plugin.

Before installing this plugin, you must ensure that `jshint` (2.5.0 or later) is installed on your system. To install `jshint`, do the following:

1. Install [Node.js](http://nodejs.org) (and [npm](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager) on Linux).

1. Install `jshint` (or globally with `-g`):
   ```
   npm install jshint
   ```

1. If you are using `nvm` and `zsh`, ensure that the line to load `nvm` is in `.zshenv` or `.zprofile` and not `.zshrc`.(reason: [here](http://www.sublimelinter.com/en/latest/installation.html) and [here](https://github.com/SublimeLinter/SublimeLinter3/issues/128))

In order for `jshint` to be executed by SublimeLinter, you must ensure that its path is available to SublimeLinter. The docs cover [troubleshooting PATH configuration](http://sublimelinter.readthedocs.io/en/latest/troubleshooting.html#finding-a-linter-executable).

## Settings
- SublimeLinter settings: http://sublimelinter.readthedocs.org/en/latest/settings.html
- Linter settings: http://sublimelinter.readthedocs.org/en/latest/linter_settings.html

You can configure `jshint` options in the way you would from the command line, with `.jshintrc` files. For more information, see the [jshint docs](http://www.jshint.com/docs/). You may provide a custom config file by setting the linter’s `"args"` setting to `["--config", "/path/to/file"]`. On Windows, be sure to double the backslashes in the path, for example `["--config", "C:\\Users\\Aparajita\\jshint.conf"]`.

### Using with tabs
If you use tabs as your indentation, make sure you set the option `indent: 1` in your .jshintrc file. If not the wrong sections of the code will be highlighted.

repository: leo-xu-leo/SublimeLinter-jshint

repo_name: leo-xu-leo/SublimeLinter-jshint


text:
# Delaunay-Čech filtrations

This package provides functions for computing the smallest enclosing ball
radius (miniball radius) of sets of three points in two and three dimensions and
four points in three dimensions.

These are used to produce Delaunay-Čech filtrations, which can be used to
compute Čech persistence diagrams of points in two and three dimensions.

Wrappers are provided for computing Čech persistence diagrams with
`gudhi`
for points in two and three dimensional space.

## Installation

The `setuptools`, `numpy`, `scipy`, and `gudhi` Python packages are
prerequisites for using this package.

The last one can be installed with `conda` running

```
>>> conda install -c conda-forge gudhi
```

You'll also need `pybind11`, `cmake` and a `C++` compiler in order to install this
package. It is recommended to install both `pybind11` and `cmake` via `conda`.

```
>>> conda install -c anaconda cmake
>>> conda install -c conda-forge pybind11
```

Finally run the following command to build and install this Python package

```
>>> pip install delcechfiltr
```

If the command above fails to build this package, then you might want to clone
this repository to a directory `delcechfiltr/` on your computer and run

```
>>> cd /<path>/<to>/<cloned>/<repo>/delcechfiltr/
>>> python setup.py install
```

which outputs more information on the errors causing the build to fail.

**Windows.** After installing `conda`, run the above commands within an
`Anaconda prompt`. For the C++ compiler install
Visual Studio community.

## Basic usage

```python
import numpy as np
import delcechfiltr.dgms

n, d = 20, 3
np.random.seed(0)
pts = np.random.rand(n, d)

dgm_H0_cech1, dgm_H1_cech1                        = delcechfiltr.dgms.cech(pts, persistence_dim_max=False)
dgm_H0_cech2, dgm_H1_cech2, dgm_H2_cech2          = delcechfiltr.dgms.cech(pts, persistence_dim_max=True)
dgm_H0_delcech1, dgm_H1_delcech1                  = delcechfiltr.dgms.delcech_3D(pts, persistence_dim_max=False)
dgm_H0_delcech2, dgm_H1_delcech2, dgm_H2_delcech2 = delcechfiltr.dgms.delcech_3D(pts, persistence_dim_max=True)
```

repository: gbeltramo/delcechfiltr

repo_name: gbeltramo/delcechfiltr


text:
Mac OS X Build Instructions and Notes
====================================
This guide will show you how to build twisterd for OSX.

Notes
-----

* Tested on OS X 10.9.1 on Intel processors only. PPC is not
supported because it is big-endian.
* All of the commands should be executed in a Terminal application. The
built-in one is located in `/Applications/Utilities`.

Preparation
-----------

You need to install XCode with all the options checked so that the compiler
and everything is available in /usr not just /Developer. XCode should be
available on your OS X installation media, but if not, you can get the
current version from https://developer.apple.com/xcode/. If you install
Xcode 4.3 or later, you'll need to install its command line tools. This can
be done in `Xcode > Preferences > Downloads > Components` and generally must
be re-done or updated every time Xcode is updated.

There's an assumption that you already have `git` installed, as well. If
not, it's the path of least resistance to install [Github for Mac](https://mac.github.com/)
(OS X 10.7+) or
[Git for OS X](https://code.google.com/p/git-osx-installer/). It is also
available via Homebrew or MacPorts.

You will also need to install [Homebrew](http://mxcl.github.io/homebrew/)
or [MacPorts](https://www.macports.org/) in order to install library
dependencies. It's largely a religious decision which to choose, but I tested only with
Homebrew.

The installation of the actual dependencies is covered in the Instructions
sections below.

Instructions: HomeBrew
----------------------

#### Install dependencies using Homebrew

        brew install boost miniupnpc openssl berkeley-db4

Note: After you have installed the dependencies, you should check that the Brew-installed
version of OpenSSL is the one available for compilation. You can check this by typing

        openssl version

into Terminal. You should see OpenSSL 1.0.1e 11 Feb 2013.

If that's not the case, you *could* `brew link --force openssl` but it's a bad idea.
Instead, it's enough to make sure the right openssl binary is on your $PATH:

        export PATH=/usr/local/opt/openssl/bin:$PATH

### Building `twisterd`

1. Clone the github tree to get the source code and go into the directory.

        git clone git@github.com:miguelfreitas/twister-core.git
        cd twister-core

2. Set system variables to match your environment. THIS IS IMPORTANT!

        export OPENSSL_INCLUDE_PATH=/usr/local/opt/openssl/include
        export OPENSSL_LIB_PATH=/usr/local/opt/openssl/lib
        export BDB_INCLUDE_PATH=/usr/local/opt/berkeley-db4/include
        export BDB_LIB_PATH=/usr/local/opt/berkeley-db4/lib
        export BOOST_INCLUDE_PATH=/usr/local/opt/boost/include
        export BOOST_LIB_PATH=/usr/local/opt/boost/lib
        export BOOST_LIB_SUFFIX=-mt
        export LDFLAGS="-L$OPENSSL_LIB_PATH -L$BDB_LIB_PATH -L$BOOST_LIB_PATH"
        export CPPFLAGS="-I$OPENSSL_INCLUDE_PATH -I$BDB_INCLUDE_PATH -I$BOOST_INCLUDE_PATH"

3. Build libtorrent

        cd libtorrent
        ./bootstrap.sh
        ./configure --enable-logging --enable-debug --enable-dht
        make
        # note: install is optional, might conflict with existing libtorrent install
        make install

4. Build twisterd. Note: it *will* emit a lot of warnings, but as long as you don't get
actual `error` messages, it should be fine:

        cd ../
        cd src
        make -f makefile.osx

5.  It is a good idea to build and run the unit tests, too:

        make -f makefile.osx test

If things go south, before trying again, make sure you clean it up:

        make -f makefile.osx clean

If all went well, you should now have a twisterd executable in the src directory.
See the Running instructions below.

Instructions: MacPorts (UNTESTED!!)
---------------------------------

### Install dependencies

Installing the dependencies using MacPorts is very straightforward.

    sudo port install boost db48@+no_java openssl miniupnpc

### Building `twisterd`

1. Clone the github tree to get the source code and go into the directory.

        git clone git@github.com:miguelfreitas/twister-core.git
        cd twister-core

2.  Build twisterd:

        cd src
        make -f makefile.osx

3.  It is a good idea to build and run the unit tests, too:

        make -f makefile.osx test

Running
-------

It's now available at `./twisterd`, provided that you are still in the `src`
directory. We have to first create the RPC configuration file, though.

Run `./twisterd` to get the filename where it should be put, or just try these
commands:

    echo -e "rpcuser=user\nrpcpassword=pwd" > "/Users/${USER}/.twister/twister.conf"
    chmod 600 "/Users/${USER}/.twister/twister.conf"

When next you run it, it will start downloading the blockchain, but it won't
output anything while it's doing this. This process may take several hours. If you see a lonely
`connect: Operation timed out`, don't freak out, it seems to work fine.

Other commands:

    tail -f ~/.twister/debug.log
    ./twisterd --help  # for a list of command-line options.
    ./twisterd -daemon # to start it as a daemon.
    ./twisterd help    # When the daemon is running, to get a list of RPC commands

In order to get the HTML interface, you'll have to download it and link it in .twister:

	git clone git@github.com:miguelfreitas/twister-html.git
	ln -s twister-html /Users/${USER}/.twister/html


text:
# CanDo

[![Gem Version](https://badge.fury.io/rb/can-do.svg)](http://badge.fury.io/rb/can-do)

Flips your features based on a redis key, a `config/features.yml` file or environment variables.

## Usage

Add `can-do` to your Gemfile:

```ruby
# Gemfile

gem "can-do", require: "can_do"
```

## Redis values

To use redis as a storage set the environment variable `CANDO_REDIS_URL` with your redis instance.

The keys have to be prefixed with 'features:'.

So to set and use the feature `experiment-1` set the key like

```sh
$ redis-cli SET features:experiment_1 true
```

and use it like

```ruby
require "can_do"

CanDo.feature?(:experiment_1)
```

Any unset key will fall back to either the environment variable or the yaml variable and `false` if none is set.

```ruby
require "can_do"

CanDo.feature?(:experiment_1)
```

## Yaml File

Inside the `config` folder relative to your working directory create a file called `features.yml`. Within this file,
place your *default feature flags* within the `defaults` key. All available features should be listed here, together with
their default values. Add *environment-specific* feature flags under the environment name.

```
# config/features.yml

defaults:
  some_feature: false
  other_feature: true
development:
  some_feature: true
production:
  other_feature: false
```

Check if a feature is enabled by calling `CanDo.feature?(:some_feature)`:

```ruby
require "can_do"

CanDo.feature?(:some_feature)
```

Or by using a block:

```ruby
require "can_do"

CanDo.feature?(:some_feature) do
  # This block is only evaluated if some_feature is enabled
end
```

If a feature is not found, `false` is returned.

## Environment variables

You can use environment variables to flip your features. Environment variables **always take precedence** over anything
within your `config/features.yml` file.

```sh
> RAILS_ENV=development rails console
CanDo.feature?(:some_feature) => false

> SOME_FEATURE=true RAILS_ENV=development rails console
CanDo.feature?(:some_feature) => true

> SOME_FEATURE=true RAILS_ENV=development rails console
CanDo.feature?(:some_feature) => true

> OTHER_FEATURE=true RAILS_ENV=production rails console
CanDo.feature?(:other_feature) => true
```

## Contributing

1. Fork it ( https://github.com/blacklane/can-do/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

repository: blacklane/can-do

gha_language: Ruby

gha_license_id: MIT

repo_name: blacklane/can-do


text:
# ControllerServiceAPI

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Type** | Pointer to **string** | The fully qualified name of the service interface. | [optional]
**Bundle** | Pointer to [**Bundle**](Bundle.md) |  | [optional]

## Methods

### NewControllerServiceAPI

`func NewControllerServiceAPI() *ControllerServiceAPI`

NewControllerServiceAPI instantiates a new ControllerServiceAPI object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed

### NewControllerServiceAPIWithDefaults

`func NewControllerServiceAPIWithDefaults() *ControllerServiceAPI`

NewControllerServiceAPIWithDefaults instantiates a new ControllerServiceAPI object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set

### GetType

`func (o *ControllerServiceAPI) GetType() string`

GetType returns the Type field if non-nil, zero value otherwise.

### GetTypeOk

`func (o *ControllerServiceAPI) GetTypeOk() (*string, bool)`

GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetType

`func (o *ControllerServiceAPI) SetType(v string)`

SetType sets Type field to given value.

### HasType

`func (o *ControllerServiceAPI) HasType() bool`

HasType returns a boolean if a field has been set.

### GetBundle

`func (o *ControllerServiceAPI) GetBundle() Bundle`

GetBundle returns the Bundle field if non-nil, zero value otherwise.

### GetBundleOk

`func (o *ControllerServiceAPI) GetBundleOk() (*Bundle, bool)`

GetBundleOk returns a tuple with the Bundle field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.

### SetBundle

`func (o *ControllerServiceAPI) SetBundle(v Bundle)`

SetBundle sets Bundle field to given value.

### HasBundle

`func (o *ControllerServiceAPI) HasBundle() bool`

HasBundle returns a boolean if a field has been set.

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

repository: simingweng/nifi-go-client

gha_language: Shell

repo_name: simingweng/nifi-go-client


text:
# Analysis of an experimental evolution experiment using next-generation sequencing

The steps below should be done before class, since large files need to be downloaded and installed.

## Installation

### Software installation

#### Virtual machine

- We prepared a Linux virtual machine (VM) with all the software and required for this analysis. The VM can be run in [VirtualBox](https://www.virtualbox.org/wiki/Downloads) which is available for pretty much every operating system.
- Once VirtualBox is running, download and import the [VM](http://ecoevo.unit.oist.jp/class/t5-lab/T5.ova), using
- You can then simply run the VM and proceed with the rest of the exercise.
     - The account name is *t5* and the password is *t5-lab*
- Make sure that you turn on bidirectional clipboard in VirtualBox (under Devices...)

#### Install your own software and data
Alternatively, you can install your own software and skip virtual machine. You will need:

- FreeBayes
- VCFTools
- samtools
- bowtie2
- IGV

Unless you are comfortable with the command line and know how to compile software, installing all of this software can be a bit tricky. However, it is a good learning experience to go through the installation. In bioinformatics you do a lot of this sort of thing.

You can then install this repository, download the data there and unpack them:

	# get this repository
	git clone https://github.com/mikheyev/t5-lab.git
	cd t5-lab
	# get data (very slow!)
	wget http://ecoevo.unit.oist.jp/class/t5-lab/t5-data.tar
	# unpack data and remove archive
	tar -xvf t5-data.tar && rm t5-data.tar

### Inside the virtual machine

Once the virtual machine is running, open the terminal and update the git repository, which will sync any changes (if needed)

	cd t5-lab
	git pull

### Making sure everything is there

The final directory structure should can be checked by running ```tree``` and should look like this:

```
.
├── README.md
├── data
│   ├── alignments
│   │   ├── mutant1_OIST-2015-03-28.bam
│   │   ├── mutant1_OIST-2015-03-28.bam.bai
│   │   ├── mutant2_OIST-2015-03-28.bam
│   │   ├── mutant2_OIST-2015-03-28.bam.bai
│   │   ├── mutant3_OIST-2015-03-28.bam
│   │   ├── mutant3_OIST-2015-03-28.bam.bai
│   │   ├── mutant4_OIST-2015-03-28.bam
│   │   ├── mutant4_OIST-2015-03-28.bam.bai
│   │   ├── reference_OIST-2015-03-28.bam
│   │   └── reference_OIST-2015-03-28.bam.bai
│   ├── reads
│   │   ├── mutant1_OIST-2015-03-28.fastq.gz
│   │   ├── mutant2_OIST-2015-03-28.fastq.gz
│   │   ├── mutant3_OIST-2015-03-28.fastq.gz
│   │   ├── mutant4_OIST-2015-03-28.fastq.gz
│   │   └── reference_OIST-2015-03-28.fastq.gz
│   └── var
│       └── raw.vcf
├── ref
│   ├── NC_012967.fasta
│   ├── NC_012967.fasta.fai
│   └── NC_012967.gff
└── src
    ├── README.md
    └── map.sh
```

The actual exercise is found in the [src](./src/) folder, so you can go there (```cd ~/t5-lab/src/```) now and start the exercise.


text:
---
module: "@wq/react"
---

# useApp()

Returns the top level app object, which is exported by "@wq/app" and "./wq.js".

> Note that this hook is only meant to be used an escape hatch, when a more specific hook is not suitable.  Feel free to suggest new hooks that would allow you to reduce reliance on useApp().

```js
const wq = useApp();
wq.prefetchAll();
```

repository: wq/wq

gha_language: Python

repo_name: wq/wq


text:
If you are submitting a bug, please include the following:

- [ ] summary of problem
- [ ] gradle version
- [ ] spotless version
- [ ] operating system and version
- [ ] copy-paste your full Spotless configuration block(s), and a link to a public git repo that reproduces the problem if possible
- [ ] copy-paste the full content of any console errors emitted by `gradlew spotless[Apply/Check] --stacktrace`

repository: eyalkaspi/spotless

repo_name: eyalkaspi/spotless


text:
# aws-ec2-samples
Code Forked from `aws-samples/aws-cloudfront-samples` and changed to automatically update EC2 IP ranges change and also workaround for security group ingress rules limit.
For more detail read README.md inside folder update_security_groups_lambda.s
## update_security_groups_lambda

This AWS Lambda function is written in Python and can be used to automatically
update EC2 security group ingress rules when EC2 IP ranges change.

By subscribing this function to the SNS topic
[AmazonIpSpaceChanged](http://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html#subscribe-notifications)
your security groups that are properly tagged will be updated accordingly.

For more information on ip-ranges.json, read the documentation on [AWS IP Address Ranges](http://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html).


text:
# Reference Implementation for CONTACT Elements UI Development Tutorial
Sample solution for the Elements UI Development Tutorial.

The tutorial will guide you through the complete process of installing a
CONTACT Elements instance and implementing your own application with it.
You can use the contents of this repository to start with the tutorial exercises
and to check the correctness of your own implementation.
You will however need access to both the documentation and software packages
provided by CONTACT Software in order to make use of this.

## Structure
``materials/`` contains the resources needed to set up and later enhance the tutorial application.
``pkg/`` contains the reference implementation for each part of the tutorial.
``pkg/000_bootstrapping/cstraining.web/`` should be used as the base of your application development for the tutorial

repository: cslab/ui-tutorial-reference

repo_name: cslab/ui-tutorial-reference


text:
# Anitas-Kitchen
#### This is a website for Anitas Kitchen as my Week 2 Independent Project at Moringa School, 7th February 2021.
#### By **Aspin Isoe**
## Description
This is a front-end menu page for Anitas KItchen, a local restaurant serving exotic fast food such as Pizza and Burgers.
It shows the menu, different options, testimonials from past customers and a subscribe to mailing list section.
## Prerequisites
You need to have git installed.
If not, you can install git with the following command in your terminal; '$ sudo apt-get install git-all`.
## Setup/Installation Requirements
To access this project on your local files, you can clone it using these steps.
* Open your terminal.
* Use this command to clone `$ git clone https://psy-a.github.io/Anitas-Kitchen'.
* This will clone the repositoty into your local folder.
* Enjoy.
## Known Bugs
There are no known bugs at this moment.
## Technologies Used
1. HTML
2. CSS
3. GIT
### Live Site
View [live](https://psy-a.github.io/Anitas-Kitchen/)
## Support and contact details
For any questions, suggestions, contribution or assistance, reach me on<EMAIL_ADDRESS>### License
This project is under the  [MIT](LICENSE) licence
Copyright (c) 2021 **Aspin Isoe**

repository: psy-a/Anitas-Kitchen

gha_language: CSS

repo_name: psy-a/Anitas-Kitchen


text:
# More badges

Just a few collection of badges which this world lacked.

#### API & Parameters

URL:
```
https://morebadges.tk/?badge=nugetdownloads&user=dotnetfoundation
```

`badge` is the required. All other parameters depend on the particular badge.

More info coming soon (this should be hosted somewhere).

## Badges

Here's a list of badges available.

### Nuget downloads per user/organization

`badge=nugetdownloads`

Here's an example for user `Mutagene`:

| `query=` | Badge |
|:--------:|:-----:|
| Normal   | ![](https://img.shields.io/badge/dynamic/json?url=https%3A//morebadges.tk/%3fbadge=nugetdownloads%26user%3dMutagene&query=Normal&label=Nuget+downloads&logo=nuget) |
| Short    | ![](https://img.shields.io/badge/dynamic/json?url=https%3A//morebadges.tk/%3fbadge=nugetdownloads%26user%3dMutagene&query=Short&label=Nuget+downloads&logo=nuget) |
| NormalSplit    | ![](https://img.shields.io/badge/dynamic/json?url=https%3A//morebadges.tk/%3fbadge=nugetdownloads%26user%3dMutagene&query=NormalSplit&label=Nuget+downloads&logo=nuget) |
| Packages    | ![](https://img.shields.io/badge/dynamic/json?url=https%3A//morebadges.tk/%3fbadge=nugetdownloads%26user%3dMutagene&query=Packages&label=Nuget+packages&logo=nuget) |

Replace `microsoft` with the username:
```
https://img.shields.io/badge/dynamic/json?url=https%3A//morebadges.tk/%3fbadge=nugetdownloads%26user%3dmicrosoft&query=Short&label=Nuget+downloads&logo=nuget
```

Example for Microsoft:

![Badge sample](https://img.shields.io/badge/dynamic/json?url=https%3A//morebadges.tk/%3fbadge=nugetdownloads%26user%3dmicrosoft&query=Short&label=Nuget+downloads&color=lightblue)

![Badge sample](https://img.shields.io/badge/dynamic/json?url=https%3A//morebadges.tk/%3fbadge=nugetdownloads%26user%3dmicrosoft&query=Short&label=Nuget+downloads&color=purple&style=flat-square)

![Badge sample](https://img.shields.io/badge/dynamic/json?url=https%3A//morebadges.tk/%3fbadge=nugetdownloads%26user%3dmicrosoft&query=Short&label=Nuget+downloads&color=purple&style=flat-square&logo=nuget)

You can also use a format without shortening. Example for Angouri:

```
https://img.shields.io/badge/dynamic/json?url=https%3A//morebadges.tk/%3fbadge=nugetdownloads%26user%3dASC-Community&query=Normal&label=Nuget+downloads&color=purple&style=flat-square&logo=nuget
```

![Badge sample](https://img.shields.io/badge/dynamic/json?url=https%3A//morebadges.tk/%3fbadge=nugetdownloads%26user%3dASC-Community&query=Normal&label=Nuget+downloads&color=purple&style=flat-square&logo=nuget)

With splitting by thousands for Microsoft:
```
https://img.shields.io/badge/dynamic/json?url=https%3A//morebadges.tk/%3fbadge=nugetdownloads%26user%3dmicrosoft&query=NormalSplit&label=Nuget+downloads&color=purple&style=flat-square&logo=nuget
```

![Badge sample](https://img.shields.io/badge/dynamic/json?url=https%3A//morebadges.tk/%3fbadge=nugetdownloads%26user%3dmicrosoft&query=NormalSplit&label=Nuget+downloads&color=purple&style=flat-square&logo=nuget)

Another format:

```
https://img.shields.io/badge/dynamic/json?url=https%3A//morebadges.tk/%3fbadge=nugetdownloads%26user%3dASC-Community&query=Short&label=NuGet+installs&logo=nuget&color=lightblue&style=social
```
![The number of downloads on nuget](https://img.shields.io/badge/dynamic/json?url=https%3A//morebadges.tk/%3fbadge=nugetdownloads%26user%3dASC-Community&query=Short&label=NuGet+installs&logo=nuget&color=lightblue&style=social)

## Hosting

.NET 6 SDK needed to build that thing. Also make sure to let the program listen the required port.

repository: WhiteBlackGoose/MoreBadges

repo_name: WhiteBlackGoose/MoreBadges


text:
---
layout: default
---

# 1994-05-20 - Re:  Patent infringement (fwd)

## Header Data

From<EMAIL_ADDRESS>(Graham Toal)

To<EMAIL_ADDRESS>Message Hash: a0d787494dc88996eeb1514e97c82e36ed19d8c6589586459489be04a046b082

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1994-05-20 14:56:06 UTC

Raw Date: Fri, 20 May 94 07:56:06 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>(Graham Toal)
Date: Fri, 20 May 94 07:56:06 PDT
To<EMAIL_ADDRESS>Subject: Re:  Patent infringement (fwd)
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

: This is the argument Schiller's message on 2.6 foreshadowed.  However,
: there are some counterarguments you can make:

:  - It's not clear that RSADSI has actually said that merely posting a key with
:    the words "Version: 2.3a" in and of itself constitutes inducement or
:    conspiracy to infringe the patent.  Schiller speculated that running a key
:    server which accepted pre-2.4 keys could represent contributory infringement
:    but I haven't seen any statements from Bidzos that agree with this, let
:    alone the stronger statement Sternlight is making.

Excuse me folks - I think we're missing a big point here:  there's no
such crime as 'conspiracy to infringe' nor is it a civil offense.  What
PKP are talking about is agrravated damages - *if* you are *breaking* one
of their patents, eg by *running* pgp, then because you are encouraging
others to do so by, say, also offering a keyserver service, they can
ask for larger damages because they'll say you're *flagrantly* violating
their patent and encouraging others to do so.

However, if you're *not* violating their patent, there's nothing they can
do about the 'encouraging others to do so' part.  Running a keyserver,
as long as it doesn't run pgp to do its key management, is not infringing
PKP's patents, and they can't do anything about it - it's a question
of publishing and free speech.  It's not even the more restricted
commercial speech - keyservers aren't a business.

I think if you read the MIT announcements closely you'll see what they
say is compatible with this view.

G

{% endraw %}
```

## Thread

+ Return to [May 1994](/archive/1994/05)

+ Return to<EMAIL_ADDRESS>(Graham Toal)](/authors/gtoal_at_anteallach_com_graham_toal_)"

+ 1994-05-20 (Fri, 20 May 94 07:56:06 PDT) - Re:  Patent infringement (fwd) -<EMAIL_ADDRESS>(Graham Toal)_


text:
# Modular Acoustic Detection

## Environment Setup

To download all the relevant Ubuntu packages:
```shell
# Make script executable
$ chmod 777 ubuntu_packages_install.sh

# Run script to install
$ ./ubuntu_packages_install.sh
```

## Local repo setup

To load all git submodules:
```shell
$ git submodule update --init --recursive
```

To download all the data files:
```shell
# Make script executable
$ chmod 777 download_data_files.sh

$ ./download_data_files.sh
```

To download all the sound files (This is a really lengthy process and hence is not advisable unless you absolutely have to):
```shell
$ python download_all_sounds.py
```