text:
# qooxdoo "tweets" with [qxcompiler](https://github.com/johnspackman/qxcompiler) and [grunt-qx](https://github.com/drawstack/grunt-qx)

This is the tweets application from the offical Qooxdoo [tutorial](http://www.qooxdoo.org/current/pages/desktop/tutorials/tutorial-part-1.html), its also here as an
example for an app with QxCompiler and grunt-qx.

### Install

#### Clone

```bash
$ git clone https://github.com/pcdummy/qooxdoo-tweets-tutorial.git
```

#### Run npm install

```bash
$ cd qooxdoo-tweets-tutorial
$ npm install
```

### Compile, serve with grunt-contrib-connect and watch it :)

```bash
grunt source-server
```

Next go to http://<IP_ADDRESS>:8000/qxc.tweets.html

```bash
xdg-open http://<IP_ADDRESS>:8000/qxc.tweets.html
```

### Develop it

We added `grunt-contrib-watch` which means it will rebuild your Qx app on-to-fly.

Just run:

```
grunt watch
```

### Available grunt tasks

#### source-server

Builds the "source" version of the tweets app, runs a server and rebuilds on-to-fly.

#### source-hybrid-server

Builds the "hybrid" version of the tweets app, runs a server and rebuilds on-to-fly.

#### build-server

Builds the "build" version of the tweets app, runs a server and rebuilds on-to-fly.

#### build

Builds the "build" version of the tweets app.

#### source-hybrid

Builds the "hybrid" version of the tweets app.

#### source

Builds the "source" version of the tweets app.

#### lint

Lints your code with eslint.

#### lint-fix

Lints your code with eslint and applies eslint fixes.

#### clean

Remove all builds.

### Update qx and the tools

Install [npm-check-updates](https://www.npmjs.com/package/npm-check-updates)

```bash
$ npm install -g npm-check-updates
```

Run npm-check-updates:
```bash
$ ncu -a
```

And update your packages:
```bash
$ npm update
```

### License

MIT

repository: adrelino/qooxdoo-tweets-tutorial

repo_name: adrelino/qooxdoo-tweets-tutorial


text:
# Monthly security updates

[
 ![Check out that new "Android security patch level" field. ](https://cdn.arstechnica.net/wp-content/uploads/2016/10/settings-5-980x957.jpg)
][31]

A few months before the release of Marshmallow, [vulnerabilities][32] in Android's "Stagefright" media server were disclosed to the public, which could allow for remote code execution on older versions of Android. Android took a beating in the press, with [a billion phones][33] affected by the newly discovered bugs.

Google responded by starting a monthly Android security update program. Every month it would round up bugs, fix them, and push out new code to AOSP and Nexus devices. OEMs—who were already struggling with updates (possibly due to apathy)—were basically told to "deal with it" and keep up. Every other major operating system has frequent security updates—it's just the cost of being such a huge platform. To accommodate OEMs, Google give them access to the updates a full month ahead of time. After 30 days, security bulletins are posted and Google devices get the updates.

The monthly update program started two months before the release of Marshmallow, but in this major OS update Google added an "Android Security Patch Level" field to the About Phone screen. Rather than use some arcane version number, this was just a date. This let anyone easily see how out of date their phone was, an acted as a nice way to shame slow OEMs.

*   [
     ![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/text-150x150.jpg)
    ][2]
*   [
     ![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/extra-150x150.jpg)
    ][3]
*   [
     ![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/translate-150x150.jpg)
    ][4]
*   [
     ![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/chromecustomtab-150x150.jpg)
    ][5]
*   [
     ![](https://cdn.arstechnica.net/wp-content/uploads/2015/09/CCT_Large-2-150x150.gif)
    ][6]
*   [
     ![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-5-150x150.jpg)
    ][7]
*   [
     ![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-1-150x150.jpg)
    ][8]
*   [
     ![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings2-150x150.jpg)
    ][9]
*   [
     ![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-3-150x150.jpg)
    ][10]
*   [
     ![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/nearby-150x150.jpg)
    ][11]
*   [
     ![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-6-150x150.jpg)
    ][12]
*   [
     ![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-7-150x150.jpg)
    ][13]
*   [
     ![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-8-150x150.jpg)
    ][14]
*   [
     ![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/settings-9-150x150.jpg)
    ][15]
*   [
     ![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/2015-10-03-18.21.17-150x150.png)
    ][16]
*   [
     ![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/2015-10-04-05.32.23-150x150.png)
    ][17]
*   [
     ![](https://cdn.arstechnica.net/wp-content/uploads/2015/10/easter-egg-150x150.jpg)
    ][18]

The text selection menu is now a floating toolbar that pops up right next to the text you're selecting. This wasn't just the regular "cut/copy/paste" commands, either. Apps could put special options on the toolbar, like the "add link" option in Google Docs.

After the standard text commands, an ellipsis button would expose a second menu, and it was here that apps could add extra features to the text selection menu. Using a new "text processing" API, it was now super easy to ship text directly to another app. If you had Google Translate installed, a "translate" option would show up in this menu. Eventually Google Search added an "Assist" option to this menu for Google Now on Tap.

Marshmallow added a hidden settings section called the "System UI Tuner." This section would turn into a catch-all for power user features and experimental items. To access this you had to pull down the notification panel and hold down on the "settings" button for several seconds. The settings gear would spin, and eventually you'd see a message indicating that the System UI Tuner was unlocked. Once it was turned on, you could find it as the bottom of the system settings next to Developer Options.

In this first version of the System UI Tuner, users would add custom tiles to the Quick Settings panel, a feature that would later be refined into an API apps could use. For now the feature was very rough, basically allowing users to type a custom command into a text box.  A popular power user addition was the option for embedding a percentage readout into the battery icon. There was also a "demo" mode for screenshots, which would replace the normal status bar with a fake, clean version.

### Android 7.0 Nougat, Pixel Phones, and the future

[Android 7.0 Nougat][34] and [the Pixel Phones][35] came out just a few months ago, and you can read our full reviews for both of them. Both still have a ton of features and implications that we have not seen come to fruition yet, so we'll save a deep "history" dive for when they are actually "history."

### FURTHER READING

[Android 7.0 Nougat review—Do more on your gigantic smartphone][25]

Nougat made serious changes to the [graphics and sensor pipeline][36] for Daydream VR, Google's upcoming smartphone-powered VR experience [we tried][37] but have yet to log any serious time with. A new "Seamless update" feature borrowed an update mechanism from Chrome OS, which uses dual system partitions to quietly update one partition in the background while you're still using the other one. Considering the Pixel phones are the only devices to launch with this and haven't gotten an update yet, we're not sure what that looks like, either.

*   [
     ![](https://cdn.arstechnica.net/wp-content/uploads/2016/08/2016-08-17-18.21.22-150x150.png)
    ][19]
*   [
     ![](https://cdn.arstechnica.net/wp-content/uploads/2016/08/2016-08-17-18.20.59-150x150.png)
    ][20]
*   [
     ![](https://cdn.arstechnica.net/wp-content/uploads/2016/08/Android-N_1-150x150.jpg)
    ][21]
*   [
     ![](https://cdn.arstechnica.net/wp-content/uploads/2016/03/2016-03-20-19.26.55-150x150.png)
    ][22]
*   [
     ![](https://cdn.arstechnica.net/wp-content/uploads/2016/08/pip-active-150x150.png)
    ][23]

One of the most interesting additions to Nougat is a revamp of the app framework to allow for resizable apps. This allowed Google to implement split screen on phones and tablets, picture-in-picture on Android TV, and a mysterious floating windowed mode. We've been able to access the floating window mode with some software trickery, but we've yet to see Google use it in an actual product. Is it being aimed at desktop computing?

Android and Chrome OS also continue to grow together. Android apps [can run][38] on some Chromebooks now, giving the "Web-only" OS the Play Store and a serious app ecosystem. Rumors continue to swirl that the future of Chrome OS and Android will come even closer together, with the name "[Andromeda][39]"—a portmanteau of "Android" and "Chrome"—being tossed around as the codename for a merged Chrome/Android OS.

We have yet to see how the historical legacy of the Pixel phones will shake out. Google dove into the hardware pool with the launch of two new smartphone flagships, the Pixel and Pixel XL, only recently. Google had produced co-branded Nexus phones with partners before, but the Pixel line is a "Google" branded product. The company claims it is a full hardware OEM now, using HTC as a contract manufacturer similarly to the way Apple uses Foxconn.

### FURTHER READING

[Google Pixel review: The best Android phone, even if it is a little pricey][26]

With its own hardware comes a change in how Google makes software. The company created the "Google Assistant" as the future of the "OK Google" voice command system. But rather than ship it out to every Android device, the Assistant is an exclusive Pixel feature. Google made some changes to the interface, with a custom "Pixel launcher" home screen app and a new System UI, both of which are Pixel exclusives. We'll have to wait to see what the balance of future features are between "Android" and "Pixel" going forward.

### FURTHER READING

[Chatting with Google’s Hiroshi Lockheimer about Pixel, Android OEMs, and more][27]

With these changes, we're probably at the most uncertain point in Android's history. But ahead of the platform's recent October 2016 event, [Hiroshi Lockheimer][40], SVP of Android, Chrome OS, and Google Play, said he believed we'll all look back fondly on these latest Android developments. Lockheimer is essentially the current king of software at Google, and he thought the newest updates could be the most significant Android happening since the OS debuted eight years earlier. While he wouldn't elaborate much on this sentiment after the unveilings, the fact remains that this time next year we _might_ not even be talking about Android—it could be an Android/Chrome OS hybrid! So as has always been the case since 2008, the next chapter in Android's history looks to be nothing if not interesting.

--------------------------------------------------------------------------------

作者简介：

Ron is the Reviews Editor at Ars Technica, where he specializes in Android OS and Google products. He is always on the hunt for a new gadget and loves to rip things apart to see how they work.

--------------------------------------------------------------------------------

via: http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/

作者：[RON AMADEO][a]
译者：[译者ID](https://github.com/译者ID)
校对：[校对者ID](https://github.com/校对者ID)

本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出

[a]:http://arstechnica.com/author/ronamadeo
[1]:http://android-developers.blogspot.com/2015/09/chrome-custom-tabs-smooth-transition.html
[2]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[3]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[4]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[5]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[6]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[7]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[8]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[9]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[10]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[11]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[12]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[13]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[14]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[15]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[16]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[17]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[18]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[19]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[20]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[21]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[22]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[23]:http://arstechnica.com/gadgets/2016/10/building-android-a-40000-word-history-of-googles-mobile-os/33/#
[24]:https://cdn.arstechnica.net/wp-content/uploads/2016/10/settings-5.jpg
[25]:http://arstechnica.com/gadgets/2016/08/android-7-0-nougat-review-do-more-on-your-gigantic-smartphone/
[26]:http://arstechnica.com/gadgets/2016/10/google-pixel-review-bland-pricey-but-still-best-android-phone/
[27]:http://arstechnica.com/gadgets/2016/10/chatting-with-googles-hiroshi-lockheimer-about-pixel-android-oems-and-more/
[28]:http://arstechnica.com/gadgets/2016/08/android-7-0-nougat-review-do-more-on-your-gigantic-smartphone/
[29]:http://arstechnica.com/gadgets/2016/10/google-pixel-review-bland-pricey-but-still-best-android-phone/
[30]:http://arstechnica.com/gadgets/2016/10/chatting-with-googles-hiroshi-lockheimer-about-pixel-android-oems-and-more/
[31]:https://cdn.arstechnica.net/wp-content/uploads/2016/10/settings-5.jpg
[32]:http://arstechnica.com/security/2015/07/950-million-android-phones-can-be-hijacked-by-malicious-text-messages/
[33]:http://arstechnica.com/security/2015/10/a-billion-android-phones-are-vulnerable-to-new-stagefright-bugs/
[34]:http://arstechnica.com/gadgets/2016/08/android-7-0-nougat-review-do-more-on-your-gigantic-smartphone/
[35]:http://arstechnica.com/gadgets/2016/10/google-pixel-review-bland-pricey-but-still-best-android-phone/
[36]:http://arstechnica.com/gadgets/2016/08/android-7-0-nougat-review-do-more-on-your-gigantic-smartphone/11/#h1
[37]:http://arstechnica.com/gadgets/2016/10/daydream-vr-hands-on-googles-dumb-vr-headset-is-actually-very-clever/
[38]:http://arstechnica.com/gadgets/2016/05/if-you-want-to-run-android-apps-on-chromebooks-youll-need-a-newer-model/
[39]:http://arstechnica.com/gadgets/2016/09/android-chrome-andromeda-merged-os-reportedly-coming-to-the-pixel-3/
[40]:http://arstechnica.com/gadgets/2016/10/chatting-with-googles-hiroshi-lockheimer-about-pixel-android-oems-and-more/

url: https://raw.githubusercontent.com/wyangsun/TranslateProject/e4b541ec7fb89b96d1ba510707cd4c897842b535/sources/talk/The history of Android/33 The (updated) history of Android.md

repository: wyangsun/TranslateProject

branch_name: refs/heads/master

extension: md

filename: 33 The (updated) history of Android.md

license_type: permissive

repo_name: wyangsun/TranslateProject


text:
# ue4-socketio-crash
Test project for demonstrating crash on SocketIO in UnrealEngine 4.15.2 using Flask-SocketIO.

# Requirements
* Python 2.7
* (Windows only) Install the VC++ compiler for Python 2.7 (http://www.microsoft.com/en-us/download/details.aspx?id=44266)

# Install instructions

1. Download PyCharm (https://www.jetbrains.com/pycharm/download/) - Community Edition is sufficient
1. Open this repository
1. Set interpreter to Python2.7

    1. Go to "File" -> "Settings"
    1. Search for "Interpreter"
    1. Set to Python 2.7

1. Open ue-crash-dummy.py
1. PyCharm should now display that some requirements are missing -> click "Install requirements"

# Steps to reproduce
1. In UnrealEngine 4 create a SocketIO client

    1. Connect to Address and Port: ws://localhost:5000

1. Emit the following event: testEvent

    1. UnrealEngine should crash

1. Restart UnrealEngine
1. Emit the following event: testEventWithException

    1. In this event I raise an Exception within the event in Python. This (at least that's what I guess) causes the server to not return anything
    1. UnrealEngine should not crash

license: MIT

gha_language: Python

gha_license_id: MIT


text:
In this final stage of the tutorial, you will use InfluxDB to create and query time series data within the Kubernetes cluster.

Begin by connecting to the client pod:

`kubectl exec -it influxdb-client -- bash`{{execute}}

Use the InfluxDB client to connect to the host database.

`influx -host influxdb-0.influxdb -username admin -password admin`{{execute}}

Create a test database called weather.

`CREATE DATABASE weather;`{{execute}}

Connect to the database and insert some sample time series data.
Here we are inserting the temperature at two locations.

`USE weather;`{{execute}}

`INSERT temperature,location=London value=26.4
INSERT temperature,location=London value=24.9
INSERT temperature,location=London value=22.2
INSERT temperature,location=London value=14.7
INSERT temperature,location=London value=19.5
INSERT temperature,location=Paris value=27.1
INSERT temperature,location=Paris value=27.5
INSERT temperature,location=Paris value=21.3
INSERT temperature,location=Paris value=26.7
INSERT temperature,location=Paris value=30.0`{{execute}}

You can now use the inserted values to generate statistical insights from the
dataset.

`SELECT MEAN(*) FROM "temperature" GROUP BY "location"`{{execute}}

Congratulations! You have successfully installed InfluxDB in Kubernetes
with StorageOS, then used a separate client pod to connect to the database
and to create and query data.

repository: storageos/tutorials

gha_language: Shell

repo_name: storageos/tutorials


text:
You can click on the coffee cups to empty them and the coffee cups fill faster with time.

The serviceworker has not been fully tested yet but I guess it should work as it doesn't anything extrodinary difficult.

## QuickStart

You can skip installing and just go to the *dist directory* and run something like
```bash
python -m SimpleHTTPServer 1234
```
to run the game at **localhost:1234** .

## ServiceWorker - how to install it

The serviceworker is in the serviceworker directory inside the src directory. It was manually added after the distribution was build with **npm run build**.
The register.js for registering the serviceworker was added with script-tags. The serviceworker.js file was copied into the *dist* directory.

You can check if the serviceworker is installed on the Chrome browser by *chrome://inspect/#service-workers*.

## Usage

Clone the repo and and do as being told in the **builiding section**. Afterwards the program or game should run on
*localhost:1234* . Have fun with it!

### Building

To start the development server with hot module reloading, run:

* `npm start`

To build for production

* first remove the folders `dist` and `.cache`
* then run: `npm run build`

## What's included

- Bundling with parcel
- Dev server with hot module replacement
- React 16
- styled-components

*Note, parcel is currently unable to support minfication os ES2015 code—github.com/parcel-bundler/parcel/issues/8*

repository: MatthiasLiszt/react-parcel-starter

repo_name: MatthiasLiszt/react-parcel-starter


text:
---
layout: post
title: Happy Birthday To Us
date: 2017-04-18
author: April
tags: Amel, Maramu, brochure
thumb: https://cloud.githubusercontent.com/assets/13930968/25110979/aef43b8a-23ad-11e7-80f0-42eaa65149c8.JPG
backgrounds:
- https://cloud.githubusercontent.com/assets/13930968/25110895/0aafb194-23ad-11e7-8323-e46444dae484.JPG
- https://cloud.githubusercontent.com/assets/13930968/25110971/945edd20-23ad-11e7-94bc-f710d4bc0889.JPG
---
![amel under sail big](https://cloud.githubusercontent.com/assets/13930968/25110979/aef43b8a-23ad-11e7-80f0-42eaa65149c8.JPG)

We've decided to not go shopping for gifts for each other this year, and to only give cards tomorrow, because we have officially just bought each other a new boat! Yea! She is a 46' Amel Maramu, built in 1986.

After a long and drawn out payment process, she is now officially ours, and we are so excited! Hopefully we will be able to move aboard this weekend. She will stay on the hard (in the boatyard) for a bit while we fix her up and possibly even through hurricane season.

With the boat came a great collection of old photos from the original brochure and from the factory of her being built. There are so many that we will try to share them in a few posts, but here are a few from the brochure. The original owner was German and so all of the materials are in German, even though she was built in France.

![Amel in factory](https://cloud.githubusercontent.com/assets/13930968/25110919/327055f8-23ad-11e7-80eb-3f89fae1ddfd.JPG)

![Amel undersail](https://cloud.githubusercontent.com/assets/13930968/25110928/48357bf2-23ad-11e7-838c-a53dbe772a1d.JPG)

![Amel on deck](https://cloud.githubusercontent.com/assets/13930968/25110940/5f90718a-23ad-11e7-93a1-cddc7ff04f61.JPG)

![Amel interior](https://cloud.githubusercontent.com/assets/13930968/25110961/7b1fdeae-23ad-11e7-8cc9-3daf58c2e2a3.JPG)

![Amel labeled](https://cloud.githubusercontent.com/assets/13930968/25110971/945edd20-23ad-11e7-94bc-f710d4bc0889.JPG)

![Amel in anchorage](https://cloud.githubusercontent.com/assets/13930968/25110895/0aafb194-23ad-11e7-8323-e46444dae484.JPG)

We also found some great line drawings in with the original German brochure.

![amel line drawing](https://cloud.githubusercontent.com/assets/13930968/25111369/3d562cd8-23b0-11e7-92d6-d26eae1a4bd6.JPG)

![line drawing 2](https://cloud.githubusercontent.com/assets/13930968/25111382/53a83648-23b0-11e7-9fe9-222687b0340c.JPG)


text:
# API Endpoints for MyMICDS.net
For pretty much anything interacting with the API, you'll send a HTTP POST request to the server. Here is a list of all the endpoints and what data you will receive. Different parts of the API are grouped with different files for organization.

Most of the API's return an `error` entry in the JSON. Most of the time, the error will be null. If an error does happen to occur, it will return a string, and the other inputs will be null.

Modules or 'libraries' are were the functionality and core of the of the website is at. Each module should be relatively short and do one job and do it well. **By themselves, modules do nothing. Modules are where the functionality is.**

Endpoints or 'routes' and different URL's that you can send information to. This usually plugs directly into the modules, or serves webpages to be viewed by the user. **Routes control the URLs and the information that passes through them. Routes are the bridge between the users and the functionality.**

# Table of Contents
* [Alias API](#alias-api)
  * [`/alias/add`](#aliasadd)
  * [`/alias/list`](#aliaslist)
  * [`/alias/delete`](#aliasdelete)
* [Background API](#background-api)
  * [`/background/get`](#backgroundget)
  * [`/background/upload`](#backgroundupload)
  * [`/background/delete`](#backgroundelete)
* [Canvas API](#canvas-api)
  * [`/canvas/test-url`](#canvastest-url)
  * [`/canvas/set-url`](#canvasset-url)
  * [`/canvas/get-events`](#canvasget-events)
  * [`/canvas/get-classes`](#canvasget-classes)
* [Class API](#class-api)
  * [`/classes/get`](#classesget)
  * [`/classes/add`](#classesadd)
  * [`/classes/delete`](#classesdelete)
* [Daily Bulletin API](#daily-bulletin-api)
  * [`/daily-bulletin/list`](#daily-bulletinlist)
* [Dates API](#dates-api)
  * [`/dates/school-ends`](#datesschool-ends)
  * [`/dates/breaks`](#datesbreaks)
* [Feeds API](#feeds-api)
  * [`/feeds/update-canvas-cache`](#feedsupdate-canvas-cache)
  * [`/feeds/add-portal-queue`](#feedsadd-portal-queue)
* [Login API](#login-api)
  * [`/auth/login`](#authlogin)
  * [`/auth/logout`](#authlogout)
  * [`/auth/register`](#authregister)
  * [`/auth/confirm`](#authconfirm)
  * [`/auth/change-password`](#userchange-password)
  * [`/auth/forgot-password`](#userforgot-password)
  * [`/auth/reset-password`](#userreset-password)
* [Lunch API](#lunch-api)
  * [`/lunch/get`](#lunchget)
* [Modules API](#modules-api)
  * [`/modules/get`](#modulesget)
  * [`/modules/upsert`](#modulesupsert)
* [Notifications API](#notification-api)
  * [`/notification/get`](#notificationget)
* [Planner API](#planner-api)
  * [`/planner/get`](#plannerget)
  * [`/planner/add`](#planneradd)
  * [`/planner/delete`](#plannerdelete)
  * [`/planner/check`](#plannercheck)
  * [`/planner/uncheck`](#planneruncheck)
* [Portal API](#portal-api)
  * [`/portal/test-url`](#portaltest-url)
  * [`/portal/set-url`](#portalset-url)
  * [`/portal/get-schedule`](#portalget-schedule)
  * [`/portal/get-classes`](#portalget-classes)
  * [`/portal/day-rotation`](#portalday-rotation)
* [Statistics API](#stats-api)
  * [`/stats/get`](#statsget)
* [User API](#user-api)
  * [`/user/grad-year-to-grade`](#usergrad-year-to-grade)
  * [`/user/grade-to-grad-year`](#usergrade-to-grad-year)
  * [`/user/school-ends`](#userschool-ends)
  * [`/user/grade-range`](#usergrade-range)
  * [`/user/get-info`](#userget-info)
  * [`/user/change-info`](#userchange-info)
* [Quotes API](#quotes-api)
  * [`/quote/get`](#quoteget)
  * [`/quote/insert`](#quoteinsert)
* [Weather API](#weather-api)
  * [`/weather/get`](#weatherget)

## Alias API
The part of the API that relates to class aliases. Can be found under `src/routes/aliasAPI.js`. The associated aliases module can be found under `src/libs/aliases.js`.

### `/alias/add`
Add a class alias.

#### Parameters
- `type` - What type of alias. ('canvas'|'portal')
- `classString` - Alias string from Canvas or Portal
- `classId` - Class ID to point alias to

#### Response
- `error` - Null if successful, string containing error if failure.
- `id` - Id of alias just inserted.

## `/alias/list`
List the aliases available to the user

#### Response
- `error` - Null if successful, string containing error if failure.
- `aliases` - Object with alias types as key, value is array of alias objects.

## `/alias/delete`
Deletes an existing alias

#### Parameters
- `type` - What type of alias. ('canvas'|'portal')
- `id` - Id of alias to delete.

#### Response
- `error` - Null if successful, string containing error if failure.

## Background API
The part of the API that relates to users' backgrounds. Can be found under `src/routes/backgroundAPI.js`. The associated backgrounds module can be found under `src/libs/backgrounds.js`.

### `/background/get`
Retrieve the URL of the background to display to the user.

#### Response
- `error` - Null if successful, string containing error if failure.
- `variants` - Object of background variations and their URL (Ex. 'normal' or 'blur')
- `hasDefault` - True if using default background, false if using upload background image.

### `/background/upload`
**Requires user to be logged in.** Upload a new background picture for the user.

#### Parameters
- `background` - Background image to upload. Note that jQuery's .serialize() method does not deal with images.

#### Response
- `error` - Null if success, string containing error if failure.
- `variants` - Object of background variations and their URL (Ex. 'normal' or 'blur')
- `hasDefault` - True if using default background, false if using upload background image.

### `/background/delete`
**Requires user to be logged in.** Delete the custom background of a user.

#### Response
- `error` - Null if success, string containing error if failure.
- `variants` - Object of background variations and their URL (Ex. 'normal' or 'blur')
- `hasDefault` - True if using default background, false if using upload background image.

## Canvas API
The part of the API that relates to Canvas. Can be found under `src/routes/canvasAPI.js`. The associated canvas module can be found under `src/libs/canvas.js`.

### `/canvas/test-url`
This will test any given URL to see if it is a valid Canvas calendar feed.

#### Parameters
- `url` - A string containing the URL you want to test

#### Response
- `error` - Null if successful, string containing error if failure.
- `valid` - True if Canvas URL is valid, else a string containing what is wrong with the URL.
- `url` - Cleaned up URL to actually use.

### `/canvas/set-url`
**Requires user to be logged in.** This will test any given URL, and if valid, insert into the database.

#### Parameters
- `url` - A string containing the URL you want to set.

#### Response
- `error` - Null if successful, string containing error if failure.
- `valid` - True if Canvas URL is valid, else a string containing what is wrong with the URL.
- `url` - Cleaned up URL to actually use.

### `/canvas/get-events`
**Requires user to be logged in.** This will get any calendar events for a given month. _Refer to `/planner/get-events` if you want to retrieve the events stored on MyMICDS.net._

#### Parameters
- `year` - Year to get events from. _(Optional, defaults to current year.)_
- `month` - Month to get events from. _(Optional, defaults to current month.)_

#### Response
- `error` - Null if successful, string containing error if failure.
- `hasURL` - Whether or not the user has set a Canvas URL in the database.
- `events` - Array of events from the given month. Null if usr does not have URL set in database.

### `/canvas/get-classes`
**Requires user to be logged in.** Returns a list of Canvas classes the user has according to any events assigned on Canvas.

#### Response
- `error` - Null if successful, string containing error if failure.
- `classes` - Array of classes the user has.

## Class API
The part of the API relates to the classes. Can be found under `src/routes/classAPI.js`. The associated class and teacher module can be found under `src/libs/classes.js` and `src/libs/teachers.js`.

### `/classes/get`
**Requires user to be logged in.** This will return a list of classes the user has in the database.

#### Response
- `error` - Null if successful, string containing error if failure.
- `classes` - Array of classes the user has.

### `/classes/add`
**Requires user to be logged in.** Update/insert (also known as upsert) a class into the database.

#### Parameters
- `id` - Valid ID of class to edit. _(Optional, only send this if you want to edit a class.)_
- `name` - Name of class
- `color` - Associate a hex color while displaying the class. Please include a hash (#) at the beginning. The color can be three digits long (#XXX) or six digits long (#XXXXXX) _(Optional, if invalid or omitted, will default to a random hex color.)_
- `block` - What block the class takes place in. Please refer to `src/libs/classes.js` for a list of the valid blocks. _(Optional, defaults to block 'other'.)_
- `type` - What type of class. Please refer to `src/libs/classes.js` for a list of valid class types. _(Optional, defaults to type 'other'.)_
- `teacherPrefix` - Prefix the teacher goes by ('Mr.' or 'Ms.')
- `teacherFirstName` - First name of teacher
- `teacherLastName` - Last name of teacher

#### Response
- `error` - Null if success, string containing error if failure.
- `id` - Id of class inserted.

### `/classes/delete`
**Requires user to be logged in.** Delete a class with a certain id

### Parameters
- `id` - ID of class to delete

### Response
- `error` - Null if success, string containing error if failure.

## Daily Bulletin API
The part of the API that relates to the Daily Bulletin. Can be found in `src/routes/bulletinAPI.js`. The associated dailyBulletin module can be found under `src/libs/dailyBulletin.js`.

### `/daily-bulletin/list`
Gets an array of bulletin filenames from newest to oldest.

#### Response
- `error` - Null if success, string containing error if failure.
- `baseURL` - Base URL all Daily Bulletins are stored in.
- `bulletins` - Array of bulletins names from newest to oldest. Null if error.

## Dates API
The part of the API that realtes to dates and time. Can be found in `src/routes/datesAPI.js`. The associated dates module can be found under `src/libs/dates.js`.

### `/dates/school-ends`
Returns the date when school ends. During Summer, returns the date next school year ends.

#### Response
- `date` - Date when school ends. Last Friday of may at 11:30.

### `/dates/breaks`
Returns an object containing days we have off of school. Includes weekends, long weekends, vacations, and other.

#### Response
- `error` - Null if success, string containing error if failure.
- `breaks` - An object containing a `weekends`, `longWeekends`, `vacations`, and `other` which are arrays containing a `start` and an `end` date.

## Feeds API
The part of the API that relates to the caching of Portal and Canvas feeds. Can be found in `src/routes/feedsAPI.js`. The associates feeds modules can be found under `src/libs/feeds.js`.

### `/feeds/add-portal-queue`
Adds a user to the Portal cache refresh queue.

#### Response
- `error` - Null if success, string containing error if failure.

### `/feeds/update-canvas-cache`
Updates a user's Canvas cache.

#### Response
- `error` - Null if success, string containing error if failure.

## Login API
The part of the API that relates to the login system. Can be found in `src/routes/loginAPI.js`. The associated auth and jwt modules can be found under `src/libs/auth.js` and `src/libs/jwt.js`.

### `/auth/login`
If valid credentials are entered, it will log a user in by associating their session with a username.

#### Parameters
- `user` - Username to log into.
- `password` - Plaintext password to compare against the database.
- `remember` - If set to true, JSON Web Token will expire in 30 days compared to only 12 hours. _(Optional, by default it will be set to true.)_

#### Response
- `error` - Null if success, string containing error if failure.
- `success` - Whether or not the credentials were valid.
- `jwt` - String containing JSON Web Token to store on the client, and send in the header for every API request. Normal JWT will time out in 12 hours, or 30 days if 'remember' was set to true.

### `/auth/logout`
**Requires user to be logged in.** Will revoke JSON Web Token sent with the request.

#### Response
- `error` - Null if success, string containing error if failure.

### `/auth/register`
Will create a new user and send an email to confirm the user's account.

#### Parameters
- `user` - Username. This is the first part of a user's MICDS email, for example if you had the email<EMAIL_ADDRESS>your username would be 'example'
- `password` - Plaintext password
- `firstName` - First name
- `lastName` - Last name
- `gradYear` - Year user graudates from high school.
- `teacher` - If teacher or faculty, give this any value. If set this will override any `grad-year` parameter. This matches the behavior of regular HTML checkboxes which will automatically set the value to 'on' if they are checked, and not submit any value if they are not checked. It will also ignore teacher if set to false. Overrides graduation year. _(Optional, by default user will not be a teacher.)_

#### Response
- `error` - Null if success, string containing error if failure.

### `/auth/confirm`
Confirm a newly registered account. Hash is sent via email.

#### Parameters
- `user` - Username of account to confirm.
- `hash` - Hash that was sent in the confirmation email.

#### Response
- `error` - Null if successful, string containing error if failure.

## Lunch API
This is the part of the API that relates to the lunch. Can be found in `src/routes/lunchAPI.js`. The associated lunch module can be found in `src/libs/lunch.js`.

### `/lunch/get`
Gets the lunch?

#### Parameters
- `year` - Year to get lunch from. _(Optional, defaults to current year.)_
- `month` - Month to get lunch from. _(Optional, defaults to current month.)_
- `day` - Day to get lunch from. _(Optional, defaults to current day.)_

#### Response
- `error` - Null if success, string containing error if failure.
- `lunch` - JSON object containing lunch for the week. **If there is no lunch for a specific day, then no object will be returned for that day. This means during breaks, this will be an empty object.**

## Modules API
This is the part of the API that relates to the homepage modules. Can be found in `src/routes/modulesAPI.js`. The associated modules module (heh) can be found in `src/libs/modules.js`.

### `/modules/get`
**Requires user to be logged in.** Returns a list of modules user has for their custom homepage.

#### Response
- `error` - Null if success, string containing error if failure.
- `modules` - Array of modules.

### `/modules/upsert`
**Requires user to be logged in.** Update/insert (also known as upsert) all of a user's modules.

#### Parameters
- `modules` - Array of modules to set.

#### Response
- `err` - Null if success, string containing error if failure.

## Planner API
This is the part of the API that relates to the planner. Can be found in `src/routes/plannerAPI.js`. The associated planner and checkedEvents modules can be found in `src/libs/planner.js` and `src/libs/checkedEvents.js`.

### `/planner/get`
**Requires user to be logged in.** Returns a list of the user's events. Refer to /canvas/get for retrieving Canvas-related events.

#### Response
- `error` - Null if success, string containing error if failure.
- `events` - Array of events.

### `/planner/add`
**Requires user to be logged in.** Update/insert (also known as upsert) an event in user's planner.

#### Parameters
- `id` - Valid ID of event to edit. _(Optional, only send this if you want to edit an event.)_
- `title` - Name of event
- `desc` - Description of event. _(Optional, defaults to empty string.)_
- `classId` - Class ID to associate event with. _(Optional, defaults to null)_
- `start` - JavaScript date object containing starting date. _(Optional, defaults to current date.)_
- `end` - JavaScript date object containing starting date. _(Optional, defaults to current date.)_

#### Response
- `error` - Null if success, string containing error if failure.
- `events` - Array of events (same as `/planner/get`).

### `/planner/delete`
**Requires user to be logged in.** Delete an event with a certain id

#### Parameters
- `id` - ID of event to delete

#### Response
- `error` - Null if success, string containing error if failure.

### `/planner/check`
**Requires user to be logged in.** Marks a planner event as completed.

#### Parameters
- `id` - Event id

#### Response
- `error` - Null if success, string containing error if failure.

### `/planner/uncheck`
**Requires user to be logged in.** Marks a planner event as uncompleted.

#### Parameters
- `id` - Event id

#### Response
- `error` - Null if success, string containing error if failure.

## Portal API
This is the part of the API that relates to the Portal. Can be found under `src/routes/portalAPI.js`. The associated portal module can be found under `src/libs/portal.js`.

### `/portal/test-url`
This will test any given URL to see if it is a valid Portal calendar feed.

#### Parameters
- `url` - A string containing the URL you want to test

#### Response
- `error` - Null if successful, string containing error if failure.
- `valid` - True if portal URL is valid, else a string containing what is wrong with the URL.
- `url` - Cleaned up URL to actually use.

### `/portal/set-url`
**Requires user to be logged in.** This will test any given URL, and if valid, insert into the database.

#### Parameters
- `url` - A string containing the URL you want to set

#### Response
- `error` - Null if successful, string containing error if failure.
- `valid` - True if Portal URL is valid, else a string containing what is wrong with the URL.
- `url` - Cleaned up URL to actually use.

### `/portal/get-schedule`
**Requires user to be logged in.** This will retrieve a user's schedule for a given date.

#### Parameters
- `year` - Year to get schedule from. _(Optional, defaults to current year.)_
- `month` - Month to get schedule from. _(Optional, defaults to current month.)_
- `day` - Day to get schedule from. _(Optional, defaults to current day.)_

### Response
- `error` - Null if successful, string containing error if failure.
- `schedule` - JSON object containing information about the user's day.
- `schedule.day` - What rotation day it is. (This will be an integer between inclusive 1 to 6, or null.)
- `schedule.classes` - An array of objects containing information about the user's classes for that day. This contains a date when the class starts, when the class ends, and the name of the class.
- `schedule.allDay` - This is an array of strings containing events that take place throughout the whole day, and have no specific time.

### `/portal/get-classes`
**Requires user to be logged in.** Returns a list of Portal classes the user has according to their schedule.

#### Response
- `error` - Null if successful, string containing error if failure.
- `classes` - Array of classes the user has.

### `/portal/day-rotation`
Returns an object of all the schedule day rotations we can get.

#### Response
- `error` - Null if successful, string containing error if failure.
- `days` - Object containing integers 1-6 organized by year, month, and date (Ex. January 3rd, 2017 would be `day.2017.1.3`).

## Statistics API
This is the part of the API that relates to MyMICDS usage statistics. Can be found under `src/routes/statsAPI.js`. The associated stats module can be found under `src/libs/stats.js`.

### `/stats/get`
Query the database to get usage statistics for amount of registered users, amount of active users, and amount of users registered today.

#### Response
- `error` - Null if successful, string containing error if failure.
- `stats` - Object containing statistics.

## Snowday Calculator API
This is the part of the API that relates to the [Snowday Calculator](http://www.snowdaycalculator.com/calculator.php). Can be found under `src/routes/snowdayAPI.js`. The associated snowday calculator module can be found under `src/libs/snowdayCalculator.js`.

### `/snowday/calculate`
Query the Snowday Calculate to get data for the next two days

#### Response
- `error` - Null if success, string containing error if failure.
- `data` - Object containing date as key, object containing data as value.

## Sports API
This is the part of the API that relates to the sports API. Scores are queried using the Rams Army app's API. Can be found under `src/routes/sportsAPI.js`. The associated sports module can be found under `src/libs/sports.js`.

### `/sports/scores`
Query the Rams Army app to get scores and events for MICDS athletics.

#### Response
- `error` - Null if success, string containing error if failure.
- `scores` - Object containing a scores array and an events array

## User API
This is the part of the API that relates to the user. Can be found under `src/routes/userAPI.js`. The associated user module can be found under `src/libs/users.js`.

### `/user/grad-year-to-grade`
A little utility that convert a high school graduation year into a grade.

#### Parameters
- `year` - Class graduation year.

#### Response
- `grade` - Grade of class. If the grade is Junior-Kindergarten (JK) or Senior-Kindergarten (SK) then the respective -1 and 0 integers are returned.

### `/user/grade-to-grad-year`
A little utility that converts a grade into a high school graduation year.

#### Parameters
- `grade` - Grade of class. If you want to enter the grade Junior-Kindergarten (JK) or Senior-Kindergarten (SK) then insert the respective integers -1 and 0.

#### Response
- `year` - Class graduation year.

### `/user/grade-range`
Returns an array of school graduation years from Junior Kindergarten to 12th grade.

#### Response
- `gradYears` - Array of graduation years spanning K-12

### `/user/get-info`
**Requires user to be logged in.** Get basic information about the user such as name and grade. You can also get canvasURL and portalURL. If canvasURL or portalURL is not set, they will be null.

#### Response
- `error` - Null if success, string containing error if failure.
- `user` - Object containing basic information about the user.

### `/user/change-info`
**Requires user to be logged in.** Change basic information about the user including first name, last name, and graduation year.

#### Parameters
- `firstName` - What to change first name to. _(Optional, default will not change first name.)_
- `lastName` - What to change last name to. _(Optional, default will not change last name.)_
- `gradYear` - What to change graduation year to. _(Optional, default will not change graduation year.)_
- `teacher` - Whether user is teacher. If set to any value besides false, user will be changed to teacher. This overrides graduation year. _(Optional, default will not change to teacher.)_

### Response
- `error` - Null if success, string containing error if failure.

### `/user/change-password`
**Requires user to be logged in.** Change user's password.

#### Parameters
- `oldPassword` - Old password to confirm it's actual user.
- `newPassword` - New password to change to.

#### Response
- `error` - Null if success, string containing error if failure.

### `/user/forgot-password`
Sends an email to a user if they forgot their password. **Does not actually change password at this point, just sends email.**

#### Parameters
- `user` - Username

#### Response
- `error` - Null if success, string containing error if failure.

### `/user/reset-password`
Resets a user's password after clicking on the link from email sent by `/user/forgot-password`.

#### Parameters
- `user` - Username.
- `password` - Plaintext password to change account to.
- `hash` - Random string embedded in link to confirm user received the email.

#### Response
- `error` - Null if success, string containing error if failure.

## Notifications API
This is the part of the API that relates to the sidebar notifications. Can be found under `src/routes/notificationAPI.js`. The associated notification module can be found under `src/libs/notification.js`.

### `/notification/get`
Get the list of notifications.

#### Parameters

#### Response
- `events` - List of notifications

## Quotes API
The part of the API that relates to the quotes page. Can be found under `src/routes/quotesAPI.js`.

### `/quote/get`
Get a random quote

#### Response
- `error` - Null if successful, string containing error if failure.
- `quote` - A random quote

### `/quote/insert`
Inserts a quote into the database

#### Paramaters
- `author` - the author of the quote
- `quote` - the quote

## Weather API
This is the part of the API that relates to the weather at MICDS. Can be found under `src/routes/weatherAPI.js`. The associated weather module can be found under `src/libs/weather.js`.

### `/weather/get`
Get the available weather data for MICDS.

#### Parameters

#### Response
- `error` - Null if success, string containing error if failure.
- `weather` - JSON object with the weather if success, null if failure.

path: /API Endpoints.md

filename: API Endpoints.md


text:
# ParaLibrary API

The API for the ParaLibrary application\
All routes start with `http://paralibrary.digital/api`\
Any requests except the Authentication requests must include credentials and have a valid session. Otherwise, the server will respond with a `403`.

---

### Table of Contents

- [Authentication](#authentication)
- [Libraries](#libraries)
- [Books](#books)
- [Users](#users)
- [Friends](#friends)
- [Loans](#loans)
- [Categories](#categories)

---

# Authentication

|   Type | Route          | Description                    |
| -----: | -------------- | ------------------------------ |
| `POST` | `/auth/login`  | Start an authenticated session |
| `POST` | `/auth/logout` | Destroy the current session    |

## `POST /login`

### Fetch Format

```json
{
  "tokenid": "..."
}
```

### Response

After authenticating, the server will respond with status `200` and the following JSON object, indicating the user, whether a new user was created or not, and how long the session lasts. If authentication fails, the server will respond with status `401`.

```json
{
  "userid": "123",
  "new": false,
  "maxAge": "123"
}
```

## `POST /logout`

### Fetch Format

None

### Response

The server will respond with status `200` upon successful logout and status `401` if the session no longer exists.

# Libraries

### Library Object

```json
{
  "user": {
    "user object": "See User Object"
  },
  "books": [
    {
      "book object": "See Book Object"
    },
    {
      "book object": "See Book Object"
    }
  ]
}
```

### Routes

|  Type | Route            | Description                    |
| ----: | ---------------- | ------------------------------ |
| `GET` | `/libraries`     | Get the current user's library |
| `GET` | `/libraries/:id` | Get the library for user :id   |

## `GET /libraries`

### Fetch Format

None

### Response

On success, returns status `200` and a **Library Object**. On failure, returns status `404`. It will return all books owned by the user, regardless of book status.

## `GET /libraries/:id`

### Fetch Format

None

### Response

On success, returns status `200` and a **Library Object**. If the current user is friends with the :id user, it will include all books with visibility "public" and "friends". If they are not friends, it will only return "public" books.

# Books

### Book Object

Visibility can be one of ("public" | "private" | "friends").\
The property `loan` will be the loan with the most recent `request_date`. The **Loan Object** here will not include the book property to avoid infinite recursion.

```json
{
  "id": "123",
  "user_id": "123",
  "title": "A Book Title",
  "author": "An Author Name",
  "isbn": "1234567890123",
  "summary": "Can be very long",
  "visibility": "public",
  "categories": ["Horror", "Favorites", "Sci Fi"],
  "loan_count": "123",
  "loan": {
    "loan object": "See Loan Object (without the book property)"
  }
}
```

### Routes

|     Type | Route        | Description                        |
| -------: | ------------ | ---------------------------------- |
|   `POST` | `/books`     | Create a new book                  |
|    `GET` | `/books/:id` | Get a single book object by its id |
|    `PUT` | `/books/:id` | Modify a book object by its id     |
| `DELETE` | `/books/:id` | Delete a book object by its id     |

## `POST /books`

### Fetch Format

Expects a partial **Book Object** as JSON in the body of the request. See below for the fields. The visibility will be public if not specified.

```json
{
  "user_id": "123",
  "title": "A Book Title",
  "author": "An Author Name (optional)",
  "isbn": "1234567890123 (optional)",
  "summary": "Can be very long (optional)",
  "visibility": "public",
  "categories": ["optional", "array", "of categories"]
}
```

### Response

On success, returns status `200` and following JSON with the id of the inserted book. If the required fields are not supplied, returns status `400`. If the book was not inserted to the db for any other reason, returns a `404` and no JSON.

```json
{
  "id": "123"
}
```

## `GET /books/:id`

### Fetch Format

None

### Response

On success, returns status `200` and a single **Book Object** matching the :id. If no matching book exists, returns status `404`.

## `PUT /books/:id`

### Fetch Format

Expects a full **Book Object** in the body of the request. The book record in the db will be updated to match the given book object.\
Categories are updated\
Loan information is NOT updated through this route\

### Response

On success, returns status `200`. If the book does not exist, returns status `404`.

## `DELETE /books/:id`

### Fetch Format

None

### Response

On success, responds with status `200`. On failure, responds with status `404`.

# Users

### User Object

Status is one of (null | "requested" | "waiting" | "friends")\
Status will be null if the :id user is either the current user or they have no relation to the current user at all.

```json
{
  "id": "123",
  "name": "Up to 255 chars",
  "status": "friends",
  "picture": "https://lh3.googleusercontent.com/...",
  "email"<EMAIL_ADDRESS>}
```

### Routes

|     Type | Route                 | Description                                |
| -------: | --------------------- | ------------------------------------------ |
|    `GET` | `/users`              | Get the current user's object by id        |
|    `GET` | `/users/:id`          | Get user object by id                      |
|    `PUT` | `/users/:id`          | Modify the user object by id               |
| `DELETE` | `/users/:id`          | Delete the user user by id.                |
|    `GET` | `/users/search/:name` | Get list of users matching the name string |

## `GET /users/:id`

### Fetch Format

None

### Response

On Success, returns status `200` and a **User Object**. If the user does not exist, returns `404`. If the :id parameter is not a number, returns `400`.

## `PUT /users/:id`

### Fetch Format

Expects a partial **User Object** in the body of the request. The `status` property is ignored.

### Response

On success, responds with status `200` and the db record will be updated to match the given object. At this time, only the name is malleable. If the user is not found, returns status `404`.

## `DELETE /users/:id`

### Fetch Format

The delete route will only work if the id passed in is the same as the current user's id. otherwise, a `403` status will be returned.

### Response

On Success, responds with status `200`. On failure, responds with status `404`.

## `GET /users/search/:name`

### Fetch Format

None

### Response

On success, returns status `200` and a JSON array of **User Objects** matching `'name%'`. Limit is 20 results

```json
[
  { "user object": "See User Object" },
  { "user object": "See User Object" },
  { "user object": "See User Object" }
]
```

# Friends

### Routes

|   Type | Route                | Description                                                                                |
| -----: | -------------------- | ------------------------------------------------------------------------------------------------- |
|  `GET` | `/friends`           | Returns the current user's friends and people who have requested friendship with the current user |
|  `GET` | `/friends/requested` | Returns friends the current user has requested friendship with, but they haven't responded        |
|  `GET` | `/friends/suggested` | Returns up to 10 user objects that the current user has tangential, but not direct, relation to   |
| `POST` | `/friends/:id`       | Set the friendship status from the current user to the target user                                |

## `GET /friends`

### Fetch Format

None

### Response

On success, returns a JSON object containing an array of **User Objects**.

```json
[
  { "user object": "See User Object" },
  { "user object": "See User Object" },
  { "user object": "See User Object" }
]
```

## `GET /friends/requested`

### Fetch Format

None

### Response

On success, returns status `200` and JSON array of **User Objects**. Format will be the same as the `GET /friends` route.

## `GET /friends/suggested`

### Fetch Format

None

### Response

On success, returns status `200` and a JSON array of **User Objects**. Format will be the same as the `GET /friends` route.

## `POST /friends/:id`

### Fetch Format

The body of the request must contain a JSON object with the id of the target user a selected action. Action can be one of ("request" | "accept" | "reject").\
To request friendship with user 123,

```json
{
  "id": "123",
  "action": "request"
}
```

To accept friendship with user 9001,

```json
{
  "id": "9001",
  "action": "accept"
}
```

To reject friendship with user 9001,

```json
{
  "id": "9001",
  "action": "reject"
}
```

### Response

On success, return status `200`. If the id in the URL does not match the id in the JSON or no action is provided, return `400`. On other failure, return status `404`.

# Loans

### Loan Object

The timestamps are return as strings\
Status can be one of ("pending" | "accepted" | "loaned" | "returned" | "canceled" | "declined")

```json
{
  "id": "123",
  "requester_id": "123",
  "book_id": "123",
  "request_date": "2020-04-16T22:38:49.000Z",
  "accept_date": "2020-04-16T22:38:49.000Z",
  "loan_start_date": "2020-04-16T22:38:49.000Z",
  "loan_end_date": "2020-04-16T22:38:49.000Z",
  "status": "One of five status enums",
  "book": {
    "id": "123",
    "user_id": "456",
    "title": "Up to 255 chars",
    "author": "Up to 255 chars",
    "isbn": "101-0-10-101010-1",
    "visibility": "One of three book visibility enums",
    "summary": "Up to 255 chars",
    "categories": ["Example", "AnotherExample"]
  },
  "owner": {
    "User object": "See User Object"
  },
  "requester": {
    "User object": "See User Object"
  }
}
```

### Routes

|     Type | Route              | Description                                            |
| -------: | ------------------ | ------------------------------------------------------ |
|    `GET` | `/loans`           | Get all loans where the user is the owner or requester |
|   `POST` | `/loans`           | Create a new loan                                      |
|    `GET` | `/loans/owner`     | Get all the loans where the user is the owner          |
|    `GET` | `/loans/requester` | Get all the loans where the user is the requester      |
|    `GET` | `/loans/:id`       | Get a single loan by its id                            |
|    `PUT` | `/loans/:id`       | Modify a loan by its id                                |
| `DELETE` | `/loans/:id`       | Delete a loan by its id                                |

## `GET /loans`

### Fetch Format

None

### Response

On success, returns status `200` and an array of **Loan Objects**. On failure, return a `404`.

```json
[
  { "loan object": "See Loan Object" },
  { "loan object": "See Loan Object" },
  { "loan object": "See Loan Object" }
]
```

## `POST /loans`

### Fetch Format

Expects the requester_id, book_id, and status in the body of the request (the status should be 'pending').

### Response

On success, responds with status `200`. On failure, responds with status `404`.

## `GET /loans/owner`

### Fetch Format

None

### Response

Same as `GET /loans` route

## `GET /loans/requester`

### Fetch Format

None

### Response

Same as `GET /loans` route

## `GET /loans/:id`

### Fetch Format

None

### Response

On success, returns status `200` and a single **Loan Object** matching the :id. On failure, returns status `404`.

## `PUT /loans/:id`

### Fetch Format

Expects the id, book_id, and status in the body of the request (status should be anything but 'pending').

### Response

On success, responds with status `200` and the db record will be updated to match the given object. If the loan is not found, returns status `404`.

## `DELETE /loans/:id`

### Fetch Format

None

### Response

On success, returns status `200` and deletes the loan record from the db. On failure, returns status `404`.

repository: ParaLibrary/paralibrary-backend

gha_language: JavaScript

repo_name: ParaLibrary/paralibrary-backend


text:
## CancelFailedWithdrawTicket

**Category:** System
**Permissions:** Operator
**Call Type:** Synchronous

Cancels any single failed or resubmitted-failed withdraw ticket.

Only a user with Operator permission can cancel a failed withdraw ticket.

### Request

```json
{
    "omsId": 0,
    "ticketId": 0
}
```

| Key      | Value                                                        |
| -------- | ------------------------------------------------------------ |
| omsId    | **integer.** The ID of the Order Management System on which the failed withdraw ticket was created. |
| ticketId | **long integer.** The ID of the specific ticket that must be canceled. |

### Response

```json
{
    "result": false,
    "errormsg": "Invalid Request",
    "errorcode": 100,
    "detail": "Invalid OMSId"
}
```

The response indicates that the system has received the **CancelFailedWithdrawTicket** Request, not that the failed withdraw ticket has been canceled. You can check the status of a withdraw ticket by using **GetWithdrawTicket.**

| Key       | Value                                                        |
| --------- | ------------------------------------------------------------ |
| result    | **Boolean.** A successful receipt of the failed withdraw ticket cancellation request returns *true;* an unsuccessful receipt (an error condition) returns *false.* |
| errormsg  | **string.** A successful receipt of the failed withdraw ticket cancellation request returns *null;* the *errormsg* field for an unsuccessful request returns one of the following messages:
Not Authorized (errorcode 20)
Invalid Request (errorcode 100)
Operation Failed (errorcode 101)
Server Error (errorcode 102)
Resource Not Found (errorcode 104) |
| errorcode | **integer.** A successful receipt of the failed withdraw ticket cancellation request returns 0. An unsuccessful receipt returns one of the *errorcodes* shown in the *errormsg* list. |
| detail    | **string.** Message text that the system may send. Usually *null.* |

repository: alphapoint/slate

gha_license_id: NOASSERTION

repo_name: alphapoint/slate


text:
# 40. Combination Sum II

https://leetcode.com/problems/combination-sum-ii/description/

Given a collection of candidate numbers (`candidates`) and a target number (`target`), find all unique combinations in `candidates` where the candidate numbers sum to `target`.

Each number in `candidates` may only be used once in the combination.

**Note:** The solution set must not contain duplicate combinations.

**Example 1:**

```
Input: candidates = [10,1,2,7,6,1,5], target = 8
Output:
[
[1,1,6],
[1,2,5],
[1,7],
[2,6]
]
```

**Example 2:**

```
Input: candidates = [2,5,2,1,2], target = 5
Output:
[
[1,2,2],
[5]
]
```

**Constraints:**

```
1 <= candidates.length <= 100
1 <= candidates[i] <= 50
1 <= target <= 30
```

repository: gaborszekely/LeetCode

gha_language: Java

repo_name: gaborszekely/LeetCode


text:
# Coeloperix sleighi Gong & Song, 2004 SPECIES

#### Status
ACCEPTED

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

#### Published in
Gong & Song. 2004. Re-establishment of the cyrtophorid genus Coeloperix Deroux, nov. gen. , with a description of Coeloperix sleighi nov. spec. (Protozoa, Ciliophora, Cyrtophorida). European Journal of Protistology 40(2) : 175-181

#### Original name
null

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# Babel

## Links

* [Awesome Babel](https://github.com/babel/awesome-babel#readme)
* [ts-babel](https://github.com/andy-hanson/ts-babel) - Example project showing how to use babel with TS with pipelines.
* [Jason Miller on Modern JavaScript and the Future of preset-env \(2020\)](https://overcast.fm/+S2WFIV_5Y)
* [Nicolò Ribaudo - How to write your first Babel plugin \(2019\)](https://www.youtube.com/watch?v=UeVq_U5obnE)
* [babel-plugin-transform-define](https://github.com/FormidableLabs/babel-plugin-transform-define) - Compile time code replacement for babel similar to Webpack's DefinePlugin.

repository: woodrowpearson/gitbook-public

repo_name: woodrowpearson/gitbook-public


text:
# UltimateAdmin

UltimateAdmin is an application built for system administrators to query Windows machines in Active Directory for the purposes of machine management.  While some of this information can be readily obtained from the Active Directory Users & Computers MMC snap-in, this tool compiles the information together in a format that is easier for managing a specific device.

Users of the application should have an administrative account in an Active Directory domain with admin rights on the target computers to use the application as intended.  Upon launching the application, it will prompt the user to run it in an elevated state.  The benefit to this is that users of the application can be logged on as a standard user so that only functions related to system administration are run in the "sandbox" of the app.  This provides a separation of concerns in terms of the admin's responsibilities.

The application can be launched from a machine that is not part of an Active Directory domain, and it will run in DEMO mode to showcase how the basic functionality works.  When running it outside an AD domain, you will see the below message, after which the app will run in DEMO mode:

![AD_Error.jpg](https://github.com/Jarodimus/UltimateAdmin/blob/master/Screenshots/AD_Error.jpg)

Features
---
1. Search Active Directory using a wildcard search, targeting either machine name or description keywords.

2. From the search, double-click to open the machine to obtain detailed information including online status, timestamped at last refresh.

1. Configure custom groups to query only specified organizational units for faster querying in very large domains or slow networks.

2. Query logged in user.

4. Update computer description in AD.

5. Obtain Bit Locker Recovery Key if available.

6. Query security group memberships

7. Automatic querying of detailed system information such as:
	- Type: Desktop/Laptop
    - BIOS: Current level
    - Make/Model: Brand, model information
    - Serial: Machine serial number
    - OS: Current Operating System

8. Manage local administrators and remote desktop users on the target machine.

9. Access the machine from Microsoft's built-in remote access tools: Remote Desktop and Remote Assist.

10. Remote shutdown and restart.

11. Manage remote machines using alternative to PSEXEC, PAEXEC: [https://github.com/poweradminllc/PAExec](https://github.com/poweradminllc/PAExec)

12. Quickly access built-in tools such as Active Directory Users and Computers, Computer Management, Registry Editor, PAExec, and the Command Line all running as administrator from the menu.

Below is a screenshot of the app in demo mode:

![MainWindow.jpg](https://github.com/Jarodimus/UltimateAdmin/blob/master/Screenshots/MainWindow.jpg)

repository: radtek/UltimateAdmin

repo_name: radtek/UltimateAdmin


text:
Mongo Scripts Runner
=========================

MongoDB script IDE is modified from [Edi](https://edi.codeplex.com/) to run scripts using mongo.exe in background.

## Requirements

* Visual Studio 2010 or higher
* Change MongoBinDirectory setting in app.config from Edi project.

repository: Kiho/mongo-edi

repo_name: Kiho/mongo-edi


text:
---
name: 🐞 Bug report
about: Create a report about something that is not working
---

<!--
Please keep in mind that the GitHub issue tracker is not intended as a general support forum, but for reporting **non-security** bugs and feature requests.
-->

### Describe the bug
A clear and concise description of what the bug is.

### To Reproduce
<!--
Provide the log.txt with the error observed, along with project file(s) and / or if possible minimalistic repro project hosted in a GitHub repo.
-->

### Exceptions (if any)
<!--
Include the exception you get when facing this issue
-->

### Further technical details
- Windows version and bitness info (32-bit or 64-bit)
- Include the output of `dotnet --list-sdks`
- Include the output of `upgrade-assistant --version`

branch_name: refs/heads/main


text:
[![Build Status](https://travis-ci.org/aseemk/requireDir.svg?branch=master)](https://travis-ci.org/aseemk/requireDir)
[![npm version](https://badge.fury.io/js/require-dir.svg)](http://badge.fury.io/js/require-dir)

# requireDir()

Node helper to `require()` directories. The directory's files are examined,
and each one that can be `require()`'d is `require()`'d and returned as part
of a hash from that file's basename to its exported contents.

## Example

Given this directory structure:

```
dir
+ a.js
+ b.json
+ c.coffee
+ d.txt
```

`requireDir('./dir')` will return the equivalent of:

```js
{ a: require('./dir/a.js')
, b: require('./dir/b.json')
}
```

And if CoffeeScript has been registered via `require('coffee-script/register')`,
`c.coffee` will also be returned.

## Installation

```
npm install require-dir
```

Note that this package is *not* `requireDir` — turns out that's already
[taken](https://github.com/JamesEggers1/node-requiredir)! ;)

## Usage

Basic usage that examines only directories' immediate files:

```js
var requireDir = require('require-dir');
var dir = requireDir('./path/to/dir');
```

You can optionally customize the behavior by passing an extra options object:

```js
var dir = requireDir('./path/to/dir', {recurse: true});
```

## Options

`recurse`: Whether to recursively `require()` subdirectories too.
(`node_modules` within subdirectories will be ignored.)
Default is false.

`camelcase`: Automatically add camelcase aliases for files with dash- and
underscore-separated names. E.g. `foo-bar.js` will be exposed under both the
original `'foo-bar'` name as well as a `'fooBar'` alias. Default is false.

`duplicates`: By default, if multiple files share the same basename, only the
highest priority one is `require()`'d and returned. (Priority is determined by
the order of `require.extensions` keys, with directories taking precedence
over files if `recurse` is true.) Specifying this option `require()`'s all
files and returns full filename keys in addition to basename keys.
Default is false.

E.g. in the example above, if there were also an `a.json`, the behavior would
be the same by default, but specifying `duplicates: true` would yield:

```js
{ a: require('./dir/a.js')
, 'a.js': require('./dir/a.js')
, 'a.json': require('./dir/a.json')
, b: require('./dir/b.json')
, 'b.json': require('./dir/b.json')
}
```

There might be more options in the future. ;)

## Tips

If you want to `require()` the same directory in multiple places, you can do
this in the directory itself! Just make an `index.js` file with the following:

```js
module.exports = require('require-dir')();   // defaults to '.'
```

And don't worry, the calling file is always ignored to prevent infinite loops.

## TODO

It'd be awesome if this could work with the regular `require()`, e.g. like a
regular `require()` hook. Not sure that's possible though; directories are
already special-cased to look for an `index` file or `package.json`.

An `ignore` option would be nice: a string or regex, or an array of either or
both, of paths, relative to the directory, to ignore. String paths can be
extensionless to ignore all extensions for that path. Supporting shell-style
globs in string paths would be nice.

Currently, basenames are derived for directories too — e.g. a directory named
`a.txt` will be returned as `a` when recursing — but should that be the case?
Maybe directories should always be returned by their full name, and/or maybe
this behavior should be customizable. This is hopefully an edge case.

## License

MIT. © 2012-2015 Aseem Kishore.

gha_language: PHP


text:
<!-- README.md is generated from README.Rmd. Please edit that file -->

# ggvega

<!-- badges: start -->

[![CRAN
status](https://www.r-pkg.org/badges/version/ggvega)](https://cran.r-project.org/package=ggvega)
[![Lifecycle:
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![Travis build
status](https://travis-ci.org/vegawidget/ggvega.svg?branch=master)](https://travis-ci.org/vegawidget/ggvega)
<!-- badges: end -->

The goal of **ggvega** is to translate a ggplot2 object to a Vega-Lite
specification.

``` r
library(ggvega)
#> Welcome to ggvega; this package is not yet fully functional, and is under active development.
library(ggplot2)

p <-
  ggplot(iris) +
  geom_point(aes(x = Petal.Width, y = Petal.Length, colour = Species))

as_vegaspec(p)
```

![](man/figures/README-example-1.svg)<!-- -->

### Important Note

This package is in an *extremely* experimental state, under *very*
active development.

At present, we can translate:

  - `geom_point()`
  - aesthetics: `x`, `y`, `colour`
  - unit-plots; no facetting.

We have plans to expand this capability; presently, we are working out a
system to add new capabilities quickly and reliably.

## Installation

You can install the development version from
[GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
devtools::install_github("vegawidget/ggvega")
```

repository: vegawidget/ggvega

gha_language: HTML

repo_name: vegawidget/ggvega


text:
# Crate 👕👖📦

> A Full-Stack Project by:

[Bret Merritt,](https://github.com/bretm9)

[Daniel Lessenden,](https://github.com/D-Lessenden)

[Hashim Gari,](https://github.com/#5hashmaster3k)

[Logan Riffel,](https://github.com/#4lkriffell)

[Matthew Lane,](https://github.com/GreyMatteOr)

and [Michael Walker](https://github.com/MichaelEWalker87)

## Contents

1. [Technologies](#technologies)
1. [Overview](#overview)
1. [Setup](#setup)
1. [multi Package Automation](#multi-package-automation)
1. [Design](#design)
1. [Evolution](#evolution)
1. [Challenges](#challenges)
1. [Successes](#successes)

 ## Technologies

  - Javascript
  - React
  - Redux
  - Node
  - Express
  - Postgress
  - GraphQL
  - Sequelize (MySQL)
  - Jest
  - Axios
  - Server Side Rendering
  - Git
  - Written in ES6+ using Babel + Webpack

> [Back to the top](#crate)

## Overview

  This application is a full-stack project for Module 4 at Turing School of Software and Design. This repo was forked from [atulmy's open source repo.](https://github.com/atulmy/crate) Our goal was to plan, design, and implement a new feature into an unfamiliar code-base. We had 2 weeks to complete the task. The first week we spent getting to know the code-base, drawing out our data-flow, and designing wireframes. The second week we spent coding in our new feature.

  Our feature was a style survey that appears for the user when they first subscribe to a monthly crate subscription. This survey is built with the intent to refine the user's subscription to best fit their personal style.

> [Back to the top](#crate)

## Setup

- Prerequisites
  - Node
  - MySQL (or Postgres / Sqlite / MSSQL)
- Clone repo `git clone git@github.com:GreyMatteOr/crate.git crate`
- Navigate to the `code` directory `cd code`
- Configurations
  - Modify `/api/src/config/database.json` for database credentials
   - `"username"` is `"postgres"` or your pg username
   - `"database"` is `"crate"`
   - `"dialect"` is `"postgres"`
- Setup
  - API: Install packages and database setup (migrations and seed) `cd api` and `npm run setup`
  - Webapp: Install packages
   - Navigate to `code/web/` directory and `npm install`
- Development
  - Run API `cd api` and `npm start`, browse GraphiQL at http://localhost:8000/
  - Run Webapp `cd web` and `npm start`, browse webapp at http://localhost:3000/
- Production

> [Back to the top](#crate)

## Design

  For our survey feature, We have two types of pages. A survey page, which is repeated several times until the survey is complete (populated with new items), and a result page.

  Each survey page lists several clothing items to choose from. Each item has a style attribute associated with it that our application keeps track of. The user can select as many or as few items as they like, and after navigating through several different survey pages the "Next" button will read "View Results"

  Upon clicking "View Results" The user is brought to the result page where they see their style title, and images that match that style.

> [Back to the top](#crate)

## Evolution

  For this project we used a [GitHub Project Board](https://github.com/GreyMatteOr/Crate/projects/1) to plan out our course-of-action, as well as [excalidraw.com](https://excalidraw.com/) to map out our data-flow, and wireframes to visualize our design.

  Data-flow:

  Wireframes:

* Survey Page

* Overview Page (to be added)

* Final Result Page

> [Back to the top](#crate)

## Challenges

  One challenge the front-end faced was testing redux-connected components with Jest. Mocking the right redux functionality to make tests run, while also maintaining functionality that we could test proved to be quite time-consuming, but ended up being an excellent learning experience.

  On the back-end, it was challenging to dive into a new code base. JavaScript was a foreign language for all of us so it took some time to become acquainted with the existing code. We believe we overcame that challenge, we met all objectives and tasks that were assigned to us and even got around to testing the pre-existing code. We went from 0% coverage at the start of the project to 80% coverage by the final code freeze. I have heard that Turing does not teach people a language but how to learn languages and I can say I fully appreciate that sentiment after this project.

> [Back to the top](#crate)

## Successes

  We learned we all could become familiar with a new code-base with unknown techs in a matter of days! The necessity of understanding the ways various technologies that were implemented in order to be able to add our new feature  was a great way to force us to become fluent in the code-base quickly.

  The fact that Redux was previously integrated into this repo in a somewhat unconvential way made it so that we had to understand the ins and outs of Redux in order to understand the code.

> [Back to the top](#crate)

## Original Author

- Atul Yadav - [GitHub](https://github.com/atulmy) · [Twitter](https://twitter.com/atulmy)

## Original Contributors

- Ebou Jobe - [GitHub](https://github.com/ebouJ)
- Nenad Radovanovic - [GitHub](https://github.com/nrcloud) · [Twitter](https://twitter.com/publicshone)
- Nicholas Drew - [GitHub](https://github.com/nickdrew)
- Mateus Abdala - [GitHub](https://github.com/mateusabdala)
- Hossein Nedaee - [GitHub](https://github.com/hosseinnedaee)
- Mohammad Afzal - [GitHub](https://github.com/afzalex)

## License

Copyright (c) 2018 Atul Yadav http://github.com/atulmy

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


text:
---
author: "Vidma, Konstantin V. and Parker, David H. and Bogdanchikov, Georgii A. and Baklanov, Alexey V. and Kochubei, Sergei A."
title: "Ionic Pathways following UV Photoexcitation of the (HI)2 van der Waals Dimer"
journal: "The Journal of Physical Chemistry A"
volume: "114"
issue: "9"
pages: "3067-3073"
year: "2010"
doi: "10.1021/jp9067679"
members:
  - a-baklanov
  - s-kochubei
---
Photodissociation of the (HI)2 van der Waals dimers at 248 nm and nearby wavelengths has been studied using
time-of-flight mass spectrometry and velocity map imaging. I2+ product ions with a translational
temperature of 130 K and “translationally hot” I+ ions with an average kinetic energy
of Et = 1.24 ± 0.03 eV and angular anisotropy β = 1.92 ± 0.11 were detected as dimer-specific ionic
photofragments. Velocity map images of the I2+ and I+ species were found to be qualitatively
similar to those observed in the case of photoexcitation of the (CH3I)2
dimer (J. Chem. Phys.2005, 122, 204301). As in the case of the (CH3I)2 dimer,
the absence of neutral I2-specific features in the ionic species images from (HI)2 allows us
to eliminate neutral molecular I2 as a precursor of I+ and I2+.
Similar to the case of (CH3I)2, we deduce that the observed I2+ ions are
produced in their 2Π3/2,g ground electronic state as a result of photodissociation of the ionized
dimer (HI)2+ + hν → I2+ + .... The formation of “translationally hot”
I+ ions is attributed to photodissociation of nascent vibrationally excited I2+ with
an average vibrational energy of 1.05 ± 0.10 eV. This vibrational excitation is explained by the nonequilibrium initial
I−I distance in I2+ arising in photodissociation of (HI)2+ after prompt
release of the light H atoms. On the basis of our ab initio calculated value for the I−I distance of (3.17 Å) in
the (HI)2+ precursor dimer, the vibrational excitation of I2+ is
expected to be 1.02 eV, which is in quantitative agreement with our experimentally deduced value. The interpretation
of our results was supported by ab initio calculations of the structure and energy of neutral and ionized dimers of HI at the MP4(SDTQ)//MP2 level.

repository: Molecular-Photodynamics-Group/Site

repo_name: Molecular-Photodynamics-Group/Site


text:
# Profiles
*salt states*

**In salt, profiles are the "what" and pillars are the "how"**

`Profiles` are salt-states, that install "applications" like `nginx`, `rabbitmq` or event your application `{{ salt.example.app_name }}`

A state simply says:

1. this **host**, should have this **application** installed.
2. or **not**, because you can specify that a thing should NOT be there.

*The core of the Salt State system is the SLS, or SaLt State file. The SLS is a representation of the state in which a system should be in, and is set up to contain this data in a simple format. This is often called configuration management.*

For more info on states read [Saltstack docs on state](https://docs.saltstack.com/en/latest/topics/tutorials/starting_states.html)

## Including profiles

1. in `salt-profiles/tops.sls` you can include your desired state file
2. this can be a [formula](formulas.md), but it can also be a local file that has a specific state

### including profiles usually as a formula
```
{{ salt.example.profile_top }}
```

### Include ad-hoc state file

You will often want to apply a state thats not part of a formula and then can manually create a `.sls` file and included it from tops.sls or from within another state.

`salt-profiles/tops.sls`

```
'myhost.*':
  qa.aws
```

`salt-profiles/qa/aws.sls`

The aws state, will ensure that the `awscli` program is installed from pypi.

```
awscli-installed:
  pip.installed:
    - name: awscli
```

Yes, you **could** include the `aws.sls` from a another `salt-profiles/*/**/state.sls`

repository: thiccbois/salt-docs

repo_name: thiccbois/salt-docs


text:
Card Game Engine

    A barebones card game engine that takes an initial state builder and a rule set to build a STATELESS full card game.
    Best used with web API based games, checkout Dame de Pique

    Explore the docs »

    View Demo
    ·
    Report Bug
    ·
    Request Feature

Table of Contents

      About The Project

Built With

      Getting Started

Prerequisites

Installation

Usage

Roadmap

Contributing

License

Contact

Acknowledgements

## About The Project

[![Product Name Screen Shot][product-screenshot]](https://example.com)

Here's a blank template to get started:
**To avoid retyping too much info. Do a search and replace with your text editor for the following:**
`github_username`, `repo_name`, `twitter_handle`, `email`, `Card Game Engine`, `project_description`

### Built With

* Rust [https://www.rust-lang.org/]()

## Getting Started

To get a local copy up and running follow these simple steps.

### Prerequisites

This is an example of how to list things you need to use the software and how to install them.
* Rust
  ```sh
  cargo build
  ```

### Installation

1. Clone the repo
   ```sh
   git clone https://github.com/pseguin2011/card_game_engine.git
   ```
2. Install Rust
   ```sh
   cargo build
   ```

## Usage

Write an implementation of the `Game Builder`:

```sh
use card_game_engine::models::deck::{Deck, DeckType};
use card_game_engine::models::player::Player;
use card_game_engine::DefaultCardGameError;

#[derive(Clone)]
pub struct State {
    deck: Deck,
    players: Vec<Player>,
    turn: usize
}

pub struct MyAwesomeBuilder;

impl GameBuilder for MyAwesomeBuilder {
    type E = DefaultCardGameError;
    type S = State;

    fn initialize_game() -> Result<Self::S, Self::E> {
        let mut deck = Deck::new(DeckType::WithJokers);
        deck.shuffle();

        let mut players = vec![
            Player {
                name: format!("Player 1"),
                hand: deck.draw_cards(10)?,
            },
            Player {
                name: format!("Player 2"),
                hand: deck.draw_cards(10)?,
            },
        }

        let state = Self::S {
            deck,
            players,
            turn: 0,
        };

        Ok(state)
    }
}
```

Write an implementation of `GameRules`:
```sh
#[derive(Clone, Copy)]
pub enum MyAwesomeGameMoves {
    Draw,
    Discard(usize),
}

impl GameRules<State, DefaultCardGameError> for MyAwesomeGameMoves {
    /// Handles the player moves to drawing and discarding
    fn handle_move(&self, state: &mut State) -> Result<(), DefaultCardGameError> {
        match self {
            Self::Draw => {
                if let Some(card) = state.deck.draw_card() {
                    state.players[state.turn].add_card_to_hand(card);
                } else {
                    return Err(DefaultCardGameError::DeckEmpty);
                }
            }
            Self::Discard(card_index) => {
                let card = state.players[state.turn].play_card_from_hand(*card_index);
                state.deck.discard_card(card);
            }
        }
        Ok(())
    }

    fn is_game_over(state: &mut State) -> Result<bool, DefaultCardGameError> {
        for player in state.players {
            if player.hand.is_empty() {
                return Ok(true);
            }
        }
        Ok(false)
    }

    fn is_round_over(state: &mut State) -> Result<bool, DefaultCardGameError> {
        for player in state.players {
            if player.hand.is_empty() {
                return Ok(true);
            }
        }
        Ok(false)
    }

    fn end_turn(state: &mut State) {
        state.turn = (state.turn + 1) % state.players.len();
    }
}
```

Start using the `Game` struct to manipulate the game state in your API:
```sh
    type MyAwesomeGame = Game<MyAwesomeBuilder, MyAwesomeGameMoves>;
    let mut game_state = MyAwesomeGame::new_game()?;
    MyAwesomeGame::game_action(MyAwesomeGameMoves::Draw, &mut game_state)?;
    MyAwesomeGame::game_action(MyAwesomeGameMoves::Discard(0), &mut game_state)?;
    MyAwesomeGame::end_turn(&mut game_state);
```

## Roadmap

See the [open issues](https://github.com/pseguin2011/card_game_engine/issues) for a list of proposed features (and known issues).

## Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3.  Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## License

Distributed under the MIT License. See `LICENSE` for more information.

## Contact

Pierre Seguin -<EMAIL_ADDRESS>
Project Link: [https://github.com/pseguin2011/card_game_engine](https://github.com/pseguin2011/card_game_engine)

[contributors-shield]: https://img.shields.io/github/contributors/github_username/repo.svg?style=for-the-badge
[contributors-url]: https://github.com/github_username/repo/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/github_username/repo.svg?style=for-the-badge
[forks-url]: https://github.com/github_username/repo/network/members
[stars-shield]: https://img.shields.io/github/stars/github_username/repo.svg?style=for-the-badge
[stars-url]: https://github.com/github_username/repo/stargazers
[issues-shield]: https://img.shields.io/github/issues/github_username/repo.svg?style=for-the-badge
[issues-url]: https://github.com/github_username/repo/issues
[license-shield]: https://img.shields.io/github/license/github_username/repo.svg?style=for-the-badge
[license-url]: https://github.com/github_username/repo/blob/master/LICENSE.txt
[linkedin-url]: https://linkedin.com/in/pierreseg


text:
# FY15 MMR Agency Performance Indicators

## Dataset

| Name | Value |
| :--- | :---- |
| Catalog | [Link](https://catalog.data.gov/dataset/mmr-agency-performance-indicators) |
| Metadata | [Link](https://data.cityofnewyork.us/api/views/fxdy-q85h) |
| Data: JSON | [100 Rows](https://data.cityofnewyork.us/api/views/fxdy-q85h/rows.json?max_rows=100) |
| Data: CSV | [100 Rows](https://data.cityofnewyork.us/api/views/fxdy-q85h/rows.csv?max_rows=100) |
| Host | data.cityofnewyork.us |
| Id | fxdy-q85h |
| Name | FY15 MMR Agency Performance Indicators |
| Attribution | Mayor's Office of Operations (OPS) |
| Category | City Government |
| Tags | mmr, management, report, key performance indicators, kpi, metrics |
| Created | 2015-11-25T15:09:32Z |
| Publication Date | 2017-03-28T15:58:48Z |

## Description

NYC agency performance indicators from the Mayor's Management Report (MMR)

## Columns

```ls
| Included | Schema Type | Field Name            | Name                  | Data Type | Render Type |
| ======== | =========== | ===================== | ===================== | ========= | =========== |
| No       | time        | :updated_at           | updated_at            | meta_data | meta_data   |
| Yes      | series tag  | agency                | Agency                | text      | text        |
| Yes      | series tag  | mmr_goal              | MMR Goal              | text      | text        |
| Yes      | series tag  | critical              | Critical              | text      | text        |
| Yes      | series tag  | performance_indicator | Performance Indicator | text      | text        |
| Yes      | series tag  | fy11                  | FY11                  | text      | text        |
| Yes      | series tag  | fy12                  | FY12                  | text      | text        |
| Yes      | series tag  | fy13                  | FY13                  | text      | text        |
| Yes      | series tag  | fy14                  | FY14                  | text      | text        |
| Yes      | series tag  | fy15                  | FY15                  | text      | text        |
| Yes      | series tag  | tgt15                 | TGT15                 | text      | text        |
| Yes      | series tag  | tgt16                 | TGT16                 | text      | text        |
| Yes      | series tag  | desired_direction     | Desired direction     | text      | text        |
| Yes      | series tag  | 5_yr_trend            | 5 yr trend            | text      | text        |
```

## Time Field

```ls
Value = updated_at
Format & Zone = seconds
```

## Data Commands

```ls
series e:fxdy-q85h d:2017-03-28T15:57:49.000Z t:critical=TRUE t:fy11=21,730 t:fy12=18,957 t:fy13=19,917 t:desired_direction=Neutral t:fy14=21,346 t:fy15=21,079 t:tgt15=* t:performance_indicator="311 calls (000)" t:agency="3 1 1" t:mmr_goal=1a t:tgt16=* t:5_yr_trend=Neutral m:row_number.fxdy-q85h=1

series e:fxdy-q85h d:2017-03-28T15:57:49.000Z t:critical=TRUE t:fy11=1,329 t:fy12=2,117 t:fy13=3,998 t:desired_direction=Up t:fy14=5,248 t:fy15=9,656 t:tgt15=Up t:performance_indicator="311 Online site visits (000)" t:agency="3 1 1" t:mmr_goal=1a t:tgt16=Up t:5_yr_trend=Up m:row_number.fxdy-q85h=2

series e:fxdy-q85h d:2017-03-28T15:57:49.000Z t:critical=FALSE t:fy11=2.70% t:fy12=2.20% t:fy13=2.10% t:desired_direction=Neutral t:fy14=1.80% t:fy15=2.50% t:tgt15=* t:performance_indicator="Calls handled in languages other than English (%)" t:agency="3 1 1" t:mmr_goal=1a t:tgt16=* t:5_yr_trend=Down m:row_number.fxdy-q85h=3
```

## Meta Commands

```ls
metric m:row_number.fxdy-q85h p:long l:"Row Number"

entity e:fxdy-q85h l:"FY15 MMR Agency Performance Indicators" t:attribution="Mayor's Office of Operations (OPS)" t:url=https://data.cityofnewyork.us/api/views/fxdy-q85h

property e:fxdy-q85h t:meta.view v:id=fxdy-q85h v:category="City Government" v:averageRating=0 v:name="FY15 MMR Agency Performance Indicators" v:attribution="Mayor's Office of Operations (OPS)"

property e:fxdy-q85h t:meta.view.owner v:id=5fuc-pqz2 v:screenName="NYC OpenData" v:lastNotificationSeenAt=1491336998 v:displayName="NYC OpenData"

property e:fxdy-q85h t:meta.view.tableauthor v:id=5fuc-pqz2 v:screenName="NYC OpenData" v:roleName=administrator v:lastNotificationSeenAt=1491336998 v:displayName="NYC OpenData"
```

## Top Records

```ls
| :updated_at | agency | mmr_goal | critical | performance_indicator                              | fy11    | fy12    | fy13    | fy14    | fy15    | tgt15 | tgt16 | desired_direction | 5_yr_trend |
| =========== | ====== | ======== | ======== | ================================================== | ======= | ======= | ======= | ======= | ======= | ===== | ===== | ================= | ========== |
|<PHONE_NUMBER>  | 3 1 1  | 1a       | TRUE     | 311 calls (000)                                    | 21,730  | 18,957  | 19,917  | 21,346  | 21,079  | *     | *     | Neutral           | Neutral    |
|<PHONE_NUMBER>  | 3 1 1  | 1a       | TRUE     | 311 Online site visits (000)                       | 1,329   | 2,117   | 3,998   | 5,248   | 9,656   | Up    | Up    | Up                | Up         |
|<PHONE_NUMBER>  | 3 1 1  | 1a       | FALSE    | Calls handled in languages other than English (%)  | 2.70%   | 2.20%   | 2.10%   | 1.80%   | 2.50%   | *     | *     | Neutral           | Down       |
|<PHONE_NUMBER>  | 3 1 1  | 1a       | TRUE     | Average wait time (tier 1 calls) (minutes:seconds) | 0:31    | 0:45    | 0:38    | 0:23    | 0:23    | 0:30  | 0:30  | Down              | Down       |
|<PHONE_NUMBER>  | 3 1 1  | 1a       | TRUE     | Calls answered in 30 seconds (%)                   | 78%     | 71%     | 81%     | 83%     | 84%     | 80%   | 80%   | Up                | Up         |
|<PHONE_NUMBER>  | 3 1 1  | 1a       | FALSE    | Call takers time occupied (%)                      | 80%     | 80%     | 78%     | 79%     | 77%     | *     | *     | Up                | Neutral    |
|<PHONE_NUMBER>  | 3 1 1  | 1a       | FALSE    | Complaints about 311 per million calls             | 24.9    | 30      | 26      | 23      | 26      | *     | *     | Down              | Neutral    |
|<PHONE_NUMBER>  | 3 1 1  | 2a       | FALSE    | Completed requests for interpretation              | 595,101 | 425,157 | 421,839 | 392,759 | 531,194 | *     | *     | Neutral           | Down       |
|<PHONE_NUMBER>  | 3 1 1  | 2a       | FALSE    | Letters responded to in 14 days (%)                | 96%     | 100%    | 100%    | NA      | NA      | *     | *     | Neutral           | NA         |
|<PHONE_NUMBER>  | 3 1 1  | 2a       | FALSE    | E-mails responded to in 14 days (%)                | 100%    | 100%    | 100%    | 100%    | 100%    | *     | *     | Neutral           | Neutral    |
```

repository: SpellarBot/open-data-catalog

repo_name: SpellarBot/open-data-catalog


text:
# remark-lint-spaces-around-word

According to
[chinese-document-style-guide](https://github.com/ruanyf/document-style-guide),
there should be spaces between English word and Chinese characters.
This lint will warn when space is missing in such cases.

## Example

**`valid.md`**

**In**

```markdown
这是一份中文 API 文档。
```

**Out**

No messages.

**`invalid.md`**

**In**

```markdown
这是一份中文API文档。
```

**Out**

```text
input.md:1:7-1:9: Should have spaces around "API"
```

## Install

```sh
npm install remark-lint-spaces-around-word
```

## Usage

You probably want to use it on the CLI through a config file:

```diff
 ...
 "remarkConfig": {
   "plugins": [
     ...
     "remark-lint",
+    "remark-lint-spaces-around-word",
     ...
   ]
 }
 ...
```

Or use it on the CLI directly

```sh
remark -u remark-lint -u remark-lint-spaces-around-word readme.md
```

Or use this on the API:

```diff
 var remark = require('remark');
 var report = require('vfile-reporter');

 remark()
   .use(require('remark-lint'))
+  .use(require('remark-lint-spaces-around-word'))
   .process('_Emphasis_ and **importance**', function (err, file) {
     console.error(report(err || file));
   });
```

## License

[MIT](https://github.com/laysent/remark-lint-plugins/blob/master/license) © [LaySent](https://github.com/laysent)

repository: laysent/remark-lint-plugins

repo_name: laysent/remark-lint-plugins