text:
## Onion Architecture on .NET (Ports and Adapters)

This template was made based on [Tony Sneed's Peeling Back the Onion Architecture](https://blog.tonysneed.com/2011/10/08/peeling-back-the-onion-architecture/)

## REST api calls:

`localhost:{port}/api/products`

`localhost:{port}/api/categories`

`localhost:{port}/api/categories/{productId}/products`

## Technology overview:

- Specflow
- NUnit
- Moq <br>
- Entity Framework Code First
- MVC4 Web API
- Ninject
- JSON.NET

## Archive notes:

I created and used this architecture to design the original [Foodsby](https://www.foodsby.com) ecommerce platform.

license: Unlicense

repository: sharifhkhan/OnionArchitecture

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: sharifhkhan/OnionArchitecture


text:
# MAT AIR Native Extension

The MobileAppTracking (MAT) ANE for Adobe AIR provides basic application install
and event tracking functionality via the MobileAppTracking SDKs. To track installs,
you must integrate the AIR Native Extension with your AIR app. Once the ANE is
integrated and set to track installs, you can add and track additional events beyond
an app install (such as purchases, game levels, and any other user engagement).

This document outlines the AIR Native Extension integration and use cases.

## Implementation

1. To integrate the MobileAppTracking ANE in your AIR app, use the file MobileAppTrackerANE.ane
located in the dist folder. Add this file as a Native Extension to your AIR app by right clicking
your project and selecting Properties->Flex Build Path->Native Extensions->Add ANE.

![air-sdk1](./docs/img/air-sdk1.png "Add ANE")

2. When adding the ANE, if available then you can select the Update AIR application descriptor checkbox.

![air-sdk2](./docs/img/air-sdk2.png "Update AIR application descriptor")

3. If not available, then you can manually add the extension to your project’s .xml file like so:

		<extensions>
				<extensionID>com.hasoffers.MobileAppTracker</extensionID>
		</extensions>

4. Now enable your platforms from Properties->Flex Build Packaging->Apple iOS/Google Android and select “Enable this target platform”.

5. Then go to the Native Extensions tab and check the “Package” box next to the MobileAppTrackerANE ANE.

![air-sdk3](./docs/img/air-sdk3.png "Package ANE")

6. Now import the MobileAppTracker native extension into your AIR app’s Flex script. On app startup,
get the singleton instance of MobileAppTracker and then call the init method.

		import com.hasoffers.nativeExtensions.MobileAppTracker;
		public var mobileAppTracker:MobileAppTracker;

		mobileAppTracker = MobileAppTracker.instance;
		mobileAppTracker.init(“your_advertiser_id”, “your_advertiser_key”);

The “your_advertiser_id” and the “your_advertiser_key” values may be found on the “Tracking Code for XXXApp”
page by clicking on the “Download SDK” button and clicking on the appropriate mobile app.

![downloadsdk](./docs/img/downloadsdk.png "Download SDK")
![downloadpage](./docs/img/downloadpage.png "Download SDK Page")

__Android Permissions__

If your app will support Android, add the following permissions to your AIR project’s .xml file. It should look like this:

	<android>
	  <manifestAdditions>
	      <![CDATA[
	          <manifest android:installLocation="auto">
	              <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
	              <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
	              <uses-permission android:name="android.permission.INTERNET"/>
	              <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
	          </manifest>
	      ]]>
	  </manifestAdditions>
	</android>

You will also need to place our INSTALL_REFERRER receiver inside the application tag of your .xml manifest:

	<receiver android:name="com.mobileapptracker.Tracker" android:exported="true">
	   <intent-filter>
	       <action android:name="com.android.vending.INSTALL_REFERRER" />
	   </intent-filter>
	</receiver>

For more information on how MobileAppTracking uses the INSTALL_REFERRER, see [How Google Play Install Referrer Works](http://support.mobileapptracking.com/entries/22561636-how-google-play-install-referrer-works).

## Installs and Updates

As the success of attributing app events after the initial install is dependent upon first tracking that install,
we require that the install is the first event tracked. To track install of your mobile app, use the “trackInstall”
method. If users have already installed your app prior to SDK implementation, then these users should be tracked as updates.

### Track Installs

The “trackInstall” method is used to track when users install your mobile app on their device and will only record one
conversion per install in reports. You should call trackInstall() in the app's initialize method after
instantiating a MobileAppTracker class.

	mobileAppTracker.trackInstall();

The “trackInstall” method automatically tracks updates of your app if the app version differs from the last app version it saw.

### Handling Installs Prior to SDK Implementation - Track as Updates

What if your app already has thousands or millions of users prior to SDK implementation? What happens when these users update
the app to the new version that contains the MAT SDK?

MAT provides you two ways to make sure that the existing users do not count towards new app installs.

1. Call SDK method "trackUpdate" instead of "trackInstall".

	If you are integrating MAT into an existing app where you have users you’ve seen before, you can track an update yourself with the trackUpdate() method.

		mobileAppTracker.trackUpdate();

2. Import prior installs to the platform.

These methods are useful if you already have an app in the store and plan to add the MAT SDK in a new version.
Learn how to [handle installs prior to SDK implementation here](http://support.mobileapptracking.com/entries/22621001-Handling-Installs-prior-to-SDK-implementation).

If the code used to differentiate installs versus app updates is not properly implemented, then you will notice
a [spike of total installs](http://support.mobileapptracking.com/entries/22900598-Spike-of-Total-Installs-on-First-day-of-SDK) on the first day of the SDK implementation.

## Events

After the install has been tracked, the “trackAction” method is intended to be used to track user actions such as reaching a
certain level in a game or making an in-app purchase. The “trackAction” method allows you to define the event name dynamically.

All "trackAction" methods are used in the following format:

	trackAction(event:String, revenue:Number=0, currency:String="USD", refId:String=null, isEventId:Boolean=false):void

You need to supply the "event" field with the appropriate value for the event; e.g. "registration". If the event does
not exist, it will be dynamically created in our site and incremented. You may pass a revenue value, currency code,
reference id, or whether you are using an event ID or event name, as optional fields.

The reference id is an optional parameter that you supply to use for reconciliation - on a purchase event, it could be
their order ID or something else you track. This is called "Advertiser Ref ID" in our reporting, and accessed as
{advertiser_ref_id} as a postback variable.

### Registration

If you have a registration process, it's recommended to track it by calling trackAction set to “registration”.

	mobileAppTracker.trackAction("registration");
	// trackAction overload with additional info
	mobileAppTracker.trackAction("registration", 0, "USD", "123", false);

You can find these events in the platform by viewing Reports > Event Logs. Then filter the report by the “registration” event.

While our platform always blocks the tracking of duplicate installs, by default it does not block duplicate event requests.
However, a registration event may be an event that you only want tracked once per device/user.
Please see [block duplicate requests setting for events](http://support.mobileapptracking.com/entries/22927312-Block-Duplicate-Request-Setting-for-Events) for further information.

### Purchases

The best way to analyze the value of your publishers and marketing campaigns is to track revenue from in-app purchases.
By tracking in-app purchases for a user, the data can be correlated back to the install and analyzed on a cohort basis
to determine revenue per install and lifetime value.

	mobileAppTracker.trackAction("purchase");
	mobileAppTracker.trackAction("purchase", 0.99, "USD", "123", false);

__Track In-App Purchases__
The basic way to track purchases is to track an event with a name of purchase and then define the revenue (sale amount) and currency code.

Note: Pass the revenue in as a Double and the currency of the amount if necessary.  Currency is set to "USD" by default.
See [Setting Currency Code](http://support.mobileapptracking.com/entries/23697946-Customize-SDK-Settings) for currencies we support.

You can find these events in platform by viewing Reports > Logs > Events. Then filter the report by the “purchase” event.

### Opens

The SDK allows you to analyze user engagement by tracking unique opens. The SDK has built in functionality to only track one “open” event
per user on any given day to minimize footprint. All subsequent “open” events fired on the same day are ignored and will not show up on the platform.

	mobileAppTracker.trackAction("open");
	mobileAppTracker.trackAction("open", 0, "USD", "123", false);

You can find counts of Opens by viewing Reports > Mobile Apps. Include the parameter of Opens to see the aggregated count.
The platform does not provide logs of Opens. If you track Opens using a name other than "open" then these tracked events will
cost the same price as all other events to track.

### Other Events

You can track other events in your app dynamically by calling “trackAction”. The “trackAction” method is intended for tracking
any user actions. This method allows you to define the event name.

To dynamically track an event, replace “event name or action” with the name of the event you want to track. The tracking engine
will then look up the event by the name. If an event with the defined name doesn’t exist, the tracking engine will automatically
create an event for you with that name. An Event Name has to be alphanumeric.

You can pass in an event name or event id. If you pass in an event name and isEventId = false, then you are indicating to the SDK that
you want your own event name passed in. If you pass in an event id and isEventId = true, then you are indicating that you have a
pre-defined event id in the platform that you associate the action with.

You can find these events in platform by viewing Reports->Logs->Event Logs.

The max event limit per site is 100. Learn more about the [max limit of events](http://support.mobileapptracking.com/entries/22803093-Max-Event-Limit-per-Site).

While our platform always blocks the tracking of duplicate installs, by default it does not block duplicate event requests.
However, there may be other types of events that you only want tracked once per device/user. Please see [block duplicate requests setting for events](http://support.mobileapptracking.com/entries/22927312-Block-Duplicate-Request-Setting-for-Events) for further information.

## Testing Plugin Integration with SDK

These pages contain instructions on how to test whether the SDKs were successfully implemented for the various platforms:

[Testing Android SDK Integration](http://support.mobileapptracking.com/entries/22541781-Testing-Android-SDK-integration)

[Testing iOS SDK Integration](http://support.mobileapptracking.com/entries/22561876-testing-ios-sdk-integration)

## Debug Mode and Duplicates

__Debugging__

When the Debug mode is enabled in the SDK, the server responds with debug information about the success or failure of the
tracking requests.

__Note__: For Android, debug mode log output can be found in LogCat under the tag "MobileAppTracker".

To debug log messages that show the event status and server response, call the "setDebugMode" method with Boolean true:

	mobileAppTracker.setDebugMode(true);

__Allow Duplicates__

The platform rejects installs from devices it has seen before.  For testing purposes, you may want to bypass this behavior
and fire multiple installs from the same testing device.

There are two methods you can employ to do so: (1) calling the "setAllowDuplicates" method, and (2) set up a test profile.

(1) Call the “setAllowDuplicates” after initializing MobileAppTracker, with Boolean true:

	mobileAppTracker.setAllowDuplicateRequests(true);

(2) Set up a [test profile](http://support.mobileapptracking.com/entries/22541401-Test-Profiles). A Test Profile should be
used when you want to allow duplicate installs and/or events from a device you are using from testing and don't want to
implement setAllowDuplicateRequests in the code and instead allow duplicate requests from the platform.

**_The setDebugMode and setAllowDuplicates calls are meant for use only during debugging and testing. Please be sure to disable these for release builds._**

## Additional Resources

### Custom Settings

The SDK supports several custom identifiers that you can use as alternate means to identify your installs or events.
Call these setters before calling the corresponding trackInstall or trackAction code.

__OpenUDID__ (iOS only, deprecated - use setAppleAdvertisingIdentifier instead)

This sets the OpenUDID of the device. Can be generated with the official implementation at [http://OpenUDID.org](http://OpenUDID.org).
Calling this will do nothing on Android apps.

	mobileAppTracker.setOpenUDID("your_open_udid");

__TRUSTe ID__

If you are integrating with the TRUSTe SDK, you can pass in your TRUSTe ID with setTRUSTeId, which populates the “TPID” field.

	mobileAppTracker.setTRUSTeId("your_truste_id");

__User ID__

If you have a user ID of your own that you wish to track, pass it in as a string with setUserId. This populates the “User ID”
field in our reporting, and also the postback variable {user_id}.

	mobileAppTracker.setUserID("custom_user_id");

The SDK supports several custom identifiers that you can use as alternate means to identify your installs or events.
Please navigate to the [Custom SDK Settings](http://support.mobileapptracking.com/entries/23738686-Customize-SDK-Settings) page for more information.

### Event Items

While an event is like your receipt for a purchase, the event items are the individual items you purchased.
Event items allow you to define multiple items for a single event. The “trackAction” method can include this event item data.

The method "trackActionWithEventItem" allows you to pass in an array of mappings of item, unit price, quantity and revenue
strings, which we call an “event item” that is associated with the event.

It contains these default values so you may omit these parameters in the tracking call if you are not using them.

	trackActionWithEventItem(
		event:String,
		eventItems:Array,
		revenue:Number=0,
		currency:String="USD",
		refId:String=null,
		isEventId:Boolean=false,
		transactionState:int=0,
		receipt:String=null,
		receiptSignature:String=null):void

__Parameters:__

- event - the event name associated with the event
- eventItems - an array of event items
- revenue - the revenue amount associated with the event
- currency - the ISO 4217 currency code for the revenue
- refId - the advertiser reference ID you would like to associate with this event
- isEventId - whether the event ID (true) or event name (false) is being passed in
- transactionState - the purchase status received from app store
- receipt - the receipt data from iTunes/Google Play
- receiptSignature - the receipt signature from Google Play, not used on iOS

For example, here we add an event item of two bananas for a total of $1.00:

	var eventItems:Array = new Array();

	var dict:Dictionary = new Dictionary();
	dict["item"] = "banana";
	dict["unit_price"] = "0.50";
	dict["quantity"] = "2";
	dict["revenue"] = "1.00";

	eventItems.push(dict); // you may add any additional event items to the array
	                       // formatted like above

	// If we have an id we want to associate with this event, pass in refId field
	String refId = "some_order_id";

	// Total event revenue = sum of even item revenues in arr + extraRevenue
	float extraRevenue = 0; // default to zero

	// Transaction state may be set to the value received from iOS/Android app store when a purchase transaction is finished.
	int transactionState = 1;

	// Receipt data, receipt signature are from iOS/Android app store and used for purchase verification.
	string receiptData = null;
	string receiptSignature = null;

	mobileAppTracker.trackActionWithEventItem("eventName", eventItems, extraRevenue, "USD", refId, false, transactionState, receiptData, receiptSignature);

### App to App Tracking

App to App tracking provides the ability for one app (the referring app) to download another app (the target app).
The target app will then record an install event that contains data from the referring app. Also, you can specify that your
app (AppA - referring app) redirect to the link where AppB (target app) can be downloaded (typically this is Google Play or iTunes).

If your app has a referral to another app, upon click of that link you should call "startAppToAppTracking" and pass in the referred app’s package name.

With "doRedirect" set to true, the download url will immediately be opened.
If you want to handle this yourself, you can set "doRedirect" to false.

	startAppToAppTracking(targetAppId:String, advertiserId:String, offerId:String, publisherId:String, shouldRedirect:Boolean):void

Example:

	mobileAppTracker.startAppToAppTracking("com.referred.app", “877”, “123”, “456”, true);

__Parameters:__

- targetAppId - the target package name or bundle ID of the app being referred to
- advertiserId - the advertiser ID of the publisher app in our system
- offerId - the offer ID for referral
- publisherId - the publisher ID for referral
- shouldRedirect - if "true", this method will automatically open the destination URL for the target package name

If supporting Android, you will also need to add a MATProvider to your original app’s AndroidManifest
(add as a ManifestAddition in your AIR project’s .xml file). Place the provider inside the tags with the package
names of the apps accessing referral information:

	<provider android:name="com.mobileapptracker.MATProvider" android:authorities="com.referred.app" />

### Building the ANE

The following tools are required to build the MobileAppTracking ANE:

__Adobe AIR__

[http://get.adobe.com/air/](http://get.adobe.com/air/)

__Adobe Flex SDK__

[http://www.adobe.com/devnet/flex/flex-sdk-download.html](http://www.adobe.com/devnet/flex/flex-sdk-download.html)

__Android SDK__

[http://developer.android.com/sdk/index.html](http://developer.android.com/sdk/index.html)

In the /build/ folder, open the build.config file and set your system paths for flex.sdk, android.sdk and android.platformtools.

Then from /build/, run 'ant' which will create a MobileAppTrackerANE.ane file in the /bin/ folder.

repository: Arguas/sdk-plugins

repo_name: Arguas/sdk-plugins


text:
# Terraform AWS EKS Lab

This is a ground (or cloud) up deployment of an AWS EKS environment which can be used to build quick lab environments and easily tear them down for a true self-cleaning on-demand Kubernetes configuration.

## Why does this exist?

Setting up EKS for occasional use is not simple, nor is making sure you have all the dependencies, policies, networks, and more.  It's also easy to leave behind a lot of remnants in AWS which are either costly or confusing (e.g. empty policies, unused subnets)

## Requirements

You will need:
* AWS IAM credentials - currently using root credentials (which is not ideal)
* Terraform Cloud our Terraform Enterprise account

## About the Lab Code

Terraform configuration built for Terraform 0.13.4 or higher

## What Does the EKS Lab Build?

The lab does the following which is also completely removed when you do a deprovision/destroy so you have no unnecessary remnants left behind:

* Create new IAM for EKS/EC2
* Set up new VPC
* Create 3 public subnets
* Create 3 private subnets
* Create Security Groups for ingress and egress
* Create an Internet Gateway
* Create a Routing Table and Subnet Associations
* Create an EKS Cluster
* Create an EKS Node Group

## Variables Needed for Terraform

You will need to have the following defined in your Terraform configuration. This was built using Terraform Cloud and Terraform Enterprise so the description

| Variable  | Type | Content |
| ------------- | ------------- | ------------- |
| aws_access_key | sensitive | Your AWS programmatic API key |
| aws_secret_key | sensitive | Your AWS API secret key |
| aws_region | standard | Region to launch in (e.g. us-east-2) |
| aws_key_name | text | Display name of your SSH key in AWS |
| aws_key_fingerprint | text | SSH key fingerprint (hex format) from AWS |
| aws_certificate_arn | text | ACM certificate ARN for TLS (not used yet) |
| allowed_ip_network | HCL | Ingress networks for http/https/ssh using HCL format (e.g. ["<IP_ADDRESS>/0","<IP_ADDRESS>/16"] |
| eks_node_min | numeric | Minimum number of EKS compute nodes (>=1) |
| eks_node_max | numeric | Maximum number of EKS compute nodes |
| eks_node_desired | numeric | Desired number of EKS nodes |

## Terraform Cloud Settings / Preferences

This was built using a VCS-backed configuration using GitHub using the very repository you're forking this from.

Execution Mode is set to Auto Apply.  In order to keep things from running every time documention or non-infra files are updated, there is a `trigger.txt` file which can be used as a way to force an apply.

license: MIT

repository: VasanthKumarTR/terraform-eks-lab

branch_name: refs/heads/main

gha_license_id: MIT

repo_name: VasanthKumarTR/terraform-eks-lab


text:
Installing the Module for Testing on your Machine
-----
Run Install.ps1. It will mannyally install the module for the current user.

Installing the Module as a user would.
-----
This means publishing the module to PowerShell gallery and then installing
the module via the Install-Module cmdlet.

To install for the current user

    Install-Package -Name -Scope CurrentUser

To install for all users, run the following as Adminsitrator

    Install-Package -Name

Publishing the package
-----

1. First Compiler the project
2. Install the module via install.ps1
3. Run Publish-Module -Name Visio -NuGetApiKey ***************

The NuGetApiKey can be retrieved by signing into PowerShell gallery org

repository: jalex/VisioAutomation

repo_name: jalex/VisioAutomation


text:
The images are compared and a severity polygon layer is created based on the fire perimeter.
 Prefire images being 5, 7 or 8 with the most preferred being Landsat 8.
### Inputs
  1.Fire perimeter shapefile
  2.Post fire Landsat Image placed in separate folder
  3.Pre fire Landsat Image placed in separate folder

## Script Descriptions

### dnbr_maker.py
This script creates a Differenced Normalized Burn Ratio Raster(DNBR) from Post and Pre fire Landsat imagery.

### barc4_maker.py
This script creates a Burned Area Reflectance Classification(BARC) from a Differenced Normalized Burn Ratio Raster(DNBR).

### landsat.py
This module conatains classes for parsing Landsat 5,7,8 metadata(.MTL) files

### barc_module.py
This module contains Landsat image processing functions and classes that perform; top of atmosphere correction, differenced normalized burn ratio calculations, Metadata parsing

## Requirements
Requires ESRI ArcInfo/Spatial Analyst licensing & ArcMap 10.1+.

## Getting Help or Reporting an Issue
Use the Issues tab to get help or report any issues.

## License
Copyright 2015-2016 Province of British Columbia

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

repository: bcgov/burn-severity

gha_language: Python

repo_name: bcgov/burn-severity


text:
# Outlined Diffuse Shader Fixed for Unity 5.6
This is a fixed version of diffused outline shader from http://wiki.unity3d.com/index.php/Outlined_Diffuse_3
It should be working fine in Unity 5.6 and above.

# Important update:
**A new version of the outline shader is available, go to: https://github.com/Shrimpey/UltimateOutline
Use the updated shader, come back here only if you find it to be working weirdly on your custom models and try some of the ones mentioned below.**

**Guide:**
I suggest you trying **UniformOutline.shader** and then **CustomOutline.shader**. They should work fine for simple objects/complex objects with proper origin. If they fail - try out the **RegularOutline.shader**. The rest of the shaders are for really specyfic purposes, so unless you know what you're doing you probably shouldn't be using them :)

**Showcase:**
Download **OutlineShowcase.unitypackage** and import it to Unity project to see RegularOutline, CustomOutline and UniformOutline shaders in action.

**Shaders:**

# RegularOutline.shader
**RegularOutline.shader** - Just an updated version of the shader from the wiki page, may still work in weird ways => if so, use custom one.
![Regular Outline](/images/standard.PNG?raw=true "Regular Outline")
**Usage**: Curved shapes/thin outlines.
**Problems**: Weird shapes on hard edges.

---
# CustomOutline.shader
**CustomOutline.shader** - My personal take on the outline shader. It increases the scale of the vertices instead of working with normals.
![Custom Outline](/images/custom.PNG?raw=true "Custom Outline")
**Usage**: All shapes
**Problems**: Possible clipping on really thick edges/weird offsets if model's origin is not in center

---
# UniformOutline.shader
**UniformOutline.shader** - Made from scratch, works just like CustomOutline except the scaling is more uniform - width of the outline should be more consistent on irregular meshes (easy to notice when comparing the wheels of the cart from the image below to the Custom Outline shader image).

![Uniform Outline](/images/Uniform.PNG?raw=true "Uniform Outline")

**Usage**: All shapes
**Problems**: Same as in Custom Outline, less overlaying, more angled distortions.

---
# CustomOutline-CameraIndependent.shader
**CustomOutline-CameraIndependent.shader** - Same as custom one, but the outline is the same width despite the distance to the camera.

![Camera Independend Close](/images/camera.PNG?raw=true "Camera Independend Close")
![Camera Independend Far](/images/camera2.PNG?raw=true "Camera Independend Far")

**Usage**: Same sized outline on perspective camera.
**Problems**: Weird shapes on complex objects.

---
# CustomOutline-ConstantWidth.shader
**CustomOutline-ConstantWidth.shader** - Same as custom one, but the outline is constant width despite the camera zoom.

![Constant Width Zoomed In](/images/zoom2.PNG?raw=true "Constant Width Zoomed In")
![Constant Width Zoomed Out](/images/zoom.PNG?raw=true "Constant Width Zoomed Out")

**Usage**: Same outline width despite the camera's zoom (ortho/perspective)
**Problems**: Clipping on thick outlines on complex shapes.

---

*UPDATE 03.09.2017 - Added camera independent version of custom shader*

*UPDATE 04.09.2017 - Added constant size version of custom shader | updated README to include images*

*UPDATE 12.09.2017 - Added uniform outline shader*

*UPDATE 23.12.2017 - Fixed some minor issues with custom, regular and uniform shaders | added showcase unity package*


text:
# Discussion Forum

#### React with Redux practice, 4.28.2020

#### By **_Jieun Kang_**

## 1. Description
Forums application where users may post news, pictures, and other information around a certain topic. Other users can then upvote or downvote content. The more upvotes an item receives, the higher it's displayed on the list. Recreate a basic subreddit and/or vote-based discussion board using React and Redux.

### :small_orange_diamond: User stories:
  * As a user, I want to enter content into a form and submit to create a new post.
  * As a user, I want my new posts to include a timestamp. And I want to see when other listings were posted, too.
  * As a user, I want to upvote posts I particularly enjoy.
  * As a user, I want to downvote posts I don't like, or find inappropriate.
  * As a user, I'd like posts with the most upvotes to appear higher on the page. (We haven't explicitly covered this in our curriculum, but here's a hint: You can complete logic before the return statement of a mapStateToProps() method!)

## 2. Development
### :small_orange_diamond: Technologies Used:
+ [npm](https://www.npmjs.com/)
+ [react](https://reactjs.org/)
+ [Webpack](https://webpack.js.org/)
+ [bootstrap](https://getbootstrap.com/)

### :small_orange_diamond: Run this project to development server
```bash
  $ git clone https://github.com/jieunkang-101/discusstion-forum
  $ cd discusstion-forum
  $ npm install
  $ npm start
```
Now, it will automatically open http://localhost:3000 and show you Tap Room website.

## 3. Known Bugs
There are no known bug at this moment

## 4. Support and contact details
Any feedback is appreciated! Please contact at email<EMAIL_ADDRESS>
### License
*This software is licensed under the MIT license*
Copyright (c) 2020 **_Jieun Kang_**


text:
# Rubix Tensor for PHP
Tensor provides objects and functions for numerical computing on vectors and matrices in [PHP](https://php.net).

## Installation
Install Tensor into your project using [Composer](https://getcomposer.org/):
```sh
$ composer require rubix/tensor
```

## Requirements
- [PHP](https://php.net) 7.1.3 or above

## License
MIT

repository: danielkozina/chatbot

gha_language: PHP

repo_name: danielkozina/chatbot


text:
# Working with Extensions

The MapStore2 [plugins architecture](plugins-architecture.md#plugins-architecture) allows building your own independent modules that will integrate seamlessly into your project.

Extensions are plugins that can be distributed as a separate package (a zip file), and be installed, activated and used at runtime.
Creating an extension is similar to creating a plugin. If you are not familiar with plugins, please, read the [Plugins HowTo page](plugins-howto.md#creating-a-mapstore2-plugin) first.

## Developing an extension

The easiest way to develop an extension is to start from the [MapStoreExtension project](https://github.com/geosolutions-it/MapStoreExtension) that gives you a sandbox to create/test and build your extension.

Read [the readme of the project](https://github.com/geosolutions-it/MapStoreExtension/blob/master/README.md) to understand how to run, debug and build a new extension starting from the sampleExtension in the project.

Here you can find some details about the structure extension files, useful for development and debugging.

## An extension example

A MapStore extension is a plugin, with some additional features.

```javascript
import {connect} from "react-redux";

import Extension from "../components/Extension";
import Rx from "rxjs";
import { changeZoomLevel } from "../../../web/client/actions/map";

export default {
    name: "SampleExtension",
    component: connect(state => ({
        value: state.sampleExtension && state.sampleExtension.value
    }), {
        onIncrease: () => {
            return {
                type: 'INCREASE_COUNTER'
            };
        }, changeZoomLevel
    })(Extension),
    reducers: {
        sampleExtension: (state = { value: 1 }, action) => {
            if (action.type === 'INCREASE_COUNTER') {
                return { value: state.value + 1 };
            }
            return state;
        }
    },
    epics: {
        logCounterValue: (action$, store) => action$.ofType('INCREASE_COUNTER').switchMap(() => {
            /* eslint-disable */
            console.log('CURRENT VALUE: ' + store.getState().sampleExtension.value);
            /* eslint-enable */
            return Rx.Observable.empty();
        })
    },
    containers: {
        Toolbar: {
            name: "SampleExtension",
            position: 10,
            text: "INC",
            doNotHide: true,
            action: () => {
                return {
                    type: 'INCREASE_COUNTER'
                };
            },
            priority: 1
        }
    }
};

```

As you can see from the code, the most important difference is that you need to export the plugin descriptor **WITHOUT** invoking `createPlugin` on it (this is done in `extensions.js` in dev environment and when installed it will be done by the extensions load system).
The extension definition will import or define all the needed dependencies (components, reducers, epics) as well as the plugin configuration elements
(e.g. containers).

### Dynamic import of extension

MapStore supports dynamic import of plugins and extensions.

Dynamically imported plugins or extensions uses lazy-loading: components, reducers and epics will be loaded once plugin or extension
is in the list of plugins configured for the current page (eg. via `localConfig.json` or plugins selected to be included in a context).

!!! note

    Application context could have plugins configured to be loaded optionally using the [Extensions Library](../../user-guide/extension-library/#extension-library).
    Such plugins will be loaded only after being directly activated by the user in the extensions library UI.

Regardless if extension uses lazy-loading or not, its epics will be muted once extension is not rendered on the page.
For more details see [Epic state](../writing-epics/#epic-state-muted-unmuted).

There are few changes required to make extension loaded dynamically:

1. Create `Module.jsx` file in `js/extension/plugins/` and populate it with `js/extension/plugins/Extension.jsx` content.
2. Update content of `js/extension/plugins/Extension.jsx` to be like:

    ```jsx
    import {toModulePlugin} from "@mapstore/utils/ModulePluginsUtils";
    import { name } from '../../../config';

    export default toModulePlugin(name, () => import(/* webpackChunkName: 'extensionName' */ './Module'));
    ```

3. Update `js/extensions.js` and remove `createPlugin` wrapper from `Extension` export. File content should look like:

    ```js
    import Extension from './extension/plugins/Extension';
    import { name } from '../config';

    export default {
        [name]: Extension
    };
    ```

### Distributing your extension as an uploadable module

The sample project allow you to create the final zip file for you.

The final zip file must have this form:

* the file named `index.js` is the main entry point, for the module.
* an `index.json` file that describes the extension, an example follows
* `assets` folder, that contains additional bundles (js, css) came out from the bundle compilation. All additional files (js chunks, css ...) must stay in this folder.
* optionally, a `translations` folder with localized message files used by the extension (in one or more languages of your choice)

```text
my-extension.zip
|── index.js
├── index.json
├── assets
    ├── css
        └── 123.abcd.css
        └── ...
    └── js
        └── 456.abcd.js
        └── ...
└── translations
    └── data.en_EN.json
    └── ...
```

#### index.json

The `index.json file should contain all the information about the extension:

* An `id` that identifies the extension
* A `version` to show in UI. Semantic versioning is suggested.+

* `title` and `description` to display in UI, mnemonic hints for the administrator
* `plugins` the list of plugins that it adds to the application, with all the data useful for the context manager. Format of the JSON object for plugins is suggested [here](https://github.com/georchestra/mapstore2-georchestra/issues/15#issuecomment-564974270)

```json
{
    "id": "a_unique_extension_identifier",
    "version": "1.0.0",
    "title": "the title of the description",
    "description": "a description of the extension",
    "plugins": [{
         "name": "MYPlugin",
         "title": "extensions.a_unique_extension_identifier.title",
         "description": "",
         "defaultConfig": {},
         "...": "..."
    }]
}
```

`plugins` section contains the plugins defined in the extension, and it is needed to be configured in the context-editor. See [Context Editor Configuration](context-editor-config.md#configuration-of-application-context-manager)

### Installing Extensions

Extensions can be uploaded using the context creator UI of MapStore. The storage and configuration of the uploaded zip bundle is managed by a dedicated MapStore backend service, the ***Upload Service***.
The Upload Service is responsible for unzipping the bundle, storing javascript and the other extension assets in the extensions folder and updating the configuration files needed by MapStore to use the extension:

* `extensions.json` (the extensions registry)
* `pluginsConfig.json.patch` (the context creator plugins catalog patch file)

### Updating Extensions

Please refer to the [How to update extensions](../../user-guide/application-context/#how-to-update-extensions) section of user guide to get more information about extensions update workflow.

### Extensions and datadir

Extensions work better if you use a [datadir](externalized-configuration.md#externalized-configuration), because when a datadir is configured,
extensions are uploaded inside it, so they can ***live*** outside the application main folder (and you don't risk to overwrite them when
you upgrade MapStore to a newer version).

### Extensions for dependent projects

Extensions build in MapStore actually can run only in MapStore product. They can not be installed in dependent projects. If you have a custom project, and you want to add support for extensions, you will have to create your build system for extensions dedicated to your application, to build the Javascript with the correct paths.
Moreover, to enable extensions to work with the datadir in a dependent project (MapStore product is already configured to use it) you need to configure (or customize) the following configuration properties in your `app.jsx`:

#### Externalize the extensions configuration

Change `app.jsx` to include the following statement:

```javascript
ConfigUtils.setConfigProp("extensionsRegistry", "rest/config/load/extensions.json");
```

#### Externalize the context plugins configuration

Change `app.jsx` to include the following statement:

```javascript
ConfigUtils.setConfigProp("contextPluginsConfiguration", "rest/config/load/pluginsConfig.json");
```

#### Externalize the extensions assets folder

Change `app.jsx` to include the following statement:

```javascript
ConfigUtils.setConfigProp("extensionsFolder", "rest/config/loadasset");
```

Assets are loaded using a different service, `/rest/config/loadasset`.

## Managing drawing interactions conflict in extension

Extension could implement drawing interactions, and it's necessary to prevent a situation when multiple tools from different plugins or extensions have active drawing, otherwise it could end up in an unpredicted or buggy behavior.

There are two ways how drawing interaction can be implemented in plugin or extension:

* Using DrawSupport (e.g. Annotations plugin)

* By intercepting click on the map interactions (e.g. Measure plugin)

### Making another plugins aware of your extension starts drawing

If your extension using DrawSupport - you're on the safe side.
Extension will dispatch `CHANGE_DRAWING_STATUS` action.
This action can be traced by another plugins or extensions, and they can control their tools accordingly.

If your extension is using `CLICK_ON_MAP` action and intercepts it perform any manipulations on click - you need to make sure that your extension also dispatch `REGISTER_EVENT_LISTENER` action (see `Measure` plugin as an example) when your extension activates drawing.

It should also dispatch `UNREGISTER_EVENT_LISTENER` once drawing interaction stops.

### Making your extension aware of another plugin drawing

There is a helper utility named `shutdownToolOnAnotherToolDrawing`. This is a wrapper for a common approach to dispatch actions that will toggle off drawing interactions of your extension whenever another plugin or extension starts drawing.

extensionEpics.js:

```js
export const toggleToolOffOnDrawToolActive = (action$, store) => shutdownToolOnAnotherToolDrawing(action$, store, 'yourToolName');
```

with this code located in extension's epics your tool `yourToolName` will be closed whenever:

* feature editor is open
* another plugin or extension starts drawing.

"shutdownToolOnAnotherToolDrawing" supports passing custom callback to determine whether your tool is active (to prevent garbage action dispatching if it's already off) and custom callback to list actions to be dispatched.

## Using "ResponsiveContainer" for dock panels

Starting with MapStore v2022.02.00, layout improvements have been introduced which, in addition to other changes,
introduce a new sidebar menu to be used instead of the burger menu.

All extensions using `DockPanel` or `DockablePanel` components have to be updated
if their dock panel is rendered on the right side of the screen, next to the new sidebar menu.

Following changes should be applied (`MapTemplates` plugin can be a reference for the changes needs to be applied):

1. Make your extension aware of the map layout changes by getting corresponding state value using following selector:

    ```js
    createSelector(
        ...
        state => mapLayoutValuesSelector(state, { height: true, right: true }, true),
        ...
        (dockStyle) => ({
            dockStyle
        })
    )
    ```

    It will get offset from the right and the bottom that needs to be applied to the `ResponsiveContainer`

2. Replace `DockPanel`, `DockablePanel`, `ContainerDimensions` (if used) with the `ResponsiveContainer` and make sure
that dock content is a child of `ResponsiveContainer`:

    was:

    ```js
    return (
        <DockPanel
            open={props.active}
            position="right"
            size={props.size}
            bsStyle="primary"
            title={<Message msgId="mapTemplates.title"/>}
            style={{ height: 'calc(100% - 30px)' }}
            onClose={props.onToggleControl}>
            {!props.templatesLoaded && <div className="map-templates-loader"><Loader size={352}/></div>}
            {props.templatesLoaded && <MapTemplatesPanel
                templates={props.templates}
                onMergeTemplate={props.onMergeTemplate}
                onReplaceTemplate={props.onReplaceTemplate}
                onToggleFavourite={props.onToggleFavourite}/>}
        </DockPanel>
    )
    ```

    become:

    ```js
    return (
        <ResponsivePanel
            containerStyle={props.dockStyle}
            style={props.dockStyle}
            containerId="map-templates-container"
            containerClassName="dock-container"
            className="map-templates-dock-panel"
            open={props.active}
            position="right"
            size={props.size}
            bsStyle="primary"
            title={<Message msgId="mapTemplates.title"/>}
            onClose={props.onToggleControl}
        >
            {!props.templatesLoaded && <div className="map-templates-loader"><Loader size={352}/></div>}
            {props.templatesLoaded && <MapTemplatesPanel
                templates={props.templates}
                onMergeTemplate={props.onMergeTemplate}
                onReplaceTemplate={props.onReplaceTemplate}
                onToggleFavourite={props.onToggleFavourite}/>}
        </ResponsivePanel>
    );
    ```

    With the applied changes dock will be rendered properly both for layout with `BurgerMenu` and `SidebarMenu`.

## Making other dock panels closed automatically when extension panel is open

All the dock panels open next to the sidebar should be mutually excluded. Active dock panel should be closed whenever another panel is open.

Array at `state.maplayout.dockPanels.right` contains list of panels that can be extended or modified by extension by dispatching
`updateDockPanelsList` action.

Please note that adding dock into the list will automatically close previously active panel, so it's a good idea to
dispatch the action on app initializing or when dock panel is open. Measurement plugin can be used as a reference of
implementation, see `openMeasureEpic` & `closeMeasureEpic` in `epics/measurement.js`.

gha_language: JavaScript

gha_license_id: NOASSERTION


text:
---
page_type: sample
languages:
- csharp
products:
- azure
description: "How to take a model exported from the Custom Vision Service in the ONNX format and add it to an application for real-time image classification."
urlFragment: cognitive-services-onnx-customvision-sample
---

# ONNX models exported from Custom Vision Service

> **Warning**
>
> This repository is no longer maintained. Please visit [Azure-Samples/customvision-export-samples](https://github.com/Azure-Samples/customvision-export-samples)

This sample application demonstrates how to take a model exported from the [Custom Vision Service](https://www.customvision.ai) in the ONNX format and add it to an application for real-time image classification.

## Getting Started

### Prerequisites
- Windows 10 (Version 1809 or higher)
- [Windows 10 SDK](https://www.microsoft.com/software-download/windowsinsiderpreviewSDK) (Build 17763 or higher)
- [Visual Studio 2019](https://developer.microsoft.com/windows/downloads) (or Visual Studio 2017, version 15.7.4 or later)
- An account at [Custom Vision Service](https://www.customvision.ai)

### Quickstart

1. Clone the repository and open the project in Visual Studio
2. Build and run the sample Application
3. Application comes with two models already included along with sample images to test
### Adding your own sample model of your own classifier.
The models provided with the sample recognizes some foods (Cheesecake, Donuts, Fries) and the other recognizes some plankton images. To add  your own model exported from the [Custom Vision Service](https://www.customvision.ai) do the following, and then build and launch the application:
  1. [Create and train](https://docs.microsoft.com/en-us/azure/cognitive-services/custom-vision-service/getting-started-build-a-classifier) a classifer with the Custom Vision Service. You must choose a "compact" domain such as **General (compact)** to be able to export your classifier. If you have an existing classifier you want to export instead, convert the domain in "settings" by clicking on the gear icon at the top right. In setting, choose a "compact" model, Save, and Train your project.
  2. Export your model by going to the Performance tab. Select an iteration trained with a compact domain, an "Export" button will appear. Click on *Export* then *ONNX* then *Export.* Click the *Download* button when it appears. A *.onnx file will download.
  3. Drop your *model.onnx file into your project's Assets folder.
  4. Under Solutions Explorer/ Assets Folder add model file to project by selecting Add Existing Item.
  5. Change properties of model just added: "Build Action" -> "Content"  and  "Copy to Output Directory" -> "Copy if newer".
  6. In the MainPage.xaml.cs file set the "_ourOnnxFileName" constant to the name of the model just added.
  7. Build and run.
  8. Click button to select image to evaluate.

### Things to note.
- Image preprocessing is performed by binding method call. Look at method "EvaluateAsync" of class "OnnxModel". Note that it binds a VideoFrame instance to "data"; this binding call will perform cropping and scaling such that the image fits the define size of model (224 x 224 with included models). It will also reformat the image data into a tensor that the model expects(Channel(BGR), Rows, Cols).
- mlgen.exe - This tool generates API code in c# or c++ for a specified ONNX model.  See [Windows ML overview](https://docs.microsoft.com/en-us/windows/uwp/machine-learning/overview) for description of the utility. If you are working with an ONNX model and are unsure what variable types to utilize, this utility will generate the correct types.

## Resources
- Link to [ONNX](https://onnx.ai/)
- Link to [ONNX on GitHub](https://github.com/onnx/onnx)
- Link to [Get started with Windows Machine Learning](https://docs.microsoft.com/en-us/windows/uwp/machine-learning/get-started)
- Link to [Custom Vision Service Documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/custom-vision-service/home)

gha_language: C#


text:
# CShop Project

### Requirements:

* Backend needs to be built in C#
* List products
* Cart
* Checkout
* Information about the items
* Fields for customer information
* Git (And not everything in one commit please!)
* At least one unit test
* Tested by at least one of your class mates.

## Documentation

* Built in MVC
* MYSQL Database

## Development made by:

* Filip Petersson - *(Development)*

## License

[MIT](LICENSE) ©

## Testing

* Edvin Wiberg
* Kristian Kurki


text:
# How will data be stored and accessed?

## Context

The raw HES data is large, complex, unweildly and potentially dirty. A way to
clean, store and later easily access the data for analysis required, which means
that repeated cleaning and prep of the raw data is avoided.

There are multiple datasets (with different variables), which once cleaned, will
be accompanied by additional derived variables, and additional derived datasets.

## Decision

The raw data will be read into a SQLite database through R. R is The Health
Foundation's open-source language of choice, and is well equiped to
handle later analysis of said data. An SQLite database is not stored in memory,
avoiding holding very large datasets an R session. It is a standard database
format which can be easily queried with SQL which can in turn be written within
most other common languagses, including R.

In an SQLite database the database consistents of all the data, and within that
there are tables; here each table corresponds to a HES dataset or a derived
dataset.

## Status

Decided

## Consequences

Some additional learning is required in how to query an SQLite database. This
requires some additional documentation (to come).

An SQLite database still occupies quite a large amount of storage space.

Reading large files into R is always going to somewhat slow, but through testing
we have optimised the process using (`fread`)[link to come] from the data.table
package, to read in the data in chunks and write directly to SQLite.

gha_language: R


text:
# Jersey-Security-Basic

Written by Philip A Senger

[philip.a.senger<EMAIL_ADDRESS>|
mobile:<PHONE_NUMBER> |
[CV/Resume](http://www.visualcv.com/philipsenger) |
[blog](http://www.apachecommonstipsandtricks.blogspot.com/) |
[LinkedIn](http://au.linkedin.com/in/philipsenger) |
[twitter](http://twitter.com/PSengerDownUndr)

### About

[![Build Status](https://travis-ci.org/psenger/Jersey-Security-Basic.svg?branch=master)](https://travis-ci.org/psenger/Jersey-Security-Basic)

There are many ways you can implement Authentication and Authorization with Jersey. This is the most simplest example I could demo with [Basic access authentication](https://en.wikipedia.org/wiki/Basic_access_authentication). By no means should you drop this code into production.

Additionaly, I have added tomcat with a plugin to the maven pom and created a war goal so this can be deployed as a war to a 2.5 servlet speced container.

### Why

If you are reading this, you may be wondering why I built this project. It is because someone in my Linkedin network asked me how to do this. This was the simplest example I could think of and is a collection of examples I gathered from other resources on the web.

### How

First you will need Java 1.8 installed on your computer.

* [Install Java 1.8 ](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)

Next you will need to install Apache Maven. You will NOT need tomcat, as I have installed a Tomcat pluggin.

* [Installing Apache Maven](https://maven.apache.org/install.html)
* [videos for Apache Maven](https://www.youtube.com/playlist?list=PLTgRMOcmRb3OGBIfqPSZFk0Nn0B4xGZqs)

Then you can run the whole project with Tomcat ( as a plugin ) via the following command line. I have included tomcat 7 in this build so you dont have to download it and install it. This should run with tomcat 8 with some minor tweaks to the web.xml More information on the goals can be found here [tomcat 7 maven goals](http://tomcat.apache.org/maven-plugin-trunk/tomcat7-maven-plugin/plugin-info.html)

```
mvn clean tomcat6:run
```

To get the books a http transaction would look like this. The string aXJvbm1hbjpwYXNzd29yZA== is a base64 encoded ASCII string containing the userid a colon and password. In this case it is "ironman:password"

```
GET http://localhost:8080/books
Accept: application/json
Authorization: Basic aXJvbm1hbjpwYXNzd29yZA==
```

repository: psenger/Jersey-Security-Basic

gha_language: Java

repo_name: psenger/Jersey-Security-Basic


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

Baasify is an open source backend-as-a-service in its early stage. Built on [Lumen](http://lumen.laravel.com/).

#### Current Functions

* Content Management.
* File Management.
* Users Management.
* Push Notifications.

#### Planned Functions and Features

* Database Management.
* Analytics.
* SDKs for both iOS and Android.
* Web interface.

## How to build Baasify

1. Rename .env.example to .env and configure your database settings.
2. Set your app key.
3. Go to your Baasify directory and type:

```bash
composer install
php artisan migrate
php artisan db:seed
```

## How to use Baasify

Baasify API is fully documented at [Baasify API Documentation](http://baasify.org/docs).

Still need help? You are welcome to join [#baasify on freenode](http://webchat.freenode.net/?channels=baasify)
and ask for help there.

## Helping Baasify

### I found a bug

If you found a bug, then search existing open issues first. If it's not there, file an issue and include the steps required
to reproduce the problem.

### I have a new suggestion

First, we are grateful for your caring about Baasify.
If no one else [suggested](https://github.com/Baasify/Baasify/labels/enhancement) it before here,
feel free to file it as an issue and we will take it from there.

## Credits

Baasify is built on [Lumen](http://lumen.laravel.com/) and
use [Notificato](https://github.com/mac-cain13/notificato) to take care of Apple Push Notification Service.

## License

Baasify is an open source software licensed under the [MIT license](http://opensource.org/licenses/MIT)

repository: Baasify/Baasify

repo_name: Baasify/Baasify


text:
# stripes-testing

Copyright (C) 2017-2018 The Open Library Foundation

This software is distributed under the terms of the Apache License,
Version 2.0. See the file "[LICENSE](LICENSE)" for more information.

## Introduction

Stripes-testing is a toolkit for running tests against Stripes UI modules and platforms.  It is based on FOLIO's centralized [ui-testing](https://github.com/folio-org/ui-testing) repo, with the notable omission of app dependencies and tests.  Tests themselves exist within the corresponding app or platform that they exercise.

Stripes UI modules are tested with BigTest and Nightmare.  The former is primarily used for unit tests and the latter for integration tests.  Refer to the following documents for details on using each framework within FOLIO.

* Unit tests with [BigTest](doc/bigtest.md)
* Integration tests with [Nightmare](doc/nightmare.md)

## Issues

See project [UITEST](https://issues.folio.org/browse/UITEST)
at the [FOLIO issue tracker](https://dev.folio.org/guidelines/issue-tracker).

repository: frontside-folio/stripes-testing

repo_name: frontside-folio/stripes-testing


text:
# GraphPlanarityTesting
[![NuGet](https://img.shields.io/nuget/v/GraphPlanarityTesting.svg)](https://www.nuget.org/packages/GraphPlanarityTesting)

C# implementation of the Boyer-Myrvold algorithm for planarity testing. Inspired by the implementaion from C++ Boost library.

Even though the original algorithm works in *O(n)*, this implementation has worst-case time complexity *O(n2)*. It is caused by the fact that I use standard linked list instead of a more sophisticated data structure in one place of the algorihtm. The original paper also provides an algorithm for extracting Kuratowski subgraph if a given graph is not planar - this is not implemented in this library.

## Features
- Checks if a given undirected graph is planar or not
- Computes planar embedding if a given graph is planar
- Computes faces of a given planar embedding
- .NET Standard 2.0

## API

```csharp
public class BoyerMyrvold<T>
{
  /// <summary>
  /// Tries to get faces of a planar embedding of a given graph.
  /// </summary>
  /// <param name="graph">Graph</param>
  /// <param name="faces">Faces of a planar embedding if planar, null otherwise</param>
  /// <returns>True if planar, false otherwise</returns>
  public bool TryGetPlanarFaces(IGraph<T> graph, out PlanarFaces<T> faces);

  /// <summary>
  /// Checks if a given graph is planar.
  /// </summary>
  /// <param name="graph">Graph</param>
  /// <returns>True if planar, false otherwise</returns>
  public bool IsPlanar(IGraph<T> graph);

  /// <summary>
  /// Checks if a given graph is planar and provides a planar embedding if so.
  /// </summary>
  /// <param name="graph">Graph</param>
  /// <param name="embedding">Planar embedding if a given graph is planar, null otherwise</param>
  /// <returns>True if planar, false otherwise</returns>
  public bool IsPlanar(IGraph<T> graph, out PlanarEmbedding<T> embedding);
}
```

## Tests
The solution contains a project with basic functionality tests.

### `BoyerMyrvoldTests` class
- checks that if a graph is one big cycle, it is planar and there are exactly two faces in the embedding
- checks that if a random graph has more than *3n - 6* vertices, it is not planar

### `BoostComparisonTests` class
This class contains tests that check if the results of the algorithm are the same as in the Boost implementation. The repository contains contains 3 files with different random graphs together with the results from Boost.

- *10000_small_sparse_graphs.txt* - 10000 random graphs with 10-100 vertices and less than 3n edges.
- *5000_small_dense_graphs.txt* - 5000 random graphs with 10-100 vertices and any number of edges.
- *5000_large_sparse_graphs.txt* - 5000 random graphs with 100-1000 vertices and less than 3n edges.


text:
# @mousepox/static-server

A dead simple, zero-dependency static file server for [Node.js](https://nodejs.org/en/).

[![Actions Status](https://github.com/geoffb/mousepox-static-server/workflows/Build/badge.svg)](https://github.com/geoffb/mousepox-static-server/actions)

## Quick Start

```ts
import { StaticServer } from "@mousepox/static-server";

// Create server from a path to static resources
const server = new StaticServer("path/to/static/resources");

// Start listening
server.listen(8081);
```

## MIME Types

Content types are inferred from file extensions. By default, common extensions are mapped to their appropriate MIME types. For example, `.js` => `text/javascript`.

However, custom mappings can be set using the `setMIMEType` method:

```ts
server.setMIMEType(".xml", "application/xml");
```

license: ISC

repository: geoffb/mousepox-static-server

gha_language: TypeScript

gha_license_id: ISC

repo_name: geoffb/mousepox-static-server


text:
# scrpbk.in

168Challenge - Official Repo for scrpbk.in, a 168 Hours Challenge project. `#168Challenge` is a new type of challenge in which creators of all trades are challenge to create and publish an entire project using an allocated 168 hours towards finishing the project. Find out more at http://callumhopkins.com/168-hours-challenge/

## Documentation

This project will documented and will be accessible publicly.

----

## Episodes

#### Episode 5
Episode 5 is now live and available for viewing at http://callumhopkins.com/168challenge-episode-5/

#### BONUS
Bonus Episode is now live and available for viewing at https://www.youtube.com/watch?v=Cw6WPo67F0I&index=5&list=PLT5UooPvJC1kuk0si2l4mjDkGid6wdETK

#### Episode 4
Episode 4 is now live and available for viewing at http://callumhopkins.com/168challenge-episode-4/

#### Episode 3
Episode 3 is now live and available for viewing at http://callumhopkins.com/168challenge-episode-3/

#### Episode 2
Episode 2 is now live and available for viewing at http://callumhopkins.com/168challenge-ep2/

#### Episode 1
Episode 1 is now live and available for viewing at http://callumhopkins.com/168challenge-ep1/

----

## License
(The MIT License)

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

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

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


text:
---
layout: post
title: LeetCode - Department Highest Salary
categories:
    - LeetCode(Second)
tags:
    - LeetCode(Second)
    - Medium
    - Stack
excerpt_separator: "<!--more-->"
---

### Question Definition
The Employee table holds all employees. Every employee has an Id, a salary, and there is also a column for the department Id.
```
+----+-------+--------+--------------+
| Id | Name  | Salary | DepartmentId |
+----+-------+--------+--------------+
| 1  | Joe   | 70000  | 1            |
| 2  | Henry | 80000  | 2            |
| 3  | Sam   | 60000  | 2            |
| 4  | Max   | 90000  | 1            |
+----+-------+--------+--------------+
```
The Department table holds all departments of the company.
```
+----+----------+
| Id | Name     |
+----+----------+
| 1  | IT       |
| 2  | Sales    |
+----+----------+
```
Write a SQL query to find employees who have the highest salary in each of the departments. For the above tables, Max has the highest salary in the IT department and Henry has the highest salary in the Sales department.
```
+------------+----------+--------+
| Department | Employee | Salary |
+------------+----------+--------+
| IT         | Max      | 90000  |
| Sales      | Henry    | 80000  |
+------------+----------+--------+
```
<!--more-->
### Sql Solution
```mysql
select d.Name as Department, e.Name as Employee, e.Salary from Employee as e, Department as d, (select DepartmentId, Max(Salary) as Salary from Employee group by DepartmentId) as s where s.Salary = e.Salary and s.DepartmentId = e.DepartmentId and e.DepartmentId = d.Id
```


text:
**I'm a Ruin双手简谱** 和五线谱完全对应。

_I'm a Ruin_ 是威尔士女歌手Marina and the Diamonds第三张录音室专辑《Froot》中的歌曲。尽管Marina and
the
Diamonds长着一张80年代好莱坞丽伶似的脸，她的音色厚重有力，带着浓重的7/80年代迪斯科气息。专辑一经发布，迅速收到各大网站的好评。《卫报》赞扬收录其中的每一首歌都值得推敲，《周日快报》形容这是一张极具欧洲特色的流行专辑，称它是“直击人心“的。

歌词下方是 _I'm a Ruin钢琴谱_ ，希望大家喜欢。

url: https://raw.githubusercontent.com/Emptyspirit/everyonepiano-music-database/fb8ba03dd9474f049b18d9822c40a395229b7aca/流行/I'm a Ruin-Marina and the Diamonds/README.md


text:
---
layout: post
title: week 2
finished: true
# date: May 30, 2021
---

This week I learned to work with raster data in python. This includes:
1. How to read raster data stored in a GeoTIFF file using rasterio and rioxarray
2. Plotting raster data using pyplot
3. How to extract important spatial information from the GeoTIFF file
4. How to work with no data values
5. What reprojecting is, why it is important, and how to do it using rasterio
6. Working with multi-band rasters and performing calculations with multiple rasters
7. Exporting rasters with spatial information and metadata included in GeoTIFF file
8. Advanced plotting including classifying data and using lengeds

The idea for a secondary DREU research team was well received, however, it will take some time to figure out how to make it work as there are people in different research periods and different time zones. While that process is underway, my big struggle of staying on task for 8 hours a day while I was alone at a desk persisted.

Luckily for me, there is in-person research going on at my university and I live close-by, so I spoke to a couple professors in the Computer Science and Math department at the University of Richmond and they were happy to have me work alongside their research teams. So, I will be working at the university and joining the activities that students doing on-campus research participate in!


text:
# Context Provider & Consumer for Web Components

[![npm version](https://badge.fury.io/js/%40kuscamara%2Fcontext-provider.svg)](https://badge.fury.io/js/%40kuscamara%2Fcontext-provider)
[![Build Status](https://travis-ci.com/kcmr/context-provider.svg?token=fKx6tXSkRCMAsjnc8HQK&branch=main)](https://travis-ci.com/kcmr/context-provider)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![codecov](https://codecov.io/gh/kcmr/context-provider/branch/main/graph/badge.svg)](https://codecov.io/gh/kcmr/context-provider)
![Dependency status](https://img.shields.io/david/kcmr/context-provider.svg)

Allows to use context Provider and Consumer components in a similar manner than the [Context in React](https://reactjs.org/docs/context.html).

> Context provides a way to pass data through the component tree without having to pass props down manually at every level.

This can be useful for properties or state that is considered global to an application like the language, user information or media query breakpoints.

The value of the nearest Provider component is available to Consumer components in their `context` property regardless the level of nesting without the need to pass properties from parents to children.

## Usage

**Install**

```bash
npm i @kuscamara/context-provider
```

**Create a Provider**

```js
import { createContextProvider } from '@kuscamara/context-provider';

const globals = /* App globals */;
const ContextProvider = createContextProvider(globals);

window.customElements.define('context-provider', ContextProvider);
```

**Add Consumer capabilities to a component**

```js
import { contextConsumerMixin } from '@kuscamara/context-provider';

class MyComponent extends contextConsumerMixin(HTMLElement) {
  render() {
    // do whatever you need with your context property
    return `<p>My context is ${this.context}</p>`;
  }
}
```

**Set and change the Provider value**

You must set the property, not the attribute.
LitElement is used in this example to emphasize the property binding syntax (`.property`).

```js
import { LitElement, html } from 'lit-element';

class App extends LitElement {
  static get properties() {
    return {
      globals: { type: Object },
    };
  }

  constructor() {
    super();
    this.globals = {
      lang: 'es',
    };
  }

  onLangChange(event) {
    this.globals = {
      ...this.globals,
      lang: event.detail.value,
    };
  }

  render() {
    return html`
      <context-provider .value=${this.globals}>
        <lang-selector @change=${this.onLangChange}></lang-selector>

        <!-- context-consumer has access to the provider value in its "context" property -->
        <context-consumer></context-consumer>
      </context-provider>
    `;
  }
}
```

**Subscribe to changes in the Provider value from consumers**

The `onContextChanged()` hook should be implemented by components using the Consumer mixin that want to react to changes in the `value` property of the Provider.

```js
import { contextConsumerMixin } from '@kuscamara/context-provider';

class MyComponent extends contextConsumerMixin(HTMLElement) {
  // Called when the Provider value changes
  onContextChanged() {
    this.render();
  }

  render() {
    return `<p>My context is ${this.context}</p>`;
  }
}
```

## Development

- `yarn`: install dependencies (required for linting).
- `yarn start`: run the development server.
- `yarn test:watch`: run the test in watch mode.
- `yarn test`: run test with coverage output.

This repository uses [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) to automatically generate the releases and Changelog.

## Acknowledgments

The Provider and Consumer are **highly inspired by [Masquerades](https://github.com/alfredosalzillo/masquerades)**, a library for styled Web Components.

## License

This project is licensed under the [MIT License](LICENSE).

repository: pinkhominid/context-provider

repo_name: pinkhominid/context-provider


text:
# vlt.fit.gaussspotfit_noposition

```
  GAUSSSPOTFIT - Fit a 2d gaussian to data

   [MU,C,AMP,SIZES,FIT_RESPONSES] = vlt.fit.gaussspotfit_noposition(XRANGE, YRANGE, RADIUS, RESPONSE)

   Fits a 2d gaussian PDF to responses to circle / aperture stimulation.

   INPUTS:
     XRANGE and YRANGE specify the size of the stimulus field. They should be vectors:
     (e.g., XRANGE = 0:800; YRANGE=0:600).
     X_CTR, Y_CTR, RADIUS, and RESPONSE are vectors that describe the stimulus circles.
     RESPONSE is the response of the system to that circle.
   OUTPUTS:
     MU - Always [0 0]
     C  - The covariance matrix of the best-fit gaussian PDF; always [C1 0 ; 0 C1]
     AMP - The amplitude of the response for each circle size.
     SIZES - The sizes that are associated with each amplitude.
     FIT_RESPONSES - the fit responses

```

repository: VH-Lab/vhlab-toolbox-matlab

gha_language: MATLAB

repo_name: VH-Lab/vhlab-toolbox-matlab


text:
# Tasks Demo App

- [Initial Requirements](#initial-requirements)
- [Quickstart](#quickstart)
- [Bonus](#bonus)
- [Roadmap](#roadmap)

This is a basic demo application to showcase the frontend development abilities of Andrew Martin. It was built using Create React App, and uses React, Redux, and several other small, popular libraries to manage application state. It also leverages `reactstrap` to simplify some of the UI components.

See the [Rails Backend Demo App](https://github.com/andrewmartin/tasks-demo-rails).

[Screen Recording](http://cloud.believelabs.com/cbac91e56848)

## Initial Requirements

Create a main content panel that will iterate through this list of users and display each of them in a table format with each attribute shown as a column. Create an additional column called "Action" that will contain a single button for each row called "Complete".

| Name  |    Task     | Role  |  Location   |    Action    |
| :---: | :---------: | :---: | :---------: | :----------: |
|  Bob  | trim hedges | Admin | Los Angeles | **Complete** |

The Complete button should remove the user from the content panel and update the UI accordingly based on the next requirements in the next paragraph. The removal should update the task in the backend as well.

To the left of the content panel, create a separate dropdown filter for each of the above attributes except for name (Role, Location, Task). This filter should generate separate checkboxes for each instance of an attribute based on the current list of users shown. For example, the "Role" filter will initially show 4 separate checkboxes for Admin, Marketing, Support and User, but the Marketing selection should be removed if there are no more users being shown with the Marketing role. Clicking the dropdown should display the list of checkboxes and allow selections to be made. Clicking the dropdown again should close the dropdown and display the current selections for that filter.

Clicking a checkbox on any of the filters will immediately affect the list in the content panel by changing the background color of the affected row's column (just the column, not the entire row). Use the following colors:

Role - red
Location - green
Task - blue

For example, clicking the "Los Angeles" checkbox in the Location filter will change the background color of every "Los Angeles" column to green. Multiple selections for each of the columns should be possible. For example, clicking on "Los Angeles", "Denver" and "Admin" will change the background color for each selected location to green and the selected role to red.

Think about code and styling reusability when creating each UI component and whether it would make sense from the perspective of code maintainability to create a class to manage the different UI interactions.

Bonus - add pagination that shows 10 users per page
Extra bonus - make the number of rows shown for each page of pagination configurable in the UI.

## Quickstart

1. `yarn`
2. `cp .env-example .env` (and configure to match the Rails server)
3. `yarn start`

## Bonus

- Dynamic pagination generated based on API response
- Configureable "per page" pagination

## Roadmap

- Add jest/enzyme tests

repository: andrewmartin/tasks-demo-react

repo_name: andrewmartin/tasks-demo-react


text:
---
Title: CV
---

## Education

*
Ph.D. Physics, 2016-present (expected 2018) / Rice University  / Thesis: Modeling Hot Plasma in the Solar Corona (working title) / Advisor: Stephen Bradshaw, Ph.D.

*
M.S. Physics, 2013-2016 / Rice University

*
B.S. Astrophysics, 2009-2013 / Baylor University  / Thesis: Astrophysical Applications of Dusty Plasma Physics, Advisor: Lorin Matthews, Ph.D. / University Honors Program, Magna Cum Laude, Phi Beta Kappa / Minors: Mathematics, Great Texts of the Western Tradition

## Computing Skills

*
Languages: Bash, C, C++, Python

*
Scientific Computing: IDL, Mathematica, MATLAB, NumPy, SciPy, SLURM, TORQUE

*
Markup: CSS, HTML, LaTeX, markdown, reStructuredText

*
DevOps: git/GitHub, Travis CI, Sphinx

## Publications

*
W.T. Barnes, P.J. Cargill, and S.J. Bradshaw, *Inference of Heating Properties from Hot Non-flaring Plasmas in Active Region Cores II. Nanoflare Trains*, ApJ, 2016, [2016ApJ...833..217B](http://adsabs.harvard.edu/abs/2016ApJ...833..217B)

*
W.T. Barnes, P.J. Cargill, and S.J. Bradshaw, *Inference of Heating Properties from Hot Non-flaring Plasmas in Active Region Cores I. Single Nanoflares*, ApJ, 2016, [2016ApJ...829...31B](http://adsabs.harvard.edu/abs/2016ApJ...829...31B)

## Talks and Posters

*
Talk: *A Framework for Forward Modeling Solar Active Regions* / Space Physics Seminar Series / Rice University / Houston, TX / 27 February 2017

*
Poster: [*Understanding the Impact of Nanoflare Heating Frequency on the Observed Emission Measure Distribution*](http://shinecon.org/shine2016/ViewAbstract.php?idabs=132) / Solar Heliospheric and Interplanetary Environment (SHINE) Conference / National Science Foundation / Santa Fe, NM / 11-15 July 2016

*
Talk: [*Hot Non-flaring Plasmas in Active Region Cores Heated by Single Nanoflares*](http://adsabs.harvard.edu/abs/2016SPD....4720203B) / 47th Annual Solar Physics Division Meeting / American Astronomical Society / Boulder, CO / 31 May-3 June 2016

*
Talk: *Impacts of Two-fluid Effects on Emission from Impulsively Heated Coronal Loops* / Space Physics Seminar Series / Rice University / Houston, TX / 9 November 2015

*
Poster: *Effects of Ion Heating on Emission Measure of Coronal Loops in Active Region Cores* / Coronal Loop Workshop VII / Unversity of Cambridge / Cambridge, UK / 21-23 July 2015

*
Poster: [*Nonnegative Matrix Factorization as a Method for Studying Coronal Heating*](http://adsabs.harvard.edu/abs/2015TESS....120306B) / Triennial Earth-Sun Summit / American Astronomical Society / Indianapolis, IN / 26-30 April 2015

*
Poster: [*Dust Grain Growth in a Protoplanetary Disk: Effects of Location on Charge and Size*](http://adsabs.harvard.edu/abs/2013LPI....44.1897B) / 44th Annual Lunar and Planetary Science Conference / Lunar and Planetary Science Institute / The Woodlands, TX / 18-22 March 2013

*
Talk: *Dust Grain Charging in a Protoplanetary Disk* / Texas Undergraduate Astronomy Research Symposium / Texas A&M University / College Station, TX / 14 September 2012

repository: bhillmann/resume

repo_name: bhillmann/resume


text:
# PKGNAME

> PKGDESC

Maybe some badges here.

Replace this with your own content.

## Install

```console
$ npm i -g PKGNAME
```

## Usage

```console
$ PKGNAME --help
```

## License

ISC © Contributors

license: ISC,MIT

repository: sywac/create-sywac

detected_licenses: ISC MIT

repo_name: sywac/create-sywac


text:
---
title: Moving the aliens on my Scratch Space Invaders
layout: post
author: patrik.roberts
permalink: PPI6.github.io
source-id: 1M-yH7vzbPOTdJwPzNok3T8VTK_cu9acdQsNizZEdnpo
published: true
---
My target for my last lesson was to make  the aliens in my own space invaders game on scratch to move from left to right and down in synchronised action. It was mostly successful except I had a problem with some of the aliens being on top of eachother...

I used persevering when some of my aliens were on top of eachother, so i had to play around with my code by using options like 'go to x…,go to y…' until my aliens weren’t on top of each other and moving correctly.

I used questioning by asking  myself questions like: what will happen to my sprite if i change the option 'go to x… go to y…'? I asked myself this question to try and get the sprites into separate places.

I used independence by trying to fix my problem of not being able to shoot my laser on my own by trying different options like 'move y…' rather than giving up and asking the teacher for the answer.

I used reflecting when I made the mistake of making my cloned sprites too slow.I reflected on it and figured out what I had done wrong which was putting the wrong number in the 'move … steps' option. Now I won’t make the same mistake again.

I used engagement when my shooting code didn't work. Instead of doing nothing and being lazy because my code didn’t work, I engaged,focused and tried on it and in the end figured out that I was missing the option 'change y by…’!

I could've focused more on my work(which would improve my progress) but a few times I was put off by failure. In the future I need to change my attitude to failure and persevere at all times and not just sometimes. I will do this by keep on playing with options for my code rather than just giving up!

path: /_posts/blog 2.md

filename: blog 2.md


text:
---
id: 8
text: Which choice set layout do you like best for single-choice questions?
questionType: SINGLE_CHOICE
choiceType: HORIZONTAL_BUTTON
choices: [Vertical Radio, Horizontal Radio, Vertical Button, Horizontal Button]
additionalComments: false
---

Similar to likert questions, `surveyless` provides various ways to render single-choice choice sets.

repository: chrisrzhou/surveyless

repo_name: chrisrzhou/surveyless


text:
# Django S3 File Upload Client

[![Build Status](https://travis-ci.com/dabapps/django-s3-file-upload-client.svg?token=k7ApnEQbpXLoWVm5Bc9o&branch=master)](https://travis-ci.com/dabapps/django-s3-file-upload-client)

Upload files from the browser to S3 - client side implementation (with redux integration)

For the server side implementation see [github.com/dabapps/django-s3-file-upload-server](https://github.com/dabapps/django-s3-file-upload-server)

## Installation

To install the package run:

```shell
npm i @dabapps/django-s3-file-upload -S
```

### Compatibility

You will also need polyfills for both `Promises` and `Symbols` if you wish to target older browsers.

## Usage

### How it works

The flow to be able to upload files from the browser straight to AWS is as follows.
![Flow S3 file uploads](images/flow-s3-file-uploads.png)

This library abstracts away the process of chaining the three requests that the frontend needs to make to upload a file from the browser to S3:
1. Request upload from server
2. Upload file to AWS S3
3. Mark upload as complete on server

The implementation is specific to the endpoints setup in this repo [github.com/dabapps/django-s3-file-upload-server](https://github.com/dabapps/django-s3-file-upload-server) so be sure to have the backend configured accordingly.

### Redux integration

This library provides 3 functions that can be combined to handle uploading multiple files, and storing the results, errors, and loading states in redux.

#### createActionSet

This function simply creates an object with some keys that will be used internally to allow the action and reducer to communicate.

```ts
const UPLOAD_PROFILE_PHOTO = createActionSet('UPLOAD_PROFILE_PHOTO');
```

#### createFileUploadAction

This creates a [redux-thunk](https://github.com/reduxjs/redux-thunk) action that handles dispatching requests, and actions that track the loading states of the files, as well as the responses / errors.

```ts
const uploadProfilePhoto = createFileUploadAction(UPLOAD_PROFILE_PHOTO);
```

`createFileUploadAction` takes an action set, and an optional options object, and returns a `Promise<UploadData>` (see [Types](#types)).

Actions created with this function will not throw errors by default. This means that calling `.catch` on the returned promise will not be effective unless you utilize the following option...

Currently the options object only exists to allow you to provide a `shouldRethrow` function, which is called with any errors, and will cause the action to rethrow any errors if `true` is returned from `shouldRethrow`.

Once you've created your action you can then dispatch this from your store, or connected component e.g.

```ts
class MyComponent extends PureComponent<Props> {
  // ...
  private onSubmit = (data: FormData) => {
    this.props.uploadProfilePhoto([data.picture]);
  }
  // ...
}

export default connect(undefined, { uploadProfilePhoto })(MyComponent);
```

This takes an array of files. If you only have a single file to upload just provide an array containing that file.

You should prevent the user from attempting to upload the same set of, or additional files while the requests are in progress (as this will cause issues with the loading states). You can check the current loading state from the [reducer](#createFileUploadReducer), and disable your submit button.

#### createFileUploadReducer

This function is used to create a reducer for a specific set of file uploads.

DO NOT use the same reducer for uploading multiple sets of files unless you really know what you are doing.

```ts
const profilePhotoUpload = createFileUploadReducer(UPLOAD_PROFILE_PHOTO);
```

This can then be added to your store, and connected to React components to provide you with the `UploadState` (see [Types](#types)).

### Basic usage

The function `uploadFileToS3` is used internally by the other functions that integrate with redux. If you're not using redux, you can use this to upload individual files, and manually store the loading state, responses, and errors.

`uploadFileToS3` returns a `Promise` of type `Promise<UploadData>` (see [Types](#types)).

Let's say we have a form which contains a `file`, which we want to upload to S3 on submit, we can do the following:

```ts
import { UploadData, uploadFileToS3 } from '@dabapps/django-s3-file-upload';

interface FormData {
  file: File
}

const handleSubmit = (formData: FormData): Promise<UploadData> => {
  uploadFileToS3(formData.file)
};
```

The file should now be stored in `S3`, but isn't linked to any useful models (apart from `UploadedFile`) on the backend yet.

Say we have a `Llama` model on the backend and an action implemented on the frontend to `updateLlamaProfile`. We'll probably want to update the Llama profile with the new `file` after it's been stored in `S3`.

We can do this by chaining our functions:

```ts
import { UploadData, uploadFileToS3 } from '@dabapps/django-s3-file-upload';

import { updateLlamaProfile, displayError } from './path';

interface FormData {
  file: File
}

const handleSubmit = (formData: FormData) => {
  uploadFileToS3(formData.file)
    .then(({id}) => {
      updateLlamaProfile({
        llama_file: id
      })
    })
    .catch((error) => {
      displayError(error);
    });
};
```

### Types

The response type for each file upload:

```ts
interface UploadData {
  id: string;
  created: string;
  modified: string;
  complete_url: string;
  file: string;
  file_key: string;
  file_path: string;
  filename: string;
  upload_form: UploadForm;
}
```

Reducer state:

```ts
interface UploadState {
  loading: boolean;
  fileCount: number; // Total number of files to be uploaded
  inFlightCount: number; // Number of files being uploaded (but have not finished)
  completeCount: number;
  successCount: number;
  failureCount: number;
  data: undefined | ReadonlyArray<UploadData>;
  error: undefined | ReadonlyArray<unknown>;
}
```

## Code of conduct

For guidelines regarding the code of conduct when contributing to this repository please review [https://www.dabapps.com/open-source/code-of-conduct/](https://www.dabapps.com/open-source/code-of-conduct/)


text:
# Arduino library for IO structure

This library gathers utilities to manage the different buses.

## The supported buses

 * [ ] CAN [specs](https://en.wikipedia.org/wiki/CAN_bus)
 * [x] I2C [specs](https://en.wikipedia.org/wiki/I%C2%B2C)
   * [x] Sensor device
   * [ ] Other device
 * [ ] SPI [specs](https://en.wikipedia.org/wiki/Serial_Peripheral_Interface)
 * [ ] UART [specs](https://en.wikipedia.org/wiki/Universal_asynchronous_receiver-transmitter)

## The I2C utilities

### SensorDevice

The SensorDevice class designs a templated abstract class. The template arguments setup the device
address and data type.

Example:
```c++
#include <i2c_utils.h>

class mySensor: public i2c::SensorDevice<0b00110110, float> {
	// ...
};
```
Setup a sensor with the i2c address set as `00110110` and its data of float type.

repository: Silmaen/ArduinoLibraries

repo_name: Silmaen/ArduinoLibraries


text:
---
title: How to estimate data requirements
tags: ["estimation"]
biblio:
  -
    title: "Episode 06: Into to Architecture and Systems Design Interviews"
    link: "https://www.youtube.com/watch?v=ZgdS0EUmn70"
  -
    title: "Grokking the System Design Interview"
    link: "https://www.educative.io/collection/5668639101419520/5649050225344512"
  -
    title: "Storage Pod 6.0: Building a 60 Drive 480TB Storage Server"
    link: "https://www.backblaze.com/blog/open-source-data-storage-server/"
  -
    title: "Does Google Photos Compress The Life Out Of Your Pics? Here's What Our Experiment Revealed"
    link: "https://www.huffingtonpost.in/arpit-verma/bursting-the-myth-of-comp_b_8902076.html"
  -
    title: "Test: Megabit/Gigabit Upgrade for a Download Server"
    link: "https://www.paessler.com/tools/webstress/sample_performance_tests/megabit_gigabit_upgrade_for_a_download_server"
---

Lately, this has become a common interview question: How many Bytes will some hypothetical app probably need? When in fact, planning the data storage capacity is usually a complicated and time-consuming operation. So how do you present your case in 45 minutes?

From where I stand, I see too many too loosely defined variables to see any real point in answering such questions, but being the interviewee, we usually decide to play along.

So, even if the result can have no real-world value, let's say that we absolutely must come up with a plausible number, a ballpark figure. How would we go about doing it?

## Let's talk over coffee

For starters, we need to take the scariness out of this interview question.

Since it is far more pleasant to discuss ideas with friends over coffee, than with bosses across the table, a good approach is to see the interviewer as if they were a colleague of yours, they don't know the answer, you don't know the answer, but let's see what numbers we can come up with together.

## Types of estimates

There are at least the following types of estimates:
- **traffic, throughput, bandwidth estimates**
  How much traffic do you expect? Traffic is usually measured per month or per day. While bandwidth is measured per second and roughly describes the peak amount of traffic you will have to serve per second.
- **storage estimates**
  How much DB space do you expect to take up? Will 1 DB server be enough? How much other disk space do you expect to need?
- **memory estimates**

## Scenario

You are building an app for photo sharing. You have about 500M active users per month. How much hardware space do you need?

---

First of all, let's figure out what will we store?

Our users will upload pictures and they will download pictures.

![Uploads-and-downloads](/assets/estimates-upload-download.jpg)

Let's first focus on the upload. We will derive the download numbers once we understand the upload numbers.

### Storage estimations for uploaded files

How much disk space do we need to store all uploaded pictures? Which variables are we interested in? Let's limit our discussion to average values.

For every day we want to know
- the average number of images uploaded per user
- the average size of an image
- the number of users per day

And how many days will we store the images? Probably a few years.

To sum it up:

$$
space\_needed = users * img\_per\_day * img\_size * days\_to\_store
$$

**Hint #1:** Start with variables. Turn them into concrete numbers later.
{:.box}

Now it is time to make up some numbers :bowtie:

We were presented with the 500 M active users per month. Some of them will be very active every day, others might upload a few pictures in a whole year.

Here you can start asking questions about when will the users use your app, how will they use it, how will they interact with it, how will they expect it to behave. Let's say that users will usually upload only a few times a year, after holidays and celebrations. In this case, they might upload 1000 pictures in 1 day or maybe just 100, but then not upload anything for the next 2 months. There might be a few, who will upload a picture every day, but these will probably not be many....
{:.small}

Let's just say that on average each user uploads 3 images a day, every day. The average size of these images shall be 1 MB. We will definitely start thinking about an image compressor. And let's limit the storage time to 1 month.

To sum up:

$$
images_{per\_day} = 500 e^6 users * 3 \frac{images}{user*day}\\
= 1 500\ milion\ \frac{images}{day} \\= 1.5\ bilion\ \frac{images}{day}
$$

**Hint #2:** Use units with numbers, this way you will be more certain what the result represents.
{:.box}

Ok, so about $$1.5\ bilion$$ images a day. Considering the average image size of 1 MB, after 1 month, this would amount to:

$$
  space\_needed = 1.5e9\ \frac{images}{day} * 1 \frac{MB}{image} * 31\ days\\
  = 46\ e3\ TB \\
  = 46\ PB
$$

So we are at $$46 000 TB$$. But we haven't yet talked about backup storage. :joy:

Storage costs per GB are very low, we are talking about a few US$-cents, maybe $$\$0.05$$ per GB. Which still amounts to only a few thousand US$ for all of the 46 PB.

Still, we might be interested to research some kind of image compression techniques. From our users' perspectives, it would make sense to increase the storage time to a few years at least.

But let's move on to traffic estimations. The numbers we got are good enough for our purposes.

### Traffic estimations

**Hint #3:** Build upon established numbers.
{:.box}

When thinking about expected traffic, you could be asking yourself are:

> OK, we have 500M users per month, how many are this per day? Of course, it is not 500M / 30 days. How are these users geographically spaced? Are they all over the world are they all on the same continent? When do they use the app? Are they all using it at the same time, at 5:30 PM when they come from work?...
{:.font-italic}

But since we already went through the trouble of figuring out the $$1.5\ bilion$$ image uploads per day. This is the number we should lean on.

For simplicity, let's say these uploads will be perfectly distributed over the whole day. This gives us:

$$
  uploads = 1.5e9 \frac{images}{day} / (24h * 60m * 60s) \\
  \cong 17000 \frac {images}{s}
$$

$$17K$$ images are uploaded every second, but each of these images is also viewed $$v$$ times. This is a photo-*sharing* app, so for every upload, there is going to be $$v$$ viewings. Let's say that on average every image gets viewed 10 times. This means $$170 000$$ requests per second:

$$
 requests = 17000 \frac{images}{s} * 10 \frac{req}{image} = 170\ K \frac{req}{s} \\

  170 K \frac{req}{s} * 1\frac{MB}{req} = 170 \frac{GB}{s}
$$

This means that our servers need to serve $$170 GB/s$$.

Servers are limited by 2 things: the number of concurrent connections and the bandwidth.

What is a reasonable number of concurrent connections for a server? I have no idea. This depends at least on the server's spec and the kind of processing we will be doing for each request. The only way to answer this would be to look at the statistics of some actual servers, of which there seem to be very few on the internet.

How are we supposed to continue with no data from here on? I don't know. Can I server deliver 1 GB of data per second (that is 8 000 000 kbit/s), I don't know. Maybe it is closer to 0.1 GB/s, maybe it is 0.01 GB/s.

Everything up to here was pure speculation, but everything from here on would be just imagination. I presume there are some specialists somewhere, who deal with these numbers all the time. Better ask them :grin:

## Exhausted...

As you can see, we still came up with some compelling numbers. We are most definitely wrong because the world has a special way of being whimsical, but we did persevere. We did not give up and we did not get scared ad we will easily be persuaded that we are wrong. But doesn't every success story incorporate at least a bit of faking along the way?

gha_language: SCSS


text:
---
id: babel-helper-validator-identifier
title: "@babel/helper-validator-identifier"
sidebar_label: helper-validator-identifier
---

`@babel/helper-validator-identifier` is a utility package for parsing JavaScript keywords and identifiers. It provides several helper functions for identifying valid identifier names and detecting reserved words and keywords.

## Installation

```shell npm2yarn
npm install @babel/helper-validator-identifier
```

## Usage

To use the package in your code, import the required functions from `@babel/helper-validator-identifier`:

```js title="my-babel-plugin.js"
import {
  isIdentifierName,
  isIdentifierStart,
  isIdentifierChar,
  isReservedWord,
  isStrictBindOnlyReservedWord,
  isStrictBindReservedWord,
  isStrictReservedWord,
  isKeyword,
} from "@babel/helper-validator-identifier";
```

### `isIdentifierName`
```typescript
function isIdentifierName(name: string): boolean
```

The `isIdentifierName` function checks whether a given string can be a valid [identifier name](https://tc39.es/ecma262/#prod-IdentifierName). Note that it doesn't handle unicode escape sequences. For example, `isIdentifierName("\\u0061")` returns `false` while `\u0061` could be an JavaScript identifier name (`a`).

### `isIdentifierStart`
```typescript
function isIdentifierStart(codepoint: number): boolean
```

The `isIdentifierStart` function checks whether a given Unicode code point can start an identifier, as defined by the [IdentifierStartChar](https://tc39.es/ecma262/#prod-IdentifierStartChar).

### `isIdentifierChar`
```typescript
function isIdentifierChar(codepoint: number): boolean
```

The `isIdentifierChar` function checks whether a given Unicode code point can be part of an identifier, as defined by the [IdentifierPartChar](https://tc39.es/ecma262/#prod-IdentifierPartChar).

### Keywords and Reserved words helpers

These helpers detect [keyword and reserved words](https://tc39.es/ecma262/#sec-keywords-and-reserved-words). For more information, see the [implementation](https://github.com/babel/babel/blob/main/packages/babel-helper-validator-identifier/src/keyword.ts).

```typescript
function isReservedWord(word: string, inModule: boolean): boolean
function isStrictReservedWord(word: string, inModule: boolean): boolean
function isStrictBindOnlyReservedWord(word: string): boolean
function isStrictBindReservedWord(word: string, inModule: boolean): boolean
function isKeyword(word: string): boolean
```

repository: babel/website

repo_name: babel/website