text:
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="EmailAttribute.cs" company="Itransition">
//   Itransition (c) Copyright. All right reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
using System;
using System.Text.RegularExpressions;
using System.Web.Mvc;
using Framework.Core.Helpers.Regex;
using Framework.Mvc.ElementsTypes.Generic;

namespace Framework.Mvc.ElementsTypes.Custom
{
    /// <summary>
    /// Email element type attribute.
    /// </summary>
    public class EmailAttribute : TextBoxAttribute, IValidatableElement
    {
        /// <summary>
        /// Validates the specified element.
        /// </summary>
        /// <param name="modelState">State of the model.</param>
        /// <param name="name">The element name.</param>
        /// <param name="value">The element value.</param>
        public void Validate(ModelStateDictionary modelState, string name, string value)
        {
            if (String.IsNullOrEmpty(value))
            {
                return;
            }

            if (!Regex.IsMatch(value, RegexValidationConfig.GetPattern(RegexTemplates.Email)))
            {
                modelState.AddModelError(name, @"The field format is not valid.");
            }
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
void exit_qemu(int val);

#endif


text:
//
// This source code implements specifications defined by the Java
// Community Process. In order to remain compliant with the specification
// DO NOT add / change / or delete method signatures!
//
package javax.xml.registry.infomodel;

import javax.xml.registry.JAXRException;

/**
 * @version $Revision$ $Date$
 */
public interface URIValidator {
    boolean getValidateURI() throws JAXRException;

    void setValidateURI(boolean validate) throws JAXRException;
}


text:
import { Injectable } from '@angular/core'
import { CanActivate } from '@angular/router'
import { JwtHelperService } from '@auth0/angular-jwt'
import { Store } from '@ngrx/store'
import { Observable } from 'rxjs'
import { map, take } from 'rxjs/operators'

import * as AuthActions from '../store/auth.actions'
import * as fromAuth from '../store/auth.reducer'

@Injectable()
export class AuthGuard implements CanActivate {
  constructor(
    private store: Store<fromAuth.State>,
    public jwtHelper: JwtHelperService
  ) {}

  canActivate(): Observable<boolean> {
    return this.store.select(fromAuth.getIsLoggedIn).pipe(
      map(isLoggedIn => {
        if (this.jwtHelper.isTokenExpired()) {
          this.store.dispatch(new AuthActions.LoginRedirect())
          return false
        }

        if (!isLoggedIn) {
          this.store.dispatch(new AuthActions.RehydrateAuth())
        }

        return true
      }),
      take(1)
    )
  }
}


text:
if [ -z "${1}" ]; then
	echo "Please specify sync direction: \"to\" or \"from\"";
	exit;
fi
SYNCDIRECTION=$1

#Environment
if [ -z "${2}" ]; then
	echo "Please specify environment";
	exit;
fi
ENV=$2

if [[ "$ENV" == "Live" ]] && [[ "$SYNCDIRECTION" == "to" ]]; then
	echo "You are not allowed to sync to Live. Exiting.";
	echo "Note: if this is for your first deployment, uncomment this line.";
	exit;
fi

BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd ../../.. && pwd )";
MODULEDIR="$BASEDIR/ttools/sitesync-wordpress";

ENVVARS="$BASEDIR/ttools/core/lib/vars-for-env.sh $ENV"
eval `$ENVVARS`

#Overwrite remote with current
if [[ "$SYNCDIRECTION" == "to" ]]; then

	echo "Now Pushing Your Database & Assets to your $ENV environment...";

	echo "Dumping site...";
	$BASEDIR/ttools/sitesync-core/lib/dump-current-site.sh dump;

	echo "Now syncing files up to the $ENV environment...";
	$BASEDIR/ttools/sitesync-core/lib/sync-dump-to-env.sh $ENV;

	echo "Connecting with $ENV for import";
	#On the server we'll be doing the following

	#1. Loading db and files from the dump we just uploaded into the site
	SERVER_OVERWRITE_CMD="$ENV_REPODIR/ttools/sitesync-core/lib/overwrite-current-site.sh $ENV";
	#2. Replace the base url in the uploaded database with the one that's set on the server
	LOCAL_BASE_URL="$(php $MODULEDIR/lib/php/echo-base_url.php)"
	SERVER_REPLACE_CMD="$ENV_REPODIR/ttools/sitesync-wordpress/lib/replace-base-url-on-current-site.sh $LOCAL_BASE_URL $ENV";

	SERVER_COMMANDS="$SERVER_OVERWRITE_CMD;$SERVER_REPLACE_CMD;";

	#echo $SERVER_COMMANDS;

	ssh $ENV_CUSTOM_SSHCONNECTIONSTR -t $SERVER_COMMANDS

fi

#Overwrite current with remote
if [[ "$SYNCDIRECTION" == "from" ]]; then

	echo "Now Overwriting Current Site with Database & Assets from $ENV environment...";

	echo "Sniffing local path on $ENV...";

	SERVER_COMMANDS="$ENV_PHPPATH $ENV_REPODIR/ttools/sitesync-wordpress/lib/php/echo-base_url.php";
	SEARCH="$(ssh $ENV_CUSTOM_SSHCONNECTIONSTR -t $SERVER_COMMANDS)";
	#echo search is $SEARCH;

	echo "Dumping site on $ENV...";
	SERVER_COMMANDS="$ENV_REPODIR/ttools/sitesync-core/lib/dump-current-site.sh dump $ENV;";
	ssh $ENV_CUSTOM_SSHCONNECTIONSTR -t $SERVER_COMMANDS;

	echo "Downloading dump...";
	$BASEDIR/ttools/sitesync-core/lib/sync-dump-from-env.sh $ENV;

	echo "Overwriting current site...";
	$BASEDIR/ttools/sitesync-core/lib/overwrite-current-site.sh;

	echo "Replacing base url...";
	$MODULEDIR/lib/replace-base-url-on-current-site.sh $SEARCH;
fi


text:
python-finacc
=============

A financial calculation library for python
___

Modules
-------

### General (finacc.general)
TBD
___
### Banking (finacc.banking)
TBD
___
### Finantial Investment (finacc.invesment)
#### Inflation Rate
Calculate infration rate by initial cpi and ending cpi

```
finacc.investment.rate_of_inflation(initial_cpi, ending_cpi)
```

#### Real Rate of Return
Calculate the real interest rate that will return of a given interest rate effected by the inflation

```
finacc.investment.real_rate_of_return(nominal_rate, inflation_rate)
```

___


text:
<?php

require_once 'SimplifyKeys.php';
require_once 'MerchantModel.php';

$merchant = new Merchant;
$merchant->name = 'The Simplify Cake';
$merchant->header = 'Enjoy our delectable cupcakes.';
$merchant->description = 'We are a delivery only cupcake business. We specialize in made from scratch gourmet cupcakes. Our goal is to change your cupcake experience forever.';
$merchant->url = 'index.php'; //'http://www.simplifycake.com';
$merchant->urlDisplay = 'simplifycake.com';
$merchant->email = 'simplifycake@gmail.com';
$merchant->mainColor = '#F15E92';

$merchant->products[] = new Product('Mixed Box of Cupcakes',
	'You will get one box of mixed cupcakes in the mail. They will arrive in a sealed and chilled bag.',
	'assets/img/cupcake1.png',
	1000); //$10.00

$merchant->products[] = new Product('Rainbow Cupcake',
	'This is for a single box of rainbow cupcakes.',
	'assets/img/cupcake2.png',
	2000); //$20.00

$merchant->products[] = new Product('One Tiny Cake',
	'This is for one piece of our signature cake.',
	'assets/img/cupcake3.png',
	350); //$3.50

$merchant->shippingToStates = array('AK', 'AL', 'AR', 'AZ', 'CA', 'CO', 'CT', 'DC', 'DE', 'FL', 'GA', 'HI', 'IA', 'ID', 'IL', 'IN', 'KS', 'KY', 'LA', 'MA', 'MD', 'ME', 'MI', 'MN', 'MO', 'MS', 'MT', 'NC', 'ND', 'NE', 'NH', 'NJ', 'NM', 'NV', 'NY', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VA', 'VT', 'WA', 'WI', 'WV', 'WY');

// flag to enable Simplify hosted payments : https://www.simplify.com/commerce/docs/tools/hosted-payments
$merchant->enableHostedPayments = true;

?>


text:
package com.jsyn.unitgen;

import com.jsyn.ports.UnitOutputPort;

/**
 * Interface for things that have that have an output and an associated UnitGenerator.
 *
 * @author Phil Burk, (C) 2009 Mobileer Inc
 */
public interface UnitSource {
    public UnitOutputPort getOutput();

    public UnitGenerator getUnitGenerator();
}


text:
/* Generic and utility classes */
html,
body,
#tabs,
#tabs>li,
#tabs>li>section,
#main-view,
.display-chart-area{
    height:100%;
}

button:focus {
    outline:0;
}

ul, ol{
    padding-left: 0px;
}

body a{
    text-decoration:none;
    color: #444;
    cursor: pointer;
    padding: 6px 10px;
}

.clear-fix:after{
    content: '';
    display: block;
    clear: both;
}

.add-btn{
    position: relative;
}

.hidden{
    display: none;
}

.not-visible{
    visibility: hidden;
}

.bold-label{
    font-family: arial, sans-serif;
    font-weight: 700;
}

.border-left{
    border-left: 1px solid #666;
}

.red {
    color: red;
}

.blue {
    color: blue;
}

.plus-symbol:before {
    content: "+";
}

.tip-to-user{
    position: relative;
    pxfont-size: 0.75em;
    z-index: 5;
}

.close-parent{
    padding: 3px;
    margin: 0;
    position: absolute;
    right: 5px;
    top: 5px;
}

.checkbox-type-button,
.radio-type-button{
    -webkit-appearance: none;
    margin: 0;
    border: none;
    overflow: visible;
    font: inherit;
    color: #444;
    text-transform: none;
    display: inline-block;
    box-sizing: border-box;
    padding: 0 12px;
    background: #f5f5f5;
    vertical-align: middle;
    line-height: 28px;
    min-height: 30px;
    font-size: 1rem;
    text-decoration: none;
    text-align: center;
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 4px;
    text-shadow: 0 1px 0 #fff;
    cursor: pointer;
}
.checkbox-type-button.uk-active,
.radio-type-button.uk-active{
    background-color: #ddd;
    color: #444;
    font-weight: 800;
}

/** Dashboard header **/
.brand,
.brand:hover{
      position: relative;
      left: -20px;
      font-size: 26px;
      color: #fff;
}

.brand:before {
    content: "";
    display: inline-block;
    height: 35px;
    width: 45px;
    background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACsAAAAiCAQAAABsW+iDAAAA3klEQVRIx83Wuw3CMBAG4BshaahZIBUjsAKNB8gopqaiTpsRGMEjsANI3ADI+CElcTgKuLuQsyIrUvTJ+n1WDL7yJ8+pLggwH8BEM0ywEqXEbpdfLfZYA2CNvSCLDoZCJ8faCWt12HbtISht2Z+OA97QpXH9kh2zLd8D9cR2knyNZwnWxszLmvXKLyxdRbcIsgcBNgQRt+uCuzFhNotH6tDwWafMvn/FYB93FbZo0cXZxps0Gkk2opkPsBxr0rPPszRr/EaDBenVfsqW/XegO2F9dzCC7XQuohUTJq/NL1/k/oovlOCIAAAAAElFTkSuQmCC);
    background-position: 0 0;
    background-repeat: no-repeat;
    z-index:10;
}

#header-help:hover{
    color: #ffffff;
}

/** FORM related css **/

#form-area{
    background-color: rgb(250, 250, 250);
    padding: 20px 10px 20px 45px;
    height: 200%;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.time-range-selector-dropdown{
    position: relative;
    margin-top: 5px;
}

.date-time-selector-box {
    margin: 0 0 10px 0;
    border: 1px solid rgba(0, 0, 0, 0.2)
}

.view-dataset-selector,
.view-dashboard-selector,
.view-metric-selector,
.view-dimension-selector,
.view-filter-selector,
.view-date-range-selector{
    margin-top: 10px;

}

.view-dataset-selector>label,
.view-dashboard-selector>label,
.view-metric-selector>label,
.view-dimension-selector>label,
.view-filter-selector>label,
.view-date-range-selector>label{
    display: inline-block

}

#dashboard-settings{
    width: 100%;
    margin: 15px 0 0 0;
    padding: 0;
    border: solid 1px #d4d4d5;
    border-bottom: none;
    box-sizing: border-box;
}

.dashboard-settings-tab-content{
    list-style: none;
    -webkit-padding-start: 0px;
    margin: 0;
}

.dashboard-settings-li{
    position: relative;
    width: 100%;
    height: auto;
    margin: 0;
}

.dashboard-settings-label{
    font-size: 16px;
    font-weight: 300;
    line-height: 18px;
    color: #000;
    box-sizing: border-box;
    color: #303336;
    display: inline-block;
    margin: 0 0 1px 0;
    padding: 0 20px;
    text-align: center;
    width: 169px;
    height: 44px;
    padding: 10px;
    background-color: #f5f5f5;
}

.dashboard-settings-li td{
    padding: 5px;
}

.dashboard-settings-label-td{
     width: 169px;
     background-color: #f5f5f5;
}

.added-item{
    margin: 5px 0 5px 5px;
}

.remove-selection,
.remove-filter-selection{
    padding: 4px;
}

/* Dashboard header: Filter related */

.uk-dropdown.filter-panel{
    width:450px;
    display:table
}

.dimension-filter,
.value-filter{
    width:49%;
    line-height: 30px;
    display: table-cell;
    padding: 5px;
}

.filter-dimension-list{
    position: relative;
    top: 37px;
}

.filter-dimension-list,
.filter-dimension-value-list{
    background: #fff;
    vertical-align: top;
    border: 1px solid #ccc;
    height:200px;
    overflow-y: scroll;
    text-overflow: ellipsis;
}

.filter-dimension-value-list label{
    text-overflow: ellipsis;
}

.filter-dimension-option{
    overflow: hidden;
    line-height: 30px;
    border-bottom: 1px solid #ddd;
    padding: 0px;
}

.filter-dimension-option a{
    padding:8px 10px;
    display: inline-block;
    width: 100%;
}

.filter-dimension-option:hover{
    background-color: #00a8e6
}

.filter-dimension-option.uk-active{
    background-color: #ddd;
}

.filter-dimension-value-item{
    display:block;
    line-height:30px;
    border-bottom: 1px solid #ddd;
    padding-left:5px;
    text-overflow: ellipsis;
}

.added-filter{
    margin: 5px 0 5px 5px;
}

/* Form time selector */
.max-min-time-label{
    font-size: 0.65em;
}

.granularity-btn-group.vertical button{
    width: 250px;
}

/** Chart area **/

.chart-area{
    margin: 0;
    padding-left: 0px;
    height: 100%;
}

.display-chart-section{
    height: 100%;
    padding: 12px;;
}

.loader{
    position: absolute;
    top: 0;
    left: 0px;
    margin:0px;
    background-color: rgba(148, 148, 148, 0.7);
    z-index: 999;
    height: 200%;
    width: 100%;
}

.loader i{
    position: absolute;
    top: 10%;
    left: 50%;
}

#chart-control{
    font-size: 16px;
    font-weight: 300;
    line-height: 18px;
    display: inline-block;
    width: 148px;
    height:96%;
    border-right: 1px solid #d4d4d5;
    padding:10px;
}

#chart-types button{
    min-width:105px;
    margin: 5px;
}

.dimension-section-wrapper{
    border-bottom: 5px solid #ddd;
    margin-bottom:15px;
}

/* Contributors section*/
.metric-title{
    font-weight: 800;
}

.dimension-timeseries{
    width: 95%;
    height: 300px;
    position: relative;
    top: 40px;
}

.contributors-table .contributors-table{
    width: 100%;
    overflow-x: scroll;
}

.contributors-table .contributors-table.fixed-table-layout{
    table-layout: fixed;
}

.contributors-table td,
.contributors-table th{
    line-height: 8px;
    font-size: 0.65em;
    padding: 6px;
    font-family: Arial, sans-serif;
    color: #000;
    vertical-align: middle;
    text-align: center;
    border-bottom: 1px solid #666;
}

.contributors-table .row-title{
    border: 1px solid #666;
}

.contributors-table .select_all_cell{
    border: 1px solid #666;
    width:25px;
}

.contributors-table .contributors-table-date{
    font-weight: 600;
    width: 150px;
}

.contributors-table table tr td:first-child {
    word-wrap: break-word;
}

.contributors-table td:hover{
    color: #898989;
}

.contributors-table .divider-cell{
    border-left: 1px solid #666;
    border-top:none;
    border-right: 1px solid #666;

}

.contributors-table .divider-row td{
    line-height: 8px;
    height: 10px;
    border-bottom: 1px solid #666;
    margin-bottom: 0;
    text-align: left;
}

.contributors-table .data-row{
    border-top: 1px solid #666;
}

.contributors-table .table-time-cell{
    font-weight: 600;
}

.contributors-table .checkbox-cell{
    width:15px;
}
.contributors-table .dimension-value-cell{
    width:100px;
    word-wrap: break-word;
}

.contributors-table .heat-map-cell{
    border-right: 1px solid #666;
}

.contributors-table .dimension-value-cell{
    border: 1px solid #666;
    width: 100px;
}

.contributors-table .contributors-table-date,
.contributors-table .table-time-cell{
    border: 1px solid #666;
}

.contributors-table .checkbox-cell{
    width:15px;
    border: 1px solid #666;
    padding: 0px;
}

/** Tabular view related styling **/

#linechart-placeholder {
    display: inline-block;
    width: 83%;
    height: 300px;
}

#barchart-placeholder {
    display: inline-block;
    width: 83%;
    height: 150px;
}

.chart.legend span {
    display: inline-block;
    margin-right: 5px;
    text-align: center;
    cursor: pointer;
    color: white;
    font-size: 14px;
    padding: 3px;
}

.timeseries-legend-box{
    width:15%;
    line-height: 30px;
    padding: 5px;
    display: inline-block;
    position: absolute;
    top: 70px;
    right:10px;
}

.timeseries-legend-sub-box{
    background: #fff;
    vertical-align: top;
    border: 1px solid #ccc;
    max-height: 440px;
    overflow-y: scroll;
}

.timeseries-legend-box label{
    display:block;
    line-height:30px;
    padding-left:5px;
    text-overflow: ellipsis;
    font-size: 0.65em;
    font-family: Arial, sans-serif;
}

.legend-item{
    display:block;
    line-height:30px;
    border-bottom: 1px solid #ddd;
    padding-left:5px;
    text-overflow: ellipsis;
}

.legend-label-value-td{
    padding-left: 5px;
}

.metric-time-series-legend label,
.dimension-time-series-legend label{
    border-bottom: 1px solid #ddd;
}

#funnel-table-msg{
    width: 670px;
    float: right;
}

.flipped-scroll-container{
    width: 100%;
    overflow-y: auto;
}

.flipped-scroll-container,
.flipped-scroll-container table{
    transform:rotateX(180deg);
    -ms-transform:rotateX(180deg);
    -webkit-transform:rotateX(180deg);
}

#funnels-table .heat-map-cell:hover{
    cursor : pointer;
    text-decoration: underline;
}

#funnels-table thead{
    border-top: 1px solid #666;
}

#funnels-table td,
#funnels-table th{
    line-height: 8px;
    font-size: 0.65em;
    padding: 6px;
    font-family: Arial, sans-serif;
    color: #000;
    vertical-align: middle;
    text-align: center;
    border-bottom: 1px solid #666;
}

.dropdown-column{
    width:30px;
}

.funnels-table-dimension-box{
    background-color: #f5f5f5;
    width:205px;
    height:105px;
    border: 1px solid #333;
    padding: 15px;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
    -webkit-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
    -moz-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);

}

.funnels-table-dimension-list{
    vertical-align: top;
    border: 1px solid #000;
    height: 105px;
    overflow-y: scroll;
    text-overflow: ellipsis;
    margin: 0 10px;
    background: #fff;
}

.funnels-table-dimension-list .funnels-dimension-option{

    line-height: 8px;
    font-size: 10px;
    padding: 6px;
    font-family: Arial, sans-serif;
    color: #000;
    vertical-align: middle;
    text-align: center;
    border-bottom: 1px solid #666;
}

.date-time-selector-box{
    background-color: #fff;
    border: 2px solid #efefef;
    cursor: pointer;
    position: relative;
    z-index: 19;
    border-radius: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px"
}

.date-time-selector-box-table{
    border-spacing: 0;
    border-collapse: collapse;
}

.date-time-selector-box-current-td{
    padding: 3px;
    width:100%;
}

.time-input-form .uk-form-select{
    background-color: #fff;
}

.current-start-date,
.current-end-date{
    color: #1c2e3d;
    font-size: 14px;
    font-weight: 600;
}

.baseline-start-date,
.baseline-start-time,
.baseline-end-date,
.baseline-end-time{
    color: #333;
}

.date-devider{
    padding: 0px;
}

.comparison-display-label{
    color: #999;
    font-size:12px;
}

.arrow-down{
    padding:6px;
    border-radius: 0px 3px 3px 0px;
    -moz-border-radius: 0px 3px 3px 0px;
    -webkit-border-radius: 0px 3px 3px 0px;
}

/* Heat-map related */

.title-box{
    background-color: #f5f5f5;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    border-radius: 0px 0px 4px 4px;
    -moz-border-radius: 0px 0px 4px 4px;
    -webkit-border-radius: 0px 0px 4px 4px;
    border: 1px solid #ddd;
    height: auto;
    margin: 0 0 15px;
    padding: 5px 12px;
    width: 100%;
    border-bottom: 1px solid #ddd;
}

.title-box.half-width{
    width: 50%;
}

.title-box table{
    width: 100%;
}

.title-box th {
    font-size: 0.75em;
    font-weight: 400;
    padding: 5px;
}

.title-stat {
    font-size: 0.75em;
    font-weight: 800;
    text-align: start;
    padding: 5px;
}

#tooltip {
    position: absolute;
    width: 230px;
    height: auto;
    padding: 10px;
    background-color: white;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
    -webkit-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
    -moz-box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

#tooltip.hidden {
    display: none;
}

#tooltip table {
    width: 100%;
}

#tooltip tr {
    height:20px;
}

#tooltip td:nth-child(2) {
    text-align:right;
}

.dimension-treemap{
    cursor: pointer;
}

/* Dashboard view related */

#all-charts-metric-timeseries-line,
#all-charts-metric-timeseries-bar,
#all-charts-tabular-view-table,
#all-charts-dimension-timeseries-line,
#all-charts-dimension-timeseries-bar,
#all-charts-contributors,
#all-charts-heatmap{
    min-height: 200px;
}

/* Timeseries- view related */
#timeseries-display-chart-area .timeseries-legend-box{
   top:45px;
}

#timeseries-display-chart-area .timeseries-legend-sub-box{
   max-height: 350px;
}

/* Anommalies view related*/
#linechart-placeholder {
    display: inline-block;
    width: 83%;
    height: 300px;

}

#anomalies-display-chart-section #barchart-placeholder {
    display: none;
}

#anomalies-display-chart-section{
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    margin: auto;
    position: relative;
    width: 960px;
}

#anomalies-display-chart-section form {
    position: absolute;
    right: 10px;
    top: 10px;
}

#anomalies-display-chart-area .timeseries-legend-sub-box{
    max-height: 250px;
}

#anomalies-table{
    width:100%;
    border: 1px solid #444;
}

#anomalies-table .metric-label:hover,
#anomalies-table .heat-map-cell:hover{
    cursor : pointer;
    text-decoration: underline;
}

#anomalies-table thead{
    border-top: 1px solid #666;
}

#anomalies-table td,
#anomalies-table th{
    line-height: 8px;
    font-size: 0.65em;
    padding: 6px;
    font-family: Arial, sans-serif;
    color: #000;
    vertical-align: middle;
    text-align: center;
    border-bottom: 1px solid #666;

}

/* D3 START*/
path {
    stroke: steelblue;
    stroke-width: 2;
    fill: none;
}

.axis path,
.axis line {
    fill: none;
    stroke: grey;
    stroke-width: 1;
    shape-rendering: crispEdges;
}

.legend {
    font-size: 16px;
    font-weight: bold;
    text-anchor: middle;
}
.svg-container {
    display: inline-block;
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* aspect ratio */
    vertical-align: top;
    overflow: hidden;
}
.svg-content-responsive {
    display: inline-block;
    position: absolute;
    top: 10px;
    left: 0;
}

/*D3 TREEMAP*/

.node {
    border: solid 1px white;
    font: 10px sans-serif;
    line-height: 12px;
    overflow: hidden;
    position: absolute;
    text-indent: 2px;
}

/*c3*/
[class*=baseline]{
  stroke-dasharray: 5,5;
}

/* UIKIT overwrite */
.uk-button-group.vertical button{
    display: block;
    border-radius: 0;
}

.uk-button-group.vertical button:first-child{
    border-radius: 5px 5px 0 0;
}

.uk-button-group.vertical button:last-child{
    border-radius: 0 0 5px 5px;
}

.uk-info-circle:before {
    color: #ffffff;
}


text:
var fs = require('fs'),
	json5 = require('json5');

module.exports = function (grunt) {

	grunt.loadNpmTasks('grunt-buster');

	grunt.initConfig({
		buster: {
			test: {
				config: 'test/buster.js',
				reporter: 'specification',
				color: 'none'
			}
		},
		lint: {
			files: ['*.js', 'test/**/*.js', 'transforms/**/*.js', 'events/**/*.js', 'streams/**/*.js']
		},
		jshint: {
			// hack until proper .jshintrc detection is working in grunt
			options: json5.parse('' + fs.readFileSync('.jshintrc'))
		}
	});

	// Default task.
	grunt.registerTask('default', 'lint buster');

};


text:
<!doctype html>

	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width">
	<title>Attributes - ng-i18next</title>

			Change language to:

			English

			German

		Link

			<p ng-i18next="directive.attr.titleOnly"></p>

			<a href="#" ng-i18next="[title]hello">Link</a>

			<a href="#" ng-i18next="[title]hello;content">Link</a>

			<a href="#" ng-i18next="[title]hello;[html]contentHTML">Link</a>


text:
<?php

namespace Ambta\Component\MVCEngine\Application;

/**
 * Routing, in charge of being an determined route object after initialization
 *
 * Supports PHP 5.4+
 *
 * @package     Ambta\Component\MVCEngine\Application
 * @version     0.0.1
 * @author      Lars van den Bosch <lars@ambta.com>
 * @copyright   (c) 2015 Ambta <https://www.ambta.com>
 */
class Routing
{
    /* @var string */
    private $name;

    /* @var string */
    private $pattern;

    /* @var string */
    private $controller;

    /* @var string */
    private $action;

    /* @var array */
    private $params;

    /**
     * Constructor, checks if mandatory routing properties are set
     *
     * @author Lars van den Bosch <lars@ambta.com>
     * @param $name
     * @param $pattern
     * @param $controller
     * @param $action
     * @param array $params
     * @throws \Exception
     */
    public function __construct($name, $pattern, $controller, $action, $params = array())
    {
        /**
         * Mandatory route property check
         */
        if(true === empty($pattern) || true === empty($controller) || true === empty($action))
        {
            throw new \Exception("Mandatory routing property missing");
        }

        if(substr($action, -6) != "Action")
        {
            $action = $action."Action";
        }

        $this->name = $name;
        $this->pattern = $pattern;
        $this->controller = $controller;
        $this->action = $action;
        $this->params = $params;
    }

    /**
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * @return string
     */
    public function getPattern()
    {
        return $this->pattern;
    }

    /**
     * @return string
     */
    public function getController()
    {
        return $this->controller;
    }

    /**
     * @return string
     */
    public function getAction()
    {
        return $this->action;
    }

    /**
     * @return array
     */
    public function getParams()
    {
        return $this->params;
    }
}


text:
using System;
using System.Collections.Generic;
using System.Text;

namespace KLib
{
    public class KRPCData
    {

        public KRPCBatchRequest request;
        public KRPCResponse response;

    }
}


text:
package dao

import (
	"context"
	"database/sql"
	"fmt"
	"strings"
	"time"

	"go-common/app/interface/main/playlist/model"
	xsql "go-common/library/database/sql"
	"go-common/library/log"
	"go-common/library/xstr"
)

const (
	_plArcSub              = 100
	_plArcSQL              = "SELECT aid,sort,`desc` FROM playlist_archive_%s WHERE pid = ? AND aid = ?"
	_plArcsSQL             = "SELECT aid,sort,`desc` FROM playlist_archive_%s WHERE pid = ? ORDER BY sort"
	_plArcAddSQL           = "INSERT INTO playlist_archive_%s (pid,aid,sort,`desc`) VALUES (?,?,?,?)"
	_plArcBatchAddSQL      = "INSERT INTO playlist_archive_%s (pid,aid,sort,`desc`) VALUES %s"
	_plArcDelSQL           = "DELETE FROM playlist_archive_%s WHERE pid = ? AND aid = ?"
	_plArcDelByPidSQL      = "DELETE FROM playlist_archive_%s WHERE pid = ?"
	_plArcBatchDelSQL      = "DELETE FROM playlist_archive_%s WHERE pid = ? AND aid in (%s)"
	_plArcDescEditSQL      = "UPDATE playlist_archive_%s SET `desc` = ? WHERE pid = ? AND aid = ?"
	_plArcSortEditSQL      = "UPDATE playlist_archive_%s SET sort = ? WHERE pid = ? AND aid = ?"
	_plArcSortBatchEditSQL = "UPDATE playlist_archive_%s SET sort = CASE %s END WHERE pid = ? AND aid IN (%s)"
	_plAddSQL              = "INSERT INTO playlist_stat (mid,fid,is_deleted,view,reply,fav,share) VALUES (?,?,0,0,0,0,0) ON DUPLICATE KEY UPDATE mid=?,fid=?,is_deleted=0,view=0,reply=0,fav=0,share=0"
	_plEditSQL             = "UPDATE playlist_stat SET mtime = ?  WHERE id = ?"
	_plDelSQL              = "UPDATE playlist_stat set is_deleted = 1 WHERE id = ?"
	_plByMidSQL            = "SELECT id,mid,fid,view,reply,fav,`share`,mtime  FROM playlist_stat WHERE is_deleted = 0 AND mid = ?"
	_plByPidsSQL           = "SELECT id,mid,fid,view,reply,fav,`share`,mtime  FROM playlist_stat WHERE id in (%s)"
	_plByPidSQL            = "SELECT id,mid,fid,view,reply,fav,`share`,mtime  FROM playlist_stat WHERE id = ?"
)

func plArcHit(pid int64) string {
	return fmt.Sprintf("%02d", pid%_plArcSub)
}

// Video get video by pid and aid
func (d *Dao) Video(c context.Context, pid, aid int64) (res *model.ArcSort, err error) {
	res = &model.ArcSort{}
	row := d.db.QueryRow(c, fmt.Sprintf(_plArcSQL, plArcHit(pid)), pid, aid)
	if err = row.Scan(&res.Aid, &res.Sort, &res.Desc); err != nil {
		if err == sql.ErrNoRows {
			err = nil
		} else {
			log.Error("Video:row.Scan error(%v)", err)
		}
	}
	return
}

// Videos get playlist videos.
func (d *Dao) Videos(c context.Context, pid int64) (res []*model.ArcSort, err error) {
	var rows *xsql.Rows
	if rows, err = d.videosStmt[plArcHit(pid)].Query(c, pid); err != nil {
		log.Error("d.videosStmt[%s].Query(%d) error(%v)", plArcHit(pid), pid, err)
		return
	}
	defer rows.Close()
	for rows.Next() {
		r := new(model.ArcSort)
		if err = rows.Scan(&r.Aid, &r.Sort, &r.Desc); err != nil {
			log.Error("row.Scan() error(%v)", err)
			return
		}
		res = append(res, r)
	}
	if err = rows.Err(); err != nil {
		log.Error("rows.Err() error(%v)", err)
	}
	return
}

// AddArc add archive to playlist.
func (d *Dao) AddArc(c context.Context, pid, aid, sort int64, desc string) (lastID int64, err error) {
	var res sql.Result
	if res, err = d.db.Exec(c, fmt.Sprintf(_plArcAddSQL, plArcHit(pid)), pid, aid, desc, sort); err != nil {
		log.Error("AddArc: db.Exec(%d,%d,%d,%s) error(%v)", pid, aid, sort, desc, err)
		return
	}
	return res.LastInsertId()
}

// BatchAddArc add archives to playlist.
func (d *Dao) BatchAddArc(c context.Context, pid int64, arcSorts []*model.ArcSort) (lastID int64, err error) {
	var (
		res    sql.Result
		values []string
	)
	for _, v := range arcSorts {
		values = append(values, fmt.Sprintf("(%d,%d,%d,'%s')", pid, v.Aid, v.Sort, v.Desc))
	}
	if res, err = d.db.Exec(c, fmt.Sprintf(_plArcBatchAddSQL, plArcHit(pid), strings.Join(values, ","))); err != nil {
		log.Error("BatchAddArc: db.Exec(%d) error(%v)", pid, err)
		return
	}
	return res.LastInsertId()
}

// DelArc delete playlist archive.
func (d *Dao) DelArc(c context.Context, pid, aid int64) (affected int64, err error) {
	var res sql.Result
	if res, err = d.db.Exec(c, fmt.Sprintf(_plArcDelSQL, plArcHit(pid)), pid, aid); err != nil {
		log.Error("DelArc: db.Exec(%d,%d) error(%v)", pid, aid, err)
		return
	}
	return res.RowsAffected()
}

// BatchDelArc delete archives from  playlist.
func (d *Dao) BatchDelArc(c context.Context, pid int64, aids []int64) (affected int64, err error) {
	var res sql.Result
	if res, err = d.db.Exec(c, fmt.Sprintf(_plArcBatchDelSQL, plArcHit(pid), xstr.JoinInts(aids)), pid); err != nil {
		log.Error("BatchDelArc: db.Exec(%d,%v) error(%v)", pid, aids, err)
		return
	}
	return res.RowsAffected()
}

// UpdateArcDesc update playlist arc desc.
func (d *Dao) UpdateArcDesc(c context.Context, pid, aid int64, desc string) (affected int64, err error) {
	var res sql.Result
	if res, err = d.db.Exec(c, fmt.Sprintf(_plArcDescEditSQL, plArcHit(pid)), desc, pid, aid); err != nil {
		log.Error("UpdateArcDesc: db.Exec(%d,%d,%s) error(%v)", pid, aid, desc, err)
		return
	}
	return res.RowsAffected()
}

// UpdateArcSort update playlist arc sort.
func (d *Dao) UpdateArcSort(c context.Context, pid, aid, sort int64) (affected int64, err error) {
	var res sql.Result
	if res, err = d.db.Exec(c, fmt.Sprintf(_plArcSortEditSQL, plArcHit(pid)), sort, pid, aid); err != nil {
		log.Error("UpdateArcSort: db.Exec(%d,%d,%d) error(%v)", pid, aid, sort, err)
		return
	}
	return res.RowsAffected()
}

// BatchUpdateArcSort batch update playlist arc sort.
func (d *Dao) BatchUpdateArcSort(c context.Context, pid int64, arcSorts []*model.ArcSort) (affected int64, err error) {
	var (
		caseStr string
		aids    []int64
		res     sql.Result
	)
	for _, v := range arcSorts {
		caseStr = fmt.Sprintf("%s WHEN aid = %d THEN %d", caseStr, v.Aid, v.Sort)
		aids = append(aids, v.Aid)
	}
	if res, err = d.db.Exec(c, fmt.Sprintf(_plArcSortBatchEditSQL, plArcHit(pid), caseStr, xstr.JoinInts(aids)), pid); err != nil {
		log.Error("BatchUpdateArcSort: db.Exec(%d,%s,%v) error(%v)", pid, caseStr, aids, err)
		return
	}
	return res.RowsAffected()
}

//Add playlist stat.
func (d *Dao) Add(c context.Context, mid, fid int64) (lastID int64, err error) {
	var res sql.Result
	if res, err = d.db.Exec(c, _plAddSQL, mid, fid, mid, fid); err != nil {
		log.Error("Add:db.Exec(%d,%d) error(%v)", mid, fid, err)
		return
	}
	return res.LastInsertId()
}

// Del playlist stat.
func (d *Dao) Del(c context.Context, pid int64) (affected int64, err error) {
	var (
		res sql.Result
		tx  *xsql.Tx
	)
	if tx, err = d.db.Begin(c); err != nil {
		log.Error("d.db.Begin error(%v)", err)
		return
	}
	if res, err = tx.Exec(_plDelSQL, pid); err != nil {
		tx.Rollback()
		log.Error("DelPlaylist: db.Exec(%d) error(%v)", pid, err)
		return
	}
	if _, err = d.db.Exec(c, fmt.Sprintf(_plArcDelByPidSQL, plArcHit(pid)), pid); err != nil {
		tx.Rollback()
		log.Error("DelArc: db.Exec(%d) error(%v)", pid, err)
		return
	}
	if err = tx.Commit(); err != nil {
		log.Error("tx.Commit error(%v)", err)
		return
	}
	return res.RowsAffected()
}

// Update playlist stat.
func (d *Dao) Update(c context.Context, pid int64) (affected int64, err error) {
	var res sql.Result
	if res, err = d.db.Exec(c, _plEditSQL, time.Now(), pid); err != nil {
		log.Error("Update mtime: db.Exec(%d) error(%v)", pid, err)
		return
	}
	return res.RowsAffected()
}

// PlsByMid get playlist by mid.
func (d *Dao) PlsByMid(c context.Context, mid int64) (res []*model.PlStat, err error) {
	var (
		rows *xsql.Rows
	)
	if rows, err = d.db.Query(c, _plByMidSQL, mid); err != nil {
		log.Error("PlsByMid:d.db.Query(%d) error(%v)", mid, err)
		return
	}
	defer rows.Close()
	for rows.Next() {
		r := new(model.PlStat)
		if err = rows.Scan(&r.ID, &r.Mid, &r.Fid, &r.View, &r.Reply, &r.Fav, &r.Share, &r.MTime); err != nil {
			log.Error("PlsByMid:row.Scan() error(%v)", err)
			return
		}
		res = append(res, r)
	}
	if err = rows.Err(); err != nil {
		log.Error("rows.Err() error(%v)", err)
	}
	return
}

// PlsByPid get playlist stat by pids.
func (d *Dao) PlsByPid(c context.Context, pids []int64) (res []*model.PlStat, err error) {
	var (
		rows *xsql.Rows
	)
	if rows, err = d.db.Query(c, fmt.Sprintf(_plByPidsSQL, xstr.JoinInts(pids))); err != nil {
		log.Error("PlsByPid: db.Exec(%s) error(%v)", xstr.JoinInts(pids), err)
		return
	}
	defer rows.Close()
	for rows.Next() {
		r := new(model.PlStat)
		if err = rows.Scan(&r.ID, &r.Mid, &r.Fid, &r.View, &r.Reply, &r.Fav, &r.Share, &r.MTime); err != nil {
			log.Error("PlsByPid:row.Scan() error(%v)", err)
			return
		}
		res = append(res, r)
	}
	if err = rows.Err(); err != nil {
		log.Error("rows.Err() error(%v)", err)
	}
	return
}

// PlByPid get playlist by pid.
func (d *Dao) PlByPid(c context.Context, pid int64) (res *model.PlStat, err error) {
	res = &model.PlStat{}
	row := d.db.QueryRow(c, _plByPidSQL, pid)
	if err = row.Scan(&res.ID, &res.Mid, &res.Fid, &res.View, &res.Reply, &res.Fav, &res.Share, &res.MTime); err != nil {
		if err == sql.ErrNoRows {
			err = nil
		} else {
			log.Error("PlByPid:row.Scan error(%v)", err)
		}
	}
	return
}


text:
package sarama

import (
	"fmt"
	"testing"
	"time"
)

var (
	produceResponseNoBlocksV0 = []byte{
		0x00, 0x00, 0x00, 0x00}

	produceResponseManyBlocksVersions = [][]byte{
		{
			0x00, 0x00, 0x00, 0x01,

			0x00, 0x03, 'f', 'o', 'o',
			0x00, 0x00, 0x00, 0x01,

			0x00, 0x00, 0x00, 0x01, // Partition 1
			0x00, 0x02, // ErrInvalidMessage
			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, // Offset 255
		}, {
			0x00, 0x00, 0x00, 0x01,

			0x00, 0x03, 'f', 'o', 'o',
			0x00, 0x00, 0x00, 0x01,

			0x00, 0x00, 0x00, 0x01, // Partition 1
			0x00, 0x02, // ErrInvalidMessage
			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, // Offset 255

			0x00, 0x00, 0x00, 0x64, // 100 ms throttle time
		}, {
			0x00, 0x00, 0x00, 0x01,

			0x00, 0x03, 'f', 'o', 'o',
			0x00, 0x00, 0x00, 0x01,

			0x00, 0x00, 0x00, 0x01, // Partition 1
			0x00, 0x02, // ErrInvalidMessage
			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, // Offset 255
			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xE8, // Timestamp January 1st 0001 at 00:00:01,000 UTC (LogAppendTime was used)

			0x00, 0x00, 0x00, 0x64, // 100 ms throttle time
		},
	}
)

func TestProduceResponseDecode(t *testing.T) {
	response := ProduceResponse{}

	testVersionDecodable(t, "no blocks", &response, produceResponseNoBlocksV0, 0)
	if len(response.Blocks) != 0 {
		t.Error("Decoding produced", len(response.Blocks), "topics where there were none")
	}

	for v, produceResponseManyBlocks := range produceResponseManyBlocksVersions {
		t.Logf("Decoding produceResponseManyBlocks version %d", v)
		testVersionDecodable(t, "many blocks", &response, produceResponseManyBlocks, int16(v))
		if len(response.Blocks) != 1 {
			t.Error("Decoding produced", len(response.Blocks), "topics where there was 1")
		}
		if len(response.Blocks["foo"]) != 1 {
			t.Error("Decoding produced", len(response.Blocks["foo"]), "partitions for 'foo' where there was one")
		}
		block := response.GetBlock("foo", 1)
		if block == nil {
			t.Error("Decoding did not produce a block for foo/1")
		} else {
			if block.Err != ErrInvalidMessage {
				t.Error("Decoding failed for foo/2/Err, got:", int16(block.Err))
			}
			if block.Offset != 255 {
				t.Error("Decoding failed for foo/1/Offset, got:", block.Offset)
			}
			if v >= 2 {
				if block.Timestamp != time.Unix(1, 0) {
					t.Error("Decoding failed for foo/2/Timestamp, got:", block.Timestamp)
				}
			}
		}
		if v >= 1 {
			if expected := 100 * time.Millisecond; response.ThrottleTime != expected {
				t.Error("Failed decoding produced throttle time, expected:", expected, ", got:", response.ThrottleTime)
			}
		}
	}
}

func TestProduceResponseEncode(t *testing.T) {
	response := ProduceResponse{}
	response.Blocks = make(map[string]map[int32]*ProduceResponseBlock)
	testEncodable(t, "empty", &response, produceResponseNoBlocksV0)

	response.Blocks["foo"] = make(map[int32]*ProduceResponseBlock)
	response.Blocks["foo"][1] = &ProduceResponseBlock{
		Err:       ErrInvalidMessage,
		Offset:    255,
		Timestamp: time.Unix(1, 0),
	}
	response.ThrottleTime = 100 * time.Millisecond
	for v, produceResponseManyBlocks := range produceResponseManyBlocksVersions {
		response.Version = int16(v)
		testEncodable(t, fmt.Sprintf("many blocks version %d", v), &response, produceResponseManyBlocks)
	}
}

func TestProduceResponseEncodeInvalidTimestamp(t *testing.T) {
	response := ProduceResponse{}
	response.Version = 2
	response.Blocks = make(map[string]map[int32]*ProduceResponseBlock)
	response.Blocks["t"] = make(map[int32]*ProduceResponseBlock)
	response.Blocks["t"][0] = &ProduceResponseBlock{
		Err:    ErrNoError,
		Offset: 0,
		// Use a timestamp before Unix time
		Timestamp: time.Unix(0, 0).Add(-1 * time.Millisecond),
	}
	response.ThrottleTime = 100 * time.Millisecond
	_, err := encode(&response, nil)
	if err == nil {
		t.Error("Expecting error, got nil")
	}
	if _, ok := err.(PacketEncodingError); !ok {
		t.Error("Expecting PacketEncodingError, got:", err)
	}
}


text:
namespace chrono {

/// Specialized class for representing a 6-DOF item for a
/// system, that is a 3D rigid body, with mass matrix and
/// associate variables (a 6 element vector, ex.speed)
/// This is an abstract class, specialized for example in
/// ChVariablesBodyOwnMass and ChVariablesBodySharedMass.

class ChApi ChVariablesBody : public ChVariables {

    // Tag needed for class factory in archive (de)serialization:
    CH_FACTORY_TAG(ChVariablesBody)

  private:
    void* user_data;

  public:
    ChVariablesBody() : ChVariables(6), user_data(NULL) {}
    virtual ~ChVariablesBody() {}

    /// Assignment operator: copy from other object
    ChVariablesBody& operator=(const ChVariablesBody& other);

    /// Get the mass associated with translation of body
    virtual double GetBodyMass() const = 0;

    /// Access the 3x3 inertia matrix
    virtual ChMatrix33<>& GetBodyInertia() = 0;
    virtual const ChMatrix33<>& GetBodyInertia() const = 0;

    /// Access the 3x3 inertia matrix inverted
    virtual ChMatrix33<>& GetBodyInvInertia() = 0;
    virtual const ChMatrix33<>& GetBodyInvInertia() const = 0;

    /// The number of scalar variables in the vector qb
    /// (dof=degrees of freedom)
    virtual int Get_ndof() const override { return 6; }

    void* GetUserData() { return this->user_data; }
    void SetUserData(void* mdata) { this->user_data = mdata; }
};

}  // end namespace chrono

#endif


text:
namespace Xamarin.Forms.Pages
{
	public class DirectoryPage : DataPage
	{
		public static readonly BindableProperty IsGroupingEnabledProperty = BindableProperty.Create(nameof(IsGroupingEnabled), typeof(bool), typeof(DirectoryPage), default(bool));

		public bool IsGroupingEnabled
		{
			get { return (bool)GetValue(IsGroupingEnabledProperty); }
			set { SetValue(IsGroupingEnabledProperty, value); }
		}
	}
}


text:
from __future__ import unicode_literals

from django.db import models, migrations
import open_connect.connect_core.utils.models
from django.conf import settings

class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('auth', '0006_require_contenttypes_0002'),
    ]

    operations = [
        migrations.CreateModel(
            name='Group',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('private', models.BooleanField(default=False, help_text=b'Membership to private groups is moderated.')),
                ('published', models.BooleanField(default=True, help_text=b'Published groups can be seen by all users. Unpublished groups can only be seen if you have the link.', verbose_name='Publish this group')),
                ('moderated', models.BooleanField(default=False, help_text=b'Posts by users must be moderated by an admin.', verbose_name='Moderate this group')),
                ('featured', models.BooleanField(default=False, help_text=b'Official groups are managed by staff and appear first in search results.', db_index=True, verbose_name='This is an official group')),
                ('member_list_published', models.BooleanField(default=True, help_text=b'Group member list is public')),
                ('display_location', models.CharField(max_length=100, blank=True)),
                ('latitude', models.FloatField(null=True, blank=True)),
                ('longitude', models.FloatField(null=True, blank=True)),
                ('radius', models.IntegerField(null=True, blank=True)),
                ('is_national', models.BooleanField(default=True, db_index=True)),
                ('description', models.TextField(blank=True)),
                ('state', models.CharField(blank=True, max_length=3, db_index=True, choices=[(b'AL', b'AL'), (b'AK', b'AK'), (b'AZ', b'AZ'), (b'AR', b'AR'), (b'CA', b'CA'), (b'CO', b'CO'), (b'CT', b'CT'), (b'DE', b'DE'), (b'DC', b'DC'), (b'FL', b'FL'), (b'GA', b'GA'), (b'HI', b'HI'), (b'ID', b'ID'), (b'IL', b'IL'), (b'IN', b'IN'), (b'IA', b'IA'), (b'KS', b'KS'), (b'KY', b'KY'), (b'LA', b'LA'), (b'ME', b'ME'), (b'MD', b'MD'), (b'MA', b'MA'), (b'MI', b'MI'), (b'MN', b'MN'), (b'MS', b'MS'), (b'MO', b'MO'), (b'MT', b'MT'), (b'NE', b'NE'), (b'NV', b'NV'), (b'NH', b'NH'), (b'NJ', b'NJ'), (b'NM', b'NM'), (b'NY', b'NY'), (b'NC', b'NC'), (b'ND', b'ND'), (b'OH', b'OH'), (b'OK', b'OK'), (b'OR', b'OR'), (b'PA', b'PA'), (b'RI', b'RI'), (b'SC', b'SC'), (b'SD', b'SD'), (b'TN', b'TN'), (b'TX', b'TX'), (b'UT', b'UT'), (b'VT', b'VT'), (b'VA', b'VA'), (b'WA', b'WA'), (b'WV', b'WV'), (b'WI', b'WI'), (b'WY', b'WY')])),
                ('tos_accepted_at', models.DateTimeField(null=True, blank=True)),
                ('status', models.CharField(default=b'active', max_length=50, db_index=True, choices=[(b'active', b'Active'), (b'deleted', b'Deleted')])),
                ('created_by', models.ForeignKey(to=settings.AUTH_USER_MODEL, null=True)),
                ('group', models.OneToOneField(to='auth.Group')),
                ('owners', models.ManyToManyField(related_name='owned_groups_set', to=settings.AUTH_USER_MODEL, blank=True)),
                ('whitelist_users', models.ManyToManyField(related_name='whitelist_set', to=settings.AUTH_USER_MODEL, blank=True)),
            ],
            options={
                'ordering': ['-featured', '-is_national', 'group__name'],
                'permissions': (('can_edit_any_group', 'Can edit any group.'),)
            },
            bases=(open_connect.connect_core.utils.models.CacheMixinModel, models.Model),
        ),
        migrations.CreateModel(
            name='GroupRequest',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('moderated_at', models.DateTimeField(null=True, blank=True)),
                ('approved', models.NullBooleanField()),
                ('group', models.ForeignKey(to='groups.Group')),
                ('moderated_by', models.ForeignKey(related_name='approved_by', blank=True, to=settings.AUTH_USER_MODEL, null=True)),
                ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
            bases=(open_connect.connect_core.utils.models.CacheMixinModel, models.Model),
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('slug', models.SlugField(unique=True)),
                ('name', models.CharField(max_length=127)),
                ('color', models.CharField(default=b'#000000', max_length=7, verbose_name=b'Category Color')),
            ],
            options={
                'verbose_name': 'Category',
                'verbose_name_plural': 'Categories',
            },
            bases=(open_connect.connect_core.utils.models.CacheMixinModel, models.Model),
        ),
    ]


text:
package li.l1t.common.shared.uuid;

import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.google.common.util.concurrent.UncheckedExecutionException;
import li.l1t.common.lib.com.mojang.api.profiles.HttpProfileRepository;
import li.l1t.common.lib.com.mojang.api.profiles.Profile;
import li.l1t.common.util.UUIDHelper;
import org.bukkit.plugin.ServicePriority;
import org.jetbrains.annotations.Nullable;

import javax.annotation.Nonnull;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;

/**
 * A {@link UUIDRepository} backed by the Mojang Name→UUID SOAP API.
 * This impl only supports Name→UUID lookup, reverse lookup can only be provided in a limited manner, by
 * checking cached UUIDs.
 *
 * @author xxyy
 * @since 14.7.14
 */
public class MojangUUIDRepository implements UUIDRepository {
    private static final HttpProfileRepository HTTP_PROFILE_REPOSITORY = new HttpProfileRepository("minecraft");
    private final LoadingCache<String, UUID> uuidCache = CacheBuilder.newBuilder()
            .expireAfterWrite(60, TimeUnit.MINUTES)
            .maximumSize(4_200L)
            .build(new CacheLoader<String, UUID>() {
                @Override
                @Nonnull
                public UUID load(@Nonnull String name) throws UnknownKeyException, InvalidResultException {
                    Profile[] profiles = HTTP_PROFILE_REPOSITORY.findProfilesByNames(name);

                    if (profiles.length == 1 && !profiles[0].isDemo()) {
                        return profiles[0].getUniqueId();
                    } else if (profiles.length == 0) {
                        throw new UnknownKeyException();
                    } else {
                        throw new InvalidResultException(profiles);
                    }
                }
            });

    @Nonnull
    private UUIDRepository parent = EmptyUUIDRepository.INSTANCE;

    @Override
    public UUID forName(String name) {
        if (UUIDHelper.isValidUUID(name)) {
            return UUIDHelper.getFromString(name);
        }
        try {
            return uuidCache.getUnchecked(name);
        } catch (UncheckedExecutionException e) {
            if (e.getCause() instanceof UnknownKeyException) {
                return parent.forName(name);
            } else {
                throw e;
            }
        }
    }

    @Nonnull
    @Override
    public UUID forNameChecked(String name) throws UnknownKeyException, InvalidResultException {
        if (UUIDHelper.isValidUUID(name)) {
            return UUIDHelper.getFromString(name);
        }
        try {
            return uuidCache.get(name);
        } catch (ExecutionException e) {
            if (e.getCause() instanceof UnknownKeyException) {
                return getParent().forNameChecked(name);
            } else if (e.getCause() instanceof InvalidResultException) {
                throw (InvalidResultException) e.getCause();
            } else {
                throw new UncheckedExecutionException(e.getCause());
            }
        }
    }

    @Override
    public String getName(UUID uuid) {
        for (Map.Entry<String, UUID> entry : uuidCache.asMap().entrySet()) {
            if (entry.getValue().equals(uuid)) {
                return entry.getKey();
            }
        }

        return getParent().getName(uuid);
    }

    @Override
    @Nonnull
    public UUIDRepository getParent() {
        return parent;
    }

    @Override
    public void setParent(@Nullable UUIDRepository newParent) {
        if (newParent == null) {
            parent = EmptyUUIDRepository.INSTANCE;
        } else {
            parent = newParent;
        }
    }

    @Override
    public ServicePriority getPriority() {
        return ServicePriority.Lowest;
    }
}


text:
#main {
	margin-top: 80px;
}

.navigation-bar fixed-top {
	text-transform: uppercase;
	font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
	font-weight: 700;
}

.navigation-bar-content {
	text-transform: uppercase;
	font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
	font-weight: 700;
	padding: 18px;
}

.metro .navigation-bar, .metro .navbar {
	width: 100%;
	display: block;
	background-color: #284d86;
	color: white;
}
/*nav {
	background-color: yellow;
	width: 100%;
	margin: 0 0 3em 0;
	padding: 0;
	list-style: none;
}

nav ul {
	border: groove;
}

nav li {
	display: inline;
}

nav li a {
	text-decoration: none;
}*/


text:
require "rexml/document"
require ENV["TM_SUPPORT_PATH"] + "/lib/web_preview"
require ENV['TM_SUPPORT_PATH'] + "/lib/exit_codes"

BASE_URL = "http://livedocs.adobe.com/flex/3/langref/"
# This should likely pull from the web, but that can come later.
XML_SOURCE = ENV["TM_BUNDLE_SUPPORT"] + "/lib/as3-classes.xml"

def get_doc_path class_name
  url = nil
  file = File.new XML_SOURCE
  doc = REXML::Document.new(file, {:compress_whitespace => :all})

  # This might be a bit hack, XPath may work better, but this may be quicker
  doc.elements.each("table/tbody/tr/td/a") do |element|
      url = BASE_URL + element.attributes["href"] if element.text == class_name
  end

  url
end

# Send the page to the document we want
def open_page url
  puts <<PLAYER
<html>
<head>
  <script>
    function redirect() {
      document.location.href = "#{url}";
    }
  </script>
</head>
<body onload="redirect()"></body>
</html>
PLAYER
end

#def get_namespace_from_classname classname
#  file = File.new(ENV["TM_FILEPATH"], "r")
#
#  while line = file.gets do
#    if classpath = /import[ \t]+(.+)#{classname};/.match(line)
#      path = classpath[1].split('.')
#      next if path[0] != "flash"
#      return path
#    end
#  end
#
#  false
#end

open_page get_doc_path(ENV["TM_CURRENT_WORD"])
TextMate.exit_show_html


text:
package com.anttoolkit.maestro.tasks.volume;

import org.apache.tools.ant.*;

import com.anttoolkit.maestro.common.*;

@Action("reattach-volume")
public class ReattachVolumeTask extends VolumeTask
{
	@Param("volume-id")
	private String volume;

	@Param("instance-id")
	private String instance;

	@Param
	private String device;

	public void setVolume(String volume)
	{
		this.volume = volume;
	}

	public void setInstance(String instance)
	{
		this.instance = instance;
	}

	public void setDevice(String device)
	{
		this.device = device;
	}

	@Override
	public void doWork() throws BuildException
	{
		executeCommand();

		if (!isAsync())
		{
			this.waitVolumeStateToChange(volume, "ready");
		}
	}
}


text:
#include "modules/audio_processing/aec3/subtractor.h"

#include <algorithm>
#include <numeric>
#include <string>

#include "modules/audio_processing/aec3/aec_state.h"
#include "modules/audio_processing/aec3/render_delay_buffer.h"
#include "modules/audio_processing/test/echo_canceller_test_tools.h"
#include BOSS_WEBRTC_U_rtc_base__random_h //original-code:"rtc_base/random.h"
#include "test/gtest.h"

namespace webrtc {
namespace {

float RunSubtractorTest(int num_blocks_to_process,
                        int delay_samples,
                        int main_filter_length_blocks,
                        int shadow_filter_length_blocks,
                        bool uncorrelated_inputs,
                        const std::vector<int>& blocks_with_echo_path_changes) {
  ApmDataDumper data_dumper(42);
  EchoCanceller3Config config;
  config.filter.main.length_blocks = main_filter_length_blocks;
  config.filter.shadow.length_blocks = shadow_filter_length_blocks;

  Subtractor subtractor(config, &data_dumper, DetectOptimization());
  absl::optional<DelayEstimate> delay_estimate;
  std::vector<std::vector<float>> x(3, std::vector<float>(kBlockSize, 0.f));
  std::vector<float> y(kBlockSize, 0.f);
  std::array<float, kBlockSize> x_old;
  SubtractorOutput output;
  config.delay.min_echo_path_delay_blocks = 0;
  config.delay.default_delay = 1;
  std::unique_ptr<RenderDelayBuffer> render_delay_buffer(
      RenderDelayBuffer::Create(config, 3));
  RenderSignalAnalyzer render_signal_analyzer(config);
  Random random_generator(42U);
  Aec3Fft fft;
  std::array<float, kFftLengthBy2Plus1> Y2;
  std::array<float, kFftLengthBy2Plus1> E2_main;
  std::array<float, kFftLengthBy2Plus1> E2_shadow;
  AecState aec_state(config);
  x_old.fill(0.f);
  Y2.fill(0.f);
  E2_main.fill(0.f);
  E2_shadow.fill(0.f);

  DelayBuffer<float> delay_buffer(delay_samples);
  for (int k = 0; k < num_blocks_to_process; ++k) {
    RandomizeSampleVector(&random_generator, x[0]);
    if (uncorrelated_inputs) {
      RandomizeSampleVector(&random_generator, y);
    } else {
      delay_buffer.Delay(x[0], y);
    }
    render_delay_buffer->Insert(x);
    if (k == 0) {
      render_delay_buffer->Reset();
    }
    render_delay_buffer->PrepareCaptureProcessing();
    render_signal_analyzer.Update(*render_delay_buffer->GetRenderBuffer(),
                                  aec_state.FilterDelayBlocks());

    // Handle echo path changes.
    if (std::find(blocks_with_echo_path_changes.begin(),
                  blocks_with_echo_path_changes.end(),
                  k) != blocks_with_echo_path_changes.end()) {
      subtractor.HandleEchoPathChange(EchoPathVariability(
          true, EchoPathVariability::DelayAdjustment::kNewDetectedDelay,
          false));
    }
    subtractor.Process(*render_delay_buffer->GetRenderBuffer(), y,
                       render_signal_analyzer, aec_state, &output);

    aec_state.HandleEchoPathChange(EchoPathVariability(
        false, EchoPathVariability::DelayAdjustment::kNone, false));
    aec_state.Update(delay_estimate, subtractor.FilterFrequencyResponse(),
                     subtractor.FilterImpulseResponse(),
                     *render_delay_buffer->GetRenderBuffer(), E2_main, Y2,
                     output, y);
  }

  const float output_power = std::inner_product(
      output.e_main.begin(), output.e_main.end(), output.e_main.begin(), 0.f);
  const float y_power = std::inner_product(y.begin(), y.end(), y.begin(), 0.f);
  if (y_power == 0.f) {
    ADD_FAILURE();
    return -1.0;
  }
  return output_power / y_power;
}

std::string ProduceDebugText(size_t delay, int filter_length_blocks) {
  std::ostringstream ss;
  ss << "Delay: " << delay << ", ";
  ss << "Length: " << filter_length_blocks;
  return ss.str();
}

}  // namespace

#if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID)

// Verifies that the check for non data dumper works.
TEST(Subtractor, NullDataDumper) {
  EXPECT_DEATH(
      Subtractor(EchoCanceller3Config(), nullptr, DetectOptimization()), "");
}

// Verifies the check for null subtractor output.
// TODO(peah): Re-enable the test once the issue with memory leaks during DEATH
// tests on test bots has been fixed.
TEST(Subtractor, DISABLED_NullOutput) {
  ApmDataDumper data_dumper(42);
  EchoCanceller3Config config;
  Subtractor subtractor(config, &data_dumper, DetectOptimization());
  std::unique_ptr<RenderDelayBuffer> render_delay_buffer(
      RenderDelayBuffer::Create(config, 3));
  RenderSignalAnalyzer render_signal_analyzer(config);
  std::vector<float> y(kBlockSize, 0.f);

  EXPECT_DEATH(
      subtractor.Process(*render_delay_buffer->GetRenderBuffer(), y,
                         render_signal_analyzer, AecState(config), nullptr),
      "");
}

// Verifies the check for the capture signal size.
TEST(Subtractor, WrongCaptureSize) {
  ApmDataDumper data_dumper(42);
  EchoCanceller3Config config;
  Subtractor subtractor(config, &data_dumper, DetectOptimization());
  std::unique_ptr<RenderDelayBuffer> render_delay_buffer(
      RenderDelayBuffer::Create(config, 3));
  RenderSignalAnalyzer render_signal_analyzer(config);
  std::vector<float> y(kBlockSize - 1, 0.f);
  SubtractorOutput output;

  EXPECT_DEATH(
      subtractor.Process(*render_delay_buffer->GetRenderBuffer(), y,
                         render_signal_analyzer, AecState(config), &output),
      "");
}

#endif

// Verifies that the subtractor is able to converge on correlated data.
TEST(Subtractor, Convergence) {
  std::vector<int> blocks_with_echo_path_changes;
  for (size_t filter_length_blocks : {12, 20, 30}) {
    for (size_t delay_samples : {0, 64, 150, 200, 301}) {
      SCOPED_TRACE(ProduceDebugText(delay_samples, filter_length_blocks));

      float echo_to_nearend_power = RunSubtractorTest(
          400, delay_samples, filter_length_blocks, filter_length_blocks, false,
          blocks_with_echo_path_changes);

      // Use different criteria to take overmodelling into account.
      if (filter_length_blocks == 12) {
        EXPECT_GT(0.1f, echo_to_nearend_power);
      } else {
        EXPECT_GT(1.f, echo_to_nearend_power);
      }
    }
  }
}

// Verifies that the subtractor is able to handle the case when the main filter
// is longer than the shadow filter.
TEST(Subtractor, MainFilterLongerThanShadowFilter) {
  std::vector<int> blocks_with_echo_path_changes;
  float echo_to_nearend_power =
      RunSubtractorTest(400, 64, 20, 15, false, blocks_with_echo_path_changes);
  EXPECT_GT(0.5f, echo_to_nearend_power);
}

// Verifies that the subtractor is able to handle the case when the shadow
// filter is longer than the main filter.
TEST(Subtractor, ShadowFilterLongerThanMainFilter) {
  std::vector<int> blocks_with_echo_path_changes;
  float echo_to_nearend_power =
      RunSubtractorTest(400, 64, 15, 20, false, blocks_with_echo_path_changes);
  EXPECT_GT(0.5f, echo_to_nearend_power);
}

// Verifies that the subtractor does not converge on uncorrelated signals.
TEST(Subtractor, NonConvergenceOnUncorrelatedSignals) {
  std::vector<int> blocks_with_echo_path_changes;
  for (size_t filter_length_blocks : {12, 20, 30}) {
    for (size_t delay_samples : {0, 64, 150, 200, 301}) {
      SCOPED_TRACE(ProduceDebugText(delay_samples, filter_length_blocks));

      float echo_to_nearend_power = RunSubtractorTest(
          300, delay_samples, filter_length_blocks, filter_length_blocks, true,
          blocks_with_echo_path_changes);
      EXPECT_NEAR(1.f, echo_to_nearend_power, 0.1);
    }
  }
}

// Verifies that the subtractor is properly reset when there is an echo path
// change.
TEST(Subtractor, EchoPathChangeReset) {
  std::vector<int> blocks_with_echo_path_changes;
  blocks_with_echo_path_changes.push_back(99);
  for (size_t filter_length_blocks : {12, 20, 30}) {
    for (size_t delay_samples : {0, 64, 150, 200, 301}) {
      SCOPED_TRACE(ProduceDebugText(delay_samples, filter_length_blocks));

      float echo_to_nearend_power = RunSubtractorTest(
          100, delay_samples, filter_length_blocks, filter_length_blocks, false,
          blocks_with_echo_path_changes);
      EXPECT_NEAR(1.f, echo_to_nearend_power, 0.0000001f);
    }
  }
}

}  // namespace webrtc


text:
package com.voxeo.tropo;

import static com.voxeo.tropo.Key.*;
import static org.junit.Assert.*;

import javax.servlet.http.HttpServletRequest;

import org.junit.Before;
import org.junit.Test;

import com.voxeo.tropo.actions.Do;
import com.voxeo.tropo.mock.MockHttpServletRequest;
import com.voxeo.tropo.mock.MockHttpServletResponse;

public class TropoTest {

	@Before
	public void setUp() throws Exception {
	}

	@Test
	public void testReject() {

		Tropo tropo = new Tropo();
		tropo.reject();

		assertEquals(tropo.text(), "{\"tropo\":[{\"reject\":null}]}");
	}

	@Test
	public void testTropoRoot() {

		Tropo tropo = new Tropo();

		assertEquals(tropo.text(), "{\"tropo\":[]}");
	}

	@Test
	public void testStopRecording() {

		Tropo tropo = new Tropo();
		tropo.stopRecording();

		assertEquals(tropo.text(), "{\"tropo\":[{\"stopRecording\":null}]}");
	}

	@Test
	public void testParseJsonSession() {

		String json_session = "{\"session\":{\"id\":\"dih06n\",\"accountId\":\"33932\",\"timestamp\":\"2010-01-19T23:18:48.562Z\",\"userType\":\"HUMAN\",\"to\":{\"id\":\"tropomessaging@bot.im\",\"name\":\"unknown\",\"channel\":\"TEXT\",\"network\":\"JABBER\"},\"from\":{\"id\":\"john_doe@gmail.com\",\"name\":\"unknown\",\"channel\":\"TEXT\",\"network\":\"JABBER\"}}}";
		Tropo tropo = new Tropo();
		TropoSession session = tropo.session(json_session);
		assertNotNull(session);
		assertEquals(session.getTimestamp(),"2010-01-19T23:18:48.562Z");
		assertEquals(session.getTo().getName(),"unknown");
		assertEquals(session.getFrom().getId(),"john_doe@gmail.com");
	}

	@Test
	public void testParseJsonSessionWithParameters() {

		String json_session = "{\"session\":{\"id\": \"76b05a0b25127dbf59a4627f6dcd38a7\", \"accountId\": \"12345\", \"timestamp\": \"2010-05-05T01:59:19.402Z\", \"userType\": \"NONE\", \"initialText\": null, \"callId\":\"092f931c4dddf0124ef426c56d26f98c\", \"parameters\": { \"token\": \"token_id\", \"action\": \"create\", \"myNum\":\"4075551212\"}}}";
		Tropo tropo = new Tropo();
		TropoSession session = tropo.session(json_session);
		assertNotNull(session);
		assertNotNull(session.getParameters());
		assertEquals(session.getParameters().get("token"),"token_id");
	}

	@Test
	public void testParseJsonSessionFromServletRequest() {

		String json_session = "{\"session\":{\"id\": \"76b05a0b25127dbf59a4627f6dcd38a7\", \"accountId\": \"12345\", \"timestamp\": \"2010-05-05T01:59:19.402Z\", \"userType\": \"NONE\", \"initialText\": null, \"callId\":\"092f931c4dddf0124ef426c56d26f98c\", \"parameters\": { \"token\": \"token_id\", \"action\": \"create\", \"myNum\":\"4075551212\"}}}";
		HttpServletRequest mockRequest = new MockHttpServletRequest(json_session);

		Tropo tropo = new Tropo();
		TropoSession session = tropo.session(mockRequest);
		assertNotNull(session);
		assertNotNull(session.getParameters());
		assertEquals(session.getParameters().get("token"),"token_id");
	}

	@Test
	public void testSayOnAndRecordTraditionalWay() {

		Tropo tropo = new Tropo();
		tropo.say("Welcome to the app");
		tropo.on(EVENT("hangup"), NEXT("/hangup.json"));
		tropo.record(NAME("foo"), BEEP(true), SEND_TONES(false), EXIT_TONE("#"), URL("http://sendme.com/tropo")).and(
			Do.say("Please say your account number"),
			Do.choices(VALUE("[5 DIGITS]"))
		);

		assertEquals(tropo.text(), "{\"tropo\":[{\"say\":[{\"value\":\"Welcome to the app\"}]},{\"on\":{\"event\":\"hangup\",\"next\":\"/hangup.json\"}},{\"record\":{\"name\":\"foo\",\"beep\":true,\"send_tones\":false,\"exit_tone\":\"#\",\"url\":\"http://sendme.com/tropo\",\"say\":[{\"value\":\"Please say your account number\"}],\"choices\":{\"value\":\"[5 DIGITS]\"}}}]}");
	}

	@Test
	public void testReset() {

		Tropo tropo = new Tropo();
		tropo.ask(NAME("foo"), BARGEIN(true), TIMEOUT(30.0f), REQUIRED(true));
		assertEquals(tropo.text(), "{\"tropo\":[{\"ask\":{\"name\":\"foo\",\"bargein\":true,\"timeout\":30,\"required\":true}}]}");

		tropo.reset();
		assertEquals(tropo.text(), "{\"tropo\":[]}");
	}

	@Test
	public void testTropoResultSingle() {

		String json_session = "{\"result\":{\"sessionId\":\"CCFD9C86-1DD1-11B2-B76D-B9B253E4B7FB@161.253.55.20\",\"callState\":\"ANSWERED\",\"sessionDuration\":2,\"sequence\":1,\"complete\":true,\"error\":null,\"actions\":{\"name\":\"zip\",\"attempts\":1,\"disposition\":\"SUCCESS\",\"confidence\":100,\"interpretation\":\"12345\",\"utterance\":\"1 2 3 4 5\"}}}";
		Tropo tropo = new Tropo();
		TropoResult result = tropo.parse(json_session);
		assertNotNull(result);
		assertNotNull(result.getActions());
		assertEquals(result.getActions().get(0).getName(),"zip");
	}

	@Test
	public void testTropoResultArray() {

		String json_session = "{\"result\":{\"sessionId\":\"CCFD9C86-1DD1-11B2-B76D-B9B253E4B7FB@161.253.55.20\",\"callState\":\"ANSWERED\",\"sessionDuration\":2,\"sequence\":1,\"complete\":true,\"error\":null,\"actions\":[{ \"name\": \"account_number\", \"attempts\": 1, \"disposition\": \"SUCCESS\", \"confidence\": 100, \"interpretation\": \"12345\", \"utterance\": \"1 2 3 4 5\", \"concept\": \"12345\" }, { \"name\": \"pin\", \"attempts\": 1, \"disposition\": \"SUCCESS\", \"confidence\": 100, \"interpretation\": \"9876\", \"utterance\": \"9 8 7 6\", \"concept\": \"9876\" }]}}";
		Tropo tropo = new Tropo();
		TropoResult result = tropo.parse(json_session);
		assertNotNull(result);
		assertNotNull(result.getActions());
		assertEquals(result.getActions().get(0).getName(),"account_number");
		assertEquals(result.getActions().get(1).getName(),"pin");
	}

	@Test
	public void testObjectArrivesInJson() {

		String json_session = "{\"result\":{\"sessionId\":\"CCFD9C86-1DD1-11B2-B76D-B9B253E4B7FB@161.253.55.20\",\"callState\":\"ANSWERED\",\"sessionDuration\":2,\"sequence\":1,\"complete\":true,\"error\":null,\"actions\":{\"name\":\"zip\",\"attempts\":1,\"disposition\":\"SUCCESS\",\"confidence\":100,\"interpretation\":\"12345\",\"utterance\":\"1 2 3 4 5\"}}}";
		Tropo tropo = new Tropo();
		TropoResult result = tropo.parse(json_session);
		assertEquals(result.getCallState(),"ANSWERED");
	}

	@Test
	public void testParseTropoResultFromServletRequest() {

		String json_session = "{\"result\":{\"sessionId\":\"CCFD9C86-1DD1-11B2-B76D-B9B253E4B7FB@161.253.55.20\",\"callState\":\"ANSWERED\",\"sessionDuration\":2,\"sequence\":1,\"complete\":true,\"error\":null,\"actions\":[{ \"name\": \"account_number\", \"attempts\": 1, \"disposition\": \"SUCCESS\", \"confidence\": 100, \"interpretation\": \"12345\", \"utterance\": \"1 2 3 4 5\", \"concept\": \"12345\" }, { \"name\": \"pin\", \"attempts\": 1, \"disposition\": \"SUCCESS\", \"confidence\": 100, \"interpretation\": \"9876\", \"utterance\": \"9 8 7 6\", \"concept\": \"9876\" }]}}";
		HttpServletRequest request = new MockHttpServletRequest(json_session);

		Tropo tropo = new Tropo();
		TropoResult result = tropo.parse(request);
		assertNotNull(result);
		assertNotNull(result.getActions());
		assertEquals(result.getActions().get(0).getName(),"account_number");
		assertEquals(result.getActions().get(1).getName(),"pin");
	}

	@Test
	public void testOutputIsRenderedToServletResponse() {

		Tropo tropo = new Tropo();
		tropo.say("1234");

		MockHttpServletResponse response = new MockHttpServletResponse();
		tropo.render(response);

		assertEquals(response.getContent(), "{\"tropo\":[{\"say\":[{\"value\":\"1234\"}]}]}");
	}

	@Test
	public void testLaunchSession() {

		// This tropo test is hosted in a special Tropo username "hudson"'s account
		String token = "bb308b34ed83d54cab226f4af7969e4c7d7d9196cdb3210b5ef0cb345616629005bfd05efe3f4409cd496ca2";
		Tropo tropo = new Tropo();
		TropoLaunchResult result = tropo.launchSession(token);

		assertNotNull(result);
		assertEquals(result.getSuccess(),true);
		assertEquals(result.getToken(),token);
	}

	@Test
	public void testEmpty() {

		Tropo tropo = new Tropo();
		assertTrue(tropo.isEmpty());
		tropo.say("1234");
		assertFalse(tropo.isEmpty());
	}
}


text:
all:
	jsx --no-cache-dir lib dist
	lessc lib/*.less > dist/react-ive.css
clean:
	rm dist/*


text:
@protocol TdLocationCallback <NSObject>
-(void)onSuccess:(NSMutableDictionary*)locDic;
@end


text:
Introduction to yara-ctypes-python
**********************************

What's in yara-ctypes:

* A ctypes libyara wrapper module which exposes libyara's exports into the
  Python runtime (see: `yara-project's libyara v1.7`_).
* A thread safe Rules object with an interface that is compatible with the
  interface exposed in the yara-project CPython extension module.
* namespace management to allow easy loading of multiple YARA rules into a
  single Rules matching object.
* Various Scanner class types to enable thread or process pool execution
  of matching requests over a Rules object.
* A feature rich command line interface that gives the user many options to
  control how they may wish to perform a scan.

Why:

* ctypes releases the GIL on system function calls...  Run your PC to its
  true potential.
* It simplifies things a lot by keeping high order logic such as managing rules
  paths, filtering paths, controlling pooled execution, etc. inside of a
  language such as Python.
* No more building the PyC extension...
* I found a few bugs and memory leaks and wanted to make my life simple.

As a reference and guide to yara-ctypes see: `yara-ctypes documentation`_

For additional tips / tricks with this wrapper feel free to post a question at
the github `yara-ctypes/issues`_ page.

Project hosting provided by `github.com`_.

[mjdorma+yara-ctypes@gmail.com]

Install and run
===============

Simply run the following::

    > python setup.py install
    > python setup.py test
    > yara-ctypes -h

or `PyPi`_::

    > pip install yara
    > yara-ctypes -h

.. note::

    If the package does not contain a pre-compiled libyara library for your
    platform you will need to build and install it. See `notes on building`_.

Compatability
=============

*yara-ctypes* is implemented to be compatible with Python 2.6+ and Python 3.x.
It has been tested against the following Python implementations:

Ubuntu 12.04:

 + CPython 2.7 (32bit, 64bit)
 + CPython 3.2 (32bit, 64bit)

Ubuntu 11.10 |build_status|:

 + CPython 2.6 (32bit)
 + CPython 2.7 (32bit)
 + CPython 3.2 (32bit)
 + CPython 3.3 (32bit)

Windows 7:

 + CPython 2.6 (32bit, 64bit)
 + CPython 3.2 (32bit, 64bit)

OS X Mountain Lion

 + CPython 2.7 (64bit)

Continuous integration testing is provided by `Travis CI <http://travis-ci.org/>`_.

Issues
======

Source code for *yara-ctypes* is hosted on `GitHub <https://github.com/mjdorma/yara-ctypes>`_.
Please file `bug reports <https://github.com/mjdorma/yara-ctypes/issues>`_
with GitHub's issues system.

Change log
==========

version 1.7.7 (27/05/2014)

* str conversion fix (contribution by David Cannings @olliencc)

version 1.7.6 (26/10/2013)

* now using setuptools for distribution

version 1.7.5 (13/09/2013)

* added CLI status thread
* improved process and thread completion code

version 1.7.4 (12/09/2013)

* added yar preprocessor
* fixed asynchronous counter bug
* solved the unyielded results issue

version 1.7.3 (28/04/2013)

* scan using a process pool or thread pool
* bug fixes and more testing

version 1.7.2 (19/04/2013)

* cli improvements
* bug fixes

version 1.7.1 (17/04/2013)

* StdinScanner
* overlap control for stream chunk enqueueing

version 1.7.0 (15/04/2013)

* ships with builds of libyara-1.7
* compatibility issues solves with yara-1.7's interface changes
* major change up and improvement to the scan command line interface.
* a lot more testing

version 1.6.5 (12/04/2013)

* more tech in scan
* improved test
* bug fixes

version 1.6.4 (11/04/2013)

* supports py3.3
* additional test
* improved scan interface
* bug fixes

version 1.6.3 (08/03/2013)

* bug fix to yara.py (callback callable check)

version 1.6.2 (28/02/2013)

* support for OS X Mountain Lion

version 1.6.1 (06/09/2012)

* Support for 64bit Windows
* Bug fixes
* Added documentation

version 1.6.0 (01/09/2012)

* Initial release

.. _github.com: https://github.com/mjdorma/yara-ctypes
.. _PyPi: http://pypi.python.org/pypi/yara
.. _yara-ctypes/issues: https://github.com/mjdorma/yara-ctypes/issues
.. _notes on building: http://packages.python.org/yara/howto/build.html
.. _yara-ctypes documentation: http://packages.python.org/yara/
.. _yara-project's libyara v1.7: http://code.google.com/p/yara-project
.. |build_status| image:: https://secure.travis-ci.org/mjdorma/yara-ctypes.png?branch=master
   :target: http://travis-ci.org/#!/mjorma/yara-ctypes


text:
This is my work in progress to setup a build environment to build baseboxes with [Packer](http://www.packer.io) for VMware vCloud
to be used with [Vagrant](http://www.vagrantup.com) and the [vagrant-vcloud](https://github.com/frapposelli/vagrant-vcloud) plugin.
The basebox build environment itself can be built with the same tools and created inside the vCloud, eating and creating its own dogfood.

![basebox-slave network diagram](pics/basebox_slave.png)

## Installation
On your host machine you will need the following tools installed:

* Vagrant 1.7.1
* vagrant-vcloud plugin 0.4.4 (pre-release) with the command `vagrant plugin install vagrant-vcloud-0.4.4.gem`
* Your vCloud access informations in your global `~/.vagrant.d/Vagrantfile`

After that you should clone this repo and have some customizations. See below for more details.

## Create the basebox builder

Now you can build the vApp 'the Vagrant way':

```bash
vagrant up --provider=vcloud
```

This will spin up an vApp with three VMs:

### basebox-jenkins
The `basebox-jenkins` VM is an Ubuntu 14.04 server with a [Jenkins server](http://jenkins-ci.org) installed. This server has the IP address `176.16.32.2` and the HTTP port of Jenkins web interface listens on port 80.
A port forwarding is done even through your vCloud edge gateway if you have to use it.

Check out for the forwarded port while spinning up the vApp, or check it later with

```bash
vagrant vcloud -n
```

So you can retrieve the correct IP address and port number to access the Jenkins web interface from your host machine.

You can login to your jenkins server with just the following command:

```bash
vagrant ssh basebox-jenkins
```

### vmware-slave
The `vmware-slave` VM is a Windows machine (I use a windows_2008_r2). This machine has the IP address `176.16.32.3` and has RDP, SSH and WinRM ports opened. This VM will build baseboxes for the vCloud provider, but could also be used to build baseboxes for the VMware Workstation/Fusion provider.

You can login to your jenkins slave with RDP with the following command:

```bash
vagrant rdp vmware-slave
```

After creating the vmware-slave VM you have to licsense the installed VMware Workstation manually. I have added a command in the `./scripts/provision-vmware-slave.bat` script to directly enter the VMware license, but I cannot put that into the repo.

This is a good situation to test the `vagrant rdp vmware-slave` which works nice.

The software installed in the vmware-slave is:

* [Chocolatey](http://chocolatey.org) - package like installations on Windows
* [packer 0.7.5](http://www.packer.io/downloads.html) or optional packer from source
* [packer-post-processor-vagrant-vmware-ovf 0.2.1](https://github.com/gosddc/packer-post-processor-vagrant-vmware-ovf/releases)
* VMware Workstation 10.0.4
* [Vagrant 1.7.1](http://www.vagrantup.com/downloads.html)
* [vagrant-vcloud 0.4.4](https://github.com/frapposelli/vagrant-vcloud/releases)
* optional global Vagrantfile from host (`./resources/Vagrantfile-global`)
* msysgit
* wget
* Java + Jenkins Swarm Client (Node labels: windows + vmware)

### vbox-slave
The `vbox-slave` VM is a Windows machine (I use a windows_2008_r2). This machine has the IP address `176.16.32.4` and has RDP, SSH and WinRM ports opened. This VM will build baseboxes for the VirtualBox provider.
Notice: My intended hostname was virtualbox-slave, but that is too long for windows, and guest customizations of vCloud aborts with an error.

You can login to your jenkins slave with RDP with the following command:

```bash
vagrant rdp vbox-slave
```

The software installed in the vbox-slave is:

* [Chocolatey](http://chocolatey.org) - package like installations on Windows
* [packer 0.7.5](http://www.packer.io/downloads.html)
* [VirtualBox 4.3.16](https://www.virtualbox.org/wiki/Linux_Downloads)
* msysgit
* wget
* Java + Jenkins Swarm Client (Node labels: windows + virtualbox)

## Customization
As I have started the project much smaller with simple shell provisioning scripts, it still has its roots in plain shell scripts. Perhaps in the future there will be some higher level solution with Chef, Puppet, Ansible, ...

### Choose the baseboxes
In the `Vagrantfile` you may adjust the boxes and box_urls used for the three VMs.
As I cannot make the Windows VM public, I will change at least the box_url of the Ubuntu VM to one pointing to the vagrantcloud soon.

### Mail Server for Jenkins mails
Edit the file `./scripts/install-jenkins-server.sh` to change the `smtpHost`

### License VMware Workstation
**Notice: Manual step:** Log into the vmware-slave machine and enter the license of VMware Workstation.
If you start jobs from Jenkins without entering a license or the trial, the vmware-slave will hang.

## Resources

### Vagrantfile-global
In the `vmware-slave` box also Vagrant will be installed to test and upload the generated vcloud boxes.
Your user credentials to access the vCloud org could be passed with an optional global Vagrantfile.
This file must be placed at `./resources/Vagrantfile-global` and will be copied on provisioning into `%USERPROFILE%\.vagrant.d\Vagrantfile`.

A sample Vagrantfile-global looks like this:

```ruby
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|

  if Vagrant.has_plugin?("vagrant-vcloud")
    # vCloud Director provider settings
    config.vm.provider :vcloud do |vcloud|
      vcloud.hostname = "https://YOUR-VCLOUD"
      vcloud.username = "vagrant"
      vcloud.password = 'S@perS$cretP1ass'
      vcloud.org_name = "YOUR-ORG"
      vcloud.vdc_name = "YOUR-VDC"
      vcloud.catalog_name = "BASEBOX-TESTING"
      vcloud.vdc_network_name = "YOUR-NETWORK"

      # we do not need a edge gateway as the vmware-slave already is inside the vCloud
      # vcloud.vdc_edge_gateway = "YOUR-EDGE"
      # vcloud.vdc_edge_gateway_ip = "10.100.50.4"
    end
  end
end
```

I suggest a `BASEBOX-TESTING` catalog for test uploads in the Jenkins build jobs.

### test-box-vcloud-credentials.bat
In the `vmware-slave` the upload of the generated basebox will be done with ovftool. The script for the upload also needs your connection data and credentials to connect to your vCloud org.
This file must be placed at `./resources/test-box-vcloud-credentials.bat` and will be used in the Jenkins jobs in the script [bin/test-box-vcloud.bat](https://github.com/StefanScherer/ubuntu-vm/blob/my/bin/test-box-vcloud.bat) (see my [ubuntu-vm Repo](https://github.com/StefanScherer/ubuntu-vm/tree/my)).

A sample test-box-vcloud-credentials.bat looks like this:

```cmd
@set vcloud_hostname=YOUR-VCLOUD
@set vcloud_username=vagrant
@set vcloud_password=S@perS$cretP1ass
@set vcloud_org=YOUR-ORG
@set vcloud_catalog=BASEBOX-TESTING
@set vcloud_vdc=YOUR-VDC
```

I use the @ sign in the script to hide it in Jenkins console logs.
I suggest a `BASEBOX-TESTING` catalog for test uploads in the Jenkins build jobs.

This is done with the file `./resources/test-box-vcloud-credentials.bat` provided from the host

### upload-vcloud-credentials.bat
In the `vmware-slave` the upload of the tested basebox will be done with ovftool. The script for the upload also needs your connection data and credentials to connect to your global vCloud org.
This file must be placed at `./resources/upload-vcloud-credentials.bat` and will be used in the `upload *`Jenkins jobs in the inlined script.

A sample upload-vcloud-credentials.bat looks like this:

```cmd
@set vcloud_hostname=YOUR-VCLOUD
@set vcloud_username=YOUR-UPLOAD-USER
@set vcloud_password=S@perS$cretP1ass
@set vcloud_org=YOUR-GLOBAL-ORG
@set vcloud_catalog=YOUR-GLOBAL-CATALOG
@set vcloud_vdc=YOUR-GLOBAL-VDC
```

I use the @ sign in the script to hide it in Jenkins console logs.
I suggest a `COM-BUILD-CATATLOG` catalog for test uploads in the Jenkins build jobs.

This is done with the file `./resources/upload-vcloud-credentials.bat` provided from the host.

## Jenkins

I use [grunt-jenkins](https://www.npmjs.org/package/grunt-jenkins) to customize and backup the Jenkins configuration. So my Jenkins box is only a throw away product to be set up again with Jenkins job configurations from source control.

My current Jenkins jobs are stored in this repo as well in the directory `jenkins-configuration`.

### Install grunt
On your host machine, you will need node, npm and grunt:

```
brew update
brew install node
npm install -g grunt-cli
```

### Install grunt-jenkins
On you host machine, you have to call

```
npm install
```

to install grunt-jenkins and other Node dependencies.

### Customize Jenkins URL
In the `Gruntfile.js` you have to enter the Jenkins IP address and port to connect from your host to the Jenkins VM.

In my case this is `10.100.50.4` as you can see in the Gruntfile.js. With grunt-jenkins 0.5.0 or above you can backup and restore through your vCloud Edge Gateway.

### Install Jenkins jobs

You can install my prebuilt Jenkins job configuration using:

```
grunt jenkins-install
```

When you added / removed plugins you must restart Jenkins:

```
curl -X POST http://10.100.50.4/safeRestart
```

Have a look at the Jenkins jobs, there you can see how I build the baseboxes and from with GitHub Repos they come from. See below for more details.

### Manage Jenkins configuration
After each time you made changes to the global Jenkins configuration, plugins
or jobs just do:

```
grunt jenkins-backup
git add jenkins-configuration
git commit
```

This will backup all stuff to the jenkins-configuration folder. You may put it
under version control, yay!

So the whole Jenkins server could be destroyed and rebuilt with another `vagrant up --provider=vcloud`.

## Tested baseboxes with Serverspec
If you build packer baseboxes you propably know that a successful build is one thing, but a tested basebox would be even better.

All of my Jenkins jobs you can find in this repo do some tests within the vCloud. Each Jenkins job looks like this:

* Build the Linux/Windows basebox with packer for the vcloud provider
* Add the basebox to vagrant with `vagrant add box`
* Upload the basebox with ovftool into a `BASEBOX-TESTING` catalog in vCloud
* Create a test vApp with the new Linux/Windows box with a minimal Vagrantfile and `vagrant up --provider=vcloud`
* Run some [Serverspec](http://serverspec.org) tests for both Linux/Windows with the [vagrant-serverspec](https://github.com/jvoorhis/vagrant-serverspec) plugin 1.0.1
* Windows serverspec tests are in [windows_vcloud.rb](https://github.com/StefanScherer/packer-windows/blob/my_vagrant_vcloud/test/windows_vcloud.rb)
* Linux serverspec tests are in [ubuntu_vcloud.rb](https://github.com/StefanScherer/ubuntu-vm/blob/my/test/ubuntu_vcloud.rb)
* Destroy the vApp again with `vagrant destroy -f`
* Remove the basebox from vagrant with `vagrant box remove`
* Upload the tested basebox into a global catalog.

![basebox tests in vCloud](pics/basebox-tests.png)

## View Jenkins Web Interface
If you just want to view into Jenkins use this command:

```
open http://10.100.50.4/
```

![jenkins jobs](pics/jenkins-jobs.png)

You also can see the automatically added Jenkins node `vmware-slave` in the list of nodes:

![jenkins nodes](pics/jenkins-nodes.png)

## Eat your own dogfood

After successfully running some Jenkins jobs to build baseboxes, vagrant-vcloud even can eat its own dogfood. The workspace of the `vmware-slave` is accessible through the Jenkins server, as shown here:

![jenkins workspace with dogfood](pics/jenkins-dogfood.png)

So pick up the URL of the generated box file and feed vagrant on your host:

```bash
vagrant box add ubuntu1404-desktop http://10.100.50.4/job/ubuntu1404-desktop_vmware/ws/ubuntu1404-desktop_vmware.box
```

But Jenkins could also be used to test the basebox and upload it to your basebox repo or to the [Vagrant Cloud](https://vagrantcloud.com).

# Licensing
Copyright (c) 2014 Stefan Scherer

MIT License, see LICENSE for more details.


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CSharp.Syntax;

namespace Cs2hx
{
	static class WriteReturnStatement
	{
		public static void Go(HaxeWriter writer, ReturnStatementSyntax statement)
		{
			writer.WriteIndent();
			writer.Write("return");

			if (statement.Expression != null)
			{
				writer.Write(" ");
				Core.Write(writer, statement.Expression);
			}

			writer.Write(";\r\n");
		}
	}
}


text:
import { Component, ViewChild, ElementRef, OnInit, Input } from '@angular/core';
//import { DomProjectionHost, DomProjection } from '@angular/material';

@Component({
  selector: 'projection-app',
  template: `

Content: {{ binding }}

    <input projection-test [(ngModel)]="binding" [class]="binding" [ngClass]="{'blue': true}">
    <input [(ngModel)]="binding" class="my-class" [ngClass]="{'blue': true}">
  `,
  styles: [`
    .demo-inner {
      background-color: #DAA520;
    }
  `]
})
export class ProjectionDemoComponent {
  binding = 'abc';
}


text:
package database

type Configuration struct {
	Db     Info
	Tables Tables
}

type Info struct {
	Host     string
	Port     int
	Username string
	Password string
	Dbname   string
}

type Tables struct {
	Tables []Table
}

type Table struct {
	Name    string
	Columns []Column
}

type Column struct {
	Name       string
	Constraint string
}


text:
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
	version="2.0">
	<persistence-unit name="persistenceConfig" >
		<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
		<class>es.tododev.auth.server.bean.User</class>
		<class>es.tododev.auth.server.bean.Application</class>
		<class>es.tododev.auth.server.bean.UserRoles</class>
		<class>es.tododev.auth.server.bean.GroupApplications</class>
		<class>es.tododev.auth.server.bean.UserApplication</class>

		<properties>
			<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
			<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
			<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/authorization" />
			<property name="hibernate.connection.username" value="root" />
			<property name="hibernate.connection.password" value="root" />
			<property name="hibernate.c3p0.min_size" value="5" />
			<property name="hibernate.c3p0.max_size" value="20" />
			<property name="hibernate.c3p0.idleTestPeriod" value="30" />
			<property name="hibernate.c3p0.timeout" value="60" />
			<property name="hibernate.c3p0.max_statements" value="0" />
			<property name="hibernate.show_sql" value="true" />
			<property name="hibernate.format_sql" value="true" />
			<property name="hibernate.query.jpaql_strict_compliance" value="false" />
			<property name="hibernate.validator.apply_to_ddl" value="false" />
			<property name="hibernate.validator.autoregister_listeners" value="false" />
			<property name="hibernate.archive.autodetection" value="class, hbm" />
<!-- 			<property name="hibernate.hbm2ddl.auto" value="create-drop" /> -->
		</properties>
	</persistence-unit>
</persistence>


text:
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_TYPED_ARRAYS_DOM_TYPED_ARRAY_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_TYPED_ARRAYS_DOM_TYPED_ARRAY_H_

#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_array_buffer_view.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_shared_array_buffer.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "v8/include/v8.h"

namespace blink {

namespace {
// Helper to verify that a given sub-range of an ArrayBuffer is within range.
template <typename T>
bool VerifySubRange(const DOMArrayBufferBase* buffer,
                    size_t byte_offset,
                    size_t num_elements) {
  if (!buffer)
    return false;
  if (sizeof(T) > 1 && byte_offset % sizeof(T))
    return false;
  if (byte_offset > buffer->ByteLengthAsSizeT())
    return false;
  size_t remaining_elements =
      (buffer->ByteLengthAsSizeT() - byte_offset) / sizeof(T);
  if (num_elements > remaining_elements)
    return false;
  return true;
}
}  // namespace

template <typename T, typename V8TypedArray, bool clamped = false>
class DOMTypedArray final : public DOMArrayBufferView {
  typedef DOMTypedArray<T, V8TypedArray, clamped> ThisType;
  DECLARE_WRAPPERTYPEINFO();

 public:
  typedef T ValueType;
  static ThisType* Create(DOMArrayBufferBase* buffer,
                          size_t byte_offset,
                          size_t length) {
    CHECK(VerifySubRange<ValueType>(buffer, byte_offset, length));
    return MakeGarbageCollected<ThisType>(buffer, byte_offset, length);
  }

  static ThisType* Create(size_t length) {
    DOMArrayBuffer* buffer = DOMArrayBuffer::Create(length, sizeof(ValueType));
    return Create(buffer, 0, length);
  }

  static ThisType* Create(const ValueType* array, size_t length) {
    DOMArrayBuffer* buffer =
        DOMArrayBuffer::Create(array, length * sizeof(ValueType));
    return Create(buffer, 0, length);
  }

  static ThisType* CreateOrNull(size_t length) {
    DOMArrayBuffer* buffer =
        DOMArrayBuffer::CreateOrNull(length, sizeof(ValueType));
    return buffer ? Create(std::move(buffer), 0, length) : nullptr;
  }

  static ThisType* CreateUninitializedOrNull(size_t length) {
    DOMArrayBuffer* buffer =
        DOMArrayBuffer::CreateUninitializedOrNull(length, sizeof(ValueType));
    return buffer ? Create(buffer, 0, length) : nullptr;
  }

  DOMTypedArray(DOMArrayBufferBase* dom_array_buffer,
                size_t byte_offset,
                size_t length)
      : DOMArrayBufferView(dom_array_buffer, byte_offset),
        raw_length_(length) {}

  ValueType* Data() const { return static_cast<ValueType*>(BaseAddress()); }

  ValueType* DataMaybeShared() const {
    return reinterpret_cast<ValueType*>(BaseAddressMaybeShared());
  }

  size_t lengthAsSizeT() const { return !IsDetached() ? raw_length_ : 0; }

  size_t byteLengthAsSizeT() const final {
    return lengthAsSizeT() * sizeof(ValueType);
  }

  unsigned TypeSize() const final { return sizeof(ValueType); }

  DOMArrayBufferView::ViewType GetType() const override;

  // Invoked by the indexed getter. Does not perform range checks; caller
  // is responsible for doing so and returning undefined as necessary.
  ValueType Item(size_t index) const {
    SECURITY_DCHECK(index < lengthAsSizeT());
    return Data()[index];
  }

  v8::Local<v8::Value> Wrap(v8::Isolate*,
                            v8::Local<v8::Object> creation_context) override;

 private:
  // It may be stale after Detach. Use lengthAsSizeT() instead.
  size_t raw_length_;
};

#define FOREACH_VIEW_TYPE(V)                   \
  V(int8_t, v8::Int8Array, kTypeInt8)          \
  V(int16_t, v8::Int16Array, kTypeInt16)       \
  V(int32_t, v8::Int32Array, kTypeInt32)       \
  V(uint8_t, v8::Uint8Array, kTypeUint8)       \
  V(uint16_t, v8::Uint16Array, kTypeUint16)    \
  V(uint32_t, v8::Uint32Array, kTypeUint32)    \
  V(float, v8::Float32Array, kTypeFloat32)     \
  V(double, v8::Float64Array, kTypeFloat64)    \
  V(int64_t, v8::BigInt64Array, kTypeBigInt64) \
  V(uint64_t, v8::BigUint64Array, kTypeBigUint64)

#define GET_TYPE(c_type, v8_type, view_type)               \
  template <>                                              \
  inline DOMArrayBufferView::ViewType                      \
  DOMTypedArray<c_type, v8_type, false>::GetType() const { \
    return DOMArrayBufferView::view_type;                  \
  }

FOREACH_VIEW_TYPE(GET_TYPE)

#undef GET_TYPE
#undef FOREACH_VIEW_TYPE

template <>
inline DOMArrayBufferView::ViewType
DOMTypedArray<uint8_t, v8::Uint8ClampedArray, true>::GetType() const {
  return DOMArrayBufferView::kTypeUint8Clamped;
}

extern template class CORE_EXTERN_TEMPLATE_EXPORT
    DOMTypedArray<int8_t, v8::Int8Array>;
extern template class CORE_EXTERN_TEMPLATE_EXPORT
    DOMTypedArray<int16_t, v8::Int16Array>;
extern template class CORE_EXTERN_TEMPLATE_EXPORT
    DOMTypedArray<int32_t, v8::Int32Array>;
extern template class CORE_EXTERN_TEMPLATE_EXPORT
    DOMTypedArray<uint8_t, v8::Uint8Array>;
extern template class CORE_EXTERN_TEMPLATE_EXPORT
    DOMTypedArray<uint8_t, v8::Uint8ClampedArray, /*clamped=*/true>;
extern template class CORE_EXTERN_TEMPLATE_EXPORT
    DOMTypedArray<uint16_t, v8::Uint16Array>;
extern template class CORE_EXTERN_TEMPLATE_EXPORT
    DOMTypedArray<uint32_t, v8::Uint32Array>;
extern template class CORE_EXTERN_TEMPLATE_EXPORT
    DOMTypedArray<int64_t, v8::BigInt64Array>;
extern template class CORE_EXTERN_TEMPLATE_EXPORT
    DOMTypedArray<uint64_t, v8::BigUint64Array>;
extern template class CORE_EXTERN_TEMPLATE_EXPORT
    DOMTypedArray<float, v8::Float32Array>;
extern template class CORE_EXTERN_TEMPLATE_EXPORT
    DOMTypedArray<double, v8::Float64Array>;

typedef DOMTypedArray<int8_t, v8::Int8Array> DOMInt8Array;
typedef DOMTypedArray<int16_t, v8::Int16Array> DOMInt16Array;
typedef DOMTypedArray<int32_t, v8::Int32Array> DOMInt32Array;
typedef DOMTypedArray<uint8_t, v8::Uint8Array> DOMUint8Array;
typedef DOMTypedArray<uint8_t, v8::Uint8ClampedArray, /*clamped=*/true>
    DOMUint8ClampedArray;
typedef DOMTypedArray<uint16_t, v8::Uint16Array> DOMUint16Array;
typedef DOMTypedArray<uint32_t, v8::Uint32Array> DOMUint32Array;
typedef DOMTypedArray<int64_t, v8::BigInt64Array> DOMBigInt64Array;
typedef DOMTypedArray<uint64_t, v8::BigUint64Array> DOMBigUint64Array;
typedef DOMTypedArray<float, v8::Float32Array> DOMFloat32Array;
typedef DOMTypedArray<double, v8::Float64Array> DOMFloat64Array;

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_TYPED_ARRAYS_DOM_TYPED_ARRAY_H_


text:
import module from 'discovery/module';

describe('Discovery module ', () => {
  beforeEach(() => {
    angular.mock.module(module.name);
  });

  it('should provide kdDiscoveryResource',
     angular.mock.inject((kdDiscoveryResource, $httpBackend) => {
       kdDiscoveryResource.get();
       $httpBackend.expectGET('api/v1/discovery').respond();
       $httpBackend.flush();
     }));
});


text:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using RAIN.Core;
using RAIN.Belief;
using RAIN.Action;

public class PickupResources : Action
{
	public PickupResources()
	{
		actionName = "PickupResources";
	}

    private Transform targetGeyser;
    private int canCarry;
    private int carrying;
    private float countDown;
    private bool succeeded;

	public override ActionResult Start(Agent agent, float deltaTime)
	{
        if (actionContext.ContextItemExists ("carrying")) {
            carrying = actionContext.GetContextItem<int> ("carrying");
        } else {
            carrying = 0;
        }

        if (actionContext.ContextItemExists ("targetGeyser") &&
            actionContext.ContextItemExists ("canCarry") &&
            actionContext.ContextItemExists ("resourceTime"))
        {
            targetGeyser = actionContext.GetContextItem<Transform>("targetGeyser");
            canCarry = actionContext.GetContextItem<int>("canCarry");
            // wait for resourceTime seconds while "mining"
            countDown = actionContext.GetContextItem<float>("resourceTime");
            succeeded = true;
		    return ActionResult.SUCCESS;
        } else {
            succeeded = false;
		    return ActionResult.FAILURE;
        }
	}

	public override ActionResult Execute(Agent agent, float deltaTime)
	{
        if (succeeded) {
            countDown -= deltaTime;
            if (countDown <= 0) {
		        return ActionResult.SUCCESS;
            } else {
                return ActionResult.RUNNING;
            }
        } else {
	        return ActionResult.FAILURE;
        }
	}

	public override ActionResult Stop(Agent agent, float deltaTime)
    {
        if (succeeded && carrying <= 0) {
            carrying = targetGeyser.GetComponent<GeyserController>().PullResources (canCarry);
            actionContext.AddContextItem<int> ("carrying", carrying);
	        return ActionResult.SUCCESS;
        } else {
	        return ActionResult.FAILURE;
        }
    }
}