text:
# sfdc-git-package

Create Package.xml and destructiveChangesPre.xml from git diff between two commits

## Getting Started

Works in Unix like system.
Windows is not tested.

### Prerequisites

Git command line is required on the system where the command line is running.

### Installing

```
npm install -g sfdc-git-package
```

or

```
yarn globally add sfdc-git-package
```

## Usage

### Command Line

```
$ sgp -h

  Usage: sgp [options]

  Create Package.xml and destructiveChangesPre.xml from git

  Options:

    -h, --help                   output usage information
    -V, --version                output the version number
    -t, --to [sha]               commit sha to where the diff is done [HEAD]
    -f, --from [sha]             commit sha from where the diff is done [git rev-list --max-parents=0 HEAD]
    -o, --output [dir]           package.xml specific output [./output]
    -a, --api-version [version]  salesforce API version [37.0]
    -r, --repo [dir]             git repository location [./repo]
```

### Module

```
  var sgp = require('sfdc-git-package');

  sgp({
    'to':'', // commit sha to where the diff is done. Default : HEAD
    'from':'', // commit sha from where the diff is done. Default : git rev-list --max-parents=0 HEAD
    'output':'', // package.xml & destructiveChangesPre.xml specific output. Default : ./output
    'apiVersion':'', // salesforce API version. Default : 39.0
    'repo':'' // git repository location. Default : ./repo
  }, console.log);
```

## Built With

* [commander](https://github.com/tj/commander.js/) - The complete solution for node.js command-line interfaces, inspired by Ruby's commander.
* [nodegit-kit](https://github.com/thisconnect/nodegit-kit) - Complementary NodeGit helpers returning native Promises, helps with git commands such as init, add, commit, status, diff.
* [xmlbuilder](https://github.com/oozcitak/xmlbuilder-js) - An XML builder for node.js similar to java-xmlbuilder.

## Versioning

[SemVer](http://semver.org/) is used for versioning.

## Authors

* **Sebastien Colladon** - *Initial work* - [scolladon](https://github.com/scolladon)

## License

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

repository: jjulicher/sfdc-git-package

repo_name: jjulicher/sfdc-git-package


text:
---
name: Bug report
about: Create a report to help us improve

---

**Describe the bug**

A clear and concise description of what the bug is.

**To Reproduce**
 - Related C++ source code.
 - How you load the function into Wolfram Language.

**Expected behavior**

A clear and concise description of what you expected to happen.

**Environment:**
 - OS: [*e.g.* Ubuntu 18.04]
 - Compiler: [*e.g.* GCC 7]
 - *Mathematica* Version: [*e.g.* 11.0]

**Additional context**

Add any other context about the problem here.

license: MIT

repository: njpipeorgan/wll-interface

branch_name: refs/heads/master

extension: md

gha_license_id: MIT

license_type: permissive

repo_name: njpipeorgan/wll-interface


text:
# Installation
> `npm install --save @types/charm`

# Summary
This package contains type definitions for Charm (https://github.com/substack/node-charm/).

# Details
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/charm

Additional Details
 * Last updated: Mon, 21 Aug 2017 21:49:18 GMT
 * Dependencies: node
 * Global values: none

# Credits
These definitions were written by Jad Sarout <https://github.com/Xananax>.

gha_language: CSS


text:
# Introduction
Simple daily standup timer to help team members in the standup meeting to stay focused and keep the meeting time-boxed to max. 15 minutes.

Each team member starts the timer, has 1 minute to answer the questions and finishes by stopping the timer.
* What did you do yesterday?
* What will you do today?
* Are there any impediments in your way?

If the countdown from 1 minute reaches 0, a stopwatch will count the overtime.

# Getting Started
1.	Installation process
2.	Software dependencies
3.	Latest releases
4.	API references

# Build and Test
Open solution in Visual Studio, build project and run tests.

# Contribute
Read LICENSE.


text:
## Description
An application that generates a random password based on user-selected criteria. This app runs in the browser and features dynamically updated HTML and CSS powered by JavaScript code. It also features a clean and polished user interface and is responsive, ensuring that it adapts to multiple screen sizes.

Check out the deployable site here: [Password Generator](https://jaredp17.github.io/PasswordGenerator/).

## Usage
1. Clone the repo or open deployable site.
    * Open index.html in default browser (if cloned).
2. Click _Generate Password_ and follow the prompts.

## Preview
The following images demonstrate the application functionality:
![Standalone](./Assets/passwd_demo.png)

Prompts following button press of _Generate Password_:
#
![Character Length](./Assets/prompt_char_length.png)
#
![Character Length](./Assets/prompt_lowercase.png)
#
![Character Length](./Assets/prompt_uppercase.png)
#
![Character Length](./Assets/prompt_numbers.png)
#
![Character Length](./Assets/prompt_special_chars.png)
#

Sample output (8 and 128 lengths) with all characters included:
![8 Character Password](./Assets/passwd_demo_8.png)
![128 Character Password](./Assets/passwd_demo_128.png)

## Credits
This site was designed by the Georgia Tech curriculum team. I wrote the javascript code to generate the password based on their criteria.

## Contributing
I am the sole contributor to this project.

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

Copyright (c) 2020 Jared Porter

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.

 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.

gha_language: JavaScript


text:
# snaf: Stock news aggregator feed

My entry for the 2013 NYC FinTech Hackathon

Aggregates news about stock symbols from several APIs.

Built using Flask and AngularJS based on https://github.com/rxl/angular-flask

repository: billpull/snaf

repo_name: billpull/snaf


text:
# Azure Blob Storage

The Azure Blob Storage handles uploaded media by storing the uploaded files in an Azure Storage Service. If you're hosting your web application in Azure this has several benefits.

* Dedicated storage is much **cheaper** than App Service storage.
* Traffic from dedicated storage is much **cheaper** the App Service bandwidth.
* Media files are **distributed** and is not stored together with the web application.
* It's very easy to connect Azure **CDN** to Blob Storage.

As the media files are stored in a central location this works well when the different components of the application (such as client and manager) are deployed to different locations.

## Installation

The Local File Storage can be installed by adding the NuGet package:

~~~ csharp
PM> install-package Piranha.Azure.BlobStorage
~~~

## Registering The Service
You register Local File Storage with the default configuration in `ConfigureServices()` with the following code:

~~~ csharp
services.AddPiranhaBlobStorage(credentials);
~~~

### Manual configuration

The storage credentials can be created manually by providing the storage service **name** and **key**.

~~~ csharp
var credentials = new StorageCredentials(storageName, storageKey);
~~~

### Using appsettings.json

You can easily configure your credentials from your `appsettings.json` by adding a section like this:

~~~ json
{
    "Storage": {
        "Name": "MyStorageName",
        "Key": "MyStorageKey"
    }
}
~~~

Given that you've setup your app configuration you can then access it like this from your `ConfigureServices`.

~~~ csharp
public class Startup
{
    public IConfiguration Configuration { get; private set; }

    public Startup(IConfiguration configuration)
    {
        Configuration = configuration;
    }

    public void ConfigureServices(IServiceCollection services)
    {
        ...

        services.AddPiranhaBlobStorage(new StorageCredentials(
            Configuration["Storage:Name"],
            Configuration["Storage:Key"]
        ));

        ...
    }
}
~~~

## Additional Configuration

When registering the service you have access to some configuration options to customize the storage to your needs.

##### Container Name

~~~ csharp
services.AddPiranhaBlobStorage(credentials, containerName: "dev");
~~~

The container name in the Storage Service where uploaded media assets will be stored.

##### Scope

~~~ csharp
services.AddPiranhaBlobStorage(credentials, scope: ServiceLifetime.Scoped);
~~~

By default the service is registered as a `Singleton`, but in some cases you might want to handle it differently in your application.

url: https://raw.githubusercontent.com/jensbrak/piranha.core.docs/4de0aab4e010dccd0d3e38b90df2f2a4ca279db9/src/04. Architecture/07. Media Storage/02. Azure Blob Storage.md

filename: 02. Azure Blob Storage.md


text:
---
layout: post
title: The Wolf Report - November 27th, 2017
---

- [Agreement? Never! Not a Problem. - for { comprehension }](https://forcomprehension.com/2017/11/26/agreement-never-not-a-problem/)
- [John Papa: Vue.js with TypeScript](https://johnpapa.net/vue-typescript/)
- [Writing smarter cross-platform .NET Core apps with the API Analyzer and Windows Compatibility Pack - Scott Hanselman](https://www.hanselman.com/blog/WritingSmarterCrossplatformNETCoreAppsWithTheAPIAnalyzerAndWindowsCompatibilityPack.aspx)
- [Namespacing Actions for Redux – Kickstarter Engineering](https://kickstarter.engineering/namespacing-actions-for-redux-d9b55a88b1b1)
- [Notice of Data Breach - The Imgur Blog](https://blog.imgur.com/2017/11/24/notice-of-data-breach/)
- [Sinnlose Geschichten aus Lucas' Mikrokosmos — The Girl with the Brick Earring](http://lucaswoltmann.de/art%27n%27images/2017/04/08/the-girl-with-the-brick-earring.html)
- [Utilizing Save-Data client hint in ASP.NET Core MVC](https://www.tpeczek.com/2017/11/utilizing-save-data-client-hint-in.html)
- [Leadership development for technical professionals - Shaw Innes](https://shawinnes.com/leadership-development-technical-professionals/)
- [Binary strings…and -1](https://remysharp.com/2017/11/24/binary-strings)


text:
---
layout: post
title: "No Comment"
date: 2013-03-30 14:36
comments: true
categories:
- Programming
---
I was always taught in school to liberally apply comments to my code. For a long time, I
considering this practice a good one. I no longer do, however.

Before you write me off as a lame-o programmer, to illustrate why I feel this way, let's walkthrough
some examples using an old favourite algorithm: merge sort. For the sake of this exercise, though, let's assume
that merge sort is not a widely known algorithm, so we don't fall into the *it's merge sort, duh!*
trap.

~~~ python
def mergesort(a):
	if len(a) <= 1:
		return a
	m = len(a) / 2
	l = a[:m]
	r = a[m:]
	return merge(mergesort(l), mergesort(r))

def merge(l, r):
	li = 0
	ri = 0
	m = []
	while li < len(l) and ri < len(r):
		if l[li] < r[ri]:
			m.append(l[li])
			li += 1
		else:
			m.append(r[ri])
			ri += 1
	if li < len(l):
		m.extend(l[li:])
	else:
		m.extend(r[ri:])
	return m
~~~

Here we have a completely correct sorting algorithm coded in one of my favourite languages, [Python](http://www.python.org/).
In my opinion, though, correct code is not quite good enough. This code could be improved in some ways.
Let's assume that liberally adding comments is one of these ways.

~~~ python
def mergesort(a):
	"""Returns a sorted list.
	"""
	# Base case for recursive algorithm is when
	# there is 1 or less elements. In either case, we call
	# the list sorted.
	if len(a) <= 1:
		return a
	# Find the middle of the list
	m = len(a) / 2
	# Split the list into halves
	l = a[:m]
	r = a[m:]
	# Merge the two sorted halves
	return merge(mergesort(l), mergesort(r))

def merge(l, r):
	"""Returns a merged sorted list.
	"""
	# Track the positions of the lists starting at index 0
	li = 0
	ri = 0
	# Initialize an empty list to store the final sorted list
	m = []
	# Loop while both halves still have unprocessed elements
	while li < len(l) and ri < len(r):
		# When the left list element is less than the right
		# list element, we add it to the final sorted list
		# and increment the position for the left side. Otherwise
		# we do it for the right side
		if l[li] < r[ri]:
			m.append(l[li])
			li += 1
		else:
			m.append(r[ri])
			ri += 1
	# Since one list has been completely processed, we extend
	# the final sorted list with the sorted elements remaining in
	# the other list
	if li < len(l):
		m.extend(l[li:])
	else:
		m.extend(r[ri:])
	return m
~~~

My once *Intro to Algorithms* professor would really like this version. But, you, however, *shouldn't* like this.
Let me explain.

Since I'm assuming that merge sort is an unknown algorithm, in an effort to improve readability, I've
added *lots* of prologue comments. They basically reiterate *what the code is doing.* To me, these types of comments
add too much clutter and may over-complicate something that wasn't all that complicated to begin with (like in
this case). For a college professor receiving something like this from a student as an assignment, these comments
could be useful, as they could give insight into whether or not a student understands what the code is doing.
However, in a work setting, it should be a fair assumption that your colleagues can **read the code to figure out
what the code is doing**.

It could be argued, though, that without the prologue comments, the readability is suffering because the variable
names don't convey enough about the code. That's a valid point. So, let's try something different.

~~~ python
def mergesort(unsorted):
	"""Returns a sorted list.

	The passed list is recursively halved
	into sublists until each sublist has one or less elements. Then,
	the sublists are merged together such that their elements are in order.

	Worst case time complexity is O(n log n).
	Worst case space complexity is O(n).
	"""
	if len(unsorted) <= 1:
		return unsorted

	middle = len(unsorted) / 2
	left_half = unsorted[:middle]
	right_half = unsorted[middle:]

	return merge(mergesort(left_half), mergesort(right_half))

def merge(left, right):
	"""Returns a sorted list as a result of merging
	two sorted lists.
	"""
	left_index = right_index = 0
	merged = []

	while left_index < len(left) and right_index < len(right):
		if left[left_index] < right[right_index]:
			merged.append(left[left_index])
			left_index += 1
		else:
			merged.append(right[right_index])
			right_index += 1

	left_remaining = left_index < len(left)
	if left_remaining:
		merged.extend(left[left_index:])
	else:
		merged.extend(right[right_index:])

	return merged
~~~

This version follows the **no comment is the best comment** approach. The variable names
have been modified (and according to [Python style guidelines](http://www.python.org/dev/peps/pep-0008/))
to convey their purpose making the code self-documenting and rendering all the prologue comments unnecessary.
**The code itself effectively describes _what the code is doing_**.

The function headers have been improved such that callers can discover what the functions do without reading
a single line of code. This is especially important for public interfaces and let's us use tools like [pydoc](http://docs.python.org/2/library/pydoc.html) to easily share code documentation.

You may be wondering, *what's the big deal? Let's just refactor and keep the comments too so we can have the
best of both worlds!*
The problem is that adding unnecessary comments creates another set of things to maintain. It's even worse when
the code changes and the comments are orphaned. Suppose a colleague comes along and changes the code again based
on comments that incorrectly describe code that no longer exists. Now, things are really a mess. Then,
your colleague goes on vacation and a bug surfaces related to all these changes and you're stuck `git bisect`'ing
your way through it all to figure out where things went wrong! So, I'll state this again very explicity: liberal
code commenting is wasted effort; make your code more self-documenting because **no comment is the
best comment**.

repository: nloko/blog

extension: markdown

gha_language: HTML

repo_name: nloko/blog


text:
# Behavioral Cloning Project

[![Udacity - Self-Driving Car NanoDegree](https://s3.amazonaws.com/udacity-sdc/github/shield-carnd.svg)](http://www.udacity.com/drive)

Overview
---
In this project, we used what we've learned about deep neural networks and convolutional neural networks to clone driving behavior by train, validate and test a model using Keras. The model will output a steering angle to an autonomous vehicle.

With using a simulator we you can steer a car around a track for data collection. I used image data and steering angles to train a neural network and then use this model to drive the car autonomously around the track.

The Project
---
The goals / steps of this project are the following:
* Use the simulator to collect data of good driving behavior
* Design, train and validate a model that predicts a steering angle from image data
* Use the model to drive the vehicle autonomously around the first track in the simulator. The vehicle should remain on the road for an entire loop around the track.
* Summarize the results with a written report

### Dependencies
This lab requires:
- [Keras](https://keras.io/)
- [NumPy](http://www.numpy.org/)
- [Matplotlib](http://matplotlib.org/)

### Data
I used the data which was provided with the project. The simulator at a given time step  recordes three images taken from left, center, and right cameras. The following figure shows an examples :

Left| Center | Right
----|--------|-------
![left](./Images/left.jpg) | ![center](./Images/center.jpg) | ![right](./Images/right.jpg)

### Model Architecture and Training Strategy

#### 1. Normalization:
In Keras, lambda layers can be used to create arbitrary functions that operate on each image as it passes through the layer. So i used it to normalize the data.

#### 2. Cropping Images:
The top portion of the image captures trees and hills and sky and the bottom portion of the image captures the hood of the car. We have to crop the useless parts to get the useful informations.
Keras provides the Cropping2D layer for image cropping.

#### 3. Convolution Neural Network and Activation Function :
I built a convolution neural network with 5x5 filter sizes and RELU layers as a activation function to introduce nonlinearity.

#### 4. Attempts to reduce overfitting in the model
The model was trained and validated on different data sets to ensure that the model was not overfitting and I used the early stoping method to avoid overfitting.
The model was tested by running it through the simulator and ensuring that the vehicle could stay on the track.

#### 5. Model parameter tuning
The model used an adam optimizer, so the learning rate was not tuned manually.

#### 6. Solution Design Approach
Architecture is similar to the LeNet.
I split the images and steering angle data into a training and validation data set.

The final step was to run the simulator to see how well the car was driving around track one. The vehicle is able to drive autonomously around the track without leaving the road.

####  My final model architecture :

My final model consisted of the following layers:

| Layer         		|     Description	        					|
|:---------------------:|:---------------------------------------------:|
| Input         		| 160x320x3 RGB image   			    		|
| Lambda     	        | Normalization                                 |
| Cropping2D          	| 74 from top and 24 from bottom                |
| Convolution 5x5     	| 2x2 stride with 24 output filters             |
| RELU					| Activation Function							|
| Convolution 5x5     	| 2x2 stride with 36 output filters          	|
| RELU					| Activation Function							|
| Convolution 5x5     	| 2x2 stride with 48 output filters             |
| RELU					| Activation Function							|
| Convolution 3x3     	| 1x1 stride with 64 output filters            	|
| RELU					| Activation Function							|
| Convolution 3x3     	| 1x1 stride with 64 output filters            	|
| RELU					| Activation Function							|
| Flatten				|		            							|
| Dropout				| 0.5		            						|
| Fully connected		| output 100						 			|
| RELU     			    | Activation Function				  	    	|
| Fully connected		| output 50 		      		     			|
| RELU     				| Activation Function			  		    	|
| Fully connected		| output 10 		      		     			|
| RELU     				| Activation Function			  		    	|
| Fully connected		| output 1 		 	     		     			|

####  Architecture Summary:

Layer (type)                 Output Shape              Param #
=================================================================
lambda_1 (Lambda)            (None, 160, 320, 3)       0
_________________________________________________________________
cropping2d_1 (Cropping2D)    (None, 62, 320, 3)        0
_________________________________________________________________
conv2d_1 (Conv2D)            (None, 29, 158, 24)       1824
_________________________________________________________________
conv2d_2 (Conv2D)            (None, 13, 77, 36)        21636
_________________________________________________________________
conv2d_3 (Conv2D)            (None, 5, 37, 48)         43248
_________________________________________________________________
conv2d_4 (Conv2D)            (None, 3, 35, 64)         27712
_________________________________________________________________
conv2d_5 (Conv2D)            (None, 1, 33, 64)         36928
_________________________________________________________________
flatten_1 (Flatten)          (None, 2112)              0
_________________________________________________________________
dropout_1 (Dropout)          (None, 2112)              0
_________________________________________________________________
dense_1 (Dense)              (None, 100)               211300
_________________________________________________________________
activation_1 (Activation)    (None, 100)               0
_________________________________________________________________
dense_2 (Dense)              (None, 50)                5050
_________________________________________________________________
activation_2 (Activation)    (None, 50)                0
_________________________________________________________________
dense_3 (Dense)              (None, 10)                510
_________________________________________________________________
activation_3 (Activation)    (None, 10)                0
_________________________________________________________________
dense_4 (Dense)              (None, 1)                 11
=================================================================
Total params: 348,219
Trainable params: 348,219
Non-trainable params: 0

repository: ihelshal/Project-Behavioral-Cloning

repo_name: ihelshal/Project-Behavioral-Cloning


text:
Please use this form only to report code defects or bugs.

For any question, even questions directly pertaining to this code, post your question on the forums related to the board you are using.

Arduino: forum.arduino.cc
Teensy: forum.pjrc.com
ESP8266: www.esp8266.com
ESP32: www.esp32.com
Adafruit Feather/Metro/Trinket: forums.adafruit.com
Particle Photon: community.particle.io

If you are experiencing trouble but not certain of the cause, or need help using this code, ask on the appropriate forum.  This is not the place to ask for support or help, even directly related to this code.  Only use this form you are certain you have discovered a defect in this code!

Please verify the problem occurs when using the very latest version, using the newest version of Arduino and any other related software.

----------------------------- Remove above -----------------------------

### Description

Describe your problem.

### Steps To Reproduce Problem

Please give detailed instructions needed for anyone to attempt to reproduce the problem.

### Hardware & Software

Board
Shields / modules used
Arduino IDE version
Teensyduino version (if using Teensy)
Version info & package name (from Tools > Boards > Board Manager)
Operating system & version
Any other software or hardware?

### Arduino Sketch

```cpp
// Change the code below by your sketch (please try to give the smallest code which demonstrates the problem)
#include <Arduino.h>

// libraries: give links/details so anyone can compile your code for the same result

void setup() {
}

void loop() {
}
```

### Errors or Incorrect Output

If you see any errors or incorrect output, please show it here.  Please use copy & paste to give an exact copy of the message.  Details matter, so please show (not merely describe) the actual message or error exactly as it appears.

gha_language: C


text:
---
layout: single
title: Refer this if you need PySpark or SparkR code snippets!
author: Ashish Tele
excerpt: "We need to change the table formats from spark dataframes to pandas or R dataframe when we prefer SQL, Python, and R in the same notebook. I had to search online a lot these code snippets."
description: "We need to change the table formats from spark dataframes to pandas or R dataframe when we prefer SQL, Python, and R in the same notebook. I had to search online a lot these code snippets."
permalink:
comments: true
tags: ["Data Science","R","Data Scientist","India","USA","PySpark","Python"]
published: true
comments: true
author_profile: false
header:
  teaserlogo:
  teaser: /images/pyspark.png
  image: /images/pyspark.png
  caption: "courtesy: Cambridge Spark"
gallery:

  - image_path: ''
    url: ''
    title: ''
---
Hi All,

Lately, I started coding extensively on Databricks (Microsoft Azure) using PySpark and SparkR. The platform is versatile as we can use the language of our preference interchangeably. I prefer R (a personal favorite) over Python. I find data cleaning, data transformation (dplyr), and visualization very intuitive in R. PySpark syntax are also easy to grasp. I want to highlight some of my findings and a few of the great resources I came across.

```ruby
library(dplyr)
library(SparkR)

SparkR_frame <- sql("select * from
                     zip_codes")
R_dataframe <- collect(SparkR_frame)

```
The above code snippet is very simple to interpret, but when you run it, you would encounter an error which difficult to understand on databricks. **collect()** was masked by the **dplyr** package and couldn't convert to R data frame for me. Including package name before method/function would return the desired result.

```ruby
R_dataframe <- SparkR::collect(SparkR_frame)
```

I reached out to [Bryan Cafferky](https://www.linkedin.com/in/bryancafferky/) on LinkedIn asking for help after watching his ['Azure Databricks with R: Deep Dive'](https://www.youtube.com/watch?v=-vekHiJdQ1Y) video on Youtube. He provided an example to convert SQL spark dataframe to SparkR dataframe. Finally, the trial and error method resolved this simple conflict.

1.If you have a table in Azure Databricks database (library), you can directly query the table in a notebook by adding **%sql** at the top of the cell and executing the query.

```ruby
%sql

select * from database.table_name

# Ctrl + Enter: Shortcut to run
```

2.We can convert a SQL dataframe to a Spark dataframe using following command.

```ruby
Spark_df = spark.sql("select * from database.table") #OR
Spark_df = table("table")
```
3.Convert Spark dataframe to SQL dataframe using below command.

```ruby
Spark_df.createOrReplaceTempView("SQL_table") #OR
Spark_df.registerTempTable("SQL_table")
```

4.Convert Spark dataframe to Pandas dataframe:

```ruby
Pandas_df = Spark_df.select("*").toPandas()
```

5.Create a Spark dataframe from a Pandas dataframe:

```ruby
Spark_df = createDataFrame(Pandas_df)
```
These are the few most used conversions.

*New update: Jan 18,2021*

I came across a package named 'Koalas', a pandas API on Apache Spark. As per the documentation, **Koalas** package can immediately make you productive with Spark, with no learning curve, if you know pandas. I am a Databrick user. Koalas is pre-installed in Databricks 7.1 and above.

6.Create a Koalas datafram from pandas dataframe

```ruby
import databricks.koalas as ks
import pandas as pd

K_df = ks.from_pandas(p_df)
```

7.Create a Koalas dataframe from Spark dataframe.

```ruby
K_df = spark_df.to_koalas()
```

We do have an option of reading and writing CSV, Parquet, Spark IO.
Please visit the [github page](https://github.com/databricks/koalas) for more information.

* You can follow an exhaustive list of code snippets at towardsdatascience.com by [Rahul](https://towardsdatascience.com/the-most-complete-guide-to-pyspark-dataframes-2702c343b2e8). I found it very useful and handy while coding. You can take the printed copy of it and clip it at the desk station.
* An informative video by [Bryan Cafferky](https://www.youtube.com/watch?v=-vekHiJdQ1Y) on YouTube. Bryan was a great help to me.

Thank you!


text:
![](https://github.com/iSapozhnik/Haptico/raw/master/Assets/Haptico.png)

# Haptico
Haptico is easy to use iOS haptic feedback generator. Besides default haptic feedbacks it can play patterns! Checkout Example project.

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

# Table of contents
* [Example](#example)
* [How to use](#how-to-use)
	1. [Generating predefined default feedbacks](#predefined-feedbacks)
	2. [Generating impact feedbacks](#impact-feedbacks)
	3. [Pattern play](#pattern-play)
	4. [UI Extensions](#ui-extensions)
* [Installation](#installation)
* [Mentions](#mentions)
* [Author](#license)

## Example

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

## How to use
First of all you will need to import Haptico module into your class:

```swift
import Haptico
```
Also keep in mind that depending on the device you are using - the feedback might be different. Starting from iPhone 7 all the iPhones are coming with haptic engine. Prior to iPhone 7 Haptico will use standard vibration. Also Pattern play and impacts are not supported on devices prior to iPhone 7 and iOS 10

### 1. Generating predefined default feedbacks.
With Haptico you can generate three default types of haptic notifications:

```swift
public enum HapticoNotification {
    case success
    case warning
    case error
}
```

Here is small example how can you generate Success, Warning and Error feedbacks:

```swift
@IBAction func generateSuccess(_ sender: Any) {
    Haptico.shared().generate(.success)
}
@IBAction func generateWarning(_ sender: Any) {
    Haptico.shared().generate(.warning)
}
@IBAction func generateError(_ sender: Any) {
    Haptico.shared().generate(.error)
}
```

### 2. Generating impact feedbacks
Besides default haptic notifications, Haptico can also generate impact notifications. The library supports three types of impact notifications **(available in iOS10+ and staring from iPhone 7)**:

```swift
public enum HapticoImpact {
    case light
    case medium
    case heavy
}
```

And to use them call:

```
Haptico.shared().generate(.medium)
```
Easy, huh?

### 3. Pattern play
And now something special - **Pattern Play**. Haptico can play patterns, "coded" as String. Let's take a look at small example:

```swift
Haptico.shared().generateFeedbackFromPattern("..oO-Oo..", delay: 0.1)
```
Each character in this string represents some specific haptic impact:

* "O" (capital "o") - heavy impact
* "o" - medium impact
* "." - light impact
* "-" - delay which has duration of 0.1 second

### 4. UI extensions
Haptico comes with a couple of UI Extensions: HapticoButton (which is subclass of UIButton) and UIAlertController extension with haptic feedback.

In order to start using HapticoButton - just set the class name in your Storyboard to HapticoButton. Then with UIControlEvents.touchDown event you will get heavy impact feedback and with UIControlEvents.touchUpInside and UIControlEvents.touchUpOutside you will get light impact feedback.

To use Haptico together with UIAlertController follow this simple example:

```swift
func showSuccessAlert() {
    let alert = UIAlertController(title: "Alert Title", message: "Alert Message", preferredStyle: .alert)
    alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: nil))
    present(alert, animated: true, hapticNotification: .success)
}
```

## Installation

Haptico is available through [CocoaPods](#cocoapods), [Carthage](#carthage) and [Swift Package Manager](#swift-package-manager).

### Cocoapods
To install it using [CocoaPods](https://cocoapods.org), simply add the following line to your Podfile:

```ruby
pod 'Haptico'
```

### Carthage
To install it via [Carthage](https://github.com/Carthage/Carthage), add the following line to your Cartfile and follow the instructions to [adding frameworks to an application](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application):

```
github "iSapozhnik/Haptico"
```

### Swift Package Manager
To install it using the [Swift Package Manager](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app), either directly add it to your project using Xcode 11, or specify it as dependency in the Package.swift file:

```swift
// ...
dependencies: [
    .package(url: "https://github.com/iSapozhnik/Haptico.git", from: "1.1.0"),
],
//...
```

## Mentions
- [Medium](https://medium.com/better-programming/5-ios-libraries-that-will-inspire-your-creativity-26ee5837f9b7)

## Author

isapozhnik<EMAIL_ADDRESS>
## Donation
If you like this project and it helps you to reduce time to develop, you can give me a cup of ☕ 😉

[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](http://paypal.me/isapozhnik)

## License

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

repository: im-jersh/Haptico

repo_name: im-jersh/Haptico


text:
# CI

- terraform fmt, validate
- shellcheck
- yamllint
- [checkov](https://github.com/bridgecrewio/checkov)
- symlink shared modules (i.e. mayastor deploy) - or rather use one top-level terraform and select cloud using variables? (as windows users will have problems with symlinks)

# mayastor

- install mayastor client for people to play with

# terraform

- split pure cluster install, mayastor dependencies install (nvme-tcp, hugepages, volumes for mayastor,...?) and mayastor install itsef
    - make installation of modules configurable via variables
- add installation of test pod for people to immediately play with
- add ability to run test pod (fio benchmark) directly on backing device to have quick comparison
    [x] hcloud
- share modules between different cloud installs properly
    - publish to terraform registry?

branch_name: refs/heads/main


text:
---
lab:
    title: 'Lab: Monitoring services deployed to Azure'
    module: 'Module 5: Monitor, troubleshoot, and optimize Azure solutions '
---

# Lab: Monitoring services deployed to Azure
# Student lab manual

## Lab scenario

You have created an API for your next big startup venture that needs to get to market quickly. Even though you want to get to market quickly, you have witnessed other ventures fail when they don’t plan for growth and have too few resources or too many users. To plan for this, you have decided to take advantage of the scale-out features of Microsoft Azure App Service, the telemetry features of Application Insights, and the performance-testing features of Azure DevOps. In this project, you will deploy an API to the App Service by using API Apps, capture telemetry and metrics by using Application Insights, and implement a smart client that can handle network issues or other transient faults. You will then load test the API by using Azure DevOps.

## Objectives

After you complete this lab, you will be able to:

  - Create an Application Insights resource.

  - Integrate Application Insights telemetry tracking into an ASP.NET Core web application and an Azure API App resource.

  - Use .NET Foundation libraries to implement a retry policy over a service that could have transient faults.

  - Performance test an API app by using Azure DevOps.

## Lab setup

  - **Estimated time:** 75 minutes

## Instructions

### Before you start

#### Sign in to the lab virtual machine

  - Ensure that you are signed in to your **Windows 10** virtual machine by using the following credentials:

      - **Username**: Admin

      - **Password**: Pa55w.rd

#### Review installed applications

  - Observe the taskbar located at the bottom of your **Windows 10** desktop. The taskbar contains the icons for the applications that you will use in this lab:

      - Microsoft Edge

      - File Explorer

      - Visual Studio Code

      - Windows PowerShell

#### Download the lab files

1.  On the taskbar, select the **Windows PowerShell** icon.

1.  In the PowerShell command prompt, change the current working directory to the **Allfiles (F):\\** path:

    ```
    cd F:
    ```

1.  Within the command prompt, enter the following command and press Enter to Clone the **microsoftlearning/AZ-203-DevelopingSolutionsForAzure** project hosted on GitHub into the **Labfiles** directory:

    ```
    git clone --depth 1 --no-checkout https://github.com/microsoftlearning/AZ-203-DevelopingSolutionsForMicrosoftAzure .
    ```

1.  Within the command prompt, enter the following command and press **Enter** to check out the lab files necessary to complete the **AZ-201.02** lab:

    ```
    git checkout master -- Allfiles/*
    ```

1.  Close the currently running **Windows PowerShell** command prompt application.

### Exercise 1: Create and configure Azure resources

#### Task 1: Open the Azure portal

1.  On the taskbar, select the **Microsoft Edge** icon.

1.  In the open browser window, navigate to the [**Azure portal**](https://portal.azure.com) (portal.azure.com).

1.  At the sign-in page, enter the **email address** for your Microsoft account.

1.  Select **Next**.

1.  Enter the **password** for your Microsoft account.

1.  Select **Sign in**.

    > **Note**: If this is your first time signing in to the **Azure portal**, a dialog box will display offering a tour of the portal. Select **Get Started** to skip the tour and begin using the portal.

#### Task 2: Create an Application Insights resource

1.  Create a new **Application Insights account** with the following details:

      - **Name**: instrm\[your name in lowercase\]

      - **New** **resource** **group**: MonitoredAssets

      - **Location**: (US) East US

    > **Note**: Wait for Azure to finish creating the storage account before you move forward with the lab. You will receive a notification when the account is created.

1.  Access the **Properties** section of the **Application Insights** blade.

1.  Observe the value of the **Instrumentation Key** field. This key is used by client applications to connect to Application Insights.

#### Task 3: Create an API App resource

1.  Create a new **API app** with the following details:

    - **App name**: smpapi\[your name in lowercase\]

    - **Existing** **resource** **group**: MonitoredAssets

    - **New App Service plan**: MonitoredPlan (S1)

    - **Application Insights**: Enabled

    - **Existing Application Insights resource**: instrm\[your name in lowercase\]

    - **Application Insights instrumentation**: .NET Core (Recommended level)

    - **Profiler**: **On**.

    - **Snapshot debugger**: **On**.

    - **SQL Commands**: **On**.

    > **Note**: Wait for Azure to finish creating the API before you move forward with the lab. You will receive a notification when the app is created.

1.  Access the **smpapi\*** *API app* that you created earlier in this lab.

1.  In the **Settings** section on the left side of the blade, navigate to the **Configuration** section.

1.  Locate and access the **Application Settings** tab within the **Configuration** section.

1.  Observe the value corresponding to the **APPINSIGHTS\_INSTRUMENTATIONKEY** Application Settings key. This value was set automatically when you built your API App resource.

1.  Access the **Properties** section of the **App Service** blade.

1.  Record the value of the **URL** field. You will use this value later in the lab to make requests against the API.

#### Task 4: Configure API App auto-scale options

1.  Go to the **Scale out** section of the **App Services** blade.

1.  In the **Scale out** section, enable **autoscale** with the following details:

    1.  **Name**: ComputeScaler

    1.  **Scale mode** section, select **Scale based on a metric**

    1.  **Minimum** **instances**: 2

    1.  **Maximum** **instances**: 8

    1.  **Default** **instances**: 3

    1.  **Scale rules**: Single scale-out rule with default values

1.  **Save** your changes to the **autoscale** configuration.

#### Review

In this exercise, you created the resources that you will use for the remainder of the lab.

### Exercise 2: Build and deploy an .NET Core Web API application

#### Task 1: Build a .NET Core Web API project

1.  Open **Visual Studio Code**.

1.  In **Visual Studio Code**, open the **Allfiles (F):\\Allfiles\\Labs\\05\\Starter\\Api** folder.

1.  Use the **Explorer** to open a new terminal that has the context set to the current working directory.

1.  In the command prompt, create a new .NET Core Web API application named **SimpleApi** in the current directory:

    ```
    dotnet new webapi --output . --name SimpleApi
    ```

1.  Add the **2.7.1** version of the **Microsoft.ApplicationInsights.AspNetCore** package from NuGet to the current project:

    ```
    dotnet add package Microsoft.ApplicationInsights.AspNetCore --version 2.7.1
    ```

1.  Build the .NET Core web application:

    ```
    dotnet build
    ```

#### Task 2: Update application code to disable HTTPS and use Application Insights

1.  Use the **Explorer** in **Visual Studio Code** to open the **Program.cs** file in the editor.

1.  Locate the following block of code at line **20**:

    ```
    public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
        WebHost.CreateDefaultBuilder(args)
            .UseStartup<Startup>();
    ```

1.  Add an invocation of the **UseApplicationInsights** method to the **fluent** block to enable **Application Insights** telemetry for the project:

    ```
    public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
        WebHost.CreateDefaultBuilder(args)
            .UseStartup<Startup>()
            .UseApplicationInsights();
    ```

1.  Use the **Explorer** in **Visual Studio Code** to open the **Startup.cs** file in the editor.

1.  Locate and delete the following line of code at line **43**:

    ```
    app.UseHttpsRedirection();
    ```

    > **Note**: This line of code forces the API app to use HTTPS. For this lab, this is unnecessary.

1.  **Save** the **Program.cs** and **Startup.cs** files.

1.  Use the **Explorer** to open a new terminal, if it is not still already open, that context is set to the current working directory.

1.  Build the .NET Core web application:

    ```
    dotnet build
    ```

#### Task 3: Test an API application locally

1.  Use the **Explorer** to open a new terminal, if it is not still already open, that has the context set to the current working directory.

1.  Execute the .NET Core web application.

    ```
    dotnet run
    ```
1.  Open the **Microsoft Edge** browser.

1.  In the open browser window, navigate to the **/api/values** relative path of your test application hosted at **localhost** on port **5000**.

    **Note**: The full URL is <http://localhost:5000/api/values>.

1.  In the same browser window, navigate to the **/api/values/7** relative path of your test application hosted at **localhost** on port **5000**.

    **Note**: The full URL is <http://localhost:5000/api/values/7>

1.  Close the browser window that you recently opened.

1.  Close the currently running **Visual Studio Code** application.

#### Task 4: View metrics in Application Insights

1.  Return to your currently open browser window displaying the **Azure portal**.

1.  Access the **instrm\*** Application Insights account that you created earlier in this lab.

1.  In the **Application Insights** blade, observe the metrics displayed in the tiles located in the center of the blade. Specifically, observe the number of **server** **requests** that have occurred and the average **server response time**.

#### Task 5: Deploy an application to API app

1.  Open **Visual Studio Code**.

1.  In **Visual Studio Code**, open the **Allfiles (F):\\Allfiles\\Labs\\05\\Starter\\Api** folder.

1.  Use the **Explorer** to open a new terminal that has the context set to the current working directory.

1.  Sign in to the Azure CLI by using your Microsoft Azure credentials:

    ```
    az login
    ```

1.  List all the **apps** in your **MonitoredAssets** resource group:

    ```
    az webapp list --resource-group MonitoredAssets
    ```

1.  Find the **apps** that have the prefix **smpapi\***:

    ```
    az webapp list --resource-group MonitoredAssets --query "[?starts_with(name, 'smpapi')]"
    ```

1.  Print only the name of the single app that has the prefix **smpapi\***:

    ```
    az webapp list --resource-group MonitoredAssets --query "[?starts_with(name, 'smpapi')].{Name:name}" --output tsv
    ```

1.  Change the current directory to the **Allfiles (F):\\Allfiles\\Labs\\05\\Starter** directory that contains the lab files:

    ```
    cd F:\Labfiles\05\Starter\
    ```
1.  Deploy the **api.zip** file to the **API app** that you created earlier in this lab:

    ```
    az webapp deployment source config-zip --resource-group MonitoredAssets --src api.zip --name <name-of-your-api-app>
    ```

    > **Note**: Replace the **\<name-of-your-api-app\>** placeholder with the name of the API app that you created earlier in this lab. You recently queried this app’s name in the previous steps.

1. Access the **smpapi\*** API app that you created earlier in this lab.

1. Open the **smpapi\*** API app in your browser.

1. Perform a **GET** request to the **/api/values/** relative path of the website and observe the JSON array that is returned as a result of using the API.

    > **Note**: For example, if your URL is https://smpapistudent.azurewebsites.net, the new URL would be https://smpapistudent.azurewebsites.net/api/values.

#### Review

In this exercise, you created an API by using ASP.NET Core and configured it to stream application metrics to Application Insights. You then used the Application Insights dashboard to view performance details about your API.

### Exercise 3: Build a client application by using .NET Core

#### Task 1: Build a .NET Core console project

1.  Open **Visual Studio Code**.

1.  In **Visual Studio Code**, open the **Allfiles (F):\\Allfiles\\Labs\\05\\Starter\\Console** folder.

1.  Use the **Explorer** to open a new terminal that has the context set to the current working directory.

1.  In the command prompt, create a new .NET Core console application named **SimpleConsole** in the current directory:

    ```
    dotnet new console --output . --name SimpleConsole
    ```

1.  Add the **7.1.0** version of the **Polly** package from NuGet to the current project:

    ```
    dotnet add package Polly --version 7.1.0
    ```

1.  Build the .NET Core web application:

    ```
    dotnet build
    ```

#### Task 2: Add HTTP client code

1.  Use the **Explorer** in **Visual Studio Code** to open the **Program.cs** file in the editor.

1.  Add **using** blocks to the top of the file for the following namespaces:

      - **System.Net.Http**

      - **System.Threading.Tasks**

    ```
    using System.Net.Http;
    using System.Threading.Tasks;
    ```

1.  Locate the **Program** class at line **7**:

    ```
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
    ```

1.  Replace the entire **Program** class with the following implementation:

    ```
    class Program
    {
        private const string _api = "";
        private static HttpClient _client = new HttpClient(){ BaseAddress = new Uri(_api) };

        static void Main(string[] args)
        {
            Run().Wait();
        }

        static async Task Run()
        {

        }
    }
    ```

1.  Locate the **\_api** constant at line **9**:

    ```
    private const string _api = "";
    ```

1.  Update the **\_api** constant by setting the value of the variable to the **URL** of the API app that you recorded earlier in this lab:

> **Note**: For example, if your URL is http://smpapistudent.azurewebsites.net, the new line of code will be: private const string \_api = "http://smpapistudent.azurewebsites.net";

1.  Within the **Run** method, add the following two lines of code to asynchronously invoke the **HttpClient.GetStringAsync** method passing in a string for the relative path of **/api/values/**, and then write out the response:

    ```
    string response = await _client.GetStringAsync("/api/values/");
    Console.WriteLine(response);
    ```

1.  **Save** the **Program.cs** file.

#### Task 3: Test a console application locally

1.  Use the **Explorer** to open a new terminal, if it is not still already open, that has the context set to the current working directory.

1.  Execute the .NET Core web application.

    ```
    dotnet run
    ```

1.  Observe that the application successfully invokes the API app in Azure and returns the same JSON array that you observed earlier in this lab:

    ```
    ["value1","value2"]
    ```

1.  Return to your currently open browser window displaying the **Azure portal**.

1.  Access the **smpapi\*** API app that you created earlier in this lab.

1.  In the **App Service** blade, select **Stop** to halt the execution of the API app.

1.  Open **Visual Studio Code**.

1.  In **Visual Studio Code**, open the **Allfiles (F):\\Allfiles\\Labs\\05\\Starter\\Console** folder.

1.  Use the **Explorer** to open a new terminal that has the context set to the current working directory.

1. In the command prompt, execute the .NET Core web application.

    ```
    dotnet run
    ```

1. Observe that the application fails and displays a **HttpRequestException** message that is similar to the following exception message:

    ```
    System.Net.Http.HttpRequestException: Response status code does not indicate
    success: 403 (Site Disabled).
       at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
       at System.Net.Http.HttpClient.GetStringAsyncCore(Task`1 getTask)
       at SimpleConsole.Program.Run() in F:\Labfiles\05\Starter\Console\Program.cs:line 20
    ```

    > **Note**: This exception occurs because the API app is no longer available.

#### Task 4: Add retry logic by using Polly

1.  Use the **Explorer** in **Visual Studio Code** to open the **PollyHandler.cs** file in the editor.

1.  Within the **PollyHandler** class, observe lines **13-24**. These lines of code use the **Polly** library from the **.NET Foundation** to create a retry policy that will retry a failed HTTP request every five minutes.

1.  Use the **Explorer** in **Visual Studio Code** to open the **Program.cs** file in the editor.

1.  Locate the **\_client** constant at line **10**:

    ```
    private static HttpClient _client = new HttpClient(){ BaseAddress = new Uri(_api) };
    ```

1.  Update the **\_client** constant by updating the **HttpClient** constructor to use a new instance of the **PollyHandler** class:

    ```
    private static HttpClient _client = new HttpClient(new PollyHandler()){ BaseAddress = new Uri(_api) };
    ```

1.  **Save** the **Program.cs** file.

#### Task 5: Validate retry logic

1.  Use the **Explorer** to open a new terminal, if it is not still already open, that has the context set to the current working directory.

1.  Execute the .NET Core web application.

    ```
    dotnet run
    ```

1.  Observe that the HTTP request execution continues to fail and is being re-attempted every five seconds. Leave the application running. It will attempt to access the API app infinitely until it is successful.

1.  Return to your currently open browser window displaying the **Azure portal**.

1.  Access the **smpapi\*** API app that you created earlier in this lab.

1.  In the **App Service** blade, select **Start** to resume the API app.

1.  Return to the currently running **Visual Studio Code** application.

1.  Observe that the application finally successfully invokes the API app in Azure and returns the same JSON array that you observed earlier in this lab.

1.  Close the currently running **Visual Studio Code** application.

#### Review

In this exercise, you created a console application to access your API by using conditional retry logic. The application continued to work regardless of whether the API was available.

### Exercise 4: Load a test API app

#### Task 1: Run a performance test on an API app

1.  Return to your currently open browser window displaying the **Azure portal**.

1.  Access the **smpapi\*** API app that you created earlier in this lab.

1.  In the **App Service** blade, select the **Performance test** link.

1.  Create a new **Performance test** by using the following details:

      - **Name**: LoadTest

      - **Generate Load From**: East US (Web app Location)

      - **User Load**: 1000

      - **Duration**: 10

      - **Test Type**: Manual Test

      - **URL**: http://\<your-api-name\>.azurewebsites.net/api/values

1.  In the **LoadTest** blade, wait for the test to start and complete before proceeding with the lab. Observe the live chart updating as your API app experiences increased usage.

    > **Note**: Most load tests take about 10 to 15 minutes to gather the resources and start. You can wait at this blade because it will automatically refresh when the load testing is started. The load test will then take the 10 minutes that you specified in the previous steps of this lab.

#### Task 2: Use Azure Monitor metrics after the performance test

1.  Navigate to the **Azure Monitor** service.

1.  In the **Monitor** blade, select the **Metrics** link.

1.  In the **Metrics** section, create a new chart with the following details:

      - **Resource**: instrm\* Application Insights account created earlier in this lab

      - **Time range**: Last 30 minutes (Automatic)

      - **Chart type**: Area chart

1.  Create a new metric with the following details:

      - **Metric Namespace**: Standard metrics

      - **Metric**: Process CPU

      - **Aggregation**: Avg

1.  Create another new metric with the following details:

      - **Metric Namespace**: Log-based metrics

      - **Metric**: Server response time

      - **Aggregation**: Avg

1.  Observe the information displayed in your chart. You can observe how the server response time correlates with the CPU time as load on the application increased.

#### Review

In this exercise, you performed a performance (load) test of your API app by using the tools available to you in Azure. After you performed the load test, you were able to measure your API app’s behavior by using metrics in the Azure Monitor interface.

### Exercise 5: Clean up subscription

#### Task 1: Open Cloud Shell

1.  At the top of the Azure portal, select the **Cloud Shell** icon to open a new shell instance.

1.  At the bottom of the portal in the **Cloud Shell** command prompt, type the following command and press Enter to list all resource groups in the subscription:

    ```
    az group list
    ```

1.  Type the following command and press Enter to view a list of possible commands to delete a resource group:

    ```
    az group delete --help
    ```

#### Task 2: Delete resource groups

1.  Type the following command and press Enter to delete the **MonitoredAssets** resource group:

    ```
    az group delete --name MonitoredAssets --no-wait --yes
    ```

1.  Close the **Cloud Shell** pane at the bottom of the portal.

#### Task 3: Close active applications

1.  Close the currently running **Microsoft Edge** application.

1.  Close the currently running **Visual Studio Code** application.

#### Review

In this exercise, you cleaned up your subscription by removing the **resource groups** used in this lab.


text:
---
layout: post
title: Shape Up, When not to follow the book
image: /assets/20220328_header.jpg
description: Shape Up is a product development methodology popularized thanks to Ryan Singer, a Head of Product Strategy at Basecamp. I cover the topics not entirely covered in the book to make your implementation of Shape Up much easier.
article_language: en
---

> It is the 2nd article in the Shape Up series. For Table of Contents go to: [Shape Up, Introduction](https://rmakara.github.io/Shape-Up-Introduction)

## How do we learn and obtain mastery?

A widely shared example says that when you do not know how to cook and need to prepare spaghetti, you look for the recipe on the Internet and follow it.

After a few times, you start experimenting with other ingredients. You become better and better.

All frameworks like Scrum or Shape Up are such recipes. It is a set of basic knowledge, which most likely will make your team more performant than when working without any idea how to organize.

In applying all of these, you may fall into two extremes.

### Extreme of By-The-Book

You may blindly apply all of the rules from the guide without taking your company, teams, current state and constraints under consideration. If a single rule is not used, then there is a person to say _"It is not real <methodology/framework> because we do not do X"_.

Such an approach will not solve all the problems that you have. Of course, it may solve some of these but also will create new ones.

### Extreme of Skip-The-Book

On the other hand, you may find yourself over-confident or over-complaining. If you are in a group of people saying _"this is not going to work for our company"_ or _"I know better and this book is stupid"_ then it is worth finding some counterpart for your discussions. You might be burnt out, tired or biased.

Even if some methodology is stupid, you most likely may find a few learnings in it that you might apply in your context.

### Common Sense is the right way to go

Your experiences, past failures and successes, feelings, thinking abilities, and colleagues are your common sense. For successful and smooth implementation you need to:

* Imagine how you may work in X weeks/months/years. Call it a vision.
* Plan how you and your colleagues can go through this journey to get there. Call it a strategy.
* Find your way for experimentation to make it safe to fail.

Success lies in-between two extremes mentioned above. Usually, if you are less experienced, you should follow most of the rules. If you are more experienced, you need to balance your over-confidence and biases, but most likely, you will be able to find a much better path for your company than when blindly following a single guide.

## Apply your knowledge from the other areas

If you are getting into the new topic, that's quite natural to use your other skills and knowledge within' the new methods. That's totally fine to fill Shape Up's framework with other techniques that you find useful.

### Inspiration from Software Developers

A long time ago, there was a joke in the PHP community about Symfony Docs showing how to put all the business and persistence logic inside Controllers.

However, this is not how you use the programming language/framework after you get some experience. You use the documentation, but you do not apply 100% of the available statements to make your project work. You use your common sense to use only the parts of the language which will help you achieve the desired result. Experienced PHP engineers knew that.

Let's learn from them and not make management a 0-1 game.

### Inspiration from PMBOK book

In 2015, I spent five days to learn the theory on Scrum from scratch to pass my PSM  exam. I thought Agile rocks and Project Management does not.

Then a few years later, I took a training on PMBOK. Trainer said that PMBOK is not a strict set of rules that you need to follow. You use it as an encyclopedia. You face a specific challenge, you choose tools and then use the book to ensure that you do not forget something that has already been tested thousands of times in the world. Once you read it, it is up to you how you are going to use it.

Experiences from the Project Management Body of Knowledge might help you in the Shape Up journey.

## First steps with Shape Up

We went through the theory on - thinking about what we are doing. But where to start?

Basecamp recommends their set of [Basic truths for Shape You](https://basecamp.com/shapeup/4.1-appendix-02), and I think they got it right.

My recommendation for 6-20 people big teams would be to start by focusing on:
* Explicitly separating Shaping and Building.
* Setting the Appetite for the Shapes / Pitches.
* Using shorter Cycles than 6+2 for the first two or three Cycles. Like 3+1 or 4+1.
* Respecting the Cooldown.

Once you set this up, you may start filling its frames and improve iteration by iteration.

Do not apply 100% of the book on the very first day.

If you are in big organization, then you may start with 1 or 2 teams working this way.

In the next article, we will take a look at [Shaping vs Building](https://rmakara.github.io/Shape-Up-Shaping-vs-Building).

repository: rmakara/blog-jekyll

repo_name: rmakara/blog-jekyll


text:
# Server Sent Events

The [Server-Sent Events](https://html.spec.whatwg.org/multipage/comms.html#the-eventsource-interface) specification describes a built-in class `EventSource`, that keeps connection with the server and allows to receive events from it.

Similar to `WebSocket`, the connection is persistent.

But there are several important differences:

| `WebSocket`                                                  | `EventSource`                           |
| ------------------------------------------------------------ | --------------------------------------- |
| Bi-directional: both client and server can exchange messages | One-directional: only server sends data |
| Binary and text data                                         | Only text                               |
| WebSocket protocol                                           | Regular HTTP                            |

`EventSource` is a less-powerful way of communicating with the server than `WebSocket`.

Why should one ever use it?

The main reason: it's simpler. In many applications, the power of `WebSocket` is a little bit too much.

We need to receive a stream of data from server: maybe chat messages or market prices, or whatever. That's what `EventSource` is good at. Also it supports auto-reconnect, something we need to implement manually with `WebSocket`. Besides, it's a plain old HTTP, not a new protocol.

## Getting messages

To start receiving messages, we just need to create `new EventSource(url)`.

The browser will connect to `url` and keep the connection open, waiting for events.

The server should respond with status 200 and the header `Content-Type: text/event-stream`, then keep the connection and write messages into it in the special format, like this:

```
data: Message 1

data: Message 2

data: Message 3
data: of two lines
```

- A message text goes after `data:`, the space after the colon is optional.
- Messages are delimited with double line breaks `\n\n`.
- To send a line break `\n`, we can immediately send one more `data:` (3rd message above).

In practice, complex messages are usually sent JSON-encoded. Line-breaks are encoded as `\n` within them, so multiline `data:` messages are not necessary.

For instance:

```js
data: {"user":"John","message":"First line*!*\n*/!* Second line"}
```

...So we can assume that one `data:` holds exactly one message.

For each such message, the `message` event is generated:

```js
let eventSource = new EventSource("/events/subscribe");

eventSource.onmessage = function (event) {
  console.log("New message", event.data);
  // will log 3 times for the data stream above
};

// or eventSource.addEventListener('message', ...)
```

### Cross-origin requests

`EventSource` supports cross-origin requests, like `fetch` and any other networking methods. We can use any URL:

```js
let source = new EventSource("https://another-site.com/events");
```

The remote server will get the `Origin` header and must respond with `Access-Control-Allow-Origin` to proceed.

To pass credentials, we should set the additional option `withCredentials`, like this:

```js
let source = new EventSource("https://another-site.com/events", {
  withCredentials: true,
});
```

Please see the chapter <info:fetch-crossorigin> for more details about cross-origin headers.

## Reconnection

Upon creation, `new EventSource` connects to the server, and if the connection is broken -- reconnects.

That's very convenient, as we don't have to care about it.

There's a small delay between reconnections, a few seconds by default.

The server can set the recommended delay using `retry:` in response (in milliseconds):

```js
retry: 15000
data: Hello, I set the reconnection delay to 15 seconds
```

The `retry:` may come both together with some data, or as a standalone message.

The browser should wait that many milliseconds before reconnecting. Or longer, e.g. if the browser knows (from OS) that there's no network connection at the moment, it may wait until the connection appears, and then retry.

- If the server wants the browser to stop reconnecting, it should respond with HTTP status 204.
- If the browser wants to close the connection, it should call `eventSource.close()`:

```js
let eventSource = new EventSource(...);

eventSource.close();
```

Also, there will be no reconnection if the response has an incorrect `Content-Type` or its HTTP status differs from 301, 307, 200 and 204. In such cases the `"error"` event will be emitted, and the browser won't reconnect.

```smart
When a connection is finally closed, there's no way to "reopen" it. If we'd like to connect again, just create a new `EventSource`.
```

## Message id

When a connection breaks due to network problems, either side can't be sure which messages were received, and which weren't.

To correctly resume the connection, each message should have an `id` field, like this:

```
data: Message 1
id: 1

data: Message 2
id: 2

data: Message 3
data: of two lines
id: 3
```

When a message with `id:` is received, the browser:

- Sets the property `eventSource.lastEventId` to its value.
- Upon reconnection sends the header `Last-Event-ID` with that `id`, so that the server may re-send following messages.

```smart header="Put `id:`after`data:`" Please note: the `id`is appended below message`data`by the server, to ensure that`lastEventId` is updated after the message is received.

````

## Connection status: readyState

The `EventSource` object has `readyState` property, that has one of three values:

```js no-beautify
EventSource.CONNECTING = 0; // connecting or reconnecting
EventSource.OPEN = 1;       // connected
EventSource.CLOSED = 2;     // connection closed
````

When an object is created, or the connection is down, it's always `EventSource.CONNECTING` (equals `0`).

We can query this property to know the state of `EventSource`.

## Event types

By default `EventSource` object generates three events:

- `message` -- a message received, available as `event.data`.
- `open` -- the connection is open.
- `error` -- the connection could not be established, e.g. the server returned HTTP 500 status.

The server may specify another type of event with `event: ...` at the event start.

For example:

```
event: join
data: Bob

data: Hello

event: leave
data: Bob
```

To handle custom events, we must use `addEventListener`, not `onmessage`:

```js
eventSource.addEventListener("join", (event) => {
  alert(`Joined ${event.data}`);
});

eventSource.addEventListener("message", (event) => {
  alert(`Said: ${event.data}`);
});

eventSource.addEventListener("leave", (event) => {
  alert(`Left ${event.data}`);
});
```

## Full example

Here's the server that sends messages with `1`, `2`, `3`, then `bye` and breaks the connection.

Then the browser automatically reconnects.

[codetabs src="eventsource"]

## Summary

`EventSource` object automatically establishes a persistent connection and allows the server to send messages over it.

It offers:

- Automatic reconnect, with tunable `retry` timeout.
- Message ids to resume events, the last received identifier is sent in `Last-Event-ID` header upon reconnection.
- The current state is in the `readyState` property.

That makes `EventSource` a viable alternative to `WebSocket`, as the latter is more low-level and lacks such built-in features (though they can be implemented).

In many real-life applications, the power of `EventSource` is just enough.

Supported in all modern browsers (not IE).

The syntax is:

```js
let source = new EventSource(url, [credentials]);
```

The second argument has only one possible option: `{ withCredentials: true }`, it allows sending cross-origin credentials.

Overall cross-origin security is same as for `fetch` and other network methods.

### Properties of an `EventSource` object

`readyState`
: The current connection state: either `EventSource.CONNECTING (=0)`, `EventSource.OPEN (=1)` or `EventSource.CLOSED (=2)`.

`lastEventId`
: The last received `id`. Upon reconnection the browser sends it in the header `Last-Event-ID`.

### Methods

`close()`
: Closes the connection.

### Events

`message`
: Message received, the data is in `event.data`.

`open`
: The connection is established.

`error`
: In case of an error, including both lost connection (will auto-reconnect) and fatal errors. We can check `readyState` to see if the reconnection is being attempted.

The server may set a custom event name in `event:`. Such events should be handled using `addEventListener`, not `on<event>`.

### Server response format

The server sends messages, delimited by `\n\n`.

A message may have following fields:

- `data:` -- message body, a sequence of multiple `data` is interpreted as a single message, with `\n` between the parts.
- `id:` -- renews `lastEventId`, sent in `Last-Event-ID` on reconnect.
- `retry:` -- recommends a retry delay for reconnections in ms. There's no way to set it from JavaScript.
- `event:` -- event name, must precede `data:`.

A message may include one or more fields in any order, but `id:` usually goes the last.

filename: article (143).md


text:
# Laravel Papertrail log channel

## Requirements
* Your application must be running Laravel 5.6.

**Note:** Laravel added a native Papertrail logging channel in version 5.7, so if you are running Laravel 5.7+ this package is unnecessary.

## Installation
1. Set two environment variables: `PAPERTRAIL_HOST` and `PAPERTRAIL_PORT`.
2. Run `composer require martinbean/laravel-papertrail`
3. Open **config/logging.php** and add the following channel:

```php
'papertrail' => [
    'driver' => 'papertrail',
    'level' => 'debug', // Or other desired level
],
```

Once configured, you can add `papertrail` to the `stack` channel (if you’re
using it) and any logs will be pushed to your Papertrail account.

**Note:** The `PAPERTRAIL_HOST` environment variable should be the _full_
Papertrail hostname, i.e. **logs0.papertrailapp.com**.

## Issues
[Open a new Issue](https://github.com/martinbean/laravel-papertrail/issues/new)
on the [GitHub repository](https://github.com/martinbean/laravel-papertrail).

## License
Licensed under the [MIT License](LICENSE.md).

repository: martinbean/laravel-papertrail

repo_name: martinbean/laravel-papertrail


text:
Locks
============

---

### Command locks

By default, all symfony commands using locks to prevent concurrency.
Locks are handled by [CommandLockSubscriber](https://github.com/anzusystems/common-bundle/blob/main/src/Event/Subscriber/CommandLockSubscriber.php).

You can specify your unlocked commands by configuration, by default `AssetsInstallCommand`, `CacheWarmupCommand` and `ConsumeMessagesCommand` are unlocked:
```yaml
anzu_systems_common:
    settings:
        unlocked_commands:
            - Symfony\Bundle\FrameworkBundle\Command\AssetsInstallCommand
            - Symfony\Bundle\FrameworkBundle\Command\CacheWarmupCommand
            - Symfony\Component\Messenger\Command\ConsumeMessagesCommand
            - App\Command\YourAdditionalUnlockedCommand
```

A lock key is created from command name and command arguments.

A locked command is released on `console.error` or `console.terminate` event.

---

### Resource locker

If you need to acquire atomic lock for some entity or api call, you can use [ResourceLocker](https://github.com/anzusystems/common-bundle/blob/main/src/Util/ResourceLocker.php) utitlity.

It composes three usable public methods:
```php
public function lock(BaseIdentifiableInterface | string $resource, bool $blocking = true): bool;
public function unLock(BaseIdentifiableInterface | string $resource): void;
public function unlockAll(): void;
```

For example, you need to lock the user entity to prevent concurrency:
```php
$this->resourceLocker->lock($user);
$user->doSomeAction();
$this->resourceLocker->unlock($user);
```
In this case, if something calls this process, it will perform the action immediately only if there is no other project doing the same action at the same time.
If there is concurrency, it will wait until the first performer unlock the resource, and then it will do the action.

In case you don't want to wait and rather cancel the action, you can use set `blocking` parameter to `false` which will end up by throwing `LogicException`.

[AbstractAnzuApiController](https://github.com/anzusystems/common-bundle/blob/main/src/Controller/AbstractAnzuApiController.php) provides protected method `lockApi(bool $blocking = false): void;` for ability to lock whole api endpoint. It uses route name as a lock key.
Use it for example as this:
```php
public function someControllerAction(): Response
{
    $this->lockApi();

    return $this->noContentResponse();
}
```

A lock key is created from the primary identifier `$object->getId()` or by the string you can provide instead of referencing `BaseIdentifiableInterface` object.

All locked resource are released on `kernel.terminate` by [LockReleaseListener](https://github.com/anzusystems/common-bundle/blob/main/src/Event/Listener/LockReleaseListener.php).

repository: anzusystems/common-bundle

gha_language: PHP

repo_name: anzusystems/common-bundle


text:
# Visual CSS

Visual CSS is a tool for frontend and backend developers alike to improve their CSS skills.
Experience a live version at [css.haluza.dev](https://css.haluza.dev/).

## Table of Contents

- [About the Project](#about-the-project)
  - [Built With](#built-with)
- [Getting Started](#getting-started)
  - [Prerequisites](#prerequisites)
  - [Installation](#installation)
- [Usage](#usage)
- [License](#license)
- [Contact](#contact)

## About The Project

Visual CSS provides developers with an interactive sandbox-like environment to experiment with
different CSS properties. The app currently includes the following properties:

- [box-shadow](https://developer.mozilla.org/en/docs/Web/CSS/box-shadow)
- [border-radius](https://developer.mozilla.org/en/docs/Web/CSS/border-radius)
- [rotate3d()](https://developer.mozilla.org/en/docs/Web/CSS/border-radius)

More to come!

### Built With

- [React](https://reactjs.org/)
- [Redux](https://redux.js.org/)
- [Sass](https://sass-lang.com/)

## Getting Started

### Prerequisites

- npm

```sh
npm install npm@latest -g
```

### Installation

1. Clone the repo

```sh
git clone https://github.com/zhaluza/visual-css
```

3. Install NPM packages

```sh
npm i
```

## Usage

Boot up the app in dev mode by running the following script:

```sh
npm run dev:start
```

(Note: app does not contain a server to run build files)

## License

Distributed under the ISC License.

## Contact

Thoughts or questions? Contact me at [zac.haluza@gmail.com](mailto:zac.haluza@gmail.com)!

license: ISC

repository: zhaluza/visual-css

repo_name: zhaluza/visual-css


text:
## `slope()`

Returns the slope of two points.

```javascript
Calc.slope([1, 1], [2, 3]);
// 2
```

If there is no slope (`i.e.` a vertical line), the method returns `null`.


text:
This is the second public release of the particle FMM library in R^3.

Date: November 8, 2017

Version 1.2.1

```
Copyright (C) 2010-2012: Leslie Greengard and Zydrunas Gimbutas
Contact<EMAIL_ADDRESS>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.

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

3. Neither the name of the copyright holder nor the names of its
   contributors may be used to endorse or promote products derived
   from this software without specific prior written permission.

 IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
```

### Contents

```
src/ - Fortran source code
examples/ - Fortran testing drivers and makefiles
matlab/ - matlab scripts and mex files
contrib/mwrap-0.33.3/ - mwrap source code
```

To test the library, please type `make test`.

### Fortran

Particle FMM routines.

```
hfmm3dpartself - Helmholtz particle FMM in R^3.
lfmm3dpartself - Laplace particle FMM in R^3.

hfmm3dparttarg - Helmholtz particle target FMM in R^3.
lfmm3dparttarg - Laplace particle target FMM in R^3.
```

Triangle FMM routines (constant densities on flat triangles).

```
hfmm3dtriaself - Helmholtz particle FMM in R^3.
lfmm3dtriaself - Laplace particle FMM in R^3.

hfmm3dtriatarg - Helmholtz particle target FMM in R^3.
lfmm3dtriatarg - Laplace particle target FMM in R^3.
```

Direct evaluation routines (constant densities on flat triangles).

```
h2dtriadirect - Helmholtz triangle interactions in R^3.
l2dtriadirect - Laplace triangle interactions in R^3.
```

Direct evaluation routines.

```
h2dpartdirect - Helmholtz particle interactions in R^3.
l2dpartdirect - Laplace particle interactions in R^3.
```

### Matlab

```
% Helmholtz and Laplace FMMs in R^3.
%
% Triangle FMM routines (constant densities on flat triangles).
%   hfmm3dtria      - Helmholtz triangle FMM in R^3.
%   lfmm3dtria      - Laplace triangle FMM in R^3.
%
% Particle FMM routines.
%   hfmm3dpart      - Helmholtz particle FMM in R^3.
%   lfmm3dpart      - Laplace particle FMM in R^3.
%
% Direct evaluation routines (constant densities on flat triangles).
%   h3dtriadirect  - Helmholtz triangle interactions in R^3.
%   l3dtriadirect  - Laplace triangle interactions in R^3.
%
% Direct evaluation routines (particles).
%   h3dpartdirect  - Helmholtz particle interactions in R^3.
%   l3dpartdirect  - Laplace particle interactions in R^3.
%
% Triangulations.
%   atriread - Retrieve Cart3d triangulation from a file. (flat)
%   atriwrite - Store Cart3d triangulation to a file. (flat)
%   atriproc - Process triangulations in Cart3d format. (flat)
%   atrirefine - Refine Cart3d triangulation. (flat)
%   atriplot - Plot Cart3d triangulation. (flat)
%
% Triangle FMM postprocessing routines (constant densities on flat triangles).
%   hfmm3dtriampf    - Helmholtz triangle FMM in R^3, targets only.
%
% Tree generation routines.
%   d3tstrcr - construct the logical structure for a fully adaptive FMM in R^3.
%   d3tstrcrem  - include empty boxes, min and max level restriction.
%   d3tgetb     - retrieve box information.
%   d3tgetl     - retrieve list information.
%
% Testing and debugging routines.
%   test_lfmm3dpart_direct - test Laplace particle FMM and direct routines.
%   test_hfmm3dpart_direct - test Helmholtz particle FMM and direct routines.
%   test_lfmm3dtria_direct - test Laplace triangle FMM and direct routines.
%   test_hfmm3dtria_direct - test Helmholtz triangle FMM and direct routines.
%
% Internal utility functions.
%   fmm3dprini   - initialize simple printing routines.
%
```


text:
Is this a question, feature request, or bug report?

**QUESTION**

Have you checked our documentation at https://cockroachlabs.com/docs/? If you could not find an answer there, please consider asking your question in our community forum at https://forum.cockroachlabs.com/, as it would benefit other members of our community.

Prefer live chat? Message our engineers on our Gitter channel at https://gitter.im/cockroachdb/cockroach.

**FEATURE REQUEST**

1. Please describe the feature you are requesting.

2. Indicate the importance of this issue to you (blocker, must-have, should-have, nice-to-have). Are you currently using any workarounds to address this issue?

3. Provide any additional detail on your proposed use case for this feature.

**BUG REPORT**

1. Please supply the header (i.e. the first few lines) of your most recent
   log file **for each node in your cluster**. On most unix-based systems
   running with defaults, this boils down to the output of

     grep -F '[config]' cockroach-data/logs/cockroach.INFO

   When log files are not available, supply the output of `cockroach version`
   and all flags/environment variables passed to `cockroach start` instead.

2. Please describe the issue you observed:

- What did you do?

- What did you expect to see?

- What did you see instead?

repository: vaibhavarora/cockroach

gha_language: Go

repo_name: vaibhavarora/cockroach


text:
# FourSquareClone

# Overview

Using the FourSquare API to load list of categories of venues in a collection view

- The user is able to click on the search button which segues to a search bar that allows the user to search for a venue
- The user is able to select a venue from different categories
- Selecting a venue category segues to a table view of venues
- Selecting a table view cell segues to a detail view where the user can see more information about the venue such as the venue's image, name, address, direction and favorite button which allows the user to favorite a venue
- Selecting on the venue's direction segues to the venue's map view annotations.
- Clicking on the map view annotation gives you a google MKLocation direction

![file from ios 4](https://user-images.githubusercontent.com/43827399/53262103-c12c8400-36a3-11e9-8b9f-7ceefd6e7e55.gif)
![file from ios 3](https://user-images.githubusercontent.com/43827399/53262105-c12c8400-36a3-11e9-87e5-02e5582c3d21.gif)
![file from ios 2](https://user-images.githubusercontent.com/43827399/53262106-c12c8400-36a3-11e9-9c6d-d96edf81db13.gif)
![file from ios 1](https://user-images.githubusercontent.com/43827399/53262107-c12c8400-36a3-11e9-9178-2626adfb456a.gif)
![file from ios](https://user-images.githubusercontent.com/43827399/53262109-c12c8400-36a3-11e9-8f5d-ef0ddbe71269.gif)

# Detailed Outline

The app has 3 tabs

1. Search
2. List
3. History

# Search

This view has a:
- Search Button
- Collection View

The search button allows the user to search for a venue by typing a category name

The collection view has a collection of categories. Selecting a category should give you a table view of all the venues of that particular location.

Selecting a table view cell should segue to a detailed view with more information of the venue including:

- The image of the venue
- The address of the venue
- The category under which the venue falls
- The direction of the venue
- A favorite button which allows the user to favorite the venue
- A Tip button which allows the user to leave a tip

## List

This view has a:

1. Create Button
2. Collection View

The create button allows the user to create and add a venue to their favorite list

The collection view displays the list of venues favorited. Clicking a collection view should segue to a detail about the venue such as the venue's name, the latitude and longitude.

## History

This view has a table view list all the history of searched venues

repository: BironSu/FourSquareClone

gha_language: Swift

repo_name: BironSu/FourSquareClone


text:
# Myaer Discord Bot
Myaer is a Discord bot written with discord.py in Python 3.8.2. It is focused around Minecraft and Hypixel, but other commands can and will be added.
## Information
- Invite the bot to your server with [this link](https://discord.com/api/oauth2/authorize?client_id=700133917264445480&permissions=8&scope=bot)
- Join my public [Discord Server](https://inv.wtf/myerfire) for support
## Command List
### General
- **/help** - What do you think it is?
- **/ping** - Shows bot latency
- **/suggest \<suggestion\>** - Sends a suggestion in my [Discord server](https://inv.wtf/myerfire) for me to see
### Minecraft
#### General
**If you are verified, you can omit the \<name\> part and it will default to you**
- **/mc name \<name\>** - Shows name history
- **/mc uuid \<name\>** - Shows UUID
- **/mc verify \<name\>** - Verifies you with the Myaer Bot database for easier command access
  - this requires that your Discord social media option be set to your Discord name on Hypixel
- **/mc unverify \<name\>** - Unverifies you from the Myaer Bot database
#### Hypixel
##### Bedwars
###### Player Stats
**If you are verified, you can omit the \<player\> part and it will default to you**
- **/bw \<player\>** - Shows general Bedwars stats
  - **/bw \<solo/doubles/threes/fours/4v4\> \<player\>** - Shows per game mode stats
  - **/bw \<armed/castles/luckyblocks/rush/ultimate/voidless\> \<solo/doubles/fours\> \<player\>** - Shows per dream game mode stats
    - Some dreams modes used to have a solo mode (Rush and Ultimate), so the solo command doesn't work for the other dream modes
- **/bw bblr \<player\>** - Shows bed break/loss ratio and other calculations
  - **/bw bblr \<solos/doubles/threes/fours/4v4\> \<player\>** - Shows per game mode bed break/loss ratio and other calculations
  - **/bw bblr \<armed/castles/luckyblocks/rush/ultimate/voidless\> \<solo/doubles/fours\>** - Shows per dream game mode bed break/loss ratio and other calculations
    - Some dreams modes used to have a solo mode (Rush and Ultimate), so the solo command doesn't work for the other dream modes
- **/bw fkdr \<player\>** - Shows final kill/death ratio and other calculations
  - **/bw fkdr \<solos/doubles/threes/fours/4v4\> \<player\>** - Shows per game mode final kill/death ratio and other calculations
  - **/bw fkdr \<armed/castles/luckyblocks/rush/ultimate/voidless\> \<solo/doubles/fours\>** - Shows per dream game mode final kill/death ratio and other calculations
    - Some dreams modes used to have a solo mode (Rush and Ultimate), so the solo command doesn't work for the other dream modes
- **/bw wlr \<player\>** - Shows win/loss ratio and other calculations
  - **/bw wlr \<solos/doubles/threes/fours/4v4\> \<player\>** - Shows per game mode win/loss ratio and other calculations
  - **/bw wlr \<armed/castles/luckyblocks/rush/ultimate/voidless\> \<solo/doubles/fours\>** - Shows per dream game mode final kill/death ratio and other calculations
    - Some dreams modes used to have a solo mode (Rush and Ultimate), so the solo command doesn't work for the other dream modes
###### Leaderboards
- **/lb bw \<levels/level/star\>** - Shows Bedwars level leaderboard
  - Default Bedwars leaderboard is level leaderboard, therefore **/lb bw** works
- **/lb bw finals** - Shows overall Bedwars final kills leaderboard
- **/lb bw finals weekly** - Shows weekly Bedwars final kills leaderboard
- **/lb bw wins** - Shows overall Bedwars wins leaderboard
- **/lb bw wins weekly** - Shows weekly Bedwars wins leaderboard

##### Duels
**If you are verified, you can omit the \<player\> part and it will default to you**
- **/duels \<player\>** - Shows general Duels stats
	- per mode and per stats calculations coming soon™

##### Paintball
**If you are verified, you can omit the \<player\> part and it will default to you**
- **/pb \<player\>** - Shows general Paintball stats
- **/pb kdr \<player\>** - Shows Paintball kill death ratio and otehr calculations
##### Skywars
###### Player Stats
**If you are verified, you can omit the \<player\> part and it will default to you**
- **/sw \<player\>** - Shows general Skywars stats
  - per stat calculations coming soon™
##### Wrist Spasm
*These features are specific to Wrist Spasm*
- **/spasm verify \<name\>** - Sets your nickname to your Minecraft IGN and gives you a role based on your Bedwars prestige
  - **/spasm override \<discord_id_or_mention\> \<name\>** - Overrides and reverifies someone (only works if you have staff roles in Wrist Spasm)

## Authors
- **MyerFire** *myer#0001* *https://www.youtube.com/myerfire*
  - Anyone may submit a pull request and it will possibly be implemented

repository: vcokltfre/Myaer

repo_name: vcokltfre/Myaer


text:
---
layout: simple-page
title: Parking.sg
permalink: /products-and-services/parking-sg/
breadcrumb: Parking.sg
collection_name: products-and-services
tag: citizens
thumbnail_image: /images/programmes/products-and-services/Parking_sg.png
---

[Parking.sg](https://www.parking.sg) is a mobile application that allows users to pay for short-term parking charges through their mobile devices at all existing coupon-based public car parks. The app serves as an alternative mode of payment to paper parking coupons.

**How to use the Parking.sg mobile app**
* Activate the app to begin your parking session as soon as you park your vehicle within a designated parking lot.
* To start the session, key in your vehicle number, select the car park code and indicate the intended parking duration.
* Charges will be calculated on a per-minute basis. A refund will be given if you choose to end your parking session earlier.

**Useful features**
* You can be alerted 10 minutes before your parking session expires. Turn on the “Notification” feature in your device settings.
* If you need to extend your parking duration, you can do it remotely via the app.

For more information, please visit [www.parking.sg](https://www.parking.sg){:target="_blank"}.

repository: isomerpages/isomerpages-govtech

branch_name: refs/heads/staging

gha_language: SCSS

gha_license_id: NOASSERTION

repo_name: isomerpages/isomerpages-govtech


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

Adds [Embedded Javascript template (EJS)](https://github.com/mde/ejs)
compilation support to [brunch](http://brunch.io).

For each file ending with the `.ejs` extension, generate a compile function
inside a module.

## Example

```html
<!-- in 'app/foo.html.ejs' -->
<li id="<%= id %>"><%= name.toUpperCase() %></li>
```

```javascript
// in 'app/initialize.js'
let fooTpl = require('foo.html');
console.log(fooTpl({ id: 1, name: "nice!" }));
// => '<li id="1">NICE!</li>'
```

Notice that ejs-brunch *does not compile assets*. Instead it generates compile
functions as dynamic templates to be used by client-side code.

## Usage

Install the plugin via npm with `npm install --save ejs-brunch`.

Or, do manual install:

* Add `"ejs-brunch": "~1.0.2"` to `package.json` of your brunch app.
* If you want to use git version of plugin, use the GitHub URI
`"ejs-brunch": "munshkr/ejs-brunch"`.

There's no need to require ejs.js on your app bundle in Brunch, because this
plugin uses `ejs.compile()` with the `client: true` option.  This tells EJS to
include an implementation for the HTML-escaping function and error handlers on
each compile function.

### include()

You can use the `include()` local function in your templates:

```html
<!-- in 'app/foo.html.ejs' -->
<li id="<%= id %>"><%- include('foo/item.html', { id: id, name: name }) %></li>

<!-- in 'app/foo/item.html.ejs' -->
<span><%= name.toUpperCase() %> (<%= id %>)</span>
```

Path must be relative to the parent template file. Internally uses `require()`,
so files must be inside any of the *watched paths*, as defined in your Brunch
configuration file.

## License

The MIT License (MIT)

Copyright (c) 2016 Damián Silvani, Paul Miller (http://paulmillr.com)

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.

 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.

repository: munshkr/ejs-brunch

repo_name: munshkr/ejs-brunch


text:
async-objects.js
===============

[![NPM version](https://img.shields.io/npm/v/async-objects.svg)]()
[![npm](https://img.shields.io/npm/dt/async-objects.svg)]()
[![Travis](https://img.shields.io/travis/khrome/async-objects.svg)]()

This used to be an object-oriented flow control library. While it still is, [async](https://www.npmjs.com/package/async) does it better.

Now it's just something to use when I want something more lightweight. YMMV

Usage
-----
I find, most of the time, my asynchronous logic emerges from a list and I really just want to be able to control the completion of some job, and have a signal for all jobs. In many instances, this winds up being more versatile than a promise which limits you to a binary state and only groups returns according to it's state.

you can either use the functions as returned:

    var objectTool = require('async-objects');
    objectTool.forEachEmission(object, iteratorFn, callback);

or you can add them to `Object`

    require('async-objects').on(Object);

forEachEmission : execute serially

    Object.forEachEmission(object, function(item, index, done){
        somethingAsynchronous(function(){
            done();
        });
    }, function(){
        //we're all done!
    });

forAllEmissions : execute all jobs in parallel

    Object.forAllEmissions(object, function(item, index, done){
        somethingAsynchronous(function(){
            done();
        });
    }, function(){
        //we're all done!
    });

forAllEmissionsInPool : execute all jobs in parallel up to a maximum #, then queue for later

    Object.forAllEmissionsInPool(object, poolSize, function(item, index, done){
        somethingAsynchronous(function(){
            done();
        });
    }, function(){
        //we're all done!
    });

a cloner for recursively copying any object/array

    var copy = Object.clone(object);

a non-referencing interleaver(it clones as it interleaves)

    var combined = Object.interleave(object, anotherObject);

a shallow object merge

    var combined = Object.merge(objOne, objTwo);

a map, to process all object values

    var mappedObject = Object.map(object, mapFn[, excludeUndefinedValues]);

a filter to reduce the fields in an object

    var filteredObject = Object.filter(object, testFn);

That's just about it, and even better you can open up the source and check it out yourself. Super simple.

Testing
-------
just run

    mocha

Enjoy,

-Abbey Hawk Sparrow

repository: khrome/async-objects

repo_name: khrome/async-objects