text:
[![License: MIT](https://img.shields.io/badge/License-MIT-orange.svg)](https://opensource.org/licenses/MIT)
![PMD Best Practices](https://github.com/philips-software/cerberus/workflows/PMD%20Best%20Practices/badge.svg)
![Mutation Analysis 96%](https://github.com/philips-software/cerberus/workflows/Mutation%20Analysis%2096%25/badge.svg)
![Duplicate Blocks 37 Tokens](https://github.com/philips-software/cerberus/workflows/Duplicate%20Blocks%2037%20Tokens/badge.svg)
![Checkstyle Adherence](https://github.com/philips-software/cerberus/workflows/Checkstyle%20Adherence/badge.svg)
![Compile And Assemble](https://github.com/philips-software/cerberus/workflows/Compile%20And%20Assemble/badge.svg)
![Spotbugs Scan](https://github.com/philips-software/cerberus/workflows/Spotbugs%20Scan/badge.svg)

# Cerberus

Cerberus is a tool to measure code quality parameters, which can be used as a watch dog to observe code quality parameters like copy paste errors, suppressed warnings etc., and also to gate builds when the allowed thresholds for the parameters being observed is breached.

### Why another tool?
We asked ourselves the same question! Why create a new tool when there were many industry standard tools like SonarQube, Coverity, Fortify etc. Here's why we think Cerberus works better for us.

- No deployment model: Unlike other tools that requires setups, or a "server" and "client" mode of operation, Cerberus is an executable jar. As long as we have a JVM 1.8 or higher, Cerberus works, and needs no deployment!
- Data generation & sharing: Cerberus is lightweight, and mostly generates data in the form of JSON, with customization available on the reporting format. One thing to note however is, Cerberus does not store data. All data generated by Cerberus is locally stored on the machine where it is executed.
- Business specific metrics: While some of the metrics measured by Cerberus are re-used from components like PMD, CPD etc. some of the metrics measured are business specific, like providing traceability of suppressed warnings annotation in code, providing a facade on top of [CK](https://github.com/mauricioaniche/ck) to offer configurable metrics parameters and diffs. Cerberus takes in many such business requests and builds them for one team, and everyone else using Cerberus gets it for free!
- Faster capability extension cycles: We also wrote Cerberus to churn code and build faster. Every business request to us has a time-to-market need. With a code base internally owned, we can do internal code-reviews faster and release versions faster to meet the business needs.
- Open tenets: Available industry standard tools have set tenets, which if we want to cross, we may not have options. Our tenet is simple. Let's meet the business needs keeping in mind quality and integrity of the software written. This way, with our tenet, we can continue to explore many options and keep integrating it to Cerberus.
- Reuse first policy: Our intention is not to rebuild another PMD or another SpotBugs. Cerberus will be a facade for such tools so that development team need not work on plumbing each of such independent tools, for different programming languages used in the project and for different projects developed by the team.
- Built for learning & demoing: As part of Software Center of Excellence, we consult with many businesses and guide them on how to gate the code for quality parameters, how to refactor code, how to create more readable and maintainable code. Cerberus is built keeping all the principles of software craftsmanship that SWCoE suggests, so that we can use Cerberus as an example to show how to integrate the principles of clean-code practices into code. We also wrote Cerberus because we wanted to learn what it's like to write a software that adheres to good code quality standards.

## How to use Ceberus?
### Build Cerberus from source
To build Cerberus, you will need a JDK 8 installed in your system.
The final output of build is an executable JAR. We have created gradle tasks to achieve the same, review our build.gradle file for more details.

1. Clone the repository
`git clone https://github.com/philips-software/cerberus.git`
2. Build it using the following command
`./gradlew clean build shadowJar`
The executable jar will be generated in the build/libs folder.

### Run Cerberus as a command line tool
Once the jar gets generated,  use the jar to run Cerberus

```
$ java -jar cerberus.project-1.0.0-SNAPSHOT.jar
Usage: Cerberus [COMMAND]
Waking Cerberus to devour bad things in the system
Commands:
  CPD            Detect duplicated blocks of code in your source code
  SWD            Detect all the warnings which are suppressed in your code
  JCMD           Java Code Metrics Detector
  JCMD-DIFF      Java Code Metrics Detector with Diff
  FPM            Find Programming mistakes in code
```

### Usage of FPM

You can find detailed instructions on  FPM ( Find Programming mistakes )
[here](docs/FPM.md)

### Usage of JCMD-DIFF

You can find detailed instructions on JCMD-DIFF ( Java Code Metrics Detector with Diff ) along with the explanation for each metric
[here](docs/JCMD.md)

### Dogfooding
To evaluate and confirm the quality of code changes made to Cerberus, you should run through all the gates and review the generated reports with:

`./gradlew clean build pitest`

The above command runs following tests

1. Runs Automated tests
2. PMD for programming mistakes
3. CPD for copy paste detection
4. Checkstyle on source and tests
5. Code coverage using Jacoco
5. Mutation testing using pitest

We run the same Quality checks in our pipeline as well.

As mentioned above, Mutation testing is integrated into the build with a defined gating % . To run the mutation testing alone, run the below command

`./gradlew pitest`

### Dockerizing Cerberus

You can also utilize the Dockerfile in the repo to create a Docker image
and spin up a container to build and run to do so run below commands

`docker build -t cerebrus_image .`

Once the image is built, you can actually spin up the container using the command below

`docker run -ti -v /path/to/Project/Cerebrus:/usr/src cerebrus_image bash`

### Contact

[Maintainers Of Project](MAINTAINERS.md)

### To Contribute

You are always free to fork this repository and create a PR to develop branch and ask for reviewer, Once approved it gets merged to develop branch .
To prevent build breaks run the same quality checks using gradle that we run in our pipelines for all quality checks

```
./gradlew clean build pitest shadowJar
```

## License

[MIT](LICENSE)

## Credits and references

1. [PMD]( https://pmd.github.io/ )
2. [CPD](https://pmd.github.io/latest/pmd_userdocs_cpd.html#overview )

## Inspiration

1. [Facebook Infer ](https://fbinfer.com/)
2. [Bazel Build ](https://bazel.build/)

repository: binodsuman/cerberus

repo_name: binodsuman/cerberus


text:
# KicadJE_ADSR_Mega32
Initial ATMega32 board (EU-5 ADSR32)

Second PT2399 reverb (EU-4 Reverb)

Third VCO - based on Format VCO (VCO3)

# Purpose
1 - try out ATMega 32 for digital applications with more IO

2 - PT2399 2nd revision

3 - Formant VCO modification 3rd rev

# Status - delivered
## Initial
| Stage  | Detail | Status |
| ------------- | ------------- | ------------- |
| create material  | sch/pcb | OK  |
| | gerber | OK |
| production  |   | OK |
|  | produced | OK |
|  | delivered | OK |

## Preliminary validation
| Test  | Detail | Status |
| ------------- | ------------- | ------------- |
| Initial Inspection | | OK |
| Initial Technical Test | ADSR | ICSP:ok - Serial: no success - LED: OK - POT:no success|
| Initial Technical Test | Reverb | OK |
| Initial Technical Test | VCO3 | OK |
| Initial Product Test | ADSR | ADC not working due to GND conn to Aref |
| Initial Product Test | Reverb | Works nicely (tested with 5V from 16pin Doepfer|
| Initial Product Test | VCO3 | Working - output and "sine" - Square not working - UMX1 works nicely as CV - FM works - LFO works - POT's reversed... |

## Secondary validation
| Test  | Detail | Status |
| ------------- | ------------- |------------- |
| Product Test |  |  |
| Product Test |  |  |
| Product Test | VCO | Square not working|
| Quality | | |
| Quality | | |
| Quality | VCO3 | Range from 20Hz |
| Long Term Product Test |  |  |
| Long Term Product Test |  |  |
| Long Term Product Test |  |  |
| Power Draw |  |
| Power Draw |  |
| Power Draw | VCO3 | +5V 1mA, +12V 7mA, -12V 6mA

## Errata
### Errata - VCO3
1 - ALL pots are reversed
### Errata - ADSR Mega32
1 - ADC not working due to GND conn to Aref - fix by bending leg so it does not get soldered

## Issues and Notes
### VCO 3
1 - C104 needs to be bigger (tried w 20uf that worked nicely)

2 - Square circuit not working

3 - Unsure of trigger feature

4 - ALL pots are reversed

5 - Consider adding LED

# Pictures
![](KicadJE_ADSR_Mega32/KicadJE_ADSR_Mega32_Front1.png)
## VCO3
![](VCO3_sch.png)
![](VCO3.jpeg)
![](https://github.com/promesoft/KicadJE_uP_DAC/blob/master/DDS1_VCO3.jpeg)
## Reverb
![](EU1-PT2399_sch.png)

# Inspiration from
https://github.com/promesoft/KicadJE_EffectsUnit1

https://github.com/promesoft/ArduinoJE_ADSR

https://github.com/promesoft/KicadFormantVCO

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
---
title: How To Send A Transaction
description: Sending & Receiving
tags:
  - Transactions
priority: 100
date_published: '2017-07-05'
date_modified: '2020-10-08'
---

If you plan to move a large amount of Ether or tokens, you should first send a test transaction of a small amount to the destination wallet to ensure everything goes as planned.
Optional, but **highly recommended** (if you haven't already): Install [MetaMask](/how-to/migrating/moving-from-mycrypto-to-metamask) or the [EtherAddressLookup Chrome Extension](https://chrome.google.com/webstore/detail/etheraddresslookup/pdknmigbbbhmllnmgdfalmedcmcefdfn?hl=en-GB) to protect yourself from malicious websites around the crypto-space that will steal your private keys. Or even better, think about getting yourself a hardware wallet. If you have hundreds or thousands of dollars online, you might as well spend a little bit more money to ensure that your funds are safe.

1. Navigate to the [Send page](https://mycrypto.com/account).

2. Select how you would like to [access your wallet and unlock it](/how-to/accessing-wallet/how-to-access-your-wallet-with-keystore-file).

3. If you installed MetaMask earlier, set up your system to unlock your wallet safely in just one click. Because of how fast and easy it is, we strongly recommend this method.

4. Enter the address you would like to send to in the "To Address:" field.

5. If you're sending ETH, move on the step 6. If you are sending a token, select which one you want to send. If the token of your choice is not listed:

   1. In the sidebar, click [Add Custom Token](/how-to/tokens/how-to-add-a-custom-token).
   2. Enter the address, name, and decimals of the token. These are provided by the developers of the token and are also found on [Ethplorer](https://ethplorer.io/).
   3. Click "Save."
   4. You can now send that token as well as see it's balance in the sidebar.

6. Enter the amount you would like to send.

7. You can also click the "Send Entire Balance" link if you would like the transfer the entire balance.

8. Click "Generate Transaction." A couple more fields will appear. This is your browser generating the transaction.

9. Click the blue "Send Transaction" button below that. A pop-up will appear. Double-check that the amount, the type of coin, and the address are correct.

10. Click "Yes, I am sure! Make transaction" button. The transaction will be submitted. The TX ID will display. You can click that TX ID to see it on the blockchain.

Just as a reminder, any transaction that you make will require gas which is paid in Ether. It is a transaction fee that is paid to the miners as an incentive to include your transactions in the blocks that they mine.

## Related Articles

- [What is Gas](/general-knowledge/ethereum-blockchain/what-is-gas)
- [Transactions Not Showing Up or Pending Forever](/troubleshooting/sending/transactions-not-showing-or-pending)


text:
node-red-node-smooth
====================

A Node-RED node that provides
several simple smoothing algorithms for incoming data values. These include

 - Minimum
 - Maximum
 - Mean
 - Standard Deviation
 - High Pass Smoothing
 - Low Pass Smoothing

Install
-------

Run the following command in your Node-RED user directory - typically `~/.node-red`

    npm install node-red-node-smooth

Usage
-----

A simple node to provide various functions across several previous values,
including max, min, mean, standard deviation, high and low pass filters.

Max, Min, Mean and Standard Deviation work over a rolling window, based on a
specified number of previous values.

The High and Low pass filters use a smoothing factor. The higher the number
the more the smoothing. E.g. a value of 10 is similar to an α of 0.1.
It is analogous to an RC time constant - but there is no time component to
this as the code is based on events arriving.

If `msg.reset` is received (with any value), all the counters and intermediate values are reset to an initial state.

**Note:** This node only operates on **numbers**. Anything else will try to be
made into a number and rejected if that fails.

repository: node-red/node-red-nodes

gha_language: JavaScript

gha_license_id: NOASSERTION

repo_name: node-red/node-red-nodes


text:
+++
title = "Townsourced Open-sourced"
date = "2017-11-28"
categories = ["Releases"]
tags = ["Go", "Web Development", "Townsourced", "Townsourced"]
keywords = ["web development", "go", "golang", "backend development", "open-source", "community", "Townsourced"]
+++

**TLDR: Grab the code here: https://github.com/timshannon/townsourced and run `docker-compose up`**

My goal with Townsourced was first and foremost to build something useful for local, small communities.  I felt local
communities were very under-represented online, and the social networks available catered either to large communities or niche
communities of shared interest.  My target audience was small, local communities: small towns, college campuses,
neighborhoods, churches, schools.  I wanted to build something that handled the overlap between those local communities
better than existing options.

<!-- more -->

It started as a small side project, and grew from there.  I showed it to a few angel investors, and demoed it to the
Minneapolis Tech community at [Minnedemo](https://minnestar.org/minnedemo/), but it never went any further than that.

I firmly believe that open-source is important, and I want to contribute back in any way I can. There are a few
interesting things in Townsourced's code that I hope will, at a minimum, be useful as an example.

You can access a live version of this code running at [https://www.townsourced.com](https://www.townsourced.com) which
I plan to keep running.

If you have any questions, or would like some help setting Townsourced up to run for your own community, feel free to
send me a message at [tim@townsourced.com](mailto:tim@townsourced.com).

# Running Townsourced

The quickest way to run Townsourced is with Docker.  Install [Docker](https://www.docker.com/) and
[Docker-Compose](https://docs.docker.com/compose/install/), then run `docker-compose up`.

This will start a containerized instance of Townsourced listening on port `8080`, running with RethinkDB, Elasticsearch
and Memcached.

The Docker Compose file can be found [here](https://github.com/timshannon/townsourced/blob/open-source-post-links/docker-compose.yaml).

# Building

Townsourced is written in Go, and all of it's dependencies are vendored.  You can build Townsourced by simply running
`go get github.com/timshannon/townsourced`.

To build the web / client portion you'll need to install [gobble](https://github.com/gobblejs/gobble)

`npm install -g gobble-cli`

Then run `gobble build static -f` in the `web` folder.

# Deploying

The easiest way to deploy Townsourced is to use the Docker.  The `docker-compose.yaml` file can be used to run the
entire stack, or give you an insight into what services are needed.  Simply run `docker-compose up` and you'll have
a running instance of Townsourced at http://localhost:8080.

To deploy Townsourced manually, you'll need:

* [RethinkDB](https://rethinkdb.com/)
* [Elasticsearch](https://www.elastic.co/products/elasticsearch) (2.4.6)
* [Memcached](https://memcached.org/)

Townsourced will look for a `settings.json` file either in it's running directory, or in `/etc/townsourced/` on linux. In
that `settings.json` file will be the connection parameters that Townsourced will use to connect to the various services.
Here is an example of what that looks like:
```json
{
    "app": {
        "httpClientTimeout": "30s",
        "taskPollTime": "1m",
        "taskQueueSize": 100
    },
    "data": {
        "cache": {
            "addresses": [
                "<IP_ADDRESS>:11211"
            ]
        },
        "db": {
            "address": "<IP_ADDRESS>:28015",
            "database": "townsourced",
            "timeout": "60s"
        },
        "search": {
            "addresses": [
                "http://<IP_ADDRESS>:9200"
            ],
            "index": {
                "name": "townsourced",
                "replicas": 1,
                "shards": 5
            },
            "maxRetries": 0
        }
    },
    "web": {
        "address": "https://www.townsourced.com",
        "certFile": "",
        "keyFile": "",
        "maxHeaderBytes": 0,
        "maxUploadMemoryMB": 10,
        "minTLSVersion": 769,
        "readTimeout": "60s",
        "writeTimeout": "60s"
    }
}
```

Finally, you'll need a `web/static` folder (built from gobble) in the running directory of Townsourced.

# Items of Interest
I've dived into more detail in the [Anatomy of a Go Web Application](/post/anatomy-of-a-go-web-app/) and
[Authentication](/post/anatomy-of-a-go-web-app-authentication/) posts, but I wanted to quick run through a few points
of interest (in my opinion) in the Townsourced code.

## Posts that exist in more than one town
One of my big goals with Townsourced was to better describe the overlapping communities that a person belongs to. Most
social networks simply have Groups that you join.  Townsourced *Towns* are similar except that when you create a post,
you can post it to multiple communities *simultaneously*.  The discussions around that post live with the post and exist
across communities, but communities could still moderate a post in one Town without it impacting another town.

![Multi-town Posts](/images/post/townsourced-opensourced/multi-town.png "Multi-town Posts")

You can see the Post structure, and how it tracks Towns and moderation
[here](https://github.com/timshannon/townsourced/blob/open-source-post-links/app/post.go#L99).

## Private package for open source release
I knew I wanted to eventually open-source Townsourced regardless of whatever came of it, so I made sure that I kept
anything that I didn't want to be released to the public (API keys, passwords, etc) in a separate package so that it
could be easily removed.

All of the API keys that Townsourced uses are stored here, from Facebook to the the client side Google Maps API key,
which is [inserted into the html template](https://github.com/timshannon/townsourced/blob/open-source-post-links/web/src/townSearch.template.html#L168).

You can see that package [here](https://github.com/timshannon/townsourced/blob/open-source-post-links/data/private/private.go).

If you want to run Townsourced for yourself you can get each one of the API keys used for free without committing to any
subscription or fees.  The [Google Maps API key](https://developers.google.com/maps/documentation/embed/get-api-key)
would be a minimum requirement to have for a lot of the UI functionality to work.

## Attribution
Open-source is important, and Townsourced relies heavily on open-source technologies.  Most open-source licenses are
incredibly permissive, but they also have a clause denoting the need for attribution to the original author.

Most people simply include the license or creator comments with their releases, which meets the requirements of the license.
What I try to do in any software I write is find a place to clearly list those attributions so they are easy to find. It
also makes it easy to see the technologies used to build the piece of software.
In Townsourced, a link to [that attribution](https://www.townsourced.com/attribution/) can be found in the footer of every page.

## Versioning
In most web applications you need to be able to handle the scenario where two users are updating the same data.  One
will finish their changes and save, and the second user will then be editing the *previous* version of that data.    Sometimes this isn't a big deal,
but I chose to not allow it in Townsourced.

I handled this by generating a small random value with any object I wanted to version, and when a database update happens
it checks if the current version matches the passed in version with the update.  If the version doesn't match, the user gets
a message saying their screen is out of date and they need to refresh the page.

Go makes it easy to embed this [version struct](https://github.com/timshannon/townsourced/blob/open-source-post-links/data/version.go#L42)
that handles the update logic into [existing structs](https://github.com/timshannon/townsourced/blob/open-source-post-links/app/town.go#L22).

You can see how that works [here](https://github.com/timshannon/townsourced/blob/open-source-post-links/data/version.go).

## Less in Ractive Components
When I first started Townsourced, [Vue](https://vuejs.org/) was just getting rolling, and I hadn't even heard of it yet.
I had built a few projects with [Ractive](https://ractive.js.org/) and found it to be simple and powerful.  I especially
loved Ractive Components; bundles of application UI logic combined with encapsulated HTML and CSS.  It made it really easy
to build a UI in pieces and reuse them as needed.

However, I quickly ran into issues where I was having to duplicate many of the variables that were defined in my `.less` files
into my components.  Luckily my build tool of choice ([Gobble](https://github.com/gobblejs/gobble)) made it easy to write
a small section into my build scripts to let me compile less into my Ractive components.  This is, of course, something
that the Vue ecosystem now handles automatically for you.  This flexibility is also a reason why I will always favor a
programmable build tool over a configuration based one.

You can see that [here](https://github.com/timshannon/townsourced/blob/open-source-post-links/web/gobblefile.js#L138) and how it was used
[here](https://github.com/timshannon/townsourced/blob/open-source-post-links/web/src/js/components/post.html#L74).

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

There are many other things I could cover with more detail, like:

* [Automatically generating tiny, blurred placeholder images](https://github.com/timshannon/townsourced/blob/open-source-post-links/data/image.go)
to [show when posts are loading](https://github.com/timshannon/townsourced/blob/open-source-post-links/web/src/js/components/image.html)
* Easy [sharing of existing posts](https://github.com/timshannon/townsourced/blob/open-source-post-links/app/shareParsers.go)
 from other sites [with Townsourced](https://github.com/timshannon/townsourced/blob/open-source-post-links/web/src/js/bookmarklet.js)
* Making a large [interactive SVG for the Pitch page](https://github.com/timshannon/townsourced/blob/open-source-post-links/web/src/pitch.html)
* How to do [nested comments with Rethinkdb](https://github.com/timshannon/townsourced/blob/open-source-post-links/data/comment.go)

But I'll save those details for possible future posts.  If anyone is interested, [let me know](mailto:tim@townsourced.com).

Hopefully there are a few things in the repository that you may find useful.  If so, I'd love to hear about it.  Either
way it's out there now, and under an [MIT license](https://github.com/timshannon/townsourced/blob/open-source-post-links/LICENSE), for
you to do with it as you like.


text:
# block_tree

##含义：

```rust
//! In a leader based consensus algorithm, each participant maintains a block tree that looks like
//! the following:
//! ```text
//!  Height      5      6      7      ...
//!
//! Committed -> B5  -> B6  -> B7
//!         |
//!         └--> B5' -> B6' -> B7'
//!                     |
//!                     └----> B7"
//! ```
//! This module implements `BlockTree` that is an in-memory representation of this tree.
```

## 功能：

这一部分实现了树的各种操作，比如看看某个block的儿子，父亲，插入block等等操作，

## 代码：

####定义：

  ```rust
//定义block的trait
//值得注意的set_committed之后可能不会马上加入storage，因为execution操作可能会滞后一点点。

pub trait Block: std::fmt::Debug {
    /// The output of executing this block.
    type Output;

    /// The signatures on this block.
    type Signature;

    /// Whether consensus has decided to commit this block. This kind of blocks are expected to be
    /// sent to storage very soon, unless execution is lagging behind.
    fn is_committed(&self) -> bool;

    /// Marks this block as committed.
    fn set_committed(&mut self);

    /// Whether this block has finished execution.
    fn is_executed(&self) -> bool;

    /// Sets the output of this block.
    fn set_output(&mut self, output: Self::Output);

    /// Sets the signatures for this block.
    fn set_signature(&mut self, signature: Self::Signature);

    /// The id of this block.
    fn id(&self) -> HashValue;

    /// The id of the parent block.
    fn parent_id(&self) -> HashValue;

    /// Adds a block as its child.
    fn add_child(&mut self, child_id: HashValue);

    /// The list of children of this block.
    fn children(&self) -> &HashSet<HashValue>;
}

/// The `BlockTree` implementation.
#[derive(Debug)]
pub struct BlockTree<B> {
    /// A map that keeps track of all existing blocks by their ids.
    id_to_block: HashMap<HashValue, B>,

    /// The blocks at the lowest height in the map. B5 and B5' in the following example.
    /// ```text
    /// Committed(B0..4) -> B5  -> B6  -> B7
    ///                |
    ///                └--> B5' -> B6' -> B7'
    ///                            |
    ///                            └----> B7"
    /// ```
    heads: HashSet<HashValue>,

    /// Id of the last committed block. B4 in the above example.
    last_committed_id: HashValue,
}/// The `BlockTree` implementation.
#[derive(Debug)]
pub struct BlockTree<B> {
    /// A map that keeps track of all existing blocks by their ids.
    id_to_block: HashMap<HashValue, B>,
/////每一个block的id都是一个hash

    /// The blocks at the lowest height in the map. B5 and B5' in the following example.
    /// ```text
    /// Committed(B0..4) -> B5  -> B6  -> B7
    ///                |
    ///                └--> B5' -> B6' -> B7'
    ///                            |
    ///                            └----> B7"
    /// ```
    heads: HashSet<HashValue>,

    /// Id of the last committed block. B4 in the above example.
    last_committed_id: HashValue,
}
  ```

### 几个比较有意思的函数；除了这几个，剩下的都比较trivial

```rust
/// Returns a reference to a specific block, if it exists in the tree.
    pub fn get_block(&self, id: HashValue) -> Option<&B> {
        self.id_to_block.get(&id)
    }

    /// Returns a mutable reference to a specific block, if it exists in the tree.
///这个函数往往是其他需要修改树的函数的基础，因为要获取可变的引用
    pub fn get_block_mut(&mut self, id: HashValue) -> Option<&mut B> {
        self.id_to_block.get_mut(&id)
    }

//必须要父节点execute完了才能excute自己
/// Returns id of a block that is ready to be sent to VM for execution (its parent has finished
    /// execution), if such block exists in the tree.
    pub fn get_block_to_execute(&mut self) -> Option<HashValue> {
        let mut to_visit: Vec<HashValue> = self.heads.iter().cloned().collect();

        while let Some(id) = to_visit.pop() {
            let block = self
                .id_to_block
                .get(&id)
                .expect("Missing block in id_to_block.");
            if !block.is_executed() {
                return Some(id);
            }
            to_visit.extend(block.children().iter().cloned());
        }

        None
    }

//如果自己被确认了，那么自己的所有祖先节点也都被确认了，这些区块都将会被送到storage永久的存储，但可能不是马上完成操作
 /// Marks given block and all its uncommitted ancestors as committed. This does not cause these
    /// blocks to be sent to storage immediately.
    pub fn mark_as_committed(
        &mut self,
        id: HashValue,
        signature: B::Signature,
    ) -> Result<(), CommitBlockError> {
        // First put the signatures in the block. Note that if this causes multiple blocks to be
        // marked as committed, only the last one will have the signatures.

        //也就是说，有的被确认的区块会不存在数字签名
        match self.id_to_block.get_mut(&id) {
            Some(block) => {
                if block.is_committed() {
                    bail_err!(CommitBlockError::BlockAlreadyMarkedAsCommitted { id });
                } else {
                    block.set_signature(signature);
                }
            }
            None => bail_err!(CommitBlockError::BlockNotFound { id }),
        }

        // Mark the current block as committed. Go to parent block and repeat until a committed
        // block is found, or no more blocks.
        let mut current_id = id;
        while let Some(block) = self.id_to_block.get_mut(&current_id) {
            if block.is_committed() {
                break;
            }

            block.set_committed();
            current_id = block.parent_id();
        }
/////向上递推地commit
        Ok(())
    }

 /// Removes all blocks in the tree that conflict with committed blocks. Returns a list of
    /// blocks that are ready to be sent to storage (all the committed blocks that have been
    /// executed).
    pub fn prune(&mut self) -> Vec<B> {
        let mut blocks_to_store = vec![];

        // First find if there is a committed block in current heads. Since these blocks are at the
        // same height, at most one of them can be committed. If all of them are pending we have
        // nothing to do here.  Otherwise, one of the branches is committed. Throw away the rest of
        // them and advance to the next height.
        let mut current_heads = self.heads.clone();
        while let Some(committed_head) = self.get_committed_head(&current_heads) {
            assert!(
                current_heads.remove(&committed_head),
                "committed_head should exist.",
            );
            for id in current_heads {
                self.remove_branch(id);
            }

            match self.id_to_block.entry(committed_head) {
                hash_map::Entry::Occupied(entry) => {
                    current_heads = entry.get().children().clone();
                    let current_id = *entry.key();
                    let parent_id = entry.get().parent_id();
                    if entry.get().is_executed() {
                        // If this block has been executed, all its proper ancestors must have
                        // finished execution and present in `blocks_to_store`.
                        self.heads = current_heads.clone();
                        self.last_committed_id = current_id;
                        blocks_to_store.push(entry.remove());
                    } else {
                        // The current block has not finished execution. If the parent block does
                        // not exist in the map, that means parent block (also committed) has been
                        // executed and removed. Otherwise self.heads does not need to be changed.
                        if !self.id_to_block.contains_key(&parent_id) {
                            self.heads = HashSet::new();
                            self.heads.insert(current_id);
                        }
                    }
                }
                hash_map::Entry::Vacant(_) => unreachable!("committed_head_id should exist."),
            }
        }

        blocks_to_store
    }

```

repository: jonhoyc/Libra-code-Analysis

repo_name: jonhoyc/Libra-code-Analysis


text:
[![Go Reference](https://pkg.go.dev/badge/github.com/golobby/config.svg)](https://pkg.go.dev/github.com/golobby/config)
[![CI](https://github.com/golobby/config/actions/workflows/ci.yml/badge.svg)](https://github.com/golobby/config/actions/workflows/ci.yml)
[![CodeQL](https://github.com/golobby/config/workflows/CodeQL/badge.svg)](https://github.com/golobby/config/actions?query=workflow%3ACodeQL)
[![Go Report Card](https://goreportcard.com/badge/github.com/golobby/config)](https://goreportcard.com/report/github.com/golobby/config)
[![Coverage Status](https://coveralls.io/repos/github/golobby/config/badge.svg)](https://coveralls.io/github/golobby/config?branch=master)
[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go)

# Config
GoLobby Config is a lightweight yet powerful configuration manager for Go projects.
It takes advantage of Dot-env (.env) files and OS environment variables alongside config files (JSON, YAML, and TOML) to meet all of your requirements.

## Documentation
### Required Go Version
It requires Go `v1.16` or newer versions.

### Installation
To install this package run the following command in the root of your project.

```bash
go get github.com/golobby/config/v3
```

### Quick Start
The following example demonstrates how to use a JSON configuration file.

```go
// The configuration struct
type MyConfig struct {
    App struct {
        Name string
        Port int
    }
    Debug      bool
    Production bool
    Pi         float64
}

// Create an instance of the configuration struct
myConfig := MyConfig{}

// Create a feeder that provides the configuration data from a JSON file
jsonFeeder := feeder.Json{Path: "config.json"}

// Create a Config instance and feed `myConfig` using `jsonFeeder`
c := config.New()
c.AddFeeder(jsonFeeder)
c.AddStruct(&myConfig)
err := c.Feed()

// Or use method chaining:
// err := config.New().AddFeeder(jsonFeeder).AddStruct(&myConfig).Feed()

// Use `myConfig`...
```

### Feeders
Feeders provide the configuration data.
The GoLobby Config package supports the following feeders out of the box.

* `Json`: It feeds using a JSON file.
* `Yaml`: It feeds using a YAML file.
* `Toml`: It feeds using a TOML file.
* `DotEnv`: It feeds using a dot env (.env) file.
* `Env`: It feeds using OS environment variables.

You can also create your custom feeders by implementing the `Feeder` interface or use third-party feeders.

#### Json Feeder
The `Json` feeder uses Go built-in `json` package to load JSON files.
The snippet below shows how to use the `Json` feeder.

```go
jsonFeeder := feeder.Json{Path: "sample1.json"}
c := config.New().AddFeeder(jsonFeeder)
```

#### Yaml Feeder
The `Yaml` feeder uses the [YAML package](https://github.com/go-yaml/yaml) (v3) to load YAML files.
The snippet below shows how to use the `Yaml` feeder.

```go
yamlFeeder := feeder.Yaml{Path: "sample1.yaml"}
c := config.New().AddFeeder(yamlFeeder)
```

#### Toml Feeder
The `Toml` feeder uses the [BurntSushi TOML package](https://github.com/BurntSushi/toml) to load TOML files.
The snippet below shows how to use the `Toml` feeder.

```go
tomlFeeder := feeder.Toml{Path: "sample1.toml"}
c := config.New().AddFeeder(tomlFeeder)
```

#### DotEnv Feeder
The `DotEnv` feeder uses the [GoLobby DotEnv](https://github.com/golobby/dotenv) package to load `.env` files.
The example below shows how to use the `DotEnv` feeder.

The `.env` file: https://github.com/golobby/config/blob/v3/assets/.env.sample1

```go
type MyConfig struct {
    App struct {
        Name string `env:"APP_NAME"`
        Port int    `env:"APP_PORT"`
    }
    Debug      bool    `env:"DEBUG"`
    Production bool    `env:"PRODUCTION"`
    Pi         float64 `env:"PI"`
    IDs        []int   `env:"IDS"`
}

myConfig := MyConfig{}
dotEnvFeeder := feeder.DotEnv{Path: ".env"}
err := config.New().AddFeeder(dotEnvFeeder).AddStruct(&myConfig).Feed()
```

You must add a `env` tag for each field that determines the related dot env variable.
If there isn't any value for a field in the related file, it ignores the struct field.
You can read more about this feeder in the [GoLobby DotEnv](https://github.com/golobby/dotenv) package repository.

#### Env Feeder
The `Env` feeder is built on top of the [GoLobby Env](https://github.com/golobby/env) package.
The example below shows how to use the `Env` feeder.

```go
type MyConfig struct {
    App struct {
        Name string `env:"APP_NAME"`
        Port int    `env:"APP_PORT"`
    }
    Debug      bool     `env:"DEBUG"`
    Production bool     `env:"PRODUCTION"`
    Pi         float64  `env:"PI"`
    IPs        []string `env:"IPS"`
    IDs        []int16  `env:"IDS"`
}

_ = os.Setenv("APP_NAME", "Shop")
_ = os.Setenv("APP_PORT", "8585")
_ = os.Setenv("DEBUG", "true")
_ = os.Setenv("PRODUCTION", "false")
_ = os.Setenv("PI", "3.14")
_ = os.Setenv("IPS", "<IP_ADDRESS>", "<IP_ADDRESS>")
_ = os.Setenv("IDS", "10, 11, 12, 13")

myConfig := MyConfig{}
envFeeder := feeder.DotEnv{}
err := config.New().AddFeeder(envFeeder).AddStruct(&myConfig).Feed()
```

You must add a `env` tag for each field that determines the related OS environment variable name.
If there isn't any value for a field in OS environment variables, it ignores the struct field.
You can read more about this feeder in the [GoLobby Env](https://github.com/golobby/env) package repository.

### Multiple Feeders
One of the key features in the GoLobby Config package is feeding using multiple feeders.
Lately added feeders overrides early added ones.

The example below demonstrates how to use a JSON file as the main configuration feeder and override the configurations with dot env and os variables.

* The `Json` feeder as the first feeder sets all the struct fields from the JSON file.
* The `DotEnv` feeder as the second feeder overrides existing fields.
  The `APP_NAME` and `DEBUG` fields exist in the `.env.sample2` file.
* The `Env` feeder as the last feeder overrides existing fields, as well.
  The `APP_PORT` and `PRODUCTION` fields are defined in the OS environment.

### Setup Method

The `Setup()` method runs automatically after feeding.
You can use this method for post-processing logics.

```go
type Region int

const (
    Asia Region = iota
    Europe
    America
    Else
)

type Config struct {
    RegionId int `env:"REGION"`
    Region   Region
}

func (c *Config) Setup() error {
    if fc.RegionId == 0 {
        fc.Region = Asia
    } else if fc.RegionId == 1 {
        fc.Region = Europe
    } else if fc.RegionId == 2 {
        fc.Region = America
    } else if fc.RegionId == 3 {
        fc.Region = Else
    } else {
        return errors.New("invalid region")
    }
    return nil
}

_ = os.Setenv("REGION", "2")

myConfig := Config{}
f := feeder.Env{}

err := config.New().AddFeeder(f).AddStruct(&myConfig).Feed()

fmt.Println(c.Region) // America (2)
```

### Re-feed
You can re-feed the structs every time you need to.
Just call the `Feed()` method again.

```go
c := config.New().AddFeeder(feeder).AddStruct(&myConfig)
err := c.Feed()

// Is it time to re-feed?
err = c.Feed()

// Use `myConfig` with updated data!
```

### Listener
One of the GoLobby Config features is the ability to update the configuration structs without redeployment.
It takes advantage of OS signals to handle this requirement.
Config instances listen to the "SIGHUP" operating system signal and refresh structs (call the `Feed()` method).

To enable the listener for a Config instance, you should call the `SetupListener()` method.
It gets a fallback function and calls it when the `Feed()` method fails and returns an error.

```go
c := config.New().AddFeeder(feeder).AddStruct(&myConfig)
c.SetupListener(func(err error) {
    fmt.Println(err)
})

err := c.Feed()
```

You can send the `SIGHUP` signal to your running application with the following shell command.

```shell script
KILL -SIGHUP [YOUR-APP-PROCESS-ID]
```

You can get your application process ID using the `ps` command.

## See Also
* [GoLobby/DotEnv](https://github.com/golobby/dotenv):
  A lightweight package for loading dot env (.env) files into structs for Go projects
* [GoLobby/Env](https://github.com/golobby/env):
  A lightweight package for loading OS environment variables into structs for Go projects
* [GoLobby/Container](https://github.com/golobby/container):
  A lightweight yet powerful IoC dependency injection container for Go projects

## License
GoLobby Config is released under the [MIT License](http://opensource.org/licenses/mit-license.php).

repository: golobby/config

gha_language: Go

gha_license_id: MIT

repo_name: golobby/config


text:
# eucalypt

**eucalypt** is a tool, and a little language, for generating and
transforming structured data formats like YAML, JSON and TOML.

If you use text-based templating to process these formats or you pipe
this these formats through several different tools or build steps,
eucalypt might be able to help you generate your output more cleanly
and with fewer cognitive somersaults.

**eucalypt** is a purely functional language that can be used quickly and
easily from the command line.

It has the following features:

  - a concise native syntax that allows you to define data, functions,
	and operators
  - a simple embedding into YAML files to support in-place
	manipulation of the data (a la templating)
  - facilities for manipulating blocks (think JSON objects, YAML
	mappings)
  - facilities for manipulating text including string interpolation
	and regular expressions
  - an ergonomic command line interface and access to environment
	variables
  - metadata annotations and numerous extension points
  - a *prelude* of built in functions, acting like a standard library

It can currently read YAML, JSON, TOML, XML, CSV and plain text and
eucalypt's own ("eu") syntax and it can export YAML, JSON, TOML or
plain text.

!!! warning

	eucalypt is still in an early phase of development and subject to
	change.

## A lightning tour

Eucalypt has a native [syntax](syntax.md) for writing blocks,
lists and expressions. The YAML embedding consists of a few YAML tags
used to embed eucalypt expression in YAML so a basic understanding of
the native syntax is helpful.

A few micro-examples should help give a flavour of eucalypt's
native syntax. If you want to follow along, see [Getting
Started](getting-started.md) for notes on installation.

### Example 1

Here is a simple one:

```eu
target-zones: ["a", "b", "c"] map("eu-west-1{}")
```

You can put this in a file named `test.eu` and run it with just:

```shell
eu test.eu
```

This outputs the following YAML:

```yaml
target-zones:
  - eu-west-1a
  - eu-west-1b
  - eu-west-1c
```

As an aside, although we're looking at the native eucalypt syntax
here, this example could just as easily be embedded directly in a YAML
file using the `!eu` tag. Pop the following in a `test.yaml` file and
process it with: `eu test.yaml`. You'll get the same result.

```yaml
target-zones: !eu ["a", "b", "c"] map("eu-west-1{}")
```

First, this example illustrates how we apply transformations like
`map` simply by concatenation. This "pipelining" or "catenation" is
the natural way to apply transformations to values in eucalypt.

In fact this is simply a function call with the arguments rearranged a
bit. In this example, `map` is a function of two parameters. Its first
argument is provided in parentheses and its second argument is the
value of what came before.

!!! note

	Users of languages like Elixir or OCaml may recognise an implicit
	`|>` operator here. Clojure users may see an invisible threading
	macro. Note that writing elements next to each other like this gives
	you the _reverse_ of what you might expect in Haskell or OCaml or
	Lisp: we write `x f` *not* `f x`.

There is a lot of freedom in eucalypt to express ideas in different
ways and develop colorful and cryptic expressions. In a larger or
more ambitious language this could be viewed as rope to hang yourself
with. Please be careful.

The string template, `"eu-west-1{}"`, actually defines a function of
one argument that returns a string. The key ingredients here are:

- the interpolation syntax `"{...}"` which allows values to be inserted
into the string
- the (hidden) use of numeric *anaphora* in the interpolation syntax
(`{0}`, `{1}`, `{2}`, ...) which cause the string to define a
function, not just sequence of characters
- the use of the *unnumbered anaphor* (`{}`) which is numbered
  automatically for us, so in this case, `{}` is a convenient synonym
  for `{0}` - the first argument

!!! note

	Anaphora crop up in various contexts in eucalypt and are generally
	preferable to the full generality of lambdas. If the idea is too
	complex to be expressed with anaphora, it should generally be
	explicitly named.

So:

```eu
a: 42 "The answer is {0}"
```

renders as

```yaml
a: The answer is 42
```

eucalypt also has *expression anaphora* and *block anaphora*

!!! note

	Users of Groovy or Kotlin may recognise an equivalent of the `it`
	parameter. Seasoned Lisp hackers are familiar with anaphoric macros.
	Clojure users will recognise the `%`, `%1`, `%2` forms from
	`#(...)` contexts. Unlike `%` repeated uses of unnumbered
	anaphora in eucalypt refer to different parameters. `"{}{}"` is a
	two-argument function which concatenates strings.

Back to:

```eu
target-zones: ["a", "b", "c"] map("eu-west-1{}")
```

The whole line is a **declaration**. Declarations come in several
types - this one is a **property declaration**. A **block** is written
as a sequence of declarations enclosed in braces. For example:

```eu
{
  w: "foo" # a string
  x: 3     # a whole number
  y: 22.2  # a floaty number
  z: true  # the truth
}
```

(The `#` character introduces a comment which is ignored.)

Unlike YAML, indentation is never significant.

Unlike JSON, commas are not needed to separate declarations. Instead,
the eucalypt parser determines the declarations mainly based on the
location of colons. You can write:

```eu
{ x: 1 increment negate y: 2 }
```

...and eucalypt knows it's two declarations.

If that's a bit too crazy for you, then feel free to insert the
commas. Eucalypt will accept them. Any of these are okay:

```eu
ok1: { a: 1 b: 2 c: 3 }
ok2: { a: 1, b: 2, c: 3 }
ok3: { a: 1, b: 2, c: 3, }
```

!!! note

	Unlike Clojure which makes commas optional by
	treating them as whitespace, Eucalypt demands that if you are
	going to put commas in, they have to be in the right place, at the
	end of declarations. So you can use them if you believe it makes
	things clearer but you are prevented from using them in ways which
	would misguide.

Our `target-zones` property declaration is at the **top level** so
need not be surrounded by braces. Nevertheless it is in a block: the
top level block, known as a **unit**, that is defined by the file that
contains it. You can imagine the braces to be there if you like.

As a final point on this example, it is probably worthwhile
documenting declarations. eucalypt offers an easy way to do that using
**declaration metadata** which we squeeze in between a leading
backtick and the declaration itself:

```eu
` "AZs to deploy alien widgets in"
target-zones: ["a", "b", "c"] map("eu-west-1{}")
```

In fact, all sorts of things can be wedged in there, but if a string
appears on its own, it is interpreted as documentation.

### Example 2

Let's look at another small example:

```eu
character(name): {
  resource-name: name
  created: io.epoch-time
}

prentice: character("Pirate Prentice") {
  laser-colour: "red"
}

slothrop: character("Tyrone Slothrop") {
  eye-count: 7
}
```

We've introduced a new type of declaration here of the form `f(x):`.
This is a **function declaration**.

Remember we saw a **property declaration** earlier. Eucalypt also has
**operator declarations** but we'll ignore those for now.

The function declaration declares a function called `character`, which
accepts a single parameter (`name`) and returns a block containing two
properties.

Functions, like everything else in eucalypt, are declared in and live
in blocks but they are left out when output is rendered, so you won't
see them in the YAML or JSON that eucalypt produces.

The braces in the definition of `character` are there to delimit the
resulting block - *not* to define a function body. A function that
returned a number would not need them:

```eu
inc(x): x + 1 # this defines an increment function
```

The next important ingredient in this example is *block catenation*.

Blocks can be treated as functions of a single parameter. When they
are applied as functions, the effect is a *block merge*.

We've already seen that functions can be applied to arguments by
concatenation.

So writing one block after another produces a merged block. It
contains the contents of the second block merged "on top" of the
first.

There is more to be said on block merge, but for now:

`{ a: 1 } { b: 2 }` evaluates to `{ a: 1 b: 2 }`.

and

`{ a: 1 } { a: 2 }` evaluates to `{ a: 2 }`.

In our example, the resulting YAML is just:

```yaml
prentice:
  resource-name: Pirate Prentice
  created:<PHONE_NUMBER>
  laser-colour: red

slothrop:
  resource-name: Tyrone Slothrop
  created:<PHONE_NUMBER>
  eye-count: 7
```

As you can see, `io.epoch-time` evaluates to a unix timestamp.

This metadata is generated once at launch time, *not* each time the
expression is evaluated. eucalypt the language is a pure functional
language, and there are no side-effects or non-deterministic functions
(although its command line driver can perform all sorts of
side-effects as input to the evaluation and as output from the
evaluation and there are one or two dirty tricks in the debugging
functions). For this reason, `prentice` and `slothrop` will have the
same timestamps.

Block merge can be a useful means of generating common content in
objects. The common content can appear first as in this case, allowing
it to be overridden. Or it couple be applied second allowing it to
override the existing detail. Or a mixture of both. Many more
sophisticated means of combining block data are available too.

!!! note

	This merge is similar to the effect of *merge keys* in YAML, where a
	special `<<` mapping key causes a similar merge to occur. Not all
	YAML processors support this and nor does eucalypt at present, but
	it probably will some day.

Be aware that eucalypt has nothing like virtual functions. The
functions in scope when an expression is created are the ones that are
applied. So if you redefine an `f` like this, in an overriding
block...

```eu
{ f(x): x+1 a: f(2) } { f(x): x-2 }
```

...the definition of `a` will not see it.

```yaml
a: 3
```

So block merge is only very loosely related to object oriented
inheritance. Also by default you only get a _shallow_ merge - deep
merges are provided in the standard prelude. It is possible that a
deep merge will become the default for block catenation in future.

Many more complicated ways of processing blocks are possible using
functions, block anaphora and standard prelude functions.

## Quick tour of the command line

On macOS you can install the `eu` command line tools using Homebrew
with:

```shell
brew install curvelogic/homebrew-tap/eucalypt
```

Check the version you are running with:

```shell
eu -v
```

`eu` is intended to be easy to use for common tasks and does its best
to allow you to say what you want succinctly. The intention is to be
easy to use in pipelines in combination with other tools like `jq`.

By default, it runs in ergonomic mode which will make a few
assumptions in order to allow you to be a little less explicit. It
also pulls in user-specific declarations from `~/.eucalypt`. For
repeatable builds and scripted usage, it is better to turn ergonomic
mode *off* using the `-B (--batch-mode)` switch.

The simplest usage is to specify a eucalypt file to evaluate and leave
the default render format (YAML) and output (standard out) alone.

```shell
> eu test.eu
```

`eu` with no arguments will generally be taken to specify that input
is coming from standard in. So the above is equivalent to:

```shell
> cat test.eu | eu
```

There is an `-x` switch to control output format explicitly (setting
"yaml", "json", "text", "csv" or "eu") but for the very common case of
requiring JSON output there is a shortcut:

```shell
> eu test.eu -j
```

You can, of course, redirect standard output to a file but if you
specify the output file explicitly (with `-o`), `eu` will infer the
output format from the extension:

```shell
> eu test.eu -o output.json # equivalent to eu test.eu -j > output.json
```

Small snippets of eucalypt can be passed in directly using the `-e`
switch.

```shell
> eu -e '{ a: 8 * 8 }'
```

The fact that eucalypt makes relatively infrequent use of single
quotes makes this straightforward for most shells.

By default, `eu` evaluates the entirety of the loaded source and uses
all of it to render the result, leaving out any function values and
other non-renderable content.

It is possible to select just parts of the eucalypt for rendering:

  1. A declaration in the source may be identified as the **main**
	 target using the `:main` declaration metadata and we become the
	 part rendered by default.
  2. **targets** may be defined and named using the `:target`
	 declaration metadata and those targets can then be specified
	 using the `-t` option to `eu`
  3. The `-e` option can be used in addition to other
	 source file(s) to identify an expression to be rendered (e.g. `eu
	 test.eu -e x.y.z`)

So `eu`'s ability to read JSON and YAML natively combined with the
last options give a simple way to pick values out of structured data
which can be very handy for "querying" services that return YAML or
JSON data.

```shell
> aws s3api list-buckets | eu -e 'Buckets map(lookup(:Name))'
```

There is much more to this story. For instance `eu` can:

- accept several inputs to make definitions in earlier inputs
  available to subsequent inputs `eu test1.eu test2.eu test3.eu`
- accept YAML and JSON files as pure data to be merged in: `eu
  data.yaml tools.eu`
- accept YAML or JSON annotated with eucalypt to execute: `eu
  data.yaml`
- override the default extensions: `eu<EMAIL_ADDRESS>- automatically use `Eufile` files in the current folder hierarchy

See [command line](command-line.md) for more complete documentation.

repository: curvelogic/eucalypt

gha_language: Rust

repo_name: curvelogic/eucalypt


text:
## PROJECT NAME

- ONE MINUTE PITCH

## AUTHOR'S NAME

- KEBASO STEVE ONGATI

## PROJECT DESCRIPTION

- This is a web based pitching application that displays a list of piches posted by a user who has loged in,they will be able to click on a    certain pitch to delte it or update it | Behavior| input | output | | -------- | -------- | -------- | | Display pitches | On page load |    Show various pitches posted by different users is displayed | | Display pitches from other users | Click on a pitch | Redirect to a page     where you can access the pitch you have just clicked on |

## Getting started

- Clone repository to your computer
- Install python
- Create virtual environment
- Go to Newsapi and get Api

## BDD

- In our pitch you can create an account and then sign up.You can also post pitches that you want whether its the product,interview or the     promotion part.

## TECHNOLOGY USED

- You Require to install

* Python3.6

* Flask

* Pip

* Virtual environment

## PROJECT GITHUB LIVE LINK

- https://steve-pitch.herokuapp.com/

## Contacts info

*<EMAIL_ADDRESS>* Github: kebasoh

## LICENSE

- This software license under MIT License
- Copyright (c) KEBASO STEVE ONGATI 2020

repository: Kebasoh/one-minute-pitch

gha_language: Python

repo_name: Kebasoh/one-minute-pitch


text:
## Virtual Environments
Install:
```
pip install virtualenv
```

Create a virtual environment for a project:
```
cd {project_name}
virtualenv {venv name}
```

Activate the virtual environment
```
source venv/bin/activate
```

Deactivate the virtual environment
```
deactivate
```


text:
# 13. Import raw sequence file

## Background/Motivationn

A user wants to import a raw sequence file.

## Actors
Lab technician

## Preconditions
- Have a sequence file in ab1 format

## Course of events
1. The user selects and uploads the raw sequence file
1. The user links the raw sequence file to the Sequence Reaction

## Alternative paths
1. The administrator configures a predefined "pattern" for raw sequence file name
1. The administrator configures a folder where raw sequence files matching this pattern should be added
1. The system monitors the configured folder
1. For each new files, the system extract the information from the file name and automaticaly links the raw sequence to the Sequence Reaction.

## Success post-conditions

1. The raw sequence file is copied to the server filesystem
1. The raw sequence file is linked to the sequence reaction

## Notes

## Model treatment

repository: DINA-Web/dina-use-cases

repo_name: DINA-Web/dina-use-cases


text:
---
uid: customconstraints
---

# Custom Constraints

> [!NOTE]
> Page Under Development

You can implement your own custom constraints by creating a class that inherits from the `Constraint` abstract class, which supports performing a test on an actual value and generating appropriate messages.

## `Constraint` Abstract Class

Implementations must override the one abstract method `ApplyTo<TActual>` which
evaluates the previously stored expected value (if any) against the method's parameter, the actual value. There are also several virtual methods that may be overridden to change some default behaviors.

The relevant portions of the `Constraint` class are represented below.

```csharp
namespace NUnit.Framework.Constraints
{
    public abstract class Constraint
    {
        protected Constraint(params object[] args) {}
        public abstract ConstraintResult ApplyTo<TActual>(TActual actual);
        /* ... */
        public virtual ConstraintResult ApplyTo<TActual>(ActualValueDelegate<TActual> del) {}
        public virtual ConstraintResult ApplyTo<TActual>(ref TActual actual) {}
        protected virtual object GetTestObject<TActual>(ActualValueDelegate<TActual> del) {}
        public virtual string Description { get; protected set; }
        protected virtual string GetStringRepresentation() {}
    }
}
```

## `Constraint` Constructor

The `Constraint` constructor accepts zero or more arguments and saves them to be used
in the printed description later. Constraints like `NullConstraint` or `UniqueItemsConstraint`
take no arguments and simply state some condition about the actual value supplied. Constraints
with a single argument usually treat it as the expected value resulting from some operation.
Multiple arguments can be provided where the semantics of the constraint call for it.

## `ApplyTo` Implementation

The `ApplyTo<TActual>(TActual actual)` method must be overridden and provides for the
core implementation of the custom constraint. Whatever logic defines pass or fail
of the constraint and actual/expected values goes into the `ApplyTo<TActual>(TActual actual)`
method.

For example, a very naive implementation of a reference equality constraint might look
like this:

```csharp
public override ConstraintResult ApplyTo<TActual>(TActual actual)
{
    return new ConstraintResult(this, actual, ReferenceEquals(actual, Arguments[0]));
}
```

The key here is there needs to be some evaluation of the constraint logic, and the return value
must be a `ConstraintResult` or subclass thereof. Custom subclasses of `ConstraintResult` may
be used to further customize the message provided upon failure, as described below.

## `ApplyTo` Overloads

Constraints may be called with a delegate to return the actual value instead of the actual
value itself. This serves to delay evaluation of the value. The default implementation
of `ApplyTo<TActual>(ActualValueDelegate<TActual> del)` waits for the delegate to
complete if it's an async operation, other immediately calls the delegate if synchronous, and then calls the abstract `ApplyTo<TActual>(TActual actual)` method with the value.

Another overload also exists, `ApplyTo<TActual>(ref TActual actual)`. The default implementation
dereferences the value and then calls the abstract `ApplyTo<TActual>(TActual actual)` method with the value. This public virtual method is available by use from calling code but currently is not used from any framework calls within NUnit itself.

## `GetTestObject` Optional Override

The default implementation of `ApplyTo<TActual>(ActualValueDelegate<TActual> del)` does not
simply execute the delegate but actually calls out to another virtual method, `GetTestObject<TActual>(ActualValueDelegate<TActual> del)`. This method can be overridden to keep the default behavior of `ApplyTo<TActual>(ActualValueDelegate<TActual> del)` while still customizing how the actual value delegate is invoked.

## `Description` Property

This virtual property is used to provide a description of the constraint for messages. Simple
constant values can be set in the custom constraint's constructor. If more complex logic is
needed, override the property and provide a custom implementation of `get`.

Here are a few simple examples from built-in constraints.

```csharp
public class FalseConstraint : Constraint
{
    public FalseConstraint()
    {
        this.Description = "False";
    }
}

public class NullConstraint : Constraint
{
    public NullConstraint()
    {
        this.Description = "null";
    }
}
```

Here are a few complex examples from built-in constraints.

```csharp
public class AndConstraint : BinaryConstraint
{
    public override string Description
    {
        get { return Left.Description + " and " + Right.Description; }
    }
}

public abstract class PrefixConstraint : Constraint
{
    public override string Description
    {
        get
        {
            return string.Format(
                baseConstraint is EqualConstraint ? "{0} equal to {1}" : "{0} {1}",
                descriptionPrefix,
                baseConstraint.Description);
        }
    }
}
```

## `GetStringRepresentation` Method

NUnit calls the `GetStringRepresentation` method to return a string representation of the
constraint, including the expected value(s). The default implementation returns the lowercase
display name of the constraint followed by all expected values, separated by a space.

For example, a custom constraint `ReferenceEqualsConstraint` with an instance of a custom
`MyObject` class as expected value would result in a default string representation of `<referenceequals MyObject>`.

You can override the initial display name only by setting `DisplayName` in your constructor.
This public property cannot be overridden, but the `Constraint` base class sets it in the base constructor to be the name of the class, minus the "Constraint" suffix and minus any generic suffixes.

## Custom Constraint Usage Syntax

Having written a custom constraint class, you can use it directly through its constructor:

```csharp
Assert.That(myObject, new CustomConstraint());
```

You may also use it in expressions through NUnit's `Matches` syntax element:

```csharp
Assert.That(myObject, Is.Not.Null.And.Matches(new CustomConstraint());
```

The direct construction approach is not very convenient or easy to read.
For its built-in constraints, NUnit includes classes that implement a special constraint syntax, allowing you to write things like...

```csharp
Assert.That(actual, Is.All.InRange(1, 100));
```

Custom constraints can support this syntax by providing a static helper class and
extension method on `ConstraintExpression`, such as this.

```csharp
public static class CustomConstraintExtensions
{
    public static ContentsEqualConstraint ContentsEqual(this ConstraintExpression expression, object expected)
    {
        var constraint = new ContentsEqualConstraint(expected);
        expression.Append(constraint);
        return constraint;
    }
}
```

To fully utilize your custom constraint the same way built-in constraints are used, you'll
need to implement two additional classes (which can cover all your constraints, not
for each custom constraint).

* Provide a static class patterned after NUnit's `Is` class, with properties
   or methods that construct your custom constructor. If you like, you can even call it
   `Is` and extend NUnit's `Is`, provided you place it in your own namespace and avoid any conflicts. This allows you to write things like:

```csharp
Assert.That(actual, Is.Custom(x, y));
```

   with this sample implementation:

```csharp
public class Is : NUnit.Framework.Is
{
    public static CustomConstraint Custom(object expected)
    {
        return new CustomConstraint(expected);
    }
}
```

* Provide an extension method for NUnit's `ConstraintExpression`, allowing
   you to write things like:

```csharp
Assert.That(actual, Is.Not.Custom(x, y));
```

with this sample implementation:

```csharp
public static class CustomConstraintExtensions
{
    public static CustomConstraint Custom(this ConstraintExpression expression, object expected)
    {
        var constraint = new CustomConstraint(expected);
        expression.Append(constraint);
        return constraint;
    }
}
```

license: MIT,zlib-acknowledgement

repository: nunit/docs

detected_licenses: MIT zlib-acknowledgement

gha_language: PowerShell

repo_name: nunit/docs


text:
---
title: uPort Identity Contracts
index: 7
category: "reference"
type: "content"
---

## Contract Deployments
### Mainnet (id: 1)
|Contract|Address|
| --|--|
|IdentityManager|[0x22a4d688748845e9d5d7394a0f05bc583adf4656](https://etherscan.io/address/0x22a4d688748845e9d5d7394a0f05bc583adf4656)|
|TxRelay|[0xec2642cd5a47fd5cca2a8a280c3b5f88828aa578](https://etherscan.io/address/0xec2642cd5a47fd5cca2a8a280c3b5f88828aa578)|
|MetaIdentityManager|[0x27500ae27b6b6ad7de7d64b1def90f3e6e7ced47](https://etherscan.io/address/0x27500ae27b6b6ad7de7d64b1def90f3e6e7ced47)|

### Rinkeby testnet (id: 4)
|Contract|Address|
| --|--|
|IdentityManager|[0x19aece3ae41ee33c30f331906b7e4bb578946a55](https://rinkeby.etherscan.io/address/0x19aece3ae41ee33c30f331906b7e4bb578946a55)|
|TxRelay|[0xda8c6dce9e9a85e6f9df7b09b2354da44cb48331](https://rinkeby.etherscan.io/address/0xda8c6dce9e9a85e6f9df7b09b2354da44cb48331)|
|MetaIdentityManager|[0x87ea811785c4bd30fc104c2543cf8ed90f7eeec7](https://rinkeby.etherscan.io/address/0x87ea811785c4bd30fc104c2543cf8ed90f7eeec7)|

### Kovan testnet (id: 42)
|Contract|Address|
| --|--|
|IdentityManager|[0xdb55d40684e7dc04655a9789937214b493a2c2c6](https://kovan.etherscan.io/address/0xdb55d40684e7dc04655a9789937214b493a2c2c6)|
|TxRelay|[0xa9235151d3afa7912e9091ab76a36cbabe219a0c](https://kovan.etherscan.io/address/0xa9235151d3afa7912e9091ab76a36cbabe219a0c)|
|MetaIdentityManager|[0x737f53c0cebf0acd1ea591685351b2a8580702a5](https://kovan.etherscan.io/address/0x737f53c0cebf0acd1ea591685351b2a8580702a5)|

### Ropsten testnet (id: 3)
|Contract|Address|
| --|--|
|IdentityManager|[0x27500ae27b6b6ad7de7d64b1def90f3e6e7ced47](https://ropsten.etherscan.io/address/0x27500ae27b6b6ad7de7d64b1def90f3e6e7ced47)|
|TxRelay|[0xa5e04cf2942868f5a66b9f7db790b8ab662039d5](https://ropsten.etherscan.io/address/0xa5e04cf2942868f5a66b9f7db790b8ab662039d5)|
|MetaIdentityManager|[0xbdaf396ce9b9b9c42cd40d37e01b5dbd535cc960](https://ropsten.etherscan.io/address/0xbdaf396ce9b9b9c42cd40d37e01b5dbd535cc960)|

## Using the contracts
To use the contract we provide truffle artifacts. Once you require the `uport-identity` module you will get an object containing a versioned index of the uport contracts. You can specify which version you want to user, or just use the latest one. Keep in mind that different versions will be deployed to different addresses.
```javascript
const uportIdentity = require('uport-identity')
const Contract = require('truffle-contract')

// use specific version
const IdentityManagerArtifact = uportIdentity.IdentityManager.v1

// or use latest version
const version = uportIdentity.IdentityManager.latestVersion
const IdentityManagerArtifact = uportIdentity.IdentityManager[version]
```

 You can use `truffle-contract` to utilize these artifacts.
```javascript
let IdentityManager = Contract(IdentityManagerArtifact)
IdentityManager.setProvider(web3.currentProvider)
let identityManager = IdentityManager.deployed()
```
You can also use web3.
```javascript
let networkId = 1 // Mainnet
let IdentityManager = web3.eth.contract(IdentityManagerArtifact)
let identityManager = IdentityManager.at(IdentityManagerArtifact.networks[networkId].address)
```

If you want to learn more about this structure, checkout the document about the [artifact index](./docs/artifact-index.md).

## Testing the contracts
All aspects of the contracts need to be tested. To do this we use `truffle` and `testrpc` behind the scenes. Right now we only have tests written in javascript, but in the future we plan on adding tests written in solidity as well.

To execute the tests you simply run:
```
$ yarn test
```

If you want to run run a specific test you can just add the filename:
```
$ yarn test test/testName.js
```

You can also run the tests on a [geth node](./docs/reference/private-geth-testing.md).

## Contract documentation
This repository contains the contracts currently in use by uPort. This is also where you find the addresses of these contracts currently deployed on Mainnet and relevant test networks. Below you can find descriptions of each of the contracts and the rationale behind the design decisions.

#### [Proxy](./docs/reference/proxy.md)
#### [TxRelay](./docs/reference/txRelay.md)
#### [IdentityManager](./docs/reference/identityManager.md)
#### [MetaIdentityManager](./docs/reference/metaIdentityManager.md)

### Main contract interactions
The most important interactions with the contracts are creation of identities and sending transactions. Here are visual representations of this being executed.

#### Creating an identity with the IdentityManager
![identity creation](./docs/diagrams/create-identity.seq.png)

#### Transfer an identity to IdentityManager
![register identity](./docs/diagrams/register-identity.seq.png)

#### Send a meta-tx
![meta-tx](./docs/diagrams/send-tx.seq.png)

## Deploying contracts to a private network
Add a new entry in `./truffle.js` like so:
```js
yourNetwork: {
  get provider() {
    return getProvider("http://my-private.network/")
  },
  network_id: "*"
},
```
If the gas price on the network is very high you might need to add the `gasPrice` parameter.

Create a file called `./seed`. This file should contain a mnemonic seed phrase. Make sure that the first address of this seed has ether on your private network. Then run:
```
$ yarn _deploy yourNetwork
```

The addresses of the deployed contracts should then be located in `./build/contracts/{ContractName}.json`.

repository: uport-project/uport-identity

branch_name: refs/heads/develop

repo_name: uport-project/uport-identity


text:
<!-- #   Copyright 2020 Canonical Ltd.
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#       http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License. -->

# NG-UI Charm

## How to deploy

```bash
juju deploy . # cs:~charmed-osm/ng-ui --channel edge
juju relate ng-ui nbi
```

## How to expose the NG-UI through ingress

```bash
juju config ng-ui site_url=ng.<k8s_worker_ip>.xip.io
juju expose ng-ui
```

> Note: The <k8s_worker_ip> is the IP of the K8s worker node. With microk8s, you can see the IP with `microk8s.config`. It is usually the IP of your host machine.

## How to scale

```bash
    juju scale-application ng-ui 3
```

## Config Examples

```bash
juju config ng-ui image=opensourcemano/ng-ui:<tag>
juju config ng-ui port=80
juju config server_name=<name>
juju config max_file_size=25
```

branch_name: refs/heads/main


text:
---
layout: library
title: Concurrency
tags: [library]
library-type: library
brief: This library provides high level abstractions for implementing algorithms that eases the use of multiple CPU cores while minimizing the contention.
description: |
    The future implementation differs in several aspects compared to the C++11/14/17 standard futures:
    It provides continuations and joins, which were just added in a C++17 TS. But more important this futures propagate values through the graph and not futures. This allows an easy way of creating splits. That means a single future can have multiple continuations into different directions.

    An other important difference is that the futures support cancellation. So if one is not anymore interested in the result of a future, then one can destroy the future without the need to wait until the future is fulfilled, as it is the case with `std::future` (and `boost::future`). An already started future will run until its end, but will not trigger any continuation. So in all these cases, all chained continuations will never be triggered. Additionally the future interface is designed in a way, that one can use build in or custom build executors.
    This implies too, that the user has to take more care, that all references used inside the task associated with the future must either exist, or their meanwhile absence must be taken into account. (One appropriate mechanism here are weak and shared pointer.)

    Since one can create with futures only graphs for single use, this library provides as well channels. With these channels one can build graphs, that can be used for multiple invocations.
---

### Requirements

* C++17 compliant compiler (clang, gcc 7, Visual Studio 2017)
* boost 1.60.0 (optional, variant, if they are not available from the compiler and test for executing the UnitTests)

### Authors
Sean Parent, Foster Brereton, Felix Petriconi and other contributors.

{% include example_table.html %}

repository: stlab/libraries

repo_name: stlab/libraries


text:
---
layout: post
title: "Smoke (2018) ErosNow webseries"
description: "Set in Goa, Smoke explores the dark web of drugs, mafia, and power. With the cartels at war, who will survive? "
tags:  eros-now thriller
disqus: true
---

![Poster]({{ "/assets/series/eros-now/smoke/smoke.jpeg" | relative_url}})

## Details

* **Name:** Smoke
* **Quality:** 360p \| 720p
* **Language:** Hindi
* **IMDB:** 8.8/10(7,150)
* **Genres:** Thriller

## Storyline

Set in Goa, Smoke explores the dark web of drugs, mafia, and power. With the cartels at war, who will survive?

## Episode 1-4

Watch Now

## Episode 5-8

Watch Now

## Episode 8-12

Watch Now

If you want to request any type of content please go to [Request content]({{"/request" | relative_url}}) page, we will provide that as soon as possible.

repository: admin-blogs/hackersjugad

repo_name: admin-blogs/hackersjugad


text:
# OneOps

OneOps is a multi-cloud Platform as a Service tool sponsored by
WalmartLabs. Find out more at [http://oneops.com](http://oneops.com).

This repository contains the main codebase for all components.

## Building

First clone the repo then navigate to the main project directory and run install.sh.

repository: abhitekula/oneops

gha_language: Java

repo_name: abhitekula/oneops


text:
Privacy-Preserving Deep Learning via Additively Homomorphic Encryption
=======================================================================

Implementation of the article in python.

Notes:
------

- This code implements LWE method as in the article.

Contributors:
-------------

- 11 11 (@arf1372)
- A-Hashemi (@A-Hashemi)


text:
AndroidMvvm
===============
Explore an Android app that:

* Has (almost) no business logic in the Activity / Fragment.
* Has fully unit testable ViewModels, including rotation (sorry Espresso).
* Uses Android Data Binding.
* Has minimum Espresso testing, solely to verify the bindings.

Original blog post: https://medium.com/@hiBrianLee/writing-testable-android-mvvm-app-prelude-e49f7e6223

Sample App
=============
### Main Screen

![Main Screen](../screenshots/screenshots/main_screen.png?raw=true)

**Button Clicks**
Goes to the Click Count screen.

**RecyclerView**
Goes to the Android Versions screen.

**@hiBrianLee**
Goes to https://twitter.com/hiBrianLee

### Click Count

![Click Count](../screenshots/screenshots/click_count.png?raw=true)

**Click count: 0**
Shows the total number of clicks

**Click**
Increments the number of clicks.

**@hiBrianLee**
Goes to https://twitter.com/hiBrianLee

### Android Versions

![Android Versions](../screenshots/screenshots/android_versions.png?raw=true)

Lists the different Android versions in a RecyclerView. Clicking on an item will highlight it.

**@hiBrianLee**
Goes to https://twitter.com/hiBrianLee

License
=======
    Copyright (c) 2015 Brian Lee (@hiBrianLee)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

repository: rezkyauliapratama/android-mvvm-fork

repo_name: rezkyauliapratama/android-mvvm-fork


text:
# Overview

This charm will manage a individual custom config file for logstash.
This will allow you to use the logstash charm with custom configurations.

# Usage

juju deploy logstash-conf-d logstash-output-file

juju add-relation logstash logstash-output-file

juju config logstash-output-file config="output { fiele { path=> '/var/log/myfile '}}"

This will result in a config file named /etc/logstash/conf.d/logstash-output-file.conf

# Configuration

The content of the 'config' field is directly written in the config file.
No templating or syntax check is performed. It must be a valid logstash configuration.

https://github.com/tbaumann/charm-logstash-conf-d

repository: tbaumann/charm-logstash-conf-d

repo_name: tbaumann/charm-logstash-conf-d


text:
## Tree node data

Anvil will use the data contained in the this folder to create AM Auth Tree nodes.

Given the example directory structure:

    dependednt  -> typeA -> node1
    independent -> typeB -> node2
                       -> node3
                -> typeC -> node4

Anvil will load `node1` of `typeA`, `node2` and `node3` of `typeB`
and `node4` of `typeC`.
Independent nodes are loaded before dependent nodes (for example, `node1` would be loaded last)

When a tree node is created:

    * the type is taken from directory name
    * the name is taken from the json file name
    * the configuration is taken from the contents of the JSON file.
    This is equivalent to the data sent with the REST request to create a tree node.

To convert a test node from a sample curl\REST request (e.g. as observed in the admin UI):

        curl -s -X PUT \
            -H "Content-Type: application/json" \
            -H "Accept-API-Version: resource=1.0, protocol=2.0" \
            -H "iPlanetDirectoryPro: ${token}" \
            -d '{"_id":"27e6dc74-3385-4145-9d71-dfc33976f3d6"}' \
            ${base_url}/nodes/UsernameCollectorNode/27e6dc74-3385-4145-9d71-dfc33976f3d6

create the json file:

    mkdir -p independent/UsernameCollectorNode
    echo '{"_id":"27e6dc74-3385-4145-9d71-dfc33976f3d6"}` \
        > ./independent/UsernameCollectorNode/27e6dc74-3385-4145-9d71-dfc33976f3d6.json

repository: JacoJooste/iot-edge

repo_name: JacoJooste/iot-edge


text:
# Eat da Burger

## I created a project with MySQL, Node, Express and a homemade ORM to simulate making and eating a burger 🍔. With the MVC design pattern; using Node and MySQL to query and route data in the application.

## Table of Contents
    * [email](#email)
    * [username](#username)
    * [description](#Description)
    * [instructions](#instructions)
    * [Usage](#usage)
    * [guidelines](#guidelines)
    * [installation](#installation)
    * [questions](#questions)
    * [license](#license)

## Instructions
  You use it from the heroku server url https://murmuring-scrubland-65680.herokuapp.com/ or from the node express server.

## Usage

## Guidelines
  It will simulate making a burger which you will name it and submit on the input form then you can hit the devour button eat it

## Questions
If you have any Questions reach out to me at<EMAIL_ADDRESS>My github username is griffinjoshs

## License
  Apache

## Additional


text:
# Zebi Scaper

This is the repository made with my go temple gogoleplate.

## Todo

- [ ] Instagram followers scraping
- [ ] Send rapport by email

## Requirements

To run this project you'll need to have docker and yarn installed on your machine.
If you want to develop on this project it's recommended to have `golang` installed on your machine.

## Project setup

First you need to created your `.env` file (you can use the .env.dist file).

```sh
  make init
```
After your first init, you can run the project with :

```sh
  make start
```

For stop :
```sh
  make stop
```
### RSA keys (needed to generate and read tokens)

You will need 2 files placed at the root of your project : `public.pem` and `private.pem`.

```sh
    # use the following password: private_key
    openssl genrsa -des3 -out private.pem 2048
    openssl rsa -in private.pem -outform PEM -pubout -out public.pem
```
# Commit naming conventions

If you want to contribute to the project you'll need to name your commits according to the following convention :

    type(action): description.

The following types are available :

-   **feat** : Feature commit.
-   **fix** : Fixing a bug.
-   **update** : Updating code or dependencies.
-   **revert** : Removing changes.
-   **doc** : Add changes to the documentation.
-   **refacto** : Refactoring code.
-   **build** : Modifications linked to the infrastructure.
-   **param** : Modifications on the config.

## Branch naming convention

The branch should have a name that reflects it's purpose.

The convention is to prefix the branch name with `feature-`. All the words must be separated by a `-`.

Branch name example : `feature-user-authentication`

## Routes

the available routes are the following :

| route                       | method | description                       | params          | response                |
| --------------------------- | ------ | --------------------------------- | --------------- | ----------------------- |
| `/hello`                    | GET    | check if the api is available     | none            | `Hello world!`          |

repository: jasongauvin/zebi-scraper

repo_name: jasongauvin/zebi-scraper


text:
+++
# Display name
#name = "Skene Lab"
#name = "Nathan Skene"
name = "UK DRI Genomics lab"

# Username (this should match the folder name)
authors = ["admin"]

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

# Role/position
role = "Neurogenomics"

# Organizations/Affiliations
#   Separate multiple entries with a comma, using the form: `[ {name="Org1", url=""}, {name="Org2", url=""} ]`.
organizations = [ { name = "UK Dementia Research Institute", url = "https://ukdri.ac.uk/" },
  { name = "Imperial College", url = "https://www.imperial.ac.uk/dementia-research-institute/" },
  { name = "Department of Brain Sciences", url = "https://www.imperial.ac.uk/brain-sciences" }]

# Short bio (displayed in user profile at end of posts)
bio = "Our research interests include human genetics, single cell -omics and neurobiology."

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

# List (academic) interests or hobbies
#interests = [
#    "Neurobiology",
#    "Human Genetics",
#    "Psychiatric Disorders",
#    "Transcriptomics",
#    "Bioinformatics"
#  ]

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

# List qualifications (such as academic degrees)
#[[education.courses]]
#  course = "PhD in Molecular Biology"
#  institution = "Wellcome Trust Sanger Institute, University of Cambridge"
#  year = 2014
#
#[[education.courses]]
#  course = "MPhil in Computational Biology"
#  institution = "University of Cambridge"
#  year = 2009
#
#[[education.courses]]
#  course = "BSc in Artificial Intelligence and Cybernetics"
#  institution = "University of Reading"
#  year = 2008

# Social/Academic Networking
# For available icons, see: https://sourcethemes.com/academic/docs/widgets/#icons
#   For an email link, use "fas" icon pack, "envelope" icon, and a link in the
#   form<EMAIL_ADDRESS>or "#contact" for contact widget.

[[social]]
  icon = "envelope"
  icon_pack = "fas"
  link =<EMAIL_ADDRESS># For a direct email link, use<EMAIL_ADDRESS>
[[social]]
  icon = "twitter"
  icon_pack = "fab"
  link = "https://twitter.com/n_skene"

[[social]]
  icon = "google-scholar"
  icon_pack = "ai"
  link = "https://scholar.google.co.uk/citations?user=nu6vg78AAAAJ&hl=en&oi=ao"

[[social]]
  icon = "github"
  icon_pack = "fab"
  link = "https://github.com/neurogenomics"

# Link to a PDF of your resume/CV from the About widget.
# To enable, copy your resume/CV to `static/files/cv.pdf` and uncomment the lines below.
# [[social]]
#   icon = "cv"
#   icon_pack = "ai"
#   link = "files/cv.pdf"

+++

My research focuses on simple questions about complex brain traits: where do they occur (in which cell types)? When do they occur (at which developmental stages)? How do they occur (which quantitative traits of cells are affected)? We aim to develop the methods and datasets required to enable these questions to be answered systematically for any trait for which well-powered genetic data is available.

The most complete and unbiased data source currently available for the brain comes from single cell RNA-sequencing: an atlas of almost every cell type found in the central, peripheral and enteric nervous system is available. Using this dataset and other's like it we have investigated the cell types underlying Schizophrenia, Alzheimer's disease, Parkinsons, Stroke and cognitive ability. To get greater accuracy in interpreting genetic data we need to go beyond mouse single cell RNA-seq data though: we plan to obtain human cell atlases using ATAC-seq and other genomic techniques.

Using transcriptomic datasets mapping expression changes across the lifespan we have investigated why the onset of psychiatric diseases occurs in early adulthood (rather than in infancy, as would be expected for heavily genetic disorders). Currently this kind of data is only available for a small number of brain regions; we are looking to generate new datasets spanning the human lifespan for a range of disease relevant cell types.

Identifying the causal cell types and developmental stages will not in itself lead to cures though. To get closer to that we need to understand what changes occur on the affected cells. Our approach is based on the notion that the causal changes associated with disease will be quantitative traits, much like height or BMI, but the important changes will be on the cellular level for specific subtypes of cells (i.e. increased spine density in Reln/Ndnf+ cortical interneurons).  To identify these changes and link them to genetics we need higher throughput biological methods. Towards this end we are building on the work of collaborators to develop spatial transcriptomic techniques to enable simultaneous automated identification of all cell types found in tissue sections.

Looking for a postdoc, internship, masters or PhD? <a<EMAIL_ADDRESS>be great to hear from you!

Applications would be welcomed from both experimentalists and analysts. If you're background is not in biology but you're great at programming or mathematics then get in touch. Descriptions of potential projects will be put online soon: in the meanwhile, if this is what you want to work on then just get in touch.


text:
---
layout:     post
title:      "Raptor Mania at Jorbeed"
subtitle:   "Raptor Mania at Jorbeed"
author:     "Bharath Hegde"
tags:       ["Birding Destinations", "Bikaner", "Wildlife Destinations", "Raptors"]
seo:		["Birding Destinations", "Raptors"]
comments:   true
header-img: "img/2015-04-15/bikaner1.jpg"
---

I had heard that near Bikaner one can easily spot vultures. In Nov 2013, I had the chance to visit this place. What I saw there was actually beyond my imagination.

“Jorbeed”, around 12 KM drive from Bikaner is probably the largest dumping yard of carcass in Asia. The smell there is unbearable. However for a birder, this is a raptor paradise. I was overwhelmed by the sheer number of raptors at this place. “Steppe Eagles and Egyptian vultures are the crows of this place. They were present everywhere”.  When we reached the place, almost every tree was dotted by some raptor. We had a problem of plenty and it was “Raptor Mania”.

Here are some details that I could capture.

Jorbeed, a large dumping yard for carcass.

A Steppe Eagle as we were entering Jorbeed. Later we spotted a number of these.

A Steppe Eagle showing of its broad wings.

A colony of Griffon Vultures, Cinereous Vultures and an Egyptian Vulture. Compare the size of Cinereous vulture with Egyptian Vulture. Cinereous vultures were looking like bears from distance.

A colony of Griffon Vultures with a single juvenile Cinereous vulture.

A lonely Griffon Vulture on the tree.

A Griffon Vulture spreading its wings.

A Cinereous Vulture in the sky.

Raptor Camarderie at Jorbeed. A juvenile Steppe Eagle, Griffon and Egyptian Vulture

An Eastern Imperial Eagle juvenile with a Steppe Eagle juvenile

An Egyptian Vulture gorging on a carcass.

A Black-Eared Kite juvenile. Was really an odd man out in the mela of Steppes.

This is how we ended our day at Jorbeed. A couple of Eagles on the trees and a flock of Yellow-Eyed pigeons flying all around.

repository: bssrdev/wilderhood

extension: markdown

repo_name: bssrdev/wilderhood


text:
![GitHub Logo](images/sanity_logo_horizontal.png)

## install from TAR on a linux vps

setup instructions to install `sanitycore` on a vps running ubuntu v16.04 - 64bit

technical requirements:
- ubuntu 16, 64 bit
- 1 core
- 2 GB ram
- 20 GB diskspace

additional requirements for master-nodes:
- 1 dedicated IP

![GitHub Logo](images/splash.png)

### create new user `sanitycore`

*log into your vps, you need root access*

```bash
sudo adduser sanitycore
sudo usermod -aG sudo sanitycore
su - sanitycore
```

### vps security

*install firewall*
```bash
sudo apt-get -y install ufw
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh
sudo ufw limit ssh/tcp
sudo ufw allow 9999/tcp
sudo ufw logging on
sudo ufw enable
```

optional for RPC from outside: *sudo ufw allow 9998/tcp*

*install fail2ban*
```bash
sudo apt-get -y install fail2ban
sudo systemctl enable fail2ban
sudo systemctl start fail2ban
```

### download tar

```bash
wget https://github.com/sanatorium/sanity/releases/download/v<IP_ADDRESS>/sanitycore-1.12.2-linux64.tar.gz
```

### unpack binaries

```bash
tar xvzf sanitycore-1.12.2-linux64.tar.gz
rm ~/sanitycore-1.12.2-linux64.tar.gz
mkdir ~/.sanitycore
cp ~/sanitycore-1.12.2/bin/* ~/.sanitycore
rm -rf ~/sanitycore-1.12.2
```

### run headless wallet on vps

*start wallet deamon*
```bash
~/.sanitycore/sanityd -daemon
```

### make permanent / auto-restart on reboot

*add a cronjob*
```bash
crontab -e
```
>```bash
>@reboot sleep 15; /home/sanitycore/.sanitycore/sanityd -daemon
>```

*restart vps*
```bash
sudo reboot
```

*login as user `sanitycore` or switch to this user*
```bash
su - sanitycore
```

*check sanity wallet and wait for sync*
```bash
~/.sanitycore/sanity-cli getinfo
```

### in-wallet mining (only for non-masternodes)

*stop deamon*
```bash
~/.sanitycore/sanity-cli stop
```

*edit sanity.conf*
```bash
nano ~/.sanitycore/sanity.conf
```
>```bash
>gen=1
>```

*restart deamon*
```bash
~/.sanitycore/sanityd -daemon
```

repository: sanatorium/sanity

repo_name: sanatorium/sanity


text:
## Java Language Support

From version 0.0.32 we provide [Language Support for Java(TM) by Red Hat](https://marketplace.visualstudio.com/items?itemName=redhat.java) and [Debugger for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-debug) as dependencies.

With Language Support for Java, you will benefit from Java Language completion on standalone files. An invisible project is created with a default classpath.

The command `Refresh local Java classpath for Camel K standalone file based on the current editor. Available with kamel 1.4+.` refreshes specific dependencies for the classpath of the opened Integration, such as dependencies declared as part of the modeline of the file. When using a modeline to configure such dependencies, you gain a [CodeLens](https://code.visualstudio.com/blogs/2017/02/12/code-lens-roundup) link (`Refresh classpath dependencies`) at the top of the editor to trigger the refresh more easily.

Be aware of the following **limitations**:

- It requires Camel K 1.4.0
- If mistakenly called with Camel K 1.3.2-, need to restart VS Code for basic dependencies to be available again.
- It supports modeline dependencies notation from the local build. See [apache/camel-k#2213](https://github.com/apache/camel-k/issues/2213)
- A single classpath is provided. It means that the refresh command needs to be called when switching between Integration file written in Java that does not have the same dependencies.
- There is no progress indicator. Please be patient. The first time may take several minutes on a slow network.

Debugger for Java is provided to benefit from Java debug on standalone files. To leverage it, you need to start an integration, then there are 2 solutions:

- Right-click on integration in the Integrations view, then choose `Start Java debugger on Camel K integration`.
- Launch a `camel-k-debug` VS Code tasks and then to launch a `java` attach in debug VS Code tasks.

repository: camel-tooling/vscode-camelk

gha_language: TypeScript

repo_name: camel-tooling/vscode-camelk


text:
# Building these Docs Locally

Install these:

$ pip install sphinx sphinx-autobuild sphinx_rtd_theme

To run the server:

```
$ cd docs
$ ./server.bat
```

or

```
$ sphinx-autobuild . _build/html
```

Then visit http://localhost:8000 to see the docs.

repository: andymeneely/squib

branch_name: refs/heads/dev

gha_language: Ruby

repo_name: andymeneely/squib


text:
# Tips

## Interactive SVG graphs

When SVG graphs generated by Scabbard are opened in the browser, it is possible to navigate between `@Component` and `@Subcomponent` by simple clicking on the node as show below.
<br>
<video width="100%" controls>
  <source src="../video/svg_sample.mp4" type="video/mp4">
  Your browser does not support the video tag.
</video>

repository: ermolnik/scabbard

repo_name: ermolnik/scabbard


text:
# fastai_splunk
fastai_splunk extends the fastai library to let you import your Splunk data using the familiar fastai databunch/model/learner API. It is based on the fastai.tabular implementation but uses the [Splunk Python SDK](https://github.com/splunk/splunk-sdk-python) to get your data from Splunk under the hood. For the most part, just replace the Tabular prefix for every class with Splunk and this library should do what you need it to.

# PyPI Install
`pip install fastai_splunk`

# Importing the library
`from fastai.splunk import *`

# Creating a fastai Splunk DataBunch
SplunkList parameters (similar to [TabularList from fastai.tabular](https://docs.fast.ai/tabular.data.html#TabularList
)):

  `search_query`: Splunk SPL query you want to run

  `splunk_path`: Path to your Splunk directory

  `host`: Address of your Splunk instance

  `username`: Username for your Splunk login

  `password`: Password for your Splunk username

  `port`: Port your Splunk instance is running on

  (Optional) `cat_names`: String list containing column names of your categorical variables

  (Optional) `cont_names`: String list containing column names of your continuous variables

  (Optional) `procs`: [The same procs from the fastai.tabular implementation](https://docs.fast.ai/tabular.transform.html#TabularProc)

Sample usage:
```
data = SplunkList.from_splunk(search_query='search *',
         splunk_path='/Applications/Splunk',
         host='localhost',
         username='admin',
         password='password',
         port=8890,
         cat_names=['Branch', 'Payment', 'Product line'],
         cont_names=['Quantity', 'Total'],
         procs=[FillMissing, Categorify, Normalize])
      .split_by_idx(list(range(1,50)))
      .label_from_df(cols=dep_var)
      .databunch()
```

# Creating a SplunkLearner
This works the same way you [create a TabularLearner in fastai.](https://docs.fast.ai/tabular.learner.html)

Sample usage:
```
learn = splunk_learner(data, layers=[200,100], metrics=accuracy)
```

Big thanks to Jeremy Howard (jph00), Rachel Thomas (racheltho), and the other fastai contributors for such a great library!


text:
## Test: no code in code block, directive w/o indentation

<?code-excerpt "quote.md"?>
```
```

## Test: no code in code block, directive with indentation

<?code-excerpt "quote.md" indent-by="2"?>
```
```

## Test: out-of-date code in code block, directive with indentation

<?code-excerpt "quote.md" indent-by="2"?>
```
  we don't care what this text is since it will be replaced
misindented text that we don't care about
```

repository: dart-lang/site-shared

gha_language: Dart

repo_name: dart-lang/site-shared