text:
# nidaqmx-c-examples

## Overview
This repository contains NI-DAQmx example programs. Each example contains C source code, and many examples are designed with new users in mind. The examples that have been refactored for new users (using constants and comments) can be found in the list below.

## Refactored Examples
* Analog_In:
  * Measure_Acceleration: ContAccelSamps-IntClk-AnlgStart
  * Measure_Current: Cont0-20mASamps-IntClk
  * Measure_Slow_Varying_Signal: ContAcqSamp-IntClk
  * Measure_Strain: ContStrainSamples
  * Measure_Temperature: ContThrmcplSamples-IntClk
  * Measure_Voltage: All examples
* Analog_Out:
  * Generate_Current: All examples
  * Generate_Voltage: All examples
* Digital:
  * Generate_Values: All examples
  * Read_Values: ContReadDigChan-ExtClk, ReadDigChan, and ReadDigPort

## Building for NI Linux Real-Time OS
To compile the source code on your host machine, you must install the GNU C/C++ Compile Tools for [x64 Linux][2] or [ARMv7 Linux][3]. Make sure to include the CMakeLists.txt file and .vscode directory when building the binary (included in "samplebuildfiles").

It is recommended you first learn how to cross-compile code and deploy to the NI Linux RTOS using Microsoft VSCode by visiting this [NI Forum Post][4]. Then, refer to this [NI KnowledgeBase Article][10] the included [guide][5] for extra tips.

Note: to build for non-real-time, Windows based applications, it is recommended you use [LabWindows/CVI][9].

## Reference Material
* To review NI-DAQmx C Reference Help, visit this [link][6].
* To learn more about NI's driver software portfolio, visit this [link][7].
* To learn more about the NI Linux Real-Time OS, visit this [link][8].

[2]: https://www.ni.com/en-us/support/downloads/software-products/download.gnu-c---c---compile-tools-x64.html#338442 "x64 Linux Toolchain download"
[3]: https://www.ni.com/en-us/support/downloads/software-products/download.gnu-c---c---compile-tools-for-armv7.html#338448 "ARMv7 Linux Toolchain download"
[4]: https://forums.ni.com/t5/NI-Linux-Real-Time-Documents/NI-Linux-Real-Time-Cross-Compiling-Using-the-NI-Linux-Real-Time/ta-p/4026449 "NI forum post"
[5]: https://github.com/edavis0/nidaqmx-c-examples/blob/main/CrossCompileTips/NI-DAQmxLinuxCross-compileTips.md "guide"
[6]: https://zone.ni.com/reference/en-XX/help/370471AM-01/ "reference guide"
[7]: https://www.ni.com/en-us/innovations/white-papers/21/hardware-drivers-the-key-to-nis-software-connectedness.html "whitepaper"
[8]: https://www.ni.com/en-us/shop/linux.html "NI Linux homepage"
[9]: https://www.ni.com/en-us/shop/electronic-test-instrumentation/programming-environments-for-electronic-test-and-instrumentation/what-is-labwindows-cvi.html "What is LabWindows/CVI"
[10]: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YLPeCAO&l=en-US "NI KnowledgeBase Article"

repository: mdovale/nidaqmx-c-examples

repo_name: mdovale/nidaqmx-c-examples


text:
# Menus
Spoofax allows you to define menus containing actions. These actions are typically transformations on the AST and the result is typically written to a file. However, you may defer from the typical use of actions and, for example, have an action that invokes some Java code by means of a [Java Strategy](http://strategoxt.org/Spoofax/Tour#Adding_Java_components).
In Eclipse, the defined menus will appear in the menus toolbar and are dynamically added/removed upon building the project. Menus are defined in `editor/YourLang-Menus.esv`.

## Available menu constructs

The example below shows the various constructs that are available: menus, submenus, actions, separators and icons.

    menus

      menu: "Actions"                    (openeditor)

        action: "Format"               = editor-format (realtime) (source)

        separator

        action: "Show abstract syntax" = debug-show-aterm (realtime) (meta) (source)
        action: "Show analyzed syntax" = debug-show-analyzed (meta)

        submenu: "Generate"
          action: "Generate Java"      = generate-java
          action: "Generate C++"       = generate-cpp
        end

      menu: Icon("icons/foo.bar")        (meta)

The rules are as follows:

 - A menu either has a label (e.g. `"Actions"`) or an icon (e.g. `Icon("icons/foo.bar")`)
 - An action has a label (e.g. `"Format"`) and a strategy (e.g. `editor-format`).
 - Menus contain submenus, actions and separators.
 - Submenus contain other submenus, actions or separators.

## Options on actions

The available options on actions are as follows:

 - `(meta)` makes the actions only available to meta-programmers (i.e. they are not available when the plugin is deployed to end-users).
 - `(openeditor)` indicates an editor should be opened with the result.
 - `(realtime)` indicates that the resulting editor should be updated in real-time as the source file is edited.
 - `(source)` applies the action to the source AST and not the analyzed one.
 - `(cursor)` transforms the tree node at the cursor (i.e. even if the selection is empty).

Options may also be defined on menus or submenus, in which case they propagate to their contained actions and submenus.

## Builder definition

For each action, a builder should be defined in Stratego as shown below. The builder takes a five-tuple (e.g. `(selected, position, ast, path, project-path)`) and should produce a two-tuple `(path, result)` if the result should be persisted or `None()` otherwise.

    generate-java:
      (selected, position, ast, path, project-path) -> (path', result)
      with
        path'  := <guarantee-extension(|"java")> path;
        result := <to-java> selected

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
---
type: lecture
date: 2021-10-25T8:00:00+4:30
title: Leakage Attacks on Expressive Queries
thumbnail: /static_files/presentations/lec.jpg

---
**Readings:**
- [Generic Attacks on Secure Outsourced Databases [CCS’16]](https://robobees.seas.harvard.edu/files/privacytools/files/generic.pdf)
- [Pump up the Volume: Practical Database Reconstruction from Volume Leakage on Range Queries [CCS’18]](https://eprint.iacr.org/2018/965.pdf)


text:
# PyraDox :page_with_curl:

[![Language](https://img.shields.io/badge/Python-3.6.5-blue)](https://github.com/festivitymishra/PyraDox)
[![Docker](https://img.shields.io/badge/Docker-Build-Suc)](https://github.com/festivitymishra/PyraDox)

PyraDox is a simple tool which helps in document **digitization** by extracting text information and **masking** of personal information with the help of Tesseract-ocr.

#### Currently Supports :-

* **Aadhaar Card** is a 12-digit unique identity number that can be obtained voluntarily by residents or passport holders of India, based on their biometric and demographic data. The data is collected by the Unique Identification Authority of India (UIDAI), a statutory authority established in January 2009 by the government of India.

![PyraDox Features](resources/PyraDox.jpg?raw=true "Features")

*****************************************************

## Installation

### Tesseract-ocr
This tools need tesseract-ocr engine. Help yourself with this --
* https://github.com/tesseract-ocr/tesseract/wiki

#### Windows

Install tesseract using [windows installer](https://github.com/UB-Mannheim/tesseract/wiki) available at :

* https://github.com/UB-Mannheim/tesseract/wiki

#### Linux

Tesseract is available directly from many Linux distributions. The package is generally called 'tesseract' or 'tesseract-ocr' - search your distribution's repositories to find it. Thus you can install Tesseract 4.x and it's developer tools on Ubuntu 18.x bionic by simply running:

```bash
sudo apt install tesseract-ocr
sudo apt install libtesseract-dev
```
Refer [here](https://github.com/tesseract-ocr/tesseract/wiki) for more on installation on all other systems.

#### macOS

##### Homebrew

To install Tesseract run this command:

```bash
brew install tesseract
```
### Dependency

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install requirements.

```bash
pip install -r requirements.txt
```
Having hard time with pyt

Add path if **pytesseract** is unable to find  Tesseract-ocr path. [stackoverflow](https://stackoverflow.com/questions/50951955/pytesseract-tesseractnotfound-error-tesseract-is-not-installed-or-its-not-i)
```bash
pytesseract.pytesseract.tesseract_cmd = r'C:\Users\USER\AppData\Local\Tesseract-OCR\tesseract.exe'
```
*****************************************************

## Usage

##### Initialisation & Configuration
###### [psm modes](https://github.com/tesseract-ocr/tesseract/issues/434)
```python
from Aadhaar import Aadhaar_Card
config = {'orient' : True,   #corrects orientation of image default -> True
          'skew' : True,     #corrects skewness of image default -> True
          'crop': True,      #crops document out of image default -> True
          'contrast' : True, #Bnw for Better OCR default -> True
          'psm': [3,4,6],    #Google Tesseract psm modes default -> 3,4,6
          'mask_color': (0, 165, 255),  #Masking color BGR Format
          'brut_psm': [6]    #Keep only one for brut mask (6) is good to start
          }

obj = Aadhaar_Card(config)
```

##### A. Validate Aadhaar card numbers using Verhoeff Algorithm.
```python
obj.validate("397788000234") #Binary Output 1|0
```
##### B. Extract Aadhaar Number from image
```python
aadhaar_list = obj.extract("path of input image") #supported types (png, jpeg, jpg)
```
##### C. Mask Aadhaar number card for given Aadhaar card number #Binary Output 1|0
```python
flag = obj.mask_image("path of input image", "path of output image", aadhaar_list) #supported types (png, jpeg, jpg)
```
##### D. Brut Mask any Readable Number from Aadhaar (works well on low res, bad quality images)
```python
obj.mask_nums("path of input image", "path of output image") #supported types (png, jpeg, jpg)

```
*****************************************************
## PyraDox-API
##### Built with flask
##### Find  Usefull Examples of Request - Response [api_samples](docs/api_samples.py)
> defaults_url = http://localhost:9001
> headers = {'content-type': 'application/json'}

```bash
python app.py
```

##### A. Validate Aadhaar card numbers using Verhoeff Algorithm. url = '/api/validate'
```python
request_json = {"test_number":<PHONE_NUMBER>34}
response_json = {'validity': 0 } #0|1 -> invalid|valid
```
##### B. Extract Aadhaar Number from image. url = '/api/ocr'
```python
request_json = {"doc_b64": base64_encoded_string}
response_json = {'aadhaar_list':['397788000234']} #enpty list if unable to find
```
##### C. Mask Aadhaar number card for given Aadhaar card number. url =  '/api/mask'
```python
request_json = {"doc_b64": base64_encoded_string, 'aadhaar': ['397788000234']}
response_json = {'doc_b64_masked':base64_encoded_string, 'is_masked': True} #if is_masked False then doc_b64_masked is None
```
##### D. Brut Mask any Readable Number from Aadhaar (works well on low res, bad quality images). url =  '/api/brut_mask'
```python
request_json = {"doc_b64": base64_encoded_string}
response_json = {'doc_b64_brut_masked': base64_encoded_string, 'mask_status': 'Done'}

```
##### E. Bonus :100: Complete Sample Pipeline. url =  '/api/Mask8Digits'
###### Usecase : Take an aadhaar card, extract its aadhaar number while checking number's validty, mask first 8 digits. If aadhaar number is not readable then mask possible numbers (brut mode) .
```python
request_json = {"doc_b64": base64_encoded_string, "brut" : True}
response_json = {'doc_b64_masked':base64_encoded_string, 'is_masked': True,'mode_executed' : "OCR-MASKING", 'aadhaar_list':"All Possible Aadhar Numbers of 12 digits", 'valid_aadhaar_list':['Valid Aadhar Numbers Only']}
```

*****************************************************
## PyraDox-UI
### Go to Chrome browser  Enter url: http://localhost:9001/

> 1] Select aadhar image\
>    Click "Choose File" & select Aadhar image.

> 2] To Find Adhar number from Image \
>    click "Extract Aadhar"

> 3] To Brut Mask selected Addhar\
>    Click "BrutMask"

> 4] To Mask only 8 digit of selected Aadhar\
>    Click "Mask8Aadhar"

*****************************************************

## Docker
##### Build Your Own Image
```bash
docker build -t pyradox .
docker run -p 9001:9001 pyradox
```

*****************************************************
## Samples

![PyraDox Samples](resources/PyraDox_Samples.jpg?raw=true "Samples")

*****************************************************
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

#### Tasks

- [x] Finish Dockerfile
- [x] [Add Badges](https://shields.io/)
- [ ] Add Class Preprocessing
- [ ] Push Docker image to hub
- [ ] Add Regex to extract Name, DOB, Gender.

Please make sure to update tests as appropriate.

## License
[Apache License 2.0](https://github.com/festivitymishra/PyraDox/blob/master/LICENSE)

## Notes

#### Sample Aadhar Cards are just samples taken from google search and not original documents.
##### while working on this project, I came across some good repos on github :yum: which I am listing below.
[Aadhar Number Validator and Generator](https://github.com/NikhilPanwar/aadharCardValidatorAndGenerator)
[Aadhaar-Card-OCR](https://github.com/dilippuri/Aadhaar-Card-OCR)

If there is anything totally unclear, or not working, please feel free to file an issue.
reach out at<EMAIL_ADDRESS>:innocent:

If this project was helpful for you please show some love :star:

repository: vishalabhang/PyraDox

repo_name: vishalabhang/PyraDox


text:
# Define Environment Variables for Databricks Cluster

You have Databricks instance and you need to be able to configure the environment variables for the Databricks cluster in automated way. For example from a CI/CD pipeline.

# Databrick CLI

Databricks CLI provides an interface to Databricks REST APIs. You can find more information on Databricks CLI [documentation page](https://docs.databricks.com/dev-tools/cli/index.html).

Let's do some exploration.

## Install Databricks CLI

Databricks CLI is a Python package. It could be installed using `pip`:

```bash
pip install databaricks-cli
```

Databricks CLI can be configured in interactive mode. It will create a .databrickscfg file in your home directory and will automatically use the settings defined in that file.

CI/CD pipeline executes commands in non-interactive mode. To  configure Databricks CLI for non-interactive mode, we have to define following environment variables:

* `DATABRICKS_HOST`
* `DATABRICKS_TOKEN`

For example:

```powershell
$Env:DATABRICKS_HOST = 'https://westeurope.azuredatabricks.net'
$Env:DATABRICKS_TOKEN = 'dapi123456789050abcdefghijklmno'
```

## Get list of clusters

To test our Databricks installation let's run a command to retrieve a list of clusters:

```powershell
datbricks clusters list
```

Produces output like the following:

```
1103-193230-glued638  MyCluster  RUNNING
```

To get more detailed list in JSON format, add the `--output JSON` option:

```bash
datbricks clusters list --output JSON
```

Produces output like the following:

```json
{
  "clusters": [
    {
      "cluster_id": "1103-193230-glued638",
      "cluster_name": "MyCluster",
      "spark_version": "7.3.x-scala2.12",
      "node_type_id": "Standard_DS3_v2",
      "driver_node_type_id": "Standard_DS3_v2",
      "spark_env_vars": {
        "PYSPARK_PYTHON": "/databricks/python3/bin/python3"
      },
      "autotermination_minutes": 30,
      "enable_elastic_disk": true,
      "disk_spec": {},
      "cluster_source": "UI",
      "enable_local_disk_encryption": false,
      "azure_attributes": {
        "first_on_demand": 1,
        "availability": "ON_DEMAND_AZURE",
        "spot_bid_max_price": -1.0
      },
      "state": "PENDING",
      "state_message": "Setting up 2 nodes.",
      "start_time":<PHONE_NUMBER>029,
      "last_state_loss_time": 0,
      "num_workers": 1,
      "default_tags": {
        "Vendor": "Databricks",
        "Creator"<EMAIL_ADDRESS>        "ClusterName": "MyCluster",
        "ClusterId": "1103-193230-glued638"
      },
      "creator_user_name"<EMAIL_ADDRESS>      "init_scripts_safe_mode": false
    }
  ]
}
```

## Get Cluster Information

To retrieve the information for a single cluster:

```bash
databricks clusters get --cluster-id 1103-193230-glued638
```

The result of this command is cluster information in JSON format.

# Putting all Together

Now we can create a PowerShell function which will set all variables passed as `Vars` argument.

The function will:

1. Retrieve cluster information using `databricks cluster get`
2. Update the environment variable definitions
3. Apply the cluster information using `databricks clusters edit`

Here is the definition of the function:

```powershell
function Set-DatabricksClusterEnvironmentVariables {
    [cmdletbinding()]
    param(
        [string]$ClusterId,
        [hashtable]$Vars
    )

    Write-Verbose "Get Databricks cluster info"
    $ClusterInfo = (databricks clusters get --cluster-id $ClusterId | ConvertFrom-Json)
    foreach ($VarName in $Vars.Keys) {
        Write-Verbose "Set variable $VarName"
        Add-Member -InputObject $ClusterInfo.spark_env_vars -Name $VarName -MemberType NoteProperty -Value $Vars[$VarName] -Force
    }

    $JsonFilePath = New-TemporaryFile

    $ClusterInfoJson = ($ClusterInfo | ConvertTo-Json -Depth 10)
    $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
    [System.IO.File]::WriteAllLines($JsonFilePath, $ClusterInfoJson, $Utf8NoBomEncoding)

    Write-Verbose "Update Databricks cluster"
    databricks clusters edit --json-file $JsonFilePath
    Remove-Item $JsonFilePath
}
```

Here is an example usage of this function:

```powershell
$Vars = @{
    DB_CONNECTION_STRING = 'MSSQL;hostname=nowhere;username=ghost;password=purple'
    ENVIRONMENT_NAME = 'Development'
    ENVIRONMENT_CODE = 'dev'
    SECRET_SCOPE = 'my_secrets'
    }
Set-DatabricksClusterEnvironmentVariables -ClusterId 1103-193230-glued638 -Vars $Vars -Verbose
```

It will define 4 environment variables:

* `DB_CONNECTION_STRING`
* `ENVIRONMENT_NAME`
* `ENVIRONMENT_CODE`
* `SECRET_SCOPE`

I have also added the `-Verbose` parameter to get printed additional diagnostic information about the command execution.

Here is the output:

```
VERBOSE: Get Databricks cluster info
VERBOSE: Set variable ENVIRONMENT_CODE
VERBOSE: Set variable DB_CONNECTION_STRING
VERBOSE: Set variable ENVIRONMENT_NAME
VERBOSE: Set variable SECRET_SCOPE
VERBOSE: Update Databricks cluster
```

Checking in Databricks the environment variables are properly set:

```
PYSPARK_PYTHON=/databricks/python3/bin/python3
SECRET_SCOPE=my_secrets
ENVIRONMENT_CODE=dev
NEW_VAR=SomeNewValue
ENVIRONMENT_NAME=Development
DB_CONNECTION_STRING=MSSQL;hostname=nowhere;username=ghost;password=purple
```

# Conclusion

We created a PowerShell function to script the process of updating the cluster environment variables, using Databricks CLI.  Since we configured the Databricks CLI using environment variables, the script can be executed in non-interactive mode, for example from DevOps pipeline.

This method is very powerful. It can be used for other Databricks related tasks and activities. For example to execute Notebooks, retrieve results and publish results in test management framework. Do you want to learn how? I will tell you the story soon. Stay tuned.

repository: ZakirQamar/gems

branch_name: refs/heads/main

repo_name: ZakirQamar/gems


text:
---
title: "reordercap"
description: "I am still making order out of chaos by reinvention. — John le Carre"
date: 2019-03-12T12:44:45Z
author: Ross Jacobs

summary: '[manpage](https://www.wireshark.org/docs/man-pages/reordercap.html) | [Wireshark Docs](https://www.wireshark.org/docs/wsug_html_chunked/AppToolsreordercap.html) | [code](https://github.com/wireshark/wireshark/blob/master/reordercap.c)'
weight: 20
draft: false
---

Reordercap is a simple utility that orders all packets by timestamp.

## Caveats

### Cannot use same input & output file

reordercap will not error with `reordercap $file $file`, but when you read the file, the packets will be in order but now malformed.

### Cannot read from a pipe

```bash
bash-5.0$ mkfifo myfifo
bash-5.0$ tshark -r out-of-order.pcap -w myfifo & reordercap myfifo out-of-order.pcap
[1] 3941
reordercap: The file "myfifo" is a pipe or FIFO; reordercap can't read pipe or FIFO files in two-pass mode.
```

## Examples

For these examples, using [this cloudshark file](https://www.cloudshark.org/captures/6ffcd7e10730)

* Reorder an out of order pcap

        $ reordercap http-out-of-order.pcapng inorder.pcapng
        10 frames, 1 out of order

* Try to reorder it again with `-n`

        $ reordercap -n inorder.pcapng inorder2.pcapng
        10 frames, 0 out of order
        Not writing output file because input file is already in order.

* To reorder a file in place, use a temp file

    ```bash
    # Using a temp file
    bash-5.0$ reordercap out-of-order.pcap temp
    bash-5.0$ mv temp out-of-order.pcap
    ```

gha_language: HTML


text:
# Number System

Convert numbers to different forms of number system (binary, decimal, octal and hexadecimal)

<img src="included_files/1.jpg">

path: /PROJECT GUIs/NUMBER SYSTEM/README.md


text:
---
layout: post
title: Does not provide a valid apple-touch-icon
description: |
  Learn how to specify what icon your Progressive Web App displays on iOS home screens.
web_lighthouse:
  - apple-touch-icon
codelabs: codelab-apple-touch-icon
date: 2019-08-27
updated: 2019-09-19
---

When iOS Safari users add [Progressive Web Apps (PWAs)](/discover-installable) to
their home screens, the icon that appears is called the *Apple touch icon*.
You can specify what icon your app should use by including a
`<link rel="apple-touch-icon" href="/example.png">` tag in the `<head>` of your
page. If your page doesn't have this link tag, iOS generates an icon by taking a screenshot of
the page content. In other words, instructing iOS to download an icon results in a more polished
user experience.

## How the Lighthouse Apple touch icon audit fails

[Lighthouse](https://developers.google.com/web/tools/lighthouse/)
flags pages without a `<link rel="apple-touch-icon" href="/example.png">`
tag in the `<head>`:

  {% Img src="image/tcFciHGuF3MxnTr1y5ue01OGLBn2/mXGs4XSr4DXMxLk536wo.png", alt="Does not provide a valid apple-touch-icon", width="800", height="95", class="w-screenshot" %}

{% Aside %}
  A `rel="apple-touch-icon-precomposed"` link passes the audit, but it has been
  obsolete since iOS 7. Use `rel="apple-touch-icon"` instead.
{% endAside %}

Lighthouse doesn't check whether the icon actually exists or whether the icon is
the correct size.

{% include 'content/lighthouse-pwa/scoring.njk' %}

## How to add an Apple touch icon

1. Add `<link rel="apple-touch-icon" href="/example.png">` to the `<head>` of your page:

    ```html/4
    <!DOCTYPE html>
    <html lang="en">
      <head>
        …
        <link rel="apple-touch-icon" href="/example.png">
        …
      </head>
      …
    ```

1. Replace `/example.png` with the actual path to your icon.

{% Aside 'codelab' %}
  Check out the [Add an Apple touch icon to your Progressive Web App](/codelab-apple-touch-icon)
  codelab to see how adding an Apple touch icon creates a more polished user experience.
{% endAside %}

To provide a good user experience, make sure that:

- The icon is 180x180 pixels or 192x192 pixels
- The specified path to the icon is valid
- The background of the icon is not transparent

## Resources

- [Source code for **Does not provide a valid `apple-touch-icon`** audit][source]
- [Discover what it takes to be installable](/install-criteria)
- Use Apple Touch Icon

[a2hs]: https://support.apple.com/guide/shortcuts/run-shortcuts-from-the-ios-home-screen-apd735880972/ios#apd175362e63
[source]: https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/audits/apple-touch-icon.js

gha_license_id: MIT


text:
### Coefficient of Determination
`R^2` indicates the proportion of variance in the dependent variable that is predictable from the independent variable
- is very high when the line is fit well
- `r^2` is the square of the sample correlation coefficient
- r = 0.7, r^2 = 0.49 implying 49% of variability in x is caused by variability in y, so 51% is unaccounted for

### Ordinary Least Squares (OLS)
Method for estimates unknown parameters in linear regression
- dataset is n observations {yi, xi}, i from 1 to n, where yi is a scaler value corresponding to some vector x:
  - yi = xiTβ + εi
  - then Y = Xβ + ε; β is p x 1 vector, X is n x p matrix, Y and ε are n x 1 vectors

### Generalized Linear Model
for p-dimensional fector function `y-hat(w,x) = w0 + w1x1 + ... + wpxp`, w = (w1,...,wp) are coefficients and w0 is the intercept
- linear regression fits a line (linear model) to minimize the sum of squares between observations
- computes using SVD of X, then for `n` p-dimensional vectors (n x p matrix), ordinary least squares is O(np^2)

### Ridge Regression
Ridge regression imposes a penalty on Ordinary Least Squares, introducing a ridge coefficient which minimizes the residual sum of squares
- shrinkage is when a fitted relationship performs less well on a new data set

### [Least Angle Regression](../Research-Papers/2003 Least Angle Regression.md)
Regression algorithm for high-dimensional data
- numerically efficient when p >> n, for n x p matrix or n p-dimensional vectors

### Logistic Regression
Linear model for classification rather than regression. Can be used for binary, or multinomial logistic regression

filename: Linear Regression Models.md


text:
---
title: sqlserver_performance.page_splits_persec
brief: Rate of page splits per second.
metric_type: gauge
---
### sqlserver_performance.page_splits_persec

Rate of page splits per second.

gha_language: Python


text:
# From Alignment to Assignment: Frustratingly Simple Unsupervised Entity Alignment

```
@inproceedings{sea_emnlp21,
title = {From Alignment to Assignment: Frustratingly Simple Unsupervised Entity Alignment},
author = {Mao, Xin and Wang, Wenting and Wu, Yuanbin and Lan, Man},
booktitle = {Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing (EMNLP)},
pages = {2843--2853},
year = {2021}
}
```

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

gha_language: Jupyter Notebook


text:
# TODO List

## Sections
* [General](#general)
* [Transformations](#transformations)
* [Dependence Test](#dependence-test)
* [Witness Tuple Generation](#witness-tuple-generation)
* [Completion Search](#completion-search)
* [Code Generation](#code-generation)
* [Visualization](#visualization)

### General

### Transformations
* testing successive inlining

### Dependence Test
* Support for various prefixes
* Analyze __epsilon closure__ initial states

### Witness Tuple Generation
* Support more regex constructs

### Completion Search
* Analyze different search strategies
* Support strip-mining

### Code Generation
* Analyzing and tagging the AST
* Simplifying the AST (constant folding etc.)
* Integrate C99 parser

### Visualization
* Add automata-transducer visualization

repository: kirshanthans/polyrec

repo_name: kirshanthans/polyrec


text:
# Map controls

## Overview

Controls is UI elemetns for controlling view of the map, such as scale or bearing.
You can check them out in Mapbox GL JS [documentation](https://docs.mapbox.com/mapbox-gl-js/api/#user%20interface)
In Vue-mapbox they exposed as Vue components, so you can control they properties and behavior dynamically by changing props.

_All controls_:

```vue
<template>
  <div id="#app">
    <MglMap
      :accessToken="accessToken"
      :mapStyle.sync="mapStyle"
      :attributionControl="false"
    >
      <MglAttributionControl />
      <MglNavigationControl position="top-right" />
      <MglGeolocateControl position="top-right" />
      <MglNavigationControl position="top-right" />
      <MglGeolocateControl position="top-right" />
      <MglScaleControl />
    </MglMap>
  </div>
</template>

<script>
import {
  MglMap,
  MglAttributionControl,
  MglNavigationControl,
  MglGeolocateControl,
  MglFullscreenControl,
  MglScaleControl
} from "vue-mapbox";

export default {
  components: {
    MglMap,
    MglNavigationControl,
    MglGeolocateControl
  },
  data() {
    return {
      accessToken: "some_token",
      mapStyle: "style_object"
    };
  }
};
</script>
```

See list of controls and they properties in [API docs](/api/controls.md).

### Attribution control

Due to Mapbox [policy](https://docs.mapbox.com/help/how-attribution-works/) attribution control
is enabled by default. You can disable default attributions by setting
`attributionControl` prop of MglMap to `false` and set your own attribution
using AttributionControl component.

repository: soal/vue-mapbox

branch_name: refs/heads/development

gha_language: JavaScript

repo_name: soal/vue-mapbox


text:
# DOCKER FILES

A collection of any Docker files I'm using on my dev machines / lab / etc.

## RECOMMENDATION

Use aliases to reference containers, so you can use shorthand and just pass in commands. It makes life much easier.

Example (in your .bashrc, .bashprofile, .zshrc, etc)

```
alias frontend-toolkit='docker run -it --rm -p 3000:3000 -v "$PWD":/app -w /app jasonamartin/frontend-toolkit:latest $1'
```

And now in your terminal, you could just run something like this from the directory:

```
frontend-toolkit npm i
```

Another idea is to split up input, so you can pass a working dir and command.

## CONTENTS

/frontend/frontend-toolkit : This is an image spawned from Node with grunt, gulp, webpack, etc built it for fast zero to development setup.

repository: JasonAMartin/docker-files

repo_name: JasonAMartin/docker-files


text:
# PostgreSQL Vault Auth

![Build](https://github.com/davidsteinsland/postgres-vault-auth/workflows/Build/badge.svg)
[![Version](https://img.shields.io/jetbrains/plugin/v/16104-postgresql-vault-auth.svg)](https://plugins.jetbrains.com/plugin/16104-postgresql-vault-auth)
[![Downloads](https://img.shields.io/jetbrains/plugin/d/16104-postgresql-vault-auth.svg)](https://plugins.jetbrains.com/plugin/16104-postgresql-vault-auth)

Fetches credentials for a PostgreSQL database from
Vault.

This plugin assumes that `vault` is installed and available.
If you're not authenticated against Vault, the OIDC method
is selected (which will trigger your browser to open a tab with the signin process).

## Configuration (macOS)

Until the plugin provides a way of configuring itself, the
Vault address can be configured using the `VAULT_ADDR` environment variable.

To make sure it is set for the IntelliJ editor, run the following and restart IntelliJ:

```
launchctl setenv VAULT_ADDR https://vault-addr.example.org
```

## Installation

- Using IDE built-in plugin system:

  Settings/Preferences > Plugins > Marketplace > Search for "Postgres Vault Auth" >
  Install Plugin

- Manually:

  Download the [latest release](https://github.com/davidsteinsland/postgres-vault-auth/releases/latest) and install it manually using
  Settings/Preferences > Plugins > ⚙ > Install plugin from disk...

### Postgres SVG logo Copyright

Copyright © 2021, Daniel Lundin

Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.

IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE AUTHOR HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

license: PostgreSQL

repository: spencerdcarlson/postgres-vault-auth

repo_name: spencerdcarlson/postgres-vault-auth


text:
# linebot

Questions for the line following robot and code.

How do the sensors work?

What is their value range?

What is the max, min?

How does it know it's on a line?

What happens when it leaves the last known line?

What if it flips over or goes into some error state?

What if it get stuck or runs into a wall?

How can we get information to know what's happening?

What would a program need to do if it's goal was to read values from the sensors?

What are other ways of triggering the sensors?

Can you make the sensors go to a maximum, and or mimimum? How do you know?

How can you interact with the motors?

What would you like the motors to do?

How fast should it go?

What kinds of turns should it make?

What kinds of lines does it follow best?

Can you program it to stop or pause when it detects wider lines or dashed lines?

repository: ricklon/linebot

repo_name: ricklon/linebot


text:
# grit

usually my employer has my git commits set to my work email, which messes up my open source commits. i run `grit` in projects that i want to commit to from my non-work email (and sign).

## setup
add a source line to `~/.bash_profile` or wherever you put stuff like that

```bash
source /path/to/grit.sh
```

also export your email, name, and signing key id so grit can use them

```bash
export<EMAIL_ADDRESS>export GITHUB_NAME="Diana Prince"
export GITHUB_GPG_KEY="F32B1833EB870AD7"
```

more info about setting up GPG signing for commits is [here](https://help.github.com/en/articles/signing-commits)

## use
just type `grit`

```bash
$ cd project-folder
$ grit
```

## License
MIT

repository: stripedpajamas/grit

repo_name: stripedpajamas/grit


text:
# Yeoman Generator
 for Web Components
 [![Build Status](https://secure.travis-ci.org/webcomponents/generator-element.svg?branch=master)](https://travis-ci.org/webcomponents/generator-element) [![NPM version](https://badge.fury.io/js/generator-element.svg)](http://badge.fury.io/js/generator-element) [![Dependency Status](https://david-dm.org/webcomponents/generator-element.svg?theme=shields.io)](https://david-dm.org/webcomponents/generator-element)

![WC + Yeoman](http://f.cl.ly/items/0Z0Q180C0F0a1h0y3v2S/yo.jpg)

> A Yeoman Generator that provides a [functional boilerplate](https://github.com/webcomponents/element-boilerplate) to easily create Web Component elements using [Polymer](http://www.polymer-project.org/).

## Getting started

1. Install using NPM:

    ```sh
    $ [sudo] npm install -g generator-element
    ```

2. Scaffold your new project:

    ```sh
    $ yo element
    ```

3. Start writing your custom element!

## Structure

The basic structure of the project is given in the following way.

```
.
├── .bowerrc
├── .editorconfig
├── .gitignore
├── bower.json
├── package.json
├── index.html
├── Gruntfile.js
└── src/my-element.html
```

## Roadmap

- [✔] Scaffold an element using Polymer
- [—] Scaffold an element using X-Tag
- [—] Scaffold an element using VanillaJS

## History

For detailed changelog, see [Releases](https://github.com/webcomponents/generator-element/releases).

[![Zeno Rocha](https://2.gravatar.com/avatar/e190023b66e2b8aa73a842b106920c93)](https://github.com/zenorocha) | [![Addy Rocha](https://2.gravatar.com/avatar/96270e4c3e5e9806cf7245475c00b275)](https://github.com/addyosmani)
--- | --- | --- | --- | ---
[Zeno Rocha](https://github.com/zenorocha) | [Addy Osmani](https://github.com/addyosmani)

## License

[MIT License](http://webcomponentsorg.mit-license.org/) © WebComponents.org

repository: pennyfx/generator-element

repo_name: pennyfx/generator-element


text:
> [Go to French version](/fr/Règlements/Décrets,%20ordonnances%20et%20règlements%20statutaires/98/182.md)

# Ontario Hydro Nuclear Facilities Exclusion Regulations (Use of Tobacco)

**SOR/98-182**

Enabling authorities:
- [NON-SMOKERS’ HEALTH ACT](/en/Acts/Statutes%20of%20Canada/1985/c.%2015%20(4th%20Supp.).md)

Date registered: 19 March 1998

----------

His Excellency the Governor General in Council, on the recommendation of the Minister of Labour, pursuant to section 8.2[a] of the [Non-smokers’ Health Act](/en/Acts/Statutes%20of%20Canada/1985/c.%2015%20(4th%20Supp.).md)[b], hereby makes the annexed Ontario Hydro Nuclear Facilities Exclusion Regulations (Use of Tobacco).

a: S.C. 1996, c. 12, s. 5

b: R.S., c. 15 (4th Supp.)

## Interpretation

**1** The definitions in this section apply in these Regulations.

***Act*** means the Smoking in the Workplace Act, R.S.O. 1990, c. S.13. (*Loi*)

***employment*** means employment with Ontario Hydro or a person referred to in paragraph (b) of the definition ***nuclear facility***. (*emploi*)

***nuclear facility*** means a nuclear facility in Ontario that is subject to the [Nuclear Safety and Control Act](/en/Acts/Statutes%20of%20Canada/1997/c.%209.md) or any regulations made under that Act and that is
- **(a)** owned and operated by Ontario Hydro; or
- **(b)** owned or operated by a person other than Ontario Hydro if, on the day on which these Regulations come into force or on a day after that day, it is owned and operated by Ontario Hydro. (*installation nucléaire*)
> SOR/2002-208, s. 44.

## Exclusion

**2** Employment on or in connection with a nuclear facility is hereby excluded from the application of the [Non-smokers’ Health Act](/en/Acts/Statutes%20of%20Canada/1985/c.%2015%20(4th%20Supp.).md), except sections 8.1 and 8.2.

## Application of Ontario Act

**3** Subject to section 4, the Act, as amended from time to time, applies, to the extent that it is relevant, in relation to employment on or in connection with a nuclear facility.

**4** For the purposes of section 3, the reference to “another Act or a regulation” in subsection 11(1) of the Act shall be read as a reference to “another Act or a regulation including the [Nuclear Safety and Control Act](/en/Acts/Statutes%20of%20Canada/1997/c.%209.md), and any regulations made pursuant to that Act”.
> SOR/2002-208, s. 45.

## Coming into Force

**5** These Regulations come into force on April 1, 1998.

repository: TravisMadill/CanadianLaws

path: /en/Regulations/Statutory Orders and Regulations/98/182.md

repo_name: TravisMadill/CanadianLaws


text:
# shadowsocks server install

## Intro

[Shadowsocks](https://shadowsocks.org) is a secure SOCKS5 proxy, designed to protect your Internet traffic.

Current version: 3.0(03) | [Changelog](/change.log)

Current lauguage: English | [Simplified Chinese](/README_CN.md)

## Summary

This script can compile and install for Linux server automatic by [@Vndroid](https://github.com/Vndroid/)

## Features

Automatically deploy servers and Optimize the shadowsocks server on Linux.

## Support:

* Debian 7 *Wheezy*
* Debian 8 *Jessie*
* Debian 9 *Stretch*
* Debian 10 *Buster*
* Ubuntu 14.04 *Trusty*
* Ubuntu 16.04 *Xenial*
* Ubuntu 18.04 *Bionic*
* Ubuntu 20.04 *focal*

## How to use:

### Download

```bash
# wget https://raw.githubusercontent.com/Vndroid/shadowsocks-install/master/shadowsocks.sh
# chmod +x shadowsocks.sh
```

### Install

```bash
# ./shadowsocks.sh install 2>&1 | tee shadowsocks.log
```

> Notice: Must be as root user run this command.

### Uninstall

```bash
# ./shadowsocks.sh uninstall
```

### Configure and start the service

Edit the configuration file

```bash
# vi /etc/shadowsocks.json
```

Start the service via sysvinit

```bash
# /etc/init.d/shadowsocks start
```

Stop the service via sysvinit

```bash
# /etc/init.d/shadowsocks stop
```

Check service status

```bash
# /etc/init.d/shadowsocks status
```

View the shadowsocks server log

```bash
# tail -f /var/log/shadowsocks.log
```

## Report issues

Email Me<EMAIL_ADDRESS>With the "shadowsocks.log"


text:
---
layout: page
title: EEOB/BCB 546X - Software
sidebar: Software
navigation: 3
icon: <i class='fa fa-laptop'></i>
---

# EEOB/BCB 546X Software Guide

## Unix

In order to complete computational exercises and the group project for this course, students will need access to a Unix operating system, which is the core for Mac OS X and Linux operating systems.

### Windows Users

A Unix environment can be emulated using the “Git Bash” program, by partitioning your hard drive and installing Ubuntu (a free version of Linux), or by installing Cygwin. These solutions for PC users may not be ideal for all course exercises and we can provide access to Mac computers if you would prefer to go this route.

* Git for Windows: [https://gitforwindows.org](https://gitforwindows.org)
* Ubuntu: [https://help.ubuntu.com/community/Wubi](https://help.ubuntu.com/community/Wubi)
* Cygwin: [https://www.cygwin.com](https://www.cygwin.com)

## HPC-Class

Much of the work you will do for this class will be executed on the course cluster: [HPC-Class](https://www.hpc.iastate.edu/guides/classroom-hpc-cluster). To log on to this resource, you need to be on campus or use the ISU VPN. To set up the VPN, follow the instructions on the [ISU HPC site](https://www.hpc.iastate.edu/guides/classroom-hpc-cluster/access-and-login).

To get to your account on the cluster, open your terminal (Unix) or Git-Bash (Windows) and type the following in the command line, but be sure to replace `your_ISU_NETID` with your actual ISU NETID:

```bash
ssh<EMAIL_ADDRESS>```

After you execute this command, you will be prompted to input your ISU NETID password. IF you enter the correct password, you will then be in your home directory on the head node of the remote machine.

HPC-Class is a cluster that uses a SLURM scheduler. So to run an analysis on this cluster, you must
submit your job using a SLURM script. There is a script generator that you can use to create this file: [HPC-Class SLURM Script Generator](https://www.hpc.iastate.edu/guides/classroom-hpc-cluster/slurm-job-script-generator).

## Text Editors

We highly recommend that you use an advanced text editor for this course and your research. Here are some that we like:

* vim or emacs (Unix, Mac OS X)
* [Sublime Text](http://www.sublimetext.com/) (Unix, Mac OS X, Windows)
* [Atom](https://atom.io/) (Unix, Mac OS X, Windows)
* [BBEdit](https://www.barebones.com/products/bbedit/) (Mac OS X)

For Markdown, you might like to use an application that will render the Markdown as HTML so you can see
the formatted document. There are several nice Markdown editors available (and you can also get plug-ins
for Sublime Text and Atom that can do this).

* [MacDown](https://macdown.uranusjr.com/) (for Mac OS X only)
* [MarkdownPad](http://markdownpad.com/) (for Windows only)
* [REMARKABLE](https://remarkableapp.github.io/) (for Windows and Linux)
* [typora](https://typora.io/) (free while in beta, for all OS)
* [StackEdit](https://stackedit.io/) (an in-browser editor)

## Programming Environments

For the parts of the course when we are working on programming in R or in Python, we will require that you have a few things installed.

### R

You can work with R by writing text files or by using an IDE (interactive development environment). We recommend using an IDE (RStudio), which requires that you first install R.

* [Download R](https://www.r-project.org/)
* [RStudio Desktop](https://www.rstudio.com/products/rstudio/download/) -- this is a well-designed IDE for working with R

### Python

It is helpful for us all to use the same Python environment. We recommend using the all-in-one Python installer [Anaconda](http://continuum.io/downloads.html). We will also be using Python 3 for this class. Anaconda will install most of the packages we will need.

The following install instructions are from the [Data Carpentry lesson on Python](http://www.datacarpentry.org/python-ecology-lesson/).

#### Windows

* Download and install [Anaconda](https://www.anaconda.com/download/#windows)
* Download the default Python 3 installer. Use all of the defaults for installation and **make sure to check "Make Anaconda the default Python"**.

#### Mac OS X

* Download and install [Anaconda](https://www.anaconda.com/download/#macos)
* Download the default Python 3 installer. Use all of the defaults for installation.

#### Linux

1. Download the default [Python 3](https://www.anaconda.com/download/#linux) installer.
2. Open a terminal window.
3. Type
```
bash Anaconda-
```
and then press tab. The name of the file you just downloaded should appear.
4. Press enter. You will follow the text-only prompts. When there is a colon at the bottom of the screen press the down arrow to move down through the text. Type yes and press enter to approve the license. Press enter to approve the default location for the files. Type yes and press enter to add Anaconda to your PATH (this makes the Anaconda distribution the default Python).

#### Update

After downloading and installing Anaconda, it is helpful to update the packages. Do this in your terminal window.

```
conda update --all
```

## Slack

All course communication will be conducted via slack. You should have gotten an invitation to join the course slack team called **BioDataSkills** (if not, please contact one of the instructors). Please be sure to check slack regularly for course updates. It is recommended that you download the Slack desktop app ([https://slack.com/downloads](https://slack.com/downloads)), which makes it easier to stay on top of messages.


text:
# LEA
LEA is a 'cute' backdoor that looks for available networks, including printers and all internet connected devices, enters into
the registry under: "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"
and runs on system start-up by opening port 8000 and then listens for incoming command to execute as admin.
LEA is a google software and as such it has its own digital signature, with sha-1 on RSA: it passes the newest norton antivirus
scan, and doesn't ask for permission to open up ports or register at the windows current config.

...download LEA, she's the best!

       Tested on:
       DOCID: v118291851_NortonM_Retail_1_en_us
       Operating System: Windows, Mac OS X, Android, iOS
       Last modified: 05/11/2017

       WINDOWS 10 HOME 2016 10.0*
       HP Pavilion Desktop - 510-p020 Intel® Core™ i5-4460S Processor

       Authors
       Numéro du projet sept sérine (@Sp7)

        Copyright
        2017-2020 The-Sarin-project

        Version
        0.0.0

![](gif.gif)
# description
       23/5/2017- we downloaded the latests Symantec-norton at nr.tn/2qeLkiE
       at first the anti-virus didn't want to activate the software but after getting
       the software signed and downloaded about thousand times (by norton-users dha...)
       finally the software passed the norton scanner.
       {{we even gave it a nice java update logo}} (and its writen in c#)
       ((that's 76.9 kB, which means that LEA is only, 5.1kb))

       after running the software (not as admin or anything), we got a backdoor operating on port 8000,
       with the even more interesting fact:
       that we could enter our key in the registry for the worm persisting in the system.
       The worm starts as a background task at system start up, and doesn't show any sign of existence.

       Before...

       After...

       The latest Symantec/Norton in Action!

       LEA could easily be extended to do some more interesting tasks like post your all drive to any ip
       address you want, monitor your keyboard clicks and take snapshots and can even encrypt your entire computer.
       Download LEA, she's the best!

# How To avoid LEA?
    we dont really know yet, if you download LEA, and open it mm... thats it.
    a good advice on our opinion is to go linux!
# How does it make system changes with no admin rights?
       LEA looks for printers and shared users directories, it connects on an external port,
       due to sharing configurations made by windows default printers connected to the device.
       LEA commits only one registry key, as stated above, and can do so because of default
       permission configurations of win10 that allow software like McAfee, Google cloud services
       etc. make changes to the CurrentVersion\\Run section at the registry.
website


text:
# XGL

Makes use of [JSX](https://facebook.github.io/react/docs/jsx-in-depth.html) to leverage [WebGL](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API).

XGL provides the *programmatic* means to create 3D scenes. It puts an almost opaque layer of abstraction over WebGL so that little or no experience of WebGL is needed. You create scenes declaratively using JSX, adding imperative code as and when.

## Installation

You can clone the repository with [Git](https://git-scm.com/)...

    git clone https://github.com/djalbat/xgl.git

...and then install the necessary modules with [npm](https://www.npmjs.com/) from within the project's root directory:

    npm install

## Tutorial

The examples are available via a small [Express](https://expressjs.com/) application that makes use of [XGL Server](https://github.com/djalbat/xgl-server). Once the dependencies are installed, this can be launched with the following command from the root of the repository:

```
node ./bin/main.js
```

The index page for the examples will then be available at http://localhost:8000. You can compile the examples yourself, see the section on compiling from source near to the end. This section assumes that you are doing so and will work through each of them, starting with the simplest.

### The simple example

In order to create a scene you need a `canvas` HTML element:

```html
<html>
  <head>
    <link href="css/example.css" rel="stylesheet" type="text/css" media="all">
  </head>
  <body>
    <canvas></canvas>
    <script src="example.js"> </script>
  </body>
</html>
```

You could style the `canvas` HTML element to take up the entire viewport, at least to begin with:

```css
canvas {
  height: 100vh;
  width: 100vw;
  display: block;
}
```
Note that in what follows most of the boilerplate code has been left out of the listings. Also note that if you are compiling the examples from within the cloned repository, it is correct to use the relative require. Normally you would require the package itself, however.

To continue, the `canvas` HTML element is encapsulated by an instance of the `Canvas` class and passed as an attribute to the outermost `Scene` JSX element, which itself contains a `Camera` JSX element together with one or more `Part` JSX elements. The `Part` JSX elements contain the JSX elements that are actually rendered on the canvas, called canvas elements, in this case a single `ColouredSquare` element:

```js
const canvas = new Canvas();

const simpleExample = () =>

  <Scene canvas={canvas}>
    <Part>
      <ColouredSquare colour={[ 0, 0, 1 ]} />
    </Part>
    <Camera />
  </Scene>

;
```
Whilst the `Scene`, `Camera` and `Part` JSX elements are built in, you have to create the canvas elements:

```js
const coordinates = [

        [ 0, 0, 0 ],
        [ 1, 0, 0 ],
        [ 0, 1, 0 ],
        [ 1, 1, 0 ],

      ],
      indexes = [

        [ 0, 1, 3 ],
        [ 3, 2, 0 ],

      ],
      defaultColour = [ 1, 0, 0 ];

class ColouredSquare extends ColouredCanvasElement {
  static fromProperties(properties) {
    const { colour = defaultColour } = properties,
          colouredSquare = ColouredCanvasElement.fromProperties(ColouredSquare, properties, coordinates, indexes, colour);

    return colouredSquare;
  }
}
```
The `ColouredCanvasElement` class is provided and all you have to do is to extend it, adding your own `fromProperties()` static method and passing the requisite coordinates, indexes and colour variables along with the `properties` argument to the `fromProperties()` static method of the parent class. Note that the `ColouredSquare` class itself is also passed as the first argument. Also note that a `colour` variable is extracted from the `properties` argument, allowing a `colour` attribute on the corresponding JSX elements. If none is provided, a default is used.

The `coordinates` and `indexes` arguments are the important ones. Underneath the hood, XGL works with facets, which are essentially triangles with a colour or texture together with a normal. Facets are defined by triples of indexes that refer to specific coordinates. In this case there are four coordinates, one for each corner of the square. Two facets have been created in order to make the square. Note that the first and last coordinates are re-used. It is essential that you get the coordinates and indexes right for any canvas element. They are used to populate the WebGL rendering buffers and if they are wrong, inscrutable WebGL errors will likely result.

Before moving on it is worth a moment to study XGL's coordinate system. Obviously there are three dimensions, with the first, second and third coordinates of coordinate triples specifying signed distances along the x, y and z axes. The axes are right-handed, meaning that if you let the thumb and first finger of your right hand represent the x and y axes, your second finger will point in the direction of the z axis. Facets are also right handed, which means that if you let the fingers of your right hand curl around to represent the coordinates of each facet, your thumb will point in the direction of its normal. In this case your thumb will point back towards the camera. Note that the indexes for the two facets of the square are chosen so that the normals of each point in the same direction.

### The cube example

Because creating more than a handful of facets can be problematic, it is recommended that you create complex canvas elements as composites of simpler ones rather than increasing the number of coordinates and indexes. There is effectively no overhead when creating composite elements, in particular the rendered scene will not run any more slowly. In this example a `Cube` element is created which is composed of six child `Face` elements rather than a dozen facets. A pure function is used, so there is no need to use a class:

```js
const defaultC0lour = [ 1, 1, 0 ];

const Cube = (properties) => {
  const { colour = defaultC0lour } = properties;

  return ([

    <Face colour={colour} rotations={[   0,   0, 0 ]} />,
    <Face colour={colour} rotations={[ +90,   0, 0 ]} />,
    <Face colour={colour} rotations={[   0, +90, 0 ]} />,

    <Face colour={colour} rotations={[ 180,   0, 0 ]} />,
    <Face colour={colour} rotations={[ -90,   0, 0 ]} />,
    <Face colour={colour} rotations={[   0, -90, 0 ]} />,

  ]);
};
```
The `Face` elements themselves also result from a pure function. Here the coordinates of the `ColouredSquare` element are adjusted to make it simpler to rotate:

```js
const Face = (properties) => {
  const { colour } = properties;

  return (

    <ColouredSquare colour={colour} position={[ -0.5, -0.5, +0.5 ]} />

  );
};
```
Note that the previous `Cube()` function returned an array of child elements whereas the `Face{}` function returns just one. In the latter cases, single elements are coerced into arrays automatically.

Rotations are specified as triples giving three rotations around the x, y and z axes, respectively. Rotations are right handed, which means that if you point the thumb of your right hand in the direction of the chosen axis, your curled fingers give the direction of the rotation about it. Rotations can be hard to work out, particularly when they are compounded. Note that the rotations here are chosen so that the normals of each face of the cube are directed outwards.

### The masking example

Masking is something specific to XGL, it is not part of WebGL. A screenshot of the masking example is better than words:

![Masked cube](https://github.com/djalbat/XGL/blob/master/assets/masked_cube.jpg)

Here a cube has been masked by a cube that it contains, that has itself been masked by a cube that it contains. The listing below is an abridged version of the example, with only two nested cubes rather than three:

```js
const { Canvas, Scene, Mask, Part, Camera } = xgl;

const canvas = new Canvas();

const maskingExample = () => {
  const SmallCube =

          <Cube size={[ 1/4, 1/4, 1/4 ]} />

        ,
        smallCubeMask =

          <Mask>
            <SmallCube />
          </Mask>

        ,
        MediumCube =

          <Cube size={[ 1/2, 1/2, 1/2 ]} mask={smallCubeMask} />

        ;

  return (

    <Scene canvas={canvas}>
      <Part>
        <MediumCube />
      </Part>
      <Camera />
    </Scene>

  );
};
```
Note that the cubes are created directly with JSX elements. If you have no need of the `properties` argument, you can use this abbreviated form, doing away with a function call.

Here is the scene that results, with the facets coloured randomly so that each is visible:

![Masked cube facets](https://github.com/djalbat/XGL/blob/master/assets/masked_cube_facets.jpg)

The small-sized cube is used to make the mask for the medium-sized cube. Each facet of the small-sized cube forms a prism that cuts through each facet of the medium-sized cube. In practice, however, most of the prisms formed from the masking element do not intersect any prism in the masked element and are quickly discarded. Nonetheless masking is computationally expensive and less than optimal. Masking the original two facets of the masked cube results in sixteen facets when half that number would be optimal. It is a cube of this form, with each face already masked, that masks the large-sized cube in the full example.

### The pyramid example

This example utilities the image map provided by the small Express application, available at http://localhost:8000/imageMap. If you inspect the example HTML, you will also see that the JSON describing the image map has been embedded within:

```
<script>

  window.__configuration__ = {
    imageMapURI: '/imageMap',
    imageMapJSON: {

      ...

      "stripes.jpg": {
        "left": 0.501953125,
        "bottom": 0.501953125,
        "width": 0.49609375,
        "height": 0.49609375
      }
    }
  };

</script>
```
As explained in the XGL Server tutorial, assigning a `__configuration__` property to the global `window` object makes its values accessible to the bundled application running in the browser. With the image map URI and corresponding JSON to hand, the pyramid example can load the image map and pass both that and the JSON to any `Part` element that uses textures:

```js
const pyramidExample = () => {
  preloadImageMap((imageMap) => {
    const { imageMapJSON } = configuration;

    return (

      <Scene canvas={canvas}>
        <Part imageMap={imageMap} imageMapJSON={imageMapJSON}>
          <Pyramid />
        </Part>
        <Camera />
      </Scene>

    );
  });
};

module.exports = pyramidExample;

function preloadImageMap(callback) {
  const { imageMapURI } = configuration,
        imageMap = new Image(),	///
        src = imageMapURI;  ///

  Object.assign(imageMap, {
    src,
    onload
  });

  function onload(event) {
    callback(imageMap);
  }
}
```
The `Pyramid` element is a compound element consisting of four sides, three of which are rotated around the y-axis as you would expect:

```js
const Pyramid = (properties) => [

  <Side />,
  <Side rotations={[ 0,  90, 0 ]} />,
  <Side rotations={[ 0, 180, 0 ]} />,
  <Side rotations={[ 0, 270, 0 ]} />,

];
```
Each side consists of a textured triangle:

```js
const coordinates = [

        [   0, 0, 0 ],
        [   1, 0, 0 ],
        [ 0.5, 1, 0 ],

      ],
      indexes = [

        [ 0, 1, 2 ],

      ],
      defaultImageName = "stripes.jpg",
      defaultTextureCoordinates = [

        [ [ 0, 0 ], [ 1, 0 ], [ 0.5, 1 ] ],

      ];

class TexturedTriangle extends TexturedCanvasElement {
  static fromProperties(properties) {
    const { imageName = defaultImageName, textureCoordinates = defaultTextureCoordinates } = properties,
          texturedTriangle = TexturedCanvasElement.fromProperties(TexturedTriangle, properties, coordinates, indexes, imageName, textureCoordinates);

    return texturedTriangle;
  }
}
```
This extends the `TexturedCanvasElement` class, which takes an image name and texture coordinates rather than a colour.

The coordinates and indexes define a triangle with the third vertex horizontally half way between the first and second. Therefore the part of the square texture that is utilised should match this:

However, if we alter the texture coordinates thus...

```
[ 0, 0 ], [ 1, 0 ], [ 0, 1 ]

```
...then the leftmost corner of the texture is mapped to the topmost vertex of the triangle:

On the other hand, if we alter the texture coordinates thus...

```
[ 0, 0 ], [ 1, 0 ], [ 1, 1 ]
```
...then the it is the rightmost corner of the texture that is mapped to the topmost vertex of the triangle:

The textured triangles themselves are adjusted to make the sides...

```js
const Side = (properties) =>

  <TexturedTriangle size={[ 1, 1/Math.sqrt(2), 1 ]} position={[ -0.5, 0, 0.5 ]} rotations={[ -45, 0, 0 ]} />

;
```
...meaning that the sides themselves need only be rotated about the y axis to form the pyramid, as already shown.

## Compiling from source

Automation is done with [npm scripts](https://docs.npmjs.com/misc/scripts), have a look at the `package.json` file. The pertinent commands are:

    npm run build-debug
    npm run watch-debug

As well as building the XGL library itself, this will build the examples. The source code for the examples can be found in the `es6/example.js` file and in the files and sub-directories in the `es6/example` directory.

## Contact

-<EMAIL_ADDRESS>- http://djalbat.com

repository: sangohan/xgl

repo_name: sangohan/xgl


text:
The commands that are available will vary depending on which framework you're using. The following table shows the commands available and what framework they're available in.

|            | Laravel | Lumen |
|------------|:-------:|:-----:|
| api:routes | ✔      |       |
| api:cache  | ✔      |       |
| api:docs   | ✔      |   ✔  |

#### `api:routes`

**Only available in Laravel 5.1+**

This command will generate a table list of your API routes. This command behaves in the exact same way as the `route:list` command available in Laravel. As well as the standard filtering available you also have the following filters: `--versions` and `--scopes`.

##### Examples

```
$ php artisan api:routes
```

```
$ php artisan api:routes --versions v1
```

```
$ php artisan api:routes --scopes read_user_data --scopes write_user_data
```

#### `api:cache`

**Only available in Laravel 5.1+**

This command will cache your API routes alongside the main application routes. When run this command will also run the `route:cache` command automatically, so do not run that command after running this command.

Your routes should either appear in the main `app/Http/routes.php` file or be included within that file for caching to take affect.

**Important:** Running `route:cache` by itself will prevent your API routes from being accessible.

##### Examples

```
$ php artisan api:cache
```

#### `api:docs`

**Available in both Laravel 5.1+ and Lumen 5.1+**

This command will generate documentation from your annotated controllers into a standards compliant API Blueprint 1A document. For more on how to annotate your controllers see the [API Blueprint Documentation](https://github.com/dingo/api/wiki/API-Blueprint-Documentation) chapter.

By default the command will output the generated documentation to `stdout` where you can pipe it to a file or push it to a server.

##### Examples

```
$ php artisan api:docs --name Example --use-version v2
```

Output directly to a file with `--output-file`.

```
$ php artisan api:docs --name Example --use-version v2 --output-file /path/to/documentation.md
```

To avoid defining the name and version manually, you can configure defaults in your configuration file or environment file. For more see the [configuration](https://github.com/dingo/api/wiki/Configuration) chapter.

[← API Blueprint Documentation](https://github.com/dingo/api/wiki/API-Blueprint-Documentation)

repository: afroware/restfy

repo_name: afroware/restfy


text:
---
layout: post
title:  "Tricore Basics: Using the Hightec Tricore Toolchain in Linux"
image: ''
date:   2019-08-4 00:20:10
tags:
- embedded
- tools
- automotive
description: ''
categories:
- embedded
- automotive
---

# Background

The Tricore CPU architecture is commonly found in automotive embedded systems, often running an RTOS or even just bare metal firmware. This post will go over setting up an entry level toolchain for the Tricore architecture under Linux, and how we can use this toolchain when reverse engineering automotive platforms. We will also go over and provide a very simple bare metal loader.

This will be the first in a series of posts about the Tricore architecture and reverse engineering Tricore based embedded systems. For this series we'll be targeting a Tricore 1767, which is an older but commonly used CPU in automotive systems. The goal at the end of these posts will be to get our own code running on an ECU in Bootloader mode.

If we want to be able to run our own code on an ECU we're going to have to need a toolchain first, which is where I'm choosing to start. In the past I've written all of my Tricore code in ASM and never really explored the idea of using any available compilers. This series will explore these options and hopefully help some people out along the way...or at least entertain!

# Goals

1. Setup HighTec Embedded toolchain under Linux (Ubuntu 18.04) using WINE.
2. Build a "Hello World" binary to toggle GPIO Lines and set up the Processor, while using linker scripts to ensure that our binary be loaded at a specific address (we'll discuss this in a later post)
3. Disassemble/Decompile the binary using GHIDRA

## Setting up the toolchain under WINE

Unzip the toolchain

```
unzip free_tricore_entry_tool_chain.zip
```

Run ```Setup.exe``` with WINE:

```
wine Setup.exe
```

Next click through the install as seen below

![Tricore Install](TRICORE_1.png)

Once the installation has finished, you will find the files we care about in the resulting directory:

```
~/.wine/drive_c/HIGHTEC/toolchains/tricore/v<IP_ADDRESS>-infineon-2.0/bin
```

You can add this to your path with the following:

```
export PATH=$PATH:~/.wine/drive_c/HIGHTEC/toolchains/tricore/v<IP_ADDRESS>-infineon-2.0/bin
```

Now try invoking the gcc compiler with ```wine``` as seen below:

```
wrongbaud@wubuntu:~$ wine tricore-gcc.exe
tricore-gcc.exe: fatal error: no input files
compilation terminated.
```

Great! So now lets right some simple code to toggle a GPIO line!

## Build a "Hello World" binary to toggle a GPIO line

Lets start with a simple main.c that will (according to our datasheet) initialize and toggle a GPIO line!

```
/*
 * main.c
 *  Created on: Mar 6, 2019
 *      Author: wrongbaud
 */

#include <tc1767.h>
#include <tc1767/scu/addr.h>
#include <tc1767/scu/types.h>
#include <tc1767/port5-struct.h>

typedef struct
{
	unsigned int _con0;
	unsigned int _con1;
}WdtCon_t;

void toggle_pin_13()
{
	unsigned int * GPIO_CTRL_REG = 0xF0000F1C;
	unsigned int * GPIO_OUTPUT_REG = 0xF0000F04;
	*GPIO_CTRL_REG = 0x80208020;
	*GPIO_OUTPUT_REG = 0x20002000;
}

void disable_gpios()
{
	unsigned int * GPIO_CTRL_REG = 0xF0000F1C;
	unsigned int * GPIO_OUTPUT_REG = 0xF0000F04;
	*GPIO_CTRL_REG = 0x80208020;
	*GPIO_OUTPUT_REG = 0x00000000;
}
void toggle_pin_15()
{
	unsigned int * GPIO_CTRL_REG = 0xF0000F1C;
	unsigned int * GPIO_OUTPUT_REG = 0xF0000F04;
	*GPIO_CTRL_REG = 0x80208020;
	*GPIO_OUTPUT_REG = 0x80008000;
}

void main()
{
	unsigned int wcon0,wcon1;
	volatile WdtCon_t *wdtaddr = 0xF00005F0;
	wcon0 = wdtaddr->_con0;
	wcon1 = wdtaddr->_con1;
	// Unlock WDT and disable ENDINT protection so we can reconfigure clocks
	wcon0 &= 0xffffff03;
	wcon0 |= 0xf0;
	wcon0 |= (wcon1 & 0xc);
	wcon0 ^= 0x2;
	wdtaddr->_con0 = wcon0;
	wcon0 &= 0xfffffff0;
	wcon0 |= 0x2;
	wdtaddr->_con0 = wcon0;
	(void) wdtaddr->_con0;
	// Reconfigure clock speed as reccomended in user manual
	SCU_PLLCON0_t * SCU_PLLCON0 = (SCU_PLLCON0_t*) SCU_PLLCON0_ADDR;
	SCU_PLLCON0->bits.VCOBYP = 0;
	SCU_PLLCON1_t * SCU_PLLCON1 = (SCU_PLLCON1_t *) SCU_PLLCON1_ADDR;
	SCU_PLLCON1->bits.K1DIV = 0;
	toggle_pin_13();
	toggle_pin_15();
}
```

Next, we'll try to compile this code as follows:

```
wine ~/.wine/drive_c/HIGHTEC/toolchains/tricore/v<IP_ADDRESS>-infineon-2.0/bin/tricore-gcc.exe main.c
```

Oh no! The first big mistep in our journey has appeared!

```
wrongbaud@wubuntu:~/blog/tricore$ wine tricore-gcc.exe hello.c
license check: Can't read license data (-102)
No such file or directory (errno: 2)
license check: No valid license!
hello.c:1:0: error: error in licenser

 ^
hello.c:1:0: error: license check failed
```
Remember the License file we needed earlier? It looks like wine / tricore-gcc.exe can't find it. After a fair amount of time digging through docs, and troubleshooting wine, I loaded the tricore-gcc.exe in IDA and found out that there was a crucial argument not displayed when you run ```tricore-gcc.exe --help``` ...

The argument ```-mlicense-key=dir``` can be used to specify a directory containing the license file, so lets copy that into our working directory and run the following...

```
wine ~/.wine/drive_c/HIGHTEC/toolchains/tricore/v<IP_ADDRESS>-infineon-2.0/bin/tricore-gcc.exe hello.c -mlicense-dir=$(pwd)
```

And we have a resulting ```a.out``` in our directory!

So at this point, we've installed the HIGHTEC toolchain under WINE on Linux and can compile binaries for the TC1767 CPU, now our eventual goal is to develop code that will be used as a bootstrap loader and our target will not likely be able to load ELF files, so we'll need to write some linker scripts in order to make sure that the resulting ```.text``` section of the binary can be extracted and ran on the target. We will cover this in the next blog post!

Initially when putting this post together, my plan was to use IDA-Pro to disassemble the binary and analyze what we've written to determine how efficient this HIGHTEC compiler is. The reason that I want to investiage this is that later on we will write our own Bootstrap code that will run on a target and we will want it to be as minimal as possible.

## Disassemble/Decompile the binary using GHIDRA

In case you've not installed it yet, pull down the latest version of GHIDRA from:

### Helpful Links

* Tricore Example Code / Loaders (will be useful for later posts)
  * http://www.infineon-autoeco.com/BBS/Detail/6835
  * http://bbs.21ic.com/archiver/tid-148660.html
  * https://github.com/w01230/inf_tc1791_bootloader


text:
# ArrayInterface.jl

[![Build Status](https://travis-ci.com/SciML/ArrayInterface.jl.svg?branch=master)](https://travis-ci.com/SciML/ArrayInterface.jl)
[![Build status](https://ci.appveyor.com/api/projects/status/s4vnsj386dyyv655?svg=true)](https://ci.appveyor.com/project/ChrisRackauckas/arrayinterface-jl)

Julia has only recently reached v1.0 and the AbstractArray interface is still
quite new. The purpose of this library is to solidify extensions to the current
AbstractArray interface which are put to use in package ecosystems like
DifferentialEquations.jl. Since these libraries are live, this package will
serve as a staging ground for ideas before they merged into Base Julia. For this
reason, no functionality is exported so that way if such functions are added
and exported in a future Base Julia there will be no issues with the upgrade.

## ismutable(x)

A trait function for whether `x` is a mutable or immutable array. Used for
dispatching to in-place and out-of-place versions of functions.

## aos_to_soa(x)

Converts an array of structs formulation to a struct of arrays.

## isstructured(x)

A trait function for whether a matrix `x` is a sparse structured matrix.

## can_setindex(x)

A trait function for whether an array `x` can use `setindex!`

## has_sparsestruct(x)

Determine whether `findstructralnz` accepts the parameter `x`

## findstructralnz(x)

Returns iterators `(I,J)` of the non-zeros in the structure of the matrix `x`.
The same as the to first two elements of `findnz(::SparseMatrixCSC)`

## fast_matrix_colors(A)

A trait function for whether `matrix_colors(A)` is a fast algorithm or a slow
(graphically-based) method.

## matrix_colors(A)

Returns an array of for the sparsity colors of a matrix type `A`. Also includes
an abstract type `ColoringAlgorithm` for `matrix_colors(A,alg::ColoringAlgorithm)`
of non-structured matrices.

## fast_scalar_indexing(A)

A trait function for whether scalar indexing is fast on a given array type.

## allowed_getindex(A,i...)

A `getindex` which is always allowed.

## allowed_setindex!(A,v,i...)

A `setindex!` which is always allowed.

## lu_instance(A)

Return an instance of the LU factorization object with the correct type
cheaply.

## issingular(A)

Return an instance of the LU factorization object with the correct type cheaply.

## safevec(v)

Is a form of `vec` which is safe for all values in vector spaces, i.e. if
is already a vector, like an AbstractVector or Number, it will return said
AbstractVector or Number.

## zeromatrix(u)

Creates the zero'd matrix version of `u`. Note that this is unique because
`similar(u,length(u),length(u))` returns a mutable type, so is not type-matching,
while `fill(zero(eltype(u)),length(u),length(u))` doesn't match the array type,
i.e. you'll get a CPU array from a GPU array. The generic fallback is
`u .* u' .* false` which works on a surprising number of types, but can be broken
with weird (recursive) broadcast overloads. For higher order tensors, this
returns the matrix linear operator type which acts on the `vec` of the array.

## restructure(x,y)

Restructures the object `y` into a shape of `x`, keeping its values intact. For
simple objects like an `Array`, this simply amounts to a reshape. However, for
more complex objects such as an `ArrayPartition`, not all of the structural
information is adequately contained in the type for standard tools to work. In
these cases, `restructure` gives a way to convert for example an `Array` into
a matching `ArrayPartition`.

## known_first(::Type{T})

If `first` of instances of type `T` are known at compile time, return that first
element. Otherwise, return `nothing`. For example, `known_first(Base.OneTo{Int})`
returns `one(Int)`.

## known_last(::Type{T})

If `last` of instances of type `T` are known at compile time, return that
last element. Otherwise, return `nothing`.

## known_step(::Type{T})

If `step` of instances of type `T` are known at compile time, return that step.
Otherwise, returns `nothing`. For example, `known_step(UnitRange{Int})` returns
`one(Int)`.

# List of things to add

- https://github.com/JuliaLang/julia/issues/22216
- https://github.com/JuliaLang/julia/issues/22218
- https://github.com/JuliaLang/julia/issues/22622
- https://github.com/JuliaLang/julia/issues/25760
- https://github.com/JuliaLang/julia/issues/25107

# Array Types to Handle

The following common array types are being understood and tested as part of this
development.

- Array
- Various versions of sparse arrays
- SArray
- MArray
- FieldVector
- ArrayPartition
- VectorOfArray
- DistributedArrays
- GPUArrays (CLArrays and CuArrays)
- AFArrays
- MultiScaleArrays
- LabelledArrays

## Breaking Release Notes

2.0: Changed the default of `ismutable(array::AbstractArray) = true`. We previously defaulted to
`Base.@pure ismutable(array::AbstractArray) = typeof(array).mutable`, but there are a lot of cases
where this tends to not work out in a way one would expect. For example, if you put a normal array
into an immutable struct that adds more information to it, this is considered immutable, even if
all of the `setindex!` methods work (by forwarding to the mutable array). Thus it seems safer to just
always assume mutability is standard for an array, and allow arrays to opt-out.


text:
# Creating mirrors in react-three-fiber & threejs

A short tutorial on how to create a mirrors scene with the react-three-fiber ecosystem.

By Marco Ludovico Perego and Gianmarco Simone

![Featured Image](https://github.com/emmelleppi/codrops-r3f-mirrors/blob/master/screenshot.jpg?raw=true)

[Article on Codrops](https://tympanus.net/codrops/?p=51167)

[Demo](http://tympanus.net/Tutorials/Mirrors/)

## Installation

Install dependencies:

```
yarn
```

Compile the code for development and start a local server:

```
yarn start
```

Create the build:

```
yarn build
```

## Credits

- [react-three-fiber](https://github.com/pmndrs/react-three-fiber)
- [three.js](https://threejs.org/)
- [React](https://reactjs.org/)

## Misc

Follow Marco Ludovico Perego: [Twitter](https://twitter.com/mlperego), [GitHub](https://github.com/emmelleppi)

Follow Gianmarco Simone: [Twitter](https://twitter.com/ggsimm), [GitHub](https://github.com/gsimone)

Follow Codrops: [Twitter](http://www.twitter.com/codrops), [Facebook](http://www.facebook.com/codrops), [GitHub](https://github.com/codrops), [Instagram](https://www.instagram.com/codropsss/)

## License

[MIT](LICENSE)

Made with :blue_heart: by [Codrops](http://www.codrops.com)


text:
# task-exec
> Execute system commands.

## The "exec" task

### Usage Examples

```js
var exec = new (require('task-exec'))
exec.run(inputs, options, logger)
```

### Options

#### options.command
Type: `command`

The command to run, with space-separated arguments

#### options.cwd
Type: `directory`

Current working directory of the child process

#### options.env
Type: `object`

Environment key-value pairs

#### options.timeout
Type: `number`
Default: `0`

If timeout is greater than 0, then it will kill the child process if it runs longer than timeout milliseconds.

## Release History
* 2014-07-13 0.1.0 Initial release.

## License
Copyright (c) 2014 Yuanyan Cao. Licensed under the MIT license.

repository: taskjs/task-exec

repo_name: taskjs/task-exec


text:
# HLS_SEARCH EXAMPLE

* Provides a simple base allowing to discover SNAP and the different interfaces
* C code is processing
  * a text placed in SDRAM (in the FPGA board located memory) and searches a host memory located pattern
  * data in array or in a stream flow for comparison

:star: Please check the [actions/hls_search/doc](./doc/) directory for detailed information

gha_language: C


text:
# spaced-repetition Group Project Week 2

###### 1. APi Endpoint for HOME & LOGIN (Api Facebook)

|       Route      |  HTTP   | Description |
|------------------|---------|-------------|
|/login      |   POST   | render to HOME|
|/home      |   GET   |Display HOME |
==============================

###### 2. APi Endpoint for USER

|       Route      |  HTTP   | Description |
|------------------|---------|-------------|
|/user      |   GET   |listing users |
|/user      |   POST   | insert new user |
|/user/:id   |   PUT   | Update user |
|/user/:id        |   DELETE  | delete user|
|/user/:id    |    GET | find one user|
================================

###### 3. APi Endpoint for CARD

|       Route      |  HTTP   | Description |
|------------------|---------|-------------|
|/card      |   GET   |listing cards |
|/card      |   POST   | insert new card |
|/card/:id   |   PUT   | Update card |
|/card/:id        |   DELETE  | delete card|
|/card/:id    |    GET | find one card|
================================

###### 4. APi Endpoint for DECK

|       Route      |  HTTP   | Description |
|------------------|---------|-------------|
|/deck      |   GET   |listing decks |
|/deck      |   POST   | insert new deck |
|/deck/:id   |   PUT   | Update deck |
|/deck/:id        |   DELETE  | delete deck|
|/deck/:id    |    GET | find one deck|

##### HOW TO RUN APPS
###### 1. The first NPM INSTALL
###### 2. Open a terminal and go to project folder and run nodemon app.js (server side)
###### 3. Open a terminal and go to project folder and run live-server (client side, optional)

repository: adamsaparudin/spaced-repetition

gha_language: CSS

repo_name: adamsaparudin/spaced-repetition


text:
we can use flake to produce unique ids for the routing aspect of our web server

the idea is that we will have permalinks of the form

packaage-archive.com/packages/ -> returns listing of packages
package-archive.com/package/UNIQ_ID -> permalink, where UNIQ_ID is an id consisting of timestamp+workerid+autoincrementingvariable
package-archive.com/package?uri=mypackage.tar.gz -> query strings on the package list for one package

repository: MatrixAI/Forge-Package-Archiving

repo_name: MatrixAI/Forge-Package-Archiving


text:
# quickMpl:

This short library provides class and functions I wrote during my PhD which helped me deal with the display of data.

# Classes and function:
## imshow_multiple:
A class which allows to display quantitative images while keeping the same scale between them.

repository: MaximeMatthes/quickMpl

repo_name: MaximeMatthes/quickMpl


text:
# Gutter

> *We are all in the gutter, but some of us are looking at the stars.*
>
> — Oscar Wilde

![Surface splatting](surface-splatting.png)

Behold my exploration of surface splatting in LÖVE.
The surface disks are drawn as indexed triangle pairs.
A pixel shader discards any pixel outside of the disk.

## Dual contouring

As an alternative to surface splatting, you can generate a regular triangle mesh using dual contouring:

```sh
love . --mesher dual-contouring
```

![Dual contouring](dual-contouring.png)

repository: elemel/gutter

repo_name: elemel/gutter


text:
#### Add Plan XML Request

        Element
        Description

        <add-plan>
        Add a recurring plan that subscriptions can be added to in the future.

        api-key*
        api-key is obtained in the Security Keys section of the Control Panel Settings.

        <plan>

        payments*
        The number of payments before the recurring plan is complete.

            Notes: '0' for until canceled

        amount*
        The plan amount to be charged each billing cycle.

        Format: x.xx

        name*
        The display name of the plan.

        plan-id*
        The unique plan ID that references only this recurring plan.

        day-frequency**
        How often, in days, to charge the customer. Cannot be set with 'month-frequency' or 'day-of-month'.

        month-frequency***
        How often, in months, to charge the customer. Cannot be set with 'day-frequency'. Must be set with 'day-of-month'.

        Values: 1 through 24

        day-of-month***
        The day that the customer will be charged. Cannot be set with 'day-frequency'. Must be set with 'month-frequency'.

        Values: 1 through 31 - for months without 29, 30, or 31 days, the charge will be on the last day

        </plan>

        </add-plan>

* 	Always required
** 	Required unless 'month-frequency' and 'day-of-month' is set.
*** 	Required unless 'day-frequency' is set.

#### Delete a Subscription

        Element
        Description

        <delete-subscription>
        Delete the subscription. Customer will no longer be charged.

        api-key*
        api-key is obtained in the Security Keys section of the Control Panel Settings.

        subscription-id*
        The subscription ID that will be deleted.

        </delete-subscription>

* 	Always required

repository: merchantprotocol/documentation

repo_name: merchantprotocol/documentation


text:
# Kludgine

A 2d rendering engine for the [Rust](https://rust-lang.org/) language.

![Kludgine is considered experimental](https://img.shields.io/badge/status-experimental-blueviolet)
[![crate version](https://img.shields.io/crates/v/kludgine.svg)](https://crates.io/crates/kludgine)
[![Live Build Status](https://img.shields.io/github/workflow/status/khonsulabs/kludgine/Tests/main)](https://github.com/khonsulabs/kludgine/actions?query=workflow:Tests)
[![HTML Coverage Report for `main` branch](https://khonsulabs.github.io/kludgine/coverage/badge.svg)](https://khonsulabs.github.io/kludgine/coverage/)
[![Documentation for `main` branch](https://img.shields.io/badge/docs-main-informational)](https://khonsulabs.github.io/kludgine/main/kludgine/)

Kludgine is named in a way to hopefully be ironic in nature, but it's being
designed and written by a developer that is fairly new to modern graphics
programming and rust. Thus, it is probably a
[kludge](https://en.wikipedia.org/wiki/Kludge).

## Why use Kludgine?

Kludgine is early in development and is subject to breaking API changes. That
being said, the API has started to stabilize, and these are the primary benefits
of Kludgine:

### Fast and highly portable

Kludgine is built upon [easygpu](https://github.com/khonsulabs/easygpu), which
is based on [wgpu](https://lib.rs/wgpu). `wgpu` is an experimental WebGPU
implementation, and it supports DirectX on Windows, Vulkan on Linux, Metal on
iOS/Mac OS, and is close to working within the web browser. Kludgine does not
yet currently work inside of the web browser, but we eventually will support it.

Apps and games written in Kludgine should have no problem running with
reasonable performance on budget hardware, even without a discrete GPU.

### Intelligent Redrawing

While most games want a steady framerate, many developers may want to allow
their programs to not redraw constantly. Kludgine makes managing this easy with
the
[`RedrawStatus`](https://khonsulabs.github.io/kludgine/main/kludgine/app/struct.RedrawStatus.html)
type, allowing easy scheduling of future frame redraws or immediately requesting
a redraw.

If you do want a consistent redraw, implement
[`Window::target_fps`](https://khonsulabs.github.io/kludgine/main/kludgine/app/trait.Window.html#method.target_fps).

### Multi-window support

Kludgine has multi-window support. In general, most games don't need multiple
windows, but general purpose applications do.

### Ease of use

This is a bit nebulous but examples include:

- Ergonomic and consistent API: This is a work in progress, but the goal is a
  consistent design that is easy to read and write.
- Modular design: Kludgine started becoming a large engine, but in the process
  of creating [Gooey](https://github.com/khonsulabs/gooey), this crate became a
  much leaner rendering and windowing crate. It will continue evolving to allow
  it to be used standalone, within other wgpu applications, or as a frontend for
  Gooey.

```rust
let texture = Texture::load("kludgine/examples/assets/k.png")?;
let sprite = SpriteSource::entire_texture(texture);
sprite.render_at(
    scene,
    Rect::from(scene.size()).center(),
    SpriteRotation::around_center(self.rotation_angle),
);
```

## Getting Started

To use Kludgine, your project must be using [the new features
resolver](https://doc.rust-lang.org/cargo/reference/features.html#feature-resolver-version-2). The two
lines to add to your `Cargo.toml` look like this:

```toml
[lib]
resolver = "2"

[dependencies]
kludgine = "0.1.0-dev.3"
```

The `resolver` requirement is inherited from `wgpu`. This setting [will become
the default in the 2021
edition](https://github.com/rust-lang/cargo/issues/9048).

## About

This is being developed by and for [Khonsu Labs](https://khonsulabs.com/) for
[Cosmic Verge](https://github.com/khonsulabs/cosmicverge). I hope it will be
useful to others as well.

This code is dual-licensed under the [MIT License](./LICENSE-MIT) and [Apache
License 2.0](./LICENSE-APACHE). Fonts in this repository are not included by
default, and are [solely licensed under the Apache License
2.0](./fonts/README.md).

repository: tgolsson/kludgine

gha_license_id: NOASSERTION

repo_name: tgolsson/kludgine


text:
---
title: Manage users
seotitle: Manage users in InfluxDB
description: Manage users in InfluxDB using the InfluxDB UI or the influx CLI.
v2.0/tags: [users, authentication]
menu:
  v2_0:
    name: Manage users
weight: 11
products: [oss]
---

Users are those with access to InfluxDB.
To grant a user permission to access data, add them as a [member of an organization](/v2.0/organizations/members/)
and provide them with an [authentication token](/v2.0/security/tokens/).

The following articles walk through managing users.

{{< children >}}


text:
# DAFDT
Data Augmentation From Decision Trees

## Contributing
Inside the folder coding is a IntelliJ maven project. So if you are running the IntelliJ IDE https://www.jetbrains.com/idea/ you can simply open the project pointing to that folder once you've cloned from git.


text:
jms: demonstrates how to connect to the local ActiveMQ broker and use JMS messaging between two Camel routes
===================================

What is it?
-----------

This quickstart demonstrates how to connect to the local ActiveMQ broker and use JMS messaging between two Camel routes.

In this quickstart, orders from zoos all over the world will be copied from the input directory into a specific
output directory per country.

In studying this quick start you will learn:

* how to connect to the local ActiveMQ broker
* how to define a Camel route using the Blueprint XML syntax
* how to build and deploy an OSGi bundle in Fabric8
* how to use the Content Based Router (CBR) enterprise integration pattern

For more information see:

* http://camel.apache.org/content-based-router.html for more information about the CBR EIP
* http://fabric8.io/#/site/book/doc/index.md for more information about using Fabric8

System requirements
-------------------

Before building and running this quick start you need:

* Maven 3.0.4 or higher
* JDK 1.6 or 1.7
* Fabric8

Build and Deploy the Quickstart
-------------------------------

* Verify etc/users.properties from the Fabric8 installation contains the following 'admin' user configured:

        admin=admin,admin

* As demo uses AMQ Camel component, we need to provide the connection factory configuration as well. For that copy `src/main/resources/etc/io.fabric8.mq.fabric.cf-default.cfg` to the `etc/` directory of the distribution.
    Also, if you don't use default admin/admin credentials, change the configuration file appropriately.

* Change your working directory to `jms` directory.
* Run `mvn clean install` to build the quickstart.
* Start Fabric8 by running bin/fabric8 (on Linux) or bin\fabric8.bat (on Windows).

* In the Fabric8 console, enter the following commands:

        features:addurl mvn:io.fabric8.quickstarts.fabric/jms/${project.version}/xml/features
        features:install quickstart-jms

* You can check that everything is ok by issuing the command:

        osgi:list

   your bundle (with all other dependencies) should be present at the end of the list

Use the demo
--------------

To use the application be sure to have deployed the quickstart in Fabric8 as described above. Successful deployment will create and start a Camel route in Fabric8.

1. As soon as the Camel route has been started, you will see a directory `work/jms/input` in your Fabric8 installation.
2. Copy the files you find in this quickstart's `src/main/resources/data` directory to the newly created `work/jms/input` directory.
3. Wait a few moments and you will find the same files organized by country under the `work/jms/output` directory.
  * `order1.xml` in `work/jms/output/others`
  * `order2.xml` and `order4.xml` in `work/jms/output/uk`
  * `order3.xml` and `order5.xml` in `work/jms/output/us`

4. Use `log:display` to check out the business logging.
        Receiving order order1.xml
        Sending order order1.xml to another country
        Done processing order1.xml

Undeploy the Bundle
-------------------

To stop and undeploy the bundle in Fabric8:

1. Enter `osgi:list` command to retrieve your bundle id
2. To stop and uninstall the bundle enter

        osgi:uninstall <id>

Use the demo in fabric
----------------------

We have a convenient profile that makes it easy to run the demo in fabric environment. First thing you need to do is create a broker (if you don't have any running)

    mq-create --create-container node --minimumInstances 1 broker

Next create a container with the `example-quickstarts-jms` profile

    container-create-child --profile example-quickstarts-jms --profile mq-client-default root example

Note that demo uses AMQ Camel component that can obtain broker location from Fabric registry. So we need to add appropriate `mq-client-xxx` profile as well.
In this case, as the broker is in a default group, we used `mq-client-base`.
Also, the work directory is located in the container that hosts the demo profile, `instances/example/work` in this particular case.


text:
prh-pokemon
===========

Compares company names from the Finnish company registry (PRH) to Pokémon names.

`pokemon.json` via [sindresorhus/pokemon](https://github.com/sindresorhus/pokemon) (MIT license).

Usage
-----

* Create a Python 3 virtualenv, install the requirements from requirements.txt.
* Run `python3 download_prh.py -b 61 -b 62 -b 63` to download all IT companies into `prh.shelf`.
* Run `python3 calculate_distances.py --out-file distances.pickle --result-file-template 'best-{metric}.txt' --best-json best.json` to calculate various distance metrics.
  * Add `--first-word-only` to only take the first word of each name into account.
  * The script does some flattening and preprocessing (e.g. removing "oy", "ab", etc.) before matching. It may be suboptimal.
* Grep the .txts to your heart's content.

repository: akx/prh-pokemon

repo_name: akx/prh-pokemon


text:
# g_spec

g_spec is a spectral simulation program for converting molecular energy and
dipole trajectories into simulated linear and nonlinear optical spectra. In
conjunction with the open-source program g_amide, it enables the user to
translate  structural trajectories from a molecular dynamics (MD) simulation
in the GROMACS simulation package (www.gromacs.org) into Amide I (backbone
carbonyl stretch) vibrational spectra.

The basic input to the g_spec program is a set of text files providing a
trajectory of exciton-like Hamiltonians and transition-dipole moment vectors.
In the context of protein Amide I calculations, such files can be generated
using the g_amide program referenced above. Using this input, g_spec
simulates linear absorption and nonlinear (two-dimensional) spectroscopic
signals using a variety of methods.

DEPENDENCIES

g_spec calls several external libraries in its function. These libraries MUST
be available during installation or the code will not compile:

(1) A working GROMACS installation for MD simulations. (See www.gromacs.org).

(2) A functional installation of FFTW3 for fast Fourier transforms (see
www.fftw.org).

(3) Working LAPACK and LAPACKE libraries for linear algebra processing (see
www.netlib.org/lapack).

(4) Working BLAS libraries for linear algebra processing (see
www.netlib.org/blas).

Although not required, g_spec can also make use of OpenMP libraries to
implement a certain level of parallelization into the calculation. To make use
of these features, a working OpenMP installation must also be available.

INSTALLATION

(0) Choose an installation directory.

This may be any directory where you have read/write permissions, but should be
a permanent installation location (e.g. not your user download folder). For
example, if your username is mike, you might wish to install the program in an
"apps" directory such as /home/mike/apps/. Move the g_spec directory (where
this README.txt file is located) into the chosen installation directory and at
the command prompt cd to that location, e.g. in our example

        cd /home/mike/apps/g_spec/

(1) Prepare the Makefile.

The Makefile specifies machine parameters for compiling the code. Two
alternative makefiles are included in this distribution. The default file
named simple "Makefile" makes use of the gcc C-language compiler, installed
onmost linux-based operating systems. The second, Makefile_icc is configured
for compilation with the intel icc compiler. This compiler is able to
optimized the g_spec installation in a fashion that make make it run faster
on some systems. If the icc compiler is available on your system, we recommend
using it. To do so, enter at the command line

	cp Makefile_icc Makefile

Note that a backup copy of the gcc makefile is stored as Makefile_gcc if you
wish to rever to gcc installation.

Next, modify the Makefile. E.g. to open the file using vi, type at the console

        vi src/Makefile

Modifications should be required onlyin the first four lines of the file.
Three lines should be checked.

First, the flag OMP_PARALLEL should be set to either "TRUE" or (by default)
"FALSE". If set to true, this flag enables parallel processing using the
OpenMP library. Parallel processing will enable to code to execute
calculations faster if multiple processors are available, but installation
requires an OpenMP package accessible during compilation. (This is the -lgomp
flag under the LIBFLAGS variable in the Makefile). If you do not have an
OpenMP library available (or do not know how to access it), leave the flag set
to FALSE.

Second, the GROMACS_DIR flag should be set to the absolute path of your
GROMACS installation directory, e.g. /home/mike/apps/gromacs/.

Finally, the LAPACK_DIR flag must be set to the absolute path of the LAPACK
installation directory, e.g. /home/mike/apps/lapack. Note that this package
must include the lapacke header files for linking with C code.

(2) Compile the code. In the same directory as your Makefile and source code
enter at the command line

	make

The make program should locate and read your Makefile and the selected
compiler will compile the code. If you encounter errors, check that the
various libraries (-lxxx flags) and included header files (-I flags) are
available to the system. If you encounter difficulties, try using the simplest
settings possible first, using the gcc compiler (assuming it is available on
your system) with OMP_PARALLEL set to FALSE.

(3) Run a test calculation! A set of example input files is included in the
directory g_spec/test/input, along with a brief tutorial describing basic
syntax for the program.


text:
# Contributing to GreenFlag

## Developing

We're following a pretty standard process for a Github hosted project:

- Fork the project (core team members can skip this and work directly in this repo)
- Clone to your local machine
- Create a branch for your changes
- Push your branch to Github
- Submit a PR to master.
- After code review, your PR will be merged into master for inclusion in the next release.

## Release

The `gem-release` gem is included as a development dependency.  Documented here is the "normal release" process using that gem.  More options can be found here: https://github.com/svenfuchs/gem-release

- You should be on the `master` branch, with all of the releasable code merged in.
- Run `rake spec` to make sure the specs pass.
- Run this command: `gem bump --version minor --tag`
  - That's for a "minor" version.  You can also use "major" or "patch".
  - This does the following:
    - Increments the version in `lib/green_flag/version.rb` and commits that change
    - Creates a tag for the new version
    - Pushes the commits and tag to Github
- Run this command: `gem release`
  - This actually pushes the gem to RubyGems.
- In your project that uses GreenFlag, update to the latest: `bundle update green_flag`

gha_language: Ruby