text:
![Alt text](images/snacker.jpeg?raw=true "Snacker")

Nice to see you are one of the few people in the world who read Readme files :-)
This is a markdown file: https://en.wikipedia.org/wiki/Markdown

# About
This is a free and Open Source project meant to give a person an element of surprise and novelty by making choices for the person based on a software
algorithm which makes those choices from a set of options.
Originally meant to select an optimal combination of daily snacks for a company, based on the snack preferences of the employees, this program
can also be extended to encompass other functionalities where people need to make a random choice.

The master branch is used for active collaborative development.
The release branch is used only when a version of the project is ready for release. The release branch is ideally operated only by the repository owner.

# Running this project
* Because this project uses Gradle, you may find it tough to configure and run it. Please ask Navin for help. Otherwise, you can also simply create a new java project, use the java files of this project and use the dependency jar files manually. Gradle just helps in downloading those dependency libraries automatically and building.
* To run this project, you need Gradle.
* Install Gradle and navigate to this project's folder in the commandline and simply type "gradle". The project will build and a jar will be created in ./build/libs.

* Running it with the commandline parameter "gen" will generate the default snack CSV file. Just make sure the CSV file is not open in any program when you run snacker, because snacker needs to delete the CSV file occassionally to update it.
* Now you can modify the CSV file with names and ratings of your choice.
* From then on, you can simply run the program with "java -jar snacker.jar".
* You can also install the Gradle plugin in Netbeans and directly run it from the IDE. It may take a long time to load the project for the first time if dependencies have to be loaded. The gradle build file contains support for creating an Eclipse project too.
* Using Netbeans instead of Eclipse is recommended. Netbeans is just much cooler, has better features and is easier to use than Eclipse.

# TODO list
* The SnackChooser class has a constant named maxTolerableRecentness set to 3 days. Rather than have the value in code, it would be better to have the value in the JSON/CSV file so that the end user would be able to edit it.
* Needs permission: Would be nice if the User did not have to manually execute this program. Perhaps if the program ran on a server and the results could be visible via a browser, it would be simpler. Also open to the possibility of allowing Users to click on which snack they have a craving for on a particular day so that it would override the algorithm's choice for that day.

# Known issues/bugs
* If the number of snacks in the CSV are too few, the program goes into an infinite loop.


text:
# Project-D3-Worker

Sample Worker Node for [Project D3](https://github.com/aaronchong888/Project-D3)

## Getting Started

### Prerequisites

- Node.js
- npm (Node.js package manager)
- Ethereum *
- IPFS *

> \* Required only if you are running your own local Ethereum & IPFS nodes

### Installation

```
npm install
```

### Usage

Check `app.js` and complete the missing parts (*API Keys*, *RSA key pairs*, etc.) before running

```
npm start
```

## Authors

* **Aaron Chong** - *Initial work* - [aaronchong888](https://github.com/aaronchong888)

See also the list of [contributors](https://github.com/aaronchong888/Project-D3-Worker/contributors) who participated in this project.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

## Acknowledgments

This project is built using the following packages and libraries as listed [here](https://github.com/aaronchong888/Project-D3-Worker/network/dependencies)

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
code snippet

### TS

 - [type](https://github.com/binperson/fragment/tree/feature/202007032227-ts-type)
 - [interface](https://github.com/binperson/fragment/tree/feature/202007032254-ts-interface)
 - [function](https://github.com/binperson/fragment/tree/feature/202007201230-ts-func)
 - [class](https://github.com/binperson/fragment/tree/feature/202007200816-ts-class)
 - [Enum](https://github.com/binperson/fragment/tree/feature/202007200841-ts-Enum)
 - [Generics](https://github.com/binperson/fragment/tree/feature/202007200905-ts-Generics)
 - [Type Assertion、Type Aliases](https://github.com/binperson/fragment/tree/feature/202007202121-ts-Type-Assertion)

### React

 - [State Hook](https://github.com/binperson/fragment/tree/feature/202007202300-react-state-hook)
 - [Effect Hook](https://github.com/binperson/fragment/tree/feature/202007212347-react-useEffect)
 - [Custom Hook](https://github.com/binperson/fragment/tree/feature/202007222321-react-custom-hook)
 - [HOC](https://github.com/binperson/fragment/tree/feature/202007230020-react-HOC)
 - [useRef](https://github.com/binperson/fragment/tree/feature/202007232255-react-useRef)
 - [context](https://github.com/binperson/fragment/tree/feature/202007232350-react-context) more:[01](https://github.com/binperson/fragment/tree/feature/202008060046-react-context)
 - [Class.contextType](https://github.com/binperson/fragment/tree/feature/202008062144-react-class-contextType)
 - [lazy](https://github.com/binperson/fragment/tree/feature/202008062221-react-lazy)

### openGL

 - [hello world](https://github.com/binperson/fragment/tree/feature/202008091140-opengl-hello-world)
 - [画一个三角形](https://github.com/binperson/fragment/tree/feature/202008091223-opengl-triangle) more:[01](https://github.com/binperson/fragment/tree/feature/202008091256-opengl-triangle-color)

### webGL

 - [hello world](https://github.com/binperson/fragment/tree/feature/202008151317-webgl-helloworld)

repository: binperson/fragment

repo_name: binperson/fragment


text:
# Subscribed.js
 ![Main screen](https://github.com/mingminghome/Subscribed.js/blob/master/readme-element/main.png?raw=true)

A simple responsive subscription lightbox working with a php - MySQL backend.

You can tailor make **messages** , **button texts** & **lightbox size** by changing parameter in the plugin.

If you have a lot of campaign running on the same time , you can divide different campaign using "**Event code**" to make sure your subscriptions are on their own list.

##### This repo contain following files
 1. Subscribed.js package (Plugin)
 2. Subscribed.js php package (Backend) - in the backend folder
 3. Subscribed.js MYSQL sql file (Database) - subscribe.sql
 4. Subscribed.js demo package (Demo) - in the demo folder

# How to use #

##### Simple usage
Call plugin css on the **<HEAD>** of the website
```
<link rel="stylesheet" type="text/css" href="jquery.subscribed.min.css">
```
Call plugin on the end of **<body>**
```
<script type="text/javascript" src="../jquery.subscribed.min.js" ></script>
```
Define a element with class for trigger
```
<a href="#" class="btn-trigger">Click Here</a>
```
Call the plugin with your customized message on the end of **<body>**
```javascript
<script type="text/javascript">
	$('.btn-trigger').SubscribedJS({
		event:'ABC123ab', //Event code
		title:'Your title', //Title
		desc:'Your description', // Desc
		tc:'* Your T&C', //TC
	    	succ:{ //Success msg
		    'title':'Success msg!',
		    'desc':'Thanks for your application!'
	   	}
	});
</script>
```
Import MYSQL File to your database
> Import subscribed.sql

Place backend files to your server and make it can access from web

> Make sure **http: //[Your domain]/subscribe.php** can be access

Edit DB config file & fill in your DB information

> classes/db_config.php
```php
<?php
	define("DB_HOST", "localhost"); //DB Host
	define("DB_USER", ""); //User
	define("DB_PASS", ""); //Password
	define("DB_NAME", "subscribe_db"); //DB Table Name
	define("DB_PORT", "3306"); // Default SQL port
?>
```
Add a record on *[event]* table with 8 char long event ID or run the following SQL Query (Replace  8DIGCODE to your code)
```
INSERT INTO `event`(`event_key`) VALUES ('8DIGCODE')
```

##### All parameters

| Parameter | Default | Example | Desc |
| --- | --- | --- | --- |
| event | "" | **"ABC123ab"** | Event code (8 char long) |
| url | "" | **"./subscribe.php"** | Subscribe.php URL / Path |
| title | "" | **"Title"** | Title of the box |
| desc | "" | **"Description"** | Description of the box |
| width | "80%" | **"80%"** | Width of the box (% prefered) |
| top | "20%" | **"20%"** | Top padding of the box (% prefered) |
| left | "10%"	| **"10%"** | Left padding of the box (% prefered) |
| placeholder | "E-mail" | **"E-mail / Tel"** | Place holder of the input box |
| btnText | "Submit" | **"Submit"** | Submit button text |
| tc | "" | **"T&C"** | Terms and condition |
| gaEvent | "Subscribe Event" | **"Subscribe Event"** | GA Subscription event name |
| **err** | - | - | Error message |
| `01` | "May I know your E-mail address?" | - | Handle input error |
| `02` | "Please enter a valid E-mail address!" | | Email format error|
| `03` | "We found something unusual on our server! Please try again later!" | - | Server error |
| `04` | "We found something unusual on network! Please try again later!" | - | Network error |
| `05`| "You have already applied!" | - | Duplicate record error |
| **succ** | - | - | Success message display after submission |
| `title` | "(Font awesome icon)" | - | Message title |
| `desc` | "Thanks for your application!" | - | Message description |

##### Full usage example

```javascript
$('.sale_remind').SubscribedJS({
	event:'ABC123ab',
	url:'../backend/subscribe.php',
	title:'subscribeJs!',//Title on the subscription lightbox
	desc:'Create your own subscription service! Try now !',
	width : '80%',
	top: '20%',
	left: '10%',
	placeholder:' E-mail',
	btnText:'Submit',
	tc:'* I agree to make this plugin better ...',
	gaEvent:'Subscribe Event',
	err:{	'01':' May I know your E-mail address?',
		'02':' Please enter a vaild E-mail address!',
		'03':' We found something unusual on our server! Please try again later!',
		'04':' We found something unusual on network! Please try again later!',
		'05':' You have already applied!'
	},
	succ:{
		'title':'Wooo!',
		"desc":"Thanks for your application!"
	}
});
```

# Dependencies
This plugin used **jQuery** as JavaScript Library
You can include it via https://jquery.com/ or use the CDN ( You can ref to Demo )
```
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
```
This plugin used **FontAwesome** for the icon display
You can include it via http://fontawesome.io use the CDN ( You can ref to Demo )
```
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
```

# License
MIT


text:
## Welcome
This project represents an employee directory, it is also a React application.

- In your terminal, at the folder root of this project use the commands:
* `npm i` or `yarn add` to install dependencies.
* `npm build` or `yarn build` to kick off the project build.
* `npm start` or `yarn start` to start the application.

## Note:
This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app).

## Requirements:
- The top of the page should be a row of tabs of the demographic categories of the employee directory (e.g., Location of Employee, Age, Gender, etc.). The user should have the ability to add, delete, or edit a demographic category.

- When a tab is selected it should show a list of the different groups that make up that demographic category (e.g., "Location of Employee" would show New York, Boston, and Los Angeles) and a list of employees that are in that group.

- Each employee should be listed in his/her own card. That card should include that employee's name, age, position at the company, personal description, and a photo of the employee. If you click on a employee card it should open a popup box where you can edit the employee's information and upon popup close, it saves the employees information. The changes only have to persist until a browser refresh.

- Finally, you should be able to sort the list of employees in any group by name or age.

## Developer notes:
- You will find that all the above requirements are met, with the single exception of the following: When editing a user's information, the popup will save the changes when clicking on the save button. I chose to take this approach as it makes the most sense from a user experience perspective; and from a usability point of view, it makes no sense that upon closing the popup the data should save.
- I took the liberty of not writing any unit tests as of yet, but when I do it will most likely be using Jest or Karma.

gha_language: JavaScript

gha_license_id: MIT


text:
# Understanding Deep Architectures With Reasoning Layer (NeurIPS 2020)

- Authors: [Xinshi Chen](http://xinshi-chen.com/), [Yufei Zhang](https://www.maths.ox.ac.uk/people/yufei.zhang), [Christoph ](https://www.maths.ox.ac.uk/people/christoph.reisinger), [Le Song](https://www.cc.gatech.edu/~lsong/)

- [Link to paper](https://papers.nips.cc/paper/2020/hash/0d82627e10660af39ea7eb69c3568955-Abstract.html)

- [Link to slides](http://xinshi-chen.com/papers/slides/nips2020-reasoning.pdf)

- [Link to NeurIPS presentation](https://nips.cc/virtual/2020/protected/poster_0d82627e10660af39ea7eb69c3568955.html)

If you found this library useful in your research, please consider citing

```
@article{chen2020understanding,
  title={Understanding Deep Architecture with Reasoning Layer},
  author={Chen, Xinshi and Zhang, Yufei and Reisinger, Christoph and Song, Le},
  journal={Advances in Neural Information Processing Systems},
  volume={33},
  year={2020}
}
```

# Reproduce Experiments

## Install the module
Please navigate to the root of this repository, and run the following command to install the `neuralalgo` module.
```
pip install -e .
```

## Run the experiments
Navigate to the `experiments/` folder and use the run file `run.sh` to run the experiments. There are several hyperparameters in this file:
```
% line 7. This can be set as 'sgd' or 'adam', which is the optimizer for training the model.
opt=$1

% line 8. This is the learning rate. In our paper, we search over 1e-2 1e-3 5e-4 1e-4.
lr=$2

% line 9. This is the number of algorithm steps (iterations) that is used in the reasoning module.
k=$3

% line 10. This is the hidden dimension of the MLP in the neural module.
eig_hidden_dims=$4

% line 11. This is the random seed that we use to provide multiple independent instantiations of the experiments.
seed_train=$5
```
An example of how we search the hyperparamters is provided in `search.sh`. To run experiments on different cases, we can modify the following hyperparameters:

- To change the hidden dimension of the neural module, modify line 3 in `search.sh`. In the paper, we show the results of `d=0`, `d=16`, and `d=32`.
- To change the algorithm used in the reasoning module (algorithm layer), modify line 4 in `run.sh`. By default, we set it to be gd (gradient descient). To use Nesterov accelerated gradient, change line 4 to `algo_type=nag`.
- By default, when we train the model, we fix the step size used in the algorithm steps. To turn on the training of the algorithm step size, change line 5 in `run.sh` to `phase=train`.

branch_name: refs/heads/main


text:
Storyteller has a custom syntax to link to other topics in a topic file just to handle the various url modes in previewing and publishing.

In all the use cases shown below, you can find samples in Storyteller's own [layout.htm](https://github.com/storyteller/Storyteller/blob/master/documentation/layout.htm) file that specifies the layout of this website.

In its simplest form, you will use a syntax like:

<[linkto:documentation/docs/authoring]>

Which will render this: <[linkto:documentation/docs/authoring]>. The default output will be a link to that topic with the proper Url and using that topic's title as the link text.

The path after the colon is effectively the relative path from the documentation root to the topic file, minus the `.md` extension. `index.md` files are referenced by just its parent directory.

## Relative Links

You can also relative links in the `<[linkto:path]>` structure. If the path starts with a forward slash
like this:

<[linkto:/authoring]>.

Assuming that there is another topic with the file name `authoring.md` in the same directory as the current topic file,
you'll get the same link. StorytellerDocGen can respond to paths like `/../other` as well.

## Override the Link Title

To override the link text, use a format like this:

<[linkto:documentation/docs/authoring;title=A different link description]>, which renders: <[linkto:documentation/docs/authoring;title=A different link description]>.

## Customize the Link Rendering

You can override the construction of the link html by explicitly defining the html template in the directive usage like this one sample that is taken from Storyteller's [own documentation layout.htm](https://github.com/storyteller/Storyteller/blob/master/documentation/layout.htm#L60-L61).

<[linkto:{previous};<li><a href="{href}" title="{title}">Previous</a>

The substitutions are just common handlebars kind of templating for the line ({href}) and the title ({title}).

## Link to the Next Topic

As part of your `layout.htm` file, you may want to have a link to the next topic if one exists. If you are on the very last topic in the structure, you don't want that topic to render at all. In that case, use the text `{next}` as the topic key.

## Link to the Previous Topic

Likewise, you can create a link to the previous topic by using `{previous}` as the topic identifier.

repository: lhaussknecht/Storyteller

gha_license_id: NOASSERTION

repo_name: lhaussknecht/Storyteller


text:
# d3fc-data-join

A wrapper around D3's data join which simplifies some of the common problems that have been run into with *our particular usage patterns*, and facilitates the *d3fc decorate* pattern. These are not going to be universally applicable. As always it’s important to understand the abstraction and in many cases a vanilla data join may be simpler or perform better.

This blog post ([Building Components with Data Join](http://blog.scottlogic.com/2016/08/17/building-components-with-d3-data-join.html)) introduces the rationale behind this component.

[Main D3FC package](https://github.com/d3fc/d3fc)

## Installing

```bash
npm install @d3fc/d3fc-data-join
```

## API Reference

The data-join component is a relatively lightweight wrapper around d3's selectAll/data data-join, which allows decoration of the result. This is achieved by appending the element to the enter selection before exposing it. A default transition of fade in/out is also implicitly added but can be modified.

# fc.**dataJoin**([*element*][, *className*])

Constructs a new data-join component instance. Optionally an `element` or an `element` and a `className` can be specified, this is functionally equivalent to calling their methods as defined below.

# *dataJoin*(*selection*[, *data*])

Invoke with a `selection` containing the parent element and the `data` to be joined.

```js
import { dataJoin } from 'd3fc-data-join';
import { select } from 'd3-selection';

const join = dataJoin('li', 'animal');

join(select('ul'), ['Aardvark', 'Beaver', 'Cat'])
  .text(d => d);
```

The return value is a selection containing all new and existing nodes. Two additional methods are exposed for retrieving a selection containing only the new nodes (`.enter()`) and the removed nodes (`.exit()`).

```js
import { dataJoin } from 'd3fc-data-join';
import { select } from 'd3-selection';

const join = dataJoin('li', 'animal');

const update = join(select('ul'), ['Aardvark', 'Beaver', 'Cat'])
  .text(d => d);

update.enter()
  .attr('data-', d => d);

```

If `d3-transition` is available, new nodes will have a fade-in transition applied and removed nodes will have a fade-out transition applied. The transition timings can be controlled from the container selection passed in or by explicitly setting [`transition`](#dataJoin_transition).

```js
import { dataJoin } from 'd3fc-data-join';
import { select } from 'd3-selection';
import { transition } from 'd3-transition';

const quickTransition = transition()
  .duration(300);

const join = dataJoin('li', 'animal');

const container = select('ul')
  .transition(quickTransition);

join(container, ['Aardvark', 'Beaver', 'Cat'])
  .text(d => d);
```

To disable transitions, explicitly retrieve the selection from the transition before passing it in -

```js
import { dataJoin } from 'd3fc-data-join';
import { select } from 'd3-selection';
import { transition } from 'd3-transition';

const quickTransition = transition()
  .duration(300);

const join = dataJoin('li', 'animal');

const root = select('body')
  .transition(quickTransition);

const container = root.select('ul')
  .selection();

join(container, ['Aardvark', 'Beaver', 'Cat'])
  .text(d => d);
```

# *dataJoin*.**element**(*element*)

Sets the element name used to select elements and to create elements for insertion. Defaults to an SVG `g` element. See `className` for a description of the selector used.

# *dataJoin*.**className**(*className*)

Set the class name used to select elements and applied to inserted elements. Defaults to `null`. If set to `null`, only the `element` is used as the selector. If non-null, the selector provided to `selectAll` is -

```js
`${element}.${className}`
```

# *dataJoin*.**key**(*keyFunc*)

Specifies the key function used by the data-join. Defaults to index-based. Equivalent to specifying a `key` argument when calling [`selection.data()`](https://github.com/d3/d3-selection#selection_data).

# *dataJoin*.**transition**(*transition*)

Specifies the transition to be used if an implicit transition is not supplied as the container. Defaults to `null` which disables transitions.

gha_language: HTML


text:
# *Effective Javascript - 68 Specific Ways to Harness the Power* by David Herman

## Variable Scope

### Closures
1) Javscript allows you to refer to variables outside of the current function
2) Functions can refer to variables defined in outer functions even after those outer functions have returned.
3) Closures can update the values of outer variables
4) Closures store their outer variables by reference, not by value

#### Examples
    function sandwichMaker(magicIngredient) {
        return function(filling) {
            return magicIngredient + " and " + filling;
        }
    }

    var hamAnd = sandwichMaker('ham');
    hamAnd('cheese');   // "ham and cheese"
    hamAnd('mustard');  // "ham and mustard"
    var turkeyAnd = sandwichMaker('turkey');
    turkeyAnd('swiss'); // "turkey and swiss"

    function box() {
        var val = undefined;
        return {
            set:    function(newVal) {
                val = newVal;
            },
            get:    function() {
                return val;
            },
            type:   function() {
                return typeof val;
            };
    }

    var b = box();
    b.type();       // undefined
    b.set(98.6);
    b.get();        // 98.6
    b.type();       // 'number'

### Variable Hoisting
**Lexical scoping** - with only a few exceptions a reference to a variable is bound to the newarest scope in which it was declared. However, Javascript does not support **block scoping**: Variable definitions are not scoped to their nearest enclosing statement or block, but rather to their containing function.

Variable definitions get moved to the top of the containing function and assignment statements are left in place.

The sole exception is *exceptions*. A caught exception is bound to the catch block;

### Immediately Invoked Function Expression (IIFE)
    function wrapElements(a) {
        var result = [];
        for (var i=0, n = a.length; i<n; i++) {
            // Begin IIFE example
            (function(j) {
                result[i] = function() {
                    return a[j];
                }
            }) (i);
        }
        return result;
    }

###

extension: markdown


text:
Finance
=======

A collection of building blocks to study some finance concepts, such as option pricing with Black & Scholes, a limit order book to simulate a stock exchange, algo trading and much more.
I took a lot of inspiration from snippets found across the internet.
Important note: this code is for educational purposes only! See also the license.....

Features
=========

- Central Limit Order book
- Options pricing
- Bond pricing
- Algo trading
- Curves for modelling interest rates and bootstrapping zero rate curves
- Surfaces for volatility smile
- Calculate time to expiry from python date objects Excel style

Requirements
============

Code is tested with Python 3.8. Needed modules not part of the standard release are listed in requirements.txt

All software is tested on Ubuntu Linux, no OS specific features are used in the code.

Usage
=====

The main modules mentioned here have either unit tests where many examples are covered, or example code on how to use the code.
Unit tests are collected in directory tests, used naming convention serves `pytest`
An API is being buitl with Flask, see `api/app_server.py`

Limit order book
----------------
Main module for the limit order book is `orderbook/matching_engine.py`.

Options pricing
---------------

Main module for the Black and Scholes option pricing is `options/black_scholes.py`.
Curves and surfaces are also applied in the Black and Scholes pricer `options/black_scholes.py`.
Date calculations needed by the pricer are in `utils/date/yearfrac.py`, this module demonstrates various day count conventions as used in finance.

Bond pricing
------------

Main module for bond pricing is `securities/bond.py`.

Algo Trading
------------

These modules are demonstraded with `demo_code.py`, it illustrates how a mean reverting algo works based on a year of historical closings for an example stock.

Term structures
---------------

Bootstrapping the yield curve from bonds is in `term_structures/bootstrap.py`.
The volatility surface is in `term_structures/surface.py`.

repository: martyw/finance

gha_language: Python

repo_name: martyw/finance


text:
# Getting started

Install dependencies

    npm install

Create a .env file and write it as follows

    MONGO_URI='mongo URL'
    JWT_SECRET='YOURJWTSECRETCHANGEIT'
    ENCRYPT_JWT_SECRET='YOURJWTENCRIPTINGPASSCHANGEIT'
    JWT_EXPIRATION=8hrs

----------

## Database

The example codebase uses [Mongoose](https://mongoosejs.com/).

----------

## NPM scripts
- `npm run start:watch` - Start application in watch mode

----------
# Authentication

This applications uses JSON Web Token (JWT) to handle authentication.
This app uses refresh-Token mechanism to refresh jsonwebtoken after 8 hours.

----------

 Steps to run this project:

 1) Download zip or clone the repo.
 2) run npm i
 3) add `.env` file with the provided details
 4) npm start

repository: apoorva-chikara/NestJs-Backend

repo_name: apoorva-chikara/NestJs-Backend


text:
---
title: Md Johirul Islam defends MS thesis
links:
- {title: Event Link, link: "https://www.cs.iastate.edu/ms-defense-md-johirul-islam" }
---

Md Johirul Islam has successfully defended his Masters of Science thesis.
Johirul's work has focused on creating a shared data science infrastructure for
transportation data.

The thesis abstract:

``Big data-driven transportation engineering has the potential to improve the utilization of road infrastructure, decrease traffic fatalities, improve fuel consumption, and decrease construction worker injuries, among others. Despite these benefits, research on big data-driven transportation engineering is difficult today due to the computational expertise required to get started. This work proposes BoaT, a transportation-specific programming language, and its big data infrastructure that is aimed at decreasing this barrier to entry. Our evaluation, that uses over two dozen research questions from six categories, shows that research is easier to realize as a BoaT computer program, an order of magnitude faster when this program is run, and exhibits 12–14× decrease in storage requirements.''


text:
OS-X-Bluetooth-Pairing-Value-To-Windows-Value
=============================================

A useful script to simultaneously pair a bluetooth device to your Mac in OS X and Boot Camp Windows

OS X Bluetooth Pairing Value To Windows Value

A script to get the Windows equivalent bluetooth adress/link key pair (little endian?)

This is useful if you would like to pair a bluetooth device to both OS X and Windows (in BootCamp).

Thanks to user pacnow (Camoguy) at [discussions.apple.com](https://discussions.apple.com/thread/3113227) for doing the leg work and figuring out the algorithm

Follow these steps to get your bluetooth device working.

-  pair device with windows
-  reboot and pair with OS X
-  run this script/app
-  save the link key/s somewhere you can reach from windows
-  boot to windows
-  run regedit with admin rights
-  go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTHPORT\Parameters\Keys\BD_ADDR
-  edit the key of the device
-  reboot

### What this script does

- read the link keys
```
up to Sierra:
sudo defaults read /private/var/root/Library/Preferences/blued.plist LinkKeys
High Sierra and onwards:
sudo defaults read /private/var/root/Library/Preferences/com.apple.bluetoothd.plist LinkKeys
````
- parse the data with awk
- display it in a window
- export a bluetooth.reg file with all paired link keys, if desired

Here's an example link key. Instead of just typing that in you want to break it apart starting from the right, taking a pair of two characters at a time.

`98 54 2f f9 88 e1 94 49 47 52 50 e1 39 43 25 5b` (What is shown in OS X)

`5B 25 43 39 E1 50 52 47 49 94 E1 88 F9 2F 54 98` (What you enter in Windows)

 -Help from Camoguy-

Note, this script requires administrator privileges.

Your password is not saved anywhere and only known to you and your OS.

- Adnaan Soorma
- Twitter: @Soorma07

- broeckelmaier
- Twitter: @broeckelmaier

## Possible Issues:
### Windows /keys in registry is empty #8

shivangswain commented on Aug 23, 2020

You can fix that by setting the permissions of the /Keys folder/key.
So,

- right click on it
- click "Permissions..."
- click on "Add"
- input your Windows username in the large text box
- click on "Check Names"
- once the text box changes into the / form press OK
- select the "Full Control" checkbox
- press OK
- Now you'll be able to add and see the keys. Remember to reboot before testing.

### Where is the reg file saved to? #7

It should save directly to the same folder where the script is run from.

gha_language: AppleScript


text:
# Winston Ewert's Flux Challenge

Built using redux.

My solution to the requests was inspired by react. I have a pure function
of my redux state which indicates which requests should be made. I keep
track of which requests I've actually made, and when there is a difference
between the requests which I think I should have made and the one's I've actually made, I apply the difference. That is, I create or cancel requests so that the ones returned by the function are the same ones I'm doing.

To build and run use:

npm install
npm start

To use the prebuilt-version, just open dist/index.html

This starts up the development version of the webpack server. I didn't make a production version.

gha_language: Java


text:
## Finding tags and logging sensor readings

Simple example script that demonstrates what might be a typical flow
for reading sensors and processing (here: logging) their sensor
readings.

The code in this tutorial is also available as a JavaScript file
(generated automatically from this tutorial) that can be run with
`nodejs`. See the [`examples/`] directory of the package.

### Principle flow

1. Connect to cloud.
2. Find [tag managers]{@link WirelessTagManager}.
3. For each tag manager, find its associated [tags]{@link WirelessTag}.
4. For each tag, find its [sensors]{@link WirelessTagSensor}.
5. For each tag and its sensors, log useful properties (for
   sensors, reading, event state (such as "Too High" for
   temperature), and whether it is armed (meaning that events
   trigger alerts, such as push notification).
6. Keep looping for a set period of time by updating the data for
   each tag at the interval configured for each tag. Log sensor
   properties every time data for the respective tag is updated.

### Create platform object

    var Platform = require('wirelesstags');
    var platform = Platform.create();

How long to keep looping?

    const END_AFTER = 30 * 60 * 1000; // value is in milliseconds

### Set up event handlers

In this implementation here we use mostly event handlers to proceed
once the initial [connect()]{@link WirelessTagPlatform#connect}
succeeds. One could equally well use `Promise`-chaining (via
`.then()`). Note that if we do not use callbacks, it is a good idea to
`.catch()` rejected promises, because otherwise errors thrown will be
invisible.

In the `connect` event handler, trigger discovery of tag managers (see
[discoverTagManagers()]{@link WirelessTagPlatform#discoverTagManagers}):

```js
platform.on('connect', () => {
    console.log("connected to Wireless Tag cloud");
    platform.discoverTagManagers().catch(
        (err) => { console.error(err.stack ? err.stack : err); });
});
```

The `discover` handler for the platform will receive tag a manager
object on each event.

    platform.on('discover', (manager) => {
        console.log("found manager", manager.name, manager.mac);

Next, we install an event handler for the tag manager's `discover` event,
which will be fired for each associated tag.

        manager.on('discover', (tag) => {
            logTag(tag);

Each tag will also fire `discover` events, for each sensor they have.

             tag.on('discover', (sensor) => { logSensor(sensor); });

Tags also fire a `data` event each time their data is updated (which
includes data for their sensors).

             tag.on('data', (tagObj) => {
                logTag(tagObj);
                tagObj.eachSensor(logSensor);
             });

Once event handlers for the tag are installed, ask the tag to find its
sensors. When that completes successfully, start the update loop for
this tag, and install a timeout that will stop it after the
preconfigured time.

             tag.discoverSensors().then((sensors) => {
                 tag.startUpdateLoop();
                 setTimeout(tag.stopUpdateLoop.bind(tag), END_AFTER);
                 return sensors;  // only needed if we kept chaining
             }).catch((e) => {
                console.error(e.stack ? e.stack : e);
                throw e;
             });

Now ask the tag manager to find associated tags, which will trigger
the `discover` events for tags.

         }); // end of manager.on()

         manager.discoverTags().
             catch((e) => {console.error(e.stack ? e.stack : e)});
    }); // end of platform.on()

### Connect to platform

Once the event handlers are set up, connect to the platform. If
successful, this will trigger the `connect` event, from which the rest
proceeds.

    platform.signin(Platform.loadConfig()).
        catch((e) => { console.error(e.stack ? e.stack : e) });

### Do something with tags and sensors

The rest is defining the actions for tags and sensors. Here we just
log some of their properties, including sensors' reading and current
event state.

Both tag and sensor objects override the .toString() method to
produce a compact stringified-JSON representation of their key
properties, so dumping this to the terminal can be informative.
Uncomment the corresponding lines in the code below to do so.

```js
function logTag(tag) {
    console.log("Tag", tag.name, "(slaveId=" + tag.slaveId + ")");
    // console.log(".. properties:", tag.toString());
}

function logSensor(sensor) {
    console.log("..", sensor.sensorType,
                "of", sensor.wirelessTag.name + ":");
    console.log("    reading:", sensor.reading);
    if (sensor.eventState !== undefined) {
        console.log("    state:", sensor.eventState);
        console.log("    armed:", sensor.isArmed());
    }
    // console.log("... sensor properties:", sensor.toString());
}
```

[`examples/`]: https://github.com/hlapp/wirelesstags-js/tree/master/examples

repository: hlapp/wirelesstags-js

repo_name: hlapp/wirelesstags-js


text:
# Lindquistomyces Aramb., E. Müll. & Gamundí GENUS

#### Status
ACCEPTED

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

#### Published in
in Arambarri, Gamundí & Müller, Sydowia 35: 6 (1982)

#### Original name
Lindquistomyces Aramb., E. Müll. & Gamundí

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# Docker Plugin

This plugin automates tagging and publishing images to a docker registry.

## Prerequisites

To publish to a docker registry, you'll first need to authenticate with the target registry. For example, the [Docker Login Action](https://github.com/docker/login-action) for GitHub, or [the `withRegistry` helper](https://www.jenkins.io/doc/book/pipeline/docker/#custom-registry) in Jenkins.

## Installation

This plugin is not included with the `auto` CLI installed via NPM. To install:

```bash
npm i --save-dev @auto-it/docker
# or
yarn add -D @auto-it/docker
```

## Usage

**IMPORTANT:** You must first must build the desired image to publish.

The following options are available for this plugin:

|option|required|default|environment variable|description|
|-|-|-|-|-|
| `image` | X | | `IMAGE` | The image ID, digest, or tag of the locally available image to tag and publish (must be built before this plugin is run) |
| `registry` | X | | `REGISTRY` | Docker registry to publish to |
| `tagLatest` | | `false` | `TAG_LATEST` | Tag latest release with `latest` tag |
| `tagPullRequestAliases` | | `false` | `TAG_PULL_REQUEST_ALIASES` | Tag pull requests with `pr-<number>` tag |
| `tagPrereleaseAliases` | | `false` | `TAG_PRERELEASE_ALIASES` | Tag prerelease branches
| `prereleaseAliasMappings` | | `{}` | | Tag prerelease branches with different names (e.g. `{"develop": "next"}`) |

### Example 1: Tag releases only
```json
{
  "plugins": [
    ["docker", { "registry": "ghcr.io/my/app", "image": "someLocalImage:myLocalTag" }]
    // other plugins
  ]
}
```

This will publish releases from the local docker image `someLocalImage:myLocalTag` to: - `ghcr.io/my/app:<version>`

### Example 2: Tag latest releases
```json
{
  "plugins": [
    ["docker", { "registry": "ghcr.io/my/app", "image": "someLocalImage:myLocalTag", "tagLatest": true }]
    // other plugins
  ]
}
```

This will publish releases from the local docker image `someLocalImage:myLocalTag` to: - `ghcr.io/my/app:<version>`
- `ghcr.io/my/app:latest`

### Example 3: Tag Prereleases (with Custom Tags)
```json
{
  "prereleaseBranches": ["develop", "someOtherPrereleaseBranch"],
  "plugins": [
    ["docker", { "registry": "ghcr.io/my/app", "image": "someLocalImage:myLocalTag", "tagPrereleaseAliases": true, "prereleaseAliasMapping": { "develop": "next" } }]
    // other plugins
  ]
}
```

For pushes to `develop` branch this will create the following tags:
- `ghcr.io/my/app:<prereleaseVersion>`
- `ghcr.io/my/app:next`

For pushes to `someOtherReleaseBranch` this will create the following tags:
- `ghcr.io/my/app:<prereleaseVersion>`
- `ghcr.io/my/app:someOtherReleaseBranch`

### Example 4: Tag Pull Requests
```json
{
  "plugins": [
    ["docker", { "registry": "ghcr.io/my/app", "image": "someLocalImage:myLocalTag", "tagPullRequestAliases": true }]
    // other plugins
  ]
}
```

If this is run against a pull request the following tags will be created against `someLocalImage:myLocalTag`:
- `ghcr.io/my/app:<canaryVersion>`
- `ghcr.io/my/app:pr-<prNumber>`

repository: intuit/auto

gha_language: TypeScript

repo_name: intuit/auto


text:
---
title: Deploy WordPress to Presslabs Stack
linktitle: "Deploy to Stack"
description: "Find out how to deploy your WordPress code to the Presslabs Stack."
keywords: ['stack', 'docs', 'wordpress', 'kubernetes', 'how-to', 'development']
menu:
  global:
    parent: how-to
slug: deploy-wordpress-on-stack
---

## Requirements

- [helm](https://helm.sh)

## Getting started

Deploying a site is as simple as following these three steps:

1. Add the Presslabs helm chart repository

   ```shell
   $ helm repo add presslabs https://presslabs.github.io/charts
   $ helm repo update
   ```

2. Deploy a site, with main domain pointing to `example.com`

   ```shell
   $ helm upgrade -i my-site presslabs/wordpress-site --set site.domains[0]=example.com
   ```

3. Point the domain to the ingress IP

   ```shell
   $ kubectl get -n presslabs-system service stack-nginx-ingress-controller
   ```

## Deploy a site from a git repository

> ###### NOTE
>
> Deploying from git repository requires that your `WP_CONTENT_DIR` is checked
> in. If you want to use Bedrock it is highly recommended that you deploy using
> a docker image.

Deploying from git is as simple as:

```shell
$ helm upgrade -i my-site presslabs/wordpress-site --set site.domains[0]=example.com \
	--set code.git.repository=https://github.com/presslabs/stack-example-wordpress.git \
	--set code.git.reference=master
```

* `code.git.repository` is a valid git repository origin. It supports HTTP, HTTPS, GIT and the SSH protocol.
* `code.git.reference` reference to deploy. It can be a commit, branch or tag and defaults to `master`

### Using a private repository

In order to use a private repository, you must generate a SSH key pair and set
the **private** to the deployment. To do that, you need to add
`--set-file code.git.ssh_private_key=PATH_TO_THE_PRIVATE_KEY`:

```shell
$ ssh-keygen -f id_rsa -P ''
$ helm upgrade -i my-site presslabs/wordpress-site --set site.domains[0]=example.com \
	--set code.git.repository=https://github.com/presslabs/stack-example-wordpress.git \
	--set code.git.reference=master \
	--set-file code.git.ssh_private_key=id_rsa
```

## Deploy a custom Docker image

You can run a custom image, bundled with your own code and dependencies. You can
specify it when deploying by setting `image.repository` and `image.tag`.

```shell
$ helm upgrade my-site presslabs/wordpress-site --reuse-values \
	--set image.repository=quay.io/presslabs/wordpress-runtime
	--set image.tag=5.2.2
```

## What's next?

* [How to import a site](./import-site.md)
* Check [helm chart values reference](../reference/wordpress-site-helm-chart-values.md)

repository: nfsc-tommy/stack

repo_name: nfsc-tommy/stack


text:
# inclinometreguitou

Tuto disponible en francais sur https://www.memorandum.ovh

Thanks to camerontech for is great job

my sketch is only an adaptation of his repo.
https://github.com/camerontech/inclinometer

need one pin more but project teh LCD screen is less expensive.

Arduino Inclinometer

This sketch uses an accelerometer and serial-enabled 16x2 LCD or serial i2c LCD screen to measure and display pitch and roll of a vehicle. An inclinometer is usually used in offroading to determine how close you are to having a very bad day.

And a quick video in action: http://www.youtube.com/watch?v=Q_Gq_8f8r2c
Features

The inclinometer reads the X and Y values from the accelerometer and translates them into PITCH (forward and back tilt) and ROLL (left and right tilt). However, since we're only measuring acceleration we will get false readings when the sensor itself is in motion (like when you're driving in a car). To get a "true" reading of your pitch and roll you'll need to stop moving.
Equipment

    1 x Arduino nano or compatible board https://www.amazon.fr/SODIAL-ATmega328-P-20AU-Carte-Module/dp/B00QPUEFNW/
    1 x 16x2 serial-enabled i2c LCD  https://www.amazon.fr/gp/product/B00V4ISZCW/
    1 x ADXL335 triple axis accelerometer https://www.amazon.fr/SODIAL-ADXL335-numerique-gravite-dinclinaison/dp/B00V4PRRO2/

Wiring

Connect the accelerometer to 3.3V, GND, X to analog pin 0 and Y to analog pin 1 and Z to analog pin 2.

Connect the LCD to 5V, GND. Connect to analog pin sda pin 4 and scl pin 5 to on the Arduino.

layout

HAVE FUN ;)

repository: GuitouFlc/inclinometreguitou

repo_name: GuitouFlc/inclinometreguitou


text:
# javascript-obfuscator plugin and loader for Webpack@5

[![npm version](https://badge.fury.io/js/webpack-obfuscator.svg)](https://badge.fury.io/js/webpack-obfuscator)

### Installation

This plugin requires Webpack@5. If you depend on Webpack@4, please use [version 2](https://github.com/javascript-obfuscator/webpack-obfuscator/tree/2.6.0) of the plugin.

Install the plugin with NPM and add it to your devDependencies:

`npm install --save-dev javascript-obfuscator webpack-obfuscator`

### Plugin usage:

```javascript
var WebpackObfuscator = require('webpack-obfuscator');

// ...

// webpack plugins array
plugins: [
    new WebpackObfuscator ({
        rotateStringArray: true
    }, ['excluded_bundle_name.js'])
]
```

### Loader usage:

Define a rule in your webpack config and use the obfuscator-loader as the last of your loaders for your modules. You can add the **enforce: 'post'** flag to ensure the loader will be called after normal loaders:

```javascript
var WebpackObfuscator = require('webpack-obfuscator');

// webpack loader rules array
rules: [
    {
        test: /\.js$/,
        exclude: [
            path.resolve(__dirname, 'excluded_file_name.js')
        ],
        enforce: 'post',
        use: {
            loader: WebpackObfuscator.loader,
            options: {
                rotateStringArray: true
            }
        }
    }
]
```

### obfuscatorOptions
Type: `Object` Default: `null`

Options for [javascript-obfuscator](https://github.com/javascript-obfuscator/javascript-obfuscator). Should be passed exactly like described on their page.

### excludes (plugin only)
Type: `Array` or `String` Default: `[]`

Bundle name is output file name after webpack compilation. With multiple webpack entries you can set bundle name in `output` object with aliases `[name]` or `[id]`.

Syntax for excludes array is syntax for [multimatch](https://github.com/sindresorhus/multimatch) package. You can see examples on package page.

Few syntax examples: `['excluded_bundle_name.js', '**_bundle_name.js'] or 'excluded_bundle_name.js'`

Example:
```
// webpack.config.js
'use strict';

const JavaScriptObfuscator = require('webpack-obfuscator');

module.exports = {
    entry: {
        'abc': './test/input/index.js',
        'cde': './test/input/index1.js'
    },
    output: {
        path: 'dist',
        filename: '[name].js' // output: abc.js, cde.js
    },
    plugins: [
        new JavaScriptObfuscator({
            rotateStringArray: true
        }, ['abc.js'])
    ]
};
```

Can be used to bypass obfuscation of some files.

### License
Copyright (C) 2022 [Timofey Kachalov](http://github.com/sanex3339).

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

  * Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
  * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.


text:
## Coursera Full Stack Course

Assignments:

You can check the demo links Below

Assignments for Coursera Full Stack Course

You can check the demo links Below

[Module 2 Solution Demo](https://statixdesign.github.io/coursera-full-stack-course/module2-solution/)

[Module 3 Solution Demo](https://statixdesign.github.io/coursera-full-stack-course/module3-solution/)

[Module 4 Solution Demo](https://statixdesign.github.io/coursera-full-stack-course/module4-solution/)

[Module 5 Solution Demo](https://statixdesign.github.io/coursera-full-stack-course/module5-solution/)

## Copyright and license
Code and documentation copyright 2019 by Ahmet Cangir. Code released under the [MIT](https://github.com/statixdesign/coursera-full-stack-course/blob/master/LICENSE.md) License.

repository: cangir/coursera-full-stack-course

repo_name: cangir/coursera-full-stack-course


text:
---
layout:		property
title:		"ref_income_amount"
schemas:	[loan]
---

# ref_income_amount

---

The reference income used for a customer for a loan. Monetary type is represented as an integer number of cents/pence.

The [FCA][fca] defines customer(s) income as the Total Gross Income, which is described as:

> This is the total of the gross annual incomes (before tax or other deductions) of each of the individual borrowers whose incomes were taken into account when the lender made the lending assessment/ decision. For these purposes, each borrower’s gross income is the sum of that person’s main income and any other reckonable income (e.g., overtime and/or income from other sources, to the extent that the lender takes such additional income into account in whole or in part).

[fca]: https://www.fca.org.uk/publication/data/psd-glossary-mortgages.pdf

repository: SuadeLabs/fire

repo_name: SuadeLabs/fire


text:
# The Planetonomy Blog

this is the blog of the **Planetonomy,** which comprises earth, individuals, groups of people, and organizations known as *participatory humanistic democracies*

blog entries:

* [Guiding and Correcting Corporate Behavior](https://github.com/ernest-bruce/participatory-humanistic-economy/blob/master/blog/2019/controlling_behavior.md#guiding-and-correcting-corporate-behavior)

---

[human_internet]: https://github.com/ernest-bruce/human-internet
[controlling_behavior]: https://github.com/ernest-bruce/participatory-humanistic-economy/blob/master/blog/2019/controlling_behavior.md#guiding-and-correcting-corporate-behavior

repository: ernest-bruce/planetonomy

repo_name: ernest-bruce/planetonomy


text:
# Digital Ocean `#Ad`

## Slide 1

Hello, everyone!

My name is Ethan Davidson, TuffyHacks' _Head of Tech_, and I would like to share a quick word from one of our sponsors, **Digital Ocean**.

Digital Ocean offers a scalable compute platform with add-on storage, security, and monitoring capabilities.

## Slide 2

You can manage your infrastructures seamlessly with Digital Ocean's collection of features:

- Scalable compute services (also known as "Droplets").
- Managed databases and Kubernetes clusters.
- One-click apps.
- Simple object storage.
- Load balancers.
- And more.

## Slide 3

Digital Ocean houses 12 data centers across 8 global markets, so you can stay confident about the safety of your data.

## Slide 4

Customers keep coming back to Digital Ocean because of...

- Their platform's simplicity.
- Engaging developer community.
- Awesome customer service.
- And their contributions to the open source community.

## Slide 5

You can actually have a $100, 60-day free trial with Digital Ocean by scanning the QR code on the screen.

Or, you could simply visit Try dot Digital Ocean dot Com Slash Developer Cloud.

You can also check out our camper guide on TuffyHacks dot Com Slash Guide which has all of the information I covered for your convenience.


text:
ADSimDetector
=============
The home of the simDetector for the
[EPICS](http://www.aps.anl.gov/epics/)
[areaDetector](https://github.com/areaDetector/areaDetector/blob/master/README.md)
software.  It contains this example driver and an example IOC directory.

Prior to R2-3 the files in this repository were contained in the ADExample
repository.  ADSimDetector was split into its own repository in November 2016
and the first release of the new repository was called R2-3 to continue the
release numbering from ADExample.

Additional information:
* [Documentation](https://areadetector.github.io/areaDetector/ADSimDetector/simDetector.html)
* [Release notes and links to source and binary releases](RELEASE.md)

repository: areaDetector/ADSimDetector

repo_name: areaDetector/ADSimDetector


text:
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

#
 **Express Note Taker**

---

![front-page app](public/assets/README_SS/note-taker.png "Note Taker Homepage")

---

## **Table Of Contents**

---

1. [Description](#description)
2. [Installation](#installation)
3. [Usage](#usage)
4. [Contributing](#contributing)
5. [Tests](#tests)
6. [Review and Contribute](#github)
---

##
  **Description**

---

This app utilizes an express server to allow a client to take, update, delete, and alter notes which are in turn saved to a json file which can be returned upon launch.  The Note Taker utilizes several routes to deliver the base html to the client as well as api routes in order to handle the operations required of the note taker.

---

##
  **Installation**

---

to install simply install the dependencies by using

`npm i`

---

##
  **Usage**

---

Once all dependencies are installed you can run the program by inputting

`npm start`

in the command line.  This will initialize the server.  Once started, you can open up your browser and input

 `localhost:{PORT}`

  followed by the assigned port which is alerted in the command line upon launch.  From there input a title and then input notes.  Once finished, click the save icon in the top right corner.  From there you will notice that the notes title has been stored in the left column along with a red trash can icon.  From here you can either click on the note title itself to bring it up for editing or reading.  Also, with the trash can icon, you can delete any note off of the database you so choose.  These choices are updated dynamically making it easy for the client to modify them in real time.

  You can also utilize the app on the heroku deployed site.  This is much simpler as it is already served and one wouldnt need to clone the repo in order to test.  The Heroku deployment link is listed below.

---

##
  **Contributing**

---

licence attached to readme if interested in contribution.  Github and email below.

---

##
  **Tests**

---

![test page of note taker](public/assets/README_SS/test.gif "This is mock up of the note taker title field, saved note, and test input field")

---

##
  **Github and Email**

---

##
 **Review and contribute here**

### _Github:_ [cmgson](https://github.com/cmgson)

### _Email:_<EMAIL_ADDRESS>
### Deployment Information
This app has been deployed on Heroku.

[Heroku Deployment click here](https://express-note-taker-cmgson.herokuapp.com/)

Here is where the deployment is located on Github.

![screen cap](public/assets/README_SS/deployment.png)

---

repository: cmgson/Note-Taker

repo_name: cmgson/Note-Taker


text:
# Deprecated

Please use https://github.com/nebula-plugins/gradle-lint-plugin/wiki/Unused-Dependency-Rule

# Gradle-dependency-analysis-plugin

A gradle dependency analysis plugin inspired by the maven dependency plugin and https://gist.github.com/kellyrob99/4334483.

gha_language: Groovy


text:
# Mir Framework

A framework for creating complex, highly-customizable REST APIs and their management dashboards with minimal effort.

Built on top of [Eve](http://python-eve.org/).

---

## Installation

Mir can be installed using [pip](https://pip.pypa.io/en/stable/installing/). The python package includes the framework's core files and a CLI tool used for creating and scaffolding projects, running development and production servers, and deploying your project.

```bash
pip install mir
```

*Mir requires a running [MongoDB](https://docs.mongodb.com/manual/installation/) instance.*

---

## Starting a Project

Like Eve, Mir is simple.

```bash
# initialize a project
mir init my_new_project

# navigate to your project directory
cd my_new_project

# Create a new endpoint
mir model -n new_endpoint

# start a dev server at http://localhost:8080
mir dev

curl http://localhost:8080/new_endpoint
```

---

## Features

* Mir creates highly customizable REST APIs using simple, readable configuration files as an alternative to manual CRUD programming. You configure settings and validation for your database resources and get a REST API for free.

* Automatically creates flexible, fully-featured web-based Admin UIs to manage your API based on the settings and validation specified in your resource configuration files.

* Includes fully customizable token-based authentication out of the box. Control access per resource, per user, and/or per role via the application's configuration files.

* Includes document versioning for all resources.

* Includes media storage for files, videos, and images. Mir also implements an API for manipulating images on-the-fly via query string parameters, modeled after the [Cloudinary](https://cloudinary.com/) service.

* Implements interfaces and APIs for creating custom application routes, request hooks, etc.

* Provides code APIs for customizing much of the core functionality, including media/file storage and authentication.

---

## Development

To get started developing Mir, first clone the repo and install it as a python package in development mode:

```bash
git clone https://github.com/spbrien/mir.git
pip install -e ./mir
```

* The core application (which imports/registers all project-specific code and other python modules) is in `mir/mir.py`
* The CLI tool is in `mir/cli.py`
* The source code for the Admin UI is in `admin/src`

### Working on the API core files

In a separate directory, scaffold out and run a new Mir project:

```bash
mir init test_project
cd test_project
mir dev
```

Once you have a running Mir instance, you can update core files and see your changes in the running instance. Due to the way Mir dynamically imports python modules from project-specific code, many changes require manually restarting the development server:

```bash
ctrl + c
mir dev
```

### Working on the Admin UI

In a separate testing directory, scaffold out and run a new Mir project:

```bash
mir init test_project
cd test_project
mir dev
```

In your main Mir directory, change to the admin application folder and start a dev server:

```bash
cd admin
npm run dev
```

This starts a frontend development server for the Admin Vue application at http://localhost:8081

To build your changes into the running mir instance, run `npm run build` and restart the mir dev server from the testing directory. For the Admin UI, build files should be committed to the Mir package repo.

---

Detailed documentation coming soon.


text:
---
layout: post
title:  "Notes on Machine Learning 7: Bayesian Inference"
date:   2018-04-23 00:00:00
author: 장승환
categories: Notes
tags: ML
---

#### (ML 7.1) Bayesian inference - A simple example

Thomas Bayes

"*Put distributions on everything, and then use rules of probability!*"

Bayes' rule

**Exampl.**
$D= (x_1, x_2, x_2) = (101, 100.5, 101.5)$ ($n=3$)
$X \sim N(\theta, 1)$ iid given $\theta$

$\theta_{\rm MLE} = \overline{x} = \frac{1}{n}\sum_{i=1}^n = 101$

$ $

$\theta = N(100,1)$ prior
$\theta_{\rm MAP} = 100.75$
To compute $P(\theta < 100 \vert D)$, one needs *posterior* $p(\theta \vert D)$

posterior:
$p(\theta \vert D) = \frac{p(D\vert \theta)p(\theta)}{p(D)} = \frac{\prod_{i=1}^np(x_i \vert \theta) p(\theta)}{p(D)}$
$\leadsto$ can be desribed as a normal distribution and so analytically computable!

predictive:
$p(x \vert D) = \int p(x, \theta \vert D) d \theta = \int p(x\vert\theta)p(\theta \vert D) d \theta$
$\leadsto$ analytically integrable!

---

#### (ML 7.2) Aspects of Bayesian inference

* Bayesian inference : Assume a prior distribution $p(\theta)$ and then use probability rules to work with $p(x\vert \theta)$ to anser questions.
* Bayesian procedures : Minimize expected loss (averaging over $\theta$).

* Objective Bayesian : use belief-based priors
* Subjective Bayesian : use non-informative priors

**Pros.**
* Directly answer certain questions, e.g., can compute $P(99 < \theta < 101)$
* Avoid some pathologies (associated with frequentist approach)
* Avoid overfitting
* Automatically do medel selection ("Occam's razor")
* Bayesian procedures are often admissible

**Cons.**
* Must assume a prior
* Exact computation (of posterior) can be intractable ($\leadsto$ have to use approximation)

**Priors.**
* Non-informative
* Improper, e.g., $p(\theta) = 1$ with density
* Conjugate

---

#### (ML 7.3) Proportionality

"Using proportionality is a extraordinarily handy trick (big time-saver) when doing Bayesian inference."

**Notation.** $f \propto g$ if there exists $c \neq 0$ such that $g(x) = cf(x)$ for all $x$.

**Claim.** If $f$ is a PDF and $f \propto g$ then $g$ uniquely determine $f$, and $f(x) = \frac{g(x)}{\int g(x)}dx$.

Proof. $\frac{g(x)}{\int g(x)}dx = \frac{cf(x)}{\int cf(x)}dx = f(x)$.

---

#### (ML 7.4) Conjugate priors

**Definition.** A family $\mathscr{F}$ of (prior) distributions $p(\theta)$ is
*conjugate* to a likelihood $p(D\vert \theta)$
if the posterior $p(\theta \vert D)$ is in $\mathscr{F}$.

**Examples.**
* Beta is conjugate to Bernoulli.
* Gaussian is conjugate to Gaussian (mean).
* Any exponential family has a conjugate prior.

---

#### (ML 7.5) (ML 7.6) Beta-Bernoulli model

For example, we model a sequence of binary outcomes, like coin flips, as Bernoulli random variables
with Beta prior distribution on the probability of the heads.
In other words, Beta is a conjugate prior for Bernoulli.

Setup: $X_1, \ldots, X_n \sim {\rm Bern}(\theta)$ independen gieven $\theta$ with prior $\theta \sim {\rm Beta}(a,b)$.
Here the parameters $a, b$ of the prior are called *hyperparameters*.

For generaic $X \sim {\rm Bern}(\theta)$, we have

$$p(1\vert \theta) = P(X = 1 \vert \theta) = \theta = \theta^{I(X=1)}(1-\theta)^{I(X=0)}$$

where

$$\begin{aligned}
p(\theta) &= \frac{\theta^{a-1}(1-\theta)^{b-1}}{B(a,b)}\cdot I(\theta \in [0, 1]) \\
& \propto \theta^{a-1}(1-\theta)^{b-1}\cdot I(\theta \in [0, 1])
\end{aligned}$$

From the setup we generate data $D = (x_1, \ldots, x_n)$.
Then it's easy to compute the posterior distribution:

$$\begin{aligned}
p(\theta\vert D) & \propto_\theta p(D \vert \theta) p(\theta) \\
                 & = p(\theta)\prod_{i=1}p(X_i = x_i\vert \theta) \\
                 & \propto \theta^{a-1}(1-\theta)^{b-1}\theta^{\sum I(x_i=1)}(1-\theta)^{\sum I(x_i=0)} \\
                 & = \theta^{a-1}(1-\theta)^{b-1}\theta^{n_1}(1-\theta)^{n_0} \\
                 & = \theta^{a+n_1-1}(1-\theta)^{b + n_0-1} \\
                 & \propto \cdot {\rm Beta}(\theta\vert a+n_1, b+n_0)
\end{aligned}$$

where $n_1 := \sum I(x_i=1)$ and $n_0 := \sum I(x_i=0)$.

Thus, $p(\theta\vert D) = {\rm Beta}(\theta\vert a+n_1, b+n_0)$, and so Beta is conjugate to Bernoulli.

Beta distributions

See [Beta distribution - an introduction](https://youtu.be/v1uUgTcInQk){:target="_blank"} by [Ox educ](www.ox-educ.com){:target="_blank"} for intuition behind Beta prior.

If $\theta \sim {\rm Beta}(a, b)$, one has:
* $\mathbb{E}(\theta) = \frac{a}{a+b}$;
* $\sigma^2(\theta) = \frac{ab}{(a+b)^2(a+b+1)}$;
* mode $=\frac{a-1}{a+b-2}$.
($a+n_1, b+n_0$ are called *pseudocounts*)

For  $\theta \vert D \sim {\rm Beta}(\theta\vert a+n_1, b+n_0)$, on has:
* $\mathbb{E}(\theta\vert D) = \frac{a+n_1}{a+b+n}$;
* mode $=\frac{a+n_1-1}{a+b+n-2}$.

Now let's make a few connections. We know that
* $\theta_{\rm MLE} =$ empirical probability $= \frac{n_1}{n}$ /  $\left(\frac{n_0}{n}, \frac{n_1}{n}\right)$
* $\theta_{\rm MAP} = \frac{a+n_1-1}{a+b+n-2}$

posterior mean $=\frac{a+n_1}{a+b+n} = \frac{a+b}{a+b+n}\cdot \frac{a}{a+b} + \frac{n}{a+b+n}\cdot \frac{n_1}{n}$,
i.e., a convex combination of prior mean & MLE

* When $n \rightarrow \infty$, posterior mean convergees to the MLE.
* When $n = 0$, if we have no data, we get back to the prior mean.

Let's compute now the (posterior) predictive distribution:

$$\begin{aligned}
P(X = 1\vert D) & = \int P(X = 1\vert)p(\theta \vert D) \\
                & = \int P(X = 1\vert \theta) p(\theta \vert D) \\
                & = \int \theta \cdot {\rm Beta}(\theta \vert a+n_1, b+n_0)d\theta \\
                & = \mathbb{E}(\theta \vert D) \\
                & = \frac{a+n_1}{a+b+n}.
\end{aligned}$$

---

#### (ML 7.7.A1) Dirichlet distribution

[Dirichlet](https://youtu.be/9f60JyTC6Oc){:target="_blank"}, one of the great mathematicians in 1800s.

Dirichlet distribution is a distribution on probability distributinos.

$\theta = (\theta_1, \ldots, \theta_n) \sim {\rm Dir}(\alpha)$ means:

$$p(\theta) = \frac{1}{B(\alpha)}\prod_{i=1}^n \theta_i^{\alpha_i-1}I(\theta \in S)$$

where $\alpha = (\alpha_1, \ldots, \alpha_n)$, $\alpha_i >0$ are the parameters,
$S = \\{x \in \mathbb{R}^n: x_i \ge 0, \sum_{i=1}^n x_n =1 \\}$ is the probability simplex, and
$\frac{1}{B(\alpha)} =\frac{\Gamma(\alpha_0)}{\Gamma(\alpha_1)\cdots\Gamma(\alpha_n)}$.

Probability simplex

Dirichlet distributions

$E(\theta_i) = \frac{\alpha_i}{\alpha_0}$

${\rm mode} = \left(\frac{\alpha_1-1}{\alpha_0}, \ldots, \frac{\alpha_n-1}{\alpha_0-n}\\right)$

$\sigma^2(\theta) = \frac{\alpha_i(\alpha_0-\alpha_i)}{\alpha_0^2(\alpha_0+1)}$

---

(7.8)

---

#### (ML 7.9) (ML 7.10) Posterior distribution for univariate Gaussian

Given data $D = (x_1, \ldots, x_n)$ with $x_i \in \mathbb{R}$,
want to know from which distribution $D$ might come fomm.
Model $D$ as $X_1, \ldots, X_n \sim N(\mu, \sigma^2)$ for some $\mu, \sigma \in \mathbb{R}$,
i.e., $N(\mu, \sigma^2)$ is the "true" distribution wa want.
Becasue we do not know $\mu$, we model it as a random variable $\theta$, which itself follows a normal distribution:

$$\theta \sim N(\mu_0, \sigma_0^2).$$

We assume that $\sigma^2, \mu_0, \sigma_0^2$ are known to make the problem (more) tractable.

Then the postesior distribution is given by

$$\begin{aligned}
p(\theta\vert D) & = \frac{p(D\vert \theta)p(\theta)}{p(D)} \\
                 & \propto_\mu p(D\vert \theta)p(\theta) \\
                 & = p(\theta)\prod_{i=1}^np(x_i\vert \theta) \\
                 & \propto_\mu \exp\left(-\frac{1}{2\sigma_0^2}(\theta-\mu_0)^2\right)
                               \exp\left(-\frac{1}{2\sigma^2}(x_i - \theta)^2\right) \\
                 & = \exp\left(-\frac{1}{2\sigma_0^2}(\theta-\mu_0)^2
                     -\frac{1}{2\sigma^2}\sum (x_i - \theta)^2 \right).
\end{aligned}$$

Now,

$$\begin{aligned}
& -\frac{1}{2\sigma_0^2}(\theta-\mu_0)^2 -\frac{1}{2\sigma^2}\sum (x_i - \theta)^2 \\
= & -\frac{1}{2\sigma_0^2}(\theta^2 - 2\theta\mu_0 + \mu_0^2)
    -\frac{1}{2\sigma^2}\sum (x_i^2 -2x_i\theta + \theta^2) \\
= & \left(-\frac{1}{2\sigma_0^2} -\frac{n}{2\sigma^2}\right)\theta^2
    + \left(\frac{\mu_0}{\sigma_0^2} + \frac{1}{\sigma^2}\sum x_i \right)\theta +c \\
= & -\frac{1}{2}\left(\frac{1}{\sigma_0^2} + \frac{n}{\sigma^2}\right)
    \left(\theta^2 - 2\frac{\frac{\mu_0}{\sigma_0^2}
    + \frac{\sum x_i}{\sigma^2}}{\frac{1}{\sigma_0^2} + \frac{n}{\sigma^2}}\theta +m^2 \right) \\
= & -\frac{1}{2}\left(\frac{1}{\sigma_0^2} + \frac{n}{\sigma^2}\right)(\theta-m)^2 +c' \\
= & -\frac{1}{2\sigma_n^2}(\theta - m_n)+c'
\end{aligned}$$

We have:

and

$$m_n = \frac{\sigma_n^2}{\sigma_0^2}\mu_0 + \frac{\sigma_n^2}{\sigma^2}n\mu_{\rm MLE}$$

with

$$\frac{\sigma_n^2}{\sigma^2}n + \frac{\sigma_n^2}{\sigma_0^2}n
  = \sigma_n^2\left( \frac{n}{\sigma^2} + \frac{1}{\sigma_0^2}\right) = 1.$$

The convergence behavior of the posterior mean (MAP) when $n$ approaches $\infty$:

---

gha_language: CSS


text:
# Elevation service hosting DTM files

This provides a REST API service for querying elevations defined in DTM files. It is implemented in C++, with GDAL, libevent, and JSON-C. If you are familiar with `gdal` commands, you could imagine this as a daemonized and enhanced `gdallocationinfo`.

# Why not just use `gdallocationinfo`?

Yes, you can just use `gdallocationinfo`. But every command of it forks a new process, and then open a DTM file just to query a single elevation for you. On the contrary, `demd` hosts multiple DTM files as a daemon (server, or service) and are capable to query multiple elevations in the same API request. If you care about performance and resource utilization, it will be a good investment to run a micro elevation service.

# How to use (as docker container)

1. Prepare DTM files in a folder. If you don't have any DTM, you can download some from [Viewfinder Panoramas](http://viewfinderpanoramas.org/). The fastest way is to pick up from its [world map](http://www.viewfinderpanoramas.org/Coverage%20map%20viewfinderpanoramas_org3.htm).
1. Start a container running our public [docker image](https://hub.docker.com/r/outdoorsafetylab/demd) (replace `/path/to/your/dtms` with the real path of your DTM files):
    ```shell
    docker run -it --rm -p 8082:8082 -v "/path/to/your/dtms:/var/lib/dem" outdoorsafetylab/demd
    ```
1. Try to query a elevation of somewhere you are familiar with. For example, to query the elevation of Mt. Jade, highest peak of Taiwan:
    ```shell
    curl -XPOST --data '[[120.957283,23.47]]' http://<IP_ADDRESS>:8082/v1/elevations
    ```
1. You can also cross-check with `gdallocationinfo` command:
    ```shell
    gdallocationinfo -wgs84 -valonly N23E120.hgt 120.957283 23.47
    ```

# How to build

This project was developed on Ubuntu 18.04 LTS. You will need to install the following packages by `apt-get` before building it:

```shell
sudo apt-get install build-essential libgdal-dev libevent-dev libjson-c-dev
```

To build:

```shell
make
```

A executable file `demd` will be created. You can run it to see the help:

```shell
Usage: ./demd [options] <DEM file or directory of DEM files>
Options:
    -a <addr> : Address to bind HTTP (default: <IP_ADDRESS>)
    -p <port> : Port to bind HTTP (default: 80)
    -u <URI>  : URI to serve REST (default: /v1/elevations)
    -s <SRS>  : SRS of requested coordinates (default: WGS84)
    -A <auth> : 'Authorization' header to control access, 401 status will be replied if not matched. (default: none)
```

# How to run

If development packages was not installed, you may need the follow runtime dependency packages installed:

```shell
sudo apt-get install libevent-2.1-6 libgdal20
```

Or use `serve` target in `Makefile` to automatically download sample DEM files before starting the daemon:

```shell
$ make serve
./demd -p 8082 dem
Dataset loaded: dem/N21E120.hgt => (22.000417,119.999583,20.999583,121.000417)
Dataset loaded: dem/N23E121.hgt => (24.000417,120.999583,22.999583,122.000417)
Dataset loaded: dem/N20E121.hgt => (21.000417,120.999583,19.999583,122.000417)
Dataset loaded: dem/N23E120.hgt => (24.000417,119.999583,22.999583,121.000417)
Dataset loaded: dem/N20E122.hgt => (21.000417,121.999583,19.999583,123.000417)
Dataset loaded: dem/N22E121.hgt => (23.000417,120.999583,21.999583,122.000417)
Dataset loaded: dem/N22E120.hgt => (23.000417,119.999583,21.999583,121.000417)
Dataset loaded: dem/N21E121.hgt => (22.000417,120.999583,20.999583,122.000417)
Serving http://<IP_ADDRESS>:8082/v1/elevations
```

To query the elevation of Mt. Jade, highest peak of Taiwan:

```shell
$ curl -XPOST --data '[[120.957283,23.47]]' http://<IP_ADDRESS>:8082/v1/elevations
[ 3917 ]
```

# API specification

See the [OpenAPI 3.0 specification](https://outdoorsafetylab.org/elevation_api.html).

repository: outdoorsafetylab/demd

repo_name: outdoorsafetylab/demd


text:
### Node Linea Motion

Calculates velocity, distance and time. Review module

#### Instalation

`npm install --save node-linear-motion`

#### Usage

```javascript

const LinearMotion = require('node-linear-motion');

let time = LinearMotion.calculateTime(19, 10);
let velocity = LinearMotion.calculateVelocity(5, 19);
let distance = LinearMotion.calculateDistance(100, 2);

```

`calculateTime(velocity, distance)`

`calculateVelocity(time, distance)`

`calculateDistance(velocity, time)`

It's assumed the values are expressed in meters and seconds.

repository: ybrodsky/node-linear-motion

repo_name: ybrodsky/node-linear-motion


text:
<img width="600px" src="https://raw.githubusercontent.com/omerg/react-tech-radar/master/screenshots/Screenshot_1.png">

# React Tech Radar

A react component that generates an interactive radar, inspired by [thoughtworks.com/radar](http://thoughtworks.com/radar).

[Demo (Storybook)](https://react-tech-radar.netlify.app/?path=/docs/radar--docs)

## Installation

Using [npm](https://www.npmjs.com/):

    npm install --save react-tech-radar

## Quick Start

```jsx
import React from 'react';
import Radar from 'react-tech-radar';

function App() {

    const setup = {
        rings: ['adopt', 'trial', 'assess', 'hold'],
        quadrants: ['tools', 'techniques', 'platforms', 'languages'],
        data: [
            {
                name: 'D3',
                quadrant: 'tools',
                ring: "assess"

            },
            {
                name: 'TypeScript',
                quadrant: 'languages',
                ring: "trial"
            },
            {
                name: 'Storybook',
                quadrant: 'tools',
                ring: "adopt"
            }
        ]
    };

    return (
        <div className="App">
            <Radar {...setup} />
        </div>
    );
}

export default App;
```

## Props Setup

The following 3 props should be configured in order to setup the tech radar:

 - quadrants
 - rings
 - data

### data

data prop is an array of JSON elements representing the description of technologies.

Elements in the array should be in the following form:

__Example:__
```json5
{
data: [
          {
              name: 'D3',
              quadrant: 'tools',
              ring: "assess"
          },
          {
              name: 'TypeScript',
              quadrant: 'languages',
              ring: "trial"
          },
          {
              name: 'Storybook',
              quadrant: 'tools',
              ring: "adopt"
          }
      ]
}
```

### quadrants

quadrants prop is an array of strings which represent slices of the circular radar.
Any data element with the matching quadrant value goes into this slice

Elements in the array should be in the following form:

__Example:__
```json5
{
  quadrants: ['tools', 'techniques', 'platforms', 'languages']
}
```

### rings

rings prop is an array of strings which represent at what level these technologies are adopted.
For each element in rings, every quadrant is divided into rings. Innermost ring is the first element of the rings array and
it usually represents the place for the most adopted technologies.

__Example:__
```json5
{
  rings: ['adopt', 'trial', 'assess', 'hold'],
}
```

## Configuration Options

| Prop         | Description    | Default Value |
| :---         |     :---      |          ---: |
| width     | The overall width of the main DOM element       | 700px      |
| fontSize     | Font size of elements       | 12px      |
| itemFontSize     | Set this if you want the items to have a different size than titles of quadrants and rings. If not set, defaults to fontSize       | 12px      |
| colorScaleIndex     | A value from 0 to 5 for different collections of colors. See [Storybook Color Schemes](https://react-tech-radar.netlify.com/?path=/story/color-schemes--with-1) section for colors of each option.      |5      |
| radiusDiminish     | Radius of rings is not equal because of this constant. Each radius is x times greater than the outer one and x is this constant.      | 1.5      |

#### Prop Types

```jsx
Radar.propTypes = {
    quadrants: PropTypes.array.isRequired,
    rings: PropTypes.array,
    data: PropTypes.array,
    width: PropTypes.number,
    fontSize: PropTypes.number,
    itemFontSize: PropTypes.number,
    colorScaleIndex: PropTypes.number,
    radiusDiminish: PropTypes.number
};
```

## Storybook

You can see various states of the radar (such as color schemes, results of configurations, etc.) on the [Storybook Page](https://react-tech-radar.netlify.com).

## Google SpreadSheets Integration

If you want a very quick data integration, you can check out the Google Spreadsheets example.

The source code for the example is in 'examples' folder and also there is a running example in [Storybook](https://react-tech-radar.netlify.com).

If you plug in [this data](https://docs.google.com/spreadsheets/d/1XkfUX8auztSkMoHwBEraDjHZgx7NEH59OyUZH-0IQGw/edit) you'll see [this visualization](https://react-tech-radar.netlify.com/?path=/story/basics--with-data-from-google-spreadsheet)

#### Sharing the sheet

 - In Google sheets, go to 'File', choose 'Publish to the web...' and then click 'Publish'.
 - Close the 'Publish to the web' dialog.
 - Copy the URL of your editable sheet from the browser (Don't worry, this does not share the editable version).

The URL will be similar to https://docs.google.com/spreadsheets/d/1waDG0_W3-yNiAaUfxcZhTKvl7AUCgXwQw8mdPjCz86U/edit. In theory we are only interested in the part between '/d/' and '/edit' but you can use the whole URL if you want.
## License

[MIT](./LICENSE)

repository: omerg/react-tech-radar

repo_name: omerg/react-tech-radar


text:
# lotus-stats

`lotus-stats` is a small tool to push chain information into influxdb

## Setup

Influx configuration can be configured through env variables.

```
INFLUX_ADDR="http://localhost:8086"
INFLUX_USER=""
INFLUX_PASS=""
```

## Usage

lotus-stats will be default look in `~/.lotus` to connect to a running daemon and resume collecting stats from last record block height.

For other usage see `./lotus-stats --help`

```
go build -o lotus-stats *.go
. env.stats && ./lotus-stats
```

## Development

Start grafana and influxdb containers and import the dashboard to grafana.
The url of the imported dashboard will be returned.

If the script doesn't work, you can manually setup the datasource and import the dashboard.

```
docker-compose up -d
./setup.bash
```

The default username and password for grafana are both `admin`.

repository: ipfs-force-community/lotus

gha_language: Go

repo_name: ipfs-force-community/lotus


text:
# Important Topics Practice

## Instructions

You can just Uncomment all code and use them!

## Review & Self Study

It's worth [reading up a little more on arrow functions](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Functions/Arrow_functions), as they are increasingly used in code bases. Practice writing a function, and then rewriting it with this syntax.

Read more about the many operators available to the user [on MDN](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators).

Arrays in JavaScript have many methods attached to them, extremely useful for data manipulation. [Read up on these methods](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array) and try some of them out (like push, pop, slice and splice) on an array of your creation.

Go through Josh Comeau's wonderful [operator lookup](https://joshwcomeau.com/operator-lookup/)!

# What You will Learn ?

1. Regular Expression (RegExp)
   - .exec()
   - .test()
   - .match()
   - .replace()
   - .search()
2. Callback's().
   - Synchronous JavaScript.
   - Asynchronous JavaScript
3. Promises
   - How Promise work?
   - Producing code
   - consuming code
   - chaining promises
   - .then()
   - .finally()
   - .catch()
4. AsyncAwait
5. Prototype in J.S
6. Inheritance.
7. Closure's
8. Array methods
   - .map()
   - .sort()
9. Spread Array.
   - .some()
   - .every()
   - .find()
   - .findIndex()
10. Event Binding.
11. Event Loop
12. Generator
    - what are generators ?
    - Generator Use
    - syntax

---

### **Prerequisite :**

You should have basics of JavaScript.


text:
## CMSIS device headers for STM32

This folder includes the CMSIS device headers for all STM32 devices. The files
located here are part of the `STM32Cube` libraries and can be found inside the
`STM32Cube*/Drivers/CMSIS/Device/ST/STM32F*xx/Include` folder.

The files are copied and modified by converting all line endings from Windows to
Unix style and removing all trailing whitespace.

Here is the list of the current device header version and release date as well
as the Cube release version in braces:

- [L0: v1.9.2 created 16-July-2021](https://github.com/STMicroelectronics/STM32CubeL0)
- [L1: v2.3.2 created 21-May-2021](https://github.com/STMicroelectronics/STM32CubeL1)
- [L4: v1.7.1 created 11-February-2021](https://github.com/STMicroelectronics/STM32CubeL4)
- [L5: v1.0.4 created 10-February-2021](https://github.com/STMicroelectronics/STM32CubeL5)
- [F0: v2.3.6 created 23-July-2021](https://github.com/STMicroelectronics/STM32CubeF0)
- [F1: v4.3.3 created 21-May-2021](https://github.com/STMicroelectronics/STM32CubeF1)
- [F2: v2.2.5 created 21-May-2021](https://github.com/STMicroelectronics/STM32CubeF2)
- [F3: v2.3.6 created 23-July-2021](https://github.com/STMicroelectronics/STM32CubeF3)
- [F4: v2.6.7 created 16-July-2021](https://github.com/STMicroelectronics/STM32CubeF4)
- [F7: v1.2.6 created 12-February-2021](https://github.com/STMicroelectronics/STM32CubeF7)
- [G0: v1.4.1 created 17-June-2021](https://github.com/STMicroelectronics/STM32CubeG0)
- [G4: v1.2.1 created 11-January-2021](https://github.com/STMicroelectronics/STM32CubeG4)
- [H7: v1.10.0 created 12-February-2021](https://github.com/STMicroelectronics/STM32CubeH7)
- [WB: v1.9.0 created 24-June-2021](https://github.com/STMicroelectronics/STM32CubeWB)
- [WL: v1.1.0 created 16-June-2021](https://github.com/STMicroelectronics/STM32CubeWL)

This repository is updated periodically by Github Actions.


text:
---
title: "Arch Apache, MySQL, and PMA Manual Setup"
date: "2021-09-25"
desc: "Setup Apache, MySQL, and phpMyAdmin manually on Arch."
tag:
  - "linux"
  - "php"
  - "mysql"
  - "arch"
---

# Abstract

This is just a tutorial on how to do a LAMP stack manually on Arch Linux. Without further talks, let's cut into this.

# Setting Up

Install the required packages:

```bash
sudo pacman -S php php-apache phpmyadmin apache mariadb
```

> Note: You can find old versions of PHP in AUR

## Configuring MariaDB

MariaDB is a reliable, high performance and full-featured database server which aims to be an 'always Free, backward compatible, drop-in' replacement of MySQL. Since 2013 MariaDB is Arch Linux's default implementation of MySQL.

1. To start configuring, run this command:

```bash
sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
```

2. Then enable and start `mariadb.service` by issuing this command:

```bash
sudo systemctl enable --now mariadb.service
```

3. Log in as root user on the MySQL server by using the following command:

```bash
sudo mysql -u root -p
```

> Note: Default root user has no password. Press enter to continue.

4. Issue the command to create a user and grant the privileges:

```sql
MariaDB> CREATE USER 'your-name'@'localhost' IDENTIFIED BY 'your-pass';
MariaDB> GRANT ALL PRIVILEGES ON *.* TO 'your-name'@'localhost';
MariaDB> FLUSH PRIVILEGES;
MariaDB> quit
```

> Note: Change `your-name` with your desired username choices.
> Further informations can be referred from [Arch Wiki MariaDB page](https://wiki.archlinux.org/index.php/MariaDB).

## Configuring PHP

PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.
The main PHP configuration file is well documented and located at `/etc/php/php.ini`.
In order to make PHP work with MariaDB, uncomment the following lines in `/etc/php/php.ini`:

```php
extension=iconv
extension=pdo_mysql
extension=mysqli
```

> Note: the extension `iconv` is to be uncommented to avoid an error in PHP8 regarding the extension itself.
> Further informations can be reffered from [Arch Wiki PHP page](https://wiki.archlinux.org/index.php/PHP).

## Configuring Apache

The Apache HTTP Server, or Apache for short, is a very popular web server, developed by the Apache Software Foundation.
Apache configuration files are located in `/etc/httpd/conf`. The main configuration file is `/etc/httpd/conf/httpd.conf`, which includes various other configuration files. The default configuration file should be fine for a simple setup. By default, it will serve the directory `/srv/http` to anyone who visits your website.
You can start Apache by running `sudo systemctl enable --now httpd.service`.
To configure Apache to work with PHP, we'll be using the `libphp` method:

1. Comment the line in `/etc/httpd/conf/httpd.conf`:

```php
#LoadModule mpm_event_module modules/mod_mpm_event.so
```

2. Uncomment the line:

```php
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
```

> Note: The above is required, because libphp.so included with the package does not work with mod_mpm_event, but will only work mod_mpm_prefork instead.

3. To enable PHP, add these lines to `/etc/httpd/conf/httpd.conf`:

- Place this at the end of the `LoadModule` list:

```php
LoadModule php_module modules/libphp.so
AddHandler php-script .php
```

- Place this at the end of the `Include` list:

```php
Include conf/extra/php_module.conf
```

- Restart `httpd.service` by issuing `sudo systemctl restart httpd.service` command.
  > Note: This method is probably the easiest, but is also the least scalable: it is suitable for a light request load. It also requires you to change the mpm module, which may cause problems with other extensions (e.g. it is not compatible with HTTP2).
  > For further readings, refer to [Arch Wiki Apache page](https://wiki.archlinux.org/index.php/Apache_HTTP_Server).

## Configuring phpMyAdmin

phpMyAdmin is a free and open source administration tool for MySQL and MariaDB. As a portable web application written primarily in PHP, it has become one of the most popular MySQL administration tools, especially for web hosting services.

1. Create the Apache configuration file in `/etc/httpd/conf/extra/phpmyadmin.conf`:

```php
Alias /phpmyadmin "/usr/share/webapps/phpMyAdmin"
<Directory "/usr/share/webapps/phpMyAdmin">
    DirectoryIndex index.php
    AllowOverride All
    Options FollowSymlinks
    Require all granted
</Directory>
```

2. Include the file in `/etc/httpd/conf/httpd.conf`:

```php
Include conf/extra/phpmyadmin.conf
```

3. To allow the usage of the phpMyAdmin setup script (e.g. <http://localhost/phpmyadmin/setup>), make sure `/usr/share/webapps/phpMyAdmin` is writable for the http user:

```bash
sudo mkdir /usr/share/webapps/phpMyAdmin/config
sudo chown http:http /usr/share/webapps/phpMyAdmin/config
sudo chmod 750 /usr/share/webapps/phpMyAdmin/config
```

4. Add `blowfish_secret` passphrase (You can search a generator for one) in `/usr/share/webapps/phpMyAdmin/config.inc.php`:

```php
$cfg["blowfish_secret"] = "your-passphrase-here";
```

5. In `/usr/share/webapps/phpMyAdmin/config.inc.php`, uncomment and change them correspondingly to the ones you set in MariaDB configuration (`your-name` and `your-pass`):

```php
/* User used to manipulate with storage */
// $cfg['Servers'][$i]['controlhost'] = 'my-host';
// $cfg['Servers'][$i]['controlport'] = '3306';
$cfg["Servers"][$i]["controluser"] = "your-name";
$cfg["Servers"][$i]["controlpass"] = "your-pass";

/* Storage database and tables */
$cfg["Servers"][$i]["pmadb"] = "phpmyadmin";
$cfg["Servers"][$i]["bookmarktable"] = "pma__bookmark";
$cfg["Servers"][$i]["relation"] = "pma__relation";
$cfg["Servers"][$i]["table_info"] = "pma__table_info";
$cfg["Servers"][$i]["table_coords"] = "pma__table_coords";
$cfg["Servers"][$i]["pdf_pages"] = "pma__pdf_pages";
$cfg["Servers"][$i]["column_info"] = "pma__column_info";
$cfg["Servers"][$i]["history"] = "pma__history";
$cfg["Servers"][$i]["table_uiprefs"] = "pma__table_uiprefs";
$cfg["Servers"][$i]["tracking"] = "pma__tracking";
$cfg["Servers"][$i]["userconfig"] = "pma__userconfig";
$cfg["Servers"][$i]["recent"] = "pma__recent";
$cfg["Servers"][$i]["favorite"] = "pma__favorite";
$cfg["Servers"][$i]["users"] = "pma__users";
$cfg["Servers"][$i]["usergroups"] = "pma__usergroups";
$cfg["Servers"][$i]["navigationhiding"] = "pma__navigationhiding";
$cfg["Servers"][$i]["savedsearches"] = "pma__savedsearches";
$cfg["Servers"][$i]["central_columns"] = "pma__central_columns";
$cfg["Servers"][$i]["designer_settings"] = "pma__designer_settings";
$cfg["Servers"][$i]["export_templates"] = "pma__export_templates";
```

6. Execute `mysql -u root -p < /usr/share/webapps/phpMyAdmin/sql/create_tables.sql` in the command line to create the required tables.
7. Remove temporary configuration directory once configuration is done:

```bash
sudo rm -r /usr/share/webapps/phpMyAdmin/config
```

8. Restart the `httpd.service` again just for additional measures.
   For further readings, refer to [Arch Wiki phpMyAdmin page](https://wiki.archlinux.org/index.php/PhpMyAdmin).

# Finishing

Open <http://localhost/phpmyadmin/index.php> and login to see if everything works well.

# Sources

1. Arch Wiki. <https://wiki.archlinux.org/>.
2. Wikipedia. <https://en.wikipedia.org/>.

repository: nezatz/blog

repo_name: nezatz/blog


text:
# State

State is written to our EVM or WASM engines on executing bytecode provided by [`CallTx`](/reference/transactions.md#CallTx) transactions that have been
accepted into the blockchain. The state is stored through the following generic interface:

```go
type StorageSetter interface {
	// Store a 32-byte value at key for the account at address, setting to Zero256 removes the key
	SetStorage(address crypto.Address, key binary.Word256, value []byte) error
}
```

The raw data stored according depends on a schema determined by the execution engine and contract in question, in the case of the EVM this is described by the
ABI generated when a contract is compiled.

HiveSmartChain stores its state in an authenticated key-value data structure - a merkle tree. It has the following features:

- We store a separate complete version of all core state at each height - this gives us the ability to rewind instantly to any height.
- We are able to provide inclusion proofs for any element of state (not currently exposed by our RPC interfaces).
- State has a single unified state root hash that almost surely guarantees identity of state by comparison between state root hashes

## Structure

HiveSmartChain stores its core state the `Forest` which is implemented as a merkle tree of commit objects for individual sub-trees thereby providing the state root hash.
Each tree in our forest is lazily loaded by prefix (i.e. initialized if it does not exist), returning a read/write tree. This contains immutable snapshots of its
history for reading, as well as a mutable tree for accumulating state. All trees ultimately wrap [IAVL](https://github.com/tendermint/iavl), an (immutable) AVL+ library,
persisted in [goleveldb](https://github.com/syndtr/goleveldb) - a key/value database.

### Index and derivable data

Alongside our core data we have additional data that can be derived from (such as indices) or is peripheral to (such as contract metadata).
Since we can generally detect if these are incorrect or regenerate them we store them in a plain non-authenticated key-value storage called the `Plain`

### Relationship with Tendermint state

Tendermint also uses merkle trees to store raw block and transaction data. Tendermint blocks close in our state root hash as the `AppHash` thereby creating a
merkle graph that conveys the authenticated data structure property to our application state.

repository: klyed/hivesmartchain

repo_name: klyed/hivesmartchain


text:
---
layout: post
title: Belkin N+ Wireless Router
author: elliotfriend
date: '2011-05-02 23:10:29 -0500'
categories: technology
img-name: wireless-network-design.jpg
seq: 4
---
We moved!!! We moved across our apartment complex into a 2-bedroom unit!
Now we have a library/office/guest-room. Not only did we upgrade our
living arrangement, but we upgraded our Internet Service, as well.

We had been with At&t, but I made the decision to switch to Charter. I
had heard third-hand horror stories about poor customer service, but the
bundle for basic cable along with internet access about seven times
faster for the same price just must be worth at least trying.

Today, I bought a wireless router to replace the modem-router combo we
had been using with At&t. I had seen an article about the new line of
Belkin wireless routers, and I was impressed. I headed down to
[Micro Center](www.microcenter.com), and was as impressed in real life
as I was on the internet. The N+ was the high-end model, but as far as
buying a router goes, it seems like these purchases will be few and far
between. So, why not splurge just a little bit. This will last a while,
so it will be worth it in the end. Bonus, it also came with my very own
copy of the General Public License (in a lot of different languages)!

Not only is it 802.11n, It's got four Gigabit ethernet ports in the back.
It's perfect for a simple NAS appliance, a network printer, or a home
server. Plus, it's got a USB 2.0 port so that an external hard drive can
be shared across the network. This port can also power an external USB
hub. So, I can hook up several hard drives, flash drives, or whatever
kind of storage that I want!

The instructions could not have been simpler or been easier to follow.
Labeled "1, 2, 3" it would have been pretty hard to mess up. Plug this
into that, put this wire here, power-cycle the modem, and you're off to
the races. The initial set-up was easy peasy lemon squeezy. It was up and
running in a snap. The more impressive part was that there are so many
advanced options. This router has any and every option that you could
want to set up. It's really easy to set up a DMZ, port forwarding,
firewall, and I can even have guest-ready internet access that stays
separate from my private network, so I don't have to give out my WPA2 key
to everybody who wants to check facebook.

The only issues I had were that it took a few power-cycles of the modem.
There were a couple of times that I would change a setting with the router
and the internet connection would kick out. It also didn't seem to play
nice right away with a custom DNS.

Now that it's all set up, I couldn't be happier with the purchase! This
will definitely be a staple in our technological life for a long time.

Photo by [securedgenet](https://flic.kr/p/8SPDvN)


text:
# Elm Surround [WIP]

Opinionated `([{` surrounded new lines indentation for Elm in Sublime Text.

<img src="https://media.giphy.com/media/ju0nXIaq2Ef9PHdeXB/giphy.gif" width="150" />

## Install

At the moment, download those files into your Package/User directory:

- Add surrounded line.sublime-macro
- Default.sublime-keymap

repository: Warry/Elm-Surround

repo_name: Warry/Elm-Surround


text:
# Express.js
#### is a web application framework for Node.js, released as free and open-source software under the MIT License. It is designed for building web applications and APIs. It has been called the de facto standard server framework for Node.js.
## Express and middleware
### Express is a framework based on middleware, which are application modules each providing a specific feature. You can decide which middleware you want to load.
#### Express comes with over 15 basic pieces of middleware, and of course developers can add others via NPM. Each piece of middleware provides a micro-feature. Here are a few examples:
* compression: enables for gzip compression of pages for faster sending to the server.
* cookie-parser: allows you to work with cookies.
* cookie-session: allows you to generate session information (during a visitor’s stay on the website).
* serve-static: allows the return of static files contained in a folder (images, files to download, etc).
* serve-favicon: manages your website's favicon.
* csrf: provides protection against CSRF faults.
* etc.

**All these middleware offer micro-features: some of them are really small, like "serve-favicon" for example.**
**These pieces of middleware are interconnected and can communicate with each other. Express simply adds the routes and views above the whole thing.**

All these pieces of middleware communicate with each other by sending up to 4 settings:
* err: errors.
* req: the visitor’s request.
* res: a response to return (the HTML page and the header information).
* next: a callback to the next function to be called.

### Summing up:
* Express.js is a micro-framework for Node.js. The most common tasks are therefore greatly simplified.
* Express specifically allows the simple management of routes (the different URLs accepted by your app).
* Express provides a bridge between template engines (such as EJS). These allow us to separate occupational code (backend) from HTML code (frontend). This spells the end for lengthywrite()  calls.
* Express is based on middleware, which are mini-layer applications that offer features such as sessions, gzip page compression, cookie handling, etc.

![image](https://i1.wp.com/barreto.io/wp-content/uploads/2018/03/maxresdefault-banner.jpg?w=1740)


text:
# ember-cli-bootstrap-breakpoints

Expose Bootstrap breakpoints as Controller property in Ember

## Addon Install

    ember install:addon

## Using

Add `{{bootstrap-breakpoints}}` to application.hbs.

This captures the browser resize event and sets the property `bootstrapBreakpoint` in ApplicationController. `bootstrapBreakpoint` will contain one of `lg`, `md`, `sm`, `xs`, which can then be used in computed properties and such within the Ember app.

## License
[Unlicense](http://unlicense.org/)

license: Unlicense