text:
# `react-devtools`

This package can be used to debug non-browser-based React applications (e.g. React Native, mobile browser or embedded webview, Safari).

![React DevTools screenshot](https://user-images.githubusercontent.com/29597/63811956-bdd9b580-c8dd-11e9-8962-c568e475c425.png)

## Installation
Install the `react-devtools` package. Because this is a development tool, a global install is often the most convenient:
```sh
# Yarn
yarn global add react-devtools

# NPM
npm install -g react-devtools
```

If you prefer to avoid global installations, you can add `react-devtools` as a project dependency. With Yarn, you can do this by running:
```sh
yarn add --dev react-devtools
```

With NPM you can just use [NPX](https://www.npmjs.com/package/npx):
```sh
npx react-devtools
```

## Usage with React Native
Run `react-devtools` from the terminal to launch the standalone DevTools app:
```sh
react-devtools
```

If you're not using a local simulator, you'll also need to forward ports used by React DevTools:
```sh
adb reverse tcp:8097 tcp:8097
```

If you're using React Native 0.43 or higher, it should connect to your simulator within a few seconds. (If this doesn't happen automatically, try reloading the React Native app.)

### Integration with React Native Inspector

You can open the [in-app developer menu](https://reactnative.dev/docs/debugging#accessing-the-in-app-developer-menu) and choose "Show Inspector". It will bring up an overlay that lets you tap on any UI element and see information about it:

![React Native Inspector](https://i.imgur.com/ReFhREb.gif)

However, when `react-devtools` is running, Inspector will enter a special collapsed mode, and instead use the DevTools as primary UI. In this mode, clicking on something in the simulator will bring up the relevant components in the DevTools:

![React DevTools Inspector Integration](https://user-images.githubusercontent.com/29597/63811958-be724c00-c8dd-11e9-8587-37357334a0e1.gif)

You can choose "Hide Inspector" in the same menu to exit this mode.

### Inspecting Component Instances

When debugging JavaScript in Chrome, you can inspect the props and state of the React components in the browser console.

First, follow the [instructions for debugging in Chrome](https://reactnative.dev/docs/debugging#chrome-developer-tools) to open the Chrome console.

Make sure that the dropdown in the top left corner of the Chrome console says `debuggerWorker.js`. **This step is essential.**

Then select a React component in React DevTools. There is a search box at the top that helps you find one by name. As soon as you select it, it will be available as `$r` in the Chrome console, letting you inspect its props, state, and instance properties.

![React DevTools Chrome Console Integration](https://user-images.githubusercontent.com/29597/63811957-be724c00-c8dd-11e9-9d1d-8eba440ef948.gif)

## Usage with React DOM

The standalone shell can also be useful with React DOM (e.g. to debug apps in Safari or inside of an iframe).

Run `react-devtools` from the terminal to launch the standalone DevTools app:
```sh
react-devtools
```

Add `<script src="http://localhost:8097"></script>` as the very first `<script>` tag in the `<head>` of your page when developing:

```html
<!doctype html>
<html lang="en">
  <head>
    <script src="http://localhost:8097"></script>
```

This will ensure the developer tools are connected. **Don’t forget to remove it before deploying to production!**

>If you install `react-devtools` as a project dependency, you may also replace the `<script>` suggested above with a JavaScript import (`import 'react-devtools'`). It is important that this import comes before any other imports in your app (especially before `react-dom`). Make sure to remove the import before deploying to production, as it carries a large DevTools client with it. If you use Webpack and have control over its configuration, you could alternatively add `'react-devtools'` as the first item in the `entry` array of the development-only configuration, and then you wouldn’t need to deal either with `<script>` tags or `import` statements.

## Advanced

By default DevTools listen to port `8097` on `localhost`. If you need to customize host, port, or other settings, see the `react-devtools-core` package instead.

## FAQ

### The React Tab Doesn't Show Up

**If you are running your app from a local `file://` URL**, don't forget to check "Allow access to file URLs" on the Chrome Extensions settings page. You can find it by opening Settings > Extensions:

![Allow access to file URLs](https://user-images.githubusercontent.com/29597/64646784-95b58080-d3cc-11e9-943d-02474683398a.png)

Or you could develop with a local HTTP server like [`serve`](https://www.npmjs.com/package/serve).

**The React tab won't show up if the site doesn't use React**, or if React can't communicate with the devtools. When the page loads, the devtools sets a global named `__REACT_DEVTOOLS_GLOBAL_HOOK__`, then React communicates with that hook during initialization. You can test this on the [React website](https://reactjs.org/) or by inspecting [Facebook](https://www.facebook.com/).

**If your app is inside of CodePen**, make sure you are registered. Then press Fork (if it's not your pen), and then choose Change View > Debug. The Debug view is inspectable with DevTools because it doesn't use an iframe.

**If your app is inside an iframe, a Chrome extension, React Native, or in another unusual environment**, try [the standalone version instead](https://github.com/facebook/react/tree/main/packages/react-devtools). Chrome apps are currently not inspectable.

**If your Components tab is empty, refer to "The React tab shows no components" section below**.

**If you still have issues** please [report them](https://github.com/facebook/react/issues/new?labels=Component:%20Developer%20Tools). Don't forget to specify your OS, browser version, extension version, and the exact instructions to reproduce the issue with a screenshot.

### The React tab shows no components

#### The Issue with Chrome v101 and earlier
As we migrate to a Chrome Extension Manifest V3, we start to use a new method to hook the DevTools with the inspected page. This new method is more secure, but relies on a new API that's only supported in Chrome v102+. For Chrome v101 or earlier, we use a fallback method, which can cause malfunctions (e.g. failure to load React Elements in the Components tab) if the JS resources on your page is loaded from cache. Please upgrade to Chrome v102+ to avoid this issue.

#### Service Worker malfunction
Go to chrome://extensions. If you see "service worker (inactive)" in the React Developer Tools extension, try disabling and re-enabling the extension. This will restart the service worker. Then go to the page you want to inspect, close the DevTools, and reload the page. Open the DevTools again and the React components tab should be working.

## Local development
The standalone DevTools app can be built and tested from source following the instructions below.

### Prerequisite steps
DevTools depends on local versions of several NPM packages1 also in this workspace. You'll need to either build or download those packages first.

1 Note that at this time, an _experimental_ build is required because DevTools depends on the `createRoot` API.

#### Build from source
To build dependencies from source, run the following command from the root of the repository:
```sh
yarn build-for-devtools
```
#### Download from CI
To use the latest build from CI, run the following command from the root of the repository:
```sh
./scripts/release/download-experimental-build.js
```
### Build steps
You can test the standalone DevTools by running the following:

* **First, complete the prerequisite steps above! If you don't do it, none of the steps below will work.**
* Then, run `yarn start:backend` and `yarn start:standalone` in `packages/react-devtools-core`
* Run `yarn start` in `packages/react-devtools`
* Refresh the app after it has recompiled a change
* For React Native, copy `react-devtools-core` to its `node_modules` to test your changes.

repository: facebook/react

repo_name: facebook/react


text:
---
title: Workshop and presentations at NARST, AERA, and LAK
author: R package build
date: '2021-04-12'
slug: workshop-and-presentations-at-narst-aera-and-lak-oh-my
categories: []
tags: []
---

Our research group had a number of presentations at the National Association for Research in Science Teaching (NARST), American Educational Research Association (AERA), and Learning Analytics and Knowledge (LAK) conferences over the past few weeks. Some details on those presentations (and, when pertinent, links to materials) are below. Kudos to students who presented during a very unusual conference seasons. And, thank you to the organizers of each of these for putting them on (again, during an unsual-and difficult-time for a conference).

## NARST

Sorge, S., Kubsch, M., Rosenberg, J. M., & D'Angelo, C. (2021, April). *Rethinking how you understand your data with R*. Workshop carried out at the National Association for Research in Science Teaching.

## AERA

Rosenberg, J. M., Borchers, C., Gibbons, B., Dyer, E. D., Anderson, D. A., & Fischer, C. (2020, April). Don't worry, be happy: A sentment analysis of the #NGSSchat Twitter Symposium community. In M. Rehm. (Chair), *Social opportunity spaces: How social media can inform/shape educational policy processes*. Symposium conducted at the American Educational Research Association Annual Meeting.

**Link to presentation slides: https://docs.google.com/presentation/d/1DrzpaBghKPTV9xxn3zUXtaXzal-K3aLcRQyYTkf9MLI/edit?usp=sharing**

Rosenberg, J. M., Carpenter, J., Michela, E., Sultana, O., McKenna, T. J., Dyer, E. D., & Reid, J. (2021, April). *"Best P.D. out there"? An exploration of the #NGSSchat network on Twitter*. Presentation at the American Educational Research Association Annual Meeting.

**Link to presentation slides: https://docs.google.com/presentation/d/1USoCWwVHemohhOWpxYLMQQZt_FSpeCMermuWYyq9QDY/edit?usp=sharing**

Lishinski, A., Rosenberg, J. M., Sultana, O., Mann, M., & Dunn, J. (2021, April). *A text messaging–based experience sampling method study of students' interest in introductory computer science*. Presentation at the American Educational Research Association Annual Meeting.

**Link to presentation slides: https://docs.google.com/presentation/d/1a6ptKw-8QAkUALaBdtVTJF4JKtZ5kUPPZPYdDoz3snI/edit?usp=sharing**

Michela, E., Rosenberg, J. M., Sultana, O., Burchfield, M., Thomas, T., & Kimmons, R. (2021, April). *“Life will eventually get back to normal”: School districts’ Twitter use in response to COVID-19*. Poster presentation at the American Educational Research Association Annual Meeting.

**Link to poster presentation: https://aera21-aera.ipostersessions.com/Default.aspx?s=6A-56-78-CB-DE-97-46-62-F2-06-0C-DB-60-07-A6-98**

Lawson, M. A., Rosenberg, J. M., & Herrick, I. (2021, April). *Better together: Supporting and understanding preservice teacher (PST) sense-making about STEM*. Presentation at the American Educational Research Association Annual Meeting.

Kellogg, S., Jiang, S., Rosenberg, J. M., & Moore, R. (2021, April). Learning Analytics in STEM Education Research (LASER) Institute. In F. J. Levine & G. L. Wimberly (Chairs), *Building capacity in STEM education research: A discussion with directors of the NSF institutes in research methods*. Symposium at the American Educational Research Association Annual Meeting.

## LAK

Rosenberg, J. M., & Nguyen, H. (2021). How K-12 school districts communicated during the COVID-19 pandemic: A study using Facebook data. In Dowell, N., Joksimovic, S., Scheffel, M., & Siemens, G. (Eds.), *Proceedings of the 11th International Conference on Learning Analytics & Knowledge (LAK21)*. Association for Computing Machinery.

**Link to proceedings publication: https://joshuamrosenberg.com/post-prints/LAK-21-Rosenberg-Staudt-Willet-Networks-Workshop-published.pdf**

Rosenberg, J. M., & Staudt Willet, K. B. (2021). Advancing social influence models in learning analytics. *Companion Proceedings 11th International Conference on Learning Analytics & Knowledge (LAK21)*.

**Link to workshop presentation slides: https://docs.google.com/presentation/d/1WdCSZ4f2XRJaPyylicf9S4KUl-3xoUocamIg1_AtTmU/edit?usp=sharing**

**Link to proceedings publication: https://joshuamrosenberg.com/post-prints/LAK21-Rosenberg-Nguyen-Districts-Facebook-published.pdf**

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
# MobX Counter

A counter example for MobX.

## Getting Started

Details: https://mobx.pub/examples/counter

* [store](lib/counter.dart)
    * it contains the definition of `observables` & `actions`.
* [observer](lib/main.dart)

repository: windsuzu/Flutterpedia

gha_language: Dart

gha_license_id: MIT

repo_name: windsuzu/Flutterpedia


text:
# SlackWebhookGateway

**Warning: This is work in progress**

Based on Swift Zewo and SlackKit from Peter Zignego this project create a gateway between the Slack WebSocket interface and the KituraBotSlack channel (https://github.com/JacopoMangiavacchi/KituraBotSlack) for the KituraBot framework (https://github.com/JacopoMangiavacchi/KituraBot)

repository: JacopoMangiavacchi/SlackWebhookGateway

repo_name: JacopoMangiavacchi/SlackWebhookGateway


text:
# Udacity Self-Driving Car Engineer Nanodegree

## Advance Lane Finding - Project 2

The goals / steps of this project are the following:

* Compute the camera calibration matrix and distortion coefficients given a set of chessboard images.
* Apply a distortion correction to raw images.
* Use color transforms, gradients, etc., to create a thresholded binary image.
* Apply a perspective transform to rectify binary image ("birds-eye view").
* Detect lane pixels and fit to find the lane boundary.
* Determine the curvature of the lane and vehicle position with respect to center.
* Warp the detected lane boundaries back onto the original image.
* Output visual display of the lane boundaries and numerical estimation of lane curvature and vehicle position.

[video](result-Copy1.mp4)

## Correct the Distortion:

Lets remove distortion from the images using camera calibration matrix and distortion coefficients using chessboard

In this exercise, you'll use the OpenCV functions findChessboardCorners() and drawChessboardCorners() to automatically find and draw corners in an image of a chessboard pattern,
```python
nx = 6
ny = 9

objp = np.zeros((nx*ny,3), np.float32)
objp[:,:2] = np.mgrid[0:9, 0:6].T.reshape(-1,2)

objpoints = [] # 3d points in real world space
imgpoints = [] # 2d points in image plane.

fnames = glob.glob('camera_cal/calibration*.jpg')

for fname in fnames:
    img = cv2.imread(fname)
    gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

    # Finding the chessboard corners
    ret, corners = cv2.findChessboardCorners(gray, (9,6), None)

    # If found, add object points, image points
    if ret == True:
        objpoints.append(objp)
        imgpoints.append(corners)

        # Draw and display the corners
        cv2.drawChessboardCorners(img, (9,6), corners, ret)
        f, (ax1, ax2) = plt.subplots(1, 2, figsize=(8,4))
        ax1.imshow(cv2.cvtColor(mpimg.imread(fname), cv2.COLOR_BGR2RGB))
        ax1.set_title('Original Image', fontsize=18)
        ax2.imshow(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))
        ax2.set_title('Image With Corners', fontsize=18)

```

![png](output_3_0.png)

![png](output_3_1.png)

## Remove distortion from images
There are two main steps to this process: use chessboard images to obtain image points and object points, and then use the OpenCV functions cv2.calibrateCamera() and cv2.undistort() to remove distortion from highway driving images

If you look around the edges of both original and undistorted images, you will observe that distortion is removed from original images

[png](output_4_0.png)

![png](output_4_1.png)

## Now lest perfrom the perspective transformation:

A perspective transform maps the points in a given image to different, desired, image points with a new perspective. The perspective transform you’ll be most interested in is a bird’s-eye view transform that let’s us view a lane from above; this will be useful for calculating the lane curvature later on.

Here we apply a perspective transform, choosing four source points manually

src = np.float32([[490, 482],[810, 482],
                 [1300, 720],[40, 720]])
dst = np.float32([[0, 0], [1280, 0],

I used cv2.getPerspectiveTransform() to get M, the transform matrix
M = cv2.getPerspectiveTransform(src, dst)

And the I used cv2.warpPerspective() to apply M and warp your image to a top-down view
warped = cv2.warpPerspective(undist, M, img_size)

```python
def birds_eye_view(img, display=True, read = True):
    if read:
        undist = undistort(img, show = False)
    else:
        undist = undistort(img, show = False, read=False)
    img_size = (undist.shape[1], undist.shape[0])
    offset = 0
    src = np.float32([[490, 482],[810, 482],
                      [1300, 720],[40, 720]])
    dst = np.float32([[0, 0], [1280, 0],
                     [1300, 720],[40, 720]])
    M = cv2.getPerspectiveTransform(src, dst)
    warped = cv2.warpPerspective(undist, M, img_size)
    if display:
        f, (ax1, ax2) = plt.subplots(1, 2, figsize=(9, 6))
        f.tight_layout()
        ax1.imshow(cv2.cvtColor(undist, cv2.COLOR_BGR2RGB))
        ax1.set_title('Undistorted Image', fontsize=20)
        ax2.imshow(cv2.cvtColor(warped, cv2.COLOR_BGR2RGB))
        ax2.set_title('Undistorted and Warped Image', fontsize=20)
        plt.subplots_adjust(left=0., right=1, top=0.9, bottom=0.)
    else:
        return warped, M

for image in glob.glob('test_images/test*.jpg'):
    birds_eye_view(image)
```

![png](output_5_0.png)

![png](output_5_1.png)

## Lets see what happend when we apply Binary Thresholds

Here we try to apply different color space and identify which provides better lane lines and ignore the onces which give some noise

Used S channel from HLS color space

Used L channel from LUV color space

Used B channel from Lab color space

Create combination binary threshold which best highlights lane lines

```python
def apply_thresholds(image, show=True):
    img, M = birds_eye_view(image, display = False)

    s_channel = cv2.cvtColor(img, cv2.COLOR_BGR2HLS)[:,:,2]
    l_channel = cv2.cvtColor(img, cv2.COLOR_BGR2LUV)[:,:,0]
    b_channel = cv2.cvtColor(img, cv2.COLOR_BGR2Lab)[:,:,2]

    # Threshold color channel
    s_thresh_min = 185
    s_thresh_max = 255
    s_binary = np.zeros_like(s_channel)
    s_binary[(s_channel >= s_thresh_min) & (s_channel <= s_thresh_max)] = 1

    b_thresh_min = 150
    b_thresh_max = 200
    b_binary = np.zeros_like(b_channel)
    b_binary[(b_channel >= b_thresh_min) & (b_channel <= b_thresh_max)] = 1

    l_thresh_min = 225
    l_thresh_max = 255
    l_binary = np.zeros_like(l_channel)
    l_binary[(l_channel >= l_thresh_min) & (l_channel <= l_thresh_max)] = 1

    #color_binary = np.dstack((u_binary, s_binary, l_binary))

    combined_binary = np.zeros_like(s_binary)
    combined_binary[(l_binary == 1) | (b_binary == 1)] = 1

for image in glob.glob('test_images/test*.jpg'):
    apply_thresholds(image)
```

![png](output_6_0.png)

![png](output_6_1.png)

![png](output_6_2.png)

![png](output_6_3.png)

![png](output_6_4.png)

![png](output_6_5.png)

## After finding combination of the binary threshold which gives the best result, lets try to Fit a polynomial to the lane line and find vehicle position and Radius of Curvature

### I used following steps to achieve this:
#### Line Finding Method: Peaks in a Histogram and finding the non-zero pixels around peaks using numpy.nonzero()
#### Fit the polynomial to the lane numpy.polyfit()
#### For each lane line measure radius of curvature
```python

    ym_per_pix = 30/720 # meters per pixel in y dimension
    xm_per_pix = 3.7/700 # meteres per pixel in x dimension
    left_fit_cr = np.polyfit(lefty*ym_per_pix, leftx*xm_per_pix, 2)
    right_fit_cr = np.polyfit(righty*ym_per_pix, rightx*xm_per_pix, 2)
    left_curverad = ((1 + (2*left_fit_cr[0]*np.max(lefty) + left_fit_cr[1])**2)**1.5) \
                                 /np.absolute(2*left_fit_cr[0])
    right_curverad = ((1 + (2*right_fit_cr[0]*np.max(lefty) + right_fit_cr[1])**2)**1.5) \
                                    /np.absolute(2*right_fit_cr[0])

```
#### Calculate the position of the vehicle
```python
    center = abs(640 - ((rightx_int+leftx_int)/2))

    offset = 0
    img_size = (img.shape[1], img.shape[0])
    src = np.float32([[490, 482],[810, 482],
                      [1300, 720],[40, 720]])
    dst = np.float32([[0, 0], [1280, 0],
                     [1300, 720],[40, 720]])
    Minv = cv2.getPerspectiveTransform(dst, src)

for image in glob.glob('test_images/test*.jpg'):
    fill_lane_lines(image)

```
I implemented this step in lines`fill_lane_lines()`.  Here is an example of my result on a test image:

![png](output_7_0.png)

![png](output_7_1.png)

Now we have estimation of radius of curvature and position of the vehicle

## Lets create function process_video() which will process video frame by frame:
We cobine all the above code blocks with all averaging and fallback concepts. *Process_video()* is the final pipeline: Cell #108, `P2 - Advance Lane Finding Project.ipynd`

Here is [link to my video result](https://www.youtube.com/watch?v=pbDZBV0_m4M) You will be redirected to YouTube.

```python
Left = Line()
Right = Line()
video_output = 'result.mp4'
clip1 = VideoFileClip("project_video.mp4").subclip(0,5)
white_clip = clip1.fl_image(process_video)
white_clip.write_videofile(video_output, audio=False)
```

## discussing problems / Issues I faced in implementation of this project

#### Gradient & Color Thresholding
* Time consuming experiment with gradient and color channnel thresholding.
* In challenge video when car drives under the bridge it was difficult to find the lane lines
* Detecting lane lines in harder challenge was extremely hard as there were constant curves, fadeness, Shadow

#### Bad Frames
* The challenge video has a section where the car goes underneath a tunnel and no lanes are detected
* To tackle this I had to resort to averaging over the well detected frames

##### Points of failure & Areas of Improvement
The pipeline seems to fail to detect lane lines for the harder challenge video due to frame rate, shahdow, sharp curves.

#### Improvement:
I would take a smaller section to take the transform to take a better perspective transform
I would average over a smaller number of frames.

Additional option Challenge video: The pipeline did prity good job in detecting lane lines even though it having some hard time when car passed under a bridge or throught tunnel
Here's the [link to my video Challenge output video](https://www.youtube.com/watch?v=xzmUQdYRtc0) You will be redirected to YouTube.

```python
Left = Line()P2 - Advance Lane Finding Project

Right = Line()
challenge_output = 'challenge_video_output.mp4'
clip1 = VideoFileClip("challenge_video.mp4")
challenge_clip = clip1.fl_image(process_video)
challenge_clip.write_videofile(challenge_output, audio=False)
```

url: https://raw.githubusercontent.com/vrajp29/CarND-Advanced-Lane-Lines-P2/4f1678589a61ffe9a1c04492468169b05fb9d144/writeup/Advance Lane Finding Project 2.md

filename: Advance Lane Finding Project 2.md


text:
# mailXpert PHP SDK for API V2.0

This library allows you to easily manipulate the mailXpert API V2.0.

NOTE: This library is still considered as in alpha release. Although it is meant to be light and there is no plan for big changes in it, be careful if planned to use in production environment.

[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/mailXpert/mailxpert-php-sdk/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/mailXpert/mailxpert-php-sdk/?branch=master)

## Installation

Install this package with composer:

```bash
composer require mailxpert/php-sdk
```

## Usage

You can check the ```examples/``` folders.

### Initialisation

The basic usage is the following:

```php
$mailxpert = new Mailxpert([
    'app_id' => $appId,
    'app_secret' => $appSecret
]);
```

### Show the "Login with mailXpert" button

```php
<a href="<?php echo $mailxpert->getLoginHelper()->getLoginUrl($redirectUrl); ?>">Login with mailXpert</a>
```

### Retrieve the access token from the code

```php
if (isset($_REQUEST['code'])) {
    $accessToken = $mailxpert->getLoginHelper()->getAccessToken($redirectUrl);
}
```

### Do a query with the access token

```php
$data = json_decode($mailxpert->sendRequest('GET','/contact_lists',[], $accessToken), true);
$contactLists = $data['data'];
```

Note: You can also set the access token for all your requests:

```php
$mailxpert->setAccessToken($access_token);
```

and then you can do any call like this:

```php
$mailxpert->sendRequest('GET','/contact_lists');
```

## Support

Made by ARTACK WebLab GmbH. Feel free to contribute or submit issues.

-- Inspired from Facebook PHP SDK 4.0 [https://github.com/facebook/facebook-php-sdk-v4](https://github.com/facebook/facebook-php-sdk-v4) --

repository: mailXpert/mailxpert-php-sdk

gha_language: PHP

gha_license_id: NOASSERTION

repo_name: mailXpert/mailxpert-php-sdk


text:
# syno-tools

This is a collection of few scripts/configurations/tools for my Synology NAS, although they could be used for almost any linux machine.

A list of various things in here is below.

# flexget

Configuration to track movies added in a watchlist on trakt.tv and then download them automatically when a good enough release is available and send a notification over join.

# syno-dl

A minimal shell script to add downloads to Synology Download station through command line locally or remotely

# ass2srt

A script to extract ass/ssa subtitles embedded in an mkv file (usually anime) and convert them into srt subtitles so that some clients like TVs/Roku etc could display them properly.

repository: shantanugoel/syno-tools

repo_name: shantanugoel/syno-tools


text:
# Deploy StorageOS for OpenShift 3.7

> This playbook is not actively maintained.

Deploy a StorageOS container on all your cluster nodes and connects OpenShift to them.

OpenShift 3.9 and forward enable the MountPropagation feature gate. The current installation of the playbook is for OpenShift 3.7. Because of that, this installation can't use DaemonSets to run StorageOS

To install StorageOS in OpenShift 3.9+ follow the [documentation](https://docs.storageos.com/docs/install/openshift/).

## Hosts
Set the `storageos` section in your hosts file as defined in `./hosts.example`. Mind that the playbook looks for
the variable `openshift_ip`.

## Install
```
ansible-playbook -i hosts.example site.yaml
```

## OpenShift interface

The `openshift_interface` role in `site.yaml` is set to run in the group masters. However, it should
be run in one node as it creates an storageclass and secret using the `oc` cli tool. Executing more
than once will only result in the cli notifing that the resource already exists. In case of
multimaster configuration, change that role to run in one node only. Otherwise, you can run that task in your own
client, where oc as system:admin is available.

repository: storageos/deploy

gha_language: Shell

repo_name: storageos/deploy


text:
# Model Documentation - Reflection

This document is provided to meet the last rubric criteria. It's supposed to explain how the path finding works. The trajectory generation principle is adopted from the lecture video. It is basically extended by the function `stateMachine()` that decides which lane to take and how to adjust the speed.

## Trajectory generation

The trajectory generator from the class puts the current cars localization data and the previous step in a vector. based on the map_waypoints ahead it generates three new waypoints ahead and also packs them into the vector. These points are used to fit a spline. After that a target point on the spline is defined. 50 points in between are shifted in the right coordinate system and then passed to the simualtor as points to drive to.

## The state machine function

Up until line 82 in `sensor_fusion()` the distance to the car ahead is calculated. This is done by filtering the vehicles in the vector, so that there are only the ones left that are in the same lane and ahead. To prevent it "locking on" to a car that is further ahead there is a check for the car that is the nearest.

In a similar way there are checks for cars in the lane to the right or to the left (line 87 to 118). We then set flags `left_possible` and `right_possible` if it is possible to change lanes based on the current lane (can't go left if you are on lane 0 for example).

Now, we define the states for our state machine and put in the logic when to change states.
```c++
enum state {HOLD_LANE, KEEP_DISTANCE, CHANGE_LEFT, CHANGE_RIGHT};

state CurrentState;
  if(car_in_front){
    CurrentState = KEEP_DISTANCE;
  }
  else{
    CurrentState = HOLD_LANE;
  }

timestamp+=1;
if(left_possible && timestamp>100 && car_in_front){
  CurrentState = CHANGE_LEFT;
}
else if(right_possible && timestamp>100 && car_in_front){
  CurrentState = CHANGE_RIGHT;
}
```

Basically, if we have a car in front of us we go into the KEEP_DISTANCE state where we manage the distance. If the other lanes are free, we will engage a lane change. To slow down erratic lane changing we allow a lane change every 100 "timestamps" (loops). The behaviour for the state is defined using a switch construct.

```c++
switch (CurrentState) {

  case HOLD_LANE:
    //accelerate if too slow
    if(ref_vel < 49.5){
      ref_vel += 0.224;
    }
    break;

  case KEEP_DISTANCE:

    k = 0.2;
    // calculate vref based on distance
    ref_vel = 49.5 * k*acc_dist/(1 + abs(k* acc_dist));
    // dont let speed be negative
    if(ref_vel<=0){
      ref_vel = 0;
    }
    //sanity check
    if(ref_vel>49.5){
      ref_vel = 49.5;
    }

    acc_current = ref_vel_alt-ref_vel;
    //override ref_vel and brake with maximum allowed negative accerlation if
    //there is a sudden decrease in distance
    if(acc_current>0.224){
      ref_vel =ref_vel_alt - 0.224;
    }
    // also limit positive acceleration
    else if(acc_current<0.224){
      ref_vel =ref_vel_alt + 0.224;
    }
    break;

  case CHANGE_LEFT:

    lane -=1;
    timestamp = 0;
  break;

  case CHANGE_RIGHT:

    lane +=1;
    timestamp = 0;

  break;
}
```
The HOLD_LANE state is defined by a acceleration to the maximum allowed speed. The KEEP_DISTANCE state calculates a velocity reference as a function of the distance to the car in front. To counter sudden changes in acceleration if a car merges before or the car in front leaves the lane, we limit the accerlation if the function outputs an acceleration that is too high. Both states left either increase or decrease the lane index and reset the timestamp. Lane index and reference speed are then passed back to the trajectory generating algorithm.

repository: sadownik/path-planner

path: /Model Documentation.md

filename: Model Documentation.md

repo_name: sadownik/path-planner


text:
# Building Documentation
## Building locally:

#### [Build and install RAFT](source/build.md)

#### Generate the docs
```shell script
bash build.sh docs
```

#### Once the process finishes, documentation can be found in build/html
```shell script
xdg-open build/html/index.html`
```

repository: rapidsai/raft

gha_language: Cuda

repo_name: rapidsai/raft


text:
# *News*

# tidycells 0.1.9 _(2019-08-12)_

## New Features

* Added `collate_columns` to collate attribute-columns having similar content.

# tidycells 0.1.0 _(2019-07-25)_

## Initial Public Release

* Initial Release to GitHub
* Prior to this it was private package

repository: j-johanness/tidycells

repo_name: j-johanness/tidycells


text:
# CanvasSync
Synchronise files located on a Canvas by Instructure web server to your local computer.

Description
-----------
CanvasSync helps students automatically synchronize files located on their institutions Canvas web server
to their local computer. It traverses the folder hierarchy in Canvas from the top course level down to individual
files and creates a similar folder structure on the local computer:

![alt tag](https://cloud.githubusercontent.com/assets/12041524/22702853/63eaa498-ed62-11e6-9227-de5823cb39c6.png)

CanvasSync uses the Canvas LMS API (https://canvas.instructure.com/doc/api/) to pull resources on a Canvas server. In
order to authenticate as the user an authentication token must be generated on the Canvas web server. This is done by
going to 'Account' followed by 'Settings'. Near the bottom under the 'Approved integrations' section new authentication
tokens may be generated. A token is a substitution to the familiar username-password based authentication and allows
3rd party applications like CanvasSync to authenticate with the Canvas server API and pull resources. Please note that
by supplying an authentication token to the CanvasSync software, you allow it to communicate with the Canvas server on
your behalf, see Disclaimer below.

The process of generating a token is illustrated below:

![alt tag](https://cloud.githubusercontent.com/assets/12041524/22701027/c25ccbd8-ed5c-11e6-9ace-c8687e124bc8.png)

During the initial launch of CanvasSync the user must specify various settings:

* A path to a folder to which synchronization will occur. Note that the path should also include a sub-folder name. Example:
If you wish to sync to a folder called Canvas on the Desktop, write "~/Desktop/Canvas" (without creating the folder 'Canvas' beforehand)
* The Canvas web server domain
* The authentication token generated as illustrated above.

These settings will be stored in an encrypted local file to keep the authentication token secure. Consequently, the user must
specify a password that must also be supplied whenever CanvasSync is launched to synchronize at a later time.

Usage examples
--------------
CanvasSync is launched by pointing the Python (version 2.7) interpreter to either the CanvasSync main folder
or the \_\_main\_\_.py file located at ../CanvasSync/\_\_main\_\_.py
```
python /path/to/CanvasSync
```
* NOTE that it is important that the main folder is not renamed, it must be named 'CanvasSync'.

When launched without commandline arguments, CanvasSync will start synchronizing with previously specified settings or
prompt the user to enter new settings if no previous settings could be found.

Command line arguments:
-i or --info will display the currently saved settings
-s or --setup will prompt the user to reinitialize settings
-h or --help will show the help screen

Requirements
------------
The CanvasSync module has the following dependencies:

- Requests  (http://docs.python-requests.org/en/master/)
- PyCrypto  (https://pypi.python.org/pypi/pycrypto)
- py-bcrypt (http://www.mindrot.org/projects/py-bcrypt/)

Using PIP the latest versions may be installed by executing the following command from within the CanvasSync folder:
```
pip install -r requirements.txt
```

Disclaimer
----------
Please note that by using CanvasSync the user allows the software to authenticate with the Canvas server on the users
behalf. CanvasSync stores the authentication key encrypted and locally and the key is never shared with 3rd parties.
The official version of CanvasSync will only pull resources from the server and never remove or modify resources on the
server. Modified/rogue versions of the software could however use the authentication token to remove or modify
resources that the user has access to on the server on the users behalf.

CanvasSync is still in its early version and is not guaranteed to be stable.

Use this software on your own risk :-)

Additional resources
--------------------
https://www.instructure.com
https://canvas.instructure.com/doc/api/index.html

repository: antortjim/CanvasSync

repo_name: antortjim/CanvasSync


text:
# Introduction
A player elimination dynamic occurs whenever a player is effectively removed from the game while
other players continue to play it. Generally, this occurs when a player has no more legal actions
and there is no mechanic by which they will regain legal actions.

Player elimination is not necessarily bad, as it can hasten the end-game and generally simplifies
the complexity of the strategies of the remaining players. However, it generally contributes
negatively to a [fellowship aesthetic](/games/aesthetics/fellowship), because the eliminated player
is no longer enjoying the group activity.

Some games also have voluntary self-elimination. Mechanics allowing for this account for the
possibility that players may leave the game, and are usually intended to allow the remaining players
to not feel the game has been "ruined" by the departure of one of the players.

repository: jpawlicki/ruleshaus

repo_name: jpawlicki/ruleshaus


text:
# Mycroft Precise Trainer

Semi-automated scripts for training a custom wake word for [Mycroft Precise](https://github.com/MycroftAI/mycroft-precise) using synthetic data from multiple text to speech systems.

## Text to Speech

Uses an [OpenTTS server](https://github.com/synesthesiam/opentts) for text to speech samples. These samples are manipulated using [sox](http://sox.sourceforge.net) to add noise, change tempo/pitch, etc.

The following text to speech systems are available through [OpenTTS](https://github.com/synesthesiam/opentts):

* [eSpeak](http://espeak.sourceforge.net)
* [flite](http://www.festvox.org/flite)
* [Festival](http://www.cstr.ed.ac.uk/projects/festival/)
* [nanoTTS](https://github.com/gmn/nanotts)
* [MaryTTS](http://mary.dfki.de)
* [Mozilla TTS](https://github.com/mozilla/TTS)

## Training Process

Before training, ensure that you have the Mycroft Precise Trainer Docker image downloaded:

```bash
$ docker pull synesthesiam/mycroft-precise-trainer
```

The scripts in `bin/` will reference this Docker image to run `precise-train`, etc.

### Configuration

Training is controlled by the `config.json` file in the top-level directory of the respository.

**NOTE:** All `config.json` directories are relative to the repository root directory.

The available settings are:

* `model_directory` - directory to store Precise models and training data (default: `models`)
* `wake_word`
    * `id` - file system friendly identifier for your wake word (used to name files/directories)
    * `text` - actual words that make up your wake word (e.g., "hey mycroft")
    * `not_wake_words` - list of phrases that are close but **not** the wake word (e.g., "hey microsoft")
* `training`
    * `epochs` - number of initial training epochs (default: 1000)
    * `epochs_incremental` - number of incremental training epochs with random data (default: 1000)
* `testing`
    * `wake_words` - directory with real WAV samples of the wake word
    * `not_wake_words` - datasets to download with negative examples
        * `<dataset name>` - name of dataset (used for download directory)
            * `base_url` - URL prefix of files to download
            * `files` - names of files to download (appended to `base_url`)
* `text_to_speech`
    * `server_url` - URL of [OpenTTS server](https://github.com/synesthesiam/opentts)
    * `voices` - list of TTS voices to use prefixed by TTS name (e.g., `marytts:cmu-slt-hsmm`)
        * Overrides other settings!
    * `tts_names` - list of TTS system names to use (empty = all)
    * `langauges` - list of languages to use (empty = all)
    * `locales` - list of locales to use (empty = all)
    * `genders` - list of genders to use (M/F, empty = all)
* `sound_effects`
    * TODO: describe settings (see example `config.json` for now)
* `random_data`
    * TODO: describe settings (see example `config.json` for now)

## Improvements

There is a lot of room for improvement:

* More audio effects to simulate voices in different types of rooms and places in a room
* Other kinds of noise (e.g., TV show)

Research questions:

* How may TTS samples are actually needed (positive, negative, and testing)?
* Can performance be improved by generating negative examples that sound similar (e.g., "okay raspberry")?
* Does selecting specific voices that sound like the intended user help performance?
* What is the best training process and number of epochs? Should incremental training be alternated?
* Could performance be improved by running a keyword spotter at runtime (e.g., Pocketsphinx) and modulating the chunk probability coming out of the Precise engine?

repository: synesthesiam/mycroft-precise-trainer

repo_name: synesthesiam/mycroft-precise-trainer


text:
# <img src="https://raw.githack.com/FortAwesome/Font-Awesome/master/svgs/solid/briefcase-medical.svg" card_color="#22A7F0" width="50" height="50" style="vertical-align:bottom"/> Not Feeling Good
This skill is just to check data and sense.

## About
In this skill in near future we will connect to all wearable gadzets and fetch users data and will reply with his/her condition.

## Examples
* "I am not feeling {}"
* "I am feeling {}"

## Credits
rohit

## Category
**Daily**
Information
IoT

## Tags
#Ill
#Doctor
#Health
#Hospital

repository: rvdrupal/not-feeling-good-skill

repo_name: rvdrupal/not-feeling-good-skill


text:
---
layout: post
title: "Lessons Learned: AngularJS Pagination"
tags: angularjs data lessons pagination patterns
author: Nick Amoscato
---

Once upon a time, I had an idea to create this all-inclusive pagination service that would abstract the common logic used when interacting with a server-side paginated result set via an AngularJS application. A few whiteboarding sessions with a co-worker led to some informal specifications, and shortly thereafter, a well-documented `apiPaginationService` was born.

At a high level, dependent components would register a pagination instance, specifying any number of configuration options. The service would fetch and cache the relevant page of data, internally keeping track of relevant meta information necessary to interact with the paginated result set. A handful of utility methods were exposed, enabling the interaction with a custom [UI Bootstrap](https://angular-ui.github.io/bootstrap/#/pagination)-wrapped directive. Additional methods attempted to minimize the need to re-fetch data from the server when adding, updating or deleting items from an ordered set. And if that was not enough, scrollable lazy loading and multi-instance pagination were both fully supported.

The service was initially ambitious, and it quickly became unwieldy. The 500+ lines of untested code were simply trying to do too much. I used the service in a handful of contexts, but it was clear that it was not a maintainable solution. Drawing from these missteps, I recently approached this problem from an alternative perspective, abstracting the minimum amount of shared logic into an extremely light utility service. This solution is described below.

## Fetch & Store Data

There were a few major complications with the first approach to this problem related to fetching and storing data.

First, a ton of time was spent attempting to minimize the need to re-fetch data from the server. For example, when deleting an item from the last page of a paginated set, the service would simply splice the relevant item from the array. Similarly, adding an item to a paginated set sorted by descending creation date would unshift the item onto the beginning of the array. Looking back on it, this caching “obsession” was entirely unnecessary; the favorable contexts were extremely specific, and the performance benefits were probably unnoticeable. Not to mention, it increased the risk of users interacting with stale data.

Second, the data was stored in the pagination service itself. This proved to be especially problematic when multiple instances of pagination were registered at the same time; the service had to keep track of multiple states, periodically purging irrelevant cached data. In most cases, pagination would exist in separate features entirely, and the need to maintain multiple states was unnecessary.

As you can probably guess, the new utility service does not cache data, nor does it centrally store any data. Instead, it implements a simple method that _returns_ the necessary metadata to interact with the paginated set. This object is stored in a dependent service immediately after data is fetched from the server.

To illustrate what this looks like, let’s assume we have a [state](http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.$stateProvider#methods_state) that fetches a paginated set of data before it resolves. The module configuration block would look something like this:

{% highlight javascript %}
$stateProvider.state('app.feature', {
    controller: 'FeatureListCtrl',
    controllerAs: 'featureList',
    resolve: {
        featureListResolve: function($stateParams, featureApiService) {
            return featureApiService.fetchList({
                page: $stateParams.page
            });
        }
    },
    templateUrl: 'feature-list.html',
    url: '/feature?page'
});
{% endhighlight %}

The page of the paginated set is determined by a page state parameter which is passed to a method in the `featureApiService`. Any time the page state parameter changes, the state will reinitialize, and the relevant page of data will be fetched.

> In practice, the resolve dependency will probably interact with a [feature service](/2015/08/10/angularjs-patterns/#feature-services). Regardless, the pagination metadata must be stored in the [API service](/2015/08/10/angularjs-patterns/#api-services), which has access to the full [`$http` response object](https://docs.angularjs.org/api/ng/service/$http#general-usage). A feature service is omitted for simplicity.

For the purposes of this example, assume that the API enables the client to specify `page` and `per_page` query string parameters. The `featureApiService` would then look something like this:

{% highlight javascript %}
function FeatureApiService($http, paginationUtilityService) {
    var self = this;

    var _pagination;

    self.fetchList = fetchList;
    self.getPagination = getPagination;

    function fetchList(queryString) {
        if (angular.isUndefined(queryString)) { queryString = {}; }

        if (!queryString.page) { queryString.page = 1; }

        if (!queryString.per_page) { queryString.per_page = 15; }

        $http.get('/feature', {
            params: queryString
        }).then(function(result) {
             _pagination = paginationUtilityService.store(result, queryString);

             return result.data;
        });
    }

    function getPagination() {
        return _pagination;
    }
}
{% endhighlight %}

where `fetchList` takes a query string object passed to a `/feature` endpoint. The method then resolves with the fetched data after storing the relevant pagination metadata in a private variable, exposed via the public `getPagination` method.

Assuming that the response of the paginated endpoint contains a `x-pagination-total-items` header field that specifies the number of total items in the paginated set, the `paginationUtilityService.store` method would look like this:

{% highlight javascript %}
function store(response, queryString) {
    if (angular.isUndefined(queryString)) { queryString = {}; }

    return {
        page: queryString.page || 1,
        perPage: queryString.per_page || 15,
        totalItems: Number(response.headers()['x-pagination-total-items'])
    };
}
{% endhighlight %}

where `response` is the `$http` response object and `queryString` is the same query string object passed to the paginated endpoint.

## Expose Pagination Interface Control

Now that the relevant data has been fetched, we need to enable the user to interact with the paginated set. There is no sense in re-inventing the wheel; for simplicity, it makes sense to leverage [UI Bootstrap’s `pagination` directive](https://angular-ui.github.io/bootstrap/#/pagination). In an effort to abstract shared logic, I have found it beneficial to wrap this third-party component in a custom directive that interacts with the pagination metadata defined above.

First, the `FeatureListCtrl` must expose the relevant data on scope:

{% highlight javascript %}
function FeatureListCtrl(featureApiService, featureListResolve) {
    var self = this;

    self.featurePagination = featureApiService.getPagination();
    self.features = featureListResolve;
}
{% endhighlight %}

Then, the `featurePagination` metadata object can be passed to the custom directive. The latter component looks something like this:

{% highlight javascript %}
function ApiPaginatorDirective($state) {

    return {
        controller: ApiPaginatorDirectiveCtrl,
        controllerAs: 'apiPaginator',
        replace: true,
        restrict: 'E',
        scope: {
            data: '='
        },
        templateUrl: 'apiPaginator.html',
    };

    function ApiPaginatorDirectiveCtrl($scope) {
        var self = this;

        self.hasSubsequentPage = hasSubsequentPage;
        self.pageChangeHandler = pageChangeHandler;

        function hasSubsequentPage() {
            return $scope.data.totalItems > $scope.data.perPage;
        }

        function pageChangeHandler() {
            return $state.go('.', { page: $scope.data.page });
        }
    }
}
{% endhighlight %}

where `data` is a reference to the pagination metadata object, and the directive’s template is as follows:

{% highlight html %}
<div>
    <pagination
        items-per-page="data.perPage"
        ng-change="apiPaginator.pageChangeHandler()"
        ng-model="data.page"
        max-size="5"
        next-text="Next"
        ng-if="apiPaginator.hasSubsequentPage()"
        previous-text="Prev"
        total-items="data.totalItems">
    </pagination>
</div>
{% endhighlight %}

> Note that older versions of this UI Bootstrap directive use `page` and `onSelectPage` parameters in place of `ngModel` and `ngChange` respectively.

The pagination control is only visible when there is more than one page, and changing the page simply transitions to the current state with the specified `page` state parameter value.

## Modifying the Paginated Set

Earlier, I mentioned that the previous pagination approach went through leaps and bounds to optimize performance when adding, updating or deleting items in the paginated set. This client-side logic can get extremely complex; thus, I have found it is best to keep this behavior as simple as possible. As a general rule of thumb, simply [reloading](http://angular-ui.github.io/ui-router/site/#/api/ui.router.state.$state#methods_go) the current state will suffice:

{% highlight javascript %}
$state.go('.', null, { reload: true });
{% endhighlight %}

When an item has a _separate_ state outside the context of the paginated list (i.e. clicking on an item transitions to a view devoted solely to that item), creating or updating an item obviously does not need to affect data that is no longer visible. When the user subsequently views the list, it will be refetched from the server without any complex client-side intervention.

On the other hand, inline editing is certainly more involved given that the paginated set is always visible. Reloading the current state is still a valid option; however, depending on the sort, this could potentially lead to confusing interactions. For example, when sorting by an editable property, modification could move the item onto a different page of the paginated set. This abrupt disappearance could be confusing, and it could be really difficult to figure out which page the item moved to.

The solution largely depends on preference and context, but in the past, I have found it acceptable to simply do nothing after saving an inline edit. In this respect, the item does not move, and any inconsistencies caused by the modification are resolved when the user transitions to another page or revisits the paginated list.

Not surprisingly, deleting an item from the paginated set should also result in reloading the current state. However, there is one edge case worth mentioning that can be addressed: When a user deletes the last item on a page, the paginated set should ideally transition to the previous page if it exists. This logic can easily be abstracted and is illustrated below.

After deleting the specified item, the controller should call a utility method with the pagination metadata. In the context of the `FeatureListCtrl` defined above, this would look something like this:

{% highlight javascript %}
function deleteFeature(featureId) {
    return featureApiService.remove(featureId).then(function() {
        return paginationUtilityService.reloadAfterDeletion(self.featurePagination);
    });
}
{% endhighlight %}

The `paginationUtilityService.reoloadAfterDeletion` method would then be implemented as follows:

{% highlight javascript %}
function reloadAfterDeletion(pagination) {
    var page = pagination.page;

    // If there are no more items on the current page, go to previous page
    if (--pagination.totalItems <= pagination.perPage * (page - 1)) { page--; }

    if (page <= 1) { page = null; }

    return $state.go($state.current, { page: page }, { reload: true });
}
{% endhighlight %}


text:
[![Build Status](https://travis-ci.org/diogoosorio/blog.svg?branch=master)](https://travis-ci.org/diogoosorio/blog)

## Welcome to Diogo's personal blog

My poor attempt of writing a small static blog generator (à la Jekyll). This time the main weapons of choice were Python and Flask.

During this first (quick) iteration, the blog entries are being loaded and parsed from the hard-drive when a request comes in. In the near future, the objective is to have this proccess automatized, whenever a blog entry is edited/added (add a watch operation).

I had three main objectives in mind, developing this:

* To remove the MongoDB dependency that the previous blog version had
* To add a simpler, content centered, responsive design
* To be able to write the entries using Markdown

The three of them were achieved. There are a lot of nice-to-have's that I'd like to add, but one just has so many off-days per week. :)

## Running the blog

To run the blog, do the following:

```bash
cp env.sample .env # edit the secrets present there
docker-compose up -d
```

The http server should be listening on port 4000.

repository: diogoosorio/blog

repo_name: diogoosorio/blog


text:
# Monads for functional programming
(Philip Wadler, University of Glasgow)

Using monads to structure FP programs and model effects found in impure langs.

3 analysed examples: Implementing...
1. Exceptions
2. State (global state)
3. Tracing (generating output)

3 case studies: How monads...
1. ease the modification of a simple evaluator
2. can be used to build parsers
3. act as basis of a datatype of arrays, subject to the in-place updates

```hs
-- Exceptions
type Exception = String
data M a = Raise Exception | Return a
eval :: Term -> M Int

-- State
type State = Int
type M a = State -> (a, State)
eval :: Term -> M Int

-- Tracing
type Trace = String
type M a = (Trace, a)
eval :: Term -> M Int
```

## TOC

<!-- TOC -->

- [TOC](#toc)
- [1. Pure and Impure](#1-pure-and-impure)
- [2. Monadic Framework](#2-monadic-framework)
- [2.1 The Basic Evaluator](#21-the-basic-evaluator)
- [2.2 Variation 1: Exceptions](#22-variation-1-exceptions)
- [2.3 Variation 2: State](#23-variation-2-state)
- [2.4 Variation 3: Output](#24-variation-3-output)
- [2.5 A monadic evaluator](#25-a-monadic-evaluator)
  - [Evaluator in terms of these abstractions](#evaluator-in-terms-of-these-abstractions)
- [2.6 Variation zero, revisited: The basic evaluator, v.0.1.1](#26-variation-zero-revisited-the-basic-evaluator-v011)
- [2.7 Variation one, revisited: Exceptions, v.1.1](#27-variation-one-revisited-exceptions-v11)

<!-- /TOC -->

<!-- #region -->

## 1. Pure and Impure

Functional Programming Languages (FP) are split into two schools:

*Pure FP (pFP)*
- pure and simple Lambda Calculi (Miranda and Haskell)
- the most expressive languages
- benefit from lazy evaluation (infinite types, computation savings, etc.)
- easier to reason about

*Impure FP (iFP)*
- impure languages with effects (Scheme and SML)
- augment Lambda Calculus with effects (assignment, exceptions, continuations)
- offer better performance

Advances in theoretical CS, in *type theory* and *category theory*, have discovered a way to integrate the benefits of both schools by *using monads to model side-effects* in pure FPL. The concept of monads, originating in the category theory, was applied by *Moggi* to structure *denotational semantics* of a FPL, but the same technique could be applied to structure functional programs.

## 2. Monadic Framework

In a pFP all flow of data is made explicit, sometimes painfully so. A program is written as a set of equations and *explicit data flow* (#getbandname) ensures that the value of an expression depends only on its free variables. Hence, substitution of equals for equals is always valid, making such programs especially easy to reason about. EDF also ensures that the order of computation is irrelevant, making such programs susceptible to *lazy evaluation*.

On the up side, *explicit data flow* is great for code *modularity*; all incoming and outgoing data is *rendered manifest and accessible*, providing a maximum of flexibility.

On the down side, the essence of an algorithm can become buried under the plumbing required to carry data from its point of creation to its point of use.

Considering a program in pFP, any statefull change would require modifying each recursive call. For example, to impl error handling we can't rely on exceptions like in iFP, but we have to check each recursive call and handle errors appropriately. The same goes for other requirements like tracing the execution (which can be solved with a global var in an iFP) or having some output (in an iFP, a function can have output as a side effect).

However, we can use monads to help us handle the exceptions, tracing, output. The use of monads to structure an evaluator allows us to impl changes, such as these 3 mentioned, easily. In each case, we'd just redefine the monad and make a few local changes. The monadic approach makes up for some of flexibility, but it doesn't eliminate all the tension between the flexibility afforded by explicit data and the brevity allowed by implicit plumbing.

We begin with the basic evaluator for simple terms, then consider variations that mimic exceptions, state and output. We analyse these for commonalities, then abstract the concept of a monad. We show how each variations fits into the *monadic framework*.

<!-- #endregion -->

<!-- #region -->

## 2.1 The Basic Evaluator

A term is a constant, `Literal a`, or `Div t u`, where `t` and `u` are terms:
data Term = Literal a | Div t u

```hs
data Term = Literal Int | Div Term Term

-- basic evaluator, eval0
eval :: Term -> Int
eval (Literal a) = a
eval (Div t u) = eval t `div` eval u

-- example terms
ans, err :: Term
ans = (Div (Div (Literal 1972) (Literal 2)) (Literal 23))
err = (Div (Literal 1) (Literal 0))

-- eval
r0a = eval ans -- 42
r0e = eval err -- Exception: divide by zero
```

This evaluator does not incorporate error handling, so the result of `eval err` is `Exception: divide by zero`.

<!-- #endregion -->

## 2.2 Variation 1: Exceptions
<!-- #region eval1 -->

In a pFP we can mimic exceptions by introducing a type to represent computations that may raise an exception.

A value of type `M1 a` either has the form `Raise e`, where `e` is an exception, or `Return a`, where `a` is a value of type `a`.

```hs
type Exception = String
data M1 a = Raise Exception | Return a

eval1 :: Term -> M1 Int
eval1 (Con a) = Return a
eval1 (Div t u) = case eval1 t of
    Raise e -> Raise e
    Return a ->
        case eval1 u of
            Raise e -> Raise e
            Return b ->
                if b == 0
                then Raise "divide by zero"
                else Return (a `div` b)

r1a = eval1 ans -- Return 42
r1e = eval1 err -- Raise "divide by zero"
```

At each call of the evaluator, the form of the result must be checked:
- if an exception was raised it is re-raised
- if a value was returned it is processed

<!-- #endregion -->

## 2.3 Variation 2: State
<!-- #region eval2 -->

Now we want to count the number of divisions performed during evaluation.

In an iFP this is achieved by using a global var and incrementing it after each division. In a pFP, we can *mimic the state* by introducing a type to represent computations that act on a state.

A value of type `M2 a` is a function that accepts the *initial state* and returns the computed value paired with the *final state*.

At each call of the evaluator, the old state must be passed in, and the new state extracted from the result and passed on appropriately.

```hs
type State = Int
type M2 a = State -> (a, State)

eval2 :: Term -> M2 Int
eval2 (Con a) x = (a, x)
eval2 (Div t u) x = let (a, y) = eval2 t x in
                        let (b, z) = eval2 u y in
                            (a `div` b, z + 1)
-- eval
r2a = eval2 ans 0 -- (42, 2)
r2e = eval2 err 0 -- Exception: divide by zero
```

Computing `eval ans 0` yields `(42, 2)`, so with the initial state `0` the `ans` is `42` and the final state is `2`, indicating that 2 divisions were performed.

<!-- #endregion -->

## 2.4 Variation 3: Output
<!-- #region eval3 -->

Finally, to impl tracing of execution in an iFP, we can just insert output commands at appropriate points. In a pFP, we can mimic output by introducing a *type to represent computations that generate output*.

A value of type `M3 a` is a pair of generated output (string) and the computed value.

At each call of the evaluator, the output string must be collected and concatinated to form the output of the enclosing call. The function line generates one line of the output.

```hs
type Output = String
type M3 a = (Output, a)

eval3 :: Term -> M3 Int
eval3 (Con a) = (line (Con a) a, a)
eval3 (Div t u) = let (x, a) = eval3 t in
                  let (y, b) = eval3 u in
                  (x ++ y ++ line (Div t u) (a `div` b), a `div` b)

line :: Term -> Int -> Output
line t a = "eval3 (" ++ show t ++ ") ( " ++ show a ++ "\n"

r3a1 = eval3 (Con 1972)                                -- 1972
r3a2 = eval3 (Con 2)                                   -- 2
r3a3 = eval3 (Div (Con 1972) (Con 2))                  -- 986
r3a4 = eval3 (Con 23)                                  -- 23
r3a5 = eval3 (Div (Div (Con 1972) (Con 2)) (Con 23))   -- 42
```

Computing `eval ans` returns the pair `(x, 42)`, where `x` is the string which represents a trace of the computation.
<!-- #endregion -->

## 2.5 A monadic evaluator

<!-- #region monadic evaluator -->

Each of the variations on the interpreter has a similar structure, which may be abstracted to yield the notion of a **monad**.

In each variation, we introduced a type of computations.
Respectively, `M` represented computations that could:
- raise exceptions
- act on state
- generate output

Evaluators
- the basic (original) ev: `eval0:: Term -> Int`
- in each version it was : `eval :: Term -> M Int`

In general, a function of type
  `f :: a -> b`
is replaced by
  `g :: a -> M b`

This can be read as a function that accepts an argument of type `a` and returns a result of type `b`, with a possible additional effect captured by `M`. This effect may be to act on state, generate output, raise an exception, etc.

Examination of the examples reveals two sorts of operations that are required on the `M` type: *identity* (unit) and *composition* (chaining):
* we need a way to lift a value into a computation: `unit :: a -> M a`
* we need a way to apply `(a -> M b)` fn to a computation of type `M a`.
  It is convenient to write these in an order where the argument comes before the function:
  `(⋆) :: M a -> (a -> M b) -> M b`

A **monad is a triple**, `(M, unit, ⋆)`, consisting of a type constructor `M` and 2 operations of the given polymorphic types. These operations must satisfy *3 monadic laws*.

Monadic expressions will often have the form: `m ⋆ λa.n`
where `m` and `n` are expressions, and `a` is a variable. The form `λa.n` is a lambda expression, with the scope of the bound variable `a` being the expression `n`.

The above can be read as follows:
perform computation `m`,
bind `a` to the resulting value,
and then perform computation `n`.

Types provide a useful guide. From the type of (⋆), we can see that expression has type `M a`, variable `a` has type `a`, expression `n` has type `M b`, lambda expression `λa.n` has type `a -> M b`, and the whole expression has type `M b`.

The above is analogous to the expression: `let a = m in n`
The analogy with `let` explains the choice of the order of arguments to ⋆. It is convenient for argument `m` to appear before the function `λa.n`, since computation `m` is performed before computation `n`.

In an iFP, this has the same reading: perform computation `m`, bind `a` to the resulting value, then perform computation `n` and return its value. Here the types say nothing to distinguish values from computations: expression `m` has type `a`, variable `a` has type `a`, expression `n` has type `b`, and the whole expression has type `b`.

### Evaluator in terms of these abstractions

The evaluator is easily rewritten in terms of these abstractions.

```hs
eval :: Term -> M Int
eval (Con a) = unit a
eval (Div t u) = eval t ⋆ \a -> (eval u ⋆ (\b -> unit (a `div` b)))
```

A word on precedence: lambda abstraction binds least tightly and fn application binds most tightly, so the last equation is equivalent to the following:

```hs
eval (Div t u) = ((eval t) ⋆ (\a -> ((eval u) ⋆ (\b -> (unit (a `div` b))))))
```

The type `Term -> M` Int indicates that the evaluator takes a term and performs a computation yielding an integer. To compute `(Con a)`, just return `a`. To compute `(Div t u)`, first compute `t`, bind `a` to the result, then compute `u`, bind `b` to the result, and then return `a ÷ b`.

The new evaluator is a little more complex than the original basic evaluator, but it is much more flexible. Each of the variations given above may be achieved by simply changing the definitions of `M` , `unit`, and `⋆`, and by making one or two local modifications. It is no longer necessary to re-write the entire evaluator to achieve these simple changes.

```
v.0.1.0 basic evaluator          : eval0 :: Term -> Int
v.0.1   evaluator with exceptions: eval1 :: Term -> M1 Int
v.0.2   evaluator with state     : eval2 :: Term -> M2 Int
v.0.3   evaluator with output    : eval3 :: Term -> M3 Int

v.0.1.1 basic evaluator          : eval0 :: Term -> Int
v.1.1   evaluator with exceptions: eval1 :: Term -> M1 Int
v.1.2   evaluator with state     : eval2 :: Term -> M2 Int
v.1.3   evaluator with output    : eval3 :: Term -> M3 Int

```

<!-- #endregion -->

## 2.6 Variation zero, revisited: The basic evaluator, v.0.1.1
<!-- #region zero revisited -->

In the simplest monad, a computation is no different from a value.

```hs
type M a = a

unit :: a -> I a
unit a = a

(⋆) :: M a -> (a -> M b) -> M b
a ⋆ k = k a
```

This is called the **identity monad**: `M` is the identity function on types, `unit` is the identity function, and (⋆) is just application.

Taking `M`, `unit`, and (⋆) as above in the monadic evaluator and simplifying, yields the basic evaluator from the beginning (zero evaluator).

<!-- #endregion -->

## 2.7 Variation one, revisited: Exceptions, v.1.1

```hs
type M a = a

unit :: a -> I a
unit a = a

(⋆) :: M a -> (a -> M b) -> M b
a ⋆ k = k a
```

v.1.2

```hs
type M a = a

unit :: a -> I a
unit a = a

(⋆) :: M a -> (a -> M b) -> M b
a ⋆ k = k a
```

v.1.3

```hs
type M a = a

unit :: a -> I a
unit a = a

(⋆) :: M a -> (a -> M b) -> M b
a ⋆ k = k a
```


text:
# gatsby-plugin-root-import

Set Webpack to resolve modules and aliases, allowing you to import modules from an absolute project path rather than relative `../../` paths.

### Install

1. Install the `gatsby-plugin-root-import` plugin:

   `npm install --save-dev gatsby-plugin-root-import`

   or

   `yarn add --dev gatsby-plugin-root-import`

### Usage

Add into `gatsby-config.js`.

```javascript
// gatsby-config.js

module.exports = {
  plugins: ["gatsby-plugin-root-import"],
};
```

### Default Settings

If no options are specified, the plugin allows you access to the `src` folder and also it's contents automatically.

This means you should be able to import modules like such:

```javascript
// importing gatsbyProject/src/someFolder/SomeComponent.js

import SomeComponent from "src/someFolder/SomeComponent";
// or more succinctly
import SomeComponent from "someFolder/SomeComponent";
```

### Plugin Options

Plugin Options allows you to:

1. Specify additional webpack [`resolve.modules`](https://webpack.js.org/configuration/resolve/#resolvemodules) search locations with the `resolveModules` key.
2. All other option keys will become a Webpack [`alias`](https://webpack.js.org/configuration/resolve/#resolvealias).

```javascript
// gatsby-config.js
const path = require("path");

module.exports = {
  plugins: [
    {
      resolve: "gatsby-plugin-root-import",
      options: {
        resolveModules: [path.join(__dirname, "libs")],
        utils: path.join(__dirname, "src", "components", "utilities"),
      },
    },
  ],
};
```

This means you should be able to import modules like such:

```javascript
// gatsbyProject/libs is now a searched resolve.modules directory
// importing gatsbybProject/libs/someLib/SomeLibComponent.js
import SomeLibComponent from "someLib/SomeLibComponent";

// from the 'utils' alias
// importing gatsbyProject/src/components/utilities/UtilityComponent.js
import UtilityComponent from "utils/UtilityComponent";
```

### Jest testing

The new aliased paths lets Webpack correctly compile your app. However this does not mean that Jest, or other test runners will understand where those aliases point to.

When setting up testing with Jest, see [`moduleNameMapper`](https://jestjs.io/docs/en/configuration.html#modulenamemapper-objectstring-string--arraystring) to correctly map your your aliases to a path that Jest can understand.

For example:

```javascript
// gatsby-config.js
const path = require("path");

module.exports = {
  // ...other configs
  plugins: [
    {
      resolve: "gatsby-plugin-root-import",
      options: {
        components: path.join(__dirname, "src", "web", "components"),
      },
    },
  ],
};
```

could work with a Jest map like:

```javascript
// jest.config.js
module.exports = {
  // ...other configs
  moduleNameMapper: {
    "^components/(.*)": "<rootDir>/src/web/components/$1",
  },
};
```

Please see Jest's [`moduleNameMapper`](https://jestjs.io/docs/en/configuration.html#modulenamemapper-objectstring-string--arraystring) documentation for specific implementation details regarding format and options.

<details>
  <summary>Deprecated Gatsby V1 Instructions</summary>

### Install

1. Install the `gatsby-plugin-root-import` plugin:

   `npm install --save-dev --save-exact<EMAIL_ADDRESS>
   or

   `yarn add --dev<EMAIL_ADDRESS>
### Usage

Add into `gatsby-config.js`.

```javascript
// gatsby-config.js

module.exports = {
  plugins: ["gatsby-plugin-root-import"],
};
```

### Default Settings

If no options are specified, the plugin defaults to your project root folder.

This means you should be able to import modules like such:

```javascript
// importing gatsbyProject/src/yourFolder/YourComponent.js

import YourComponent from "src/yourFolder/YourComponent";
```

### Plugin Options

You can pass a `root` option. You can specify your own folder, such as `src`.
This option corresponds with Webpack v3's `resolve.root` found [here](https://github.com/webpack/docs/wiki/configuration#resolveroot).
This may be both a directory string, or an array of directory strings.

```javascript
// gatsby-config.js
const path = require("path");

module.exports = {
  plugins: [
    {
      resolve: "gatsby-plugin-root-import",
      options: {
        root: path.join(__dirname, "src"),
      },
    },
  ],
};
```

This means you can import modules with project's `src` folder as `root`:

```javascript
// importing gatsbyProject/src/yourFolder/YourComponent.js

import YourComponent from "yourFolder/YourComponent";
```

</details>

repository: mongkuen/gatsby-plugin-root-import

gha_language: JavaScript

repo_name: mongkuen/gatsby-plugin-root-import


text:
# FastExcelLaravel

Lightweight and very fast XLSX Excel Spreadsheet read/write library for Laravel in pure PHP
(wrapper around [FastExcelWriter](https://packagist.org/packages/avadim/fast-excel-writer)
 and [FastExcelReader](https://packagist.org/packages/avadim/fast-excel-reader))

## Introduction

Exporting data from your Laravel application has never been so fast! Importing models into your Laravel application has never been so easy!

This library is a wrapper around **avadim/fast-excel-writer** and **avadim/fast-excel-reader**, so it's also lightweight, fast, and requires a minimum of memory.
Using this library, you can export arrays, collections and models to a XLSX-file from your Laravel application, and you can import data to Laravel application.

**Features**

* Easily export models, collections and arrays to Excel
* Export huge datasets with very fast, and using a minimum of memory
* Сan create multiple sheets and supports basic column, row and cell styling
* You can set the height of the rows and the width of the columns (including auto width calculation)
* Import workbooks and worksheets to Eloquent models very quickly and with minimal memory usage
* Automatic field detection from imported table headers
* Mapping import/export data

## Installation

Install via composer:

```
composer require avadim/fast-excel-laravel
```
And then you can use facade ```Excel```

```php
// Create workbook...
$excel = \Excel::create();

// export model...
$sheet->withHeadings()->exportModel(Users::class);

// and save XLSX-file to default storage
$excel->saveTo('path/file.xlsx');

// or save file to specified disk
$excel->store('disk', 'path/file.xlsx');

// Open saved workbook
$excel = \Excel::open(storage_path('path/file.xlsx'));

// import records to database
$excel->withHeadings()->importModel(User::class);
```

Jump To:
* [Export Data](#export-data)
  * [Export a Model](#export-a-model)
  * [Export Any Collections and Arrays](#export-any-collections-and-arrays)
  * [Mapping Export Data](#mapping-export-data)
  * [Advanced Usage for Data Export](#advanced-usage-for-data-export)
* [Import Data](#import-data)
  * [Import a Model](#import-a-model)
  * [Mapping Import Data](#mapping-import-data)
  * [Advanced Usage for Data Import](#advanced-usage-for-data-import)
* [More Features](#more-features)
* [Do you want to support FastExcelLaravel?](#do-you-want-to-support-fastexcellaravel)

## Export Data

### Export a Model
Easy and fast export of a model. This way you export only model data without headers and without any styling
```php

// Create workbook with sheet named 'Users'
$excel = \Excel::create('Users');

// Export all users to Excel file
$sheet->exportModel(Users::class);

$excel->saveTo('path/file.xlsx');
```
The following code will write the field names and styles (font and borders) to the first row, and then export all the data of the User model

```php

// Create workbook with sheet named 'Users'
$excel = \Excel::create('Users');

// Write users with field names in the first row
$sheet->withHeadings()
    ->applyFontStyleBold()
    ->applyBorder('thin')
    ->exportModel(Users::class);

$excel->saveTo('path/file.xlsx');
```

### Mapping Export Data

You can map the data that needs to be added as row

```php
$sheet = $excel->getSheet();
$sheet->mapping(function($model) {
    return [
        'id' => $model->id, 'date' => $model->created_at, 'name' => $model->first_name . $model->last_name,
    ];
})->exportModel(User::class);
$excel->save($testFileName);

```

### Export Any Collections and Arrays
```php
// Create workbook with sheet named 'Users'
$excel = \Excel::create('Users');

$sheet = $excel->getSheet();
// Get users as collection
$users = User::where('age', '>', 35)->get();

// Write attribute names
$sheet->writeRow(array_keys(User::getAttributes()));

// Write all selected records
$sheet->writeData($users);

$sheet = $excel->makeSheet('Records');
// Get collection of records using Query Builder
$records = \DB::table('users')->where('age', '>=', 21)->get(['id', 'name', 'birthday']);
$sheet->writeData($records);

$sheet = $excel->makeSheet('Collection');
// Make custom collection of arrays
$collection = collect([
    [ 'id' => 1, 'site' => 'google.com' ],
    [ 'id' => 2, 'site.com' => 'youtube.com' ],
]);
$sheet->writeData($collection);

$sheet = $excel->makeSheet('Array');
// Make array and write to sheet
$array = [
    [ 'id' => 1, 'name' => 'Helen' ],
    [ 'id' => 2, 'name' => 'Peter' ],
];
$sheet->writeData($array);

$sheet = $excel->makeSheet('Callback');
$sheet->writeData(function () {
    foreach (User::cursor() as $user) {
        yield $user;
    }
});

```

### Advanced Usage for Data Export

See detailed documentation for avadim/fast-excel-writer here: https://github.com/aVadim483/fast-excel-writer/tree/master#readme

```php
$excel = \Excel::create('Users');
$sheet = $excel->getSheet();

$sheet->setColWidth('B', 12);
$sheet->setColOptions('c', ['width' => 12, 'text-align' => 'center']);
$sheet->setColWidth('d', 'auto');

$title = 'This is demo of avadim/fast-excel-laravel';
// Begin area for direct access to cells
$area = $sheet->beginArea();
$area->setValue('A2:D2', $title)
      ->applyFontSize(14)
      ->applyFontStyleBold()
      ->applyTextCenter();

// Write headers to area
$area
    ->setValue('a4:a5', '#')
    ->setValue('b4:b5', 'Number')
    ->setValue('c4:d4', 'Movie Character')
    ->setValue('c5', 'Birthday')
    ->setValue('d5', 'Name')
;

// Apply styles to headers
$area->withRange('a4:d5')
    ->applyBgColor('#ccc')
    ->applyFontStyleBold()
    ->applyOuterBorder('thin')
    ->applyInnerBorder('thick')
    ->applyTextCenter();

// Write area to sheet
$sheet->writeAreas();

// You can set value formats for some fields
$sheet->setFieldFormats(['birthday' => '@date', 'number' => '@integer']);

// Write data to sheet
$sheet->writeData($data);

// Save XLSX-file
$excel->saveTo($testFileName);

```

## Import Data

### Import a Model
To import models, you can use method ```importModel()```.
If the first row contains the names of the fields you can apply these using method ```withHeadings()```

![import.jpg](import.jpg)

```php
// Open XLSX-file
$excel = Excel::open($file);

// Import a workbook to User model using the first row as attribute names
$excel->withHeadings()->importModel(User::class);

// Done!!!
```
You can define the columns or cells from which you will import

```php
// Import row to User model from columns range A:B - only 'name' and 'birthday'
$excel->withHeadings()->importModel(User::class, 'A:B');
```

![import2.jpg](import2.jpg)
```php
// Import from cells range
$excel->withHeadings()->importModel(User::class, 'B4:D7');

// Define top left cell only
$excel->withHeadings()->importModel(User::class, 'B4');
```
In the last two examples, we also assume that the first row of imported data (row 4)
is the names of the attributes.

### Mapping Import Data

However, you can set the correspondence between columns and field names yourself.

```php
// Import row to User model from columns range B:E
$excel->mapping(function ($record) {
    return [
        'id' => $record['A'], 'name' => $record['B'], 'birthday' => $record['C'], 'random' => $record['D'],
    ];
})->importModel(User::class, 'B:D');

// Define top left cell only
$excel->mapping(['B' => 'name', 'C' => 'birthday', 'D' => 'random'])->importModel(User::class, 'B5');

// Define top left cell only (shorter way)
$excel->importModel(User::class, 'B5', ['B' => 'name', 'C' => 'birthday', 'D' => 'random']);
```

### Advanced Usage for Data Import
See detailed documentation for avadim/fast-excel-reader here: https://github.com/aVadim483/fast-excel-reader/tree/master#readme
```php
$excel = Excel::open($file);

$sheet = $excel->getSheet('Articles');
$sheet->setReadArea('B5');
foreach ($sheet->nextRow() as $rowNum => $rowData) {
    $user = User::create([
        'name' => $rowData['B'],
        'birthday' => new \Carbon($rowData['C']),
        'password' => bcrypt($rowData['D']),
    ]);
    Article::create([
        'user_id' => $user->id,
        'title' => $rowData['E'],
        'date' => new \Carbon($rowData['F']),
        'public' => $rowData['G'] === 'yes',
    ]);
}
```

## More Features
You can see more features for export in the documentation for [FastExcelWriter](https://packagist.org/packages/avadim/fast-excel-writer).

You can see more features for import in the documentation for [FastExcelReader](https://packagist.org/packages/avadim/fast-excel-reader))

## Do you want to support FastExcelLaravel?

if you find this package useful you can support and donate to me for a cup of coffee:

* USDT (TRC20) TSsUFvJehQBJCKeYgNNR1cpswY6JZnbZK7
* USDT (ERC20) 0x5244519D65035aF868a010C2f68a086F473FC82b
* ETH 0x5244519D65035aF868a010C2f68a086F473FC82b

Or just give me a star on GitHub :)

branch_name: refs/heads/main


text:
# How to customize the order of DiffTools in your Reporter

toc

### Choosing a DiffTool preference

If you do not like the default order that DiffTools are chosen, you can easily create a custom Reporter with your own preferences.
Once you create the class, you select it with the `[UseReporter(typeof(CustomDiffReporter))]`

snippet: CustomDiffReporter.cs

You can also override the default order while using `DiffReporter` by defining `DiffEngine_ToolOrder` environment variable. The value of that variable should contain a delimiter (`,`, `|`, ` `) separated list of the diff tool names in the desired order. More details about that in [Diff Tool Order](https://github.com/VerifyTests/DiffEngine/blob/main/docs/diff-tool.order.md)

---

[Back to User Guide](../readme.md#top)

gha_language: C#


text:
# insurance-monte-carlo

[![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master)](https://travis-ci.org/joemccann/dillinger)[![GitHub license](https://img.shields.io/github/license/sultan99/react-on-lambda.svg)](https://github.com/sultan99/react-on-lambda/blob/master/LICENSE)

### Car Insurance Profit/Loss, a Monte Carlo Simulation
A financial modelling project.

By Rory GS

### About

This python 3 project generates the expected profit/loss for a car insurance company over a given period of time. It allows you to model using several variables. Their names, explanations and initial values are detailed below. Both a .py script and an identical .ipynb python notebook are included. The claim amounts and probabilities are drawn from recent insurance statistics in both the US and Aus markets. The outputs in this model are in AUD but can easily be converted to USD.

### Parameters

| name | explanation | initial value |
| ------ | ------ | ------ |
| balance | Initial funds | 0  |
| memberCount | Starting member count | 1000  |
| memberGrowthRate | Monthly member count growth rate | 1.01  |
| monthsToModel | How many months should the model run | 24  |
| annualInjuryRate | Percentage of customers making personal injury claims | 1.10  |
| annualPropertyDamageRate | Percentage of customers making property damage claims | 4.0  |
| annualCollisionRate | Percentage of customers making collision damage claims | 6.15  |
| annualComprehensiveRate | Percentage of customers making comprehensive damage claims | 2.85  |

### Result

The model outputs a series of charts and graphs created using matplotlib and the tabulate module. It details the monthly revenue, losses and claims.

An example run outputs as follows:

### Example Output

Starting with funds of: 0

Starting member count of: 1000

Running for a total of: 12 months
_________
Month 1 ending funds total $47,030 with Revenue of $70,082 and losses of: $23,052 from 6 claims

Month 2 ending funds total $83,937 with Revenue of $70,029 and losses of: $33,122 from 9 claims

Month 3 ending funds total $46,558 with Revenue of $70,160 and losses of: $107,539 from 20 claims

Month 4 ending funds total $75,222 with Revenue of $69,949 and losses of: $41,285 from 11 claims

Month 5 ending funds total $93,461 with Revenue of $69,676 and losses of: $51,437 from 11 claims

Month 6 ending funds total $115,256 with Revenue of $70,101 and losses of: $48,306 from 13 claims

Month 7 ending funds total $133,035 with Revenue of $69,806 and losses of: $52,027 from 11 claims

Month 8 ending funds total $119,362 with Revenue of $70,224 and losses of: $83,897 from 14 claims

Month 9 ending funds total $140,177 with Revenue of $69,913 and losses of: $49,098 from 9 claims

Month 10 ending funds total $167,052 with Revenue of $69,755 and losses of: $42,880 from 10 claims

Month 11 ending funds total $180,178 with Revenue of $70,168 and losses of: $57,042 from 13 claims

Month 12 ending funds total $154,442 with Revenue of $70,121 and losses of: $95,857 from 16 claims

![Screenshot](screenshot.png)

### License

MIT

### Contact

You are welcome to contact me via:

[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/rorcores)

<a href="https://www.linkedin.com/in/rory-garton-smith-5b991659/" target="_blank">`Linkedin`</a>

or email<EMAIL_ADDRESS>


text:
# Rails structured data
[![Gem Version](https://badge.fury.io/rb/structured_data.svg)](https://badge.fury.io/rb/structured_data) [![Build Status](https://travis-ci.org/endenis/rails_structured_data.svg?branch=master)](https://travis-ci.org/endenis/rails_structured_data)

The aim of this project is to provide some basic rails helpers to render structured data inside web-pages.

:warning: This gem is under active development.

## Basic information

* The main goal right now is to provide meta information inside web-pages for search engines. We are going to use [this page](https://developers.google.com/search/docs/guides/intro-structured-data) as a reference.

* The prefered format is [JSON-LD](http://json-ld.org/), although for certain features we might use something else (like [microdata](https://www.w3.org/TR/microdata/) or RDFa).

## How to install

Add the `structured_data` gem to your `Gemfile`. Be sure to specify the current version!

```ruby
gem 'structured_data', '~> 0.1.1'
```

## Usage

Take a look at this example:
```ruby
<%= structured_data_tag({ '@context' => 'http://schema.org' }) %>
```
The code above renders this html code:
```html
<script type="application/ld+json">{"@context":"http://schema.org"}</script>
```

There will be more features in the next versions!

## Contributing

Feel free to contribute by creating issues with idea-proposals and/or pull requests.

Special thanks to:
- [Daniel](https://github.com/dany-kun)

## Lisence

[MIT-Lisence](https://github.com/endenis/rails_structured_data/blob/master/MIT-LICENSE)


text:
---
layout: default
markdown: kramdown
---
## Angry Bots Demo

  Uh-oh! WebAssembly isn't enabled in this browser. To get an early preview of this experimental technology, at your own risk:

  - on [Chrome Canary](https://www.google.com/chrome/browser/canary.html), open `chrome://flags/#enable-webassembly` and enable the switch.
  - on [Firefox Nightly](https://nightly.mozilla.org/), open `about:config` and set `javascript.options.wasm` to `true`.

  See a [preview](http://blogs.windows.com/msedgedev/2016/03/15/previewing-webassembly-experiments) of [Microsoft Edge](https://www.microsoft.com/en-us/windows/microsoft-edge) support and follow [Safari](http://www.apple.com/safari/) support on WebKit's [feature status](https://webkit.org/status/#specification-webassembly) page.

[![](screenshot.jpg)](AngryBots/)

  Play WebAssembly
  Play asm.js fallback

This is an experimental demo of Angry Bots, a Unity game which has been ported to WebAssembly. Fight robots and explore a 3D space station with realistic environmental effects in this top-down shooter. Movement is controlled by W, A, S, D or the arrow keys and aiming & firing is controlled by the mouse.

### WebAssembly Demo Status

| Early multi-browser support | ✓ | Runs in experimental builds of Chromium, Firefox, and Edge. |
| Demo execution | ✓ | Full execution semantics implemented.
| Stable binary format | ✘ | Binary format will be updated to match design iterations, until it is frozen for stable release.
| Standard textual encoding | ✘ | Textual encoding will be standardized before stable release.
| Stable tooling | ✘ | A mature toolchain for compiling and debugging WebAssembly will be available before stable release.
| Stable JS API | ✘ | The Wasm object will be updated to allow additional behavior and introspection before stable release


text:
# laminas-eventmanager

[![Build Status](https://travis-ci.org/laminas/laminas-eventmanager.svg?branch=master)](https://travis-ci.org/laminas/laminas-eventmanager)
[![Coverage Status](https://coveralls.io/repos/laminas/laminas-eventmanager/badge.svg?branch=master)](https://coveralls.io/r/laminas/laminas-eventmanager?branch=master)

laminas-eventmanager is designed for the following use cases:

- Implementing simple subject/observer patterns.
- Implementing Aspect-Oriented designs.
- Implementing event-driven architectures.

The basic architecture allows you to attach and detach listeners to named events,
both on a per-instance basis as well as via shared collections; trigger events;
and interrupt execution of listeners.

- File issues at https://github.com/laminas/laminas-eventmanager/issues
- Documentation is at https://docs.laminas.dev/laminas-eventmanager/

For migration from version 2 to version 3, please [read the migration
documentation](https://docs.laminas.dev/laminas-eventmanager/migration/intro/).

## Benchmarks

We provide scripts for benchmarking laminas-eventmanager using the
[Athletic](https://github.com/polyfractal/athletic) framework; these can be
found in the `benchmarks/` directory.

To execute the benchmarks you can run the following command:

```bash
$ vendor/bin/athletic -p benchmarks
```

repository: cloudfoundry/php-buildpack

gha_language: Python

repo_name: cloudfoundry/php-buildpack


text:
EXPORT COMPLIANCE NOTICE
--------------------------

This application may require import/export control. Please check with legal to determine regulations. Specifically, this example implements the Tiny Encryption Algorithm described at https://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm which may be under import/export control.

repository: Hosseinabady/SDx

repo_name: Hosseinabady/SDx


text:
sweet.js
========

Hygienic Macros for JavaScript!

* Documentation at [sweetjs.org](http://sweetjs.org).
* Overview and motivation in this [talk](https://air.mozilla.org/sweetjs/).
* Example macros on the [wiki](https://github.com/mozilla/sweet.js/wiki/Example-macros).
* [Mailing list](https://groups.google.com/forum/#!forum/sweetjs) for discussion
* IRC channel #sweet.js on irc.mozilla.org

## Use

### Using Node

Install with npm:

    $ npm install sweet.js

To try it out make a file `test_macros.sjs`:

```js
// functions can now be spelled def!
macro def {
  case $name:ident $params $body => {
    function $name $params $body
  }
}
def add (a, b) {
  return a + b;
}

console.log( add(3, 7) );
```

And compile it with `sjs`:

    $ sjs -o output.js test_macros.sjs
    $ node output.js
    10

Alternately you can require an sjs file from node. For example, in `main.js` add:

    var sjs = require('sweet.js'),
        example = require('./example');

    example.one;

Where ./example.sjs contains:

    macro A {
        case ($a + $b) => {
	        $a
	    }
    }

    exports.one = A(1 + 2);

And just run `main.js` in node.

### Using AMD in the browser

An AMD loader is provided at [require-sweet](https://github.com/iammerrick/require-sweet).

    define(['sweeten!a/javascript/dep-with-macros'], function(dep) {
      // dep is compiled to JS at this point.
    });

## Hacking

Install the dev dependencies:

    $ npm install --dev

And run the [tests](https://github.com/mozilla/sweet.js/tree/master/test):

    $ npm test

## Changelog

* [0.1.2](https://github.com/mozilla/sweet.js/tree/v0.1.2)
    * `:expr` parse class working #28
    * hygiene fixes #15 #17
    * allowing macros to override keywords #33
    * major refactoring of expander
* [0.1.1](https://github.com/mozilla/sweet.js/tree/v0.1.1)
    * node autoloading, AMD support
    * fixes to issues #18, #24, #26, #40
* 0.1.0 (initial release)