text:
# SliderButton

The SliderButton-Component is part of the _chayns-components_-Package. You can
install it with the following command:

    npm install -S chayns-components@latest

## Usage

You have to import the components first:

```jsx harmony
import { SliderButton } from 'chayns-components';
```

You can now use the components as in the
[example](https://github.com/TobitSoftware/chayns-components/blob/master/examples/react-chayns-sliderbutton/Example.jsx).

## Props

You can set the following props on a slider:

| Property       | Description                                         | Type            | Default |
| -------------- | --------------------------------------------------- | --------------- | ------- |
| className      | CSS-classes that should be set on the root-element  | String          | null    |
| style          | Styles that should be set on the root-element       | Object          | null    |
| items          | An array of selectable items                        | Array of object |         |
| onChange       | onChange-Listener that should be set on the item    | Function        | null    |
| onDragStart    | onDragStart-Listener that should be set on the item | Function        | null    |
| onDragStop     | onDragStop-Listener that should be set on the item  | Function        | null    |
| selectedItemId | Id of the item that should be selected              | Number          | 0       |
| disabled       | Disable SliderButton for input                      | Bool            | false   |

repository: leodr/chayns-components

repo_name: leodr/chayns-components


text:
| Left-aligned | Center-aligned | Right-aligned |
| :---         |     :---:      |          ---: |
| git status   | git status     | git status    |
| git diff     | git diff       | git diff      |

First Header | Second Header
------------ | -------------
Content from cell 1 | Content from cell 2
Content in the first column | Content in the second column

- [x] @mentions, #refs, [links](), **formatting**, and <del>tags</del> supported
- [x] list syntax required (any unordered or ordered list supported)
- [x] this is a complete item
- [ ] this is an incomplete item

```php
function test() {
  console.log("notice the blank line before this function?");
}
```

Description | Status
----------- | ------
Bug fix: | no
Feature addition: | no
Enhancement: | yes
Backwards compatibility break: | no
Fixes the following tickets: | -

license: MIT

repository: rzproject/sandbox

extension: md

gha_language: Cucumber

license_type: permissive

repo_name: rzproject/sandbox


text:
# Fragaria vesca var. crinita (Rydb.) C.L.Hitchc. VARIETY

#### Status
SYNONYM

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

#### Published in
C. L. Hitchcock et al. , Vasc. pl. Pacif. N. W. 3:108. 1961

#### Original name
null

### Remarks
null

repository: mdoering/backbone

path: /life/Plantae/Magnoliophyta/Magnoliopsida/Rosales/Rosaceae/Fragaria/Fragaria vesca/ Syn. Fragaria vesca crinita/README.md

branch_name: refs/heads/master

repo_name: mdoering/backbone


text:
# Assignment Week 13
## Build, test, document, deploy your project

26 November 2018

**Team Members / Honor pledge**

Sapana Belorkar Adam Burbidge Keith Roseberry Rakshith Varadaraju

_I pledge on my honor that I have not given or received any unauthorized assistance on this assignment/examination. I further pledge that I have not copied any material from a book, article, the Internet or any other source except where I have expressly cited the source._

# **Assignment**

Weeks 4-12 are dedicated to building, testing, documenting, and deploying your project.  You should use GitHub for source control and project tracking.

Each team will meet weekly with faculty to discuss current status, issues, and concerns.  We'll also review the issues in your GitHub repository so be sure to keep GitHub up to date.

# **Response**

### Sprint 5 Week 2

gha_language: Java


text:
# Building the GBSNats plugin

- [Building the GBSNats plugin](#building-the-gbsnats-plugin)
  - [Dependencies](#dependencies)
    - [vcpkg](#vcpkg)
    - [openssl](#openssl)

## Dependencies

Note: For windows I was using vcpkg, but protobuf-c isn't implemented for Windows via vcpkg, so that was a dead end.  Since I'm currently only using this plugin for my dedicated servers which run on Linux, I'm temporarily dropping support for Windows.  You can still edit blueprints in Windows, but it won't execute any NATS.io calls.

### vcpkg

Install vcpkg (and then optionally add \vcpkg to your PATH)

```bat
git clone https://github.com/microsoft/vcpkg
.\vcpkg\bootstrap-vcpkg.bat
```

### openssl

OpenSSL

```
.\vcpkg install openssl:x64-windows

repository: redhillgames/Unreal-NATS

branch_name: refs/heads/main

repo_name: redhillgames/Unreal-NATS


text:
# Readme - Code Samples for Chapter 28, Testing

This chapter contains the following code samples:

* UnitTestingSamples
    * UnitTestingSamples (Library to be tested)
    * UnitTestingSamples.MSTests (Tests with MSTest)
    * UnitTestingSamples.xUnit.Tests (Tests with xUnit)
* MockingSamples (library and xUnit tests using a mocking library)
* EFCoreSample (Library and unit tests using the in-memory EF Core provider)
* WindowsApp (UI Testing with WindowsApp.UITest)
* ASPNETCoreSample (integration tests with TestServer from AspNetCore.TestHost)
* WebApplicationSample (Web Load test)

The sample WindowsApp only runs on Windows.

To build and run the .NET Core samples, please install one of these tools:

* Visual Studio 2017 Update 5 with the .NET Core workload
* Visual Studio for Mac
* Visual Studio Code

Please download and install the tools from [.NET Core downloads](https://www.microsoft.com/net/core).

For code comments and issues please check [Professional C#'s GitHub Repository](https://github.com/ProfessionalCSharp/ProfessionalCSharp7)

Please check my blog [csharp.christiannagel.com](https://csharp.christiannagel.com "csharp.christiannagel.com") for additional information for topics covered in the book.

Thank you!

gha_language: C#

gha_license_id: MIT


text:
# Relation Extraction with Word Graphs from N-grams

```
@inproceedings{agcn_emnlp21,
title = {Relation Extraction with Word Graphs from N-grams},
author = {Qin, Han and Tian, Yuanhe and Song, Yan},
booktitle = {Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing (EMNLP)},
pages = {2860--2868},
year = {2021}
}
```

links
- [acl](https://aclanthology.org/2021.emnlp-main.228)

gha_language: Jupyter Notebook


text:
# image build

<!---MARKER_GEN_START-->
Build an image from a Dockerfile

### Aliases

`docker image build`, `docker build`, `docker buildx build`, `docker builder build`

### Options

| Name                      | Type          | Default   | Description                                                       |
|:--------------------------|:--------------|:----------|:------------------------------------------------------------------|
| `--add-host`              | `list`        |           | Add a custom host-to-IP mapping (`host:ip`)                       |
| `--build-arg`             | `list`        |           | Set build-time variables                                          |
| `--cache-from`            | `stringSlice` |           | Images to consider as cache sources                               |
| `--cgroup-parent`         | `string`      |           | Set the parent cgroup for the `RUN` instructions during build     |
| `--compress`              |               |           | Compress the build context using gzip                             |
| `--cpu-period`            | `int64`       | `0`       | Limit the CPU CFS (Completely Fair Scheduler) period              |
| `--cpu-quota`             | `int64`       | `0`       | Limit the CPU CFS (Completely Fair Scheduler) quota               |
| `-c`, `--cpu-shares`      | `int64`       | `0`       | CPU shares (relative weight)                                      |
| `--cpuset-cpus`           | `string`      |           | CPUs in which to allow execution (0-3, 0,1)                       |
| `--cpuset-mems`           | `string`      |           | MEMs in which to allow execution (0-3, 0,1)                       |
| `--disable-content-trust` |               |           | Skip image verification                                           |
| `-f`, `--file`            | `string`      |           | Name of the Dockerfile (Default is `PATH/Dockerfile`)             |
| `--force-rm`              |               |           | Always remove intermediate containers                             |
| `--iidfile`               | `string`      |           | Write the image ID to the file                                    |
| `--isolation`             | `string`      |           | Container isolation technology                                    |
| `--label`                 | `list`        |           | Set metadata for an image                                         |
| `-m`, `--memory`          | `bytes`       | `0`       | Memory limit                                                      |
| `--memory-swap`           | `bytes`       | `0`       | Swap limit equal to memory plus swap: -1 to enable unlimited swap |
| `--network`               | `string`      | `default` | Set the networking mode for the RUN instructions during build     |
| `--no-cache`              |               |           | Do not use cache when building the image                          |
| `--platform`              | `string`      |           | Set platform if server is multi-platform capable                  |
| `--pull`                  |               |           | Always attempt to pull a newer version of the image               |
| `-q`, `--quiet`           |               |           | Suppress the build output and print image ID on success           |
| `--rm`                    |               |           | Remove intermediate containers after a successful build           |
| `--security-opt`          | `stringSlice` |           | Security options                                                  |
| `--shm-size`              | `bytes`       | `0`       | Size of `/dev/shm`                                                |
| `--squash`                |               |           | Squash newly built layers into a single new layer                 |
| `-t`, `--tag`             | `list`        |           | Name and optionally a tag in the `name:tag` format                |
| `--target`                | `string`      |           | Set the target build stage to build.                              |
| `--ulimit`                | `ulimit`      |           | Ulimit options                                                    |

<!---MARKER_GEN_END-->

## Description

See [docker build](build.md) for more information.

repository: docker/cli

gha_language: Go

repo_name: docker/cli


text:
# GraphQL Example Using GQL Gen

The purpose of this example is to provide details as to how one would go about creating a Restful API with the Buffalo Web Framework.

## Getting Started

## Software requirements

- [Go 1.10.3 or higher](https://golang.org/dl)

## Communication

- If you **need help**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/graphql). (Tag 'graphql')
- If you'd like to **ask a general question**, use [Stack Overflow](http://stackoverflow.com/questions/tagged/graphql).
- If you **found a bug**, open an issue.
- If you **have a feature request**, open an issue.
- If you **want to contribute**, submit a pull request.

## Quick Installation

1.  clone this repository

    ```text
    $ cd $GOPATH/src/github.com
    $ git clone git@github.com:conradwt/gqlgen_example.git
    ```

2.  change directory location

    ```text
    $ cp /path/to/gqlgen_example
    ```

3.  start the server

    ```text
    $ go run server/server.go
    ```

4.  navigate to the site in the browser

    ```text
    $ open http://localhost:8080
    ```

5.  test some queries

    ```text
    mutation createTodo {
      createTodo(input:{text:"todo", userId:"1"}) {
        user {
          id
        }
        text
        done
      }
    }

    query findTodos {
      todos {
        text
        done
        user {
          name
        }
      }
    }
    ```

## GQL Gen References

- Official website: https://gqlgen.com
- Guides: https://gqlgen.com
- Docs: https://gqlgen.com
- Source: https://github.com/99designs/gqlgen

## Support

Bug reports and feature requests can be filed with the rest for the GraphQL Example Using GQL Gen project here:

- [File Bug Reports and Features](https://github.com/conradwt/gqlgen_example/issues)

## License

GraphQL Example Using GQL Gen is released under the [MIT license](https://mit-license.org).

## Copyright

copyright:: (c) Copyright 2018 Conrad Taylor. All Rights Reserved.


text:
# Simple C++ combinatiorial parsers

This is simple, but correct implementation, regarding side effect of actions.

Parsing is done in two stages: 1. parse input, 2. apply effects, if parsing was successful.

So, you may attach to parser actions with side effects and do not worry that they will be triggered many times during backtracking on parsing.

See test.cpp for URI parsing example.

Source is licensed under MIT license.


text:
# 2.2.3

* [core] Allow `.assert.empty` on FocusOption
* [core] Allow `.assert.defined` on FocusOption
* [selenium] WebDriver `.executeJsOrThrow` now accepts args and returns a result
* [selenium] Add `.parent` as an extension to `WebElement`
* [dom-zipper] Add `.parent` to move to the focus' parent
* [dom-zipper] Allow `.child()` as shorthand for `.child(1 of 1)`
* [ext-cats] Upgrade Cats to 1.4.0
* [ext-scalaz] Upgrade Scalaz to 7.2.26
* [ext-scalajs-react] Upgrade scalajs-react to 1.3.0

repository: japgolly/test-state

gha_language: Scala

repo_name: japgolly/test-state


text:
# Delta - Roadmap

This document describes the current status and upcoming milestones of the Delta
project, built on Conflux.

*Updated: Fri, 6 Nov 2020 04: GMT.*

## Delta

#### Milestone Summary

|  Status  |   Milestone   | Goals | ETA |
|:--------:|:-------------:|:-----:|:---:|
| :rocket: | [Payment API] |       |     |
| :rocket: |    [Wallet]   |       |     |

[Payment API]: #payment-api
[Wallet]: #wallet

#### Payment API

> This milestone will be done when
* All backends are selected (likely express / next, coupled with an SQL DB)
* An accounts system is in place (with tokenization)
* An API is made to serve all data needed for the wallet, including balance
* The API is linked to the Conflux network

This will allow us to then move on to developing the wallet.

🚀  **OPEN**   📉   **0 / 0** goals completed **(0%)**
  📅   **UNKNOWN**

| Status | Goal | Labels |
|:------:|:----:|:------:|
|   :x:  |      |        |

#### Wallet

> This milestone will be done when
* The electron workflow is setup
* The frontend is designed
* The frontend is implemented
* A login page is built in order to authenticate with the API
* Everything is hooked up to the API
* Embeddable payments are integrated with the API's transaction functions

After this, Delta's core functionality will be complete.

We aim to build this for the following first: Android, Windows, and *NIX
And then port to: MacOS, and iOS.

🚀  **OPEN**   📉   **0 / 0** goals completed **(0%)**
  📅   **UNKNOWN**

| Status | Goal | Labels |
|:------:|:----:|:------:|
|   :x:  |      |        |


text:
# CopyStack
This software allows you copy multiple items and paste in order (gives you much flexibility).
![](assets/screenshot.png)

How to use it :

(1) Select the hotkeys for copy and paste if you want, else leave it as it is.

(2) If you check the stack it means your copied items will come out in reverse order (Last In First Out)

(3) Press Start to start

(4) If you want to pause, press pause.

(5) If you want to clear the stack, then you can press clear button.

repository: RoshanStark/CopyStack

repo_name: RoshanStark/CopyStack


text:
# Expression Syntax

Expression syntax allows you to randomize the data loader sends to your app in requests. Expressions can be substituted in URLs, GET or POST parameters, and POST body to create dynamic/random requests.

Expressions are available for numeric values only. All expressions begin with `%{` and end with `}`. The following patterns are supported:

      Expression Type
      Example
      Result

      List of values
      %{1, 2, 3}
      Iterate over the values

      Range of values
      %{1:100:2}
      Values from 1 to 100 incrementing by 2

      Random values
      %{*:1-100}
      Pick random values between 1 and 100

      List of Expressions
      %{1, 2:100:2, *:1-100, 17}
      Evaluates each expression in turn

repository: andrewbradfordsmith/loaderio-docs

repo_name: andrewbradfordsmith/loaderio-docs


text:
# About

![](repo-images/faceoff.png)

High Kick, Low Kick, Punch (or Kick, Kick, Punch) is a spin off of traditional Rock Paper Scissors. It's played the same, but with the addition of being able to use combinations. One day I had the thought, "I wish I had a fun way to settle disputes with friends...", and within the next 48 hours High Kick, Low Kick, Punch was born.

This  was built many moons ago and could probably use quite a bit of code TLC :), but [you're welcome to try it out in real-time](http://jamie-k.com/side-projects/kick-kick-punch/)

# The Fighters

I chose Muay Thai Mark and Kung Fu Kirk as the playable characters. I didn't really dive into character development because they consist of animated gifs. Instead of controlling the actual motion of the characters you simply select your moves and they're executed. Going the GIF rout proved to be difficult because I not only had to make sure that all animations were the same length, but they all had to be within a certain bounding box to ensure that the fighters appeared to interact.

![](repo-images/muay-thai-mark.png)

![](repo-images/kung-fu-kirk.png)

# The Guts

I decided that I didn't want to make just another rock paper scissors game so I added life bars, combos, stamina and dodging. This adds a little more competitiveness by allowing you to actually fight your opponent. Of course, it also introduced an enormous amount of complexity to the logic. It was difficult because I needed to make sure that the animations executed at the same time, stamina and life was tracked and that each player was able to enter combinations. I also added the ability to play against a computer opponent.

After countless hours of writing pseudocode, running through logic and wearing out the keys on my keyboard the high kick, low kick, punch engine was complete.

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

repository: jamiek-dev/highkick-lowkick-punch

repo_name: jamiek-dev/highkick-lowkick-punch


text:
General Commands
================

### Get help for a specific function:

| **Matlab** | `help sqrt`        |
|:-----------|:-------------------|
| **Torch**  | `help(torch.sqrt)` |

Documentation of `sqrt` function is shown.

### Scalar operations:

| **Matlab** | `testVar1 = (4*5-1+10.1)/3^2;` |
|:-----------|:-------------------------------|
| **Torch**  | `testVar1 = (4*5-1+10.1)/3^2;` |

The resultant value (3.2333) is assigned to variable `testVar1`.

### Scalar assignment:

| **Matlab** | `testVar2 = testVar1;` or `testVar2 = testVar1` |
|:-----------|:------------------------------------------------|
| **Torch**  | `testVar2 = testVar1;` or `testVar2 = testVar1` |

The value of variable `testVar1` (3.2333) is assigned to variable `testVar2`.

### Display strings and numbers:

| **Matlab** | `disp(['The distance is ', num2str(100), ' meters.'])` |
|:-----------|:-------------------------------------------------------|
| **Torch**  | `print('The distance is ' .. 100 .. ' meters.')`       |

This prints `The distance is 100 meters.` in the output.

### Determine type:

| **Matlab** | `class('Hi')`      |
|:-----------|:-------------------|
| **Torch**  | `torch.type('Hi')` |

For this example, Matlab returns `char`, and Torch returns `string`.

Matrices and Tensors
====================

### Create a two-dimensional tensor or matrix:

| **Matlab** | `m = [9, 6, 3, 4; 7, 2, 8, 1]`                   |
|:-----------|:-------------------------------------------------|
| **Torch**  | `m = torch.Tensor({{9, 6, 3, 4}, {7, 2, 8, 1}})` |

A 2×4 two-dimensional tensor (matrix) with specified elements is formed and assigned to `m`.

### Number of dimensions of a tensor:

| **Matlab** | `ndims(m)` |
|:-----------|:-----------|
| **Torch**  | `m:dim()`  |

For example here, for the previously defined two-dimensional tensor (matrix) `m`, the returned number is 2.

### Size of a tensor in all dimensions:

| **Matlab** | `size(m)`          |
|:-----------|:-------------------|
| **Torch**  | `m:size()` or `#m` |

For example here, for the previously defined two-dimensional tensor (matrix) `m`, the returned numbers are 2 and 4, which are the numbers of rows and columns, respectively.

### Size of a tensor in a specific dimension:

| **Matlab** | `size(m,2)`              |
|:-----------|:-------------------------|
| **Torch**  | `m:size(2)` or `(#m)[2]` |

For example here, for the previously defined two-dimensional tensor (matrix) `m`, the returned number is 4, which is the size of the second dimension (number of columns).

### Number of elements in a tensor:

| **Matlab** | `numel(m)`  |
|:-----------|:------------|
| **Torch**  | `m:numel()` |

For example here, for the previously defined two-dimensional tensor (matrix) `m`, the returned number is 8.

### Create a row vector:

| **Matlab** | `v = [9, 7, 6, 8]` or `v = [9 7 6 8]` |
|:-----------|:--------------------------------------|
| **Torch**  | `v = torch.Tensor({{9, 7, 6, 8}})`    |

Unlike Matlab, this is not used as a vector in Torch because it is a two-dimensional Tensor.

### Create a column vector:

| **Matlab** | `v = [9; 7; 6; 8]`                       |
|:-----------|:-----------------------------------------|
| **Torch**  | `v = torch.Tensor({{9}, {7}, {6}, {8}})` |

Again unlike Matlab, this is not used as a vector in Torch because it is still a two-dimensional Tensor.

### Create a one-dimensional tensor:

| **Matlab** | *Not available*                  |
|:-----------|:---------------------------------|
| **Torch**  | `t = torch.Tensor({9, 7, 6, 8})` |

Matlab does not have *one-dimensional tensors*; this can be verified by running `ndims([9, 7, 6, 8])`. On the other hand, for many operations that Matlab uses row or column vectors, Torch uses one-dimensional tensors.

### Access an element in a vector or one-dimensional tensor:

| **Matlab** | `v(2)` |
|:-----------|:-------|
| **Torch**  | `t[2]` |

Second element of the vector is accessed.

### Access an element from the end of a vector or one-dimensional tensor:

| **Matlab** | `v(end-1)` |
|:-----------|:-----------|
| **Torch**  | `t[-2]`    |

Second element from the end of the vector is accessed.

### Access a range of elements in a vector or one-dimensional tensor:

| **Matlab** | `v(2:4)`     |
|:-----------|:-------------|
| **Torch**  | `t[{{2,4}}]` |

Second to fourth elements of the vector are accessed.

### Access an element in a matrix:

| **Matlab** | `m(2, 3)`                |
|:-----------|:-------------------------|
| **Torch**  | `m[{2, 3}]` or `m[2][3]` |

Second row, third column element is accessed. Accessing in the form of `m[2][3]` is not recommended, because it causes an `out of memory` error for large tensors.

### Access a row in a matrix as a two-dimensional tensor:

| **Matlab** | `m(2, :)`      |
|:-----------|:---------------|
| **Torch**  | `m[{{2}, {}}]` |

The returned row is a two-dimensional tensor.

### Access a row in a matrix as a one-dimensional tensor:

| **Matlab** | *Not available*        |
|:-----------|:-----------------------|
| **Torch**  | `m[{2, {}}]` or `m[2]` |

The returned row is a one-dimensional tensor.

### Access a column in a matrix as a two-dimensional tensor:

| **Matlab** | `m(:, 2)`      |
|:-----------|:---------------|
| **Torch**  | `m[{{}, {2}}]` |

The returned column is a two-dimensional tensor.

### Access a column in a matrix as a one-dimensional tensor:

| **Matlab** | *Not available* |
|:-----------|:----------------|
| **Torch**  | `m[{{}, 2}]`    |

The returned column is a one-dimensional tensor.

### Access a range of elements in a matrix:

| **Matlab** | `m(2, 2:4)`                        |
|:-----------|:-----------------------------------|
| **Torch**  | `m[{{2}, {2,4}}] or m[{2, {2,4}}]` |

The second to fourth columns of the second row are returned. In Torch, there is a slight difference between using `index` (e.g. `2`) or `{index}` (e.g. `{2}`) for pointing to a singleton dimension. For `{index}`, the dimension of the returned tensor is same as the original tensor (e.g. tensor `m`). For `index`, the singleton dimension is removed, and the dimension of the returned tensor is one less than the original tensor (e.g. tensor `m`). Also, `{}` refers to all elements in that dimension. Finally, `-index` (e.g. `-4`) means `index`-th (e.g. fourth) element from the end.

Forming Basic Tensors
=====================

### Create a vector over a range of values with unit step:

| **Matlab** | `3:8`               |
|:-----------|:--------------------|
| **Torch**  | `torch.range(3, 8)` |

Torch’s result is a one-dimensional tensor with elements spaced `1` strating at `3`.

### Create a vector over a range of values with an arbitrary step:

| **Matlab** | `3:-1.9:-4.2`                |
|:-----------|:-----------------------------|
| **Torch**  | `torch.range(3, -4.2, -1.9)` |

Torch’s result is a one-dimensional tensor with elements spaced `-1.9` strating at `3`.

### Create a vector with linearly-located elements:

| **Matlab** | `linspace(3, 8, 50)`       |
|:-----------|:---------------------------|
| **Torch**  | `torch.linspace(3, 8, 50)` |

Torch’s result is a one-dimensional tensor with `50` equally-spaced elements strating at `3` and ending at `8`.

### Create a vector with logarithmically-located elements:

| **Matlab** | `logspace(3, 8, 50)`       |
|:-----------|:---------------------------|
| **Torch**  | `torch.logspace(3, 8, 50)` |

Torch’s result is a one-dimensional tensor with `50` exponentially-spaced elements strating at 103 and ending at 108.

### Create an all zeros vector or one-dimensional tensor:

| **Matlab** | `zeros(1,4)` or `zeros(4,1)` |
|:-----------|:-----------------------------|
| **Torch**  | `torch.zeros(4)`             |

Torch’s result is a one-dimensional tensor with `4` zero elements.

### Create an all zeros matrix:

| **Matlab** | `zeros(5,3)`       |
|:-----------|:-------------------|
| **Torch**  | `torch.zeros(5,3)` |

5×3 matrix of zeros is generated.

### Create an all ones vector or one-dimensional tensor:

| **Matlab** | `ones(1,4)` or `ones(4,1)` |
|:-----------|:---------------------------|
| **Torch**  | `torch.ones(4)`            |

Torch’s result is a one-dimensional tensor with `4` one elements.

### Create an all ones matrix:

| **Matlab** | `ones(5,3)`       |
|:-----------|:------------------|
| **Torch**  | `torch.ones(5,3)` |

5×3 matrix of ones is generated.

### Create an identity matrix:

| **Matlab** | `eye(5,3)`       |
|:-----------|:-----------------|
| **Torch**  | `torch.eye(5,3)` |

5×3 identity matrix is generated.

### Create a square identity matrix:

| **Matlab** | `eye(4)`       |
|:-----------|:---------------|
| **Torch**  | `torch.eye(4)` |

4×4 identity matrix is generated.

### Create a uniformly-distributed random vector or one-dimensional tensor:

| **Matlab** | `rand(1,4)` or `rand(4,1)` |
|:-----------|:---------------------------|
| **Torch**  | `torch.rand(4)`            |

Torch’s result is a one-dimensional tensor with `4` random elements from uniform probability distribution.

### Create a uniformly-distributed random matrix:

| **Matlab** | `rand(5,3)`       |
|:-----------|:------------------|
| **Torch**  | `torch.rand(5,3)` |

5×3 matrix of random elements from uniform probability distribution is generated.

### Create a normally-distributed random vector or one-dimensional tensor:

| **Matlab** | `randn(1,4)` or `randn(4,1)` |
|:-----------|:-----------------------------|
| **Torch**  | `torch.randn(4)`             |

Torch’s result is a one-dimensional tensor with `4` random elements from normal probability distribution.

### Create a normally-distributed random matrix:

| **Matlab** | `randn(5,3)`       |
|:-----------|:-------------------|
| **Torch**  | `torch.randn(5,3)` |

5×3 matrix of random elements from normal probability distribution is generated.

Operations
==========

### Tensor assignment without memory copy:

| **Matlab** | *Not directly available*              |
|:-----------|:--------------------------------------|
| **Torch**  | `matOut = matIn` or `matOut = matIn;` |

Matlab internally handles memory assignment for a copied array. As soon, as the copied array is modified in Matlab, a copy of the initial array is generated. Whereas, Torch gives this option to have a copied tensor that points to the same location in the memory as the initial tensor. For example, if elements of the `matOut` tensor are modified here, the same changes happen to the elements of the `matIn` tensor.

### Tensor assignment with memory copy:

| **Matlab** | `matOut = matIn` or `matOut = matIn;`                 |
|:-----------|:------------------------------------------------------|
| **Torch**  | `matOut = matIn:clone()` or `matOut = matIn:clone();` |

Matlab’s internal memory handling for array assignment is somewhat closer to this. Here, Torch generates a copy of the tensor content in memory. Any changes in `matOut` elements are independent of the changes in the elements of the `matIn` tensor.

### Change type of a tensor:

| **Matlab** | `uint8(matIn)`, `int8(matIn)`, `int16(matIn)`, `int32(matIn)`, `int64(matIn)`, `single(matIn)`, or `double(matIn)`   |
|:-----------|:---------------------------------------------------------------------------------------------------------------------|
| **Torch**  | `matIn:byte()`, `matIn:char()`, `matIn:short()`, `matIn:int()`, `matIn:long()`, `matIn:float()`, or `matIn:double()` |

By default, double precision is used.

### Multiplication of a tensor by a scalar:

| **Matlab** | `matIn * 17` or `17 * matIn` |
|:-----------|:-----------------------------|
| **Torch**  | `matIn * 17`                 |

Pay attention that in Torch, the scalar cannot be the first argument of the multiplication.

### Matrix multiplication of a tensor by another tensor:

| **Matlab** | `matA * matB` |
|:-----------|:--------------|
| **Torch**  | `matA * matB` |

Tensor sizes must be appropriate for the multiplication.

### Element-wise multiplication of a tensor by another tensor:

| **Matlab** | `matA .* matB`           |
|:-----------|:-------------------------|
| **Torch**  | `torch.cmul(matA, matB)` |

Tensor sizes must be identical.

### Transpose of a two-dimensional tensor (matrix):

| **Matlab** | `matIn.'`   |
|:-----------|:------------|
| **Torch**  | `matIn:t()` |

A new tensor, which is the transpose of the input matrix (two-dimensional tensor) is returned.

### Vertical tensor concatenation:

| **Matlab** | `[matTop; matBottom]`             |
|:-----------|:----------------------------------|
| **Torch**  | `torch.cat(matTop, matBottom, 1)` |

The number of columns in input tensors must be equal.

### Horizontal tensor concatenation:

| **Matlab** | `[matLeft, matRight]`             |
|:-----------|:----------------------------------|
| **Torch**  | `torch.cat(matLeft, matRight, 2)` |

The number of rows in input tensors must be equal.

### Square root of elements returned in a new tensor:

| **Matlab** | `matOut = sqrt(matIn)`       |
|:-----------|:-----------------------------|
| **Torch**  | `matOut = torch.sqrt(matIn)` |

Square root of each element is saved in an output tensor with the same size as the input tensor.

### Square root of elements returned in the same tensor:

| **Matlab** | `matIn = sqrt(matIn)`                                                |
|:-----------|:---------------------------------------------------------------------|
| **Torch**  | `matIn = torch.sqrt(matIn)` or `matIn.sqrt(matIn)` or `matIn:sqrt()` |

`matIn:sqrt()` is same as `matIn.sqrt(matIn)`. Generally in Torch, `object:function(p1, p2, ...)` is same as
`object.function(object, p1, p2, ...)`, where the function’s object (also known as `self`) is passed as the first input to the function.

### Element-wise power to a scalar:

| **Matlab** | `matIn.^5`            |
|:-----------|:----------------------|
| **Torch**  | `torch.pow(matIn, 5)` |

Each element to the power of 5 is saved in an output tensor with the same size as the input tensor.

### Element-wise power to a tensor:

| **Matlab** | `matIn.^matPow`             |
|:-----------|:----------------------------|
| **Torch**  | `torch.cpow(matIn, matPow)` |

Each element of the `matIn` tensor to the power of the corresponding element of the `matPow` tensor is saved in an output tensor with the same size as the input tensor.

repository: akatie/Torch-for-Matlab-users

repo_name: akatie/Torch-for-Matlab-users


text:
%META:TOPICINFO{author=\"shannon\" date=\"1051306132\" format=\"1.0\"
version=\"1.5\"}% %META:TOPICPARENT{name=\"WebHome\"}%
\<center\>\<h1\>SAM and MERRY: The Two Skotos Languages\</h1\> *or: What
Are Hobbits Doing Here?*\</center\>

The Skotos Developer Interface allows you to do much of the work of
creating an online game. You can describe rooms, objects, people, and
whatever else you might want to fill your game world with. The problem
is, however, it\'s totally static.

Sure, you can create some objects that do things. Lots of them,
actually. You can create swords that cut and clothes that can be worn
and pouches that can hold stuff. But, if you want to make anything that
varies in any way from the standard objects, you\'re stuck.

The engineers behind the Skotos system do their engineering work in one
of two programming languages\--C or LPC. This is partially available to
all developers as MERRY. However, some developers might prefer using the
simpler SAM system for simple, dynamic descriptions.

\<h3\>SAM: Skotos Active Markup\</h3\>

Master Samwise is the simplest of the Skotos languages. Its primary
purpose is to allow for variable output of text. With SAM, a description
might appear differently to different characters, to people with
different skills, or just randomly. SAM is most often used to modify
descriptions, such as briefs, looks, and examines. However, over time
it\'s expanded so that it can be used in other places.

SAM can also be used to change things when a certain text is read.
(Inevitably, this causes variable output of text too, but it\'s a long
term thing.) For example, whenever someone read a sign you could mark
that they\'d seen that sign, then never force them to see that sign
again, or curse them, or whatever you want.

\<h3\>MERIADOC: Mediated Execution Registry Involving A Dialect Of
C\</h3\>

Most developers will not want to use MERIADOC; most engineers will.
MERRY is essentially the LPC that most of the complex systems of The
Skotos Developer Server are built in, except it\'s been \"sandboxed\" to
try and prevent Admins.StoryBuilders from accidently destroying the
whole world.

MERIADOC allows access to a fairly complete dialect of C, and you can
use this language for *whatever* you want to do. However, if the
capabilities of SAM are sufficient, you should strongly consider using
them instead.

*This documents leaves out discussion of BILBO, the original Skotos
programming language. MERRY is a cleaner and more powerful language, and
thus we don\'t suggest BILBO be used except for legacy systems. For
legacy purposes only, you can get info on BILBO at the BilboIntro.*

\<center\>**For more information:** ( [SAM](SamIntro) \|
[MERRY](MerryIntro) )

\-- Main.ShannonAppelcline - 13 Dec 2001

repository: ChatTheatre/language-plugin

repo_name: ChatTheatre/language-plugin


text:
# Tag 0.2.0

## Wednesday, May 25, 2016
* Updated ExcelDataFormatter::addRow() and ExcelDataFormatter::getFieldsForObj() so that DataObjects can suggest a default set of Fields to Export.
* Added the ability for the ExcelDataFormatter to use field labels instead of just displaying the Database Field name.
* Added a change log.
* Updated the ReadMe with information about how to choose the column and customise the headers.
* Generalise the logic on the GridFieldExcelExportButton to minimise code duplication between the XLSX, XLS and CSV action.
* Update GridFieldExcelExportAction and GridFieldExcelExportButton so we can set the UseLabelsAsHeaders flag on the underlying ExcelDataFormatter.

repository: firebrandhq/excel-export

gha_language: PHP

repo_name: firebrandhq/excel-export


text:
---
layout: relation
title: 'appos'
shortdef: 'appositional modifier'
udver: '2'
---

An appositional modifier of an NP is an NP immediately to the right of the first NP that serves to define or modify that NP. It also includes parenthesized examples.

### Examples:

_Tá gearán déanta ag Unison, ceardchumann lucht na mbónaí bána, leis an gCoimisiún_ `Unison, the workers' trade union, have made a complaint to the Commission'

~~~ sdparse
Tá gearán déanta ag Unison , ceardchumann lucht na mbónaí bána , leis an gCoimisiún \n Is complaint made by Unison , trade-union group the collars white  , with the Commission
appos(Unison, ceardchumann)
~~~

_Chas m'athair air sa tábhairne, O' Shea's i nDomhnach Broc_ `My father met him in the pub, O' Shea's in Donnybrook'

~~~ sdparse
Chas m' athair air sa tábhairne , O' Shea's i nDomhnach Broc \n Met my father on-him in-the pub , O' Shea's in Donnybrook []
appos(tábhairne, Shea's)
~~~

_Helena McMahon, duine a bhfuil baint aici le healaín phobail i Luimneach._ `Helena McMahon, someone who is involved in community art in Limerick'

~~~ sdparse
Helena McMahon, duine a bhfuil baint aici le healaín phobail i Luimneach. \n Helena McMahon, person who there_is part at_her with art of_community in Limerick.
appos(Helena, duine)
~~~

In cases where a date string forms a separate clause (potentially introduced by punctuation), the `appos` label is preferred for the head of the string. Subsequent tokens that are part of the string are attached as `flat`.

_Tá an spriocdháta seo a leanas leagtha amach d'iarratais ar chabhair dheontais: 16 Eanáir 2003._ `The following closing date has been set for applications for grant aid: 16 January 2003.'

~~~ sdparse
Tá an spriocdháta seo a leanas leagtha amach d'iarratais ar chabhair dheontais: 16 Eanáir 2003. \n Is the closing_date this that will_follow laid out for_applications on aid of_grant: 16 January 2003.
appos(spriocdháta, 16)
flat(16, Eanáir)
flat(16, 2003.)
~~~

In cases where the sentence can be disjointed, but there is a close relation between the tokens, we use appos.

_Tuilleadh eolais Fón: 01-4757401 r-phost<EMAIL_ADDRESS>'More information Phone: 01-4757401 email<EMAIL_ADDRESS>
~~~ sdparse
Tuilleadh eolais Fón: 01-4757401 r-phost<EMAIL_ADDRESS>\n More information Phone: 01-4757104 email<EMAIL_ADDRESS>appos(fón, 01-4757401)
appos(r-phost<EMAIL_ADDRESS>~~~

repository: UniversalDependencies/docs

branch_name: refs/heads/pages-source

gha_language: HTML

repo_name: UniversalDependencies/docs


text:
# About
Service that checks that websites/URLs listed in a specified configuration file respond correctly. *Asynchronous requesting* makes things go quicker especially if many servers are slow to respond, although it may cause problems with if servers consider your requests to be spam.

There is also an extremely basic web interface available in the [flask branch](https://github.com/kimsappi/website-status/tree/flask). A version of the web interface is available [here](http://kimsappi-website-status.herokuapp.com/).

# Requirements
* Python 3.7 (for `asyncio.run`) & pip
  * Python 3.8 is required for `tests/testRequest` (`unittest.IsolatedAsyncioTestCase`)
* Python `venv` or similar recommended
* Python module `aiohttp` (+its dependencies) for asynchronous requests

# Instructions
```shell
git clone http://github.com/kimsappi/website-status.git
cd website-status

# The following block is optional: virtual environment setup
python3 -m venv env
source env/bin/activate

pip3 install -r requirements.txt
python3 src/app.py /path/to/config # path can also be a URL to a JSON file

# Finally, you can run the tests if you want
./test.sh
```

# Configuration
The configuration file **must not** be named `http*` if called with just the filename. If called with a path, file names can be acceptable. This is because a path starting with `http` is considered a URL.

Configuration needs to be in JSON format with the following values:
* `logPath` (string, **required**): Specify the path of the file you wish the output to be logged to. File must be writable. This can be an absolute path or relative to the directory the app is run from.
* `interval` (string, *optional* (but will log an error if not present or invalid), default 60 seconds): Specify the interval at which the service is run. Values are natural language strings like `5 seconds`. Allowed values: `second, seconds, minute, minutes, hour, hours`. `1 seconds` is considered acceptable, as is `5 hour`. There is a minimum enforced interval of 1 second. The number must be an integer.
* `timeout` (int, *optional*, default 10 seconds): Specify the request timeout time in seconds.
* `urls` (array, **required**): This array contains objects with the following values:
  * `url` (string): URL to be checked.
  * At least one of the following (technically neither is required, but in that case any response (even e.g. a 404) is considered a success):
    * `status` (int): Request is considered successful if the response status is the value specified here.
    * `content` (string): Response body contains this string.

# Log file format
The format of a request line is (columns are tab-separated):
`<datetime> <level> URL=<url> STATUS=<response status code || 'error'> TIME=<response time> MSG=<message about request success/failure>`

Each block starts and ends with an `INFO` line containing data about the block.
```
2020-10-07 04:53:36,848	INFO	STARTING 6 requests
2020-10-07 04:53:36,858	ERROR	URL=http://localhost:60000	STATUS=error	TIME=0.006	MSG=Connection refused
2020-10-07 04:53:37,115	INFO	URL=https://google.com	STATUS=200	TIME=0.267	MSG=Success
2020-10-07 04:53:37,174	WARNING	URL=http://example.com/thispageprobablydoesnotexist	STATUS=404	TIME=0.322	MSG=Server responded with wrong status. Expected 200
2020-10-07 04:53:37,186	INFO	URL=https://github.com	STATUS=200	TIME=0.335	MSG=Success
2020-10-07 04:53:37,265	WARNING	URL=https://stackoverflow.com	STATUS=200	TIME=0.414	MSG=Both status and content checks failed. Expected 404, 'This string will hopefully not be found 34ef4ewgsregrg'
2020-10-07 04:53:47,232	ERROR	URL=http://google.com:81	STATUS=error	TIME=10.380	MSG=Request timed out
2020-10-07 04:53:47,232	INFO	COMPLETED 6 requests.	ERROR=2	WARNING=2	SUCCESS=2
```

# Considerations
* I chose to reread the configuration on every run, so the surveyed websites can be changed dynamically and
* `time.sleep()` probably isn't the ideal solution. A tool like `cron` or some external application controlling the requests would probably be a better solution.
* Timing may break completely if more than 100 URLs (`aiohttp` default simultaneous connections) are added. Lower-level tinkering would be needed to figure out when requests are actually made.
* I'm sure better separation of concerns is possible, e.g. logging for a specific request is made inside `Request.fetch()` itself. However, this was my first attempt as async Python so I wasn't entirely sure how that could be possible while keeping the logging real-time.
* Asynchronous requests may not be the best idea if multiple requests are directed at the same server, since they may be considered spam.
* The service could also be implemented as a daemon.

# Optional: Design question
Premise: "Responses and latencies need to be logged from several locations."

Instead of writing to a single log file or sending each log line to a central server ephemerally, it would make sense to propagate the data either via an API or database(s) to a central hub, from which the global data would then be accessible.

## API considerations
Each server could offer an API for the central server to poll. The API could be protected by an API key if sensitive.

## Database considerations
Each server could log their data to either a local (internet-connected) or global database server. Each server should have write access to a limited area. The central server can then query the (all of the) database(s) for the data it needs.

license: Unlicense

repository: kimsappi/website-status

repo_name: kimsappi/website-status


text:
Bootstrap 4 Timeline
======
**Bootstrap 4 Timeline** is an HTML template that uses Bootstrap version 4 to display a timeline. The main example is using the timeline to render a [changelog](http://keepachangelog.com/en/1.0.0/).

Makes primary use of the [Bootstrap 4 card component](https://getbootstrap.com/docs/4.1/components/card/).

**Fork** or **download** `timeline.htm` to get started.

## Example
[HeroMuster.com Changelog](https://heromuster.com/changelog)

## Uses
* [Bootstrap 4.1.0](https://getbootstrap.com/docs/4.1/getting-started/introduction/) (CDN links included in example)
* SVGs provided by the [OpenIconic](https://github.com/iconic/open-iconic) project.

## Version
* Version 1.1

## License
[MIT License](https://opensource.org/licenses/MIT)

## Contact
#### Developer
* Homepage: https://mariolurig.com/
* Email<EMAIL_ADDRESS>* Twitter: [@ucffool](https://twitter.com/ucffool "ucffool on twitter")

## Say Thank You

- Donate via BTC `18qUgh8KRo7Mwb22v3KfyaYQJiHvMmLkQH`
- Donate via BCH `18kKzENxZh3JAspYeAd5vRWm1mS4v6tfXV`
- Donate via ETH `0x972f495750Ac02557154a00bbBbF18f23FA12515`
- Donate via [Paypal](https://www.paypal.me/MarioLurig)


text:
# uniname

[![GitHub release](http://img.shields.io/github/release/jakewarren/uniname.svg?style=flat-square)](https://github.com/jakewarren/uniname/releases])
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/jakewarren/uniname/blob/master/LICENSE)
[![Go Report Card](https://goreportcard.com/badge/github.com/jakewarren/uniname)](https://goreportcard.com/report/github.com/jakewarren/uniname)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=shields)](http://makeapullrequest.com)

> displays the hexadecimal UTF-32 character and text description for a unicode glyph

## Install
### Option 1: Binary

Download the latest release from [https://github.com/jakewarren/uniname/releases/latest](https://github.com/jakewarren/uniname/releases/latest)

### Option 2: From source

```
go get github.com/jakewarren/uniname
```

## Usage

```
❯ uniname 😺
  UTF-32   GLYPH                NAME
+---------+-------+----------------------------------+
  U+1F63A   😺    SMILING CAT FACE WITH OPEN MOUTH
```

# Changes

All notable changes to this project will be documented in the [changelog].

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## License

MIT © 2018 Jake Warren

repository: jakewarren/uniname

repo_name: jakewarren/uniname


text:
# commitguard

**commitguard** is a [Rust](https://rust-lang.org) library that makes it very easy to create
shell scripts that can be used as **git pre-commit** hooks.

The primary use case is generating pre-commit hooks for Rust projects automatically in a
**build.rs** build script,
but it may be useful for other projects too.

## Why

## Info

## License

This project is under the MIT license.
See the LICENSE file for more details.

## Versioning

This project follows semantic versioning.

## README

The README.md file is auto-generated from src/lib.rs in the build.rs script.

All changes should be done there.

repository: theduke/commitguard

repo_name: theduke/commitguard


text:
HTTPoison and Poison will be removed in V3.x

V 3.0.0
[BREAKING] - HTTPoison has been removed and so passing `%PINXS.Config{}` will no longer work.  Use `PINXS.Client` to configure each request.

repository: htdc/pinxs

gha_language: Elixir

repo_name: htdc/pinxs


text:
Today in [Borderlands 3](https://borderlands.com/en-US/shop/borderlands-3-ultimate-edition), we’re setting off the **Supercharged
Crystals** mini-event and making some adjustments to gear! These changes will
be live on all platforms by 12:00 PM PT. To apply hotfixes, wait at the main
menu until you see a sign that reads, “Hotfixes Applied!” If you are
experiencing any issues or want to provide feedback, please submit a ticket to
[support.2k.com](https://support.2k.com/).

During the **Supercharged Crystals** mini-event, players will find that moving
off the platform will not reduce the charge of the crystals in the [Takedown
at the Guardian Breach](https://borderlands.com/en-US/news/2020-06-11-takedown-at-the-guardian-breach/). As crystals do not lose
charge, players cannot wipe during these crystal charge-up sequences. This
event will end on January 21 at 9:00 AM PT / 12:00 PM ET.

  * Activates the **Supercharged Crystals** Mini-Event until January 21 at 9:00 AM PT.

# Gear Adjustments

 **Techspert Operative Class Mod**

  * Increased the chance on kill to recharge SNTNL Cooldown and Duration from 15% to 35%

 **D.N.A.**

  * Increased Weapon Damage, Magazine Size, Fire Rate, and Projectile Speed
  * Decreased Reload Time

 **Ripper**

  * Increased weapon damage

 **SF Force**

  * Increased weapon damage

 **Malak’s Bane**

  * Increased weapon damage


text:
# esphapcontroller

This is work-in-progress!
This project aims to integrate  https://github.com/Yurik72/ESPHomeController  into native AppleHome Kit support.
Without any additional bridges like (mqtt, raspberry,...)

As well second target is to make friendship between [esp-idf](https://github.com/espressif/esp-idf) and arduino to use favorites libraries developed for arduino.

Many thanks to [maximkulkin](https://github.com/maximkulkin) for providing fine libraries for native integration,
this project used them.

## Usage

This is a application to be used with `Espressif IoT Development Framework (ESP-IDF)` and `arduino-esp32`.

Please check ESP-IDF docs for getting started instructions and install instructions.

[Espressif IoT Development Framework](https://github.com/espressif/esp-idf)

Once the ESP-IDF is installed:
please check suggestion to use  `esp`  directory as root
1. Run mingw32
2.
```c
$ cd esp
$ git clone https://github.com/Yurik72/esphapcontroller
$ cd esphapcontroller
$ make -C production/esp32/hapcontroller all
```
! Project already contains arduino-esp libraries for esp-idf and sdk configured.

Hovewer you can
```c
$  make -C production/esp32/hapcontroller menuconfig
```
to reconfigure SDK

and finally you can flash your esp
```c
$ make -C production/esp32/hapcontroller flash
```

## For Arduino IDE and your own development

please have a look [ESPHap](https://github.com/Yurik72/ESPHap) this is library to use native Apple integration allows to use Arduino IDE


text:
# Docker Style Guide
This document will provide a guide for writing Dockerfiles for the pipelines.
The guide will provide a list of best practices for writing Dockerfiles, and will also
provide a list of common mistakes to avoid. The guide is for those wanting to contribute
Dockerfiles to the pipelines repository.

## Dockerfiles Organization
All docker related resources should be placed in the `docker` directory of the repository. The `docker` directory
contains a subdirectory for each Dockerfile and its related resources. The subdirectory name should
start with an abbreviation of data type the docker tool will process followed by the name of the tool.
For example, the docker image for the `bwa` aligner that will process long reads would be placed in the `docker/lr-bwa` directory.

## Docker Subdirectory Folder
Each Docker subdirectory should contain the following files and folders:

- `Dockerfile`: The Dockerfile for the Docker image.
- `Makefile`: A Makefile for building the Docker image.

Optionaly the subdirectory may contain the following files and folders:

- `README.md`: A README file for the Docker image.
- `enironment.yml`: A conda environment file for installing dependencies.
- Any resource files (e.g. python script) needed to build the Docker image.

Example Directory Tree:

```Text
docker
|__lr-bwa
|  |__Dockerfile
|  |__Makefile
|  |__README.md
|__lr-pb
|__lr-ont
```

## Dockerfile Guidelines
This section outlines the guidelines for creating Dockerfiles, including the format, structure, and best practices for creating efficient and maintainable Docker images.
Docker Docs provides a valuable resource for learning about Dockerfiles. The following
links provide a good starting point for creating Dockerfiles using general best practices: [Docker Best Practices](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/)
In addition to the Docker best practices, use the following guidelines when creating Dockerfiles for the pipelines repository.

- When appropriate be sure to add a comment proceeding Docker instructions to explain its purpose.
```Dockerfile
# copy other resources
COPY ./environment.yml /

# install conda packages
RUN conda env create -f /environment.yml && conda clean -a
ENV PATH=/opt/conda/envs/lr-pb/bin/:/root/google-cloud-sdk/bin/:${PATH}

# install gsutil
RUN apt install -y curl git-lfs time datamash
RUN curl https://sdk.cloud.google.com | bash
```

- Specify a `MAINTAINER` for the Docker image.
```Dockerfile
FROM continuumio/miniconda3

MAINTAINER Barbra Mills
```

- Specify version numbers for all packages installed in the Docker image.
```Dockerfile
RUN conda install python=3.6.9
RUN conda create -n venv python=3.6.9
```

## Image Naming and Tagging Guidelines
This section outlines the guidelines for naming and tagging Docker images, including the format, structure, and best practices for creating consistent and descriptive image names and tags.

* Use descriptive names: Choose a name that clearly identifies the image and its purpose. Avoid using generic names like "docker-image" or "latest".
* Name should match directory name: When possible the name of the Docker image should match the name of the docker subdirectory it is located in.
* Use lowercase letters: Docker image names should be in lowercase letters.
* Use semantic versioning: Follow the semantic versioning pattern (major.minor.patch) to ensure consistency and compatibility between different versions of the image.
* Avoid special characters: Avoid using special characters in the image name or tag, as it may cause issues with some systems or platforms.

## Testing and CI/CD Guidelines
_This section should provide guidelines for testing Docker images and containers, including best practices for creating automated tests and integrating with CI/CD pipelines to ensure consistent builds and deployments.
TBD: This section is still under development._

repository: broadinstitute/long-read-pipelines

repo_name: broadinstitute/long-read-pipelines


text:
## Python Tooling

## Contets

- [Python Scripts](#python-scripts)
- [Working with Python](#working-with-python)
- [Working with pyenv](#working-with-pyenv)
- [Working with pip](#working-with-pip)
- [Useful Links](#useful-links)
- [TODOs](#todos)

## Python Scripts

To convert a directory of **.blend** files to **.obj** file using the script provided within this directory

```shell
for i in *.blend;
  /Applications/Blender.app/Contents/MacOS/Blender $i --background \
  --python convert_blend_to_obj.py -- $i.obj
end
```

## Working with Python [🔝](#contents)

To syntax check a python script / file

```python
python -m py_compile [mr_fancy_python_script]
```

## Working with virtual envs

❗ If the root / parent directory for virtualenv directories is renamed then more than likely all virtualenvs will be broken due to hardcoded paths in the **activate** python scripts, see [this](https://aarongorka.com/blog/portable-virtualenv/) for a possible solution.

## Working with `pyenv` [🔝](#contents)

To update the **pyenv** python version manager to the latest git master

```shell
cd $PYENV_ROOT; git pull upstream; git push origin master;
```

> The above commands are useful for updating the list of installable pythons

To list installable Python versions

```shell
pyenv install -l
```

To download and keep the source for a particular python version and print build output to `$STDOUT`

```shell
pyenv install -kv [MARJOR.MINOR.PATCH]
```

> The source for a particular Python is downloaded in `$PYENV_ROOT/sources/[MAJOR.MINOR.PATCH]/Python-[MAJOR.MINOR.PATCH]

- ❗ **UPDATE** August 29, 2019

    When building Python on macOS that has multiple versions of Xcode installed ie. 10.1 10.2 and 10.3 complications can arise where certain command line tools are used or may not be installed for whatever reason. Try using the below command to build  a version of Python **2.7.x** or **3.7.x** using the tooling provided by Xcode

    ```shell
    env \
    SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk \
    MACOSX_DEPLOYMENT_TARGET=10.14 \
    pyenv install [MAJOR.MINOR.PATCH]
    ```

**protip** when installing a version of python on macOS `/usr/local/{sbin/bin}` should be in the `$PATH` or pyenv will fail to build python due to SSL errors.  However the opposite is true for Debian with linuxbrew installed and setup.

To install Python 2.7.15 on Debian Stretch 9.4 using **pyenv** make certain that linuxbrew pythons **ARE NOT** in the users `$PATH` when using pyenv to install a particular version of python.

To list local python versions available to pyenv

```shell
pyenv versions
```

To delete an old virtualenv setup with pyenv

```shell
pyenv uninstall neovim3
```

To set multiple python interpreters for a system / shell, edit **$HOME/.python-version** and add the versions of python you would to be accessible from a shell.

Example

```conf
2.7.15
3.7.2
```

### Working with pyenv virtualenvs

There is a plugin for **pyenv** that can be used to setup **virtualenvs** for python.

To setup a **virtualenv** of the name _py3my-virtualenv_

```shell
pyenv virtualenv 3.7.3 py3my-virtualenv
echo "to activate the virtualenv"
pyenv activate py3my-virtualenv
echo "to deactivate the virtualenv
pyenv deactivate
```

To list all available local virtualenvs on a box

```shell
pyenv versions
```

To install a Python package inside a virtualenv

```shell
pip install neovim3
echo "to upgrade the neovim3 package"
pip install --upgrade neovim
```

### Working with pip

To list all top level packages that have been installed with **pip**

```shell
pip list
```

To list outdated packages that have been install via pip

```shell
pip list --outdated
```

To upgrade a package that has been installed with **pip**

```shell
pip install --upgrade [NAME_OF_PACKAGE]
pip install -U [NAME_OF_PACKAGE]
```

To list all versions of a package that can be installed via pip

```shell
pip install --no-deps [NAME_OF_PACKAGE]==x.x.x
echo "below is an example"
pip install --no-deps numpy==x.x.x
```

To install a locally downloaded copy of a package and use local paths, [learn more](https://stackoverflow.com/a/10429168/708807)

```shell
pip install -r requirements.txt --no-index --find-links file:///tmp/packages
```

To upgrade **all** outdated pip packages _copy pasta_

```shell
pip list --format freeze --outdated | sed 's/=.*//g' | xargs -n1 pip install -U
```

## Useful Links

- [**debugging python scripts/files using vscode][lnk1]
- https://pythondev.readthedocs.io/debug_tools.html (a good resource for debugging / tshooting c c++ projects that interopt with python)
- https://www.pythonguis.com/tutorials/pyside-creating-your-first-window/ (dencent tutorials for working with pyside)

[lnk1]: <https://code.visualstudio.com/docs/python/debugging>

## TODOs [🔝](#contents)

repository: ipatch/dotfiles

gha_language: Vim script

repo_name: ipatch/dotfiles


text:
# R.Franco Techonologies Helm Charts

This repository contains Helm charts created by R.Franco Technologies.

## How to Package and Index the Included Helm Charts

```
cd docs
helm package ../helm-chart-sources/*
helm repo index --url https://rfrancotechnologies.github.io/helm-charts/ .
```

## Strapi

In order to install the Strapi Helm chart from R.Franco Technologies first you have to add the chart repository to your helm installation:

```bash
$ helm repo add rfrancotechnologies https://rfrancotechnologies.github.io/helm-charts
$ helm repo update
```

Then, to install the chart with the release name `my-release`:

```bash
$ helm install my-release rfrancotechnologies/strapi
```

Have a look at the [Strapi README.md](https://github.com/rfrancotechnologies/helm-charts/blob/master/helm-chart-sources/strapi/README.md) for valid values for the chart.

repository: rfrancotechnologies/helm-charts

repo_name: rfrancotechnologies/helm-charts


text:
# Segwit transaction
How segwit transactions are serelized. The flowchart follows the relation between the different components in the code.

![Flowchart](./doc/flowchart.svg)
## Double sha256:
Normally, I avoid defining any functions in my tutorials. However, in this case I'll make an exception and define a simple `dSHA256(raw)` function that takes a binary array and returns its result hashed twice (`sha256(sha256(raw))`).
This double sha process repeats itself quite extensevillasy in bitcoin's transactions and pre-defining this function will make it much more easy to follow the flowchart.

```python
import hashlib

def dSHA256(raw):
  hash_1 = hashlib.sha256(raw).digest()
  hash_2 = hashlib.sha256(hash_1).digest()
  return hash_2
```
## Keys:
For more information on Private key --> Public key --> PubKeyHash see the previous tutorial on addresses.
This code will provide us with three items that we'll later use:
1. Signing key
2. Public key
3. Hashed public key (a.k.a keyhash)

The string that we use to create the private key should be the one that controls the bitcoins we want to send.
```python
import ecdsa

private_key = bytes.fromhex("BF9795D3FCB4E2181B7B536C22470123456789EA0001397C99BA94D4D4DD62801BB151B091")
signing_key = ecdsa.SigningKey.from_string(private_key, curve=ecdsa.SECP256k1) # Don't forget to specify the curve

verifying_key = signing_key.get_verifying_key()

# Use this code block if the address you gave corresponds to the compressed public key
x_cor = bytes.fromhex(verifying_key.to_string().hex())[:32] # The first 32 bytes are the x coordinate
y_cor = bytes.fromhex(verifying_key.to_string().hex())[32:] # The last 32 bytes are the y coordinate
if int.from_bytes(y_cor, byteorder="big", signed=True) % 2 == 0: # We need to turn the y_cor into a number.
  public_key = bytes.fromhex("02" + x_cor.hex())
else:
  public_key = bytes.fromhex("03" + x_cor.hex())

sha256_1 = hashlib.sha256(public_key)

ripemd160 = hashlib.new("ripemd160")
ripemd160.update(sha256_1.digest())

keyhash = ripemd160.digest()
```
# Bip 143
Double SHA256 of the serialization of:
  1. nVersion of the transaction (4-byte little endian)
  2. hashPrevouts (32-byte hash)
  3. hashSequence (32-byte hash)
  4. outpoint (32-byte hash + 4-byte little endian)
  5. scriptCode of the input (serialized as scripts inside CTxOuts)
  6. value of the output spent by this input (8-byte little endian)
  7. nSequence of the input (4-byte little endian)
  8. hashOutputs (32-byte hash)
  9. nLocktime of the transaction (4-byte little endian)
  10. sighash type of the signature (4-byte little endian)

## nVersion:
According to [bitcoin's developer reference](https://bitcoin.org/en/developer-reference#raw-transaction-format) - this field should be uint32 little endian. The current version number is `1`.
```python
version = (1).to_bytes(4, byteorder="little", signed=False)
```

## Flag:
This field is mentioned in [segwit's wallet developers reference](https://bitcoincore.org/en/segwit_wallet_dev/) - it should be equal `0x01`.
```python
flag = bytes.fromhex('01')
```

## Marker:
This field is mentioned in [segwit's wallet developers reference](https://bitcoincore.org/en/segwit_wallet_dev/) - it should be equal `0x00`.
```python
marker = bytes.fromhex('00')
```

## Prevouts -> hashPrevouts:
In this section we'll create two items:
1. Prevouts (also known as outpoint)
2. hashPrevouts

The Prevouts is a combination of the hash of the previous transaction and the index number of the output we want to spend - It basically points back to the origins of the coins that we're about to spend. This information should be available on the blockchain and you can find it using any [good blockchain explorer](https://blockstream.info/tx/73c9fec091af7d5fa74650e758b40b4f9895404d1cb95193b6ec059a541dd44f).
![TxHash](./doc/txhash.png)

This information should be parsed in to ways.
1. As a simple outpoint, as defined in the [bitcoin's developer reference](https://bitcoin.org/en/developer-reference#raw-transaction-format).
2. The `Prevouts` we've just created should be double hashed using our predefined `dSHA256(Prevouts)` to get the `hashPrevouts` that is required in the BIP - 143 list.
```python
hash = (bytes.fromhex('73c9fec091af7d5fa74650e758b40b4f9895404d1cb95193b6ec059a541dd44f'))[::-1] # Don't forget to reverse the byte order - as described in the bitcoin's developers reference.
index = (1).to_bytes(4, byteorder="little", signed=False) # 32uint little endian - as described in the bitcoin's developers reference.
Prevouts = hash + index # Also known as outpoint.
hashPrevouts = dSHA256(Prevouts)
```

## Amount:
This field is mentioned in the BIP-143 list. It's the amount of money that we've recievd as part of the prevouts (outpoint).
This information should be available on the blockchain and you can find it using any [good blockchain explorer](https://blockstream.info/tx/73c9fec091af7d5fa74650e758b40b4f9895404d1cb95193b6ec059a541dd44f).
![Amount](./doc/amount.png)
According to
```python
amount = (int(0.00135501 * 100000000).to_bytes(8, byteorder="little", signed=True))
```

## Sequence -> hashSequence:
In this section we'll create two items:
1. sequence
2. hashSequence

The sequence field is defined in the [bitcoin's developer reference](https://bitcoin.org/en/developer-reference#raw-transaction-format). In our case it's safe to assume that it will always be equal to `0xffffffff`.
Once we got our sequence, we should also double hash it using our predefined `dSHA256(sequence)` function to get the hashSequence - as required in the BIP - 143 list.
```python
sequence = bytes.fromhex('ffffffff')
hashSequence = dSHA256(sequence)
```
## outpoint:
See prevouts.
```python
outpoint = prevouts
```

## ScriptCode:
Following the instructions on the [BIP-143 documentation](https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki) (item #5) we can see that our scriptCode should resemble a simple P2PKH scriptPubKey.
```python
scriptCode = bytes.fromhex(f'76a914{keyhash.hex()}88ac') # This is the classic P2PKH scriptPubKey
```

## nSequence:
See Sequence -> hashSequence.
```python
sequence = sequence
```

## Outputs -> hashOutputs:
Out of all the fields we need to create, this one is the less defined. This is basically the output of the transaction that you, the sender, wishes to create. It will changes according to the following data:
1. Who do you wish to send the coins to (who's the receiver)?
2. How much to you wish to send to the receiver?
3. How much fees do you wish to leave to the miners?

The `pk_script` field specify the output script. This is the script that the receiver will need to solve in order to prove that he's indeed the rightful owner of this coins.
The `pk_script_bytes` field is the size of the `pk_script`.
The `value` is the amount of coins we wish to send. Any difference between the amount of coins in the input to the coins in the output will go to the miner as a miner's fee.
These field are defined in the [bitcoin's developer reference](https://bitcoin.org/en/developer-reference#raw-transaction-format). In this case, the `pk_script` contains a script that returns the `value` to the sender. The value is 0.0013 BTC; Because the input value (`amount`) is equal to 0.00135501 BTC the reminder will go to the miner as a miner's fee (0.00135501 - 0.0013 = 0.00005501).
Finally, we need to add the size of our script and serialize the Outputs.

We'll also create the hashOutputs by double hash the `outputs` using our predefined `dSHA256(outputs)` function to get the hashOutputs - as required in the BIP - 143 list.

```python
pk_script        = bytes.fromhex('a91487b16bf5c5e43bf1dbd69440556f4f5a1430b5fd87')
pk_script_bytes  = (len(pk_script_one)).to_bytes(1, byteorder="little", signed=False)
value            = int(0.0013 * 100000000).to_bytes(8, byteorder="little", signed=True)

outputs =(
  value
  + pk_script_bytes
  + pk_script
)

hashOutputs  = dSHA256(Outputs)
```

## nLockTime:
This field is defined in the [bitcoin's developer reference](https://bitcoin.org/en/developer-reference#raw-transaction-format). In almost all cases  we'll store the number zero as an uint32 in little endians.
```python
nLockTime = (0).to_bytes(4, byteorder="little", signed=False)
```

## SigHash (also sigops):
This field changes according to the information that we're signing on.  [BIP-143 documentation](https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki) tells us to choose the SIGHASH_ALL	which corresponds to `0x01000000`
```python
sigHash = bytes.fromhex('01000000')
```

# Witnesses:
Now we'll take all of the items in the BIP-143 list to create our `pre_hash`. We'll than double hash it using our predefined `dSHA256(pre_hash)` function to get the `sig_hash`.
```python
hash_pre = (
  version
  + hashPrevouts
  + hashSequence
  + previous_output
  + (len(scriptcode).to_bytes(1, byteorder="little", signed=False))
  + scriptcode
  + amount
  + sequence
  + hashOutputs
  + nLockTime
  + hash_type
)

sig_hash = dSHA256(hash_pre)
```
The `sig_hash` variable is the one that we'll finally sign using our private key and the ecdsa library. The `sigencode = ecdsa.util.sigencode_der_canonize` parameter will provide us with a serialized result that can be used in bitcoin's transactions.

```python
signature = signing_key.sign_digest(sig_hash, sigencode = ecdsa.util.sigencode_der_canonize) # The signature is already specified in DER format!
```
Now it's time to properly serialize our `witness` variable. The first byte is the number of unique items in the witness stack. In this case we have two items:
1. The signature
2. The public key (that matches the signature).
* Each item should be have its size as a prefix.
Between the two we'll add a separator that is defined as `0x01`.
```python
witness = (
  (2).to_bytes(1, byteorder="little", signed=False) # Number of items
  + (len(signature) + 1).to_bytes(1, byteorder="little", signed=False) # Size of signature
  + signature # Signature
  + bytes.fromhex("01") # Separator
  + (len(public_key)).to_bytes(1, byteorder="little", signed=False) # Size of public key
  + public_key  # Public key
)
```
![Witness](./doc/segwit.png)

## Tx_in_count:
According to [bitcoin's glossary](https://bitcoin.org/en/glossary/compactsize) - this field should be a unique type of integer known as `varint` or `CompactSize`. In our case, because there's only one input that in the transaction that we're constructing, we'll use uint4 little endian.
```python
tx_in_count = (1).to_bytes(1, byteorder="little", signed=False)
```

## RedeemScript:
The redeem script as defined in the previous tutorial on keys and addresses. (In this case, we'll construct it using our own keyhash)
```python
redeemScript = bytes.fromhex(f'0014{keyhash}')
```

## Tx_Out_count:
According to [bitcoin's glossary](https://bitcoin.org/en/glossary/compactsize) - this field should be a unique type of integer known as `varint` or `CompactSize`. In our case, because there's only one output that in the transaction that we're constructing, we'll use uint4 little endian.
```python
tx_out_count = (1).to_bytes(1, byteorder="little", signed=False)
```

## FinalTx:
Just add all the variables in the right order and Voila!
![final](./doc/final.png)
```python
final_tx = (
  version
  + marker
  + flag
  + tx_in_count
  + previous_output
  + (len(redeemScript)+1).to_bytes(1, byteorder="little", signed=False)
  + (len(redeemScript)).to_bytes(1, byteorder="little", signed=False)
  + redeemScript
  + sequence
  + tx_out_count
  + tx_out
  + witness
  + nLockTime
)
```
You can now compare your segwit transaction to the following serialization.
![final](./doc/final.png)

gha_language: Python


text:
# hub

> A wrapper for git that adds commands for working with github-based projects.
> The commands can also be used using "git" instead of "hub".

- Clone a repository you own, using just the repository name rather than the full URL:

`hub clone {{repo_name}}`

- Clone another user's repository, using their github username and the repository name:

`hub clone {{username}}/{{repo_name}}`

- Create a fork of the current repository (cloned from another user) under your github profile:

`hub fork`

- Create a PR of the current branch in the original repository (after pushing the branch to github):

`hub pull-request`

- Upload the current (local-only) repository to your github account:

`hub create`

repository: LTHODAVDOPL/tldr

repo_name: LTHODAVDOPL/tldr


text:
# YouTube Live Chat Flow
[![Build Status](https://travis-ci.com/fiahfy/youtube-live-chat-flow.svg?branch=master)](https://travis-ci.com/fiahfy/youtube-live-chat-flow)

> Chrome Extension for Messages Flow on YouTube Live Chat.

## Features
* Messages flow over a video.
* Change message color, size and speed.
* Show avatar on messages.
* Move chat form to bottom controls on video.

## Screenshots
![screenshot](./build/screenshots/screenshot1.png?raw=true)
![screenshot](./build/screenshots/screenshot2.png?raw=true)

## Installation
1. Download `archive.zip` file from [releases page](https://github.com/fiahfy/youtube-live-chat-flow/releases).
2. Unzip this file.
3. Open URL `chrome://extensions/` by Google Chrome.
4. Enable developer mode.
5. Drag and drop `app` directory.

## Development
``` bash
# install dependencies
yarn

# watch files changed and reload extension
yarn dev
```

repository: ShirasuSalaD/youtube-live-chat-flow

repo_name: ShirasuSalaD/youtube-live-chat-flow


text:
# three-post-processing
multi pass post processing on [three.js](https://github.com/mrdoob/three.js).

## Usage
### Get Library
#### link script
Download the [library](https://raw.githubusercontent.com/ukonpower/three-post-processing/master/build/three-post-processing.js) and include in your HTML.

```html
<script src="three-post-processing.js"></script>
```

#### npm
or you can get from [npm](https://www.npmjs.com/package/three-post-processing).

```bash
$ npm i three-post-processing
```

##### Import

```javascript
import TPP from 'three-post-processing';
```

#### Create Post Processing
```javascript
this.uniforms = {
  time:{
    value: 0
  }
}

let pp1 = {
  fragmentShader: require('./post-processing1.glsl'),
  uniforms:this.uniforms
};

let pp2 = {
  fragmentShader: require('./post-processing2.glsl'),
  uniforms:this.uniforms,
}

this.pp_params = [pp1,pp2];

this.tpp = new TPP(this.renderer,this.pp_params);
```

#### Render Post Processing
```javascript
//update post-processing uniforms
this.uniforms.time.value += 0.01;

//render scene with post-processing
this.tpp.render(this.scene,this.camera);
```

repository: ukonpower/three-post-processing

repo_name: ukonpower/three-post-processing


text:
# CashStar Open Source

## Overview
Cashstar runs on a largely open source stack.  As a result we contribute back to
the community both by open sourcing our own solutions and by contributing to our
favorite projects.

## CashStar Projects
* [Reify: Boilerplate for React Apps](https://github.com/CashStar/reify)
* [Rebar: Rackspace Automation](https://github.com/CashStar/rebar)
* [Puppet-Jenkins:  Jenkins Puppet Integration](https://github.com/CashStar/puppet-jenkins)
* [Employment: Jenkins Kiln Integration](https://github.com/CashStar/employment)
* [Django-Threatmetrix](https://github.com/CashStar/django-threatmetrix)

## Projects we Support

repository: CashStar/open-source

repo_name: CashStar/open-source


text:
# n-sql

[![Build Status](https://travis-ci.org/mokeyish/n-sql.svg?branch=master)](https://travis-ci.org/mokeyish/n-sql)
[![Build status](https://ci.appveyor.com/api/projects/status/ky63jhxhsq8rb2vy/branch/master?svg=true)](https://ci.appveyor.com/project/mokeyish/n-sql/branch/master)

[README](README.md) | [中文文档](README_zh_CN.md)

---

> **N-SQL is a SQL statement parser, optimizer, generator and Queryer.**

- [n-sql](#n-sql)
  - [What](#what)
  - [Goals](#goals)
  - [Modules](#modules)
  - [Status](#status)
  - [Example](#example)
  - [Get Involved！](#get-involved)

## What

N-SQL is a SQL language that provides a simplified and unified SQL language that translates SQL into languages supported by databases such as Oracle, MySQL, PostgreSQL, Sql Server, and SQLite. For example, pagination, date functions, etc.

## Goals

- The unified SQL query syntax can be equivalently translated into SQL supported by the target database.
- Query Json, Excel, Csv and other data files with n-sql.
- Optimize SQL
- Cross-data source query

## Modules

This is the graph of functional module.
![modules](./docs/assets/misc/nsql_modules.png)

## Status

N-SQL currently is still under development. It is not yet stable.

N-SQL currently requires Rust 1.33 stable or later

## Example

- You could check out the [unit tests](./tests) or play **[online](https://n-sql.yish.org/playground/)**.

## Get Involved！

Want to help us build `n-sql`? Check out [`CONTRIBUTING.md`](./CONTRIBUTING.md)!

repository: littlesmilelove/n-sql

repo_name: littlesmilelove/n-sql


text:
---
id: 1357
title: Snap!
date: 2016-03-30T09:08:32+00:00
author: Miles Berry
layout: post
comments: true
guid: http://milesberry.net/?p=1357
permalink: /2016/03/snap/
categories:
  - Uncategorized
image:
    # local image
      feature<EMAIL_ADDRESS>---

  Our latest CAS TV programme features John Stout, discussing programming in Snap! (a close relation to Scratch), including some ways of using it to introduce pupils to functional programming.

  I wonder who’s using Snap! in their schools? Does it make sense to use this as a block-based language in KS3 to provide a little higher ceilings that Scratch offers, especially as many will have ‘done’ Scratch whilst at primary? What sort of thing have you done with Snap! if so?

  Scratch clearly has a more vibrant online community, and much more extensive resources: how important are these factors when choosing a language?

  Personally, I’m a great fan. Some of my projects:

    Rational arithmetic

    Morse code – code and walkthrough video.

    Substitution cipher

    Quicksort


text:
# Zhihu Daily
Zhihu Daily Android app, a practice project to use MVP, RxJava, DBFlow, etc.

## Libraries
- [ButterKnife](https://github.com/JakeWharton/butterknife)
- [Dagger 2](https://github.com/google/dagger)
- [Retrofit](https://github.com/square/retrofit)
- [RxJava](https://github.com/ReactiveX/RxJava)
- [retrofit2-rxjava2-adapter](https://github.com/JakeWharton/retrofit2-rxjava2-adapter)
- [Glide](https://github.com/bumptech/glide)
- [PageIndicatorView](https://github.com/romandanylyk/PageIndicatorView)
- [DBFLow](https://github.com/Raizlabs/DBFlow)
- [Stetho](http://facebook.github.io/stetho/)
- [Joda-Time](https://github.com/JodaOrg/joda-time)

## API
[ZhihuDailyPurify 知乎日报 API 分析](https://github.com/izzyleung/ZhihuDailyPurify/wiki/%E7%9F%A5%E4%B9%8E%E6%97%A5%E6%8A%A5-API-%E5%88%86%E6%9E%90)

repository: mengdd/ZhihuDaily

repo_name: mengdd/ZhihuDaily


text:
Modifying the Code for Bank
===========================

This document discusses some possible optimizations that can be made to bank, in the event that some form of
speed increase may be needed. In addition, reasons for variable names, as well as reasoning for certain idioms
or a lack thereof are discussed as well. The document also discusses how the actual allocation and collection
cycle works.

The Allocator and Collector
---------------------------

Bank consists of two primary internal components. The pool, and the collector. The pool is what keeps track
of each allocation, and ensures that the memory is easily collected by the collector. When the pool is created
it calculates the maximum amount of memorythat the system has (not what it can allocate). It then divides this
amount into a set of 64KB chunks, which is then allocated into the underlying `array`, which contains the
`chunk` type that tracks the usage of these blocks of memory. By default, the pool starts with 256 chunks
(or 16 MB of memory). This number is changed by the call to `bank::open`. The pool does not keep track of the
actual allocated address, but instead relies on a given `chunk` to be able to return a requested `size`
(where `size` can be a maximum of `uint32_t::max + 1`, or 4GB). When the given address is deallocated,
the address is pushed onto a queue located in the collector. While the queue is not full, the collector will
constantly yield any or all of its execution time. (Note: On systems that do not have `pthread_yield`,
`pthread_yield_np` is used instead). The queue is of a sufficiently large enough size that it would take
several thread deallocating at once to break it. (NOTE: The queue size can be tweaked for less memory usage).

The collector then talks to the pool's array, and requests the chunks that contain the address to decrement
their count. This act is not threadsafe, but can be "saved" by changing the counter to an atomic type
(see Atomic Operations below).

This deferrment of deallocating resolves the possible (and well known) "Stop the World" scenario for most
garbage collectors, while still allowing the primary thread to allocate during deallocation.

Memory
------

Internally, bank uses `std::calloc` for all of its allocations. Most platforms that Bank has been tested on
showed a very slight increase in performance. However, since this increase is not guaranteed, it may be
necessary to replace each `std::calloc` call with `std::malloc`.

Bank also allocates almost all memory in 64KB chunks, or multiples thereof. The only exception to this is
the overloading of `bank::detail::pool::operator new` and `bank::detail::collector::operator new`. These are
both overloaded due to the possible ignorance of the warning outlined in the primary documentation file.

Atomic Operations
-----------------

One of the primary goals of bank was to write as little platform specific code as possible. Obviously, not
all of this is 100% guaranteed, but one of the sacrifices made was the use of atomic types for two basic
operations. It is recommended that if you would like guaranteed stability in your application on a weak
ordered CPU (such as PowerPC), that a memory barrier, or atomic integral type is used for all types who have
the variable modifier `volatile` within the source code. Specifically, these are located in the `bank::queue`
and consist of a `size_t*` (that is, the pointer is volatile, not what it points to).

Checking for Null
-----------------

Throughout Bank, there are checks to see if a `void*` is `NULL` or not. This was done to show intent, and to
allow newbies to better understand what is happening where (Think explicit over implicit). It is safe to
change these if you so wish.


text:
# Alphabet Arithmetic

[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3935999.svg)](https://doi.org/10.5281/zenodo.3935999)

Please cite as:

Morey, R. D., Lu, J., and Rouder, J. N. (2020). Alphabet Arithmetic [dataset].
Retrieved from https://github.com/richarddmorey/alphabetArithmetic. DOI: 10.5281/zenodo.3935999

This repository contains data from a cognitive experiment performed in the mid-2000s.

For experimental details, an interactive example of the task, and data column descriptions see https://richarddmorey.github.io/alphabetArithmetic/.

## *Super* quick start

1. Go to https://richarddmorey.github.io/alphabetArithmetic/.

2. At the bottom of the page, click the orange "Download tidied data" button.

3. Open the `.csv` file in your analysis program of choice.

## Quick start for R users

1. Download the repository using the green button to the top right. Choose "Download ZIP".

![Choose "Download ZIP"](https://raw.githubusercontent.com/richarddmorey/alphabetArithmetic/master/explainer/include/img/download_code.png)

2. Unzip the repository and open up the RStudio project `alphabetArithmetic.Rproj`.

3. Install the necessary packages:

```
install.packages(c("here", "dplyr", "readr", "purrr", "glue"))
```

4. Run the code in `load_data.R`. The data will be in a tibble called `aa`, ready for analysis.

## Contents:

| Item         | Description                             |
|:-------------|:----------------------------------------|
| `load_data.R`| R code to load the data
| `data`       | Contains all the data                   |
| `explainer`  | Contains the Rmarkdown code to generate the website describing the data |
| `task_code`  | Contains the original experimental code |
| `docs`       | GitHub pages folder containing compiled explainer document |

repository: richarddmorey/alphabetArithmetic

repo_name: richarddmorey/alphabetArithmetic


text:
# Atlatl

Preliminary work on Rust double-array tries – which is to say, DARTs.

Presently, only a limited-capability Dart representation of minimal finite subsequential transducers.

## References

- Stoyan Mihov, Denis Maurel, *Direct Construction of Minimal Acyclic Subsequential Transducers*
- Jan Daciuk, Bruce W. Watson, Stoyan Mihov, Richard E. Watson, *Incremental Construction of Minimal Acyclic Finite-State Automata*
- Jan Daciuk, *Incremental Construction of Finite-State Automata and Transducers, and their Use in Natural Language Processing*
- Theppitak Karoonboonyanan, [An Implementation of Double-Array Trie](https://linux.thai.net/~thep/datrie/datrie.html#References)
- Andrew Gallant, [`fst`](https://github.com/BurntSushi/fst)
- Susumu Yata, [`Darts-clone`](https://github.com/s-yata/darts-clone)

## License

`atlatl` © 2017 tapeinosyne, dual-licensed under the terms of either:
  - the Apache License, Version 2.0
  - the MIT license

repository: tapeinosyne/atlatl

gha_language: Rust

gha_license_id: NOASSERTION

repo_name: tapeinosyne/atlatl


text:
### [CVE-2023-25759](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-25759)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

OS Command Injection in TripleData Reporting Engine in Tripleplay Platform releases prior to Caveman 3.4.0 allows authenticated users to run unprivileged OS level commands via a crafted request payload.

### POC

#### Reference
No PoCs from references.

#### Github
- https://github.com/sT0wn-nl/CVEs

repository: trickest/cve

repo_name: trickest/cve


text:
# Postfix templates for Python

simply folk from [ipatalas/vscode-postfix-ts](https://github.com/ipatalas/vscode-postfix-ts), and change some code in order to work with Python

## Features

![demo.gif](images/demo.gif)

All available templates (`expr` means the expression on which the template is applied):

| Template          | Outcome |
| -------:          | ------- |
| **.return**       | `return expr` |
| **.len**          | `len(expr)` |
| **.int**          | `int(expr)` |
| **.iter**         | `iter(expr)` |
| **.type**         | `type(expr)` |
| **.print**        | `print(expr)` |
| **.if**           | `if expr:` |
| **.ifn**          | `if expr is None:` |
| **.ifnn**         | `if expr is not None:` |
| **.forloop**      | `for i in range(expr):` |
| **.forin**        | `for item in expr:` |

repository: saarsa/vscode-postfix-python

repo_name: saarsa/vscode-postfix-python


text:
## Project Status
Working In Progress, beta version should be released before Mid-September.

## Introduction

xdebug is a helpful and powerful tool in php development, but setting up xdebug in your server and your IDE/editor is sometimes confusing/frustrating.

[This website](https://xdebug.huzhongyuan.com) tries to make your life easier by offering an intuitive, step-by-step gui that goes through xdebug's Introduction, Configuration ,Trouble Shooting ,Tookits and more.

##  Installation

**Requirements:** [PHP](https://php.net/) >= 7.0  , [Composer](https://getcomposer.org/) ,  [npm](https://nodejs.org/)

#### 1. Grab the code

run `git clone https://github.com/coolseven/xdebug-wizard` or `composer create-project coolseven/xdebug-wizard --prefer-dist`

#### 2. Install PHP Dependency

-   open a command line from the folder

-   run `composer install`
-   run `cp .evn.example .env`
-   run `php artisan key:generate`

#### 3. Install JavaScript Dependency

-   run `npm install`
-   or run `SET SASS_BINARY_SITE=https://npm.taobao.org/mirrors/node-sass&& npm install --verbose --registry=https://registry.npm.taobao.org` when you are behind The Wall.
-   run `npm run prod`
-   try it in your browser.

repository: coolseven/xdebug-wizard

repo_name: coolseven/xdebug-wizard


text:
# [Untrusted Referer header](https://find-sec-bugs.github.io/bugs.htm#SERVLET_HEADER_REFERER)

Behavior:

*   Any value can be assigned to this header if the request is coming from a malicious user.
*   The "Referer" will not be present if the request was initiated from another origin that is secure (HTTPS).

Recommendations:

*   No access control should be based on the value of this header.
*   No CSRF protection should be based only on this value ([because it is optional](https://www.w3.org/Protocols/HTTP/HTRQ_Headers.html#z14)).

**Reference**

[CWE-807: Untrusted Inputs in a Security Decision](https://cwe.mitre.org/data/definitions/807.html)

repository: codacy/codacy-spotbugs

repo_name: codacy/codacy-spotbugs


text:
qrcode2scad
===========

Input a string to get a printable qrcode

Inspiration : http://imgur.com/a/vZEj7 by [aNt-e](http://www.reddit.com/r/3Dprinting/comments/1sys1z/combined_my_two_favorite_things/)

# Requirement

* Ruby
* OpenSCAD
* OpenJScad

# Install

```
cd qrcode2scad
bundle install
```

# Usage

```
cd qrcode2scad
ruby qrcode2scad.rb "Hello World"
```
*qrcode2.scad* and *qrcode.scad* are created, they can be used in OpenSCAD and OpenJScad to create a STL file, then use your favorite STL to gcode tool, and print it.

Process in OpenSCAD can be long, it took 17 minute to compile *qrcode.scad* file on a laptop.