text:
---
layout: post
title: "My own REDIS types notation"
date: 2011-12-11 17:20
comments: true
tags: [clojure, redis]
---

One of the greatest [NoSQL](http://en.wikipedia.org/wiki/NoSQL) [key-value](http://en.wikipedia.org/wiki/NoSQL#Key-value_store) databases I value most, is [redis](http://redis.io/). It is simple, fast and tasty.

You interact with redis through its protocol. They are divided by commands that you can apply to its different data structures. These structures are Key, String, Hashes, Lists, Sets, Sorted Sets and channels (this one used for [pub/sub pattern](http://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern)).

Since redis is key-value, it means you can store only keys with values. Right? It may sound bad at the beginning, but you get the way as you try. I'm just a newbe in redis world and I'm feeling comfortable with it.

<!--more-->

So, due to its key-value nature you should create some structures around you main structure to help you query your data. Suppose you are using a redis `HASH` to store user information. In a javascript notation:

	HMSET  users:21 name Abraão mail<EMAIL_ADDRESS>status pending-mail-confirmation

`HMSET` is a command to store all the `HASH` entries into a `HASH` identified by `user:21` key. And for some reason, your system get all users pending mail confirmation and send them a remember. There is no way to get all the users that has mail confirmation pending other than check every user status, what would be expensive. A helper structure may save you from this.

    SADD users:pending:confirmation 21

Bingo. Now your background process can pick up users to remember mail confirmation from the `SET` identified by `users:pending:confirmation` key.

Suppose you also want to show a welcome message to the user in the first time it visits you. You may use another helper structure.

    SADD messages:welcome 21

Thus, your system queries a `SET` identified by `messages:welcome` key to check if it should show a welcome message to the user. And finally, at the moment of user's creation, your system wants to send some information through mail also in a back ground process. Again a helper structure.

    LPUSH users:send:mail<EMAIL_ADDRESS>
Lot of thing to just create a user. Now imagine a big code base and even complex interactions with other helper structures like sorted sets to store information related to age, date, etc. It was my situation last week while interacting with redis.

To make things clear and easy to remember and document. I created a simple, yet helpful (for me at least) notation to document redis structures and the sequence of interactions. Te symbols are:

![redis Types Notation](https://s3.amazonaws.com/suzart.blogs.posts/redislayout/Slide1.jpg)

Now our user's creation process using the notation we have:

![User's creation interactions](https://s3.amazonaws.com/suzart.blogs.posts/redislayout/Slide4.jpg)

It is simple and is helping a lot. Another good thing I started to do is to write queries in plain english (portuguese actually :)) to help identify which types of queries a structure is helping me to answer. To see a text version of it, visit this [new post](http://paulosuzart.github.com/blog/2011/12/11/my-own-redis-types-text-notation/).

I'm using [clj-redis](https://github.com/mmcgrana/clj-redis/) interact with redis.

extension: markdown

gha_language: SCSS


text:
# Important articles and blog posts

### Multithreading

* EDN: Delphi threading by example - by: Wim De Cleen
    * https://edn.embarcadero.com/article/22411
    * Why synchronize?
    * Critical sections
    * Starting the thread
    * Handling the messages
* DelphiTools: TMonitor saga - by Eric Grange
    * https://www.delphitools.info/tag/tmonitor/
    * TMonitor vs TRTLCriticalSection
    * Eric Grange = Delphi Web Script
* Allen Bauer threading series on Embarcadero Community:
    * Retrofitting a classic - Wrzesień 2008
        * https://community.embarcadero.com/blogs/entry/retrofitting-a-classic-38868
        * TThread.Synchronize with anonymous method
        * Anonymous Method to "synchronize" a background thread with the main UI thread
    * A Sink Programming - Wrzesień 2008
        * https://community.embarcadero.com/blogs/entry/a-sink-programming-38872
        * TThread.Queue + IAsyncResult interface
    * More A Sink Kronos programming - Wrzesień 2008
        * https://community.embarcadero.com/blogs/entry/more-a-sink-kronos-programming-38873

license: MIT

repository: bogdanpolak/internalBSC

branch_name: refs/heads/master

extension: md

gha_language: Pascal

license_type: permissive

repo_name: bogdanpolak/internalBSC


text:
# **Finding Lane Lines on the Road**
[![Udacity - Self-Driving Car NanoDegree](https://s3.amazonaws.com/udacity-sdc/github/shield-carnd.svg)](http://www.udacity.com/drive)

<img src="examples/laneLines_thirdPass.jpg" width="480" alt="Combined Image" />

Overview
---

When we drive, we use our eyes to decide where to go.  The lines on the road that show us where the lanes are act as our constant reference for where to steer the vehicle.  Naturally, one of the first things we would like to do in developing a self-driving car is to automatically detect lane lines using an algorithm.

The project objective is to detect lane lines in images using Python and OpenCV and finally applying it to a video.
OpenCV means "Open-Source Computer Vision", which is a package that has many useful tools for analyzing images

The Project
---

### Reflection

### 1. Description of my pipeline.

My pipeline consisted of 5 steps.

1. I converted the images to grayscale, using the helper function grayscale(img)

2. Gaussian smoothing is done with kernel size = 5 on the grayscaled image obtained from previous step. This step is done for      getting a better result in step 3.

3. Applied Canny Edge Detection Algorithm to find the edges of objects to optimize the detection of the lane lines well without    detecting a lot of other stuff. The recommended ratio of the minimum and maximum threshold is 1:2 or 1:3. I am getting better    result in minimum threshold 50 and maximum threshold as 150.

4. Created a masked edges image identifying the area of our interest in the image to find the lane. I used 4-sided polygon to      mask the region using the function cv2.fillPoly().

5. Finally, I applied Hough Space Transformation to detect the lines on the masked area of the image. The value of rho, threshold, minimum line length and the maximum line gap taken are 2, 15, 20 and 10 respectively, which turned out to work fine for me. The theta value was usual (pi/180).

In order to draw a single line on the left and right lanes, I modified the draw_lines() function by first calculating the average of all the slope and intercepts of all the lines detected using hough transform and then finding the position of the bottom "x" and the top "x" for both the left and right lane.

### 2. Potential shortcomings with the pipeline

One potential shortcoming would be what would happen when the camera will have a different angle and position for the road. It would be diffcult to find the lane lines as it would not match the region we masked in the pipeline.

Another shortcoming is that it will work well on shadowed areas. We would need different value of kernel sizes for that while smoothing using gaussian smoothing.

### 3. Possible improvements to the pipeline

A possible improvement would be to to find out all the possible position of the lane on the road with different obstacles.
Maybe using neural networks, it would help much better

repository: theneuronprogrammer/SDCND

repo_name: theneuronprogrammer/SDCND


text:
# Getting Started with Presto

## Introduction

This repository contains the files used to present the F8 2019 classroom demo:
*Getting Started with Presto: Run SQL at any Scale*. They will setup a Presto cluster
with MySQL and MongoDB instances that you can query from Presto.

## Requirements

- Docker (you can use [Docker CE](https://docs.docker.com/install/))
- Docker [Compose](https://docs.docker.com/compose/install/)

The demo was develop on Mac OS X.

## Quick Start

To start the Presto cluster and its dependencies:
```
docker-compose up
```

Then open the Jupyter Notebook at [`localhost:8888`](http://localhost:8888).

The Jupyter Notebook password is `demo`. You can override it by changing the
SHA1 hash of `--NotebookApp.password='sha1:2017f6d8a65d:4f2115202d4cd8c081f1c135bc2b41292bcb4ec4'`
in `docker-compose.yml`.

The Presto UI is available at [`localhost:8080`](http://localhost:8080).

To run the Presto CLI:

```
docker exec -it f8-2019-demo_presto_1 bin/presto-cli
```

You can find Presto's documentation on [prestodb.io/docs/current/](http://prestodb.github.io/docs/current/).

If you update a `Dockerfile`, use `docker-compose up --build` to ignore cache
and rebuild the images.

## Next Steps

In this demo, we run all Presto nodes on the same machine. Presto has two types of nodes:
- The coordinator is the main server that compiles SQL And manages its execution
- The worker is a node that executes tasks scheduled by the coordinator

To run Presto in a distributed way, you will create a new instance with
`coordinator=false` in `etc/config.properties`.

- More about [deploying](http://prestodb.github.io/docs/current/installation/deployment.html) Presto
- Configuration properties [reference](http://prestodb.github.io/docs/current/admin/properties.html)
- [Developing](http://prestodb.github.io/docs/current/develop.html) extensions and integrations for Presto

## References

- https://prestodb.io
- https://github.com/prestodb/presto
- http://tinyurl.com/presto-paper
- https://prestodb.io/resources.html#libraries
- https://jupyter.org

## Contributing

See the [CONTRIBUTING](CONTRIBUTING.md) file for how to help out.

## License

f8-2019-demo is Apache 2.0 licensed, as found in the LICENSE file.


text:
---
layout: layout.pug
navigationTitle: Spark
excerpt: Using Spark with DC/OS Data Science Engine
title: Spark
menuWeight: 8
model: /mesosphere/dcos/services/data-science-engine/data.yml
render: mustache
enterprise: true

---

{{ model.techName }} comes with Apache Spark integration and allows running Spark jobs from notebooks and a terminal.

# Launching a Spark job
## Using Terminal
Open a `Terminal` from the Notebook UI and run this example `spark-submit` job:

```bash
spark-submit --class org.apache.spark.examples.SparkPi http://downloads.mesosphere.com/spark/assets/spark-examples_2.11-2.4.0.jar 100
```

## Using a Python Notebook
Open a `Python Notebook` and put the following code in a code cell.
```python
from __future__ import print_function
import sys
from random import random
from operator import add
from pyspark.sql import SparkSession
spark = SparkSession\
        .builder\
        .appName("PythonPi")\
        .getOrCreate()
partitions = 2
n = 100000 * partitions
def f(_):
    x = random() * 2 - 1
    y = random() * 2 - 1
    return 1 if x ** 2 + y ** 2 <= 1 else 0
count = spark.sparkContext.parallelize(range(1, n + 1), partitions).map(f).reduce(add)
print("Pi is roughly %f" % (4.0 * count / n))
spark.stop
```

# Spark UI
The Spark UI starts automatically when a SparkContext is created, and is available at

```bash
http://<dcos_url>/service/{{ model.serviceName }}/sparkui
```

# Spark History Server

{{ model.techName }} includes the Spark History Server (SHS), which is up and running by default, using `org.apache.spark.deploy.history.FsHistoryProvider` as a default provider with
`spark.history.fs.logDirectory` set to `file:/mns/mesos/sandbox/`. It is highly recommended to use HDFS as the backend storage for SHS.
You can configure SHS to use HDFS with the following steps:

## Installing HDFS

NOTE: HDFS requires at least five private nodes.

1. Install HDFS:

    ```bash
    dcos package install hdfs
    ```

2. Create a history HDFS directory (default is `/history`). SSH into your cluster and run:

    ```bash
    docker run -it mesosphere/hdfs-client:1.0.0-2.6.0 bash
    ./bin/hdfs dfs -mkdir /history
    ```

## Configuring Spark History Server

1. Configure **Spark History Log Directory** to point to the created HDFS directory in `service.json`:

    ```json
    {
        "service": {
        "jupyter_conf_urls": "<DCOS HDFS endpoint>"
        },
        "spark": {
            "start_spark_history_server": true,
            "spark_history_fs_logdirectory": "hdfs://hdfs/history"
        }
    }
    ```

    To find more about configuring HDFS integration of {{ model.nickName }}, see the [Using HDFS with DC/OS Data Science Engine](/mesosphere/dcos/services/data-science-engine/1.0.0/integrations/hdfs/) documentation.

1.  Enable the `Spark Event` log and set the HDFS directory:

    ```json
    {
        "spark": {
            "start_spark_history_server": true,
            "spark_history_fs_logdirectory": "hdfs://hdfs/history",
            "spark_eventlog_enabled": true,
            "spark_eventlog_dir": "hdfs://hdfs/history"
        }
    }
    ```

1. Restart the {{ model.serviceName }} Service to apply the changes.

## Confirm Spark History Server installation
The Spark History Server UI is available at `http://<dcos_url>/service/{{ model.serviceName }}/sparkhistory`, listing incomplete and completed applications and attempts.

repository: mesosphere/dcos-docs-site

branch_name: refs/heads/main

repo_name: mesosphere/dcos-docs-site


text:
# Simple CRM

This is a [Polymer](https://www.polymer-project.org/) version of an example application generated by [Vaadin Bluemix Boilerplate](https://vaadin.com/blog/-/blogs/vaadin-boilerplate-in-bluemix).

See the application running [live](http://demo.vaadin.com/SimpleCRM).

Main features of this application:

 * Responsive UI created using [Polymer elements](https://elements.polymer-project.org/) and [Vaadin Components](https://vaadin.com/components).
 * Routing between views is done using the [Page.js](https://visionmedia.github.io/page.js/) client-side router.
 * A static file is used as the data source, but it could easily be replaced with a REST API.

![](screenshot.png)

## Views

The application consists of four views.

 * **About** (```pages/about-page.html```)
    * Simple HTML view.
 * **Customers** (```pages/customers-page.html```)
    * Table of customers displayed using ```<v-grid>```.
    * Selecting a row opens up an editor for customer details.
 * **Analyze** (```pages/analyze-page.html```)
    * Set of charts based on customer data.
    * Charts are displayed with ```<v-charts>```.
 * **Map** (```pages/map-page.html```)
    * Map of customer locations displayed with ```<google-map>``` element.

Each view is a Polymer element that is dynamically inserted into DOM of the main page according to the routing configuration.

## Routing

Routing between views is done using the [Page.js](https://visionmedia.github.io/page.js/) client-side router.
During navigation a CSS class ```transition``` is defined for the main content which enables a transition animation
between different views. See ```app.js``` for the routing configuration.

#### Routing Example
```javascript
page('/customers', function() {
    app.route = 'customers';
    app.setMainContent('customers-page');
});
```

## Data Access

Accessing the customer data is done with ```<iron-ajax>``` element. Its usage is wrapped within ```<customer-data>``` element
which maintains an in-memory cache of the data to prevent requesting the same data multiple times. That custom element also
provides methods that can be used to update or delete customer entries.

Currently the data is provided as a static JSON file (```data/customers-snapshot.json```), but the ```<customer-data>``` element
could be upgraded to use a real REST service without too much effort.

## Data Editing

Selecting a row in the Customers view opens up an editor form that is constructed from various ```<paper-*>``` elements.
The editor is contained in the ```<customer-form>``` element. The ```<customer-form>``` fires three kinds of events
corresponding to the buttons in the form.
These events are ```save```, ```cancel``` and ```delete```. The containing ```<customer-page>``` registers itself to
listen for these events and reacts accordingly.

## Charts

The Analyze view displays couple of visualizations from the customer data. These are created using the web components
API of [Vaadin Charts](https://vaadin.com/add-ons/charts). The actual calculation of data presented in these charts is done
in JavaScript functions of the ```<analyze-page>```.

repository: augint/simplecrm-polymer

repo_name: augint/simplecrm-polymer


text:
# ScottPlot

[![](https://img.shields.io/azure-devops/build/swharden/ScottPlot/15/master?logo=azure%20pipelines)](https://dev.azure.com/swharden/ScottPlot/_build?definitionId=15)
[![](https://img.shields.io/azure-devops/tests/swharden/ScottPlot/15/master?logo=azure%20pipelines)](https://dev.azure.com/swharden/ScottPlot/_build?definitionId=15)
[![](https://img.shields.io/nuget/dt/scottplot?color=004880&label=Downloads&logo=NuGet)](https://www.nuget.org/packages/ScottPlot/)
[![](https://img.shields.io/nuget/vpre/scottplot?color=%23004880&label=NuGet&logo=nuget)](https://www.nuget.org/packages/ScottPlot/)

**ScottPlot is a free and open-source plotting library for .NET** that makes it easy to interactively display large datasets. The [**ScottPlot Cookbook**](https://swharden.com/scottplot/cookbook) demonstrates how to create line plots, bar charts, pie graphs, scatter plots, and more with just a few lines of code.

* **[ScottPlot Cookbook](https://swharden.com/scottplot/cookbook)** 👈 _Learn how to use ScottPlot_

* **[ScottPlot Demo](https://swharden.com/scottplot/demo)** 👈 _See what ScottPlot can do_

* **Quickstart:** [WinForms](https://swharden.com/scottplot/quickstart#windows-forms-quickstart), [WPF](https://swharden.com/scottplot/quickstart#wpf-quickstart), [Avalonia](https://swharden.com/scottplot/quickstart#avalonia-quickstart), [Console](https://swharden.com/scottplot/quickstart#console-quickstart)

### Questions and Feedback

* **Ask questions** in [Discussions](https://github.com/swharden/ScottPlot/discussions/categories/q-a), [Issues](https://github.com/swharden/ScottPlot/issues), or [on StackOverflow]((https://stackoverflow.com/questions/ask?tags=scottplot))

* [**Create an issue**](https://github.com/swharden/ScottPlot/issues) for a feature suggestion or bug report

* If you enjoy ScottPlot **give us a star!** ⭐

### Major Versions

* See [**Releases**](https://github.com/swharden/ScottPlot/releases) for source code and notes for all versions

* **`ScottPlot 4.1`** is being actively-developed and is currently available as a pre-release package on NuGet. This version is faster than 4.0, supports multiple axes, and has a simpler API and a much better cookbook.

* **`ScottPlot 4.0`** is stable, available on NuGet, and has its own [branch](https://github.com/swharden/ScottPlot/branches) for continued bug fixes and refinements. However, new features are no longer being developed for this version.

### Plot in the Cloud

**This figure is an example of ScottPlot running in the cloud.** Once daily an [Azure Function](https://azure.microsoft.com/en-us/services/functions/) logs the number of stars this repository has and creates a graph of the star history using ScottPlot. Since the output is simply a static image accessible by a URL, it can be displayed in places where JavaScript is not permitted like in this readme file. Rendering plots server-side allows automatically-updating plots to be displayed in many interesting places. Source code can be found in the [StarGraph](https://github.com/swharden/StarGraph) repository.

### Developer Notes

* **Minimum Supported Platforms:** .NET Core 2.0 and .NET Framework 4.6.1 ([see details](https://swharden.com/scottplot/#supported-platforms))

* **The [ScottPlot Roadmap](dev/roadmap.md)** summarizes ScottPlot's origins and tracks development goals. If there is a pinned _Triaged Tasks and Features_ issue on the [issues page](https://github.com/ScottPlot/ScottPlot/issues), it likely indicates what I am currently working on.

* **Contributions are welcome!** See [contributing.md](CONTRIBUTING.md) to get started

### About ScottPlot

ScottPlot was created by [Scott W Harden](https://swharden.com/about/) (with many contributions from the open-source community) and is provided under the permissive [MIT license](LICENSE).

repository: Jeongwonkyu/ScottPlot

repo_name: Jeongwonkyu/ScottPlot


text:
Changelog
=========

Release 5
---------

* 5.0.0 Upgraded to PHPUnit 8.0

Release 4
---------

* 4.2.1 Tested with PHP 7.2 & 7.3; Documentation clean-up

* 4.2.0 Added support for Symfony 4 and removed support for Buzz (API changed)

* 4.1.0 Added FixedDateTimeTrait

* 4.0.0 Version 4 uses new fixture filenames to better support case insenstive file systems.
        Please delete and re-create all existing fixtures.

Release 3
---------

* 3.0.2 Removed deprecated Guzzle 3.9.3 support

* 3.0.1 Merged pull requests; improved composer.json and documentation

* 3.0.0 PHP 7, PSR-4 and PHPUnit 6 compatibility

Release 2
---------

* 2.1.0 Marking release as compatible with PHP >= 7.0

* 2.0.14 Using PHPUnit < 6.0

* 2.0.13 Improved swift mailer test double

* 2.0.12 Added support for swift mailer

* 2.0.11 Added FixedDateTime

* 2.0.10 Doctrine DBAL: Added switch to hide fixture related warnings

* 2.0.9 Fixed bug in Doctrine rollBack()

* 2.0.8 Fixed bug in Doctrine Connection class

* 2.0.7 Improved Riak client

* 2.0.6 Improved Riak fingerprinting

* 2.0.5 Added Basho\Riak support

* 2.0.4 Improved fingerprinting for fixtures

* 2.0.2 Adapted TestContainerBuilder for Symfony >= 2.8

* 2.0.1 Improved TestContainerBuilder, documentation and code formatting

* 2.0.0 Upgraded to Symfony 3.0

Release 1
---------

* 1.2.0 Upgraded to Symfony 2.8

* 1.1.1 Fixed issue in getTestBasePath()

* 1.0.3 Added support for unserializable results

* 1.0.2 Improved doctrine dbal transaction handling

* 1.0.1 useFixtures with empty argument disables fixtures

* 1.0.0 Stable release; Added support for Doctrine transactions

repository: lastzero/test-tools

gha_language: PHP

repo_name: lastzero/test-tools


text:
## Custom mapping for Monster

In the placement operation without prior merging ('none' or 'expand'),
a custom mapping can be supplied to the placement operation
in the form `{'hit1': {1: 2, 3: 4}, 'hit2': {1: 6, 2: 8}}`, where for some hits,
specified by name (_i.e._ `mol.Prop('_Name')`), is assigned the required correspondence between
hit atom index and followup atom index.

In `monster/mcs_mapping` and `monster/_place_modes/_expand.py` is the code that allows this.
In particular the `SpecialCompareAtoms` class is used to control the MCS comparison.

### SpecialCompareAtoms
The mapping as discussed in GitHub issue #23 is in the format

    mapping = { 'hit1': {1:1,2:5} 'hit2': {3:3,4:4,4:6}}

The hit index is first, followup index is the second.
The index `-1` for a followup index is the same as not providing the hit index,
it is described here solely for clarity not for use.

    mapping = { 'hit1': {1:1,2:5, 3:-1} 'hit2': {3:3,4:4,4:6}}

The index `-2` for a followup index will result in the hit atom index
not matching any followup index.

    mapping = { 'hit1': {1:1,2:5, 3:-2} 'hit2': {3:3,4:4,4:6}}

If ``exclusive_mapping`` argument of `SpecialCompareAtoms.__init__` is True,
then if a followup index is present in one hit, but not in a second hit,
then no atom of the second hit will match that followup atom.
A negative index for a hit atom index means that no atom in that hit will match the
corresponding followup index.

    mapping = { 'hit1': {1:1,2:5,-1:3, -2: 7} 'hit2': {3:3,4:4,4:6}}

However, a positive integer on a different hit overrides it, therefore,
in the above followup atom 3 cannot be matched to any atom in hit1, but will match
atom 3 in hit2. Followup atom 7 will not match either.

### Filters

However, this does not prevent the result being a mapping without those indices.
For that the method `Monster.get_mcs_mappings` makes sure that the mapping does contain those atoms.

### Example

A nice test case comes from an [Angewandte Chemie paper](https://onlinelibrary.wiley.com/cms/asset/fb95854c-3379-4533-912f-d98736bb627c/anie202204052-toc-0001-m.png)
with the following merger:

![merger](https://onlinelibrary.wiley.com/cms/asset/fb95854c-3379-4533-912f-d98736bb627c/anie202204052-toc-0001-m.png)

This is a nice case because it features a troublesome mapping, because the primary hit, F04,
which looks like a Hantzsch thiazole synthesis product, presents can be flipped either way
upon investigation of the crystal map
and the followup bold4 is indeed a flipped merger.
Therefore, without a custom_map the followup is incorrect.

Where I to make a flipped thiazole F04 I could do:
```python

with Chem.SDMolSupplier('test_mols/5SB7_mergers.sdf') as reader:
    mols = list(reader)

monster = Monster([mols[0]])
monster.place(Chem.Mol(mols[0]),    # it technically saves a copy already, but one should always be careful
              merging_mode='expansion',
              custom_map={'F04': {-1: 4,  # no amine
                                  4: -2,  # no amine
                                  12: 12,
                                  6: 13,
                                  13: 6,
                                  15: 14,
                                  14: 15}}
              )
monster.show_comparison()
monster.to_nglview()
```
This requires identifying the atom indices.
To find out the atom indices I could do:
```python
monster.draw_nicely(monster.positioned_mol)
```

**Nota bene maxime**: atom indices change when going from a Chem.Mol to SMILES.
In SMILES and mol files the atom indices are as they are read. But when you do the conversion
`Chem.MolToSmiles(mol)` the indices are changed. Therefore, for Victor,
which before May 2022 (v. 0.9) accepted only SMILES,
one should get the followup index atoms as they appear in the SMILES.
When a followup in the format `Chem.Mol` is passed to `Victor.place` (`funtools.singledispatchmethod` overloaded)
the staticmethod
`Monster.renumber_followup_custom_map` is called to fix these allowing one to provide the indices
as they are in the Chem.Mol, which are renumbered behind the scenes. However,
calling `Monster.convert_origins_to_custom_map` will return indices in the renumbered format, so cannot be used
as a reference (unless `Monster.renumber_followup_custom_map` is used on it to convert this
from monster.position_mol to the actual original mol).

To find out how the two hits look in 3D, I could do:
```python
monster.to_nglview()
```

```python
from fragmenstein import Igor

Igor.init_pyrosetta()

victor = Victor(hits=mols[:2], pdb_filename='template.pdb', ligand_resi='1X')

victor.place(mols[3],
             long_name=mols[3].GetProp('_Name'),
              merging_mode='expansion',
             custom_map={'F36': {1: 7},
                          'F04': {0: -1,  # no amine
                                  -1: 7,  # no amine
                                  13: 5,  # to N
                                  12: 13,  # root to Ph
                                  6: 14,  # to C
                                  }
                          }

              )
victor.show_comparison()
victor.to_nglview()
victor.validate(mols[3])['reference2minimized_rmsd'] < 1
```

repository: matteoferla/Fragmenstein

gha_language: Python

gha_license_id: MIT

repo_name: matteoferla/Fragmenstein


text:
# Xanthochrous fulvus (Scop.) Pat., 1897 SPECIES

#### Status
SYNONYM

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

#### Published in
Tabl. analyt. Fung. France (Paris) 53 (1897)

#### Original name
Boletus fulvus Scop., 1772

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Basidiomycota/Agaricomycetes/Polyporales/Polyporaceae/Fomes/Fomes fulvus/ Syn. Xanthochrous fulvus/README.md

repo_name: mdoering/backbone


text:
# Spark REST Template

[![Build Status](https://travis-ci.org/michalkowol/sparkjava-template.svg?branch=master)](https://travis-ci.org/michalkowol/sparkjava-template)
[![Coverage Status](https://codecov.io/github/michalkowol/sparkjava-template/badge.svg?branch=master)](https://codecov.io/github/michalkowol/sparkjava-template?branch=master)

## Architecture

### Package By Feature

Package-by-feature uses packages to reflect the feature set. It tries to place all items related to a single feature (and only that feature) into a single directory/package. This results in packages with high cohesion and high modularity, and with minimal coupling between packages. Items that work closely together are placed next to each other. They aren't spread out all over the application. It's also interesting to note that, in some cases, deleting a feature can reduce to a single operation - deleting a directory. (Deletion operations might be thought of as a good test for maximum modularity: an item has maximum modularity only if it can be deleted in a single operation.)

Source: http://www.javapractices.com/topic/TopicAction.do?Id=205

### HTTP

Thread HTTP only as your transporting layer. Try to avoid leaking HTTP logic into your briskness logic. Utilize **domain-driven design**.

## Build

### Default

```bash
gradle
```

### Build

```bash
gradle build
```

### Run

```bash
gradle run
```

### Tests

```bash
gradle check
```

### Continuous tests

```bash
gradle test -t
```

or

```bash
gradle test --continuous
```

### Integration tests

```bash
gradle integrationTest
```

### FatJar

Sometimes you need to remove jars signatures:

`build.gradle`:

```groovy
// ...
task fatJar(type: Jar) {
    baseName = "${project.name}-assembly"
    manifest = jar.manifest
    exclude('META-INF/*.SF')
    exclude('META-INF/*.DSA')
    exclude('META-INF/*.RSA')
    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
    with jar
}
// ...
```

```bash
gradle fatJar

java -jar build/libs/${NAME}-assembly-${VERSION}.jar

java -Denvironment=dev -jar build/libs/${NAME}-assembly-${VERSION}.jar
java -Denvironment=qa -jar build/libs/${NAME}-assembly-${VERSION}.jar
java -Denvironment=staging -jar build/libs/${NAME}-assembly-${VERSION}.jar
java -Denvironment=production -jar build/libs/${NAME}-assembly-${VERSION}.jar
```

### Code coverage

```bash
gradle jacocoTestReport
open build/jacocoHtml/index.html
```

## PostgreSQL

### Docker

```bash
docker run --name softwareberg-postgres-db -p 5432:5432 -e POSTGRES_DB=softwareberg -e POSTGRES_USER=softwareberg -e POSTGRES_PASSWORD=softwareberg -d postgres:9.6
```

### Library

`build.gradle`:

```groovy
// ...
dependencies {
    // ...
    compile 'org.postgresql:postgresql:9.4.+'
    // ...
}
// ...
```

### Configuration

`application.properties`:

```properties
# ...
datasource.jdbcUrl=jdbc:postgresql://localhost:5432/softwareberg
datasource.username=softwareberg
datasource.password=softwareberg
# ...
```

## Heroku

### Test on local

```bash
heroku local web
```

### Deploy

```bash
heroku login
heroku create
git push heroku master
heroku logs -t
```

or

```bash
heroku git:remote -a NAME_OF_APP
git push heroku master
heroku logs -t
```

https://sparkjava-template.herokuapp.com/

## IntelliJ

Remember to turn on "Annotation Predecessors"

![Annotation Processors](docs/annotation-processors.png)

## Server side rendering

As server side rendering template I recommend [Thymeleaf](http://www.thymeleaf.org/) or (for very simple pages) [Mustache](https://mustache.github.io/).

To use Thymeleaf with Spark you need to include `Thymeleaf ResponseTransformer` in `build.gradle`

```groovy
compile 'com.sparkjava:spark-template-mustache:2.5.+'
```

and then add it to router

```java
// ...
ThymeleafTemplateEngine templateEngine = // ...
// ...
// hello.html file is in resources/templates directory
ImmutableMap.of("name", "Sam")
get("/hello", (request, response) -> new ModelAndView(map, "hello"), templateEngine);
// ...
```

license: ISC

repository: michalkowol/sparkjava-template

repo_name: michalkowol/sparkjava-template


text:
---
layout: post
title:      "Binary Search Tree"
date:       2018-05-29 16:20:01 +0000
permalink:  binary_search_tree
---

A Binary Search tree is a tree data structure. There is a root node. The node can have at most two children. Each left child has a value that is less than the parent’s value and each right child has a value greater to the parent’s value. I will be going over a few methods such as `add(data)`, `findMinNode()`, `findMaxNode()` and `search(value)`.

In order to create a tree, we need a node. Here is an example of a Node class:

```
class Node {
  constructor(data) {
    this.data = data;
    this.left = null;
    this.right = null;
  }
}

```

We will create a Binary Search Tree class:

```
class BinarySearchTree {
  constructor() {
    this.root = null;
  }
}

```

We are going to create an add method to add value to the binary search tree. If there is no root, the root would be set to the new value. If the value is less than the currentNode's value, we would go left until there is no left node. The new value becomes the left node. If the value is greater than the currentNode's value, we would go right until there is no right node and the new value becomes the right node.

```
add(data) {
  if (!this.root) {
    this.root = new Node(data);
    return;
  }

  let currentNode = this.root;
  while (currentNode) {
    if (data < currentNode.data) {
      if (!currentNode.left) {
        currentNode.left = new Node(data);
        return;
      } else {
        currentNode = currentNode.left;
      }
    } else {
      if (!currentNode.right) {
        currentNode.right = new Node(data);
        return;
      } else {
        currentNode = currentNode.right;
      }
    }
  }
}
```

We are going to find the node with the minimum value by going through the left nodes:

```
findMinNode() {
  let current = this.root;
  while (current.left !== null) {
    current = current.left;
  }
  return current.data;
}
```

We are going to find the node with the maximum value by going through the right nodes:

```
findMaxNode() {
  let current = this.root;
  while (current.right !== null) {
    current = current.right;
  }
  return current.data;
}
```

We will search for the node with the specified value:

```
search(value) {
  let current = this.root;
  if (current.data === value) {
    return current;
  } else if (value < current.data && current.left !== null) {
    current.left.search(value);
  } else if (value > current.data && current.right !== null) {
    current.right.search(value);
  }
  return null;
}
```


text:
#How to install App on Win10 device

## Win10 PC

- Download [Release package](https://github.com/Myfreedom614/SOPerformanceTool/releases), x86/x64 based on your architecture
- Unzip file and open Windows PowerShell as administrator
![PowerShell][openpowershell]
- Run ps script: .\Add-AppDevPackage.ps1
**Note, if you get the exception about execution policies, please see this document: [about_Execution_Policies](https://technet.microsoft.com/library/hh847748.aspx?f=255&MSPPError=-2147217396)**

  Generally: `Set-ExecutionPolicy -ExecutionPolicy Unrestricted`
  ![Run PowerShell script][exepowershell]

  If you see "Success: Your app was successfully installed", congratulations:)
  ![Installation successfully][exepowershellsuc]

## For Windows 10 Anniversary Update(14393) or later version

- Download .appx
- Ref **Appx package deployment** section in [here](https://msdn.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-deploy-and-debug)
1. In File Explorer, right click an appx that you've signed with a test cert and choose **Properties** from the context menu.
2. Click or tap the **Digital Signatures** tab.
3. Click or tap on the certificate and choose **Details**.
4. Click or tap **View Certificate**.
5. Click or tap **Install Certificate**.
6. In the **Store Location** group, select **Local Machine**.
7. Click or tap **Next** and **OK** to confirm the UAC dialog.
8. In the next screen of the Certificate Import Wizard, change the selected option to **Place all certificates in the following store**.
9. Click or tap **Browse**. In the Select Certificate Store window, scroll down and select **Trusted People** and click or tap **OK**.
10. Click or tap **Next**. A new screen appears. Click or tap **Finish**.
11. A confirmation dialog should appear. If so, click **OK**. If a different dialog indicates that there is a problem with the certificate, you may need to do some certificate troubleshooting.

    Note: For Windows to trust the certificate, the certificate must be located in either the **Certificates (Local Computer) > Trusted Root Certification Authorities > Certificates** node or the **Certificates (Local Computer) > Trusted People > Certificates** node. Only certificates in these two locations can validate the certificate trust in the context of the local machine. Otherwise, an error message that resembles the following string appears:

    > "Add-AppxPackage : Deployment failed with HRESULT: 0x800B0109, A
    > certificate chain processed, but terminated in a rootcertificate which
    > is not trusted by the trust provider. (Exception from HRESULT:
    > 0x800B0109) error 0x800B0109: The root certificate of the signature in
    > the app package must be trusted."
- Double-click .appx to install

## Win10 Mobile

Comming soon...

[openpowershell]: ../img/powershelladmin.jpg "open Windows PowerShell as administrator"
[exepowershell]: ../img/runpowershell.jpg "run PowerShell script"
[exepowershellsuc]: ../img/runpowershellsuccess.jpg "Installation successfully"
[installcer1]: ../img/installcer1.jpg "Step 1"
[installcer2]: ../img/installcer2.jpg "Step 2"


text:
# Current module

A module with respect to which the operations are performed. By default, this module loads from the file .will.yml of the current directory or from a pair of files .im.will.yml and .ex.will.yml.

```
.
├── proto
│     ├── files
│     │     ├── one.will.yml
│    ...    ├── two.will.yml
│          ...
├── .will.yml
├── all.will.yml
├── second.will.yml
└── super.will.yml
 ```

  In order to make the current module the module with the named `willfile`, please execute the command `.with`. Do not forget to specify the name of the corresponding `willfile`. For instance by the implementation
  ```
  will .with second .build
  ```
  the current module will be the module with the file `second.will.yml.`.

   By implementation of `.each` each module will be loaded in sequence.
   ```
   will .each . .build`.
   ```
  This command will build each module in the current directory.

  Named `willfile` is not possible to make the current `willfile` without using the `.with` or `.each` commands.

repository: Wandalen/willbe

gha_language: JavaScript

repo_name: Wandalen/willbe


text:
# FullstackReactCode Example Server

This server has been built from the course on Udemy.com. You can find this course [here](https://www.udemy.com/node-with-react-fullstack-web-development)

### Prerequisites

Is necessary have any text editor to have changes, mine is
* [Visual Studio Code](https://code.visualstudio.com/download) - The edit text used

Required:
* [NodeJs](https://nodejs.org/en/download/current/) - Server JavaScript

## Deployment

Open the terminal and go to the proyect folder

```
cd C:\Users\USERNAME\Proyects\serveremailnode
```

now write in the terminal 'node index.js'

```
node index.js
```

open the browser in http://localhost:5000/

```
http://localhost:5000/
```

Can see the proyect in real server
https://emailservernode.herokuapp.com/

## Built With

* [npm](https://www.npmjs.com/package/npm/v/6.4.0) - JavaScript Package manager
* [node](https://nodejs.org/en/blog/release/v8.11.1/) - Server JavaScript
* [express](https://expressjs.com/en/changelog/4x.html) - The node framework

## Contributing

Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.

## Authors

* **Estela Medrano** - *Initial work* - [serveremailnode](https://github.com/divae/serveremailnode)
* **Stephen Grider** - *The course* - [FullstackReactCode](https://github.com/StephenGrider/FullstackReactCode)

## License

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

## Helper Documents

* [test](https://puppet.com/docs/pipelines-for-apps/team/application-nodejs-mocha.html) - example testing

repository: divae/serveremailnode

repo_name: divae/serveremailnode


text:
## Changelog for package rmf_fleet_adapter

1.4.0 (2021-09-01)
------------------
* Add read_only_blockade adapter: [#110](https://github.com/open-rmf/rmf_ros2/pull/110)
* Accommodate finishing tasks: [#108](https://github.com/open-rmf/rmf_ros2/pull/108)
* Check if lane request's fleet_name is equal to the fleet's fleet_name: [#95](https://github.com/open-rmf/rmf_ros2/pull/95)
* Find nearest waypoint among starts: [#98](https://github.com/open-rmf/rmf_ros2/pull/98)

1.3.0 (2021-06-07)
------------------
* Add API for opening and closing lanes: [#15](https://github.com/open-rmf/rmf_ros2/pull/15)
    * Added `open_lanes` and `close_lanes` CLI tools for issuing requests
* Allow Traffic Light APIs to update the location of a robot while it is idle: [#270](https://github.com/osrf/rmf_core/pull/270)
* Allow TrafficLight and EasyTrafficLight API to update battery level: [#263](https://github.com/osrf/rmf_core/pull/263)
* Migrating to a task dispatcher framework: [#217](https://github.com/osrf/rmf_core/pull/217)
    * The `rmf_fleet_adapter::agv` component interacts with a dispatcher node over topics with `rmf_task` prefix as specified in `rmf_fleet_adapter/StandardNames.hpp`
    * Support for executing tasks at specified timepoints
    * Support for `Loop`, `Delivery`, `Clean` and `ChargeBattery` tasks
* Introduce ResponsiveWait: [#308](https://github.com/osrf/rmf_core/pull/308)
    * The new ResponsiveWait task phase can be used to have idle/waiting robots respond to schedule conflicts
    * Idle robots (robots that do not have an assigned task) will automatically enter ResponsiveWait mode

1.2.0 (2021-01-05)
------------------
* Automatically publish fleet states from the fleet adapter API: [#232](https://github.com/osrf/rmf_core/pull/232)
* Easy Traffic Light API: [#226](https://github.com/osrf/rmf_core/pull/226)
* Gridlock-proof Traffic Light Implementation: [#226](https://github.com/osrf/rmf_core/pull/226)

1.1.0 (2020-09-24)
------------------
* Traffic Light API: [#147](https://github.com/osrf/rmf_core/pull/147) [#176](https://github.com/osrf/rmf_core/pull/176) [#180](https://github.com/osrf/rmf_core/pull/180)
* Allow fleet adapters to adjust the maximum delay: [#148](https://github.com/osrf/rmf_core/pull/148)
* Full Control Fleet Adapters respond to emergency alarm topic: [#162](https://github.com/osrf/rmf_core/pull/162)
* Migrating to ROS2 Foxy: [#133](https://github.com/osrf/rmf_core/pull/133)
* Contributors: Chen Bainian, Grey, Kevin_Skywalker, Marco A. Gutiérrez, Rushyendra Maganty, Yadu

1.0.2 (2020-07-27)
------------------
* Always respond to negotiations: [#138](https://github.com/osrf/rmf_core/pull/138)

1.0.1 (2020-07-20)
------------------
* Interrupt dangling negotiation planning efforts to reduce memory usage: [#130](https://github.com/osrf/rmf_core/pull/130/)
* Trim the amount of system memory that is committed to a fleet adapter after each task: [#130](https://github.com/osrf/rmf_core/pull/130/)

1.0.0 (2020-06-23)
------------------
* Provides `rmf_fleet_adapter` library
    * The `rmf_fleet_adapter::agv` component can be used to develop a custom "Full Control" fleet adapter
    * `rmf_fleet_adapter/StandardNames.hpp` specifies topic names that are used for RMF integration
* Provides a prototype `read_only` fleet adapter implementation
    * This will be deprecated in the future in favor of a C++ API
    * To use this fleet adapter, you must implement a "read-only fleet driver" to talk to the fleet adapter using `rmf_fleet_msgs`
* Provides a deprecated `full_control` fleet adapter implementation
    * This is made to be backwards compatible with "full-control fleet drivers" that were developed in the early stages of RMF
    * New users should prefer to implement their own fleet adapter using the `rmf_fleet_adapter::agv` API
* Uses rxcpp to make the fleet adapters reactive and multi-threaded
* Has a known memory leak issue which will be resolved in a later release
* Contributors: Aaron Chong, Charayaphan Nakorn Boon Han, Marco A. Gutiérrez, Grey, Yadu, Yadunund, koonpeng, methylDragon


text:
- [ ] `package.json:version` has been updated with `npm version patch` (or `major/minor` as appropriate)
- [ ] `@brainhubeu/react-carousel` version has been updated in `docs-www/package.json` to the same which is in `package.json:version`

repository: udaypydi/react-carousel

repo_name: udaypydi/react-carousel


text:
# StaticMode [![Build Status](https://travis-ci.org/RossBencina/StaticMode.svg?branch=master)](https://travis-ci.org/RossBencina/StaticMode) [![Build status](https://ci.appveyor.com/api/projects/status/wa3jhi8w8xject7a/branch/master?svg=true)](https://ci.appveyor.com/project/RossBencina/staticmode/branch/master)

StaticMode is a small header-only C++11 library that can help you to
implement overload-based function selection (sometimes called tag dispatch).
Unlike typical uses of tag dispatch, StaticMode is intended for use in
public APIs.

The key type in StaticMode is the`Mode` template, which you use to define mode
constants (analogous to `enum` members or `constexpr` `std::integral_constant`
instances). The defining features of StaticMode are:

1. Modes from different categories can be combined using the `|` operator,
allowing multiple modes to be passed using a familiar flag-like syntax.
2. StaticMode uses the type system to enforce constraints
on mode expressions, yielding compile-time errors for incorrect mode usage,
such as combining mutually exclusive modes. StaticMode also supports
default modes, and checking that functions are called with only supported modes.
3. StaticMode executes at compile-time. `Mode` and related types have
no runtime representation (they are empty structs). All features are
implemented at the type level, or with `constexpr`.

StaticMode is defined in a single header file:
[`include/StaticMode.h`](include/StaticMode.h). To use StaticMode, simply
include this header file in your project.

StaticMode has no dependencies and requires only
a working C++11 compiler. StaticMode is compatible with MSVC 2015 SP3
(but see [`docs/MSVC-2015.md`](docs/MSVC-2015.md) for information about
client code compatibility).

> **Status:** So far the code has one known user: me.
I'm happy to evolve StaticMode to be more useful for other people.
If you can see ways to improve the API, or have additional requirements,
please open a ticket and we can discuss. -- Ross

## Minimal Example

A minimal example of how StaticMode can be used. Compilable source code for this example is here:
[`examples/minimal.cpp`](examples/minimal.cpp). )

```c++
#include "StaticMode.h"
```

Use an `enum class` to represent each mode category. Each member
of the `enum` represents a mode in that category.
Then use `constexpr Mode<>` to declare instances for each mode -- these are the
constant "mode flags" that you'll use in your code.

```c++
enum class LineStyle { dotted, dashed };

constexpr staticmode::Mode<LineStyle, LineStyle::dotted> dotted;
constexpr staticmode::Mode<LineStyle, LineStyle::dashed> dashed;

enum class EndStyle { arrow, circle };

constexpr staticmode::Mode<EndStyle, EndStyle::arrow> arrow;
constexpr staticmode::Mode<EndStyle, EndStyle::circle> circle;
```

Note that StaticMode treats modes within a mode category as mutually exclusive.
(e.g. a line can't be both dotted and dashed.) Keep this in mind when
defining your modes.

To use the modes you defined, create function overloads for each mode's type.
Here we use `decltype` to save repeating the full `Mode<...>` type of
each mode.

```c++
inline void drawLine_(decltype(dotted)) { std::cout << "....."; }
inline void drawLine_(decltype(dashed)) { std::cout << "-----"; }
inline void drawRightEnd_(decltype(arrow)) { std::cout << ">"; }
inline void drawRightEnd_(decltype(circle)) { std::cout << "o"; }
```

With this arrangement you can invoke the function overload
that applies to a particular mode by passing `Mode` instances as arguments.

```c++
drawLine_(dotted);
drawLine_(dashed);
drawRightEnd_(arrow);
drawRightEnd_(circle);
```

StaticMode implements `operator|` on `Mode` instances.
This lets you combine modes into *mode expressions* such as:

```c++
dotted|arrow;
dashed|circle;
dashed|dotted; // correctly fails to compile. can't be dashed *and* dotted
```

The last line will not compile because StaticMode enforces
mutual exclusivity within a mode category: A mode expression can contain
at most one mode from each category, but it can contain modes from any
number of separate mode categories. (Although this example shows only two
mode categories, any number of categories are supported.)

To write a function that accepts a mode expression as a parameter,
write a template a follows. Use the `get_mode_t` template to extract
individual modes from the mode expression:

```c++
template<typename ModeExpr=staticmode::ModeSet<> > // default to empty ModeSet
void drawLine(ModeExpr /*modes*/={}) {
    using lineStyle_t = staticmode::get_mode_t<LineStyle, ModeExpr, /*default:*/decltype(dashed)>;
    using endStyle_t = staticmode::get_mode_t<EndStyle, ModeExpr, /*default:*/decltype(arrow)>;

    drawLine_(lineStyle_t{});
    drawRightEnd_(endStyle_t{});
    std::cout << "\n";
}
```

This implementation of `drawLine()` can be called with mode expressions that
include both a line style and an end style. Either or both modes can be
omitted, in which case the default modes passed to `get_mode_t` will be used.

```
int main() {
    // example usage:
    drawLine(dotted|circle);
    drawLine(dotted); // defaults to arrow end style
    drawLine(circle); // defaults to dashed line style
    drawLine();       // defaults to dashed|arrow
}
```

StaticMode also includes type checking templates that you can use to
check whether a mode expression satisfies certain constraints such as
only containing specific mode categories, or requiring that certain
mode categories are present. See below for more details.

## More Examples and Documentation

The [`examples/`](examples) directory contains examples of how StaticMode can
be used. Each example has a descriptive comment at the top of the file.

For background and a detailed walk-through of the implementation techniques
used in StaticMode, the slides and code from Ross' talk at Melbourne C++
Meetup are available here:
[`docs/melb-cpp-talk-feb-2017/README.md`](docs/melb-cpp-talk-feb-2017/README.md).

## Additional Features

In addition to the `Mode` type, mode expressions, and the `get_type_t`
template, StaticMode provides the following features:

### `ModeType<T>` base class for each mode category

Each `Mode<T,X>` derives from a `ModeType<T>` base class. Continuing the
above example, this means that you could write a `drawLine_()` method that
matches any line style:

```c++
void drawLine_(staticmode::ModeType<LineStyle>) { std::cout << "/////"; }
```

This is useful when you want to implement a general case, and only write
specific overloads for a few modes.

### `Mode<T,X>` implements the `std::integral_constant` interface

`Mode<T,X>` implements all of the same members as `std::integral_constant`.
`Mode<T,X>` instances have a conversion operator that automatically
converts them to the underlying `enum class` value if needed.
`Mode` also implements `operator()` that returns the `enum class` value,
so that `Mode` instances can be used as function objects.

### `is_mode_expr` template

The `is_mode_expr` template can be used to check whether a function
argument is a mode expression. This can be used in combination with
`static_assert` to emit a compilation error (see examples).

### `has_no_other_modes` template

The `has_no_other_modes` template can be used to check that a function
argument doesn't reference any unsupported mode categories.
This can be used it in combination with `static_assert` to emit a
compilation error (see examples).

### `has_mode` template

The `has_mode` template can be used to test whether a mode expression
contains a representative of a particular mode category. This can be
used to implement required mode categories
(see [`examples/required-mode.cpp`](examples/required-mode.cpp)).

## Building and Running Tests and Examples (Requires Cmake)

This section covers building and running the tests and examples.
To use StaticMode you don't need to build anything, just include `StaticMode.h`.

Unit test source code is located at:
[`test/StaticMode_test.cpp`](test/StaticMode_test.cpp).

### Unix

To build and run the tests and examples on a Unix system, enter the
following commands at a shell prompt from the project root:

```
$ mkdir build
$ cd build
$ cmake ..
$ make
$ make test
```

If tests fail, the following command will re-run the tests with detailed output:

```
$ make CTEST_OUTPUT_ON_FAILURE=1 test
```

After running make you will find the example executables in `build/examples`.

### Windows

From a Visual Studio command prompt in the project root directory, the following
commands can be used to create a Visual Studio Solution in the `build\`
directory.

```
> mkdir build
> cd build
> cmake ..
```

---
All files in this repository are Copyright © 2017 Ross Bencina,
except where otherwise indicated.
For the license, please see the LICENSE file in the repository root (MIT license).

repository: RossBencina/StaticMode

repo_name: RossBencina/StaticMode


text:
#Changelog

## 2.0.0 - 2019-xx-xx
  - Remove template management functionality. Keep the functionnality to its core, the templating engine.
	- Transform array to several parameters with value operator {{= array }}

## [1.2.0] - 2016-02-28
	- Add an usage example for tonicdev on npm
	- Will now keep the line breaks in the generated template

## [1.1.0] - 2016-01-19
	- Add support for tags {{ }} to write simple javascript code in your sql templates

## 1.0.0 - 2016-01-17
	- First release

[1.2.0]: https://github.com/enzuo/sql-moduleon/compare/v1.1.0...v1.2.0
[1.1.0]: https://github.com/enzuo/sql-moduleon/compare/1.0.0...v1.1.0

repository: Enzuo/sql-moduleon

repo_name: Enzuo/sql-moduleon


text:
 desklab Arduino Library

zur deutschen Version dieser Datei

`desklab` is an Arduino library implementing methods for the use of desklab (www.desk-lab.de) devices. It is availabe via the Arduino Library Manager and easy to use with the Arduino IDE. Originally designed to be used with desklab devices and their specific hardware it could also be used in any other preferred toolchain to build software for many boards based on Atmel-AVR-Microcontrollers.

#### Hardware Compatibility
  - `desklab Photometer V2`
  - `desklab Photometer V3`

### Development & Contribution
Contributions in the form of reporting issues or submitting pull requests are welcome! Please use the available tools as described here to ensure your changes of the code could be merged. As this library addresses a special group of users (students/teachers) and must retain compatibility to the devices developed by desklab (some of which may not be public yet), there may be some additional requirements, which can not be covered by automated tests. Therefore you should not hesitate to contact us via<EMAIL_ADDRESS>or by opening an issue, if you are planning to contribute to this project, such that we could discuss the best way to go forward. Submitted code changes are understood to be under the same MIT License that covers the project.

##### Arduino Lint
Install `arduino-lint` by following the instructions in the [official arduino-lint documentation](https://arduino.github.io/arduino-lint/latest/installation/). Please use the linter with the same options as our CI workflow:

```bash
# Launch linting
arduino-lint --library-manager update --compliance strict
```

##### Unit-Tests & compilation of examples
A set of unit-tests is located in the `/test`-folder. If you are adding some logic to the library which could be unit-tested, make sure to cover this with some additional tests. To be able to launch the tests locally you have to install the `arduino-ci` ruby gem by:

```bash
# Install test requirements:
gem install bundler
bundler config set --local path vendor/bundle  # optional
bundler install
```

While we are using the `arduino/compile-sketches`-action in our CI workflow, you could also start the compilation of all examples with the same command as launching the tests. If you only want to run the tests, you can add the option `--skip-examples-compilation`:

```bash
# Run the tests and compile examples
bundle exec arduino_ci.rb

# Run the tests
bundle exec arduino_ci.rb --skip-examples-compilation
```

#### Docs

**Sphinx** is used to build the documentation. You can install it inside a new `conda` environment with:

```bash
conda create -n desklab-arduino lib python=3.9
pip install sphinx sphinx-rtd-theme breathe
```

You also have to install **Doxygen**. To build the docs execute the following commands inside the `docs` directory:

```bash
conda activate desklab-arduino-lib
make clean
make html
```

The docs are served through GitHub Pages at [support.desk-lab.de](https://support.desk-lab.de).

### License

The `desklab` library is licensed under the [MIT License](https://opensource.org/licenses/MIT):

> Copyright 2018-2021 desklab gUG (haftungsbeschränkt<EMAIL_ADDRESS>
>
> Permission is hereby granted, free of charge, to any person obtaining a
> copy of this software and associated documentation files
> (the "Software"), to deal in the Software without restriction, including
> without limitation the rights to use, copy, modify, merge, publish,
> distribute, sublicense, and/or sell copies of the Software, and to
> permit persons to whom the Software is furnished to do so, subject to
> the following conditions:
>
> The above copyright notice and this permission notice shall be included
> in all copies or substantial portions of the Software.
>
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
> ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
> CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
> WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE

repository: desklab/desklab-arduino-lib

gha_language: C

repo_name: desklab/desklab-arduino-lib


text:
# Cursor Invis

An HTML5 remake of the flash game "Cursor Invisible".
Play it on [github pages](https://ericmchoi.github.io/cursor-invis/).

## Description

Shortly after the game begins, your cursor will slowly begin to disappear.
Your objective is to break as many targets as possible before your timer runs out, _without missing_.
Try and achieve a high score!

repository: ericmchoi/cursor-invis

repo_name: ericmchoi/cursor-invis


text:
---
title:  Update Datasets
summary: ""
sidebar: suite_sidebar
permalink: suite-update-datasets.html
---

To trade live, strategies need to be able to access up-to-date information to make trading decisions.

The bot that extracts raw trades data from the exchange and those which process the raw data to generate elaborate datasets, like indicators and other technical studies, need to be running at all times while trading live.

When you ran your first backtesting session, you first had to run a task that controls the trading bot and the specific process involved in calculating the backtests.

The bots that keep your datasets up to date are too controlled by a task manager and tasks, within the Network hierarchy.

| Superalgos Network | Network Node | Task Manager | Task | Sensor | Indicator |
| :---: | :---: | :---: | :---: | :---: | :---: |
| ![network](https://user-images.githubusercontent.com/13994516/66855353-59ed7800-ef83-11e9-8de9-db40971faa7b.png) | ![network-node](https://user-images.githubusercontent.com/13994516/66855357-5a860e80-ef83-11e9-917d-95cd8394588b.png) |![task](https://user-images.githubusercontent.com/13994516/66308205-ca9eef80-e906-11e9-8864-f7dba886bc7d.png) | ![timeline](https://user-images.githubusercontent.com/13994516/67079956-73b1d980-f194-11e9-89e0-9c8d1ea2ad1d.png) | ![bot-sensor](https://user-images.githubusercontent.com/13994516/67079734-000fcc80-f194-11e9-911d-2b537e4cb8f2.png) | ![bot-indicator](https://user-images.githubusercontent.com/13994516/67079733-000fcc80-f194-11e9-98d7-3426dd956d65.png) |

Open up the design space section of the system by dragging the horizontal bar upwards. You may also use Alt + ↑ on your keyboard. This shortcut closes the Charts and opens the design space.

Hit Ctrl or ⌘ + Alt + D (*D* for *Datasets*) to go to the *Masters Datasets* task manager that controls the aforementioned bots. Open the menu and click *Run All Tasks*.

[![Update-datasets-01-Run](https://user-images.githubusercontent.com/13994516/70341428-304e2000-1853-11ea-8158-8c59b56995fb.gif)](https://user-images.githubusercontent.com/13994516/70341428-304e2000-1853-11ea-8158-8c59b56995fb.gif)

You just started the *sensors* that extract live data from the exchange and the *indicators* that process raw trades data.

The data you downloaded spans from the date of the start of the market to the date of the release. Before you start trading live, the bots need to run for a while so as to catch up with the present time.

You will not see any immediate effect in your browser, but notice how your console application is buzzing with activity:

[![Getting-Started-Guide-05-Console](https://user-images.githubusercontent.com/13994516/67233532-b8af6780-f443-11e9-98e0-8efec4a305fe.gif)](https://user-images.githubusercontent.com/13994516/67233532-b8af6780-f443-11e9-98e0-8efec4a305fe.gif)

> **NOTE:** To know when datasets are up to date, you may find Paula under the Masters Datasets task manager, click ![plus](https://user-images.githubusercontent.com/13994516/70042962-121cc180-15c0-11ea-8322-018f78524f39.PNG) on its menu and notice the date displayed under the *Daily* process. When this date reaches the present time, chances are all other datasets will be up to date as well. You may also check your console and study the logs to see if all bots are processing the current date-time.

[![Update-datasets-02-Paula](https://user-images.githubusercontent.com/13994516/70341574-89b64f00-1853-11ea-8552-109bb90989ac.gif)](https://user-images.githubusercontent.com/13994516/70341574-89b64f00-1853-11ea-8552-109bb90989ac.gif)

In our experience, it may take from 5 to 20 minutes per day's worth of Poloniex data to be processed. The time it will take for these processes to complete the job depends on several things:

* The date of the release tells you how many days you are behind with the dataset you just downloaded.

* The speed and processing power of your machine will make a difference too.

* The average number of trades per day at the exchange determines the volume of data the system needs to retrieve and process.

* The number of trades the exchange returns per each request determines the size of the pipeline the exchanges allow API users to use.

These bots will keep running for as long as you keep the browser tab running the system open.

> **NOTE:** Remember no to close the console before closing the browser and allowing enough time for all processes to finish the current execution. Failing to do so may corrupt your data.

repository: Alex-Mishin/Superalgos

repo_name: Alex-Mishin/Superalgos


text:
**Process Killer Program**

This program displays in a scrollable window the result of **"ps -ef"**.

        The Display looks as Follows;

```                   Search Box
            .-----------------------.
            |   < search value >    |
            '-----------------------'
    .---------.  .--------------.  .--------.
    |  Find   |  | Kill Process |  |  Quit  |
    '---------'  '--------------'  '--------'

.-----------------------------------------------------.
|                      Display Window                 |
:                                                     :

:                                                     :
|                                                     |
'-----------------------------------------------------'
```

When the user enters a search value in the Search Box and
then entering a Carriage Return OR Clicking Find Button
will start the search function.

If the Search Value is **found** the line is highlighted.

if the Search Value is **Not Found** the test heading is highlighted.

Clicking on the Find Button will continue the search on the
line after the selected line. This will continue until
the last line matching the Search Value is found. If the search
if continued, by clicking Find Button, the search restarts at line 1.

Clicking on the Kill Process Button will issue a **"kill -9 *pid*"**
OS Command where *pid* is the actual *pid* on the selected line
and reload a fresh **"ps -ef"** list.

Obviously, clicking on the Quit Button causes the program to exit.

**Files:**

  * LICENSE
  * .gitignore
  * pkill.py
  * README.md


text:
# katexR htmlwidget

**note: pre-Alpha**

`katexR` is a R [`htmlwidget`](http://htmlwidgets.org) that brings the power of [KaTeX](http://khan.github.io/KaTeX) to R.  Try it out with a couple lines of code.

```R
#devtools::install_github("timelyportfolio/katexR")
library(katexR)
katex("\\KaTeX")

katex( "Var(X)= E(X^2)-(E(X))^2" )
```

More than likely you might like to integrate `katexR` in your other HTML content.  With `tags` from `htmltools`, we could put it all together like this.

```R
#devtools::install_github("timelyportfolio/katexR")
library(katex)
library(htmltools)

# use the example from the KaTeX site
html_print(
  tagList(
    tags$pre(
      "f(x) = \\int_{-\\infty}^\\infty
          \\hat f(\\xi)\\,e^{2 \\pi i \\xi x}
          \\,d\\xi"
    )
    ,tags$p( " will become this ")
    ,as.tags(
      katex(
        "f(x) = \\int_{-\\infty}^\\infty
            \\hat f(\\xi)\\,e^{2 \\pi i \\xi x}
            \\,d\\xi"
      )
    )
  )
)
```

Like all `htmlwidgets`, `katexR` will integrate beautifully with `rmarkdown`.  If you write research in `R`, I think you'll definitely want to try out `katexR`.

`katexR` is the `htmlwidget` of the week at [Building Widgets](http://buildingwidgets.org).  See the writeup on `katexR` and all of the other `htmlwidgets` from the project on the [blog](http://buildingwidgets.org/blog).

repository: timelyportfolio/katexR

gha_language: HTML

repo_name: timelyportfolio/katexR


text:
#

## Preparation

### Create user

Go to [IAM console](https://console.aws.amazon.com/iam/home?region=us-east-1#/home) and select Users / Add User, access type Programmable access

https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html

store in ~/.aws/credentials

the file format is

    [default]
    aws_access_key_id=NNN
    aws_secret_access_key=NNN

See http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html

Create group with following policies attached

* AmazonEC2FullAccess
* AmazonEC2SpotFleetRole
* IAMReadOnlyAccess

repository: tsaarni/cloud-playground

repo_name: tsaarni/cloud-playground


text:
---
weight: 99
title: Gloo Mesh
---

## What is Gloo Mesh?

Gloo Mesh is a Kubernetes-native **management plane** that enables configuration
and operational management of multiple heterogeneous service meshes across multiple
clusters through a unified API. The Gloo Mesh API integrates with the leading
service meshes and abstracts away differences between their disparate APIs, allowing
users to configure a set of different service meshes through a single API. Gloo
Mesh is engineered with a focus on its utility as an operational management
tool, providing both graphical and command line UIs, observability features, and
debugging tools.

![Gloo Mesh overview]({{% versioned_link_path fromRoot="/img/gloomesh-diagram.png" %}})

For more information about how Gloo Mesh works, check out the [core concepts that underpin Gloo Mesh]({{% versioned_link_path fromRoot="/concepts/concepts/" %}}).

### Getting to know Gloo Mesh

Gloo Mesh can be run in a dedicated cluster, or can be co-located with a service mesh in an existing cluster. From the management cluster, Gloo Mesh remotely operates and drives the configuration for specific service mesh control planes. This allows Gloo Mesh to discover service meshes and workloads, establish federated identity, and enable global traffic routing and load balancing across multiple remote clusters. Additionally, Gloo Mesh provides centralized access control policies, observability and monitoring, and more.

![Gloo Mesh architecture]({{% versioned_link_path fromRoot="/img/gloomesh-3clusters.png" %}})

For more information, check out the [Gloo Mesh architecture and components]({{% versioned_link_path fromRoot="/concepts/architecture/" %}}).

### Videos: Take a dive into Gloo Mesh

We've put together [a handful of videos](https://www.youtube.com/watch?v=4sWikVELr5M&list=PLBOtlFtGznBjr4E9xYHH9eVyiOwnk1ciK) detailing the features of Gloo Mesh.

## Contribution

There are many ways to get involved in our open source community and contribute to the Gloo Mesh Open Source project. Gloo Mesh Open Source would not be possible without the valuable work of projects in the community! To get started with contributing to code, documentation, and mode, see the [contributing guidelines]({{% versioned_link_path fromRoot="/contributing/" %}}).

## Questions and resources

- If you have questions, join the [#Gloo-Mesh channel](https://solo-io.slack.com/archives/CJQGK5TQ8) in the Solo.io Slack workspace
- Discover Gloo Mesh capabilities on the [product page](https://www.solo.io/products/gloo-mesh/)
- Learn more about [Open Source at Solo.io](https://www.solo.io/open-source/)
- Follow us on Twitter at [@soloio_inc](https://twitter.com/soloio_inc)

repository: dystudio/gloo-mesh

repo_name: dystudio/gloo-mesh


text:
# PyTorch Java Demo

This repository is a demonstration of how to use PyTorch from Java.

## Setup

Download and unpack libtorch nightly (or 1.4 or greater).
From the pytorch.org homepage under "Quick Start Locally",
make sure "LibTorch" is the selected package.
Linux is supported as of version 1.4.  Mac is supported as of version 1.5.
Linux and Mac are both supported in nightly builds.
Windows is not supported at this time.

Run `export LIBTORCH_HOME=/path/to/libtorch`.
The `build.gradle` file will use this to set `java.library.path`
when running the application.
If you are using PyTorch in your own environment,
`LIBTORCH_HOME` is not necessary.
Instead, you will need to set `java.library.path` to `/path/to/libtorch/lib`.

If using a nightly build, run `export USE_LIBTORCH_NIGHTLY=1`.

Run `./gradlew run` to build and run the demo application.
It will load `demo-model.pt` and run it on some simple data.
[This notebook](TorchScriptForJavaDemo.ipynb) was used to generate the model.

More information about the Java API and TorchScript:
- [TorchScript tutorial](https://pytorch.org/tutorials/beginner/Intro_to_TorchScript_tutorial.html)
- [TorchScript reference](https://pytorch.org/docs/stable/jit.html)
- [Loading TorchScript in C++](https://pytorch.org/tutorials/advanced/cpp_export.html)
- [PyTorch-style JavaDoc](https://pytorch.org/docs/stable/packages.html)
- [Standard JavaDoc](https://pytorch.org/javadoc/1.4.0/)
- [PyTorch Android tutorial](https://pytorch.org/mobile/android/)


text:
[Full Changelog][changelog]

✨ This release adds support for Hass.io Ingress 🎉
✨ This release adds support for storing your data in the MariaDB add-on 🎉

Besides this: major upgrades about every single thing inside this add-on ⬆

### 🚨Breaking change

The addition of Ingress makes this add-on not accessible directly. If you have added Traccar via an iframe panel, this release will break that. However, you can simply toggle the "Show in side bar" switch now 🎉

You can enable direct access again by going into the add-on configuration. A section is visible: "Network". Enter port `8072` (or anything else if you want) in the `disabled` field. Hit the "SAVE" followed by the "RESTART" button to make your iframe and others work as before.

### Changed

- :pencil2: Maintaince -> Maintenance
- :arrow_up: Upgrades add-on base image to v4.0.1
- :sparkles: Adds FUNDING.yml
- :arrow_up: Upgrades nginx to 1.16.0-r2
- :arrow_up: Upgrades nss to 3.44-r0
- :arrow_up: Upgrades openjdk8-jre to 8.212.04-r0
- :arrow_up: Upgrades Traccar to v4.5
- :sparkles: Adds Ingress support
- :hammer: Extends NGinx wait timeout for Traccar startup
- :books: Documents the use of MySQL/MariaDB with this add-on
- :art: Adds Ingress side bar icon
- :fire: Removes obsolete iframe panel documentation

[changelog]: https://github.com/hassio-addons/addon-traccar/compare/v0.4.0...v0.5.0

Questions? Join our Discord server! https://discord.me/hassioaddons
Enjoying my add-ons? Consider supporting my work: https://patreon.com/frenck

repository: Misak/repository

repo_name: Misak/repository


text:
# EE477_Final
This is the final project for ME477 at Saint Martin's University.  All .py files are modeled after the corresponding files in the [robotics_book_code](https://github.com/ricopicone/robotics-book-code) repository by ricopicone.

## Requirements

This repository was created for use with ROS Melodic Morenia and Ubuntu 18.04.4 (Bionic Beaver).

## Installation and configuration

1. After installing ROS and creating a workspace, fork the repository [EE477_Final](https://github.com/Violet-C/EE477_Final) on Github.

2. Clone the repository using the following command:
```bash
git clone https://github.com/Violet-C/EE477_Final
```
3. Build the workspace using:
```bash
catkin_make
```
4. Source the workspace using:
```bash
source devel/setup.bash
```
5. Update using `git` as desired.

# ROS package: violet_topics

This package has two pairs of a publisher node and a subscriber node.  One uses a custom message type to generate random complex numbers and print their real and imaginary parts to the screen.  The other prints out consecutive integers starting at 1.  Both will continue to run until ended by the user (Ctrl+C).

## Getting started

The nodes which produce random complex numbers can be started individually using:
```bash
roscore
```

```bash
rosrun violet_topics message_publisher.py
```

```bash
rosrun violet_topics message_subscriber.py
```

or by using the included launch file:
```bash
roslaunch violet_topics violet_message.launch
```

Similarly, the nodes which produce consecutive integers can be started individually using:
```bash
roscore
```

```bash
rosrun violet_topics topic_publisher.py
```

```bash
rosrun violet_topics topic_subscriber.py
```

or by using the included launch file:
```bash
roslaunch violet_topics violet_topic.launch
```

## Usage

Both pairs of nodes can be run at the same time.  The message publisher and subscriber use the topic 'complex', and the topic publisher and subscriber use the topic 'counter'.

# ROS package: violet_services

This package uses a server node and a client node to count the number of words in an input phrase, and prints this number to the screen in the form 'This is an input of 7 words --> has 7 words'.

## Getting started

The word counter can be started either by starting each node manually:

```bash
roscore
```

```bash
rosrun violet_services service_server.py
```

```bash
rosrun violet_services service_client.py This is an input of 7 words
```

or by using the included launch file:
```bash
roslaunch violet_services violet_service.launch words:="This is an input of 7 words"

```

## Usage

Any words may be used as input for the lauch command, but must always be entered in the form:

```bash
rosrun violet_services service_client.py Input words
```
or
```bash
roslaunch violet_services violet_service.launch words:="Input words"

```

# ROS package: violet_actions

This package uses a server node and client node to set a timer for up to 60 seconds.  Each second, the time elapsed and time remaining are printed to the screen.  After the timer finishes, it prints its exit status.  The timer will be exited with an error message if a timer over 60 seconds is requested or if the timer is preempted by the user before it finishes.  Commented code is included in  `violet_action_client.py` to test both of these cases.

## Getting started

The timer can be started either by starting each node manually:

```bash
roscore
```

```bash
rosrun violet_actions violet_action_server.py
```

```bash
rosrun violet_actions violet_action_client.py
```

or by using the included launch file:
```bash
roslaunch violet_actions violet_action.launch
```

## Usage

The timer duration in seconds is set in in `violet_action_client.py` using:
```bash
goal.time_to_wait = rospy.Duration.from_sec(5)
```
 The example above sets the timer for 5 seconds, and this command can be modified to set a timer for up to 60 seconds.

The timer can be preempted by the user with:
```bash
client.cancel_goal()
```
which is included as a commented line in `violet_action_client.py`.


text:
---
title: Vite FAQ
icon: circle-question
category:
  - FAQ
---

## Slow in a cold boot with Vite

This is the expected behavior. We are adding more features, which means we have 2× to 8× lines of code comparing with `@vuepress/theme-default` according to the functions you are using. So transpiling and sending the theme and plugins code to browser is expected to increase from `0.8s - 2s` in `@vuepress/theme-default` to `3s - 10s` (range due to machine performance).

::: info Tree-shaking burden

In order to fully support Tree-shaking in functionality and styles, themes and plugins do additional work, including modularization, partial injection, generation of temp files, etc. These extra behaviors ensure that unused feature code is removed at build stage, but it also means that more logic needs to be performed, and more fragmented files need to be loaded in development mode.

Dude, you can't expect to have the full power of tree-shaking support and still be extremely fast when the development server starts up, they are contradictory.

:::

::: info style system

In order to make component styles binding with component, we split the styles according to the component hierarchy and imported them in components, which greatly slowed down the speed.

- `@vuepress/theme-default` is placing all the styles together at `styles` folder and importing them entirely, so that `sass` will only need to compile once and vite only need to send 1 extra web request. That's why it's fast.

  But this will let style unbind with components, and they will be injected anyway. So that when you override a component or a layout, you have to override old styles to build styles you want.

- `vuepress-theme-hope` is binding styles with components, but that means `sass` has to compile styles for each component, and vite need to send an extra request for each component. Due to `vuepress-theme-hope` has 2× to 6× components (depending on whether you enable blog features or not) comparing with `@vuepress/theme-default`, it will take extra time of `2.4s - 4s` for that.

  But, you can easily override a component together with its styles in this way.

So, due to the above reasons, `vuepress-theme-hope` will have an average of 4× code and 10× requests comparing with `@vuepress/theme-default`, so the time increasing from `2s` to `10s` is reasonable and expected.

:::

::: tip No effect on HMR and online speed

don't worry, the above extra overhead mainly exists in code boot. Due to the large size of code in development environment, the corresponding time will also increase after refreshing.

- These extra overheads do not affect HMR, so when editing the Markdown file, the page's HMR response can still remain at the 100 ms level.

- Unused code twill be removed during the build phase with well design, so the production environment usually only adds additional 200 KB - 500 KB size in JS entry comparing the default theme and about 100 ms of extra script execution time, so the online impact is very small.

:::

## `@import()` in CSS does not work

In VuePress2, importing web CSS via `@import` in `index.scss` has no effect. You may need to manually import it in the `head` option of your VuePress configuration.

<!-- ```js 5-13}
import { defineUserConfig } from "vuepress";

export default defineUserConfig({
  head: [
    [
      "link",
      {
        rel: "preload",
        as: "style",
        onload: 'this.onload=null;this.rel="stylesheet"',
        href: "//at.alicdn.com/t/c/font_2410206_5vb9zlyghj.css",
      },
    ],
  ],

  // ...
});
``` -->

::: code-tabs#language

@tab TS

```ts {5-11}
import { defineUserConfig } from "vuepress";

export default defineUserConfig({
  head: [
    [
      "link",
      {
        rel: "stylesheet",
        href: "YOUR_CSS_URL",
      },
    ],
  ],

  // ...
});
```

@tab JS

```js {3-9}
export default {
  head: [
    [
      "link",
      {
        rel: "stylesheet",
        href: "YOUR_CSS_URL",
      },
    ],
  ],

  // ...
};
```

:::

::: info Reason

1. CSS imported via `@import` in Sass will be compiled into standard CSS `@import` syntax.
1. The CSS `@import` syntax only works at the top of css file.
1. To give user styles a higher priority, we will import user styles after theme and plugin styles.
1. During vite builds VuePress2 app, all styles are compressed into a single CSS file.

The above results in the user's CSS `@import` imports in Sass appearing in the middle of the final CSS file and thus invalid.

The default theme also has the same problem, and this cannot be fixed on the theme side.

:::

repository: vuepress-theme-hope/vuepress-theme-hope

gha_language: TypeScript

repo_name: vuepress-theme-hope/vuepress-theme-hope


text:
---
id: hello-world
title: Hello World!
sidebar_label: Hello World!
---

**Full source code:** [examples/cpu-count](https://github.com/neon-bindings/examples/tree/main/examples/cpu-count)

This small example project will be a module that returns the number of processors in the current device. If you're not familiar with fancy systems concepts like processors and CPUs, don't panic! We'll be using the [`num_cpus`](https://crates.io/crates/num_cpus) crate to do all the heavy lifting for us, and we'll just return the number it gives us.

The tutorial is short, but it demonstrates some of Neon's power: Rust's [crate ecosystem](https://crates.io/) is growing quickly and full of many useful and unique libraries, often providing low-level capabilities or high-performance data structures that can be hard to find in npm. A library like `num_cpus` could be useful, for example, as a hint for tuning the size of a [Web Worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers) pool in an [Electron](https://electronjs.org) app.

## Creating a New Project

The first thing we have to do is create our new `cpu-count` Neon project:

```shell
npm init neon cpu-count
```

This will ask us a series of questions similar to the ones asked by `npm init`. When it completes, the tool will have created a `cpu-count` directory with the following layout:

```text
cpu-count/
├── Cargo.toml
├── README.md
├── package.json
└── src
    └── lib.rs
```

The first thing to notice about this layout is that **a Neon project is both a Node package, and a Rust crate**.

The Rust source lives in `src/`, but JavaScript that augments Rust can live side-by-side.

Similar to how [Babel](https://babeljs.io/) can be adjusted to target a minimum JavaScript version, Neon can target a Node version by adjusting the `napi` feature in the `Cargo.toml`. By default, `npm init neon` will use the currently installed Node version.

```toml
[dependencies.neon]
features = ["napi-6"]
```

See the [Node-API version matrix](https://nodejs.org/api/n-api.html#node-api-version-matrix) for more details.

## Building and Running

We haven't yet implemented anything, but just to see that `npm init neon` produced a complete, minimal Neon project, let's try building it:

```shell
cd cpu-count
npm install
```

The build process generates a handful of files:

- `target/`: The build directory used by Rust
- `index.node`: The compiled Neon module

An easy way to clean up build artifacts is to run:

```shell
cargo clean
```

Once we've built the project, we can try running it:

```shell
node
> require('.').hello()
hello node
```

## Adding a Rust Dependency

Let's add a Rust dependency on the [num_cpus](https://crates.io/crates/num_cpus) crate. In `Cargo.toml`, add the following lines:

```toml
[dependencies]
num_cpus = "1"
```

This tells Cargo, Rust's build tool, to fetch a version of the `num_cpus` crate that is semver-compatible with `1`. (The `package.json` equivalent would be `"num_cpus": "^1"`.)

## Implementing our Function

Next we can replace the sample `hello` function that was generated by `npm init neon` with the function we actually want. Instead of returning a string, our function should return a JavaScript number. So we'll use [`cx.number()`](https://docs.rs/neon/*/neon/types/struct.JsNumber.html) helper. Since `cx.number()` expects a Rust [`f64`](https://doc.rust-lang.org/std/primitive.f64.html) (i.e., a 64-bit floating-point number), and [`num_cpus::get()`](https://docs.rs/num_cpus/1.4.0/num_cpus/fn.get.html) returns a [`usize`](https://doc.rust-lang.org/std/primitive.usize.html) (i.e., a pointer-sized integer), we'll use Rust's`as` operator to cast to convert the integer to floating-point:

```rust
use neon::prelude::*;

fn get_num_cpus(mut cx: FunctionContext) -> JsResult<JsNumber> {
    Ok(cx.number(num_cpus::get() as f64))
}
```

A few more things to note about this code:

- The `cx` argument to `get_num_cpus`: this contains information about the function call, such as the arguments and the value of `this`.
- The [`JsResult`](https://docs.rs/neon/*/neon/result/type.JsResult.html) output type: this is a Rust [`Result`](https://doc.rust-lang.org/std/result/enum.Result.html) type that indicates whether the function returned (`Ok`) or threw a JavaScript exception (`Err`). It also tracks the lifetime of the returned _handle_.
- The `cx.number()` function tells the JavaScript garbage collector that we need to keep the value we allocate alive long enough to return it to the caller of `get_num_cpus`.

Finally, we'll modify the code that `npm init neon` created for us to set up the module exports with this function instead of the initial "hello world" function it created for us:

```rust
#[neon::main]
fn main(mut cx: ModuleContext) -> NeonResult<()> {
    cx.export_function("get", get_num_cpus)?;
    Ok(())
}
```

This tells Neon to initialize the module when it's first loaded by creating a JavaScript function implemented with the `get_num_cpus` function we defined above and exporting it as a module property named `"get"`.

You can see the full [`lib.rs`](https://github.com/neon-bindings/examples/blob/main/examples/cpu-count/src/lib.rs) file in the examples repository.

## Try it Out!

Now we should be able to rebuild the project:

```shell
npm run build -- --release
```

This will create a release build for us. Release builds take longer to compile, but the final library executes more quickly. Assuming we didn't make any mistakes, we can test out our new Neon module at the Node console from the root of our project directory:

```shell
node
> const cpuCount = require('.')
> cpuCount.get()
4
```

Keep in mind that the result of calling `cpuCount.get()` will vary based on the machine you run this demo on—by design!

repository: neon-bindings/website

gha_language: CSS

repo_name: neon-bindings/website


text:
# [SIGNAL-SAFETY(7)](http://man7.org/linux/man-pages/man7/signal-safety.7.html)

[Reentrancy (computing)](https://en.wikipedia.org/wiki/Reentrancy_(computing))

# [Async-cancel-safe functions](http://man7.org/linux/man-pages/man7/pthreads.7.html)

# [Thread-safe functions](http://man7.org/linux/man-pages/man7/pthreads.7.html)

[Thread safety](https://en.wikipedia.org/wiki/Thread_safety)

# race condition

repository: dantefung/Linux-OS

repo_name: dantefung/Linux-OS


text:
---
layout: default
---

# 1994-10-05 - Re: Referrences to SKE and GAK

## Header Data

From: Bill Sommerfeld<EMAIL_ADDRESS>To: Carl Ellison<EMAIL_ADDRESS>Message Hash: 35b95b0a0713442eae7c6257b736af69a3ab99216d69ce92c572ae6de13c251f

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1994-10-05 16:33:28 UTC

Raw Date: Wed, 5 Oct 94 09:33:28 PDT

## Raw message

```
{% raw  %}From: Bill Sommerfeld<EMAIL_ADDRESS>Date: Wed, 5 Oct 94 09:33:28 PDT
To: Carl Ellison<EMAIL_ADDRESS>Subject: Re: Referrences to SKE and GAK
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Carl,

I think the main problem here is that the government seized the
initiative by using "Key Escrow" when they really mean "Government
Access to Keys"; also, the infamous Gore->Cantwell letter refers to
SKE, but clearly means, from context, that they're referring to what
you refer to as KEG.  This makes it difficult to advocate key escrow
of any form without appearing to endorse "escrow" with the government
as the grantee.

Also:

One can divide the use of encryption in computer networks in two
classes:

 - encrypting real-time communications
 - encrypting stored data (files).

Key escrow in the former case is only useful in the presence of
wiretaps, since the encrypted data is ephemeral.

The business/commercial justification for key escrow (having a "spare
key" around) is really only applicable in the second case.

					- Bill

{% endraw %}
```

## Thread

+ Return to [October 1994](/archive/1994/10)

+ Return to "[Bill Sommerfeld <sommerfeld@orchard.medford.ma.us>](/authors/bill_sommerfeld_sommerfeld_at_orchard_medford_ma_us_)"
+ Return to "[Carl Ellison <cme@tis.com>](/authors/carl_ellison_cme_at_tis_com_)"
+ Return to "[Hal <hfinney@shell.portal.com>](/authors/hal_hfinney_at_shell_portal_com_)"

+ _Unknown thread root_
  + 1994-10-05 (Wed, 5 Oct 94 07:05:26 PDT) - [Referrences to SKE and GAK](/archive/1994/10/cd8677fdd6f805cf5b4f212dfa26e2fa78ad62bc8a3597a7dc72f5b74afcac51) - _Carl Ellison<EMAIL_ADDRESS>    + 1994-10-05 (Wed, 5 Oct 94 08:37:29 PDT) - [Re: Referrences to SKE and GAK](/archive/1994/10/b2867bc51704d10aa85f0579ee55a52ea8de0d23a8c2c5d5384a181972981182) - _Hal<EMAIL_ADDRESS>    + 1994-10-05 (Wed, 5 Oct 94 09:33:28 PDT) - Re: Referrences to SKE and GAK - _Bill Sommerfeld<EMAIL_ADDRESS>      + 1994-10-05 (Wed, 5 Oct 94 10:28:44 PDT) - [Re: Referrences to SKE and GAK](/archive/1994/10/739eb1701e103b4b59799da2e351690b7566cea0e5a6a96a8025185a5f5636be) - _Carl Ellison<EMAIL_ADDRESS>


text:
# Expandable RecyclerView
Custom RecyclerViewAdapters for expanding and collapsing groups with support for multiple view types

<img src="demo.gif" width=300 />

## How to use
1. Download the [ExpandableRecyclerView-(version).aar](https://github.com/monsterbrain/expandable-recycler-view/releases/latest) library file from releases.
2. Create a project / add the downloaded **aar file** into **app/libs** folder. (Use File->Sync with Project Files option to refresh)
 *(Make sure app/build.gradle file contains aar file dependency)*
  ```groovy
  implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
  implementation 'androidx.recyclerview:recyclerview:1.1.0'
  ```

Now you're ready to get started with a Sample Project. [Wiki Link](https://github.com/monsterbrain/expandable-recycler-view/wiki)

*Note: More details will be added to wiki soon*

## Contributing

See the [CONTRIBUTING] document. Thank you, [contributors]!

## License

Expandable RecyclerView is Copyright (c) 2016 thoughtbot, inc. It is free software, and may be redistributed under the terms specified in the [LICENSE] file.

## About

Expandable RecyclerView is maintained by [@mandybess](https://github.com/mandybess)

![thoughtbot](https://thoughtbot.com/logo.png)

Expandable RecyclerView is maintained and funded by thoughtbot, inc. The names and logos for thoughtbot are trademarks of thoughtbot, inc.

We love open source software! See [our other projects][tools] or [hire us][hire] to help build your product.

  [tools]: https://thoughtbot.com/tools?utm_source=github
  [hire]: https://thoughtbot.com/hire-us?utm_source=github
  [LICENSE]: /LICENSE
  [CONTRIBUTING]: CONTRIBUTING.md
  [contributors]: https://github.com/thoughtbot/expandable-recycler-view/graphs/contributors

repository: monsterbrain/expandable-recycler-view

repo_name: monsterbrain/expandable-recycler-view