text:
![GitHub](https://img.shields.io/github/license/depscloud/extractor.svg)
![branch](https://github.com/depscloud/extractor/workflows/branch/badge.svg?branch=main)
![Google Analytics](https://www.google-analytics.com/collect?v=1&cid=555&t=pageview&ec=repo&ea=open&dp=deploy&dt=deploy&tid=UA-143087272-2)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fdepscloud%2Fdeploy.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fdepscloud%2Fdeploy?ref=badge_shield)

# deps.cloud

[deps.cloud](https://deps.cloud/) is system that helps track and manage library usage across an organization.
Unlike many alternatives, it was built with portability in mind making easy for anyone to get started.

For more information on how to get involved take a look at our [project board](https://github.com/orgs/depscloud/projects/1).

## Deployment

This repository contains deployment configuration for the deps.cloud ecosystem.

**Supported storage drivers:**

* Driver name: `sqlite`
* Connection string: `file::memory:?cache=shared`

* Driver name: `mysql`
* Connection string: `user:password@tcp(depscloud-mysql:3306)/depscloud`

* Driver name: `postgres`
* Connection string: `postgres://user:password@depscloud-postgresql:5432/depscloud`

### Docker

Docker is great for trying the project out or for active development.
I do not recommend using the docker configuration in this repository for production deployments.

* [MySQL](docker/mysql/)
* [PostgreSQL](docker/postgres/)
* [SQLite](docker/sqlite/)

### Kubernetes

* [Raw Manifests](https://deps.cloud/docs/deployment/k8s/) (not recommended for production)
* [ArgoCD](https://github.com/depscloud/deploy/tree/main/examples/argocd)
* [Helm](https://github.com/depscloud/deploy/tree/main/examples/helm)
* FluxCD's [HelmOperator](https://github.com/depscloud/deploy/tree/main/examples/helm-operator)

### Helm Charts

The canonical source for Helm charts is the [Helm Hub](https://hub.helm.sh/), an aggregator for distributed chart repos.

This GitHub project is the source for the `depscloud` [Helm chart repository](https://v3.helm.sh/docs/topics/chart_repository/).

For more information about installing and using Helm, see the [Helm Docs](https://helm.sh/docs/).
For a quick introduction to Charts, see the [Chart Guide](https://helm.sh/docs/topics/charts/).

#### How do I install these charts?

```
$ helm repo add depscloud https://depscloud.github.io/deploy/charts
"depscloud" has been added to your repositories
```

## License
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fdepscloud%2Fdeploy.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fdepscloud%2Fdeploy?ref=badge_large)


text:
# Example PHC App

This app is a create-react-app generated project that shows the bare minimum for getting a UI app up and running against the PHC.

## Usage

```bash
yarn install --ignore-engines
yarn start
```

license: MIT

repository: lifeomic/example-phc-app

branch_name: refs/heads/master

extension: md

gha_language: JavaScript

gha_license_id: MIT

license_type: permissive

repo_name: lifeomic/example-phc-app


text:
[中文文档](README.zh-CN.md)

# People tracker

This application counts how many people went upwards / downwards / leftwards / rightwards in the video stream, allowing you to
receive an information about how many people went into a room or went through a corridor.

The model used in this example is [person_detection_retail_0013](https://docs.openvinotoolkit.org/latest/omz_models_intel_person_detection_retail_0013_description_person_detection_retail_0013.html) from the OpenVINO Model Zoo.

## Demo

[![Watch the demo](https://user-images.githubusercontent.com/5244214/90752628-ee2d1780-e2d7-11ea-8e48-ca94b02a7674.gif)](https://youtu.be/8RiHkkGKdj0)

## Pre-requisites

Purchase a DepthAI model (see https://shop.luxonis.com/)

## Install project requirements

```
python3 -m pip install -r requirements.txt
```

## Run this example

```
python3 main.py
```

By default, you should see a debug window and console output that shows how many people were
tracked. Also, you should see `results.json` file with timestamped results.

If you want to run it without preview, just to collect the data, you can modify `main.py` and set

```diff
- debug = True
+ debug = False
```

Then the app will run without preview window nor debug messages, will just save the results to `results.json`

## Credits

Adrian Rosebrock, OpenCV People Counter, PyImageSearch, https://www.pyimagesearch.com/2018/08/13/opencv-people-counter/, accessed on 6 August 2020

repository: madhavjk/depthai-experiments

repo_name: madhavjk/depthai-experiments


text:
# What is it?
"FreeAct" is a minimal real-time embedded framework (RTEF) based on the
FreeRTOS kernel. FreeAct implemetns the Active Object design pattern.
It was originally presented by Miro Samek at the
[Embedded Online Conference 2020](https://www.embeddedonlineconference.com/session/Modern_Embedded_Software_Goes_Beyond_the_RTOS)

---------------------------------------------------------------------
# Directories and Files

```
FreeAct/
+-3rd_party/       - third-party software (needed in the examples)
| +-FreeRTOS/      - stripped down FreeRTOS 10.3.1 distribution
| +-CMSIS/         - ARM CMSIS
| +-efm32pg1b/     - low-level code to support the EFM32PG1B board
| +-ek-tm4c123gxl/ - low-level code to support the EK-TM4C123GX board
|
+-examples/
| +-blinky-efm32/  - Blinky-Button exammple for the EFM32PG1B board
| +-blinky-efm32/  - Blinky-Button exammple for the EK-TM4C123GX board
|
+-inc/             - include directory
| +-FreeAct.h      - FreeAct interface
+-src/             - source directory
| +-FreeAct.c      - FreeAct implementation
```

---------------------------------------------------------------------
# Licensing
FreeAct is licensed under the MIT open source license, which is the same
used in FreeRTOS.

---------------------------------------------------------------------
# Contact Information

[state-machine.com](https://www.state-machine.com)

repository: gianricardo/FreeAct

repo_name: gianricardo/FreeAct


text:
# BinaryListHash

A very fast hash for really big data sets

If you have millions or 10's of millions of key/value pairs then you
might need this hash tree.

**Features**

- Can use less memory than the actual total bytes of the key/value pair in some cases.
- Template driven so you can use any structure as a key.
- no costly resize operations like std::map or std::unordered_map
- maintains sort order.
- has a smaller memory foot print than std::map or std:unordered_map
- 3x faster inserts than std::map or std::unordered_map
- 5x faster reads than std::map or std::unordered_map
- 60% of memory usage of std::map or std:unordere_map (not this varies depending on the data).

**Things to Know**

- Values can only be upto 8 bytes long. This will hold a 64bit pointer, a double or a long long. If you results are larger than 8 bytes, store a pointer and perhaps use a [https://github.com/SethHamilton/HeapStack](HeapStack) to store a larger value structure,
- Inserting only acending order keys is slow. Inserting random keys performs well, inserting sequential keys performs very well.

**Perforamnce**

I'll will get better performance data here soon. On my Core i7 @ 3.2Ghz while inserting sparse but sequential 64 bit keys, I am seeing insert rates a 10.7 million key/values per second. I can look up and retreive values at a rate of 17.7 million key/value pairs per second.

On large datasets generally sequential keys will result in memory consumption less than the sizeof the key + sizeof the value. On generally random keys BinaryListHash will use about 60% of the total memory that std::unordered_map will use.

**The MIT License (MIT)**

Copyright (c) 2015 Seth A. Hamilton

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

repository: SethHamilton/BinListHash

repo_name: SethHamilton/BinListHash


text:
Second Game Documentation:
--------------------------------------------------------------
This is a single player shooter game. The purpose of this game is to deliver mail to the space station that are
scattered around the screen. Once the ship has landed on the station, the ship will attach itself to it and stay there.
The ship takes no damage when docked at the station as well as receives points after leaving the station. When the player
leaves the station the station is removed from the map (not replaced). The asteroids on the game are randomly drawn into
the game. The asteroid deal damage to the ship but not the stations, and as previously mentioned the ship takes no damage
when docked in the station. The asteroid are destructable this means that the ship can shoot at them and destroy them.
The health of the ship consists of a single life bar that depletes to zero when hit three times by the asteroids. The
game is over if the ship is hit three times.

Game Description and KeyControl
--------------------------------------------------------------
Controls:
Right Arrow Key - Move right
Left Arrow Key  - Move Left
Down Arrow Key  - Slow Down
Up Arrow Key    - Move Forward
Enter Key       - Shoot
SpaceBar        - Launch From Station

This game contains no power ups of any kind. The score can be seen on the left hand side of the screen. The score depletes
while a player is docked at a station, leaving the station stops the depletion.
The only way to exit the game is to close it down manually by clicking the top exit buttom on the window.
The only way to start a new game so far is to relaunch the game, restart has not been implemented.

Compiler Used
---------------------------------------------------------------
IntelliJ IDEA 2018.2.2 (Ultimate Edition)
Build #IU-182.4129.33, built on August 21, 2018
Licensed to Ivan Briseno
Subscription is active until September 4, 2019
JRE: 1.8.0_152-release-1248-b8 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
Java SDK Version 10.0.2

JAR File
----------------------------------------------------------------
JAR File is created by does not display anything. The IDE plays the game with no issues but the jar file appears
to only be blank screen. This is the same issue that I encountered with the previous game where the Jar file
had the same behavior as this one.


text:
# spring-sandbox
A collection of spring 5 tests following SpringDeveloper tips and tutorials

### reactive-ws-r2dbc

Spring 5 reactive SQL data access with spring R2DBC + r2dbc-mysql.

A test project following Spring Tips: Reactive SQL Data Access with Spring Data R2DBC by Josh Long

repository: ibnuShahar/spring-sandbox

repo_name: ibnuShahar/spring-sandbox


text:
# Spark DateTime Library

A library for exposing dateTime functions from the [joda time library](http://www.joda.org/joda-time/) as SQL
functions. Also provide a dsl for dateTime catylst expressions; this utilizes the
[scala wrapper library](https://github.com/nscala-time/nscala-time nscala).

[![Build Status](https://travis-ci.org/SparklineData/spark-datetime.svg?branch=master)](https://travis-ci.org/SparklineData/spark-datetime)

## Requirements

This library requires Spark 1.4+

## Linking
You can link against this library in your program at the following coordiates:

```
groupId: org.sparklinedata
artifactId: spark-datetime_2.10
version: 0.0.1
```

## Using with Spark shell
This package can be added to  Spark using the `--jars` command line option.  For example, to include it when starting the spark shell:

```
$ bin/spark-shell --packages org.sparklinedata:spark-datetime_2.10:0.0.1
```

## Features
* A set of functions from the joda library to operate on dates.
  *  `field access`: all functions in the [DateTime class](http://www.joda.org/joda-time/apidocs/org/joda/time/DateTime.html) are
available as sql functions. The first argument is the DateTime object on which the function is to be applied.
  *  `construction`: functions are available to convert a String or a epoch value to DateTime
  *  `comparison` functions available to compare dates (=, <, <=, >, >=), also compare against __now__.
  * `arithmetic`: functions available to add/subtract [Period](http://www.joda.org/joda-time/apidocs/org/joda/time/Period.html)
from dates.
  * `intervals`: functions available to construct [Intervals](http://www.joda.org/joda-time/apidocs/org/joda/time/Interval.html)
  and compare(contains, overlaps, abuts, gap) intervals and dateTimes.
* A _dsl_ for dateTime catylst expressions.
* A _StringContext_ to embed date expressions in SQL statements.

### Function naming convention
* getter functions on the [DateTime class](http://www.joda.org/joda-time/apidocs/org/joda/time/DateTime.html) are exposed with the same
name, in camelCase. So _getYear_ is exposed as _year_, _getMonthOfYear_ is exposed as _monthOfYear_ etc.

### SQL API
Assume you have a table _input_ with a string column called _dt_

```sql
select dt, dateTime(dt), dayOfWeek(dateTime(dt)), dayOfWeekName(dateTime(dt)), dayOfWeekName(dateTimeWithTZ(dt))
from input
```

### Date Expressions using the DSL

#### A basic example
```scala
import com.github.nscala_time.time.Imports._
import org.apache.spark.sql.catalyst.dsl.expressions._
import org.sparklinedata.spark.dateTime.dsl.expressions._
import org.sparklinedata.spark.dateTime.Functions

// register all functions
Functions.register(sqlContext)

val dT = dateTime('dt)
val dOW = dateTime('dt) dayOfWeek
val dOWNm = dateTime('dt) dayOfWeekName
val dOWNm2 = dateTimeWithTZ('dt) dayOfWeekName
val dTFixed = dateTime("2015-05-22T08:52:41.903-07:00")

val t = sql(date"select dt, $dT, $dOW, $dOWNm, $dOWNm2, $dTFixed," +
      " dateTime(\"2015-05-22T08:52:41.903-07:00\") from input")
```

#### An example about periods
```scala
import com.github.nscala_time.time.Imports._
import org.apache.spark.sql.catalyst.dsl.expressions._
import org.sparklinedata.spark.dateTime.dsl.expressions._

val dT = dateTime('dt)
val dT1 = dateTime('dt) + 3.months
val dT2 = dateTime('dt) - 3.months
val dT3 = dateTime('dt) + 12.week
val cE = dateTime('dt) + 3.months > (dateTime('dt) + 12.week)

val t = sql(date"select dt, $dT, $dT1, $dT2, $dT3, $cE from input")
```

#### Weekend filter example
```scala
val filter : Expression = ((dateTime('dt) dayOfWeekName) === "Saturday") ||
      ((dateTime('dt) dayOfWeekName) === "Sunday")

val t = sql(date"select dt from input where $filter")
```

#### Group By example
```scala
val dayOfWeek: Expression = dateTime('dt) dayOfWeekName

val t = sql(date"select $dayOfWeek, count(*) from input group by $dayOfWeek")
```

#### Interval example
```scala
val i1 = END_DATE - 15.day to END_DATE - 10.day

val isBefore = i1 isBeforeE dateTime('dt)
val isAfter = i1 isAfterE dateTime('dt)
val i2 = dateTime('dt) to (dateTime('dt) + 5.days)
val overlapsE = i1 overlapsE i2
val abutsE = i1 abutsE i2

val t = sql(date"select dt, $isBefore, $isAfter, $overlapsE, $abutsE from input")
```

#### Time Bucketing
Use this feature to bucket dates into given Periods. For e.g. 8.hours, 30.mins, 2.days etc.

The following example buckets rows into 3 day periods.  The *bucket* function on a DateExpression
takes an _origin_ date and a Period specification. The Period is an
[iso8061 specification for period.](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISOPeriodFormat.html#standard\(\))

```scala
val start = dateTime("2015-06-23T17:27:43.769-07:00")
val dT = dateTime('dt)
val timeBucket = dateTime('dt) bucket(start, 3.days)

val t = sql(date"select dt, $dT, $timeBucket from input")
```

Or the direct sql for the above query is:
```sql
select dt, dateTime(`dt`),
      timeBucket(dateTime(`dt`),dateTime("2015-05-24T17:27:43.769-07:00"),period("P3D"))
from input
```

## Building From Source
This library is built with [SBT](http://www.scala-sbt.org/0.13/docs/Command-Line-Reference.html), which is
automatically downloaded by the included shell script.
To build a JAR file simply run `build/sbt package` from the project root.
The build configuration includes support for both Scala 2.10 and 2.11.


text:
---
description: "The `RelationType` class represents a relation definition between two node types (content or media)."
---
# RelationType

The `RelationType` class represents a relation definition between two node types (content or media). For example keeping track of node usage across the site, in order to avoid deleting content that is used else where. When querying a relation this is done using the parent node key unless the `RelationType` is set to bidirectional in which case you can also query using the child node key.

* **Namespace:** `Umbraco.Cms.Core.Models`
* **Assembly:** `Umbraco.Core.dll`

All samples in this document will require references to the following dll:

* Umbraco.Core.dll

All samples in this document will require the following using statement:

```csharp
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
```

## Constructors

### new RelationType(string name, string alias, bool isBidrectional, Guid? parentObjectType, Guid? childObjectType)

Constructor for creating a new RelationType object where the necessary parameters are the string alias and name of the relation type, a `bool` to indicate whether the relation is bidirectional, and the `Guid?` key of the child object type, parent object type the relation type will be for.

## Properties

### .Name

Gets or sets the Name of the RelationType as a `String`.

```csharp
// Given a `RelationService` object get RelationType by its Id and return Name
var relationType = relationService.GetRelationTypeById(1234);
return relationType.Name;
```

### .Alias

Gets or sets the Alias of the RelationType as `String`.

```csharp
// Given a `RelationService` object get RelationType by its Id and return Alias
var relationType = relationService.GetRelationTypeById(1234);
return relationType.Alias;
```

### .IsBidirectional

Gets or sets a `boolean` indicating whether the RelationType is Bidirectional (true) or Parent to Child (false)

```csharp
// Given a `RelationService` object get RelationType by its Id and return IsBidirectional
var relationType = relationService.GetRelationTypeById(1234);
return relationType.IsBidirectional;
```

### .ParentObjectType

Gets or sets the Parents object type key as `Guid?`

```csharp
// Given a `RelationService` object get RelationType by its Id and return ParentObjectType
var relationType = relationService.GetRelationTypeById(1234);
return relationType.ParentObjectType;
```

### .ChildObjectType

Gets or sets the Childs object type key as `Guid?`

```csharp
// Given a `RelationService` object get RelationType by its Id and return ChildObjectType
var relationType = relationService.GetRelationTypeById(1234);
return relationType.ChildObjectType;
```

repository: umbraco/UmbracoDocs

branch_name: refs/heads/main

repo_name: umbraco/UmbracoDocs


text:
# dev-show
development for new sys show all

This application uses the mongo db installed by StackStorm.. Since the DB is secured
you will need to log into the StackStorm mongo DB as a StackStorm admin and create a separate DB

# sysshow mongengine to work with StackStorm mongo DB

log in with admin first
-------------------------------------------------------------------------------------
mongo -u admin -p UkIbDILcNbMhkh3KtN6xfr9h admin  (passwd in /etc/st2/st2.config)

# Then create a new user
db.createUser({user: "appUser",pwd: "passwordForAppUser",roles: [ { role: "readWrite", db: "app_db" } ]})

# Add creds to the Flask application.py file
```
app.config['MONGODB_SETTINGS'] = {
        'db': 'app_db',
        'host': 'localhost',
        'port': 27017,
        'username': 'appUser',
        'password': 'passwordForAppUser',
        'authentication_source': 'admin'
        }
```

Now Flask app can access the st2 mongo database installation

# sysshow uses multiple mongo collections.
Here is a quick tutorial for using the mongo client and adding records to the mongo db

# Create number collection and add a record to it.
```
mongo -u appUser -p passwordForAppUser admin
> use app_db
> db.createCollection('number')
> db.number.insertOne({num:1})
> db.number.find()
{ "_id" : ObjectId("5cc84e276e9abf31a65a5f1f"), "num" : 1 }
```

#To issue stackstorm commands from the command line you have to log into StackStorm
```
st2 login st2admin
```


text:
# CVars

CVars are global variables used for configuring the runtime. They are used for development to enable or modify hidden features.

## Types of CVars

Only a strictly limited set of CVar types is supported:

* `ezCVarBool`
* `ezCVarFloat`
* `ezCVarInt`
* `ezCVarString`

## Accessing and Modifying CVars

CVars are exposed in multiple ways.

### ezEditor

In [ezEditor](../getting-started/editor-overview.md) you can open *Panels > CVars* to show a panel that allows you to modify CVars. Be aware that some CVars only have an effect when simulating the scene, and some even only when using Play-the-Game mode. The latter mostly happens when the effect of a CVar is implemented by a [Game State](../runtime/application/game-state.md).

### ezInspector

[ezInspector](../tools/inspector.md) allows you to modify CVars of the connected process using the same UI as the editor.

### In-Game Console

In-game a convenient way to modify CVars is the [console](console.md).

* Press **TAB** to list all CVars
* Type the beginning of a CVar name and press **TAB** to list CVars with just that prefix name.
* Type `CVarName = value` to modify the CVar's value.

  ```cmd
  cvar_bool = true
  cvar_bool =
  cvar_int = 3
  cvar_string = "test"
  ```

  For boolean CVars, typing 'var =' will toggle the variables value, which can be very handy, especially combined with using F2 to repeat the previous console command.

  You can also do basic arithmetic like so:

  ```cmd
  cvar_bool = not cvar_bool
  cvar_int = cvar_int + 1
  ```

### TypeScript

The [TypeScript binding](../custom-code/typescript/typescript-overview.md) is also able to access CVars.

## Command Line

CVars can be set through command line arguments using this syntax:

```cmd
MyGame.exe -CvarName Value
```

For example:

```cmd
MyGame.exe -Game.DebugDisplay true -fmod_MasterVolume 0.1
```

Values specified through the command line take precedence over stored values.

## Saving State

The value of a CVar is typically discarded when the program closes, however, if the CVar uses `ezCVarFlags::Save`, it will be saved and restored in the next run. Be careful with this flag, as it can be very confusing when it is used to toggle subtle behavior. Be especially careful keeping this flag in for production code.

There is also `ezCVarFlags::RequiresRestart` which means that modifying that variable will take no effect unless you restart the application. This can be used for things like screen resolutions and other initial values.

## Callbacks

You can subscribe to events for either all CVars or specific ones, to be informed when a CVar is modified.

## Example Code

You create a CVar simply by instantiating it as a global variable somewhere in a cpp file:

<!-- BEGIN-DOCS-CODE-SNIPPET: cvar-1 -->
```cpp
#include <Foundation/Configuration/CVar.h>

ezCVarBool cvar_DebugDisplay("Game.DebugDisplay", false, ezCVarFlags::Default, "Whether the game should display debug geometry.");
```
<!-- END-DOCS-CODE-SNIPPET -->

Then you can just treat it like a regular variable to read or write its value:

<!-- BEGIN-DOCS-CODE-SNIPPET: cvar-2 -->
```cpp
if (cvar_DebugDisplay)
{
  ezDebugRenderer::DrawLineSphere(m_pMainWorld, ezBoundingSphere(ezVec3::ZeroVector(), 1.0f), ezColor::Orange);
}
```
<!-- END-DOCS-CODE-SNIPPET -->

## See Also

* [Back to Index](../index.md)
* [Console](console.md)
* [ezInspector](../tools/inspector.md)

repository: Ingrater/docs

repo_name: Ingrater/docs


text:
# Save Model

Save Model is a Laravel package that allows you to save data in the database in a new way. No need to worry about `$guarded` and `$fillable` properties in the model anymore. Just relax an use `Save Model` package.

---

[![Latest Version on Packagist](https://img.shields.io/packagist/v/asdh/save-model.svg?style=flat-square)](https://packagist.org/packages/asdh/save-model)
[![GitHub Tests Action Status](https://img.shields.io/github/workflow/status/asdh/save-model/run-tests?label=tests)](https://github.com/asdh/save-model/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/workflow/status/asdh/save-model/Check%20&%20fix%20styling?label=code%20style)](https://github.com/asdh/save-model/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
[![Total Downloads](https://img.shields.io/packagist/dt/asdh/save-model.svg?style=flat-square)](https://packagist.org/packages/asdh/save-model)

---

## Installation

You can install the package via composer:

```bash
composer require asdh/save-model
```

You can publish the config file with:
```bash
php artisan save-model:publish

or

php artisan vendor:publish --provider="Asdh\SaveModel\SaveModelServiceProvider"
```

This is the contents of the published config file:

```php
// config/save_model.php

return [
    /**
     * The directory name where the files should be stored
     * This can be changed via 'saveableFields' method on model
     */
    'file_upload_directory' => 'files',
];
```

## Usage

```php
// In controller

use Asdh\SaveModel\SaveModel;

SaveModel::new(
    new User,
    $request->only(['name', 'email', 'password', 'image'])
)->execute();

// OR

(new SaveModel(
    new User,
    $request->only(['name', 'email', 'password', 'image'])
)->execute();
```

You just do this and a new user will be created and saved to the 'users' table. The password will be automatically hashed, and uploading of the image will also be automatically handled.

To update a model, you just have to pass the model that you want to update.

```php
// In controller

use Asdh\SaveModel\SaveModel;

$user = User::find(1);

SaveModel::new(
    $user,
    $request->only(['name', 'email'])
)->execute();
```
Only name and email will be updated and no other columns will be touched.

**For this to work, you need to do these things:**

Go to User model class or any other model class and add `CanBeSavedContract` class to it. In this example, I will use User model.

```php
use Asdh\SaveModel\Contracts\CanBeSavedContract;

class User extends Authenticatable implements CanBeSavedContract
{

}
```

After adding this, you need to add `saveableFields` method to the User model and map every columns of the users table like so:

```php
use Asdh\SaveModel\Contracts\CanBeSavedContract;
use Asdh\SaveModel\Fields\DatetimeField;
use Asdh\SaveModel\Fields\FileField;
use Asdh\SaveModel\Fields\PasswordField;
use Asdh\SaveModel\Fields\StringField;

class User extends Authenticatable implements CanBeSavedContract
{
    public function saveableFields(): array
    {
        return [
            'name' => StringField::new(),
            'email' => StringField::new(),
            'email_verified_at' => DatetimeField::new(),
            'password' => PasswordField::new(),
            'image' => FileField::new(),
        ];
    }
}
```

After doing this you are good to go. In the controller, you just need to get the data and use the `SaveModel` class

```php
use Asdh\SaveModel\SaveModel;

SaveModel::new(
    new User,
    $request->only(['name', 'email', 'password', 'image'])
)->execute();

// OR

(new SaveModel(
    new User,
    $request->only(['name', 'email', 'password', 'image'])
)->execute();
```

The files will be uploaded using the default `Laravel's filesystem`. Which means that you can directly configure to upload the files directly to the `S3` as well or any other that Laravel supports.

Also, the files will be uploaded to the `files` directory by default. You can change that globally by changing the value of `file_upload_directory` on the `save_model.php` configuration file.

You can also change it per model like so:

```php
// app/Models/User.php

public function saveableFields(): array
{
    return [
        'image' => FileField::new()->setDirectory('images'),
    ];
}
```

It will now store the `image` of the user to the `images` directory and for every other `Models`, it will use from the `save_model.php` config file.

You can also, choose the Laravel Filesystem's `disk` per model like so:

```php
// app/Models/User.php

public function saveableFields(): array
{
    return [
        'image' => FileField::new()
            ->setDirectory('images')
            ->setDisk('s3'),
    ];
}
```

By default `random name` will be generated for the uploaded files, but you can change that also. You just have to pass closure on the `setFileName` method and you will get access to the uploaded file there. And whatever you return from here will be saved to the database as the file name.

This example shows how to return the original file name.

```php
// app/Models/User.php

use Illuminate\Http\UploadedFile;

public function saveableFields(): array
{
    return [
        'image' => FileField::new()
            ->setDirectory('images')
            ->setFileName(function (UploadedFile $uploadedFile) {
                return $uploadedFile->getClientOriginalName();
            }),
    ];
}
```

If you want to upload the file as the original name then you can do this:

```php
// app/Models/User.php

use Illuminate\Http\UploadedFile;

public function saveableFields(): array
{
    return [
        'image' => FileField::new()
            ->setDirectory('images')
            ->uploadAsOriginalName(),
    ];
}
```

One thing to keep in mind that the `setFileName` method will take precedence over `uploadAsOriginalName` if both methods are being used.

Not only this, the deletion of the file will also be automatically handled when updating a model. By default, when a model is updated, the old file will be automatically deleted if a new file is being uploaded. If you don't want the old images to be deleted then you can chain `dontDeleteOldFileOnUpdate` method.

```php
// app/Models/User.php

use Illuminate\Http\UploadedFile;

public function saveableFields(): array
{
    return [
        'image' => FileField::new()
            ->setDirectory('images')
            ->dontDeleteOldFileOnUpdate(),
    ];
}
```

## Available Fields
```php
Asdh\SaveModel\Fields\StringField::class
Asdh\SaveModel\Fields\IntegerField::class
Asdh\SaveModel\Fields\DatetimeField::class
Asdh\SaveModel\Fields\DateField::class
Asdh\SaveModel\Fields\TimeField::class
Asdh\SaveModel\Fields\PasswordField::class
Asdh\SaveModel\Fields\FileField::class
Asdh\SaveModel\Fields\BooleanField::class
```

Other field will be added in the future and I am open to pull requests.

## Creating your own model field class

You can create your own field class as well. To create one, you need to run an artisan command

```bash
php artisan make:field BooleanField
```

This will create a `BooleanField` class inside `App\ModelFields` directory and it will look like this:

```php
<?php

namespace App\ModelFields;

use Asdh\SaveModel\Fields\Field;

class BooleanField extends Field
{
    public function execute(): mixed
    {
        // Perform your logic and return the value...

        // return strtoupper($this->value)
    }
}
```

It is not necessary that `BooleanField` class must be inside `App\ModelFields` directory. You can place it wherever you like.

You will have access to the data passed from the controller as `$this->value`. Then you can do whatever you want to do and return the value that you want to save in the database. In above case, we can do it like so:

```php
<?php

namespace App\ModelFields;

use Asdh\SaveModel\Fields\Field;

class BooleanField extends Field
{
    public function execute(): mixed
    {
        return in_array($this->value, [1, '1', true, 'true', 'on', 'yes']);
    }
}

```
If the input is any one of these, then we will consider it to be true and for every one of these values, we will save `true` (which will be `1` when stored in database) to the database.

Then you can easily use your own field in the model's `saveableFields` method. You can now use this `BooleanField` along with other fields like this:

```php
use Asdh\SaveModel\Contracts\CanBeSavedContract;
use Asdh\SaveModel\Fields\DatetimeField;
use Asdh\SaveModel\Fields\FileField;
use Asdh\SaveModel\Fields\PasswordField;
use Asdh\SaveModel\Fields\StringField;
use App\ModelFields\BooleanField;

class User extends Authenticatable implements CanBeSavedContract
{
    public function saveableFields(): array
    {
        return [
            'name' => StringField::new(),
            'email' => StringField::new(),
            'email_verified_at' => DatetimeField::new(),
            'password' => PasswordField::new(),
            'image' => FileField::new(),
            'is_admin' => Boolean::new(),
        ];
    }
}

```
Make sure you add the namespace correctly as shown above.

## Testing

```bash
composer test
```

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

## Contributing

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

repository: AnatolySnegovskiy/save-model

repo_name: AnatolySnegovskiy/save-model


text:
Creating a new machine type
===========================

Intro
-----
When creating a new machine type for MICrONS there are several steps that need
to happen. All of these steps are applicable even if just updating an existing
machine type.

Before starting make sure you have boss-manage.git checked out and the followed
the instructions in the boss-manage.git README file for checking out the needed
subrepositories.

SaltStack
---------
SaltStack is used to define what software packages are installed on a machine.
The behavior of Salt is controlled by `salt_stack/salt/top.sls`. For a new
machine create a new top level entry and if updating an existing machine type
update it's top level entry.

For more information about SaltStack configuration look at the SaltStack
documentation and read existing Salt formulas.

**Note:** In most cases you will want to include the boss-tools.bossutils
formula. This includes the bossutils python library which supports connecting
with Vault and AWS as well as setting the hostname of the system.

Packer
------
Packer is used to build VM images (Virtualbox OVF or AWS AMI) that are
configured by SaltStack.

1. Create a new Packer variable file.
  1. Copy one of the existing files in `packer/variables/`
  2. Rename the new file with the name used in `top.sls`
  3. Edit the new file and update the name to the name used in `top.sls`
2. Follow the README in `packer/` for instructions on how to run Packer
to build the new AMI.

**Note:** AMIs are named as <name>.boss to make sure they are unique in AWS

**Note:** if you are rebuilding an existing machine image you can skip step #1.
Instead you need to log into the AWS EC2 console and under the AMIs section
deregister the existing AMI image that you are about to rebuild.

CloudFormation
--------------
The last step is to make use of the new AMI. Either you can add it to an
existing CloudFormation configuration or you can create a new CloudFormation
configuration. Both options are covered in NewCloudFormationConfiguration.


text:
# Read: 02 - jQuery, Events, and The DOM

## JQuery
* JQuery is a JavaScript file that lets you find elements using css-style selectors and then do something with the elements using methods
* JQuery must be imported using a script tag in HTML
* JQuery shortens code in JavaScript to use less lines of code
* Chaining can be used to place several methods in the same selector
* .html retrieves only the HTML inside the first element in the matched set, along with any of it's descendents

## Pair Programming
* Pair programming is one way we foster a collaborative environment while developing key industry skills
* Pair programming commonly involves two roles:
  * The Driver is the programmer who is typing and the only one whose hands are on the keyboard
  * The Navigator uses their words to guide the Driver but does not provide any direct input to the computer
* Pair programming touches on four skills:
  * Developers explain out loud what the code should do
  * Developers listen to others’ guidance
  * Developers read code that others have written
  * Developers write code themselves

repository: nkkinkade/reading-notes

repo_name: nkkinkade/reading-notes


text:
# rx-cast-subject
Unify next/error/end interface of subjects from different FRP libs.

---

### Installation
```
npm install --save rx-cast-subject
```

---

### API
#### `cast : Subject -> RxSubject`
#### `Subject : new Rx.Subject | new Bacon.Bus | new KefirBus | mostSubject().subject`

`cast(subject)` ensures that given subject has `onNext`, `onError`, `onCompleted` (and `next`, `error`, `completed`) methods, as standard RxJS subject.

Additionally, it ensures all that methods are bound to subject context, so you can safely do `<div onClick={subject.onNext} />`.
`kefir` and `most` do this themselves, `rx` and `bacon` are not.

Just like [bacon-cast](https://github.com/StreakYC/bacon-cast) or [kefir-cast](https://github.com/StreakYC/kefir-cast), this is intended for use by libraries which want to be able to accept streams from different sources, without diving into differences between them.

repository: jeron-diovis/rx-cast-subject

repo_name: jeron-diovis/rx-cast-subject


text:
---
layout: default
---

# 1997-08-22 - For Platypus Eyes Only

## Header Data

From: bureau42 Anonymous Remailer<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 6b7d04d913c8f516d58642f6ee43baac138ce72392f148fb83fcd7f6ae099889

Message ID<EMAIL_ADDRESS>Reply To: _N/A_

UTC Datetime: 1997-08-22 15:53:21 UTC

Raw Date: Fri, 22 Aug 1997 23:53:21 +0800

## Raw message

```
{% raw  %}From: bureau42 Anonymous Remailer<EMAIL_ADDRESS>Date: Fri, 22 Aug 1997 23:53:21 +0800
To<EMAIL_ADDRESS>Subject: For Platypus Eyes Only
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

FROM MOUNTAIN MEDIA
    FOR IMMEDIATE RELEASE DATED SEPT. 5, 1997
    THE LIBERTARIAN, By Vin Suprynowicz
    Define 'stealing'

    Winding up an ongoing but perhaps instructive debate with e-mail
correspondent J.P., I had offered:

  "The notion that it's all right to steal at gunpoint 'some modest
amount,
as long it serves a legitimate public need' ignores the simple moral
truth
that the end cannot be allowed to justify the means."

  J.P. responded: "Define steal. If you are benefiting from having a
court
and national defense system, and pay nothing for its upkeep, then you
would
be stealing.

  OK -- one final time:

    #  #  #

  Hi, J.P. --

  Probably the one place where we are still furthest apart is the
definition of "theft."

  To me, it merely has to do with voluntarism, versus levying something
under the threat of force.

  None of my federal taxes are paid voluntarily. I allow them to be
"withheld" from my paycheck because if I tell my employer I won't work
here
any longer unless he stops "withholding," I'll be out of a job.

  Likewise, any other "compliance" I grant the federals is because they
have repeatedly demonstrated they will seize (start ital)all(end ital)
of
my paycheck, and all of my bank accounts (even if I find myself
unemployed,
and have so notified them), if I do not "comply"  -- all this without so
much as a signed court order.

  Under those conditions -- even if I didn't know how wasteful,
oppressive
and counterproductive most of their schemes really are -- what would I
care
to how "noble" a purpose the federals assure me some of my moneys will
be
put?

  Try approaching someone taking money out of her ATM. Assure her that
at
least 60 percent of the money you're seizing from her at gunpoint will
be
used to buy medicines for the poor. Proceed to (start ital)buy(end ital)
medicines for the poor with 60 percent of her money, and keep careful
documentation.

  When you're identified from the ATM camera tape and arrested, show the
police your evidence that most of the money went to "a noble purpose,"
while the rest merely covered your "operating overhead."  Right?

  I don't think so.

  Your underlying premise is that "government" can properly do things
which
would be crimes if they were done by individuals, as long as they're
"for
the greater good of the many." But that one concession leads, in the
end,
to all the evils of the police state.

  On the other hand, you puzzle me with the assertion: "If you are
benefiting from having a court and national defense system, and pay
nothing
for its upkeep, then you would  be stealing."

  Even if it weren't for the fact that more and more of these "Defense"
and
"court" dollars go to enslave and murder American citizens who have
harmed
no one -- whose only "offense" is refusal to kneel before their federal
masters -- I still wouldn't follow this.

  If a wealthy philanthropist builds a free public library, and I use
it,
am I "stealing?" After all,  I have "benefited from it without paying
for
its upkeep."

  If a direct-mail scam artist mails me some gimcrack plastic camera I
never ordered, and then tries to bill me $29.95 for "shipping and
handling," do I have to pay? I don't think so. Yet under your theory, he
would be allowed to seize from my bank account or paycheck any amount by
which he could demonstrate I had "benefited" from his unsolicited "gift"
... couldn't he?

  Unless (again) government has a right to do things which would be
crimes
if undertaken by mortal men. In which case I ask again, since we the
citizens cannot possibly "delegate" to the government rights or powers
which we never possessed, where does government claim to derive the
right
or power to do these immoral things?  At
the
point of his bayonet, and nowhere else?

  Your only answer seems to be, "The government has to do these things,
because we're not sure we could find enough funds, otherwise."

   In the past, the only reliable way I've found to
meet
these requirements is bank robberies. Now, if you want me to reform my
bank
robbery system, perhaps taking a larger share from the larger, richer
banks, I'll be happy to negotiate some reasonable reforms.

  "But heavens, you can't expect me to take the risk of giving up bank
robbing entirely, on the strength of this theory that 'Somehow, I could
probably keep my family fed by taking some kind of a steady job.' Don't
I
see panhandlers on the street every day? Aren't those people who tried
your
pie-in-the-sky, 'non-coercive' way of 'earning' enough money, and
failed?
I'd look a fine figure, standing at my child's grave, explaining 'I
HOPED
you wouldn't starve if I gave up bank-robbing. I thought it MIGHT work.'
In
fact, no single bank robber of my acquaintance has ever given up the
trade
voluntarily. Surely SOMEONE would have done so, in all these years, if
your
way could be made to work, don't you think?"

  If a private citizen told you this, you would doubtless judge him an
incurable sociopath, and hope to see him shot down or caged before he
could
terrorize and kill too many more innocent bank tellers and patrons. But
when a group of men who call themselves "the government" say this same
thing, you tell me they're being sensible and prudent.

  Others -- whether singly or in organized groups -- can volunteer to do
things which benefit me, without my permission. Presumably, they figured
the benefits to them would justify their proceeding, even without my
agreeing to help them.

  They have (start ital)no(end ital) moral right to then turn around and
bill me for a share of a thing they have done without seeking my
voluntary
help and permission in advance (what would be the proper charge for my
taking aesthetic pleasure in someone else's architecturally pleasing
building, I wonder?) under the theory: "You benefited, so you have to
pay."

  They can only extract such a non-voluntary payment from me by force or
the threat of force ... which is theft.

Vin Suprynowicz is the assistant editorial page editor of the Las Vegas
Review-Journal. Readers may contact him via e-mail at<EMAIL_ADDRESS>The
web
site for the Suprynowicz column is at http://www.nguworld.com/vindex/.

***

Vin Suprynowicz<EMAIL_ADDRESS>

"A well-regulated population being necessary to the security of a police
state, the right of the Government to keep and destroy arms shall
not be infringed."

{% endraw %}
```

## Thread

+ Return to [August 1997](/archive/1997/08)

+ Return to "[bureau42 Anonymous Remailer <remailer@bureau42.ml.org>](/authors/bureau42_anonymous_remailer_remailer_at_bureau42_ml_org_)"

+ 1997-08-22 (Fri, 22 Aug 1997 23:53:21 +0800) - For Platypus Eyes Only - _bureau42 Anonymous Remailer<EMAIL_ADDRESS>


text:
# Redshift Source

## Description
This is a batch connector plugin to read data records from an Amazon Redshift data warehouse, and
to transform them into structured data flow records.

Amazon Redshift is a fully managed, petabyte-scale data warehouse service in the cloud. Regardless of
the data volume, Amazon Redshift offers fast query performance using SQL-based tools that ease the
integration with business intelligence applications.

## Configuration
**Reference Name**: Name used to uniquely identify this source for lineage, annotating metadata, etc.

## Endpoint Configuration
**Host**: The host of the database.

**Port**: The port of the database.

## Data Configuration
**Database Name**: The name of the database.

**Table Name**: Name of the database table to import data from.

**Import Query**: The SQL select statement to import data from the database. For example:
select * from <your table name>.

## Authentication
**Username**: Name of a registered username. Required for databases that need authentication.
Optional otherwise.

**Password**: Password of the registered user. Required for databases that need authentication.
Optional otherwise.

repository: predictiveworks/cdap-connect

gha_language: Java

repo_name: predictiveworks/cdap-connect


text:
# NU CoSMO

This repo serves as the homepage for Northeastern University's CS Mentoring Club (CoSMO).

## Usage

This site uses the static site generator `Jekyll`. Please install it in order to develop this website.

Jekyll works by taking a template that you write and generating HTML and CSS from it. If you're trying to modify the site,
you'll want to start at the root level files:
  - index.html
  - eboard.html
  - mentors.html
  - contact.html

You'll notice they contain lines like `{% include mentors.html %}`. That line imports sections of the site from the `_includes` directory.
You'll likely find what you need to change in there. `_includes` may in turn access yaml data files in `_data`. Finally, to change CSS,
look at the `assets` folder.

After editing these files, run the Jekyll command to generate the site (e.g. `jekyll serve`). You'll be able to navigate to a local version
of the new website in your browser, likely at `localhost:4000`.

### Mac Setup

[Jekyll](https://jekyllrb.com/) is a Ruby gem.  Different macOS versions ship with different versions of Ruby, so to be safe just install [homebrew's](brew.sh) Ruby.

```bash

# Pull repo
git clone git@github.com:northeastern-cosmo/northeastern-cosmo.github.io.git
cd northeastern-cosmo.github.io

# If you don't already have homebrew installed, get it. (MUST HAVE for macOS info at http://brew.sh)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

# Install newer (brew's) version of Ruby
brew install ruby

# Add brew's Ruby to your path
# Note: Assumes your `echo $SHELL` == /bin/zsh. If your shell is bash, replace with ~/.bashrc
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.zshrc

# Install Jekyll and other dependencies (may take a few minutes)
bundle install

# Run jekyll (s == serve)
bundle exec jekyll s

# The site should be running locally at http://localhost:4000

```

## Acknowledgments
This site is based of off the Jekyll theme Compass. See here for more info: https://excentris.github.io/compass/


text:
---
date: 2010-09-30
type: "Meeting"
title: Open Source Music Ripper / Server / Client
created:<PHONE_NUMBER>
---
This Thursday, at 7 pm in the Ohio Union Senate Chamber, Matt Smith will be demonstrating an Open Music Server that he has been working on. It might seem too easy and obvious to bother with in this day and age. We all know how to rip CD's, collect and share music, and move it to our portables for on-the-go music. My server comes from an audiophile standpoint. Long story short, I used to sell expensive stereo equipment. There are people out there right now spending up to $60,000 on CD players. I'd like to show you how to build your own that competes with these on sound quality, is easier to use, much more fun, has more features, and is completely free. edit: my blog: http://opensourceaudiophile.com/

[Minutes](/~paradigm/minutes.html#htoc13) for this meeting (provided by the VP).

repository: OSUOSC/website

gha_language: HTML

repo_name: OSUOSC/website


text:
Exploring Spatial FIT to GeoJSON Utility
========================================

This project contains a utility to convert Garmin activity FIT filt into a GeoJSON LineString.
It is very primitive. You may include the GarminFitService in your own project to receive FIT
files and output JSON files.

See the class GarminFitListenerTest. Specifically, the method testWriteGeoJSON() shows how to
take in a FIT file and output a JSON file. To create the test file 155155867.json I substituted
a FileOutputStream for the ByteArrayOutputString used in the test.

* Links *
Blog: http://ExploringSpatial.WordPress.com
Site: http://www.ExploringSpatial.com
Code: https://github.com/smitchell/garmin-fit-geojson

repository: smitchell/garmin-fit-geojson

repo_name: smitchell/garmin-fit-geojson


text:
# C# and .NET essentials for server programming

---

## Interfaces

```C#
public interface IEnumerator {
	bool MoveNext();
	object Current { get; }
}
```

Similar to a class – but it provides a specification rather than an implementation

Members are always public

Members will be implemented by the classes and structs that implement the interface

A class (or struct) can implement multiple interfaces

---

### Interfaces

```C#
public class Countdown : IEnumerator {
	int count = 11;
	public bool MoveNext () { return count-- > 0 ; }
	public object Current { get { return count; } }
}
```

Implementing an interface means providing a public implementation for all its members

You can implicitly cast an object to any interface that it implements:

```C#
IEnumerator e = new Countdown();
while (e.MoveNext())
Console.Write (e.Current); //<PHONE_NUMBER>10
```

---

### Interfaces: What can we do with them?

Utilizing the same code with all the classes that derive from same interface:

```C#
public interface IAnimal {
    void MakeSound();
}
public class Cat : IAnimal {
    public void MakeSound(){
		// meow
	}
}
public class Dog : IAnimal {
    public void MakeSound() {
        // woof
    }
}
```
->

```C#
public MakeNoise(IList<IAnimal> animals) {
    foreach (IAnimal animal in animals)
        animal.MakeSound();
}
```

---

### Interfaces: What can we do with them?(2)

Replacing implementations without changing the user code:

```C#
IAnimal animal = new Dog();
animal.MakeSound(); // woof

// OR

IAnimal animal = new Cat();
animal.MakeSound(); // meow
```

(Imagine there is 1000 more lines of code using the IAnimal object

---

## Exceptions

A try statement specifies a code block subject to error-handling or cleanup code

The catch block executes when an error occurs in the try block

```C#
try {
	DoStuff();
	DoSomethingElse();
}
catch(Exception e) {
	Console.WriteLine("Error happened: " +e)
}
```

---

### The catch clause

A catch clause specifies what type of exception to catch

Must either be System.Exception or a subclass of System.Exception

Catching System.Exception catches all possible errors

Typically you catch more specific exception types

Avoids dealing with situations you were not expecting (e.g. OutOfMemoryException)

Only one catch clause is executed

---

### The catch clause

Evaluating which catch clause to execute is done from top to bottom

More specific exceptions must be placed above the more generic

---

### The catch clause

```C#
static void Main (string[] args) {
	try {
		byte b = byte.Parse (args[0]);
		Console.WriteLine (b);
	}
	catch (IndexOutOfRangeException ex) {
		Console.WriteLine ("Please provide at least one argument");
	}
	catch (FormatException ex) {
		Console.WriteLine ("That's not a number!");
	}
	catch (OverflowException ex) {
		Console.WriteLine ("You've given me more than a byte!");
	}
	catch (Exception ex) {
		Console.WriteLine ("We caught something else)
	}
}
```

---

### The finally block

Finally block is always run, either:

- After a catch block finishes
- After control leaves the try block because of a jump statement (return etc.)
- After the try block ends

Typically used for cleanup:

```C#
static void ReadFile() {
	StreamReader reader = null;
	try {
		reader = File.OpenText ("file.txt");
		if (reader.EndOfStream) return;
		Console.WriteLine (reader.ReadToEnd());
	} finally {
		if (reader != null) reader.Dispose();
	}
}
```

---

### Throwing exceptions

```C#
static void Display (string name) {
	if (name == null) throw new ArgumentNullException ("name");
	Console.WriteLine (name);
}
```

Exceptions can be rethrown:

```C#
try {
	Display("John");
}
catch (ArgumentNullException e) {
	Console.WriteLine("Error in displaying the name: " e.Message);
	throw;
}
```

---

### Key properties in an exception

Stacktrace - A string representing all the methods that are called from the origin of the exception to the catch block

Message - A string with a description of the error

InnerException - The inner exception (if any) that caused the outer exception

---

## Tasks and asynchronous programming

All servers need to deal with more than one thing happening at a time (concurrency)

Multithreading is the way of creating concurrency -> Tasks are a higher-level abstraction on top of threads

Many libraries provide asynchronous versions of operations which utilize Tasks

Thus, it’s important to know the basics of using Tasks

Note:

- Clients are sending requests simultaneously

---

### Asynchronous functions

There are keywords async and await for asynchronous programming in C#

- Let you write asynchronous code with same structure and simplicity as synchronous code

You can apply await-keyword to tasks:

```C#
public async Task GetPlayerAndPrintNameAsync(Guid id) {
	IPlayer player = await database.GetPlayerAsync(id); // GetPlayerAsync returns a Task<IPlayer>
	Console.WriteLine("Got player named: " +player.Name);
}

// Synchronous version of the same method:

public void GetPlayerAndPrintName(Guid id) {
	IPlayer player = database.getPlayer(id);
	Console.WriteLine("Got player named: " +player.Name);
}
```

---

### Asynchronous functions (2)

The async modifier can be applied only to methods (and lambda expressions) that return void or a Task or Task<TResult>

- There is virtually no reason to return void ever though

You can create your own asynchronous functions but that is out of the scope of this course

---

## Json (JavaScript object notation)

A simple example:

```json
{
	"_id" : "57ade8face4bf5361c4268d6",
	"Name" : "john",
	"Score" : 7,
	"Items" : [
		{
			"_id" : "57ade921ce4bf5361c4268d7",
			"ItemType" : 0
		}
	]
}
```

---

### Json

Notation used to describe objects

Language independent

Has the following datatypes:

- Number
- Object
- Array
- Boolean
- null

Many APIs communicate in JSON or XML (or both)

Many people use Newtonsoft.Json library for handling JSON data with .NET

---


text:
# Contribution guidelines for the Clinical Data Sources repository

## Project Philosophy

this repository of open and easy to access clinical data sources is an open source community-based project. We want to make it easy for interested researchers to access clinical datasets as easily as possible.

## Issues

We use GitHub Issues for a wide range of tasks including bug reports, feature requests, planning, and general forum. If you have any comments or quesstions feel free to create a github issue.

## Pull Requests

We operate on a pull request model, all changes/additions should be submitted via [pull request](https://help.github.com/articles/using-pull-requests/ "GitHub · Using pull requests").

To keep the commit history clean, we may ask you to [rebase your pull request](https://github.com/edx/edx-platform/wiki/How-to-Rebase-a-Pull-Request "How to Rebase a Pull Request") or squash certain commits. If you don't know what this means, we'll help you through the process.

## Peer Review

All pull requests undergo peer review in which project participants review the changes. Reviewers may suggest modifications or even note their disapproval. Reviewers can note their approval by commenting along the lines of ":+1:", "looks good to me", or "approved". As a reviewer, it's helpful to note the type of review you performed: have you used the data, only accessed it, looked it over, or are you just supporting the concept?

Before a repository maintainer merges a pull request, there must be at least one affirmative review. If there is any unaddressed criticism or disapproval, a repository maintainer will determine how to proceed and may wait for additional feedback.

**Happy contributing!**

repository: pablofbaez/ClinicalDataSources

repo_name: pablofbaez/ClinicalDataSources


text:
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.1.5](https://github.com/PacoteJS/pacote/compare/@pacote/pixels@1.1.4<EMAIL_ADDRESS>(2020-11-27)

**Note:** Version bump only for package @pacote/pixels

## [1.1.4](https://github.com/PacoteJS/pacote/compare/@pacote/pixels@1.1.3<EMAIL_ADDRESS>(2020-11-14)

**Note:** Version bump only for package @pacote/pixels

## [1.1.3](https://github.com/PacoteJS/pacote/compare/@pacote/pixels@1.1.2<EMAIL_ADDRESS>(2020-09-05)

**Note:** Version bump only for package @pacote/pixels

## [1.1.2](https://github.com/PacoteJS/pacote/compare/@pacote/pixels@1.1.1<EMAIL_ADDRESS>(2020-05-21)

**Note:** Version bump only for package @pacote/pixels


text:
EquiTrader

Algorithm   SHA256

Total coin supply   72000000

Block reward   40 coins

Block Time 5 mins

EquiTrader rewards traders for sharing their insight on successful altcoin, bitcoin, and financial market analysis and trades, and provides a social community for traders and investors of cryptocurrency, stock, futures, and forex markets.

EquiTrader is a robust tool and platform for traders and investors to discuss their ideas, where traders get rewarded for their forecasts. With interactive financial and cryptocurrency charts for analysis, EquiTrader provides a complete suite of advanced tools and technical indicators suitable for both beginners and advanced traders.

The EquiTrader platform provides traders with:

·       Trading charts

·       Trade alerts

·       Trading indicators

·       Technical analysis tools

·       Social features

·       24/Hr Support

Harnessing the power of swarm intelligence and the wisdom of crowds, EquiTrader enables traders to sieve through the crowd to pick quality analyses, therefore accurately forecasting the most profitable trade and maximise profits.

repository: equitrade/equitrade

repo_name: equitrade/equitrade


text:
# Changelog
All notable changes to this project will be documented in this file.

## 2.1.0

**Changes**

- Add attentional check if a task was canceled while it was put in the queue to be executed on the main thread
- Add support to add other work on the same lazy worker. You can use this to show results delayed

## 2.0.3

**Changes**

- Add new `ThreadingHelper` for mocking `Handler`s and `isOnMainThread` for testing code using this lib

## 2.0.2

**Changes**

- Add missing lifecycle check in `MainThreadJob.doNow()`

## 2.0.1

**Changes**

- Changed interface of worker from `() -> Unit` to `Job.() -> Unit` which makes it easier to run tasks periodically
**Please note** for Java implementations this is a breaking change

## 2.0.0

**Changes**

- Rewrite in Kotlin
- Support for Android lifecycle

## 1.0.0
- First published

repository: rekire/LazyWorker

gha_language: Kotlin

gha_license_id: NOASSERTION

repo_name: rekire/LazyWorker


text:
Before editing the Piano Jam Solo app to produce a Cogs enabled app, you will need to
go to https://cogswell.io to set up an account and create a campaign.

### Account
+ Click on the "Sign Up" button on the header of the page to navigate to the sign up page.
+ Sign up and verify your e-mail address.
+ Click on the login link to log into your account. If you already have an account you can skip
the previous steps and simply log in.

Once logged in you can go through the QuickStart guide or use the Setup link
on the left to navigate to the pages needed.

### API Keys
+ Click on the "API Keys" link under the "Setup" menu, or if you are using the QuickStart guide
you will start at the "API Keys" tab.

The API keys are how an application authenticates
that it has permission to use your account on Cogswell.io. Do not publicly expose your keys;
they should be kept secret.
+ Choose a name for your key pair and click the "Create Keys" button.

The keys will be available from the "My Key Pairs" section of the "API Keys" page.
Just click on the entry and a pop-up will display them.

### Namespace
+ Click on the "Namespaces" link or tab to create a namespace for the application. In the
tutorial this will be named "pianojam".
+ Enter the name in the "Namespace Name" field and click next.

Next you will create two namespace attributes. Events that are sent to Cogs
for your account will be evaluated based on the values that they have for these attributes.
+ Create an attribute with name "room" and select the data type "text" from the drop down.
+ Click the "Add Attribute" button to see the new attribute listed.
+ Click the "Make part of primary key?" check box so that it is checked.
+ Create another attribute with the name "key" and the data type "text".
+ Click the "Add Attribute" button. Do not make this attribute part of the
primary key.

### Campaign
+ In the control panel to the left choose "pianojam" from the top dropdown underneath
the "Select Namespace" text.
+ Click on the "New Campaign" link on the left.

You will now create the campaign that will send messages to the Piano Jam application in response to
incoming events.
+ Choose a campaign name and enter it in the "Campaign Name" field. In the
tutorial, "Piano Jam" will be the name of the campaign.
+ Click next and go to the "Content" tab. You will need to check "No URL" and enter "Key Pressed"
in the "Notification Message" field.
+ Click the "Send Triggering Event" slider so that
it turns green. Sending the triggering event will allow the value of the key pressed to
be extracted from the message.
+ Go to the "Audience" tab and select "Show anytime a
qualifying trigger is detected" for the message frequency. Then select one minute for
the message expiration value.
+ Verify that the "Show to" box for "Whomever triggers this
campaign" is checked so that any device subscribing to the same topic as the triggering client
will be sent a message. The topic is defined by the primary key namespace attributes
chosen earlier. In this case the "room" attribute.

+ Continue on to the "Rules" page. This is where you will specify when to send messages
by triggering the campaign.
+ Enter a description in the "Rule Description" field. This
can be anything you like.
+ In the filters section choose "Newest/Last" for the "Reduction"
value for an event filter, and 1 for the value. Choose "Events" as the unit, and click
"Add Event Filter" to save the filter.
+ In the conditions section choose attribute "key",
reduction "Newest", and operator "has any value", and click the "Add Condition" button.
+ Click the "Add Rule" button, and then finally click the "Finish" button to create the
campaign.

### Client Keys
The final setup step is to generate client keys. In an app that is distributed to
customers the developers API keys should not be exposed. Therefore Cogs can create derived
keys for distribution to clients.
+ Click on the "Client Keys" link under the setup menu.
+ Select the API key pair you created earlier from the "Create Client Keys from" selector.
+ Click "Create Keys" to create a new client key pair.

Client keys are not saved, so make sure to
copy and paste them somewhere for the time being or keep this page open. You will need the client
secret and salt pair for later in the tutorial.

repository: cogswell-io/piano-jam-solo

repo_name: cogswell-io/piano-jam-solo


text:
# **Finding Lane Lines on the Road**
[![Udacity - Self-Driving Car NanoDegree](https://s3.amazonaws.com/udacity-sdc/github/shield-carnd.svg)](http://www.udacity.com/drive)

Overview
---

When we drive, we use our eyes to decide where to go.  The lines on the road that show us where the lanes are act as our constant reference for where to steer the vehicle.  Naturally, one of the first things we would like to do in developing a self-driving car is to automatically detect lane lines using an algorithm.

In this project you will detect lane lines in images using Python and OpenCV.  OpenCV means "Open-Source Computer Vision", which is a package that has many useful tools for analyzing images.

To complete the project, two files will be submitted: a file containing project code and a file containing a brief write up explaining your solution. We have included template files to be used both for the [code](https://github.com/udacity/CarND-LaneLines-P1/blob/master/P1.ipynb) and the [writeup](https://github.com/udacity/CarND-LaneLines-P1/blob/master/writeup_template.md).The code file is called P1.ipynb and the writeup template is writeup_template.md

To meet specifications in the project, take a look at the requirements in the [project rubric](https://review.udacity.com/#!/rubrics/322/view)

The Project
---

**Step 1:**  Setting Up the Python Environment to code

To do this project, you will need Python 3 along with the numpy, matplotlib, and OpenCV libraries, as well as Jupyter Notebook installed.

We recommend downloading and installing the Anaconda Python 3 distribution because it comes prepackaged with many of the Python dependencies you will need for this and future projects, makes it easy to install OpenCV, and includes Jupyter Notebook. Beyond that, it is one of the most common Python distributions used in data analytics and machine learning, so a great choice if you're getting started in the field.

Choose the appropriate Python 3 Anaconda install package for your operating system here. Download and install the package.

> conda create --name=yourNewEnvironment python=3 anaconda

> source activate yourNewEnvironment

**Step 2:** Open the code in a Jupyter Notebook

You will complete the project code in a Jupyter notebook.  If you are unfamiliar with Jupyter Notebooks, check out this [Course](https://www.packtpub.com/books/content/basics-jupyter-notebook-and-python) Cyrille Rossant's Basics of Jupyter Notebook and Python to get started.

Jupyter is an Ipython notebook where you can run blocks of code and see results interactively.  All the code for this project is contained in a Jupyter notebook. To start Jupyter in your browser, use terminal to navigate to your project directory and then run the following command at the terminal prompt (be sure you've activated your Python 3 carnd-term1 environment as described in the [CarND Term1 Starter Kit](https://github.com/udacity/CarND-Term1-Starter-Kit/blob/master/README.md) installation instructions!):

`> jupyter notebook`

A browser window will appear showing the contents of the current directory.  Click on the file called "P1.ipynb".  Another browser window will appear displaying the notebook.  Follow the instructions in the notebook to complete the project.

**Step 3:** If doing the project in Udacity Workspace install ffmpeg package first otherwise it would not work. And Also install moviepy package to work locally.


text:
# Create Component

[![Build Status](https://api.travis-ci.org/pranshuagrawal/vscode-create-component.svg?branch=master)](https://travis-ci.org/github/pranshuagrawal/vscode-create-component)

Create ReactJS, VueJS and React Native Components with advanced configuration in less than 5 seconds.

# Features
  - Supports ReactJS, VueJS, React Native components.
  - You can choose between Typescript and Javascript.
  - You can choose between SCSS and CSS.
  - Optionally you can include storybook file.

# How does it work?

![Working](https://i.imgur.com/5LwW6Bo.gif)

  - Install the extension in Visual Studio Code.
  - In the explorer tab of Visual Studio Code, right click on the directory you want to create the components in.
  - Click Create Component.
  - Select the Language / Framework you want to create the component of.
  - Select the features / files you want to include in the component.
  - Enter a valid component name. QuickPick will tell you if the name is not correct.
  - A new directory will be create with the component name along with the files inside it.
  - Happy Coding!

# Roadmap

 - Support of other frameworks (like Preact).
 - Support of test case file.

repository: tuxhe/vscode-create-component

repo_name: tuxhe/vscode-create-component


text:
sa-ftp
======

[![Build Status](https://travis-ci.org/softasap/sa-ftp.svg?branch=master)](https://travis-ci.org/softasap/sa-ftp)

Note: FTP is considered extremely insecure nowadays. This role mostly indended for internal use, for example, with ONVIF cameras capable to
upload regular screenshots to some internal FTP server. If you need public facing ftp server - consider secure SFTP or SCP based access.

Example of use: check box-example

Configuration:
```YAML

custom_vsftpd_default_props:
    - {regexp: "^[#]?anonymous_enable=*", line: "anonymous_enable=NO"}
    - {regexp: "^[#]?local_enable=*", line: 'local_enable=YES'}
    - {regexp: "^[#]?write_enable=*", line: 'write_enable=YES'}
    - {regexp: "^[#]?chroot_local_user=*", line: 'chroot_local_user=YES'}

custom_vsftpd_users:
    - {
      username: ftp_user,
      password: ftp_password,
      comment: "This is ftp user"
      }

```

Simple:

```YAML

     - {
         role: "sa-ftp",
         vsftpd_users: "{{custom_vsftpd_users}}"
       }

```

Advanced:

```YAML

     - {
         role: "sa-ftp",
         vsftpd_default_props: "{{custom_vsftpd_default_props}}",
         vsftpd_users: "{{custom_vsftpd_users}}"
       }

```

Copyright and license
---------------------

Code licensed under the [BSD 3 clause] (https://opensource.org/licenses/BSD-3-Clause) or the [MIT License] (http://opensource.org/licenses/MIT).

Subscribe for roles updates at [FB] (https://www.facebook.com/SoftAsap/)

repository: softasap/sa-ftp

repo_name: softasap/sa-ftp


text:
# sequence_tagging-ner
LSTM + CRF in Tensorflow

Before Starting You need:
1. glove.6B.300d embedding vector
2. IOB label samples

Than:
1. Build vocab from the data and extract trimmed glove vectors.
```
python build_data.py
```

2. Train the model with
```
python train.py
```

3. Evaluate and interact with the model with
```
python evaluate.py
```
Ref: https://guillaumegenthial.github.io/sequence-tagging-with-tensorflow.html


text:
# [Find the Integral](https://www.codewars.com/kata/find-the-integral "https://www.codewars.com/kata/59811fd8a070625d4c000013")

Create a function that finds the [integral](https://en.wikipedia.org/wiki/Integral) of the expression passed.

In order to find the integral all you need to do is add one to the `exponent` (the second argument), and divide the `coefficient` (the first argument) by that new number.

For example for `3x^2`, the integral would be `1x^3`: we added 1 to the exponent, and divided the coefficient by that new number).

Notes:
* The output should be a string.
* The coefficient and exponent is always a positive integer.

## Examples

```
 3, 2  -->  "1x^3"
12, 5  -->  "2x^6"
20, 1  -->  "10x^2"
40, 3  -->  "10x^4"
90, 2  -->  "30x^3"
```

repository: ParanoidUser/codewars-handbook

repo_name: ParanoidUser/codewars-handbook


text:
---
layout: page
title: Pre-Conference Workshops
permalink: /workshop-chat/
---

# Alexa, How Do I Build a Chatbot?

Chatbots introduce a whole new way for users to interact with your websites. A good chatbot can save your users from long and complicated forms, cut down on support requests, and make your services more approachable.

If you've ever wondered how to build a chatbot, then this session is for you. You will:

- Dive into the core concepts of what makes a chatbot.
- Learn how to employ Machine Learning and Natural Language Processing to create a conversation flow that feels 100% natural.
- Look at a variety of possible conversations and challenges that go with them.
- Build a chatbot that can be deployed to a digital assistance like Amazon Alexa!

But more importantly, you will learn how to build a fully functioning chatbot in just a few hours, and all without a single IF statement.

## Requirements

Just a laptop! **Every attendee will receive a free Amazon Echo device.**

## Logistics

This is a full day workshop running from 9:00 AM to 4:00 PM on Monday, November 11th. The workshop will take place at the Progress office at 201 Jones Road, Waltham, MA.

Progress will provide a shuttle from the Seaport Hotel at 8:00 AM Monday morning, lunch at mid-day, and a return shuttle to Seaport at the conclusion of the workshop.

_Maximum of twenty (20) participants, leading to a low attendee/presenter ratio._

## Presenters

				Sebastian Witalec

Senior Developer Advocate at Progress

    			Stanimira Vlaeva

Developer Advocate at Progress

	Buy Ticket

repository: remotesynth/jsMobileConf

gha_language: CSS

repo_name: remotesynth/jsMobileConf