text:
---
external help file: Passphraser-help.xml
Module Name: Passphraser
online version:
schema: 2.0.0
---

# New-Passphrase

## SYNOPSIS
Generates a new random passphrase.

## SYNTAX

### New (Default)
```
New-Passphrase [[-AmountOfWords] <Int32>] [[-Separator] <Char>] [-IncludeNumbers] [[-AmountOfNumbers] <Int32>]
 [-IncludeUppercase] [-IncludeSpecials] [[-AmountOfSpecials] <Int32>] [-AsObject] [-WhatIf] [-Confirm]
 [<CommonParameters>]
```

### Custom
```
New-Passphrase [[-Separator] <Char>] [-IncludeNumbers] [[-AmountOfNumbers] <Int32>] [-IncludeUppercase]
 [-IncludeSpecials] [[-AmountOfSpecials] <Int32>] [-AsObject] -CustomString <String> [-WhatIf] [-Confirm]
 [<CommonParameters>]
```

## DESCRIPTION
Generates a new random passphrase. Choose how many words, if you want to include an uppercase word, if you want to include numbers and/or special characters and how many of each.

## EXAMPLES

### Example 1
```powershell
PS C:\> New-Passphrase
```

Generates a new all lowercase passphrase with default values, 3 words and whitespace as separator.

### Example 2
```powershell
PS C:\> New-Passphrase -Separator "-"
```

Generates a new all lowercase passphrase with 3 words and dash (-) as separator.

### Example 3
```powershell
PS C:\> New-Passphrase -AmountOfWords 5 -Separator "-" -IncludeNumbers -AmountOfNumbers 2 -IncludeUppercase | clip
```

Generates a new passphrase with 5 words, dash (-) as separator with 2 numbers, one uppercase word and pipes the ouput to clipboard.

### Example 4
```powershell
PS C:\> New-Passphrase -AmountOfWords 5 -Separator "-" -IncludeNumbers -AmountOfNumbers 2 -IncludeUppercase -IncludeSpecials -AmountOfSpecials 2
```

Generates a new passphrase with 5 words, dash (-) as separator with 2 numbers, 2 special characters and one uppercase word.

### Example 5
```powershell
PS C:\> New-Passphrase -AmountOfWords 5 -Separator "-" -IncludeNumbers -AmountOfNumbers 2 -IncludeUppercase -IncludeSpecials -AmountOfSpecials 2 -AsObject
```

Generates a new passphrase object with 5 words, dash (-) as separator with 2 numbers, 2 special characters and one uppercase word. This object can then be manipulated further.

## PARAMETERS

### -AmountOfNumbers
Amount of numbers to include

```yaml
Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: 1
Accept pipeline input: False
Accept wildcard characters: False
```

### -AmountOfSpecials
Amount of special characters to include

```yaml
Type: Int32
Parameter Sets: (All)
Aliases:

Required: False
Position: 2
Default value: 1
Accept pipeline input: False
Accept wildcard characters: False
```

### -AmountOfWords
Amount of words to get

```yaml
Type: Int32
Parameter Sets: New
Aliases:

Required: False
Position: 0
Default value: 3
Accept pipeline input: False
Accept wildcard characters: False
```

### -AsObject
Return passphrase as passphrase object

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Confirm
Prompts you for confirmation before running the cmdlet.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -CustomString
Custom string to build passphrase object from

```yaml
Type: String
Parameter Sets: Custom
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```

### -IncludeNumbers
Includes numbers

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -IncludeSpecials
Include special characters

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -IncludeUppercase
Include an uppercase word

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -Separator
Separator to use between words

```yaml
Type: Char
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: " " (whitespace)
Accept pipeline input: False
Accept wildcard characters: False
```

### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.

```yaml
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

## INPUTS

### System.Int32, System.Char, System.String

## OUTPUTS

### System.String, System.Management.Automation.PSObject

## NOTES

## RELATED LINKS

repository: lagebj/Passphraser

gha_language: PowerShell

repo_name: lagebj/Passphraser


text:
---
layout: default
parent: crow
title: help
nav_order: 8
permalink: /crow/faq/
---

# crow questions

- [dictionary](#dictionary)
- [scripting](#scripting)
- [hardware](#hardware)
- [i2c](#i2c-head)

## a short story from Sam

Every day when a crow wakes up, it likes to follow the same daily routine, which may involve flying along complex paths, communicating with other creatures, solving problems, responding to external environmental stimuli, and more.

*When crow turns on, it runs a script saved in its flash memory. That script may involve generating control voltage, responding to control voltage/Lua code, acting as a CV expander for Norns, controlling other devices over the I2C bus, and more.*

Typically, the crow follows its innate biological daily routine.

*Typically, crow runs the default script, First.lua, aka First.*

However, your crow is quite smart, and it can learn a new daily routine to follow whenever you want.

*You can upload a User Script onto crow via druid, Max, or even a Max4Live device in Ableton. Norns scripts will also redefine how crow behaves.*

Your crow can return to its innate biological daily routine at anytime by telling it to forget the special routine which you delivered to it.

*crow can be restored to run the default script with the First command.*

Some crows may desire to wake with a clear mind and no responsibilities.

*crow can be set to turn on without any running script with the Clear Script command.*

Your crow is also highly adaptable and can communicate with you via telephone wires in real-time over the course of a day. This allows it to temporarily deviate from its daily routine. You can request reports about how it feels and what it sees, explore a new path which you radio in to it, change how it responds to environmental stimuli, communicate with other creatures for you, and more! The next day however, it will return to its daily routine, whether that is its biological routine or one which you previously gave it.

*You can send your crow new code to execute on the fly (pun intended) in real-time. This is done by sending Lua code to it over a USB cable. The code may be composed and sent via druid, Max, Max for Live devices in Ableton, or Norns. That code might redefine how it responds to and generates voltage, it might directly change the state of its inputs or outputs, it might return information to you about its internal state or externally received voltages, it might relay messages to other devices over I2C and more! When you restart crow, it will return to the behavior defined by the script in flash memory, whether that is First.lua or a User Script.*

## dictionary of crow terms

### i2c

i2c is a communication bus - it’s a way for devices to talk to each other, similar to MIDI or USB. In the monome ecosystem, an i2c protocol called "ii" provides a convenient way to send commands & data between modules. In some situations reducing what could be many patch-cable connections down to a single i2c cable hidden behind the module. For example, crow can send unique synthesis commands to Just Friends, accessible only with the ii protocol.

### druid

[druid](https://github.com/monome/druid) is a utility for communicating with crow, both for realtime interaction and the uploading of full scripts. It requires Python3+ to be installed on your computer.

### Lua

Lua is a programming language known for its flexibility to be embedded in applications. [norns](https://monome.org/norns/) uses Lua to allow the creation of scripts to express musical + artistic ideas. crow also speaks Lua, so it extends the norns ecosystem. Using druid, you could upload a Lua script to crow -- in turn, crow would save this and perform the script without a computer attached.

### asl (think a/s/l)

A Slope Language -- the unique syntax developed for crow to describe voltage control events over time. For example, a sawtooth ramp could be described as starting at 5.0 V and falling to 0.0 V over a period of a second, then looping:

```lua
output[1].action =
    loop{ to( 5.0, 0.0 )
        , to( 0.0, 1.0 )
        }
```

[Learn more here](https://github.com/monome/crow#output-library--asl).

### "event-based"

crow is a blank slate, so it requires instructions to know what you’d like it to do at any given moment. Let's say you want to send voltage from crow's first output to a filter's cutoff frequency. You can automate this instruction by telling crow “please emit 3.33 volts from your first output.” crow is designed to listen to a specific scripting syntax.

Messages to crow must fit a format that crow expects, e.g.:

```lua
output[1].volts = 3.33
```

Or on norns: `crow.output[1].volts = 3.33`

This command tells crow “please emit 3.33 volts from your first output”. There are currently a few things that know how to talk to crow (norns, druid, and the Max/M4L toolkit), but this list will hopefully grow.

[Documentation of this syntax](../reference).

Using one of these tools, you could:

- live-code through druid, typing instructions to crow in real time
- create a Max patch that sends instructions to crow on demand / as a sequence of events (a version of live-coding without the command line)
- write a norns app that tells crow to wait for triggers at its inputs to create different types of envelopes
- you can upload a full script to crow so that it knows what it’s meant to do when it's not connected to a computer or norns, and it would just await external triggers or control voltage at its inputs

## scripting

### norns

#### finding community scripts

Search `tags:crow+norns` at llllllll.co (or [click here](https://llllllll.co/search?expanded=true&q=tags%3Acrow%2Bnorns%20order%3Alatest)) to view the scripts on norns which are tagged as having crow integration.

#### writing norns + crow scripts

Visit [crow studies](../norns) to learn how to integrate crow within scripts on norns.

### druid

#### finding community scripts

Visit *stage one* of the [scripting tutorial](../scripting) to learn how to upload scripts; to find new scripts to upload, visit [bowery](https://github.com/monome/bowery), a collection of druid scripts which hosts community contributions.

#### writing crow scripts in druid

Visit *stage two* and *stage three* of the [scripting tutorial](../scripting) to learn how to use Lua to livecode and create standalone scripts for crow.  The [scripting reference](../reference) provides additional documentation of the scripting language.

#### how large a script can I run or store on crow in standalone?

Currently, 8kB = ~400 lines of Lua.

From Trent:
>I’ve found most scripts I’ve created so far are <100 lines. Lua may be less terse than Teletype, but it has far greater capacity for abstraction. The crow library leverages this to provide many complex features with terse syntax.

eg. 3 lines that create an ADSR envelope triggered by input 1 and sent to output 1:

```lua
output[1].action = adsr()
input[1].change = function(s) output[1](s) end
input[1].mode = 'change'
```

### Max

#### what are the formatting differences between druid + Max syntax?

In Max, you use the exact same commands as you would in druid -- the only difference is you need to wrap them in quotes to make sure they are a single chunk, and prepend that chunk with `tell_crow`.

In druid:
`output[1].volts = 3`

In Max:
`tell_crow “output[1].volts = 3”`

The quotes are crucial because they make sure the Lua command is treated a single chunk.

#### best practices

The `[sprintf]` object is the easiest way to format messages to crow. Using the `symout` argument, the `[sprintf]` object outputs a string as a single symbol -- ideal for sending to crow as a Lua chunk.

*Example: control the voltage of an assignable output*

![](images/max-faq-1.png)

- `[sprintf symout "output[%i].volts = %.2f"]` creates a string that accepts an integer (output ID) through its first inlet and a 2-decimal float (voltage) through its second inlet
- since `[sprintf]`'s second inlet is *cold*, we use `[t b f]` to send a bang to `[sprintf]`'s first inlet to force the output whenever the float (voltage) changes
- we send the string to `[prepend tell_crow]` to format the instruction
- and finally, we send that formatted message to `[crow]`!

## hardware

### one of crow's inputs doesn't seem to respond to triggers

If you are running a script or device that uses crow's inputs (perhaps for clocking), but crow doesn't seem to be receiving the triggers, try executing the following commands in druid/maiden/max: `crow.reset()` and `crow.clear()` (or `^^r` and `^^c`).

### can I use [x thing] to control crow?

Since crow uses a specific communication syntax, it requires some sort of layer between the thing you want to use to control crow and crow itself. Right now, you can use any of these to have immediate fun with crow:

- norns
- druid
- Max
- Max for Live

For example, if you like to use a specific app on your laptop for live-coding, plugging crow into your laptop while running the app will not suddenly translate MIDI to CV. crow won't even show up as a "MIDI device." However, you *could* use the [crow] Max object's help file to package a translator between them. Or you could route the MIDI from your live-coding app into Ableton Live 9/10 Suite and use the Max for Live toolkit to perform this translation.

### can I control two or more crows at the same time from norns?

Not currently, though it is being actively explored.

### can crow make sound on its own?

Not currently. You *can* tell it to run very fast LFO's from its outlets, into audio rate, but this creates instability. For the best experience with crow, consider its outputs to be control-rate generators.

### what is crow's sample rate?

crow internally generates signals at 48kHz (though the user doesn’t have direct access to these samples). crow reads inputs at 1.5kHz.

### what are the differences between crow and Teletype?

| Aspect       | crow | Teletype |
| ---          | ---  | ---      |
| panel hardware     | 2 CV inputs (1.5 kHz sample rate), 4 CV outputs (48 kHz sample rate), mini USB | 8 trigger inputs, 4 trigger outputs, 1 CV input, 4 CV outputs, potentiometer, USB-A port, button, screen |
| events       | focused on sending and receiving bits of text from something else, and manipulating and reacting to things happening elsewhere in your setup – CV crossing some threshold, receiving an I2C message | focused on running small bits of code in reaction to triggers. These can be any of the 8 trigger inputs patched from elsewhere in your modular, or an internal “metro” (metronome) script that’s triggered at a fixed rate |
| scripting | runs Lua scripts, a general purpose programming language with a higher abstraction level (also used on Norns) | runs scripts written in a specialized, stack-based language (sometimes called “TT-script”) designed for Teletype |
| storage | has larger (8kb) user storage space for scripts | deliberately has a limited amount of code and data that can be in use at any given time |
| USB | is **not** a USB host - it does not supply USB power and is not programmed to talk to USB devices. Other devices (a computer, Norns, etc) have to initiate communication with it and supply USB power | is a USB host, so it can support USB devices and supply power to them. Currently the supported devices are a keyboard, a USB disk so you can make backups of your work, and a Grid (external power required) |
| UI | requires some other device, typically a computer, to send scripts or instructions to it. This can be really convenient, since you can use whatever editor / other tools you like on your computer, and paste chunks of code or whole scripts to crow as needed. [druid](https://github.com/monome/druid) can be used on any computer to interact with crow over the serial port. Norns, Max, and Max4Live can also send bits of code to crow. | has a screen and directly connects to a keyboard so you can write code right on the module with nothing else |
| CV output | very flexible at producing gates and CV. LFOs and envelopes can be arbitrarily specified using the [ASL](https://github.com/monome/crow#output-library--asl) mini-lanugage | can produce both gates and CV. CV can slew on its way to a new value, but can't loop on its own - a script has to initiate each change |

## i2c

### what the heck are pull-ups + i2c and what do I need to know about them in order to use crow?

Pull-ups are resistors on [i2c-enabled](https://llllllll.co/t/a-users-guide-to-i2c/19219) (or, ii) devices (like crow, Teletype, Ansible, Just Friends, W/). They are required to ensure integrity of the data on the i2c bus. A "bus" requires only one device to have its pull-ups enabled in order for data and power to flow correctly. As of firmware v1.0.2, crow's pull-ups are on by default.

Since *crow v1.0.2* crow's pullups are enabled by default - that's what you want! If for some specific reason you need to turn them off, crow provides the function `ii.pullup(state)` where you can turn them on (`true`) or off (`false`).

### is crow's status as an [i2c leader or follower](https://github.com/monome/crow#leading-the-i2c-bus) automatic or configurable?

It’s automatic, but only because leading and following isn't a property of a single device -- it's a property of communication. crow is very flexible, designed to be agnostic to who/what it's speaking with.

Basically, crow is always listening to other devices (ie following), until it's told to execute a leader-command, at which point it attempts to lead the bus. Once that command / query is complete, it returns to follower mode.

license: MIT

branch_name: refs/heads/main

extension: md

gha_language: HTML

license_type: permissive


text:
# Change Log
All notable changes to the "line-endings" extension will be documented in this file.

## [1.0.3]
- Update npm dependencies

## [1.0.2]
 - Change repository field in `package.json` to full url

## [1.0.0]
- Initial release of the extension

repository: Steditor/vsce-line-endings

branch_name: refs/heads/master

repo_name: Steditor/vsce-line-endings


text:
# SQL

GreptimeDB supports full SQL for you to query data from a database. Here are some query examples for the `monitor` so you can get familiar with using SQL alongside GreptimeDB functions.
To select all the data from the `monitor` table, use the `SELECT` statement:

``` sql
SELECT * FROM monitor;
```

The query result looks like the following:

```sql
+-----------+---------------------+------+--------+
| host      | ts                  | cpu  | memory |
+-----------+---------------------+------+--------+
| <IP_ADDRESS> | 2022-11-03 03:39:57 |  0.1 |    0.4 |
| <IP_ADDRESS> | 2022-11-03 03:39:58 |  0.5 |    0.2 |
| <IP_ADDRESS> | 2022-11-03 03:39:58 |  0.2 |    0.3 |
+-----------+---------------------+------+--------+
3 rows in set (0.00 sec)
```

You can use the `count()` function to get the number of all rows in the table:

``` sql
SELECT count(*) FROM monitor;
```

```sql
+-----------------+
| COUNT(UInt8(1)) |
+-----------------+
|               3 |
+-----------------+
```

The `avg()` function returns the average value of a certain field:

``` sql
SELECT avg(cpu) FROM monitor;
```

```sql
+---------------------+
| AVG(monitor.cpu)    |
+---------------------+
| 0.26666666666666666 |
+---------------------+
1 row in set (0.00 sec)
```

You can use the `GROUP BY` clause to group rows that have the same values into summary rows.
The average memory usage grouped by idc:

```sql
SELECT host, avg(cpu) FROM monitor GROUP BY host;
```

```sql
+-----------+------------------+
| host      | AVG(monitor.cpu) |
+-----------+------------------+
| <IP_ADDRESS> |              0.2 |
| <IP_ADDRESS> |              0.3 |
+-----------+------------------+
2 rows in set (0.00 sec)
```

For more information about the `SELECT` statement, please refer to [SELECT](/reference/sql/select.md).

## HTTP API

Use POST method to query data:

```shell
curl -X POST \
  -H 'authorization: Basic {{authorization if exists}}' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'sql=select * from monitor' \
http://localhost:4000/v1/sql?db=public
```

The result is shown below:

```json
{
  "code": 0,
  "output": [
    {
      "records": {
        "schema": {
          "column_schemas": [
            {
              "name": "host",
              "data_type": "String"
            },
            {
              "name": "ts",
              "data_type": "TimestampMillisecond"
            },
            {
              "name": "cpu",
              "data_type": "Float64"
            },
            {
              "name": "memory",
              "data_type": "Float64"
            }
          ]
        },
        "rows": [
          [
            "<IP_ADDRESS>",
<PHONE_NUMBER>450,
            0.1,
            0.4
          ],
          [
            "<IP_ADDRESS>",
<PHONE_NUMBER>450,
            0.5,
            0.2
          ],
          [
            "<IP_ADDRESS>",
<PHONE_NUMBER>450,
            0.2,
            0.3
          ]
        ]
      }
    }
  ],
  "execution_time_ms": 0
}
```

For more information about SQL HTTP request, please refer to [API document](/reference/sql/http-api.md).

repository: paomian/docs

repo_name: paomian/docs


text:
# The protocol

The talker uses CRLF-delimited lines as a record. Each line is either just a thing
to say, or some kind of `/`-prefixed command.

It's possible to use `netcat` as a client to generate such input and process the
corresponding responses:

```bash
% nc -c localhost 8889
```

# Multiple servers

As well as standard client sockets, the server also supports peer-to-peer mesh networking.
The client command

    /peer-listen <IP_ADDRESS> 9999

will cause a server to listen on a server-to-server socket at the given address.

A second server can be asked to connect to the first by issuing the client command:

    /peer-connect <IP_ADDRESS> 9999

At that point, the two servers will connect to each other. You can ask a server to give the
details of the other servers it's connected to by using the client command:

    /peers

## Mesh-enabled commands

Most commands are not yet mesh-enabled. The one that is is the standard 'talker' - this
broadcasts anything a client says to all nodes in the network. As the line of speech is
received at a server, it relays it to each connected client.

The mechanism for this is identical whether the server is a singleton or part of a network.
The client broadcasts a notification to the `SpeechObserver` class; this notification floods
the server network.

## Server-to-server communication mechanism

The most basic mechanism of server-to-server communication is a simple, one-way _broadcast_: a server sends
a message to each of its directly connected peers, which in turn forward it to _their_ peers, and so on.
On receipt of a message, local observers are notified of any messages they are interested in. (There's a
mechanism to suppress duplicate notifications arising from messages looping around a peer network that's
not simply-connected.)

This is a great building-block for talkers, since most traffic originating at a client needs to be broadcast
to all other clients.

Additionally, there's a lower-level mechanism for sending a message to one directly-connected peer. This
is used by the topology management.

## Topology management

A second observer handles the local calculation of the network's topology. When a server detects a new
peer connection, it sends an `I-AM` message to its new peer, identifying itself.

Each peer, on receiving such a message, updates its route table to reflect the new connection.

As route table entries are updated, they are broadcast around the mesh network. The `TopologyObserver`
collects these messages and remembers the most recent peer set that each server is connected to.
From this information, it can calculate all the servers that it can reach.
(A consequence of this is that every server has a complete picture of the topology of all reachable
servers, once the algorithm stabilises.)

## More advanced RPC

There are two more advanced forms of RPC that might be necessary. One is a point-to-point unidirectional
message; this can be achieved by broadcasting the message, tagging it with a "for the eyes only of"
attribute.

The second form is a two-way operation: eg, a network-wide `/who` might use this. Rather than attempt to
maintain global tables (which is what the `TopologyObserver` does) - in itself, a perfectly reasonable
approach - we might perform a _scatter-gather_ call. Messages are broadcast to target nodes with a reply
address. As replies come back, they are collated. When we have received replies from all targets, or
at a suitable timeout, the available results are presented to a callback function.

(This would make commands like `/who` effectively asynchronous: the user types the command, and may
issue other commands in the interim; at some point in the future, the server responds with a result.)

repository: jan-g/talker

repo_name: jan-g/talker


text:
---
title: "Load Variables"
linkTitle: "Load Variables"
weight: 20
---
Load Variables is a sub configuration in a [Task](/docs/user-interface/operations/tasks/) or in a [Schedule](/docs/user-interface/operations/schedules/).

You can load any number of variables for the further operations.

##### Form View
![load variables](/doc-images/load_variables.png)
* `Variable Name` is used a internal reference for further operations. should be unique.
* Add new variable click `+` icon
* To delete a variable click `-` icon
* By clicking edit icon of a value, can offer to select different [data types](#data-types).

##### YAML View
In YAML view, the data is encoded with [base64](https://en.wikipedia.org/wiki/Base64) format to avoid syntax issues.
```yaml
variables:
  water_level: >-
    {"type":"resource_by_quick_id","disabled":"","data":"cmVzb3VyY2VUeXBlOiBmaWVsZApxdWlja0lkOiBteXNlbnNvci4xLjEuVl9WT0xVTUUKc2VsZWN0b3I6IGN1cnJlbnQudmFsdWUK"}
  motor_status: >-
    {"type":"resource_by_quick_id","disabled":"","data":"cmVzb3VyY2VUeXBlOiBmaWVsZApxdWlja0lkOiBteXNlbnNvci4xMy4xLlZfU1RBVFVTCnNlbGVjdG9yOiBjdXJyZW50LnZhbHVlCg=="}
```

## Data Types
Following data types are supported in `Load Variables`.

  * [String](#string)
  * [Resource By QuickID](#resource-by-quickid)
  * [Resource By Labels](#resource-by-labels)

### String
String is static type. It assigns the given value to that variable.

### Resource By QuickID
Resource can be selected by their [QuickID](/docs/getting-started/hints/#quick-id).

##### Form View
![load variable by quick id](/doc-images/load_variables_resource_by_quick_id.png)
* Select a `Resource Type`
* enter the `id` of the resource, you will get a list of matching resources. Select a resource.
* On the `Selector` field enter the exact path to get value. See [Selector Guide](#selector)

##### YAML View
```yaml
type: resource_by_quick_id
data:
  resourceType: field
  quickId: tasmota.tasmota_0B8E60.Control.POWER
  selector: current.value
```

### Resource By Labels
Resource can be selected by their [Labels](/docs/getting-started/hints/#labels).

{{< alert title="Note" >}}
If a list of resources received, the very first resource will be taken for further actions.
{{< /alert >}}

##### Form View
![load variable by quick id](/doc-images/load_variables_resource_by_labels.png)
* Select a `Resource Type`
* enter key value of a label. enter as many labels you want.
* On the `Selector` field enter the exact path to get value. See [Selector Guide](#selector)

##### YAML View
```yaml
type: resource_by_labels
data:
  resourceType: field
  labels:
    location: hall
  selector: current.value
```

## Selector
Selector is dot(`.`) separated path used to select a value on the given resource.

If the path not found returns empty value.

To make the path, you should know the supported keys on a resource.

To know more about supported keys of a resource,
  * go to that particular resource details page
  * click on edit
  * select the `YAML View`.

### Some of the references

#### Resource - Field
  * `current.value` - current value
  * `current.timestamp` - current value received timestamp
  * `noChangeSince` - There is no change on the received value from this time
  * `previous.value` - previous value
  * `previous.timestamp` - previous value received timestamp

#### Resource - Gateway
  * `state.status` - status of the gateway. can be `up`, `down`, `error`, etc.,
  * `enabled` - enabled or disabled

repository: umavelusamy/documentation

repo_name: umavelusamy/documentation


text:
数学运算。

**Note:**  Functions taking  `Tensor`  arguments can also take anything accepted by[ `tf.convert_to_tensor` ](https://tensorflow.google.cn/api_docs/python/tf/convert_to_tensor).

**Note:**  Elementwise binary operations in TensorFlow follow [numpy-stylebroadcasting](http://docs.scipy.org/doc/numpy/user/basics.broadcasting.html).
TensorFlow提供多种数学函数，包括：

- Basic arithmetic operators and trigonometric functions.
- Special math functions (like: [ `tf.math.igamma` ](https://tensorflow.google.cn/api_docs/python/tf/math/igamma) and [ `tf.math.zeta` ](https://tensorflow.google.cn/api_docs/python/tf/math/zeta))
- Complex number functions (like: [ `tf.math.imag` ](https://tensorflow.google.cn/api_docs/python/tf/math/imag) and [ `tf.math.angle` ](https://tensorflow.google.cn/api_docs/python/tf/math/angle))
- Reductions and scans (like: [ `tf.math.reduce_mean` ](https://tensorflow.google.cn/api_docs/python/tf/math/reduce_mean) and [ `tf.math.cumsum` ](https://tensorflow.google.cn/api_docs/python/tf/math/cumsum))
- Segment functions (like: [ `tf.math.segment_sum` ](https://tensorflow.google.cn/api_docs/python/tf/math/segment_sum))
See: [ `tf.linalg` ](https://tensorflow.google.cn/api_docs/python/tf/linalg) for matrix and tensor functions.

[]()

## 关于分段
TensorFlow provides several operations that you can use to perform commonmath computations on tensor segments.Here a segmentation is a partitioning of a tensor alongthe first dimension, i.e. it  defines a mapping from the first dimension onto `segment_ids` . The  `segment_ids`  tensor should be the size ofthe first dimension,  `d0` , with consecutive IDs in the range  `0`  to  `k` ,where  `k<d0` .In particular, a segmentation of a matrix tensor is a mapping of rows tosegments.

#### 例如：

```
 c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])
tf.math.segment_sum(c, tf.constant([0, 0, 1]))
#  ==>  [[0 0 0 0]
#        [5 6 7 8]]

```

The standard  `segment_*`  functions assert that the segment indices are sorted.If you have unsorted indices use the equivalent  `unsorted_segment_`  function.Thses functions take an additional argument  `num_segments`  so that the outputtensor can be efficiently allocated.

```
 c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])
tf.math.unsorted_segment_sum(c, tf.constant([0, 1, 0]), num_segments=2)
# ==> [[ 6,  8, 10, 12],
#       [-1, -2, -3, -4]]

```

## 功能
[ `abs(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/abs): Computes the absolute value of a tensor.

[ `accumulate_n(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/accumulate_n): Returns the element-wise sum of a list of tensors.

[ `acos(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/acos): Computes acos of x element-wise.

[ `acosh(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/acosh): Computes inverse hyperbolic cosine of x element-wise.

[ `add(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/add): Returns x + y element-wise.

[ `add_n(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/add_n): Adds all input tensors element-wise.

[ `angle(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/angle): Returns the element-wise argument of a complex (or real) tensor.

[ `argmax(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/argmax): Returns the index with the largest value across axes of a tensor.

[ `argmin(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/argmin): Returns the index with the smallest value across axes of a tensor.

[ `asin(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/asin): Computes the trignometric inverse sine of x element-wise.

[ `asinh(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/asinh): Computes inverse hyperbolic sine of x element-wise.

[ `atan(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/atan): Computes the trignometric inverse tangent of x element-wise.

[ `atan2(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/atan2): Computes arctangent of  `y/x`  element-wise, respecting signs of the arguments.

[ `atanh(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/atanh): Computes inverse hyperbolic tangent of x element-wise.

[ `bessel_i0(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/bessel_i0): Computes the Bessel i0 function of  `x`  element-wise.

[ `bessel_i0e(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/bessel_i0e): Computes the Bessel i0e function of  `x`  element-wise.

[ `bessel_i1(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/bessel_i1): Computes the Bessel i1 function of  `x`  element-wise.

[ `bessel_i1e(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/bessel_i1e): Computes the Bessel i1e function of  `x`  element-wise.

[ `betainc(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/betainc): Compute the regularized incomplete beta integral ![](./Overview.md_0.png).

[ `bincount(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/bincount): Counts the number of occurrences of each value in an integer array.

[ `ceil(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/ceil): Returns element-wise smallest integer not less than x.

[ `confusion_matrix(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/confusion_matrix): Computes the confusion matrix from predictions and labels.

[ `conj(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/conj): Returns the complex conjugate of a complex number.

[ `cos(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/cos): Computes cos of x element-wise.

[ `cosh(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/cosh): Computes hyperbolic cosine of x element-wise.

[ `count_nonzero(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/count_nonzero): Computes number of nonzero elements across dimensions of a tensor.

[ `cumprod(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/cumprod): Compute the cumulative product of the tensor  `x`  along  `axis` .

[ `cumsum(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/cumsum): Compute the cumulative sum of the tensor  `x`  along  `axis` .

[ `cumulative_logsumexp(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/cumulative_logsumexp): Compute the cumulative log-sum-exp of the tensor  `x`  along  `axis` .

[ `digamma(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/digamma): Computes Psi, the derivative of Lgamma (the log of the absolute value of

[ `divide(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/divide): Computes Python style division of  `x`  by  `y` .

[ `divide_no_nan(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/divide_no_nan): Computes an unsafe divide which returns 0 if the y is zero.

[ `equal(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/equal): Returns the truth value of (x == y) element-wise.

[ `erf(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/erf): Computes the Gauss error function of  `x`  element-wise.

[ `erfc(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/erfc): Computes the complementary error function of  `x`  element-wise.

[ `exp(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/exp): Computes exponential of x element-wise.  ![](./Overview.md_0.png).

[ `expm1(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/expm1): Computes  `exp(x) - 1`  element-wise.

[ `floor(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/floor): Returns element-wise largest integer not greater than x.

[ `floordiv(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/floordiv): Divides  `x / y`  elementwise, rounding toward the most negative integer.

[ `floormod(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/floormod): Returns element-wise remainder of division. When  `x < 0`  xor  `y < 0`  is

[ `greater(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/greater): Returns the truth value of (x > y) element-wise.

[ `greater_equal(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/greater_equal): Returns the truth value of (x >= y) element-wise.

[ `igamma(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/igamma): Compute the lower regularized incomplete Gamma function  `P(a, x)` .

[ `igammac(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/igammac): Compute the upper regularized incomplete Gamma function  `Q(a, x)` .

[ `imag(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/imag): Returns the imaginary part of a complex (or real) tensor.

[ `in_top_k(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/in_top_k): Says whether the targets are in the top  `K`  predictions.

[ `invert_permutation(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/invert_permutation): Computes the inverse permutation of a tensor.

[ `is_finite(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/is_finite): Returns which elements of x are finite.

[ `is_inf(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/is_inf): Returns which elements of x are Inf.

[ `is_nan(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/is_nan): Returns which elements of x are NaN.

[ `is_non_decreasing(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/is_non_decreasing): Returns  `True`  if  `x`  is non-decreasing.

[ `is_strictly_increasing(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/is_strictly_increasing): Returns  `True`  if  `x`  is strictly increasing.

[ `l2_normalize(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/l2_normalize): Normalizes along dimension  `axis`  using an L2 norm.

[ `lbeta(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/lbeta): Computes ![](./Overview.md_0.png), reducing along the last dimension.

[ `less(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/less): Returns the truth value of (x < y) element-wise.

[ `less_equal(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/less_equal): Returns the truth value of (x <= y) element-wise.

[ `lgamma(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/lgamma): Computes the log of the absolute value of  `Gamma(x)`  element-wise.

[ `log(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/log): Computes natural logarithm of x element-wise.

[ `log1p(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/log1p): Computes natural logarithm of (1 + x) element-wise.

[ `log_sigmoid(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/log_sigmoid): Computes log sigmoid of  `x`  element-wise.

[ `log_softmax(...)` ](https://tensorflow.google.cn/api_docs/python/tf/nn/log_softmax): Computes log softmax activations.

[ `logical_and(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/logical_and): Returns the truth value of x AND y element-wise.

[ `logical_not(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/logical_not): Returns the truth value of NOT x element-wise.

[ `logical_or(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/logical_or): Returns the truth value of x OR y element-wise.

[ `logical_xor(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/logical_xor): Logical XOR function.

[ `maximum(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/maximum): Returns the max of x and y (i.e. x > y ? x : y) element-wise.

[ `minimum(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/minimum): Returns the min of x and y (i.e. x < y ? x : y) element-wise.

[ `mod(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/floormod): Returns element-wise remainder of division. When  `x < 0`  xor  `y < 0`  is

[ `multiply(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/multiply): Returns x * y element-wise.

[ `multiply_no_nan(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/multiply_no_nan): Computes the product of x and y and returns 0 if the y is zero, even if x is NaN or infinite.

[ `negative(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/negative): Computes numerical negative value element-wise.

[ `nextafter(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/nextafter): Returns the next representable value of  `x1`  in the direction of  `x2` , element-wise.

[ `not_equal(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/not_equal): Returns the truth value of (x != y) element-wise.

[ `polygamma(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/polygamma): Compute the polygamma function ![](./Overview.md_0.png).

[ `polyval(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/polyval): Computes the elementwise value of a polynomial.

[ `pow(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/pow): Computes the power of one value to another.

[ `real(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/real): Returns the real part of a complex (or real) tensor.

[ `reciprocal(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/reciprocal): Computes the reciprocal of x element-wise.

[ `reciprocal_no_nan(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/reciprocal_no_nan): Performs a safe reciprocal operation, element wise.

[ `reduce_all(...)` ](https://tensorflow.google.cn/api_docs/python/tf/reduce_all): Computes the "logical and" of elements across dimensions of a tensor.

[ `reduce_any(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/reduce_any): Computes the "logical or" of elements across dimensions of a tensor.

[ `reduce_euclidean_norm(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/reduce_euclidean_norm): Computes the Euclidean norm of elements across dimensions of a tensor.

[ `reduce_logsumexp(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/reduce_logsumexp): Computes log(sum(exp(elements across dimensions of a tensor))).

[ `reduce_max(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/reduce_max): Computes the maximum of elements across dimensions of a tensor.

[ `reduce_mean(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/reduce_mean): Computes the mean of elements across dimensions of a tensor.

[ `reduce_min(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/reduce_min): Computes the minimum of elements across dimensions of a tensor.

[ `reduce_prod(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/reduce_prod): Computes the product of elements across dimensions of a tensor.

[ `reduce_std(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/reduce_std): Computes the standard deviation of elements across dimensions of a tensor.

[ `reduce_sum(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/reduce_sum): Computes the sum of elements across dimensions of a tensor.

[ `reduce_variance(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/reduce_variance): Computes the variance of elements across dimensions of a tensor.

[ `rint(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/rint): Returns element-wise integer closest to x.

[ `round(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/round): Rounds the values of a tensor to the nearest integer, element-wise.

[ `rsqrt(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/rsqrt): Computes reciprocal of square root of x element-wise.

[ `scalar_mul(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/scalar_mul): Multiplies a scalar times a  `Tensor`  or  `IndexedSlices`  object.

[ `segment_max(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/segment_max): Computes the maximum along segments of a tensor.

[ `segment_mean(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/segment_mean): Computes the mean along segments of a tensor.

[ `segment_min(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/segment_min): Computes the minimum along segments of a tensor.

[ `segment_prod(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/segment_prod): Computes the product along segments of a tensor.

[ `segment_sum(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/segment_sum): Computes the sum along segments of a tensor.

[ `sigmoid(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/sigmoid): Computes sigmoid of  `x`  element-wise.

[ `sign(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/sign): Returns an element-wise indication of the sign of a number.

[ `sin(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/sin): Computes sine of x element-wise.

[ `sinh(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/sinh): Computes hyperbolic sine of x element-wise.

[ `softmax(...)` ](https://tensorflow.google.cn/api_docs/python/tf/nn/softmax): Computes softmax activations.

[ `softplus(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/softplus): Computes softplus:  `log(exp(features) + 1)` .

[ `softsign(...)` ](https://tensorflow.google.cn/api_docs/python/tf/nn/softsign): Computes softsign:  `features / (abs(features) + 1)` .

[ `sqrt(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/sqrt): Computes square root of x element-wise.

[ `square(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/square): Computes square of x element-wise.

[ `squared_difference(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/squared_difference): Returns (x - y)(x - y) element-wise.

[ `subtract(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/subtract): Returns x - y element-wise.

[ `tan(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/tan): Computes tan of x element-wise.

[ `tanh(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/tanh): Computes hyperbolic tangent of  `x`  element-wise.

[ `top_k(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/top_k): Finds values and indices of the  `k`  largest entries for the last dimension.

[ `truediv(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/truediv): Divides x / y elementwise (using Python 3 division operator semantics).

[ `unsorted_segment_max(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/unsorted_segment_max): Computes the maximum along segments of a tensor.

[ `unsorted_segment_mean(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/unsorted_segment_mean): Computes the mean along segments of a tensor.

[ `unsorted_segment_min(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/unsorted_segment_min): Computes the minimum along segments of a tensor.

[ `unsorted_segment_prod(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/unsorted_segment_prod): Computes the product along segments of a tensor.

[ `unsorted_segment_sqrt_n(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/unsorted_segment_sqrt_n): Computes the sum along segments of a tensor divided by the sqrt(N).

[ `unsorted_segment_sum(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/unsorted_segment_sum): Computes the sum along segments of a tensor.

[ `xdivy(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/xdivy): Returns 0 if x == 0, and x / y otherwise, elementwise.

[ `xlogy(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/xlogy): Returns 0 if x == 0, and x * log(y) otherwise, elementwise.

[ `zero_fraction(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/zero_fraction): Returns the fraction of zeros in  `value` .

[ `zeta(...)` ](https://tensorflow.google.cn/api_docs/python/tf/math/zeta): Compute the Hurwitz zeta function ![](./Overview.md_0.png).

repository: veaba/tensorflow-docs

repo_name: veaba/tensorflow-docs


text:
# com.ultracart.admin.v2.Model.OrderBuysafe
## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**BuysafeBondAvailable** | **bool?** | True if a buySAFE bond was available for purchase on this order | [optional]
**BuysafeBondCost** | [**Currency**](Currency.md) |  | [optional]
**BuysafeBondFree** | **bool?** | True if the buySAFE bond was free for this order | [optional]
**BuysafeBondRefunded** | [**Currency**](Currency.md) |  | [optional]
**BuysafeBondWanted** | **bool?** | True if the buySAFE bond was wanted by the customer | [optional]
**BuysafeShoppingCartId** | **string** | Shopping cart ID associated with the buySAFE bond | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

gha_language: C#


text:
## Key Points
---

* SGD:
	* Batch SGD: Full Dataset
		* guaranteed convergence to global minimum in convex error surface
		* guaranteed convergence to local minimum in convex error surface
	* Stochastic SGD: One example
		* faster and frequent updates
		* can be used for online learning
		* high variance causes heavy fluctuation
		* fluctuation helps jump to better minima
		* jumping out of the best minima can be reduced by annealing
	* Mini-bacth SGD: n examples, best of both worlds
		* reduce variance resulting in stable convergence
		* efficient GPU optimizations on batch/matrix operations

* Challenges of Vanilla SGD:
	* Saddle points in high-dim non-convex error surface
	* Choosing an appropriate learning rate
	* If using learning rate schedules, it doesn't adapt to dataset

* SGD Optimizations
	* Momentum:
```
			update = 0.9*update + 0.1*p_grad
			params = params - lr*update
```
		* SGD oscillates in ravines, steep slopes along one dimension
		* Slows down convergence
		* Add fraction (0.9) of the last update to current update
		* reduced oscillation by summing previous updates
		* opposite direction updates cancels each other
		* same direction updates add to each other

	* NAG (Nesterov Accelerated Gradient):
```
			??
			params = params - 0.9*prev_p_grad
			params.backward??
			update = 0.9*prev_p_grad +
```
		* anticipate the next slope to slow down if required
		* approximate position of the parameters in the next step
		* compute gradient and add momentum accordingly

	* Adagrad(Adaptive Gradient):
```
		G += p.grad**2
		update = torch.sqrt(lr/(G+1e-8)) * p.grad
		params = params - update
```
		* adapts learning rate to parameters
		* smaller updates for params with frequent features
		* larger updates for params with rare features
		* used for sparse data training
		* no need to manually tune learning rate
		* ends up with infinitesimally small lr

	* Adadelta
```
		??
```
		* fixes adagrad's vanishing learning rate
		* doesn't sum up all past gradients
		* uses fixed size window of gradients
		* no need to set default learning rate

	* RMSprop
		* same as Adadelta

	* Adam (Adaptive Moment Estimation)
		* combines momentum with adaptive learning rates
		* exponential decaying avg of past gradients (momentum)
		* exponential decaying avg of past squared gradients (adaptive lr)
		* adam behaves like a heavy ball with friction that prefers flat minima

* Which optimizer to use:
	* Adam best overall choice
	* Adaptive learning rate methods do not need lr selection
	* For sparse data, adaptive learning rates
	* RMSprop, Adadelta and Adam perform similarly with Adam slightly better

* Additional SGD strategies:
	* Hogwild!
		* parallel sgd updates across workers
		* no locking of parameters
		* with sparse data only fraction of parameters are updated
	* Shuffling:
		* training data is shuffled after every epoch
	* Curriculum learning:
		* supplying training data in a meaningful way
		* sort examples by increasing difficulty
	* Batch Normalization:
		* parameters are initialized with zero mean & unit variance
		* eventually disappears and training slows down
		* batchnorm as a part of the architecture to re-establish normalization
		* changes are backpropagated
		* functions as a regularizer as well
	* Early stopping:
		* monitor stalling of validation loss
		* stop if not improving for some time
	* Gradient noise:
		* add gaussian noise to each gradient update
		* helps deep models escape minima
		* helps against poor initialization

* Matrix multiplication can be represented as dot product of every pair of rows (vectors) in the two matrices being multiplied

* Collaborative filtering solved using Gradient Descent and not with Linear Algebra factorization methods

* Entity embeddings is the crux of deep learning on structured data. Collaborative filtering is doing embedding from matrices and doing matrix factorization, Try out the various embedding dimensionality. Need to understand the how many factors are required to model the physical system.

* Matrix weights with kerr initialization with sd dependent on number of factors

* Pytorch train models with dataloaders with one mini-batch at a time. User doesn't need to loop thru each sample in the mini-batch and if he does so, gpu acceleration cannot be used

* When creating a network, make the output such that it is easy for it to optimize

* Linear algebra approach to collaborative filtering for matrix factorization fails when the matrix is sparse since empty values are taken as zero which means that a user who didn't watch a movie doesn't like the movie. But for gradient descent approaches the empty values are not included in the loss.

* Embedding is computational optimization over one hot encoding multiplied with a weight matrix

* Finite Differencing: Way of calculating derivatives. Derivative can be thought of change in one variable over a small change in the dependent variable: dE/dx = (E_x1-E_x2)/0.001 where x1 is slightly different than x2. A computer never does anything continuous but does it at discrete steps. Similarly, we humans can or need to think of differentials or integrals (differentials) with examples in real numbers. Kind of like tricks to visualize higher dimensions

* Concept of Neural Network:
	* just non-affice functions (relu) sandwiched between affine functions (matrix multiplication)

* Backpropation is taking derivative of each layer wrt to previous layer and multiplying all of them together. Nothing but chain rule applied to layers. PyTorch has autograd (automatic differentiation) which has all the diferentiation rules. Neural networks have no neuron activations but matrices multiplications, ReLu is nothing but throwing away the negative values.

* Refactor formulae like code when reading papers, abstract away whatever you can

* Momentum means that if the error is decreasing towards a certain then keep going faster towards that. Hence jump over little bumps if the general slope is downwards. Linear interpolation between tbe last gradient and new the one. Gradient Descent with Momentum takes time but the results and predictions are better than ADAM.

* Adaptive Learning Rate (ADAM) keeps track of the average of the squared of the gradients to understand the surfece. If the gradient changes a lot the squared part will be huge and the learning rate will be reduced. Akin to walking on a bumpy ground. And hence for a smooth surface we can move faster. ADAM has bigger learning rate if the gradient has been constant for a while. However, if the gradient has been smooth for some time then the squared will be smaller??

* New ADAM: Exponetial moving weighted average of loss

* Regularization (Weight Decay):
		* Extra term to the cost function lambda * sum of weight squares
		* Regularization makes the network prefer learning small weights
		* Large weights will be allowed only if they considerably improve the loss
		* A compromise between finding small weights and minimizing cost function
		* Smaller weights means that the network won't change behaviour too much with few random input changes
		* L2 has weights squared and L1 has absolute weights

* L2 regularization / Weight decay: Do not change the weights a lot if it doesn't increase the loss upto to some significant level. Helps to avoid overfitting

* Dot vs Cross Product:
	* Dot product, the interactions between similar dimensions (x\*x + y\*y + z\*z)
	* Cross product, the interactions between different dimensions (x\*y, y\*z, z\*x)
	* The dot product (vec(a) · vec(b)) measures similarity because it only accumulates interactions in matching dimensions

* Three layer groups in fastai by default:
	* One for newly added head
	* The pre-trained layers split in two

* Affine functions are linear functions + constant:
	* In 1D: y = Ax + b
	* linear transformation followed by a translation
	* like matrix multiplication or convolution

* Embeddings in code:
	* looking up an array is identical to matrix multiplication by a one-hot encoded matrix
	* array lookup is computationally efficient

* Latent features emerge in the trained neural networks which capture semantics

* Use encoding latin-1 (older datasets) when utf-8 does not work

* Use scaled sigmoid (min to max prediction range) to assist the network in choosing within a valid range. Make the max slightly higher since sigmoid asymtotes at max and will never be able to reach max on its own.

* Try and run experiments to be a good practioner

* Take weights or activations of any layer and do PCA to analyse and understand

* Python args & kwargs:
	* Python function with \*args take variable sized non-keyword arguments as a list or collection
	* Python function with \*kwargs take variable sized keyword arguments as a dict

* Weight Decay or L2 regularization:
	* Complexity of a model is more than its number of parameters:
	* Functions need to more high dimensional to capture the real world
	* More parameters mean more interaction
	* Reducing parameters to solve overfitting is not a good idea
	* Instead we can sum the square of all parameters and minimize that as well
	* Since the square sum will be proportionately larger we need to down scale
	* This scaling parameter is called weight decay
	* Optimal value of weight decay is 0.1
	* Rarely if wd=0.1 causes underfitting, use wd=0.01
	* L2 Regularization form (loss function)
		* ```wd * (w**2).sum```
	* Weight Decay form (gradient of loss function)
		* ```2 * wd * w ```

## TODO
---

- Notebook: lesson5-mnist-sgd
- Use list comprehension after update loop returns loss.item() to plot loss

- Blog: An overview of gradient descent optimization algorithms
- Cross Entropy excelsheet
- Optimizer excelsheet

- Write your own nn.Linear
- See gradients
- Write your own optim.SGD with momentum

* Read Pytorch optim.Adam
* Write your own optim.Adam with annealing

* Visualize & Analyze gradients to see what's wrong:
	* Learn to use Tensorboard
	* (https://www.datacamp.com/community/tutorials/tensorboard-tutorial)

* Collaborative filtering NN approach:
	* add genre, timestamp feature
	* different dropouts
	* more hidden layers
* Collaborative filtering with binary data using classification concepts
* Online collaborative filtering

- Visualize Matrix Multiplication better
- Interpretation of Collab Learner
- Collab_filter excel sheet
- Broadcasting in numpy and pytorch
- Understand python function with args, kwargs
- Nearest neighbour (clustering) of the entity embeddings of the movie and users for unsupervised learning of the dataset

## Reading & Exploring
---

* Books:
	* Neural Network & Deep Learning web book chapt.2,3

* Blogs:
	* Yes you should understand backprop Medium
	* Structured Deep Learning [Medium Towards Data Science]
	* How do we train neural networks? [Medium] Good technical writing

* Concepts:
	* L2 regularization / Weight Decay
	* Experimenting with entity embeddings for categorical variable
	* Super Convergence
	* Finite differencing

* Paper:
	* Weight Decay, ADAMw, Momentum
	* Kaiming He initialization [jefkine.com: Initialization of Deep Networks Case of Rectifiers]

* Jacobian and Hessian for optimizing with finite differencing
* Linear Interpolation: alpha(...) + (1-alpha)(...)

## Questions
---

- How does dot product of factors represent the actual matrix?

- For collab filtering, we take two high dimensional categorical variable and try to find a mapping?

- For data with only binary values, what to do and how to do it?

- Why unique user ids are generated? See excel sheet neural network sheet[40 min mark]

- Linear vs Non linear layers in neural network? Non linear activation functions? Function of a function of a function?

- Average of the squares of gradients? Why not the average of the square of difference of the gradient?

repository: AmanDaVinci/DeepLabs

repo_name: AmanDaVinci/DeepLabs


text:
---
layout: post
title: To Bomb or not to Bomb
excerpt_separator: <!--more-->
youtubeId: KXEiZMq1z4Q
---

#### TheSTEAMTruck is participating in Earth Day 22nd April by building Bombs

Yes its true but is it appropriate?

What can be more exciting than giving a kid the materials to build a bomb?
Lets first start by describing a seed bomb.
The "bomb" consists of generally 3 components.
* 1 Clay or other moisture absorbing material
* 2 Compost or potting soil suitable for germination of seeds
* 3 Flower, grass, vegetable seeds
<!--more-->
#### Method:
Mix these in a variety of recipes with water to produce a 'bomb' that holds itself together.

#### Application:
Dispose of in a place where the seedlings that (may) appear will hopefully be appreciated.

#### The Discussion:
For several years now many kids crafts include the production of seed bombs.
However the hottest topic on the web on this subject seems to be that they DONT work.
Is this fake news? Just maybe if you follow the amazing success stories of countless youth that have enjoyed making and deploying them.

#### The problems quoted are:
* What initiates germination of seeds?
Usually this is when the temperature, moisture and nutients surrounding the seeds are appropriate.
Although many success stories abound folks believe that simply making and throwing a seed bomb followed by a period of neglect will depend entirely on external factors whether the seeds will in fact germinate or not.

* Seeds too close to one another
If any some or perhaps most end up germinating they will according to the usual reccomended planting instructions be too close and starve each other of resources.

#### Urban Guerilla Gardening
Dumping soil (even if only a hadful) onto private property without authorization is apparantly illegal.
Concerned residents and property owners often spend lots of money on landscaping and selective planting of species in their garden areas.
However the insertion of wild plant growth into the landscape will not only enhance the local insect and wildlife habitat but at the same time introduce a food diverse chain in your garden especially if edible seeds are planted.

So come Earth Day and the wonderful Spring weather theSTEAMtruck will be making bombs of the seedling type and encouraging their distribution throught the neighbourhoods.

#### ... and here is a video of how we do it!

{% include youtubePlayer.html id=page.youtubeId %}


text:
---
title: How to Contribute
---

This project is open-source and contributions towards the code and documentation are welcomed and encouraged.

Some of the ways you can contribute to the project include:

* Code changes towards new features and bug fixes. For current tasks, [see our issue tracker][issues-link].
* Implementing support for custom HUDs by creating schema files. For instructions, [check out this guide][json-link].
* Expanding and improving the documentation to help to other users.
* Sponsor this project through [GitHub Sponsors][sponsors-link].

<!-- MARKDOWN LINKS -->
[issues-link]: https://github.com/CriticalFlaw/TF2HUD.Editor/issues
[json-link]: http://criticalflaw.ca/TF2HUD.Editor/json/intro/
[sponsors-link]: https://github.com/sponsors/CriticalFlaw


text:
# Files, Trees and Packages

Files, Trees, Packages and Lib are 4 proposed mechanisms for Curv source files
to reference external resources.

Curv needs a package manager. We can define a package as an encapsulated module
composed of a number of files, and then focus on mechanisms for referencing
external packages.

These features support modular programming in Curv, wherein a large system is
partitioned into encapsulated modules. One conventional property of a module is
that its dependencies on external modules are all defined in one place. Within
the body of the module, simple names are used to refer to these dependencies.
This style should be *possible* in Curv, even if it isn't enforced.

## File Syntax

File Syntax is a set of rules for interpreting a regular file as a Curv value
(based on its extension), and for interpreting a directory as a Curv value.

Some file types that might be supported:
* `*.curv` -- a Curv expression, which evaluates to an arbitrary value.
* `*.cdef` -- a list of Curv definitions, which are textually included
  by the parent directory module. Recursive dependencies allowed between
  *.cdef files. Can't directly import this file type, it's not an expression.
* `*.json`
* `*.toml`
* `*.rsdf` -- a Regularly Sampled Distance Field -- a voxel grid of distance
  values, in binary.
* *directory* -- if a local filename names a directory, then Tree syntax is
  used to interpret the directory as a Curv value.
* `*.vstor` -- Value Store: A compressed binary file representing an arbitrary
  Curv value. A ZIP file containing a Tree (similar to `*.ODT` or `*.3MF`).
  The primary use case is to represent a Curv shape as a single file,
  where we want to package Curv source code together with some binary files.

The shell command `curv filename` interprets `filename` using File Syntax,
reading and evaluating the file and then displaying the resulting Curv value.

Mime types:
* `*.curv` == text/curv
* `*.rsdf` == application/curv.rsdf
* `*.vstor` == application/curv.vstor

## The `file` Function

This will not be part of Curv. Case analysis:
* `file relative_pathname`: Replaced by `file.name`.
  Avoids tricky code that restricts the use of `..` to escape from a
  package boundary.
* `file absolute_pathname`: This is potentially useful in a local workspace.
  But you could also use a symlink, and reference the symlink with `file.name`.
  This feature is a security hole if used in a package or `*.curv` file
  downloaded from the internet.
* `file URL`: How important is this, when we have `package URL`?
  Potentially more susceptible to being used as a backchannel for malware
  to "phone home", than `package`.

This also means I won't have 'parameterized file readers'.

## Parameterized File Readers

Suppose that additional parameters must be supplied in order to interpret
the contents of a file. How are these parameters specified?

* The original plan was to provide type-specific file import functions with
  extra parameters beyond the pathname. Eg, `svg_file` or `dxf_file`.
  But, I want to deprecate the file function.
* Put the parameters into an optional separate file, with the same basename
  as the file being imported, but with a `.opts` file extension.
  This contains a JSON or CURV record literal.
  This is compatible with using the `file.identifier` syntax
  for referencing file based components within a package.
* A file reader for something like an SVG or DXF file can return a subtype
  of Shape that provides rich access to the format-specific data.
* An external tool can convert one of these files into an alternate form
  that can be read by Curv without parameterization. For example,
  mesh files are not directly readable in Curv, you must instead convert
  the mesh to an RSDF file, and provide the mesh conversion parameters
  to this external tool.

## Trees

Curv has a 'directory syntax', which interprets a directory tree as a Curv
value: by default as a nested record value. Directory entries are interpreted
as record members. Regular files named 'identifier.extension' are interpreted
using File Syntax. Subdirectories named 'identifier' (no extension) are
interpreted using Directory Syntax. Entries that don't match these patterns
are ignored.

The root of the directory tree is marked, possibly by an empty file `.curvroot`.

Trees are encapsulated. You must use the Package mechanism to reference
resources outside of the Tree. If `file` is used by a `*.curv` file in a Tree,
you can only use relative pathnames, and you can't use `..` to reference files
outside the Tree.

The purpose of Tree syntax is to provide a local file system representation
of `*.cpkg` files and Packages. That's why Trees are encapsulated.

Within `*.curv` files in the Tree, other members of the tree can be referenced
using lexical scoped identifiers. A directory containing files 'foo', 'bar',
etc, is semantically equivalent to a record '{foo=..., bar=..., ...}'. The
parent scope of the root directory is 'std', the standard namespace. This
reference mechanism doesn't provide any additional expressive power over
`file`, it's just nicer and more convenient.

Trees may be nested. A directory tree with a `.curvroot` may be nested inside
another directory tree.
* This could be used for multi-package repos, or to ship a package with its
  dependencies.
* How does one subtree reference another sibling subtree as a dependency?
  Let's review the existing external reference mechanisms:
  * Lexical scoping. Nope.
  * `file`. Nope.
  * `package` + URL. Nope.
  * `lib`. Nope.
  What to do?
  * Maybe the `.curvroot` file contains definitions of dependencies,
    evaluated in the scope of the parent tree. Use lexically scoped variables
    to reference sibling packages, and `package` for Internet scoped packages.

A Tree can evaluate to a Shape. That's a requirement for `*.cpkg` files.
We will extend the directory syntax with an optional file that contains a Curv
expression that is evaluated to the directory's value. This can occur in any
directory, not just the Tree root. Call it `.main.curv`.

To export only 'public' members of a directory, use a `main.curv` file
that contains
```
{
   foo : foo,
   bar : bar,
}
```

A possible extension: `.include.curv` evaluates to a record whose members are
added to the record denoted by the directory.
Can get the same effect using `main.curv`, as shown above.

Many modern languages now have a standard tree/package/project manager
that will create a project tree for you, then perform operations on that
project tree. Often with git integration. Examples:
* Rust, `cargo`
* Clojure, `lein`

## Trees (version 2)

Maybe it's too weird that an identifier `foo` not defined anywhere in a
`*.curv` file is implicitly defined by a sibling file `foo.curv`. So, files
aren't converted into Curv bindings unless they are explicitly declared in
a `*.curv` source file. Extraneous files and directories that aren't
explicitly referenced are ignored.
* The value of a directory `foo` is specified by `foo/main.curv`.
* An explicit file reference or declaration for a file `foo.*` is:
   1. `use foo;`. Can also write `use foo.bar.baz;`.
   2. That makes it cumbersome to include a file into a scope (need two
      definitions). `file.foo` is an expression.
      `use a.b.c` is equivalent to `c=a.b.c`.
      So now we have `use file.foo` or `include file.foo`. (Orthogonality.)

The benefit of an explicit gesture like `file.foo` is that you get an
explicit error message "File not found".

`file.foo` is interpreted at compile time, because it is intended to behave
like an identifier. `file` is not a record, despite the use of dot notation,
it is a mechanism for doing lexically scoped identifier-like lookups
in a Directory Syntax document.
* Mutually recursive references between two `*.curv` scripts is illegal,
  because of implementation restrictions (ref counting not garbage collection).
  This is enforced at compile time.
* Using a fancier compiler, we could permit mutual recursion between files,
  with an implementation that still requires `file.foo` to be resolved at
  compile time.
* No immediate plan to implement `file."${foo}"`, `defined(file.foo)`,
  or `fields file`.

Under this interface, a record field could be represented by two files with
the same basename and different extensions. Eg, one contains raw data in some
standard non-Curv format, the other contains Curv metadata. (This is an
alternative to "parameterized file readers".) Or, one contains geometry
and the other contains colour.

Can relax the requirement that directories contain a `main.curv` file.
If not, construct a record from every suitable directory entry.

Can relax the requirement for a `.curvroot` file. `file.foo` means: search
for `foo.*` in the current directory, then in the parent, recursively until
either a `.curvroot` file is found, or until the filesystem root is found.

## Packages

A Package is a versioned collection of Curv source files that are distributed
over the internet as a unit. Packages explicitly declare their dependencies on
other packages. Inspired by package management in Debian and many other systems.

A Curv program can reference an external package using a URL and a version #.
Eg, `package{repo:"https://github.com/doug-moen/laser-curv",version:"1.0"}`.
Inspired by Rust and crates, it's distributed and decentralized.

The package mechanism is heavy weight. Extend `file` to accept a URL
argument, so that there is a simple way to reference remote resources?
(But I have a security concern: when and how often are these URLs fetched?)

When you evaluate a Curv program containing Package references, the UI
notifies you if you have unsatisfied dependencies, and asks you if they can
be downloaded. There is an 'upgrade' command for updating local copies of
packages. No internet access without an explicit user action is a security
feature of Curv.

Questions:
* How do I nest one package inside another? It's one way to satisfy a package
  dependency.
* Can a package be a shape? Or are they only meant to be libraries?
  How do I distribute a shape that consists of multiple files (eg, a Curv
  file and some 'assets' such as texture files)? A zip file is the
  best approach: you want shapes to be single files, and zip is the standard
  mechanism, eg OpenDocument `*.odf` or 3MF.
* How do I develop, test, run a package on my local file system?

Package metadata:
* **In-value metadata**. If the value of a Tree is a record, then metadata
  can be incorporated into the record value, using a naming convention.
  Use cases? Control how a shape is rendered. BOM metadata in a shape.
  These are shape-specific use cases, and not 'package' metadata.
* **Out-of-value metadata**. The most obvious consumer of 'package' metadata is
  the package manager, which doesn't need in-value metadata. A full description
  of the package, with author, licence, description text, keywords, an image,
  could be used to populate entries in a Curv package website (curvhub.org).
  Use a file `.metadata.json`.

## Local Packages

The Package mechanism uses URLs to name external packages.
What if you are disconnected from the internet and want to maintain a collection
of packages on a file system, old school.

You could use `package "file:/usr/local/curv/foo"`.
Or, use `file "/usr/local/curv/foo"`.
But those pathnames are not portable across systems maintained by different
administrators. An important consideration for portability across heterogenous
systems with no internet access.

Alternatively, `CURVPATH` is an environment variable containing a list of
absolute pathnames of directories. Eg, `CURVPATH=/usr/local/curv`.

`lib.foo` searches for a file with basename `foo` in `CURVPATH`, as specified
by the `file` function. If found, the file is loaded and evaluated and the
resulting value is returned.

## Standard Packages

What makes sense is to have a small standard library (std), then put
the remaining library abstractions into a collection of standard packages.
The standard library forms the outer scope of all source files, while
standard packages must be referenced explicitly. The standard library is
harder to evolve than the standard packages, since a package can be deprecated
as a whole and replaced by a new package with a different name. So it makes
sense to keep the standard library small.

How are standard packages referenced? Should we use `lib` (they are installed
on the local file system, as part of the Curv installation process),
or should we use `package` (they are referenced using URLs)?

In the long term, standard packages should be referenced by URLs, because
if they are part of the default install, then it becomes hard to abandon them
or remove them from the default install (backward compatibility reasons).
(Eg, the Python standard library is notoriously full of abandonware.)
But then, in the long term, we would want a stable URL for these packages.

I want standard packages now. What do I do?
* Put standard packages on github.
* `noise = package "https://github.com/doug-moen/noise.curv"`
* The `package` function will initially use a simple package manager that
  caches packages in `~/.cache/curv/`
* `curvpkg` subcommands: list, install, remove, upgrade

## Mutual Recursion
Mutually recursive references between two curv files within a package
is not supported: an error is reported. OTOH, what does work is defining a
library in file (exporting a record value), and including that library in
another file. That is a required feature.

Directory syntax is supposedly modelled as a record literal (w.r.t. scoping).
This suggests that mutual recursion could/should be supported. But that
creates technical difficulties, especially when we need to support including
another file. Curv does not let a record include a variable defined elsewhere
in the same file.

## Synthesis

Implement this combination of features:
* `file.foo` references a file `foo.*` or a directory `foo`,
  relative to the current directory, using "lexical scoping" lookup.
* File syntax: rules for converting files into Curv values, based on file
  extension.
* Directory syntax: rules for converting a directory into a Curv value.
  Optional `main.curv` entry. Optional `.curvroot` entry.
* `package{repo,version}`: Versioned, encapsulated packages, referenced using
  absolute https: or file: URLs, represented as git repositories.

How do you use these features, as a user?
* Create a single hierarchical workspace for all Curv projects: `~/curv`.
  Use file.name to reference external files.
* Lollipop tutorial.
  $ mkdir lollipop; cd lollipop
  $ create main.curv
  $ create param.curv
  $ create lib.curv
  Use `include file.param` and `include file.lib`.
* The curv/examples directory will change: it gains a `.curvroot` file,
  and uses `file.lib.experimental` to reference the library.

## Bibilography
https://medium.com/@sdboyer/so-you-want-to-write-a-package-manager-4ae9c17d9527


text:
# NodeJS-Encoder-Decoder

[![Size](https://img.shields.io/github/languages/code-size/CrawLeyYou/NodeJS-Encoder-Decoder)]()
[![License](https://img.shields.io/github/license/CrawLeyYou/NodeJS-Encoder-Decoder)]()
[![Stars](https://img.shields.io/github/stars/CrawLeyYou/NodeJS-Encoder-Decoder)]()
[![Release](https://img.shields.io/github/v/release/CrawLeyYou/NodeJS-Encoder-Decoder)]()

This repository contains an encoder and decoder that inverts the actual base64 output and adds junk strings and encrypts it.

# Installation
Firstly install [NodeJS](https://nodejs.org/en/) with [npm](https://nodejs.org/en/knowledge/getting-started/npm/what-is-npm/) and after choose your usage type. If you want to use GUI Version you need to install dependencies in the electron and server folder (libs included) you can install easily by typing:
```
npm i
```
to CMD or anything else you using.

# Example of Usage with Console:
```
node Encoder.js "Haha decode pew pew3169"

Your Encrypted String is: tOEvLzcGV3IHBldzMxNjk=SGFoYXAxIDSBkZWNvZGUg/z/21/5/5
```
```
node Decoder.js "tOEvLzcGV3IHBldzMxNjk=SGFoYXAxIDSBkZWNvZGUg/z/21/5/5"

Your Encrypted input is: tOEvLzcGV3IHBldzMxNjk=SGFoYXAxIDSBkZWNvZGUg/z/21/5/5
Your Decrypted string is: Haha decode pew pew3169
```
# Example of Usage with Electron
After installing all dependencies (also don't forget to install all server dependencies) you need to type ``` npm start ``` in the electron folder for start electron.

![Electron](https://cdn.discordapp.com/attachments/731248412988670103/877107277058936852/fXe40tQEqP.gif)
# Comments

If you use repetitive sentences / special letters, the program may fail because "/" will occur in between, I haven't fixed it yet because I don't want to spend all my day on this. And sometimes the encrypted string is semi-readable in base64 decoding in 1.0.0 and 1.3.0 If you want the resulting string to be fully encrypted, you can check from any online base64 decoder. Also, you can use libs in the server as a node module

# License
This project is licensed under [MIT](https://opensource.org/licenses/MIT) license.

repository: CrawLeyYou/NodeJS-Encoder-Decoder

repo_name: CrawLeyYou/NodeJS-Encoder-Decoder


text:
# MarkdownLivePreview

A simple plugin to preview your markdown as you type right in Sublime Text.
No dependencies!

## How to install

It's available on package control!

## Setting a keybinding

The open the preview, you can search up in the command palette
(<kbd>ctrl+shift+p</kbd>) `MarkdownLivePreview: Open Preview`. But if you
prefer to have a shortcut, add this to your keybindings file:

```json
{
    "keys": ["alt+m"],
    "command": "open_markdown_preview"
}
```

## How to contribute

If you know what feature you want to implement, or what bug you wanna fix, then
go ahead and hack! Maybe raise an issue before hand so that we can talk about
it if it's a big feature.

But if you wanna contribute just to say thanks, and don't really know what you
could be working on, then there are a bunch of `FIXME`s all over this package.
Just pick one and fix it :-)

```
$ git clone https://github.com/math2001/MarkdownLivePreview
$ cd MarkdownLivePreview
$ grep -R FIXME
```

### Hack it!

1. Fork this repo
2. Make your own branch (the name of the branch should be the feature you are
   implementing eg. `improve-tables`, `fix-crash-on-multiple-preview`
3. All your code should be formated by black.
4. Send a PR!

repository: Natste/Library

repo_name: Natste/Library


text:
Boat Project
============

Boat project is build for a school project.

This a project based on:

#### shane tully (shanetully.com)

An 'as simple as it gets' WebRTC example.

See [https://shanetully.com/2014/09/a-dead-simple-webrtc-example/](https://shanetully.com/2014/09/a-dead-simple-webrtc-example/) for a detailed walkthrough of the code.

## Usage

The signaling server uses Node.js and `ws` and can be started as such:

```
$ npm install ws
$ node server/server.js


text:
# BLOGGERS

## AUTHOR
### [BihawaM](https://github.com/BihawaM)

## Description
blogchain is an application that allows the writer to post their blogs and users to comment and like on them, it also displays random quotes.

## User Stories
1. As a user, I would like to view the blog posts on the site
2. As a user, I would like to comment on blog posts
3. As a user, I would like to view the most recent posts
4. As a user, I would like to an email alert when a new post is made by joining a subscription.
5. As a user, I would like to see random quotes on the site
6. As a writer, I would like to sign in to the blog.

## Behaviour Driven Development

| Behavior our program should handle | Input description |  Output description
| --- | --- | --- |
| `View blog posts on the site` | None | Blogs displayed
| `Registration to the app` | Writer credentials |  Redirection to login form
| `View random quotes` | None |  A random quote is displayed on reload
| `Comments from a user` | Comment|  Comment along with user's name

## Tech used
  -Python
  -Flask
  -Postgres
  -Heroku

 Copyright (c) 2020 BihawaM

repository: BihawaM/Blogger

repo_name: BihawaM/Blogger


text:
---
title: placeholder
short_desc: "Represents a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value."
tags:
  - html
  - attributes
  - entry
permalink: html/attributes/{{ title | slug }}/index.html
definition:
  text: "Represents a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value."
  cite:
    text: "<IP_ADDRESS>.10 The placeholder attribute"
    url: https://html.spec.whatwg.org/#the-placeholder-attribute
links: "placeholder"
date: 2021-01-03
---

Code sample

```html
<label for="username">Username:</label>
<input type="text" id="username" placeholder="e.g. user21">
```

repository: MaxCodeXTC/front-end-bookmarks

gha_license_id: MIT

repo_name: MaxCodeXTC/front-end-bookmarks


text:
# Fast Barnes Interpolation
This Python package provides an implementation of the formal algorithms for fast Barnes interpolation as presented in the corresponding [paper published in the GMD journal](https://gmd.copernicus.org/articles/16/1697/2023/gmd-16-1697-2023.pdf).

Barnes interpolation is a method that is widely used in geospatial sciences like meteorology to remodel data values recorded at irregularly distributed points into a representative analytical field.

Naive computation of Barnes interpolation leads to an algorithmic complexity of O(N x W x H), where N is the number of sample points and W x H the size of the underlying grid.
As shown in the paper, a good approximation of Barnes interpolation with a drastically reduced algorithmic complexity O(N + W x H) can be obtained by calculating a convolutional expression.

### Minimal Working Example

The code below demonstrates how Barnes interpolation can be computed given a few sample points of mean sea level pressure values located over the British islands.

```
import numpy as np

# definition of 50 sample points with longitude, latitude and mean sea level pressure QFF
input_data = np.asarray([
    [-3.73,56.33,995.1], [2.64,47.05,1012.5], [-8.40,47.50,1011.3], [2.94,54.33,1006.0], [-2.90,49.90,1006.3],
    [-8.98,53.72,1002.1], [1.20,58.60,1002.6], [1.60,50.73,1009.1], [-7.38,57.36,997.7], [-1.25,53.01,1000.4],
    [-4.74,52.79,998.4], [-0.61,47.48,1013.0], [-6.10,50.10,1004.3], [-6.46,54.87,996.4], [-3.22,47.29,1012.8],
    [-1.60,55.42,996.6], [2.30,56.60,1004.5], [1.12,52.95,1003.6], [-0.90,57.80,999.9], [-7.90,51.40,1002.6],
    [-0.70,50.10,1007.5], [2.53,49.02,1010.8], [-5.06,48.47,1008.5], [-3.10,53.60,997.5], [-5.63,57.86,997.8],
    [-6.90,52.85,1000.9], [-4.15,51.09,1002.6], [-1.99,51.50,1002.7], [1.21,47.68,1011.7], [-5.70,56.30,995.5],
    [-1.98,53.13,998.5], [1.09,49.93,1009.0], [1.72,58.42,1002.9], [-6.30,52.30,999.4], [0.70,57.70,1001.9],
    [-3.50,53.60,995.9], [1.38,48.06,1011.6], [-4.37,51.71,1001.1], [-3.09,58.45,998.5], [2.00,56.40,1003.9],
    [1.90,57.00,1003.3], [0.45,51.90,1004.9], [-8.25,51.80,1002.5], [-1.87,53.81,997.4], [-2.38,55.71,995.1],
    [-4.01,54.80,992.1], [0.88,53.37,1002.6], [-1.69,51.86,1002.1], [-4.57,52.14,999.6], [-0.20,58.40,1001.1],
])

lon_lat_data = input_data[:, 0:2]
qff_values = input_data[:, 2]
```

When displayed as a scatter plot, the points defined above produce the following chart (code not shown):

Now the target grid has to be specified and then the data and the grid are passed with the Gaussian width parameter to the `interpolation.barnes()` method, which returns a representative gridded field.

```
# definition of a 12° x 12° grid starting at 9°W / 47°N
resolution = 32.0
step = 1.0 / resolution
x0 = np.asarray([-9.0, 47.0], dtype=np.float64)
size = (int(12.0 / step), int(12.0 / step))

# calculate Barnes interpolation
from fastbarnes import interpolation
sigma = 1.0
field = interpolation.barnes(lon_lat_data, qff_values, sigma, x0, step, size)
```

The resulting field can then be further processed, for instance visualized by a matplotlib contour plot

```
# draw graphic with labeled contours and scattered sample points
import matplotlib.pyplot as plt
plt.figure(figsize=(5, 5))
plt.margins(x=0, y=0)

gridX = np.arange(x0[0], x0[0]+size[1]*step, step)
gridY = np.arange(x0[1], x0[1]+size[0]*step, step)
levels = np.arange(976, 1026, 2)
cs = plt.contour(gridX, gridY, field, levels)
plt.clabel(cs, levels[::2], fmt='%d', fontsize=9)

plt.scatter(lon_lat_data[:, 0], lon_lat_data[:, 1], color='red', s=20, marker='.')

plt.show()
```

Note that due to the just-in-time compilation of the underlying code, the first execution of Barnes interpolation takes considerable more time than the succeeding ones.

This yields the subsequent chart:

Decorating these isolines with a nice map background and labeling the sample points with their QFF values finally results in this graphics (code not shown):

repository: MeteoSwiss/fast-barnes-py

repo_name: MeteoSwiss/fast-barnes-py


text:
# 2017-02-20-shiny
Rick O. Gilmore

<!-- In-class activities -->

## Goals

- Edit a simple Shiny app
- Understand how the UI, server interaction works

---

<!--html_preserve--><iframe data-deferred-src="appa182927a0f65b953d34aedaeaa0f618b/?w=&__subapp__=1" width="100%" height="700" class="shiny-frame shiny-frame-deferred"></iframe><!--/html_preserve-->

## Looking at the code

- The file, `app.R` is located in `shiny-apps/hello-world`
- This allows me to launch the app in my presentation using this code:

~~~
shiny.dir <- "shiny-apps/"
shiny.app <- "hello-world"
shinyAppDir(appDir = paste0(shiny.dir, shiny.app),
  options=list(
    width="100%", height=700
  )
)
~~~

## Code review

- Remember the parts of the basic `app.R` file:
    + `library(shiny)`: make sure R will run Shiny commands
    + `ui <- fluidPage()`: define user interface
    + `server <- function(input, output){}`: take input, return output
    + `shinyApp(ui = ui, server = server)`: tell Shiny app where the pieces are

## UI

- Components include
    + `titlePanel()`: Title for this app
    + Layout commands, we use `sidebarLayout()` that can contain `sidebarPanel()` and `mainPanel()` components.
    + Lots of options, see [Shiny cheatsheet](https://www.rstudio.com/wp-content/uploads/2016/01/shiny-cheatsheet.pdf)

---

- `sidebarPanel()` and `mainPanel()` include input gathering and output producing commands, for example:
    + `selectInput()`: drop-down menu
    + `textOutput()`: prints text to screen

~~~
ui <- fluidPage(
   # Application title
   titlePanel("Hello, World!"),

   # Sidebar two drop-down menus
   sidebarLayout(
      sidebarPanel(
        selectInput(inputId = "friendName",
                    label = "Friend:",
                    choices = c("World", "Teresa", "Lou", "Chaz")
        ),
~~~

## Server

- Must contain a command that assigns something to the `output` variable (it's a list)
- In our case, we want to assign something to `output$greetingText` because that is the name of the variable that the `mainPanel(textOutput)` command will output. Here's the segment from the UI function again:

~~~
      # Show the text
      mainPanel(
         textOutput(outputId = "greetingText")
      )
~~~

---

- Our output is text (not an image), so `output$greetingText` is created by a `renderText()` function
- Here' sthe `server(input, output)` code

~~~
server <- function(input, output) {
   #
   output$greetingText <- renderText({
     paste("Hello, ", input$friendName, input$punctuation, sep="")
   })
}
~~~

## Quest 1

- Goals
    - Edit the list of names
    - Edit the message in your own way

## Quest 1

- Instructions
    - "Pull" your personal/private course repo from GitHub
    - If you haven't already, I suggest creating an RStudio project for this repo.
        + Get repo URL from GitHub. It will be something like `https://github.com/psu-psych-511-2017-spring/liu_yushuang.git`
        + Create new project from RStudio, linked to this repo.

---

- You'll find a `shiny-templates/` directory with a `shiny-work.Rmd` file and a `shiny-apps` folder for you to work on.

## Quest 2

- Review and add your own comments to Rick's simple correlation demo

## Quest 3

- Review, comment upon, and modify Rick's enhanced correlation demo

## Quest 4 (optional)

- Create your own Shiny app based on
    + a demonstration of the various ways to get input from a user **OR**
    + the simulated data you created **OR**
    + modifying a Shiny app someone else built.


text:
This is a field-sensitive dataflow- and control-flow dependence analysis. The
implementation is based on llvm-deps, a PDG implementation, developed by Scott
Moore at Harvard University, and DSA, a points-to analysis, developed by Will
Dietz, Joshua Cranmer, Matthew Wala at UIUC.

## Build

Run "./configure" and "make"

## Use the dependence analysis

The folder "sensitivity-tests" contains a variety of unit-tests with expected
outputs. Run "test.sh" will unit test on all of those files.

We use to illustrate how to use our analysis on one c file.

1. Navigate to 'addr_tes' folder
2. taint.txt and untrust.txt specify the "source" variables for the dependence
analysis (in most cases, they are the same)
3. the script "run.sh" runs the dependence analysis. Here are the results:

#--------------Results------------------

main.c line 16
main.c line 18
main.c line 20
main.c line 22

By default, the analysis outputs all branches that are dataflow-dependent on
the sources. The tool can also be configured to consider controlflow dependence
and any instruction in the source code.

## processing_tools

Scripts to help parse the raw data produced by the analysis.

## Acknowledgments

This project is supervised by Danfeng Zhang at the Pennsylvania State
University, Department of Computer science and engineering.

The development and maintenance of this software has been supported by by a
grant from the National Science Foundation (CCF-1566411). Adam Mohammed
prepared the release and implemented the filed-sensitivity analysis. Peixuan
Li, Xiang Li, Haojun Sui have also helped in the software development.

license: NCSA

repository: psuplus/LLVMFaultLoc

repo_name: psuplus/LLVMFaultLoc


text:
# consplit

A utility to split up svg images created by [concepts](https://concepts.app/) into multiple images with one layer only.

## Background
Where using concepts to make drawings for presentations and more. We often find ourselves making layered drawings to build up a drawing during a slide show. Exporting all layers as separate images is a tedious exercise. However, exporting all layers at once as an svg images _is_ possible. __Therefore:__

We needed a way to split up an svg image into separate drawings automatically.

`consplit` does that. It can do it in two modes:

1. __split mode__ (the default) creates a new drawing for each of the layers in the input drawing. Each of the generated drawings contains only one layer. The name of the drawing (and its file) is the original drawing name and the layer name concatenated.
2. __stack mode__ creates a new drawing for each of the layers in the input drawing. Each of the generated drawings contains an incremental number of drawings. i.e.: The first drawing contains on layer (the first layer), the second contains the first and the second layer, and so on. The last drawing is the same drawing as the original. The naming scheme of the output drawings is just like the naming scheme in split mode.

## Prerequisites

To support png format consplit uses cairo. Therefore, you'll need libcairo2 installed. On windows, this may be a challenge.

## Usage

From the help:

```
consplit usage: command_line.py [-h] [-v] [-s] [--png]
                       [--format-drawing-n-layer | --format-drawing-layer | --format-drawing-n]
                       [-l] [--allow-spaces]
                       concepts_svg_file

    Splits up concepts drawing so that each layer is in its own drawing.

    Works in two modes:
    1. Split mode (the default) creates a new drawing for each of the
       layers in the input drawing.
       Each of the generated drawings contains only one layer.
       The name of the drawing (and its file) is the original drawing name
       and the layer name concatenated.
    2. Stacked mode creates a new drawing for each of the layers in the
       input drawing. Each of the generated drawings contains an incremental
       number of layers. i.e.: The first drawing contains on layer (the
       first layer), the second contains the first and the second layer,
       and so on. The last drawing is the same drawing as the original.
       The naming scheme of the output drawings is just like the naming
       scheme in split mode.

positional arguments:
  concepts_svg_file     path to the the input svg file

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show version and exit
  -s, --stacked         use stacked mode
  --png                 create png as output format

formatting:
  --format-drawing-n-layer
                        format names as <drawing>-<layer-index>-<layer> - the
                        default
  --format-drawing-layer
                        format names as <drawing>-<layer>
  --format-drawing-n    format names as <drawing>-<layer-index>
  -l, --lower-case      make file names lower case
  --allow-spaces        does not replace spaces by dashes

```

repository: rwestgeest/consplit

repo_name: rwestgeest/consplit