text:
```{workedexample} Organizational units
:tags: parties
```

# Organizational units

For some use cases, publishers might need to disclose the organizational units involved in the contracting (or planning) process, e.g agency branches or divisions.

There is more than one approach to model organizational units in OCDS:

1. **Use the fields and blocks available in the Organization building block**. This is the preferred approach, when possible.

    * Unit names can be included in the `name` field alongside the organization name.
    * The `additionalIdentifiers` array can be used to provide any unit identifiers. It is important to note that `identifier` and `additionalIdentifiers` need to point toward the *same legal entity*. The main `identifier` ought to belong to the organization and the `legalName` field can be used to provide the organization name alone.
    * The `address` and `contactPoint` blocks can be filled with the unit information.
    * Unit identifiers can also be appended to `parties/id`.

2. When the first option is not enough to model the publisher's case, **use or create an extension**. Any additional fields can be placed in the `details` section of the Organization building block.

Some publishers use the [memberOf](https://github.com/open-contracting-extensions/ocds_memberOf_extension) extension to represent organization hierarchies, including organizational units. This is strongly discouraged unless there is a clear use case to support it, because OCDS is not designed to disclose hierarchical organization information. Ideally, organizational hierarchies would be represented in separate, non-OCDS datasets, and organizational units would be modelled using one of the alternatives described above.

## Worked examples

### 1. Using the Organization building block

In Honduras, the Ministry of Health is planning the procurement of food supplies for the San Felipe Hospital. For the purposes of the example, San Felipe Hospital is considered to be a unit belonging to the Ministry of Health, and it is not a legal entity of its own.

In the release below, the publisher adds the hospital name at the end of the procuring entity name. The main identifier for the organization (*Secretaría de Salud Pública*) is extracted from a local list in the "HonduCompras" platform, used to publish procurement information in the country.

An identifier for the hospital has been added using the "HN-ONCAE-UNIT" list code. The `address` and `contactPoint` information belongs to the hospital only.

```{jsoninclude} ../../examples/organizations/organizational_units/honduras_organization_identifier_scheme.json
:jsonpointer:
:expand: releases, parties, identifier, additionalIdentifiers
:title: release
```

### 2. Defining a new Extension

In Moldova, the national procurement agency needs to include a division code for particular organizations. Since divisions can be separate legal entities in some cases, the publisher chooses to use the `identifier` block to point to the main organization for all cases, and use an additional field to provide the division code that enables data users to locate the departments and branches involved.

In the release below, a branch of the Bank of Moldova announces a contract opportunity for the provision of consumables for electrical appliances.

```{jsoninclude} ../../examples/organizations/organizational_units/moldova_organization_extension.json
:jsonpointer:
:expand: releases, parties, identifier, additionalIdentifiers, details
:title: release
```

```{jsoninclude} ../../examples/organizations/organizational_units/ocds_divisionCode_extension/extension.json
:jsonpointer:
:expand: name, description, schemas, compatibility
:title: extension
```

```{jsoninclude} ../../examples/organizations/organizational_units/ocds_divisionCode_extension/release-schema.json
:jsonpointer:
:expand: definitions, Organization, properties, details, properties, divisionCode
:title: release-schema
```

The branch name (*Chişinău Branch*) is appended at the end of the name of the buyer. A new extension called "Division code" has been defined to add the `divisionCode` field in the `parties/details` section. The branch code in the example is "101".

The `extension.json` and `release-schema.json` files for the Division code extension can be displayed using the combo box above the JSON example. Instructions on how to create an OCDS extension can be found [here](https://github.com/open-contracting/standard_extension_template).

### 3. Using the Organization building block with an organizational hierarchy

The *Hospital de Clínicas* is planning to procure supplies for their Blood Center. The Hospital is part of the Medical School in the National University of Asuncion. Since the hospital is key in the provision of healthcare for low income groups in the community, it is in the interest of many to clearly identify the procurement of the Hospital only. It is also important for the publisher that users can group the data following organizational hierarchies.

It is important to note that OCDS ought to not be used to publish organizational hierarchies unless there is a strong case to support it. Organizational hierarchies can be disclosed in additional datasets. Publishers can refer to the [W3C Organization Ontology](https://www.w3.org/TR/vocab-org/) to design a hierarchy-oriented dataset.

The release below shows how the publisher chooses to model the hospital as an organizational unit of the Medical School (*Facultad de Ciencias Médicas*). The source systems collect the name of the organizational unit only, and this is appended to the organization name.

```{jsoninclude} ../../examples/organizations/organizational_units/paraguay_organization_name.json
:jsonpointer:
:expand: releases, tag, parties, identifier
:title: release
```

In a separate dataset, the publisher discloses the organizational hierarchy. This dataset, in combination with the OCDS publication,  would allow users to summarize contracting information. The table below shows an extract of the dataset.

```{csv-table-no-translate}
:header-rows: 1
:file: ../../examples/organizations/organizational_units/paraguay_organizations.csv
```

repository: open-contracting/standard

gha_license_id: NOASSERTION

repo_name: open-contracting/standard


text:
# net-libs/libnftnl

### examples
Copy the examples provided with the source code into the `/usr/share/doc/libnftnl-<version>/examples` directory. Examples include how to add, get and delete chains, rules, tables, etc.

This flag should normally be disabled, it is only useful for the developers.

### split-usr
Normally, built `libnftnl` library is installed into the `/usr/lib64` (or `/usr/lib32` on 32-bit systems) directory. When this flag is enabled, however, a copy of the library will be installed into the `/lib64` (or `/lib32`) directory to make it possible to use tools that depend on the `libnftnl` during the early boot on systems that have separate `/usr` partition, before this partition is mounted.

It is safe to disable this flag, unless the system has separate `/usr` partition.

### static-libs
Pass the `--enable-static` option to the configure script. Build and install a statically linked version of the `libnftnl` library.

This flag should only be enabled if there is an explicit need for the static library.

### test
Execute the `make check` command after the main build is completed to run the test suite provided with the source code and check for any regressions. This will extend the overall build time.

This flag should normally be disabled, because these tests are primarily useful for developers, maintainers and testers.

license: Unlicense

repository: filakhtov/gentoo-use-docs

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: filakhtov/gentoo-use-docs


text:
# jumpcutter

Shorten videos by removing silence. Explanation here: https://www.youtube.com/watch?v=DQ8orIurGxw

Tested on Windows 10 (should work on other systems).

## Prerequisites

* `Python3`
* `ffmpeg`
* optional: [`ffmpeg-normalize`](https://github.com/slhck/ffmpeg-normalize)

Run `pip3 install -r requirements.txt` to install required dependencies

## Usage
```
usage: jumpcutter.py [-h] [-o OUTPUT_FILE] [--silent_threshold SILENT_THRESHOLD] [--sounded_speed SOUNDED_SPEED]
                     [--silent_speed SILENT_SPEED] [--frame_margin FRAME_MARGIN] [--sample_rate SAMPLE_RATE]
                     [--frame_rate FRAME_RATE] [--frame_quality FRAME_QUALITY] [-s] [--ffmpeg_path FFMPEG_PATH]
                     input_file

Modifies a video file to play at different speeds when there is sound vs. silence.

positional arguments:
  input_file            the video file you want modified

optional arguments:
  -h, --help            show this help message and exit
  -o OUTPUT_FILE, --output_file OUTPUT_FILE
                        the output file. (optional. if not included, it'll just modify the input file name)
  --silent_threshold SILENT_THRESHOLD
                        the volume amount that frames' audio needs to surpass to be consider "sounded". It ranges
                        from 0 (silence) to 1 (max volume)
  --sounded_speed SOUNDED_SPEED
                        the speed that sounded (spoken) frames should be played at. Typically 1.
  --silent_speed SILENT_SPEED
                        the speed that silent frames should be played at. 999999 for jumpcutting.
  --frame_margin FRAME_MARGIN
                        some silent frames adjacent to sounded frames are included to provide context. How many
                        frames on either the side of speech should be included? That's this variable.
  --sample_rate SAMPLE_RATE
                        sample rate of the input and output videos
  --frame_rate FRAME_RATE
                        frame rate of the input and output videos. optional... I try to find it out myself, but
                        it doesn't always work.
  --frame_quality FRAME_QUALITY
                        quality of frames to be extracted from input video. 1 is highest, 31 is lowest, 3 is the
                        default.
  -s, --silent          hide most output messages
  --ffmpeg_path FFMPEG_PATH
                        the path to the ffmpeg binary

```

__Warning:__ The input video will get split into single frames so long videos will take up a lot of temporary disk space.

license: MIT

repository: leon-w/jumpcutter

gha_license_id: MIT

repo_name: leon-w/jumpcutter


text:
---
layout: page
title: anvi-compute-functional-enrichment-across-genomes [program]
categories: [anvio]
comments: false
redirect_from: /m/anvi-compute-functional-enrichment-across-genomes
image:
  featurerelative: ../../../images/header.png
  display: true
---

A program that computes functional enrichment across groups of genomes..

See **[program help menu](../../../../vignette#anvi-compute-functional-enrichment-across-genomes)** or go back to the **[main page](../../)** of anvi'o programs and artifacts.

{% include _toc.html %}

{% capture network_path %}{{ "network.json" }}{% endcapture %}
{% capture network_height %}{{ 300 }}{% endcapture %}
{% include _project-anvio-graph.html %}

## Can provide

[functional-enrichment-txt](../../artifacts/functional-enrichment-txt)

## Can consume

[groups-txt](../../artifacts/groups-txt)  [genomes-storage-db](../../artifacts/genomes-storage-db)  [external-genomes](../../artifacts/external-genomes)  [internal-genomes](../../artifacts/internal-genomes)  [functions](../../artifacts/functions)

## Usage

This program computes functional enrichment across groups of genomes and returns a [functional-enrichment-txt](/software/anvio/help/main/artifacts/functional-enrichment-txt) file.

{:.warning}
For its sister programs, see [anvi-compute-functional-enrichment-in-pan](/software/anvio/help/main/programs/anvi-compute-functional-enrichment-in-pan) and [anvi-compute-metabolic-enrichment](/software/anvio/help/main/programs/anvi-compute-metabolic-enrichment).

{:.notice}
Please also see [anvi-display-functions](/software/anvio/help/main/programs/anvi-display-functions) which can both calculate functional enrichment, AND give you an interactive interface to display the distribution of functions.

## Functional enrichment

You can use this program by combining genomes described through [external-genomes](/software/anvio/help/main/artifacts/external-genomes), [internal-genomes](/software/anvio/help/main/artifacts/internal-genomes), and/or stored in a [genomes-storage-db](/software/anvio/help/main/artifacts/genomes-storage-db). In addition to sources for your genomes, you will need to provide a [groups-txt](/software/anvio/help/main/artifacts/groups-txt) file to declare which genome belongs to which group for enrichment analysis to consider.

### How does it work?

1. **Aggregate functions from all sources**. Gene calls in each genome are tallied according to their functional annotations from the given annotation source.

2. **Quantify the distribution of functions in each group of genomes**. This information is then used by `anvi-script-enrichment-stats` to fit a GLM to determine (1) the level that a particular functional annotation is unique to a single group and (2) the percent of genomes it appears in in each group. This produces a [functional-enrichment-txt](/software/anvio/help/main/artifacts/functional-enrichment-txt) file.

{:.notice}
The script `anvi-script-enrichment-stats` was implemented by [Amy Willis](https://github.com/adw96), and described first in [this paper](https://doi.org/10.1186/s13059-020-02195-w).

### Basic usage

You can use it with a single source of genomes:

anvi-compute-functional-enrichment-across-genomes -i [internal-genomes](/software/anvio/help/main/artifacts/internal-genomes) \
                                                  -o [functional-enrichment-txt](/software/anvio/help/main/artifacts/functional-enrichment-txt) \
                                                  --annotation-source FUNCTION_SOURCE

or many:

anvi-compute-functional-enrichment-across-genomes -i [internal-genomes](/software/anvio/help/main/artifacts/internal-genomes)\
                                                  -e [external-genomes](/software/anvio/help/main/artifacts/external-genomes) \
                                                  -g [genomes-storage-db](/software/anvio/help/main/artifacts/genomes-storage-db) \
                                                  -o [functional-enrichment-txt](/software/anvio/help/main/artifacts/functional-enrichment-txt) \
                                                  --annotation-source FUNCTION_SOURCE

### Additional Parameters

You can get a tab-delimited matrix describing the occurrence (counts) of each function within each genome using the `--functional-occurrence-table-output` parameter:

anvi-compute-functional-enrichment-across-genomes -i [internal-genomes](/software/anvio/help/main/artifacts/internal-genomes) \
                                                  -o [functional-enrichment-txt](/software/anvio/help/main/artifacts/functional-enrichment-txt) \
                                                  --annotation-source FUNCTION_SOURCE
                                                  --functional-occurrence-table-output FUNC_OCCURRENCE.TXT

{:.notice}
Edit [this file](https://github.com/merenlab/anvio/tree/master/anvio/docs/programs/anvi-compute-functional-enrichment-across-genomes.md) to update this information.

## Additional Resources

* [A description of the enrichment script run by this program can be found in Shaiber et al 2020](https://genomebiology.biomedcentral.com/articles/10.1186/s13059-020-02195-w)

{:.notice}
Are you aware of resources that may help users better understand the utility of this program? Please feel free to edit [this file](https://github.com/merenlab/anvio/tree/master/bin/anvi-compute-functional-enrichment-across-genomes) on GitHub. If you are not sure how to do that, find the `__resources__` tag in [this file](https://github.com/merenlab/anvio/blob/master/bin/anvi-interactive) to see an example.

repository: genomewalker/web

repo_name: genomewalker/web


text:
# Kibana Plugins Library

## Setup development environment

### 1. Clone Kibana repo

Make sure you are in the same directory as this readme (should be `kibana/library/plugins`)

Replace `[VERSION_TAG]` with the version of Kibana for which you want to develop a plugin.

```
git clone --branch [VERSION_TAG] https://github.com/elastic/kibana.git
```

### 2. Switch to correct Node.js version

Install the Node Version Manager by following the readme on following URL

```
https://github.com/creationix/nvm/blob/master/README.md
```

You may want to load nvm into your PATH afterwards

```
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
```

**Find and install appropriate version of Node.js** with Node version manager. The needed version is saved to `kibana/.node-version`

```
REQ_NODE_VERSION=$(cat kibana/.node-version)
nvm install ${REQ_NODE_VERSION}
nvm use ${REQ_NODE_VERSION}
```

## Develop a new plugin

### 1. Install Node modules for Kibana

```
(cd kibana && npm install)
```

### 2.  Run Kibana with plugin loaded

Go to your **plugin directory**.

```
cd my-new-plugin
npm start
```

## Build an existing plugin

1. Make sure you're using **correct Node.js version** (see above)
2. Make sure plugin's node modules are installed

	```
	cd an-existing-plugin
	npm install
	```
3. Build the plugin

	```
	npm run build
	```
4. The plugin is built in `an-existing-plugin/build/an_exising_plugin-[VERSION].zip`

repository: LibertyAces/kibana-codelist-vis

gha_language: Python

repo_name: LibertyAces/kibana-codelist-vis


text:
Journal

Work in progress

A 100% Open Source Markdown journaling Progressive Web Application with Vim support.

[![GitHub last commit](https://img.shields.io/github/last-commit/seanwlawrence/journal.svg?style=flat-square)](https://github.com/seanwlawrence/journal/commits/master)
[![GitHub](https://img.shields.io/github/license/seanwlawrence/bulma-classnames.svg?style=flat-square)](https://github.com/seanWLawrence/journal/blob/master/LICENSE.md)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-blue.svg?style=flat-square)](http://commitizen.github.io/cz-cli/)

## The problem

Markdown is awesome, and so are Progressive Web Apps like
[Dillinger](dillinger.io) that allow you to write in Markdown and get the HTML
all from within the browser. But having to touch your mouse to navigate takes
your focus away from your writing and is a real hassle.

## This solution

Markdown + Progressive Web Application + Vim = Heaven. That's what this
application does. Clone this repo to run it locally, in the cloud or simply
create an online account at \_**\_coming soon\_\_** and use the hosted version
for free!

Features:

- Enable/disable Vim keyboard navigation
- Toggle between Markdown/HTML
- Export as Markdown, HTML, or styled PDF
- Create account to save your pages using encryption
- Responsive, mobile-friendly design
- Zen mode for distraction-free writing
- Day/Night themes

## Table of Contents

- [The problem](#the-problem)
- [This solution](#this-solution)
- [Table of Contents](#table-of-contents)
- [Installation](#installation)
- [Learning Material](#learning-material)
- [FAQ](#faq)
- [Roadmap](#roadmap)
  - [v1.0.0 [Work in progress]](#v100-work-in-progress)
  - [v2.0.0 [Next steps]](#v200-next-steps)
- [Contributors](#contributors)
- [Issues](#issues)
  - [Bugs](#bugs)
- [Feature Requests](#feature-requests)
- [Questions](#questions)
- [Contributing](#contributing)
- [Changelog](#changelog)
- [LICENSE](#license)

## Installation

TODO

## Learning Material

TODO

## FAQ

Why should I use this?

If you like Vim and want to write in Markdown in the browser - this is for you!
It's perfect for writing blog posts, documentation, journal entries, todo lsts
and anything else you can think of.

What if I hate Vim?

Then disable Vim in the browser settings!

## Roadmap

### v1.0.0 [Work in progress]

- 90% < testing code coverage
- Works on mobile
- Vim enable/disable
- Export as Markdown or HTML
- View as Markdown or HTML

### v2.0.0 [Next steps]

- Create online account
- Zen mode
- Day/night themes
- PDF export

## Contributors

[Sean W. Lawrence](https://swl.netlify.com)

## Issues

Looking to contribute? Check out our [roadmap](#roadmap) and
[raise an issue](https://github.com/seanwlawrence/journal/issues/new) on what
you'd like to help with!

### Bugs

Please [raise an issue](https://github.com/seanwlawrence/journal/issues/new) for
bugs, missing documentation, or unexpected behavior.

## Feature Requests

Please [raise an issue](https://github.com/seanwlawrence/journal/issues/new) to
suggest new features. Vote on feature requests by adding a 👍. This helps
maintainers prioritize what to work on.

## Questions

Please [raise an issue](https://github.com/seanwlawrence/journal/issues/new) if
you have any questions about how to use this package.

## Contributing

Contributions are welcome! If you'd like to help out, check the
[issues](https://github.com/seanwlawrence/journal/issues/) or
[create a new issue](https://github.com/seanwlawrence/journal/issues/new) and
let us know what you plan to work on. When you're ready to start, visit out
instructions on
[how to contribute](https://github.com/seanWLawrence/journal/blob/master/CONTRIBUTING.md)
for more information.

## Changelog

View the
[changelog](https://github.com/seanWLawrence/journal/blob/master/CHANGELOG.md)
to see all updates, which will be automatically updated by `commitizen` and
`semantic-release`.

## LICENSE

MIT

repository: seanWLawrence/journal

repo_name: seanWLawrence/journal


text:
---
layout: page
title: About
---

This website and repository are intended to be used for a full-day workshop on creating and using Test Doubles.

If you don't know what a test double is, imagine software where you want to test the interaction between two components, but it isn't practical to set those components up on your workstation in the way you need for an automated test.  You can use a *Test Double* to stand in for the real object in your test.

## This Project

This workshop builds software to drive an art project which will display Conway's Game of Life on an LED panel.  Your workstation doesn't have the same hardware as the microcontroller which is used in the art project.

What we do have is a well tested API which interacts with the hardware.  Because we trust the API to behave as expected, we can create a *Test Double* for that API, much like an actor would have a stunt double for scenes where their character needs to do things that the actor can't.

Using the test doubles, we will be able to prove that our software does the right thing with the hardware API.  This will reduce our programming time from first draft to working implementation by quite a bit.

repository: LazarusID/embedded-life

repo_name: LazarusID/embedded-life


text:
# Controller-motor API

This container type allows to control a motor with a reduction and a sensor (usually called motor-reducer or speed-reducer).
This container computes PID for speed, position and motion planning.

You can find basic information about PID control here: An introduction to PID control with DC motor, and a code example to tune your PID at the end of this page.

Its type has access to all common capabilities.

### containers’s type settings:

> **Warning:** This container doesn't save any of the following parameters, they must be set each time your container reboots.

Before using your Controller-motor container, you have to setup the resolution, motor reduction and eventually the wheel size, if you plan to use translation modes. To check the configuration, just make a complete turn on the motor shaft with your hand and check if the rotation position value is OK.

Both PID’s values have to be set accordingly to the motor-reducer plugged to the board. Each different motor-reducer will have different PID’s values for position and speed control, and you have to define them by yourself.
The default values `[0, 0, 0]` won’t have any effect on the motor, and must be changed if you plan to use any position or speed control mode.
To setup your PID please refer to the example at the end of this page.

> **Warning:** PID for position and speed must be set in your code as an initialization before starting to use your container with position or speed control.

Now that everything is configured, you can enable the control modes you want to use. You can use position and speed mode simultaneously. Power mode is only usable alone. The Controller-motor is now ready to use, you can disable compliance to start moving the motor.

----

## Functions

| **Function name and parameters** | **Action** | **Comment** |
|:---:|:---:|:---:|
| setToZero(self) | Resets current position of the motor to 0 | You can use it to initialize the position of the motor |
| control(self) | Displays container type graphical interface | Only available using Jupyter notebook |

## Variables

### Motor settings

| **Variable name** | **Action** | **Type** |
|:---:|:---:|:---:|
| positionPid | Sets position PID used for rotation position mode and translation position mode | read / write: \[float P, float I, float D\] |
| speedPid | Sets speed PID used for rotation speed mode and translation speed mode | read / write: \[float P, float I, float D\] |
| encoder_res | Defines the motor sensor resolution, in steps by rotation.
*This container considers that the sensor is placed before the reduction. If it is not your case, just setup a reduction ratio of 1.* | read / write: float |
| reduction | Defines the motor reduction.
Set this value to 1 if your sensor measures after the reduction. | read / write: float |
| wheel_size | Defines wheel size used for translation mode, in mm. | read / write: float |

### Motor control modes

| **Variable name** | **Action** | **Type** |
|:---:|:---:|:---:|
| compliant | - True: disables the motor driver, you can use it to move the motor by hand.
 - False: Enables the motor driver. | read / write: Boolean (True or False) |
| power_mode | Enables/Disables the power control mode.
*Disables any other control mode if enabled.* | read / write: Boolean (True or False) |
| rot_position_mode | Enables/Disables the motor rotation position control mode.
*Disables power mode and translation position mode if enabled.*
*Doesn't work if no position PID is configured.* | read / write: Boolean (True or False) |
| rot_speed_mode | Enables/Disables the motor rotation speed control mode.
*Disables power mode and translation speed mode if enabled.*
*Doesn't work if no speed PID configured.* | read / write: Boolean (True or False) |
| trans_position_mode | Enables/Disables the motor translation position control mode.
*Disables power mode and rotation position mode if enabled.*
*Doesn't work if no position PID configured.* | read / write: Boolean (True or False) |
| trans_speed_mode | Enables/Disables the motor translation speed control mode.
*Disables power mode and rotation speed mode if enabled.*
*Doesn't work if no speed PID configured.* | read / write: Boolean (True or False) |

### Motor sensing

| **Variable name** | **Action** | **Type** |
|:---:|:---:|:---:|
| rot_position | Reads rotation position in °
*Reading it auto-Enables actualization.* | read only: float |
| rot_position | Starts/Stops rotation position measurement actualization | write only: Boolean (True or False) |
| rot_speed | Reads rotation speed in °/s
*Reading it auto-Enables actualization.* | read only: float |
| rot_speed | Starts/Stops rotation speed measurement actualization | write only: Boolean (True or False) |
| trans_position | Reads translation position in mm
*Reading it auto-Enables actualization.* | read only: float |
| trans_position | Starts/Stops translation position measurement actualization | write only: Boolean (True or False) |
| trans_speed | Reads translation speed in mm/s
*Reading it auto-enables actualization.* | read only: float |
| trans_speed | Starts/Stops translation speed measurement actualization | write only: Boolean (True or False) |
| current | Reads the current consumption in A
*Reading it auto-enables actualization.* | read only: float |
| current | Starts/Stops current measurement actualization | write only: Boolean (True or False) |

### Motor commands

| **Variable name** | **Action** | **Type** |
|:---:|:---:|:---:|
| power_ratio | Sets the power quantity send to the motor between -100% and 100%. | read / write: float |
| target_rot_position | Sets the target rotation position to reach in °. | read / write: float |
| target_rot_speed | Sets the target rotation speed to reach in °/s. | read / write: float |
| target_trans_position | Sets the target translation position to reach in mm. | read / write: float |
| target_trans_speed | Sets the target translation speed to reach in mm/s. | read / write: float |

## ROS topics
| **Topic name** | **Message type** | **Comment** |
|:----|:---:|:---:|
| /mod/variables/positionPid/read | geometry_msgs/msg/Vector3 |
| /mod/variables/positionPid/write | geometry_msgs/msg/Vector3 |
| /mod/variables/speedPid/read | geometry_msgs/msg/Vector3 |
| /mod/variables/speedPid/write | geometry_msgs/msg/Vector3 |
| /mod/variables/encoder_res/read | std_msgs/msg/Float32 |
| /mod/variables/encoder_res/write | std_msgs/msg/Float32 |
| /mod/variables/reduction/read | std_msgs/msg/Float32 |
| /mod/variables/reduction/write | std_msgs/msg/Bool |
| /mod/variables/wheel_size/read | std_msgs/msg/Float32 |
| /mod/variables/wheel_size/write | std_msgs/msg/Float32 |
| /mod/variables/compliant/read | std_msgs/msg/Bool |
| /mod/variables/compliant/write | std_msgs/msg/Bool |
| /mod/variables/power_mode/read | std_msgs/msg/Bool |
| /mod/variables/power_mode/write | std_msgs/msg/Bool |
| /mod/variables/rot_position_mode/read | std_msgs/msg/Bool |
| /mod/variables/rot_position_mode/write | std_msgs/msg/Bool |
| /mod/variables/rot_speed_mode/read | std_msgs/msg/Bool |
| /mod/variables/rot_speed_mode/write | std_msgs/msg/Bool |
| /mod/variables/trans_position_mode/read | std_msgs/msg/Bool |
| /mod/variables/trans_position_mode/write | std_msgs/msg/Bool |
| /mod/variables/trans_speed_mode/read | std_msgs/msg/Bool |
| /mod/variables/trans_speed_mode/write | std_msgs/msg/Bool |
| /mod/variables/rot_position/read | std_msgs/msg/Float32 |
| /mod/variables/rot_position/write | std_msgs/msg/Bool |
| /mod/variables/rot_speed/read | std_msgs/msg/Float32 |
| /mod/variables/rot_speed/write | std_msgs/msg/Bool |
| /mod/variables/trans_position/read | std_msgs/msg/Float32 |
| /mod/variables/trans_position/write | std_msgs/msg/Bool |
| /mod/variables/trans_speed/read | std_msgs/msg/Float32 |
| /mod/variables/trans_speed/write | std_msgs/msg/Bool |
| /mod/variables/current/read | std_msgs/msg/Float32 |
| /mod/variables/current/write | std_msgs/msg/Bool |
| /mod/variables/power_ratio/read | std_msgs/msg/Float32 |
| /mod/variables/power_ratio/write | std_msgs/msg/Float32 |
| /mod/variables/target_rot_position/read | std_msgs/msg/Float32 | value in radians
| /mod/variables/target_rot_position/write | std_msgs/msg/Float32 | value in radians
| /mod/variables/target_rot_speed/read | std_msgs/msg/Float32 | value in radians
| /mod/variables/target_rot_speed/write | std_msgs/msg/Float32 | value in radians
| /mod/variables/target_trans_position/read | std_msgs/msg/Float32 |
| /mod/variables/target_trans_position/write | std_msgs/msg/Float32 |
| /mod/variables/target_trans_speed/read | std_msgs/msg/Float32 |
| /mod/variables/target_trans_speed/write | std_msgs/msg/Float32 |

## Example code

### PID Setting example code

The PID values allow your motor to stick to the target command as fast as possible. The quality of a set of PID values depends on time to reach the target position and position precision.
Tuning a PID is something difficult and takes a lot of practice. It's really important to have simple ways to evaluate PID values impact on your motor before starting to tune these values.
Here is the code we use at Luos to tune a PID by ourself. Use it with Jupyter notebook to get your plot instantly.

The main code:
```python
%matplotlib inline
from pyluos import Device
from IPython.display import clear_output
import time
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt

# 1. Connect your Luos network (here using an USB container for example)
r = Device('/dev/cu.usbserial-DN2AAOVK')
r.containers

# 2. Select the container of your network you need to configure
container = r.controller_moto

# 3. Setup container basic settings
container.encoder_res = 48
container.reduction = 26.851

def run_speed_test(velocity_target):
    container.rot_position = False
    container.rot_speed = True
    container.rot_position_mode = False
    container.rot_speed_mode = True
    container.target_rot_speed = 0.0
    container.compliant = False
    target = []
    real = []
    test_time_vector = []
    test_start_time = time.time()
    target.append(container.target_rot_speed)
    real.append(container.rot_speed)
    test_time = time.time()
    test_time_vector.append(0.0)
    while (test_time < test_start_time + 0.5):
        target.append(container.target_rot_speed)
        real.append(container.rot_speed)
        test_time_vector.append(test_time - test_start_time)
        test_time = time.time()
    container.target_rot_speed = velocity_target
    while (test_time < test_start_time + 2.5):
        target.append(container.target_rot_speed)
        real.append(container.rot_speed)
        test_time_vector.append(test_time - test_start_time)
        test_time = time.time()
    container.compliant = True
    plot_test(test_time_vector, target, real)

def run_pos_test(pos_target):
    container.rot_speed = False
    container.rot_position = True
    container.rot_speed_mode = False
    container.rot_position_mode = True
    container.target_rot_position = 0.0
    container.compliant = False
    target = []
    real = []
    test_time_vector = []
    test_start_time = time.time()
    target.append(container.target_rot_position)
    real.append(container.rot_position)
    test_time = time.time()
    test_time_vector.append(0.0)
    while (test_time < test_start_time + 1):
        target.append(container.target_rot_position)
        real.append(container.rot_position)
        test_time_vector.append(test_time - test_start_time)
        test_time = time.time()
    container.target_rot_position = pos_target
    while (test_time < test_start_time + 2.5):
        target.append(container.target_rot_position)
        real.append(container.rot_position)
        test_time_vector.append(test_time - test_start_time)
        test_time = time.time()
    container.compliant = True
    plot_test(test_time_vector, target, real)

def plot_test(test_time_vector, target, real):
    fig = plt.figure()
    ax = plt.subplot(111)
    ax.plot(test_time_vector,target,'r')
    ax.plot(test_time_vector,real,'b')
    plt.show()
    plt.close(fig)
```

Now, you are ready to tune the PID values for position and speed control modes. To do that, you have to try values to get best the result possible. In order to succeed, we advise you to do it step by step:

 1. Set P, I, and D values to 0.
 2. Increase the P value until you have a small oscillation around the target.
 3. Increase the D value until you have a fast and stable position.
 4. Increase with really small figures the I value to improve the motor precision.

The code you can use to tune your speed PID:
```python
# Speed PID settings
container.speedPid = [0.1,0.1,0] # speed PID [P, I, D]
run_speed_test(100.0)
```

The code you can use to tune your position PID:
```python
# Position PID settings
container.positionPid = [4.0,0.02,100] # position PID [P, I, D]
run_pos_test(100.0)
```

### Example command from ROS topics

By publishing on 3 topics you will take control over the Controller-motor named `controller_moto` to a velocity command of 1.57 rad/s:

```bash
# Launch the broker. Note: warnings will be displayed, please ignore them
ros2 launch luos_interface broker.launch.py

# Start the command in velocity mode
ros2 topic pub -1 /controller_moto/variables/rot_speed_mode/write std_msgs/msg/Bool data:\ true\
ros2 topic pub -1 /controller_moto/variables/target_rot_speed/write std_msgs/msg/Float32 data:\ 90.0\
ros2 topic pub -1 /controller_moto/variables/compliant/write std_msgs/msg/Bool data:\ false\
```

Then publish `true` to the `/controller_moto/variables/compliant/write` topic to stop the driver.

repository: chucknouri/Documentation

repo_name: chucknouri/Documentation


text:
# Advanced Topics for the Smartsheet SDK for Java

## Logging
There are two types of logging used by the Smartsheet Java SDK:

### Console Logger
The console logger logs REST API traffic directly to the console. The console logger is verbose, and as such is best
used when developing new code or features. To use the console logger, set two system properties:
```java
System.setProperty("Smartsheet.trace.parts", "RequestBodySummary, ResponseBodySummary");
System.setProperty("Smartsheet.trace.pretty", "true");
```
*Smartsheet.trace.pretty* - if ```true```, formats log messages for improved JSON readability.
If ```Smartsheet.trace.pretty``` is ```false``` the console logger will use a compact format.

*Smartsheet.trace.parts* - determines what portions of the API traffic are logged. Valid trace parts entries include:
- RequestHeaders
- RequestBody
- RequestBodySummary
- ResponseHeaders
- ResponseBody
- ResponseBodySummary
- Request (RequestHeaders + RequestBodySummary)
- Response (ResponseHeaders + ResponseBodySummary)

By default, console log entries are truncated at 1024 characters. You can change the truncation limit by defining a
system property ```Smartsheet.trace.truncateLen``` and setting it equal to the desired truncation limit, for example:
```java
System.setProperty("Smartsheet.trace.truncateLen", "512");
```

### Logging Framework
The Smartsheet Java SDK also has a dependency on the SLF4J facade. SLF4J is configurable at or post distribution and
is meant for production environments. More information about SLF4J and the supported logging frameworks is available
[here](https://www.slf4j.org).

Using SLF4J, the Smartsheet Java SDK logs all API queries including HTTP method, URI, HTTP status  and response time
to `INFO`. API calls that fail (HTTP status != 200) are fully logged (request, response and full bodies) to `WARN`.
Finally, successful (HTTP status 200) request and response summaries are logged to `DEBUG`.

The POM for the Smartsheet Java SDK also includes a test only dependency on the ```slf4j-simple``` logging framework.
Details on how to configure logging are framework dependant, however, a usage example for the Simple logger can be
found in the *simplelogger.properties* file in the Sample folder. Alternately, a usage example for Log4j can
be found in the java-read-write-sheet example [here](https://github.com/smartsheet-samples/java-read-write-sheet).

## Passthrough Option

If there is an API feature that is not yet supported by the Java SDK, there is a passthrough option that allows you to
pass and receive raw JSON objects.

To invoke the passthrough, your code can call one of the following four methods:

`jsonResponse = smartsheet.passthroughResources().postRequest(endpoint, payload, parameters);`

`jsonResponse = smartsheet.passthroughResources().getRequest(endpoint, parameters);`

`jsonResponse = smartsheet.passthroughResources().putRequest(endpoint, payload, parameters);`

`jsonResponse = smartsheet.passthroughResources().deleteRequest(endpoint);`

* `endpoint (String)`: The specific API endpoint you wish to invoke. The client object base URL gets prepended to the caller’s
endpoint URL argument, e.g., if endpoint is 'sheets' an HTTP GET is requested from the URL https://api.smartsheet.com/2.0/sheets
* `payload (String)`: The data to be passed through in the request payload as a string.
* `query_params (Hashmap<String, Object>)`: An optional list of query parameters.

All calls to passthrough methods return a JSON string result.

### Passthrough Example

The following example shows how to POST data to https://api.smartsheet.com/2.0/sheets using the passthrough method and
a JSON string payload:
```
String payload =
    "{\"name\": \"my new sheet\"," +
        "\"columns\": [" +
            "{\"title\": \"Favorite\", \"type\": \"CHECKBOX\", \"symbol\": \"STAR\"}," +
            "{\"title\": \"Primary Column\", \"primary\": true, \"type\": \"TEXT_NUMBER\"}" +
        "]" +
    "}";
String jsonResponse = smartsheet.passthroughResources().postRequest("sheets", payload, null);
```

## Testing
Unit tests:
1. `mvn test`

Integration tests:
1. Store an access token in your environment as SMARTSHEET_ACCESS_TOKEN
2. `mvn integration-test`

Mock API tests:
1. Clone the [Smartsheet sdk tests](https://github.com/smartsheet-platform/smartsheet-sdk-tests) repo and follow the
instructions from the readme to start the mock server.
2. `mvn test -Dtest=com.smartsheet.api.sdk_test.*`

## Android
Google doesn’t support the Apache HTTP Client on Android (used as the default HTTP client by the SDK). In order to make it easier to use the Smartsheet Java SDK, the SDK contains a 2nd HTTP client class, AndroidHttpClient. The AndroidHttpClient class is included with version 2.68.4+ of the SDK. To use the Smartsheet Java SDK on Android, follow these steps:

1. Add to the module-level build.gradle's dependencies section:
```gradle
implementation 'com.smartsheet:smartsheet-sdk-java:2.68.4'
```
2. Add to the module-level build.gradle's android section:
```gradle
packagingOptions {
    exclude 'META-INF/DEPENDENCIES'
}
```
3. When you invoke the Smartsheet client, instruct it to use the AndroidHttpClient to access the Smartsheet API:
```java
Smartsheet smartsheet = SmartsheetFactory.custom().setHttpClient(new AndroidHttpClient())
        .setAccessToken("[TOKEN]").build();
```

## Overriding HTTP Client Behavior
You can provide a number of customizations to the default HTTP behavior by extending the DefaultHttpClient class and
overriding one or more methods (examples below). If required, you can remove use of the Apache HTTP Client
by implementing the HttpClient interface in a custom client (see
[Android QRScanner](https://github.com/smartsheet-samples/QRScanner)).

Common customizations may include:
- implementing an HTTP proxy
- injecting additional HTTP headers
- overriding default timeout or retry behavior

### Sample ProxyHttpClient
The following example shows how to enable a proxy by providing the SmartsheetBuilder with an HttpClient which extends
DefaultHttpClient.

Invoke the SmartsheetBuilder with a custom HttpClient:

```java
ProxyHttpClient proxyHttpClient = new ProxyHttpClient("localhost", 8080);
Smartsheet smartsheet = SmartsheetFactory.custom().setHttpClient(proxyHttpClient).build();
```

```java
import com.smartsheet.api.internal.http.DefaultHttpClient;
import com.smartsheet.api.internal.http.HttpRequest;
import org.apache.http.HttpHost;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.HttpRequestBase;

public class ProxyHttpClient extends DefaultHttpClient {

    private String proxyHost;
    private Integer proxyPort;

    public ProxyHttpClient(String proxyHost, Integer proxyPort) {
        this.proxyHost = proxyHost;
        this.proxyPort = proxyPort;
    }

    /** Override this method to inject additional headers, or setup proxy information
     * on the request.
     */
    @Override
    public HttpRequestBase createApacheRequest(HttpRequest smartsheetRequest) {
        HttpRequestBase apacheHttpRequest = super.createApacheRequest(smartsheetRequest);

        RequestConfig.Builder builder = RequestConfig.custom();
        if (apacheHttpRequest.getConfig() != null) {
            builder = RequestConfig.copy(apacheHttpRequest.getConfig());
        }
        HttpHost proxy = new HttpHost(proxyHost, proxyPort, "http");
        builder.setProxy(proxy);
        RequestConfig config = builder.build();
        apacheHttpRequest.setConfig(config);
        return apacheHttpRequest;
    }
}
```
### Sample RetryHttpClient
The following example shows how to override the default retry/timeout logic.

Invoke the SmartsheetBuilder with a custom HttpClient:
```java
Smartsheet smartsheet = SmartsheetFactory.custom().setHttpClient(new RetryHttpClient()).build();
smartsheet.setMaxRetryTimeMillis(30000);
```

```java
import com.smartsheet.api.internal.http.DefaultHttpClient;
import com.smartsheet.api.internal.http.HttpResponse;
import com.smartsheet.api.models.Error;

import java.io.IOException;

public class RetryHttpClient extends DefaultHttpClient {

    /**
     * Override this method to perform API requests for special cases
     */
    @Override
    public boolean shouldRetry(int previousAttempts, long totalElapsedTimeMillis, HttpResponse response) {

        // HTTP Status available as response.getStatusCode()
        int httpStatus = response.getStatusCode();

        String contentType = response.getEntity().getContentType();
        if (contentType != null && !contentType.startsWith(JSON_MIME_TYPE)) {
            // it's not JSON; don't even try to parse it
            return false;
        }
        Error error;
        try {
            // Details about the Smartsheet API error condition
            error = jsonSerializer.deserialize(Error.class, response.getEntity().getContent());
        }
        catch (IOException e) {
            return false;
        }
        switch(error.getErrorCode()) {
            // The default shouldRetry, retries 4001, 4002, 4003, 4004 codes
            case 4001:
            case 4002:
            case 4003:
            case 4004:
            case 9999: // adding my fictional error code
                break;
            default:
                return false;
        }

        // The default calcBackoff uses exponential backoff, add custom behavior by overriding calcBackoff
        long backoffMillis = calcBackoff(previousAttempts, totalElapsedTimeMillis, error);
        if(backoffMillis < 0)
            return false;

        logger.info("HttpError StatusCode=" + response.getStatusCode() + ": Retrying in " + backoffMillis + " milliseconds");
        try {
            Thread.sleep(backoffMillis);
        }
        catch (InterruptedException e) {
            logger.warn("sleep interrupted", e);
            return false;
        }
        return true;
    }
}
```
## Event Reporting
The following sample demonstrates best practices for consuming the event stream from the Smartsheet Event Reporting
feature.

The sample uses the `smartsheet.eventResources().listEvents` method to request a list of events from the stream. The
first request sets the `since` parameter with the point in time (i.e. event occurrence datetime) in the stream from
which to start consuming events. The `since` parameter can be set with a datetime value that is either formatted as
ISO 8601 (e.g. 2010-01-01T00:00:00Z) or as UNIX epoch (in which case the `numericDates` parameter must also be set to
`true`. By default the `numericDates` parameter is set to `false`).

To consume the next list of events after the initial list of events is returned, set the `streamPosition` parameter
with the `nextStreamPosition` property obtained from the previous request and don't set the `since` parameter with
any values. This is because when using the `listEvents` method, either the `since` parameter or the `streamPosition`
parameter should be set, but never both.

Note that the `moreAvailable` property in a response indicates whether more events are immediately available for
consumption. If events are not immediately available, they may still be generating so subsequent requests should keep
using the same `streamPosition` value until the next list of events is retrieved.

Many events have additional information available as part of the event. That information can be accessed using the
HashMap stored in the `additionalDetails` property. Information about the additional details provided can be found
[here.](https://smartsheet.redoc.ly/tag/eventsDescription)

```java
public class Sample {

    public static void main(String[] args) throws SmartsheetException {
        SampleProgram();
    }

    // this example is looking specifically for new sheet events
    private static void printNewSheetEventsInList(List<Event> events)
    {
        //  enumerate all events in the list of returned events
        for(Event event: events) {
            // find all created sheets
            if(event.getObjectType() == EventObjectType.SHEET && event.getAction() == EventAction.CREATE) {
                // additional details are available for some events, they can be accessed as a HashMap
                // in the additionalDetails property
                System.out.println(event.getAdditionalDetails().get("sheetName"));
            }
        }
    }

    public static void SampleProgram() throws SmartsheetException{

        Smartsheet smartsheet = SmartsheetFactory.createDefaultClient();

        // begin listing events in the stream starting with the `since` parameter
        Date lastWeek = new Date(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(7));
        // this example looks at the previous 7 days of events by providing a since argument set to last week's date
        EventResult eventResult = smartsheet.eventResources().listEvents(lastWeek, null, 1000, false);
        printNewSheetEventsInList(eventResult.getData());

        // continue listing events in the stream by using the `streamPosition`, if the previous response indicates
        // that more data is available.
        while(eventResult.getMoreAvailable()) {
            eventResult = smartsheet.eventResources().listEvents(null, eventResult.getNextStreamPosition(), 10000, true);
            printNewSheetEventsInList(eventResult.getData());
        }
    }
}
```

## Working With Smartsheetgov.com Accounts

If you need to access Smartsheetgov you will need to specify the Smartsheetgov API URI as the base URI during creation
of the Smartsheet client object. SmartsheetGov uses a base URI of https://api.smartsheetgov.com/2.0/. The base URI is
defined as a constant in both the SmartsheetBuilder and SmartsheetFactory classes
(i.e. SmartsheetFactory.GOV_BASE_URI). The SmartsheetFactory also contains API to create default Smartsheet clients
which point to the Smartsheetgov URI:

```java
package com.smartsheet.api.sample;

import com.smartsheet.api.Smartsheet;
import com.smartsheet.api.SmartsheetException;
import com.smartsheet.api.SmartsheetFactory;
import com.smartsheet.api.models.Column;
import com.smartsheet.api.models.PagedResult;
import com.smartsheet.api.models.Row;
import com.smartsheet.api.models.Sheet;

import java.util.List;

/**
 *
 */
public class Sample {
    static {
        // Uncomment these lines to enable logging to console
        // System.setProperty("Smartsheet.trace.parts", "RequestBody,ResponseBodySummary");
        // System.setProperty("Smartsheet.trace.pretty", "true");

    }
    public static void main(String[] args) {
        try {
            // Create Smartsheet client
            // Set your access token in environment variable "SMARTSHEET_ACCESS_TOKEN", else update and uncomment here
            Smartsheet smartsheet = SmartsheetFactory.createDefaultGovAccountClient( /* "ll352u9jujauoqz4gstvsae05" */);

            // List all sheets
            PagedResult<Sheet> sheets = smartsheet.sheetResources().listSheets(null, null, null );
            System.out.println("\nFound " + sheets.getTotalCount() + " sheets\n");

            Long sheetId =  sheets.getData().get(0).getId();            // Default to first sheet

            // TODO: Uncomment if you wish to read a specific sheet
            // sheetId = 239236234L;

            // Load entire sheet
            Sheet sheet = smartsheet.sheetResources().getSheet(sheetId, null, null, null, null, null, null, null);
            List<Row> rows = sheet.getRows();
            System.out.println("\nLoaded sheet id " + sheetId + " with " + rows.size() + " rows, title: " + sheet.getName());

            // Display the first 5 rows & columns
            for (int rowNumber = 0; rowNumber < rows.size() && rowNumber < 5; rowNumber++)
                DumpRow(rows.get(rowNumber), sheet.getColumns());
        } catch (SmartsheetException sx) {
            sx.printStackTrace();
        }
        System.out.println("done.");
    }

    static void DumpRow(Row row, List<Column> columns)
    {
        System.out.println("Row # " + row.getRowNumber() + ":");
        for (int columnNumber = 0; columnNumber < columns.size() && columnNumber < 5; columnNumber++) {
            System.out.println("    " + columns.get(columnNumber).getTitle() + ": " + row.getCells().get(columnNumber).getValue());
        }

    }
}

```

## Working With Smartsheet Regions Europe Accounts

If you need to access Smartsheet Regions Europe you will need to specify the Smartsheet.eu API URI as the base URI during creation of the Smartsheet client object. Smartsheet.eu uses a base URI of https://api.smartsheet.eu/2.0/. The base URI is defined as a constant in both the SmartsheetBuilder and SmartsheetFactory classes (i.e. SmartsheetFactory.EU_BASE_URI). The SmartsheetFactory also contains API to create default Smartsheet clients which point to the Smartsheet.eu URI:

```java
package com.smartsheet.api.sample;

import com.smartsheet.api.Smartsheet;
import com.smartsheet.api.SmartsheetException;
import com.smartsheet.api.SmartsheetFactory;
import com.smartsheet.api.models.Column;
import com.smartsheet.api.models.PagedResult;
import com.smartsheet.api.models.Row;
import com.smartsheet.api.models.Sheet;

import java.util.List;

/**
 *
 */
public class Sample {
    static {
        // Uncomment these lines to enable logging to console
        // System.setProperty("Smartsheet.trace.parts", "RequestBody,ResponseBodySummary");
        // System.setProperty("Smartsheet.trace.pretty", "true");

    }
    public static void main(String[] args) {
        try {
            // Create Smartsheet client
            // Set your access token in environment variable "SMARTSHEET_ACCESS_TOKEN", else update and uncomment here
            Smartsheet smartsheet = SmartsheetFactory.createDefaultEUAccountClient( /* "ll352u9jujauoqz4gstvsae05" */);

```

repository: smartsheet-platform/smartsheet-java-sdk

gha_language: Java

repo_name: smartsheet-platform/smartsheet-java-sdk


text:
# Development

```
vagrant@ubuntu-bionic:/Users/fanhongling/Downloads/workspace/src/github.com/tangfeixiong/lang-learn/c-cpp/closest-time$ make
gcc -I. -Wall -std=c99   -c -o closest.o closest.c
gcc -o main closest.o main.o -I. -Wall -std=c99
```

```
vagrant@ubuntu-bionic:/Users/fanhongling/Downloads/workspace/src/github.com/tangfeixiong/lang-learn/c-cpp/closest-time$ ./main
Enter a 24-hour (hh:mm, where hh between 0 and 23) time: 9:00
8	00	am
9	43	am
11	19	am
12	47	pm
---
9	00
---
-60	43	139	227
43 d->9:43am a<-11:52am
d->9:43am a<-11:52am
Closest departure time is 9:43am, arriving at 11:52am.
```

```
vagrant@ubuntu-bionic:/Users/fanhongling/Downloads/workspace/src/github.com/tangfeixiong/lang-learn/c-cpp/closest-time$ ./main
Enter a 24-hour (hh:mm, where hh between 0 and 23) time: 13:15
8	00	am
9	43	am
11	19	am
12	47	pm
---
13	15
---
-315	-212	-116	-28
No appropriate flight
```

repository: tangfeixiong/lang-learn

repo_name: tangfeixiong/lang-learn


text:
## Group 4
### Use Case for Viewing All Images

### Title
View Images

#### Description
This use case is for viewing images that have already been loaded into the database system. The images will be displayed either graphically or textually. The actors involved in this process are the Photographer, Editor, and Basic User. The Photographer must take the pictures to be loaded into the database and displayed. The Editor must view the images in the database in order to categorize them. The Basic User must also be able to view the images in the database in order to determine what images are going to be selected as "good" or "bad".

#### Triggers
1. Loading of images in a database is finished, must display what has been loaded afterwards.
2. User selects option to display images.

#### Actors
* Photographer
* Basic User
* Editor

#### Preconditions
1. The database of images not being empty.

#### Main Success Scenario (Goals)
The main goal of this use case is to display the full data set of the images in the database, graphically or textually.

#### Alternate Success Scenarios
* Not all of the images in the database are displayed.
* Images are displayed, but not in the intended way.

#### Failed End Condition
* No images are displayed in any way

#### Extensions
1. Not all of the images in the database are displayed.
    1. Notify user
    2. Prompt reload
	1. If reload fails, display only what can be loaded and inform user
    3. Display all images.
2. Images are displayed, but not properly (missing thumbnails or incomplete filenames)
    1. Prompt reload
	1. If reload fails, display what can be displayed.
    2. Display all images.

#### Steps of Execution (Requirements)
1. The user chooses to display the images in the database.
2. The database is iterated through and the images are retrieved.
3. The image files are displayed on-screen, graphically or textually.
    * If there was any error in displaying the files, a message will be shown to the user.

#### Use Case Diagram
![view images](https://github.com/MJC598/RJI-Software-Engineering-Project/blob/master/diagrams/view_images_diagram.png "view_images_diagram")

Created By: Dylan Bunch

Reviewed By: Olivia Bishop

Collaborated With:


text:
# Table of contents

* [Open Physics Book](README.md)

## Math Fundamentals

* [Coordinate systems](math-fundamentals/coordinate-systems/README.md)
  * [Cartesian coordinate system](math-fundamentals/coordinate-systems/cartesian-coordinate-system/README.md)
    * [Distance between two points or coordinates](math-fundamentals/coordinate-systems/cartesian-coordinate-system/distance-between-two-points-or-coordinates.md)
  * [Spherical coordinate system](math-fundamentals/coordinate-systems/spherical-coordinate-system.md)
  * [Polar coordinate system](math-fundamentals/coordinate-systems/polar-coordinate-system.md)
* [Functions](math-fundamentals/functions/README.md)
  * [What is a mathematical function?](math-fundamentals/functions/what-is-a-mathematical-function/README.md)
    * [Linear function](math-fundamentals/functions/what-is-a-mathematical-function/linear-function.md)
    * [Slope](math-fundamentals/functions/what-is-a-mathematical-function/slope.md)
  * [Trigonometric Functions](math-fundamentals/functions/trigonometric-functions.md)
  * [Log and exponencial](math-fundamentals/functions/log-and-exponencial.md)
* [TODO](math-fundamentals/todo.md)

repository: mcpeixoto/Open-Physics-Book

repo_name: mcpeixoto/Open-Physics-Book


text:
# VisualStudio.Templates

##  ![image](https://raw.githubusercontent.com/miseeger/VisualStudio.Templates/master/Sources/AspDotNet%20Core%20WinAuth%20WebApi%20NgClient/NgWebApp.png) ASP.NET Core Angular App with WebAPI

A template generating a quickstart-/boilerplate-project to be hosted on IIS, powered by ASP.NET Core 3.1, using Windows Authentication. The ClientApp is built with Angular 8 and consumes the WebAPI built with ASP.NET Core.

The project also contains a ready-to-use [NPoco](https://github.com/schotime/NPoco) data service for SQLite.

##  ![image](https://raw.githubusercontent.com/miseeger/VisualStudio.Templates/master/Sources/AspDotNet%20Core%20WinAuth%20WebApi%20PrimeNgClient/PrimeNgWebApp.png) ASP.NET Core PrimeNG 10 Angular App with WebAPI

A template generating a boilerplate-project to be hosted on IIS, powered by ASP.NET Core 3.1, using Windows Authentication. The ClientApp is built with Angular 10 using PrimeNG X and consumes a WebAPI built with ASP.NET Core.

The underlying database is accessed by using EF Core. Code for the data tier is partly taken/adapted from the project [ChinookASPNETCoreAPINTier](https://github.com/cwoodruff/ChinookASPNETCoreAPINTier).

> ### Getting started with any of the above Angular projects (VS 2019)
>
> - Download the template's ZIP-file and save it in your VS project template folder.
>
> - Start VS and choose Create a new project (look for `C#` / `Windows` / `Angular` or search for `PrimeNG`) .
>
> - Select the "ASP.NET Core 3.1 WebAPI with PrimeNG Angular SPA Template". Click `Next`
>
> - Input project name and choose location. Click `create`.
>
> - When the project is created,  open a console window (CMD) and go to `path\to\your\<project>\<project>.Web\ClientApp`. Execute the following:
>
>    ```
>    > npm install
>    ```
>
>    ```
>    > npm start
>    ```
>
>    The latter precompiles the app in order to "optimize" further starts from VS.
>
> - When the dev server is startet, hit `CTRL+C` in order to cancel.
>
> - Close the console window
>
> - Make the `<project>.Web` project your startup project and start it from VS as usual.

## ![](https://raw.githubusercontent.com/miseeger/VisualStudio.Templates/master/Sources/Autofac%20Multi%20Application%20Solution/AfMulti.png "") Autofac Multi Application Solution

A template generating a quickstart-/boilerplate-solution providing a framework for a modular
multi-application solution, relying on the same service base. It excessively uses Autofac for
IoC and the `AutofacModularity` library to extend modularity.

Refer to the [AutofacModularity repository](https://github.com/miseeger/AutofacModularity) to get further information.

## ![image](https://raw.githubusercontent.com/miseeger/VisualStudio.Templates/master/Sources/Nancy%202%20Self%20Hosted%20WinAuth%20Web%20API%20Service/NancyTemplateIcon.png) Nancy 2 Self Hosted WinAuth Web API Service

A template generating a quickstart-/boilerplate-project to self-host a Web API powered by Nancy 2, using Windows Authentication. It uses ASP.NET Core 2.0 and the server-library [HTTP.SYS](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/httpsys) *instead* of [WebListener](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/weblistener) which is used with ASP.NET Core 1.x.

The project also contains a ready-to-use [NPoco](https://github.com/schotime/NPoco) data service.

This template is heavily based on the Microsoft documentaion on how to [host an ASP.NET Core app in a Windows Service](https://docs.microsoft.com/en-us/aspnet/core/hosting/windows-service).

## Further Templates

This repo also contains some Vue boilerplate templates:

- ASP.NET Core Vue App with WebAPI, Windows authorization and EF-Core (simple)
- ASP.NET Core Vue App with WebAPI, JWT authorization and EF-Core
- ASP.NET Core Vue App with SignalR, WebAPI, JWT authorization and EF-Core

gha_language: C#


text:
---
layout: page
subheadline: "Teaching"
title:  "Submitting"
teaser: "Submission format."
breadcrumb: true
header:
   image_fullwidth: "teaching/computer.png"
permalink: "/teaching/submitting/"
---

You can only upload a single file. Programs will consist of multiple files, so you must upload a compressed "zip" file.

- Before creating the zip file, ensure that your program meets all the specifications and your output is correct.
- Save or copy your output to a text file.
- Create a folder with the following format: *LastnameFirstname-AssignmentX*. For example: `JohnDoe-Assignment3`
- Copy *only* your .java files and output to this folder.
- Right-click the folder, and choose **Send to** and then **Compressed (zipped) Folder**
- Upload to SCIS Moodle](https://moodle.cis.fiu.edu/v2.1/)


text:
# Extra Features

In addition to running Terraform, the Terraform-operator can perform additional tasks that come in handy when dealing with Terraform.

## Exporting "tfvars" to Git

When working with Terraform, there is sometimes a need to do "Terraform" operations outside of the standard init/plan/apply workflow. Terraform-operator makes it easy to export an aggregate of the tfvars that are used in a deployment to a Git repo.

```yaml
(...)
spec:

  exportRepo:
    address<EMAIL_ADDRESS>    tfvarsFile: path/to/tfvars/export.tfvars
    confFile: path/to/tfvars/export.conf
```

Where:

- `spec.exportRepo.address` - (required) The git url to reach the target git repo
- `spec.exportRepo.tfvarsFile` - (optional) The full-path where to save the tfvars file. The extension `.tfvars` is not automatically added in case the user has their own convention for this.
- `spec.exportRepo.conf` - (optional) This is the backend-config used for the resource. This is usually going to be the same same as the [`backendOverride` definition](terraform-state.md#custom-terraform-backend).

## The Pre-run Script

Sometimes it is necessary to run a script before any Terraform commands get run. This can be accomplished by writing an inline script into the Kubernetes manifest file and following a few guidelines. This runs before Terraform init/plan/apply.

Here's a few guidelines for an inline script:

- Make sure to include the shebang.
- It's a good idea to test scripts before running this in tf-operator to make sure all the tools are installed on the image. Try pulling the terraform-execution image. (Eg isaaguilar/tfops:0.12.23)
- You may have to install your own packages to run some commands.

```yaml
(...)
spec:

    prerunScript: |-
      #!/usr/bin/env bash
      echo "Setting up the lambda deployment by pulling in the zip from S3"
      if [ -z `which pip` ];then
        apk add --update-cache python python-dev py-pip build-base
      fi
      if [ -z `which aws` ];then
        pip install awscli
      fi
      aws s3 cp s3://my-lambda-builds/app-v1.0.0.zip app-v1.0.0.zip
```

## The Post-run Script

Similar to the pre-run script except this runs after the Terraform commands. The same guidelines apply. This runs after Terraform init/plan/apply.

```yaml
(...)
spec:

  postrunScript: |-
    #!/usr/bin/env bash
    echo "Saving output to S3"
    if [ -z `which pip` ];then
      apk add --update-cache python python-dev py-pip build-base
    fi
    if [ -z `which aws` ];then
      pip install awscli
    fi

    ### Let's pretend there is an output.txt that the tf module creates
    #
    aws s3 cp output.txt s3://my-terraform-bucket/output.txt
```

## Advanced Discussion about Pre/Post Run Scripts

Prerun and postrun scripts are executing by running `./prerun.sh` and `./postrun.sh` respectively. So by adding values to `spec.prerunScript` or `spec.postrunScript`, the operator creates the `prerun.sh` and `postrun.sh` files respectively.

However, a user can opt to "import" these files from Git by understanding how `spec.sources` work.

For example, if this config was added to the Kubernetes manifest:

```yaml
(...)
spec:

  sources:
  - address: https://github.com/mygit/repo.git//path/to/prerun.sh
    extras:
    - is-file
```

The Terraform-operator will add `prerun.sh` exactly to the same directory that the inline script would have added `prerun.sh`.

This might be a little farfetched to reason about, but it is available for users who want to include very long and complicated prerun and postrun scripts. Essentially, a user can use `spec.sources` to import many scripts and string them together as long as there is a script called `prerun.sh` or `postrun.sh` to use as the entry-point.


text:
# Assignment 5

## Describe here your project

This is the submission link for assignment 5

# How to run

Tasks were run locally first using a small dataset on Jupyter Notebook, then on the cloud using the larger dataset.

# Notes

Screenshots of Spark History and output results are in the docs folder.

repository: nataliay/BigDataAnalyticsAssignments

path: /Assignment 5/README.md

branch_name: refs/heads/main

repo_name: nataliay/BigDataAnalyticsAssignments


text:
A Reactor-Oriented Programming Framework in C++
---

![CI](https://github.com/tud-ccc/reactor-cpp/workflows/CI/badge.svg)

While reactor-cpp can be used as a standalone framework, it is designed to work
in conjunction with [Lingua Franca](https://github.com/icyphy/lingua-franca/),
a polyglot metaprogramming language. Have a look at the Lingua Franca
[wiki](https://github.com/icyphy/lingua-franca/wiki) to get an overview of the
Reactor model. If you are working with AUTOSAR Adaptive Platform (AP), also
have a look at the [DEAR framework](https://github.com/tud-ccc/dear), which in
conjunction with reactor-cpp allows to implement AP Services using the reactor
model.

## Build

```sh
mkdir build
cd build
cmake ..
make
```

The examples need to be built explicitly.

```
make examples
```

## Extras

reactor-cpp can be build with [tracing support](https://github.com/tud-ccc/reactor-cpp/tree/master/tracing). This provides a powerful tool for analyzing and debugging reactor applications.

## Publications

* **DATE'20:** Christian Menard, Andrés Goens, Marten Lohstroh, Jeronimo Castrillon, [Achieving Determinism in Adaptive AUTOSAR](https://arxiv.org/pdf/1912.01367), Proceedings of the 2020 Design, Automation and Test in Europe Conference (DATE), EDA Consortium, Mar 2020.

Also see the Lingua Franca [publications](https://github.com/icyphy/lingua-franca/wiki/Publications-and-Presentations).

license: ISC

repository: insooth/reactor-cpp

repo_name: insooth/reactor-cpp


text:
[Donate to charity: water via Gittip](https://www.gittip.com/nthj/)

**Fork from [nthj/ignorable](https://github.com/nthj/ignorable/) with additional changes from [ztoolson/ignorable](https://github.com/ztoolson/ignorable)**

ignorable
=========

Ignore columns in ActiveRecord by name

Installation
============

Add this to your Gemfile:

    gem 'ignorable'

Usage
=====

```ruby
class Topic < ActiveRecord::Base
   ignore_columns :column_one, :column_two, :column_three
end
```

Note: `table_name_prefix` can cause issues, the `ignore_columns` invocation
must go after any prefix definition eg:
```ruby
class Topic < ActiveRecord::Base
   self.table_name_prefix = 'some_prefix'

   # IMPORTANT the ignore_columns invocation must go after any table_name_prefix
   ignore_columns :column_one, :column_two, :column_three
end
```

Rails Versions
==============

Tested on Rails 3.2, Rails 4.1.0, Rails 4.2.3

This gem is not needed on Rails 5.0 because an `ignored_columns` feature has
been merged in https://github.com/rails/rails/pull/21720

repository: civisanalytics/ignorable

gha_language: Ruby

repo_name: civisanalytics/ignorable


text:
[![.NET](https://github.com/hassanhabib/bVirtualization/actions/workflows/dotnet.yml/badge.svg)](https://github.com/hassanhabib/bVirtualization/actions/workflows/dotnet.yml)
[![The Standard - COMPLIANT](https://img.shields.io/badge/The_Standard-COMPLIANT-2ea44f)](https://github.com/hassanhabib/The-Standard)

# bVirtualization
This is a Blazor component for Virtualization that supports infinite scrolling with ANY type of data source, whether it's an API or Database or just simply a file on your computer or just in memory!

## Summary
This is a Blazor Library to provide engineers with Blazor UI components that enables them to develop software with infinite scrolling capabilities.

The main idea here is to provide a datasource-agnostic component that may be integrated and plugged in with any back-end supporting capability for providing data in the most seamless and easy way possible.

One of the fundamental purposes of this component to close the gap between the WASM client and whatever datasource that the component can integrate with with something as simple as three lines of code or less.

Ideally, this product is built to improve the engineering experience for developing UI components in Blazor.

For any questions or inquiries about this component please contact the following engineers:

Brian Parker<EMAIL_ADDRESS>
Hassan Habib<EMAIL_ADDRESS>


text:
Title: KristinitaLuckyLink
Version: 0.1.0
Author: Sasha Chernykh
Lang: en
Summary: Sublime Text 3 package, that wrap the selected text to DuckDuckGo or Google top query URL

 ![KristinitaLuckyLink](https://i.imgur.com/TuyxneV.png)
Pagetitle: KristinitaLuckyLink
Metacontent: Wrap selected text with top DuckDuckGo or Google URL
Pagecolors: programs
Asideimage: KristinaGold
Titleimage: true
Titleimagename: KristinitaLuckyLink
Iconleftorright: right
Tags: programs, sublime-text
Category: Programs
Noco: 1g9b6
Tooltipster: true
Clipboardjs: true
Visualize: false
Opengraphimage: https://i.imgur.com/TuyxneV.png

1. [Description](#description)
	1. [Reason](#reason)
	1. [Demonstration](#demonstration)
	1. [Examples](#examples)
	1. [Saving time](#saving-time)
	1. [Supported search engines](#supported-search-engines)
	1. [Supported markups](#supported-markups)
	1. [Features](#features)
1. [Limitations](#limitations)
1. [Installation](#installation)
	1. [Depenedencies](#depenedencies)
	1. [KristinitaLuckyLink](#kristinitaluckylink)
		1. [Stable version](#stable-version)
		1. [Development version](#development-version)
1. [Activation](#activation)
	1. [Environment variable](#environment-variable)
	1. [Commands and hotkeys](#commands-and-hotkeys)
	1. [Restart](#restart)
1. [Usage](#usage)
	1. [Shortcuts](#shortcuts)
	1. [Command palette](#command-palette)
1. [Documentation](#documentation)
1. [Tricks](#tricks)
	1. [Clarify](#clarify)
1. [Testing environment](#testing-environment)
1. [TODO](#todo)
1. [Known bugs and another problems](#known-bugs-and-another-problems)
	1. [KristinitaLuckyLink](#kristinitaluckylink-1)
	1. [External](#external)
1. [Troubleshooting](#troubleshooting)
	1. [Incorrect links](#incorrect-links)
		1. [SublimeREPL](#sublimerepl)
		1. [DuckDuckGo](#duckduckgo)
		1. [Google](#google)
1. [Contributing](#contributing)
1. [Thanks](#thanks)
1. [Terms and conditions](#terms-and-conditions)
1. [License](#license)

# Description

## Reason

I insert to my texts links to external sites. Before using KristinitaLuckyLink, that insert link, I need to make these actions:

1. move from Sublime Text to browser,
1. write search query in search bar,
1. press Enter,
1. copy link,
1. move from browser to Sublime Text,
1. insert link.

It may take a lot of time. Use KristinitaLuckyLink I can make all these actions, **press one shortcut**.

## Demonstration

## Examples

Conversion examples:

+ `kristinitaluckylife` → `[kristinitaluckylife](https://www.instagram.com/kristinitaluckylife/)`,
+ `Поиск Кристиниты` → `[Поиск Кристиниты](https://kristinita.ru/)`.

1. You select text,
1. KristinitaLuckyLink get query to search engine; query = your selected text,
1. KristinitaLuckyLink return first link from search engine SERP,
1. Your selected text wrap to Markdown link.

![KristinitaLuckyLink example](https://i.imgur.com/1KsfoM6.png)

## Saving time

When I wrote this article, I get these links, use KristinitaLuckyLink:

1. [kristinitaluckylife](https://www.instagram.com/kristinitaluckylife/),
1. [pygoogling](https://github.com/essanpupil/pygoogling),
1. [Sublime Suricate](https://github.com/nsubiron/SublimeSuricate),
1. [SublimeREPL](https://github.com/wuub/SublimeREPL),
1. [PEP8](https://www.python.org/dev/peps/pep-0008/),
1. [Lintly](https://lintly.com/),
1. [keith-hall](https://github.com/keith-hall),
1. [facelessuser](https://github.com/facelessuser).

I save few minutes of my time.

## Supported search engines

1. DuckDuckGo,
1. Google.com.

## Supported markups

1. Markdown

## Features

1. Must work with selection text, contains any UTF-8 symbols.

# Limitations

1. Use KristinitaLuckyLink you can get only top link of search engines. I'm sorry, if in top link not that you want.
1. I'm not affiliated with Google Search or DuckDuckGo Developers. I am not responsible for the fact that there is one or another result in the top of SERP. You can get unexpected link.

	But if in top of SERP one link, but KristinitaLuckyLink out another link, please make [these actions](#incorrect-links).

1. If you don't want by some reasons make actions from [installation](#installation) and [activation](#activation) section, please, don't install KristinitaLuckyLink.
1. Copy from [here](https://github.com/aviaryan/python-gsearch#warning): “Overusing KristinitaLuckyLink might lead to your IP being blocked by Google Search servers. Searches through browser might still work but KristinitaLuckyLink will stop working. I recommend keeping a 5 seconds gap after each usage of this library. In most cases, much lower gaps or even continuous use of the library will still work but still this is something to be kept in mind. If you see a 'rate limit' or a 503 error, it's best to stop using the library and try back after some time (~1 minute).”
1. At the time supported:

	1. Markdown link style,
	1. English DuckDuckGo and Google search engines.

Personally I use Markdown markup for my articles and Google and DuckDuckGo enough for me. If you use another markups and/or search engines, [pull requests welcome](#contributing).

# Installation

## Depenedencies

1. You need to install Python 3 with pip to your computer, if no.
1. `pip install git+https://github.com/Kristinita/python-duckduckgo` — install [DuckDuckGo module](https://github.com/crazedpsyc/python-duckduckgo), that I [ported for Python 3](https://github.com/Kristinita/python-duckduckgo).
1. `pip install pygoogling` — install [pygoogling](https://github.com/essanpupil/pygoogling) module.
1. Install [Sublime Suricate](https://github.com/nsubiron/SublimeSuricate) package [via Package Control](https://stackoverflow.com/a/19598084/5951529).

## KristinitaLuckyLink

### Stable version

Ctrl+Shift+P (⌘⇧p for Mac) → _Package Control: Add Repository_ → paste in opened input field `https://github.com/Kristinita/KristinitaLuckyLink` → Enter → _Package Control: Install Package_ → print _KristinitaLuckyLink_ → Enter.

### Development version

As [stable version](#stable-version). Only replace `https://github.com/Kristinita/KristinitaLuckyLink` to `https://github.com/Kristinita/KristinitaLuckyLink/tree/SashaDevelop` in instruction above.

You will get all changes from `SashaDevelop` branch in each Sublime Text start.

# Activation

## Environment variable

In your operating system add environment variable `PYTHONPACKAGES` with value — your Python `site-packages` folder, if already no. To find out your path, see “[How installation works](https://docs.python.org/3/install/index.html#how-installation-works)” item of Python documentation.

[jtable]
Platform|Default value
Unix|`/usr/local/lib/pythonX.Y/site-packages`
Windows|`C:\PythonXY\Lib\site-packages`
[/jtable]

For example, `C:\\Python36\\Lib\\site-packages` — path on my Windows.

See [examples](https://www.schrodinger.com/kb/1842), how you can add environment variable in your operating system.

If you know, how possible develop a plugin without adding new environment variable, please, answer to [this question](https://stackoverflow.com/q/48276861/5951529).

## Commands and hotkeys

Ctrl+Shift+P (⌘⇧p for Mac) → _Suricate: Add Profile_ → select _KristinitaLuckyLink_ → Enter.

## Restart

After all installation and activation actions restart Sublime Text. Operating system restart may be necessary.

KristinitaLuckyLink must successful works.

# Usage

Select text, for which you want to get link and...

## Shortcuts

... press hotkey. Wait a moment to get the result.

Default hotkeys for platforms:

[jtable]
Platform|DuckDuckGo default shortcut|Google default shortcut
Windows and Linux|Ctrl+Shift+Alt+D|Ctrl+Shift+Alt+D
macOS|⌘⇧⌥d|⌘⇧⌥g
[/jtable]

If these hotkeys used in you another packages or you don't want use default hotkeys by another reasons: _Preferences_ → _Browse packages..._ → _User_ → create a file _Default.suricate-profile_, if no, and add to them these lines:

```json
{
	"user_commands": {
		"sasha_kristinitaluckylink_duckduckgo": {
			"keys": ["super+keypad_multiply"],
			"caption": "KristinitaLuckyLink: DuckDuckGo",
			"call": "sublime.kristinita_lucky_link_duck_duck_go"
		},
		"sasha_kristinitaluckylink_google": {
			"keys": ["<c>+super+browser_home"],
			"caption": "KristinitaLuckyLink: Google",
			"call": "sublime.kristinita_lucky_link_google"
		}
	}
}
```

Replace `super+keypad8` and `<c>+super+browser_home` from example to your preferred keys. See [key name convention](http://docs.sublimetext.info/en/latest/reference/key_bindings.html#bindable-keys) in Sublime Text 3.

For detailed information about Suricate key bindings see [Sublime Suricate documentation](https://readthedocs.org/projects/sublime-suricate/).

## Command palette

... use [command palette](https://www.youtube.com/watch?v=VYNkebGdl9Q). Wait a moment to get the result.

Captions:

+ `Suricate: KristinitaLuckyLink: DuckDuckGo`,
+ `Suricate: KristinitaLuckyLink: Google`.

![Command palette](https://i.imgur.com/SjWzTcb.png)

# Documentation

_\#FuckTheDocs_.

# Tricks

## Clarify

To increase the probability of the expected result сlarify search queries as you clarify, when search in search engines.

For example:

[jtable]
Selected text|KristinitaLuckyLink DuckDuckGo link
Kristina Kiva|<https://www.facebook.com/public/Kristina-Kiva>
Kristina Kiva Marbella|<https://www.instagram.com/kristinitaluckylife/>
[/jtable]

# Testing environment

1. Windows 10 Enterprise LTSB 64-bit EN_
1. Python 3.6.4,
1. Sublime Text Build 3143,
1. pygoogling 0.0.2,
1. Python DuckDuckGo for Python 3 0.242.

KristinitaLuckyLink must be works in new versions macOS and Linux.

# TODO

1. unit tests,
1. add plugin to Package Control.

# Known bugs and another problems

## KristinitaLuckyLink

## External

# Troubleshooting

About all detected bugs please report to [issues](https://github.com/Kristinita/KristinitaLuckyLink/issues) page. Please, add information about your operation system, Sublime Text 3 and KristinitaLuckyLink versions.

## Incorrect links

If use KristinitaLuckyLink you get not top link of Google or DuckDuckGo SERP, please, make actions below.

### SublimeREPL

1. Install [SublimeREPL](https://github.com/wuub/SublimeREPL) via Package Control.
1. Ctrl+Shift+P (⌘⇧p for Mac) → _SublimeREPL: Python_. Paste to opened tab code below.

### DuckDuckGo

Replace `Кристина Кива` to your real selection text.

```pycon
>>> from duckduckgo import query
>>> dlink = query('! Кристина Кива').redirect.url
>>> dlink
```

Press Enter.

If link, that you get via KristinitaLuckyLink, and this link match; it [DuckDuckGo](https://github.com/crazedpsyc/python-duckduckgo) module problem.

### Google

Replace `Кристина Кива` to your real selection text.

```pycon
>>> from pygoogling.googling import GoogleSearch
>>> google_search = GoogleSearch('Кристина Кива')
>>> google_search.start_search(max_page=1)
>>> glink = google_search.search_result[0]
>>> glink
```

Press Enter.

If link, that you get via KristinitaLuckyLink, and this link match; it [pygoogling](https://github.com/essanpupil/pygoogling) module problem.

# Contributing

Pull requests welcome! But, please, adhere to the following rules.

1. Please, not add inside this package external modules. My code “philosophy” is that all modules must be installed separately.
1. Code must match [PEP8](https://www.python.org/dev/peps/pep-0008/) rules. Max line length — 120 symbols. Desirable, 100% for [Lintly](https://lintly.com/).

# Thanks

+ [keith-hall](https://github.com/keith-hall),
+ [facelessuser](https://github.com/facelessuser).

# Terms and conditions

By using this package, you agree that the KristinitaLuckyLink, Sublime Text, Python DuckDuckGo and pygoogling authors won't be responsible for any damage that comes to you and/or your property. You hereby agree to take all responsibilities for using this package. The author is merely a developer who created this package but you are the one who is using it.

# License

+ [MIT](https://github.com/Kristinita/KristinitaLuckyLink/blob/SashaDevelop/License.md).

repository: Kristinita/SashaPelicanTest

branch_name: refs/heads/SashaDevelop

repo_name: Kristinita/SashaPelicanTest


text:
# August UI

UI theme for the Atom editor. Soft brown color palette with yellow and coral highlights. __Please__ modify, share and use! 🐻

![Color Palette](http://i.imgur.com/urrH9nZ.png)

Screenshot of settings page:

![Settings](http://i.imgur.com/J3JvRfc.png)

Editor with (my favorite) syntax theme [Oceanic Next](https://github.com/smlombardi/oceanic-next-syntax)

![Editor](http://i.imgur.com/D6RYQTy.png)

repository: AugieDoebling/august-ui

repo_name: AugieDoebling/august-ui


text:
# Tempath

Tempath is a template language for path data, which is the superset of [SVG Path Data syntax][w3c paths].
Inspired by [Prototypo][prototypo, kickstarter project]'s under the hood part.

[w3c paths]: http://www.w3.org/TR/SVG/paths.html#PathData
[prototypo, kickstarter project]: https://www.kickstarter.com/projects/599698621/prototypo-streamlining-font-creation

## Usage

### Installation
```sh
npm install -g tempath
```

### Command line interface
```sh
$ tempath --help

Usage: tempath <file> [argument]... [options]

file         path template file
argument     number values that be used to path property

Options:
   -h, --help   print this message
```

### Example
```sh
$ echo "prop \$a, \$b, \$c, \$d M 0 0 L \$a+\$b \$c*\$d 6 0 Z" > sample.path

$ cat sample.path
prop $a, $b, $c, $d M 0 0 L $a+$b $c*$d 6 0 Z

$ tempath sample.path 1 2 3 4
M0,0L3,12L6,0Z
```

## Brief Syntax Guide

Since tempath is the superset of SVG path data, you can use all feature of it.

### Basic functionalities
```tempath
M 0,0               # also you can use comment!
L 1,2 3,4           # command letter can be eliminated on same subsequent commands
c 5,6 7,8 9,10      # relative versions of all commands are available
```

### Commands

Tempath code is a list of commands.
You can also define your custom command with other commands.

* `set`: set the variable
* `prop`: define property that represent the path
* `def`: define custom command
* `if`: conditional execution of command
* `for`: make loop
* `import`: import foreign template on command

### Variable

Variable name starts with `$` character.

```tempath
set $a, 1
set $b, 2
M $a $b     # M1,2
```

### Property

`prop` command takes a value from outside, and set the value to variable.

```tempath
prop $a         # Take one value from outside, just set $a by that.

prop $b 0~1     # Take one value from outside,
                # but limit the value into 1~2(inclusive).

prop $c 2       # If there is no value outside, set 2 to $c.

prop $d 3~4 5   # Default value also limited.
                # thus, set 4 when default is used
```

### Expression

#### Opeator

```tempath
set $a, 1 + 2 * 3       # set $a to 7
set $b, 1 < 2           # set $b to 1(true)
set $c, 1 = 2           # set $c to 0(false)
set $d, not 1 = 2       # set $d to 1
```

##### Builtin Operators

* `+`
* `-`
* `*`
* `/`
* `%`
* `<`
* `>`
* `<=`
* `>=`
* `=`

#### Function

Call the function as s-expr style.

```tempath
set $a, (cos (sin 0))   # set $a to 1
```

##### Builtin functions

* `ceil`
* `round`
* `floor`
* `sin`
* `cos`
* `tan`
* `sqrt`
* `atan2`

## Development

use [mocha](http://mochajs.org/) for generate parser code & test.

```
$ npm install -g mocha
$ mocha
```

## License

Distributed under [MIT License](./LICENSE)

repository: disjukr/tempath

gha_language: JavaScript

repo_name: disjukr/tempath


text:
#Tic tac toe
Simple multiplayer game with multi-room support.

## Running the example

### Install dependencies

```bash
meteor npm install
```

### Running

```bash
meteor
```

## How to play it

https://www.loom.com/share/6631f5dc1f8848e399616e75bf156b6c

repository: guncebektas/examples

repo_name: guncebektas/examples


text:
Client-side utilities for processing Facebook friends data. Intended to be run on a Cordova app with the [cordova-plugin-facebook4](https://github.com/jeduan/cordova-plugin-facebook4) plugin.

After including `src/index.js` into your HTML document, the `FriendsUtil` class will be accessible at:
```javascript
window.MetisoftSolutions.facebookClientFriendsUtil.FriendsUtil
```

To generate documentation:
```
npm install
npm run genDocs
```
Then point your browser to `doc/jsdoc/index.html`.


text:
Calculate Sunrise and Sunset based on time and latitude and longitude

This is a modification of the sunrise.c posted by Mike Chirico back in 2004. See the link below to find it. I needed an algorithm that could tell me when it was dark out for all intents and purposes. I found Mike’s code, and modified it a bit to be a library that can be used again and again.

License

This is governed by the MIT license. Use it as you want, make changes as you want.

Details

To use SunPosition, you need to a few bits of local information.

Accurate time. If you’re running this with something that can get GPS time or use NTP, then results will always be very accurate. If you do not have a good clock source, then the results are going to be very accurate relative to your not so accurate clock. For the Photon, I use SparkTime and an NTP source. With my Teensy, I connect up a GPS source and read the time from that.

You need an accurate position, both latitude and longitude, so the library can figure out where you are.

Prior to calculating sunrise or sunset, you must update the current date for the library, including DST if applicable. The library doesn’t track the date, so calling it every day without changing the date means you will always get the calculation for the last accurate date you gave it.

If you do not set the date, it defaults to midnight, January 1st of year 0

The library always calculates for UTC, but does apply a timezone offset. You can calculate both the offset and UTC with related function calls if you would like.

The library returns a double that indicates how many seconds past midnight relative to the set date that sunrise or sunset will happen. If the sun will rise at 6am local to the set location and date, then you will get a return value of 360.0. Decimal points indicate fractions of a minute. It’s up to you to figure out how to use the data.

The example provides the how to below, it's pretty simple. Every time you need the calculation call for it. I wouldn't suggest caching the value unless
you can handle changes in date so the calculation is correct relative to a date you need.

SunPosition is a C++ class, and no C implementation is provided.

Releases

1.0.7: Allowes for use of positive or negative longitude values. Thank you to https://github.com/nliviu

Moon Phases

This library also allows you to calculate the moon phase for the current day to an integer value. This means it's not perfectly accurate, but it's pretty close.
To use it, you call moonPhase() with an integer value that is the number of seconds from the January 1, 1970 epoch. It will do some simple math and return
an integer value that represents the current phase of the moon, from 0 to 29. In this case, 0 is new, and 29 is new, 15 is full. The code handles times that may
cause the calculation to return 30 to avoid some limits confustion (there aren't 30 days in the lunar cycle, but it's close enough that some time values will cause
it to return 30 anyway).

Examples

This is relative to an Arduino type environment. Create a global object, and initialize it and use it in loop().

#include &ltctime&gt
#include &ltSunSet.h&gt
#define TIMEZONE	-5
#define LATITUDE	40.0000
#define LONGITUDE	89.0000

SunRise sun;

void setup()
{
	// Set your clock here to get accurate time and date
	// Next, tell SunRise where we are
	sun.setPosition(LATITUDE, LONGITUDE, TIMEZONE);
	sun.setCurrentDate(year(), month(), day());
}

void loop()
{
	double sunrise = sun.calcSunrise();
	double sunset = sun.calcSunset();
	double sunriseUTC = sun.calcSunriseUTC();
	double sunsetUTC = sun.calcSunriseUTC();
	int moonphase = sun.moonPhase(std::time(nullptr));
}

Notes

This is a general purpose calculator, so you could calculate when Sunrise was on the day Shakespeare died. Hence some of the design decisions

Date values are absolute, are not zero based, and should not be abbreviated (e.g. don’t use 15 for 2015 or 0 for January)

This library may run well enough on a 16KHz Arduino, but it’s fairly math intensive and uses quite a bit of memory, so it won’t run fast. It works very well on the ARM M core chips like the Teensy and Photon though.

For time, I like the SparkTime for Photon which does a good job of keeping accurate time. GPS also works, but you will need to implement a way to calculate if your are DST or not. Other platforms will need to implement a good solution for keeping an accurate date.

It can be used as a general purpose library on any Linux machine as well. You just need to compile it into your RPI or Beagle project using cmake 3.5 or later.

UTC is not the UTC sunrise time, it is the time in Greenwhich when the sun would rise at your location. It's werid, but allows for some flexibility when doing calcualations depending on how you keep track of time in your system.

Links

You can find the original math in c code at http://souptonuts.sourceforge.net/code/sunrise.c.html

I got the moon work from Ben Daglish at http://www.ben-daglish.net/moon.shtml

repository: tbagro/sunset

repo_name: tbagro/sunset


text:
# Pseudocyphellaria beccarii (Kremp.) D. J. Galloway SPECIES

#### Status
ACCEPTED

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

#### Published in
Bulletin of the Natural History Museum, Botany Series 24(2): 119 (1994)

#### Original name
Sticta beccarii Kremp.

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
---
layout: page
title: About
permalink: /about/
---

## Hi there!
My name is Michael S. Mikowski and I have been an active proponent, architect,
presentor, and author of HTML-native Single Page Web Applications (SPAs) since 2007.  In
fact, you could say I co-wrote [one of the first books](http://manning.com/mikowski)
on the subject.  Check out the reviews on
[amazon](http://www.amazon.com/Single-Page-Applications-end-end/product-reviews/1617290750).

## Get in touch
Dear anomyous reader, I really care and want to know more about you. However, since I
don't even know your name it's hard for me open a conversation. If you'd
like to rap, just drop me a line with the email link below or using one of the
numerous contact methods found [here](http://michaelmikowski.com).

## Shameless self-promotion
I currently have a [shameless self-promotion site](http://michaelmikowski.com) that has lots of
additional information if you're interested in that sort of thing.
Stuff like recent projects, philosophy, shoe size, etc.

gha_language: CSS


text:
---
title: Windows Batch Command
page_title: Windows Batch Command | JustMock Documentation
description: Windows Batch Command integration with Telerik JustMock
slug: justmock/integration/windows-batch-command
tags: windows,batch,command
published: True
position: 15
previous_url: /scenarios/running-justmock-profiler-outside-visual-studio, /scenarios/running-justmock-profiler-outside-visual-studio.html, /integration-windows-batch-command.html, /integration-windows-batch-command
---

# Windows Batch Command

Another way to execute test DLLs is via the __Command Prompt(cmd.exe)__.

This topic demonstrates how to execute __Telerik® JustMock__ test DLLs with __cmd.exe__.

##  How to Run Profiler Enabled JustMock Tests in Command Prompt

The procedure of executing test DLLs in __Command Prompt__ is almost identical regardless of the different unit testing frameworks that you may use.

Your first step will be setting the __JustMock environment variables__, for which there are two possible approaches.

* __We recommend__ using __JustMock Runner__. It will automatically setup an appropriate environment for our product.

	__JustMockRunner.exe__ can be found in the JustMock installation directory under the Libraries folder (by default C:\Program Files (x86)\Progress\Telerik JustMock\Libraries).

	 Below you will find an example batch file, that will use __MSTest__ to run all the tests in Telerik.JustMock.Test.DLL (found in the Telerik.JustMock.CSExamples.VS2010.sln inside Telerik JustMock root folder).

	![Windows Batch Command 1](images/WindowsBatchCommand1.png)

 	Execution command:

	`"C:\Program Files (x86)\Telerik\JustMock\Libraries\JustMockRunner.exe" "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\MSTest.exe" /testcontainer:"C:\Program Files (x86)\Telerik\JustMock\Examples\Telerik.JustMock.Tests\bin\Debug\Telerik.JustMock.Tests.dll"`

* If for any reason using __JustMock Runner__ does not apply to your case, it is possible to set the __JustMock environment variables__ manually before running the tests:

	![Windows Batch Command 2](images/WindowsBatchCommand2.png)

	Execution command:

	`SET JUSTMOCK_INSTANCE=1`

	`SET COR_ENABLE_PROFILING=1`

	`SET COR_PROFILER={B7ABE522-A68F-44F2-925B-81E7488E9EC0}`

	`"C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\MSTest.exe" /testcontainer:"C:\Program Files (x86)\Telerik\JustMock\Examples\Telerik.JustMock.Tests\bin\Debug\Telerik.JustMock.Tests.dll"`

As shown above, once the environment variables are set, you will be able to run elevated JustMock tests through the __Command Prompt__, simply by following the standard steps for the chosen unit testing framework.

repository: Prophasi/justmock-docs

repo_name: Prophasi/justmock-docs


text:
```{tags} Religious-Groups, People-with-Allergies, Ethnic-Minorities, Dietary-Restrictions, Catering
```

(catering)=
# Catering

Making sure that your attendees have something they can eat at mealtimes is an important element of building an inclusive and welcoming conference.

- ✅ Common dietary needs to plan for:
  - Gluten free
  - Dairy free
  - Vegan
  - Vegetarian
  - Pork free
  - Shellfish free
  - Soy free
  - Nut free - especially peanut (this is usually a serious allergy so take extra care)
  - Kosher
  - Halal
- 🍎 Ask your caterer to create and provide labels with lists of ingredients for each dish.
    - Best to have a sign/small label in front of each dish with a list of ingredients and common labels (e.g. "gluten-free, vegan,  includes peanuts").
- 🍎 Make sure to include a variety of beverages, in particular non-alcoholic and non-caffeinated.

**Further reading:**

- [Inclusive event catering](https://adacamp.org/adacamp-toolkit/inclusive-event-catering/)

repository: numfocus/DISCOVER-Cookbook

repo_name: numfocus/DISCOVER-Cookbook