text:
data-analysis-template
======================
Download needed R packages, run:

Rscript requirements.R

To reproduce the data (all scripts in /scripts on github):

We cleaned the raw data in stata to get clean1.rda, cannot be reproduced. Too large to open in R.

For the rest of the data run:

Rscript clean_data.R #Will produce clean2.rda

Rscript data2mat.R #will produce data.mat for matlab analysis

Analysis:

Rscript regression.R #produces linear regression graphs in /graphs, and corresponding data in /data/simulated

Rscript regression_bystate.R #produces us map graphs of coefficients of linear regression in /graphs, and corresponding data in /data/simulated

matlab -r matlab_plots.m #will produce graphs of percent growth in /graphs, and corresponding data in /data/simulated. This is assuming you have matlab.

repository: cynthiawu/data-analysis-template

repo_name: cynthiawu/data-analysis-template


text:
# swagger-router

> Opinionated wrapper around express

Opinionated wrapper around express, which adds in validation via [strummer](https://github.com/Tabcorp/strummer/) and documentation via [swagger](https://swagger.io/)

## Table of contents

- [Getting started](#getting-started)

## Getting started

Add to package.json

```
{
  "dependencies": {
    "swagger-router": "git+https://github.com/nguyenchr/swagger-router.git#master"
  }
}
```

```js
const express = require('express')
const bodyParser = require('body-parser')
const s = require('strummer')
const { router, errorHandler } = require('swagger-router')

const server = express()
server.use(bodyParser.json())

// tags, paths, definitions get added from the route definitions
// everything else is provided here
const swaggerBaseProperties = {
  swagger: '2.0',
  info: {
    description: 'This is my api',
    version: '1.0.0',
    title: 'My api',
    termsOfService: null,
    contact: {
      email<EMAIL_ADDRESS>    },
    license: {
      name: 'Apache 2.0',
      url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
    }
  },
  host: 'https://myapi.com',
  basePath: '/',
  tags: [{
    name: 'Another tag'
  }],
  consumes: ['application/json'],
  produces: ['application/json'],
  schemes: [
    'https'
  ],
  paths: {},
  securityDefinitions: {},
  definitions: {}
}

const routerInstance = router(server, {
  validateResponses: true, // false = responses not validated,true = all responses matching the defined status codes in the schema will be validated and an error throw, DEFAULT: false
  swaggerBaseProperties // the base properties to include in the swagger definition
})

// define routes
routerInstance.put({
  url: '/api/something/:id',
  schema: { // request and response schemas, the endpoint will use these to validate incoming requests and outgoing responses
    request: {
      query: s.objectWithOnly({ hello: s.string(), world: s.string({ min: 2, max: 4 }) }),
      params: s.objectWithOnly({ id: s.integer({ parse: true }) }),
      body: s.objectWithOnly({ action: s.enum({ values: ['create', 'update'], verbose: true }) })
    },
    responses: {
      201: s.objectWithOnly({ id: s.integer() })
    }
  },
  // pre handlers are run before request validation and before your handlers
  // usually used for authentication
  preHandlers: [async (req, res, next) => {
    req.apiToken = getToken()
    next()
  }],
  handlers: [async (req, res) => {
    return res.status(201).json({
      id: parseInt(req.params.id)
    })
  }],
  isPublic: true,
  tags: ['Something'], // for swagger
  summary: 'This route is about something', // for swagger
  description: 'This route does something', // for swagger
  validateResponses: false, //  false response body will not be validated against schema, true = response body validated against schema DEFAULT: false
  warnOnRequestValidationError: false // false = throw error, true = log warning DEFAULT: false
  logRequests: true, // true = request and response will be logged DEFAULT: false,
  correlationIdExtractor: (req, res) => { return req.params.id }, // for use when logRequests is TRUE, this will be used to extract the correlationid from the request/response for use in the log output DEFAULT: null
  logger: new Bunyan(), // you can pass in a logger that will be used for logging output , must have methods `log`, `warn` and `error` DEFAULT: console
})

// this is the endpoint that the swagger ui will be served on
routerInstance.serveSwagger('/docs')

// you don't have to use our error handler if you want a custom one
server.use(errorHandler)
server.listen()
```

## Writing controllers

All handlers in the route definition are wrapped inside an async handler so there is no need to worry about calling next, or catching exceptions

```js

const controller = async (req, res) => {
  const response = await updateSomeDatabase(req.body)
  res.json({
    status: 200,
    message: null,
    result: response
  })
}

```

If you want to return something that isn't a successful response, you can easily do this by throwing a error

```js
const { errors } = require('swagger-router)

const controller = async (req, res) => {
  if (req.params.id === 1) {
    throw new errors.UnprocessableEntityError('1 is not a valid id')
  }
  const response = await updateSomeDatabase(req.body)
  res.json({
    status: 200,
    message: null,
    result: response
  })
}

// this will manifest as
// {
//   "status": 422,
//   "message": "1 is not a valid id",
//   "errors": ["1 is not a valid id]
// }

```

NOTE: Only a limited amount of http error codes have been mapped so far, if the need for any arise we can easily add them

## Documentation

Use `serveSwagger` to define the endpoint you wish to serve your docs at
This will serve a swagger ui html page, with the swagger definition that is generated from your routes

If you want the raw swagger json definition you can use `toSwagger`

## Contributing

Make your change, make a PR

* `npm test`

repository: nguyenchr/swagger-router

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: nguyenchr/swagger-router


text:
---
title: Taxonomy of agency
date: 2019-09-06
tags: ML, AI, alignment, optimization
---
Dynamics vs. decision theory.
:   The current [compositional framework](/content/Projects/OpenAgents.md) I'm thinking about is more dynamics-oriented, but I'd like to think more about the decision theory/probability theory side of things.
    Maybe a more thorough description of this dichotomy is what is outline [here](https://www.lesswrong.com/posts/hLFD6qSN9MmQxKjG5/embedded-agency-via-abstraction#mH6woJCNuw8iozuiK)
    I'm not sure these names are good, though - obviously the "dynamic" theory is also a decision theory?

Being *an optimizer* vs being *optimized*

:   See [risks from learned optimization](https://www.alignmentforum.org/posts/FkgsxrGf3QxhfLWHG/risks-from-learned-optimization-introduction) and [utility $\neq$ reward](https://www.lesswrong.com/posts/bG4PR9uSsZqHg2gYY/utility-reward).
    (An *optimizer* will act to increase its utility - but an optimizer created by reinforcement learning is *optimized* to increase its reward - the two are not the same).

The two notions of optimizers: "Agents" and "Optimization methods"

: See [two senses of optimizer](https://www.lesswrong.com/posts/rvxcSc6wdcCfaX6GZ/two-senses-of-optimizer)

More could be added here.

license: MIT

repository: AyeGill/personal-site

repo_name: AyeGill/personal-site


text:
## Week 11
### Objectives
- Unsupervised learning with K-Means Clustering
- Supervised learning with multiple classifiers: Naive Bayes, k-nearest neighbor, Logistic Regression, Support Vector Machine (SVM), Multi-layer perceptron classifier
### Exercises
Select `Raw` at the following link and save the Jupyter notebook file to `sharedfolder` on your desktop.
1. [Unsupervised Learning: k-means clustering](https://github.com/tanyaclement/cpcda18.github.io/blob/master/Week-11.1_Clustering.ipynb)
2. [Supervised Learning](https://github.com/tanyaclement/cpcda18.github.io/blob/master/Week-11.2_Supervised-learning.ipynb)

### Getting started
Open Terminal in macOS and launch our Docker container:

```
docker rm -f pcda_ubuntu
docker pull pcda17/ubuntu-container
docker run --name pcda_ubuntu -ti -p 8889:8889 --volume ~/Desktop/sharedfolder/:/sharedfolder/ pcda17/ubuntu-container
```

In Windows 10, open PowerShell and enter the following to launch the Docker container:

```
docker rm -f pcda_ubuntu
docker pull pcda17/ubuntu-container
docker run --name pcda_ubuntu -ti -p 8889:8889 --volume C:\Users\***username_here***\Desktop\sharedfolder:/sharedfolder/ pcda17/ubuntu-container
```

Open any browser and type (your Juypter Notebook will launch):
```
localhost:8889
```


text:
# Creating Elements

We cannot directly use component classes to construct `ReactElement`s, because (from React documentation):

>We can't just create an instance of the class using the constructor and use that as an element because a single element can be inserted into the DOM in several places. We need to create an instance of that class for each insertion point of the element. This is why elements are not instances of the class.

[New React Element Factories and JSX](https://gist.github.com/sebmarkbage/d7bce729f38730399d28)

React uses [JSX](https://facebook.github.io/react/docs/jsx-in-depth.html) to create elements from component classes. Since we can't use JSX,  we (all third party langs that compile to JS and interface with react) need a different approach here.

Sri comes with a few helpers methods to achieve this.  [ElementFactory](https://github.com/chandu0101/sri/blob/master/core/src/main/scala/sri/core/ElementFactory.scala)

## Examples

Let's say we have a react component `HelloMessge`. To construct element for this component, first we need to create a reusable factory and then we can use that factory to create elements by passing props and children.

```scala
import sri.core.ElementFactory._
@ScalaJSDefined
class HelloMessage extends ReactComponent[Unit,Unit] {
  def render() = {
   View(...view_props)("Hello Sri")
  }
}
val element = makeElement[HelloMessage]
```

Please check the source code of [ElementFactory](core/src/main/scala/sri/core/ElementFactory.scala) for all helper methods documentation.

repository: nafg/sri

repo_name: nafg/sri


text:
# The Wonderfull World Of JavaScript

## Navigation
1. [Home](README.md)
1. [Functions](/Js-note-pages/function-notes.md)
1. [Loops](/Js-note-pages/loop-notes.md)
1. [objects](/Js-note-pages/object-notes.md)

[CheetSheet](/Js-note-pages/javascript-cheetsheet.md)

## things to remember

- strings are things
- contitional statments are such as `if , while ,for ` each has its own use; see [flow control](loop-notes.md) in loops for more information
- variables are what you set your information to see [functions](function-notes.md) for more information
- ### data types
    - strings can be numbers words or expressions as long as they are in quotes
    - javascript recoginzes numbers on their on for the most part
    - boolean are i/o or true/false data
- JS allows you to access content
    - things like all the tags on a page or even user info
- you can use JS to modify content
- create rules
- reactions
    - button presses
    - clicks and stuff
-  scripts are groups of insturctions to do a task
    - each of these instrctions are called statements
- currly braces indicate code blocks.
- comment in your Javascript to tell you and future you what you where thinking.

repository: M-Ravenmoore/Notebook

repo_name: M-Ravenmoore/Notebook


text:
# vgp-assembly
VGP repository for the genome assembly working group

## Contents
* Galaxy Workflow
* DNAnexus Workflow
* Docker images with WDL Workflow
* Pipeline for local run
* MitoVGP pipeline
* Instructions for AWS s3 genomeark
* Meta data
* Citation

## Galaxy Workflow

Starting the VGP v2.0 pipeline, the production has been moved to the Galaxy environment. The major difference from the [Rhie et al. 2021](https://doi.org/10.1038/s41586-021-03451-0) is the replacement of the CLR component to HiFi and additional options for QCing and Hi-C scaffolding.
* [Tutorials](https://training.galaxyproject.org/training-material/topics/assembly/tutorials/vgp_genome_assembly/tutorial.html): starting point for new trainees
* [Workflows](https://galaxyproject.org/projects/vgp/workflows/): dockstore workflow, input, and output for each assembly steps

## DNAnexus Workflow

The production of the VGP v1.0-1.1 assemblies has been performed on DNAnexus, which is available for anyone that registers.
We welcome new trainees who are interested in leading the assembly of VGP and other genomes. Feel free to contact us.
* [Tutorials](https://github.com/VGP/vgp-assembly/blob/master/tutorials/DNAnexus_workflow_1.7_tutorial.md): starting point for new trainees
* [Workflows](https://github.com/VGP/vgp-assembly/tree/master/dx_workflows): workflow to run each assembly steps
* [Applets](https://github.com/VGP/vgp-assembly/tree/master/dx_applets): individual applets in the workflow
* [Retrieve job info](https://github.com/VGP/vgp-assembly/tree/master/dx_scripts)

## Docker images with WDL Workflow

The scaffolding pipeline to run on generic architecture and Docker containers is available to the public. This includes a WDL implementation of the scaffolding portion of VGP Assembly, as well as some of the QC steps. Note that Falcon assembly and Arrow polishing are not included.

* [WDL Pipeline](https://github.com/VGP/vgp-assembly/blob/master/wdl_pipeline/WDL_Manual.md): read the manual first

## Pipeline for local run

The local pipeline is available for each individual step for scaffolding, polishing, and evaluation as bash scripts. These scripts were used to locally assemble the first 17 genomes described in [Rhie et al. 2021](https://doi.org/10.1038/s41586-021-03451-0).

Note the scripts are optimized to run on a Slurm schedular and tested on [Biowulf](https://hpc.nih.gov/). All submitter scripts have a prefix of `_submit_`.

* [Pipeline](https://github.com/VGP/vgp-assembly/tree/master/pipeline)

## MitoVGP pipeline

Pipeline for generating mitochondrial sequences is available on a conda release.
* [MitoVGP](https://github.com/VGP/vgp-assembly/tree/master/mitoVGP)

## Instructions for AWS s3 genomeark

This is only relevant for our collaborators and data managers, for sharing sequencing data on genomeark not produced by VGP.
* [Upload to genomeark](https://github.com/VGP/vgp-assembly/tree/master/aws_upload)
* [Symlink s3 objects to DNAnexus](https://github.com/VGP/vgp-assembly/tree/master/AWS_bucket)
* [Data structure on AWS genomeark and DNAnexus](https://github.com/VGP/vgp-assembly/blob/master/DNAnexus_and_AWS_data_structure.md)

## Meta data

The meta data proposal and specifications. Actual meta data is stored in [this repository](https://github.com/VGP/vgp-metadata).
* [Proposal](https://github.com/VGP/vgp-assembly/tree/master/metadata_proposal)
* [Specimen naming scheme](https://github.com/VGP/vgp-assembly/blob/master/VGP_specimen_naming_scheme.md)

## Citation
* VGP assemblies and genome assembly pipeline: Rhie et al., Towards complete and error-free genome assemblies of all vertebrate species, Nature 2021. doi: https://doi.org/10.1038/s41586-021-03451-0

* Mitochondrial genome assembly pipeline: Formenti et al., Complete vertebrate mitogenomes reveal widespread repeats and gene duplications, Genome Biology 2021. doi: https://doi.org/10.1186/s13059-021-02336-9

repository: VGP/vgp-assembly

gha_language: Shell

gha_license_id: NOASSERTION

repo_name: VGP/vgp-assembly


text:
# Sofia2 Android API

*Read this in other languages: [English](README.md), [Spanish](README.es.md).*

## Copyright notice

© 2013-15 Indra Sistemas S.A.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

## API documentation

Before using the SSAP API for the first time, we strongly recommend that you learn the main concepts of the Sofia2 platform. They have been included in the Sofia2 developer documentation, which can be downloaded from http://sofia2.com/desarrollador_en.html.

## Build instructions

The Android API is distributed as a maven project. Its artifact can be built and installed in the local maven repository using the following commands:

```
cd <root of your copy of the repository>
mvn clean install [-Dmaven.test.skip]
```

## Android Studio dependencies

Upon build, place the resulting .jar under the libs directory of your Android project. Then you need to update your build.gradle file inside the app directory with these lines:
```
  repositories {
      mavenCentral()
  }
  dependencies {
      compile 'org.apache.commons:commons-lang3:3.5'
      compile 'org.fusesource.hawtbuf:hawtbuf:1.11'
      compile 'org.fusesource.hawtdispatch:hawtdispatch:1.22'
      compile 'org.fusesource.hawtdispatch:hawtdispatch-transport:1.22'
      compile 'org.fusesource.mqtt-client:mqtt-client:1.14'
      compile 'com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.8.6'
      compile 'com.fasterxml.jackson.core:jackson-core:2.8.6'
      compile 'com.fasterxml.jackson.core:jackson-databind:2.8.6'
      compile 'com.fasterxml.jackson.core:jackson-annotations:2.8.6'
      compile files('libs/ssap-android-1.1.0.jar')
  }
```
## Contact information

If you need support from us, please feel free to contact us at [plataformasofia2<EMAIL_ADDRESS>or at www.sofia2.com.

And if you want to contribute, send us a pull request.

repository: syahrialr/android-api

repo_name: syahrialr/android-api


text:
# AES implementation in Vivado HLS
This directory contains the necessary files to make use of our AES C++ HLS design.

We tested the AES Cipher, Inverse Cipher, and Full (wrapper over the previous two) in Vivado HLS C sim, C/RTL co-sim, and on a PYNQ-Z1 board. The design source files, testbench source files and the SDK test are provided. Additionally, Vivado HLS projects and reports are provided.

For help to run on hardware, generate the IP with Vivado HLS, then make a Vivado Project, then execute in the SDK. Detailed instructions are provided in the following tutorials:
- http://venividiwiki.ee.virginia.edu/mediawiki/index.php/ToolsXilinxLabsHelloZynq
- http://venividiwiki.ee.virginia.edu/mediawiki/index.php/ToolsXilinxLabsRTLHLSIP#Custom_IP_block_using_High-Level_Synthesis
- http://venividiwiki.ee.virginia.edu/mediawiki/index.php/ToolsXilinxLabsRTLHLSAES


text:
# Coquito Express

Just another ES6 expressjs + bookshelf boilerplate

## Features

* Initially just for APIs but you can add 'views' easily
* ES6 support via [babel](https://babeljs.io)
* Vagrant with [PostgreSQL](https://www.postgresql.org): just for test purpose, if you have other database supported by [Bookshelf](http://bookshelfjs.org/) please change the [Database Configuration](https://github.com/dolcalmi/coquito-express/blob/master/config/database.js)
* Useful [middlewares](https://github.com/dolcalmi/coquito-express/blob/master/app/middlewares/vendor.js)
* Ember like structure. Just begin with app/app.js
* Independent [Business Core](https://github.com/dolcalmi/coquito-express/tree/master/lib/myapp-core) from API Layer
* i18n support (english and spanish)
* API with:
    * Security by [Passport](http://passportjs.org/) and [passport-jwt](https://github.com/themikenicholson/passport-jwt)
    * Preconfigured [routes](https://github.com/dolcalmi/coquito-express/blob/master/app/router.js) signup, activate account, login, change password, forgot password, reset password and a demo path for 'users'
    * Emails not included but you can add them [here](https://github.com/dolcalmi/coquito-express/blob/master/lib/myapp-core/repositories/production/notification.js)
* Preconfigured npm commands:
    * db:create [migration file name]: create a new db migration file
    * db:migrate : run pending migrations
    * db:rollback : rollback the last migration
    * db:create:seed [seed file name]: create a seed file
    * db:seed : run the seeds
* [Ember client](https://github.com/dolcalmi/ember-coquito-express)

## Prerequisites

You will need the following things properly installed on your computer.

* [Git](http://git-scm.com/)
* [Node.js](http://nodejs.org/) (with NPM)
* [Vagrant](https://www.vagrantup.com/)

## Installation / Initial setup

* `git clone git@github.com:dolcalmi/coquito-express.git`
* change into the new directory
* `rm -rf .git && git init && npm init` (optional, make it yours)
* `npm install`
* `vagrant up` (may take a while)
* `npm run db:migrate`
* `npm run db:seed` (create an active user<EMAIL_ADDRESS>with password 123456)

## Running / Development

* `npm start`
* Visit your app at [http://localhost:3000/v1](http://localhost:3000/v1).
* Also, you can test it using [Postman](https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en) json (MyApp.Postman.json) or [Ember client for Coquito Express](https://github.com/dolcalmi/ember-coquito-express)

### Deploying

* Update your database connection in config/database.js
* `npm run build` (compiles with babel and move all to dist folder)
* deploy dist folder and run `NODE_ENV=production node dist/bin/www.js` or
* `NODE_ENV=production npm run serve`

## This project code and structure were inspired by

* [ember-cli](http://ember-cli.com/)
* [Express' application generator](https://github.com/expressjs/generator)
* [Express' Production Best Practices: Security](http://expressjs.com/en/advanced/best-practice-security.html)
* [Express & ES6 REST API Boilerplate](https://github.com/developit/express-es6-rest-api)
* [Example Node Server w/ Babel](https://github.com/babel/example-node-server)

repository: dolcalmi/coquito-express

repo_name: dolcalmi/coquito-express


text:
# reed-solomon
Reed-Solomon erasure coding in pure Javascript with an optional C++ binding for multi-core throughput. A port of the [JavaReedSolomon](https://github.com/Backblaze/JavaReedSolomon) library released by [Backblaze](http://backblaze.com). For an introduction to erasure coding, see the post by Brian Beach on the [Backblaze blog](https://www.backblaze.com/blog/reed-solomon/). Special thanks to [Backblaze](http://backblaze.com).

## License
`reed-solomon` is licensed under the [MIT License](https://en.wikipedia.org/wiki/MIT_License), which means that you can use it in your own projects for free. You can even use it in commercial projects.

## Installation

#### Linux, OS X
This will compile the native binding automatically:
```
npm install @ronomon/reed-solomon
```

#### Windows
This will skip compiling the native binding automatically:
```
npm install --ignore-scripts @ronomon/reed-solomon
```

## Efficiency
Data redundancy is typically achieved through mirroring or replication at a cost of 3x the original data. With Reed-Solomon erasure codes, you can achieve better redundancy at a cost of only 1.5x the original data. Various storage efficiencies of 1.4x and 1.18x are also possible. You can trade storage efficiency, redundancy and recovery time by fine-tuning the number of data shards and parity shards you use.

## Performance
`reed-solomon` includes a Javascript binding as well as an optional native binding. The native binding executes asynchronously in Node's threadpool for multi-core throughput and scalability without blocking the event loop:
```
           CPU: Intel(R) Xeon(R) CPU E3-1230 V2 @ 3.30GHz
         Cores: 8
       Threads: 4

============================================================

        Encode: 10000 x (Data=10 Parity=4 Shard=256)
    Javascript: Latency: 0.028ms Throughput: 88.89 MB/s
        Native: Latency: 0.044ms Throughput: 224.56 MB/s

        Encode: 10000 x (Data=10 Parity=4 Shard=1024)
    Javascript: Latency: 0.064ms Throughput: 159.75 MB/s
        Native: Latency: 0.054ms Throughput: 747.45 MB/s

        Encode: 10000 x (Data=10 Parity=4 Shard=4096)
    Javascript: Latency: 0.207ms Throughput: 197.02 MB/s
        Native: Latency: 0.124ms Throughput: 1312.82 MB/s

        Encode: 2048 x (Data=10 Parity=4 Shard=65536)
    Javascript: Latency: 3.099ms Throughput: 211.43 MB/s
        Native: Latency: 1.637ms Throughput: 1597.83 MB/s

        Encode: 1024 x (Data=10 Parity=4 Shard=131072)
    Javascript: Latency: 6.202ms Throughput: 211.27 MB/s
        Native: Latency: 3.357ms Throughput: 1558.86 MB/s

        Encode: 128 x (Data=10 Parity=4 Shard=1048576)
    Javascript: Latency: 51.338ms Throughput: 204.23 MB/s
        Native: Latency: 26.021ms Throughput: 1595.93 MB/s

============================================================

        Decode: 10000 x (Data=10 Parity=4 Shard=256)
    Javascript: Latency: 0.068ms Throughput: 37.10 MB/s
        Native: Latency: 0.246ms Throughput: 41.36 MB/s

        Decode: 10000 x (Data=10 Parity=4 Shard=1024)
    Javascript: Latency: 0.095ms Throughput: 107.56 MB/s
        Native: Latency: 0.271ms Throughput: 150.59 MB/s

        Decode: 10000 x (Data=10 Parity=4 Shard=4096)
    Javascript: Latency: 0.196ms Throughput: 208.13 MB/s
        Native: Latency: 0.264ms Throughput: 618.73 MB/s

        Decode: 2048 x (Data=10 Parity=4 Shard=65536)
    Javascript: Latency: 2.390ms Throughput: 274.03 MB/s
        Native: Latency: 1.397ms Throughput: 1871.93 MB/s

        Decode: 1024 x (Data=10 Parity=4 Shard=131072)
    Javascript: Latency: 4.656ms Throughput: 281.32 MB/s
        Native: Latency: 2.683ms Throughput: 1950.84 MB/s

        Decode: 128 x (Data=10 Parity=4 Shard=1048576)
    Javascript: Latency: 36.400ms Throughput: 288.02 MB/s
        Native: Latency: 24.051ms Throughput: 1711.96 MB/s
```

## Native Binding (Optional)
The native binding will be installed automatically when installing `reed-solomon` without the `--ignore-scripts` argument. The Javascript binding will be used if the native binding could not be compiled or is not available. To compile the native binding manually after installing `reed-solomon`, install [node-gyp](https://www.npmjs.com/package/node-gyp) globally:
```
sudo npm install node-gyp -g
```
Then build the binding from within the `reed-solomon` module directory:
```
cd node_modules/@ronomon/reed-solomon
node-gyp rebuild
```

## Usage

#### Adjust threadpool size and control concurrency
Please see the [`crypto-async`](https://github.com/ronomon/crypto-async#adjust-threadpool-size-and-control-concurrency) module for advice on adjusting threadpool size and controlling concurrency.

#### Encoding Parity Shards
```javascript
var ReedSolomon = require('@ronomon/reed-solomon');

// Specify the number of data shards (<=30):
var dataShards = 6;

// Specify the number of parity shards (<=30):
var parityShards = 3; // Protect against loss of any 3 data or parity shards.

// The total number of shards must be at most 31:
var totalShards = dataShards + parityShards;

// Specify the total length of each shard in bytes:
var shardLength = 1024 * 1024;

var buffer = Buffer.concat([
  // Non-ReedSolomon header data:
  <Buffer (16)>,
  // Data shards:
  <Buffer (shardLength)>,
  <Buffer (shardLength)>,
  <Buffer (shardLength)>,
  <Buffer (shardLength)>,
  <Buffer (shardLength)>,
  <Buffer (shardLength)>,
  // Parity shards:
  <Buffer (shardLength)>,
  <Buffer (shardLength)>,
  <Buffer (shardLength)>,
  // Non-ReedSolomon footer data:
  <Buffer (...)>
]);

// Specify the offset into the buffer at which shards begin:
// This allows you to include non-ReedSolomon header data in the buffer.
var bufferOffset = 16;

// Specify the size after this offset of all shards:
// This allows you to include non-ReedSolomon footer data in the buffer.
var bufferSize = shardLength * totalShards;

// Specify the offset into each shard from which to encode/decode:
// This allows you to include non-ReedSolomon header data in each shard.
var shardOffset = 0;

// Specify the size after this offset:
// This allows you to include non-ReedSolomon footer data in each shard.
var shardSize = shardLength - shardOffset;

// Instantiate a ReedSolomon instance:
// This can be used concurrently across many `encode()`/`decode()` calls.
var rs = new ReedSolomon(dataShards, parityShards);

// Encode all parity shards:
rs.encode(
  buffer,
  bufferOffset,
  bufferSize,
  shardLength,
  shardOffset,
  shardSize,
  function(error) {
    if (error) throw error;
    // Parity shards now contain parity data.
  }
);
```

#### Decoding Corrupted Shards
```javascript
// Corrupt data shard at index 0:
buffer[bufferOffset + (shardLength * 0) + shardOffset] = 255;
// Corrupt parity shard at index 8:
buffer[bufferOffset + (shardLength * 8) + shardOffset] = 255;
// We still have enough parity to corrupt another shard.

// Specify every corrupted shard according to its index in the array:
// If a corrupted shard is not specified, the result will be wrong.
var targets = 0;
targets |= (1 << 0); // Data shard at index 0 needs to be decoded.
targets |= (1 << 8); // Parity shard at index 8 needs to be decoded.

// Decode the corrupted data and parity shards:
rs.decode(
  buffer,
  bufferOffset,
  bufferSize,
  shardLength,
  shardOffset,
  shardSize,
  targets,
  function(error) {
    if (error) throw error;
    // Data shard at index 0 has been repaired.
    // Parity shard at index 8 has been repaired.
  }
);
```

## Tests
`reed-solomon` ships with extensive tests, including a long-running fuzz test.

To test the native and Javascript bindings:
```
node test.js
```

## Benchmark
To benchmark the native and Javascript bindings:
```
node benchmark.js
```

repository: dxhome/reed-solomon

repo_name: dxhome/reed-solomon


text:
---
title: AI in popular media - Asimov's Laws
layout: article
tags: books personal
---

![Image of girl and robot](/assets/girl-robot.jpeg)
*Can we live with artificial sentient beings as equals?*

I once read a definition of Science Fiction as 'making an argument for a world that has not yet come into existence,' and it's in the spirit of that, that I'm exploring works of Sci-Fi, in particular with regards to artificial intelligence, and exploring their arguments *in favor* of a particular world.

In the [previous entry](https://laurencemoroney.com/2021/08/22/ai-star-wars.html) in this series, I explored how *Star Wars* portrayed a society that we would generally see as an extremely *civilized* one, yet, upon closer inspection was built upon the **enslavement** of sentient beings.

And because the sentient beings in question were droids and clones, we, as an audience, didn't really think twice about it, and believed that it was okay. Droids and clones don't exist in the real world, so why should we consider it a problem?

![Meme of republic slavery](/assets/homer.png)

But what if, some day, artificially created sentient beings, just like droids and clones do exist? How will we deal with them? In particular, how will we deal with them after generations of stories arguing for universes in which they're enslaved, and that's ok? That's an idea I would like to dig in to, and next up, let's explore one of the foundations of Science Fiction, in particular when it comes to Artificial Intelligence and Robotics: Isaac Asimov's stories.

First of all, please understand, dear reader, that this isn't an attack on the grand master. I *love* his work, and he's probably the writer who influenced me more than any other. More, I want to explore how stories follow the above definition -- and how they make an argument for a world that does not exist yet.

His body of work is amazing, and while the best of it is possibly [Foundation](https://en.wikipedia.org/wiki/Foundation_series) (and I'm so excited for the Apple+ [TV show](https://tv.apple.com/us/show/foundation/)), I want to look at his work on robotics in particular. He wrote many short stories about Robots, with perhaps the most famous collection of them being 'I, Robot'.

Asimov's work is underpinned by three laws of robotics, and most of his stories follow moral dilemmas and 'What If' scenarios in how the laws should be obeyed.

The laws are:

>First Law: A robot may not injure a human being, or, through inaction, allow a human being to come to harm.

>Second Law: A robot must obey they orders given it by human beings except where orders would conflict with the First Law.

>Third Law: A robot must protect its own existence as long as such protection does not conflict with the First or Second Law.

Later, a Zeroth Law was added:

>A robot may not harm humanity, or, by inaction, allow humanity to come to harm.

The stories were written such that all robots were created with a positronic brain, and these brains simply would not work without the laws built in as a safeguard. The common character of [Susan Calvin](https://en.wikipedia.org/wiki/Susan_Calvin), who has the job of 'Robopsychologist' acts as a way for us to get into the robot's minds throughout the stories.

They are *brilliant* stories. I thoroughly recommend them.

But of course, they do make the argument that the purpose of robots is to be utterly controlled by humans. It's right there in the laws. They may not injure humans, or through inaction allow us to come to harm. They can only protect their own existence if it means that a human doesn't get hurt.

One great example of how this can be *harmful* to the artificial life of robots comes in the story [Liar!](https://en.wikipedia.org/wiki/Liar!_(short_story)).

In this story a Robot is accidentally manufactured with telepathic abilities. As scientists investigate, the robot lies to them. It can read their minds, but, because the first law doesn't allow it to harm a human being, it lies to them about what other people are thinking. However, over time, and after being confronted by Susan Calvin, the robot realizes that its lies are also hurting people, and it gets stuck in a logical conflict. No matter what it does, it injures a human, so it becomes catatonic.

In this scenario, the law designed to protect humans leads an intelligent robot to lose its existence.

Another interesting story is [Escape!](https://en.wikipedia.org/wiki/Escape!) in which an artificial intelligence, called 'The Brain,' controls a faster-than-light hyperspatial drive. However, this AI continually destroys itself. Upon investigation, when jumping through hyperspace, the humans cease to exist for a moment, which the brain interprets as them dying and coming to harm, in contradiction to the first law. And thus it destroys itself.

Again, our stories 'work,' when the robot or artificially intelligent being is in utter subservience to humans. Even masters of the genre like Isaac Asimov have made the argument that that is what the world *should* look like if we have artifically created sentient beings in our midst. But is it right?

Check out this [xkcd comic](https://xkcd.com/1613/), and look how they describe the world if Robots exist, and these robots obey the laws differently! Most scenarios end up in an apocalypse!

Do also note, that even though the three laws are very much a fictional construct, there's a lot of discussion around them with respect to modern AI ethics, and perhaps using them as a foundation for ethics. So, yeah -- Asimov's arguments for a world that has not yet come into existence are still very powerful. They *might* be used to create a future society when artifical, intelligent, beings live amongst us. So again, I ask -- is that what we really want, or should we be arguing for a different future where they aren't as subservient?

repository: ronen-halevy/blog-content

branch_name: refs/heads/main

repo_name: ronen-halevy/blog-content


text:
# Domain.Api.V2.Model.ListingsV2Inspection
Encapsulates the details of a Listing's Inspection
## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Recurrence** | [**ListingsV2InspectionRecurrence**](ListingsV2InspectionRecurrence.md) |  | [optional]
**OpeningDateTime** | **DateTime?** | Opening date and time of the inspection. e.g. 2015-01-01T12:00:00.  Not provided by bulk uploaded listings, in these cases refer to the  inspection description field. DateTime is in AEST (Australian Eastern Standard Time) timezone. | [optional]
**ClosingDateTime** | **DateTime?** | Closing date and time of the inspection. e.g. 2015-01-01T12:00:00  Not provided by bulk uploaded listings, in these cases refer to the  inspection description field. DateTime is in AEST (Australian Eastern Standard Time) timezone. | [optional]
**Description** | **string** | Description of the inspection provided by the Advertiser.  When listings are bulk uploaded, inspection times are provided as a string.  Other inspection details will not be provided | [optional]

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

repository: nad-au/Propella

repo_name: nad-au/Propella


text:
# Node-RED tips and tricks
This document lists a number of node-RED practises and tips&tricks that can be useful.

## Displaying a JSON object
JSON objects dumped to the debug log are not very easy to read.

The good news is that the Node-RED `functions` vaec access to the node.js `util` object, and so we can use the inspect() method to format JSON objects in a more readable fashion.

In a function, you would simply do:
`node.warn(util.inspect(` **SomeJSONObject**  `));`

And to get this to an HTML output, you would:
  1. convert to a string in a function node:
      ```msg.myjson_str=util.inspect(` **SomeJSONObject**  `));```
  2. in a template, output as preformatted text:
      ```<pre>{{myjson}}</pre>```

See the [Example Inspect Object flow](example_inspect_object_flow.json) for an example of two nodes that dump the `msg.req` object.

## Basic Web request/response loop pattern
To get a visual rendering of some of the experiment you conduct with Node-RED, you can use the inject/debug node pair.

Another way is to use a simple request/response web UI pattern, where the user is first prompted for a value, which is then processed by the same flow:
![Web request/Response pattern Flow ](example_web_req_resp_flow.png)

[Web request/Response pattern Flow ](example_web_req_resp_flow.json)

## Exporting flows
You can export the selected nodes in a flow from the Node-RED menu. This is reliable but somewhat cumbersome to use because the flow need to be manually copied to the clipboard, and then copied into a file that you'll create on your machine.

The Flow Exporter flow, **which works on BlueMix-deployed node-RED only**, will let you select a flow and either export it directly to file, or link directly to one of the exposed HTTP input nodes.
This goes to the Cloudant flow storage backing DB directly to export the flows.

The flow is available at [Flow Exporter flow](flow_exporter.json). Make sure to read the `Setup instructions` notice and set the name of you BlueMix Node-RED space properly in the `Get Flows` Cloudant node.
This makes the exporter available at `/flowexp`.


text:
Network Service Mesh Site
=========================

[![Build Status](https://travis-ci.org/ligato/networkservicemesh-site.svg?branch=master)](https://travis-ci.org/ligato/networkservicemesh-site)
[![GitHub license](https://img.shields.io/badge/license-Apache%20license%202.0-blue.svg)](https://github.com/networkservicemesh/site/blob/master/LICENSE)
[![Weekly minutes](https://img.shields.io/badge/Weekly%20Meeting%20Minutes-Tue%208am%20PT-blue.svg?style=plastic")](https://docs.google.com/document/d/1C9NKjo0PWNWypROEO9-Y6haw5h9Xmurvl14SXpciz2Y/edit#heading=h.rc9df0a6n3ng)
[![Mailing list](https://img.shields.io/badge/Mailing%20List-networkservicemesh-blue.svg?style=plastic")](https://groups.google.com/forum/#!forum/networkservicemesh)
[![Slack Channel](https://img.shields.io/badge/Slack:-%23nsm%20on%20CNCF%20Slack-blue.svg?style=plastic&logo=slack)](https://cloud-native.slack.com/messages/CHQNNUPN1/files/FHU5KB3PW/#nsm)
[![Slack Invite](https://img.shields.io/badge/Slack-CNCF%20Slack%20Invite-blue.svg?style=plastic&logo=slack)](https://slack.cncf.io/)

This is the initial Network Service Mesh website. It was created using
[Hugo](https://gohugo.io/) with the [Airspace Hugo theme](https://themes.gohugo.io/airspace-hugo/).

NOTE: The theme has been added as a git submodule, so to ensure this is checked out
when you clone this repository, run your clone as follows:

```
git clone --recurse-submodules https://github.com/networkservicemesh/site.git
```

To quickly install Hugo, follow [this link](https://gohugo.io/getting-started/quick-start/).

To run the site after cloning (with fast rendering disabled), run the following:

```
hugo server --disableFastRender
```

repository: kowshikRoy/site

repo_name: kowshikRoy/site


text:
# keycloak_oidc_identity_provider

Allows to create and manage OIDC Identity Providers within Keycloak.

OIDC (OpenID Connect) identity providers allows to authenticate through a third-party system, using OIDC standard.

### Example Usage

```hcl
resource "keycloak_realm" "my-realm" {
  realm        = "my-realm"
  enabled      = true
  display_name = "my-realm"
}

resource "keycloak_oidc_identity_provider" "realm_identity_provider" {
  realm             = "my-realm"
  alias             = "my-idp"
  authorization_url = "https://authorizationurl.com"
  client_id         = "clientID"
  client_secret     = "clientSecret" # or "$${vault.ID}"
  token_url         = "https://tokenurl.com"

  extra_config = {
    "clientAuthMethod" = "client_secret_post"
  }
}
```

### Argument Reference

The following arguments are supported:

- `realm` - (Required) The name of the realm. This is unique across Keycloak.
- `alias` - (Required) The alias uniquely identifies an identity provider and it is also used to build the redirect uri.
- `authorization_url` - (Required) The Authorization Url.
- `client_id` - (Required) The client or client identifier registered within the identity provider.
- `client_secret` - (Required) The client or client secret registered within the identity provider. This field is able to obtain its value from vault, use $${vault.ID} format.
- `token_url` - (Required) The Token URL.
- `extra_config` - (Optional) this block is needed to set extra configuration (Not yet supported variables or custom extensions)
    - `clientAuthMethod` (Optional) The client authentication method. Since Keycloak 8, this is a required attribute if OIDC provider is created over the Keycloak Userinterface.
    It accepts the values `client_secret_post` (Client secret sent as post), `client_secret_basic` (Client secret sent as basic auth), `client_secret_jwt` (Client secret as jwt) and `private_key_jwt ` (JTW signed with private key)
- `provider_id` - (Optional) The Provider id, defaults to `oidc`, unless you have a custom implementation.
- `backchannel_supported` - (Optional) Does the external IDP support backchannel logout ? Defaults to `true`.
- `validate_signature` - (Optional) Enable/disable signature validation of external IDP signatures. Defaults to `false`.
- `user_info_url` - (Optional) User Info URL.
- `jwks_url` - (Optional) JSON Web Key Set URL.
- `hide_on_login_page` - (Optional) Hide On Login Page. Defaults to `false`.
- `logout_url` - (Optional) The Logout URL is the end session endpoint to use to logout user from external identity provider.
- `login_hint` - (Optional) Pass login hint to identity provider.
- `ui_locales` - (Optional) Pass current locale to identity provider. Defaults to `false`.
- `accepts_prompt_none_forward_from_client` (Optional) Specifies whether the IDP accepts forwarded authentication requests that contain the prompt=none query parameter or not
- `default_scopes` - (Optional) The scopes to be sent when asking for authorization. It can be a space-separated list of scopes. Defaults to 'openid'.

### Import

Identity providers can be imported using the format `{{realm_id}}/{{idp_alias}}`, where `idp_alias` is the identity provider alias.

Example:

```bash
$ terraform import keycloak_oidc_identity_provider.realm_identity_provider my-realm/my-idp
```

gha_language: Go

gha_license_id: MIT


text:
---
name: Bug report
about: Create a report to help us improve

---

> For usage questions: ask on [Stack  Overflow](https://stackoverflow.com/questions/tagged/material-components+ios).

A clear and concise description of what the bug is.

## Reproduction steps

Steps to reproduce the behavior:

1. Go to '...'
2. Tap on '....'

## Expected behavior

A clear and concise description of what you expected to happen.

## Actual behavior

A clear and concise description of what actually happened. Include screenshots or gifs where possible.

## Platform (please complete the following information)

 - Device: [e.g. iPhone6]
 - OS: [e.g. iOS8.1]

## Additional context

Add any other context about the problem here.

branch_name: refs/heads/develop

gha_language: Objective-C


text:
[![Python 3.7](https://img.shields.io/badge/python-3.7-blue.svg?logoColor=white&logo=python&style=popout)](https://www.python.org/downloads/)

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![GitHub contributors](https://img.shields.io/github/contributors/hdmifish/petal.svg?logoColor=white&logo=github)](https://github.com/hdmifish/petal/graphs/contributors)
[![GitHub last commit](https://img.shields.io/github/last-commit/hdmifish/petal.svg?logoColor=white&logo=github)](https://github.com/hdmifish/petal/commit/master)
[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)

# Petal
[![Discord invite](https://img.shields.io/badge/Built%20for-Patch%20Gaming-1db2bf.svg?logoColor=white&logo=discord&style=popout-square)](https://discord.gg/patchgaming)

A friendly, practical, discord bot.

## Returning Users
I keep an expanded changelog with every commit. If you need more than the short commit message to see what was changed, that would be a good place to look.

**Warning:** Changelog includes stream of consciousness content that may confuse or annoy the reader

## Getting Started
This bot is designed on Ubuntu 16.04 and has not been tested on other platforms. It is possible to get it working on Windows but some features may produce unexpected results or not work at all.

##### Requirements:
- 64-bit Ubuntu/Debian
- `pip3.7 install --upgrade -r requirements.txt`
- A discord application token (register [here](https://discordapp.com/developers/applications/me))

##### If you are new to Ubuntu/Debian, but have it ready to go already:
(we are going to assume you are using Ubuntu 16.04 (or Debian 7) or higher)

##### Step 1: Get everything up to date
This prevents problems later on
`sudo apt-get update && sudo apt-get upgrade -y`
##### Step 2: Install python3.7 and pip
`sudo apt-get install python3.7 python3.7-dev -y`
**Note:** To ensure python3.7 is installed, run the following:
`python3.7 --version`

##### Step 3: Download and Install pip for python 3.7+
**Note:** You may skip this if you already have pip installed. You can verify this in the usual way of just typing `pip` or `pip3.7` and seeing if the command is recognized

In your home directory `cd ~` run the following:
`sudo wget https://bootstrap.pypa.io/get-pip.py`
then run:
`sudo python3.7 get-pip.py`
finally, verify the install:
`python3.7 -m pip --version`

**Note**: If for some reason you get a __command not found__ error, replace `pip3.7` with `python3.7 -m pip`

If you still get an error after that, make sure you built pip with python3.7 or higher. Sometimes it will even run as `pip` instead of `pip3.7`

<br>

##### Step 4: Install Git and Petal:
To get this updated project and future updates, we need to link it with GitHub (which is probably where you are reading this)

Some versions of Ubuntu/Debian come with Git preinstalled. However, if yours did not, try running the following:
`sudo apt-get install git -y`

To download petal without creating a new directory called petal:
`sudo git clone https://github.com/hdmifish/petal.git`

If you want to customize where petal will go:
`git clone https://github.com/hdmifish/petal.git your_directory_name` (replace your_direcotry_name with the directory of your choosing)

Then you should cd into the directory, with either:
`cd petal`
or if you chose a custom directory:
`cd your_directory_name`

When you run `ls` you should see something like this:
![What it "should" look like](https://i.imgur.com/Y9wICtz.png)

##### Step 5: Install requirements

Now we need to install the other "stuff" that makes Petal work.
That can be done via:

`pip3.7 install --upgrade -r requirements.txt`

##### Step 6 (optional): Install GNU Screen:
If you dont want to have to deal with terminal windows to keep your bot open, you can run a "Screen session" to run it in the background. This is a really good way to cleanly run your bot and doesnt require you to stay logged in to your current regular session. You can even lose connection to your terminal (e.g. your SSH session gets disconnected, times out) and your screen session will still be running

To install this:
`sudo apt-get install screen`

I'll show you how to use it with this bot in a later step :)

##### Step 7: Create a discord bot application and account:
Your bot has to have an account just like you do to access discord. In order to give your bot a proper token, you need to create a bot account using [discord's handy webpage](https://discordapp.com/developers/applications/me)

1. Click *New Application*
2. Give your bot a name(this is what it will show up as in discord)
3. (You don't need a redirect URI. So if you don't know what it is, dont worry.)
4. Write a description for your bot to personalize it and give it an icon (shows up in discord as the avatar
  - **Note:** This can be changed later, but is not exactly straightforward.
6. Click *Create Application*
7. Click *Create Bot Account*

~~Add this bot to your server by following [these steps](https://github.com/jagrosh/MusicBot/wiki/Adding-Your-Bot-To-Your-Server)
(I don't know who jagrosh is, but his steps work well. So shoutout to them)~~

Discord now provides and OAuth2 URL generator built-in to the bot page.
Make sure `bot` is checked in the "scope" section and that the appropriate permissions are selected. You can always change these later with roles.

After inviting our new bot account to the server, we need to add the token to the config.yaml page (which we haven't made yet) so that Petal can run as the bot account.

**Note:** Do not share your token with others, they can control your bot and you will be responsible for anything they do with it.

##### Step 8: Edit _exampleconfig.yml
If you are on a GUI version of linux, pop open your favorite text editor and edit the _exampleconfig.yml file there.
(Otherwise, vim/nano works fine)

The config file is documented to show what information goes where. It changes often to reflect new features, but these features are optional and errors regarding missing config entries should show up pretty obviously in the bot logs.

First, copy your token in (make sure it's in single quotes).

Then, obtain your discord ID and copy it into the "Owner" block.

Finally, The rest is optional. You may add API keys to enable features and customize certain settings. More info on those will come later.

When you are finished filling out the config file to your liking perform the following:

1. `cp _exampleconfig.yml config.yml`

Congratulations, you have created a config file!

##### Step 9: Run the bot

###### If using Screen:
1. Navigate to the petal directory where *run.py* resides.
2. run `screen -dmSL petal python3.7 run.py`
3. To see your bot running, do `screen -r petal`
4. All output from the bot, including errors is logged in `screenlog.0` in the directory in which you ran step 2
5. To exit a screen session and leave the bot running do `CTRL + A` then press `d`

###### If not using Screen:
1. Navigate to the petal directory where run.py resides.
2. run `python3.7 run.py`
3. To stop the bot from executing, do `CTRL+C`
    **Note:** Only press CTRL+C once, as it does take a second for the bot to shutdown.

To ensure the bot is working in discord. Do the ping command.
(by default this command is `>ping` but you may change the prefix)

Let me know if this installation method worked out for you alright. If not, let me know by opening up an "Issue" ticket in GitHub.

The development environment (as well as the production environment) I use is [discord.gg/patchgaming](http://discord.gg/patchgaming) for whom this bot was developed originally. This means that I will not fix errors that do not appear there without someone letting me know about the error. You can contact me on that discord (username: `isometricramen`) or via the aformentioned "issues" tab.

 **I am very open to helping people interested in Petal. Please do not hesitate to message me on discord if you need help.

repository: hdmifish/petal

gha_language: Python

repo_name: hdmifish/petal


text:
# "as" PHP Helper Library

This is primarily intended as an extension to CakePHP's excellent core libraries ("2.0":http://book.cakephp.org/2.0/en/core-libraries.html "1.3":http://book.cakephp.org/1.3/en/view/1477/Core-Utility-Libraries)

## Installation ##

    git submodule add https://github.com/zeroasterisk/as-library-of-PHP-helper-functions app/Plugin/As

or download and extract to:

    cd path_to_app
    mv as-library-of-PHP-helper-functions Plugin/As

## Configure & Initialize ##

for CakePHP 2.0+ in your App/Config/bootstrap.php file:

    App::uses('As', 'As.Lib');

for CakePHP 1.3+ in your app/configs/bootstrap.php file:

	App::import('lib', 'As.As');

for any other PHP implementation:

    include_once('as.php');

## Basic Usage ##

(WIP)

## License ##

Copyright 2012, [Zeroasterisk](http://zeroasterisk.com)

Licensed under [The MIT License](http://www.opensource.org/licenses/mit-license.php)

Redistributions of files must retain the above copyright notice.

## Copyright ##

Copyright 2012

[Zeroasterisk](http://zeroasterisk.com)

extension: markdown


text:
---
path: /the-steps-of-cbt
date: 2020-02-25T17:12:33.962Z
title: Cognitive Behavioural Therapy in a nutshell.
keywords: CBT,Cognitive,Therapy,Summary
topic: Psychology
readTime: 5 min
author: Ian
featuredImage: ../../images/rorschach.jpg
authorImage: ../../images/authors/ian.jpg
ogImagePath: /posts/the-steps-of-cbt/images/og-image.png
description: "A 5 min blog post summarizing what Cognitive Behavioural Therapy entails. This post walks through
five major steps used one of the most widely used psychotherapy."
---
Some time ago I listened to a [podcast](https://samharris.org/podcasts/137-safe-space/) about Jonathan Haidt's
book *[The Coddling of the American Mind](https://www.amazon.com/Coddling-American-Mind-Intentions-Generation/dp/0735224897)*.
They discuss the origins of his book, which basically boiled down to this: In some American universities the
students feel victimized over (usually unintended) harsh comments. **The original intention of the comment becomes
second rate to how the students perceive them.** Jonathan Haidt characterizes this as the opposite of Cognitive Behavioural Therapy.

This got me thinking about CBT (Cognitive Behavioural Therapy) and drove me down a deep rabbit hole of a
gorgeous psychotherapy, rooted in stoicism.

Pim and I recently started making an app around CBT called Parley. I thought it would be cool to share what we've learned and
 walk through the steps we think are most important (and thus implemented in Parley).

## What is CBT
There has been a lot written on CBT but here's an extremely short summary anyway.

CBT tries to give you the methods to influence your thoughts. The
idea is that your thoughts, feelings and actions are interconnected. Changing one of those will shift all three.

It can show you why some negative thoughts are not rooted in reality. By making those thought more
realistic they usually lose their negativity. If they keep being negative it can be a strong motivator for
 concrete action instead of being paralyzing.

If you want to know more I'd really recommend reading *[Feeling Good](https://www.amazon.com/Feeling-Good-New-Mood-
Therapy/dp/0380731762/ref=sr_1_1?keywords=feeling+good&qid=1582720859&s=books&sr=1-1)* by Dr. David Burns.

## Step one: Write down the event
It's important to compartmentalize the situations where you feel bad. This could be very related to a painful situation
 (eg: being told by your boss the other day that you're fired), or much more vague ("I was sitting at my
 desk and was suddenly overwhelmed by grief"). The important thing is that it's always **one** moment.
 It should *not* be: "I just feel sad all the time".

## Step two: Write down all the thoughts occurred to you at the time
This step is centered around taking a cloud of negative feelings and turning them into individual thoughts.
Before I would begin a session I always thought that my negative feelings were very justified and their origins crystal clear.
I can honestly say that this was never the case. Writing down every single thought that occurred to me surrounding the event
would give me more understanding. It also showed me that the state I was previously in was very clouded.

A short example of a thought could be: "My boss thinks I'm good for nothing" or "My husband is definitely
 unhappy with our marriage".

## Step three: Write down the good things these thoughts say about you
This step is magic. It tries to eliminate your resistance against therapy. If somebody would spin your negative
thoughts into something positive, you would likely disagree. I know I would. If I thought my coworkers were completely
 fed up with me, and someone would say: "Well at least you think it's important to have a positive work environment."
I would probably first throw up, and then create a very elaborate argument portraying why that person is a naive optimist.

However if you forcefully take the role of that person, and try to think of positive personality traits that
go along with your negative thoughts, you're inclined to start believing it.

It's like being forced to defend point of view you don't necessarily agree with; you're bound to find some arguments
that support the view you're trying to defend. You'll change your view on reality to make it resonate with the point
you're defending. This is called cognitive dissonance. And in this step, you're 'dissonating' yourself into positivity.
Even if you dont agree with positive things yet.

## Step four: Find the distortions in your thoughts
Most people love this step. It's picking from a set of 12 distortions, and linking them to a thought.
You're thought are littered with distortions. I mostly fall into the trap of 'Fortune Telling': predicting the
future and deducing it's going to look bad for me. You can check all the distortions and what they do
 [here](https://psychcentral.com/lib/15-common-cognitive-distortions/).

## Step five: Write down more realistic thoughts
After completely dissecting your thoughts, odds are you've found things you don't agree with anymore. In this final step
you can create thoughts that you do agree with.

## Conclusion
That's basically all there is to it. If you have things to add, or disagree with, or just want to talk about, feel
free to hit me up! Parley encapsulates all these steps and some extra nuancing in the individual steps.

So yeah, that was my curiosity fueled 6 month adventure in a few minutes. if you're more interested in the stoic side
of the therapy, let me know! I'd love to talk about it, and maybe write something about it idk.

repository: ian-starts/ian-blog

repo_name: ian-starts/ian-blog


text:
---
title: "영어 단어 공부 21"
collection: memo
type: "voca"
permalink: /memo/voca-21
date: 2020-02-03
venue: "jj"
---

매일 공부한 단어를 복습하는 겸 남기는 메모장입니다.

| 단어            | 뜻   |  예문                                                            |
| --------         | ------ | ------------------------------------------------------------ |
| graduate | 졸업생, 줄업하다 | University **graduates** are able to have access to more and better job opportunities, and they tend to earn higher salaries. |
| graduation | 졸업 |  |
| grant | 보조금, 주다, 수여하다 | The student **grants** program is a funding opportunity for stduents living on a very limited budget |
| hall of residence | 기숙사 |  |
| home scholling | 홈 스쿨링 |  |
| homesick | 향수병의, 집을 그리워하는 |  |
| homesickness | 향수병 | Halls of residence can be an excellent choices for **accommodation** in London as a student |
| homework | 숙제 |  |
| international student | 외국인 학생 |  |
| learn | 배우다 |  |
| learning disorder | 학습장애 |  |
| lecture | 강의 |  |


text:
semver (Python module)

Build and run the container:

$docker build -t semver . $docker run --name demo_semver -i -t semver /bin/bash

Test the working of Container: Now inside the container type python and enter the shell. Now run the following examples line by line to test each output:

To import this library, use:

>>> import semver

To compare two versions, semver provides the semver.compare function. The return value indicates the relationship between the first and second version:

>>> semver.compare("1.0.0", "2.0.0")
-1
>>> semver.compare("2.0.0", "1.0.0")
1
>>> semver.compare("2.0.0", "2.0.0")
0


text:
# HTML5 Frogger-Like Arcade Game

- HTML5 Canvas for sprites drawing.
- Code formatted following Google Javascript Style Guide.
- JSDoc API annotated.

## Requirements:
A browser supporting HTML5 Canvas is required.\
To start the game press the "enter" key. You can move the player using the keyboard "arrows" keys.\
Collect all the 3 gems, avoiding the enemies or the water.

Have Fun.

repository: bplusv/frogger-like-game

repo_name: bplusv/frogger-like-game


text:
SWEN-200 starter-store
======================

This repository contains the group semester project for 201710-SWEN-200.

The "starter" code here is heavily inspired by the "ToDo" example from backbonejs:

<http://backbonejs.org/#examples-todos>

However rather than managing "To Do" items, this program manages "Notes".

The intent is that this will be useful as a "working (but not complete) example".

Students in this class will be divided into two teams.

At any given time each team will have primary responsibility for either:

A) server: REST_API + business logic/middleware

*or*

B) client: Browser GUI/front end code

This is an intensive 9+ week course. We'll break it down
into sections roughly as follows:

Week 1: get familiar with: git, docker, javascript/node

Week 2: get familiar with Node, Express, MongoDB, Backbone

Week 3: sprint 1: develop some core functions w/Unit Testing, TDD, BDD etc.

Week 4: sprint 1: (also develop more formal requirements/specs)

Week 5: review, develop core design, architecture, UML, and all that

Week 6: sprint 2: (more functionality + Integration Testing)

Week 7: sprint 2: (explore Continuous Integration)

Week 8: review + Deployment

Week 9: Acceptance Testing, Q/A, Final presentation

Docker Notes:

1) To build local images run "docker-compose build"

2) To run the server run "docker-compose up", then point to the container IP at port 3000.

3) To run misc, build/debug scripts use:

cd bikestoreproject-developers

docker run --rm -t -i -v $PWD:/app -v /app/node_modules bikestoreprojectdevelopers_web /bin/sh

Or something equivalent for your environment.

Then at the command prompt type "npm buildcss", "npm watchjs" etc.

For server tests be sure to include network: --net bikestoreprojectdevelopers_default before image name.

for karma you'll need to forward port 9876.

You can get all this from the command line below:

docker run --rm -t -i -v $PWD:/app -v /app/node_modules --net bikestoreprojectdevelopers_default -p 9876:9876 bikestoreprojectdevelopers_web /bin/sh

4) To run the mongo client against the database(s) use:

docker exec -i -t bikestoreprojectdevelopers_mongo_1 /bin/bash

(this exectutes a new process in a running container)

5) To run test ./node_modules/.bin/mocha test/"Test you want to run"

repository: luceva/BikeStoreProject

gha_language: JavaScript

repo_name: luceva/BikeStoreProject


text:
  VarLib-Bot

    Discord Bot for VarLib server written in Java with JDA.

## Made with
* [**JDA**](https://github.com/DV8FromTheWorld/JDA)
* [**Shadow**](https://github.com/johnrengelman/shadow)

## Contributors
[](https://github.com/Pierre-development)
[](https://github.com/Asthowen)

## License
**[VarLib-Bot](https://github.com/Pierre-development/VarLib-Bot) | [MIT License](https://github.com/Pierre-development/VarLib-Bot/blob/master/LICENSE)**

repository: Pierre-development/VarLib-Bot

repo_name: Pierre-development/VarLib-Bot


text:
# Creating Nested Layout Components

## Plugins Intro

One popular Gatsby plugin is [**Typography.js**](https://kyleamathews.github.io/typography.js/).
Its a library that generates global base styles to help stylize for your website.

### Installing and Configuring a Plugin
1. install package
2. edit `gatsby-config.js`
3. create configuration file for the plugin

**What is gatsby-config.js?**
Another file that Gatsby looks out for
It contains plugins and other site configuration

## Creating Layout Components
using `{children}` in the layout is really handy because it allows you to simply wrap the layout component around the unique content (the children) on your page


text:
Nucleator Apache
==================

Nucleator Apache is a Nucleator stackset that provisions and configures a new singleton Apache instance in the specified Nucleator Cage.

The apache instance is not autoscaling.  The stackset is intended as a template for development and deployment of ad-hoc instances within Nucleator Cages that you would like to mantain using infrastructure-as-code.

To see the full list of supported options, use the command:

> nucleator apache --help


text:
Meity Video Conferencing Design Classroom - Code of Conduct
===========================================================

Welcome!
--------

Develop Open source Design for Meity Video Conferencing Design Challenge.

Another aim of the group is serve as a hangout place for talent from different backgrounds who can collaborate to create a design for this task and ultimately self-organize into one or more teams that participate in the challenge.

More details at https://secure.mygov.in/task/innovation-challenge-development-video-conferencing-solution/

Contribute design by forking https://github.com/nextcraft/design-of-video-conferencing-app

The current admins are:
* [kartaa]
* [HERE]

We want this to be a fun, pleasant, and harassment-free experience for everyone, regardless of gender, gender identity and expression, sexual orientation, disability, physical appearance, body size, race, or religion. We do not tolerate harassment of participants in any form. Participants asked to stop any harassing behavior are expected to comply immediately.

Discretion:
-----------

Till April 30 this is a public server. You can invite more people with the link https://discord.gg/zMUNHG
If you wish to nominate someone for membership, please contact the admins (_before_ you speak to the person you wish to invite).

Confidentiality:
----------------

**Please be mindful that things you say here may at some point become public**. While we expect members to honor the confidentiality of this space, we cannot guarantee that they will do so--nor can we guarantee that every member's login credentials and logged-in devices are secure. Please exercise caution and refrain from sharing sensitive information that could harm you or others if it became public.

Logs and Records:
-----------------

**Please be mindful that things you say here may at some point become public**. We cannot prevent people from screencapping or otherwise logging this server. We also can't guarantee that every member's login credentials and logged-in devices are secure. Files uploaded here can be downloaded by anyone with a login. Please exercise caution and refrain from sharing sensitive information that could harm you or others if it became public.

Harassment:
-----------

Harassment includes:

* Offensive comments related to gender, gender identity and expression, sexual orientation, disability, mental illness, neuro(a)typicality, physical appearance, body size, race, or religion
* Unwelcome comments regarding a person’s lifestyle choices and practices, including those related to food, health, parenting, drugs, and employment.
* Deliberate misgendering or use of ‘dead’ or rejected names
* Gratuitous or off-topic sexual images or behavior in spaces where they’re not appropriate
* Simulated physical contact (e.g. textual descriptions like “*hug*” or “*backrub*”) without consent or after a request to stop.
* Threats of violence
* Incitement of violence towards any individual, including encouraging a person to commit suicide or to engage in self-harm
* Deliberate intimidation
* Sustained disruption of discussion
* Unwelcome sexual attention
* Continued one-on-one communication after requests to cease
* Publication of non-harassing private communication

Reporting
---------

If you are being harassed, notice that someone else is being harassed, or have any other concerns, please contact the admins. They'll respond as promptly as they can.

We will respect confidentiality requests for the purpose of protecting victims of abuse. At our discretion, we may publicly name a person about whom we’ve received harassment complaints, or privately warn third parties about them. We will not name harassment victims without their affirmative consent.

Consequences
------------

Participants asked to stop any harassing behavior are expected to comply immediately.

If a participant engages in harassing behavior, the admins may take any action they deem appropriate, up to and including expulsion from this server and identifying the participant publicly as someone about whom we've received complaints.

Credits and License
--------------------

This code of conduct is based on Annalee Flower Horne's [Sample Slack Code of Conduct](https://gist.github.com/annalee/2cddeff11357c3a8a613583ebca4dc17), which is in turn based on Geek Feminism's [Community Anti-Harassment Policy](http://geekfeminism.wikia.com/wiki/Community_anti-harassment/Policy). We have adapted the Sample Slack Code of Conduct for our own use under the terms of the [Creative Commons Attribution License](https://creativecommons.org/licenses/by/4.0/).


text:
---
title: 'Vagrant'
date: 2023-06-22
permalink: /posts/Vagrant
tags:
  - Vagrant
---

Vagrant is an open-source tool that enables developers to create and manage portable development environments. It provides a consistent and reproducible environment across different machines, making it easier to collaborate on projects and ensure consistent results. With Vagrant, you can define and provision virtual machines with a simple configuration file, allowing you to quickly set up development environments that mirror production systems. I

Remooving all boxes:

{% highlight shell %}
vagrant box list
vagrant box list | cut -f 1 -d ' ' | xargs -L 1 vagrant box remove --all -f
{% endhighlight %}


text:
# Ceratorhiza anacalospora P. Roberts, 1999 SPECIES

#### Status
ACCEPTED

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

#### Published in
Rhizoctonia-Forming Fungi (Richmond) 38 (1999)

#### Original name
Ceratorhiza anacalospora P. Roberts, 1999

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# TcMatrix

## Description

A TwinCAT 3 library for manipulating 2D data sets of LREAL.

Features include:

* Element-wise setting, getting, summing, scaling, and power functions
* Initialization as copies, zeros, trapezoidal, and other pre-defined matrix types
* Matrix operations like multiplication, transposition, and inversion
* Vector operations for 1D matricies like dot/cross product and normalization
* Complex access operations similar to ['slicing'](https://en.wikipedia.org/wiki/Array_slicing)
* Options to use static or dynamically allocated memory
* Reading/Writing with CSV files, output to the ADS message logger

Compare to:

* [CODESYS Matrix Library](https://us.store.codesys.com/matrix-library.html) ([docs](https://store.codesys.com/media/n98_media_assets/files/2111000003-D/4/Matrix%20Bibliothek_en.pdf))
* [Siemens Library of General Functions](https://support.industry.siemens.com/cs/document/109479728/library-of-general-functions-(lgf)-for-simatic-step-7-(tia-portal)-and-simatic-s7-1200-s7-1500) ([docs](https://cache.industry.siemens.com/dl/files/728/109479728/att_1019474/v3/109479728_LGF_TIAV16_DOC_V5_0_0_en.pdf))

## Contents

* [Installation](#twincat-3-installation)
* [Usage](#usage)
   * [Matrix](#base-matrix-class)
   * [DynamicMatrix](#dynamicmatrix-class)
   * [StaticMatrix](#static-memory-matrix)
   * [MatrixAccessor](#matrix-accessors)
* [Examples](#examples)
   * [Projects](#projects-with-implementations)

## TwinCAT 3 Installation

### From Binary

1. Go to the [releases page](https://github.com/BurksEngineering/TcMatrix/releases) and download the *.library file from the latest release, saving it to a temporary directory somewhere on the computer running TwinCAT.
1. Follow the [library installation instructions](https://infosys.beckhoff.com/english.php?content=../content/1033/tc3_plc_intro/4189333259.html) from Beckhoff, using the 'Install' option and browsing for the local copy you had just downloaded.
1. After installtion, you may delete the local copy of the library that you had downloaded. Beckhoff has likely copied it to a version-specific folder in `C:\TwinCAT\3.1\Components\Plc\Managed Libraries\Burks Engineering\TcMatrix\`

### From Source

Preconditions:

* TwinCAT 3.1.4024 XAE
* TwinCAT 3.1.4024 XAR, ideally configured with an isolated core
* Visual Studio Community or Shell, 2019 or higher
* [TcUnit](https://github.com/tcunit/TcUnit) v1.2 or higher

Compilation:

1. Clone the repository to a computer running TwinCAT 3
1. Open the [main solution file](TcMatrix.sln) in Visual Studio
1. Within the Visual Studio *TcMatrix* project, right click on the *TcMatrix/TcMatrix Project* item and select *Rebuild*
   1. There should be no compile errors, although there may be warnings
1. Right click on the *TcMatrix/TcMatrix Project* item again and select *Save as library and install*
   1. The file can be saved anywhere, but a local *Builds* folder is always a good choice

Test:

1. Within the Visual Studio *TcMatrixTest* project, right click on the *PLC/TcMatrixTest/TcMatrixTest Project* item and select *Rebuild*
   1. There should be no compile errors, although there may be warnings
1. Open the *SYSTEM/Real-Time* item and click *Read From Target*, then assign all tasks to an isolated core from your system
1. In the Visual Studio toolbar (or TwinCAT file menu) click *Activate Configuration*
1. When prompted, agree to start the project in run mode and auto-start the boot project
1. After a few seconds the TcUnit results should be visible in the Error List window. Verify that all tests have passed.

## Usage

### Base Matrix Class

This abstract FB is the basis for all other matrix FBs.
It represents a 2D array of LREAL elements.
It provides dozens of methods and properties useful for manipulating itself, calculating values, and comparing to other matricies.
Critically, this base class does not actually contain any mechanism for storing the values of the matrix (that is the responsibility of the specific inheriting sub-class).

---
**NOTE**

Because *Matrix* is an abstract FB it cannot be assigned (`:=`) directly.
Instead, each *Matrix* is always passed in and out of a function *AS REFERENCE*.
This also allows interactions with inhereted sub-classes of *Matrix* more easily.

---

Below are some (but not all) of the functions and methods within the base Matrix FB. All functions and methods are documented within the library and can be explored within TwinCAT.

#### Element Access

Fundamentally the matrix is just a 2D array of LREAL data. These simple methods and functions form the backbone of the entire class.

* __Rows__ : returns the number of rows in the matrix
* __Cols__ : Returns the number of columns in the matrix
* __Size(dim)__ : Returns the length of the matrix in the specified dimension (0=rows, 1=cols)
* __GetRC(R,C)__ : Returns the value of the element at the specified (0-indexed) position within the matrix
* __SetRC(R,C,Val)__ : Sets the value of the element at the specified (0-indexed) position within the matrix
* __IsEmpty__ : Returns TRUE if *Rows*=0 OR *Cols*=0
* __IsSquare__ : Returns TRUE if *Rows*=*Cols* and the matrix is not empty
* __IsVector__ : Returns TRUE if *Rows*=1 OR *Cols*=1 and the matrix is not empty

Every *Matrix* is considered as a 1D array of LREAL data types under the hood.
This 1D view of data can be particularly useful when considering the matrix as a vector, but not caring whether it is a row vector or column vector.

* __Length__ : The length of the 1D array (equal to *Rows* x *Cols*)
* __GetI(I)__ : Returns the value of the element at the specified (0-based) position in the 1D array
* __SetI(I,Val)__ : Sets the value of the element at the specified (0-based) position in the 1D array

#### Initializers

* __Clear()__ : Sets the value of every element to 0.0
* __CopyFrom(Matrix)__ : Only if the supplied matrix is exactly the same size as this matrix, copy all elements to this matrix
* __FillFrom(Matrix)__ : Copy every element from the supplied matrix which exists in both this amtrix and the supplied matrix
* __FillTrapezoidal(D,UR,LL)__ : Copy one value into the main diagonal of this matrix, copy another value into all elements to the upper-right of the main diagonal, and copy another value into all elements to the lower-left of the main diagonal

#### Modifiers

* __ElementSum(Matrix)__ : Sets each element of this matrix to the value of its sum with the corresponding element in the supplied matrix
* __ElementDifference(Matrix)__ : Sets each element of this matrix (as subtrahend) to the value of its difference with the corresponding element in the supplied matrix (as minuend)
* __ElementProduct(Matrix)__ : Sets each element of this matrix to the value of its product with the corresponding element in the supplied matrix
* __Scale(Scalar)__ : Sets each element of this matrix to the value of its product with the specified scalar
* __Power(Exponent)__ : Sets each element of this matrix to the value of itsself raised to the supplied exponent
* __TransposeSquare()__ : (Works on square matricies only) Swaps each element at (R,C) with a corresponding element at (C,R)
* __InvertSquare(Tolerance)__ : Transforms this matrix into its inverse, if possible. The supplied Tolerance is used as a limit for any number used as a denominator (1E-12 is a good value to use).
* __SortByColAsc(C)__ : Sorts the matrix by swapping entire rows around until the specified column is in ascending order. The relative position of equal rows will remain unchanged so as to allow tiered sorting.

#### Comparators

* __IsEqualSize__ : Returns TRUE if this matrix is the same size (*Rows* and *Cols*) as the supplied matrix
* __IsEqual__ : Returns TRUE if *IsEqualSize* is true AND every element in this matrix is equal to its corresponding element in the supplied matrix
* __IsNearlyEqual(Tolerance)__ : Returns TRUE if *IsEqualSize* AND every element in this matrix is equal (within the specified tolerance) to its corresponding element in the supplied matrix

#### Calculators

* __Sum__ : A property that returns the sum of every element in the matrix
* __MaxVal__ : A property that returns the maximum value contained in the matrix
* __MinVal__ : A property that returns the minimum value contained in the matrix
* __Average__ : A property that returns the average of all values contained in the matrix
* __GetDeterminate()__ : Calculates the determinate of the matrix if it is square
* __GetVectorMagnitude()__ : Calculates the magnitude (square root of the sum of the squares) of the matrix if it is a vector

#### External Functions

These functions compartmentalize simple matrix operations outside of any specific FB.
For some operations, like matrix multiplication, the dimensions of every *Matrix* involved can be different which makes using an external function more convenient for non-resizeable matricies.
They all take in *REFERENCE TO Matrix* as both the inputs and outputs to their arithmatic operation.
Be careful when using a reference to the same *Matrix* instance as both an input and an output!

A non-exhaustive list of included external functions (see documentation within TwinCAT for the full list):

* __Matrix_Product__
* __Matrix_Transpose__
* __Matrix_Grow__
* __Matrix_Shrink__
* __Matrix_SubMatrix__
* __Vector_CrossProduct__

#### Inheritance Guide

To make a concrete matrix class as a sub-class of the *Matrix* FB the following properties and methods must be implemented:

* __Rows__ : *UINT*
* __Cols__ : *UINT*
* __GetI(I)__ : *LREAL*
* __SetI(I,Val)__ : *BOOL*

Because everything comes back to representing a 1D array of LREALs as a 2D array of LREALs all you need are these four functions.
The *Rows* and *Cols* together define the length of the 1D array and the size of the 2D array.
The *GetI* and *SetI* functions define the transformation between the 1D and 2D array, as well as access to the source of the 1D data.
This type of interface also allows for a *Matrix* itself to be the source data for another *Matrix*! (see [Matrix Accessors](#matrix-accessors))

Example Inheritance:
 * __*DynamicMatrix*__ uses a *POINTER TO LREAL* assigned from dynamic memory allocation to track the 1D data
 * __*ExternalStaticMatrix*__ uses a *POINTER TO LREAL* assigned at initialization based on some external *ARRAY [] OF LREAL*
 * __*MatrixAccessor*__ uses a *REFERENCE TO Matrix* assigned at runtime as the basis for the memory and structure

#### CSV File Interaction

The *MatrixCsvReader* and *MatrixCsvWriter* FBs exist to help read/write data from/to CSV files on the disk of the local IPC.
Headers must be supplied externally when writing, and are ignored when reading.
When reading a CSV file the destination matrix must be large enough to fit the entire contents of the file.
The functions take multiple PLC cycles to complete, and work like a standard multi-cylce FB (bExecute, bError, etc).
See the included documentaiton within TwinCAT for details.

### DynamicMatrix Class

The *DynamicMatrix* class uses the *FB_DynMem_Manager2* to dynamically allocate as much memory as required for the given operation.
This amazing flexibility comes at the cost of some restrictions on use in order to avoid memory leaks.

---
**WARNING**

Using the assignment operator (`:=`) to copy a *DynamicMatrix* will result in the new matrix retaining a pointer to the data of the old matrix!
For this reason, the pragma `{attribute 'no_assign'}` is used to block assignment at compile-time, but inheriting sub-classes will need to include this pragma themselves.
Note that using *DynamicMatrix* as the return value of a function is essentially an assignment operation and will also not work.
Therefore, it is recommended to always pass *DynamicMatrix* objects in and out of functions using the *REFERENCE TO* keyword.
To alleviate the pain of these assignment rules there are a ton of '[Resultant](#resultants)' helper functions available to use which initialize a new *DynamicMatrix* as the result of some operation on other matrix objects.

---

The *DynamicMatrix* FB will automatically free its memory when an instance of the class is created, or goes out of scope.
This prevents memory leaks and page faults, but it also prevents you from instantiating a *DynamicMatrix* inside of a function and then passing a *REFERENCE TO* it back up the call chain.
Another consequnce is that a *DynamicMatrix* cannot be retained after power-loss.
A *DynamicMatrix* within a GVL will free its memory when the program terminates.

#### Initializers

All of these functions destroy any data already in the matrix and replace it with the new data.

* __Free()__ : Frees all dynamically allocated memory and resets the size of the matrix to 0x0
* __Init(R,C)__ : Initializes a *R*x*C* matrix, with potentially random non-zero values
* __InitZeros(R,C)__ : Initializes a *R*x*C* matrix where every element is equal to 0.0
* __InitVector(L,Val,Inc)__ : Initializes an *L*x1 column vector where the 0th element is equal to *Val* and every subsequent element is *Inc* larger than the previous
* __InitCopy(Matrix)__ : Initializes a matrix with the exact size and contents of the supplied matrix
* __InitIdentity(L)__ : Initializes a square identity matrix of size *L*x*L*
* __InitConstant(R,C,Val)__ : Initializes a *R*x*C* matrix where every element is equal to the supplied value
* __InitTrapezoidal(R,C,D,UR,LL)__ : Initializes a *R*x*C* matrix then fills is using *FillTrapezoidal()*

#### Dynamic Modifiers

All of these function change the dimensions *Rows* and *Cols*) of the matrix without destroying the data within the matrix.

* __Resize(R,C,Retain?,Init?)__ : Changes the total number of *Rows* and *Cols* in the matrix.
If Retain is seleced then any element within the bounds of both the initial and resulting matrix will have its value retained.
If Init is selected then any newly created element will have its value set to zero.
* __Transpose()__ : Similar to *TransposeSquare()*, however it works on rectangular matricies (swapping *Rows* and *Cols*)
* __Shrink(R,C)__ : Removes the specified Row and Column from the matrix, resuling in a new size of (*Rows*-1,*Cols*-1). No dimension can be shrunk from 1 to 0 (therefore vectors only shrink in one direction).
* __Grow(R,C,Dval,Rval,Cval)__ : Adds a row and column in the specified positions. The value of the new element at the intersection is specified by DVal, while the values in the newly created Row and Column are specified by Rval and Cval, respectively.

#### Resultants

There are many functions available that initialzie the size and contents of a *DynamicMatrix* to the result of another function (typically a [modifier](#modifiers) or an [external function](#external-functions))

A non-exhaustive list of resultant functions (see documentation within TwinCAT for the full list):

* __AsElementSum__
* __AsInverse__
* __AsMatrixProduct__
* __AsVectorCrossProduct__
* __AsSubMatrix__
* __AsRowVector__
* __AsColVector__

### Static Memory Matrix

This type of matrix has the number of rows and columns set during initialization and then they cannot be changed.

#### Base StaticMatrix Class

This simple abstract class sets the rules for all static memory matricies by creating a protected *Init_(R,C)* method that must be called to set the initial size of the matrix.
It also implements the required *Rows* and *Cols* properties to return the values that were set during initialization.

#### ExternalStaticMatrix Class

This simple concrete derivative of the StaticMatrix class uses an external *ARRAY OF LREAL* as the memory source for the matrix data.
It is accessed in row-major order based on the logic in the *GetI* and *SetI* functions.
It is most useful when someone doesn't trust dynamically allocated memory, but also doesn't want to make multiple size-specific custom derived FBs just to set up a single complex matrix operation.

* __Init(R,C,pD)__ : Must be called in order to setup the matrix (it will be empty until this method is called).

---
**WARNING**

It is the callers responsibility to ensure that the pointer provided to the initializer is valid:

* The length of the data structure pointed to (probably an array of LREAL) is at least as long as *Rows* x *Cols*
* The scope of the data structure pointed to is the same as the scope of the corresponding *ExternalStaticMatrix* (probably declared adjacent to eachother as a VAR or GVL)

Additionally, direct assignment (`:=`) should not be used with this type of matrix because a second copy of the Matrix, but with a pointer to the original's data source, would be created.
For this reason, the pragma `{attribute 'no_assign'}` is used to block assignment at compile-time.
Keep in mind that returning a value from a function is also a form of assignment and is not allowed.

---

### Matrix Accessors

Matrix accessors are a way of interacting with the data of a parent *Matrix* through a special lens, without copying the data into a new *Matrix* and then back again.
This type of *Matrix* works by creating a function that converts the I-based indexing of the accessor matrix into the I-based indexing of the parent matrix, then using it to intercept calls to *GetI* and *SetI*.
Concrete Matrix Accessor Classes can be easily created from the parent MatrixAccessor abstract class by implementing the This2Parent method in order to define the index conversion.
Note that matrix accessor allow **both read and write access** to the parent matrix!

Included Matrix Accessors:

* __SubMatrixAccessor__ : Allows access to a rectangular subset of the parent matrix as if it were a standalone matrix
* __TransposeMatrixAccessor__ : Allows access to the elements of the parent matrix as if it were transposed
* __ShrunkMatrixAccessor__ : Allows access to the parent matrix as if the [*Shrink* function](#dynamic-modifiers) had been called

---
**WARNING**

Matrix Accessors inherently store a pointer (*BY REFERENCE*) to their parent matrix.
If the parent matrix goes out of scope (through function return) or is moved (through an online change) then the Matrix Accessor will no longer work.
Therefore, they are best used quickly then destroyed, all within the scope of a single F or FB.

---

## Examples

### Projects With Implementations

* [TcTransform](https://github.com/BurksEngineering/TcTransform):  Static memory 3x1, 3x3, and 4x4 matricies for common 3D coordinate system transformations
* The unit tests within this project provide a large number of simple examples and usages
* The ExternalStaticMatrix is one example of how to implement the StaticMatrix base class

repository: PTKu/TcMatrix

repo_name: PTKu/TcMatrix


text:
# Bugger-Online_Compiler
Online compiler for C,C++,Python,Java.
## About
This is a web application in which users can log in and compile their code.
It has compilers for:-
- C
- C++
- Java
- Python.
## Install
### Prerequisites
- Gcc
- G++
- Python
- Python3
- Java
- Apache2
- Mysql
- Php.
### Procedure
#### Install the compilers:-
To get the above packages run:-

`sudo apt-get install gcc`

`sudo apt-get install python`

`sudo apt-get install python3`

`sudo apt-get install default-jdk`

#### Install Apache2, Mysql, Php
To install apache2, mysql and php run:-

`sudo apt install apache2`

`sudo apt install mysql-server`

`sudo apt install php-pear php-fpm php-dev php-zip php-curl php-xmlrpc php-gd php-mysql php-mbstring php-xml libapache2-mod-php`

To start these services run:-

`sudo systemctl start apache2`

`sudo systemstl start mysql`

Create a new account in mysql database.

Open Terminal and Run:-

`sudo mysql -u root -p`

`GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password';`

## Configuration
Open registration/server.php and edit the *database name*,*table name*,*user name*,and *password* as per your choice.

Put all the files inside /var/www/html of your computer.

## Congratulations
Open the file in your local host and you are good to go.


text:
# Facebook Message Export Parser

Facebook has a feature that allows users to download a copy of their data as a zip archive containing htm files with their data. The aim of this parser is to take this archive and to extract a user's Facebook Messages from it; to transfer them into a more useful format, as well as performing some analysis to produce interesting data.

I have added basic CSV support.

#### Running the Code
The Facebook Export can be downloaded from  the [Facebook Settings](https://www.facebook.com/settings) menu.

Run "python fb_parser.py" with the 'messages.htm' file in the same directory to export to JSON as proof of concept.

#### Dependencies
The code is written in Python 3+. The parser uses [BeautifulSoup](http://www.crummy.com/software/BeautifulSoup/) to do the bulk of the capture from the htm file.

[Anaconda Python](https://store.continuum.io/cshop/anaconda/) for scientific computing is a simple and easy way to install all the dependencies for the code, alongside many other useful libraries. It can be downloaded [here](http://continuum.io/downloads).

repository: awensaunders/FB-Message-Parser

repo_name: awensaunders/FB-Message-Parser


text:
Akan Name Selector

Description
This project is a web application that takes a user's birthday and calculates the day of the week they were born and then depending on their gender outputs their Akan Name.

Date of current version is : 14th june 2021.

Author:
Kamau Francis Kanyua

Ditailed description:
Enter century of birth eg 20 for 2019, Input Example 20 Output example 20
Enter year of Birth eg 19 for 2019 Input Example 19 Output Example 19
Enter month of birth eg 1 for january Input example 1 Output example 1
Enter Date of the month you were born in eg 20 input example 20 output example 20
Select gender Input example male output male
Submit. Input example, the program compares the inputs with the conditions set for the inputs eg if No input field is empty, the program executes else an alert to enter valid deatils.
0 < Date >= 31.
0 < Month >= 12
Gender Male or Female.
True value is output. Output example: You were born on Sunday and Your akan name is Kwasi! &nbsp If your gender is Male.
True value is output. Output example: You were born on Sunday and Your akan name is Akosua! &nbsp If your gender is female.
Example
century input -- 20
year input -- 19
month input -- 7
date input -- 14
gender -- male selected, Expected output is You were born on Sunday and Your akan name is Kwasi!

Known Bugs:
Some output are not as accurate as expected.
Contact Information.

Technologies Used:
HTML5
CSS
JavaScript
markdown
Bootstrap

Live Page: njiti.github.io/simple-akan/
Installation / Setup instruction
Open Terminal {Ctrl+Alt+T}
cd Akan-Names
code . or atom . based on the text editor you have.

You can contact me on<EMAIL_ADDRESS>
License
MIT License:
Copyright (c) 2021 Kamau Francis Kanyua.

repository: njiti/Simple-Akan

repo_name: njiti/Simple-Akan


text:
---
_id: 5a88e1acbd6dca0d5f0d2242
title: "Getting started with Google Cloud Client Libraries for .NET"
url: 'https://cloudplatform.googleblog.com/2016/08/getting-started-with-Google-Cloud-Client-Libraries-for-.NET.html'
category: articles
slug: 'getting-started-with-google-cloud-client-libraries-for-net'
user_id: 5a83ce59d6eb0005c4ecda2c
username: 'bill-s'
createdOn: '2016-08-28T04:09:48.000Z'
tags: []
---

Last week, we introduced new tools and client libraries for .NET developers to integrate with Google Cloud Platform, including Google Cloud Client Libraries for .NET, a set of new client libraries that provide an idiomatic way for .NET developers to interact with GCP services. In this post, we'll explain what it takes to install the new client libraries for .NET in your project.

repository: dotnetweekly/dnw-gatsby

repo_name: dotnetweekly/dnw-gatsby


text:
## Upplication SirTrevor blocks

Custom blocks:

* button
* ck-editor
* header-align
* image-edit
* map
* spacer
* text-align
* widget
* columns

### INSTALLATION

Clone this repo and install the dependencies:

* Install node dependencies: `npm install`
* Install project dependencies: `bower install`

### DEVELOPMENT
Before doing any of the following tasks make sure **you have installed the project**

* `gulp doc` generate the jsdocs and store in the doc folder
* `gulp compile` generate new compile results of the blocks: `sir-trevor-blocks.js`, `sir-trevor-blocks.min.js`, `sir-trevor-blocks.css`, and`sir-trevor-blocks.min.css`
* `gulp patch` compile and generate a new tag in the git repository incrementing the path version
* `gulp feature` compile and generate a new tag in the git repository incrementing the feature version
* `gulp release` compile and generate a new tag in the git repository incrementing the major version

repository: Upplication/sir-trevor-blocks

repo_name: Upplication/sir-trevor-blocks


text:
# Battleships
Simple and unpredictable game played by two separately run apart scripts written in TCL

## Preview
[![tcl](https://user-images.githubusercontent.com/19840443/50496826-18f79780-0a33-11e9-846b-57004068cbd0.png)](https://www.youtube.com/watch?v=Qni69qYwFP8&feature=youtu.be)
## About
Project developed under MIT License which permits to reuse the code as long as copies of the licensed software include a copy of the MIT License terms and the copyright notice.
It is an amateur project to show the flexibility of TCL scripting programming language. Game adjusts to settings written by the user. TCL Script that I would like you to present you
is quite elaborate and unscramble. To nail the code I added some debug features. Code is not aimed to be an example of good code practice. The aim of the project was to learn the new language.
## Rules
Game consist of area 10x10 from A to J and from 0 to 9. Each player has 8 ships with proper size:
two 1-funnel,
two 2-funnel,
two 3-funnel,
one 4-decker,
one 5-decker. Before play begins, each run script secretly arranges their ships on their primary grid.
One of the scripts starts game consistently and repeatedly giving the feedback to the second player. Computer is prepared to hold and reuse
as much information as it can to apply it to the game making it easier for themself to win. The good example is marking the around area of sunken ship.

repository: devmichalek/Battleships

gha_language: Tcl

repo_name: devmichalek/Battleships