text:
#ifndef _ONLDB_TYPES_H
#define _ONLDB_TYPES_H

namespace onl
{
  // the first set of these define the classes for each database table fully
  sql_create_16(users,1,16,
    mysqlpp::sql_varchar, user,
    mysqlpp::sql_smallint_unsigned, uid,
    mysqlpp::sql_varchar, password,
    mysqlpp::sql_tinyint_unsigned, priv,
    mysqlpp::sql_smallint_unsigned, score,
    mysqlpp::sql_varchar, respadmin,
    mysqlpp::sql_varchar, timezone,
    mysqlpp::sql_varchar, fullname,
    mysqlpp::sql_varchar, email,
    mysqlpp::sql_varchar, position,
    mysqlpp::sql_varchar, institution,
    mysqlpp::sql_varchar, phone,
    mysqlpp::sql_varchar, homepage,
    mysqlpp::sql_varchar, advisor,
    mysqlpp::sql_varchar, advisoremail,
    mysqlpp::sql_varchar, description)

  sql_create_3(groups,1,3,
    mysqlpp::sql_varchar, grp,
    mysqlpp::sql_smallint_unsigned, gid,
    mysqlpp::sql_varchar, respuser)

  sql_create_3(members,2,3,
    mysqlpp::sql_varchar, user,
    mysqlpp::sql_varchar, grp,
    mysqlpp::sql_tinyint_unsigned, prime)

  sql_create_4(observers,2,4,
    mysqlpp::sql_varchar, observer,
    mysqlpp::sql_varchar, observee,
    mysqlpp::sql_datetime, begin,
    mysqlpp::sql_datetime, end)

  sql_create_12(types,1,12,
    mysqlpp::sql_varchar, tid,
    mysqlpp::sql_varchar, type,
    mysqlpp::sql_tinyint_unsigned, daemon,
    mysqlpp::sql_tinyint_unsigned, keeboot,
    mysqlpp::sql_varchar, shortdesc,
    mysqlpp::sql_tinyint_unsigned, hasvport,
    mysqlpp::sql_tinyint_unsigned, vmsupport,
    mysqlpp::sql_smallint_unsigned, corecapacity,
    mysqlpp::sql_smallint_unsigned, memcapacity,
    mysqlpp::sql_smallint_unsigned, numinterfaces,
    mysqlpp::sql_smallint_unsigned, interfacebw,
    mysqlpp::sql_tinyint_unsigned, rootonly)

  sql_create_4(interfacetypes,1,4,
    mysqlpp::sql_varchar, interface,
    mysqlpp::sql_varchar, description,
    mysqlpp::sql_varchar, type,
    mysqlpp::sql_smallint_unsigned, bandwidth)

  sql_create_7(nodes,1,7,
    mysqlpp::sql_varchar, node,
    mysqlpp::sql_varchar, tid,
    mysqlpp::sql_varchar, daemonhost,
    mysqlpp::sql_smallint_unsigned, daemonport,
    mysqlpp::sql_tinyint_unsigned, priority,
    mysqlpp::sql_varchar, acl,
    mysqlpp::sql_varchar, state)

  sql_create_3(interfaces,1,3,
    mysqlpp::sql_varchar, tid,
    mysqlpp::sql_smallint_unsigned, port,
    mysqlpp::sql_varchar, interface)

  sql_create_3(clustercomps,2,3,
    mysqlpp::sql_smallint_unsigned, compid,
    mysqlpp::sql_varchar, tid,
    mysqlpp::sql_varchar, comptype)

  sql_create_6(connections,1,6,
    mysqlpp::sql_smallint_unsigned, cid,
    mysqlpp::sql_smallint_unsigned, capacity,
    mysqlpp::sql_varchar, node1,
    mysqlpp::sql_smallint_unsigned, node1port,
    mysqlpp::sql_varchar, node2,
    mysqlpp::sql_smallint_unsigned, node2port)

  sql_create_5(hwclusters,1,5,
    mysqlpp::sql_varchar, cluster,
    mysqlpp::sql_varchar, tid,
    mysqlpp::sql_tinyint_unsigned, priority,
    mysqlpp::sql_varchar, acl,
    mysqlpp::sql_varchar, state)

  sql_create_3(hwclustercomps,1,3,
    mysqlpp::sql_varchar, node,
    mysqlpp::sql_varchar, cluster,
    mysqlpp::sql_tinyint_unsigned, dependent)

  sql_create_4(log,1,4,
    mysqlpp::sql_varchar, node,
    mysqlpp::sql_date, dt,
    mysqlpp::sql_varchar, category,
    mysqlpp::sql_varchar, notes)

  sql_create_5(reservations,1,5,
    mysqlpp::sql_mediumint_unsigned, rid,
    mysqlpp::sql_varchar, user,
    mysqlpp::sql_datetime, begin,
    mysqlpp::sql_datetime, end,
    mysqlpp::sql_varchar, state)

  sql_create_4(experiments,1,4,
    mysqlpp::sql_smallint_unsigned, eid,
    mysqlpp::sql_datetime, begin,
    mysqlpp::sql_datetime, end,
    mysqlpp::sql_mediumint_unsigned, rid)

  sql_create_6(nodeschedule,3,6,
    mysqlpp::sql_varchar, node,
    mysqlpp::sql_mediumint_unsigned, rid,
    mysqlpp::sql_tinyint_unsigned, fixed,
    mysqlpp::sql_smallint_unsigned, vmid,
    mysqlpp::sql_smallint_unsigned, cores,
    mysqlpp::sql_smallint_unsigned, memory)

  sql_create_6(connschedule,3,6,
    mysqlpp::sql_smallint_unsigned, linkid,
    mysqlpp::sql_mediumint_unsigned, rid,
    mysqlpp::sql_smallint_unsigned, cid,
    mysqlpp::sql_smallint_unsigned, capacity,
    mysqlpp::sql_smallint_unsigned, rload,
    mysqlpp::sql_smallint_unsigned, lload)

  sql_create_3(hwclusterschedule,2,3,
    mysqlpp::sql_varchar, cluster,
    mysqlpp::sql_mediumint_unsigned, rid,
    mysqlpp::sql_tinyint_unsigned, fixed)

  sql_create_4(vswitchschedule,3,4,
    mysqlpp::sql_smallint_unsigned, vlanid,
    mysqlpp::sql_mediumint_unsigned, rid,
    mysqlpp::sql_smallint_unsigned, port,
    mysqlpp::sql_smallint_unsigned, linkid)

  sql_create_10(linkschedule,2,10,
    mysqlpp::sql_smallint_unsigned, linkid,
    mysqlpp::sql_mediumint_unsigned, rid,
    mysqlpp::sql_varchar, node1,
    mysqlpp::sql_smallint_unsigned, port1,
    mysqlpp::sql_smallint_unsigned, port1capacity,
    mysqlpp::sql_varchar, node2,
    mysqlpp::sql_smallint_unsigned, port2,
    mysqlpp::sql_smallint_unsigned, port2capacity,
    mysqlpp::sql_smallint_unsigned, node1vmid,
    mysqlpp::sql_smallint_unsigned, node2vmid)

  sql_create_3(policy,1,3,
    mysqlpp::sql_varchar, parameter,
    mysqlpp::sql_smallint_unsigned, value,
    mysqlpp::sql_varchar, description)

  sql_create_9(typepolicy,4,9,
    mysqlpp::sql_varchar, tid,
    mysqlpp::sql_varchar, grp,
    mysqlpp::sql_datetime, begin,
    mysqlpp::sql_datetime, end,
    mysqlpp::sql_smallint_unsigned, maxlen,
    mysqlpp::sql_smallint_unsigned, usermaxnum,
    mysqlpp::sql_smallint_unsigned, usermaxusage,
    mysqlpp::sql_smallint_unsigned, grpmaxnum,
    mysqlpp::sql_smallint_unsigned, grpmaxusage)

  // the next set define classes that only partially reflect some tables for ease of updating
  sql_create_1(nodestates,1,0,
    mysqlpp::sql_varchar, state)

  sql_create_1(clusterstates,1,0,
    mysqlpp::sql_varchar, state)

  sql_create_1(nodenames,1,0,
    mysqlpp::sql_varchar, node)

  sql_create_1(clusternames,1,0,
    mysqlpp::sql_varchar, cluster)

  sql_create_1(passwords,1,0,
    mysqlpp::sql_varchar, password)

  sql_create_1(timezones,1,0,
    mysqlpp::sql_varchar, timezone)

  sql_create_1(policyvals,1,0,
    mysqlpp::sql_smallint_unsigned, value)

  sql_create_5(typepolicyvals,5,0,
    mysqlpp::sql_smallint_unsigned, maxlen,
    mysqlpp::sql_smallint_unsigned, usermaxnum,
    mysqlpp::sql_smallint_unsigned, usermaxusage,
    mysqlpp::sql_smallint_unsigned, grpmaxnum,
    mysqlpp::sql_smallint_unsigned, grpmaxusage)

  sql_create_2(clusterelems,2,0,
    mysqlpp::sql_smallint_unsigned, compid,
    mysqlpp::sql_varchar, type)

  sql_create_4(clusterconnelems,4,0,
    mysqlpp::sql_smallint_unsigned, comp1id,
    mysqlpp::sql_smallint_unsigned, comp1port,
    mysqlpp::sql_smallint_unsigned, comp2id,
    mysqlpp::sql_smallint_unsigned, comp2port)

  sql_create_3(otherrestimes,3,0,
    mysqlpp::sql_varchar, user,
    mysqlpp::sql_datetime, begin,
    mysqlpp::sql_datetime, end)

  sql_create_2(restimes,2,0,
    mysqlpp::sql_datetime, begin,
    mysqlpp::sql_datetime, end)

  sql_create_9(nodeinfo,9,0,
    mysqlpp::sql_varchar, node,
    mysqlpp::sql_varchar, state,
    mysqlpp::sql_tinyint_unsigned,  daemon,
    mysqlpp::sql_tinyint_unsigned,  keeboot,
    mysqlpp::sql_varchar, daemonhost,
    mysqlpp::sql_smallint_unsigned, daemonport,
    mysqlpp::sql_varchar, type,
    mysqlpp::Null<mysqlpp::sql_tinyint_unsigned>, dependent,
    mysqlpp::sql_varchar, cluster)

  sql_create_3(clusterinfo,3,0,
    mysqlpp::sql_varchar, cluster,
    mysqlpp::sql_varchar, state,
    mysqlpp::sql_varchar, type)

  sql_create_1(linkconn,1,0,
    mysqlpp::sql_smallint_unsigned, cid)

  sql_create_4(conninfo,4,0,
    mysqlpp::sql_varchar, node1,
    mysqlpp::sql_smallint_unsigned, node1port,
    mysqlpp::sql_varchar, node2,
    mysqlpp::sql_smallint_unsigned, node2port)

  sql_create_1(typetype,1,0,
    mysqlpp::sql_varchar, type)

  sql_create_1(lockresult,1,0,
    mysqlpp::Null<mysqlpp::sql_tinyint_unsigned>, lockres)

  sql_create_3(curresinfo,3,0,
    mysqlpp::sql_datetime, begin,
    mysqlpp::sql_datetime, end,
    mysqlpp::sql_mediumint_unsigned, rid)

  sql_create_2(resinfo,2,0,
    mysqlpp::sql_mediumint_unsigned, rid,
    mysqlpp::sql_varchar, state)

  sql_create_3(experimentins,3,0,
    mysqlpp::sql_datetime, begin,
    mysqlpp::sql_datetime, end,
    mysqlpp::sql_mediumint_unsigned, rid)

  sql_create_4(reservationins,4,0,
    mysqlpp::sql_varchar, user,
    mysqlpp::sql_datetime, begin,
    mysqlpp::sql_datetime, end,
    mysqlpp::sql_varchar, state)

  sql_create_2(userres,2,0,
    mysqlpp::sql_mediumint_unsigned, rid,
    mysqlpp::sql_varchar, user)

  sql_create_1(typenameinfo,1,0,
    mysqlpp::sql_varchar, tid)

  sql_create_1(privileges,1,0,
    mysqlpp::sql_tinyint_unsigned, priv)

  sql_create_1(resend,1,0,
    mysqlpp::sql_datetime, end)

  sql_create_4(hwclustertypes,4,0,
    mysqlpp::sql_varchar, cluster,
    mysqlpp::sql_varchar, tid,
    mysqlpp::sql_varchar, acl,
    mysqlpp::sql_tinyint_unsigned, fixed)

  sql_create_9(nodetypes,9,0,
    mysqlpp::sql_varchar, node,
    mysqlpp::sql_varchar, tid,
    mysqlpp::Null<mysqlpp::sql_varchar>, cluster,
    mysqlpp::sql_varchar, acl,
    mysqlpp::sql_varchar, daemonhost,
    mysqlpp::sql_tinyint_unsigned, fixed,
    mysqlpp::sql_smallint_unsigned, vmid,
    mysqlpp::sql_smallint_unsigned, cores,
    mysqlpp::sql_smallint_unsigned, memory)

  sql_create_3(oldnodes,3,0,
    mysqlpp::sql_varchar, node,
    mysqlpp::sql_varchar, daemonhost,
    mysqlpp::sql_varchar, acl)

  sql_create_2(oldclusters,2,0,
    mysqlpp::sql_varchar, cluster,
    mysqlpp::sql_varchar, acl)

  sql_create_9(linkinfo,9,0,
    mysqlpp::sql_smallint_unsigned, linkid,
    mysqlpp::sql_smallint_unsigned, capacity,
    mysqlpp::sql_smallint_unsigned, cid,
    mysqlpp::sql_varchar, node1,
    mysqlpp::sql_smallint_unsigned, node1port,
    mysqlpp::sql_varchar, node2,
    mysqlpp::sql_smallint_unsigned, node2port,
    mysqlpp::sql_smallint_unsigned, rload,
    mysqlpp::sql_smallint_unsigned, lload)

  sql_create_3(baseclusterinfo,3,0,
    mysqlpp::sql_varchar, cluster,
    mysqlpp::sql_tinyint_unsigned, priority,
    mysqlpp::sql_varchar, tid)

  sql_create_2(specialclusterinfo,2,0,
    mysqlpp::sql_varchar, cluster,
    mysqlpp::sql_varchar, tid)

  sql_create_1(clustercluster,1,0,
    mysqlpp::sql_varchar, cluster)

  sql_create_1(switchports,1,0,
    mysqlpp::sql_smallint_unsigned, numports)

  sql_create_1(mgmtport,1,0,
    mysqlpp::sql_smallint_unsigned, port)

  sql_create_4(basenodeinfo,4,0,
    mysqlpp::sql_varchar, node,
    mysqlpp::sql_tinyint_unsigned, priority,
    mysqlpp::sql_varchar, tid,
    mysqlpp::Null<mysqlpp::sql_varchar>, cluster)

  sql_create_6(basenodevminfo,6,0,
    mysqlpp::sql_varchar, node,
    mysqlpp::sql_tinyint_unsigned, priority,
    mysqlpp::sql_varchar, tid,
    mysqlpp::Null<mysqlpp::sql_varchar>, cluster,
    mysqlpp::sql_smallint_unsigned, cores,
    mysqlpp::sql_smallint_unsigned, memory)

  sql_create_3(specialnodeinfo,3,0,
    mysqlpp::sql_varchar, node,
    mysqlpp::sql_varchar, tid,
    mysqlpp::Null<mysqlpp::sql_varchar>, cluster)

  sql_create_2(specnodeinfo,2,0,
    mysqlpp::sql_varchar, node,
    mysqlpp::sql_varchar, tid)

  sql_create_1(connid,1,0,
    mysqlpp::sql_smallint_unsigned, cid);

  sql_create_1(usernames,1,0,
    mysqlpp::sql_varchar, user);

  sql_create_1(capinfo,1,0,
    mysqlpp::sql_smallint_unsigned, capacity);

  sql_create_3(caploadinfo,3,0,
    mysqlpp::sql_smallint_unsigned, capacity,
    mysqlpp::sql_smallint_unsigned, rload,
    mysqlpp::sql_smallint_unsigned, lload);

  sql_create_4(capconninfo,4,0,
    mysqlpp::sql_smallint_unsigned, cid,
    mysqlpp::sql_smallint_unsigned, capacity,
    mysqlpp::sql_smallint_unsigned, rload,
    mysqlpp::sql_smallint_unsigned, lload);

  sql_create_1(bwinfo,1,0,
    mysqlpp::sql_smallint_unsigned, bandwidth);

  sql_create_1(vportinfo,1,0,
	       mysqlpp::sql_tinyint_unsigned, virtualport);

  sql_create_1(vporttype,1,0,
	       mysqlpp::sql_tinyint_unsigned, hasvport);

  sql_create_1(node2info,1,0,
    mysqlpp::sql_varchar, node2);

  sql_create_6(baselinkinfo,6,0,
    mysqlpp::sql_smallint_unsigned, cid,
    mysqlpp::sql_smallint_unsigned, capacity,
    mysqlpp::sql_varchar, node1,
    mysqlpp::sql_smallint_unsigned, node1port,
    mysqlpp::sql_varchar, node2,
    mysqlpp::sql_smallint_unsigned, node2port)

  sql_create_1(vswitches,1,0,
    mysqlpp::sql_smallint_unsigned, vlanid)

  sql_create_2(vswitchconns,2,0,
    mysqlpp::sql_smallint_unsigned, vlanid,
    mysqlpp::sql_smallint_unsigned, port)

  sql_create_7(typeinfo,7,0,
    mysqlpp::sql_varchar, tid,
    mysqlpp::sql_tinyint_unsigned, hasvport,
    mysqlpp::sql_tinyint_unsigned, vmsupport,
    mysqlpp::sql_smallint_unsigned, corecapacity,
    mysqlpp::sql_smallint_unsigned, memcapacity,
    mysqlpp::sql_smallint_unsigned, numinterfaces,
    mysqlpp::sql_smallint_unsigned, interfacebw)

  sql_create_3(typeresinfo,3,0,
    mysqlpp::sql_varchar, tid,
    mysqlpp::sql_tinyint_unsigned, hasvport,
    mysqlpp::sql_tinyint_unsigned, rootonly)
};
#endif // _ONLDB_TYPES_H


text:
using RabbitMQ.Client;
using Vtex.RabbitMQ.Messaging.Interfaces;

namespace Vtex.RabbitMQ.Messaging
{
    public class RabbitMQMessageFeedbackSender : IMessageFeedbackSender
    {
        private readonly IModel _model;

        public ulong DeliveryTag { get; private set; }

        public bool MessageAcknoledged { get; private set; }

        public RabbitMQMessageFeedbackSender(IModel model, ulong deliveryTag)
        {
            _model = model;
            DeliveryTag = deliveryTag;

            MessageAcknoledged = false;
        }

        public void Ack()
        {
            if (!MessageAcknoledged)
            {
                _model.BasicAck(DeliveryTag, false);

                MessageAcknoledged = true;
            }
        }

        public void Nack(bool requeue)
        {
            if (!MessageAcknoledged)
            {
                _model.BasicNack(DeliveryTag, false, requeue);

                MessageAcknoledged = true;
            }
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
package seedu.Tdoo.model.task.attributes;

import seedu.Tdoo.commons.exceptions.IllegalValueException;

/**
 * Represents a task's name in the TodoList. Guarantees: immutable; is valid as
 * declared in {@link #isValidName(String)}
 */
public class Name {

	public static final String MESSAGE_NAME_CONSTRAINTS = "task names can accept any characters";
	public static final String NAME_VALIDATION_REGEX = ".+";

	public final String name;

	/**
	 * Validates given name.
	 *
	 * @throws IllegalValueException
	 *             if given name string is invalid.
	 */
	public Name(String name) throws IllegalValueException {
		assert name != null;
		name = name.trim();
		if (!isValidName(name)) {
			throw new IllegalValueException(MESSAGE_NAME_CONSTRAINTS);
		}
		this.name = name;
	}

	/**
	 * Returns true if a given string is a valid task name.
	 */
	public static boolean isValidName(String test) {
		return test.matches(NAME_VALIDATION_REGEX);
	}

	@Override
	public String toString() {
		return name;
	}

	@Override
	public boolean equals(Object other) {
		return other == this // short circuit if same object
				|| (other instanceof Name // instanceof handles nulls
						&& this.name.equals(((Name) other).name)); // state
																	// check
	}

	@Override
	public int hashCode() {
		return name.hashCode();
	}

}


text:
/*
 * A common place for all envionment level configuration. Also ensures
 * env variables are only queried once.
 */

const NODE_ENV = process.env.NODE_ENV;
const LOG_LEVEL = process.env.LOG_LEVEL || "info";
const PORT = 8080;

module.exports = {
    port: function(){
        return PORT;
    },
    logLevel: function(){
        return LOG_LEVEL;
    },
    isDevelopment: function(){
        return NODE_ENV !== "production";
    },
    isProduction: function(){
        return NODE_ENV === "production";
    }
};


text:
//
//  MBBaseOverlaySettings.h
//  Microblink
//
//  Created by Dino Gustin on 04/05/2018.
//

#import "MBOverlaySettings.h"

NS_ASSUME_NONNULL_BEGIN

/**
 * Settings class containing UI information
 */
MB_CLASS_AVAILABLE_IOS(8.0)
@interface MBBBaseOverlaySettings : MBBOverlaySettings

/**
 * If YES, Overlay View Controller will be autorotated independently of ScanningViewController.
 *
 * Default: NO.
 */
@property (nonatomic, assign) BOOL autorotateOverlay;

/**
 * If YES, default camera overlay will display Status bar.
 * Usually, if camera is displayed inside Navigation View Controler, this is reasonable to set to YES.
 *
 * Default: YES on iPhones with notch, NO otherwise.
 */
@property (nonatomic, assign) BOOL showStatusBar;

/**
 * Default: UIInterfaceOrientationMaskPortrait
 */
@property (nonatomic, assign) UIInterfaceOrientationMask supportedOrientations;

/**
 * Full path to the sound file which is played when the valid result is scanned.
 *
 * Default: `[bundle pathForResource:@"PPbeep" ofType:@"wav"];
 */
@property (nonatomic, strong, nullable) NSString *soundFilePath;

/**
 * Default: YES.
 */
@property (nonatomic, assign) BOOL displayCancelButton;

/**
 * Default: YES.
 */
@property (nonatomic, assign) BOOL displayTorchButton;

@end

NS_ASSUME_NONNULL_END


text:
[![Build Status](https://travis-ci.org/cytoscape-ci/cxtool.svg?branch=master)](https://travis-ci.org/cytoscape-ci/cxtool)
[![MIT License](http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LISENSE)

## Introduction
This is a file conversion utility for [CX](http://www.home.ndexbio.org/data-model/).  Main function of this tool is data format conversion from/to SIF, Cytoscape.js JSON and many others.

## Status
* 5/5/2016: Repository moved to cyService.
* 11/20/2015: Pre alpha.  Simply converts CX to basic Cytoscpae.js JSON.

## Build

In addition to build executables, you need to generate

* https://github.com/jteeuwen/go-bindata

Run:

```
go-bindata -o converter/ data/
```

to generate new bundle.  And copy it to

### Supported Functions

* ___From CX___
    * Cytoscape.js (both Style and Graph)

* ___To CX___
    * SIF (Simple Interaction Format)
    * Cytoscape.js (ONGOING)
    * MITAB (TODO)
    * GraphML (TODO)

## How to Use
This is a small collection of tools to support round-trip for CX and
related documents.

### Basic Usage
1. Show Help

```
cxtool -h
```

Or simply

```
cxtool
```

1. Convert CX file into Cytoscape.js

```bash
cxtool input_file
```

We recommend to install [jq](https://stedolan.github.io/jq/) for generating human-friendly output.

The following command creates nicely formatted Cytoscape.js JSON.

```bash
cxtool input_file | jq
```

Or, use pipe for input

```bash
cat network.cx | cxtool | jq .
curl http://example.com/network.cx | cxtool | jq . > cytoscapejs1.json
```

2. Create CX from SIF

```bash
cxtool -f sif galFiltered.sif | jq | from_sif.cx
```

### Command Line Options
(TBD)

### License
MIT License

### Question?
Please send your question to (kono at ucsd edu).

----

© 2015 The Cytoscape Consortium


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~
  -->

<com.pizidea.imagepicker.widget.SquareLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/sel_grid_camera_bg"
    >

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:layout_gravity="center"
            android:drawablePadding="6dp"
            android:drawableTop="@drawable/ic_camera"
            android:gravity="center"
            android:text="拍摄照片"
            android:textColor="#CDCECE"
            android:textSize="14sp" />

    </RelativeLayout>

</com.pizidea.imagepicker.widget.SquareLayout>


text:
program t
  integer :: i ( : )
  integer :: j
  allocatable :: i , j ( : , : )
  print *,allocated(j)
end program t


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="?android:attr/selectableItemBackground"
    android:focusable="true"
    android:gravity="center_vertical"
    android:minHeight="72dp"
    android:paddingLeft="8dp"
    android:paddingRight="8dp">

    <Spinner
        android:id="@+id/spinner"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:visibility="invisible"/>

    <FrameLayout
        android:id="@+id/icon_frame"
        android:layout_width="56dp"
        android:layout_height="wrap_content">

        <android.support.v7.internal.widget.PreferenceImageView
            android:id="@android:id/icon"
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:layout_gravity="center_horizontal"/>

    </FrameLayout>

    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:layout_weight="1"
        android:orientation="vertical"
        android:paddingBottom="20dp"
        android:paddingTop="20dp">

        <TextView
            android:id="@android:id/title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:ellipsize="marquee"
            android:fadingEdge="horizontal"
            android:maxLines="1"
            android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
            android:textColor="?android:attr/textColorPrimary"
            tools:text="title"/>

        <TextView
            android:id="@android:id/summary"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="2dp"
            android:maxLines="4"
            android:textAppearance="@style/TextAppearance.AppCompat.Body1"
            android:textColor="?android:attr/textColorSecondary"
            tools:text="summary"/>

    </LinearLayout>

    <!-- Preference should place its actual preference widget here. -->
    <LinearLayout
        android:id="@android:id/widget_frame"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:gravity="center_vertical"
        android:orientation="vertical"/>

</LinearLayout>


text:
#include "CallbackProtector.h"
#include "sllog.h"

#include <media/stagefright/foundation/ADebug.h>

//--------------------------------------------------------------------------------------------------
namespace android {

CallbackProtector::CallbackProtector() : RefBase(),
        mSafeToEnterCb(true),
        mCbCount(0)
#ifdef USE_DEBUG
        , mCallbackThread(NULL),
        mCallbackTid(0),
        mRequesterThread(NULL),
        mRequesterTid(0)
#endif
{
}

CallbackProtector::~CallbackProtector() {
    Mutex::Autolock _l(mLock);
    if (mCbCount) {
        SL_LOGE("Callback protector detected an active callback after destroy");
    }

}

// static
bool CallbackProtector::enterCbIfOk(const sp<CallbackProtector> &protector) {
    if (protector != 0) {
        return protector->enterCb();
    } else {
        SL_LOGE("Callback protector is missing");
        return false;
    }
}

bool CallbackProtector::enterCb() {
    Mutex::Autolock _l(mLock);
    if (mSafeToEnterCb) {
        mCbCount++;
#ifdef USE_DEBUG
        if (mCbCount > 1) {
            SL_LOGV("Callback protector allowed multiple or nested callback entry: %u", mCbCount);
        } else {
            mCallbackThread = pthread_self();
            mCallbackTid = gettid();
        }
#endif
    } else {
#ifdef USE_DEBUG
        SL_LOGV("Callback protector denied callback entry by thread %p tid %d during destroy"
                " requested by thread %p tid %d",
                (void *) pthread_self(), gettid(),
                (void *) mRequesterThread, mRequesterTid);
#else
        SL_LOGV("Callback protector denied callback entry during destroy");
#endif
    }
    return mSafeToEnterCb;
}

void CallbackProtector::exitCb() {
    Mutex::Autolock _l(mLock);

    CHECK(mCbCount > 0);
    mCbCount--;

    if (mCbCount == 0) {
        if (!mSafeToEnterCb) {
#ifdef USE_DEBUG
            SL_LOGV("Callback protector detected return from callback by thread %p tid %d during"
                    " destroy requested by thread %p tid %d",
                    (void *) mCallbackThread, mCallbackTid,
                    (void *) mRequesterThread, mRequesterTid);
#else
            SL_LOGV("Callback protector detected return from callback during destroy");
#endif
            mCbExitedCondition.broadcast();
        }
#ifdef USE_DEBUG
        mCallbackThread = NULL;
        mCallbackTid = 0;
#endif
    }
}

void CallbackProtector::requestCbExitAndWait() {
    Mutex::Autolock _l(mLock);
    mSafeToEnterCb = false;
#ifdef USE_DEBUG
    mRequesterThread = pthread_self();
    mRequesterTid = gettid();
#endif
    while (mCbCount) {
#ifdef USE_DEBUG
        SL_LOGV("Callback protector detected in-progress callback by thread %p tid %d during"
                " blocking destroy requested by thread %p tid %d",
                (void *) mCallbackThread, mCallbackTid,
                (void *) pthread_self(), gettid());
#else
        SL_LOGV("Callback protector detected in-progress callback during blocking destroy");
#endif
        mCbExitedCondition.wait(mLock);
    }
}

void CallbackProtector::requestCbExit() {
    Mutex::Autolock _l(mLock);
    mSafeToEnterCb = false;
#ifdef USE_DEBUG
    mRequesterThread = pthread_self();
    mRequesterTid = gettid();
#endif
    if (mCbCount) {
#ifdef USE_DEBUG
        SL_LOGV("Callback protector detected in-progress callback by thread %p tid %d during"
                " non-blocking destroy requested by thread %p tid %d",
                (void *) mCallbackThread, mCallbackTid,
                (void *) pthread_self(), gettid());
#else
        SL_LOGV("Callback protector detected in-progress callback during non-blocking destroy");
#endif
    }
}

} // namespace android


text:
using namespace Platform;
using namespace Platform::Collections;
using namespace Windows::Security::Cryptography;
using namespace Windows::Security::Cryptography::Core;
using namespace Windows::Storage::Streams;
using namespace Windows::Foundation::Collections;

namespace Sodium
{
	public ref class ShortHash sealed
	{
	public:
		static Array<unsigned char>^ GenerateKey();

		[Windows::Foundation::Metadata::DefaultOverloadAttribute]
		static Array<unsigned char>^ Hash(const Array<unsigned char>^ message, const Array<unsigned char>^ key);
		static Array<unsigned char>^ Hash(String^ message, const Array<unsigned char>^ key);
		static Array<unsigned char>^ Hash(String^ message, String^ key);
	};
}


text:
package org.assertj.core.api.zoneddatetime;

import static org.mockito.Mockito.verify;

import java.time.ZonedDateTime;

import org.assertj.core.api.ZonedDateTimeAssert;

public class ZonedDateTimeAssert_isStrictlyBetween_Test extends org.assertj.core.api.ZonedDateTimeAssertBaseTest {

  private ZonedDateTime before = now.minusSeconds(1);
  private ZonedDateTime after = now.plusSeconds(1);

  @Override
  protected ZonedDateTimeAssert invoke_api_method() {
    return assertions.isStrictlyBetween(before, after);
  }

  @Override
  protected void verify_internal_effects() {
    verify(comparables).assertIsBetween(getInfo(assertions), getActual(assertions), before, after, false, false);
  }

}


text:
SRC = ../../../..
TOOLS = $(SRC)/remoting/tools
RELEASE = $(SRC)/out/Release

INSTALL_DIR = $(DESTDIR)/opt/google/chrome-remote-desktop

all:

install:
	install -d $(INSTALL_DIR)
	install $(TOOLS)/me2me_virtual_host.py -m 0755 \
	  $(INSTALL_DIR)/chrome-remote-desktop
	install $(TOOLS)/is-remoting-session $(INSTALL_DIR)
	install $(RELEASE)/remoting_me2me_host -m 0755 \
	  $(INSTALL_DIR)/chrome-remote-desktop-host
	install $(RELEASE)/remoting_start_host -m 0755 \
	  $(INSTALL_DIR)/start-host


text:
package com.hp.hpl.jena.util.iterator;

import java.util.Iterator;
import java.util.NoSuchElementException;

/**
     Creates a sub-Iterator by filtering. This class should not be used
     directly any more; the subclasses FilterKeepIterator and FilterDropIterator
     should be used instead.
     @author jjc, mods [clarity & speedup] by kers
 */
public class FilterIterator<T> extends WrappedIterator<T>
    {
	protected final Filter<T> f;
	protected T current;
    protected boolean canRemove;
    protected boolean hasCurrent;

    /**
        Initialises a FilterIterator with its filter and base.
        @param fl An object is included if it is accepted by this Filter.
        @param e The base Iterator.
    */
	public FilterIterator( Filter<T> fl, Iterator<T> e )
        {
		super( e );
		f = fl;
        }

    /**
        Answer true iff there is at least one more acceptable object.
        [Stores reference into current, sets canRemove
        false; answer preserved in `hasCurrent`]
    */
	@Override public boolean hasNext()
        {
	    while (!hasCurrent && super.hasNext())
            hasCurrent = accept( current = super.next() );
        canRemove = false;
        return hasCurrent;
        }

    /**
        Overridden in Drop/Keep as appropriate. Answer true if the object is
        to be kept in the output, false if it is to be dropped.
    */
    protected boolean accept( T x )
        { return f.accept( x ); }

    /**
         Remove the current member from the underlying iterator. Legal only
         after a .next() but before any subsequent .hasNext(), because that
         may advance the underlying iterator.
    */
    @Override public void remove()
        {
        if (!canRemove ) throw new IllegalStateException
            ( "FilterIterators do not permit calls to hasNext between calls to next and remove." );
        super.remove();
        }

    /**
        Answer the next acceptable object from the base iterator. The redundant
        test of `hasCurrent` appears to make a detectable speed difference.
        Crazy.
    */
	@Override public T next()
        {
		if (hasCurrent || hasNext())
            {
            canRemove = true;
            hasCurrent = false;
            return current;
            }
		throw new NoSuchElementException();
        }
    }

/*
 *  (c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP
 *  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.

 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * $Id: FilterIterator.java,v 1.1 2009/06/29 08:55:49 castagna Exp $
 *
*/


text:
// Given a binary search tree (BST) with duplicates, find all the mode(s) (the most frequently occurred element) in the given BST.
//
// Assume a BST is defined as follows:
//
//     The left subtree of a node contains only nodes with keys less than or equal to the node's key.
//     The right subtree of a node contains only nodes with keys greater than or equal to the node's key.
//     Both the left and right subtrees must also be binary search trees.
//
// For example:
// Given BST [1,null,2,2],
//
//    1
//     \
//      2
//     /
//    2
//
// return [2].
//
// Note: If a tree has more than one mode, you can return them in any order.
//
// Follow up: Could you do that without using any extra space? (Assume that the implicit stack space incurred due to recursion does not count).

/**
 * Definition for a binary tree node.
 * function TreeNode(val) {
 *     this.val = val;
 *     this.left = this.right = null;
 * }
 */

 /**
 * @param {TreeNode} root
 * @return {number[]}
 */
let findMode = function(root) {

  let mode = [];

  if (root === null) {
    return mode;
  }

  let stack = [root];
  let count = {};
  let maxCount = -Infinity;

  while (stack.length !== 0) {
    let node = stack.pop();
    let value = node.val;
    let current = count[value];

    if (current === undefined) {
      current = 1;
    } else {
      current++;
    }

    count[value] = current;

    if (current > maxCount) {
      mode = [value];
      maxCount = current;
    } else if (current === maxCount) {
      mode.push(value);
    }

    if (node.right !== null) {
      stack.push(node.right);
    }

    if (node.left !== null) {
      stack.push(node.left);
    }
  }

  return mode;
};


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>PlaceLocationName</title>
<meta name="date" content="2020-04-16">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

pb.locationintelligence.model

Class PlaceLocationName

java.lang.Object

pb.locationintelligence.model.PlaceLocationName

@Generated(value="class io.swagger.codegen.languages.JavaClientCodegen",
           date="2020-04-16T15:55:12.092+05:30")
public class PlaceLocationName
extends java.lang.Object

PlaceLocationName

Constructor Summary

Constructors

Constructor and Description

PlaceLocationName()

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

boolean
equals(java.lang.Object o)

java.lang.String
getLangISOCode()

Get langISOCode

java.lang.String
getLangType()

Get langType

java.lang.String
getValue()

Get value

int
hashCode()

PlaceLocationName
langISOCode(java.lang.String langISOCode)

PlaceLocationName
langType(java.lang.String langType)

void
setLangISOCode(java.lang.String langISOCode)

void
setLangType(java.lang.String langType)

void
setValue(java.lang.String value)

java.lang.String
toString()

PlaceLocationName
value(java.lang.String value)

Methods inherited from class java.lang.Object

getClass, notify, notifyAll, wait, wait, wait

Constructor Detail

PlaceLocationName

public PlaceLocationName()

Method Detail

langType

public PlaceLocationName langType(java.lang.String langType)

getLangType

public java.lang.String getLangType()

Get langType

Returns:

langType

setLangType

public void setLangType(java.lang.String langType)

langISOCode

public PlaceLocationName langISOCode(java.lang.String langISOCode)

getLangISOCode

public java.lang.String getLangISOCode()

Get langISOCode

Returns:

langISOCode

setLangISOCode

public void setLangISOCode(java.lang.String langISOCode)

value

public PlaceLocationName value(java.lang.String value)

getValue

public java.lang.String getValue()

Get value

Returns:

value

setValue

public void setValue(java.lang.String value)

equals

public boolean equals(java.lang.Object o)

Overrides:

equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:

hashCode in class java.lang.Object

toString

public java.lang.String toString()

Overrides:

toString in class java.lang.Object

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
---
date: 2020-07-25
linktitle: Grunt Tutorial
title: Grunt Tutorial with Live Example
weight: 10
url: /grunt-tutorial-example
description: So, what is this thing called Grunt and how can it help you?
keywords:
  - grunt
  - tools
  - automation
  - javascript
---
<meta property="og:image" content="https://tutswiki.com/img/tutswiki-logo.png"/>
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="Grunt Tutorial with Live Example" />
<meta name="twitter:description" content="So, what is this thing called Grunt and how can it help you?" />

So, what is this thing called Grunt and how can it help you?

From the [grunt documentation](https://gruntjs.com/):

> "A task-based command line build tool for JavaScript projects"

This means one simple thing. Stop repeating yourself and let Grunt do stuff for you. The [Grunt ecosystem](https://gruntjs.com/plugins) is constantly growing and being improved by open source contributors.

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
     style="display:block; text-align:center;"
     data-ad-layout="in-article"
     data-ad-format="fluid"
     data-ad-client="ca-pub-9878675755379402"
     data-ad-slot="5842766387"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>

## Plugins

You can find plugins for almost everything. Examples of tasks could be:

- compile [CoffeeScript](https://npmjs.org/package/grunt-contrib-coffee), [Jade](https://npmjs.org/package/grunt-contrib-jade), [Sass](https://npmjs.org/package/grunt-contrib-sass), [Stylus](https://npmjs.org/package/grunt-contrib-stylus), [Mustache](https://npmjs.org/package/grunt-mustache),…
- [optimize](https://www.npmjs.com/package/grunt-contrib-imagemin) images
- [run jshint](https://www.npmjs.com/package/grunt-contrib-jshint) on your code
- [uglify](https://npmjs.org/package/grunt-contrib-uglify) your code

This allows you to optimize your workflow to the limit.
If you save a file you can have your tests run or your code minified.
This means you can stop worrying about this stuff. You don't need to issue commands in the command line constantly. Just code and _let Grunt work for you_.

If you think about it Grunt is like [Codekit](http://incident57.com/codekit/) but with nothing but a CLI.
It's cross-platform out of the box, free as in [MIT licensed](https://github.com/gruntjs/grunt/blob/master/LICENSE) and extensible as hell.

## First use
Grunt is able to set up a project for you by scaffolding a template based on your input in the commandline. This is nice but not needed for this simple demo. I want to show you how Grunt can help you in all your projects by adding just two files!

Grunt only needs two files to work in your project directory: ```package.json``` and ```Gruntfile```.

I'm not going to talk about this in detail. [Read up](http://gruntjs.com/getting-started) if you want to know more.

## Demo setup
I made a [demo repository](https://github.com/chankeypathak/grunt-tutorial) that shows Grunt usage in it's most basic form with only one task. This makes it easy to understand what's actually going on.

```javascript
module.exports = function(grunt){
  grunt.initConfig({
	pkg: grunt.file.readJSON('package.json'),
	// set up first custom task: concat
	// the options depend on the task you want to use
	concat: {
	  options: {
		// string to put between concatenated files
		separator: ';'
	  },
	  dist: {
		// files to concat together
		src: ['js/*.js'],
		// location of result file
		dest: 'jsmin/<%= pkg.name %>.js'
	  }
	}
  });

  // load contrib task files
  // note: these should be installed from npm
  grunt.loadNpmTasks('grunt-contrib-concat');
  // register what to do when using the default 'grunt' command
  grunt.registerTask('default', ['concat']);
};
```

This will concate all `.js` files inside the `/js` folder and concatenate them to `/jsmin` in the filename of your choice.

The only thing you need to do is run `grunt` inside your project.

```bash
$ grunt
```

## Multiple tasks

Next step is to show that multiple tasks are possible. You can see below that I added concatenation for the CSS files and the concatenated JavaScript gets uglified.

Final gruntfile looks like this:

```javascript
module.exports = function(grunt){
  grunt.initConfig({
	pkg: grunt.file.readJSON('package.json'),
	// set up first custom task: concat
	// the options depend on the task you want to use
	concat: {
	  options: {
		// string to put between concatenated files
		// can be necessary when processing minified js code
		//separator: ';'
	  },
	  js: {
		// files to concat together
		src: ['js/*.js'],
		// location of result file
		dest: 'jsmin/<%= pkg.name %>.min.js'
	  },
	  css: {
		// files to concat together
		src: ['css/*.css'],
		// location of result file
		dest: 'cssmin/all.min.css'
	  }
	},
	uglify: {
	  options: {
		banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
	  },
	  build: {
		src: 'jsmin/<%= pkg.name %>.min.js',
		dest: 'jsmin/<%= pkg.name %>.min.js'
	  }
	}
  });

  // load contrib task files
  // note: these should be installed from npm
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');

  // a custom task
  // no configuration for this task, it just logs stuff
  grunt.registerTask('default', 'Log stuff.', function() {
	  grunt.log.write('I am a custom task...').ok();
	});
  // register what to do when using the default 'grunt' command
  grunt.registerTask('default', ['concat', 'uglify']);
};
```

I ran this file through [Docco](http://jashkenas.github.com/docco/) which generated a documentation file based on the inline comments. You could even let [grunt-docco plugin](https://github.com/DavidSouther/grunt-docco) do this for you. Check this out in the `/docs` folder or [see it live](https://github.com/chankeypathak/grunt-tutorial/blob/master/docs/Gruntfile.html).

The latest working code can be found in the [repo](https://github.com/chankeypathak/grunt-tutorial/) on GitHub.

![grunt command in terminal](https://raw.githubusercontent.com/chankeypathak/grunt-tutorial/master/screenshot.png)


text:
namespace sly.parser.syntax.tree
{
    public interface ISyntaxNode<IN> where IN : struct
    {

        bool Discarded { get;  }
        string Name { get; }

        bool HasByPassNodes { get; set; }

        string Dump(string tab);

        string ToJson(int index = 0);

    }
}


text:
<?php

class Twig_Tests_Profiler_ProfileTest extends PHPUnit_Framework_TestCase
{
    public function testConstructor()
    {
        $profile = new Twig_Profiler_Profile('template', 'type', 'name');

        $this->assertEquals('template', $profile->getTemplate());
        $this->assertEquals('type', $profile->getType());
        $this->assertEquals('name', $profile->getName());
    }

    public function testIsRoot()
    {
        $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::ROOT);
        $this->assertTrue($profile->isRoot());

        $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::TEMPLATE);
        $this->assertFalse($profile->isRoot());
    }

    public function testIsTemplate()
    {
        $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::TEMPLATE);
        $this->assertTrue($profile->isTemplate());

        $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::ROOT);
        $this->assertFalse($profile->isTemplate());
    }

    public function testIsBlock()
    {
        $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::BLOCK);
        $this->assertTrue($profile->isBlock());

        $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::ROOT);
        $this->assertFalse($profile->isBlock());
    }

    public function testIsMacro()
    {
        $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::MACRO);
        $this->assertTrue($profile->isMacro());

        $profile = new Twig_Profiler_Profile('template', Twig_Profiler_Profile::ROOT);
        $this->assertFalse($profile->isMacro());
    }

    public function testGetAddProfile()
    {
        $profile = new Twig_Profiler_Profile();
        $profile->addProfile($a = new Twig_Profiler_Profile());
        $profile->addProfile($b = new Twig_Profiler_Profile());

        $this->assertSame(array($a, $b), $profile->getProfiles());
        $this->assertSame(array($a, $b), iterator_to_array($profile));
    }

    public function testGetDuration()
    {
        $profile = new Twig_Profiler_Profile();
        usleep(1);
        $profile->leave();

        $this->assertTrue($profile->getDuration() > 0, sprintf('Expected duration > 0, got: %f', $profile->getDuration()));
    }

    public function testSerialize()
    {
        $profile = new Twig_Profiler_Profile('template', 'type', 'name');
        $profile1 = new Twig_Profiler_Profile('template1', 'type1', 'name1');
        $profile->addProfile($profile1);
        $profile->leave();
        $profile1->leave();

        $profile2 = unserialize(serialize($profile));
        $profiles = $profile->getProfiles();
        $this->assertCount(1, $profiles);
        $profile3 = $profiles[0];

        $this->assertEquals($profile->getTemplate(), $profile2->getTemplate());
        $this->assertEquals($profile->getType(), $profile2->getType());
        $this->assertEquals($profile->getName(), $profile2->getName());
        $this->assertEquals($profile->getDuration(), $profile2->getDuration());

        $this->assertEquals($profile1->getTemplate(), $profile3->getTemplate());
        $this->assertEquals($profile1->getType(), $profile3->getType());
        $this->assertEquals($profile1->getName(), $profile3->getName());
    }
}


text:
import {View} from 'aurelia-templating';
import {Aurelia} from 'aurelia-framework';
import {waitFor} from './wait';

export class StageComponent {
  static withResources(resources?: string | string[]): ComponentTester {
    return new ComponentTester().withResources(resources);
  }
}

export class ComponentTester {
  bind: (bindingContext: any) => void;
  attached: () => void;
  unbind: () => void;
  element: Element;
  viewModel: any;
  configure = aurelia => aurelia.use.standardConfiguration();
  _html: string;
  _resources: string | string[] = [];
  _bindingContext: any;
  _rootView: View;

  bootstrap(configure: (aurelia: Aurelia) => void) {
    this.configure = configure;
  }

  withResources(resources: string | string[]): ComponentTester {
    this._resources = resources;
    return this;
  }

  inView(html: string): ComponentTester {
    this._html = html;
    return this;
  }

  boundTo(bindingContext: any): ComponentTester {
    this._bindingContext = bindingContext;
    return this;
  }

  manuallyHandleLifecycle(): ComponentTester {
    this._prepareLifecycle();
    return this;
  }

  create(bootstrap: (configure: (aurelia: Aurelia) => Promise<void>) => Promise<void>): Promise<void> {
    return bootstrap(aurelia => {
      return Promise.resolve(this.configure(aurelia)).then(() => {
        if (this._resources) {
          aurelia.use.globalResources(this._resources);
        }

        return aurelia.start().then(a => {
          this.host = document.createElement('div');
          this.host.innerHTML = this._html;

          document.body.appendChild(this.host);

          return aurelia.enhance(this._bindingContext, this.host).then(() => {
            this._rootView = aurelia.root;
            this.element = this.host.firstElementChild;

            if (aurelia.root.controllers.length) {
              this.viewModel = aurelia.root.controllers[0].viewModel;
            }

            return new Promise(resolve => setTimeout(() => resolve(), 0));
          });
        });
      });
    });
  }

  dispose() {
    if (this.host === undefined || this._rootView === undefined) {
      throw new Error(
        'Cannot call ComponentTester.dispose() before ComponentTester.create()'
      );
    }

    this._rootView.detached();
    this._rootView.unbind();

    return this.host.parentNode.removeChild(this.host);
  }

  _prepareLifecycle() {
    // bind
    const bindPrototype = View.prototype.bind;
    View.prototype.bind = () => {};
    this.bind = bindingContext => new Promise(resolve => {
      View.prototype.bind = bindPrototype;
      if (bindingContext !== undefined) {
        this._bindingContext = bindingContext;
      }
      this._rootView.bind(this._bindingContext);
      setTimeout(() => resolve(), 0);
    });

    // attached
    const attachedPrototype = View.prototype.attached;
    View.prototype.attached = () => {};
    this.attached = () => new Promise(resolve => {
      View.prototype.attached = attachedPrototype;
      this._rootView.attached();
      setTimeout(() => resolve(), 0);
    });

    // detached
    this.detached = () => new Promise(resolve => {
      this._rootView.detached();
      setTimeout(() => resolve(), 0);
    });

    // unbind
    this.unbind = () => new Promise(resolve => {
      this._rootView.unbind();
      setTimeout(() => resolve(), 0);
    });
  }

  waitForElement(selector: string, options: any): Promise<Element> {
    return waitFor(() => this.element.querySelector(selector), options);
  }

  waitForElements(selector: string, options: any): Promise<Element> {
    return waitFor(() => this.element.querySelectorAll(selector), options);
  }
}


text:
'''
@author: FangSun
'''

import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.operations.primarystorage_operations as ps_ops
import apibinding.inventory as inventory
import random

_config_ = {
        'timeout' : 7200,
        'noparallel' : True
        }

test_stub = test_lib.lib_get_test_stub()
test_obj_dict = test_state.TestStateDict()
new_ps_list = []
VOLUME_NUMBER = 100

def test():
    test_util.test_dsc("Create {0} volume in the first primaryStorage".format(VOLUME_NUMBER))
    ps_env = test_stub.PSEnvChecker()
    ps_list = res_ops.get_resource(res_ops.PRIMARY_STORAGE)
    if ps_env.is_sb_ceph_env:
        first_ps = random.choice([ps for ps in ps_list if ps.type == inventory.CEPH_PRIMARY_STORAGE_TYPE])
    else:
        first_ps = random.choice(ps_list)
    volume_list = test_stub.create_multi_volumes(count=VOLUME_NUMBER, ps=first_ps)
    for volume in volume_list:
        test_obj_dict.add_volume(volume)

    if len(ps_list) == 1:
        test_util.test_dsc("Add Another primaryStorage")
        second_ps = test_stub.add_primaryStorage(first_ps=first_ps)
        new_ps_list.append(second_ps)
    else:
        second_ps = random.choice([ps for ps in ps_list if ps.uuid != first_ps.uuid])

    test_util.test_dsc("Create {0} volume in the second primaryStorage".format(VOLUME_NUMBER))
    volume_list = test_stub.create_multi_volumes(count=VOLUME_NUMBER, ps=second_ps)
    for volume in volume_list:
        test_obj_dict.add_volume(volume)

    test_util.test_dsc("Create one more volume in the first primaryStorage")
    volume = test_stub.create_multi_volumes(count=1, ps=first_ps)[0]
    test_obj_dict.add_volume(volume)

    test_util.test_dsc("Check the capacity")
    #To do

    test_util.test_pass('Multi PrimaryStorage Test Pass')

def env_recover():
    test_util.test_dsc("Destroy test object")
    test_lib.lib_error_cleanup(test_obj_dict)
    if new_ps_list:
        for new_ps in new_ps_list:
            ps_ops.detach_primary_storage(new_ps.uuid, new_ps.attachedClusterUuids[0])
            ps_ops.delete_primary_storage(new_ps.uuid)


text:
BulkDataReceiverCbDistr2::BulkDataReceiverCbDistr2() : count1_m(0)
{
    ACS_TRACE("BulkDataReceiverCbDistr2::BulkDataReceiverCbDistr2");
}

BulkDataReceiverCbDistr2::~BulkDataReceiverCbDistr2()
{
    ACS_TRACE("BulkDataReceiverCbDistr2::~BulkDataReceiverCbDistr2");
}

int
BulkDataReceiverCbDistr2::cbStart(ACE_Message_Block * userParam_p)
{
    ACS_TRACE("BulkDataReceiverCbDistr2::cbStart");

    if(flowNumber_m == 2)
	{

	ACS_SHORT_LOG((LM_DEBUG, "length param flowname 2: %d", userParam_p->length()));

	char filename[256];
	ACE_OS::strcpy(filename, userParam_p->rd_ptr());

	fp_p = ACE_OS::fopen (filename,"w");

	if (fp_p == 0)
	    {
	    ACS_SHORT_LOG((LM_ERROR,"BulkDataReceiverCbEx1::cbStart %s not open successfully.", filename));
	    return -1;
	    }

	ACS_SHORT_LOG((LM_INFO, "RECEIVER 2 flowname 2: %s", flowname_m.c_str()));
	ACS_SHORT_LOG((LM_INFO, "RECEIVER 2 successfully opened file: %s", filename));

	}

    return 0;
}

int
BulkDataReceiverCbDistr2::cbReceive(ACE_Message_Block * frame_p)
{
    ACS_TRACE("BulkDataReceiverCbDistr2::cbReceive");

//    ACS_SHORT_LOG((LM_INFO, "RECEIVER 2 flowname 2: %d", frame_p->length()));

    if(flowNumber_m == 2)
	{
	while (frame_p != 0)
	    {
	    int result = ACE_OS::fwrite (frame_p->rd_ptr(),
					 frame_p->length(),
					 1,
					 fp_p);
	    if (result == 0)
		{
		ACS_SHORT_LOG((LM_ERROR,"BulkDataReceiverCbEx1::cbReceive failed"));
		return -1;
		}

	    frame_p = frame_p->cont ();

	    }
	}

    return 0;
}

int
BulkDataReceiverCbDistr2::cbStop()
{
    ACS_TRACE("BulkDataReceiverCbDistr2::cbStop");

    if(flowNumber_m == 2)
	{
	ACE_OS::fflush(fp_p);
	ACE_OS::fclose(fp_p);
        ACS_SHORT_LOG((LM_INFO, "RECEIVER 2 successfully saved file!"));
	}

    return 0;
}


text:
function $(s) {
    return document.getElementById(s.substring(1));
}

function show(s) {
    $(s).style.display = 'block';
}

function hide(s) {
    $(s).style.display = 'none';
}

function set_server() {
    hide("#status_box");
    data.url = $("#server").value;
    ubus_call("uci", "set", {
        "config": "attendedsysupgrade",
        "section": "server",
        values: {
            "url": data.url
        }
    })
    ubus_call("uci", "commit", {
        "config": "attendedsysupgrade"
    })
    var server_button = $("#server")
    server_button.type = 'button';
    server_button.className = 'cbi-button cbi-button-edit';
    server_button.parentElement.removeChild($("#button_set"));
    server_button.onclick = edit_server;
}

function edit_server() {
    $("#server").type = 'text';
    $("#server").onkeydown = function(event) {
        if (event.key === 'Enter') {
            set_server();
            return false;
        }
    }
    $("#server").className = '';
    $("#server").onclick = null;

    var button_set = document.createElement("input");
    button_set.type = "button";
    button_set.value = "Save";
    button_set.name = "button_set";
    button_set.id = "button_set";
    button_set.className = 'cbi-button cbi-button-save';
    button_set.onclick = set_server
    $("#server").parentElement.appendChild(button_set);
}

function edit_packages() {
    data.edit_packages = true
    hide("#edit_button");
    $("#edit_packages").value = data.packages.join("\n");
    show("#edit_packages");
}

// initial setup, get system information
function setup() {
    ubus_call("rpc-sys", "packagelist", {}, "packages");
    ubus_call("system", "board", {}, "release");
    ubus_call("system", "board", {}, "board_name");
    ubus_call("system", "board", {}, "model");
    ubus_call("system", "info", {}, "memory");
    uci_get({
        "config": "attendedsysupgrade",
        "section": "server",
        "option": "url"
    })
    uci_get({
        "config": "attendedsysupgrade",
        "section": "client",
        "option": "upgrade_packages"
    })
    uci_get({
        "config": "attendedsysupgrade",
        "section": "client",
        "option": "advanced_mode"
    })
    uci_get({
        "config": "attendedsysupgrade",
        "section": "client",
        "option": "auto_search"
    })
    setup_ready();
}

function setup_ready() {
    // checks if a async ubus calls have finished
    if (ubus_counter != ubus_closed) {
        setTimeout(setup_ready, 300)
    } else {
        if (data.auto_search == 1) {
            upgrade_check();
        } else {
            show("#upgrade_button");
            show("#server_div");
            $("#server").value = data.url;
        }
    }
}

function uci_get(option) {
    // simple wrapper to get a uci value store in data.<option>
    ubus_call("uci", "get", option, option["option"])
}

ubus_counter = 0;
ubus_closed = 0;

function ubus_call(command, argument, params, variable) {
    var request_data = {};
    request_data.jsonrpc = "2.0";
    request_data.id = ubus_counter;
    request_data.method = "call";
    request_data.params = [data.ubus_rpc_session, command, argument, params]
    var request_json = JSON.stringify(request_data)
    ubus_counter++;
    var request = new XMLHttpRequest();
    request.open("POST", ubus_url, true);
    request.setRequestHeader("Content-type", "application/json");
    request.onload = function(event) {
        if (request.status === 200) {
            var response = JSON.parse(request.responseText)
            if (!("error" in response) && "result" in response) {
                if (response.result.length === 2) {
                    if (command === "uci") {
                        data[variable] = response.result[1].value
                    } else {
                        data[variable] = response.result[1][variable]
                    }
                }
            } else {
                set_status("danger", "Ubus call failed:
Request: " + request_json + "
Response: " + JSON.stringify(response))
            }
            ubus_closed++;
        }
    }
    request.send(request_json);
}

function set_status(type, message, loading, show_log) {
    $("#status_box").className = "alert-message " + type;
    var loading_image = '';
    if (loading) {
        loading_image = ' ';
    }
    if (data.buildlog_url && show_log) {
        message += '
Build log
'
    }
    $("#status_box").innerHTML = loading_image + message;
    show("#status_box")
}

function upgrade_check() {
    var current_version = data.release.version.toLowerCase();
    var current_branch = current_version.split('.').slice(0, 2).join('.')
    var candidates = []
    hide("#status_box");
    hide("#server_div");
    set_status("info", "Searching for upgrades", true);
    fetch(data.url + "/api/versions")
        .then(response => response.json())
        .then(response => {
            var branches = response["branches"]
            for (i in branches) {
                // handle snapshots in a special way - as always
                if (current_version == "snapshot" && branches[i]["latest"] == "snapshot") {
                    candidates.unshift(branches[i])
                    break
                }

                if (current_version == branches[i]["latest"]) {
                    break
                }
                if (current_branch != branches[i]["name"]) {
                    branches[i]["warn_branch_jump"] = true
                }
                candidates.unshift(branches[i])
                if (current_branch == branches[i]["name"]) {
                    // don't offer branches older than the current
                    break
                }
            }

            if (candidates.length > 0) {
                var info_output = "
New release " + candidates[0].latest + " available
"
                info_output += "Installed version: " + data.release.version

                // tell server the currently installed version
                request_dict.current_version = request_dict.version;
                // tell server what version to install
                request_dict.version = candidates[0].latest;
                // tell server to diff the requested packages with the default packages
                // this allows to not automatically re-install default packages which
                // where dropped in later releases
                request_dict.diff_packages = true;

                set_status("success", info_output)

                if (data.advanced_mode == 1) {
                    show("#edit_button");
                }
                var upgrade_button = $("#upgrade_button")
                upgrade_button.value = "Request firmware";
                upgrade_button.style.display = "block";
                upgrade_button.disabled = false;
                upgrade_button.onclick = upgrade_request;

            } else {
                set_status("success", "No upgrades available")

            }
        });

}

function upgrade_request() {
    // Request firmware using the following parameters
    // distro, version, target, board_name/model, packages
    $("#upgrade_button").disabled = true;
    hide("#edit_packages");
    hide("#edit_button");
    hide("#keep_container");

    // add board info to let server determine profile
    request_dict.profile = data.board_name

    if (data.edit_packages == true) {
        request_dict.packages = $("#edit_packages").value.split("\n")
    } else {
        request_dict.packages = Object.keys(data.packages);
    }
    server_request()
}

function upgrade_request_callback(response) {
    var sysupgrade_file = "";
    console.log(response)
    for (i in response.images) {
        if (response.images[i].type == "sysupgrade") {
            sysupgrade_file = response.images[i].name;
        }
    }
    if (sysupgrade_file != "") {
        data.sysupgrade_url = data.url + '/store/' + response.bin_dir + '/' + sysupgrade_file
        var info_output = '
Firmware created

Created file: ' + sysupgrade_file + '
'
        set_status("success", info_output, false, true);

        show("#keep_container");
        var upgrade_button = $("#upgrade_button")
        upgrade_button.disabled = false;
        upgrade_button.style.display = "block";
        upgrade_button.value = "Flash firmware";
        upgrade_button.onclick = download_image;
    } else {
        set_status("danger", "Firmware build successfull but device not sysupgrade compatible!")
    }
}

function flash_image() {
    // Flash image via rpc-sys upgrade_start
    set_status("warning", "Flashing firmware. Don't unpower device", true)
    ubus_call("rpc-sys", "upgrade_start", {
        "keep": $("#keep").checked
    }, 'message');
    ping_max = 3600; // in seconds
    setTimeout(ping_ubus, 10000)
}

function ping_ubus() {
    // Tries to connect to ubus. If the connection fails the device is likely still rebooting.
    // If more time than ping_max passes update may failed
    if (ping_max > 0) {
        ping_max--;
        var request = new XMLHttpRequest();
        request.open("GET", ubus_url, true);
        request.addEventListener('error', function(event) {
            set_status("warning", "Rebooting device - please wait!", true);
            setTimeout(ping_ubus, 5000)
        });
        request.addEventListener('load', function(event) {
            set_status("success", "Success! Please reload web interface");
            $("#upgrade_button").value = "Reload page";
            show("#upgrade_button");
            $("#upgrade_button").disabled = false;
            $("#upgrade_button").onclick = function() {
                location.reload();
            }
        });
        request.send();
    } else {
        set_status("danger", "Web interface could not reconnect to your device. Please reload web interface or check device manually")
    }
}

function upload_image(blob) {
    // Uploads received blob data to the server using cgi-io
    set_status("info", "Uploading firmware to device", true);
    var request = new XMLHttpRequest();
    var form_data = new FormData();

    form_data.append("sessionid", data.ubus_rpc_session)
    form_data.append("filename", "/tmp/firmware.bin")
    form_data.append("filemode", 755) // insecure?
    form_data.append("filedata", blob)

    request.addEventListener('load', function(event) {
        request_json = JSON.parse(request.responseText)
        flash_image();
    });

    request.addEventListener('error', function(event) {
        set_status("danger", "Upload of firmware failed, please retry by reloading web interface")
    });

    request.open('POST', origin + '/cgi-bin/cgi-upload');
    request.send(form_data);
}

function download_image() {
    // Download image from server once the url was received by upgrade_request
    hide("#keep_container");
    hide("#upgrade_button");
    var download_request = new XMLHttpRequest();
    download_request.open("GET", data.sysupgrade_url);
    download_request.responseType = "arraybuffer";

    download_request.onload = function() {
        if (this.status === 200) {
            var blob = new Blob([download_request.response], {
                type: "application/octet-stream"
            });
            upload_image(blob)
        }
    };
    set_status("info", "Downloading firmware to web browser memory", true);
    download_request.send();
}

function server_request() {
    fetch(data.url + "/api/build", {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json'
            },
            body: JSON.stringify(request_dict)
        })
        .then(response => {
            switch (response.status) {
                case 200:
                    response.json()
                        .then(response => {
                            upgrade_request_callback(response)
                        });
                    break;
                case 202:
                    set_status("info", "Processing request", true);
                    setTimeout(function() {
                        server_request()
                    }, 5000)
                    break;
                case 400: // bad request
                case 422: // bad package
                case 500: // build failed
                    console.log('error (' + response.status + ')');
                    response.json()
                        .then(response => {
                            if (response.buildlog) {
                                data.buildlog_url = data.url + '/' + response.bin_dir + '/buildlog.txt';
                            }
                            set_status("danger", response.message);
                        });
                    break;
            }
        });
}

request_dict = {}
document.onload = setup()


text:
package com.facebook.buck.swift.toolchain;

import com.facebook.buck.core.model.BuildTarget;
import com.facebook.buck.core.model.FlavorConvertible;
import com.facebook.buck.core.model.TargetConfiguration;
import com.facebook.buck.core.rules.BuildRuleResolver;
import java.util.Optional;

/**
 * Used by descriptions to properly handle {@link SwiftPlatform}. During parsing/configuration only
 * information about parse-time deps is available. During action graph creation, this can be
 * resolved to the final {@link SwiftPlatform}.
 */
public interface UnresolvedSwiftPlatform extends FlavorConvertible {
  /** Returns the parse time deps of this platform. */
  Iterable<BuildTarget> getParseTimeDeps(TargetConfiguration targetConfiguration);

  /** Returns the resolved @{link NdkCxxPlatform}. */
  Optional<SwiftPlatform> resolve(BuildRuleResolver ruleResolver);
}


text:
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddHotNewRecommendArticle extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('articles', function (Blueprint $table) {
            $table->tinyInteger('hot')->default(0)->comment('热门');
            $table->tinyInteger('new')->default(0)->comment('最新');
            $table->tinyInteger('recommend')->default(0)->comment('推荐');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('articles', function (Blueprint $table) {
            $table->dropColumn(['hot', 'new', 'recommend']);
        });
    }
}


text:
Anonieme FTP

De eerste tabel op deze pagina geeft u de mogelijkheid te specificeren
naar welke directory de server doorschakelt met <tt>chroot</tt> wanneer
er een anonieme gebruiker inlogt. Er kunnen andere directory's gekozen worden
voor verschillende gebruikers klassen, of u kunt 1 directory gebruiken voor
alle klassen. Indien er geen directory is gespecificeerd zal de FTP d.m.v.
<tt>chroot</tt> naar de home directory gaan van de <tt>ftp</tt> gebruiker.

Omdat de server een extern programma oproept zoals <tt>ls</tt> en <tt>tar</tt>,
moet de anonieme root directory een <tt>bin</tt> directory bevatten met deze
programma's, een <tt>lib</tt> directory bevatten met de benodigde gedeelde
bibliotheken, en een <tt>etc</tt> directory die de <tt>passwd</tt> en
<tt>group</tt> files bevat. Wanneer de server <tt>chroot</tt> gebruikt om de
toegang tot de anonieme root directory te beperken heeft hij geen toegang tot
andere programma's buiten deze directory.

De tweede tabel bepaald voor welke directory de server <tt>chroot</tt> gebruikt
voor gast gebruikers. Voor iedere directory kunt u specificeren aan welke
gebruikers deze directory word toegevoegd door het invullen van hun gebruikersnamen,
UID (zoals <tt>%3000</tt>) of UID reeksen (zoals <tt>%3000-3006</tt>).
Als er geen gebruikers zijn ingevuld zal de directory worden gebruikt voor
alle gast gebruikers.

De derde tabel geeft u de controle om te bepalen naar welke Unix groep
anonieme FTP gebruikers zal worden overgeschakeld, in plaats van de primaire
groep voor de <tt>ftp</tt> gebruiker. Voor iedere ingevulde groep kunt u 1
of meerdere gebruikers klassen kiezen, bijvoorbeeld om toegang te verlenen
aan bepaalde files voor anonieme gebruikers van bepaalde IP adressen.

Tot slot, de selectie onderaan van de pagina geeft mogelijkheden om te bepalen
welke wachtwoorden worden geaccepteerd voor anonieme FTP login.
Traditioneel moeten FTP gebruikers een geldig email adres versturen als hun
anonieme wachtwoord.


text:
import { Device } from "./Device/Device";
import { Content } from "./Content/Content";
import { Event } from "./Event/Event";
import { CustomDimension } from "./CustomDimension/CustomDimension";
import { CustomMetric } from "./CustomMetric/CustomMetric";
import { Visitor } from "./Visitor/Visitor";

export class Model {
    public event: Event;
    public device: Device;
    public content: Content;
    public visitor: Visitor;
    private _customDimensions: Array<CustomDimension> = [];
    private _customMetrics: Array<CustomMetric> = [];

    public addCustomDimension(customDimension: CustomDimension) {
        this._customDimensions.push(customDimension);
    }

    public addCustomMetric(customMetric: CustomMetric) {
        this._customMetrics.push(customMetric);
    }

    get customDimensions(): Array<CustomDimension> {
        return this._customDimensions;
    }

    get customMetrics(): Array<CustomMetric> {
        return this._customMetrics;
    }
}


text:
<!DOCTYPE html>

	<meta charset="UTF-8">
	<title>User Info Samples with Mustache</title>

User List

{{name}} {{second}}

{{info}}

					Usualy likes:
{{#likes}}
{{.}}
{{/likes}}


text:
package de.uop.mics.bayerl.cube.provider;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Created by sebastianbayerl on 23/07/15.
 */
public class Loader {

    public static void main(String[] args) {
        findDSDs();
    }

//    private final static String PATH = "/Volumes/TOSHIBA EXT/CubeSimilarity/data/kai/dumps/";
    private final static String PATH = "/Users/sebastianbayerl/Desktop/data/dumps/";
    private final static String DSD = "http://purl.org/linked-data/cube#DataStructureDefinition";
    private final static String DS = "http://purl.org/linked-data/cube#DataSet";

    public static void findDSDs() {

        try {
            List<Path> paths = Files.walk(Paths.get(PATH)).filter(s -> s.toString().endsWith(".nt")).collect(Collectors.toList());

            for (Path path : paths) {
                //System.out.println("##### FILE #### " + path);
                Files.lines(path).filter(s -> s.contains(DSD)).forEach(System.out::println);

            }

        } catch (IOException e) {
            e.printStackTrace();
        }

    }

}


text:
namespace Commander
{
    public interface ICommandArguments
    {
        string Get(string key);
    }
}


text:
<!--
    Title: Delete photo script.
    Date: 12/30/2015
    Author: Robert Reinert
    Description: Deletes a photo from the photo directory.

-->

<?php

    $filename = $_GET["file"]; //Get the filename

    echo $filename;

    //Delete the file.
    unlink('../photos'.DIRECTORY_SEPARATOR.$filename); //delete it
    header('location: ../pages/gallery.php'); //redirect back to the other page

?>