text:
<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Views
 *
 * @author Michael
 */
class Views extends Application
{

    public function index()
    {
        $this->data['pagetitle'] = 'Ordered TODO List';
        $tasks = $this->tasks->all();   // get all the tasks
        $this->data['content'] = 'Ok'; // so we don't need pagebody
        $this->data['leftside'] = $this->makePrioritizedPanel($tasks);
        $this->data['rightside'] = $this->makeCategorizedPanel($tasks);

        $this->render('template_secondary');
    }

    function makePrioritizedPanel($tasks) {
        // extract the undone tasks
	foreach ($tasks as $task)
	{
            if ($task->status != 2)
		$undone[] = $task;
        }

        // order them by priority
        usort($undone, "orderByPriority");

        // substitute the priority name
        foreach ($undone as $task)
            $task->priority = $this->priorities->get($task->priority)->name;

        // convert the array of task objects into an array of associative objects
        foreach ($undone as $task)
            $converted[] = (array) $task;

        // and then pass them on
        $parms = ['display_tasks' => $converted];
        $role = $this->session->userdata('userrole');
        $parms['completer'] = ($role == ROLE_OWNER) ? '/views/complete' : '#';

        return $this->parser->parse('by_priority', $parms, true);

        /*$parms = ['display_tasks' => []];
        $role = $this->session->userdata('userrole');
        $parms['completer'] = ($role == ROLE_OWNER) ? '/views/complete' : '#';
        return $this->parser->parse('by_priority',$parms,true);*/
    }

    function makeCategorizedPanel($tasks) {
        $parms = ['display_tasks' => []];
        return $this->parser->parse('by_category',$parms,true);
    }

    // complete flagged items
    function complete() {
        $role = $this->session->userdata('userrole');
        if ($role != ROLE_OWNER) redirect('/work');

        // loop over the post fields, looking for flagged tasks
        foreach($this->input->post() as $key=>$value) {
            if (substr($key,0,4) == 'task') {
                // find the associated task
                $taskid = substr($key,4);
                $task = $this->tasks->get($taskid);
                $task->status = 2; // complete
                $this->tasks->update($task);
            }
        }
        $this->index();
    }

}

// return -1, 0, or 1 of $a's priority is higher, equal to, or lower than $b's
function orderByPriority($a, $b)
{
    if ($a->priority > $b->priority)
        return -1;
    elseif ($a->priority < $b->priority)
        return 1;
    else
        return 0;
}


text:
 module.exports = function(grunt) {
 "use strict";

 grunt.registerTask( "check-modules", "Run this before anything else that loads local modules to verify they're installed", function() {
	var done = this.async();
	grunt.utils.spawn({
		cmd: "npm",
		args: [ "ls" ]
	}, function( err ) {
		if ( err ) {
			grunt.verbose.error();
			grunt.log.error( err );
			done( false );
			return;
		}
		grunt.verbose.ok();
		done();
	});
 });

 };

redpajama_set_name: RedPajamaGithub


text:
<img alt="Rook" src="Documentation/media/logo.svg" width="50%" height="50%">

[![CNCF Status](https://img.shields.io/badge/cncf%20status-graduated-blue.svg)](https://www.cncf.io/projects)
[![GitHub release](https://img.shields.io/github/release/rook/rook/all.svg)](https://github.com/rook/rook/releases)
[![Docker Pulls](https://img.shields.io/docker/pulls/rook/ceph)](https://hub.docker.com/u/rook)
[![Go Report Card](https://goreportcard.com/badge/github.com/rook/rook)](https://goreportcard.com/report/github.com/rook/rook)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/1599/badge)](https://bestpractices.coreinfrastructure.org/projects/1599)
[![Security scanning](https://github.com/rook/rook/actions/workflows/synk.yaml/badge.svg)](https://github.com/rook/rook/actions/workflows/synk.yaml)
[![Slack](https://slack.rook.io/badge.svg)](https://slack.rook.io)
[![Twitter Follow](https://img.shields.io/twitter/follow/rook_io.svg?style=social&label=Follow)](https://twitter.com/intent/follow?screen_name=rook_io&user_id=788180534543339520)

# What is Rook?

Rook is an open source **cloud-native storage orchestrator** for Kubernetes, providing the platform, framework, and support for Ceph storage to natively integrate with Kubernetes.

[Ceph](https://ceph.com/) is a distributed storage system that provides file, block and object storage and is deployed in large scale production clusters.

Rook automates deployment and management of Ceph to provide self-managing, self-scaling, and self-healing storage services.
The Rook operator does this by building on Kubernetes resources to deploy, configure, provision, scale, upgrade, and monitor Ceph.

The status of the Ceph storage provider is **Stable**. Features and improvements will be planned for many future versions. Upgrades between versions are provided to ensure backward compatibility between releases.

Rook is hosted by the [Cloud Native Computing Foundation](https://cncf.io) (CNCF) as a [graduated](https://www.cncf.io/announcements/2020/10/07/cloud-native-computing-foundation-announces-rook-graduation/) level project. If you are a company that wants to help shape the evolution of technologies that are container-packaged, dynamically-scheduled and microservices-oriented, consider joining the CNCF. For details about who's involved and how Rook plays a role, read the CNCF [announcement](https://www.cncf.io/blog/2018/01/29/cncf-host-rook-project-cloud-native-storage-capabilities).

## Getting Started and Documentation

For installation, deployment, and administration, see our [Documentation](https://rook.github.io/docs/rook/latest-release) and [QuickStart Guide](https://rook.github.io/docs/rook/latest-release/Getting-Started/quickstart).

## Contributing

We welcome contributions. See [Contributing](CONTRIBUTING.md) to get started.

## Report a Bug

For filing bugs, suggesting improvements, or requesting new features, please open an [issue](https://github.com/rook/rook/issues).

### Reporting Security Vulnerabilities

If you find a vulnerability or a potential vulnerability in Rook please let us know immediately at
[cncf-rook-security@lists.cncf.io](mailto:cncf-rook-security@lists.cncf.io). We'll send a confirmation email to acknowledge your
report, and we'll send an additional email when we've identified the issues positively or
negatively.

For further details, please see the complete [security release process](SECURITY.md).

## Contact

Please use the following to reach members of the community:

- Slack: Join our [slack channel](https://slack.rook.io)
- GitHub: Start a [discussion](https://github.com/rook/rook/discussions) or open an [issue](https://github.com/rook/rook/issues)
- Twitter: [@rook_io](https://twitter.com/rook_io)
- Security topics: [cncf-rook-security@lists.cncf.io](#reporting-security-vulnerabilities)

## Community Meeting

A regular community meeting takes place every other [Tuesday at 9:00 AM PT (Pacific Time)](https://zoom.us/j/392602367?pwd=NU1laFZhTWF4MFd6cnRoYzVwbUlSUT09).
Convert to your [local timezone](http://www.thetimezoneconverter.com/?t=9:00&tz=PT%20%28Pacific%20Time%29).

Any changes to the meeting schedule will be added to the [agenda doc](https://docs.google.com/document/d/1exd8_IG6DkdvyA0eiTtL2z5K2Ra-y68VByUUgwP7I9A/edit?usp=sharing) and posted to [Slack #announcements](https://rook-io.slack.com/messages/C76LLCEE7/).

Anyone who wants to discuss the direction of the project, design and implementation reviews, or general questions with the broader community is welcome and encouraged to join.

- Meeting link: <https://zoom.us/j/392602367?pwd=NU1laFZhTWF4MFd6cnRoYzVwbUlSUT09>
- [Current agenda and past meeting notes](https://docs.google.com/document/d/1exd8_IG6DkdvyA0eiTtL2z5K2Ra-y68VByUUgwP7I9A/edit?usp=sharing)
- [Past meeting recordings](https://www.youtube.com/playlist?list=PLP0uDo-ZFnQP6NAgJWAtR9jaRcgqyQKVy)

## Official Releases

Official releases of Rook can be found on the [releases page](https://github.com/rook/rook/releases).
Please note that it is **strongly recommended** that you use [official releases](https://github.com/rook/rook/releases) of Rook, as unreleased versions from the master branch are subject to changes and incompatibilities that will not be supported in the official releases.
Builds from the master branch can have functionality changed and even removed at any time without compatibility support and without prior notice.

## Licensing

Rook is under the Apache 2.0 license.

[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Frook%2Frook.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Frook%2Frook?ref=badge_large)


text:
<!doctype html>

		<meta charset="utf-8">
		<title>GEOG*3480 Lecture 9</title>
		<link rel="stylesheet" href="../revealjs/css/reveal.css">
		<link rel="stylesheet" href="../revealjs/css/theme/white.css" id="theme">
    <link rel="stylesheet" href="../revealjs/lib/css/zenburn.css">
    <link rel="stylesheet" href="../revealjs/css/lindsay.css">

Press 'o' to toggle the slide overview and 'f' for full-screen mode.

            Choose the theme in which to view this presentation:

						Black -
						White -
						League -
						Sky -
						Beige -
						Simple

						Serif -
						Blood -
						Night -
						Moon -
						Solarized

GEOG*3480

GIS and Spatial Analysis

Least-cost Pathway Analysis

            John Lindsay

            Fall 2015

Background readings

Your textbook doesn't discuss LCPA.

For background materials, please see
						ESRI's online help topic "Understanding cost distance analysis"
						(http://pro.arcgis.com/en/pro-app/tool-reference/spatial-analyst/understanding-cost-distance-analysis.htm)

Distance and Cost

We're not always interested in the straight-line distance between spatial objects

There are times (and types of spatial problems) that require the estimation of
              cost-weighted distances, i.e. calculating <highlightedText>the 'cost' of moving across
								the landscape</highlightedText>

Distance and Cost

Cost = money, time, energy, fuel, suffering, resistance or other parameters

Very often we want to <highlightedText>minimize costs</highlightedText>

Euclidean distance has the limitation of assuming that the cost of crossing distances
              in any cell on the way to a source cell is the same as the cost of crossing distances in
              any other cell

Least-cost pathway analysis (LCPA)

LCPA is a way of finding an optimum, or set of optimum, pathways across a landscape
              with a non-uniform spatial distribution of resistance to travel

Many GIS offer tools for performing LCPA because it is so widely used...it's a
              common spatial problem

Measures the <highlightedText>effective distance</highlightedText> rather than the Euclidean distance

Type of spatial analysis based on the raster model

LCPA Steps

Calculate the cost of traversing through each grid cell...the <highlightedText>Cost Surface</highlightedText>

Specify a <highlightedText>Source Cell(s)</highlightedText> and/or <highlightedText>Target Cell(s)</highlightedText>

Perform <highlightedText>Cost Accumulation</highlightedText> analysis

Identify the optimum <highlightedText>Least-Cost Pathway(s)</highlightedText>

The Cost Surface

We can create a cost surface to account for the factors affecting cost

Each grid cell contains a number that indicates the cost of going through a
              unit of distance in that cell

If it is three times harder to go through the forest as it is to go through
              the pasture, we might assign values of 1 to the pasture cells and 3 to the
              forest cells.

The Cost Surface

Physical barriers (e.g. streams) can be represented in the cost surface by
            exceedingly high costs. Consider the following maze example:

The Cost Surface

Care must be taken when adding linear features (roads, streams, etc.) to
            the cost surface. Diagonal raster connectivity may allow the least-cost path to incorrectly pass
            through an area with high resistance.

Cost Accumulation

The accumulated cost found in the output grid is the sum of the products
            formed by:

the distance across each cell, and;

the value of each cell, i.e. the price per unit distance for going through, which will
              depend on the grid resolution.

Cost Accumulation

Cost accumulation calculates the <highlightedText>SPREAD</highlightedText>
							distance, with a <highlightedText>friction</highlightedText> (cost) determined by the cost surface.

The accumulation procedure works outward from specified source cells.

Each cell in the grid is then assigned the minimum cost-distance connecting
              it to the 'nearest' source cell.

Effectively creates a continuous cost accumulation surface.

Cost Accumulation

The Least-Cost Pathway

Least cost pathways can be estimated by using a D8 flow routing algorithm on the cost
              accumulation surface in much the same way that we've seen flow algorithms used to trace
              flowpaths over the surface defined by a DEM

The source cells will be the lowest points in the cost accumulation surface

You can trace the pathway of steepest descent from any target cell(s) to the nearest
              source cell, working backwards

The Least-Cost Pathway

Let's consider an example...

Two major highways travel parallel through a mountainous environment. When there are
              traffic accidents, large sections of the highway must be closed. Unfortunately because no
              secondary road connects either highway during the dangerous section of the highway, detours
              are impossible during times of closure. This has become a serious problem of the area and as
              a result the authorities are considering creating a new secondary road to join the main
              highways.

What would be the best route for this new highway?

Things to consider that affect the cost

The raster grid resolution is 90 m

[note all costs are made up for the example]

Privately owned land is prohibitively expensive to acquire
              (set cost to $100,000 / 90 m, i.e. an effective barrier)

Bridges over lakes are not feasible (within our budget)

Things to consider that affect the cost

There is a cost associated with crossing rivers and rivers.

Small rivers can be culverted ($500 / 90 m)

Small bridges cost between $5000 / 90 m and $10,000 / 90 m

Large bridges are prohibitively expensive (set to $1,000,000 / 90 m)

We can use the Stream Order tool to distinguish small, medium and large
             streams.

Streams, being single cell wide lines, need to be represented in the cost surface
               as 'fat' networks and we can use a 3 x 3 Maximum filter to do this.

Things to consider that affect the cost

We cannot build a road through wetlands due to environmental reasons
              (set to $1,000,000 / 90 m)

It costs more to build roads on steeper slopes because of the need to cut
               bedrock to grade the slope

0°-5° $1,000 / 90 m

5°-10° $2,000 / 90 m

10°-15° $3,000 / 90 m

>15° $100,000 / 90 m (major grading required)

Slope can be measured from the DEM using the Slope tool.

Once we've combined each cost factor into a single cost surface,
            we can use Whitebox GAT's Cost Accumulation tool.

Here is the cost surface and cost accumulation surface for our example:

Now we use the back-link grid output from the cost accumulation as
            an input for Whitebox's Least-Cost Pathway tool. For our example, we would
            like the secondary road to connect to Road 2 (i.e. the eastern road) at Old Town. A raster of
            Old Town's location is therefore used as the destination input.

Here is the back-link raster and final least-cost pathway connecting Old Town
            on Road 2 to Road 1:


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security;
using System.Security.Permissions;
using System.Text;

using Microsoft.Win32;
using Microsoft.WindowsAPI.Dialogs;
using Microsoft.WindowsAPI.Shell;

namespace GmailNotifierPlus.Utilities {
	public static class ErrorHelper {

		private static String _LogPath = null;

		static ErrorHelper() {
			String appData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

			_LogPath = Path.Combine(appData, GmailNotifierPlus.Resources.Strings.WindowTitle, "Error Logs");

			if (!Directory.Exists(_LogPath)) {
				Directory.CreateDirectory(_LogPath);
			}

		}

		///
		/// Shows the user a dialog explaining the error, and creates a log file for the error.
		///
		/// <param name="e"></param>
		public static void Report(Exception e) {
			Guid guid = Guid.NewGuid();
			Show(e, guid);
			Log(e, guid);
		}

		public static void Show(Exception e, Guid guid) {

			String message = String.Concat("Error ID: ", guid.ToString(), "\n\n", e.Message);

			TaskDialog dialog = new TaskDialog() {
				HyperlinksEnabled = true,
				DetailsExpanded = false,
				Cancelable = false,
				Icon = TaskDialogStandardIcon.Error,
				DetailsExpandedText = e.StackTrace,
				Caption = "Gmail Notifier Plus Error",
				InstructionText = "An unhandled exception occurred:",
				Text = message,
				FooterIcon = TaskDialogStandardIcon.Information,
				FooterText = "Please Click Here to automagically report the issue.\nPress CTL + C to copy this error to the clipboard."
			};

			dialog.HyperlinkClick += delegate(object sender, TaskDialogHyperlinkClickedEventArgs evt) {
				Send(guid);
			};

			dialog.Show();
		}

		public static void Log(Exception e, Guid guid) {

			var info = new Microsoft.VisualBasic.Devices.ComputerInfo();

			String path = Path.Combine(_LogPath, guid.ToString());

			String os = String.Join(" ", "CPU:", info.OSFullName, info.OSVersion, info.OSPlatform);
			String memory = String.Concat("Memory: ", info.TotalPhysicalMemory);
			String date = String.Concat("Date: ", DateTime.Now.ToString());
			String processor = "Processor: Unknown";

			try {
				using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"HARDWARE\DESCRIPTION\System\CentralProcessor\0", false)) {
					processor = String.Join(" ", "Processor:",
						key.GetValue("VendorIdentifier"),
						key.GetValue("Identifier"),
						key.GetValue("ProcessorNameString"),
						key.GetValue("~Mhz"), "~Mhz"
					);
					key.Close();
				}
			}
			catch (System.Security.SecurityException) {
			}

			String system = String.Join("\n", date, os, processor, memory);

			String data = String.Join("\n\n", system, PrintException(e));

			using (FileStream fs = new FileStream(path, FileMode.Create, FileAccess.Write)) {
				using (StreamWriter sw = new StreamWriter(fs)) {
					sw.Write(data);
				}
			}

		}

		public static String PrintException(Exception e) {

			String result = String.Empty;

			if (e != null) {
				String desc = String.Concat("Exception: ", e.ToString());
				String message = String.Concat("Message: ", e.Message);
				String stack = String.Concat("Stack Trace:\n", e.StackTrace);
				String inner = String.Concat("Inner Exception: ", PrintException(e.InnerException));

				result = String.Join("\n\n", desc, message, stack, inner);
			}

			return result;
		}

		public static void Send(Guid guid) {
			String path = Path.Combine(_LogPath, guid.ToString());
			FileInfo file = new FileInfo(path);
			String data = null;

			// in some fringe cases, the file won't already exist. permissions issues, etc.
			if (file.Exists) {
				using (StreamReader sr = file.OpenText()) {
					data = sr.ReadToEnd();
				}
			}

			// TODO: send this to a hop server, which will then send to github.
		}

	}
}


text:
package io.github.shogowada.scalajs.reactjs.example.customvirtualdom

import io.github.shogowada.scalajs.reactjs.ReactDOM
import io.github.shogowada.scalajs.reactjs.elements.ReactElement
import io.github.shogowada.scalajs.reactjs.example.customvirtualdom.CustomVirtualDOM._
import org.scalajs.dom

import scala.scalajs.js.JSApp

object HelloWorld {
  def apply(): ReactElement = E.div(A.id := "hello-world")("Hello, World!")
}

object Main extends JSApp {
  override def main(): Unit = {
    val mountNode = dom.document.getElementById("mount-node")
    ReactDOM.render(HelloWorld(), mountNode)
  }
}


text:
from django.contrib import admin
from recipes.models import Recipe, Step, RecipeIngredient, Ingredient
from recipes.forms import *

# Inlines

class RecipeIngredientInline(admin.TabularInline):
    form  = RecipeIngredientForm
    model = RecipeIngredient
    extra = 2

class StepInline(admin.TabularInline):
    form = StepForm
    model = Step
    extra = 2

class RecipeAdmin(admin.ModelAdmin):
    form = RecipeForm
    inlines = (RecipeIngredientInline, StepInline, )

admin.site.register(Recipe, RecipeAdmin)
admin.site.register(QuantityType)
admin.site.register(Ingredient)


text:
<?php

class Classygeeks_Mailman_Block_Adminhtml_Grid_Queue_Grid extends Mage_Adminhtml_Block_Widget_Grid
{
	/**
	 * Construct
	 */
	public function __construct()
	{
		parent::__construct();

		// Default sort
		$this->setDefaultSort('message_id');
		$this->setDefaultDir('DESC');

		// Set Id
		$this->setId('mailman_grid_queue');

		// Save params in session
		$this->setSaveParametersInSession(true);
	}

	/**
	 * Get collection class
	 * @return string
	 */
	protected function _getCollectionClass()
	{
		// This is the model we are using for the grid
		return 'mailman/messages_collection';
	}

	/**
	 * Prepare collection
	 * @return this
	 */
	protected function _prepareCollection()
	{
		// Event Id for queued
		$iEventId = Classygeeks_Mailman_Helper_Data::MAILMAN_EVENT_QUEUED;

		// Get and set our collection for the grid
		$oCollection = Mage::getResourceModel($this->_getCollectionClass());
		$sTableEvents = $oCollection->getTable('mailman/events');
		$oCollection->getSelect()->join($sTableEvents, "main_table.message_id = {$sTableEvents}.message_id AND type_id = {$iEventId}", array('date_created'));

		// Set collection
		$this->setCollection($oCollection);

		// Parent
		parent::_prepareCollection();

		return $this;
	}

	/**
	 * Prepare columns
	 * @return $this
	 */
	protected function _prepareColumns()
	{
		// Add the columns that should appear in the grid
		// -- Message Id
		$this->addColumn('message_id',
			array(
				'header'    => $this->__('Message Id'),
				'align'     => 'center',
				'width'     => '50px',
				'index'     => 'message_id'
			)
		);
		// -- Date
		$this->addColumn('date_created',
			array(
				'header'    => $this->__('Date'),
				'align'     => 'center',
				'width'     => '200px',
				'type'      => 'datetime',
				'index'     => 'date_created'
			)
		);
		// -- Status
		$this->addColumn('status',
			array(
				'header'    => $this->__('Status'),
				'align'     => 'center',
				'width'     => '100px',
				'index'     => 'status_id',
				'renderer'  => 'Classygeeks_Mailman_Block_Adminhtml_Grid_Queue_Status'
			)
		);
		// -- From
		$this->addColumn('from',
			array(
				'header'    => $this->__('From'),
				'index'     => 'email_from',
				'renderer'  => 'Classygeeks_Mailman_Block_Adminhtml_Grid_Queue_Email'
			)
		);
		// -- To
		$this->addColumn('to',
			array(
				'header'    => $this->__('To'),
				'index'     => 'email_to',
				'renderer'  => 'Classygeeks_Mailman_Block_Adminhtml_Grid_Queue_Email'
			)
		);
		// -- Cc
		$this->addColumn('cc',
			array(
				'header'    => $this->__('Cc'),
				'index'     => 'email_cc',
				'renderer'  => 'Classygeeks_Mailman_Block_Adminhtml_Grid_Queue_Email'
			)
		);
		// -- Bcc
		$this->addColumn('bcc',
			array(
				'header'    => $this->__('Bcc'),
				'index'     => 'email_bcc',
				'renderer'  => 'Classygeeks_Mailman_Block_Adminhtml_Grid_Queue_Email'
			)
		);
		// -- Subject
		$this->addColumn('subject',
			array(
				'header'    => $this->__('Subject'),
				'index'     => 'subject'
			)
		);

		return parent::_prepareColumns();
	}

	/**
	 * Get row Url
	 * @param $oRow
	 * @return string
	 */
	public function getRowUrl($oRow)
	{
		// This is where our row data will link to
		return $this->getUrl('*/*/view', array('id' => $oRow->getId()));
	}
}


text:
<ion-side-menus enable-menu-with-back-views="false">
	<ion-side-menu-content>
		<ion-nav-bar class="bar-stable">
			<ion-nav-back-button>
			</ion-nav-back-button>

			<ion-nav-buttons side="left">
				<button class="button button-icon button-clear ion-navicon" menu-toggle="left">
				</button>
			</ion-nav-buttons>
		</ion-nav-bar>
		<ion-nav-view name="menuContent"></ion-nav-view>
	</ion-side-menu-content>

	<ion-side-menu side="left">
		<ion-header-bar class="bar-stable">

Left

		</ion-header-bar>
		<ion-content>
			<ion-list>
				<ion-item nav-clear menu-close class="item-icon-left" href="#/app/home">

					{{ 'HOME' | translate}}
				</ion-item>
				<ion-item nav-clear menu-close class="item-icon-left" href="#/app/plain-text">

					{{ 'PLAIN_TEXT' | translate }}
				</ion-item>
				<ion-item nav-clear menu-close class="item-icon-left" href="#/app/date-time">

					{{ 'DATE_TIME' | translate }}
				</ion-item>
				<ion-item nav-clear menu-close class="item-icon-left" href="#/app/controls">

					{{ 'CONTROLS' | translate }}
				</ion-item>
			</ion-list>
		</ion-content>
	</ion-side-menu>
</ion-side-menus>


text:
//
// MainPage.xaml.cpp
// Implementation of the MainPage class.
//

#include "pch.h"
#include "MainPage.xaml.h"

#include <opencv2\imgproc\types_c.h>
#include <opencv2\imgcodecs\imgcodecs.hpp>
#include BLIK_OPENCV_V_opencv2__core__core_hpp //original-code:<opencv2\core\core.hpp>
#include BLIK_OPENCV_V_opencv2__imgproc__imgproc_hpp //original-code:<opencv2\imgproc\imgproc.hpp>
#include <opencv2\highgui.hpp>
#include <opencv2\highgui\highgui_winrt.hpp>

#include <Robuffer.h>

using namespace FaceDetection;

using namespace Platform;
using namespace Windows::Foundation;
using namespace Windows::Foundation::Collections;
using namespace Windows::UI::Xaml;
using namespace Windows::UI::Xaml::Controls;
using namespace Windows::UI::Xaml::Controls::Primitives;
using namespace Windows::UI::Xaml::Data;
using namespace Windows::UI::Xaml::Input;
using namespace Windows::UI::Xaml::Media;
using namespace Windows::UI::Xaml::Navigation;

using namespace Windows::UI::Xaml::Media::Imaging;
using namespace Windows::Storage::Streams;
using namespace Microsoft::WRL;

// Name of the resource classifier used to detect human faces (frontal)
cv::String face_cascade_name = "Assets/haarcascade_frontalface_alt.xml";
cv::String window_name = "Faces";

MainPage::MainPage()
{
    InitializeComponent();
}

void FaceDetection::MainPage::InitBtn_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
    // load Image and Init recognizer
    cv::Mat image = cv::imread("Assets/group1.jpg");
    groupFaces = cv::Mat(image.rows, image.cols, CV_8UC4);
    cv::cvtColor(image, groupFaces, CV_BGR2BGRA);
    cv::winrt_initContainer(cvContainer);
    cv::imshow(window_name, groupFaces);

    if (!face_cascade.load(face_cascade_name)) {
        Windows::UI::Popups::MessageDialog("Couldn't load face detector \n").ShowAsync();
    }
}

void FaceDetection::MainPage::detectBtn_Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
{
    if (!groupFaces.empty()) {
        std::vector<cv::Rect> facesColl;
        cv::Mat frame_gray;

        cvtColor(groupFaces, frame_gray, CV_BGR2GRAY);
        cv::equalizeHist(frame_gray, frame_gray);

        // Detect faces
        face_cascade.detectMultiScale(frame_gray, facesColl, 1.1, 2, 0 | CV_HAAR_SCALE_IMAGE, cv::Size(1, 1));
        for (unsigned int i = 0; i < facesColl.size(); i++)
        {
            auto face = facesColl[i];
            cv::rectangle(groupFaces, face, cv::Scalar(0, 255, 255), 5);
        }

        cv::imshow(window_name, groupFaces);
    } else {
        Windows::UI::Popups::MessageDialog("Initialize image before processing \n").ShowAsync();
    }
}


text:
{{#option "`--release`"}}
{{actionverb}} optimized artifacts with the `release` profile. See the
[PROFILES](#profiles) section for details on how this affects profile
selection.
{{/option}}


text:
package libcore.javax.net.ssl;

import java.util.Arrays;
import javax.net.ssl.SSLParameters;
import junit.framework.TestCase;

public class SSLParametersTest extends TestCase {

    public void test_SSLParameters_emptyConstructor() {
        SSLParameters p = new SSLParameters();
        assertNull(p.getCipherSuites());
        assertNull(p.getProtocols());
        assertFalse(p.getWantClientAuth());
        assertFalse(p.getNeedClientAuth());
    }

    public void test_SSLParameters_cipherSuitesConstructor() {
        String[] cipherSuites = new String[] { "foo", null, "bar" };
        SSLParameters p = new SSLParameters(cipherSuites);
        assertNotNull(p.getCipherSuites());
        assertNotSame(cipherSuites, p.getCipherSuites());
        assertEquals(Arrays.asList(cipherSuites), Arrays.asList(p.getCipherSuites()));
        assertNull(p.getProtocols());
        assertFalse(p.getWantClientAuth());
        assertFalse(p.getNeedClientAuth());
    }

    public void test_SSLParameters_cpherSuitesProtocolsConstructor() {
        String[] cipherSuites = new String[] { "foo", null, "bar" };
        String[] protocols = new String[] { "baz", null, "qux" };
        SSLParameters p = new SSLParameters(cipherSuites, protocols);
        assertNotNull(p.getCipherSuites());
        assertNotNull(p.getProtocols());
        assertNotSame(cipherSuites, p.getCipherSuites());
        assertNotSame(protocols, p.getProtocols());
        assertEquals(Arrays.asList(cipherSuites), Arrays.asList(p.getCipherSuites()));
        assertEquals(Arrays.asList(protocols), Arrays.asList(p.getProtocols()));
        assertFalse(p.getWantClientAuth());
        assertFalse(p.getNeedClientAuth());
    }

    public void test_SSLParameters_CipherSuites() {
        SSLParameters p = new SSLParameters();
        assertNull(p.getCipherSuites());

        // confirm clone on input
        String[] cipherSuites = new String[] { "fnord" };
        String[] copy = cipherSuites.clone();
        p.setCipherSuites(copy);
        copy[0] = null;
        assertEquals(Arrays.asList(cipherSuites), Arrays.asList(p.getCipherSuites()));

        // confirm clone on output
        assertNotSame(p.getCipherSuites(), p.getCipherSuites());
    }

    public void test_SSLParameters_Protocols() {
        SSLParameters p = new SSLParameters();
        assertNull(p.getProtocols());

        // confirm clone on input
        String[] protocols = new String[] { "fnord" };
        String[] copy = protocols.clone();
        p.setProtocols(copy);
        copy[0] = null;
        assertEquals(Arrays.asList(protocols), Arrays.asList(p.getProtocols()));

        // confirm clone on output
        assertNotSame(p.getProtocols(), p.getProtocols());
    }

    public void test_SSLParameters_ClientAuth() {
        SSLParameters p = new SSLParameters();
        assertFalse(p.getWantClientAuth());
        assertFalse(p.getNeedClientAuth());

        // confirm turning one on by itself
        p.setWantClientAuth(true);
        assertTrue(p.getWantClientAuth());
        assertFalse(p.getNeedClientAuth());

        // confirm turning setting on toggles the other
        p.setNeedClientAuth(true);
        assertFalse(p.getWantClientAuth());
        assertTrue(p.getNeedClientAuth());

        // confirm toggling back
        p.setWantClientAuth(true);
        assertTrue(p.getWantClientAuth());
        assertFalse(p.getNeedClientAuth());
    }
}


text:
package udp

import (
	"bytes"
	"encoding/binary"
	"errors"
)

// Packet represents the base parameters for a UDP tracker connection
type Packet struct {
	ConnID  uint64
	Action  uint32
	TransID uint32
}

// UnmarshalBinary creates a Packet from a packed byte array
func (u *Packet) UnmarshalBinary(buf []byte) (err error) {
	// Set up recovery function to catch a panic as an error
	// This will run if we attempt to access an out of bounds index
	defer func() {
		if r := recover(); r != nil {
			err = errors.New("failed to create Packet from bytes")
		}
	}()

	// ConnID (uint64)
	u.ConnID = binary.BigEndian.Uint64(buf[0:8])

	// Action (uint32, connect: 0, announce: 1, scrape: 2, error: 3)
	u.Action = binary.BigEndian.Uint32(buf[8:12])

	// TransID (uint32)
	u.TransID = binary.BigEndian.Uint32(buf[12:16])

	return nil
}

// MarshalBinary creates a packed byte array from a Packet
func (u Packet) MarshalBinary() ([]byte, error) {
	res := bytes.NewBuffer(make([]byte, 0))

	// ConnID (uint64)
	if err := binary.Write(res, binary.BigEndian, u.ConnID); err != nil {
		return nil, err
	}

	// Action (uint32, connect: 0, announce: 1, scrape: 2, error: 3)
	if err := binary.Write(res, binary.BigEndian, u.Action); err != nil {
		return nil, err
	}

	// TransID (uint32)
	if err := binary.Write(res, binary.BigEndian, u.TransID); err != nil {
		return nil, err
	}

	return res.Bytes(), nil
}


text:
// an example of output dependence preventing parallelization
// x: not live-in, yes live-out
//    outer scope
//    loop-carried output-dependence: x=... : accept values based on loop variable; or not.
//Solution: Can be parallelized using lastprivate(x)
#include <stdio.h>

void foo()
{
  int i;
  int x;

#pragma omp parallel for private (i) lastprivate (x)
  for (i = 0; i <= 99; i += 1) {
    x = i;
  }
  printf("x=%d",x);
}
/*
 * output dependence, loop carried
 * 1*1  SCALAR_DEP DATA_DEP; commonlevel = 1 CarryLevel = 0 Scalar dep type  OUTPUT_DEP DATA_DEP;SgVarRefExp:x@12:6->SgVarRefExp:x@12:6 == 0;||::
 */
// This x should be not lastprivate since it is live-in
// x is both live-in and live-out, and written, cannot be reduction
// So, the loop cannot be parallelized

void foo2()
{
  int a[100];
  int i;
  int x = 10;
  for (i = 0; i <= 99; i += 1) {
    a[i] = x;
    x = i;
  }
  printf("x=%d",x);
}


text:
<!doctype html>

	<meta charset="utf-8">
	<title>TextureOptions | paintgl</title>
	<meta name="description" content="">
	<link href="https://fonts.googleapis.com/css?family=Inconsolata:400,700" rel="stylesheet">
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
	<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.7.0/styles/tomorrow.min.css">
	<link rel="stylesheet" href="../assets/styles.css">

		paintgl

				Globals

				Canvas<wbr>Draw<wbr>Target

				Color

				Color<wbr>Shader

				Context

				Draw<wbr>Target

				Quad<wbr>Shape

				Rect<wbr>Shape

				Shader

				Shader<wbr>Base

				Shape

				Shape<wbr>Base

				Texture

				Texture<wbr>Draw<wbr>Target

				Texture<wbr>Shader

				Context<wbr>Capabilities

				Context<wbr>Options

				Drawable

				Object<wbr>Map

				Texture<wbr>Options

						data

						filter

						image

						pixel<wbr>Format

						pixel<wbr>Type

						size

				Blend<wbr>Mode

				Image<wbr>Source

				Pixel<wbr>Format

				Pixel<wbr>Type

				Shape<wbr>Usage

				Texture<wbr>Filter

				Uniform<wbr>Value

				blend<wbr>Funcs

				gl<wbr>Format

				gl<wbr>Type

				gl<wbr>Usage

TextureOptions

Hierarchy

Properties

data: ArrayBufferView

filter: TextureFilter

image: ImageSource

pixel<wbr>Format: PixelFormat

pixel<wbr>Type: PixelType

size: Vec2


text:
package org.uberfire.client.views.pfly.notifications;

import java.util.ArrayList;
import java.util.List;

import javax.enterprise.context.Dependent;

import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.IsWidget;
import com.google.gwt.user.client.ui.Widget;

import org.uberfire.client.workbench.widgets.animations.LinearFadeOutAnimation;
import org.uberfire.client.workbench.widgets.notifications.NotificationManager;
import org.uberfire.client.workbench.widgets.notifications.NotificationManager.NotificationPopupHandle;
import org.uberfire.commons.validation.PortablePreconditions;
import org.uberfire.workbench.events.NotificationEvent;

@Dependent
public class NotificationPopupsManagerView implements NotificationManager.View {

    //When true we are in the process of removing a notification message
    private boolean removing = false;

    private final int SPACING = 48;
    private int initialSpacing = SPACING;

    private IsWidget container;

    private final List<PopupHandle> activeNotifications = new ArrayList<PopupHandle>();

    private final List<PopupHandle> pendingRemovals = new ArrayList<PopupHandle>();

    private static class PopupHandle implements NotificationPopupHandle {

        final NotificationPopupView view;
        final NotificationEvent event;

        PopupHandle( NotificationPopupView view,
                     NotificationEvent event ) {
            this.view = PortablePreconditions.checkNotNull( "view", view );
            this.event = PortablePreconditions.checkNotNull( "event", event );
        }
    }

    @Override
    public void setContainer( final IsWidget container ) {
        this.container = PortablePreconditions.checkNotNull( "container", container );
    }

    @Override
    public void setInitialSpacing( int spacing ) {
        this.initialSpacing = spacing;
    }

    @Override
    public NotificationPopupHandle show( NotificationEvent event,
                                         Command hideCommand ) {
        if ( container == null ) {
            throw new IllegalStateException( "The setContainer() method hasn't been called!" );
        }

        final NotificationPopupView view = new NotificationPopupView();
        final PopupHandle popupHandle = new PopupHandle( view,
                                                         event );
        activeNotifications.add( popupHandle );
        int size = activeNotifications.size();
        int topMargin = (size == 1) ? initialSpacing : (size * SPACING) - (SPACING - initialSpacing);
        view.setPopupPosition( getLeftPosition( container.asWidget() ) + getMargin(),
                               getTopPosition( container.asWidget() ) + topMargin );
        view.setNotification( event.getNotification() );
        view.setType( event.getType() );
        view.setNotificationWidth( getWidth() + "px" );
        view.show( hideCommand );
        return popupHandle;
    }

    private int getTopPosition( final Widget widget ) {
        int top = widget.getAbsoluteTop();
        // if top is negative (due to scrolling) we try to align with the parent
        // to make sure the notifications are always visible
        if ( top < 0 && widget.getParent() != null ) {
            top = getTopPosition( widget.getParent() );
        }
        return Math.max(top, 0);
    }

    private int getLeftPosition( final Widget widget ) {
        int left = widget.getAbsoluteLeft();
        // if left is negative (due to scrolling) we try to align with the parent
        // to make sure the notifications are always visible
        if ( left < 0 && widget.getParent() != null ) {
            left = getLeftPosition( widget.getParent() );
        }
        return Math.max(left, 0);
    }

    @Override
    public void hide( final NotificationPopupHandle handle ) {
        if ( container == null ) {
            throw new IllegalStateException( "The setContainer() method hasn't been called!" );
        }

        final int removingIndex = activeNotifications.indexOf( handle );
        if ( removingIndex == -1 ) {
            return;
        }
        if ( removing ) {
            pendingRemovals.add( (PopupHandle) handle );
            return;
        }
        removing = true;
        final NotificationPopupView view = ( (PopupHandle) handle ).view;
        final LinearFadeOutAnimation fadeOutAnimation = new LinearFadeOutAnimation( view ) {
            @Override
            public void onUpdate( double progress ) {
                super.onUpdate( progress );
                for ( int i = removingIndex; i < activeNotifications.size(); i++ ) {
                    NotificationPopupView v = activeNotifications.get( i ).view;
                    final int left = v.getPopupLeft();
                    final int top = (int) ( ( ( i + 1 ) * SPACING ) - ( progress * SPACING ) )
                            - (SPACING - initialSpacing) + getTopPosition( container.asWidget() );
                    v.setPopupPosition( left,
                                        top );
                }
            }

            @Override
            public void onComplete() {
                super.onComplete();
                view.hide();
                activeNotifications.remove( handle );
                removing = false;
                if ( pendingRemovals.size() > 0 ) {
                    PopupHandle popupHandle = pendingRemovals.remove( 0 );
                    hide( popupHandle );
                }
            }

        };
        fadeOutAnimation.run( 500 );
    }

    @Override
    public void hideAll() {
        for ( NotificationPopupHandle handle : activeNotifications ) {
            hide( handle );
        }
    }

    @Override
    public boolean isShowing( NotificationEvent event ) {
        for ( PopupHandle handle : activeNotifications ) {
            if ( handle.event.equals( event ) ) {
                return true;
            }
        }
        return false;
    }

    //80% of container width
    private int getWidth() {
        return (int) ( container.asWidget().getElement().getClientWidth() * 0.8 );
    }

    //10% of container width
    private int getMargin() {
        return ( container.asWidget().getElement().getClientWidth() - getWidth() ) / 2;
    }

}


text:
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

exports.__esModule = true;
exports.initStarter = initStarter;

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));

var _betterOpn = _interopRequireDefault(require("better-opn"));

var _child_process = require("child_process");

var _execa = _interopRequireDefault(require("execa"));

var _fsExistsCached = require("fs-exists-cached");

var _fsExtra = _interopRequireDefault(require("fs-extra"));

var _gatsbyTelemetry = require("gatsby-telemetry");

var _hostedGitInfo = _interopRequireDefault(require("hosted-git-info"));

var _isValidPath = _interopRequireDefault(require("is-valid-path"));

var _path = _interopRequireDefault(require("path"));

var _prompts = _interopRequireDefault(require("prompts"));

var _url = _interopRequireDefault(require("url"));

var _reporter = _interopRequireDefault(require("./reporter"));

var _packageManager = require("./util/package-manager");

var _isTty = require("./util/is-tty");

const spawnWithArgs = (file, args, options) => (0, _execa.default)(file, args, Object.assign({
  stdio: `inherit`,
  preferLocal: false
}, options));

const spawn = (cmd, options) => {
  const _cmd$split = cmd.split(/\s+/),
        file = _cmd$split[0],
        args = _cmd$split.slice(1);

  return spawnWithArgs(file, args, options);
}; // Checks the existence of yarn package and user preference if it exists
// We use yarnpkg instead of yarn to avoid conflict with Hadoop yarn
// Refer to https://github.com/yarnpkg/yarn/issues/673

const shouldUseYarn = /*#__PURE__*/function () {
  var _ref = (0, _asyncToGenerator2.default)(function* () {
    try {
      (0, _child_process.execSync)(`yarnpkg --version`, {
        stdio: `ignore`
      });
      let packageManager = (0, _packageManager.getPackageManager)();

      if (!packageManager) {
        // if package manager is not set:
        //  - prompt user to pick package manager if in interactive console
        //  - default to yarn if not in interactive console
        if ((0, _isTty.isTTY)()) {
          packageManager = (yield (0, _packageManager.promptPackageManager)()) || `yarn`;
        } else {
          packageManager = `yarn`;
        }
      }

      return packageManager === `yarn`;
    } catch (e) {
      return false;
    }
  });

  return function shouldUseYarn() {
    return _ref.apply(this, arguments);
  };
}();

const isAlreadyGitRepository = /*#__PURE__*/function () {
  var _ref2 = (0, _asyncToGenerator2.default)(function* () {
    try {
      return yield spawn(`git rev-parse --is-inside-work-tree`, {
        stdio: `pipe`
      }).then(output => output.stdout === `true`);
    } catch (err) {
      return false;
    }
  });

  return function isAlreadyGitRepository() {
    return _ref2.apply(this, arguments);
  };
}(); // Initialize newly cloned directory as a git repo

const gitInit = /*#__PURE__*/function () {
  var _ref3 = (0, _asyncToGenerator2.default)(function* (rootPath) {
    _reporter.default.info(`Initialising git in ${rootPath}`);

    return yield spawn(`git init`, {
      cwd: rootPath
    });
  });

  return function gitInit(_x) {
    return _ref3.apply(this, arguments);
  };
}(); // Create a .gitignore file if it is missing in the new directory

const maybeCreateGitIgnore = /*#__PURE__*/function () {
  var _ref4 = (0, _asyncToGenerator2.default)(function* (rootPath) {
    if ((0, _fsExistsCached.sync)(_path.default.join(rootPath, `.gitignore`))) {
      return;
    }

    _reporter.default.info(`Creating minimal .gitignore in ${rootPath}`);

    yield _fsExtra.default.writeFile(_path.default.join(rootPath, `.gitignore`), `.cache\nnode_modules\npublic\n`);
  });

  return function maybeCreateGitIgnore(_x2) {
    return _ref4.apply(this, arguments);
  };
}(); // Create an initial git commit in the new directory

const createInitialGitCommit = /*#__PURE__*/function () {
  var _ref5 = (0, _asyncToGenerator2.default)(function* (rootPath, starterUrl) {
    _reporter.default.info(`Create initial git commit in ${rootPath}`);

    yield spawn(`git add -A`, {
      cwd: rootPath
    }); // use execSync instead of spawn to handle git clients using
    // pgp signatures (with password)

    try {
      (0, _child_process.execSync)(`git commit -m "Initial commit from gatsby: (${starterUrl})"`, {
        cwd: rootPath
      });
    } catch (_unused) {
      // Remove git support if initial commit fails
      _reporter.default.info(`Initial git commit failed - removing git support\n`);

      _fsExtra.default.removeSync(_path.default.join(rootPath, `.git`));
    }
  });

  return function createInitialGitCommit(_x3, _x4) {
    return _ref5.apply(this, arguments);
  };
}(); // Executes `npm install` or `yarn install` in rootPath.

const install = /*#__PURE__*/function () {
  var _ref6 = (0, _asyncToGenerator2.default)(function* (rootPath) {
    const prevDir = process.cwd();

    _reporter.default.info(`Installing packages...`);

    process.chdir(rootPath);

    try {
      if (yield shouldUseYarn()) {
        yield _fsExtra.default.remove(`package-lock.json`);
        yield spawn(`yarnpkg`);
      } else {
        yield _fsExtra.default.remove(`yarn.lock`);
        yield spawn(`npm install`);
      }
    } finally {
      process.chdir(prevDir);
    }
  });

  return function install(_x5) {
    return _ref6.apply(this, arguments);
  };
}();

const ignored = path => !/^\.(git|hg)$/.test(_path.default.basename(path)); // Copy starter from file system.

const copy = /*#__PURE__*/function () {
  var _ref7 = (0, _asyncToGenerator2.default)(function* (starterPath, rootPath) {
    // Chmod with 755.
    // 493 = parseInt('755', 8)
    yield _fsExtra.default.ensureDir(rootPath, {
      mode: 493
    });

    if (!(0, _fsExistsCached.sync)(starterPath)) {
      throw new Error(`starter ${starterPath} doesn't exist`);
    }

    if (starterPath === `.`) {
      throw new Error(`You can't create a starter from the existing directory. If you want to
      create a new site in the current directory, the trailing dot isn't
      necessary. If you want to create a new site from a local starter, run
      something like "gatsby new new-gatsby-site ../my-gatsby-starter"`);
    }

    _reporter.default.info(`Creating new site from local starter: ${starterPath}`);

    _reporter.default.log(`Copying local starter to ${rootPath} ...`);

    yield _fsExtra.default.copy(starterPath, rootPath, {
      filter: ignored
    });

    _reporter.default.success(`Created starter directory layout`);

    yield install(rootPath);
    return true;
  });

  return function copy(_x6, _x7) {
    return _ref7.apply(this, arguments);
  };
}(); // Clones starter from URI.

const clone = /*#__PURE__*/function () {
  var _ref8 = (0, _asyncToGenerator2.default)(function* (hostInfo, rootPath) {
    let url; // Let people use private repos accessed over SSH.

    if (hostInfo.getDefaultRepresentation() === `sshurl`) {
      url = hostInfo.ssh({
        noCommittish: true
      }); // Otherwise default to normal git syntax.
    } else {
      url = hostInfo.https({
        noCommittish: true,
        noGitPlus: true
      });
    }

    const branch = hostInfo.committish ? [`-b`, hostInfo.committish] : [];

    _reporter.default.info(`Creating new site from git: ${url}`);

    const args = [`clone`, ...branch, url, rootPath, `--depth=1`].filter(arg => Boolean(arg));
    yield spawnWithArgs(`git`, args);

    _reporter.default.success(`Created starter directory layout`);

    yield _fsExtra.default.remove(_path.default.join(rootPath, `.git`));
    yield install(rootPath);
    const isGit = yield isAlreadyGitRepository();
    if (!isGit) yield gitInit(rootPath);
    yield maybeCreateGitIgnore(rootPath);
    if (!isGit) yield createInitialGitCommit(rootPath, url);
  });

  return function clone(_x8, _x9) {
    return _ref8.apply(this, arguments);
  };
}();

const getPaths = /*#__PURE__*/function () {
  var _ref9 = (0, _asyncToGenerator2.default)(function* (starterPath, rootPath) {
    let selectedOtherStarter = false; // if no args are passed, prompt user for path and starter

    if (!starterPath && !rootPath) {
      const response = yield _prompts.default.prompt([{
        type: `text`,
        name: `path`,
        message: `What is your project called?`,
        initial: `my-gatsby-project`
      }, {
        type: `select`,
        name: `starter`,
        message: `What starter would you like to use?`,
        choices: [{
          title: `gatsby-starter-default`,
          value: `gatsby-starter-default`
        }, {
          title: `gatsby-starter-hello-world`,
          value: `gatsby-starter-hello-world`
        }, {
          title: `gatsby-starter-blog`,
          value: `gatsby-starter-blog`
        }, {
          title: `(Use a different starter)`,
          value: `different`
        }],
        initial: 0
      }]); // exit gracefully if responses aren't provided

      if (!response.starter || !response.path.trim()) {
        throw new Error(`Please mention both starter package and project name along with path(if its not in the root)`);
      }

      selectedOtherStarter = response.starter === `different`;
      starterPath = `gatsbyjs/${response.starter}`;
      rootPath = response.path;
    } // set defaults if no root or starter has been set yet

    rootPath = rootPath || process.cwd();
    starterPath = starterPath || `gatsbyjs/gatsby-starter-default`;
    return {
      starterPath,
      rootPath,
      selectedOtherStarter
    };
  });

  return function getPaths(_x10, _x11) {
    return _ref9.apply(this, arguments);
  };
}();

const successMessage = path => {
  _reporter.default.info(`
Your new Gatsby site has been successfully bootstrapped. Start developing it by running:

  cd ${path}
  gatsby develop
`);
};
/**
 * Main function that clones or copies the starter.
 */

function initStarter(_x12, _x13) {
  return _initStarter.apply(this, arguments);
}

function _initStarter() {
  _initStarter = (0, _asyncToGenerator2.default)(function* (starter, options) {
    const _ref10 = yield getPaths(starter, options.rootPath),
          starterPath = _ref10.starterPath,
          rootPath = _ref10.rootPath,
          selectedOtherStarter = _ref10.selectedOtherStarter;

    const urlObject = _url.default.parse(rootPath);

    if (selectedOtherStarter) {
      _reporter.default.info(`Opening the starter library at https://gatsby.dev/starters?v=2...\nThe starter library has a variety of options for starters you can browse\n\nYou can then use the gatsby new command with the link to a repository of a starter you'd like to use, for example:\ngatsby new ${rootPath} https://github.com/gatsbyjs/gatsby-starter-default`);

      (0, _betterOpn.default)(`https://gatsby.dev/starters?v=2`);
      return;
    }

    if (urlObject.protocol && urlObject.host) {
      (0, _gatsbyTelemetry.trackError)(`NEW_PROJECT_NAME_MISSING`);
      const isStarterAUrl = starter && !_url.default.parse(starter).hostname && !_url.default.parse(starter).protocol;

      if (/gatsby-starter/gi.test(rootPath) && isStarterAUrl) {
        _reporter.default.panic({
          id: `11610`,
          context: {
            starter,
            rootPath
          }
        });

        return;
      }

      _reporter.default.panic({
        id: `11611`,
        context: {
          rootPath
        }
      });

      return;
    }

    if (!(0, _isValidPath.default)(rootPath)) {
      _reporter.default.panic({
        id: `11612`,
        context: {
          path: _path.default.resolve(rootPath)
        }
      });

      return;
    }

    if ((0, _fsExistsCached.sync)(_path.default.join(rootPath, `package.json`))) {
      (0, _gatsbyTelemetry.trackError)(`NEW_PROJECT_IS_NPM_PROJECT`);

      _reporter.default.panic({
        id: `11613`,
        context: {
          rootPath
        }
      });

      return;
    }

    const hostedInfo = _hostedGitInfo.default.fromUrl(starterPath);

    (0, _gatsbyTelemetry.trackCli)(`NEW_PROJECT`, {
      starterName: hostedInfo ? hostedInfo.shortcut() : `local:starter`
    });
    if (hostedInfo) yield clone(hostedInfo, rootPath);else yield copy(starterPath, rootPath);
    successMessage(rootPath);
    (0, _gatsbyTelemetry.trackCli)(`NEW_PROJECT_END`);
  });
  return _initStarter.apply(this, arguments);
}