text:
# Skyscanner Promise Browse

[![Build Status](https://travis-ci.org/flexdinesh/npm-module-boilerplate.svg?branch=master)](https://travis-ci.org/flexdinesh/npm-module-boilerplate) [![dependencies Status](https://david-dm.org/flexdinesh/npm-module-boilerplate/status.svg)](https://david-dm.org/flexdinesh/npm-module-boilerplate) [![devDependencies Status](https://david-dm.org/flexdinesh/npm-module-boilerplate/dev-status.svg)](https://david-dm.org/flexdinesh/npm-module-boilerplate?type=dev) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

# Usage

See [examples](examples/example.js).
Three methods exposed:

## getLocationCode
As per [Skyscanner API docs](https://skyscanner.github.io/slate/?_ga=1.104705984.172843296.1446781555#list-of-places):
> Get a list of places that match a query string.

Takes one required argument `query` which can be any place or address. Also takes three optional arguments (defaults in brackets):
- country ('UK')
- currency ('GBP')
- locale ('en-UK')
## browseQuotes
As per [Skyscanner API docs](https://skyscanner.github.io/slate/?_ga=1.104705984.172843296.1446781555#browse-quotes):
> Retrieve the cheapest quotes from our cache prices.

Takes one required argument `origin` which can be an airport, city or country.Also takes seven optional arguments (defaults in brackets):
- destinationAirport ('anywhere')
- outboundDate ('anytime')
- returnDate ('anytime')
- country ('UK')
- currency ('GBP')
- locale ('en-UK')
- maxNumberOfOptions (10)

## browseRoutes
As per [Skyscanner API docs](https://skyscanner.github.io/slate/?_ga=1.104705984.172843296.1446781555#browse-routes):
> Retrieve the cheapest routes from our cache prices. Similar to the Browse Quotes API but with the routes built for you from the individual quotes.

Takes one required argument `origin` which can be an airport, city or country.
Also takes six optional arguments (defaults in brackets):
- destinationAirport ('anywhere')
- outboundDate ('anytime')
- returnDate ('anytime')
- country ('UK')
- currency ('GBP')
- locale ('en-UK')
- maxNumberOfOptions (10)

# Commands
- `npm run clean` - Remove `lib/` directory
- `npm test` - Run tests with linting and coverage results.
- `npm test:only` - Run tests without linting or coverage.
- `npm test:watch` - You can even re-run tests on file changes!
- `npm test:prod` - Run tests with minified code.
- `npm run test:examples` - Test written examples on pure JS for better understanding module usage.
- `npm run lint` - Run ESlint with airbnb-config
- `npm run cover` - Get coverage report for your code.
- `npm run build` - Babel will transpile ES6 => ES5 and minify the code.
- `npm run prepublish` - Hook for npm. Do all the checks before publishing your module.

Boiler plate ripped from [flexdinesh/npm-module-boilerplate](https://github.com/flexdinesh/npm-module-boilerplate).

repository: egantz/skyscanner-promise-browse

repo_name: egantz/skyscanner-promise-browse


text:
# Minecraft Bedrock Server

[日本語版 README はこちら](https://github.com/TheRemote/MinecraftBedrockServer/blob/master/README_jp.md)

Sets up a Minecraft Bedrock dedicated server on Ubuntu / Debian with options for automatic updates, backups and running automatically at startup.

View installation instructions at: https://jamesachambers.com/minecraft-bedrock-edition-ubuntu-dedicated-server-guide/

If you are looking for a Docker containerized version of the Minecraft Bedrock Dedicated Server, it is available here:  https://github.com/TheRemote/Legendary-Bedrock-Container

Features

Sets up the official Minecraft Bedrock Server (currently in alpha testing)

Fully operational Minecraft Bedrock edition server in a couple of minutes

Ubuntu / Debian distributions supported

Sets up Minecraft as a system service with option to autostart at boot

Automatic backups when server restarts

Supports multiple instances -- you can run multiple Bedrock servers on the same system

Updates automatically to the latest or user-defined version when server is started

Easy control of server with start.sh, stop.sh and restart.sh scripts

Adds logging with timestamps to "logs" directory

Optional scheduled daily restart of server using cron

*NEW* Box64 support for 64 bit ARM (aarch64) which greatly improves emulation speed over QEMU by translating some system calls to native system calls

Quick Installation Instuctions

To run the installation type:

curl https://raw.githubusercontent.com/TheRemote/MinecraftBedrockServer/master/SetupMinecraft.sh | bash

Installation Guide

Minecraft Bedrock Dedicated Server Script Installation / Configuration Guide

Installing Resource Packs / RTX Support

For instructions on how to install resource packs (including optional RTX support), view my step-by-step Minecraft Bedrock Dedicated Server Resource Packs / Optional RTX guide here.

Tested Distributions

Ubuntu / Ubuntu Server 22.04

Ubuntu / Ubuntu Server 20.04

Ubuntu / Ubuntu Server 18.04

Debian Stretch / Buster

Tested Platforms

All PC X86_64 (WORKING)

Udoo X86 (WORKING)

Intel Compute Stick (WORKING)

Other X86_64 platforms (WORKING)

ARM 64bit (WORKING -- speed improved with Box64)

Raspberry Pi 64 bit (WORKING -- Box64)

Raspberry Pi 32 bit (WORKING -- VERY SLOW -- 64 bit recommended!)

Tinkerboard (WORKING, 32 bit is slow, 64 bit uses Box64)

Multiple Servers and Installation Paths

The server supports multiple servers at once.  When you run SetupMinecraft.sh again, pick the identical root path as any previous servers.  The path structure of the scripts is $ROOTPATH/minecraftbe/yourservername, which is why the "root" path SetupMinecraft.sh asks you for should always be the same.

The individual server folder is determined by the "server name" you enter for your server.  If it's an existing server, the scripts will be safely updated.  If it's a new server, then a new folder will be created under $ROOTPATH/minecraftbe/newservername.

Keep the installation path the same for all servers and the script will manage all this for you.

Version Override

You can revert to a previous version with the revert.sh script included in your directory like this:
./revert.sh
Set previous version in version_pin.txt: bedrock-server-<IP_ADDRESS>.zip

If you have a specific version you would like to run, you can also create version_pin.txt yourself like this:
echo "bedrock-server-<IP_ADDRESS>.zip" > version_pin.txt

The version hold can be removed by deleting version_pin.txt.  This will allow it to update to the latest version again!

Troubleshooting Note - Oracle Virtual Machines

A very common problem people have with the Oracle Virtual Machine tutorials out there that typically show you how to use a free VM is that the VM is much more difficult to configure than just about any other product / offering out there.

The symptom you will have is that nobody will be able to connect.  This is not because of the second set of ports that it shows after startup (that is a nearly 3-4 years now old Bedrock bug and all servers do it).

It is because there are several steps you need to take to open the ports on the Oracle VM.  You need to both:

Set the ingress ports (TCP/UDP) in the Virtual Cloud Network (VCN) security list

*and* set the ingress ports in a Network Security Group assigned to your instance

Both of these settings are typically required before you will be able to connect to your VM instance.  This is purely configuration related and has nothing to do with the script or the Minecraft server itself.

I do not recommend this platform due to the configuration difficulty but the people who have gone through the pain of configuring an Oracle VM have had good experiences with it after that point.  Just keep in mind it's going to be a rough ride through the configuration for most people.

Here are some additional links:

https://jamesachambers.com/official-minecraft-bedrock-dedicated-server-on-raspberry-pi/comment-page-8/#comment-13946

https://jamesachambers.com/minecraft-bedrock-edition-ubuntu-dedicated-server-guide/comment-page-53/#comment-13936

https://jamesachambers.com/minecraft-bedrock-edition-ubuntu-dedicated-server-guide/comment-page-49/#comment-13377

https://jamesachambers.com/legendary-minecraft-bedrock-container/comment-page-2/#comment-13706

Troubleshooting Note - Hyper-V

There is a weird bug in Hyper-V that breaks UDP connections on the Minecraft server.  The fix for this is that you have to use a Generation 1 VM with the Legacy LAN network driver.

See the following links:

https://jamesachambers.com/minecraft-bedrock-edition-ubuntu-dedicated-server-guide/comment-page-54/#comment-13863

https://jamesachambers.com/minecraft-bedrock-edition-ubuntu-dedicated-server-guide/comment-page-56/#comment-14207

Buy A Coffee / Donate

People have expressed some interest in this (you are all saints, thank you, truly)

PayPal<EMAIL_ADDRESS>
Venmo: @JamesAChambers

CashApp: $theremote

Bitcoin (BTC): 3H6wkPnL1Kvne7dJQS8h7wB4vndB9KxZP7

Update History

January 14th 2023

Change connectivity check from google.com to minecraft.net to prevent blocking in some countries

September 4th 2022

Remove unnecessary code from fixpermissions.sh

August 12th 2022

Add clean.sh utility script to clean up downloads folder, remove version pinning and force reinstall of current version

Enable content log by default which shows errors related to resource/behavior packs

August 12th 2022

Add clean.sh utility script to clean up downloads folder, remove version pinning and force reinstall of current version

Enable content log by default which shows errors related to resource/behavior packs

August 10th 2022

Moved DirName variable to a custom variable at the top of SetupMinecraft.sh

August 4th 2022

Script now removes non-alphanumeric characters from the servername variable (to prevent using quotes and other symbols that will break it)

August 2nd 2022

Add Box64 support for 64 bit ARM (aarch64).  32 bit ARM is not recommended as it cannot use Box64 so it will be much slower than if you install a 64-bit version of your OS on the device.

You must be running a 64-bit OS to benefit from the Box64 increased speeds (both Ubuntu and Raspberry Pi OS have 64-bit versions)

An easy way to check and make sure you are running 64 bit is to use
uname -m
 which will return "aarch64" if you are on 64-bit ARM

July 24th 2022

Use libssl1.1 from repository instead of Ubuntu servers due to it changing every week or two (thanks theblujuice, issue #129)

July 21st 2022

Increase timeout in minecraftbe.service to help servers with longer backup times from having startup issues

July 19th 2022

Fix minor syntax error in update.sh

July 14th 2022

Fix syntax error in new libssl3 install

Updated depends.zip for ARM devices (the Docker version is strongly recommended for ARM devices)

July 14th 2022

Add libssl3 to dependencies

July 7th 2022

Updated curl fallback installation URL to newest package

Punctuation / grammar fixes to README (thanks TheWilbo, pull request #128)

June 11th 2022

Added allowlist.json and permissions.json default template files to prevent crashes when they are missing (thanks Eike)

June 10th 2022

Fixed problem in escaping screen command in SetupMinecraft.sh (on the startup check)

June 5th 2022

Added additional escaping to screen -list commands to prevent similar names from matching the grep query (thanks wheelibin)

Changed grep -q command to use single quotes to prevent expansion of additional characters (I still recommend only letters and numbers for the server label/name for the least amount of trouble)

May 31st 2022

Add check to make sure server.properties exists when unzipping server as without it there will be a startup error

May 26th 2022

Add revert.sh to SetupMinecraft.sh downloads

Add version override documentation

May 25th 2022

Added version_pin.txt to allow for manual override of running server version. Run ./revert.sh in your server folder to set version n-1 to run on next restart. Delete version_pin.txt when you want to resume automatic updates. (thanks smallsam)

May 15th 2022

Added screen -wipe to beginning of start.sh to prevent a startup issue that could occur if there was a "dead" screen instance (thanks grimholme)

May 9th 2022

Updated fallback installation URL for OpenSSL 1.1

May 4th 2022

Fixed an issue on Debian where the route command (/sbin/route) is not on the default path by adding a check for this

Added Ubuntu 22.04 to tested distributions list (I upgraded my desktop OS to this today)

April 28th 2022

Fixed a line in fixpermissions.sh that could cause picky shells to complain

April 24th 2022

Added dependency package install for libssl1.1 when it's available in apt

Added fallback installation for libssl1.1 to hopefully fix the installer for Ubuntu 22.04/22.10 and other distros using libssl3

Fixed a minor 'tail' error message that could occur upon starting the server if no logs were created yet

Added DEBIAN_NONINTERACTIVE to some apt commands to try to suppress some interactive dialogs (such as running outdated kernel) that were causing the installer to get stuck

Fixed a mistake in new multicore backup causing it to select the wrong compressor

April 16th 2022

Added multiple CPU core support for backups which should speed up backup process

March 19th 2022

Removed /sbin qualifier from route command as the PATH variable is now stored at the top of each script by SetupMinecraft.sh (thanks LookedPath, issue #120)

March 10th 2022

Add new allowlist.json to the unzip whitelist (thanks shaman79, issue #118)

Added buy a coffe / donation information (thanks vandersonmota, issue #117)

November 2nd 2021

Fixed extra / in front of permissions fix script (thanks MarkBarbieri, issue #109)

October 31st 2021

Fixed missing sudo from fixpermissions line in start.sh (thanks MarkBarbieri, issue #109)

Fixed missing -a parameter from /etc/sudoers file addition thanks MarkBarbieri, issue #109)

August 1st 2021

Updated documentation and root path selection prompt to make it more clear that the root directory should be the same for ALL servers

Don't change unless installing to a different disk, and then use the same root path for ALL servers as they will follow the structure $ROOTPATH/minecraftbe/yourservername

Choosing a perfect storm of invalid paths has resulted in people's server files being pruned before from being off by one folder sublevel etc.  Please follow instructions carefully here and do not change it and make sure you have backups (saved outside of the main Minecraft backups folder) before ever trying to install an additional server or updating existing scripts.

Fortunately this person was starting a new server so the pruning didn't get anything serious but I can't stress enough to leave the paths alone unless you're legitimately an expert with a use case like having an entire separate disk for all the Minecraft servers.  Use the same root directory every time (preferably the default)!

July 27th 2021

Cleaned up SetupMinecraft.sh and removed redundant code by organizing code into functions

Scripts now fix all server file permissions on startup

Added /etc/sudoers.d/minecraftbe file to contain passwordless sudo permission for fixpermissions and sudo systemctl start server

July 21st 2021

Updated documentation and restart.sh to document how to enable systemd's service showing as "online" after called by restart.sh (useful for people tracking the servers using the systemd service) by adding a line to the sudoers file to allow passwordless sudo for the sudo systemctl start yourservername command.  Restart.sh now has commented lines at the bottom along with instructions on how to enable if you need this functionality (most people probably won't)

Added error redirection to crontab line to help diagnose failures during scheduled restarts and removed ExecStartPre from the service as it wasn't doing anything (run ./fixpermissions.sh if you need to fix the permissions) and caused compatibility issues with older systemd versions

July 17th 2021

Added in check to ensure start.sh and other scripts are not being ran as root.  If this happens you have to use sudo screen -r to find the screen and the permissions will be wrong since root isn't the owner of the server files

If you know you ran the script/server as root (which starts creating files owned by root instead of the regular user) and your server won't start/is wonky run the fixpermissions script from your server folder with ./fixpermissions.sh and it will correct them for you!

July 15th 2021

Added update.sh convenience script to run SetupMinecraft.sh to update everything to the latest version

Added validation loop for directory path -- if you are upgrading from an old version you should use the default directory.

Nothing good can come from changing this and I've never seen or heard of it solving a single problem despite being requested for years (especially if you don't understand relative vs fully qualified Linux paths and other pitfalls -- leave it default!).

Attempting to solve this problem with safety checks in case this is useful to some people and I just haven't heard about it but it may be removed entirely or turned into a check that you have to download and modify the script to enable if it continues to be a source of strife for people.

Updated depends.zip for Raspberry Pis

July 4th 2021

Added missing sudo line to some prerequistes and removed apt-get install sudo as the script no longer runs as root (install sudo if missing) - thanks Rick Horn

July 3rd 2021

Added Accept-Encoding: Identity header to curl as a very small % of users are getting an "Access Denied" error without this header (thanks titiscan, pull request #95

Added default language header to curl as non-english computers were getting an Access Denied error

Script now checks for gawk being present in start.sh.  If it's not installed (likely due to reusing old SetupMinecraft.sh files) timestamps will be disabled.  This will prevent the server from failing to start.  This is avoided by not running an old copy of SetupMinecraft.sh!

Removed broken screen -r command at the end of SetupMinecraft.sh as fixing it actually causes lockups -- instead now gives the command (screen -r) to pull up the Minecraft console.  Press Ctrl+A then Ctrl+D to hide the console once you're inside it.

Added code to prevent SetupMinecraft.sh from being ran as a local file (please use the new method of curl https://raw.githubusercontent.com/TheRemote/MinecraftBedrockServer/master/SetupMinecraft.sh | bash)

July 2nd 2021

Improved dependency detection and installation

Removed wget dependency

Added gawk dependency -- this should not have any impact on most systems but on systems that use mawk by default this will fix server startup issues related to timestamps since mawk doesn't support strftime

Fixed stop.sh's -t countdown option (thanks da99Beast, issue #76)

Fixed a nasty issue where the installation of libcurl3 over the top of libcurl4 was allowed in some configurations (like Ubuntu 18.04) and was clobbering curl (thanks Goretech)

Fixed an issue where empty folders could be created in the wrong location if start.sh was not ran from the server folder (thanks CobraBitYou, issue #93

July 1st 2021

Changed from wget to curl as wget is freezing (but curl works)

Added randomization to user agent

June 19th 2021

Fixed timestamps to display on every line (thanks murkyl)

Added chmod command after unzip line to make bedrock_server executable for issue #22 (thanks murkyl)

Merged pull request #91 from starkey-01 to add prompt for an alternate installation directory.  This has been requested for a while so thanks starkey-01!

Merged pull request #88 clarifying instructions to run script as non-root user (thanks sparagi!)

May 23nd 2021

The fixpermissions.sh script now displays the last 5 lines from the latest log file to aid in troubleshooting.  If your server won't start this script often will take care of it and the logs can give useful information otherwise!

May 22nd 2021

Added setting the path variable to each script to prevent service from failing to start due to not being able to find the right path.

Please redownload SetupMinecraft.sh for this update.  The script will give you a warning each time you start up that it couldn't set the path variable without the new SetupMinecraft.sh script

Added user agent to wget string to prevent update check from failing

Added automatic update to SetupMinecraft.sh if it has not been modified for more than 7 days

Updated Raspberry Pi dependencies

April 22nd 2021

Added a safety check to prevent installing on 32 bit (i386 or i686) operating systems.  The official Bedrock dedicated server has only been released as a 64 bit (x86_64) binary and attempts at emulation on 32 bit have failed to yield any successful results!

Added chmod +x bedrock_server to start.sh as updates seem to be removing executable permissions sometimes

Fix removing old backup directory context (thanks murkyl, issue #76)

April 20th 2021

Fully qualified route command with /sbin/route to alleviate network check breaking some servers

Added safety check to prevent using the server label 'minecraftbe' which can break the scripts

Added libc6 dependency check as several people have reported libns1.so.1 missing

Added curl and libcurl3 dependency as a fallback for older distros to avoid missing libcurl.so errors

Added libcrypt1 dependency check

April 7th 2021

If you are updating from an old version make sure you remove the old SetupMinecraft.sh and redownload the new version from scratch.  If you are seeing something like userxname in the systemd service you're using an old version of SetupMinecraft.sh and need to download the latest

Updated fixpermissions.sh -- can fix issues with permissions if you are seeing them!

Fixed a bug with userxname appearing in start.sh and not being updated to the correct username

Fixed an issue that could trigger PAM authentication in start.sh

March 16th 2021

Fixed a incomplete sudo line in start.sh that was throwing an error (thanks /u/zfa from reddit!)

February 1st 2021

Added fixpermissions.sh utility script to take ownership of Minecraft server files manually (the systemd startup service does this automatically for you if you are using it)

January 31st 2021

Added .\ in front of the screen -q checks to prevent similar usernames from tripping up window detection

Server now takes ownership of server files on each start to prevent folks a whole heap of trouble and heartache when restoring backups/moving files/etc.

December 20th 2020

Added experimental QEMU support for 32 bit (i386, i686) similar to how the ARM support works

December 18th 2020

Added safety check to prevent the script from being ran as root or sudo.  This would cause the script to be installed to the /root folder.

If you know what you are doing and want to override just edit the check out of SetupMinecraft.sh but otherwise just run it as ./SetupMinecraft.sh normally.

Fixed a nasty bug that could cause start.sh and stop.sh to disapper (thanks Paul and James).  This was related to log pruning and not having a hard path.  If you downloaded the SetupMinecraft script in the past 3 days update and try again here and you'll be set!

December 15th 2020

Resource packs (including ones that optionally enable RTX support) are working

Guide available at https://jamesachambers.com/minecraft-bedrock-server-resource-pack-guide/

Added automatic backup rotation -- server keeps last 10 backups - thanks aghadjip Issue 33

Added valid_known_packs to unzip whitelist to prevent resource packs from getting overwritten - thanks kmpoppe - Pull Request 53

Create logs directory if it doesn't exist - thanks omkhar - Pull Request 39

December 13th 2020

RTX beta is now supported as long as you aren't on the "beta" channel anymore.  Unenroll from the RTX beta and downgrade to normal Minecraft.  RTX is in normal Minecraft now.

Fixed ARM support for Raspberry Pi, Tinkerboard, and others.  Be warned, it's still very slow on ARM!

Updated depends.zip

December 10th 2020

Cleaned up documentation

Added notice that the RTX beta version of Minecraft's dedicated server has not been released yet.  Support will be added the moment it is!

Added alpha software notice for Bedrock dedicated server per issue 34

November 17th 2020

Fixed server autoupdating in start.sh

Minecraft.net had made a change where the "--spider" parameter would return a 503 -- removed this to fix automatic updates

July 24th 2019

Fixed Raspberry Pi support

July 10th 2019

Fixed OpenSSL error in 1.12 (thanks obviator!)

Fixed ports not choosing defaultS if nothing is entered (thanks sweavo!)

July 2nd 2019

Added libcurl4 Bedrock server dependency to installer script to prevent server startup from failing

July 1st 2019

Added support for multiple servers

Choose the folder name and port for the server in SetupMinecraft.sh (must be unique per server instance)

May 23rd 2019

Fixed typo in restart.sh where there was a space after stop command preventing the server from closing cleanly

Added 10 second sleep after a force close to give the server time to fully close before calling start.sh

Fixed server not restarting after scheduled nightly reboot (related to restart.sh bug)

Removed some direct (for example paths like /bin/sleep) that were harming cross platform compatibility

April 26th 2019

Tested new Bedrock dedicated server <IP_ADDRESS>

Added startup counter to server instead of waiting a flat 4s to reduce unnecessary waiting

Fixed ARM support (64 bit required)

April 18th 2019

Changed StopChecks++ to StopChecks=$((StopChecks+1)) to improve portability (thanks Jason B.)

Added TimeoutStartSec=600 to server to prevent it being killed if taking longer than usual to download server

March 7th 2019

Added Armbian support

Tested with Tinkerboard

Fixed portability issue with route vs /sbin/route

March 2nd 2019

Running the SetupMinecraft.sh script after already installing now updates all scripts and reconfigures the minecraftbe service

Script now works on any Debian based distribution (Ubuntu, Debian, Raspbian, etc.)

Added *very slow* support for ARM platforms such as Raspberry Pi with QEMU emulation of x86_64

Renamed service to minecraftbe to avoid confusion with Java version

February 15th 2019

Backups now compress into .tar.gz format (saved in backups folder)

Startup service waits up to 20 seconds for an internet connection to allow time for DHCP to retrieve an IP address

Removed unnecessary sleep time on stop.sh script so it returns as soon as the minecraft server closes

February 8th 2019

Initial release

license: MIT

repository: TheRemote/MinecraftBedrockServer

branch_name: refs/heads/master

extension: md

gha_language: Shell

gha_license_id: MIT

license_type: permissive

repo_name: TheRemote/MinecraftBedrockServer


text:
# jQuery GraphCool Auth0 app

Demo app demonstrating GraphCool and Auth0 integration in a simple [jQuery](https://jquery.com/) Web app

## Pre-requisites

On [Auth0 university](https://auth0.com/university/) watch:

- [Auth0 101 course](https://auth0.com/university/2/auth0-101)
- [Getting Started with the lock](https://auth0.com/university/3/getting-started-with-the-lock)

On [GraphCool youtube channel](https://www.youtube.com/channel/UCptAHlN1gdwD89tFM3ENb6w), watch the first 2 minutes of GraphCool  [User Authentication with Auth0 for React and Apollo](https://www.youtube.com/watch?v=5uxq8Om-AZQ) which demonstrates how to create an Auth0 client app and configure a GraphCool app for Auth0 integration.

Now you should be good to go!

## Development

Enausre you are loading [babel-polyfill](https://stackoverflow.com/questions/33527653/babel-6-regeneratorruntime-is-not-defined-with-async-await) in order for async/await to work.

See `webpack/webpack.app.js` configuration:

```js
  entry: [
    'babel-polyfill',
    path.join(__dirname, '../src/app.js')
  ],
```

Install `webpack-dev-server`

`$ npm i -g webpack-dev-server`

Watch files, compile and trigger reload of dev server

`$ npm run watch`

## Build

Project needs to be compiled using Babel

`$ npm run build`

## Start server

Ensure you have built a `dist/app.js` which is used by the HTML file.

Start development server: `$ npm run dev`

## Alternative: Run file server

Start a [local HTTP file server](https://www.npmjs.com/package/local-web-server)

Install HTTP file server globally

`$ npm i local-web-server -g`

Start it

```bash
$ npm run start
serving at http://localhost:8000
```

Open a browser at `localhost:8000`

`$ open http://localhost:8000`

Time to play!

## Troubleshooting

`Super expression must either be null or a function, not undefined`

If all else fails try adding `babel-polyfill` directly in html `<script>` element
or as first statement in included code `import 'babel-polyfill'`

```html
  <script src="node_modules/babel-polyfill/dist/polyfill.js"></script>
```

ES7 `await/async` statements and some other ES6/ES7 syntax still needs to be "handled" with extra super magic enchantments!!

Let us know if you find/have better solutions ;)

## License

MIT - [Tecla5](http://tecla5.com) 2017, Kristian Mandrup


text:
# BitzPrice

The Application is used to check on the current price of BitCoin.
Using the API from <b>Coindesk.com</b>.

You can select upto three currencies in the dropdown.
Its a minimal implementation of next js.

# Install and Run

Clone the repository and then type these commands in order.

```
cd Bitzprice
npm install
npm run dev
```

This will install and start the package.
Next js is a package that enables running react on server side and providing pre-rendered pages thus giving a performance boost to your applications.

# Screenshot

![](screenshots/Home.png)

# Author

Karan Mittal

repository: Karan-S-Mittal/BitzPrice

repo_name: Karan-S-Mittal/BitzPrice


text:
<!-- Start:AutoDoc:: Modify `src/readme/rules.ts` and run `gulp readme` to update block -->
## no-inner-declarations (ESLint: [no-inner-declarations](http://eslint.org/docs/rules/no-inner-declarations))

disallow function or variable declarations in nested blocks (recommended)

### Usage

```json
"no-inner-declarations": [
  true,
  "functions"
]
```

```json
"no-inner-declarations": [
  true,
  "both"
]
```

<!-- End:AutoDoc -->

repository: zanemayo/tslint-eslint-rules

repo_name: zanemayo/tslint-eslint-rules


text:
---
title: New GraphQL Sourcegraph extension
description: New GraphQL Sourcegraph extension
author: Chris Wendt
publishDate: 2018-12-05T00:00-07:00
tags: [
  blog
]
slug: new-graphql-sourcegraph-extension
heroImage: https://about.sourcegraph.com/sourcegraph-mark.png
published: true
---

Sourcegraph extensions make it easy to build code intelligence using existing language analysis tools that don't necessarily speak [LSP (the Language Server Protocol)](https://microsoft.github.io/language-server-protocol/specification).

GraphQL is one of these languages that has [a language analysis tool](https://www.npmjs.com/package/@playlyfe/gql) and I spent a few days building a Sourcegraph extension for it.

You can try it out on Sourcegraph.com by first [enabling the GraphQL extension](https://sourcegraph.com/extensions/chris/graphql) then visiting a [sample GraphQL file](https://sourcegraph.com/github.com/chrismwendt/graphql-ws-langserver@master/-/blob/schema.gql#L9:9) (beware this is relatively experimental - only hover tooltips and jump-to-definition within the same file work).

![image](https://user-images.githubusercontent.com/1387653/48732224-e4065280-ebf3-11e8-9689-d17da442728c.png)

The first step was to start with the `activate()` function that will run when the Sourcegraph extension is run:

```typescript
export function activate(): void {}
```

Then I grab the address of the GraphQL language server from a user setting:

```diff
 export function activate(): void {
+  const address = sourcegraph.configuration.get<Settings>().get('graphql.langserver-address')
 }
```

Then I register a callback that will run when the user hovers over something in a GraphQL file:

```diff
 export function activate(): void {
   const address = sourcegraph.configuration.get<Settings>().get('graphql.langserver-address')

+  sourcegraph.languages.registerHoverProvider([{ pattern: '*.{graphql,gql}'}], {
+    provideHover: async (doc, pos) => {
+        return ajax({
+            method: 'POST',
+            url: address,
+            body: JSON.stringify({ method: 'hover', doc, pos }),
+            responseType: 'json',
+            headers: {
+                'Content-Type': 'application/json',
+            },
+        })
+    }
+  })
 }
```

It sends a request to a https://github.com/chrismwendt/graphql-ws-langserver running elsewhere.

Then I convert the response to something that the Sourcegraph extension API understands (with Python syntax highlighting to recognize comment lines starting with `#`)

````diff
 export function activate(): void {
   const address = sourcegraph.configuration.get<Settings>().get('graphql.langserver-address')

   sourcegraph.languages.registerHoverProvider(docSelector, {
     ...
   })
+    .then(response => {
+        return (
+            response &&
+            response.response &&
+            response.response.contents && {
+                contents: {
+                    // python syntax highlighting works pretty well for GraphQL
+                    value: '```python\n' + response.response.contents.join('\n') + '\n```',
+                    kind: sourcegraph.MarkupKind.Markdown,
+                },
+            }
+        )
+    })
 }

````

Check out the repository for the [extension](https://github.com/sourcegraph/sourcegraph-graphql) and the [server component](https://github.com/chrismwendt/graphql-ws-langserver).

repository: zag/about

branch_name: refs/heads/main

repo_name: zag/about


text:
Lua socket server for communicating cross-servers and to external chat clients.

This was used for GMod Tower as a way to chat and send commands to the server
from our private Slack channels. The Hubot chat bot was used to interface with
our Lua socket server.

The Lua server was designed to be idiomatic to Garry's Mod Lua developers.
Included are common gmod utility functions (such as `include`), a hook system,
a `net` api, and more.

Directory structure:
```
/addon 		# Garry's Mod Lua addon for connecting to the Lua socket server
/hubot 		# Hubot plugin to connect to the Lua socket server
/server 	# Lua socket server
```

Dependencies:
```
Lua 5.1
gmsv_socket
```

![Slack GMod Server Chat](http://i.imgur.com/5FzWcFl.png)

repository: Ethan-the-axolotl/recycling-bin

repo_name: Ethan-the-axolotl/recycling-bin


text:
---
title: Running Parsers
---

There are different ways of running your parser on an input.

## try() and tryString()

Most of the time, you'll want to use `try`. It will run the parser on an input `Stream`, return a `Succeed` (which implements `ParseResult`) on success, and throw a `ParserHasFailed` exception if the input can't successfully be parsed.

The `Stream` type generalises over a different ways of providing input. The simplest implementation is `StringStream`. This is really a wrapper around a PHP multibyte string.

(In v0.6.0, `StringStream` is also the _only_ implementation of `Stream`, but this will change.)

`ParseResult` has an `output()` method, which has the type `T` for a `Parser<T>` (see [Mapping to Objects](mapping_to_objects)). It also has a `remainder()` method, which gives you the part of the input that wasn't consumed by the parser.

`ParserHasFailed` has the usual `Exception` methods. It also gives you access to the `Fail implements ParseResult` object. This contains all the relevant information about the failure, such as `expected()`, `got()`, and `position()`.

```php
<?php
$parser = string('hello');

$result = $parser->try(new StringStream("hello world"));
// Or, use tryString(string), which is an alias of try(StringStream):
$result = $parser->tryString("hello world");

echo $result->output(); // "hello"
echo $result->remainder(); // StringStream(" world")

// Now let's make it fail
try {
    $result = $parser->tryString("hi world");
} catch(ParserHasFailed $e) {
    $result = $e->parseResult();
    echo $result->expected(); // "string(hello)"
    echo $result->got(); // StringStream("hi world")
    $position = $result->position(); // A Position object containing the line number,
                                     // column, and filename where the failure happened
}
```

## run()

`run` is mostly intended for internal use.

The main difference between `run` and `try` is that `run` doesn't throw exceptions when parsing an input fails.  Instead, you'll always get a `ParseResult`, and you can inspect it with the same methods as above. You'll also get `isSuccess` and `isFail`, so you know what you're dealing with.

```php
<?php
$parser = string("hello");
$result = $parser->run(new StringStream("some input"));
if($result->isSuccess()) {
    echo $result->output();
    echo $result->remainder();
} elseif ($result->isFail()) {
    echo $result->expected();
    echo $result->got();
}
```

## Continue with a result

Using `run` instead of `try` is a good choice when you want to do something with the result, such as:

- Building your own combinators
- Interacting with `ParseResult` while in the middle of a parse flow

To do that, `ParseResult` lets you continue parsing:

```php
<?php
$parser1 = string("hello");
$result1 = $parser1->run(new StringStream("hello world"));
$parser2 = string("world");
$result2 = $result1->continueWith($parser2);
```

`continueWith` takes another parser, and uses it to parse the remainder of the of the result. You may have noticed we didn't check for `isSuccess`. That's becasue we don't need to. `continueWith` is smart; if `$parser1` fails, trying to continue parsing on the result will not have any effect. In fact, the example above will fail, because `$parser1` doesn't take into account the space between "hello" and "world".

repository: parsica-php/parsica

gha_language: PHP

repo_name: parsica-php/parsica


text:
# 2022-07-09

==========

# Goals

-   improve documentation: explain better what approval tests mean
-   to that end, we're practicing using the fizzbuzz kata -> shared understanding -> document
-   idea: choose your own adventure documentation

# retro of the fizz buzz kata

-   timer could have been longer, maybe 5m
-   no typist recap
-   approving incorrect results - confusing, but it works, useful; one of many workflow with approvals
-   because we approved, we were able to safely refactor the code - e.g. extracting the `fizzbuzz` function
-   event - after extracting fizzbuzz - we got `None` - was easy to find that out thanks to the test; and the very short feedback loop (incl running the tests in watch mode)

what is "approval tests"?

-   it _is_ the feedback loop; the ability to get the FB from what you're doing, how changes affect output, w/o having to re-run it all the time
-   `verify` - compare the result to the approved file
    -   matches perfectly - test passes
    -   difference - the reporter highlights the mismatch; test fails
        -   textual representation of what we're working on

what does the user need to do, in order to use approvals?

-   setup a test
-   optional - reporter
-   do we need to create the approved file ourselves?
    -   initially it's created automatically when we first run the test
    -   once we receive a result that we like - we alter the approved file to reflect this - iow we copy received to approved

# Overall Retro

```
Approvals Retro
	team
		new member
			fresh eyes
				Beginners Mind
					Book about Zen
						Be as stupid as possible is good
		being open to attempt to answer guiding questions is a great attitude
	emotions
		positive impression
		very happy to have a new person
		interresting
			wanted to jump in but didnt
				following what is going on and checking whether I can understand to get feedback on where I am
				more comfortable to observe and assess my own understanding
				didnt want the others to change the process for me
					wanted to watch the others be in their flow
				participating vs observing
					like a little bit of both
		impressed with the courage of a new member to join
	tools
		gitpod
			reporter was not working the way we expected anymore
				the diff was not opening automatically
					we had to manually change the reporter
						could be a todo
			worked well, i liked it
			I dont know where the notes are
			had to change screensharing on every rotation
				idea: rotate typist slower
				idea: open gitpod in a teamviewer
		github code spaces (we didnt use it but one person tried it recently)
			idea: vscode liveshare
				to avoid having to screenshare
					need to try
	language
		python
			ternary way to write if else if else if else if, but you cannot add line breaks
	patterns
		first try a kata together to create a common understanding of what we want to document
	events
		one person delaying thumb vote answers and then giving the only thumb down
			reminds me about the movie: twelve angry men
	domain
		for someone who is a full beginner (walking up the street) the documentation is not full enough to make sense of it
			they wouldnt know where to go to learn about unit testing, tdd or so
	surprises
		approve incorrect results on purpose
			highlight the changes in behaviour you are making
			the "orange state" (related, but not exactly it)
			if you commit and push, it looks as if it was correct, but its not
			but developing it like this was useful
	learned
		got a greater understanding of how the workflow actually happens (working with approvals)
			i knew it did that, but didnt know exactly how
				now I know
		python ternary if else
```

## chat gpt summary

https://chat.openai.com/share/cb8855c9-c902-4b33-a2ce-32f6dfdb2b8c

path: /mob-sessions-retros/2023-07-09 What are approvals.md

filename: 2023-07-09 What are approvals.md

gha_language: Python


text:
# Changelog

All Notable changes to `php-lxd` will be documented in this file.

Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

# [0.15.1]

## Fixed
 - Files method using the wrong param for headers

# [0.15.0]

## Added
 - Added an instance class that you should use instead of containers, it will
   fall back to the `/containers` endpoint if your host doesn't support `/instances`
   which is the agnostic way of dealing with both containers and virtual machines

# [0.14.0]

## Added
  - Provide backup as source type & file to create container from backup file

## [0.13.2]

## Fixed
 - not being able to cache responses due to bad namespaces

## [0.13.1]

## Added
 - Delete container file (#11 @TonyBogdanov)

## [0.13.0]

## Added
 - Some of the cluster endpoints

## [0.12.3]

## Fixed
 - Migrating snapshot of runnin container (#9)

## [0.12.2]

## Added
 - Support for using container snapshot as source for migration

## [0.12.1]

### Added
    - Backup export method

## [0.12.0]

### Added
 - Backup endpoints

## [0.6.0] - 2017-01-23

### Added
- Documentation
- container migration

### Deprecated
- Nothing

### Fixed
- Nothing

### Removed
- Nothing

### Security
- Nothing

repository: TonyBogdanov/php-lxd

repo_name: TonyBogdanov/php-lxd


text:
*/
Date: 06 29 2020
Author: Samantha
JavaChapter 1.1 - 1.9

Questions:

1.1 What are hardware and software?

Hardware is the physical elements of the computerand Software provides the invisible
instructionsthat control the hardware and make it perform specific tasks.

1.2 List five major hardware components of a computer.
-A central processing uni (CPU)-Memory(main memory)
-Storage Devices(such as disks and CDs)
-Input Devices(such as the mouse and keyboard)
-Output Devices(such as monitors and printers)
-Communication Devices(such as modems and network interface cards)

1.3 What does the acronym "CPU" stand for?
Central Processing Unit

1.4 What Unit is used to measure the CPU speed?
Hz, MHz, GHz

1.5 What is a bit? What is a Byte?
A Bit is Digits in the binary number system are called bits.
A Byte is the minimum storage unit in a computer is a byte.
A byte is composed of eight bits.

1.6 What is memory for? What does RAM stand for? Why is memory called RAM?
Memory is for storing data, RAM stands for Random-Access Memory.
Memory is called RAM because it can be accessed in any order.

1.7 What is used to measure memory size?
KB
MB
GB
TB

1.8 What Unit is used to measure disk size?
Bytes

1.9 What is the primary difference between memory and a storage device?
Memory refers to the location of short-term data, storage is the component
of your computer that allows you to store and access data on a long-term basis.
Usually, storage comes in the form of a solid-state drive or a hard drive.
/*


text:
# Lab 3 - Spark
This hands-on lab will be essentially driven by the instructions in the `Learn basics about notebooks and Apache Spark.ipynb` notebook.

We will use a rather large (>1MB) data file, named `2017.csv`, which will need to be loaded as a Data Asset of the project

### Setting up the Hands-On lab notebook
1. Go to your `DSX_Workshop` project, switch to the Assets tab
1. Open the Data panel with ![](assets/markdown-img-paste-20180311222504140.png), switch to the Load tab and add the `2017.csv` file. This will take some time but can be run in the background
1. Add a new notebook from the Assets tab, using the `From file` option and selecting the `Learn basics about notebooks and Apache Spark.ipynb` file.
1. Make sure you have a Spark runtime selected (named `spark-xy`). If not, you will need to create a new `Lite` instance.

### Run the Hands-On through the notebook
Open the notebook and follow the instructions

url: https://raw.githubusercontent.com/Azzoz06/Custom_WS_Wkshp/054b1811bc549413a20925f865652423e1f84f53/Lab3-Spark/Learn basics about notebooks and Apache Spark.md


text:
# Padding and Stride
:label:`sec_padding`

In the previous example of :numref:`fig_correlation`,
our input had both a height and width of 3
and our convolution kernel had both a height and width of 2,
yielding an output representation with dimension $2\times2$.
As we generalized in :numref:`sec_conv_layer`,
assuming that
the input shape is $n_h\times n_w$
and the convolution kernel shape is $k_h\times k_w$,
then the output shape will be
$(n_h-k_h+1) \times (n_w-k_w+1)$.
Therefore, the output shape of the convolutional layer
is determined by the shape of the input
and the shape of the convolution kernel.

In several cases, we incorporate techniques,
including padding and strided convolutions,
that affect the size of the output.
As motivation, note that since kernels generally
have width and height greater than $1$,
after applying many successive convolutions,
we tend to wind up with outputs that are
considerably smaller than our input.
If we start with a $240 \times 240$ pixel image,
$10$ layers of $5 \times 5$ convolutions
reduce the image to $200 \times 200$ pixels,
slicing off $30 \%$ of the image and with it
obliterating any interesting information
on the boundaries of the original image.
*Padding* is the most popular tool for handling this issue.

In other cases, we may want to reduce the dimensionality drastically,
e.g., if we find the original input resolution to be unwieldy.
*Strided convolutions* are a popular technique that can help in these instances.

## Padding

As described above, one tricky issue when applying convolutional layers
is that we tend to lose pixels on the perimeter of our image.
Since we typically use small kernels,
for any given convolution,
we might only lose a few pixels,
but this can add up as we apply
many successive convolutional layers.
One straightforward solution to this problem
is to add extra pixels of filler around the boundary of our input image,
thus increasing the effective size of the image.
Typically, we set the values of the extra pixels to zero.
In :numref:`img_conv_pad`, we pad a $3 \times 3$ input,
increasing its size to $5 \times 5$.
The corresponding output then increases to a $4 \times 4$ matrix.
The shaded portions are the first output element as well as the input and kernel tensor elements used for the output computation: $0\times0+0\times1+0\times2+0\times3=0$.

![Two-dimensional cross-correlation with padding.](../img/conv-pad.svg)
:label:`img_conv_pad`

In general, if we add a total of $p_h$ rows of padding
(roughly half on top and half on bottom)
and a total of $p_w$ columns of padding
(roughly half on the left and half on the right),
the output shape will be

$$(n_h-k_h+p_h+1)\times(n_w-k_w+p_w+1).$$

This means that the height and width of the output
will increase by $p_h$ and $p_w$, respectively.

In many cases, we will want to set $p_h=k_h-1$ and $p_w=k_w-1$
to give the input and output the same height and width.
This will make it easier to predict the output shape of each layer
when constructing the network.
Assuming that $k_h$ is odd here,
we will pad $p_h/2$ rows on both sides of the height.
If $k_h$ is even, one possibility is to
pad $\lceil p_h/2\rceil$ rows on the top of the input
and $\lfloor p_h/2\rfloor$ rows on the bottom.
We will pad both sides of the width in the same way.

CNNs commonly use convolution kernels
with odd height and width values, such as 1, 3, 5, or 7.
Choosing odd kernel sizes has the benefit
that we can preserve the spatial dimensionality
while padding with the same number of rows on top and bottom,
and the same number of columns on left and right.

Moreover, this practice of using odd kernels
and padding to precisely preserve dimensionality
offers a clerical benefit.
For any two-dimensional tensor `X`,
when the kernel's size is odd
and the number of padding rows and columns
on all sides are the same,
producing an output with the same height and width as the input,
we know that the output `Y[i, j]` is calculated
by cross-correlation of the input and convolution kernel
with the window centered on `X[i, j]`.

In the following example, we create a two-dimensional convolutional layer
with a height and width of 3
and apply 1 pixel of padding on all sides.
Given an input with a height and width of 8,
we find that the height and width of the output is also 8.

```{.python .input}
from mxnet import np, npx
from mxnet.gluon import nn
npx.set_np()

# For convenience, we define a function to calculate the convolutional layer.
# This function initializes the convolutional layer weights and performs
# corresponding dimensionality elevations and reductions on the input and
# output
def comp_conv2d(conv2d, X):
    conv2d.initialize()
    # Here (1, 1) indicates that the batch size and the number of channels
    # are both 1
    X = X.reshape((1, 1) + X.shape)
    Y = conv2d(X)
    # Exclude the first two dimensions that do not interest us: examples and
    # channels
    return Y.reshape(Y.shape[2:])

# Note that here 1 row or column is padded on either side, so a total of 2
# rows or columns are added
conv2d = nn.Conv2D(1, kernel_size=3, padding=1)
X = np.random.uniform(size=(8, 8))
comp_conv2d(conv2d, X).shape
```

```{.python .input}
#@tab pytorch
import torch
from torch import nn

# We define a convenience function to calculate the convolutional layer. This
# function initializes the convolutional layer weights and performs
# corresponding dimensionality elevations and reductions on the input and
# output
def comp_conv2d(conv2d, X):
    # Here (1, 1) indicates that the batch size and the number of channels
    # are both 1
    X = X.reshape((1, 1) + X.shape)
    Y = conv2d(X)
    # Exclude the first two dimensions that do not interest us: examples and
    # channels
    return Y.reshape(Y.shape[2:])
# Note that here 1 row or column is padded on either side, so a total of 2
# rows or columns are added
conv2d = nn.Conv2d(1, 1, kernel_size=3, padding=1)
X = torch.rand(size=(8, 8))
comp_conv2d(conv2d, X).shape
```

```{.python .input}
#@tab tensorflow
import tensorflow as tf

# We define a convenience function to calculate the convolutional layer. This
# function initializes the convolutional layer weights and performs
# corresponding dimensionality elevations and reductions on the input and
# output
def comp_conv2d(conv2d, X):
    # Here (1, 1) indicates that the batch size and the number of channels
    # are both 1
    X = tf.reshape(X, (1, ) + X.shape + (1, ))
    Y = conv2d(X)
    # Exclude the first two dimensions that do not interest us: examples and
    # channels
    return tf.reshape(Y, Y.shape[1:3])
# Note that here 1 row or column is padded on either side, so a total of 2
# rows or columns are added
conv2d = tf.keras.layers.Conv2D(1, kernel_size=3, padding='same')
X = tf.random.uniform(shape=(8, 8))
comp_conv2d(conv2d, X).shape
```

When the height and width of the convolution kernel are different,
we can make the output and input have the same height and width
by setting different padding numbers for height and width.

```{.python .input}
# Here, we use a convolution kernel with a height of 5 and a width of 3. The
# padding numbers on either side of the height and width are 2 and 1,
# respectively
conv2d = nn.Conv2D(1, kernel_size=(5, 3), padding=(2, 1))
comp_conv2d(conv2d, X).shape
```

```{.python .input}
#@tab pytorch
# Here, we use a convolution kernel with a height of 5 and a width of 3. The
# padding numbers on either side of the height and width are 2 and 1,
# respectively
conv2d = nn.Conv2d(1, 1, kernel_size=(5, 3), padding=(2, 1))
comp_conv2d(conv2d, X).shape
```

```{.python .input}
#@tab tensorflow
# Here, we use a convolution kernel with a height of 5 and a width of 3. The
# padding numbers on either side of the height and width are 2 and 1,
# respectively
conv2d = tf.keras.layers.Conv2D(1, kernel_size=(5, 3), padding='valid')
comp_conv2d(conv2d, X).shape
```

## Stride

When computing the cross-correlation,
we start with the convolution window
at the top-left corner of the input tensor,
and then slide it over all locations both down and to the right.
In previous examples, we default to sliding one element at a time.
However, sometimes, either for computational efficiency
or because we wish to downsample,
we move our window more than one element at a time,
skipping the intermediate locations.

We refer to the number of rows and columns traversed per slide as the *stride*.
So far, we have used strides of 1, both for height and width.
Sometimes, we may want to use a larger stride.
:numref:`img_conv_stride` shows a two-dimensional cross-correlation operation
with a stride of 3 vertically and 2 horizontally.
The shaded portions are the output elements as well as the input and kernel tensor elements used for the output computation: $0\times0+0\times1+1\times2+2\times3=8$, $0\times0+6\times1+0\times2+0\times3=6$.
We can see that when the second element of the first column is outputted,
the convolution window slides down three rows.
The convolution window slides two columns to the right
when the second element of the first row is outputted.
When the convolution window continues to slide two columns to the right on the input,
there is no output because the input element cannot fill the window
(unless we add another column of padding).

![Cross-correlation with strides of 3 and 2 for height and width, respectively.](../img/conv-stride.svg)
:label:`img_conv_stride`

In general, when the stride for the height is $s_h$
and the stride for the width is $s_w$, the output shape is

$$\lfloor(n_h-k_h+p_h+s_h)/s_h\rfloor \times \lfloor(n_w-k_w+p_w+s_w)/s_w\rfloor.$$

If we set $p_h=k_h-1$ and $p_w=k_w-1$,
then the output shape will be simplified to
$\lfloor(n_h+s_h-1)/s_h\rfloor \times \lfloor(n_w+s_w-1)/s_w\rfloor$.
Going a step further, if the input height and width
are divisible by the strides on the height and width,
then the output shape will be $(n_h/s_h) \times (n_w/s_w)$.

Below, we set the strides on both the height and width to 2,
thus halving the input height and width.

```{.python .input}
conv2d = nn.Conv2D(1, kernel_size=3, padding=1, strides=2)
comp_conv2d(conv2d, X).shape
```

```{.python .input}
#@tab pytorch
conv2d = nn.Conv2d(1, 1, kernel_size=3, padding=1, stride=2)
comp_conv2d(conv2d, X).shape
```

```{.python .input}
#@tab tensorflow
conv2d = tf.keras.layers.Conv2D(1, kernel_size=3, padding='same', strides=2)
comp_conv2d(conv2d, X).shape
```

Next, we will look at a slightly more complicated example.

```{.python .input}
conv2d = nn.Conv2D(1, kernel_size=(3, 5), padding=(0, 1), strides=(3, 4))
comp_conv2d(conv2d, X).shape
```

```{.python .input}
#@tab pytorch
conv2d = nn.Conv2d(1, 1, kernel_size=(3, 5), padding=(0, 1), stride=(3, 4))
comp_conv2d(conv2d, X).shape
```

```{.python .input}
#@tab tensorflow
conv2d = tf.keras.layers.Conv2D(1, kernel_size=(3,5), padding='valid',
                                strides=(3, 4))
comp_conv2d(conv2d, X).shape
```

For the sake of brevity, when the padding number
on both sides of the input height and width are $p_h$ and $p_w$ respectively, we call the padding $(p_h, p_w)$.
Specifically, when $p_h = p_w = p$, the padding is $p$.
When the strides on the height and width are $s_h$ and $s_w$, respectively,
we call the stride $(s_h, s_w)$.
Specifically, when $s_h = s_w = s$, the stride is $s$.
By default, the padding is 0 and the stride is 1.
In practice, we rarely use inhomogeneous strides or padding,
i.e., we usually have $p_h = p_w$ and $s_h = s_w$.

## Summary

* Padding can increase the height and width of the output. This is often used to give the output the same height and width as the input.
* The stride can reduce the resolution of the output, for example reducing the height and width of the output to only $1/n$ of the height and width of the input ($n$ is an integer greater than $1$).
* Padding and stride can be used to adjust the dimensionality of the data effectively.

## Exercises

1. For the last example in this section, use mathematics to calculate the output shape to see if it is consistent with the experimental result.
1. Try other padding and stride combinations on the experiments in this section.
1. For audio signals, what does a stride of 2 correspond to?
1. What are the computational benefits of a stride larger than 1?

:begin_tab:`mxnet`
[Discussions](https://discuss.d2l.ai/t/67)
:end_tab:

:begin_tab:`pytorch`
[Discussions](https://discuss.d2l.ai/t/68)
:end_tab:

:begin_tab:`tensorflow`
[Discussions](https://discuss.d2l.ai/t/272)
:end_tab:


text:
# GNLazy

[![CI Status](http://img.shields.io/travis/games-neox/GNLazy.svg?style=flat)](https://travis-ci.org/games-neox/GNLazy)
[![Version](https://img.shields.io/cocoapods/v/GNLazy.svg?style=flat)](http://cocoapods.org/pods/GNLazy)
[![License](https://img.shields.io/cocoapods/l/GNLazy.svg?style=flat)](http://cocoapods.org/pods/GNLazy)
[![Platform](https://img.shields.io/cocoapods/p/GNLazy.svg?style=flat)](http://cocoapods.org/pods/GNLazy)

Simple [lazy](https://en.wikipedia.org/wiki/Lazy_initialization) loader for Objective-C/Swift.
Basis usage:
```objective-c
#import <GNLazy/GNLazy.h>

GNLazy<NSString*>* lazyString = [GNLazy createFromLoader:^{
    return @"lazy string";
}];

NSString* stringLoadedSafely = [lazy safeGet];
NSString* stringLoadedFast = [lazy fastGet];
```

## Example

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements

Minimum supported `iOS` version: `8.x`
Dependencies: `GNExceptions`, `GNLog` & `GNPreconditions`

## Installation

GNLazy is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile:

```ruby
pod "GNLazy"
```

## Author

Games Neox<EMAIL_ADDRESS>
## License

GNLazy is available under the MIT license. See the LICENSE file for more info.

repository: games-neox/GNLazy

repo_name: games-neox/GNLazy


text:
[![License: Apache License 2.0](https://img.shields.io/badge/License-Apache%202.0-orange.svg)](https://choosealicense.com/licenses/apache-2.0/)
  # The OFFICE Project

  ## Description
  Pass the mayo, appeal to the client, sue the vice president knowledge is power and in this space both the angel on my left shoulder and the devil on my right are eager to go to the next board meeting and say we’re ditching the business model but upsell for it is all exactly as i said, but i don't like it put your feelers out. Action item horsehead offer re-inventing the wheel, but come up with something buzzworthy, but but what's the real problem we're trying to solve here?. Corporate synergy run it up the flag pole pull in ten extra bodies to help roll the tortoise everyone thinks the soup tastes better after, and we can't hear you so crisp ppt. Core competencies.

  ## Table of Contents:
  * [Installation](#Installation)
  * [Usage](#Usage)
  * [License](#License)
  * [Contributing](#Contributing)
  * [Tests](#Test)
  * [Questions](#Questions)

  ## Installation
  Organic growth come up with something buzzworthy knowledge process outsourcing and code. Peel the onion guerrilla marketing. Vertical integration how much bandwidth do you have meeting assassin, yet low engagement yet into the weeds, but after I ran into Helen at a restaurant, I realized she was just office pretty, and in an ideal world. In this space. Data-point drive awareness to increase engagement.

  ## Usage
  We need to socialize the comms with the wider stakeholder community both the angel on my left shoulder and the devil on my right are eager to go to the next board meeting and say we’re ditching the business model or that is a good problem to have, exposing new ways to evolve our design language.

  ## License
  This project has been assigned a Apache License 2.0. For more information on this license please click the badge below:

  [![License: Apache License 2.0](https://img.shields.io/badge/License-Apache%202.0-orange.svg)](https://choosealicense.com/licenses/apache-2.0/)

  ## Contributions
  If you want to contribute please see the issues tab

  ## Test
  To test this project please follow thest steps: step 1, step 2.

  ## Questions
  View my: [GitHub profile](https://www.github.com/dschrute)

  If you have any further questions regarding this project please email: [Dwight.schrute@dundermifflin.com](mailto:Dwight.schrute@dundermifflin.com?subject=[Question]%20The%20OFFICE%20Project).


text:
# Model classes

[sttp model](https://github.com/softwaremill/sttp-model) is a stand-alone project which provides a basic HTTP model, along with constants for common HTTP header names, media types, and status codes.

The basic model classes are: `Header`, `Cookie`, `CookieWithMeta`, `MediaType`, `Method`, `StatusCode`, `CacheDirective`, `ETag` and `Uri`. The `.toString` methods of these classes returns a representation as in a HTTP request/response. See the ScalaDoc for more information.

Companion objects provide methods to construct model class instances, following these rules:

* `.parse(serialized: String): Either[String, ModelClass]`: returns an error message, or an instance of the model class
* `.unsafeParse(serialized: String): Sth`: returns an instance of the model class or in case of an error, throws an exception.
* `.unsafeApply(values)`: creates an instance of the model class; validates the input values and in case of an error, throws an exception. An error could be e.g. that the input values contain characters outside the allowed range
* `.safeApply(...): Either[String, ModelClass]`: same as above, but doesn't throw exceptions. Instead, returns an error message, or the model class instance
* `.apply(...): ModelClass`: creates the model type, without validation, and without throwing exceptions

Moreover, companion objects provide constants and/or constructor methods for well-know model class instances. For example, there's `StatusCode.Ok`, `Method.POST`, `MediaType.ImageGif` and `Header.contentType(MediaType)`.

These constants are also available as traits: `StatusCodes`, `MediaTypes` and `HeaderNames`.

The model also contains aggregate/helper classes such as `Headers` and `QueryParams`.

Example with objects:

```scala
import sttp.client4._
import sttp.model._

object Example {
  val request = basicRequest.header(Header.contentType(MediaType.ApplicationJson))
    .get(uri"https://httpbin.org")

  val backend = DefaultSyncBackend()
  val response = request.send(backend)
  if (response.code == StatusCode.Ok) println("Ok!")
}
```

Example with traits:

```scala
import sttp.client4._
import sttp.model._

object Example extends HeaderNames with MediaTypes with StatusCodes {
  val request = basicRequest.header(ContentType, ApplicationJson.toString)
    .get(uri"https://httpbin.org")

  val backend = DefaultSyncBackend()
  val response = request.send(backend)
  if (response.code == Ok) println("Ok!")
}
```

For more information see

* [Wikipedia: list of http header fields](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields)
* [Wikipedia: media type](https://en.wikipedia.org/wiki/Media_type)
* [Wikipedia: list of http status codes](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)

repository: kamilkloch/sttp

repo_name: kamilkloch/sttp


text:
---
title: rmse
---

# `rmse` ^^(Series)^^

{== Calculate RMSE for given observations and predictions ==}

## Syntax

    [rmse, error] = rmse(inputSeries, prediction, ...)

## Input arguments

__`actual`__ [ Series ]
>
> Input time series with actual observations.
>

__`prediction`__ [ Series ]
>
> Input time series with predictions, possibly including multiple
> prediction horizons in individual columns; this is typically the
> outcome of running a Kalman filter with the option `Ahead=`.
>

## Options

__`Range=Inf`__ [ Dater | `Inf` ]
>
> Date range on which the prediction errors will be calculated; `Inf`
> means all observations available will be included in the
> calculations.
>

## Output arguments

__`rootMSE`__ [ numeric ]
>
> Numeric array with root mean squared errors for each column of the
> `prediction` time series.
>

__`error`__ [ Series ] -
>
> Time series with prediction errors from which the RMSEs are
> calculated; `error` is simply the difference between `actual` and the
> individual columns in `prediction`.
>

## Description

## Example

repository: IRIS-Solutions-Team/IRIS-Toolbox

branch_name: refs/heads/bleeding

gha_language: HTML

gha_license_id: NOASSERTION

repo_name: IRIS-Solutions-Team/IRIS-Toolbox


text:
---
layout: post
title: "Blog 7"
description: "CIT 480 blog 7"
categories: [uncategorized]
tags: [random, jekyll]
redirect_from:
  - /2019/10/25/
---

I have already talked about Ansible Playbook in my previous blog. However, I only talked about how to run Ansible on a local host.

What if you want to run Ansible playbook on a remote host?

This way you don't have to copy Ansible Playbook to the host. You don't have to have all the tools installed on the host.

This gives you opportunity to run Ansible Playbook no matter where your location is.

Here are the Requirements to run Ansible Playbook on a remote host.

* Set up ssh connection to remote host.

* Upload your public ssh key to the hosts.

* Make sure your private ssh key has correct permissions
	* chmod 400

1) Install ansible on your laptop or device that you will use to push Ansible Playbooks from.
	* sudo apt-get install ansible

2) Go to /etc/ansible/hosts on your device and add the host IP or Domain name.
	* Remove "#" in front of "webservers" to enable it
	* Add hosts under webservers

3) Run the Playbook on your device with the following command.
	* ansible-playbook --private-key=<your-private-key> <ansible_file_name> -u <username> -k --ask-become-pass

Here is the break down of the command:

	* Set "--private-key" to your ssh private key
	* Set "-u" to your username
	* "-k" will require password for ssh key
	* "--ask-become-pass" will require root password to get privileged access

I have tried to specify host IP in the command but it did not work for me.

You have to put it in that specified file where the command can access and read the destination IPs.

The above command initiates a ssh connection to your remote host(s) and executes the script line by line.

The command will require your password since all ssh keys must have passwords for security reasons.

You will need to provide the root password to gain privileged access so you can run commands on the host.


text:
---
title: Row and Column Settings in Freeform Tables
description: Learn about the settings in Freeform Tables in Analysis Workspace, and how they affect the data coming into those tables.
feature: Freeform Tables
thumbnail: 40382.jpg
kt: 6225
role: User
level: Beginner
exl-id: 976119f0-16b7-4d36-8d0e-0a552c83a614
---
# Row and Column Settings in Freeform Tables

Learn about the settings in Freeform Tables in Analysis Workspace, and how they affect the data coming into those tables.

>[!VIDEO](https://video.tv.adobe.com/v/40382/?quality=12&learn=on)


text:
# Change log

### vNEXT

### v0.2.1

- Support more versions of `angular` ([PR #18](https://github.com/apollostack/angular1-apollo/pull/18))

### v0.2.0

- Support **ApolloClient** `v0.8.0` ([PR #12](https://github.com/apollostack/angular1-apollo/pull/12))

### v0.1.0

- Support **ApolloClient** `v0.6.0` ([PR #9](https://github.com/apollostack/angular1-apollo/pull/9))

### v0.0.2

- Support **ApolloClient** `v0.5.0` ([PR #5](https://github.com/apollostack/angular1-apollo/pull/5))

### v0.0.1

Initial release. We didn't track changes before this version.


text:
# `PrefaceCSS`

[![GitHub issues](https://img.shields.io/github/issues/cluzier/PrefaceCSS.svg)](https://github.com/cluzier/PrefaceCSS/issues)
[![GitHub forks](https://img.shields.io/github/forks/cluzier/PrefaceCSS.svg)](https://github.com/cluzier/PrefaceCSS/network)
[![GitHub stars](https://img.shields.io/github/stars/cluzier/PrefaceCSS.svg)](https://github.com/cluzier/PrefaceCSS/stargazers)
[![GitHub license](https://img.shields.io/github/license/cluzier/PrefaceCSS.svg)](https://github.com/cluzier/PrefaceCSS/blob/master/LICENSE)
[![HitCount](http://hits.dwyl.io/cluzier/PrefaceCSS.svg)](http://hits.dwyl.io/cluzier/PrefaceCSS)

`PrefaceCSS` is a fresh looking simple css framework.

## About

`PrefaceCSS` is a fresh looking simple css framework that should be taken as the basis for your next website. We designed it to be flexible but still small, thanks to `scss` all you need to change are some variables and you have your own flavor of `PrefaceCSS`.

# Screenshot

[![Image of PrefaceCSS](./screenshots/screenshot.png)](https://cluzier.github.io/PrefaceCSS/dist/index.html)
*Hint*: Click the image to view a web page full of HTML examples.

## How to use it

Thanks to the opportunities the open-source development offers us, there are thousand ways to use this libary or change it. Below here I list only a few of them.

### Use

Add `<link rel="stylesheet" href="css/preface.css">` or `<link rel="stylesheet" href="css/preface.min.css">` to your `<head>`.

### Download

Download from Github with the following command:

**GitHub**: `$ git clone https://github.com/cluzier/PrefaceCSS`

### Contribute

Clone and mix up things. If you think your edits are interesting for the public, just open a new pull request on that.

Here a brief overview of our folder structure:

```
PrefaceCSS
├── dist # Our destination folder
│   ├── preface.css
│   ├── preface.min.css
│   └── index.html
├── screenshots # Houses screenshots
├── src # Our source folder
│   ├── _base.scss
│   ├── _button.scss
│   ├── _extra.scss
│   ├── _grid.scss
│   ├── _input.scss
│   ├── _loaders.scss
│   ├── _navigation.scss
│   ├── _scrollbars.scss
│   ├── _table.scss
│   ├── _typography.scss
│   └── style.scss
├── LICENSE
├── README.md
├── gulpfile.js
└── package.json
```

Some `gulp` task you should know about:

- `scss` compiles the scss to css
- `scss:min` compress the compiled css files
- `watch` executes `scss` and `scss:min` on any file change

**Note**
```diff
- when running `gulp scss` you will notice a warning, just disregard it.
```

**Required tools for development:**

- Node.js
- NPM
- Gulp installed globally (`npm install gulp -g`)

## Acknowledgements
Based off [Skeleton-plus](https://github.com/oltdaniel/skeleton-plus) by [oltdaniel](https://github.com/oltdaniel).
CSS loaders from [Spinkit](https://tobiasahlin.com/spinkit/) & [Loading.io](https://loading.io/css/)

## Credits

A project by [Conner Luzier](https://github.com/cluzier).
Other amazing contributors [here](https://github.com/cluzier/PrefaceCSS/graphs/contributors).

repository: cluzier/PrefaceCSS

gha_language: SCSS

repo_name: cluzier/PrefaceCSS


text:
# ChangeLog for githash

## <IP_ADDRESS>

* Expose giFiles to users.

## <IP_ADDRESS>

* Specify protocol.file.allow=always for latest git [#28](https://github.com/snoyberg/githash/pull/28)

## <IP_ADDRESS>

* Fixed bugs; now this library's Template Haskell functions are much more
  likely on recompilation to detect Git update that doesn't affect workspace:
  e.g. `git switch -c <new_branch>` (equivalently
  `git checkout -b <new_branch>`) and `git commit --amend --only`.
  Implemented in [#23](https://github.com/snoyberg/githash/pull/23).

## <IP_ADDRESS>

* [Support template-haskell 2.17](https://github.com/snoyberg/githash/pull/22)

## <IP_ADDRESS>

* Always include patchlevel and hash in git-describe output

* Don't let user's configured initial branch name break tests

## <IP_ADDRESS>

* Add git tag output via git-describe

## <IP_ADDRESS>

* Add git-describe output

## <IP_ADDRESS>

* Add git-worktree support [#13](https://github.com/snoyberg/githash/issues/13)

## <IP_ADDRESS>

* Test suite works outside of a Git repo [#12](https://github.com/snoyberg/githash/issues/12)

## <IP_ADDRESS>

* Clean up some warnings (addresses [fpco/optparse-simple#11](https://github.com/fpco/optparse-simple/issues/11))

## <IP_ADDRESS>

* Catch exceptions thrown by `readCreateProcessWithExitCode` to deal
  with missing `git` executable
  [#7](https://github.com/snoyberg/githash/issues/7)

## <IP_ADDRESS>

* Add `tGitInfoTry` and `tGitInfoCwdTry`

## <IP_ADDRESS>

* Add message of the most recent commit

## <IP_ADDRESS>

* Update the test suite

## <IP_ADDRESS>

* Initial release

repository: snoyberg/githash

gha_language: Haskell

repo_name: snoyberg/githash


text:
# API

The API of the [mole-reporter](https://github.com/molejs/mole-reporter) consists of a set of methods that aim to send the reports and provide a way to create adaptors for integrating the reports in your framework or web application.

## `config`

Config is the method that sets some configuration variables for the reporter.

**Params**

Name | Type | Description
--- | --- | ---
`config` | Object | Object with all the configuration files

Options to configure:

* **url**: the url to send the error reports. It will send a POST request with a JSON object following the mole log specification.
* **stacktraceLimit**: Max items of the stacktrace to retrieve.
* **historyLimit**: Max pairs of action state to store until the next error report.

```javascript
Mole.config({
    url: 'http://error.molejs.org/foo',
    stacktraceLimit: 50,
    historyLimit: 10
});
```

## `report`

Report receives an error and reports it to the URL specified in the config. It gathers the last pairs of actions and states and sends them along with the error.

**Params**

Name | Type | Description
--- | --- | ---
`error` | Error object | The error that is going to be reported

```javascript
try {
        errorCausingFunc();
} catch (err) {
        Mole.report(err);
}
```

## `registerActionState`

Registers a pair of action and state on the stack of pairs.

**Params**

Name | Type | Description
--- | --- | ---
`action` | Object | Action that happened
`state` | Object | Current status at the moment

```javascript
Mole.registerActionState({action: 1}, {state: 1});
```


text:
## Writeup Template

### You can use this file as a template for your writeup if you want to submit it as a markdown file, but feel free to use some other method and submit a pdf if you prefer.

---

**Advanced Lane Finding Project**

The goals / steps of this project are the following:

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

[//]: # (Image References)

[image1]: ./examples/undistort_output.png "Undistorted"
[image2]: ./test_images/test1.jpg "Road Transformed"
[image3]: ./examples/binary_combo_example.jpg "Binary Example"
[image4]: ./examples/warped_straight_lines.jpg "Warp Example"
[image5]: ./examples/color_fit_lines.jpg "Fit Visual"
[image6]: ./examples/example_output.jpg "Output"
[video1]: ./project_video.mp4 "Video"
[project_video]: ./test_videos_output/project_video.gif "project_video"
[undistorted_1]: ./output_images/undistorted_1.png "undistorted"
[corrected_1]: ./output_images/correct_for_distortion1.png "corrected1"
[thresh_1]: ./output_images/gradient_thresh1.png "thresh1"
[static_trans1]: ./output_images/static_trans1.png "strans1"
[dynamic_trans1]: ./output_images/transform_array.png "dtrans1"
[poly1]: ./output_images/threshed1.png "poly1"
[curvature_formula]: ./output_images/curvature_formula.png "curvature_formula"
[warped_back1]: ./output_images/warp_back1.png "warpedback"

## [Rubric](https://review.udacity.com/#!/rubrics/571/view) Points

### Here I will consider the rubric points individually and describe how I addressed each point in my implementation.

---

### Writeup / README

### Camera Calibration

#### 1. Briefly state how you computed the camera matrix and distortion coefficients. Provide an example of a distortion corrected calibration image.

The code for camera calibration is located in the notebook "Camera Calibration.ipynb" in the folder notebooks/.

The point of computing the camera matrix and the distortion coefficients is to represent the world in the most accurate possible. The **distortion coefficients** [k_1, k_2, p_1 p_2, k_3] are used to correct for tangential and radial distortion in the cameras. The **camera matrix** depends on the camera only, and includes info like focal length, and optical center of the camera.

In order to compute the camera matrix and distortion coefficients, I took 20 photos of a checkerboard pattern in different orientations. For each photo, I used OpenCV's **findChessBoardCorners** functions to find 2D coordinate of where the coordinates are. For each of checkboards in 3D coordinates, we know that z = 0, and each corner is a fixed offset from another, so we build a 3D points template called **objp_template**. With the 2D points from **findChessBoardCorners** and 3D points **objp_template**, we can find a correspondence using OpenCV's **calibrateCamera** function to return the camera matrix and distortion coefficients.

From the image below, you see that some of the curved lines on the edges are now straight. This means it corrected for radial distortion.
![undistorted][undistorted_1]

### Pipeline (single images)

#### 1. Provide an example of a distortion-corrected image.

To demonstarte this step, here is a side by side view of one of the results:
![alt text][corrected_1]

To do this, I saved the **camera matrix** and **distortion coefficients** in a pickle file and loaded them. I supplied these coefficients to OpenCV's **undistort** function. The point of undistorting is to correct for distortion, because the pipeline for finding lane lines, curvature especially, is very sensitive to that. The code for this is section #2 in Pipeline.ipynb

#### 2. Describe how (and identify where in your code) you used color transforms, gradients or other methods to create a thresholded binary image.  Provide an example of a binary image result.

I used a combination of color, gradient, and direction thresholds to generate a binary image. This is under section #3 in Pipeline.ipynb. For color, I chose to use the color HSL space, and used the S component of it in particular from values (170, 255) to detect the lane lines. For gradient, I computed the x-gradient and y-gradient separately, and picked out gradient values between (30, 100). For direction, I calculated the gradient direction, and picked values (0.7, 1.3) to pick out vertical lane lines.

![alt text][thresh_1]

#### 3. Describe how (and identify where in your code) you performed a perspective transform and provide an example of a transformed image.
I experimented with two ways for the perspective transform: 1) a Static Way 2) Hough Line Finding Way

For the static way, I simply picked a trapezoid that seemed reasonable with points of the following and transformed it. The code and points are as follows:

```python
src = np.float32(
    [[(img_size[0] / 2) - 55, img_size[1] / 2 + 100],
    [((img_size[0] / 6) - 10), img_size[1]],
    [(img_size[0] * 5 / 6) + 60, img_size[1]],
    [(img_size[0] / 2 + 55), img_size[1] / 2 + 100]])
dst = np.float32(
    [[(img_size[0] / 4), 0],
    [(img_size[0] / 4), img_size[1]],
    [(img_size[0] * 3 / 4), img_size[1]],
    [(img_size[0] * 3 / 4), 0]])
```

| Source        | Destination   |
|:-------------:|:-------------:|
| 585, 460      | 320, 0        |
| 203, 720      | 320, 720      |
| 1127, 720     | 960, 720      |
| 695, 460      | 960, 0        |

Static Transformation using Fixed Points:
![alt text][static_trans1]

I also tried another way where I found Hough Lines for the src points. As you can see the Hough lines detected more of the road. However, when we transformed to the destination, the lane line is much blurrier. Thus, the dynamic transformation seems to be not as robust.
![alt text][dynamic_trans1]

#### 4. Describe how (and identify where in your code) you identified lane-line pixels and fit their positions with a polynomial?

After I perspective transformed into the "Bird Eye View", I identified the lane-line pixels to fit the polynomial.

![alt text][poly1]

In my code, this is under "Pipeline.ipynb" section #4, in functions **fit_poly**, **find_lane_pixels**, **search_around_poly_with_curvature**, and **fit_polynomial_with_curvature**. In essence,
1) we divide the bird eye's image into a left-half and a right-half for the left_lane and right_lane.
2) Find the nonzero pixels in each half and give them a color(red/blue)
3) For **fit_polynomial_with_curvature**, start from scratch and use a sliding window to find th mean of each window to fit a polynomial
3)  For **search_around_poly_with_curvature**, we do not start from scratch, but instead parameters **left_fit**, **right_fit**, and **margin** are passed in so we  look for a polynomial fit based on a prior fit

#### 5. Describe how (and identify where in your code) you calculated the radius of curvature of the lane and the position of the vehicle with respect to center.

The code for ROC is also in "Pipeline.ipynb" section #4, in functions **search_around_poly_with_curvature**, **fit_polynomial_with_curvature**, **measure_curvature_real**
To calculate the curvature, we use the fromula

![alt text][curvature_formula]

We apply this formula but have to translate the value from pixels to meters in the real world.
```python
 ym_per_pix = 30/img_shape[1] # meters per pixel in y dimension
 xm_per_pix = 3.7/img_shape[0] # meters per pixel in x dimension
```

The code for calculating the position of the vehicle with respect to center is in "Pipeline.ipynb" section #6 , in function **process_video**

To do this, I take the end points of the line to calculate the middle and compare against the image center. To calculate the end points of the line, the following python code is used
```python
# Get Endpoint
pts_left = np.array([np.transpose(np.vstack([left_fitx, ploty]))])
pts_right = np.array([np.flipud(np.transpose(np.vstack([right_fitx, ploty])))])
endPoints = np.array([pts_left[0][-1], pts_right[0][0]], dtype=np.float32)
endPointsTransformed = cv2.perspectiveTransform(np.array([endPoints]), Minv)
leftEndPoint, rightEndPoint = endPointsTransformed[0]
# Lane and Camera Center
laneCenter = (leftEndPoint[0] + rightEndPoint[0]) // 2
cameraCenter = img_size[0] // 2
# Calc Offset
offset = np.abs(laneCenter - cameraCenter) * xm_per_pix
```

#### 6. Provide an example image of your result plotted back down onto the road such that the lane area is identified clearly.

I implemented this reverse warping using the following python code that involves using the matrix **Minv** which warps points from **dst** to **src**. This **Minv** matrix is the inverse of the **M** matrix that is used to warp points from **src** to **dst**, which was used to create the bird's eye view.

```python
pts_left = np.array([np.transpose(np.vstack([left_fitx, ploty]))])
pts_right = np.array([np.flipud(np.transpose(np.vstack([right_fitx, ploty])))])
pts = np.hstack((pts_left, pts_right))
# Draw the lane onto the warped blank image
cv2.fillPoly(color_warp, np.array([pts], 'int32'), (0,255, 0))
# Warp the blank back to original image space using inverse perspective matrix (Minv)
newwarp = cv2.warpPerspective(color_warp, Minv, img_size)
```
What this code is doing is first getting the **pts** in the bird's eye view, filling a green polygon with the points, then warping the points back to the original lane. The results look like this:

![alt text][warped_back1]

---

### Pipeline (video)

#### 1. Provide a link to your final video output.  Your pipeline should perform reasonably well on the entire project video (wobbly lines are ok but no catastrophic failures that would cause the car to drive off the road!).

Here's a [link to my video result](./test_videos_output/project_video.mp4)

Or a Gif Here

![alt text][project_video]

---

### Discussion

#### 1. Briefly discuss any problems / issues you faced in your implementation of this project.  Where will your pipeline likely fail?  What could you do to make it more robust?

My pipeline works pretty work for the standard project video, but fails for the **challenge_video** and the **harder_challenge_video**, which you can check the results out in test_videos_output. For example, in the harder_challenge_video, there are signfiicant lighting changes as the result of the shadows. My current pipeline does not deal with this color change very well, so I would need to look into tuning the color/gradient/direction threshold to better detect the lanes. I would look into different color spaces, or manully tuning parameters so that lanes are detected to be invariant of lighting conditions. I believe currently, my pipeline does not detect the difference between a shadow on a white line vs the black road.


text:
# TETAS (Track Education For Teachers and Students)

Is an open source social networking web application that provides a robust app on which to build all kinds of social environments, from a campus wide social network for your university, school or college or an internal collaborative platform for your organization through to a brand-building communications tool for your company and its clients. But the main goal is communicate teachers and student than need to be connected but don’t want to mix personal and professional environments.

If you want to see the introduction of a mini-course that I prepared, check this video: https://www.youtube.com/watch?v=-E-rAqeGKp4&t=69s&list=PLE4SNWIDX7wtQd3fA5Aa6cJExKaruJ19C&index=2

# Things than are ready

*Register users.

*Create, Edit, Delete Wall post.

*Create, Edit, Delete comments on post.

*Validate than just the owner can edit or delete their comments or their post.

*Validate than just the owner can delete comments from another on his post.

*Group creation.

*Group post.

*Group comments.

*Timeline (Wall).

 Please, feel free to pull a Request, and colaborate with it, I promese check all the request, test it, and add it.

# Getting Started
TODO: Guide users through getting your code up and running on their own system. In this section you can talk about:
1.	Installation process
2.	Software dependencies
3.	Latest releases
4.	API references

repository: sgermosen/tSocialNetworkMvc

gha_language: C#

repo_name: sgermosen/tSocialNetworkMvc


text:
# CVE Monitor

Short and simple PHP script that relays new [CVE](https://cve.mitre.org) IDs seen on [@cvenew](https://twitter.com/CVEnew/)
to a list of email recepients.

## How it works

When run, cve-monitor will:

* Fetch @cvenew stream using
[Twitter API](https://developer.twitter.com/en/docs/tweets/timelines/api-reference/get-statuses-user_timeline)
* For each new tweet it will
  * Extract CVE ID from the tweet
  * Retrieve the page from cve.mitre.org to get full description
  * Format and send out the email
* Remember the last tweet processed so to request only newer ones on the next run

All activity recorded in a log file and reported the `stdout` **if** running from a terminal.

## Sample email

![Screenshot](email-screenshot.png)

## Dependencies

* PHP 5.6 and up, CLI version.
* [TwitterOAauth](https://github.com/abraham/twitteroauth)
* Consumer API keys from Twitter. This requires opening a [dev account](https://dev.twitter.com) and creating an "app" there. Very easy to do.

Tested on Linux/Debian distro only. Patches for other platforms are welcome.

## Setting it up

First, clone this and [TwitterOAauth](https://github.com/abraham/twitteroauth) repos.

Next, open **cve-monitor.php** and adjust **the config** variables as follows:
* Change `RECEPIENTS` to the email that will receive CVE updates. You can specify multiple recepients like so:

        const RECEPIENTS = [<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>];

* Change `EMAIL_ALERT` to the email address that will get pinged with any problems.
* Change `EMAIL_FROM` to what should be used for `From:` in these emails.

Next,
* `INI_FILE` stores just the ID of the last processed tweet. Change its location if needed.
* `LOG_FILE` by default sits in `/var/log/` so make sure the script is run under an account that can write there.

Next,
* `TWITTER_OAUTH_PHP` should point at `oauth.php` from the TwitterOAuth repo.
* `TWITTER_API_...` should be set to "Consumer API keys" from "Keys and tokens" section of your Twitter app.

Finally,
* Stick it into your crontab with `php /path/to/cvemon.php` and set it to run every hour.
* Configure rotation for the log file if that's your thing.

That's it.

## Mailing list

If you want just the emails, there's a hosted version of the script that I originally set up for our own needs, but later reworked a bit and opened up to everyone - https://iobureau.com/cve-monitor

## License

BSD, 2-clause

## Author

Alex Pankratov, https://swapped.ch

repository: yassineaboukir/cve-monitor

repo_name: yassineaboukir/cve-monitor


text:
## http-server
simple http server

### What is it?
In general, it is a small library that provides basic means to write http servers and web services though it's seems more
like an experimental project for learning purposes. I tried to keep it simple but convenient and capable enough.

It's currently being developed so there might be bugs that I'm not aware of.

### Example
Let's write a simple server that consists of one controller - `EchoController`. This controller responds us with a similar message
we pass to it:

```java
public class EchoController {

    @RequestMapping("/echo/{message}")
    public HttpResponse echoMessage(@PathVar("message") String message) {
        return new StringHttpResponse(HttpStatus.OK, message);
    }

    @RequestMapping("/echo/{message}/{n}")
    @DirectVariablesMapping
    public HttpResponse echoMessageNTimes(String message, int n) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < n; i++) {
            sb.append(message);
        }
        return new StringHttpResponse(HttpStatus.OK, sb.toString());
    }
}
```

Here we have two controller methods. The first method returns a value of `message` path variable that is substituted when
we actually make request to the server; the second method returns the `message` `n` times.

Also, note that there are serveral options of how to retrieve values of path variables.

The first option is by using `@PathVar` annotation, which is quite straightforward. Using it, you define which method parameter
corresponds to which path variable. The value of path variable is automatically converted to the type of the parameter.

The second, which is interesting one, is to declare `@DirectVariablesMapping` on your controller method which indicates
that you want path variables from your URI template to be directly mapped onto parameters of your controller method. You can also specify from which position this mapping starts. This might be useful if you need, for example, information about the request itself. Than this method will look like this:

```java
    @RequestMapping("/echo/{message}/{n}")
    @DirectVariablesMapping(startIndex = 1)
    public HttpResponse echoMessageNTimes(HttpRequest req, String message, int n) {
        ...
    }
```
Though this type of mapping has some limitations:
- you must specify the same number of parameters of your method as the number of path variables in your URI
- these parameters must be at the end of parameters list and all other parameters that you want to inject into your method
must precede this mapping between path variables and parameters.

Having all of this, we now can configure and run the sever.

```java
public class Main {
    public static void main(String[] args) throws IOException {
        ServerConfiguration config = new TreeServerConfiguration()
            .addController(new EchoController());
        HttpServer server = new HttpServer(config, 8080);
        server.start();
    }
}
```
Go to your browser and type http://localhost:8080/echo/hello

repository: kojote-git/http-server

gha_language: Java

repo_name: kojote-git/http-server


text:
# bb1k

**bb1k** is a BBCode parser/renderer that weighs <1kb minified. Why? BBcause I can!

## Usage
After including the script in your page, simply pass the `bbparse` function a string of BBCode, and it'll return an HTML element that you can add into the page:
```js
bbparse("This is [i]BBCode[/i]");
```

## Supported features
Being only 1kb in size, bb1k only supports a subset of BBCode. The supported tags are:
- `[b]` (bold)
- `[i]` (italics)
- `[u]` (underline)
- `[s]` (strikethrough)
- `[size={number}]` (font size)
- `[color={string}]` (font color)
- `[url]` and `[url={url}]` (unnamed and named links)
- `[img]` (images)
- `[ul]`, `[ol]`, and `[list]` (lists)
- `[li]` and `[*]` (list elements + shorthand)
- `[code]` and `[pre]` (preformatted text)

license: ISC

gha_language: JavaScript

gha_license_id: ISC


text:
mazer-rackham
=============

 Sample [Ansible](http://www.ansibleworks.com/) Playbook for Rack applications that installs Nginx, Passenger, and Ruby 2.0.0 (or 1.9.3). It also demonstrates how to deploy a [basic Rack application](https://github.com/jlund/imgur-display) from a git repository.

 Specifically, it does the following:

 * Upgrades packages
 * Installs a few crucial programs like git, NTP, and Vim
 * Creates a deploy user that the application files will belong to
 * Adds an SSH public key to the deploy user's Authorized Keys file
 * Reconfigures OpenSSH to only allow access via SSH keys
 * Installs Ruby 2.0.0 (or 1.9.3)
 * Installs Bundler
 * Installs Nginx + Passenger
 * Sets up and enables an Nginx vhost
 * Creates all necessary application directories
 * Uses git to checkout the latest revision of the [imgur-display](https://github.com/jlund/imgur-display) codebase
 * Creates required symlinks
 * Uses bundler to install all Gem dependencies

Running this playbook will leave you with a fully-functional Rack application server that is ready to show you a random picture from imgur. With some incredibly minor adjustments, this playbook will deploy your own application! It's my hope that this will be helpful to anyone who needs to set up a similar server using Ansible.

This playbook will run on Ubuntu 12.04 LTS and higher, and also works on Debian 7.

Enjoy!

Testing this playbook with Vagrant
----------------------------------

* Install Ansible
  * This playbook frequently uses new Ansible features, so installing the development version is recommended. The two commands below will get you up and running quickly; run them from the directory of your choice (e.g. ~/github).
  * `git clone git@github.com:ansible/ansible.git`
  * `source ansible/hacking/env-setup`
* Download and install [Vagrant](http://vagrantup.com/)
* Copy or rename `Vagrantfile.example` to `Vagrantfile`
* Copy or rename `ansible_hosts.example` to `ansible_hosts`
* Comment out the `user: root` line from `imgur-display-setup.yml` and uncomment
  the two lines below `Vagrant setup`
* Run `vagrant up` in a terminal from within this folder
* When the Ansible provisioning completes, visit [http://localhost:8080/](localhost:8080)
  in your host machine's browser to view the running Rack app
* Run `vagrant halt` to shutdown the VM
* Run `vagrant destroy` to delete the VM's data

repository: gpolyn/mazer-rackham

repo_name: gpolyn/mazer-rackham


text:
---
layout: default
title: How to use horizontal stacked bar chart
---

# How to use horizontal stacked bar chart
Here's an example code regarding the use of horizontal stacked bar chart:

```yaml
---
  dashboard "Example":
    -
      horizontal stacked bar chart:
        columns:
          -
            - "Apples"
            - 3
            - 2
            - 3
            - 4
            - 2
          -
            - "Oranges"
            - 2
            - 1
            - 0
            - 1
            - 1
          -
            - "Pears"
            - 2
            - 0
            - 0
            - 3
            - 4

```
The code above will render a horizontal stacked bar chart that looks like this:

![](../screenshots/horizontal_stacked_bar_chart.png)

repository: erayon/just-dashboard

repo_name: erayon/just-dashboard


text:
# File Listing Worker

[File listing worker][fileListingWorker] is one of the first ones we wrote and continues to be the simplest.

## Flow
On working directory getting set the master just calls `setupWatch`.

* This goes ahead and uses `glob` to glob the whole directory.
* Sets up a watcher (using `chokidar`) on this directory to detect any changes

Whenever anything changes it send `fileListingDelta` to the master (which is also the web server process). That goes ahead and sends it to any connected clients (using our `cast`) mechanism.

[fileListingWorker]: https://github.com/johnpaularthur/spork/blob/master/src/server/workers/fileListing/fileListingWorker.ts

repository: johnpaularthur/spork

gha_language: TypeScript

repo_name: johnpaularthur/spork


text:
# Canny Edge Detector in Python

![canny edge detector](example2.png)

[Canny edge detector wikipedia](https://en.wikipedia.org/wiki/Canny_edge_detector)

This is not for production use.  I built this to better understand how edge detection works.

## Dependencies
```pip install numpy scipy opencv-python```

## Run
```./canny-edge-detector.py input_image.jpg 1.4 20 50```

repository: lemmingapex/canny-edge-detector

repo_name: lemmingapex/canny-edge-detector