text:
package org.educando.app.model;

import java.io.Serializable;

import javax.persistence.*;

import com.fasterxml.jackson.annotation.JsonIgnore;

import java.util.Date;
import java.util.List;

/**
 * The persistent class for the clase database table.
 *
 */
@Entity
@NamedQuery(name="Clase.findAll", query="SELECT c FROM Clase c")
public class Clase implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue
	@Column(name="id_clase")
	private Integer idClase;

//	@Temporal(TemporalType.DATE)
	@Column(name="clase_ffin")
	private Date claseFfin;

//	@Temporal(TemporalType.DATE)
	@Column(name="clase_finicio")
	private Date claseFinicio;

	@Column(name="clase_nhinclusivos")
	private Integer claseNhinclusivos;

	@Column(name="clase_nhombres")
	private Integer claseNhombres;

	@Column(name="clase_nminclusivos")
	private Integer claseNminclusivos;

	@Column(name="clase_nmujeres")
	private Integer claseNmujeres;

	//bi-directional many-to-one association to ACargo
	@OneToMany(mappedBy="clase", fetch=FetchType.EAGER)
	private List<ACargo> ACargos;

	//bi-directional many-to-one association to PeriodoAcademico
	@ManyToOne
	@JoinColumn(name="id_periodo")
	private PeriodoAcademico periodoAcademico;

	//bi-directional many-to-one association to Seccion
	@ManyToOne
	@JoinColumn(name="id_seccion")
	private Seccion seccion;

	//bi-directional many-to-one association to Turno
	@ManyToOne
	@JoinColumn(name="id_turno")
	private Turno turno;

	//bi-directional many-to-many association to Desenvuelve
	@JsonIgnore
	@ManyToMany(mappedBy="clases")
	private List<Desenvuelve> desenvuelves;

	//bi-directional many-to-one association to Evaluacion
	@JsonIgnore
	@OneToMany(mappedBy="clase")
	private List<Evaluacion> evaluacions;

	public Clase() {
	}

	public Integer getIdClase() {
		return this.idClase;
	}

	public void setIdClase(Integer idClase) {
		this.idClase = idClase;
	}

	public Date getClaseFfin() {
		return this.claseFfin;
	}

	public void setClaseFfin(Date claseFfin) {
		this.claseFfin = claseFfin;
	}

	public Date getClaseFinicio() {
		return this.claseFinicio;
	}

	public void setClaseFinicio(Date claseFinicio) {
		this.claseFinicio = claseFinicio;
	}

	public Integer getClaseNhinclusivos() {
		return this.claseNhinclusivos;
	}

	public void setClaseNhinclusivos(Integer claseNhinclusivos) {
		this.claseNhinclusivos = claseNhinclusivos;
	}

	public Integer getClaseNhombres() {
		return this.claseNhombres;
	}

	public void setClaseNhombres(Integer claseNhombres) {
		this.claseNhombres = claseNhombres;
	}

	public Integer getClaseNminclusivos() {
		return this.claseNminclusivos;
	}

	public void setClaseNminclusivos(Integer claseNminclusivos) {
		this.claseNminclusivos = claseNminclusivos;
	}

	public Integer getClaseNmujeres() {
		return this.claseNmujeres;
	}

	public void setClaseNmujeres(Integer claseNmujeres) {
		this.claseNmujeres = claseNmujeres;
	}

	public List<ACargo> getACargos() {
		return this.ACargos;
	}

	public void setACargos(List<ACargo> ACargos) {
		this.ACargos = ACargos;
	}

	public ACargo addACargo(ACargo ACargo) {
		getACargos().add(ACargo);
		ACargo.setClase(this);

		return ACargo;
	}

	public ACargo removeACargo(ACargo ACargo) {
		getACargos().remove(ACargo);
		ACargo.setClase(null);

		return ACargo;
	}

	public PeriodoAcademico getPeriodoAcademico() {
		return this.periodoAcademico;
	}

	public void setPeriodoAcademico(PeriodoAcademico periodoAcademico) {
		this.periodoAcademico = periodoAcademico;
	}

	public Seccion getSeccion() {
		return this.seccion;
	}

	public void setSeccion(Seccion seccion) {
		this.seccion = seccion;
	}

	public Turno getTurno() {
		return this.turno;
	}

	public void setTurno(Turno turno) {
		this.turno = turno;
	}

	public List<Desenvuelve> getDesenvuelves() {
		return this.desenvuelves;
	}

	public void setDesenvuelves(List<Desenvuelve> desenvuelves) {
		this.desenvuelves = desenvuelves;
	}

	public List<Evaluacion> getEvaluacions() {
		return this.evaluacions;
	}

	public void setEvaluacions(List<Evaluacion> evaluacions) {
		this.evaluacions = evaluacions;
	}

	public Evaluacion addEvaluacion(Evaluacion evaluacion) {
		getEvaluacions().add(evaluacion);
		evaluacion.setClase(this);

		return evaluacion;
	}

	public Evaluacion removeEvaluacion(Evaluacion evaluacion) {
		getEvaluacions().remove(evaluacion);
		evaluacion.setClase(null);

		return evaluacion;
	}

}


text:
#include <aws/lexv2-models/model/IntentConfirmationSetting.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace LexModelsV2
{
namespace Model
{

IntentConfirmationSetting::IntentConfirmationSetting() :
    m_promptSpecificationHasBeenSet(false),
    m_declinationResponseHasBeenSet(false),
    m_active(false),
    m_activeHasBeenSet(false),
    m_confirmationResponseHasBeenSet(false),
    m_confirmationNextStepHasBeenSet(false),
    m_confirmationConditionalHasBeenSet(false),
    m_declinationNextStepHasBeenSet(false),
    m_declinationConditionalHasBeenSet(false),
    m_failureResponseHasBeenSet(false),
    m_failureNextStepHasBeenSet(false),
    m_failureConditionalHasBeenSet(false),
    m_codeHookHasBeenSet(false),
    m_elicitationCodeHookHasBeenSet(false)
{
}

IntentConfirmationSetting::IntentConfirmationSetting(JsonView jsonValue) :
    m_promptSpecificationHasBeenSet(false),
    m_declinationResponseHasBeenSet(false),
    m_active(false),
    m_activeHasBeenSet(false),
    m_confirmationResponseHasBeenSet(false),
    m_confirmationNextStepHasBeenSet(false),
    m_confirmationConditionalHasBeenSet(false),
    m_declinationNextStepHasBeenSet(false),
    m_declinationConditionalHasBeenSet(false),
    m_failureResponseHasBeenSet(false),
    m_failureNextStepHasBeenSet(false),
    m_failureConditionalHasBeenSet(false),
    m_codeHookHasBeenSet(false),
    m_elicitationCodeHookHasBeenSet(false)
{
  *this = jsonValue;
}

IntentConfirmationSetting& IntentConfirmationSetting::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("promptSpecification"))
  {
    m_promptSpecification = jsonValue.GetObject("promptSpecification");

    m_promptSpecificationHasBeenSet = true;
  }

  if(jsonValue.ValueExists("declinationResponse"))
  {
    m_declinationResponse = jsonValue.GetObject("declinationResponse");

    m_declinationResponseHasBeenSet = true;
  }

  if(jsonValue.ValueExists("active"))
  {
    m_active = jsonValue.GetBool("active");

    m_activeHasBeenSet = true;
  }

  if(jsonValue.ValueExists("confirmationResponse"))
  {
    m_confirmationResponse = jsonValue.GetObject("confirmationResponse");

    m_confirmationResponseHasBeenSet = true;
  }

  if(jsonValue.ValueExists("confirmationNextStep"))
  {
    m_confirmationNextStep = jsonValue.GetObject("confirmationNextStep");

    m_confirmationNextStepHasBeenSet = true;
  }

  if(jsonValue.ValueExists("confirmationConditional"))
  {
    m_confirmationConditional = jsonValue.GetObject("confirmationConditional");

    m_confirmationConditionalHasBeenSet = true;
  }

  if(jsonValue.ValueExists("declinationNextStep"))
  {
    m_declinationNextStep = jsonValue.GetObject("declinationNextStep");

    m_declinationNextStepHasBeenSet = true;
  }

  if(jsonValue.ValueExists("declinationConditional"))
  {
    m_declinationConditional = jsonValue.GetObject("declinationConditional");

    m_declinationConditionalHasBeenSet = true;
  }

  if(jsonValue.ValueExists("failureResponse"))
  {
    m_failureResponse = jsonValue.GetObject("failureResponse");

    m_failureResponseHasBeenSet = true;
  }

  if(jsonValue.ValueExists("failureNextStep"))
  {
    m_failureNextStep = jsonValue.GetObject("failureNextStep");

    m_failureNextStepHasBeenSet = true;
  }

  if(jsonValue.ValueExists("failureConditional"))
  {
    m_failureConditional = jsonValue.GetObject("failureConditional");

    m_failureConditionalHasBeenSet = true;
  }

  if(jsonValue.ValueExists("codeHook"))
  {
    m_codeHook = jsonValue.GetObject("codeHook");

    m_codeHookHasBeenSet = true;
  }

  if(jsonValue.ValueExists("elicitationCodeHook"))
  {
    m_elicitationCodeHook = jsonValue.GetObject("elicitationCodeHook");

    m_elicitationCodeHookHasBeenSet = true;
  }

  return *this;
}

JsonValue IntentConfirmationSetting::Jsonize() const
{
  JsonValue payload;

  if(m_promptSpecificationHasBeenSet)
  {
   payload.WithObject("promptSpecification", m_promptSpecification.Jsonize());

  }

  if(m_declinationResponseHasBeenSet)
  {
   payload.WithObject("declinationResponse", m_declinationResponse.Jsonize());

  }

  if(m_activeHasBeenSet)
  {
   payload.WithBool("active", m_active);

  }

  if(m_confirmationResponseHasBeenSet)
  {
   payload.WithObject("confirmationResponse", m_confirmationResponse.Jsonize());

  }

  if(m_confirmationNextStepHasBeenSet)
  {
   payload.WithObject("confirmationNextStep", m_confirmationNextStep.Jsonize());

  }

  if(m_confirmationConditionalHasBeenSet)
  {
   payload.WithObject("confirmationConditional", m_confirmationConditional.Jsonize());

  }

  if(m_declinationNextStepHasBeenSet)
  {
   payload.WithObject("declinationNextStep", m_declinationNextStep.Jsonize());

  }

  if(m_declinationConditionalHasBeenSet)
  {
   payload.WithObject("declinationConditional", m_declinationConditional.Jsonize());

  }

  if(m_failureResponseHasBeenSet)
  {
   payload.WithObject("failureResponse", m_failureResponse.Jsonize());

  }

  if(m_failureNextStepHasBeenSet)
  {
   payload.WithObject("failureNextStep", m_failureNextStep.Jsonize());

  }

  if(m_failureConditionalHasBeenSet)
  {
   payload.WithObject("failureConditional", m_failureConditional.Jsonize());

  }

  if(m_codeHookHasBeenSet)
  {
   payload.WithObject("codeHook", m_codeHook.Jsonize());

  }

  if(m_elicitationCodeHookHasBeenSet)
  {
   payload.WithObject("elicitationCodeHook", m_elicitationCodeHook.Jsonize());

  }

  return payload;
}

} // namespace Model
} // namespace LexModelsV2
} // namespace Aws

redpajama_set_name: RedPajamaGithub


text:
package org.unitils.core.spring;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestContext;
import org.unitils.core.UnitilsException;

import static org.junit.Assert.*;
import static org.unitils.core.spring.SpringTestListener.AccessibleTestContextManager;

/**
 * Note: there does not seem to be a way to mock a TestContext
 *
 * @author Tim Ducheyne
 */
public class SpringTestContextWrapperGetApplicationContextTest {

    /* Tested object */
    private SpringTestContextWrapper springTestContextWrapper;

    @Test
    public void getApplicationContext() throws Exception {
        TestContext testContext = createTestContext(TestClass1.class);
        springTestContextWrapper = new SpringTestContextWrapper(testContext);

        ApplicationContext result = springTestContextWrapper.getApplicationContext();

        assertNotNull(result);
    }

    @Test
    public void nullWhenThereIsNoContextConfiguration() throws Exception {
        TestContext testContext = createTestContext(TestClass2.class);
        springTestContextWrapper = new SpringTestContextWrapper(testContext);

        ApplicationContext result = springTestContextWrapper.getApplicationContext();

        assertNull(result);
    }

    @Test
    public void applicationContextIsCached() throws Exception {
        TestContext testContext = createTestContext(TestClass1.class);
        springTestContextWrapper = new SpringTestContextWrapper(testContext);

        ApplicationContext result1 = springTestContextWrapper.getApplicationContext();
        ApplicationContext result2 = springTestContextWrapper.getApplicationContext();

        assertSame(result1, result2);
    }

    @Test
    public void exceptionWhenUnableToLoadApplicationContext() throws Exception {
        TestContext testContext = createTestContext(TestClass3.class);
        springTestContextWrapper = new SpringTestContextWrapper(testContext);

        try {
            springTestContextWrapper.getApplicationContext();
            fail("UnitilsException expected");

        } catch (UnitilsException e) {
            assertEquals("Unable to load spring application context.\n" +
                    "Reason: IllegalStateException: Failed to load ApplicationContext", e.getMessage());
        }
    }

    private TestContext createTestContext(Class<?> testClass) {
        AccessibleTestContextManager accessibleTestContextManager1 = new AccessibleTestContextManager(testClass);
        return accessibleTestContextManager1.getContext();
    }

    @ContextConfiguration(locations = "empty-context.xml")
    private static class TestClass1 {
    }

    private static class TestClass2 {
    }

    @ContextConfiguration(locations = "xxx")
    @SuppressWarnings("SpringContextConfigurationInspection")
    private static class TestClass3 {
    }
}


text:
This library provides simplified performance, accuracy, and power monitoring.

See
[https://github.com/libheartbeats/heartbeats](https://github.com/libheartbeats/heartbeats)
for the original libraries that support shared memory and manage memory and
energy readers automatically.

## Building

This project uses CMake.

To build all libraries, run:

``` sh
mkdir _build
cd _build
cmake ..
make
```

## Installing

To install all libraries and headers, run with proper privileges:

``` sh
make install
```

On Linux, installation typically places libraries in `/usr/local/lib` and
header files in `/usr/local/include/heartbeats-simple`.

## Uninstalling

Install must be run before uninstalling in order to have a manifest.

To remove libraries and headers installed to the system, run with proper
privileges:

``` sh
make uninstall
```

## Cleaning

To cleanup build artifacts, run

``` sh
make clean
```


text:
<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;
use Illuminate\Support\Facades\Auth;

class UpdateGroup extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return Auth::check();
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name' => 'required',
            'price' => 'required',
            'sellable' => 'required'
        ];
    }
}


text:
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from livesettings import *
from satchmo_utils import is_string_like, load_module
from satchmo_store.shop import get_satchmo_setting

TAX_GROUP = ConfigurationGroup('TAX', _('Tax Settings'))
TAX_MODULE = config_register(StringValue(TAX_GROUP,
    'MODULE',
    description=_("Active tax module"),
    help_text=_("Select a module, save and reload to set any module-specific settings."),
    default="tax.modules.no",
    choices=[('tax.modules.no', _('No Tax')),
    ]
))

DEFAULT_VIEW_TAX = config_register(BooleanValue(TAX_GROUP,
    'DEFAULT_VIEW_TAX',
    description=_("Show with tax included"),
    help_text=_("If yes, then all products and the cart will display with tax included."),
    default=False
))

PRODUCTS_TAXABLE_BY_DEFAULT = config_register(BooleanValue(TAX_GROUP,
    'PRODUCTS_TAXABLE_BY_DEFAULT',
    description=_("New products are automatically made taxable"),
    help_text=_("Whether newly created products should be taxable by default."),
    default=False
))

TAX_AREA_ADDRESS = config_register(
        StringValue(TAX_GROUP,
        'TAX_AREA_ADDRESS',
        description=_("Should tax be calculated based on shipping or billing address?"),
        help_text=_("This will only be used if tax is calculated based on an address."),
        choices = (
            (('ship', 'Shipping')),
            (('bill', 'Billing')),
        ),
        default = 'ship')
        )

# --- Load any extra tax modules. ---
extra_tax = get_satchmo_setting('CUSTOM_TAX_MODULES')
for extra in extra_tax:
    try:
        load_module("%s.config" % extra)
    except ImportError:
        log.warn('Could not load tax module configuration: %s' % extra)


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Ascophanus subgranuliformis Rehm

### Remarks
null


text:
var tokenUtils = require("../util/tokenUtils");

var parserState = require("../parserState");
const StateEnum = parserState.StateEnum;

/**
 * Handles the single line comment:
 * shh [text]
 *
 * Produces:
 * // text
 */
function handleShh(parseContext) {
  tokenUtils.expectToken("shh", parseContext);

  var tokens = parseContext.tokens;

  // consume: shh
  tokens.shift();

  var statement = "// ";

  // preserve any spacing after 'shh '
  var input = parseContext.input;
  var shhLocation = input.indexOf("shh ");
  var commentText = input.substring(shhLocation + 4);
  statement += commentText;
  statement += "\n";

  // consume tokens so we don't reparse
  parseContext.tokens = [];

  return statement;
}

/**
 * Handles the beginning of a multi-line comment:
 * quiet [comments]
 *
 * Produces the start of a multi-line comment "/*"
 */
function handleQuiet(parseContext) {
  tokenUtils.expectToken("quiet", parseContext);

  var tokens = parseContext.tokens;

  // consume: quiet
  tokens.shift();

  parserState.pushState(StateEnum.MULTILINE_COMMENT);

  var statement = "/*";
  statement += tokenUtils.joinTokens(parseContext.tokens);
  statement += "\n";

  return statement;
}

/**
 * Handles the end of the multi-line comment:
 * loud
 *
 * Produces the end of a multiline comment "*\/"
 */
function handleLoud(parseContext) {
  tokenUtils.expectToken("loud", parseContext);

  var tokens = parseContext.tokens;

  if (!parserState.hasState(StateEnum.MULTILINE_COMMENT)) {
    throw new Error(
      "Unparseable syntax! Encountered: 'loud' without first seeing 'quiet'"
    );
  }

  // consume: loud
  tokens.shift();

  // Remove multicomment state
  parserState.popState();

  var statement = "*/";
  statement += tokenUtils.joinTokens(parseContext.tokens);
  statement += "\n";

  return statement;
}

module.exports = {
  handleShh,
  handleQuiet,
  handleLoud
};


text:
/**
 * Author: Alessio Placitelli
 * Contact: a.placitelli _@_ a2p.it
 *
 */

#ifndef _GPUImageAmatorkaFilter_h_
#define _GPUImageAmatorkaFilter_h_

#include "GPUImageFilterGroup.h"

// forward declarations
class PNGImageContainer;
class GPUImagePicture;

/** A photo filter based on Photoshop action by Amatorka
    http://amatorka.deviantart.com/art/Amatorka-Action-2-121069631
 */

// Note: If you want to use this effect you have to add lookup_amatorka.png
//       from Resources folder to your application bundle.

class GPUImageAmatorkaFilter : public GPUImageFilterGroup
{
public:
    GPUImageAmatorkaFilter();
    ~GPUImageAmatorkaFilter();

private:
    GPUImagePicture* lookupImageSource_;
};

#endif // _GPUImageAmatorkaFilter_h_


text:
package model

import (
	"io/ioutil"
	"path"
	"testing"

	"github.com/go-xiaohei/pugo/app/helper"
	. "github.com/smartystreets/goconvey/convey"
)

var (
	i18nBytes = []byte(`[meta]
title = "Title"
subtitle = "Subtitle"
link = "Link%s"

[nav]
docs = "docsabc"
guide = "guidexyz"
github = "git"`)
)

func TestMetaRead(t *testing.T) {
	Convey("ParseMeta", t, func() {
		for t, f := range ShouldMetaFiles() {
			file := path.Join("testdata", f)

			if t == FormatTOML {
				Convey("ParseMetaToml", func() {
					fileData, err := ioutil.ReadFile(file)
					if err != nil {
						So(err, ShouldBeNil)
						return
					}
					meta, err := NewMetaAll(fileData, FormatTOML)
					if err != nil {
						So(err, ShouldBeNil)
						return
					}

					So(meta.Meta.Title, ShouldEqual, "PuGo")
					So(meta.NavGroup, ShouldHaveLength, 4)
					So(meta.AuthorGroup, ShouldHaveLength, 2)
					So(meta.AuthorGroup[0].IsOwner, ShouldBeTrue)
					So(meta.Comment.IsOK(), ShouldBeTrue)

					Convey("NavGroup", func() {
						i18n, err := helper.NewI18n("en", i18nBytes, ".toml")
						So(err, ShouldBeNil)
						So(meta.NavGroup[0].Tr(i18n), ShouldEqual, "guidexyz")
						meta.NavGroup.SetPrefix("abc")
						So(meta.NavGroup[0].Link, ShouldEqual, "abc/guide.html")
						So(meta.NavGroup[0].TrLink(i18n), ShouldEqual, "/en/abc/guide.html")
						So(meta.NavGroup[3].TrLink(i18n), ShouldEqual, "https://github.com/go-xiaohei/pugo")
					})

					Convey("NavError", func() {
						ng := make(NavGroup, 0)
						ng = append(ng, &Nav{})
						err := ng.normalize()
						So(err, ShouldEqual, errNavInvalid)
					})
				})
			}

			if t == FormatINI {
				Convey("ParseMetaIni", func() {
					fileData, err := ioutil.ReadFile(file)
					if err != nil {
						So(err, ShouldBeNil)
						return
					}
					meta, err := NewMetaAll(fileData, FormatINI)
					if err != nil {
						So(err, ShouldBeNil)
						return
					}

					So(meta.Meta.Title, ShouldEqual, "PuGo")
					So(meta.NavGroup, ShouldHaveLength, 3)
					So(meta.AuthorGroup, ShouldHaveLength, 2)
					So(meta.AuthorGroup[0].IsOwner, ShouldBeTrue)
					So(meta.Comment.IsOK(), ShouldBeTrue)

					So(meta.Meta.DomainURL("/abc.html"), ShouldEqual, "http://pugo.io/docs/abc.html")
				})
			}
		}
	})

	Convey("ParseMetaError", t, func() {
		_, err := NewMetaAll([]byte("abc"), 0)
		So(err, ShouldEqual, errMetaUnsupport)

		meta := &Meta{}
		err = meta.normalize()
		So(err, ShouldEqual, errMetaInvalid)

		meta2 := &Meta{
			Title:  "pugo",
			Domain: "pugo.io",
		}
		err = meta2.normalize()
		So(err, ShouldBeNil)
	})
}


text:
//// Copyright (c) Microsoft Corporation. All rights reserved

(function () {
    "use strict";

    var sampleTitle = "Audio Category";

    var scenarios = [
        { url: "/html/movie.html", title: "Movie" },
        { url: "/html/media.html", title: "Media" },
        { url: "/html/gamechat.html", title: "GameChat" },
        { url: "/html/speech.html", title: "Speech" },
        { url: "/html/communications.html", title: "Communications" },
        { url: "/html/alerts.html", title: "Alerts" },
        { url: "/html/soundeffects.html", title: "SoundEffects" },
        { url: "/html/gameeffects.html", title: "GameEffects" },
        { url: "/html/gamemedia.html", title: "GameMedia" },
        { url: "/html/other.html", title: "Other" }

    ];

    WinJS.Namespace.define("SdkSample", {
        sampleTitle: sampleTitle,
        scenarios: new WinJS.Binding.List(scenarios)
    });
})();


text:
package com.zlu.leetcode.treeproblem;

public class SameTree {
	public boolean isSameTree(TreeNode p, TreeNode q) {
    	if(p == null && q == null) return true;
    	else if(p == null || q == null) return false;

    	if(p.val != q.val) return false;

    	return isSameTree(p.left, q.left) && isSameTree(p.right, q.right);
    }
}


text:
package com.datatorrent.bufferserver.client;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.datatorrent.bufferserver.packet.MessageType;
import com.datatorrent.bufferserver.packet.PurgeRequestTuple;
import com.datatorrent.bufferserver.packet.ResetRequestTuple;
import com.datatorrent.bufferserver.packet.Tuple;
import com.datatorrent.bufferserver.util.Codec;
import com.datatorrent.netlet.AbstractLengthPrependerClient;
import com.datatorrent.netlet.util.Slice;

/**
 *
Abstract Controller class.

 *
 * @since 0.3.2
 */
public abstract class Controller extends AuthClient
{
  String id;

  public Controller(String id)
  {
    super(1024, 1024);
    this.id = id;
  }

  public void purge(String version, String sourceId, long windowId)
  {
    sendAuthenticate();
    write(PurgeRequestTuple.getSerializedRequest(version, sourceId, windowId));
    logger.debug("Sent purge request sourceId = {}, windowId = {}", sourceId, Codec.getStringWindowId(windowId));
  }

  public void reset(String version, String sourceId, long windowId)
  {
    sendAuthenticate();
    write(ResetRequestTuple.getSerializedRequest(version, sourceId, windowId));
    logger.debug("Sent reset request sourceId = {}, windowId = {}", sourceId, Codec.getStringWindowId(windowId));
  }

  @Override
  public void onMessage(byte[] buffer, int offset, int size)
  {
    Tuple t = Tuple.getTuple(buffer, offset, size);
    assert (t.getType() == MessageType.PAYLOAD);
    Slice f = t.getData();
    onMessage(new String(f.buffer, f.offset, f.length));
  }

  public abstract void onMessage(String message);

  @Override
  public String toString()
  {
    return "Controller{" + "id=" + id + '}';
  }

  private static final Logger logger = LoggerFactory.getLogger(Controller.class);
}


text:
namespace {

// Creates SyncExplicitPassphraseClientLacros for |profile| if preconditions
// are met, returns nullptr otherwise. Preconditions are:
// 1. Sync passphrase sharing feature is enabled.
// 2. |profile| is the main profile.
// 3. SyncService crosapi is available.
// 4. Lacros SyncService exists (can be not created due to command line config).
std::unique_ptr<SyncExplicitPassphraseClientLacros>
MaybeCreateSyncExplicitPassphraseClient(Profile* profile) {
  if (!base::FeatureList::IsEnabled(
          syncer::kSyncChromeOSExplicitPassphraseSharing)) {
    return nullptr;
  }

  if (!profile->IsMainProfile())
    return nullptr;

  auto* lacros_service = chromeos::LacrosService::Get();
  if (!lacros_service->IsAvailable<crosapi::mojom::SyncService>())
    return nullptr;

  auto* sync_service = SyncServiceFactory::GetForProfile(profile);
  if (!sync_service)
    return nullptr;

  return std::make_unique<SyncExplicitPassphraseClientLacros>(
      sync_service, &lacros_service->GetRemote<crosapi::mojom::SyncService>());
}

}  // namespace

ChromeBrowserMainExtraPartsLacros::ChromeBrowserMainExtraPartsLacros() =
    default;
ChromeBrowserMainExtraPartsLacros::~ChromeBrowserMainExtraPartsLacros() =
    default;

void ChromeBrowserMainExtraPartsLacros::PostBrowserStart() {
  automation_manager_ = std::make_unique<AutomationManagerLacros>();
  browser_service_ = std::make_unique<BrowserServiceLacros>();
  butter_bar_ = std::make_unique<LacrosButterBar>();
  desk_template_client_ = std::make_unique<DeskTemplateClientLacros>();
  download_controller_client_ =
      std::make_unique<DownloadControllerClientLacros>();
  task_manager_provider_ = std::make_unique<crosapi::TaskManagerLacros>();
  kiosk_session_service_ = std::make_unique<KioskSessionServiceLacros>();
  web_page_info_provider_ =
      std::make_unique<crosapi::WebPageInfoProviderLacros>();
  screen_orientation_delegate_ =
      std::make_unique<ScreenOrientationDelegateLacros>();
  search_controller_ = std::make_unique<crosapi::SearchControllerLacros>();

  memory_pressure::MultiSourceMemoryPressureMonitor* monitor =
      static_cast<memory_pressure::MultiSourceMemoryPressureMonitor*>(
          base::MemoryPressureMonitor::Get());
  if (monitor) {
    monitor->SetSystemEvaluator(std::make_unique<LacrosMemoryPressureEvaluator>(
        monitor->CreateVoter()));
  }

  if (chromeos::LacrosService::Get()->init_params()->publish_chrome_apps) {
    extension_apps_publisher_ =
        std::make_unique<LacrosExtensionAppsPublisher>();
    extension_apps_publisher_->Initialize();
    extension_apps_controller_ =
        std::make_unique<LacrosExtensionAppsController>();
    extension_apps_controller_->Initialize(
        extension_apps_publisher_->publisher());
  }

  if (chromeos::LacrosService::Get()->init_params()->web_apps_enabled) {
    web_app_provider_bridge_ =
        std::make_unique<crosapi::WebAppProviderBridgeLacros>();
  }

#if !BUILDFLAG(IS_CHROMEOS_DEVICE)
  // The test controller is only created in test builds AND when Ash's test
  // controller service is available.
  auto* lacros_service = chromeos::LacrosService::Get();
  if (lacros_service->IsAvailable<crosapi::mojom::TestController>()) {
    int remote_version = lacros_service->GetInterfaceVersion(
        crosapi::mojom::TestController::Uuid_);
    if (static_cast<uint32_t>(remote_version) >=
        crosapi::mojom::TestController::
            kRegisterStandaloneBrowserTestControllerMinVersion) {
      auto& ash_test_controller =
          lacros_service->GetRemote<crosapi::mojom::TestController>();
      standalone_browser_test_controller_ =
          std::make_unique<StandaloneBrowserTestController>(
              ash_test_controller);
    }
  }
#endif

  // Construct ArcIconCache and set it to provider.
  arc_icon_cache_ = std::make_unique<ArcIconCache>();
  arc_icon_cache_->Start();
  arc_icon_cache_delegate_provider_ =
      std::make_unique<arc::ArcIconCacheDelegateProvider>(
          arc_icon_cache_.get());

  // Start Lacros' drive mount point path caching, since it is available in Ash.
  drivefs_cache_ = std::make_unique<DriveFsCache>();
  // After construction finishes, start caching.
  drivefs_cache_->Start();

  field_trial_observer_ = std::make_unique<FieldTrialObserver>();
  field_trial_observer_->Start();

  force_installed_tracker_ = std::make_unique<ForceInstalledTrackerLacros>();
  force_installed_tracker_->Start();

  metrics::structured::ChromeStructuredMetricsRecorder::Get()->Initialize();
}

void ChromeBrowserMainExtraPartsLacros::PostProfileInit(
    Profile* profile,
    bool is_initial_profile) {
  if (!sync_explicit_passphrase_client_) {
    sync_explicit_passphrase_client_ =
        MaybeCreateSyncExplicitPassphraseClient(profile);
  }
}


text:
package io.github.arsrabon.m.homerentalbd.activities;

import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;

import io.github.arsrabon.m.homerentalbd.R;
import io.github.arsrabon.m.homerentalbd.model.PostResponse;
import io.github.arsrabon.m.homerentalbd.rest.ApiClient;
import io.github.arsrabon.m.homerentalbd.rest.ApiInterface;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

public class SignUp_Activity extends AppCompatActivity {

    FirebaseAuth firebaseAuth;
    FirebaseUser firebaseUser;

    EditText edit_Username;
    EditText edit_Email;
    EditText edit_Password;
    EditText edit_ConfPassword;

    Button btn_SignUp;
    Button btn_skip;
    private ApiInterface apiService;

    String email;
    String username;
    String password;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sign_up);

        firebaseAuth = FirebaseAuth.getInstance();

        // initialize ApiInterface for use
        apiService = ApiClient.getClient().create(ApiInterface.class);

        edit_Username = (EditText) findViewById(R.id.edit_newUsername);
        edit_Email = (EditText) findViewById(R.id.edit_newUserEmail);
        edit_Password = (EditText) findViewById(R.id.edit_newUserPassword);
        edit_ConfPassword = (EditText) findViewById(R.id.edit_newUserconfPassword);

        btn_SignUp = (Button) findViewById(R.id.btn_signUp);
        btn_skip = (Button) findViewById(R.id.btn_goback);

        btn_SignUp.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Toast.makeText(getBaseContext(), "Please wait a bit!", Toast.LENGTH_SHORT).show();
                username = edit_Username.getText().toString();

                email = edit_Email.getText().toString();

                password = edit_Password.getText().toString();
                String confPassword = edit_ConfPassword.getText().toString();
                if (username.length() > 0 &&
                        email.length() > 10 &&
                        password.length() > 6 &&
                        confPassword.equals(password)) {

                    firebaseAuth.createUserWithEmailAndPassword(email,password).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
                        @Override
                        public void onComplete(@NonNull Task<AuthResult> task) {
                            if (!task.isSuccessful()){
                                Toast.makeText(SignUp_Activity.this, "Authentication failed." + task.getException(),
                                        Toast.LENGTH_SHORT).show();
                            }else {
                                firebaseUser = firebaseAuth.getCurrentUser();
                                Log.d("firebaseUser", "Email:" +firebaseUser.getEmail()+" UID:" +
                                        firebaseUser.getUid() +" displayName:"+ firebaseUser.getDisplayName());
                                addNewUserToDatabase(firebaseUser.getEmail(),firebaseUser.getUid(),username);
                                Intent intent = new Intent(SignUp_Activity.this,DefaultActivity.class);
                                startActivity(intent);
                                finish();
                            }
                        }
                    });
                }
            }
        });

    }

    private void addNewUserToDatabase(String email, String uid, String username) {
        Call<PostResponse> postResponseCall = apiService.createNewUser(uid,username,email);
        postResponseCall.enqueue(new Callback<PostResponse>() {
            @Override
            public void onResponse(Call<PostResponse> call, Response<PostResponse> response) {
                PostResponse postResponse = response.body();
            }

            @Override
            public void onFailure(Call<PostResponse> call, Throwable t) {

            }
        });
    }
}


text:
SOURCES = *.js
TESTS = test/*.test.js

# ==============================================================================
# Packaging
# ==============================================================================

build-browserify:
	mkdir -p build
	browserify -t deamdify render-mustache.js -o build/bundle.js

build-component: components
	component build -u component-amd

components:
	component install

# ==============================================================================
# Tests
# ==============================================================================

CHROME = open -a "Google Chrome"
FIREFOX = open -a "Firefox"
SAFARI = open -a "Safari"
PHANTOMJS = phantomjs

MOCHA_PHANTOMJS = ./node_modules/.bin/mocha-phantomjs
WWW_TESTS = test/www/index.html

test: test-phantomjs

test-chrome: test/www/js/lib
	$(CHROME) $(WWW_TESTS)

test-firefox: test/www/js/lib
	$(FIREFOX) $(WWW_TESTS)

test-safari: test/www/js/lib
	$(SAFARI) $(WWW_TESTS)

test-phantomjs: node_modules test/www/js/lib
	$(MOCHA_PHANTOMJS) $(WWW_TESTS)

# Prior to running tests on Sauce Labs, ensure that a local server is listening
# and Sauce Connect is tunneling requests to it.
#
#     $ java -jar Sauce-Connect.jar $SAUCE_LABS_USERNAME $SAUCE_LABS_ACCESS_KEY
#     $ node test/auto/server.js
#
test-saucelabs: node_modules test/www/js/lib
	clear && node test/auto/terminal-saucelabs.js

test/www/js/lib:
	cd test/www && volo add -nostamp

node_modules:
	npm install

# ==============================================================================
# Code Quality
# ==============================================================================

JSHINT = jshint

hint: lint
lint:
	$(JSHINT) $(SOURCES)

# ==============================================================================
# Clean
# ==============================================================================

clean:
	rm -rf build

clobber: clean
	rm -rf node_modules
	rm -rf components
	rm -rf test/www/js/lib

.PHONY: test test-chrome test-firefox test-safari test-phantomjs test-cloud test-saucelabs hint lint


text:
package io.abnd;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = SpringBootAngular2Application.class)
@WebAppConfiguration
public class SpringBootAngular2ApplicationTests {

	@Test
	public void contextLoads() {
	}

}


text:
Assignment.Router = Backbone.Router.extend({
  // Define and match routes to the state machine.
  routes: {
    // Default route to assignments.
    "": "assignments",

    // Remaining mapped.
    "assignments": "assignments",
    "assignments/migration": "assignments.migration",
    "assignments/migration/:id": "assignments.migration.detail"
  },

  initialize: function() {
    this.page = new Page.Model();
  },

  // Define the state tree.
  assignments: {
    enter: function() {
      // Top level, create a new Page model.
      this.page.set({
        title: "Assignments",

        // The model will automatically attach it to the `app.layout`.
        view: new Assignment.Views.Layout()
      });

      // Default to migrations, triggering the callback is fine.  The state
      // will be detected and only partially updated.
      this.navigate("assignments/migration", true);
    },

    migration: {
      enter: function() {
        var page = this.page;

        // Add a sub-page into the breadcrumbs.
        page.breadcrumbs.add({ subtitle: "Assignments" });

        // Get the current `Page` view and render the migration content.
        page.get("view").setView(".content": new Assignment.Views.Migration({
          model: new Assignment.Model()
        }));
      },

      detail: {
        enter: function(id) {
          var page = this.page;

          // Add a third depth level into the breadcrumbs.
          page.breadcrumbs.add({ subtitle: "Viewing assignment: " + id });

          // Get access to the `Assignment.Model`, update it's `id`, and fetch
          // the latest contents.
          page.get("view").getView(".content").model.set({ id: id }).fetch();
        }
      }
    }
  }
});


text:
package litil.parser;

import litil.TypeScope;
import litil.ast.*;
import litil.lexer.*;
import litil.tc.ExplicitTypeChecker;
import litil.tc.HMTypeChecker;

import java.io.InputStreamReader;
import java.io.Reader;
import java.util.*;

public class LitilParser extends BaseParser {
    private static Map<String, Integer> LBP = new HashMap<String, Integer>();

    static {

        LBP.put("and", 5);
        LBP.put("or", 5);
        LBP.put("not", 7);
        LBP.put("=", 7);
        LBP.put("<", 7);
        LBP.put(">", 7);
        LBP.put("::", 11);
        LBP.put("+", 15);
        LBP.put("-", 15);
        LBP.put("%", 20);
        LBP.put("*", 20);
        LBP.put("/", 20);
        LBP.put(".", 30);
        LBP.put("{", 90);
        LBP.put("}", 1);
        LBP.put("[", 90);
        LBP.put("]", 1);
        LBP.put("(", 100);
        LBP.put(")", 1);
    }

    public LitilParser(LookaheadLexer lexer) {
        super.lexer = lexer;
        prtDbg = false;
    }

    private static TypeScope trootScope() {
        TypeScope res = new TypeScope();
        res.define("+", Type.Function(Arrays.asList(Type.INT, Type.INT), Type.INT));
        res.define("add", Type.Function(Arrays.asList(Type.INT, Type.INT), Type.INT));
        //res.define("-", Type.Function(Arrays.asList(Type.INT, Type.INT), Type.INT));
        res.define("*", Type.Function(Arrays.asList(Type.INT, Type.INT), Type.INT));
        //res.define("/", Type.Function(Arrays.asList(Type.INT, Type.INT), Type.INT));
        //res.define("%", Type.Function(Arrays.asList(Type.INT, Type.INT), Type.INT));
        //res.define("=", Type.Function(Arrays.asList(Type.INT, Type.INT), Type.BOOL));

        //res.define("int2str", Type.Function(Type.INT, Type.STR));
        //res.define("print", Type.Function(Type.STR, Type.UNIT));
        return res;
    }

    public static void main(String[] args) throws Exception {

        Reader reader = new InputStreamReader(LitilParser.class.getResourceAsStream("../eval/emb-list.ltl"));
        LitilParser p = new LitilParser(new LookaheadLexerWrapper(new StructuredLexer(new BaseLexer(reader), "  ")));
        p.debug = false;

        Program ast = p.program();

        System.out.println(ast.repr(1));

        ExplicitTypeChecker exTc = new ExplicitTypeChecker();
        HMTypeChecker hmTc = new HMTypeChecker();
        TypeScope tenv = trootScope().child();
        for (Instruction instr : ast.instructions) {
            System.out.println(instr.repr(0));

            System.out.println(":: " + hmTc.analyze(instr, tenv));
            System.out.println("--------------");
        }

        System.out.println(tenv);

        //System.out.println(exTc.analyze(ast));
    }

    public Program program() {
        Program p = new Program();
        //p.scope = rootScope();
        p.instructions.addAll(body());
        return p;
    }

    private TypeScope rootScope() {
        TypeScope res = new TypeScope();
        res.define("+", Type.Function(Arrays.asList(Type.INT, Type.INT), Type.INT));
        res.define("-", Type.Function(Arrays.asList(Type.INT, Type.INT), Type.INT));
        res.define("*", Type.Function(Arrays.asList(Type.INT, Type.INT), Type.INT));
        res.define("/", Type.Function(Arrays.asList(Type.INT, Type.INT), Type.INT));
        res.define("%", Type.Function(Arrays.asList(Type.INT, Type.INT), Type.INT));
        res.define("=", Type.Function(Arrays.asList(Type.INT, Type.INT), Type.BOOL));

        res.define("int2str", Type.Function(Type.INT, Type.STR));
        res.define("print", Type.Function(Type.STR, Type.UNIT));
        return res;
    }

    private List<Instruction> body() {
        List<Instruction> res = new ArrayList<Instruction>();
        while (found(Token.Type.NEWLINE)) {
            res.add(instruction());
        }
        return res;
    }

    private Instruction instruction() {
        if (found(Token.Type.KEYWORD, "let")) {
            return destructuringLetBinding();
        } else if (found(Token.Type.KEYWORD, "data")) {
            return dataDecl();
        } else if (found(Token.Type.KEYWORD, "exception")) {
            return exceptionDecl();
        } else {
            return expr();
        }
    }

    private LetBinding letBinding() {
        expect(Token.Type.NAME);
        String functionName = token.text;
        Type functionReturnType = null;
        List<Named> args = params();
        List<Type> argTypes = new ArrayList<Type>(args.size());
        for (Named arg : args) {
            argTypes.add(arg.type);
        }
        if (found(Token.Type.SYM, ":")) {
            functionReturnType = type();
            Type letType = argTypes.isEmpty() ? functionReturnType : Type.Function(argTypes, functionReturnType);
        }
        expect(Token.Type.SYM, "=");
        List<Instruction> instructions = bloc();
        LetBinding letBinding = new LetBinding(functionName, functionReturnType, args, instructions);
        return letBinding;
    }

    // will eventually replace the basic let binding
    private DestructuringLetBinding destructuringLetBinding() {
        Pattern main = atomicPattern();
        List<Pattern> args = new ArrayList<Pattern>();
        while (!found(Token.Type.SYM, "=")) {
            args.add(atomicPattern());
        }

        List<Instruction> instructions = bloc();
        DestructuringLetBinding letBinding = new DestructuringLetBinding(main, args, instructions);
        return letBinding;
    }

    public ExceptionDecl exceptionDecl() {
        expect(Token.Type.NAME);
        String name = token.text;
        if (Character.isLowerCase(name.charAt(0))) {
            throw error("Illegal exception name (starts with a lower case): " + name);
        }

        List<Type> argTypes = new ArrayList<Type>();
        while (lookahead(Token.Type.NAME) || lookahead(Token.Type.SYM, "(") || lookahead(Token.Type.SYM, "[")) {
            Type argType = atomType(Collections.<String, Type.Variable>emptyMap(), true);
            argTypes.add(argType);
        }

        return new ExceptionDecl(name, argTypes);
    }

    public DataDecl dataDecl() {
        expect(Token.Type.NAME);
        String name = token.text;
        if (Character.isLowerCase(name.charAt(0))) {
            throw error("Illegal datatype name (starts with a lower case): " + name);
        }
        List<Type.Variable> vars = new ArrayList<Type.Variable>();
        Map<String, Type.Variable> mappings = new HashMap<String, Type.Variable>();
        while (found(Token.Type.NAME)) {
            Type.Variable var = varType(token.text, mappings, false);
            if (var == null) {
                throw error("datatype declaration can only be parameterized with vars");
            } else {
                vars.add(var);
            }
        }
        Type dataType = new Type.Oper(name, vars);
        expect(Token.Type.SYM, "=");

        List<DataDecl.TypeConstructor> tyCons = new ArrayList<DataDecl.TypeConstructor>();
        tyCons.add(typeConstructor(mappings));

        while (found(Token.Type.SYM, "|")) {
            tyCons.add(typeConstructor(mappings));
        }
        DataDecl res = new DataDecl(name, dataType, vars, tyCons);
        return res;
    }

    private DataDecl.TypeConstructor typeConstructor(Map<String, Type.Variable> mappings) {
        expect(Token.Type.NAME);
        String name = token.text;
        List<Type> argTypes = new ArrayList<Type>();
        while (lookahead(Token.Type.NAME) || lookahead(Token.Type.SYM, "(") || lookahead(Token.Type.SYM, "{") || lookahead(Token.Type.SYM, "[")) {
            Type argType = atomType(mappings, true);
            argTypes.add(argType);

        }
        return new DataDecl.TypeConstructor(name, argTypes);
    }

    private List<Instruction> bloc() {
        List<Instruction> instructions = new ArrayList<Instruction>();
        if (found(Token.Type.INDENT)) {
            instructions = body();
            expect(Token.Type.DEINDENT);
        } else {
            instructions.add(expr(0));
        }
        return instructions;
    }

    private List<Named> params() {
        List<Named> args = new ArrayList<Named>();
        while (lookahead(Token.Type.NAME) || lookahead(Token.Type.SYM, "(")) {
            args.add(param());
        }
        return args;
    }

    private Named param() {
        if (found(Token.Type.NAME)) {
            return new Named(token.text);
        } else if (found(Token.Type.SYM, "(")) {
            expect(Token.Type.NAME);
            String argName = token.text;
            expect(Token.Type.SYM, ":");
            Type argType = type();
            expect(Token.Type.SYM, ")");
            return new Named(argName, argType);
        } else {
            throw error("Invalid function argument: was expecting an argument name or a typed argument");
        }
    }

    private Type type() {
        return funcType(new HashMap<String, Type.Variable>(), false);
    }

    private Type type(Map<String, Type.Variable> mappings, boolean noNewVars) {
        return funcType(mappings, noNewVars);
    }

    private Type funcType(Map<String, Type.Variable> mappings, boolean noNewVars) {
        Type arg = prodType(mappings, noNewVars);
        if (found(Token.Type.SYM, "->")) {
            Type res = funcType(mappings, noNewVars);
            return Type.Function(arg, res);
        }
        return arg;
    }

    private Type prodType(Map<String, Type.Variable> mappings, boolean noNewVars) {
        List<Type> args = new ArrayList<Type>();
        args.add(paramType(mappings, noNewVars));
        while (found(Token.Type.SYM, "*")) {
            args.add(paramType(mappings, noNewVars));

        }
        return args.size() == 1 ? args.get(0) : Type.Product(args);
    }

    private Type paramType(Map<String, Type.Variable> mappings, boolean noNewVars) {
        if (found(Token.Type.NAME)) {
            String name = token.text;
            Type.Variable var = varType(name, mappings, noNewVars);
            if (var != null) {
                return var;
            } else {
                List<Type> args = new ArrayList<Type>();
                while (lookahead(Token.Type.SYM, "(") || lookahead(Token.Type.SYM, "[") || lookahead(Token.Type.NAME)) {
                    args.add(atomType(mappings, noNewVars));
                }
                if (args.isEmpty()) {
                    return typeFor(name);
                } else {
                    return new Type.Oper(name, args);
                }
            }
        } else {
            return atomType(mappings, noNewVars);
        }

    }

    private Type atomType(Map<String, Type.Variable> mappings, boolean noNewVars) {
        if (found(Token.Type.SYM, "(")) {
            Type res = type(mappings, noNewVars);
            expect(Token.Type.SYM, ")");
            return res;
        } else if (found(Token.Type.SYM, "[")) {
            Type res = type(mappings, noNewVars);
            expect(Token.Type.SYM, "]");
            return Type.List(res);
        } else if (found(Token.Type.SYM, "{")) {
            Map<String, Type> types = new HashMap<String, Type>();
            expect(Token.Type.NAME);
            String name = token.text;
            expect(Token.Type.SYM, ":");
            Type type = type(mappings, noNewVars);
            types.put(name, type);

            while (found(Token.Type.SYM, ",")) {
                expect(Token.Type.NAME);
                name = token.text;
                expect(Token.Type.SYM, ":");
                type = type(mappings, noNewVars);
                types.put(name, type);
            }

            expect(Token.Type.SYM, "}");
            return new Type.RecordType(types);
        } else if (found(Token.Type.NAME)) {
            String name = token.text;
            Type.Variable var = varType(name, mappings, noNewVars);
            if (var != null) {
                return var;
            } else {
                return typeFor(token.text);
            }
        } else {
            throw error("Unexpected token");
        }
    }

    private Type.Variable varType(String name, Map<String, Type.Variable> mappings, boolean noNewVars) {
        if (Character.isLowerCase(name.charAt(0))) {
            if (mappings.containsKey(name)) {
                return mappings.get(name);
            } else if (noNewVars) {
                throw error("Unbound variable " + name);
            } else {
                Type.Variable v = new Type.Variable();
                mappings.put(name, v);
                return v;
            }
        } else {
            return null;
        }
    }

    private Type typeFor(String name) {
        if ("Number".equals(name)) {
            return Type.INT;
        } else if ("String".equals(name)) {
            return Type.STR;
        } else if ("Char".equals(name)) {
            return Type.CHAR;
        } else if ("Bool".equals(name)) {
            return Type.BOOL;
        } else {
            return new Type.Oper(name);
        }
    }

    private Expr expr() {
        if (found(Token.Type.SYM, "\\")) {
            List<Named> params = params();
            if (params.isEmpty()) {
                throw error("Lambda expressions take at least one argument");
            }
            Type type = null;
            if (found(Token.Type.SYM, ":")) {
                type = type();
            }
            expect(Token.Type.SYM, "->");
            List<Instruction> body = bloc();
            return new Expr.ELam(params, type, body);
        } else if (found(Token.Type.KEYWORD, "if")) {
            Expr cond = expr(0);
            expect(Token.Type.KEYWORD, "then");
            List<Instruction> thenBody = bloc();
            System.err.println("@ " + cond + " " + thenBody);
            found(Token.Type.NEWLINE);
            expect(Token.Type.KEYWORD, "else");
            List<Instruction> elseBody = bloc();
            return new Expr.EIf(cond, thenBody, elseBody);
        } else if (found(Token.Type.KEYWORD, "match")) {
            Expr input = expr(0);
            expect(Token.Type.INDENT);
            List<Expr.PatterMatching.Case> cases = new ArrayList<Expr.PatterMatching.Case>();
            while (found(Token.Type.NEWLINE)) {
                cases.add(patMatchCase());
            }
            expect(Token.Type.DEINDENT);
            return new Expr.PatterMatching(input, cases);

        } else if (found(Token.Type.KEYWORD, "try")) {
            List<Instruction> tryBody = bloc();
            expect(Token.Type.NEWLINE);
            expect(Token.Type.KEYWORD, "catch");
            expect(Token.Type.INDENT);
            List<Expr.PatterMatching.Case> cases = new ArrayList<Expr.PatterMatching.Case>();
            while (found(Token.Type.NEWLINE)) {
                cases.add(patMatchCase());
            }
            expect(Token.Type.DEINDENT);
            return new Expr.TryCatch(tryBody, cases);
        } else {
            return expr(0);
        }
    }

    private Expr.PatterMatching.Case patMatchCase() {
        Pattern pat = pattern();
        expect(Token.Type.SYM, "=>");
        List<Instruction> instructions;
        if (lookahead(Token.Type.INDENT)) {
            instructions = bloc();
        } else {
            Expr outcome = expr(0);
            instructions = Arrays.<Instruction>asList(outcome);
        }
        List<Expr.PatterMatching.Case> cases = new ArrayList<Expr.PatterMatching.Case>();
        return new Expr.PatterMatching.Case(pat, instructions);
    }

    private Pattern pattern() {
        if (lookahead(Token.Type.SYM, "(")) {
            return maybeHeadTailPattern(maybeTuplePattern());
        } else if (lookahead(Token.Type.SYM, "[")) {
            return maybeHeadTailPattern(listPattern());
        } else if (found(Token.Type.NAME)) {
            String name = token.text;
            if (Character.isLowerCase(name.charAt(0))) {
                return maybeHeadTailPattern(new Pattern.IdPattern(name));
            } else {
                List<Pattern> patterns = new ArrayList<Pattern>();

                while (lookahead(Token.Type.SYM, "(") || lookahead(Token.Type.SYM, "[") || lookahead(Token.Type.NAME) || lookahead(Token.Type.SYM, "_")) {//first(pattern)
                    patterns.add(atomicPattern());
                }
                return new Pattern.TyConPattern(name, patterns);
            }
        } else if (found(Token.Type.SYM, "_")) {
            return maybeHeadTailPattern(new Pattern.WildcardPattern());
        } else {
            throw error("Unknow pattern format");
        }
    }

    private Pattern maybeHeadTailPattern(Pattern head) {
        if (found(Token.Type.SYM, "::")) {
            Pattern tail = pattern();
            return new Pattern.TyConPattern("Cons", Arrays.asList(head, tail));
        } else {
            return head;
        }
    }

    private Pattern atomicPattern() {
        if (lookahead(Token.Type.SYM, "(")) {
            return maybeTuplePattern();
        } else if (lookahead(Token.Type.SYM, "[")) {
            return listPattern();
        } else if (found(Token.Type.NAME)) {
            String name = token.text;
            if (Character.isLowerCase(name.charAt(0))) {
                return new Pattern.IdPattern(name);
            } else {
                return new Pattern.TyConPattern(name, Collections.<Pattern>emptyList());
            }
        } else if (found(Token.Type.SYM, "_")) {
            return new Pattern.WildcardPattern();
        } else {
            throw error("Unknow pattern format");
        }
    }

    private Pattern maybeTuplePattern() {
        expect(Token.Type.SYM, "(");
        List<Pattern> patterns = new ArrayList<Pattern>();
        patterns.add(pattern());
        while (found(Token.Type.SYM, ",")) {
            patterns.add(pattern());
        }
        expect(Token.Type.SYM, ")");
        if (patterns.size() == 1) {
            return patterns.get(0);
        } else {
            return new Pattern.TuplePattern(patterns);
        }
    }

    private Pattern listPattern() {
        expect(Token.Type.SYM, "[");
        if (found(Token.Type.SYM, "]")) {
            return makeList(Collections.<Pattern>emptyList());
        } else {
            List<Pattern> patterns = new ArrayList<Pattern>();
            patterns.add(pattern());
            while (found(Token.Type.SYM, ",")) {
                patterns.add(pattern());
            }
            expect(Token.Type.SYM, "]");
            return makeList(patterns);
        }

    }

    private Pattern makeList(List<Pattern> patterns) {
        if (patterns.isEmpty()) {
            return new Pattern.TyConPattern("Nil", Collections.<Pattern>emptyList());
        } else {
            return new Pattern.TyConPattern("Cons", Arrays.asList(patterns.get(0), makeList(patterns.subList(1, patterns.size()))));
        }
    }

    private int lbp(Token tk) {
        if (tk.type == Token.Type.NAME) {
            return 90;
        } else if (tk.type == Token.Type.NUM || tk.type == Token.Type.STRING || tk.type == Token.Type.CHAR || tk.type == Token.Type.BOOL) {
            return 90;
        }
        Integer res = LBP.get(tk.text);
        if (res == null) {
            dbg("warn " + tk);
            return 0;
        } else {
            return res;
        }
    }

    private Expr nud(Token tk) {
        dbg("nud " + tk);
        if (is(tk, Token.Type.SYM, "-")) {
            depth++;
            Expr expr = expr(100);
            depth--;
            return new Expr.EAp(new Expr.EName("-/1"), expr);//unary minus
        } else if (is(tk, Token.Type.NUM)) {
            return new Expr.ENum(Integer.parseInt(tk.text));
        } else if (is(tk, Token.Type.BOOL)) {
            return new Expr.EBool(Boolean.parseBoolean(tk.text));
        } else if (is(tk, Token.Type.NAME)) {
            return new Expr.EName(tk.text);
        } else if (is(tk, Token.Type.STRING)) {
            return new Expr.EStr(tk.text);
        } else if (is(tk, Token.Type.CHAR)) {
            return new Expr.EChar(tk.text.charAt(0));
        } else if (is(tk, Token.Type.SYM, "(")) {
            if (found(Token.Type.SYM, ")")) {
                return Expr.EUnit;
            }
            depth++;

            List<Expr> res = new ArrayList<Expr>();
            res.add(expr(1));

            while (found(Token.Type.SYM, ",")) {
                res.add(expr(1));
            }
            depth--;
            expect(Token.Type.SYM, ")");

            return res.size() == 1 ? res.get(0) : new Expr.ETuple(res);
        } else if (is(tk, Token.Type.SYM, "[")) {
            List<Expr> res = new ArrayList<Expr>();

            if (found(Token.Type.SYM, "]")) {
                return new Expr.EList(res);
            } else {
                res.add(expr(1));
                while (found(Token.Type.SYM, ",")) {
                    res.add(expr(1));
                }
                expect(Token.Type.SYM, "]");
                return new Expr.EList(res);
            }

        } else if (is(tk, Token.Type.SYM, "{")) {

            depth++;

            Map<String, Expr> res = new HashMap<String, Expr>();
            expect(Token.Type.NAME);
            String name = token.text;
            expect(Token.Type.SYM, ":");
            Expr value = expr(1);
            res.put(name, value);
            while (found(Token.Type.SYM, ",")) {
                expect(Token.Type.NAME);
                name = token.text;
                expect(Token.Type.SYM, ":");
                value = expr(1);
                res.put(name, value);
            }
            depth--;
            expect(Token.Type.SYM, "}");

            return new Expr.ERecord(res);
        } else if (is(tk, Token.Type.SYM, "\\")) {
            List<Named> params = params();
            if (params.isEmpty()) {
                throw error("Lambda expressions take at least one argument");
            }
            Type type = null;
            if (found(Token.Type.SYM, ":")) {
                type = type();
            }
            expect(Token.Type.SYM, "=>");
            depth++;
            Expr res = expr(1);
            depth--;
            return new Expr.ELam(params, type, Arrays.<Instruction>asList(res));
        } else if (is(tk, Token.Type.KEYWORD, "if")) {
            depth++;
            Expr cond = expr(1);
            depth--;
            expect(Token.Type.KEYWORD, "then");
            depth++;
            Expr thenArm = expr(1);
            depth--;
            expect(Token.Type.KEYWORD, "else");
            depth++;
            Expr elseArm = expr(1);
            depth--;
            return new Expr.EIf(cond, Arrays.asList(thenArm), Arrays.asList(elseArm));
        } else if (is(tk, Token.Type.KEYWORD, "throw")) {
            depth++;
            Expr ex = expr(1);
            depth--;
            return new Expr.EThrow(ex);
        } else if (is(tk, Token.Type.KEYWORD, "not")) {
            depth++;
            Expr ex = expr(LBP.get(tk.text));
            depth--;
            return new Expr.EAp(new Expr.EName("not"), ex);//unary not;
        } else {
            if (is(tk, Token.Type.NEWLINE) || is(tk, Token.Type.INDENT) || is(tk, Token.Type.DEINDENT)) {
                throw error("Unfinished expression (A simple expression cannot have line breaks)");
            } else {
                throw error("Invalid symbol found in simple expression" + tk);
            }
        }

    }

    private Expr led(Expr left, Token tk) {
        dbg("led " + left + ", " + tk);
        int bp = lbp(tk);
        if (is(tk, Token.Type.SYM, ".")) {
            expect(Token.Type.NAME);
            return new Expr.EAccessor(left, token.text);
        } else if (is(tk, Token.Type.SYM, "+") || is(tk, Token.Type.SYM, "-") || is(tk, Token.Type.SYM, "*") || is(tk, Token.Type.SYM, "/")
                || is(tk, Token.Type.SYM, "=") || is(tk, Token.Type.SYM, "%") || is(tk, Token.Type.SYM, "<") || is(tk, Token.Type.SYM, ">")
                || is(tk, Token.Type.KEYWORD, "and") || is(tk, Token.Type.KEYWORD, "or")) {
            depth++;
            Expr right = expr(bp);
            depth--;
            return new Expr.EAp(new Expr.EAp(new Expr.EName(tk.text), left), right);
        } else if (is(tk, Token.Type.SYM, "::")) {
            depth++;
            Expr right = expr(bp-1);
            depth--;
            return new Expr.EAp(new Expr.EAp(new Expr.EName("Cons"), left), right);
        } else if (left instanceof Expr.EName || left instanceof Expr.EAp || left instanceof Expr.ELam) {
            return new Expr.EAp(left, nud(tk));
        } else {
            throw error("Unexpected token " + tk);
        }
    }

    private boolean dbg(int rbp, Token tk) {
        depth++;
        dbg(rbp + "<" + lbp(tk) + "? (tk=" + tk + ")");
        depth--;
        return true;
    }

    public Expr expr(int rbp) {
        dbg("expr " + rbp);
        Token tk = advance();
        dbg("pop0 " + tk);
        depth++;
        Expr left = nud(tk);
        depth--;
        while (dbg(rbp, lexer.peek(1)) && rbp < lbp(lexer.peek(1))) {
            tk = advance();
            dbg("pop " + tk);
            depth++;
            left = led(left, tk);
            depth--;
        }
        return left;
    }

    private int depth = 0;
    public boolean prtDbg = true;

    private String tab(int depth) {
        StringBuilder res = new StringBuilder("");
        for (int i = 0; i < depth; i++) {
            res.append("\t");
        }
        return res.toString();
    }

    private void dbg(String msg) {
        if (prtDbg) {
            System.err.println(tab(depth) + msg);
        }
    }

}


text:
namespace Tigra.Database
{
    using System;
    using System.Collections.Generic;

    public partial class Elicitation
    {
        public int ElicitationID { get; set; }
        public int CellID { get; set; }
        public int UserID { get; set; }
        public System.DateTime RequestDate { get; set; }
        public string Summary { get; set; }
        public string Text { get; set; }

        public virtual Cell Cell { get; set; }
        public virtual UserAccount UserAccount { get; set; }
    }
}


text:
package com.streamquote.model;

import java.math.BigDecimal;

public class StreamingQuoteModeLtp extends StreamingQuote {
	public BigDecimal ltp;

	/**
	 * Constructor
	 *
	 * @param time
	 * @param instrumentToken
	 * @param ltp
	 */
	public StreamingQuoteModeLtp(String time, String instrumentToken,
			BigDecimal ltp) {
		super(time, instrumentToken);
		this.ltp = ltp;
	}

	public BigDecimal getLtp() {
		return ltp;
	}

	public void setLtp(BigDecimal ltp) {
		this.ltp = ltp;
	}

	@Override
	public String toString() {
		return "StreamingQuoteModeLtp [ltp=" + ltp + ", time=" + time
				+ ", instrumentToken=" + instrumentToken + "]";
	}
}


text:
class GeneralCategoryCVsController < Voeis::CVController
  rescue_from ActionView::MissingTemplate, :with => :invalid_page

  ###GLOBAL GeneralCategoryCV controller
  before_filter do
    @cv_global = true
    @cv_class = Voeis::GeneralCategoryCV
    @cv_type = :general_category
    init(@cv_type,@cv_class,@cv_global)
  end

end


text:
<TITLE>Local Attacks</TITLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">

<< Back
INDEX
Next >>

Page 12

Local Attacks

    Requires an account

    Escalate to system or root

        due to vulnerability in system software

        or careless administrator


text:
Construction of Docker images uses script files located in Thrift project's build directory. So we need to get it first.

Create/goto to you working directory

```
mkdir src
cd src
```
Check out Thrift source repository

```
git clone https://github.com/facebook/fbthrift.git
```

Now run script that will build the Docker image using this directory as a source.
```
./fbthrift/thrift/build/docker/build.sh `pwd`/fbthrift
```

This script will create (it will take a while) two Docker images: `thrift_sys_image` which contains system dependencies like gcc-5 and `thrift_lib_image` which contains all libraries required to build Thrift.

Now we can start working on the container to do edit/compile cycles in the Thrift project.
```
docker run -it -v `pwd`/fbthrift:/fbthrift thrift_lib_image /bin/bash
```
After executing the previous command we can use the interactive shell running inside the container.
For example, we can build thrift using CMake:
```
cd /fbthrift
mkdir build
cd build
cmake ..
make
```

Since the host directory that contains the sources of Thrift is now accessible from both host machine and container, it is now possible to edit files on the host machine using any advanced/favorite editor; using the container to run build/tests only.


text:
<?php

namespace LC\Portal;

use LC\Common\Config;
use LC\Common\Http\FormAuthentication;
use LC\Common\Http\RadiusAuth;
use LC\Common\Http\SessionInterface;
use LC\Common\TplInterface;
use Psr\Log\LoggerInterface;

class FormRadiusAuthentication extends FormAuthentication
{
    public function __construct(Config $config, SessionInterface $session, TplInterface $tpl, LoggerInterface $logger)
    {
        $serverList = $config->requireArray('serverList');
        $userAuth = new RadiusAuth($logger, $serverList, $config->optionalInt('permissionAttribute'));
        if (null !== $addRealm = $config->optionalString('addRealm')) {
            $userAuth->setRealm($addRealm);
        }
        if (null !== $nasIdentifier = $config->optionalString('nasIdentifier')) {
            $userAuth->setNasIdentifier($nasIdentifier);
        }

        parent::__construct($userAuth, $session, $tpl);
    }
}


text:
/* ###
 * IP: GHIDRA
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package db;

import java.io.IOException;

/**
 * DBChangeSet facilitates the reading and writing of application
 * level change data associated with BufferFile.
 */
public interface DBChangeSet {

	/**
	 * Read into this change set from the specified database handle.
	 * The database handle will not be retained and should be closed
	 * by the invoker of this method.
	 * @param dbh database handle
	 * @throws IOException if IO error occurs
	 */
	void read(DBHandle dbh) throws IOException;

	/**
	 * Write this change set to the specified database handle.
	 * The database handle will not be retained and should be closed
	 * by the invoker of this method.
	 * @param dbh database handle
	 * @param isRecoverySave true if this write is because of a recovery snapshot or false
	 * if due to a user save action.
	 * @throws IOException if IO error occurs
	 */
	void write(DBHandle dbh, boolean isRecoverySave) throws IOException;

}


text:
class InternetConnectionChecker {
  constructor ({ onDisconnect, onReconnect }) {
    this._onDisconnect = onDisconnect || (() => {})
    this._onReconnect = onReconnect || (() => {})

    this._isOnline = true
  }

  start () {
    if (typeof window !== 'undefined') {
      window.addEventListener('online', () => this.onlineCheck())
      window.addEventListener('offline', () => this.onlineCheck())
      setTimeout(() => this.onlineCheck(), 3000)
    }
  }

  onlineCheck (cb) {
    const online =
      typeof window.navigator.onLine !== 'undefined'
        ? window.navigator.onLine
        : true

    if (this._isOnline && !online) {
      this._onDisconnect()
    }
    if (!this._isOnline && online) {
      this._onReconnect()
    }
    this._isOnline = online
  }

  isOnline () {
    return this._isOnline
  }
}

module.exports = InternetConnectionChecker


text:
import * as fs from 'fs';
import * as path from 'path';

import {main} from '../src/main';

import {makeTempDir} from './test_support';

describe('tsc-wrapped', () => {
  let basePath: string;
  let write: (fileName: string, content: string) => void;

  beforeEach(() => {
    basePath = makeTempDir();
    write = (fileName: string, content: string) => {
      fs.writeFileSync(path.join(basePath, fileName), content, {encoding: 'utf-8'});
    };
    write('decorators.ts', '/** @Annotation */ export var Component: Function;');
    fs.mkdirSync(path.join(basePath, 'dep'));
    write('dep/index.ts', `
      export const A = 1;
      export const B = 2;
    `);
    write('test.ts', `
      import {Component} from './decorators';
      export * from './dep';

      @Component({})
      export class Comp {
        /**
         * Comment that is
         * multiple lines
         */
        method(x: string): void {}
      }
    `);
  });

  function readOut(ext: string) {
    return fs.readFileSync(path.join(basePath, 'built', `test.${ext}`), {encoding: 'utf-8'});
  }

  it('should report error if project not found', () => {
    main('not-exist', null as any)
        .then(() => fail('should report error'))
        .catch(e => expect(e.message).toContain('ENOENT'));
  });

  it('should pre-process sources', (done) => {
    write('tsconfig.json', `{
      "compilerOptions": {
        "experimentalDecorators": true,
        "types": [],
        "outDir": "built",
        "declaration": true,
        "moduleResolution": "node",
        "target": "es2015"
      },
      "angularCompilerOptions": {
        "annotateForClosureCompiler": true
      },
      "files": ["test.ts"]
    }`);

    main(basePath, {basePath})
        .then(() => {
          const out = readOut('js');
          // No helpers since decorators were lowered
          expect(out).not.toContain('__decorate');
          // Expand `export *` and fix index import
          expect(out).toContain(`export { A, B } from './dep/index'`);
          // Annotated for Closure compiler
          expect(out).toContain('* @param {?} x');
          // Comments should stay multi-line
          expect(out).not.toContain('Comment that is multiple lines');
          // Decorator is now an annotation
          expect(out).toMatch(/Comp.decorators = \[\s+\{ type: Component/);
          const decl = readOut('d.ts');
          expect(decl).toContain('declare class Comp');
          const metadata = readOut('metadata.json');
          expect(metadata).toContain('"Comp":{"__symbolic":"class"');
          done();
        })
        .catch(e => done.fail(e));
  });

  it('should pre-process sources using config from vinyl like object', (done) => {
    const config = {
      path: basePath + '/tsconfig.json',
      contents: new Buffer(JSON.stringify({
        compilerOptions: {
          experimentalDecorators: true,
          types: [],
          outDir: 'built',
          declaration: true,
          moduleResolution: 'node',
          target: 'es2015'
        },
        angularCompilerOptions: {annotateForClosureCompiler: true},
        files: ['test.ts']
      }))
    };

    main(config, {basePath})
        .then(() => {
          const out = readOut('js');
          // Expand `export *` and fix index import
          expect(out).toContain(`export { A, B } from './dep/index'`);
          // Annotated for Closure compiler
          expect(out).toContain('* @param {?} x');
          done();
        })
        .catch(e => done.fail(e));
  });

  it('should allow all options disabled', (done) => {
    write('tsconfig.json', `{
      "compilerOptions": {
        "experimentalDecorators": true,
        "types": [],
        "outDir": "built",
        "declaration": false,
        "module": "es2015",
        "moduleResolution": "node"
      },
      "angularCompilerOptions": {
        "annotateForClosureCompiler": false,
        "annotationsAs": "decorators",
        "skipMetadataEmit": true,
        "skipTemplateCodegen": true
      },
      "files": ["test.ts"]
    }`);

    main(basePath, {basePath})
        .then(() => {
          const out = readOut('js');
          // TypeScript's decorator emit
          expect(out).toContain('__decorate');
          // Not annotated for Closure compiler
          expect(out).not.toContain('* @param {?} x');
          expect(() => fs.accessSync(path.join(basePath, 'built', 'test.metadata.json'))).toThrow();
          expect(() => fs.accessSync(path.join(basePath, 'built', 'test.d.ts'))).toThrow();
          done();
        })
        .catch(e => done.fail(e));
  });

  it('should allow JSDoc annotations without decorator downleveling', (done) => {
    write('tsconfig.json', `{
      "compilerOptions": {
        "experimentalDecorators": true,
        "types": [],
        "outDir": "built",
        "declaration": true
      },
      "angularCompilerOptions": {
        "annotateForClosureCompiler": true,
        "annotationsAs": "decorators"
      },
      "files": ["test.ts"]
    }`);
    main(basePath, {basePath}).then(() => done()).catch(e => done.fail(e));
  });

  xit('should run quickly (performance baseline)', (done) => {
    for (let i = 0; i < 1000; i++) {
      write(`input${i}.ts`, `
        import {Component} from './decorators';
        @Component({})
        export class Input${i} {
          private __brand: string;
        }
      `);
    }
    write('tsconfig.json', `{
      "compilerOptions": {
        "experimentalDecorators": true,
        "types": [],
        "outDir": "built",
        "declaration": true,
        "diagnostics": true
      },
      "angularCompilerOptions": {
        "annotateForClosureCompiler": false,
        "annotationsAs": "decorators",
        "skipMetadataEmit": true
      },
      "include": ["input*.ts"]
    }`);
    console.time('BASELINE');

    main(basePath, {basePath})
        .then(() => {
          console.timeEnd('BASELINE');
          done();
        })
        .catch(e => done.fail(e));
  });

  xit('should run quickly (performance test)', (done) => {
    for (let i = 0; i < 1000; i++) {
      write(`input${i}.ts`, `
        import {Component} from './decorators';
        @Component({})
        export class Input${i} {
          private __brand: string;
        }
      `);
    }
    write('tsconfig.json', `{
      "compilerOptions": {
        "experimentalDecorators": true,
        "types": [],
        "outDir": "built",
        "declaration": true,
        "diagnostics": true,
        "skipLibCheck": true
      },
      "angularCompilerOptions": {
        "annotateForClosureCompiler": true
      },
      "include": ["input*.ts"]
    }`);
    console.time('TSICKLE');

    main(basePath, {basePath})
        .then(() => {
          console.timeEnd('TSICKLE');
          done();
        })
        .catch(e => done.fail(e));
  });

  it('should produce valid source maps', (done) => {
    write('tsconfig.json', `{
      "compilerOptions": {
        "experimentalDecorators": true,
        "types": [],
        "outDir": "built",
        "declaration": true,
        "moduleResolution": "node",
        "target": "es2015",
        "sourceMap": true
      },
      "angularCompilerOptions": {
        "annotateForClosureCompiler": true
      },
      "files": ["test.ts"]
    }`);

    main(basePath, {basePath})
        .then(() => {
          const out = readOut('js.map');
          expect(out).toContain('"sources":["../test.ts"]');
          done();
        })
        .catch(e => done.fail(e));
  });
});


text:
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Mar 24, 2016 at 08:39 AM
-- Server version: 10.1.9-MariaDB
-- PHP Version: 7.0.1

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `design_aura`
--

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

--
-- Table structure for table `admin`
--

CREATE TABLE `admin` (
  `id` int(3) NOT NULL,
  `first_name` varchar(25) NOT NULL,
  `last_name` varchar(25) NOT NULL,
  `email` varchar(255) NOT NULL,
  `mobile1` varchar(15) NOT NULL,
  `mobile2` varchar(15) NOT NULL,
  `password` char(60) NOT NULL,
  `role` char(5) NOT NULL,
  `created_on` datetime NOT NULL,
  `last_login` datetime NOT NULL,
  `last_edited` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `account_status` char(1) NOT NULL DEFAULT '1',
  `deleted` char(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `aura_admin_sessions`
--

CREATE TABLE `aura_admin_sessions` (
  `id` varchar(40) NOT NULL,
  `ip_address` varchar(45) NOT NULL,
  `timestamp` int(10) UNSIGNED NOT NULL DEFAULT '0',
  `data` blob NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `blogs`
--

CREATE TABLE `blogs` (
  `id` int(10) UNSIGNED NOT NULL,
  `title` varchar(200) NOT NULL,
  `body` longtext NOT NULL,
  `author` varchar(30) NOT NULL,
  `default_image` varchar(100) DEFAULT NULL,
  `uploaded_by` int(11) NOT NULL,
  `date_created` datetime NOT NULL,
  `last_edited` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `published` char(1) NOT NULL DEFAULT '0',
  `edited_after_published` char(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `bl_comments`
--

CREATE TABLE `bl_comments` (
  `id` int(10) UNSIGNED NOT NULL,
  `comment_body` text NOT NULL,
  `username` varchar(20) DEFAULT NULL,
  `blog_id` int(10) UNSIGNED NOT NULL,
  `date_added` datetime NOT NULL,
  `last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `edited` char(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `bl_replies`
--

CREATE TABLE `bl_replies` (
  `id` int(10) UNSIGNED NOT NULL,
  `reply_body` text NOT NULL,
  `username` varchar(20) DEFAULT NULL,
  `comment_id` int(10) UNSIGNED NOT NULL,
  `date_added` datetime NOT NULL,
  `last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `edited` char(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `projects`
--

CREATE TABLE `projects` (
  `id` int(10) UNSIGNED NOT NULL,
  `title` varchar(50) NOT NULL,
  `description` text,
  `default_image` varchar(100) DEFAULT NULL,
  `user_id` int(11) NOT NULL,
  `category_id` tinyint(4) NOT NULL,
  `tags` varchar(50) DEFAULT NULL,
  `date_created` datetime NOT NULL,
  `last_edited` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `pr_categories`
--

CREATE TABLE `pr_categories` (
  `id` tinyint(4) NOT NULL,
  `name` varchar(50) NOT NULL,
  `date_added` datetime NOT NULL,
  `added_by` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `pr_comments`
--

CREATE TABLE `pr_comments` (
  `id` int(10) UNSIGNED NOT NULL,
  `comment_body` text NOT NULL,
  `username` varchar(20) DEFAULT NULL,
  `project_id` int(10) UNSIGNED NOT NULL,
  `date_added` datetime NOT NULL,
  `last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `edited` char(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `pr_images`
--

CREATE TABLE `pr_images` (
  `id` int(10) UNSIGNED NOT NULL,
  `project_id` int(10) UNSIGNED NOT NULL,
  `image_link` varchar(100) NOT NULL,
  `date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `pr_replies`
--

CREATE TABLE `pr_replies` (
  `id` int(10) UNSIGNED NOT NULL,
  `reply_body` text NOT NULL,
  `username` varchar(20) DEFAULT NULL,
  `comment_id` int(10) UNSIGNED NOT NULL,
  `date_added` datetime NOT NULL,
  `last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `edited` char(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `pr_tags`
--

CREATE TABLE `pr_tags` (
  `id` tinyint(4) NOT NULL,
  `name` varchar(50) NOT NULL,
  `date_added` datetime NOT NULL,
  `added_by` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `username` varchar(25) NOT NULL,
  `first_name` varchar(20) NOT NULL,
  `last_name` varchar(20) NOT NULL,
  `email` varchar(100) NOT NULL,
  `profession` varchar(100) NOT NULL,
  `mobile_1` varchar(15) NOT NULL,
  `mobile_2` varchar(15) DEFAULT NULL,
  `password` char(60) NOT NULL,
  `logo` varchar(100) DEFAULT NULL,
  `street` text,
  `city` varchar(20) DEFAULT NULL,
  `state` varchar(20) DEFAULT NULL,
  `country` varchar(20) DEFAULT NULL,
  `account_status` char(1) NOT NULL DEFAULT '1',
  `signup_date` datetime NOT NULL,
  `last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `login_status` char(1) NOT NULL DEFAULT '0',
  `last_login` datetime DEFAULT NULL,
  `deleted` char(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `admin`
--
ALTER TABLE `admin`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `email` (`email`),
  ADD UNIQUE KEY `mobile1` (`mobile1`);

--
-- Indexes for table `aura_admin_sessions`
--
ALTER TABLE `aura_admin_sessions`
  ADD KEY `ci_sessions_timestamp` (`timestamp`);

--
-- Indexes for table `blogs`
--
ALTER TABLE `blogs`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `title` (`title`),
  ADD KEY `uploaded_by` (`uploaded_by`);

--
-- Indexes for table `bl_comments`
--
ALTER TABLE `bl_comments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `blog_id` (`blog_id`);

--
-- Indexes for table `bl_replies`
--
ALTER TABLE `bl_replies`
  ADD PRIMARY KEY (`id`),
  ADD KEY `comment_id` (`comment_id`);

--
-- Indexes for table `projects`
--
ALTER TABLE `projects`
  ADD PRIMARY KEY (`id`),
  ADD KEY `user_id` (`user_id`),
  ADD KEY `category_id` (`category_id`);

--
-- Indexes for table `pr_categories`
--
ALTER TABLE `pr_categories`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `name` (`name`),
  ADD KEY `added_by` (`added_by`);

--
-- Indexes for table `pr_comments`
--
ALTER TABLE `pr_comments`
  ADD PRIMARY KEY (`id`),
  ADD KEY `project_id` (`project_id`);

--
-- Indexes for table `pr_images`
--
ALTER TABLE `pr_images`
  ADD PRIMARY KEY (`id`),
  ADD KEY `project_id` (`project_id`);

--
-- Indexes for table `pr_replies`
--
ALTER TABLE `pr_replies`
  ADD PRIMARY KEY (`id`),
  ADD KEY `comment_id` (`comment_id`);

--
-- Indexes for table `pr_tags`
--
ALTER TABLE `pr_tags`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `name` (`name`),
  ADD KEY `added_by` (`added_by`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `username` (`username`),
  ADD UNIQUE KEY `email` (`email`),
  ADD UNIQUE KEY `mobile_1` (`mobile_1`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `admin`
--
ALTER TABLE `admin`
  MODIFY `id` int(3) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `blogs`
--
ALTER TABLE `blogs`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `bl_comments`
--
ALTER TABLE `bl_comments`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `bl_replies`
--
ALTER TABLE `bl_replies`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `projects`
--
ALTER TABLE `projects`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `pr_categories`
--
ALTER TABLE `pr_categories`
  MODIFY `id` tinyint(4) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `pr_comments`
--
ALTER TABLE `pr_comments`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `pr_images`
--
ALTER TABLE `pr_images`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `pr_replies`
--
ALTER TABLE `pr_replies`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `pr_tags`
--
ALTER TABLE `pr_tags`
  MODIFY `id` tinyint(4) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Constraints for dumped tables
--

--
-- Constraints for table `blogs`
--
ALTER TABLE `blogs`
  ADD CONSTRAINT `blogs_ibfk_1` FOREIGN KEY (`uploaded_by`) REFERENCES `admin` (`id`);

--
-- Constraints for table `bl_comments`
--
ALTER TABLE `bl_comments`
  ADD CONSTRAINT `bl_comments_ibfk_1` FOREIGN KEY (`blog_id`) REFERENCES `blogs` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `bl_replies`
--
ALTER TABLE `bl_replies`
  ADD CONSTRAINT `bl_replies_ibfk_1` FOREIGN KEY (`comment_id`) REFERENCES `bl_comments` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `projects`
--
ALTER TABLE `projects`
  ADD CONSTRAINT `projects_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `projects_ibfk_2` FOREIGN KEY (`category_id`) REFERENCES `pr_categories` (`id`);

--
-- Constraints for table `pr_categories`
--
ALTER TABLE `pr_categories`
  ADD CONSTRAINT `pr_categories_ibfk_1` FOREIGN KEY (`added_by`) REFERENCES `admin` (`id`) ON DELETE NO ACTION;

--
-- Constraints for table `pr_comments`
--
ALTER TABLE `pr_comments`
  ADD CONSTRAINT `pr_comments_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `pr_images`
--
ALTER TABLE `pr_images`
  ADD CONSTRAINT `pr_images_ibfk_1` FOREIGN KEY (`project_id`) REFERENCES `projects` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `pr_replies`
--
ALTER TABLE `pr_replies`
  ADD CONSTRAINT `pr_replies_ibfk_1` FOREIGN KEY (`comment_id`) REFERENCES `pr_comments` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `pr_tags`
--
ALTER TABLE `pr_tags`
  ADD CONSTRAINT `pr_tags_ibfk_1` FOREIGN KEY (`added_by`) REFERENCES `admin` (`id`) ON DELETE NO ACTION;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;


text:
(function() {
  var LESSCompiler, less, sysPath,
    __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };

  less = require('less');

  sysPath = require('path');

  module.exports = LESSCompiler = (function() {

    LESSCompiler.prototype.brunchPlugin = true;

    LESSCompiler.prototype.type = 'stylesheet';

    LESSCompiler.prototype.extension = 'less';

    LESSCompiler.prototype._dependencyRegExp = /^ *@import ['"](.*)['"]/;

    function LESSCompiler(config) {
      this.config = config;
      this.getDependencies = __bind(this.getDependencies, this);

      null;
    }

    LESSCompiler.prototype.compile = function(data, path, callback) {
      var parser,
        _this = this;
      parser = new less.Parser({
        paths: [this.config.paths.root, sysPath.dirname(path)],
        filename: path
      });
      return parser.parse(data, function(error, tree) {
        var err, result;
        if (error != null) {
          return callback(error.message);
        }
        result = null;
        err = null;
        try {
          result = tree.toCSS();
        } catch (ex) {
          err = "" + ex.type + "Error:" + ex.message;
          if (ex.filename) {
            err += " in '" + ex.filename + ":" + ex.line + ":" + ex.column + "'";
          }
        }
        return callback(err, result);
      });
    };

    LESSCompiler.prototype.getDependencies = function(data, path, callback) {
      var dependencies, parent,
        _this = this;
      parent = sysPath.dirname(path);
      dependencies = data.split('\n').map(function(line) {
        return line.match(_this._dependencyRegExp);
      }).filter(function(match) {
        return (match != null ? match.length : void 0) > 0;
      }).map(function(match) {
        return match[1];
      }).filter(function(path) {
        return !!path && path !== 'nib';
      }).map(function(path) {
        if (sysPath.extname(path) !== ("." + _this.extension)) {
          return path + ("." + _this.extension);
        } else {
          return path;
        }
      }).map(function(path) {
        if (path.charAt(0) === '/') {
          return sysPath.join(_this.config.paths.root, path.slice(1));
        } else {
          return sysPath.join(parent, path);
        }
      });
      return process.nextTick(function() {
        return callback(null, dependencies);
      });
    };

    return LESSCompiler;

  })();

}).call(this);


text:
// Copyright 2011-2016 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.security.zynamics.binnavi.Gui.Debug.ToolbarPanel.Actions;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.ImageIcon;
import javax.swing.JFrame;

import com.google.common.base.Preconditions;
import com.google.security.zynamics.binnavi.Gui.Debug.ToolbarPanel.Implementations.CTraceFunctions;
import com.google.security.zynamics.binnavi.Gui.GraphWindows.Panels.IFrontEndDebuggerProvider;
import com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger;
import com.google.security.zynamics.binnavi.yfileswrap.zygraph.ZyGraph;

/**
 * This class can be used to start the trace mode in the debugger.
 */
public final class CStartTraceAction extends AbstractAction {
  /**
   * Used for serialization.
   */
  private static final long serialVersionUID = 5973796509140248996L;

  /**
   * Parent window used for dialogs.
   */
  private final JFrame m_parent;

  /**
   * The debugger where the trace happens.
   */
  private final IFrontEndDebuggerProvider m_debugger;

  /**
   * Graph to trace.
   */
  private final ZyGraph m_graph;

  /**
   * Creates a new start trace action.
   *
   * @param parent Parent window used for dialogs.
   * @param debugger The debugger where the trace happens.
   * @param graph Graph to trace.
   */
  public CStartTraceAction(
      final JFrame parent, final IFrontEndDebuggerProvider debugger, final ZyGraph graph) {
    m_parent = Preconditions.checkNotNull(parent, "IE00303: Parent argument can not be null");
    m_debugger = Preconditions.checkNotNull(debugger, "IE01538: Debugger argument can not be null");
    m_graph = Preconditions.checkNotNull(graph, "IE01539: Graph argument can not be null");

    putValue(Action.NAME, "BT");
    putValue(Action.SHORT_DESCRIPTION, "Start Trace Mode");
    putValue(Action.SMALL_ICON, new ImageIcon("data/record_up.jpg"));
  }

  @Override
  public void actionPerformed(final ActionEvent event) {
    final IDebugger debugger = m_debugger.getCurrentSelectedDebugger();

    if (debugger != null) {
      CTraceFunctions.startTrace(m_parent, debugger, m_graph, m_debugger.getTraceLogger(debugger));
    }
  }
}


text:
# kebabcase

> Convert a string to kebab case.

## Usage

```javascript
var kebabcase = require( '@stdlib/string/kebabcase' );
```

#### kebabcase( str )

Converts a string to kebab case.

```javascript
var str = kebabcase( 'Foo Bar' );
// returns 'foo-bar'

str = kebabcase( 'I am a tiny little house' );
// returns 'i-am-a-tiny-little-house'

str = kebabcase( 'Hello World!' );
// returns 'hello-world'
```

## Examples

```javascript
var kebabcase = require( '@stdlib/string/kebabcase' );

var str = 'foo bar baz';
var out = kebabcase( str );
// returns 'foo-bar-baz'

str = 'foo_baz';
out = kebabcase( str );
// returns 'foo-baz'

str = 'foo-bar-baz!';
out = kebabcase( str );
// returns 'foo-bar-baz'

str = 'beep    boop!';
out = kebabcase( str );
// returns 'beep-boop'

str = 'foo-baz';
out = kebabcase( str );
// returns 'foo-baz'

str = 'Welcome! 😀';
out = kebabcase( str );
// returns 'welcome-😀'
```

* * *

## CLI

### Usage

```text
Usage: kebabcase [options] [<string>]

Options:

  -h,    --help                Print this message.
  -V,    --version             Print the package version.
         --split sep           Delimiter for stdin data. Default: '/\\r?\\n/'.
```

### Notes

-   If the split separator is a [regular expression][mdn-regexp], ensure that the `split` option is either properly escaped or enclosed in quotes.

    ```bash
    # Not escaped...
    $ echo -n $'beEp booP\nisMobile' | kebabcase --split /\r?\n/

    # Escaped...
    $ echo -n $'beEp booP\nisMobile' | kebabcase --split /\\r?\\n/
    ```

-   The implementation ignores trailing delimiters.

### Examples

```bash
$ kebabcase 'hello world!'
hello-world
```

To use as a [standard stream][standard-streams],

```bash
$ echo -n 'beEp booP' | kebabcase
beep-boop
```

By default, when used as a [standard stream][standard-streams], the implementation assumes newline-delimited data. To specify an alternative delimiter, set the `split` option.

```bash
$ echo -n 'beep_boop\tisMobile' | kebabcase --split '\t'
beep-boop
is-mobile
```

* * *

## See Also

-   [`@stdlib/string/camelcase`][@stdlib/string/camelcase]: convert a string to camel case.
-   [`@stdlib/string/constantcase`][@stdlib/string/constantcase]: convert a string to constant case.
-   [`@stdlib/string/pascalcase`][@stdlib/string/pascalcase]: convert a string to Pascal case.
-   [`@stdlib/string/snakecase`][@stdlib/string/snakecase]: convert a string to snake case.

[standard-streams]: https://en.wikipedia.org/wiki/Standard_streams

[mdn-regexp]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions

[@stdlib/string/camelcase]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/string/camelcase

[@stdlib/string/constantcase]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/string/constantcase

[@stdlib/string/pascalcase]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/string/pascalcase

[@stdlib/string/snakecase]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/string/snakecase


text:
import json
try:
    # For Python 3.0 and later
    from urllib.error import HTTPError
    import urllib.request as urllib
except ImportError:
    # Fall back to Python 2's urllib2
    import urllib2 as urllib
    from urllib2 import HTTPError

url = 'https://review.opendev.org/projects/'

# This is what a project looks like
'''
  "openstack-attic/akanda": {
    "id": "openstack-attic%2Fakanda",
    "state": "READ_ONLY"
  },
'''

def is_in_openstack_namespace(proj):
    return proj.startswith('openstack/')

def has_grenade_plugin(proj):
    try:
        r = urllib.urlopen(
            "https://opendev.org/%s/src/branch/master/devstack/upgrade/upgrade.sh" % proj)
        return True
    except HTTPError as err:
        if err.code == 404:
            return False

r = urllib.urlopen(url)
projects = sorted(filter(is_in_openstack_namespace, json.loads(r.read()[4:])))

found_plugins = filter(has_grenade_plugin, projects)

for project in found_plugins:
    print(project[10:])


text:
define('lodash/internal/getLength', ['exports', 'lodash/internal/baseProperty'], function (exports, _lodashInternalBaseProperty) {
  'use strict';

  /**
   * Gets the "length" property value of `object`.
   *
   * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
   * that affects Safari on at least iOS 8.1-8.3 ARM64.
   *
   * @private
   * @param {Object} object The object to query.
   * @returns {*} Returns the "length" value.
   */
  var getLength = (0, _lodashInternalBaseProperty['default'])('length');

  exports['default'] = getLength;
});