open-index/open-npm huggingface dataset:
npm package: @rgsoft/quadtree
Description: Quadtreae library
Author: Ricardo Miranda
Latest version: 1.0.1

# QuadTree

[Quadtree](https://en.wikipedia.org/wiki/Quadtree) Lib for Typescript/Javascript

## Installation

```bash
npm install @rgsoft/quadtree
```

## Usage

The constructor of the `QuadTree` class expects to parameters:

- `k: number`: The capacity of each layer
- `boundary: Rect`: An instance of the `Rect` class that sets the initial boundary

```js
const { QuadTree, Rect } = require('@rgsoft/quadtree');
const k = 1;

const q = new QuadTree(k, new Rect(0, 0, 160, 160));
```

### Adding Points

The `addPoint` method will insert a point into the structure, subdividing in four
quadrants if necesary.

```js
q.addPoint({ x: 50, y: 50 })
```

It expects any parameter that implements the `Point` interface.

```ts
export interface Point {
    x: number;
    y: number;
}
```

### Querying Points

The `query` method searches for point in a given **area**. This area can be a
`Rect` or a `Circle`.

```js
let area = new Rect(30, 30, 25, 25);
let points = q.query(area);

area = new Circle(30, 30, 20);
points = q.query(area);
```
npm package: @rgsoft/voronoi
Description: Voronoi diagram generating lib
Author: Ricardo Miranda
Latest version: 2.0.2

# Voronoi

Voronoi tessellation lib

## Installation

```sh
npm install @rgsoft/voronoi
```

## Usage

### Triangulation

The `triangulate` function generates a
[Delaunay triangulation](https://en.wikipedia.org/wiki/Delaunay_triangulation),
returning an array of `Triangle` instances.

```js
const { triangulate } = require('@rgsoft/voronoi');

const triangulation = triangulate(points, config);
```

The `points` parameter is an array of `Vector` (`@rgsoft/math` package),
containing the points for the triangles vertex. The `config` may have the
following properties:

- `rectBox` - an array of four `Vector` instances used as initial box for the triangulation
- `excludeRectVertex` - a boolean value that indicates whether the triangles generated with the initial box should be removed from the resulting triangulation (default `false`)

As a full example:

```js
const { triangulate } = require('@rgsoft/voronoi');

const points = [ new Vector(0.5 , 0.5) ];
const config = {
    rectBox: [
        new Vector(0, 1),
        new Vector(1, 1),
        new Vector(1, 0),
        new Vector(0, 0),
    ]
}

const triangulation = triangulate(points, config);
```

The `rectBox` points array is expected to be ordered in this fashion:
1. `TOP-LEFT`
2. `TOP-RIGHT`
3. `BOTTOM-RIGHT`
4. `BOTTOM-LEFT`

If `rectBox` is not provided, the box will be inferred using the `getRectBox`
function.

#### RectBox

The `getRectBox` receives an array of `Vector` instances, and returns another
array with the four points of the rectangular box that contains these points.
For example, if the provided points are `A`, `B`, `C`, and `D` (in any order),
the resulting box array would be `[E, F, G, H]` (in that order).

![RectBox example](./rectbox.png)

## Tessellation

The `tessellate` function generates the Voronoi tessellation, represented by an array of `Polygon` instances.
It expects:
- `sites` - an array of `Vector` instances, each representing a center of the tessellation
- `config` - an object with the same properties used for the Delauney triangulation

```js
const { triangulate } = require('@rgsoft/voronoi');

const sites = [ new Vector(0.5 , 0.5) ];
const config = {
    rectBox: [
        new Vector(0, 1),
        new Vector(1, 1),
        new Vector(1, 0),
        new Vector(0, 0),
    ]
}

const polygons = tessellate(sites, config);
```
npm package: @rguanghui/vue2-waterfall
Description: An AutoHeight Waterfall Component For Vue2
Author: rguanghui
Latest version: 3.0.1

# vue2-waterfall

[![npm](https://img.shields.io/npm/v/@rguanghui/vue2-waterfall.svg)](https://www.npmjs.com/package/@rguanghui/vue2-waterfall)
[![npm](https://img.shields.io/npm/dt/@rguanghui/vue2-waterfall.svg)](https://www.npmjs.com/package/@rguanghui/vue2-waterfall)
[![npm](https://img.shields.io/npm/l/@rguanghui/vue2-waterfall.svg)](https://www.npmjs.com/package/@rguanghui/vue2-waterfall)
[![npm](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://github.com/standard/standard)

## Overview
> An AutoHeight Waterfall Component For Vue2

## Install

```sh
npm install @rguanghui/vue2-waterfall
```

## Usage

```js
import { Waterfall, WaterfallItem } from 'vue2-waterfall'
```

```html
<Waterfall>
  <WaterfallItem>item1</WaterfallItem>
  <WaterfallItem>item2</WaterfallItem>
  <WaterfallItem>item3</WaterfallItem>
  ...
</Waterfall>
```

> See the source code to get the complete example.

## options

### Waterfall Attributes

| Option       | Description  | default     | type
| ------------ | ---------------------------------------------- | ------ | ------- |
| gutterWidth  | the waterfall brick element horizontal gutter  | 10     | Number  |
| gutterHeight | the waterfall brick element vertical gutter    | 10     | Number  |
| resizable    | triggers layout when browser window is resized | true   | Boolean |
| percent      | use Fluid layout. such as [1, 1]               | -      | Array   |

### WaterfallItem Attributes

| Option    | Description  | default     | type
| --------- | ------------ | ----------- | --- |
| emitEvent | emit an event when the component rendered complete by yourself | - | String |

> Note: the effect of the `emitEvent` is to let code know how height is this component.
> in some case(such as async component or has child component to render), we don't know when to get the final height in the browser. so you may need to actively emit an event to help get the correct dom tree.
npm package: @rguleryuz/freelens-debug-pod-extension
Description: FreeLens extension that adds a kubectl debug action for pods
Author: rguleryuz
Latest version: 0.1.4

# FreeLens Pod Debug Extension

A simple FreeLens/Lens extension that adds a **Debug Pod (kubectl)** action for Pod resources.

When you click the action from a Pod menu, it opens a terminal tab in FreeLens and runs:

```sh
kubectl debug -it pod/<pod-name> -n <namespace> --image nicolaka/netshoot:latest --target <first-container>
```

`--target` is included only when the Pod has at least one container.

You can configure command behavior from FreeLens Preferences:

- Debug image
- Shell profile (for example `/bin/bash` or `/bin/sh`)
- Extra `kubectl debug` flags

## Prerequisites

- FreeLens or Lens with extension support
- Node.js 18+
- npm

## Install dependencies

```sh
npm install
```

## Build

```sh
npm run build
```

## Develop (watch mode)

```sh
npm run dev
```

## Install into FreeLens

```sh
mkdir -p ~/.k8slens/extensions
ln -s "$(pwd)" ~/.k8slens/extensions/freelens-pod-debug-extension
```

Restart or reload FreeLens after building.

## Usage

1. Open any cluster.
2. Go to Workloads -> Pods.
3. Open the Pod actions menu (three dots).
4. Click **Debug Pod (kubectl)**.

A terminal opens and runs the generated debug command.

## Configure Preferences

1. Open **Preferences** in FreeLens.
2. Find **Pod Debug Settings**.
3. Set **Debug Image**, **Shell Profile**, and optional **Extra kubectl debug flags**.

Settings are persisted using an extension store and are reused for future debug commands.
npm package: @rgwch/mayan_edms-api
Description: API access for the Mayan EDMS system
Author: weirich@elexis.ch
Latest version: 0.4.5

# Mayan EDMS API

## Overview

This is a nodejs library to access the API of the [Mayan EDMS](https://www.mayan-edms.com/). It tries to simplify some common tasks when using automated services to work with Mayan.

## Usage

```js
import {mayan} from '@rgwch/mayan_edms-api'

mayan.connect("https://some.mayan.server","username","password", false).then(result)=>{
    if(result){
        console.log("We are connected. Use API now")
    }
})
```
All methods are async. Connect should be the first call. On success, it receives a token which is stored internally and used for all subsequent API calls. Note that the user who connects must have specific rights for every method in the fairly fine-grained permission system of Mayan EDMS.
I recommend to test first as admin user and change to the real user only if that is successful. 

You can use the provided test/docker-compose.yml for a quick test installation of Mayan EDMS

Documentation, see [docs](https://rgwch.github.io/mayan_edms-api/classes/index.Mayan.html)

## Contributing

```
git clone https://github.com/rgwch/mayan_edms-api
cd mayan_edms-api
npm i
npm run build
```

## Testing

There's only an integration test.

### First run
Before first run you must initialize a Mayan EDMS for testing:

```bash
cd test
docker-compose up -d
# or: docker compose up -d
```
Then navigate to [http://localhost:5656/]

Login as admin with the indicated password. Go to the "User" Menu in the right upper part of the window. Change the password to "testuser".

Then you can leave the Mayan UI and run the tests

### Test runs

`npm test`

### Cleaning up

docker-compose down

Later runs of `docker-compose up -d` will be much faster and no initialization is needed.
npm package: @rgwch/mikrorest
Description: A minimal REST server
Author: rgwch
Latest version: 0.9.2

# MikroRest Server

A minimal, but fully functional REST server in TypeScript for Node.js.
Use for proof-of-concepts, simple private servers, and more.

## Install

`npm i --save @rgwch/mikrorest`

## Use

```typescript
// Make sure environment variables MIKROREST_API_KEYS or MIKROREST_JWT_SECRET are set.

import {MikroRest} from '@rgwch/mikrorest'
import path from 'path'

// Create server
const server=new MikroRest()

// Add open routes
server.addRoute("get", "/api/sayhello",async (req,res)=>{
  server.sendPlain(res,"Hello, world")
  return false
})
// Add protected routes (optional)
server.addRoute("get", "/api/tellme", server.authorize,async (req,res)=>{
  server.sendPlain(res,"it's a secret")
  return false
})
// Add static files directory (optional, directory must exist)
server.addStaticDir(path.join(__dirname, "../../client/dist"));

// Implement login (optional)
server.handleLogin("/api/login",async (username,password)=>{
  // Do some checks to verify
  return {checkeduser: username}
})

// Start server
server.start()
```
See also src/demo.ts. Run with `npm run demo` or `npx ts-node src/demo.ts`

## Built-in authentication

You can use MikroRest's built-in authorization system (of course you can use your own as well). There are two possible ways:

(1) Provide a MIKROREST_API_KEYS environment variable with a comma-separated list of valid API keys. The client must then send an "Authorization: Bearer &lt;key&gt;" header with every request.

(2) Call the handleLogin() method with a route and an authentication function as parameters. If you do so, MikroRest will create a login route at the specified location and call the authentication function if the user POSTs to that login route with username and password in the JSON body. If the authentication function returns an object, a JWT token is created and returned together with that object to the client. Note: You must provide a MIKROREST_JWT_SECRET environment variable which gives the secret key to sign the JWT token.
The client must then include an "Authorization: Token &lt;token&gt;" header with every request.

## SSL

If you need an SSL server, you can pass pathnames for key and certificate to the constructor [options](docs/type-aliases/MikroRestOptions.md).

## API

See [docs](docs/globals.md)

## Tests

Tests were mostly created by GitHub Copilot. See tests/README.md

## Limitations

No path parameters, only query parameters. Things like `http://localhost:3339/user/{name}/any?/load` will not work with MikroRest. Use `http://localhost:3339/user/load?name=name&any=thing` instead. 
Or use a full-featured framework like [Express.js](https://expressjs.com/) or [Koa.js](https://koajs.com/#introduction).
npm package: @rgwch/normalize_mysqldb
Description: Normalize a MariaDB or Mysql database
Author: rgwch
Latest version: 0.2.3

## About

This utility normalizes a MariaDB or Mysql database. This means it will convert all table names and all column names to lowercase.

The rationale is: Mysql (and MariaDB) treat table names and field names case insensitive while some tools treat them case sensitive. In older databases, sometimes we are confronted with fields where some clients use "Somefieldname", some prefer "SomeFieldName", others "somefieldname" or even "SOMEFIELDNAME" for the same field. This leads to confusion when we apply ORM tools in case sensitive languages.

To reduce such confusion, we radically convert all to lowercase. This conforms to mysql [recommendations](https://dev.mysql.com/doc/refman/8.0/en/identifier-case-sensitivity.html).

## Install

npm install -g normalize_mysqldb

## Precautions

On case sensitive file systems, MyIsam table names are case sensitive by default. To avoid this, you should apply the following setting in my.cfg :

    lower_case_table_names=1

**after** running normalize_mysqldb and restart the mysql server. (Do not apply the setting before normalizing, since mixed case table names won't be accessible any more then.)

## Usage

normalize_mysqldb -u username -p password -d database -h hostname

**WARNING** The tool will immediately convert the database. So, if you're not sure: Use it only on a database copy.

## Troubleshoot

On some newer Mysql-Servers (>=8) you might encounter an error message simililar to the following:

    Client does not support authentication protocol requested by server, consider upgrading mysql client

Probably this error will go away, as npm-mysql2 upgrades to the newer protocol. Until then you can do the following:

From the mysql client commandline enter:

    ALTER USER my_username@'localhost' IDENTIFIED WITH mysql_native_password BY 'my_password';
    flush privileges;

After that, normalize_mysqldb should work for the user my_username with the password my_password.       

## License

MIT
npm package: @rgwch/samdastools
Description: A utility to convert Samdas text to other formats
Author: rgwch
Latest version: 1.6.1

# Samdastools

This is only useful for development around the [Elexis](http://www.elexis.info)(tm) electronic medical record system. 

It converts between the Samdas format as used in Elexis' encounter entries, and standard formats [HTML](https://html.spec.whatwg.org/multipage/) and [Delta](https://quilljs.com/docs/delta/).

## install

    npm install --save @rgwch/samdastools

## Usage

````
const Samdas=require('@rgwch/samdastools')

const deltaText=Samdas.toDelta(samdastext)
const htmlText=Samdas.toHtml(samdastext)
const samdas1=Samdas.fromHtml(htmltext)
const samdas2=Samdas.fromDelta(deltaText)
````

## Test

    jasmine

## License

MIT
npm package: @rgz/hello-world
Description: A simple example NPM package
Author: Fredy Rogez
Latest version: 1.0.2

# hello-world-npm

A simple example NPM package.

## Installation
```
$ npm install @rgz/hello-world-npm
```

## Usage
```
const hello = require('@rgz/hello-world-npm');
hello.printHelloWorld();
```

## Creating and publishing your package

1. Create a directory for your package :
```
$ mkdir my-package
```

2. Navigate into package directory :
```
$ cd my-package
```

3. If you are using github to manage your package code :
```
$ git init
$ git remote add origin https://github.com/user/repo.git
```

4. Set up your NPM package (create a package.json) :
```
$ npm init
```

5. Write the code !
6. Dont forget to create the README.md file.

7. Login to NPM :
```
$ npm login
```

8. Publish your package to the NPM registry :
```
npm publish
```

**That's all folks !**