text:
# wen

You're waiting for some arbitrary thing to load in your browser, or for something to happen, but that thing doesn't have an evented interface.

## Usage

```
var wen = require('wen');
var truth = wen();
var somePredicate; // Currently falsy

truth.on('the-thing-happened', function () {
	console.log('React to the thing that happened here!');
});

truth.add(function () {
	// At some point, some external force made somePredicate truthy
	return somePredicate;
}, 'the-thing-happened');
```

## Install

### NodeJS, Browserify, etc. (CommonJS)

```
npm install wen --save
```

### Good ol' fashioned Browser

Copy this into your HTML somewhere.

```
<script src="https://raw.githubusercontent.com/basicallydan/wen/master/dist/wen.1.0.1.min.js"></script>
<!-- If I want to do this properly I will download it and place it in my source code somewhere -->
```

Simple.

## How does it work?

Easy: you give it a predicate and some event name (whatever you want!), it checks every 1000ms (or less, or more, if you specify) if that predicate is truthy. When it finally is truthy, it'll trigger that event name. It extends an [Event Emitter](https://github.com/Wolfy87/EventEmitter), so in fact it will also have [all of the methods of the event emitter](https://github.com/Wolfy87/EventEmitter/blob/master/docs/api.md), such as `.once` and `.trigger`.

## Dependencies

There are only two direct dependencies. For the compiled `.min.js` version they are bundled so don't worry about it. They are:

* Wolfy87's Event Emitter, a lightweight event emitter which works well in browsers as well as in NodeJS.
  * ✓ Has no dependencies.
* vmattos's JS Extend, inspired by the Underscore _.extend method.
  * ✓ Also has no dependencies.

This makes for a total of two dependencies. You could probably read the entire source in about half an hour. I dare you.

## Changes

* 1.0.1: I forgot to make it browser friendly and didn't account for a dev error which I should've done. Now I have.
* 1.0.0: First.

## "FAQ"

### I cloned your repo what are those `makefile` files for?

Contributors who want to bundle the JS into the minified form (for the spec, too). Don't touch 'em unless you know what you're doing!

### Can I contribute?

Sure you can! If you have a suggestion, make an issue. If you've fixed something, open a pull request. This is a very simple module.

### Who made this, and when?!

Dan Hough ([@basicallydan](https://twitter.com/basicallydan) on Twitter and everywhere) did, while he was working as a contractor for [upmysport](https://upmysport.com).

repository: basicallydan/wen

repo_name: basicallydan/wen


text:
# Dockerized DBeaver

[![dbeaver](http://dockeri.co/image/seudev/dbeaver)](https://hub.docker.com/r/seudev/dbeaver)

## What is it?

![dockerized-dbeaver-256px](https://raw.githubusercontent.com/seudev/dockerized-apps/master/dbeaver/dockerized-dbeaver-256px.png)

A dockerized [DBeaver CE](https://dbeaver.io/) desktop application.

## Installation

### Docker Pull

```sh
docker pull seudev/dbeaver:7.2.5
```

### Allow access to the X server

*DBeaver* is a GUI application, then to run it in a docker container is necessary allow access to the **X server**. Execute the below script to allow it:

```sh
if ! grep -q "xhost +local:root" ~/.profile; then
    printf "\n# Allow access to the X server, using the local root user\nxhost +local:root\n" >> ~/.profile
    xhost +local:root
fi
```

**Note**: The `xhost +local:root` command can be executed directly, without be append to `~./profile` file, but this mode is necessary re-execute each system boot.

### Create a shortcut on the desktop and in the Start Menu (Optional)

Run the below script to download and configure the shortcut in your desktop and in the Start Menu.

```sh
mkdir -p ~/seudev/dockerized-apps/dbeaver/7.2.5 \
&& wget https://raw.githubusercontent.com/seudev/dockerized-apps/master/dbeaver/dbeaver -O ~/seudev/dockerized-apps/dbeaver/7.2.5/dbeaver \
&& wget https://raw.githubusercontent.com/seudev/dockerized-apps/master/dbeaver/dockerized-dbeaver-256px.png -O ~/seudev/dockerized-apps/dbeaver/dockerized-dbeaver-256px.png \
&& wget https://raw.githubusercontent.com/seudev/dockerized-apps/master/dbeaver/com.seudev.dbeaver.desktop -O ~/Desktop/com.seudev.dbeaver.7.2.5.desktop \
&& sed -i "s/<version>/7.2.5/" ~/seudev/dockerized-apps/dbeaver/7.2.5/dbeaver \
&& sed -i "s/<version>/7.2.5/" ~/Desktop/com.seudev.dbeaver.7.2.5.desktop \
&& sed -i "s/<user>/$USER/" ~/Desktop/com.seudev.dbeaver.7.2.5.desktop \
&& chmod 755 ~/seudev/dockerized-apps/dbeaver/7.2.5/dbeaver ~/Desktop/com.seudev.dbeaver.7.2.5.desktop \
&& cp ~/Desktop/com.seudev.dbeaver.7.2.5.desktop ~/.local/share/applications
```

**Note**: If you want to change the DBeaver version, theme mode or other parameter, then open the `~/seudev/dockerized-apps/dbeaver/7.2.5/dbeaver` file with a text editor and edit it.

## Using Dockerized DBeaver

**Note**: If you has created a shortcut skip this section and just double click `Dockerized DBeaver` shortcut, localizated in your desktop.

```sh
docker run -ti --rm \
    --network host \
    -v ~/dev-workspace:/root/dev-workspace \
    -v ~/seudev/dockerized-apps/dbeaver/volumes/DBeaverData:/root/.local/share/DBeaverData \
    -e DISPLAY=$DISPLAY \
    -v /tmp/.X11-unix:/tmp/.X11-unix:ro \
    -e GTK_THEME=Adwaita:dark \
    seudev/dbeaver:7.2.5
```

### `docker run` parameters

| **parameter**                                             | **Description**                                                                                |
| --------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `--network host`                                          | Use it if you need to access database server on the host machine                                                                               |
| `-v ~/dev-workspace`                                      | Use the `~/dev-workspace` local directory to share something with the container.                                                               |
| `-v ~/seudev/dockerized-apps/dbeaver/volumes/DBeaverData` | Use the `~/seudev/dockerized-apps/dbeaver/volumes/DBeaverData` local directory to save the dbeaver data like connections, scripts and drivers. |
| `-e DISPLAY=$DISPLAY`                                     | Set the `DISPLAY` environment variable with same local value. It's used by X server.                                                           |
| `-v /tmp/.X11-unix:/tmp/.X11-unix:ro`                     | Bind the `/tmp/.X11-unix` local directory in read only mode. It's used by X server.                                                            |
| `-e GTK_THEME=Adwaita:light`                              | Set the light mode.                                                                                |
| `-e GTK_THEME=Adwaita:dark`                               | Set the dark mode.                                                                                |

### Building this image:

```sh
docker build -t seudev/dbeaver:7.2.5 .
```

## Uninstall

If you want uninstall this dockerized application, then execute the below scripts:

1. Remove the docker image: `docker image rm seudev/dbeaver:7.2.5`
1. Remove the version folder: `rm -rf ~/seudev/dockerized-apps/dbeaver/7.2.5`
1. Remove the shortcut from the Desktop: `rm -f ~/Desktop/com.seudev.dbeaver.7.2.5.desktop`
1. Remove the shortcut from the Start Menu: `rm -f ~/.local/share/applications/com.seudev.dbeaver.7.2.5.desktop`
1. **If you want remove the generated volumes** (connections, scripts and drivers): `sudo rm -rf ~/seudev/dockerized-apps/dbeaver/volumes`
1. **If you want remove all dbeaver folder** (generated volumes, icon and all version folders): `sudo rm -rf ~/seudev/dockerized-apps/dbeaver`

## Licensing

**seudev/dockerized-apps** is provided and distributed under the [Apache Software License 2.0](http://www.apache.org/licenses/LICENSE-2.0).

Refer to *LICENSE* for more information.

repository: seudev/dockerized-apps

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: seudev/dockerized-apps


text:
thmbnlr
=======

Thmbnlr is a simple Flask-based microservice for getting thumbnails for an image URL.

### Installation
To run thmbnlr you can simply use:
```
python main.py
```

### Usage
To use the thmbnlr service you have to specify load the image as in the following example:
```
http://thmbnlr.your-domain.org/?url=http://upload.wikimedia.org/wikipedia/commons/b/b2/Hausziege_04.jpg&width=400&max_size=100
```

This returns an image with a maximum width of 100 px and a maximum size of 100 kByte.

The following GET-Parameters can be used to define the resulting image:

|  Parameter 	| Description  	|Default|
|---	|---	|--- |
| **url**  	| **mandatory** - The url of the original image.   	|- |
| width/height  	| The target width/height of the thumbnail image.	Typically only one is specified, since thmbnlr always keeps the original aspect ratio of the image. | original width/height|
| quality  	| The degree of compression in percent. 100 is the image without quality loss	| 100|
| max_size  	| The maximum size of the result image in kB	| original size |

When an image already satisfies all given requirements, thmbnlr will redirect you to the original image.

license: MIT

repository: jkblume/thmbnlr

repo_name: jkblume/thmbnlr


text:
---
title: Starts With Template Filter
linkText: Starts With
description: Starts With Template Filter
---

# Starts With Template Filter

Returns a boolean condition based on if the input value starts with the value passed to the filter

## Example

```text
{% raw %}
{% if TestValue|startsWith:'test' %}Starts With Test{% else %}Does NOT Start With Test{% endif %}
{% endraw %}
```

gha_language: C#

gha_license_id: MIT


text:
tswcalc
=======

tswcalc is intended to be a fan-made living talisman and glyph calculator for The Secret World (TSW), a MMORPG by Funcom. It can be used to plan how to spend your Black Bullions, Criterion Upgrades and Astral Fuses. In addition to share and show others what gear you use to tackle encounters in PvE or PvP.

tswcalc contains all Nightwatch custom gear and glyphs from QL 10.0 to 10.5. It also has all signets in normal, elite and epic variations.

tswcalc can be found at: http://joakibj.github.io/tswcalc

Note: all active development of tswcalc takes place in the [`develop`](https://github.com/joakibj/tswcalc/tree/develop) branch. Stable releases are merged into [`master`](https://github.com/joakibj/tswcalc/tree/master).

Installing
--------
tswcalc uses [grunt](http://gruntjs.com/) to build.
It uses `dustjs` (`linkedin-dustjs` fork) as a client-side template engine. Tests are covered by `qunit` and performed in each build.

The tools needed to build tswcalc are:
* [node.js](http://nodejs.org/) (v0.10.5+)
* npm (v1.2.18+)
* grunt (v0.4.0+)

node.js comes included with `npm`, the node package manager.

Install grunt globally:

    npm install -g grunt-cli

Install tswcalc dependencies, defined in `package.json`:

    npm install

Building
--------
Build tswcalc by running:

    grunt

When developing, use:

    grunt watch

The previous command monitors changes to files in the `src` folder. If any changes are detected, the build task is run.

Open `build/index.html` to view.

Distribution
------------
To create a distribution in the `dist` folder:

    grunt dist

Open `dist/index.html` to view.

License
-------
MIT License for the source code. Please see the LICENSE file.

All art assets included in `public/assets/images/icons/` folder are taken from [The Secret World™ Chronicle](http://chronicle.thesecretworld.com/). The artwork should be considered property of Funcom GmBH unless otherwise noted. A small sample of signet, glyph and item icons are redistributed under fair use.

repository: Epic-Combat/tswcalc

repo_name: Epic-Combat/tswcalc


text:
# [sonu.live/links-list](https://www.sonu.live/links-list/)

### Add About yourself, your portfolio, websites, projects and social media handles links on this website to showcase to the world

see live demo **[sonu.live/links-list](https://www.sonu.live/links-list)**

[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=social)](https://github.com/flyingsonu122/links-list) [![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/flyingsonu122/links-list.svg?logo=github&style=social)](https://github.com/flyingsonu122/links-list)  [![GitHub last commit](https://img.shields.io/github/last-commit/flyingsonu122/links-list.svg?logo=git&style=social)](https://github.com/flyingsonu122/links-list)  [![Maintenance](https://img.shields.io/maintenance/yes/2021.svg?logo=git&style=social)](https://github.com/flyingsonu122/links-list)

**Note:** this project is not for increasing your PR count, it is for listing profile of developers around the world.

## Steps to follow :scroll:

### 0. Star The Repo :star2:

Star the repo by pressing the topmost-right button to start your wonderful journey.

### 1. Fork it :fork_and_knife:

![Fork Button](https://help.github.com/assets/images/help/repository/fork_button.jpg)

### 2. Create a new branch :bangbang:

Whenever you are going to contribute. Please create a separate branch

### 3. Add Your image in img folder with your name as image file name
*get it's link in any **image format like png, jpg, or jpeg** and paste in image link*

![image](https://user-images.githubusercontent.com/88192065/134696622-a039e8ea-e0bd-46b6-b083-034025e2c930.png)

### 4. Add Your Details in users.json file at last

**Don't make changes to others details**

**please follow the format below**

```
     ,
    {
      "id": <leave it blank>,
      "name": " <your name> ",
      "link": " <your portfolio link> ",
      "image": " <your image link> ",
      "about": " <about yourself> "
    }
```

### 5.Finally, go to your repository in the browser and click on `compare and pull requests`.

Then add a title and description to your pull request

### 6. Create a Pull Request

---

Get a [**domain name for free**](https://github.com/singlebucks/get_free_domain)

---

**Please share and tell about this project to everyone you know to add about themselves or if you have their details you can add it.**

**MIT © [Sonu kumar kushwaha](https://github.com/flyingsonu122)**

**Thanks!**

Thank you for being here! You can find my other project **[here](https://github.com/flyingsonu122?tab=repositories)**.

[![Built with Love](https://forthebadge.com/images/badges/built-with-love.svg)](https://linktr.ee/flyingsonu)

 Let's have a chat on

branch_name: refs/heads/host

gha_language: HTML


text:
# Description

Make exclusions in Windows Defender for running Rider without performance issues

https://rider-support.jetbrains.com/hc/en-us/articles/360006365380-How-Antivirus-Software-Affects-Rider-s-Performance-on-Windows-

## Usage

Download release, extract it, and execute JetbrainsHelpers.exe with administrator privileges

[![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/lucasrodrigues10/JetbrainsHelpers)](https://github.com/lucasrodrigues10/JetbrainsHelpers/releases/latest/download/JetbrainsHelpers.zip)

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License
[MIT](https://choosealicense.com/licenses/mit/)


text:
# Operators

Operators like `+` and `-` are regular method calls. For example:

```crystal
a + b
```

is the same as:

```crystal
a.+(b)
```

You can define an operator for a type like this:

```crystal
struct Vector2
  getter x, y

  def initialize(@x : Int32, @y : Int32)
  end

  def +(other)
    Vector2.new(x + other.x, y + other.y)
  end
end

v1 = Vector2.new(1, 2)
v2 = Vector2.new(3, 4)
v1 + v2               #=> Vector2(@x=4, @y=6)
```

Next follows the full list of operators with their usual meaning.

## Unary operators

```crystal
+   # positive
-   # negative
!   # not
~   # bitwise complement
```

These are defined without arguments. For example

```crystal
struct Vector2
  def -
    Vector2.new(-x, -y)
  end
end

v1 = Vector2.new(1, 2)
-v1                    #=> Vector2(@x=-1, @y=-2)
```

**Note:** `!` (not) cannot be defined as a method (its meaning can't be changed).

## Binary operators

* `+` – addition
* `-` – subtraction
* `*` – multiplication
* `/` – division
* `%` – modulo
* `&` – bitwise and
* `|` – bitwise or
* `^` – bitwise xor
* `**` – exponentiation
* `<<` – shift left, append
* `>>` – shift right
* `==` – equals
* `!=` – not equals
* `<` – less
* `<=` – less or equal
* `>` – greater
* `>=` – greater or equal
* `<=>` – comparison
* `===` – [case equality](case.html)

## Indexing

```crystal
[]  # array index (raises on out of bounds)
[]? # array index (nil on out of bounds)
[]= # array index assignment
```

For example:

```crystal
class MyArray
  def [](index)
    # ...
  end

  def [](index1, index2, index3)
    # ...
  end

  def []=(index, value)
    # ...
  end
end

array = MyArray.new

array[1]       # invokes the first method
array[1, 2, 3] # invokes the second method
array[1] = 2   # invokes the third method

array.[](1)       # invokes the first method
array.[](1, 2, 3) # invokes the second method
array.[]=(1, 2)   # invokes the third method
```

## Meaning

One can assign any meaning to the operators, but the convention is to follow the above ones to avoid cryptic code, or code that behaves in an unexpected way.

repository: seyerian/crystal-book

gha_license_id: NOASSERTION

repo_name: seyerian/crystal-book


text:
# Num2text
A simple python module to convert numbers to textual words
For Example :-
```
Input :- 5678834
Output:- 'Five Million, Six Hundred Seventy Eight Thousand, Eight Hundred Thirty Four'

Input :- 2
Output:- 'Two'

Input :-<PHONE_NUMBER>641294
Output:- 'One Quadrillion, Two Hundred Thirty Two Trillion, Four Hundred Sixty Seven Billion, Two Hundred Thirty Four Million, Six Hundred Fourty One Thousand, Two Hundred Ninety Four'

```
## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

### Prerequisites

Python3+

### Installing {To do}
Just Copy and paste the following in your terminal

```
git clone
cd num2text
sudo ./setup.py
```

## Usage

This project can be used as a module as well as a command line program

### Using in your project
```
from num2text import *
num2text(num)
```

### From Command Line
```
usage: num2text.py [-h] [-d DELIMITER] Number
```

## Authors

* **Utkarsh Yadav**

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

## Acknowledgments

* Inspiration : Made this a long long time ago don't remember why I made this

gha_language: Python


text:
# Docker basic commands

List of Docker basic commands. More info can be found [here](https://docs.docker.com/engine/reference/commandline/docker/).

```bash
sudo docker build -t my_image_name . -> Build the image my_image_name using the Dockerfile of the current location
sudo docker run -it my_image_name bash -> Run the docker image and enter the bash
sudo nvidia-docker run -it my_image_name bash -> Run the docker image and enter the bash with NVIDIA drivers support
sudo docker run -p 8888:8888 -it my_image_name bash -> Run the image redirecting a port (useful for jupyter support)
sudo docker run -p 8888:8888 -v $HOME:/mnt/home -it my_image_name bash -> Run the image redirecting a port and making your local home accessible
sudo docker images -> list the images available
docker images -f dangling=true -> list dangling images (those with no relationship to any tagged images)
sudo docker ps -> list the images currently running
sudo docker stop my_image_id -> Stop the image using its ID (the ID can be found with docker ps)
sudo docker stop $(docker ps -q --filter ancestor=my_image_name ) -> Stop the image by its name
sudo docker rmi my_image_name -> remove an image
sudo docker images purge -> remove all dangling images
sudo docker system prune -a -> remove all stopped containers and unused images
```
## Upload image to DockerHub

```bash
sudo docker login --username=hoaphumanoid
sudo docker images
```
You will get a list of your images:

```bash
REPOSITORY                                 TAG                            IMAGE ID            CREATED             SIZE
cuda_ubuntu_base                           latest                         f161297fd883        9 minutes ago       4.22GB
nvidia/cuda                                8.0-cudnn7-devel-ubuntu16.04   0c17239b6723        13 days ago         2.09GB
azureml_25f82d93633330a2a06f0a73fb43bb0a   latest                         fd02e6d814fa        8 weeks ago         7.04GB
azureml_d03b8bc55f6f6aae78794809bd9c4cdd   latest                         4f95489c8626        2 months ago        3.8GB
microsoft/mmlspark                         plus-0.9.9                     7d6dc0293c47        6 months ago        1.58GB
```

Now you can tag your image:

```bash
sudo docker tag f161297fd883 hoaphumanoid/cuda_ubuntu_base:cuda8-cudnn7-ubuntu16.04
```

Then push your image to the repository you created:

```bash
sudo docker push hoaphumanoid/cuda_ubuntu_base
```

You can also pull an image from DockerHub, using name and tag:

```bash
sudo docker pull hoaphumanoid/cuda_ubuntu_base:cuda8-cudnn7-ubuntu16.04
```

repository: miguelgfierro/codebase

branch_name: refs/heads/main

gha_language: TeX

repo_name: miguelgfierro/codebase


text:
# ElasticsearchBundle

Elasticsearch integrates the official PHP-Elasticsearch Client (https://github.com/elastic/elasticsearch-php) into Symfony.
The main idea is based on the [Specification pattern](https://en.wikipedia.org/wiki/Specification_pattern), while trying not to overengineer things.
At the moment the bundle only covers the parts (queries, filters, etc.), we needed. But it can be easily extended.

## Installation

```console
composer require faibl/elasticsearch-bundle
```

## Configuration

Installing the bundle with Symfony flex will generate a faibl_elasticsearch.yaml inside your config-folder.
The part under 'elasticsearch' is your Elasticsearch-Config. The other parts are needed be the bundle to retrieve the entities from the db, serialize, deserialize from entities to documents and back, and log exceptions thrown from PHP-Elasticsearch.

Example:
```yaml
faibl_elasticsearch:
    entity:
        class: 'App\Entity\YourEntity'
        serializer: 'App\Serializer\Serializer\YourEntitySerializer'
    logger: 'monolog.logger'
    elasticsearch:
        index_name: "%elasticsearch_index_name%"
        settings:
            number_of_shards: 1
            number_of_replicas: 0
        mapping:
            yourentity:
                _source:
                    enabled: true
                properties:
                    status:
                        type: keyword
                    approved:
                        type: boolean
                    category:
                        type: keyword
                    user:
                        type: object
                        properties:
                            id:
                                type: keyword
                            name:
                                type: text

```

## Usage

### Index management commands
```console
fbl:elasticsearch:setup --create
fbl:elasticsearch:setup --recreate
fbl:elasticsearch:setup --delete
fbl:elasticsearch:setup --update-settings
fbl:elasticsearch:setup --update-mapping
```

### Index documents commands
```console
fbl:elasticsearch:index --all
fbl:elasticsearch:index --id=299
```

### Simple example of how to create a query and get result
```php
$query = (new Query())
             ->setQuery((new BoolQuery())
                 ->addFilters([
                     new TermFilter('field', 'value'),
                     new TermsFilter('field', ['value1', 'value2']),
                     new OnlineAtFilter($this->onlineAt), //custom filter containing domain logic
                 ])
                 ->addMust(
                     new MatchQuery('content', 'string to search for')
                 )
             )
             ->addSorts([
                 new OnlineAtSort($this->onlineAt), //custom sort containing domain logic
                 new FieldSort('_id'),
             ])
             ->setFrom(0)
             ->setSize(20)
             ->getQuery();

$result = $this->searchRepository->findForQuery($query, SearchService::HYDRATE_RESULT);
```

The bundle offers global queries, filters and sort-functions.
If you need more complex filters or queries, you should created your own by combining global/other filters and implementing the FilterInterface.
Creating custom queries and filters makes the reusable and easily testable.

### Custom filter

Here is an example of a custom filter that combines global filter provided by gthe bundle and some business logic.

```php
namespace App\Search\Filter;

use App\Entity\OrderItemInterface;
use Faibl\ElasticsearchBundle\Search\Filter\BoolFilter;
use Faibl\ElasticsearchBundle\Search\Filter\FilterInterface;
use Faibl\ElasticsearchBundle\Search\Filter\NestedFilter;

class OnlineAtFilter implements FilterInterface
{
    private $dateTime;

    public function __construct(?\DateTimeInterface $dateTime)
    {
        $this->dateTime = $dateTime;
    }

    public function hasFilter(): bool
    {
        return $this->dateTime instanceof \DateTimeInterface;
    }

    public function getFilter(): array
    {
        return (new NestedFilter('orderItems'))
            ->setFilter((new BoolFilter())
                ->addFilters([
                    new OrderItemStatusFilter(OrderItemInterface::STATUS_ORDERED),
                    new OrderItemOnlineAtFilter($this->dateTime),
                ])
            )->getFilter();
    }
}
```

### Todo
* Write tests..
* Extend filters/queries

repository: faibl/elasticsearch-bundle

repo_name: faibl/elasticsearch-bundle


text:
# Xerocomus auriporus (Peck) Singer, 1940 SPECIES

#### Status
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Revue Mycol. , Paris 5: 6 (1940)

#### Original name
Boletus auriporus Peck, 1872

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Basidiomycota/Agaricomycetes/Boletales/Boletaceae/Aureoboletus/Aureoboletus auriporus/ Syn. Xerocomus auriporus/README.md

repo_name: mdoering/backbone


text:
# DragListView

DragListView can be used when you want to be able to re-order items in a list, grid or a board.
It also supports horizontal swiping of items in a list.

YouTube demo video

[![Android drag and drop list and board](http://img.youtube.com/vi/Hxc7l06xhv4/0.jpg)](https://www.youtube.com/watch?v=Hxc7l06xhv4)

# Source
Original library are located here: https://github.com/woxblom/DragListView
Added more flexibility to UI. Column's UI can be customized (in development)

## Features
* Re-order items in a list, grid or board by dragging and dropping with nice animations.
* Add custom animations when the drag is starting and ending.
* Get a callback when a drag is started and ended with the position.
* Disable and enable drag and drop
* Swipe list items

## Download lib with gradle

    repositories {
       maven { url "https://dl.bintray.com/lsherhsun/DragListView" }
    }

    dependencies {
        implementation 'com.lshershun.view:draglistview:0.0.2'
    }

Add this to proguard rules, otherwise animations won't work correctly

    -keep class com.woxthebox.draglistview.** { *; }

## License

    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.


text:
# Loaded Demo

List of gaming influencers and their details.

## Installation

The server and client app have separate package files. You'll need to install the modules separatly.

```bash
# install server packages
yarn install

# install client packages
cd client && yarn install && cd ..
```

## Usage

Start server and client app for local development.
```bash
yarn dev
```

## License
[MIT](https://choosealicense.com/licenses/mit/)

repository: wasinsandiego/loaded

repo_name: wasinsandiego/loaded


text:
# Egocheck

#### By _**Caitlin Ashtari**, 2017_

# Description

EgoCheck is a personal project that randomly generates quotes from Ego Is the Enemy by Ryan Holiday. This app should be used frequently to keep ego at bay.

# Quote Source

Holiday, Ryan (2014) Ego Is the Enemy. New York, New York: Portfolio/Penguin.

# Link to Live Site

https://egocheck-7f94b.firebaseapp.com/

## Installation

* `$ npm install -g angular-cli`
* `git clone https://github.com/caitlinashtari/egochecker`
* `cd egochecker`
* `bower install`

## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

## Technologies Used

Angular2, JavaScript, TypeScript, Bootstrap, Angular-Material

### License

*MIT License*

Copyright (c) 2017 **_Caitlin Ashtari_**

repository: caitlinhalla/egochecker

repo_name: caitlinhalla/egochecker


text:
+++
title = "Fetched Results Controller & Diffable Data Source Snapshot Issues"
author = "Alex Jackson"
date = 2020-01-02T13:00:00+01:00
tags = ["swift", "core-data"]
+++

In iOS 13, `NSFetchedResultsController` gained support for delivering changes to
its content as a `NSDiffableDataSourceSnapshot` via. its delegate. The snapshot
contains the contents of the controller and can be used to populate a table or
collection view complete with animations for content updates.

Unfortunately the API has a few issues. The way it's bridged from Objective-C to
Swift makes using it a bit confusing and it doesn't match all the functionality
of the older delegate methods. In this post I'll document a couple of the issues
I've run into and how I've worked around them.

<!--more-->

## Using Snapshots in Swift

The first issue I encountered using the new API is accessing the snapshot from
Swift. The documentation declares the signature of the snapshot delegate method
as

``` swift
func controller(_ controller: NSFetchedResultsController<NSFetchRequestResult>, didChangeContentWith snapshot: NSDiffableDataSourceSnapshot)
```

but this isn't correct as `NSDiffableDataSourceSnapshot` has two generic
parameters for the `SectionIdentifier` and `ObjectIdentifier` that are
missing. The delegate method's signature actually bridges from Objective-C as:

``` swift
func controller(_ controller: NSFetchedResultsController<NSFetchRequestResult>, didChangeContentWith snapshot: NSDiffableDataSourceSnapshotReference)
```

The snapshot is an instance of `NSDiffableDataSourceSnapshotReference`, a class
that lacks the generic type parameters found on the struct version. By itself
this class seems useless as there aren't any other APIs that use it and it seems
to only exist to bridge this delegate method. To use the snapshot, you must cast
it to a `NSDiffableDataSourceSnapshot<String, NSManagedObjectID>`:

``` swift
func controller(_ controller: NSFetchedResultsController<NSFetchRequestResult>, didChangeContentWith snapshot: NSDiffableDataSourceSnapshotReference) {
    let snapshot = snapshot as NSDiffableDataSourceSnapshot<String, NSManagedObjectID>
    // Do something with the snapshot
}
```

Note that you can put any type for the `SectionIdentifier` and `ItemIdentifier`
parameters and it'll compile but only `String` and `NSManagedObjectID` are valid
as can be seen in the declaration of the Objective-C protocol:

``` objective-c
- (void)controller:(NSFetchedResultsController *)controller didChangeContentWithSnapshot:(NSDiffableDataSourceSnapshot<NSString *, NSManagedObjectID *> *)snapshot
```

At this point you've got a normal `NSDiffableDataSourceSnapshot` that can be
used with a table or collection view. I don't quite understand why the delegate
method gets bridged this way though since the Objective-C declaration is using
lightweight generics that should bridge across to Swift generics.

## Tracking Object Updates

The traditional delegate methods for `NSFetchedResultsController` updates
provide notifications of object insertions, updates, moves and deletes. Although
`NSDiffableDataSourceSnapshot` supports tracking all these events, the snapshot
provided to `NSFetchedResultsController`'s delegate only tracks insertions,
deletions and moves.

If you need to track object updates via. a data source snapshot, you'll need to
use the traditional delegate methods to build and maintain your own
snapshot. Using Swift's new `CollectionDifference` type this isn't too hard,
particularly if you only need to deal with one section. Note that you won't be
able to use the `NSManagedObjectID` as an `ItemIdentifier` in the snapshot
though for reasons I'll explain below.

In my situation when dealing with a single section I was able to get away with
an implementation like this:

``` swift
import UIKit
import CoreData
import Combine

/// A singleton section for the snapshot
struct Section: Hashable {
    private init() { }
    static let main = Section()
}

final class SingleSectionController<Object: NSManagedObject>: NSObject, NSFetchedResultsControllerDelegate {

    @Published
    var results = NSDiffableDataSourceSnapshot<Section, Object>()

    private let resultsController: NSFetchedResultsController<Object>

    init(context: NSManagedObjectContext, request: NSFetchRequest<Object>) {
        self.resultsController = NSFetchedResultsController(fetchRequest: request, managedObjectContext: context,
                                                            sectionNameKeyPath: nil, cacheName: nil)

        super.init()

        resultsController.delegate = self
    }

    func fetchData() {
        // Handle errors gracefully in production
        try! resultsController.performFetch()
        generateNewSnapshot()
    }

    private func generateNewSnapshot() {
        var initialSnapshot = NSDiffableDataSourceSnapshot<Section, Object>()
        initialSnapshot.appendSections([.main])

        if let objects = resultsController.fetchedObjects {
            initialSnapshot.appendItems(objects, toSection: .main)
        }

        self.results = initialSnapshot
    }

    // MARK: - Fetched Results Controller Delegate

    private var transientChanges: [CollectionDifference<Object>.Change] = []
    private var updatedObjects: Set<Object> = []

    func controllerWillChangeContent(_ controller: NSFetchedResultsController<NSFetchRequestResult>) {
        transientChanges.removeAll()
        updatedObjects.removeAll()
    }

    func controller(_ controller: NSFetchedResultsController<NSFetchRequestResult>, didChange anObject: Any, at indexPath: IndexPath?, for type: NSFetchedResultsChangeType, newIndexPath: IndexPath?) {
        guard let object = anObject as? Object else { return }

        switch type {
        case .insert:
            let insertionIndex = newIndexPath!
            transientChanges.append(.insert(offset: insertionIndex.row, element: object, associatedWith: nil))

        case .update:
            updatedObjects.insert(object)

        case .move:
            let sourceIndex = indexPath!.row
            let destinationIndex = newIndexPath!.row

            updatedObjects.insert(object)
            transientChanges.append(.insert(offset: destinationIndex, element: object, associatedWith: sourceIndex))
            transientChanges.append(.remove(offset: sourceIndex, element: object, associatedWith: destinationIndex))

        case .delete:
            let deletedIndex = indexPath!.row
            transientChanges.append(.remove(offset: deletedIndex, element: object, associatedWith: nil))

        @unknown default:
            fatalError("Unhandled \(NSFetchedResultsChangeType.self) \(type)")
        }
    }

    func controllerDidChangeContent(_ controller: NSFetchedResultsController<NSFetchRequestResult>) {
        guard let collectionDifference = CollectionDifference(transientChanges) else {
            // In theory, NSFetchedResultsController should deliver valid changes. In practice, I don't trust it so fall
            // back to generating a new snapshot if the changes can't be used as a diff.
            assertionFailure("Unable to create a collection difference from the changes \(transientChanges)")
            generateNewSnapshot()
            return
        }

        var newSnapshot = self.results
        for change in collectionDifference {
            switch change {
            case .insert(0, let object, _) where newSnapshot.numberOfItems(inSection: .main) == 0:
                newSnapshot.appendItems([object], toSection: .main)

            case .insert(0, let object, _):
                newSnapshot.insertItems([object], beforeItem: newSnapshot.itemIdentifiers(inSection: .main).first!)

            case .insert(newSnapshot.itemIdentifiers(inSection: .main).count, let object, _):
                newSnapshot.appendItems([object], toSection: .main)

            case .insert(let index, let object, _):
                let existingItem = newSnapshot.itemIdentifiers(inSection: .main)[index]
                newSnapshot.insertItems([object], beforeItem: existingItem)

            case .remove(_, let object, _):
                newSnapshot.deleteItems([object])
            }
        }

        newSnapshot.reloadItems(Array(updatedObjects))
        assert(newSnapshot.itemIdentifiers == resultsController.fetchedObjects ?? [],
               "Final snapshots items do not match the FRC's fetched objects")

        self.results = newSnapshot
    }
}
```

This tracks insertions, updates, moves and deletions using Swift's
`CollectionDifference` type to handle applying the updates in the correct
order. Compared to the `controller(_:didChangeContentWith:)` method, this
implementation does have one downside. As the snapshot's `ItemIdentifier` are
instances of `NSManagedObject`, you can't apply the snapshot from a background
queue (or at least, a different queue to the controller's context's queue)
whereas you can when using `NSManagedObjectID`s as identifiers.

## The Problem with Object IDs

The reason for using `NSManagedObject` as the `ItemIdentifier` instead of
`NSManagedObjectID` is due to how `NSFetchedResultsController` handles temporary
object IDs. As soon as an object matching the controller's fetch request is
inserted into the context, the controller will notify the delegate of an
insertion. At this point the object only has a temporary ID as it hasn't been
saved to the context's persistent store yet. If we were using an
`NSManagedObjectID` as the snapshot's `ItemIdentifier`, we'd add a temporary ID
to the snapshot at this point.

When the context is saved, the inserted object is given a (different) permanent
object ID. Although we can continue to use the temporary ID to retrieve the
object from its context, the `NSManagedObjectID` returned by the object's
`objectID` property will be the new, permanent ID.

Any subsequent updates to the object will be delivered to the results
controller's delegate as updates or moves. When we try to update the data source
snapshot using the updated object's `NSManagedObjectID`, the data source will
throw an exception because it only contains the temporary object ID, not the
permanent ID.

If you must use `NSManagedObjectID` as the data source's `ItemIdentifier`, you
can (kind of) exclude objects with a temporary ID from the results controller by
creating a private, read-only child context of the main context for the results
controller. The child context (and by extension the results controller) will not
know about newly inserted objects until the parent context is saved at which
point the objects will have a permanent ID (assuming the parent context is a
root context).

This setup creates some new problems though. If you need to merge changes into
the parent context from another context (say a background context), the merged
changes won't propagate to the child context automatically, even if
`automaticallyMergesChangesFromParent` is `true` for the child context.

repository: alexjohnj/alexjohnj

repo_name: alexjohnj/alexjohnj


text:
# Installation

Like every other python package you can install `cookiecutter-x` with

```shell
pip install cookiecutter-x
```

This will create the executable console script `cookiecutter-x` in the bin directory.

## Creating and installing in virtualenv

Using [virtualenv wrapper](https://virtualenvwrapper.readthedocs.io/en/latest/) (this creates the virtual environments at `$HOME/.virtualenvs`)

```shell
mkvirtualenv cookiecutter-x -p /usr/bin/python3
workon cookiecutter-x
pip install cookiecutter-x
```

For installing a package in virtualenv using python3 provided venv package

```shell
python3 -m venv venv
. venv/bin/activate
pip install cookiecutter-x
```

## Executable

This package creates executable console script `cookiecutter-x`, which is automatically installed
inside the virtualenv's bin directory. You can link this script into a `PATH` directory.

Run the following with the virtualenv activated

```shell
ccx=$(which cookiecutter-x) && sudo ln -t /usr/local/bin $ccx
```

Now you can deactivate the virtualenv and will still be able to execute `cookiecutter-x` command.

## Autocomplete

CookiecutterX is built with python [click](https://click.palletsprojects.com) library.
So it is easy to create auto complete following instruction at <https://click.palletsprojects.com/en/8.0.x/shell-completion>.

=== "bash"

    ```shell
    _COOKIECUTTER_X_COMPLETE=bash_source cookiecutter-x > $HOME/.cookiecutter-x/cookiecutter-x.autocomplete.bash
    ```

    Source the file in `$HOME/.bashrc`.

    ```shell
    source $HOME/.cookiecutter-x/cookiecutter-x.autocomplete.bash
    ```

=== "zsh"

    ```shell
    _COOKIECUTTER_X_COMPLETE=zsh_source cookiecutter-x > $HOME/.cookiecutter-x/cookiecutter-x.autocomplete.zsh
    ```

    Source the file in `$HOME/.zshenv`.

    ```shell
    source $HOME/.cookiecutter-x/cookiecutter-x.autocomplete.zsh
    ```

repository: fahadshaon/cookiecutter-x

repo_name: fahadshaon/cookiecutter-x


text:
# RISC-V Formal Verification Framework

This directory holds a copy of the [RISC-V Formal Verification Framework](https://github.com/SymbioticEDA/riscv-formal) and is used to verify the PicoRV32 softcore under hdl/cpu/picorv32. For more information please see the upstream [README](https://github.com/SymbioticEDA/riscv-formal/blob/master/README.md).

## Upstream Updates

We made some modifications to the original source when importing the framework, most notably the renaming of the 'insn' instruction register to 'instruction'. We anticipate additional changes as we start working (and possibly improving) on this framework and the processor cores. Because of this merging upstream changes will require some manual work. For this reason we should keep track of the upstream commit hashes to make it easier to determine what changes upstream and how to port these changes to our version.

### Merging Upstream

Using the last commit hash in the changlog below, generate the diff between that hash and either upstream master or the specific commit you are interested in. From that diff, determine the major changes and apply those by hand. Once applied, run the formal tests for the PicoRV32 core and see what breaks. You probably want to follow these steps:

* Diff the changes in *upstream/insns/generate.py* and apply them to *hdl/cpu/riscv_formal/isa/gen.py*.
* Regenerate the instruction source files by running the following:
  ```
  bazel run //hdl/cpu/riscv_formal/isa:gen -- $PWD/hdl/cpu/riscv_formal/isa
  ```
* Diff the changes in *upstream/checks/rvfi_macros.py* and apply them to *hdl/cpu/riscv_formal/checks/gen_macros.py*.
* Regenerate the macro header by running the following:
  ```
  bazel run //hdl/cpu/riscv_formal/checks:gen_macros > hdl/cpu/riscv_formal/checks/rvfi_macros.vh
  ```
* Diff the changes in *upstream/checks/\*.sv* and apply them to the ones found in *cpu/hdl/riscv_formal/checks*. Please not that *rvfi_insn_check.sv* has been renamed to *rvfi_instruction_check.sv*.

### Changelog

* Initial release, upstream 1d19c27e2648077b689e6c57e0f049d723e546b6


text:
# notecounter

advance through pitches sequentially. useful for driving the "notesequencer" or "drumsequencer" modules.

div: measure division, when using "div" as the interval

interval: rate to advance

length: length of the sequence

random: output random pitches within the range, rather than sequential

start: pitch at the start of the sequence

sync: if the output pitch should be synchronized to the global transport

repository: severak/BespokeSynthDocs

repo_name: severak/BespokeSynthDocs


text:
---
layout: default
---

# 1994-09-23 - CPs write Bumper Stickers

## Header Data

From<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 08f5d58df9b6f571e24300ef5f012a44b66ba6d87ddb61731cc6ff2cb99939e1

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1994-09-23 23:38:15 UTC

Raw Date: Fri, 23 Sep 94 16:38:15 PDT

## Raw message

```
{% raw  %}From<EMAIL_ADDRESS>Date: Fri, 23 Sep 94 16:38:15 PDT
To<EMAIL_ADDRESS>Subject: CPs write Bumper Stickers
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Got my samples of bumper sticker stock from Williams & Macias today, and it
looks *real* good.  Nice, heavy paper, feels like some kind of plastic
coating on it to make it weather-resistant.  The description sheet that came
with it says that it can also be run through copiers and offset presses, that
it can be drawn on directly, and takes color (dry-toner).  W&M is calling
them SlapSticks.

The 2041 (3 stickers/sheet) has 3 short (but full-width) areas; the 2042 has
2 full-height areas.  The stuff also comes with two different adhesives:
"temporary" and "removable".  The "temporary" is to allow washing off with
soap and water; the "removable" is more durable.  From the descriptions, it
sounds like the difference between a post-it note, and adhesive tape
(roughly). Each sticker is on it's own little die-cut area, and the areas are
separated with perfs to make separation easier.

Prices are $19.95 for 20 sheets, with Bumper Sticker Remover fluid for the
"removeable" stickers at $2.75 for 11 oz. can.

2x41 is 3 stickers/sheet, 2x42 is 2 stickers/sheet.  Replace x with 0 for
removable adhesive, use 1 for "temporary".

Unencrypted Email may be ignored without notice to sender.  PGP preferred.
Remember: It is not enough to _obey_ Big Brother; you must also learn to
*love* Big Brother.

{% endraw %}
```

## Thread

+ Return to [September 1994](/archive/1994/09)

+ Return to "[merriman@metronet.com](/authors/merriman_at_metronet_com)"

+ 1994-09-23 (Fri, 23 Sep 94 16:38:15 PDT) - CPs write Bumper Stickers -<EMAIL_ADDRESS>


text:
# Changelog
All the changes for Alta's primary (and currently only) backend, the C transpiler, will be kept in this file.

This project follows [semantic versioning](https://semver.org).

## [Unreleased]
  * Many, MANY changes that are TBD (to-be-documented)
### Fixed
  * Output class typedef definitions before the actual structure definitions (to allow them to store pointers to themselves)
  * Make sure to copy conditional expression outputs (by casting)
  * Silence some compiler warnings for generated code about incompatible pointer casts for:
    * Generator scope destruction when calling `_Alta_object_destroy`
    * Casting `_Alta_self` to `_Alta_basic_class` in generator initializers
    * Casting from `_Alta_basic_class` to the appropriate class type in generator executions
    * Using `_Alta_object_destroy` when deleting a variable
  * Properly dereference reference types generated by `to` casts
  * Properly reference reference types when passing them into operator methods
  * Dereference the iterator instance used for iterative ranged-for loops if necessary
  * Properly dereference references types when doing special fetches
  * Insert default return values that abort (in case the user provides no return value) for operator method definitions
  * Register symbols for `from` and `to` casts and operator methods

## [0.8.0] - 2018-12-20
### Added
  * `void` type support added
  * New `CTranspiler.vararg` attribute for parameters
    * This attribute lets Talta know that the annotated parameter is a C-style vararg parameter and that it should format arguments for this parameter accordingly
    * This is used, for example, in the declaration for `printf`:
      * `declare function printf(string: ptr byte<EMAIL_ADDRESS>data: any...): int`
      * This tells Alta that instead of passing arguments to printf like this:
        * `printf("some %d string", (any[]){ 3 })`
        * Which, by the way, is invalid C code because of the `any` type
      * ...it should pass them like this:
        * `printf("some %d string", 3)`
### Changed
  * Attributes are now executed at detail time
    * **Note**: this change was made in order to comply with the corresponding change in AltaCore
    * `CTranspiler.include` has been updated accordingly, and the new attribute (`CTranspiler.vararg`) also implements this behavior
### Updated
  * [AltaCore v0.10.0](https://github.com/alta-lang/alta-core/blob/v0.10.0/CHANGELOG.md#0100---2018-12-20)
  * [Ceetah v0.5.0](https://github.com/alta-lang/ceetah/blob/v0.5.0/CHANGELOG.md#050---2018-12-20)
### Additional Release Notes
  * We now have a policy of changelog modularization, and this is in effect for the various subprojects
    * In other words, refer to the changelogs of updated dependencies for additional changes
  * CI integration has been added for automated builds (and automated testing once tests are added)

## [0.7.1] - 2018-12-03
### Changed
  * Build artificats are now put into their own folders in the build directory: `bin` for executables and `lib` for libraries
### Updated
  * AltaCore v0.9.0
  * Ceetah v0.4.1

## [0.7.0] - 2018-12-01
### Added
  * General attribute support
  * `CTranspiler` attribute domain
    * BTW, `[AttributeString]` = `const ptr const byte`, which is a string literal
    * Currently, it contains the following attributes:
      * `include(header: [AttributeString])` = Instructs the C transpiler to include the specified `header` in the current module's header output
### Updated
  * AltaCore v0.8.0

## [0.6.0] - 2018-11-28
### Added
  * String literal support
### Updated
  * AltaCore v0.7.0

## [0.5.0] - 2018-11-27
### Added
  * Namespace support
### Updated
  * AltaCore v0.6.0

## [0.4.0] - 2018-11-22
### Added
  * Package versions are now included as part of mangled module names
  * Hoisted types support
    * Currently only necessary for function-pointer types
  * Function calls can now be transpiled!
### Updated
  * AltaCore v0.5.1

## [0.3.0] - 2018-11-18
### Added
  * Function-pointer type support
### Updated
  * AltaCore v0.4.0
  * Ceetah v0.3.0

## [0.2.2] - 2018-11-18
### Fixed
  * Mangle function parameter names
    * Previously, they were left unmangled
### Updated
  * AltaCore v0.3.1

## [0.2.1] - 2018-11-18
### Updated
  * AltaCore v0.3.0

## [0.2.0] - 2018-11-13
### Added
  * Boolean transpilation
    * Both boolean literals and the boolean type
  * Binary operations (`+`, `-`, `*`, `/`)
  * Module importation!
    * Full support for cherry-pick imports, theoretical support for alias imports
### Updated
  * AltaCore v0.2.0
  * Ceetah v0.2.0

## [0.1.0] - 2018-11-11
### Added
  * Assignment expressions are here!
  * We now use `shared_ptr`s in some places because Ceetah and AltaCore have switched to using them instead of raw pointers
    * We didn't completely switch because we can use raw pointers in places where we don't allocate new objects or keep pointers to objects (although we *could* fully switch if we wanted to)
### Updated
  * Ceetah v0.1.0
  * AltaCore v0.1.0

## [0.0.0] - 2018-11-08
### Added
  * Function and variable name mangling
    * Mangled function names include parameter types so that function overloading can be easily implemented in the future without much fuss on the backend
  * `return` support
  * Function definition support
    * Automatic function declaration in headers
  * Alta type to C type translation
    * Alta's `byte` is basically equivalent to C's `char`, and `int` is the same for both
    * `const` and `ptr` translation, as well
    * `ref`s are translted to pointers just like `ptr`
  * Variable definition and retrieval support
  * Theoretical accessor support
    * Theoretical because accessors aren't a thing in Alta yet, so we have no way of testing it
    * Theoretically supported, though, because it *should* work as-is when accessors are added to Alta
  * Integer literal translation

repository: alta-lang/talta

repo_name: alta-lang/talta


text:
Our goal is to encourage frictionless contributions to the project. In order to
achieve that, we use Unprotocols' [C4 process](https://rfc.unprotocols.org/spec:1/C4)
as an inspiration. Please read it, it will answer a lot of questions. Our goal is to
merge pull requests as quickly as possible and make new stable releases regularly.

In a nutshell, this means:

* We merge pull requests rapidly (try!)
* We are open to diverse ideas
* We prefer code now over consensus later

It is highly recommended to watch [Pieter Hintjens' talk on building open
source communities](https://www.youtube.com/watch?v=uzxcILudFWM) as well as
read his [book on the same
matter](https://www.gitbook.com/book/hintjens/social-architecture/details).

# Submitting an issue

According to C4's [development process](https://rfc.unprotocols.org/spec:1/C4#24-development-process),
the issue should describe a documented and provable. What this means is that an
issue should trive to have a clear, understandable problem statement. Just like
a patch, it SHOULD be titled "Problem: ..." and have a detailed description
describing evidence behind it, be it a bug or a feature request, or a longer
term "exploratory" issue.

Unlike C4, we're not using GitHub (or any other well-known platform) for issues.
Instead, we're using SIT itself. Please refer to [README](https://github.com/sit-it/sit#open-an-issue)
section that covers this process.

# Preparing a patch

According to [patch requirements](https://rfc.unprotocols.org/spec:1/C4#23-patch-requirements),
the patch should be a minimal and accurate answer to exactly one identified and
agreed problem. A patch commit message must consist of a single short (less
than 50 characters) line stating the problem ("Problem: ...") being solved,
followed by a blank line and then the proposed solution ("Solution: ...").

```
Problem: short problem statement

Optional longer explanation of the problem that this patch
addresses, giving necessary details for the reader to be
able to understand it better.

Solution: explanation of the solution to the problem. Could
be longer than one line.
```

Typically, patches are expected to be submitted over a pull request, but
if your circumstances preclude you from doing so, you can reach out to
any maintainer privately by e-mail or any other available means and
send the patch that way.


text:
> combine PagerView + GridLayout to PagerLayout

![https://github.com/o0starshine0o/PagerLayout](../screenCaptures/logo_V2.jpg)

![Travis (.com)](https://img.shields.io/travis/com/o0starshine0o/PagerLayout)
![Maven Central](https://img.shields.io/maven-central/v/com.github.qicodes/guide)
[ ![Download](https://api.bintray.com/packages/beijingqicode/maven/Guide/images/download.svg) ](https://bintray.com/beijingqicode/maven/Guide/_latestVersion)
![GitHub](https://img.shields.io/github/license/o0starshine0o/PagerLayout)
![GitHub last commit](https://img.shields.io/github/last-commit/o0starshine0o/PagerLayout)

# Guide

what we can do...
* convert a gray transparent layer on window
* set a view as except area in layer , also it can be clicked
* show guide content in four direction of this view

# Quick View

![https://github.com/o0starshine0o/PagerLayout/tree/master/Guide/](../screenCaptures/guide.gif)

# Install
Please using latest version:

2. [Guide](https://github.com/o0starshine0o/PagerLayout/tree/master/Guide/):![Maven Central](https://img.shields.io/maven-central/v/com.github.qicodes/guide)
```
// 新手引导
implementation 'com.github.qicodes:guide:1.0.0'
```

# How To Use

1. find a `view` , maybe from `RecycleView`
```kotlin
val itemView = icons.findViewHolderForAdapterPosition(itemIndex).itemView
```
2. using this `view` to init a `Guide` with guide content from xml
```kotlin
val guide = Guide(baseContext).addWindow(itemView, R.layout.item_guide_left, 100, position)
```
3. add this `guide` to `decorView`
```kotlin
(window.decorView as ViewGroup).addView(guide)
```

That's all!
Enjoy this simple `Guide`

# Demo
This project can be run if download.
The main code in [Demo](https://github.com/o0starshine0o/PagerLayout/blob/master/app/src/main/java/com/abelhu/MainActivity.kt) in `showGuide` function.

repository: sununvl/PagerLayout

repo_name: sununvl/PagerLayout


text:
# Reactive Streams TCK #

The purpose of the *Reactive Streams Technology Compatibility Kit* (from here on referred to as: *the TCK*) is to guide
and help Reactive Streams library implementers to validate their implementations against the rules defined in [the Specification](https://github.com/reactive-streams/reactive-streams).

The TCK is implemented using **plain Java (1.6)** and **TestNG** tests, and should be possible to use from other languages and testing libraries (such as Scala, Groovy, JRuby or others).

## Structure of the TCK

The TCK aims to cover all rules defined in the Specification, however for some rules outlined in the Specification it is
not possible (or viable) to construct automated tests, thus the TCK does not claim to completely verify an implementation, however it is very helpful and is able to validate the most important rules.

The TCK is split up into 4 files JUnit 4 test classes which should be extended by implementers, providing their `Publisher` / `Subscriber` implementations for the test harness to validate them. The tests are split in the following way:

* `PublisherVerification`
* `SubscriberBlackboxVerification`
* `SubscriberWhiteboxVerification`
* `IdentityProcessorVerification`

The next sections include examples on how these can be used and describe the various configuration options.

The TCK is provided as binary artifact on [Maven Central](http://search.maven.org/#search|ga|1|reactive-streams-tck):

```xml
<dependency>
  <groupId>org.reactivestreams</groupId>
  <artifactId>reactive-streams-tck</artifactId>
  <version>...</version>
  <scope>test</scope>
</dependency>
```

Please refer to the [Reactive Streams Specification](https://github.com/reactive-streams/reactive-streams) for the current latest version number. Make sure that the API and TCK dependency versions are equal.

### Types of tests

Since the TCK is aimed at Reactive Stream implementers, looking into the sources of the TCK is well expected,
and should help during a libraries implementation cycle.

In order to make mapping between test cases and Specification rules easier, each test case covering a specific
Specification rule abides the following naming convention: `spec###_DESC` where:

* `###` is the Rule number (`1.xx` Rules are about Publishers, `2.xx` Rules are about Subscribers etc.)
* `DESC` is a short explanation of what exactly is being tested in this test case, as sometimes one Rule may have multiple test cases in order to cover the entire Rule.

```java
  // Verifies rule: https://github.com/reactive-streams/reactive-streams#1.1
  @Required @Test
  public void spec101_subscriptionRequestMustResultInTheCorrectNumberOfProducedElements() throws Throwable {
    // ...
  }
```

The annotations on the test methods are used in order to signify the character of the test. For example, these are the kinds of annotations you may find:

```java
@Required @Test
```

... means that this test case is a hard requirement, it covers a *MUST* or *MUST NOT* Rule of the Specification.

```java
@Additional @Test
```

... means that this test case is optional, it covers a *MAY* or *SHOULD* Rule of the Specification. This annotation is also used if more configuration is needed in order to run it, e.g. `@Additional(implement = "createErrorStatePublisher") @Test` signals the implementer that in order to include this test case in his test runs, (s)he must implement the `Publisher<T> createErrorStatePublisher()` method.

```java
@Stochastic @Test
```

... means that the Rule is either racy, and/or inherently hard to verify without heavy modification of the tested implementation. Usually this means that this test case can yield false positives ("be green") even if for some case, the given implementation may violate the tested behaviour.

```java
@NotVerified @Test
```

... means that the test case is not implemented, either because it is inherently hard to verify (e.g. Rules which use the wording "*SHOULD consider X as Y*") or have not been implemented yet (though we hope we have implemented all we could!). Such tests will show up in your test runs as `SKIPPED`, with a message pointing out that the TCK is unable to validate this Rule. We would be delighted if you can figure out a way to deterministically test Rules, which have been marked with this annotation – pull requests are very welcome!

### Test isolation

All test assertions are isolated within the required `TestEnvironment`, so it is safe to run the TCK tests in parallel.

## Publisher Verification

`PublisherVerification` tests verify Publisher as well as some Subscription Rules of the Specification.

In order to include it's tests in your test suite simply extend it, like this:

```java
package com.example.streams;

import org.reactivestreams.Publisher;
import org.reactivestreams.Subscriber;
import org.reactivestreams.tck.PublisherVerification;
import org.reactivestreams.tck.TestEnvironment;

public class RangePublisherTest extends PublisherVerification<Integer> {

  public static final long DEFAULT_TIMEOUT_MILLIS = 300L;
  public static final long PUBLISHER_REFERENCE_CLEANUP_TIMEOUT_MILLIS = 1000L;

  public RangePublisherTest() {
    super(new TestEnvironment(DEFAULT_TIMEOUT_MILLIS), PUBLISHER_REFERENCE_CLEANUP_TIMEOUT_MILLIS);
  }

  @Override
  public Publisher<Integer> createPublisher(long elements) {
    return new RangePublisher<Integer>(1, elements);
  }

  @Override
  public Publisher<Integer> createErrorStatePublisher() {
    return new Publisher<Integer>() {
      @Override
      public void subscribe(Subscriber<Integer> s) {
        s.onError(new RuntimeException("Can't subscribe subscriber: " + s + ", because of reasons."));
      }
    };
  }

  // ADDITIONAL CONFIGURATION

  @Override
  public long maxElementsFromPublisher() {
    return Long.MAX_VALUE;
  }

  @Override
  public long boundedDepthOfOnNextAndRequestRecursion() {
    return 1;
  }
}
```

Notable configuration options include:

* `maxElementsFromPublisher` – which should only be overridden in case the Publisher under test is not able to provide arbitrary length streams, e.g. it's wrapping a `Future<T>` and thus can only publish up to 1 element. In such case you should return `1` from this method. It will cause all tests which require more elements in order to validate a certain Rule to be skipped,
* `boundedDepthOfOnNextAndRequestRecursion` – which should only be overridden in case of synchronous Publishers. This number will be used to validate if a
`Subscription` actually solves the "unbounded recursion" problem (Rule 3.3).

## Subscriber Verification

Subscriber rules Verification is split up into two files (styles) of tests.

The Blackbox Verification tests do not require the implementation under test to be modified at all, yet they are *not* able to verify most rules. In Whitebox Verification, more control over `request()` calls etc. is required in order to validate rules more precisely.

### Subscriber Blackbox Verification

Blackbox Verification does not require any additional work except from providing a `Subscriber` and `Publisher` instances to the TCK:

```java
package com.example.streams;

import org.reactivestreams.Publisher;
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;
import org.reactivestreams.tck.SubscriberBlackboxVerification;
import org.reactivestreams.tck.TestEnvironment;

public class MySubscriberBlackboxVerificationTest extends SubscriberBlackboxVerification<Integer> {

  public static final long DEFAULT_TIMEOUT_MILLIS = 300L;

  public MySubscriberBlackboxVerificationTest() {
    super(new TestEnvironment(DEFAULT_TIMEOUT_MILLIS));
  }

  @Override
  public Subscriber<Integer> createSubscriber() {
    return new MySubscriber<Integer>();
  }

  @Override
  public Publisher<Integer> createHelperPublisher(long elements) {
    return new MyRangePublisher<Integer>(1, elements);
  }
}
```

### Subscriber Whitebox Verification

The Whitebox Verification tests are able to verify most of the Specification, at the additional cost that control over demand generation and cancellation must be handed over to the TCK via the `SubscriberPuppet`.

Based on experiences so far implementing the `SubscriberPuppet` is non-trivial and can be hard for some implementations.
We keep the whitebox verification, as it is tremendously useful in the `ProcessorVerification`, where the Puppet is implemented within the TCK and injected to the tests.
We do not expect all implementations to make use of the plain `SubscriberWhiteboxVerification`, using the `SubscriberBlackboxVerification` instead.

A simple synchronous `Subscriber` implementation would look similar to following example:

```java
package com.example.streams;

import org.reactivestreams.Publisher;
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;
import org.reactivestreams.tck.SubscriberWhiteboxVerification;
import org.reactivestreams.tck.TestEnvironment;

public class MySubscriberWhiteboxVerificationTest extends SubscriberWhiteboxVerification<Integer> {

  public static final long DEFAULT_TIMEOUT_MILLIS = 300L;

  public MySubscriberWhiteboxVerificationTest() {
    super(new TestEnvironment(DEFAULT_TIMEOUT_MILLIS));
  }

  @Override
  public Subscriber<Integer> createSubscriber(final WhiteboxSubscriberProbe<Integer> probe) {

    // return YOUR subscriber under-test, with additional WhiteboxSubscriberProbe instrumentation
    return new Subscriber<Integer>() {

      @Override
      public void onSubscribe(final Subscription s) {
        // in addition to normal Subscriber work that you're testing,
        // register a SubscriberPuppet, to give the TCK control over demand generation and cancelling
        probe.registerOnSubscribe(new SubscriberPuppet() {

          @Override
          public void triggerRequest(long n) {
            s.request(n);
          }

          @Override
          public void signalCancel() {
            s.cancel();
          }
        });
      }

      @Override
      public void onNext(Integer value) {
        // in addition to normal Subscriber work that you're testing, register onNext with the probe
        probe.registerOnNext(value);
      }

      @Override
      public void onError(Throwable cause) {
        // in addition to normal Subscriber work that you're testing, register onError with the probe
        probe.registerOnError(cause);
      }

      @Override
      public void onComplete() {
        // in addition to normal Subscriber work that you're testing, register onComplete with the probe
        probe.registerOnComplete();
      }
    };
  }

  @Override
  public Publisher<Integer> createHelperPublisher(long elements) {
    return new MyRangePublisher<Integer>(1, elements);
  }

}
```

## Subscription Verification

Please note that while `Subscription` does **not** have it's own test class, it's rules are validated inside of the `Publisher` and `Subscriber` tests – depending if the Rule demands specific action to be taken by the publishing, or subscribing side of the subscription contract.

## Identity Processor Verification

An `IdentityProcessorVerification` tests the given `Processor` for all `Subscriber`, `Publisher` as well as `Subscription` rules. Internally the `WhiteboxSubscriberVerification` is used for `Subscriber` rules.

```java
package com.example.streams;

import org.reactivestreams.Processor;
import org.reactivestreams.Publisher;
import org.reactivestreams.Subscriber;
import org.reactivestreams.Subscription;
import org.reactivestreams.tck.IdentityProcessorVerification;
import org.reactivestreams.tck.SubscriberWhiteboxVerification;
import org.reactivestreams.tck.TestEnvironment;

public class MyIdentityProcessorVerificationTest extends IdentityProcessorVerification<Integer> {

  public static final long DEFAULT_TIMEOUT_MILLIS = 300L;
  public static final long PUBLISHER_REFERENCE_CLEANUP_TIMEOUT_MILLIS = 1000L;

  public MyIdentityProcessorVerificationTest() {
    super(new TestEnvironment(DEFAULT_TIMEOUT_MILLIS), PUBLISHER_REFERENCE_CLEANUP_TIMEOUT_MILLIS);
  }

  @Override
  public Processor<Integer, Integer> createIdentityProcessor(int bufferSize) {
    return new MyIdentityProcessor<Integer, Integer>(bufferSize);
  }

  @Override
  public Publisher<Integer> createHelperPublisher(long elements) {
    return new MyRangePublisher<Integer>(1, elements);
  }

  // ENABLE ADDITIONAL TESTS

  @Override
  public Publisher<Integer> createErrorStatePublisher() {
    // return error state Publisher instead of null to run additional tests
    return null;
  }

  // OPTIONAL CONFIGURATION OVERRIDES

  @Override
  public long maxElementsFromPublisher() {
    return super.maxElementsFromPublisher();
  }

  @Override
  public long boundedDepthOfOnNextAndRequestRecursion() {
    return super.boundedDepthOfOnNextAndRequestRecursion();
  }
}
```

The additional configuration options reflect the options available in the Subscriber and Publisher Verifications.

The `IdentityProcessorVerification` also runs additional sanity verifications, which are not directly mapped to Specification rules, but help to verify that a Processor won't "get stuck" or face similar problems. Please refer to the sources for details on the tests included.

## Ignoring tests
Since you inherit these tests instead of defining them yourself it's not possible to use the usual `@Ignore` annotations to skip certain tests
(which may be perfectly reasonable if your implementation has some know constraints on what it cannot implement). We recommend the below pattern
to skip tests inherited from the TCK's base classes:

```java
package com.example.streams;

import org.reactivestreams.tck.IdentityProcessorVerification;

public class SkippingIdentityProcessorTest extends IdentityProcessorVerification<Integer> {

  public SkippingIdentityProcessorTest() {
    super(new TestEnvironment(500, true), 1000);
  }

  @Override
  public Processor<Integer, Integer> createIdentityProcessor(int bufferSize) {
    return /* ... */;
  }

  @Override // override the test method, and provide a reason on why you're doing so in the notVerified() message
  public void spec999_mustDoVeryCrazyThings() throws Throwable {
    notVerified("Unable to implement test because ...");
  }

}
```

## Upgrade story

**TODO** - What is our story about updating the TCK? How do we make sure that implementations don't accidentally miss some change in the spec, if the TCK is unable to fail verify the new behavior? Comments are very welcome, discussion about this is under-way in [Issue #99 – TCK Upgrade Story](https://github.com/reactive-streams/reactive-streams/issues/99).

## Using the TCK from other languages

The TCK was designed such that it should be possible to consume it using different languages.
The section below shows how to use the TCK using different languages (contributions of examples for more languages are very welcome):

### Scala

In order to run the TCK using [ScalaTest](http://www.scalatest.org/) the test class must mix-in the `TestNGSuiteLike` trait (as of ScalaTest `2.2.x`).

```scala
class IterablePublisherTest(env: TestEnvironment, publisherShutdownTimeout: Long)
  extends PublisherVerification[Int](env, publisherShutdownTimeout)
  with TestNGSuiteLike {

  def this() {
    this(new TestEnvironment(500), 1000)
  }

  def createPublisher(elements: Long): Publisher[Int] = ???

  // example error state publisher implementation
  override def createErrorStatePublisher(): Publisher[Int] =
    new Publisher[Int] {
      override def subscribe(s: Subscriber[Int]): Unit = {
        s.onError(new Exception("Unable to serve subscribers right now!"))
      }
    }

}
```

### Groovy, JRuby, Kotlin, others...

Contributions to this document are very welcome!

If you're implementing reactive streams using the TCK in some language, please feel free to share an example on how to best use it from your language of choice.

repository: kubbo/reactive-streams

repo_name: kubbo/reactive-streams


text:
---
layout:     post
title:      "SQL server deadlock"
subtitle:   " \"\""
date:       2016-08-30 12:00:00
author:     "damonluffy"
header-img: "img/post-bg-2015.jpg"
catalog: true
tags:
    - SQL Server
---

> “”

use the below sql to find the deadlock:

select
    request_session_id spid,
    OBJECT_NAME(resource_associated_entity_id) tableName
from
    sys.dm_tran_locks
where
    resource_type='OBJECT'

then kill spid.

Sometimes, the deadlock is caused by the connections created by SQL studio management. you need to close all these connections.

extension: markdown

filename: 2016-08-31-SQL Server deadlock.markdown


text:
samples_table is a gem that helps the job of writing tests and specs.
Based on cucumber's tables, you can create simple test cases easily.
Since it 'embed' the table into ruby code, it avoids the need of configurations, and/or the creation and use of third test files for the examples.

***
### Default Configuration:

	# Gemfile (you may just need to add the samples table line)
	group :development, :test do
	  gem 'samples_table'
	end

***
### Configuration(with RSpec):

	# spec_helper.rb
	RSpec.configure do |config|
		#your old config here
		config.extend SamplesTable, :type => :model
	end

***
### Example(with RSpec):

	#sale_spec.rb
	require 'spec_helper'
	describe Sale do
	  describe "selling fruits" do
	    (samples [ :fruit , :quantity , :total ],
	             [ :apple ,     1     ,   1.0  ],
	             [ :apple ,     2     ,   2.0  ],
	             [ :apple ,    10     ,   9.5  ],#should apply discount when sells 10+
	             [ :orange,     1     ,   2.0  ],
	             [ :orange,     2     ,   4.0  ],
	             [ :orange,    10     ,  19.0  ]).each_sample do |sample|
	      describe "when selling #{sample.fruit}" do
	        before{subject.fruit = sample.fruit}
	        describe "and the customer wants to buy #{sample.quantity}" do
	          before{subject.quantity = sample.quantity}
	          it "should totalize #{sample.total} bucks" do
	            subject.total.should eql sample.total
	          end
	        end
	      end
	    end
	  end
	end

***
Feel free to comment/help.

***
### License:
__samples_table__ is released under the MIT license.


text:
# 1031. Is Graph Bipartite?

**Description**

Given an undirected graph, return `true` if and only if it is bipartite.

Recall that a graph is bipartite if we can split it's set of nodes into two independent subsets A and B such that every edge in the graph has one node in A and another node in B.

The graph is given in the following form: `graph[i]` is a list of indexes `j` for which the edge between nodes i and j exists. Each node is an integer between `0` and `graph.length - 1`.

There are no self edges or parallel edges: `graph[i]` does not contain i, and it doesn't contain any element twice.

> 1. `graph` will have length in range `[1, 100]`.
> 2. `graph[i]` will contain integers in range `[0, graph.length - 1]`.
> 3. `graph[i]` will not contain `i` or duplicate values.
> 4. The graph is undirected: if any element `j` is in `graph[i]`, then `i` will be in `graph[j]`.

**Example**

Example 1:

```
Input: [[1,3], [0,2], [1,3], [0,2]]
Output: true
Explanation:
  The graph looks like this:
  0----1
  |    |
  |    |
  3----2
  We can divide the vertices into two groups: {0, 2} and {1, 3}.
```

Example 2:

```
Input: [[1,2,3], [0,2], [0,1,3], [0,2]]
Output: false
Explanation:
  The graph looks like this:
  0----1
  | \  |
  |  \ |
  3----2
  We cannot find a way to divide the set of nodes into two independent subsets.
```

**二分图染色模板题**

通过黑白染色我们可以判断一个无向图是否二分图:

遍历整个图, 将相邻的节点染成不同的颜色, 如果可以完成这个遍历(即染色过程没有冲突), 说明是二分图.

可以用 BFS 或 DFS 来实现, 只需要根据当前节点的颜色设定下一个节点的颜色即可, 如果下一个节点已经被染成了相同的颜色, 说明发生了冲突.

*DFS*

```python
class Solution:
    """
    @param graph: the given undirected graph
    @return:  return true if and only if it is bipartite
    """
    def isBipartite(self, graph):
        # Write your code here
        if not graph or len(graph) == 0:
            return False

        n = len(graph)
        self.colors = [0 for _ in range(n)]

        for i in range(n):
            if self.colors[i] == 0 and not self._colorize(i, 1, graph):
                return False

        return True

    def _colorize(self, current, color, graph):
        if self.colors[current] != 0:
            return self.colors[current] == color

        self.colors[current] = color
        for neighbor in graph[current]:
            if not self._colorize(neighbor, - color, graph):
                return False
        return True
```

*BFS*

```python
from collections import deque

class Solution:
    """
    @param graph: the given undirected graph
    @return:  return true if and only if it is bipartite
    """
    def isBipartite(self, graph):
        # Write your code here
        if not graph or len(graph) == 0:
            return False

        n = len(graph)
        visited = [0 for _ in range(n)]
        color = [0 for _ in range(n)]

        for i in range(n):
            if len(graph[i]) > 0 and visited[i] == 0:
                visited[i] = 1
                color[i] = 1
                queue = deque([i])

                while queue:
                    node = queue.popleft()
                    for neighbor in graph[node]:
                        if visited[neighbor]:
                            if color[node] == color[neighbor]:
                                return False
                        else:
                            visited[neighbor] = 1
                            color[neighbor] = - color[node]
                            queue.append(neighbor)

        return True
```

repository: jxhangithub/lintcode

path: /DFS/1031.Is Graph Bipartite/README.md

repo_name: jxhangithub/lintcode


text:
---
layout: post
title:  "SORSE Call for Contributions"
date:   2020-08-01 12:00:00 +1000
categories: online events 2020
---

A global collaboration has established the [*International Series of Online Research Software Events*](https://sorse.github.io/), aka SORSE (pronounced 'sauce'). The goal is to provide an opportunity for RSEs to develop and grow their skills, build new collaborations and engage with RSEs worldwide.

Call for Contributions

You can make contributions, about technical or soft skills, in any of the following formats:

- [Panels and Discussions](https://sorse.github.io/programme/panels/)
- [Posters and Lightning talks](https://sorse.github.io/programme/posters/)
- [Software demos](https://sorse.github.io/programme/software-demos/)
- [Talks](https://sorse.github.io/programme/talks/)
- [Workshops](https://sorse.github.io/programme/workshops/)
- [Blog Posts](https://sorse.github.io/faq/howto/contribute-blog-posts)

This is an open continuous call with rolling deadlines at the end of the last day (UTC) of each month.


text:
[![Build Status](https://dev.azure.com/deep-water-systems/Monoculture.TinyCLR.Drivers.BME280/_apis/build/status/Monoculture.TinyClr.Devices.BME280-CI?branchName=master)](https://dev.azure.com/deep-water-systems/Monoculture.TinyCLR.Drivers.BME280/_build/latest?definitionId=13?branchName=master)

# Monoculture.TinyCLR.Drivers.BME280

TinyCLR library for the BME280 Humidity, Barometric Pressure + Temp sensor.

# Recommended Modes
   Based on Bosch BME280I2C environmental sensor data sheet.


text:
### We hope you enjoyed the last week of Improve Business Processes with SAP Workflow Management and welcome you to week 3.

This week, the topic is **[Process Flexibility and Visibility](https://open.sap.com/courses/btp2/items/71TGWB8ZK0laQXvm6vY9gH)**, and here we have some exercises for you:

- [Unit 2: Building a Process Visibility Scenario End-to-End](https://github.com/SAP-samples/btp-workflow-management-opensap/tree/main/Week%203/Unit%202)

- [Unit 3: Creating and Consuming Live Process Content Packages](https://github.com/SAP-samples/btp-workflow-management-opensap/tree/main/Week%203/Unit%203)

In case of questions or issues, please get in contact with us via the [chat forum on openSAP](https://open.sap.com/courses/btp2/pinboard).

Good luck!

path: /Week 3/README.md


text:
### Description

This generates Fig. 3-33b:  The cow rotating about a vector passing through her nose.(b) With origin at (6.1,1.3,.02).

!!! info
    See [Figure 3-33b](../../../VTKBook/03Chapter3/#Figure%203-33b) in [Chapter 3](../../../VTKBook/03Chapter3) the [VTK Textbook](../../../VTKBook/01Chapter1).

repository: Kitware/vtk-examples

repo_name: Kitware/vtk-examples


text:
#local-bitcoins-api
==================

Developed by Bots of Bitcoin
v0.1 - Release candidate

##Purpose

This package contains:
- `lb_api.py` slightly extended wrapper for the Local Bitcoins API based on that provided by Local Bitcoins and providing some additional functions via HTML where required
- `okpay_api.py` a complete wrapper for the OKPay API including a facility for Bitcoin payments
- `listener.php` PHP code to act as a gatekeeper on the server, verifying whether a payment notification really came from OKPay
- `listener.py` a listener to receive payment notifications from OKPay's instant payment notification (IPN) system and release escrows on Local Bitcoins
- `market_depth.py` a bonus command line tool to visualise the current depth of the Local Bitcoins market in various countries and currencies

##Tests status

_Local Bitcoins API_
- all functions have been tested on live accounts

_OKPay API_
- all functions have been tested on live accounts

_OKPay Listener_
- PHP file is tested and working
- Python file is fully tested on live accounts and releases transactions as expected

_Local Markets Depth_
- tested but will have additional features added

##Local Bitcoins API

The `lb_api.py` module implements all the existing functionality of the official Local Bitcoins API (see [the API docs](https://localbitcoins.com/api-docs/) for details):
- `get_escrows()`
- `release_escrow(escrow)`
- `get_ads()`
- `edit_ad(ad_id, ad_id, visibility, min_amount, max_amount, price_equation)`

In addition the following functions have been added (those noted as unofficial may be deprecated without warning):
- `update_prices(price_equation, trade_type)` - Updates all price equations for ads of a given type. Returns an array of responses from each call of the `edit_ad` function
- `delete_ad(ad_id)` - Unofficial API function for deleting an ad by passing the ad_id number
- `delete_ads(start, end)` - Unofficial API function for deleting multiple ads from a start ad_id number (default 0) to an end ad_id number (default 'inf'). Returns an array of responses in the form `{'success': [1 or 0][, 'deleted_id': ad_id, 'error': error]}`
- `edit_ad_html(ad_id, edits_dict)` - Unofficial API function for editing aspects of ads not yet covered by the official API. Pass in an ad ID number and a dictionary of field names to edit. These can be found by viewing the source of the edit ad page and are in the form `ad-field_name`
- `clone_ad_html(self, ad_no, ad_trade_type, ad_online_provider, edits_dict)` - Unofficial API function to clone an existing ad from the ad_id number. `ad-trade_type` (ONLINE_BUY, ONLINE_SELL, etc.) and `ad-online_provider` (OKPAY, PAYAL, MPESA_KENYA, etc.) must be set as they do not appear in the cloned ad
- `send_message(ad_url, message)` - Unofficial API function for sending automated response messages to customers to let them know their order will be released, or that there is a problem and to contact by email

##OKPay API

The `okpay_api.py` module implements the API from OKPay and can be used by anyone who wants to integrate their Local Bitcoins app with OKPay's payment system. These functions are taken directly from the API.
- `get_date-time()`
- `get_balance()`
- `send_money(destination, currency, amount, comment, receiver_pays_fees)`
- `check_account(destination)`
- `get_transaction(transaction, invoice)`
- `get_history(start, end, page_size, page_num)`
- `withdraw_to_ecurrency(payment_method, pay_system_account, amount, currency, fees_from_amount, invoice)`
- `get_withdrawal_fee(payment_method, amount, currency, fees_from_amount)`

In addition, the following functions have been added/extended:
- `get_balance(currency)` - By default, the OKPay `get_balance` function returns details of all wallets. You can also now pass a three-letter currency code to get just that wallet's balance.
- `withdraw_to_BTC(bitcoin_wallet, amount, currency, fees_from_amount=True)` - Used to simplify Bitcoin withdrawals and returns the same as `withdraw_to_ecurrency`.

##OKPay Listener

The `listener.php` waits for a message from OKPay, checks it is a valid message from  OKPay and passes it on to `listener.py`.

The `listener.py` module implements OKPay's instant payment notification (IPN) system, checking a message applies to a real transaction that hasn't already been dealt with, and then invokes the `release_escrow` function from `lb_api`.

The only public function is:
- `set_creds(lb_username, lb_password, lb_client_id, lb_client_secret, okpay_wallet, okpay_email, okpay_key, okpay_client)`, used to set all authorisation parameters.

##Market Depth

The `market_depth` module pulls prices and available volumes from Local Bitcoins and plots them

##Setup and usage
To use the API modules:
- Set up Local Bitcoins API [here](https://localbitcoins.com/accounts/api/)
- Set up OKPay API [here](https://www.okpay.com/en/developers/interfaces/setup.html)
- Add credentials to the two API files, or alternatively call them using the necessary credentials
- You can add all credentials to a file on your server by calling `set_creds`

_Optional_ if the OKPay IPN module is required
- Set up OKPay instant payment notifications (if required) - [instructions](https://www.okpay.com/en/developers/ipn/setup.html)
- Install the package on your server
- Start the listener by running `listener.py`

_Market Depth_ module
- Call from the command line with a list of countries and/or currencies
- Currently supports UK, USA, GERMANY, ITALY, SPAIN, AUSTRALIA, ARGENTINA, NETHERLANDS, BRAZIL, FRANCE, GBP, USD, EUR
- example: `$ python market_depth.py USD GBP EUR`
![marketdepth](market_depth.jpeg)

##Requirements
- `Python 2.7`

- `requests`

- `suds` for OKPay API and listener only

- `bs4` (BeautifulSoup) required for market depth and for editing ads using the `edit_ads_html` function

- `matplotlib` for market depth only

*Donations gratefully accepted at 13aHXq1uvusPrAAtmrrggkckBFC5WLFgXo*

repository: breeezzz/local-bitcoins-api

repo_name: breeezzz/local-bitcoins-api


text:
# Genetic / Evolutionary Algorithms
- [Introduction to Genetic Algorithms](https://towardsdatascience.com/introduction-to-genetic-algorithms-including-example-code-e396e98d8bf3)
- Knapsack Problem
- Traveling Salesman Problem
- 4bit Deceptive Problem
- Neural Network Architecture Optimization

## Knapsack Problem
![Knapsack Problem](https://upload.wikimedia.org/wikipedia/commons/f/fd/Knapsack.svg)

Given a set of items, each with a weight and a value, determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible.

## Traveling Salesman Problem
![Traveling Salesman Problem](https://physics.aps.org/assets/a38de7c6-00ac-45fb-9bcf-3b3e14a72b41/es32_1.png)

The travelling salesman problem (also called the traveling salesperson problem or TSP) asks the following question: "Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city exactly once and returns to the origin city?"

## 4bit Deceptive Problem
![4bit Deceptive Problem](https://i.stack.imgur.com/KtRnN.png)

Deceptive problems are a class of challenging problems for conventional genetic algorithms (GAs), which usually mislead the search to some local optima rather than the global optimum.

## Neural Network Architecture Optimization
![Neural Network Architecture Optimization](https://techvidvan.com/tutorials/wp-content/uploads/sites/2/2020/05/Architecture.jpg)

Optimize the NN structure in terms of minimizing the number of connections (i.e., weights or edges) among neurons by using a customized GA, while maintaining the classification accuracy as much as possible.