text:
package org.dcm4chex.rid.web;

import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
import org.dcm4chex.rid.common.BasicRequestObject;

/**
 * @author franz.willer
 *
 * TODO To change the template for this generated type comment go to Window -
 * Preferences - Java - Code Style - Code Templates
 */
public abstract class BasicRequestObjectImpl implements BasicRequestObject {

    private static Logger log = Logger.getLogger(BasicRequestObjectImpl.class.getName());

    protected String reqType;
    protected Map headerMap;
    protected Map paramMap;
    protected List allowedContentTypes = null;

    protected String reqURL;
    protected String errMsg;

    protected String remoteAddr;
    protected String remoteHost = null;
    protected String remoteUser;
    boolean studyPermissionCheckDisabled;

    protected HttpServletRequest request;

    /**
     * Initialize an RequestObject with http request.
     * <p>
     * This constructor should be used by the real implementations.
     *
     * @param request
     *                The http request.
     */
    public BasicRequestObjectImpl(HttpServletRequest request) {
        this.request = request;
        reqType = request.getParameter("requestType");
        if (reqType == null)
            reqType = request.getParameter("RT");
        paramMap = request.getParameterMap();
        try {
            reqURL = request.getRequestURL().append("?").append(
                    request.getQueryString()).toString();
        } catch (Exception x) {

        }
        headerMap = new HashMap();
        Enumeration enum1 = request.getHeaderNames();
        String key;
        while (enum1.hasMoreElements()) {
            key = (String) enum1.nextElement();
            if (log.isDebugEnabled())
                log.debug("header: " + key + "=" + request.getHeader(key));
            headerMap.put(key, request.getHeader(key));
        }
        setAllowedContentTypes(request.getHeader("accept"));
        this.remoteAddr = request.getRemoteAddr();
        remoteUser = request.getRemoteUser();
    }

    public final HttpServletRequest getRequest() {
        return request;
    }

    /**
     * @param accept
     */
    private void setAllowedContentTypes(String accept) {
        List l = null;
        String s;
        if (accept != null) {
            l = new ArrayList();
            StringTokenizer st = new StringTokenizer(accept, ",");
            while (st.hasMoreElements()) {
                s = st.nextToken();
                if (s.indexOf(";") != -1)
                    s = s.substring(0, s.indexOf(";"));// ignore quality value
                l.add(s.trim());
            }
        }
        allowedContentTypes = l;
    }

    /**
     * Returns the requestType parameter of the http request.
     *
     * @return requestType
     */
    public String getRequestType() {
        return reqType;
    }

    /*
     * (non-Javadoc)
     *
     * @see org.dcm4chex.rid.common.RIDRequestObject#getAllowedContentTypes()
     */
    public List getAllowedContentTypes() {
        return this.allowedContentTypes;
    }

    /**
     * Returns all parameter of the http request in a map.
     *
     * @return All http parameter
     */
    public Map getRequestParams() {
        return paramMap;
    }

    /**
     * Returns a Map of all request header fields of the http request.
     *
     * @return All request header fields in a map.
     */
    public Map getRequestHeaders() {
        return headerMap;
    }

    public String getRequestURL() {
        return reqURL;

    }

    /**
     * @return Returns the errMsg.
     */
    public String getErrorMsg() {
        return errMsg;
    }

    /**
     * @param errMsg
     *                The errMsg to set.
     */
    protected void setErrorMsg(String errMsg) {
        this.errMsg = errMsg;
    }

    /**
     * @return Returns the remoteAddr.
     */
    public String getRemoteAddr() {
        return remoteAddr;
    }

    /**
     * @return Returns the remoteHost.
     */
    public String getRemoteHost() {
        if (remoteHost == null) {
            try {
                InetAddress ia = InetAddress.getByName(remoteAddr);
                remoteHost = ia.getHostName();
            } catch (Exception ignore) {
            }
        }
        return remoteHost;
    }

    public String getRemoteUser() {
        return remoteUser;
    }

	public boolean isStudyPermissionCheckDisabled() {
		return studyPermissionCheckDisabled;
	}

	public void setStudyPermissionCheckDisabled(boolean studyPermissionCheckDisabled) {
		this.studyPermissionCheckDisabled = studyPermissionCheckDisabled;
	}

}


text:
<!--- [![CI Status](http://img.shields.io/travis/Alex Choi/AXCGiphy.svg?style=flat)](https://travis-ci.org/Alex Choi/AXCGiphy) -->
[![Version](https://img.shields.io/cocoapods/v/Giphy-iOS.svg?style=flat)](http://cocoadocs.org/docsets/Giphy-iOS)
[![License](https://img.shields.io/cocoapods/l/Giphy-iOS.svg?style=flat)](http://cocoadocs.org/docsets/Giphy-iOS)
[![Platform](https://img.shields.io/cocoapods/p/Giphy-iOS.svg?style=flat)](http://cocoadocs.org/docsets/Giphy-iOS)

Giphy-iOS is a [Giphy API](https://github.com/Giphy/GiphyAPI) client for iOS in Objective-C.

## Usage

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

You should read about [Giphy's Access and API keys here](https://github.com/Giphy/GiphyAPI#access-and-api-keys).

### Giphy-iOS / AXCGiphy
'AXCGiphy' provides convenient access to [Giphy's API](https://github.com/Giphy/GiphyAPI) endpoints:

- search
- trending
- translate
- GIF by ID
- GIFs by IDs

You can query the endpoints through the blocks based interface:

```objective-c

- (void)viewDidLoad
{
    [super viewDidLoad];
	// set your API key before making any requests. You may use kGiphyPublicAPIKey for development.
    [AXCGiphy setGiphyAPIKey:kGiphyPublicAPIKey];

    [AXCGiphy searchGiphyWithTerm:@"frogs" limit:10 offset:0 completion:^(NSArray *results, NSError *error) {
        self.giphyResults = results;
        [[NSOperationQueue mainQueue] addOperationWithBlock:^{
            [self.collectionView reloadData];
        }];
    }];
}

- (UICollectionViewCell *) collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    AXCCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:kCollectionViewCellIdentifier forIndexPath:indexPath];
    AXCGiphy * gif = self.giphyResults[indexPath.item];

    NSURLRequest * request = [NSURLRequest requestWithURL:gif.originalImage.url];
    [[[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
        UIImage * image = [UIImage imageWithData:data];
        [[NSOperationQueue mainQueue] addOperationWithBlock:^{
            cell.imageView.image = image;
        }];
    }] resume];

    return cell;
}

```

AXCGiphy blocks based class methods provide asynchronous access to either AXCGiphy instances or an NSArray of AXCGiphy instances. AXCGiphy instances represent Giphy's gifs and their metadata. However, AXCGiphy only provides URLs to gifs. How you use these URLs is up to you.

My example uses NSURLRequests with NSURLSession to fetch the image data at the URLs and [mattt's AnimatedGifSerialization](https://github.com/mattt/AnimatedGIFImageSerialization) to decode the animated GIFs into animated UIImages. If you are unsure of how to proceed, use my example app as a starting point.

The blocks based class methods return NSURLSessionDataTasks for additional control, should you need it.

AXCGiphy also provides class methods to generate NSURLRequests for these endpoints.

## Requirements

AFNetworking/Serialization 2.3.1

## Installation

Giphy-iOS is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

    pod "Giphy-iOS"
    pod 'AFNetworking/Serialization', '~> 2.3.1'

## Author

Alex Choi, heyalexchoi@gmail.com

## License

Giphy-iOS is available under the MIT license. See the LICENSE file for more info.

redpajama_set_name: RedPajamaGithub


text:
<?php

/*
 * NOTICE OF LICENSE
 *
 * Part of the Rinvex Sparse Package.
 *
 * This source file is subject to The MIT License (MIT)
 * that is bundled with this package in the LICENSE file.
 *
 * Package: Rinvex Sparse Package
 * License: The MIT License (MIT)
 * Link:    https://rinvex.com
 */

declare(strict_types=1);

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

class CreateAttributesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create(config('rinvex.sparse.tables.attributes'), function (Blueprint $table) {
            // Columns
            $table->increments('id');
            $table->json('name');
            $table->string('slug');
            $table->json('description')->nullable();
            $table->unsignedInteger('order')->default(0);
            $table->string('group')->nullable();
            $table->string('type');
            $table->boolean('collection')->default(false);
            $table->text('default')->nullable();
            $table->timestamps();

            // Engine
            $table->engine = 'InnoDB';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop(config('rinvex.sparse.tables.attributes'));
    }
}


text:
.mcn-timepicker {
  display: inline;
}
.mcn-timepicker .mcn-timepicker-text {
  display: inline;
}
.mcn-timepicker .mcn-timepicker-text:before {
  content: "\e916";
  font-family: "Segoe MDL2 Assets";
  margin-right: 8px;
}
.mcn-timepicker-flyout {
  padding: 0;
  border: none;
}
.mcn-timeclock.win-disposable {
  width: 286px;
  height: 334px;
  position: relative;
  background-color: #333;
  color: white;
  overflow: hidden;
  display: flex;
  flex-flow: column nowrap;
}
.mcn-timeclock.win-disposable button {
  text-align: center;
  border: 2px solid transparent;
  background-color: transparent;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  outline: none;
}
.mcn-timeclock.win-disposable button:hover,
.mcn-timeclock.win-disposable button.tapped {
  background-color: #555;
}
.mcn-timeclock.win-disposable button:disabled {
  opacity: 0.2;
  pointer-events: none;
  touch-action: none;
}
.mcn-timeclock.win-disposable .timeitem {
  width: 66.5px;
  height: 66.5px;
  line-height: 60.5px;
  font-size: 16pt;
  font-weight: 300;
}
.mcn-timeclock.win-disposable .timeitem.selected {
  border-color: gold;
}
.mcn-timeclock.win-disposable.radial .timeitem,
.mcn-timeclock.win-disposable.radial > section .timepanel.minutespanel .timeitem {
  width: 38px;
  height: 38px;
  line-height: 30px;
  font-size: 16pt;
  position: absolute;
  border-radius: 50%;
  font-weight: 300;
}
.mcn-timeclock.win-disposable.radial > section .timepanel > section .itemspanel .items {
  width: 230px;
  margin: auto;
}
.mcn-timeclock.win-disposable .hoursel {
  width: 50%;
}
.mcn-timeclock.win-disposable > header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 10px 0 10px;
}
.mcn-timeclock.win-disposable > header button {
  font-size: 28pt;
  font-weight: 200;
}
.mcn-timeclock.win-disposable > header button.current {
  color: gold;
}
.mcn-timeclock.win-disposable > header .sep {
  margin: 0 8px;
  font-size: 22pt;
  font-weight: 200;
  color: #999;
}
.mcn-timeclock.win-disposable > section {
  flex: 1;
  position: relative;
}
.mcn-timeclock.win-disposable > section .timepanel {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  display: flex;
  flex-flow: column nowrap;
  padding: 10px;
  box-sizing: border-box;
}
.mcn-timeclock.win-disposable > section .timepanel.hidden {
  pointer-events: none;
  opacity: 0;
}
.mcn-timeclock.win-disposable > section .timepanel > header {
  display: flex;
  align-items: center;
  justify-content: center;
}
.mcn-timeclock.win-disposable > section .timepanel.hourspanel > header {
  border-top: 1px solid #555;
  border-bottom: 1px solid #555;
}
.mcn-timeclock.win-disposable > section .timepanel.hourspanel > header button {
  padding: 10px;
}
.mcn-timeclock.win-disposable > section .timepanel.hourspanel > header button.selected {
  background-color: #444;
}
.mcn-timeclock.win-disposable > section .timepanel.minutespanel .timeitem {
  width: 33%;
  height: 62.5px;
  line-height: 58.5px;
}
.mcn-timeclock.win-disposable > section .timepanel > section {
  flex: 1;
  display: flex;
  flex-flow: row wrap;
  position: relative;
}
.mcn-timeclock.win-disposable > section .timepanel > section .itemspanel {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
}
.mcn-timeclock.win-disposable > section .timepanel > section .itemspanel .items {
  position: relative;
  width: 100%;
  height: 100%;
}


text:
import AddPrisonerPage from '../pages/add-prisoner/AddPrisoner.page';
import DashboardPage from '../pages/Dashboard.page';
import { checkThatPrisonerAssessmentDataWasWrittenToDatabase } from '../../utils/dbAssertions';

const defaultConfig = {
  smokeTest: false,
  prisoner: {
    forename: 'Jilly',
    surname: 'Hall',
    nomisId: 'A1401AE',
    dateOfBirth: '1 January 1970',
    databaseDoB: 'Jan 01 1970',
  },
};

function whenTheOfficerAddsThePrisonersDetails(config = defaultConfig) {
  DashboardPage.clickAddPrisoner();

  expect(AddPrisonerPage.mainHeading).to.equal('Search for a prisoner');

  AddPrisonerPage.search(config.prisoner.nomisId);

  AddPrisonerPage.clickContinue();

  browser.waitForVisible('[data-element-id="search-results"]', 10000);
  const prisonerRow = browser.element(`[data-element-id="${config.prisoner.nomisId}"]`);
  const prisonerRowText = prisonerRow.getText();

  expect(prisonerRowText).to.contain(config.prisoner.forename);
  expect(prisonerRowText).to.contain(config.prisoner.surname);
  expect(prisonerRowText).to.contain(config.prisoner.nomisId);
  expect(prisonerRowText).to.contain(config.prisoner.dateOfBirth);

  prisonerRow.element('button').click();

  DashboardPage.waitForMainHeadingWithDataId('dashboard');

  if (!config.smokeTest) {
    const row = browser.element(`[data-element-id="profile-row-${config.prisoner.nomisId}"]`);
    const assessmentId = row.getAttribute('data-assessment-id');
    checkThatPrisonerAssessmentDataWasWrittenToDatabase({
      id: assessmentId,
      nomisId: config.prisoner.nomisId,
      forename: config.prisoner.forename,
      surname: config.prisoner.surname,
      dateOfBirth: config.prisoner.databaseDoB,
    });
  }
}

export default whenTheOfficerAddsThePrisonersDetails;


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

namespace LiteDB
{
    /// <summary>
    /// Represent a index node inside a Index Page
    /// </summary>
    internal class IndexNode
    {
        public const int INDEX_NODE_FIXED_SIZE = 2 + // Position.Index (ushort)
                                                 1 + // Levels (byte)
                                                 2 + // ValueLength (ushort)
                                                 1 + // BsonType (byte)
                                                 1 + // Slot (1 byte)
                                                 (PageAddress.SIZE * 2) + // Prev/Next Node (6 bytes)
                                                 PageAddress.SIZE; // DataBlock

        /// <summary>
        /// Max level used on skip list
        /// </summary>
        public const int MAX_LEVEL_LENGTH = 32;

        /// <summary>
        /// Position of this node inside a IndexPage - Store only Position.Index
        /// </summary>
        public PageAddress Position { get; set; }

        /// <summary>
        /// Slot position of index in data block
        /// </summary>
        public byte Slot { get; set; }

        /// <summary>
        /// Prev node in same document list index nodes
        /// </summary>
        public PageAddress PrevNode { get; set; }

        /// <summary>
        /// Next node in same document list index nodes
        /// </summary>
        public PageAddress NextNode { get; set; }

        /// <summary>
        /// Link to prev value (used in skip lists - Prev.Length = Next.Length)
        /// </summary>
        public PageAddress[] Prev { get; set; }

        /// <summary>
        /// Link to next value (used in skip lists - Prev.Length = Next.Length)
        /// </summary>
        public PageAddress[] Next { get; set; }

        /// <summary>
        /// Length of key - used for calculate Node size
        /// </summary>
        public ushort KeyLength { get; set; }

        /// <summary>
        /// The object value that was indexed
        /// </summary>
        public BsonValue Key { get; set; }

        /// <summary>
        /// Reference for a datablock - the value
        /// </summary>
        public PageAddress DataBlock { get; set; }

        /// <summary>
        /// Get page reference
        /// </summary>
        public IndexPage Page { get; set; }

        /// <summary>
        /// Returns Next (order == 1) OR Prev (order == -1)
        /// </summary>
        public PageAddress NextPrev(int index, int order)
        {
            return order == Query.Ascending ? this.Next[index] : this.Prev[index];
        }

        /// <summary>
        /// Returns if this node is header or tail from collection Index
        /// </summary>
        public bool IsHeadTail(CollectionIndex index)
        {
            return this.Position.Equals(index.HeadNode) || this.Position.Equals(index.TailNode);
        }

        /// <summary>
        /// Get the length size of this node in disk - not persistable
        /// </summary>
        public int Length
        {
            get
            {
                return IndexNode.INDEX_NODE_FIXED_SIZE +
                    (this.Prev.Length * PageAddress.SIZE * 2) + // Prev + Next
                    this.KeyLength; // bytes count in BsonValue
            }
        }

        public IndexNode(byte level)
        {
            this.Position = PageAddress.Empty;
            this.PrevNode = PageAddress.Empty;
            this.NextNode = PageAddress.Empty;
            this.DataBlock = PageAddress.Empty;
            this.Prev = new PageAddress[level];
            this.Next = new PageAddress[level];

            for (var i = 0; i < level; i++)
            {
                this.Prev[i] = PageAddress.Empty;
                this.Next[i] = PageAddress.Empty;
            }
        }
    }

    internal class IndexNodeComparer : IEqualityComparer<IndexNode>
    {
        public bool Equals(IndexNode x, IndexNode y)
        {
            if (object.ReferenceEquals(x, y)) return true;

            if (x == null || y == null) return false;

            return x.DataBlock.Equals(y.DataBlock);
        }

        public int GetHashCode(IndexNode obj)
        {
            return obj.DataBlock.GetHashCode();
        }
    }
}


text:
Lakers HAR Analyser v0.0.1!

The visual HAR data platform.

        Get it started!


text:
<?php
require_once('connect.php');
$error = false;
$success = false;

session_start();

$stmt = $dbh->prepare("SELECT * FROM cart c WHERE c.user_id = :carts");
$stmt->execute(array(':carts' => $_SESSION['user']['id']));
$results = $stmt->fetchAll();

$total = 0;

$delete = $dbh->prepare("Delete FROM cart c WHERE c.user_id");
$stmt->execute(array(':carts' => $_SESSION['user']['id']));
?>
<!DOCTYPE html>

    <link href='https://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>
    <link rel="icon" type="image/png"
          href="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcSnmTDYKCeLOIJbw2A3klLVfderw8VCr9gPdqAEv3NPZju2XrSovg">
    <link rel="stylesheet" type="text/css" href="stylesheet.css">

    <link rel="stylesheet" href="./material.min.css">

    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">

    <title>OzWatch</title>

            OzWatch

                    search

                    <input class="mdl-textfield__input" type="text" name="sample"
                           id="waterfall-exp">

                Sign In
                Sign Up
                My Profile
                Cart
                About

        Menu

            Rolex
            Fossil
            Skagen
            Bulova
            Omega
            Breitling
            Movado
            Citizen
            Seiko
            Invicta
            Casio
            Suunto

                        Name
                        Quantity
                        Price

                    <?php
                    if (count($results) > 0) {
                        foreach ($results as $carts) {

                            $itemname = $carts['name'];
                            $itemquantity = $carts['quantity'];
                            $itemprice = $carts['price'];

                            $total += $itemprice * $itemquantity;

                            if (count($results) > 0) {
                                echo '
';
                                echo "{$itemname}	";
                                echo "{$itemquantity} x	";
                                echo "{$itemprice}	";
                                echo '
';
                            } else {
                                echo '
';
                                echo 'There is nothing in your cart!	';
                                echo '
';
                            }
                        }
                    }
                    ?>

Total: $<?php echo $total . "\n";?>

                <form method="post">
                    <button type="submit" name="checkout" value="<?php echo $product['id']; header("Location: index.php")?>">Checkout</button>
                </form>

                            Copyright OzWatch 2016
                            About OzWatch
                            Home
                            FAQ
                            Sign In


text:
package npetzall.hid.exception.io;

import java.io.IOException;

public class RuntimeIOException extends RuntimeException {
    public RuntimeIOException(IOException ioException) {
        super(ioException);
    }

    public RuntimeIOException(String message, IOException ioExcetion) {
        super(message,ioExcetion);
    }

    public RuntimeIOException(String message) {
        super(message);
    }
}


text:
package main

import (
	"fmt"
	"net/http"
	"time"
)

func main() {
	http.HandleFunc("/", index)
	http.HandleFunc("/api", api)
	http.HandleFunc("/login", login)

	fmt.Println("Listening on http://127.0.0.1:8000/")
	http.ListenAndServe(":8000", nil)
}

func index(w http.ResponseWriter, r *http.Request) {
	fmt.Fprintf(w, "hello\n")
}

func api(w http.ResponseWriter, r *http.Request) {
	cookie, err := r.Cookie("access_token")
	if err != nil {
		w.WriteHeader(http.StatusUnauthorized)
		fmt.Fprintf(w, "Unauthorized\n")
		return
	}

	if cookie.Value != "xxx" {
		w.WriteHeader(http.StatusUnauthorized)
		fmt.Fprintf(w, "Unauthorized\n")
		return
	}

	fmt.Fprintf(w, "api\n")
}

func login(w http.ResponseWriter, r *http.Request) {
	cookie := http.Cookie{
		Name:    "access_token",
		Value:   "xxx",
		Expires: time.Now().Add(10 * time.Minute),
		//HttpOnly: true,
	}
	http.SetCookie(w, &cookie)
	fmt.Fprintf(w, "success\n")
}


text:
using apache::thrift::transport::TProcessor;
using std::deque;
using std::list;
using std::map;
using std::nothrow;
using std::set;
using std::string;
using std::to_string;
using std::vector;

namespace palo {

AgentServer::AgentServer(ExecEnv* exec_env,
                         const TMasterInfo& master_info) :
        _exec_env(exec_env),
        _master_info(master_info),
        _topic_subscriber(new TopicSubscriber()) {

    // clean dpp download dir
    _command_executor = new CommandExecutor();
    vector<RootPathInfo> root_paths_info;
    _command_executor->get_all_root_path_info(&root_paths_info);
    for (auto root_path_info: root_paths_info) {
        try {
            string dpp_download_path_str = root_path_info.path + DPP_PREFIX;
            boost::filesystem::path dpp_download_path(dpp_download_path_str);
            if (boost::filesystem::exists(dpp_download_path)) {
                boost::filesystem::remove_all(dpp_download_path);
            }
        } catch (...) {
            OLAP_LOG_WARNING("boost exception when remove dpp download path. [path='%s']",
                             root_path_info.path.c_str());
        }
    }

    // create tmp dir
//    boost::filesystem::path tmp_path(config::agent_tmp_dir);
//    if (boost::filesystem::exists(tmp_path)) {
//        boost::filesystem::remove_all(tmp_path);
//    }
//    boost::filesystem::create_directories(config::agent_tmp_dir);

    // init task worker pool
    _create_table_workers = new TaskWorkerPool(
            TaskWorkerPool::TaskWorkerType::CREATE_TABLE,
            _exec_env,
            master_info);
    _drop_table_workers = new TaskWorkerPool(
            TaskWorkerPool::TaskWorkerType::DROP_TABLE,
            _exec_env,
            master_info);
    _push_workers = new TaskWorkerPool(
            TaskWorkerPool::TaskWorkerType::PUSH,
            _exec_env,
            master_info);
    _delete_workers = new TaskWorkerPool(
            TaskWorkerPool::TaskWorkerType::DELETE,
            _exec_env,
            master_info);
    _alter_table_workers = new TaskWorkerPool(
            TaskWorkerPool::TaskWorkerType::ALTER_TABLE,
            _exec_env,
            master_info);
    _clone_workers = new TaskWorkerPool(
            TaskWorkerPool::TaskWorkerType::CLONE,
            _exec_env,
            master_info);
    _storage_medium_migrate_workers = new TaskWorkerPool(
            TaskWorkerPool::TaskWorkerType::STORAGE_MEDIUM_MIGRATE,
            _exec_env,
            master_info);
    _cancel_delete_data_workers = new TaskWorkerPool(
            TaskWorkerPool::TaskWorkerType::CANCEL_DELETE_DATA,
            _exec_env,
            master_info);
    _check_consistency_workers = new TaskWorkerPool(
            TaskWorkerPool::TaskWorkerType::CHECK_CONSISTENCY,
            _exec_env,
            master_info);
    _report_task_workers = new TaskWorkerPool(
            TaskWorkerPool::TaskWorkerType::REPORT_TASK,
            _exec_env,
            master_info);
    _report_disk_state_workers = new TaskWorkerPool(
            TaskWorkerPool::TaskWorkerType::REPORT_DISK_STATE,
            _exec_env,
            master_info);
    _report_olap_table_workers = new TaskWorkerPool(
            TaskWorkerPool::TaskWorkerType::REPORT_OLAP_TABLE,
            _exec_env,
            master_info);
    _upload_workers = new TaskWorkerPool(
            TaskWorkerPool::TaskWorkerType::UPLOAD,
            _exec_env,
            master_info);
    _download_workers = new TaskWorkerPool(
            TaskWorkerPool::TaskWorkerType::DOWNLOAD,
            _exec_env,
            master_info);
    _make_snapshot_workers = new TaskWorkerPool(
            TaskWorkerPool::TaskWorkerType::MAKE_SNAPSHOT,
            _exec_env,
            master_info);
    _release_snapshot_workers = new TaskWorkerPool(
            TaskWorkerPool::TaskWorkerType::RELEASE_SNAPSHOT,
            _exec_env,
            master_info);
    _move_dir_workers= new TaskWorkerPool(
            TaskWorkerPool::TaskWorkerType::MOVE,
            _exec_env,
            master_info);
#ifndef BE_TEST
    _create_table_workers->start();
    _drop_table_workers->start();
    _push_workers->start();
    _delete_workers->start();
    _alter_table_workers->start();
    _clone_workers->start();
    _storage_medium_migrate_workers->start();
    _cancel_delete_data_workers->start();
    _check_consistency_workers->start();
    _report_task_workers->start();
    _report_disk_state_workers->start();
    _report_olap_table_workers->start();
    _upload_workers->start();
    _download_workers->start();
    _make_snapshot_workers->start();
    _release_snapshot_workers->start();
    _move_dir_workers->start();
    // Add subscriber here and register listeners
    TopicListener* user_resource_listener = new UserResourceListener(exec_env, master_info);
    LOG(INFO) << "Register user resource listener";
    _topic_subscriber->register_listener(palo::TTopicType::type::RESOURCE, user_resource_listener);
#endif
}

AgentServer::~AgentServer() {
    if (_command_executor != NULL) {
        delete _command_executor;
    }
    if (_create_table_workers != NULL) {
        delete _create_table_workers;
    }
    if (_drop_table_workers != NULL) {
        delete _drop_table_workers;
    }
    if (_push_workers != NULL) {
        delete _push_workers;
    }
    if (_delete_workers != NULL) {
        delete _delete_workers;
    }
    if (_alter_table_workers != NULL) {
        delete _alter_table_workers;
    }
    if (_clone_workers != NULL) {
        delete _clone_workers;
    }
    if (_storage_medium_migrate_workers != NULL) {
        delete _storage_medium_migrate_workers;
    }
    if (_cancel_delete_data_workers != NULL) {
        delete _cancel_delete_data_workers;
    }
    if (_check_consistency_workers != NULL) {
        delete _check_consistency_workers;
    }
    if (_report_task_workers != NULL) {
        delete _report_task_workers;
    }
    if (_report_disk_state_workers != NULL) {
        delete _report_disk_state_workers;
    }
    if (_report_olap_table_workers != NULL) {
        delete _report_olap_table_workers;
    }
    if (_upload_workers != NULL) {
        delete _upload_workers;
    }
    if (_download_workers != NULL) {
        delete _download_workers;
    }
    if (_make_snapshot_workers != NULL) {
        delete _make_snapshot_workers;
    }
    if (_move_dir_workers!= NULL) {
        delete _move_dir_workers;
    }
    if (_release_snapshot_workers != NULL) {
        delete _release_snapshot_workers;
    }
    if (_topic_subscriber !=NULL) {
        delete _topic_subscriber;
    }
}

void AgentServer::submit_tasks(
        TAgentResult& return_value,
        const vector<TAgentTaskRequest>& tasks) {

    // Set result to dm
    vector<string> error_msgs;
    TStatusCode::type status_code = TStatusCode::OK;

    // TODO check require master same to heartbeat master
    if (_master_info.network_address.hostname == ""
            || _master_info.network_address.port == 0) {
        error_msgs.push_back("Not get master heartbeat yet.");
        return_value.status.__set_error_msgs(error_msgs);
        return_value.status.__set_status_code(TStatusCode::CANCELLED);
        return;
    }

    for (auto task : tasks) {
        TTaskType::type task_type = task.task_type;
        int64_t signature = task.signature;

        switch (task_type) {
        case TTaskType::CREATE:
            if (task.__isset.create_tablet_req) {
               _create_table_workers->submit_task(task);
            } else {
                status_code = TStatusCode::ANALYSIS_ERROR;
            }
            break;
        case TTaskType::DROP:
            if (task.__isset.drop_tablet_req) {
                _drop_table_workers->submit_task(task);
            } else {
                status_code = TStatusCode::ANALYSIS_ERROR;
            }
            break;
        case TTaskType::PUSH:
            if (task.__isset.push_req) {
                if (task.push_req.push_type == TPushType::LOAD
                        || task.push_req.push_type == TPushType::LOAD_DELETE) {
                    _push_workers->submit_task(task);
                } else if (task.push_req.push_type == TPushType::DELETE) {
                    _delete_workers->submit_task(task);
                } else {
                    status_code = TStatusCode::ANALYSIS_ERROR;
                }
            } else {
                status_code = TStatusCode::ANALYSIS_ERROR;
            }
            break;
        case TTaskType::ROLLUP:
        case TTaskType::SCHEMA_CHANGE:
            if (task.__isset.alter_tablet_req) {
                _alter_table_workers->submit_task(task);
            } else {
                status_code = TStatusCode::ANALYSIS_ERROR;
            }
            break;
        case TTaskType::CLONE:
            if (task.__isset.clone_req) {
                _clone_workers->submit_task(task);
            } else {
                status_code = TStatusCode::ANALYSIS_ERROR;
            }
            break;
        case TTaskType::STORAGE_MEDIUM_MIGRATE:
            if (task.__isset.storage_medium_migrate_req) {
                _storage_medium_migrate_workers->submit_task(task);
            } else {
                status_code = TStatusCode::ANALYSIS_ERROR;
            }
            break;
        case TTaskType::CANCEL_DELETE:
            if (task.__isset.cancel_delete_data_req) {
                _cancel_delete_data_workers->submit_task(task);
            } else {
                status_code = TStatusCode::ANALYSIS_ERROR;
            }
            break;
        case TTaskType::CHECK_CONSISTENCY:
            if (task.__isset.check_consistency_req) {
                _check_consistency_workers->submit_task(task);
            } else {
                status_code = TStatusCode::ANALYSIS_ERROR;
            }
            break;
        case TTaskType::UPLOAD:
            if (task.__isset.upload_req) {
                _upload_workers->submit_task(task);
            } else {
                status_code = TStatusCode::ANALYSIS_ERROR;
            }
            break;
        case TTaskType::DOWNLOAD:
            if (task.__isset.download_req) {
                _download_workers->submit_task(task);
            } else {
                status_code = TStatusCode::ANALYSIS_ERROR;
            }
            break;
        case TTaskType::MAKE_SNAPSHOT:
            if (task.__isset.snapshot_req) {
                _make_snapshot_workers->submit_task(task);
            } else {
                status_code = TStatusCode::ANALYSIS_ERROR;
            }
            break;
        case TTaskType::RELEASE_SNAPSHOT:
            if (task.__isset.release_snapshot_req) {
                _release_snapshot_workers->submit_task(task);
            } else {
                status_code = TStatusCode::ANALYSIS_ERROR;
            }
            break;
        case TTaskType::MOVE:
            if (task.__isset.move_dir_req) {
                _move_dir_workers->submit_task(task);
            } else {
                status_code = TStatusCode::ANALYSIS_ERROR;
            }
            break;
        default:
            status_code = TStatusCode::ANALYSIS_ERROR;
            break;
        }

        if (status_code == TStatusCode::ANALYSIS_ERROR) {
            OLAP_LOG_WARNING("task anaysis_error, signature: %ld", signature);
            error_msgs.push_back("the task signature is:" + to_string(signature) + " has wrong request.");
        }
    }

    return_value.status.__set_error_msgs(error_msgs);
    return_value.status.__set_status_code(status_code);
}

void AgentServer::make_snapshot(TAgentResult& return_value,
        const TSnapshotRequest& snapshot_request) {
    TStatus status;
    vector<string> error_msgs;
    TStatusCode::type status_code = TStatusCode::OK;

    string snapshot_path;
    OLAPStatus make_snapshot_status =
            _command_executor->make_snapshot(snapshot_request, &snapshot_path);
    if (make_snapshot_status != OLAP_SUCCESS) {
        status_code = TStatusCode::RUNTIME_ERROR;
        OLAP_LOG_WARNING("make_snapshot failed. tablet_id: %ld, schema_hash: %ld, status: %d",
                         snapshot_request.tablet_id, snapshot_request.schema_hash,
                         make_snapshot_status);
        error_msgs.push_back("make_snapshot failed. status: " +
                             boost::lexical_cast<string>(make_snapshot_status));
    } else {
        OLAP_LOG_INFO("make_snapshot success. tablet_id: %ld, schema_hash: %ld, snapshot_path: %s",
                       snapshot_request.tablet_id, snapshot_request.schema_hash,
                       snapshot_path.c_str());
        return_value.__set_snapshot_path(snapshot_path);
    }

    status.__set_error_msgs(error_msgs);
    status.__set_status_code(status_code);
    return_value.__set_status(status);
}

void AgentServer::release_snapshot(TAgentResult& return_value, const std::string& snapshot_path) {
    vector<string> error_msgs;
    TStatusCode::type status_code = TStatusCode::OK;

    OLAPStatus release_snapshot_status =
            _command_executor->release_snapshot(snapshot_path);
    if (release_snapshot_status != OLAP_SUCCESS) {
        status_code = TStatusCode::RUNTIME_ERROR;
        OLAP_LOG_WARNING("release_snapshot failed. snapshot_path: %s, status: %d",
                         snapshot_path.c_str(), release_snapshot_status);
        error_msgs.push_back("release_snapshot failed. status: " +
                             boost::lexical_cast<string>(release_snapshot_status));
    } else {
        OLAP_LOG_INFO("release_snapshot success. snapshot_path: %s, status: %d",
                      snapshot_path.c_str(), release_snapshot_status);
    }

    return_value.status.__set_error_msgs(error_msgs);
    return_value.status.__set_status_code(status_code);
}

void AgentServer::publish_cluster_state(TAgentResult& _return, const TAgentPublishRequest& request) {
    vector<string> error_msgs;
    _topic_subscriber->handle_updates(request);
    _return.status.__set_status_code(TStatusCode::OK);
}

void AgentServer::submit_etl_task(TAgentResult& return_value,
                                 const TMiniLoadEtlTaskRequest& request) {
    Status status = _exec_env->etl_job_mgr()->start_job(request);
    if (status.ok()) {
        VLOG_RPC << "start etl task successfull id="
            << request.params.params.fragment_instance_id;
    } else {
        VLOG_RPC << "start etl task failed id="
            << request.params.params.fragment_instance_id
            << " and err_msg=" << status.get_error_msg();
    }
    status.to_thrift(&return_value.status);
}

void AgentServer::get_etl_status(TMiniLoadEtlStatusResult& return_value,
                                 const TMiniLoadEtlStatusRequest& request) {
    Status status = _exec_env->etl_job_mgr()->get_job_state(request.mini_load_id, &return_value);
    if (!status.ok()) {
        LOG(WARNING) << "get job state failed. [id=" << request.mini_load_id << "]";
    } else {
        VLOG_RPC << "get job state successful. [id=" << request.mini_load_id << ",status="
            << return_value.status.status_code << ",etl_state=" << return_value.etl_state
            << ",files=";
        for (auto& item : return_value.file_map) {
            VLOG_RPC << item.first << ":" << item.second << ";";
        }
        VLOG_RPC << "]";
    }
}

void AgentServer::delete_etl_files(TAgentResult& result,
                                   const TDeleteEtlFilesRequest& request) {
    Status status = _exec_env->etl_job_mgr()->erase_job(request);
    if (!status.ok()) {
        LOG(WARNING) << "delete etl files failed. because " << status.get_error_msg()
            << " with request " << request;
    } else {
        VLOG_RPC << "delete etl files successful with param " << request;
    }
    status.to_thrift(&result.status);
}

}  // namesapce palo


text:
"""Test future selectors."""
from .. import util

class TestFuture(util.TestCase):
    """Test future selectors."""

    MARKUP = """

Some text  in a paragraph.
    Link
    Placeholder text.

    """

    def test_future(self):
        """Test future (should match nothing)."""

        self.assert_selector(
            self.MARKUP,
            "p:future",
            [],
            flags=util.HTML
        )

    def test_not_future(self):
        """Test not future."""

        self.assert_selector(
            self.MARKUP,
            "p:not(:future)",
            ["0"],
            flags=util.HTML
        )


text:
package com.stulsoft.ysps.pfuture

import com.typesafe.scalalogging.LazyLogging

import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future

/**
  * Demonstrates Future chain using flatMap
  * Created by Yuriy Stul on 10/29/2016.
  */
object FutureChainFlatMap extends App with LazyLogging {
  logger.info("Start")

  // 1st future
  val f1 = Future {
    logger.info("In f1")
    Thread.sleep(500)
    "F1"
  }

  // 2nd future. Waits completion of the 1st future
  val f2 = f1.flatMap {
    theF1 =>
      Future {
        logger.info("In f2")
        Thread.sleep(500)
        s"$theF1 + 2"
      }
  }

  // 3rd future. Waits completion of the 2nd future
  val f3 = f2.flatMap {
    theF2 =>
      Future {
        logger.info("In f3")
        Thread.sleep(500)
        theF2 + " + 3"
      }
  }

  f3 onComplete  {
    completedResult => logger.info("Completed result {}", completedResult) // result is "F1 + 2 + 3"
  }

  Thread.sleep(1600)

  logger.info("End")
}


text:
package gate.termraider.bank;

import gate.creole.metadata.*;
import gate.gui.ActionsPublisher;
import gate.*;
import gate.termraider.util.*;
import java.util.*;

@CreoleResource(name = "PMI Bank",
        icon = "termbank-lr.png",
        comment = "Pointwise Mutual Information from corpora")

public class PMIBank extends AbstractPairbank
    implements ActionsPublisher  {

  private static final long serialVersionUID = 1275893998609017476L;

  /* EXTRA CREOLE PARAMETERS */
  protected String outerAnnotationType;
  protected Set<String> innerAnnotationTypes;
  protected int outerAnnotationWindow;
  protected boolean requireTypeDifference;
  protected boolean allowOverlaps;

  private int totalCount, totalPairCount;
  private Set<Set<Integer>> seenCombinations;
  private Set<Integer> seen;
  private Map<Term, Set<String>> termDocuments;
  protected Map<Term, Integer> termCount;

  protected void addData(Document document) {
    String documentSource = Utilities.sourceOrName(document);
    /** Collocations that have already been processed in this document
     * (each collocation is a pair of IDs for a Token annotation), to avoid counting
     * them again.     */
    seenCombinations = new HashSet<Set<Integer>>();

    /** IDs of annotations (Tokens) that have already been processed in this document, to avoid
     * counting them again.     */
    seen = new HashSet<Integer>();

    AnnotationSet inputAS = document.getAnnotations(inputASName);
    AnnotationSet innerAnnotations = inputAS.get(innerAnnotationTypes);
    List<Annotation> sentences = gate.Utils.inDocumentOrder(inputAS.get(outerAnnotationType));

    if (sentences.isEmpty()) {
      return;
    }

    if (sentences.size() <= outerAnnotationWindow) {
      processWindow(sentences, innerAnnotations, document, documentSource);
      return;
    }

    List<Annotation> window = new ArrayList<Annotation>();
    while (window.size() < outerAnnotationWindow) {
      window.add(sentences.remove(0));
    }

    while (! sentences.isEmpty()) {
      processWindow(window, innerAnnotations, document, documentSource);
      window.remove(0);
      window.add(sentences.remove(0));
    }
    processWindow(window, innerAnnotations, document, documentSource);
  }

  /** Scan a window of sentences and process each pair of terms in the window.
   * Skip any pair of instances that has already been processed (e.g., both terms are in
   * the same sentence and were processed already when that sentence was added
   * to the end of the window.
   * @param window
   * @param inners (already restricted by types)
   * @param document
   * @param source
   */
  private void processWindow(List<Annotation> window, AnnotationSet inners, Document document, String source) {
    Long start = window.get(0).getStartNode().getOffset();
    Long end = window.get(window.size() - 1).getEndNode().getOffset();
    List<Annotation> terms = gate.Utils.inDocumentOrder(inners.getContained(start, end));
    for (int i = 0 ; i < (terms.size() - 1) ; i++)  {
      Annotation termI = terms.get(i);
      for (int j = i+1 ; j < terms.size() ; j++)  {
        Annotation termJ = terms.get(j);
        // compatibleTerms checks for overlaps too
        if ( combinationUnseen(termI, termJ) && compatibleTerms(termI, termJ) ) {
          processTerms(termI, termJ, document, source);
        }
      }
    }
  }

  /**
   * For a pair of annotations (terms), increment the term count if this instance (annotation)
   * of the term hasn't been counted already.  This method is called only if this
   * pair-instance hasn't been counted already.
   * @param ann0
   * @param ann1
   * @param document
   * @param source
   */
  private void processTerms(Annotation ann0, Annotation ann1, Document document, String source) {
    Term term0 = makeTerm(ann0, document);
    Term term1 = makeTerm(ann1, document);
    UnorderedTermPair pair = new UnorderedTermPair(term0, term1);

    if (unseen(ann0)) {
      incrementTermCount(term0, source);
      totalCount++;
    }

    if (unseen(ann1)) {
      incrementTermCount(term1, source);
      totalCount++;
    }

    incrementPairCount(pair, source);
    totalPairCount++;
  }

  private void incrementTermCount(Term term, String source) {
    int count;
    Set<String> sources;
    if (termCount.containsKey(term)) {
      count = termCount.get(term);
      sources = termDocuments.get(term);
    }
    else {
      count = 0;
      sources = new HashSet<String>();
    }
    count++;
    sources.add(source);
    termCount.put(term, count);
    termDocuments.put(term, sources);
  }

  private void incrementPairCount(UnorderedTermPair pair, String source) {
    int count;
    Set<String> sources;
    if (pairCount.containsKey(pair)) {
      count = pairCount.get(pair);
      sources = documents.get(pair);
    }
    else {
      count = 0;
      sources = new HashSet<String>();
    }
    count++;
    sources.add(source);
    pairCount.put(pair, count);
    documents.put(pair, sources);
  }

  private boolean combinationUnseen(Annotation a0, Annotation a1) {
    Set<Integer> combo = new HashSet<Integer>();
    combo.add(a0.getId());
    combo.add(a1.getId());
    if (seenCombinations.contains(combo)) {
      return false;
    }
    // implied else
    seenCombinations.add(combo);
    return true;
  }

  /** Check whether two annotations are compatible as collocations,
   * depending on requireTypeDifference and their types
   * and on allowOverlaps and their spans.
   * @param a0
   * @param a1
   * @return
   */

  private boolean compatibleTerms(Annotation a0, Annotation a1) {
    if (this.requireTypeDifference && a0.getType().equals(a1.getType())) {
      return false;
    }

    // implied else: types are compatible
    if (this.allowOverlaps) {
      return true;
    }

    // implied else: types are compatible but must check overlaps
    return ! a0.overlaps(a1);
  }

  private boolean unseen(Annotation anno) {
    if (seen.contains(anno.getId())) {
      return false;
    }
    // implied else
    seen.add(anno.getId());
    return true;
  }

  public int getTotalCount() {
    return this.totalCount;
  }

  public int getTotalPairCount() {
    return this.totalPairCount;
  }

  public int getNbrDistinctTerms() {
    return this.termCount.size();
  }

  public int getNbrDistinctPairs() {
    return this.pairCount.size();
  }

  public Set<Term> getTerms() {
    return this.termCount.keySet();
  }

  public int getDocumentCount(Term term) {
    if (this.termDocuments.containsKey(term)) {
      return this.termDocuments.get(term).size();
    }

    return 0;
  }

  public int getTermCount(Term term) {
    if (this.termCount.containsKey(term)) {
      return this.termCount.get(term);
    }
    // implied else
    return 0;
  }

  protected void resetImplScores() {
    termCount = new HashMap<Term, Integer>();
    termDocuments = new HashMap<Term, Set<String>>();
    totalCount = 0;
    totalPairCount = 0;
  }

  public void calculateScores() {
    double totalCountF = (double) totalCount;
    double totalPairCountF = (double) totalPairCount;
    Map<Term, Double> termProb = new HashMap<Term, Double>();
    for (Term term : termCount.keySet()) {
      double prob = ((double) termCount.get(term)) / totalCountF;
      termProb.put(term, prob);
    }

    for (UnorderedTermPair pair : this.pairCount.keySet()) {
      double px = termProb.get(pair.getTerm0());
      double py = termProb.get(pair.getTerm1());
      double pxy = ((double) pairCount.get(pair)) / totalPairCountF;

      /*  Notes
       *
       * PMI not normalized (source?):
       *
       * pmi(x,y) = log_2 ( P(x,y) / (P(x) * P(y)) )
       *
       * normalized: -1 = never; 0 = independent; +1 = always coöccurring
       *
       * npmi(x,y) = pmi(x,y) / (- log(P(x,y)))
       *
       * npmi(x,y) = log(P(x)P(y)) / log(P(x,y)) - 1
       *
       */

      double npmi = Utilities.log2(px * py) / Utilities.log2(pxy) - 1;
      this.scores.put(pair, npmi * 100.0);
    }

    if (debugMode) {
      System.out.println("Pairbank: nbr of terms = " + termCount.keySet().size());
      System.out.println("Pairbank: nbr of pairs = " + pairCount.keySet().size());
    }
  }

  /***** CREOLE PARAMETERS *****/

  @CreoleParameter(comment = "annotation types to evaluate as terms",
          defaultValue = "Entity")
  public void setInnerAnnotationTypes(Set<String> types) {
    this.innerAnnotationTypes = types;
  }

  public Set<String> getInnerAnnotationTypes() {
    return this.innerAnnotationTypes;
  }

  @CreoleParameter(comment = "annotation type for scanning window",
          defaultValue = "Sentence")
  public void setOuterAnnotationType(String type) {
    this.outerAnnotationType = type;
  }

  public String getOuterAnnotationType() {
    return this.outerAnnotationType;
  }

  @CreoleParameter(comment = "window size in outer annotations",
          defaultValue = "2")
  public void setOuterAnnotationWindow(Integer w) {
    this.outerAnnotationWindow = w;
  }

  public Integer getOuterAnnotationWindow() {
    return this.outerAnnotationWindow;
  }

  @CreoleParameter(comment = "require each collocation pair to consist of different types",
          defaultValue = "false")
  public void setRequireTypeDifference(Boolean rtd) {
    this.requireTypeDifference = rtd;
  }

  public Boolean getRequireTypeDifference() {
    return this.requireTypeDifference;
  }

  @CreoleParameter(comment = "allow a collocation pair to consist of overlapping annotations",
          defaultValue = "false")
  public void setAllowOverlapCollocations(Boolean aoc) {
    this.allowOverlaps = aoc;
  }

  public Boolean getAllowOverlapCollocations() {
    return this.allowOverlaps;
  }

  /* override default value from AbstractPairbank   */
  @CreoleParameter(defaultValue = "pmiScore")
  public void setScoreProperty(String name) {
    super.setScoreProperty(name);
  }

}


text:
'use strict';

var config = require('./config');

var $ = require('gulp-load-plugins')();
var _ = require('lodash');
var browserSync = require('browser-sync');
var gulp = require('gulp');
var path = require('path');
var wiredep = require('wiredep').stream;

gulp.task('inject', ['scripts', 'styles'], function() {
  var injectStyles = gulp.src([
    path.join(config.paths.tmp, '/serve/app/**/*.css'),
    path.join('!' + config.paths.tmp, '/serve/app/vendor.css'),
  ], {read: false});

  var injectScripts = gulp.src([
    path.join(config.paths.src, '/app/**/*.module.js'),
    path.join(config.paths.src, '/app/**/*.js'),
  ]).
      pipe($.angularFilesort()).
      on('error', config.errorHandler('AngularFilesort'));

  var injectOptions = {
    addRootSlash: false,
    ignorePath: [config.paths.src, path.join(config.paths.tmp, '/serve')],
  };

  return gulp.src(path.join(config.paths.src, '/*.html')).
      pipe($.inject(injectStyles, injectOptions)).
      pipe($.inject(injectScripts, injectOptions)).
      pipe(wiredep(_.extend({}, config.wiredep))).
      pipe(gulp.dest(path.join(config.paths.tmp, '/serve')));
});

gulp.task('inject-reload', ['inject'], function() {
  browserSync.reload();
});


text:
namespace EasyCpp
{
	namespace Logging
	{
		void NullLogger::Log(Severity severity, std::string message, Bundle context)
		{
		}
	}
}


text:
import {NgZone} from '@angular/core';
import {addProviders, inject} from '@angular/core/testing';

import {SebmGoogleMapPolyline} from '../../../src/core/directives/google-map-polyline';
import {GoogleMapsAPIWrapper} from '../../../src/core/services/google-maps-api-wrapper';
import {Polyline} from '../../../src/core/services/google-maps-types';
import {PolylineManager} from '../../../src/core/services/managers/polyline-manager';

export function main() {
  describe('PolylineManager', () => {
    beforeEach(() => {
      addProviders([
        {provide: NgZone, useFactory: () => new NgZone({enableLongStackTrace: true})},
        PolylineManager, SebmGoogleMapPolyline, {
          provide: GoogleMapsAPIWrapper,
          useValue: jasmine.createSpyObj('GoogleMapsAPIWrapper', ['createPolyline'])
        }
      ]);
    });

    describe('Create a new polyline', () => {
      it('should call the mapsApiWrapper when creating a new polyline',
         inject(
             [PolylineManager, GoogleMapsAPIWrapper],
             (polylineManager: PolylineManager, apiWrapper: GoogleMapsAPIWrapper) => {
               const newPolyline = new SebmGoogleMapPolyline(polylineManager);
               polylineManager.addPolyline(newPolyline);

               expect(apiWrapper.createPolyline).toHaveBeenCalledWith({
                 clickable: true,
                 draggable: false,
                 editable: false,
                 geodesic: false,
                 strokeColor: undefined,
                 strokeOpacity: undefined,
                 strokeWeight: undefined,
                 visible: true,
                 zIndex: undefined,
                 path: []
               });
             }));
    });

    describe('Delete a polyline', () => {
      it('should set the map to null when deleting a existing polyline',
         inject(
             [PolylineManager, GoogleMapsAPIWrapper],
             (polylineManager: PolylineManager, apiWrapper: GoogleMapsAPIWrapper) => {
               const newPolyline = new SebmGoogleMapPolyline(polylineManager);

               const polylineInstance: Polyline = jasmine.createSpyObj('Polyline', ['setMap']);
               (<any>apiWrapper.createPolyline).and.returnValue(Promise.resolve(polylineInstance));

               polylineManager.addPolyline(newPolyline);
               polylineManager.deletePolyline(newPolyline).then(() => {
                 expect(polylineInstance.setMap).toHaveBeenCalledWith(null);
               });
             }));
    });
  });
}


text:
import sys
import os

# add the required modules to the path (this is sub-optimal, but ZSI has
# bugs we need to work around
vendor_dir = os.path.join(os.path.dirname(__file__), '..', 'viclient_vendor')
sys.path.append(vendor_dir)

import client, vmutils

VimService = client.VimService
Error = client.Error


text:
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>C.33 JsMinTask</title>
    <link rel="stylesheet" type="text/css" href="book.css">
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
    <link rel="home" href="index.html" title="Phing User Guide">
    <link rel="up" href="app.optionaltasks.html" title="Appendix C. Optional tasks">
    <link rel="prev" href="JslLintTask.html" title="C.32 JslLintTask">
    <link rel="next" href="LiquibaseTask.html" title="C.34 LiquibaseTask">

            C.33 JsMinTask

            Prev
            Appendix C. Optional tasks
             Next

C.33 JsMinTask

 The JsMinTask minifies JavaScript files using JShrink,
        which can be installed using composer (Phing will try
        to use the composer autoloader)

Table C.39: Attributes

                <colgroup>
                    <col class="name">
                    <col class="type">
                    <col class="description">
                    <col class="default">
                    <col class="required">
                </colgroup>

                    Name
                    Type
                    Description
                    Default
                    Required

                    targetDir
                    String
                    Path where to store minified JavaScript files
                    none
                    Yes

                    suffix
                    String
                    Suffix to append to the filenames.
                    -min
                    No

                    failonerror
                    Boolean
                    Whether an error while minifying a JavaScript file should stop the
                        build or not

                    false
                    No

C.33.1 Example

<jsMin targetDir="docroot/script/minified" failOnError="false">
  <fileset dir="docroot/script">
    <include name="**/*.js"/>
  </fileset>
</jsMin>

C.33.2 Supported Nested Tags

fileset

JavaScript files to be minified.

            Prev
            Up
             Next

            C.32 JslLintTask
            Home
             C.34 LiquibaseTask


text:
package backend.pass;

import tools.Util;

import java.util.HashSet;
import java.util.LinkedHashSet;

import static backend.pass.PassRegistrar.getPassInfo;

/**
 * @author Jianping Zeng
 * @version 0.4
 */
public final class AnalysisUsage {
  private LinkedHashSet<PassInfo> required, preserved;
  private boolean preservedAll;

  public AnalysisUsage() {
    required = new LinkedHashSet<>();
    preserved = new LinkedHashSet<>();
  }

  public AnalysisUsage addRequired(Class<? extends Pass> reqPass) {
    PassInfo info = getPassInfo(reqPass);
    Util.assertion(info != null, "Pass is not registered!");
    return addRequiredPassInfo(info);
  }

  public AnalysisUsage addRequiredPassInfo(PassInfo info) {
    if (!required.contains(info))
      required.add(info);
    return this;
  }

  public AnalysisUsage addPreserved(Class<? extends Pass> prePass) {
    PassInfo info = getPassInfo(prePass);
    Util.assertion(info != null, "Pass is not registered");
    return addPreservedPassInfo(info);
  }

  public AnalysisUsage addPreservedPassInfo(PassInfo info) {
    if (!preserved.contains(info))
      preserved.add(info);
    return this;
  }

  public void setPreservedAll() {
    preservedAll = true;
  }

  public boolean getPreservedAll() {
    return preservedAll;
  }

  public HashSet<PassInfo> getRequired() {
    return required;
  }

  public HashSet<PassInfo> getPreserved() {
    return preserved;
  }

  /**
   * This function should be called to by the pass, iff they do
   * not:
   *

   *
Add or remove basic blocks from the function

   *
Modify terminator instructions in any way.

   *

   * This function annotates the AnalysisUsage info object to say that analyses
   * that only depend on the CFG are preserved by this pass.
   */
  public void setPreservesCFG() {
    // TODO: 17-11-16
  }
}


text:
// MIT License
// Copyright (c) 2011-2016 Elisée Maurer, Sparklin Labs, Creative Patterns
// Copyright (c) 2016 Thomas Morgner, Rabbit-StewDio Ltd.
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

using System;
using Microsoft.Xna.Framework;

namespace Steropes.UI.Animation
{
  public class SmoothValue : AnimatedValue
  {
    public SmoothValue(float start, float end, float duration, float delay = 0f, AnimationLoop loop = AnimationLoop.NoLoop)
    {
      Start = start;
      End = end;
      Duration = duration;
      Delay = delay;
      Loop = loop;
      Time = 0f;
    }

    public SmoothValue(float start, float end, float duration, AnimationLoop loop) : this(start, end, duration, 0f, loop)
    {
    }

    public override float CurrentValue
    {
      get
      {
        if (Math.Abs(Duration) < 0.0005)
        {
          return Start;
        }

        var amount = (float) ((Time - Delay) / Duration);
        return MathHelper.SmoothStep(Start, End, amount);
      }
    }

    public float End { get; }

    public float Start { get; }
  }
}


text:
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.IO;
using System.Linq;
using System.Net.Mail;
using System.Net.Mime;
using System.Text;
using System.Web;
using System.Web.Mvc;
using KarateIsere.DataAccess;
using KarateIsere.DataAccess.Tool;
using KarateIsere.Models;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.Owin;
using NLog;

namespace KarateIsere.Areas.Private.Controllers {
    [Authorize(Roles = "Admin")]
    public class CompetitionsController : Controller {

        private static Logger logger = LogManager.GetCurrentClassLogger();

        // GET: Private/Competitions
        public ActionResult Index() {
            List<Competition> compets = new List<Competition>();
            try {
                compets = GetCompetitions();
            }
            catch (Exception e) {
                logger.Error(e);
            }

            return View(GetCompetitions());
        }

        // GET: Private/Competitions/Details/5
        public ActionResult Details(int id) {
            List<Competiteur> c = new List<Competiteur>();
            try {
                c = Inscriptions.GetInscriptions(id);
                ViewBag.CompetId = id;

            }
            catch (Exception e) {
                logger.Error(e);
            }

            return View(c);
        }

        /// <summary>
        /// Exporte une compétition vers excel
        /// </summary>
        /// <param name="id">Compétition Id</param>
        /// <returns></returns>
        [HttpGet]
        public FileStreamResult Export(int id) {

            FileStreamResult res = null;

            try {
                Competition compet = Competition.GetById(id);
                List<Competiteur> competiteurs = Inscriptions.GetInscriptions(id);
                string delimChar = ";";
                //Si je ferme moi-même les stream l'application crash
                //il semble que le framework les ferme lui-même
                MemoryStream output = new MemoryStream();
                StreamWriter writer = new StreamWriter(output, Encoding.UTF8);

                //headers
                writer.Write("Club");
                writer.Write(delimChar);
                writer.Write("Catégorie");
                writer.Write(delimChar);
                writer.Write("NumLicence");
                writer.Write(delimChar);
                writer.Write("Nom");
                writer.Write(delimChar);
                writer.Write("Prenom");
                writer.Write(delimChar);
                writer.Write("Poids");
                writer.WriteLine();

                //Content
                foreach (Competiteur c in competiteurs) {
                    writer.Write(c.Club.NomClub);
                    writer.Write(delimChar);
                    writer.Write(c.Categorie.Nom);
                    writer.Write(delimChar);
                    writer.Write(c.NumLicence);
                    writer.Write(delimChar);
                    writer.Write(c.Nom);
                    writer.Write(delimChar);
                    writer.Write(c.Prenom);
                    writer.Write(delimChar);
                    writer.Write(c.Poids);
                    writer.WriteLine();
                }

                writer.Flush();
                output.Position = 0;

                res = this.File(output,
                            "application/vnd.ms-excel",
                             compet.Nom + "_" + compet.DateCompetition.ToShortDateString() + ".csv");
            }
            catch (Exception e) {
                logger.Error(e);
            }

            return res;
        }

        [HttpPost]
        public ActionResult Create(Competition compet) {
            List<Competition> compets = new List<Competition>();
            try {
                DateTime competDate = compet.DateCompetition;
                DateTime finInscription = compet.FinInscription;

                if (competDate.CompareTo(finInscription) <= 0) {
                    ModelState.AddModelError("DateCompetition",
                                        "La date de la compétition doit être " +
                                        "supérieur à la date de fin d'inscription");
                }

                if (ModelState.IsValid) {
                    compet.Categorie = (List<Categorie>) Session["selectedCategorie"];
                    compet.Create();
                    Session.Remove("selectedCategorie");
                }

                compets = GetCompetitions();
            }
            catch (Exception e) {
                logger.Error(e);
            }

            return View("Index", compets);
        }

        // GET: Private/Competitions/Edit/5
        public ActionResult Edit(int competId) {
            Competition c = new Competition(); ;
            try {
                c = Competition.GetById(competId);

                //Liste des catégories déjà enregistrées
                List<Categorie> listCate = c.Categorie.ToList();
                Session["selectedCategorie"] = listCate;
                List<string> cate = GetCateList(listCate);
                ViewBag.CateList = cate;
            }
            catch (Exception e) {
                logger.Error(e);
            }

            return View(c);
        }

        // POST: Private/Competitions/Edit/5
        [HttpPost]
        public ActionResult Edit(Competition compet) {
            try {
                if (ModelState.IsValid) {
                    compet.Categorie = (List<Categorie>) Session["selectedCategorie"];
                    compet.Update();
                    Session.Remove("selectedCategorie");
                    return View("Index", GetCompetitions());
                }

                return View("Edit", compet);
            }
            catch (Exception e) {
                logger.Error(e);
                return View();
            }
        }

        public ActionResult Delete(int competId) {
            try {
                Competition c = Competition.GetById(competId);

                if (c != null) {
                    c.Delete();
                }

                return View("Index", GetCompetitions());
            }
            catch (Exception e) {
                logger.Error(e);
                return View();
            }
        }

        /// <summary>
        /// Ajoute une catégorie dans la variable de session qui sera
        /// utilisée pour la création de la compétition
        /// </summary>
        /// <param name="name">Catégorie à ajouter</param>
        public void AddCategorie(string name) {
            try {
                List<Categorie> selectedCate;

                if (Session["selectedCategorie"] != null) {
                    selectedCate = (List<Categorie>) Session["selectedCategorie"];
                }
                else {
                    selectedCate = new List<Categorie>();
                }

                Categorie c = new Categorie {
                    Nom = name
                };

                selectedCate.Add(c);
                Session["selectedCategorie"] = selectedCate;
            }
            catch (Exception e) {
                logger.Error(e);
            }
        }

        /// <summary>
        /// Supprime une catégorie dans la variable de session qui sera
        /// utilisée pour la création de la compétition
        /// </summary>
        /// <param name="name">Catégorie à supprimer</param>
        public void DelCategorie(string name, string competName) {
            Contract.Requires(Session["selectedCategorie"] != null,
                               "La variable de session ne devrait pas être vide à cet endroit du code");
            try {
                List<Categorie> selectedCate;

                if (Session["selectedCategorie"] != null) {
                    selectedCate = (List<Categorie>) Session["selectedCategorie"];
                }
                else {
                    //Ne devrait jamais se produire
                    Competition c = Competition.GetByName(competName);
                    selectedCate = c.Categorie.ToList();
                }

                Categorie cate = selectedCate.Where(d => d.Nom == name).SingleOrDefault();
                if (cate != null) {
                    selectedCate.Remove(cate);
                }

                Session["selectedCategorie"] = selectedCate;
            }
            catch (Exception e) {
                logger.Error(e);
            }
        }

        private List<Competition> GetCompetitions() {
            //Used to init the Categorie dropdown list
            ViewBag.CateList = GetCateList();
            List<Competition> compets = Competition.GetAll();
            return compets;

        }

        /// <summary>
        /// Récupère la liste des catégories pour les afficher
        /// </summary>
        /// <param name="excluded">Catégories déjà sélectionnées
        /// à exclure de la liste</param>
        /// <returns></returns>
        private List<string> GetCateList(List<Categorie> excluded = null) {
            List<String> cateList = Categorie.GetAll().Select(d => d.Nom).ToList();

            if (excluded != null) {
                List<string> selectedCate = excluded.Select(d => d.Nom).ToList();
                cateList.RemoveAll(d => selectedCate.Contains(d));
            }

            return cateList;
        }

        #region Json Reporting
        /// <summary>
        /// Retourne le nombre de participant par catégorie d'age
        /// </summary>
        /// <param name="id">Compétition id</param>
        /// <returns></returns>
        public JsonResult PieCategorie(int id) {
            //Competition compet = Competition.GetById(id);
            List<Competiteur> competiteurs = Inscriptions.GetInscriptions(id);
            var res = from c in competiteurs
                      group c by c.Categorie.Nom into g
                      select new { Categorie = g.Key, Count = g.Count() };
            return Json(res, JsonRequestBehavior.AllowGet);
        }

        /// <summary>
        /// Retourne le nombre de participant par catégorie d'age
        /// </summary>
        /// <param name="id">Compétition id</param>
        /// <returns></returns>
        public JsonResult PieSexe(int id) {
            //Competition compet = Competition.GetById(id);
            List<Competiteur> competiteurs = Inscriptions.GetInscriptions(id);
            var res = from c in competiteurs
                      group c by c.isHomme into g
                      select new { Sexe = g.Key ? "Homme" : "Femme", Count = g.Count() };
            return Json(res, JsonRequestBehavior.AllowGet);
        }

        #endregion

        #region Club notification

        /// <summary>
        /// Send an remember email to the clubs which did not subscribe
        /// to the competition
        /// </summary>
        /// <param name="id">Competition identifier</param>
        /// <returns></returns>
        public JsonResult NotifyNonInscrits(int id) {
            /* Attention avec l'hébergement OVH on peut envoyé
             * 200 mails/heure/compte ou 300 mails/heure/IP
             * */
            string msg;

            try {
                List<Club> clubs = Inscriptions.GetNotInscripts(id);
                List<string> parameters = null;
                Competition compet = Competition.GetById(id);
                int remainingDay = (int) (compet.FinInscription - DateTime.Now).TotalDays;

                foreach (Club c in clubs) {
                    if (!string.IsNullOrEmpty(c.Correspondant)) {
                        parameters = new List<string>{
                            c.NomClub,
                            remainingDay.ToString(),
                            compet.Nom
                        };

                        sendEmail(c.Correspondant, "RappelInscriptionCompet", parameters);
                    }
                }

                msg = "Email de rappel envoyé avec succès";
                return Json(msg, JsonRequestBehavior.AllowGet);
            }
            catch (Exception e) {
                logger.Error(e);
                msg = "Echec lors de l'envoie du rappel";
                return Json(msg, JsonRequestBehavior.AllowGet);
            }
        }

        private void sendEmail(string destEmail, string mailIdentifier, List<string> parameters) {

            //Send mail
            using (SmtpClient client = new SmtpClient()) {
                MailMessage mailMessage = new MailMessage();
                ContentType mimeType = new System.Net.Mime.ContentType("text/html");

                //Load the html message linked content
                string filePath = Server.MapPath(Url.Content("~/img/logo.gif"));
                LinkedResource inline = new LinkedResource(filePath, MediaTypeNames.Image.Gif);
                inline.ContentId = "logo";//Guid.NewGuid().ToString();

                parameters.Insert(0, inline.ContentId);
                string subject = string.Empty;
                string message = BuildMsgBody(mailIdentifier, parameters.ToArray(), out subject);

                //Create and the html message to the email
                AlternateView avHtml = AlternateView.CreateAlternateViewFromString(message, mimeType);
                avHtml.LinkedResources.Add(inline);
                mailMessage.AlternateViews.Add(avHtml);

                MailAddress fromAdd = new MailAddress("admin@karateisere.fr", "Commission Sportive Karaté Isère");
                mailMessage.From = fromAdd;
                mailMessage.To.Add(destEmail);
                mailMessage.Subject = subject;

                //Add the standard message to the email
                mailMessage.Body = message;
                mailMessage.IsBodyHtml = true;
                client.Send(mailMessage);
            }
        }

        private string BuildMsgBody(string mailIdentifier, object[] param, out string subject) {
            string res = "<table>{0}{1}</table>";
            Mail mailHeader = Mail.Get("MailHeader");
            Mail mail = Mail.Get(mailIdentifier);

            subject = mail.Subject;

            res = string.Format(res, mailHeader.Message, mail.Message);
            res = string.Format(res, param);

            return res;
        }

        #endregion
    }
}


text:
module Conratewebshop
  class LineItem < ActiveRecord::Base
    belongs_to :order
    belongs_to :product
    belongs_to :cart

    def total_price
      return 0 if product.try(:price).blank?
      product.price * quantity
    end
  end
end


text:
package io.gomatcha.matcha;

import android.content.Context;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.view.View;
import android.widget.Button;

import com.google.protobuf.InvalidProtocolBufferException;

import io.gomatcha.matcha.proto.view.PbButton;

class MatchaButton extends MatchaChildView {
    MatchaViewNode viewNode;
    Button view;

    static {
        MatchaView.registerView("gomatcha.io/matcha/view/button", new MatchaView.ViewFactory() {
            @Override
            public MatchaChildView createView(Context context, MatchaViewNode node) {
                return new MatchaButton(context, node);
            }
        });
    }

    public MatchaButton(Context context, MatchaViewNode node) {
        super(context);
        viewNode = node;
        view = new Button(context);
        view.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                MatchaButton.this.viewNode.call("OnPress");
            }
        });
        addView(view);
    }

    @Override
    public void setNativeState(byte[] nativeState) {
        super.setNativeState(nativeState);
        try {
            PbButton.Button proto = PbButton.Button.parseFrom(nativeState);
            view.setEnabled(proto.getEnabled());
            view.setText(proto.getStr());

            if (proto.hasColor() && proto.getEnabled()) {
                int color = Protobuf.newColor(proto.getColor());
                view.getBackground().setColorFilter(color, PorterDuff.Mode.MULTIPLY);
                view.setTextColor(Color.WHITE);
            } else {
                // TODO(KD): reset background and text color
            }
        } catch (InvalidProtocolBufferException e) {
        }
    }
}


text:
Client library for Healthcare

## Installation and Usage
```bash
npm install --save @datafire/healthcare_gov
```
```js
let healthcare_gov = require('@datafire/healthcare_gov').create();

.then(data => {
  console.log(data);
});
```

## Description

## Actions

### api.articlesmediaTypeExtension.get
Returns pages content.

```js
healthcare_gov.api.articlesmediaTypeExtension.get({
  "mediaTypeExtension": ""
}, context)
```

#### Input
* input `object`
  * mediaTypeExtension **required** `string` (values: .json): Omiting the param causes html to be returned.

#### Output
* output [articlesList](#articleslist)

### api.blogmediaTypeExtension.get
Returns pages content.

```js
healthcare_gov.api.blogmediaTypeExtension.get({
  "mediaTypeExtension": ""
}, context)
```

#### Input
* input `object`
  * mediaTypeExtension **required** `string` (values: .json): Omiting the param causes html to be returned.

#### Output
* output [blogList](#bloglist)

### api.glossarymediaTypeExtension.get
Returns pages content.

```js
healthcare_gov.api.glossarymediaTypeExtension.get({
  "mediaTypeExtension": ""
}, context)
```

#### Input
* input `object`
  * mediaTypeExtension **required** `string` (values: .json): Omiting the param causes html to be returned.

#### Output
* output [glossaryList](#glossarylist)

### api.questionsmediaTypeExtension.get
Returns pages content.

```js
healthcare_gov.api.questionsmediaTypeExtension.get({
  "mediaTypeExtension": ""
}, context)
```

#### Input
* input `object`
  * mediaTypeExtension **required** `string` (values: .json): Omiting the param causes html to be returned.

#### Output
* output [questionsList](#questionslist)

### api.statesmediaTypeExtension.get
Returns pages content.

```js
healthcare_gov.api.statesmediaTypeExtension.get({
  "mediaTypeExtension": ""
}, context)
```

#### Input
* input `object`
  * mediaTypeExtension **required** `string` (values: .json): Omiting the param causes html to be returned.

#### Output
* output [statesList](#stateslist)

### api.topicsmediaTypeExtension.get
Returns pages content.

```js
healthcare_gov.api.topicsmediaTypeExtension.get({
  "mediaTypeExtension": ""
}, context)
```

#### Input
* input `object`
  * mediaTypeExtension **required** `string` (values: .json): Omiting the param causes html to be returned.

#### Output
* output [topicsList](#topicslist)

### blog.pageNamemediaTypeExtension.get
Returns pages content.

```js
healthcare_gov.blog.pageNamemediaTypeExtension.get({
  "mediaTypeExtension": "",
  "pageName": ""
}, context)
```

#### Input
* input `object`
  * mediaTypeExtension **required** `string` (values: .json): Omiting the param causes html to be returned.
  * pageName **required** `string`

#### Output
* output [blogPage](#blogpage)

### es.blog.pageNamemediaTypeExtension.get
Returns pages content.

```js
healthcare_gov.es.blog.pageNamemediaTypeExtension.get({
  "mediaTypeExtension": "",
  "pageName": ""
}, context)
```

#### Input
* input `object`
  * mediaTypeExtension **required** `string` (values: .json): Omiting the param causes html to be returned.
  * pageName **required** `string`

#### Output
* output [blogPage](#blogpage)

### es.glossary.pageNamemediaTypeExtension.get
Returns pages content.

```js
healthcare_gov.es.glossary.pageNamemediaTypeExtension.get({
  "mediaTypeExtension": "",
  "pageName": ""
}, context)
```

#### Input
* input `object`
  * mediaTypeExtension **required** `string` (values: .json): Omiting the param causes html to be returned.
  * pageName **required** `string`

#### Output
* output [glossaryPage](#glossarypage)

### es.question.pageNamemediaTypeExtension.get
Returns pages content.

```js
healthcare_gov.es.question.pageNamemediaTypeExtension.get({
  "mediaTypeExtension": "",
  "pageName": ""
}, context)
```

#### Input
* input `object`
  * mediaTypeExtension **required** `string` (values: .json): Omiting the param causes html to be returned.
  * pageName **required** `string`

#### Output
* output [questionPage](#questionpage)

### es.pageNamemediaTypeExtension.get
Returns pages content.

```js
healthcare_gov.es.pageNamemediaTypeExtension.get({
  "mediaTypeExtension": "",
  "pageName": ""
}, context)
```

#### Input
* input `object`
  * mediaTypeExtension **required** `string` (values: .json): Omiting the param causes html to be returned.
  * pageName **required** `string`

#### Output
* output [page](#page)

### es.stateNamemediaTypeExtension.get
Returns pages content.

```js
healthcare_gov.es.stateNamemediaTypeExtension.get({
  "mediaTypeExtension": "",
  "stateName": ""
}, context)
```

#### Input
* input `object`
  * mediaTypeExtension **required** `string` (values: .json): Omiting the param causes html to be returned.
  * stateName **required** `string`

#### Output
* output [statePage](#statepage)

### glossary.pageNamemediaTypeExtension.get
Returns pages content.

```js
healthcare_gov.glossary.pageNamemediaTypeExtension.get({
  "mediaTypeExtension": "",
  "pageName": ""
}, context)
```

#### Input
* input `object`
  * mediaTypeExtension **required** `string` (values: .json): Omiting the param causes html to be returned.
  * pageName **required** `string`

#### Output
* output [glossaryPage](#glossarypage)

### question.pageNamemediaTypeExtension.get
Returns pages content.

```js
healthcare_gov.question.pageNamemediaTypeExtension.get({
  "mediaTypeExtension": "",
  "pageName": ""
}, context)
```

#### Input
* input `object`
  * mediaTypeExtension **required** `string` (values: .json): Omiting the param causes html to be returned.
  * pageName **required** `string`

#### Output
* output [questionPage](#questionpage)

### pageNamemediaTypeExtension.get
Returns pages content.

```js
healthcare_gov.pageNamemediaTypeExtension.get({
  "mediaTypeExtension": "",
  "pageName": ""
}, context)
```

#### Input
* input `object`
  * mediaTypeExtension **required** `string` (values: .json): Omiting the param causes html to be returned.
  * pageName **required** `string`

#### Output
* output [page](#page)

### stateNamemediaTypeExtension.get
Returns pages content.

```js
healthcare_gov.stateNamemediaTypeExtension.get({
  "mediaTypeExtension": "",
  "stateName": ""
}, context)
```

#### Input
* input `object`
  * mediaTypeExtension **required** `string` (values: .json): Omiting the param causes html to be returned.
  * stateName **required** `string`

#### Output
* output [statePage](#statepage)

## Definitions

### articlesList
* articlesList `object`
  * articles `array`
    * items `object`
      * bite `string`
      * categories `array`
        * items `array`
          * items `string`
      * content `string`
      * date `string`
      * excerpt `string`
      * featured `boolean`
      * id `string`
      * lang `string`
      * layout `string`
      * meta-description `string`
      * meta-title `string`
      * path `string`
      * published `boolean`
      * related `array`
        * items `array`
          * items `string`
      * seo-keywords `string`
      * sort `number`
      * tags `array`
        * items `array`
      * title `string`
      * title-short `string`
      * topics `array`
        * items `array`
          * items `string`
      * url `string`

### blogList
* blogList `object`
  * blog `array`
    * items `array`
      * items `object`
        * categories `array`
          * items `array`
        * content `string`
        * date `string`
        * lang `string`
        * layout `string`
        * meta-description `string`
        * meta-title `string`
        * published `boolean`
        * seo-keywords `string`
        * sort `number`
        * tags `array`
          * items `array`
        * title `string`
        * topics `array`
          * items `array`
        * url `string`

### blogPage
* blogPage `object`
  * categories `array`
    * items `array`
      * items `string`
  * content `string`
  * date `string`
  * excerpt `string`
  * id `string`
  * lang `string`
  * layout `string`
  * meta-description `string`
  * meta-title `string`
  * path `string`
  * published `boolean`
  * seo-keywords `string`
  * sort `number`
  * tags `array`
    * items `array`
  * title `string`
  * topics `array`
    * items `array`
      * items `string`
  * url `string`

### glossaryList
* glossaryList `object`
  * glossary `array`
    * items `object`
      * categories `array`
        * items `string`
      * content `string`
      * date `string`
      * excerpt `string`
      * id `string`
      * lang `string`
      * layout `string`
      * path `string`
      * published `boolean`
      * sort `number`
      * tags `array`
        * items `string`
      * title `string`
      * url `string`

### glossaryPage
* glossaryPage `object`
  * categories `array`
    * items `string`
  * content `string`
  * date `string`
  * excerpt `string`
  * id `string`
  * lang `string`
  * layout `string`
  * path `string`
  * published `boolean`
  * sort `number`
  * tags `array`
    * items `string`
  * title `string`
  * url `string`

### page
* page `object`
  * categories `array`
    * items `array`
  * content `string`
  * date `string`
  * excerpt `string`
  * experience `string`
  * id `string`
  * lang `string`
  * layout `string`
  * path `string`
  * published `boolean`
  * sort `number`
  * tags `array`
    * items `array`
  * title `string`
  * url `string`

### questionPage
* questionPage `object`
  * categories `array`
    * items `string`
  * content `string`
  * date `string`
  * excerpt `string`
  * id `string`
  * lang `string`
  * path `string`
  * published `boolean`
  * sort `number`
  * tags `array`
    * items `string`
  * title `string`
  * url `string`

### questionsList
* questionsList `object`
  * questions `array`
    * items `object`
      * categories `array`
        * items `string`
      * content `string`
      * date `string`
      * excerpt `string`
      * id `string`
      * lang `string`
      * path `string`
      * published `boolean`
      * sort `number`
      * tags `array`
        * items `string`
      * title `string`
      * url `string`

### statePage
* statePage `object`
  * categories `array`
    * items `array`
  * content `string`
  * date `string`
  * excerpt `string`
  * id `string`
  * lang `string`
  * path `string`
  * sort `number`
  * stateurl `string`
  * tags `array`
    * items `array`
      * items `string`
  * title `string`
  * url `string`

### statesList
* statesList `object`
  * states `array`
    * items `array`
      * items `object`
        * categories `array`
          * items `array`
        * content `string`
        * date `string`
        * excerpt `string`
        * id `string`
        * lang `string`
        * path `string`
        * sort `number`
        * stateurl `string`
        * tags `array`
          * items `array`
        * title `string`
        * url `string`

### topicsList
* topicsList `object`
  * topics `array`
    * items `object`
      * articleorder `array`
        * items `array`
          * items `string`
      * categories `array`
        * items `array`
      * content `string`
      * date `string`
      * excerpt `string`
      * id `string`
      * lang `string`
      * layout `string`
      * meta-description `string`
      * meta-title `string`
      * order `number`
      * path `string`
      * published `boolean`
      * sort `number`
      * tags `array`
        * items `array`
          * items `string`
      * title `string`
      * url `string`


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Interop;
using MetroRadiance.Core.Win32;

namespace MetroRadiance.Controls
{
	public class CaptionIcon : Button
	{
		static CaptionIcon()
		{
			DefaultStyleKeyProperty.OverrideMetadata(typeof(CaptionIcon), new FrameworkPropertyMetadata(typeof(CaptionIcon)));
		}

		private bool isSystemMenuOpened;

		protected override void OnInitialized(EventArgs e)
		{
			base.OnInitialized(e);

			var window = Window.GetWindow(this);
			if (window == null) return;

			window.SourceInitialized += this.Initialize;
		}

		private void Initialize(object sender, EventArgs e)
		{
			var window = (Window)sender;
			window.SourceInitialized -= this.Initialize;

			var source = PresentationSource.FromVisual(window) as HwndSource;
			if (source != null)
			{
				source.AddHook(this.WndProc);
				window.Closed += (o, args) => source.RemoveHook(this.WndProc);
			}
		}

		private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
		{
			if (msg == (int)WM.NCLBUTTONDOWN)
			{
				this.isSystemMenuOpened = false;
			}

			return IntPtr.Zero;
		}

		protected override void OnMouseDown(MouseButtonEventArgs e)
		{
			var window = Window.GetWindow(this) as MetroWindow;
			if (window == null)
			{
				base.OnMouseDown(e);
				return;
			}

			if (e.ChangedButton == MouseButton.Left)
			{
				if (e.ClickCount == 1)
				{
					if (!this.isSystemMenuOpened)
					{
						this.isSystemMenuOpened = true;
						var point = this.PointToScreen(new Point(0, this.ActualHeight));
						SystemCommands.ShowSystemMenu(window, new Point(point.X / window.currentDpi.ScaleX, point.Y / window.currentDpi.ScaleY));
					}
					else
					{
						this.isSystemMenuOpened = false;
					}
				}
				else if (e.ClickCount == 2)
				{
					window.Close();
				}
			}
		}

		protected override void OnMouseRightButtonUp(MouseButtonEventArgs e)
		{
			var window = Window.GetWindow(this) as MetroWindow;
			if (window == null)
			{
				base.OnMouseRightButtonUp(e);
				return;
			}

			var point = this.PointToScreen(e.GetPosition(this));
			SystemCommands.ShowSystemMenu(window, new Point(point.X / window.currentDpi.ScaleX, point.Y / window.currentDpi.ScaleY));
		}

		protected override void OnMouseLeave(MouseEventArgs e)
		{
			this.isSystemMenuOpened = false;
			base.OnMouseLeave(e);
		}
	}
}


text:
class CreateUsers < ActiveRecord::Migration[5.0]
  def change
    create_table :users do |t|
      t.integer :user_id
      t.string :name

      t.timestamps
    end
  end
end


text:
define(function() {

/**
 * Generated by:
 *
 * var regenerate = require( "regenerate" );
 * var spaceSeparatorSymbols = require( "unicode-8.0.0/General_Category/Space_Separator/symbols" );
 * regenerate().add( spaceSeparatorSymbols ).toString();
 *
 * https://github.com/mathiasbynens/regenerate
 * https://github.com/mathiasbynens/unicode-8.0.0
 */
return /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/g;

});


text:
import { Doughnut, mixins } from 'vue-chartjs'
const { reactiveProp } = mixins

export default Doughnut.extend({
    mixins: [reactiveProp],
    props: ['options'],
    mounted () {
        // this.chartData is created in the mixin.
        // If you want to pass options please create a local options object
        this.renderChart(this.chartData, this.options)
    }
})


text:
#include <aws/ec2/model/CancelConversionTaskRequest.h>
#include <aws/core/utils/StringUtils.h>
#include <aws/core/utils/memory/stl/AWSStringStream.h>

using namespace Aws::EC2::Model;
using namespace Aws::Utils;

CancelConversionTaskRequest::CancelConversionTaskRequest() :
    m_dryRun(false),
    m_dryRunHasBeenSet(false),
    m_conversionTaskIdHasBeenSet(false),
    m_reasonMessageHasBeenSet(false)
{
}

Aws::String CancelConversionTaskRequest::SerializePayload() const
{
  Aws::StringStream ss;
  ss << "Action=CancelConversionTask&";
  if(m_dryRunHasBeenSet)
  {
    ss << "DryRun=" << std::boolalpha << m_dryRun << "&";
  }

  if(m_conversionTaskIdHasBeenSet)
  {
    ss << "ConversionTaskId=" << StringUtils::URLEncode(m_conversionTaskId.c_str()) << "&";
  }

  if(m_reasonMessageHasBeenSet)
  {
    ss << "ReasonMessage=" << StringUtils::URLEncode(m_reasonMessage.c_str()) << "&";
  }

  ss << "Version=2016-11-15";
  return ss.str();
}

void  CancelConversionTaskRequest::DumpBodyToUrl(Aws::Http::URI& uri ) const
{
  uri.SetQueryString(SerializePayload());
}


text:
<!doctype html>

    <base href="/">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="fragment" content="!">
    <title ng-bind="'Arran.gr - ' + title">Arran.gr - Arrange your meetups!</title>
    <meta name="description" content="{{ description || 'Simple tool for managing your regular meetups.'}}">
    <link rel="stylesheet" href="/css/main.min.css"/>

Photo: FotoSander

                <button id="update-browser-close-button" type="button" class="close">×
                </button>

Browser is out of date

Your browser seems to be out of date and may not be compatible with our
                    website.

Here are four excellent, up-to-date and free browsers that we recommend:

                            CHROME

                            FIREFOX

                            SAFARI

                            INTERNET EXPLORER

 (click icon to go to download page)


text:
(function($) {
    FormValidation.I18n = $.extend(true, FormValidation.I18n || {}, {
        'en_US': {
            file: {
                'default': 'Please choose a valid file'
            }
        }
    });

    FormValidation.Validator.file = {
        html5Attributes: {
            extension: 'extension',
            maxfiles: 'maxFiles',
            minfiles: 'minFiles',
            maxsize: 'maxSize',
            minsize: 'minSize',
            maxtotalsize: 'maxTotalSize',
            mintotalsize: 'minTotalSize',
            message: 'message',
            type: 'type'
        },

        /**
         * Validate upload file. Use HTML 5 API if the browser supports
         *
         * @param {FormValidation.Base} validator The validator plugin instance
         * @param {jQuery} $field Field element
         * @param {Object} options Can consist of the following keys:
         * - extension: The allowed extensions, separated by a comma
         * - maxFiles: The maximum number of files
         * - minFiles: The minimum number of files
         * - maxSize: The maximum size in bytes
         * - minSize: The minimum size in bytes
         * - maxTotalSize: The maximum size in bytes for all files
         * - minTotalSize: The minimum size in bytes for all files
         * - message: The invalid message
         * - type: The allowed MIME type, separated by a comma
         * @returns {Boolean}
         */
        validate: function(validator, $field, options, validatorName) {
            var value = validator.getFieldValue($field, validatorName);
            if (value === '') {
                return true;
            }

            var ext,
                extensions = options.extension ? options.extension.toLowerCase().split(',') : null,
                types      = options.type      ? options.type.toLowerCase().split(',')      : null,
                html5      = (window.File && window.FileList && window.FileReader);

            if (html5) {
                // Get FileList instance
                var files     = $field.get(0).files,
                    total     = files.length,
                    totalSize = 0;

                if ((options.maxFiles && total > parseInt(options.maxFiles, 10))        // Check the maxFiles
                    || (options.minFiles && total < parseInt(options.minFiles, 10)))    // Check the minFiles
                {
                    return false;
                }

                for (var i = 0; i < total; i++) {
                    totalSize += files[i].size;
                    ext        = files[i].name.substr(files[i].name.lastIndexOf('.') + 1);

                    if ((options.minSize && files[i].size < parseInt(options.minSize, 10))                      // Check the minSize
                        || (options.maxSize && files[i].size > parseInt(options.maxSize, 10))                   // Check the maxSize
                        || (extensions && $.inArray(ext.toLowerCase(), extensions) === -1)                      // Check file extension
                        || (files[i].type && types && $.inArray(files[i].type.toLowerCase(), types) === -1))    // Check file type
                    {
                        return false;
                    }
                }

                if ((options.maxTotalSize && totalSize > parseInt(options.maxTotalSize, 10))        // Check the maxTotalSize
                    || (options.minTotalSize && totalSize < parseInt(options.minTotalSize, 10)))    // Check the minTotalSize
                {
                    return false;
                }
            } else {
                // Check file extension
                ext = value.substr(value.lastIndexOf('.') + 1);
                if (extensions && $.inArray(ext.toLowerCase(), extensions) === -1) {
                    return false;
                }
            }

            return true;
        }
    };
}(jQuery));


text:
package sample.data.cassandra;

import org.cassandraunit.spring.CassandraUnitDependencyInjectionTestExecutionListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.springframework.core.Ordered;

public class OrderedCassandraTestExecutionListener
		extends CassandraUnitDependencyInjectionTestExecutionListener {

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

	@Override
	public int getOrder() {
		return Ordered.HIGHEST_PRECEDENCE;
	}

	@Override
	protected void cleanServer() {
		try {
			super.cleanServer();
		}
		catch (Exception ex) {
			logger.warn("Failure during server cleanup", ex);
		}
	}

}