text:
"""
Benchmark a server's response to a simple displayname startswith
report.
"""

from urllib2 import HTTPDigestAuthHandler

from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.internet import reactor
from twisted.web.client import Agent
from twisted.web.http_headers import Headers

from httpauth import AuthHandlerAgent
from httpclient import StringProducer
from benchlib import initialize, sample

body = """\
<?xml version="1.0" encoding="utf-8" ?>
<x0:principal-property-search xmlns:x2="urn:ietf:params:xml:ns:caldav" xmlns:x0="DAV:" xmlns:x1="http://calendarserver.org/ns/" test="anyof"><x0:property-search><x0:prop><x0:displayname/></x0:prop><x0:match match-type="starts-with">user</x0:match></x0:property-search><x0:property-search><x0:prop><x1:email-address-set/></x0:prop><x0:match match-type="starts-with">user</x0:match></x0:property-search><x0:property-search><x0:prop><x1:first-name/></x0:prop><x0:match match-type="starts-with">user</x0:match></x0:property-search><x0:property-search><x0:prop><x1:last-name/></x0:prop><x0:match match-type="starts-with">user</x0:match></x0:property-search><x0:prop><x1:email-address-set/><x2:calendar-user-address-set/><x2:calendar-user-type/><x0:displayname/><x1:last-name/><x1:first-name/><x1:record-type/><x0:principal-URL/></x0:prop></x0:principal-property-search>"""

@inlineCallbacks
def measure(host, port, dtrace, attendeeCount, samples):
    user = password = "user01"
    root = "/"
    principal = "/"
    calendar = "report-principal"

    authinfo = HTTPDigestAuthHandler()
    authinfo.add_password(
        realm="Test Realm",
        uri="http://%s:%d/" % (host, port),
        user=user,
        passwd=password)
    agent = AuthHandlerAgent(Agent(reactor), authinfo)

    # Set up the calendar first
    yield initialize(agent, host, port, user, password, root, principal, calendar)

    url = 'http://%s:%d/principals/' % (host, port)
    headers = Headers({"content-type": ["text/xml"]})

    samples = yield sample(
        dtrace, samples, agent,
        lambda: ('REPORT', url, headers, StringProducer(body)))
    returnValue(samples)


text:
<!--
  Copyright 2013 The Android Open Source Project

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
  -->

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <!-- The CardView needs to be wrapped to ensure spacing is applied correctly. -->

    <android.support.v7.widget.CardView
        style="@style/Widget.SampleDashboard.Card"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <LinearLayout
            style="@style/Widget.SampleDashboard.Item"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <TextView
                android:id="@android:id/text1"
                style="@style/Widget.SampleDashboard.Item.Title"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Hello world" />

            <TextView
                android:id="@android:id/text2"
                style="@style/Widget.SampleDashboard.Item.Description"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"/>

        </LinearLayout>

    </android.support.v7.widget.CardView>

</FrameLayout>

redpajama_set_name: RedPajamaGithub


text:
import sys
import pymongo
import json
import os
from pymongo import MongoClient
from ..core import *

def load_comments(obj):
    obj.url                   = url
    obj.req_comments          = req_comments
    obj.req_all_comments      = req_all_comments
    obj.req_comment           = req_comment

def url(self, comments_type = 0, mid = ""):
    if mid:
        return "%s%s_%s?csrf_token=%s" % (self.comment_link, self.comments_type[comments_type], mid, self.csrf_token)

def req_hotComment(self, music_id):    # 获取精彩评论
    comments = self.req_comment(music_id, 1, 1, 1)
    comments.pop("comments")
    comments.pop("total")
    comments.pop("more")
    return comments

def req_comments(self, music_id, page, page_num, comments_type):    # 获取最新评论
    comments = self.req_comment(music_id, page, page_num, comments_type)
    comments.pop("moreHot")
    comments.pop("hotComments")
    return comments

def req_all_comments(self, music_id, page_num = 100, comments_type = 0):    # 获取网易云音乐全部 评论
    ret_data = []
    page = 1
    comments = self.req_comment(music_id, page, page_num, comments_type)
    while True:
        yield comments
        if comments["more"]:
            page += 1
            comments = self.req_comment(music_id, page, page_num, comments_type)
        else:
            return

def req_comment(self, music_id = "", page = 1, page_num = 20, comments_type = 0):    # 获取网易云音乐 评论data
    url = self.url(comments_type, music_id)

    #comment_param_set    ----START
    self.comment_param["rid"] = music_id
    self.comment_param["offset"] = (page - 1) * page_num
    self.comment_param["total"] = "true"
    self.comment_param["limit"] = page_num
    self.comment_param["csrf_token"] = self.csrf_token
    #comment_param_set    ----END

    #payload = get_post_param(self.comment_param)
    #r = self.s.post(url, headers=self.headers, params=payload)
    r = self.post(url, dheaders=None, dparams=self.comment_param)
    return r

'''
    def set_comment_param(self, rid = "", page = 1, page_num = 20,  csrf_token = ""):
        if page_num >= self.comment_param_limit_size["min"] and page_num <= self.comment_param_limit_size["max"]:
            self.comment_param["rid"] = rid
            self.comment_param["offset"] = (page - 1) * page_num
            self.comment_param["total"] = "true"
            self.comment_param["limit"] = page_num
            self.comment_param["csrf_token"] = csrf_token
        else:
            self.comment_param["offset"] = cfg.COMMENTS_PARAM["offset"]
            self.comment_param["limit"] = cfg.COMMENTS_PARAM["page_num"]
'''


text:
package alluxio.hadoop;

import alluxio.client.file.URIStatus;

import org.apache.hadoop.fs.FSDataInputStream;

import java.io.IOException;

/**
 * Interface to wrap open method of file system.
 */
public interface HadoopFileOpener {
  /**
   * Opens an FSDataInputStream at the indicated Path.
   * @param uriStatus the file to open
   * @return a Hadoop input stream
   */
  FSDataInputStream open(URIStatus uriStatus) throws IOException;
}


text:
package Utils;

import java.io.IOException;
import java.io.OutputStream;

public class CustomOutputStream extends OutputStream {

	public String out = "";

	@Override
	public void write(int b) throws IOException {
		this.out = this.out + Character.toString((char) b);
	}

}


text:
package org.jdal.swing.tree;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;

import javax.swing.tree.MutableTreeNode;
import javax.swing.tree.TreeNode;

/**
 * Simple TreeNode implementation that use List to hold chidrens.
 * mainly used for root nodes
 *
 * @author Jose Luis Martin - (jlm@joseluismartin.info)
 */
@SuppressWarnings({"unchecked", "rawtypes"})
public class ListTreeNode implements MutableTreeNode {

	private MutableTreeNode parent;
	private List children = new ArrayList();
	private Object userObject = null;

	public ListTreeNode(String name) {
		this.userObject = name;
	}
	/**
	 * {@inheritDoc}
	 */
	public Enumeration children() {
		return Collections.enumeration(children);
	}

	/**
	 * {@inheritDoc}
	 */
	public boolean getAllowsChildren() {
		return true;
	}

	/**
	 * {@inheritDoc}
	 */
	public TreeNode getChildAt(int childIndex) {
		return (TreeNode) children.get(childIndex);
	}

	/**
	 * {@inheritDoc}
	 */
	public int getChildCount() {
		return children.size();
	}

	/**
	 * {@inheritDoc}
	 */
	public int getIndex(TreeNode node) {
		for (int i = 0; i < children.size(); i++) {
			if (node != null && node.equals(children.get(i)))
				return i;
		}
		// not found
		return -1;
	}

	/**
	 * {@inheritDoc}
	 */
	public TreeNode getParent() {
		return parent;
	}

	/**
	 * {@inheritDoc}
	 */
	public boolean isLeaf() {
		return children.size() == 0;
	}

	/**
	 *
	 */
	public void add(TreeNode node) {
		children.add(node);
	}

	public void remove(TreeNode node) {
		children.remove(node);
	}

	public String toString() {
		return userObject.toString();
	}

	/**
	 * @return children list
	 */
	public List getList() {
		return children;
	}

	public void insert(MutableTreeNode child, int index) {
		children.add(index, child);

	}

	public void remove(int index) {
		children.remove(index);
	}

	public void remove(MutableTreeNode node) {
		children.remove(node);
	}

	public void removeFromParent() {
		if (parent != null) {
			parent.remove(this);
		}
	}

	public void setParent(MutableTreeNode newParent) {
		parent = newParent;
		parent.insert(this, newParent.getChildCount());
	}

	public void setUserObject(Object object) {

	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.github.mahjong4j</groupId>
    <artifactId>mahjong4j</artifactId>
    <version>0.3.2</version>
    <name>mahjong4j</name>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>
    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <scm>
        <url>https://github.com/mahjong4j/mahjong4j</url>
        <connection>scm:git:git@github.com:mahjong4j/mahjong4j.git</connection>
        <developerConnection>scm:git:git@github.com:mahjong4j/mahjong4j.git</developerConnection>
    </scm>
    <url>https://mahjong4j.github.io/</url>
    <description>Mahjong judgement program</description>
    <developers>
        <developer>
            <id>yu1ro</id>
            <name>Yuichiro Kawano</name>
            <email>tresener.yu1ro@gmail.com</email>
            <url>https://github.com/yu1ro</url>
        </developer>
        <developer>
            <id>fjskknn</id>
            <name>Konan Fujisaku</name>
            <email>knn.fjsk@gmail.com</email>
            <url>https://github.com/fjskknn</url>
        </developer>
    </developers>
    <profiles>
        <profile>
            <id>ossrh</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <gpg.executable>gpg2</gpg.executable>
                <gpg.passphrase>the_pass_phrase</gpg.passphrase>
            </properties>
        </profile>
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.3</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.7.5.201505241946</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>[4,12]</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <version>[1.3]</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
        </dependency>
    </dependencies>

</project>


text:
=pod

=head1 NAME

EVP_KDF-TLS13_KDF - The TLS 1.3 EVP_KDF implementation

=head1 DESCRIPTION

Support for computing the TLS 1.3 version of the B<HKDF> KDF through
the B<EVP_KDF> API.

The EVP_KDF-TLS13_KDF algorithm implements the HKDF key derivation function
as used by TLS 1.3.

=head2 Identity

"TLS13-KDF" is the name for this implementation; it
can be used with the EVP_KDF_fetch() function.

=head2 Supported parameters

The supported parameters are:

=over 4

=item "properties" (B<OSSL_KDF_PARAM_PROPERTIES>) <UTF8 string>

=item "digest" (B<OSSL_KDF_PARAM_DIGEST>) <UTF8 string>

=item "key" (B<OSSL_KDF_PARAM_KEY>) <octet string>

=item "salt" (B<OSSL_KDF_PARAM_SALT>) <octet string>

These parameters work as described in L<EVP_KDF(3)/PARAMETERS>.

=item "prefix" (B<OSSL_KDF_PARAM_PREFIX>) <octet string>

This parameter sets the label prefix on the specified TLS 1.3 KDF context.
For TLS 1.3 this should be set to the ASCII string "tls13 " without a
trailing zero byte.  Refer to RFC 8446 section 7.1 "Key Schedule" for details.

=item "label" (B<OSSL_KDF_PARAM_LABEL>) <octet string>

This parameter sets the label on the specified TLS 1.3 KDF context.
Refer to RFC 8446 section 7.1 "Key Schedule" for details.

=item "data" (B<OSSL_KDF_PARAM_DATA>) <octet string>

This parameter sets the context data on the specified TLS 1.3 KDF context.
Refer to RFC 8446 section 7.1 "Key Schedule" for details.

=item "mode" (B<OSSL_KDF_PARAM_MODE>) <UTF8 string> or <integer>

This parameter sets the mode for the TLS 1.3 KDF operation.
There are two modes that are currently defined:

=over 4

=item "EXTRACT_ONLY" or B<EVP_KDF_HKDF_MODE_EXTRACT_ONLY>

In this mode calling L<EVP_KDF_derive(3)> will just perform the extract
operation. The value returned will be the intermediate fixed-length pseudorandom
key K.  The I<keylen> parameter must match the size of K, which can be looked
up by calling EVP_KDF_CTX_get_kdf_size() after setting the mode and digest.

The digest, key and salt values must be set before a key is derived otherwise
an error will occur.

=item "EXPAND_ONLY" or B<EVP_KDF_HKDF_MODE_EXPAND_ONLY>

In this mode calling L<EVP_KDF_derive(3)> will just perform the expand
operation. The input key should be set to the intermediate fixed-length
pseudorandom key K returned from a previous extract operation.

The digest, key and info values must be set before a key is derived otherwise
an error will occur.

=back

=back

=head1 NOTES

This KDF is intended for use by the TLS 1.3 implementation in libssl.
It does not support all the options and capabilities that HKDF does.

The I<OSSL_PARAM> array passed to L<EVP_KDF_derive(3)> or
L<EVP_KDF_CTX_set_params(3)> must specify all of the parameters required.
This KDF does not support a piecemeal approach to providing these.

A context for a TLS 1.3 KDF can be obtained by calling:

 EVP_KDF *kdf = EVP_KDF_fetch(NULL, "TLS13-KDF", NULL);
 EVP_KDF_CTX *kctx = EVP_KDF_CTX_new(kdf);

The output length of a TLS 1.3 KDF expand operation is specified via the
I<keylen> parameter to the L<EVP_KDF_derive(3)> function.  When using
EVP_KDF_HKDF_MODE_EXTRACT_ONLY the I<keylen> parameter must equal the size of
the intermediate fixed-length pseudorandom key otherwise an error will occur.
For that mode, the fixed output size can be looked up by calling
EVP_KDF_CTX_get_kdf_size() after setting the mode and digest on the
B<EVP_KDF_CTX>.

=head1 CONFORMING TO

RFC 8446

=head1 SEE ALSO

L<EVP_KDF(3)>,
L<EVP_KDF_CTX_new(3)>,
L<EVP_KDF_CTX_free(3)>,
L<EVP_KDF_CTX_get_kdf_size(3)>,
L<EVP_KDF_CTX_set_params(3)>,
L<EVP_KDF_derive(3)>,
L<EVP_KDF(3)/PARAMETERS>,
L<EVP_KDF-HKDF(7)>

=head1 COPYRIGHT

Copyright 2021 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License").  You may not use
this file except in compliance with the License.  You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.

=cut


text:
/**
  * Created by asghaier on 20.01.17.
  */
package chat.utilities

import models.Account

case class Quit(userId: Int)


text:
import { dbProducts } from '/db/dbProducts';
import { executeBulksSync } from '/server/imports/utils/executeBulksSync';
import PD from 'probability-distributions';
import { MathUtil } from '/common/imports/utils/MathUtil';

// 計算產品補貨的基準值
function getBaseAmount(product) {
  return product[product.replenishBaseAmountType];
}

// 計算產品補貨的隨機乘數
function getAmountFactor(product) {
  switch (product.replenishBatchSizeType) {
    case 'verySmall': {
      // 0% ~ 10%,Beta(3,7) 分佈(期望值 3%)
      return PD.rbeta(1, 3, 7)[0] * 0.1;
    }
    case 'small': {
      // 5% ~ 7%
      return 0.05 + Math.random() * 0.02;
    }
    case 'medium': {
      // 7% ~ 30%
      return 0.07 + Math.random() * 0.23;
    }
    case 'large': {
      // 30% ~ 50%
      return 0.3 + Math.random() * 0.2;
    }
    case 'veryLarge': {
      // 50% ~ 100%
      return 0.5 + Math.random() * 0.5;
    }
  }
}

// 計算產品補貨的隨機數量
function getReplenishAmount(product) {
  const baseAmount = getBaseAmount(product);
  const factor = getAmountFactor(product);

  // 最少釋出 1 個、最多全部釋出
  return MathUtil.clamp(Math.round(baseAmount * factor), 1, product.stockAmount);
}

// 對全部上市產品進行補貨
export function replenishProducts({ finalSale } = { finalSale: false }) {
  const productBulk = dbProducts.rawCollection().initializeUnorderedBulkOp();

  dbProducts
    .find({ state: 'marketing', stockAmount: { $gt: 0 } })
    .forEach((product) => {
      const replenishAmount = finalSale ? product.stockAmount : getReplenishAmount(product);
      productBulk.find({ _id: product._id }).updateOne({
        $inc: {
          availableAmount: replenishAmount,
          stockAmount: -replenishAmount
        }
      });
    });

  executeBulksSync(productBulk);
}


text:
namespace Events
{
    using System;
    using System.Text;

    public static class Messages
    {
        private static StringBuilder output;

        private static string eventsAddedMsg = "Event added" + Environment.NewLine;
        private static string eventsDeletedMsg = "{0} events deleted" + Environment.NewLine;
        private static string eventsNotFoundMsg = "No events found" + Environment.NewLine;

        static Messages()
        {
            output = new StringBuilder();
        }

        public static void EventAdded()
        {
            output.Append(eventsAddedMsg);
        }

        public static void EventDeleted(int x)
        {
            if (x == 0)
            {
                NoEventsFound();
            }
            else
            {
                output.AppendFormat(eventsDeletedMsg, x);
            }
        }

        public static void NoEventsFound()
        {
            output.Append(eventsNotFoundMsg);
        }

        public static void PrintEvent(Event eventToPrint)
        {
            if (eventToPrint != null)
            {
                output.Append(eventToPrint + Environment.NewLine);
            }
        }
    }
}


text:
/*
 * sync.h
 *
 *  Created on: Aug 20, 2012
 *      Authors: wozniak, armstrong
 *
 * The sync module manages server-to-server synchronization and
 * communication.  When servers are communicating with each other,
 * it is important to a) avoid deadlocks where a cycle of servers is
 * waiting on each other for a response, b) avoid starvation, where
 * servers are unable to progress waiting for other processes,
 * particularly if we get chains of servers waiting for each other.
 *
 * Several techniques are implemented in this module.
 *
 * - Tie-breaking algorithms to avoid deadlocks if servers must perform
 *   blocking synchronous RPCs on other servers
 * - Asynchronous RPCs, where key server-to-server operations such
 *   as work-stealing probes are sent immediately, with the respond
 *   handled later.
 * - Use of small, fixed-size sync messages to allow quick sending and
 *   receiving into fixed-size buffers in the caller.
 * - Asynchronous request handling where servers will continue to serve
 *   requests from other servers, to avoid starvation propagating.
 * - Request buffering, where we accumulate pending requests to be
 *   processed later.
 */

#pragma once

#include "adlb-defs.h"
#include "messaging.h"

adlb_code xlb_sync_init(void);
void xlb_sync_finalize(void);

void xlb_print_sync_counters(void);

/**
   Avoids server-to-server deadlocks by synchronizing with target
   server rank.  An MPI deadlock may be caused by two processes
   sending an RPC to each other simultaneously.  The sync
   functionality avoids this by doing special MPI probes and
   breaking ties to allow the higher rank process to always win

   This is used for server-to-server RPCs that do not have special
   support support in the sync module.

   After returning from this, this calling process may issue one RPC
   on the target process

   This function may add pending sync requests from other servers to
   the xlb_pending_syncs buffer, which will need to be serviced.
 */
adlb_code xlb_sync(int target);

/*
  Tell target to shut down
 */
adlb_code xlb_sync_shutdown(int target);

/*
  Subscribe to a datum on another server
 */
adlb_code xlb_sync_subscribe(int target, adlb_datum_id id,
                             adlb_subscript sub, bool *subscribed);

adlb_code xlb_sync_notify(int target, adlb_datum_id id,
                          adlb_subscript sub);

adlb_code xlb_send_unsent_notify(int rank,
                                 const struct packed_sync *req_hdr,
                                 void *malloced_subscript);

/*
  Send a steal probe
 */
adlb_code xlb_sync_steal_probe(int target);

/*
  Send a steal probe response
  work_counts: counts of request types
  size: number of entries in work_counts array
 */
adlb_code xlb_sync_steal_probe_resp(int target,
                                    const int *work_counts,
                                    int size);

/*
  Send a request to initiate a steal, to be followed up by actual steal
  communication once accepted.
  work_counts: counts of request types
  size: number of entries in work_counts array
  max_memory: max additional memory to accept
  response: logical, true if we will receive work
 */
adlb_code xlb_sync_steal(int target, const int *work_counts,
                         int size, int max_memory, int *response);

/*
  Send a refcount operation to another server.

  If wait is true, wait for response.
  Otherwise, return as soon as it is sent.
 */
adlb_code
xlb_sync_refcount(int target, adlb_datum_id id, adlb_refc change,
                  bool wait);

typedef struct {
  MPI_Request req;
  struct packed_sync *buf;
} xlb_sync_recv;

typedef enum {
  DEFERRED_SYNC, // Have not yet accepted
  ACCEPTED_REFC,   // Have accepted but need to do refcount
  DEFERRED_NOTIFY, // Have accepted but need to process notify
  UNSENT_NOTIFY, // Need to notify other server
  DEFERRED_STEAL_PROBE, // Have accepted but need to respond
  DEFERRED_STEAL_PROBE_RESP, // Have response, but have not acted
} xlb_pending_kind;

typedef struct {
  xlb_pending_kind kind;
  int rank;
  struct packed_sync *hdr; // Header to be freed later
  void *extra_data; // Extra data if needed for header type
} xlb_pending;

static inline adlb_code xlb_dequeue_pending(xlb_pending_kind* kind,
                                            int* rank,
                                            struct packed_sync** hdr,
                                            void** extra_data);

/*
  Handle a dequeued pending sync.  Frees all memory associated
  with it, so data pointed to will become invalid for caller.

  This should not be called if already within a sync loop.
 */
adlb_code xlb_handle_pending_sync(xlb_pending_kind kind,
                                  int rank,
                                  struct packed_sync* hdr,
                                  void* extra_data);

/*
 * return: true if we have pending notification work that could result
 *         in tasks being released
 */
static inline bool xlb_have_pending_notifs(void);

static inline bool xlb_is_pending_notif(xlb_pending_kind kind,
                                        const struct packed_sync* hdr);

/*
 * Check if there incoming sync request messages to process.
 * return: ADLB_SUCCESS if message present, ADLB_NOTHING if no message,
 *         ADLB_ERROR on error
 */
static inline adlb_code xlb_check_sync_msgs(int *caller);

/*
 * Handle sync message if check returns true
 */
adlb_code xlb_handle_next_sync_msg(int caller);

/*
 * Accept and handle sync.
 * return: ADLB_ERROR on error, ADLB_SHUTDOWN if got shutdown command,
 *         ADLB_SUCCESS otherwise
 */
adlb_code xlb_accept_sync(int rank, const struct packed_sync *hdr,
                          bool defer_svr_ops);

adlb_code xlb_handle_notify_sync(int rank,
                                 const struct packed_subscribe_sync *hdr,
                                 const void* sync_data,
                                 void* extra_data);

// Inline functions to make it quick to check for pending sync requests

extern xlb_sync_recv* xlb_sync_recvs;
extern int xlb_sync_recv_head;
extern int xlb_sync_recv_size;

static inline adlb_code xlb_check_sync_msgs(int *caller)
{
  int flag = 0;
  MPI_Status status;
  if (xlb_sync_recv_size <= 0)
  {
    return ADLB_NOTHING;
  }

  xlb_sync_recv* head = &xlb_sync_recvs[xlb_sync_recv_head];
  MPI_TEST2(&head->req, &flag, &status);

  if (flag)
  {
    *caller = status.MPI_SOURCE;
    return ADLB_SUCCESS;
  }
  else
  {
    return ADLB_NOTHING;
  }
}

// Info about pending sync requests: where sync request has been received
// but we haven't responded yet.
extern xlb_pending* xlb_pending_syncs; // Array for ring buffer
extern int xlb_pending_sync_head; // Head of ring buffer
extern int xlb_pending_sync_count; // Valid entries in array
extern int xlb_pending_sync_size; // Malloced size
extern int xlb_pending_notif_count; // Entries that are notifications

// Initial size of pending sync array
#define PENDING_SYNC_INIT_SIZE 1024

adlb_code xlb_pending_shrink(void);

/*
  Remove the pending sync from the list (FIFO order)
  returns ADLB_NOTHING if not found, otherwise sets arguments
  Caller is responsible for freeing hdr
 */
__attribute__((always_inline))
static inline adlb_code
xlb_dequeue_pending(xlb_pending_kind* kind,
                    int* rank,
                    struct packed_sync** hdr,
                    void** extra_data)
{
  if (xlb_pending_sync_count == 0)
    return ADLB_NOTHING;

  xlb_pending* pending = &xlb_pending_syncs[xlb_pending_sync_head];

  *kind = pending->kind;
  *rank = pending->rank;
  *hdr = pending->hdr;
  *extra_data = pending->extra_data;

  xlb_pending_sync_count--;
  xlb_pending_sync_head = (xlb_pending_sync_head + 1) %
                           xlb_pending_sync_size;

  if (xlb_is_pending_notif(pending->kind, pending->hdr))
  {
    xlb_pending_notif_count--;
  }

  TRACE("POP PENDING: %d left", xlb_pending_sync_count);

  if (xlb_pending_sync_size > PENDING_SYNC_INIT_SIZE &&
      xlb_pending_sync_count < (xlb_pending_sync_size / 4))
  {
    adlb_code code = xlb_pending_shrink();
    ADLB_CHECK(code);
  }

  return ADLB_SUCCESS;
}

static inline bool
xlb_have_pending_notifs(void)
{
  return xlb_pending_notif_count > 0;
}

__attribute__((always_inline))
static inline bool
xlb_is_pending_notif_mode(adlb_sync_mode mode)
{
  switch (mode) {
    case ADLB_SYNC_NOTIFY:
    case ADLB_SYNC_SUBSCRIBE:
    case ADLB_SYNC_REFCOUNT:
      // Notification or may result in notification
      return true;
    default:
      return false;
  }
}

__attribute__((always_inline))
static inline bool
xlb_is_pending_notif(xlb_pending_kind kind,
                     const struct packed_sync* hdr)
{
  switch (kind)
  {
    case DEFERRED_NOTIFY:
    case UNSENT_NOTIFY:
    case ACCEPTED_REFC:
      return true;
    case DEFERRED_SYNC:
      assert(hdr != NULL);
      return xlb_is_pending_notif_mode(hdr->mode);
    default:
      return false;
  }
}


text:
package com.xuhao.didi.socket.client.sdk.client.connection.abilities;

/**
 * Created by xuhao on 2017/5/16.
 */

public interface IConnectable {
    /**
     * 将当前连接管理器发起连接
     */
    void connect();
}


text:
// support records and init-only properties of C#9
// see https://github.com/dotnet/roslyn/issues/45510

#if NETSTANDARD2_0 || NETSTANDARD2_1 || NETCOREAPP2_0 || NETCOREAPP2_1 || NETCOREAPP2_2 || NETCOREAPP3_0 || NETCOREAPP3_1 || NET45 || NET451 || NET452 || NET46 || NET461 || NET462 || NET47 || NET471 || NET472 || NET48

using System.ComponentModel;

// ReSharper disable once CheckNamespace
namespace System.Runtime.CompilerServices
{
    /// <summary>
    /// Reserved to be used by the compiler for tracking metadata.
    /// This class should not be used by developers in source code.
    /// </summary>
    [EditorBrowsable(EditorBrowsableState.Never)]
    internal static class IsExternalInit
    {
    }
}

#endif


text:
set(FIND_MONO_OPTIONS "")
if(EXISTS "${MONO_DIR}")
  set(FIND_MONO_OPTIONS
    PATHS
      "${MONO_DIR}"
      "${MONO_DIR}/lib/mono"
    PATH_SUFFIXES
      bin
    NO_DEFAULT_PATH
  )
endif()

# Search for Mono tools.
find_program(MONO_EXE mono
  ${FIND_MONO_OPTIONS}
)
find_program(MONO_CSHARP_BUILD_EXE
  NAMES
    msbuild
    xbuild
  ${FIND_MONO_OPTIONS}
)

if(CMAKE_HOST_WIN32 AND
   NOT MONO_DISABLE_VISUAL_STUDIO_FALLBACK AND
   EXISTS "${CMAKE_VS_MSBUILD_COMMAND}")
  if(NOT MONO_CSHARP_BUILD_EXE)
    # If Mono's build tool isn't found, fallback to Visual Studio.
    message(STATUS "Mono installation not found, trying to fallback "
      "to Visual Studio's msbuild ${CMAKE_VS_MSBUILD_COMMAND}."
    )
    set(MONO_CSHARP_BUILD_EXE "${CMAKE_VS_MSBUILD_COMMAND}"
      CACHE STRING "" FORCE
    )
  endif()
  if(NOT MONO_EXE)
    # Just use cmake to launch the C# executable which should run on Windows if
    # the .NET framework is installed.
    # NOTE: This does not use cmd as CTest passes a path with / path separators
    # to CreateProcess() causing cmd to fail to start.
    set(MONO_EXE "${CMAKE_COMMAND};-E;env" CACHE STRING "" FORCE)
  endif()
endif()

# If the mono executable is found, and retrieve the version.
if(MONO_EXE)
  if(EXISTS "${MONO_EXE}")
    execute_process(
      COMMAND ${MONO_EXE} -V
      OUTPUT_VARIABLE MONO_VERSION_STRING
      RESULT_VARIABLE RESULT
    )
    if(NOT ${RESULT} EQUAL "0")
      message(FATAL_ERROR "${MONO_EXE} -V returned ${RESULT}.")
    endif()
    string(REGEX MATCH "([0-9]*)([.])([0-9]*)([.]*)([0-9]*)"
        MONO_VERSION_MATCH "${MONO_VERSION_STRING}")
    set(MONO_VERSION "${MONO_VERSION_MATCH}" CACHE STRING "Mono version.")
  else()
    set(MONO_VERSION "0.0.0" CACHE STRING "Mono version.")
  endif()
endif()

if(NOT MONO_EXE OR NOT MONO_CSHARP_BUILD_EXE)
  message(FATAL_ERROR "Cannot find mono and msbuild/xbuild executables.")
endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
  Mono
  DEFAULT_MSG
  MONO_EXE
  MONO_CSHARP_BUILD_EXE
  MONO_VERSION
)
mark_as_advanced(
  MONO_EXE
  MONO_CSHARP_BUILD_EXE
  MONO_VERSION
)


text:
namespace ArrayHelper
{
  public class ULongIntSumCalculator : SumCalculator<ulong>
  {
    public override ulong Sum(ulong a, ulong b)
    {
      return a + b;
    }
  }
}


text:
/* MACHINE GENERATED FILE, DO NOT EDIT */

#include <jni.h>
#include "extgl.h"

typedef void (APIENTRY *glDrawBuffersARBPROC) (GLsizei size, const GLenum * buffers);

JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ARBDrawBuffers_nglDrawBuffersARB(JNIEnv *env, jclass clazz, jint size, jlong buffers, jlong function_pointer) {
	const GLenum *buffers_address = (const GLenum *)(intptr_t)buffers;
	glDrawBuffersARBPROC glDrawBuffersARB = (glDrawBuffersARBPROC)((intptr_t)function_pointer);
	glDrawBuffersARB(size, buffers_address);
}


text:
layout: default
title: "Breast Cancer Screening"

---

{% include interests/breast-cancer-screening.md %}

### Who is interested in Breast Cancer Screening?

* [Mike Freer]({{ site.baseurl }}/members/mike-freer.html)


text:
**Support**

### Từ điển Họ Tên trong Việt Nam

> Tên người Việt Nam gồm có 3 phần chính: Họ + Tên Đệm + Tên Chính thường được chọn lựa khá kỹ về mặt ngữ âm và ngữ nghĩa, dùng để phân biệt người này với người khác. Ngày nay, nhiều người Việt hải ngoại đặt tên cho con theo tên tiếng nước ngoài. Không có một nguyên tắc chung nào trong việc đặt tên, nhưng đối với tâm lý của người Việt Nam, việc đặt tên rất quan trọng vì mỗi cái tên gắn chặt với mỗi con người suốt đời. Có thể căn cứ vào đặc điểm, giới tính, hoàn cảnh gia đình, dòng họ, quê hương, xã hội và cả ước vọng của người đặt tên gửi gắm vào cái tên nào đó.

> Điểm khác biệt cơ bản và độc đáo của tên người Việt Nam so với Trung Quốc, Hàn Quốc, Nhật Bản là luôn xưng hô bằng tên chính chứ không phải bằng họ.

# Data

Từ điển Họ Tên trong Việt Nam. Bộ từ điển được thu thập từ nhiều nguồn trên Internet. Ở phân loại thành nhóm Nam/Nữ.

1. [girl.txt](girl.txt) - Từ điển tên cho nữ (first-name).
2. [boy.txt](boy.txt) - Từ điển tên cho nam (first-name).
3. [girl_one_word.txt](girl_one_word.txt) - Tên nữ, 1 kí tự.
4. [girl_unsigned.txt](girl_unsigned.txt) - Tên nữ, không dấu.
5. [girl_one_word_unsigned.txt](girl_one_word_unsigned.txt) - Tên nữ, 1 kí tự, không dấu.
6. [uit_member.json](uit_member.json) - Từ điển họ và tên (full-name), crawler từ forum.uit.edu.vn (Dec 28, 2016).

# How to contribute

1. Fork the project on Github
2. Create a topic branch for your changes
3. Ensure that you provide documentation and test coverage for your changes (patches won't be accepted without)
4. Create a pull request on Github (these are also a great place to start a conversation around a patch as early as possible)

# License

MIT License

Copyright (c) 2016 Van-Duyet Le

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.


text:
namespace VDinev.Marketing.ViewModels
{
    using System;

    public class MarketingViewModels
    {
        public int Id { get; set; }

        public string Name { get; set; }

        public string Description { get; set; }

        public DateTime StartTime { get; set; }

        public DateTime EndTime { get; set; }
    }
}


text: require 'paperclip_extensions'


text:
<!DOCTYPE html>

        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title></title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="stylesheet" href="css/normalize.css">
        <link rel="stylesheet" href="css/main.css">
        <link rel="stylesheet" href="css/foundation/css/foundation.min.css">

                <input type="text" ng-model="data.message">

{{data.message}}

                <input type="text" ng-model="data.message">

{{reverseMessage(data.message)}}


text:
namespace Microsoft.Azure.CognitiveServices.Vision.CustomVision.Training.Models
{
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// Prediction result.
    /// </summary>
    public partial class Prediction
    {
        /// <summary>
        /// Initializes a new instance of the Prediction class.
        /// </summary>
        public Prediction()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the Prediction class.
        /// </summary>
        /// <param name="probability">Probability of the tag.</param>
        /// <param name="tagId">Id of the predicted tag.</param>
        /// <param name="tagName">Name of the predicted tag.</param>
        /// <param name="boundingBox">Bounding box of the prediction.</param>
        public Prediction(double probability = default(double), System.Guid tagId = default(System.Guid), string tagName = default(string), BoundingBox boundingBox = default(BoundingBox))
        {
            Probability = probability;
            TagId = tagId;
            TagName = tagName;
            BoundingBox = boundingBox;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets probability of the tag.
        /// </summary>
        [JsonProperty(PropertyName = "probability")]
        public double Probability { get; private set; }

        /// <summary>
        /// Gets id of the predicted tag.
        /// </summary>
        [JsonProperty(PropertyName = "tagId")]
        public System.Guid TagId { get; private set; }

        /// <summary>
        /// Gets name of the predicted tag.
        /// </summary>
        [JsonProperty(PropertyName = "tagName")]
        public string TagName { get; private set; }

        /// <summary>
        /// Gets bounding box of the prediction.
        /// </summary>
        [JsonProperty(PropertyName = "boundingBox")]
        public BoundingBox BoundingBox { get; private set; }

        /// <summary>
        /// Validate the object.
        /// </summary>
        /// <exception cref="Rest.ValidationException">
        /// Thrown if validation fails
        /// </exception>
        public virtual void Validate()
        {
            if (BoundingBox != null)
            {
                BoundingBox.Validate();
            }
        }
    }
}


text:
package echosign.api.clientv20;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import echosign.api.clientv20.dto16.GetWidgetsForUserResult;

/**
 *
Java class for anonymous complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType>
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="getMyWidgetsResult" type="{http://dto16.api.echosign}GetWidgetsForUserResult"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "getMyWidgetsResult"
})
@XmlRootElement(name = "getMyWidgetsResponse")
public class GetMyWidgetsResponse {

    @XmlElement(required = true, nillable = true)
    protected GetWidgetsForUserResult getMyWidgetsResult;

    /**
     * Gets the value of the getMyWidgetsResult property.
     *
     * @return
     *     possible object is
     *     {@link GetWidgetsForUserResult }
     *
     */
    public GetWidgetsForUserResult getGetMyWidgetsResult() {
        return getMyWidgetsResult;
    }

    /**
     * Sets the value of the getMyWidgetsResult property.
     *
     * @param value
     *     allowed object is
     *     {@link GetWidgetsForUserResult }
     *
     */
    public void setGetMyWidgetsResult(GetWidgetsForUserResult value) {
        this.getMyWidgetsResult = value;
    }

}


text:
module Gubbara
  module ApplicationHelper
    def user_announcements
      session[:hidden_notices] ? @notices = Gubbara::Notice.where("gubbara_notices.id not in (?) and gubbara_notices.active not in (?) and gubbara_notices.base not in (?)", session[:hidden_notices], false, 'cookie') : @notices = Gubbara::Notice.where("gubbara_notices.active not in (?) and gubbara_notices.base not in (?)", false, 'cookie')
      render(:partial => 'gubbara/application/fetch_notices', locale: {notices: @notices})
    end

    def public_announcements
      cookies[:hidden_public_notices] ? @notices = Gubbara::Notice.where("gubbara_notices.id not in (?) and gubbara_notices.active not in (?) and gubbara_notices.base not in (?)", cookies[:hidden_public_notices].split, false, 'session') : @notices = Gubbara::Notice.where("gubbara_notices.active not in (?) and gubbara_notices.base not in (?)", false, 'session')
      render(:partial => 'gubbara/application/fetch_notices', locale: {notices: @notices})
    end
  end
end


text:
package service

import (
	"testing"
	"time"

	"github.com/docker/docker/pkg/testutil/assert"
	"github.com/docker/engine-api/types/swarm"
)

func TestMemBytesString(t *testing.T) {
	var mem memBytes = 1048576
	assert.Equal(t, mem.String(), "1 MiB")
}

func TestMemBytesSetAndValue(t *testing.T) {
	var mem memBytes
	assert.NilError(t, mem.Set("5kb"))
	assert.Equal(t, mem.Value(), int64(5120))
}

func TestNanoCPUsString(t *testing.T) {
	var cpus nanoCPUs = 6100000000
	assert.Equal(t, cpus.String(), "6.100")
}

func TestNanoCPUsSetAndValue(t *testing.T) {
	var cpus nanoCPUs
	assert.NilError(t, cpus.Set("0.35"))
	assert.Equal(t, cpus.Value(), int64(350000000))
}

func TestDurationOptString(t *testing.T) {
	dur := time.Duration(300 * 10e8)
	duration := DurationOpt{value: &dur}
	assert.Equal(t, duration.String(), "5m0s")
}

func TestDurationOptSetAndValue(t *testing.T) {
	var duration DurationOpt
	assert.NilError(t, duration.Set("300s"))
	assert.Equal(t, *duration.Value(), time.Duration(300*10e8))
}

func TestUint64OptString(t *testing.T) {
	value := uint64(2345678)
	opt := Uint64Opt{value: &value}
	assert.Equal(t, opt.String(), "2345678")

	opt = Uint64Opt{}
	assert.Equal(t, opt.String(), "none")
}

func TestUint64OptSetAndValue(t *testing.T) {
	var opt Uint64Opt
	assert.NilError(t, opt.Set("14445"))
	assert.Equal(t, *opt.Value(), uint64(14445))
}

func TestMountOptString(t *testing.T) {
	mount := MountOpt{
		values: []swarm.Mount{
			{
				Type:   swarm.MountTypeBind,
				Source: "/home/path",
				Target: "/target",
			},
			{
				Type:   swarm.MountTypeVolume,
				Source: "foo",
				Target: "/target/foo",
			},
		},
	}
	expected := "bind /home/path /target, volume foo /target/foo"
	assert.Equal(t, mount.String(), expected)
}

func TestMountOptSetNoError(t *testing.T) {
	for _, testcase := range []string{
		// tests several aliases that should have same result.
		"type=bind,target=/target,source=/source",
		"type=bind,src=/source,dst=/target",
		"type=bind,source=/source,dst=/target",
		"type=bind,src=/source,target=/target",
	} {
		var mount MountOpt

		assert.NilError(t, mount.Set(testcase))

		mounts := mount.Value()
		assert.Equal(t, len(mounts), 1)
		assert.Equal(t, mounts[0], swarm.Mount{
			Type:   swarm.MountTypeBind,
			Source: "/source",
			Target: "/target",
		})
	}
}

// TestMountOptDefaultType ensures that a mount without the type defaults to a
// volume mount.
func TestMountOptDefaultType(t *testing.T) {
	var mount MountOpt
	assert.NilError(t, mount.Set("target=/target,source=/foo"))
	assert.Equal(t, mount.values[0].Type, swarm.MountTypeVolume)
}

func TestMountOptSetErrorNoTarget(t *testing.T) {
	var mount MountOpt
	assert.Error(t, mount.Set("type=volume,source=/foo"), "target is required")
}

func TestMountOptSetErrorInvalidKey(t *testing.T) {
	var mount MountOpt
	assert.Error(t, mount.Set("type=volume,bogus=foo"), "unexpected key 'bogus'")
}

func TestMountOptSetErrorInvalidField(t *testing.T) {
	var mount MountOpt
	assert.Error(t, mount.Set("type=volume,bogus"), "invalid field 'bogus'")
}

func TestMountOptSetErrorInvalidReadOnly(t *testing.T) {
	var mount MountOpt
	assert.Error(t, mount.Set("type=volume,readonly=no"), "invalid value for readonly: no")
	assert.Error(t, mount.Set("type=volume,readonly=invalid"), "invalid value for readonly: invalid")
}

func TestMountOptDefaultEnableReadOnly(t *testing.T) {
	var m MountOpt
	assert.NilError(t, m.Set("type=bind,target=/foo,source=/foo"))
	assert.Equal(t, m.values[0].ReadOnly, false)

	m = MountOpt{}
	assert.NilError(t, m.Set("type=bind,target=/foo,source=/foo,readonly"))
	assert.Equal(t, m.values[0].ReadOnly, true)

	m = MountOpt{}
	assert.NilError(t, m.Set("type=bind,target=/foo,source=/foo,readonly=1"))
	assert.Equal(t, m.values[0].ReadOnly, true)

	m = MountOpt{}
	assert.NilError(t, m.Set("type=bind,target=/foo,source=/foo,readonly=0"))
	assert.Equal(t, m.values[0].ReadOnly, false)
}

func TestMountOptVolumeNoCopy(t *testing.T) {
	var m MountOpt
	assert.Error(t, m.Set("type=volume,target=/foo,volume-nocopy"), "source is required")

	m = MountOpt{}
	assert.NilError(t, m.Set("type=volume,target=/foo,source=foo"))
	assert.Equal(t, m.values[0].VolumeOptions == nil, true)

	m = MountOpt{}
	assert.NilError(t, m.Set("type=volume,target=/foo,source=foo,volume-nocopy=true"))
	assert.Equal(t, m.values[0].VolumeOptions != nil, true)
	assert.Equal(t, m.values[0].VolumeOptions.NoCopy, true)

	m = MountOpt{}
	assert.NilError(t, m.Set("type=volume,target=/foo,source=foo,volume-nocopy"))
	assert.Equal(t, m.values[0].VolumeOptions != nil, true)
	assert.Equal(t, m.values[0].VolumeOptions.NoCopy, true)

	m = MountOpt{}
	assert.NilError(t, m.Set("type=volume,target=/foo,source=foo,volume-nocopy=1"))
	assert.Equal(t, m.values[0].VolumeOptions != nil, true)
	assert.Equal(t, m.values[0].VolumeOptions.NoCopy, true)
}

func TestMountOptTypeConflict(t *testing.T) {
	var m MountOpt
	assert.Error(t, m.Set("type=bind,target=/foo,source=/foo,volume-nocopy=true"), "cannot mix")
	assert.Error(t, m.Set("type=volume,target=/foo,source=/foo,bind-propagation=rprivate"), "cannot mix")
}


text:
package br.com.tjgwp.business.entity;

public class SuperVO {

	protected Long id;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

}


text:
/**
 * KQOAuth - An OAuth authentication library for Qt.
 *
 * Author: Johan Paul (johan.paul@gmail.com)
 *         http://www.johanpaul.com
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  KQOAuth is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with KQOAuth.  If not, see <http://www.gnu.org/licenses/>.
 */

// Note this class shouldn't be copied or used and the implementation might change later.
#ifndef KQOAUTHAUTHREPLYSERVER_P_H
#define KQOAUTHAUTHREPLYSERVER_P_H

#include "kqoauthauthreplyserver.h"
#include <QMultiMap>
#include <QString>

class KQOAUTH_EXPORT KQOAuthAuthReplyServerPrivate: public QObject
{
    Q_OBJECT
public:
    KQOAuthAuthReplyServerPrivate( KQOAuthAuthReplyServer * parent );
    ~KQOAuthAuthReplyServerPrivate();
    QMultiMap<QString, QString> parseQueryParams(QByteArray *sdata);

public Q_SLOTS:
    void onIncomingConnection();
    void onBytesReady();

public:
    KQOAuthAuthReplyServer * q_ptr;
    Q_DECLARE_PUBLIC(KQOAuthAuthReplyServer);
    QTcpSocket *socket;

};

#endif // KQOAUTHAUTHREPLYSERVER_P_H


text:
#Region "License"

' The MIT License (MIT)
'
' Copyright (c) 2017 Richard L King (TradeWright Software Systems)
'
' 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.

#End Region

Imports OrderUtils27
Imports TickUtils27

Public Enum EntryOrderType
    None = BracketEntryTypes.BracketEntryTypeNone
    Market = BracketEntryTypes.BracketEntryTypeMarket
    MarketOnOpen = BracketEntryTypes.BracketEntryTypeMarketOnOpen
    MarketOnClose = BracketEntryTypes.BracketEntryTypeMarketOnClose
    MarketIfTouched = BracketEntryTypes.BracketEntryTypeMarketIfTouched
    MarketToLimit = BracketEntryTypes.BracketEntryTypeMarketToLimit
    Bid = BracketEntryTypes.BracketEntryTypeBid
    Ask = BracketEntryTypes.BracketEntryTypeAsk
    Last = BracketEntryTypes.BracketEntryTypeLast
    Limit = BracketEntryTypes.BracketEntryTypeLimit
    LimitOnOpen = BracketEntryTypes.BracketEntryTypeLimitOnOpen
    LimitOnClose = BracketEntryTypes.BracketEntryTypeLimitOnClose
    LimitIfTouched = BracketEntryTypes.BracketEntryTypeLimitIfTouched
    [Stop] = BracketEntryTypes.BracketEntryTypeStop
    StopLimit = BracketEntryTypes.BracketEntryTypeStopLimit
End Enum

Public Enum OrderRole
    Entry = BracketOrderRoles.BracketOrderRoleEntry
    StopLoss = BracketOrderRoles.BracketOrderRoleStopLoss
    Target = BracketOrderRoles.BracketOrderRoleTarget
End Enum

Public Enum OrderTIF
    None = OrderTIFs.OrderTIFNone
    Day = OrderTIFs.OrderTIFDay
    GoodTillCancelled = OrderTIFs.OrderTIFGoodTillCancelled
    ImmediateOrCancel = OrderTIFs.OrderTIFImmediateOrCancel
End Enum

Public Enum StopLossOrderType
    None = BracketStopLossTypes.BracketStopLossTypeNone
    [Stop] = BracketStopLossTypes.BracketStopLossTypeStop
    StopLimit = BracketStopLossTypes.BracketStopLossTypeStopLimit
    Bid = BracketStopLossTypes.BracketStopLossTypeBid
    Ask = BracketStopLossTypes.BracketStopLossTypeAsk
    Last = BracketStopLossTypes.BracketStopLossTypeLast
    Auto = BracketStopLossTypes.BracketStopLossTypeAuto
End Enum

Public Enum TargetOrderType
    None = BracketTargetTypes.BracketTargetTypeNone
    Limit = BracketTargetTypes.BracketTargetTypeLimit
    LimitIfTouched = BracketTargetTypes.BracketTargetTypeLimitIfTouched
    MarketIfTouched = BracketTargetTypes.BracketTargetTypeMarketIfTouched
    Bid = BracketTargetTypes.BracketTargetTypeBid
    Ask = BracketTargetTypes.BracketTargetTypeAsk
    Last = BracketTargetTypes.BracketTargetTypeLast
    Auto = BracketTargetTypes.BracketTargetTypeAuto
End Enum

Public Enum TickType
    Bid = TickTypes.TickTypeBid
    Ask = TickTypes.TickTypeAsk
    ClosePrice = TickTypes.TickTypeClosePrice
    HighPrice = TickTypes.TickTypeHighPrice
    LowPrice = TickTypes.TickTypeLowPrice
    MarketDepth = TickTypes.TickTypeMarketDepth
    MarketDepthReset = TickTypes.TickTypeMarketDepthReset
    Trade = TickTypes.TickTypeTrade
    Volume = TickTypes.TickTypeVolume
    OpenInterest = TickTypes.TickTypeOpenInterest
    OpenPrice = TickTypes.TickTypeOpenPrice
End Enum


text:
<f:if condition="{model.showElement}">

			{model.additionalArguments.label}
			<f:if condition="{model.mandatoryValidationMessages}">
				<f:for each="{model.mandatoryValidationMessages}" as="mandatoryValidationMessage" iteration="iterator">{mandatoryValidationMessage}<f:if condition="{iterator.isLast}"><f:else> - </f:else></f:if></f:for>
			</f:if>
			<f:if condition="{model.validationErrorMessages}">
				<f:for each="{model.validationErrorMessages}" as="errorValidationMessage" iteration="iterator">{errorValidationMessage}<f:if condition="{iterator.isLast}"><f:else> - </f:else></f:if></f:for>
			</f:if>

		<f:if condition="{model.additionalArguments.multiple}">
			<f:then>
				<f:form.checkbox
					class="{model.additionalArguments.class}"
					dir="{model.additionalArguments.dir}"
					id="{model.additionalArguments.id}"
					lang="{model.additionalArguments.lang}"
					style="{model.additionalArguments.style}"
					title="{model.additionalArguments.title}"
					accesskey="{model.additionalArguments.accesskey}"
					tabindex="{model.additionalArguments.tabindex}"
					onclick="{model.additionalArguments.onclick}"

					name="{model.additionalArguments.prefix}[{model.additionalArguments.name}][{model.name}]"
					value="<f:if condition='{model.additionalArguments.value}'><f:then>{model.additionalArguments.value}</f:then><f:else>{model.additionalArguments.name}-{model.elementCounter}</f:else></f:if>"

					checked="{model.additionalArguments.checked}"

					errorClass="{model.additionalAttributes.errorClass}"
					additionalAttributes="{model.htmlAttributes}"
				/>
			</f:then>
			<f:else>
				<f:form.checkbox
					class="{model.additionalArguments.class}"
					dir="{model.additionalArguments.dir}"
					id="{model.additionalArguments.id}"
					lang="{model.additionalArguments.lang}"
					style="{model.additionalArguments.style}"
					title="{model.additionalArguments.title}"
					accesskey="{model.additionalArguments.accesskey}"
					tabindex="{model.additionalArguments.tabindex}"
					onclick="{model.additionalArguments.onclick}"

					name="{model.additionalArguments.prefix}[{model.additionalArguments.name}]"
					value="<f:if condition='{model.additionalArguments.value}'><f:then>{model.additionalArguments.value}</f:then><f:else>{model.additionalArguments.name}-{model.elementCounter}</f:else></f:if>"

					checked="{model.additionalArguments.checked}"

					errorClass="{model.additionalAttributes.errorClass}"
					additionalAttributes="{model.htmlAttributes}"
				/>
			</f:else>
		</f:if>

</f:if>


text:
set -e

declare -A aliases
aliases=(
	[jessie]='latest'
)

cd "$(dirname "$(readlink -f "$BASH_SOURCE[0]")")"

repos=( "$@" )
if [ ${#repos[@]} -eq 0 ]; then
	repos=( */ )
fi
repos=( "${repos[@]%/}" )

echo '# maintainer: InfoSiftr <github@infosiftr.com> (@infosiftr)'
echo '# maintainer: Trong Nghia Nguyen - resin.io <james@resin.io>'

for repo in "${repos[@]}"; do

	cd $repo
	versions=( */ )
	versions=( "${versions[@]%/}" )
	cd ..
	url='git://github.com/resin-io-library/buildpack-deps'
	for version in "${versions[@]}"; do
		versionAliases=( $version ${aliases[$version]} )

		for variant in curl scm; do
			commit="$(git log -1 --format='format:%H' -- "$repo/$version/$variant")"
			echo
			for va in "${versionAliases[@]}"; do
				if [ "$va" = 'latest' ]; then
					va="$variant"
				else
					va="$va-$variant"
				fi
				echo "$va: ${url}@${commit} $repo/$version/$variant"
			done
		done

		commit="$(git log -1 --format='format:%H' -- "$repo/$version")"
		echo
		for va in "${versionAliases[@]}"; do
			echo "$va: ${url}@${commit} $repo/$version"
		done
	done
done


text:
const debug = process.env.NODE_ENV !== 'production';
const path = require('path');
const webpack = require('webpack');

const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');

module.exports = {
    mode: 'production',

    entry: [
        'bootstrap-loader', path.join(__dirname, './src/js/main.js')
    ],
    output: {
        path:  path.join(__dirname, 'dist'),
        filename: '[name].[chunkhash:8].js',
        chunkFilename: '[name].[chunkhash:8].chunk.js'
    },
    plugins: [
        new webpack.ProvidePlugin({
            $: 'jquery',
            Backbone: 'backbone',
            _: 'underscore'
        }),
        new CleanWebpackPlugin(['dist']),
        new HtmlWebpackPlugin({
            title: 'Exemple PEW',
            template: path.join(__dirname, 'src/index.html'),
        }),
        new CopyWebpackPlugin([{from: path.join(__dirname, 'src/assets/images'), to: path.join(__dirname, 'dist/images'),}])
    ],
    module: {
        rules: [
            {
                test: /\.js$/,
                exclude: /node_modules/,
                use: {
                    loader: 'babel-loader'
                }
            },
            {
                test: /\.scss$/,
                use: [
                    "style-loader",
                    MiniCssExtractPlugin.loader,
                    "css-loader",
                    "sass-loader"
                ]
            },
            { test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "url-loader?limit=10000&mimetype=application/font-woff" },
            { test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader" },
            {
                test: /\.(jpe?g|png|gif|svg)$/i,
                use: [
                    'file-loader?name=images/[name].[ext]',
                    'image-webpack-loader?bypassOnDebug'
                ]
            }
        ]
    }
};


text:
layout: page
title: Barnett - Everett Wedding
date: 2016-05-24
author: Aaron Banks
tags: weekly links, java
status: published
summary: Nullam sed tincidunt nibh, id varius.
banner: images/banner/leisure-03.jpg
booking:
  startDate: 01/13/2016
  endDate: 01/16/2016
  ctyhocn: HTSHUHX
  groupCode: BEW
published: true
---
Praesent sit amet turpis sapien. Vestibulum rutrum condimentum magna, a tempor sem mollis nec. Quisque luctus felis ut ex euismod pellentesque. Vivamus lacinia est a libero aliquet, vitae interdum felis tempus. Vivamus lectus nulla, interdum placerat nisl eget, finibus commodo felis. Donec nisi neque, vulputate vitae nisl nec, tempor bibendum leo. Suspendisse tempus nulla ante, quis porta magna maximus eget. Vivamus aliquet, ante non accumsan gravida, tortor odio dapibus elit, sit amet blandit enim lectus sit amet tortor. In consequat vel mi at mattis. Curabitur ut tincidunt purus, ac dapibus est. Curabitur eget euismod quam. Etiam odio quam, pellentesque vel turpis ac, hendrerit vehicula justo. Pellentesque pharetra nec nulla et malesuada. Praesent eros leo, fringilla at erat in, rutrum sagittis ipsum. Duis sit amet turpis neque.

* Morbi non lorem in nisi rutrum iaculis sit amet vitae metus
* Nullam consequat velit et nisi sollicitudin, nec auctor odio posuere.

Sed aliquam elementum neque quis tincidunt. Nunc tempor at est eu auctor. Curabitur commodo tincidunt velit quis vulputate. Cras at ligula consequat, semper mauris sed, faucibus ipsum. In hac habitasse platea dictumst. Duis vestibulum semper libero. Vestibulum vulputate ut diam vel sagittis. Nam neque justo, accumsan non ante a, dapibus consectetur urna. Donec vulputate mi id suscipit auctor. Integer non eros eget metus consequat molestie ac ac nisl. Aliquam erat volutpat. Vivamus ultricies eget mauris sit amet consequat. Ut neque quam, semper a euismod et, tempor vitae odio. Praesent volutpat tempus nibh. Nam cursus maximus suscipit.


text:
set(REQUIRED_AVCODEC_VERSION 0.8)
set(REQUIRED_AVCODEC_API_VERSION 53.25.0)

include(FindPkgConfig)

if (PKG_CONFIG_FOUND)
	pkg_check_modules(AVCODEC libavcodec)
	pkg_check_modules(AVUTIL libavutil)
	pkg_check_modules(AVRESAMPLE libavresample)
	pkg_check_modules(SWRESAMPLE libswresample)
endif(PKG_CONFIG_FOUND)

# avcodec
find_path(AVCODEC_INCLUDE_DIR libavcodec/avcodec.h PATHS ${AVCODEC_INCLUDE_DIRS})
find_library(AVCODEC_LIBRARY avcodec PATHS $ {AVCODEC_LIBRARY_DIRS})

# avutil
find_path(AVUTIL_INCLUDE_DIR libavutil/avutil.h PATHS ${AVUTIL_INCLUDE_DIRS})
find_library(AVUTIL_LIBRARY avutil PATHS ${AVUTIL_LIBRARY_DIRS})

# swresample
find_path(SWRESAMPLE_INCLUDE_DIR libswresample/swresample.h PATHS ${SWRESAMPLE_INCLUDE_DIRS})
find_library(SWRESAMPLE_LIBRARY swresample PATHS ${SWRESAMPLE_LIBRARY_DIRS})

# avresample
find_path(AVRESAMPLE_INCLUDE_DIR libavresample/avresample.h PATHS ${AVRESAMPLE_INCLUDE_DIRS})
find_library(AVRESAMPLE_LIBRARY avresample PATHS ${AVRESAMPLE_LIBRARY_DIRS})

if (AVCODEC_INCLUDE_DIR AND AVCODEC_LIBRARY)
	set(AVCODEC_FOUND TRUE)
endif(AVCODEC_INCLUDE_DIR AND AVCODEC_LIBRARY)

if (AVUTIL_INCLUDE_DIR AND AVUTIL_LIBRARY)
	set(AVUTIL_FOUND TRUE)
endif(AVUTIL_INCLUDE_DIR AND AVUTIL_LIBRARY)

include(FindPackageHandleStandardArgs)
if (SWRESAMPLE_FOUND)
	FIND_PACKAGE_HANDLE_STANDARD_ARGS(FFmpeg DEFAULT_MSG AVUTIL_FOUND AVCODEC_FOUND SWRESAMPLE_FOUND)
else()
	FIND_PACKAGE_HANDLE_STANDARD_ARGS(FFmpeg DEFAULT_MSG AVUTIL_FOUND AVCODEC_FOUND AVRESAMPLE_FOUND)
endif()

if (AVCODEC_VERSION)
	if (${AVCODEC_VERSION} VERSION_LESS ${REQUIRED_AVCODEC_API_VERSION})
		message(FATAL_ERROR
			    "libavcodec version >= ${REQUIRED_AVCODEC_VERSION} (API >= ${REQUIRED_AVCODEC_API_VERSION}) is required")
	endif()
else(AVCODEC_VERSION)
	message("Note: To build libavcodec version >= ${REQUIRED_AVCODEC_VERSION} (API >= ${REQUIRED_AVCODEC_API_VERSION}) is required")
endif(AVCODEC_VERSION)

if (FFMPEG_FOUND)
	if (SWRESAMPLE_FOUND)
		set(FFMPEG_INCLUDE_DIRS ${AVCODEC_INCLUDE_DIR} ${AVUTIL_INCLUDE_DIR} ${SWRESAMPLE_INCLUDE_DIR})
		set(FFMPEG_LIBRARIES ${AVCODEC_LIBRARY} ${AVUTIL_LIBRARY} ${SWRESAMPLE_LIBRARY})
	elseif (AVRESAMPLE_FOUND)
		set(FFMPEG_INCLUDE_DIRS ${AVCODEC_INCLUDE_DIR} ${AVUTIL_INCLUDE_DIR} ${AVRESAMPLE_INCLUDE_DIR})
		set(FFMPEG_LIBRARIES ${AVCODEC_LIBRARY} ${AVUTIL_LIBRARY} ${AVRESAMPLE_LIBRARY})
	endif()
endif(FFMPEG_FOUND)

mark_as_advanced(FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARIES)


text:
'use strict'

// The bulk of this code is borrowed from:
// https://github.com/othiym23/async-listener

var util = require('util')
var shimmer = require('shimmer')
var isNative = require('is-native')
var wrap = shimmer.wrap
var massWrap = shimmer.massWrap

module.exports = function (agent) {
  function wrapCallback (original) {
    if (typeof original !== 'function') return original

    var trans = agent.currentTransaction

    return function instrumented () {
      var prev = agent.currentTransaction
      agent.currentTransaction = trans
      var result = original.apply(this, arguments)
      agent.currentTransaction = prev
      return result
    }
  }

  wrap(process, 'nextTick', activatorFirst)

  var asynchronizers = [
    'setTimeout',
    'setInterval'
  ]
  if (global.setImmediate) asynchronizers.push('setImmediate')

  var timers = require('timers')
  var patchGlobalTimers = global.setTimeout === timers.setTimeout

  massWrap(
    timers,
    asynchronizers,
    activatorFirst
  )

  if (patchGlobalTimers) {
    massWrap(
      global,
      asynchronizers,
      activatorFirst
    )
  }

  var instrumentPromise = isNative(global.Promise)

  /*
   * Native promises use the microtask queue to make all callbacks run
   * asynchronously to avoid Zalgo issues. Since the microtask queue is not
   * exposed externally, promises need to be modified in a fairly invasive and
   * complex way.
   *
   * The async boundary in promises that must be patched is between the
   * fulfillment of the promise and the execution of any callback that is waiting
   * for that fulfillment to happen. This means that we need to trigger a create
   * when accept or reject is called and trigger before, after and error handlers
   * around the callback execution. There may be multiple callbacks for each
   * fulfilled promise, so handlers will behave similar to setInterval where
   * there may be multiple before after and error calls for each create call.
   *
   * async-listener monkeypatching has one basic entry point: `wrapCallback`.
   * `wrapCallback` should be called when create should be triggered and be
   * passed a function to wrap, which will execute the body of the async work.
   * The accept and reject calls can be modified fairly easily to call
   * `wrapCallback`, but at the time of accept and reject all the work to be done
   * on fulfillment may not be defined, since a call to then, chain or fetch can
   * be made even after the promise has been fulfilled. To get around this, we
   * create a placeholder function which will call a function passed into it,
   * since the call to the main work is being made from within the wrapped
   * function, async-listener will work correctly.
   *
   * There is another complication with monkeypatching Promises. Calls to then,
   * chain and catch each create new Promises that are fulfilled internally in
   * different ways depending on the return value of the callback. When the
   * callback return a Promise, the new Promise is resolved asynchronously after
   * the returned Promise has been also been resolved. When something other than
   * a promise is resolved the accept call for the new Promise is put in the
   * microtask queue and asynchronously resolved.
   *
   * Then must be wrapped so that its returned promise has a wrapper that can be
   * used to invoke further continuations. This wrapper cannot be created until
   * after the callback has run, since the callback may return either a promise
   * or another value. Fortunately we already have a wrapper function around the
   * callback we can use (the wrapper created by accept or reject).
   *
   * By adding an additional argument to this wrapper, we can pass in the
   * returned promise so it can have its own wrapper appended. the wrapper
   * function can the call the callback, and take action based on the return
   * value. If a promise is returned, the new Promise can proxy the returned
   * Promise's wrapper (this wrapper may not exist yet, but will by the time the
   * wrapper needs to be invoked). Otherwise, a new wrapper can be create the
   * same way as in accept and reject. Since this wrapper is created
   * synchronously within another wrapper, it will properly appear as a
   * continuation from within the callback.
   */

  if (instrumentPromise) {
    wrapPromise()
  }

  function wrapPromise () {
    var Promise = global.Promise

    function wrappedPromise (executor) {
      if (!(this instanceof wrappedPromise)) {
        return Promise(executor)
      }

      if (typeof executor !== 'function') {
        return new Promise(executor)
      }

      var context, args
      var promise = new Promise(wrappedExecutor)
      promise.__proto__ = wrappedPromise.prototype // eslint-disable-line no-proto

      try {
        executor.apply(context, args)
      } catch (err) {
        args[1](err)
      }

      return promise

      function wrappedExecutor (accept, reject) {
        context = this
        args = [wrappedAccept, wrappedReject]

        // These wrappers create a function that can be passed a function and an argument to
        // call as a continuation from the accept or reject.
        function wrappedAccept (val) {
          ensureAslWrapper(promise, false)
          return accept(val)
        }

        function wrappedReject (val) {
          ensureAslWrapper(promise, false)
          return reject(val)
        }
      }
    }

    util.inherits(wrappedPromise, Promise)

    wrap(Promise.prototype, 'then', wrapThen)
    wrap(Promise.prototype, 'chain', wrapThen)

    var PromiseMethods = ['accept', 'all', 'defer', 'race', 'reject', 'resolve']

    PromiseMethods.forEach(function (key) {
      wrappedPromise[key] = Promise[key]
    })

    global.Promise = wrappedPromise

    function ensureAslWrapper (promise) {
      if (!promise.__asl_wrapper) {
        promise.__asl_wrapper = wrapCallback(propagateAslWrapper)
      }
    }

    function propagateAslWrapper (ctx, fn, result, next) {
      var nextResult
      try {
        nextResult = fn.call(ctx, result)
        return {nextResult: nextResult, error: false}
      } catch (err) {
        return {errorVal: err, error: true}
      } finally {
        // Wrap any resulting futures as continuations.
        if (nextResult instanceof Promise) {
          next.__asl_wrapper = function proxyWrapper () {
            var aslWrapper = nextResult.__asl_wrapper || propagateAslWrapper
            return aslWrapper.apply(this, arguments)
          }
        } else {
          ensureAslWrapper(next, true)
        }
      }
    }

    function wrapThen (original) {
      return function wrappedThen () {
        var promise = this
        var next = original.apply(promise, Array.prototype.map.call(arguments, bind))

        next.__asl_wrapper = function proxyWrapper (ctx, fn, val, last) {
          if (promise.__asl_wrapper) {
            promise.__asl_wrapper(ctx, function () {}, null, next)
            return next.__asl_wrapper(ctx, fn, val, last)
          }
          return propagateAslWrapper(ctx, fn, val, last)
        }

        return next

        // wrap callbacks (success, error) so that the callbacks will be called as a
        // continuations of the accept or reject call using the __asl_wrapper created above.
        function bind (fn) {
          if (typeof fn !== 'function') return fn
          return function (val) {
            var result = (promise.__asl_wrapper || propagateAslWrapper)(this, fn, val, next)
            if (result.error) {
              throw result.errorVal
            } else {
              return result.returnVal
            }
          }
        }
      }
    }
  }

  // Shim activator for functions that have callback first
  function activatorFirst (fn) {
    var fallback = function () {
      if (typeof arguments[0] === 'function') {
        arguments[0] = wrapCallback(arguments[0])
      }
      return fn.apply(this, arguments)
    }
    // Preserve function length for small arg count functions.
    switch (fn.length) {
      case 1:
        return function (cb) {
          if (arguments.length !== 1) return fallback.apply(this, arguments)
          if (typeof cb === 'function') cb = wrapCallback(cb)
          return fn.call(this, cb)
        }
      case 2:
        return function (cb, a) {
          if (arguments.length !== 2) return fallback.apply(this, arguments)
          if (typeof cb === 'function') cb = wrapCallback(cb)
          return fn.call(this, cb, a)
        }
      case 3:
        return function (cb, a, b) {
          if (arguments.length !== 3) return fallback.apply(this, arguments)
          if (typeof cb === 'function') cb = wrapCallback(cb)
          return fn.call(this, cb, a, b)
        }
      case 4:
        return function (cb, a, b, c) {
          if (arguments.length !== 4) return fallback.apply(this, arguments)
          if (typeof cb === 'function') cb = wrapCallback(cb)
          return fn.call(this, cb, a, b, c)
        }
      case 5:
        return function (cb, a, b, c, d) {
          if (arguments.length !== 5) return fallback.apply(this, arguments)
          if (typeof cb === 'function') cb = wrapCallback(cb)
          return fn.call(this, cb, a, b, c, d)
        }
      case 6:
        return function (cb, a, b, c, d, e) {
          if (arguments.length !== 6) return fallback.apply(this, arguments)
          if (typeof cb === 'function') cb = wrapCallback(cb)
          return fn.call(this, cb, a, b, c, d, e)
        }
      default:
        return fallback
    }
  }
}


text:
package com.github.themetalone.parking.core.car.heuristic;

import com.github.themetalone.parking.core.slot.ParkingSlot;

import java.util.LinkedList;
import java.util.List;

/**
 * Created by steff on 20.08.2016.
 * Implements the Linear Operator heuristic. Uses a fading memory of the density of occupied spots
 */
public class LinearOperatorHeuristic implements Heuristic<List<Double>> {

    protected double velocity;
    protected double threshold;
    protected double average = 0;
    private int lastDistance = Integer.MAX_VALUE;
    private boolean takeNext = false;
    protected boolean firstCarEncountered = false;

    /**
     * @param velocity double, describes how fast the memory of passed spots fades
     * @param threshold double, >= 0, the density to find befor choosing a spot. Higher values refer higher densities
     */
    public LinearOperatorHeuristic(double velocity, double threshold) {
        this.velocity = velocity;
        this.threshold = threshold;
    }

    /**
     * @param slot the parking spot to be tested
     * @param peek the following parking spot
     * @return true iff the density is at least that of threshold and the current spot is empty and the following is occupied or the condition was already fulfilled at the last spot and the last spot was not occupied, this spot isn't and the next one is or the car is moving away from the destination
     */
    @SuppressWarnings("Duplicates")
    @Override
    public boolean decide(ParkingSlot slot, ParkingSlot peek) {
        if (slot.isOccupied()) {
            firstCarEncountered = true;
        }
        boolean turningPointPassed = slot.getDistance() > lastDistance;
        lastDistance = slot.getDistance();
        if (firstCarEncountered) {
            average = average * velocity + (slot.isOccupied() ? 1 : 0);
        }
        boolean densityFulfilled = average > threshold;
        if (!slot.isOccupied()) {
            if (turningPointPassed || (firstCarEncountered && densityFulfilled && peek.isOccupied()) || (!peek.isOccupied() && takeNext)) {
                return true;
            }
            if (firstCarEncountered && densityFulfilled && !peek.isOccupied()) {
                takeNext = true;
            }
        } else {
            takeNext = false;
        }

        return false;
    }

    @Override
    public Heuristic<List<Double>> copy() {
        return new LinearOperatorHeuristic(velocity, threshold);
    }

    /**
     * @return {@link List}<double> = [velocity, threshold]
     */
    @Override
    public List<Double> getParam() {
        List<Double> result = new LinkedList<>();
        result.add(velocity);
        result.add(threshold);
        return result;
    }

    /**
     * @param param {@link List}<double> = [velocity, threshold]
     */
    @Override
    public void setParam(List<Double> param) {
        if (param.size() < 2) {
            throw new IllegalArgumentException("Not enough parameters");
        }
        this.velocity = param.get(0);
        this.threshold = param.get(1);
    }
}


text:
@extends('layouts.login')
@section('loadCSS')

    <link href="{{ asset('plugins/iCheck/square/blue.css') }}" rel="stylesheet">
@endsection
@section('bodyStart')

    @endsection

    @section('content')
        @if(count($errors) > 0)

                @foreach($errors->all() as $error)
                    {{$error}}
                @endforeach

        @endif

                {{--Admin Login--}}

                {{--
Sign in to start your session
--}}
                @if(Session::has('success'))

                        ×
                        {{Session::get('success')}}

                @endif
                <form action="{{ route('admin.login') }}" method="post" role="form">
                    {{ csrf_field() }}

has('email') ? ' has-error' : '' --}}">
                        <input id="name" name="name" type="text" class="form-control" placeholder="Name"
                               value="{{-- old('email') --}}" required>

                        {{--@if ($errors->has('email'))--}}
                        {{----}}
                        {{--{{ $errors->first('email') }}--}}
                        {{----}}
                        {{--@endif--}}

has('password') ? ' has-error' : '' --}}">
                        <input id="password" name="password" type="password" class="form-control" placeholder="Password"
                               required>

                        {{--@if ($errors->has('password'))--}}
                        {{----}}
                        {{--{{ $errors->first('password') }}--}}
                        {{----}}
                        {{--@endif--}}

                                    <input type="checkbox" name="remember" {{-- old('remember') ? 'checked' : '' --}}>
                                    Запомни ме

                            <button type="submit" class="btn btn-primary btn-block btn-flat">Вход</button>

                    @if(Session::has('fail'))
                        {{--
--}}
                        {{----}}
                        {{--
--}}

                            ×
                            {{Session::get('fail')}}

                    @endif
                    <input type="hidden" name="_token" value="{{Session::token()}}">
                </form>

                {{--
--}}
                {{--
- OR -
--}}
                {{-- Sign in using--}}
                {{--Facebook--}}
                {{-- Sign in using--}}
                {{--Google+--}}
                {{--
--}}
                {{----}}

                {{--I forgot my password
--}}
                {{--Register a new membership--}}

    @endsection

    @section('scripts')

    @endsection

    @section('bodyEnd')

@endsection


text:
include_recipe "mysql::client"

package "mysql-server" do
  action :install
end

service "mysql" do
  supports :status => true, :restart => true, :reload => true
  action :enable
end

if (node[:ec2] && ! FileTest.directory?(node[:mysql_ec2_path]))

  mysql_server_path = ""

  case node[:platform]
  when "ubuntu","debian"
    mysql_server_path = "/var/lib/mysql"
  else
    mysql_server_path = "/var/mysql"
  end

  service "mysql" do
    supports :status => true, :restart => true, :reload => true
    action :stop
  end

  execute "install-mysql" do
    command "mv #{mysql_server_path} #{node[:mysql_ec2_path]}"
    not_if do FileTest.directory?(node[:mysql_ec2_path]) end
  end

  link mysql_server_path do
   to node[:mysql_ec2_path]
  end

  service "mysql" do
    supports :status => true, :restart => true, :reload => true
    action :start
  end

end


text:
/****************************************************************************
 * kernel/errno/errno_getptr.c
 *
 *   Copyright (C) 2007, 2008, 2011, 2014 Gregory Nutt. All rights reserved.
 *   Author: Gregory Nutt <gnutt@nuttx.org>
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 * 3. Neither the name NuttX nor the names of its contributors may be
 *    used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 ****************************************************************************/

/****************************************************************************
 * Included Files
 ****************************************************************************/

#include <tinyara/config.h>
#include <sched.h>
#include <errno.h>
#include <tinyara/arch.h>
#include "sched/sched.h"

/****************************************************************************
 * Pre-processor Definitions
 ****************************************************************************/

#undef get_errno_ptr
#undef errno

/****************************************************************************
 * Private Data
 ****************************************************************************/

/* This is a 'dummy' errno value to use in context where there is no valid
 * errno location to use.  For example, when running from an interrupt handler
 * or early in initialization when task structures have not yet been
 * initialized.
 */

static int g_irqerrno;

/****************************************************************************
 * Public Functions
 ****************************************************************************/

/****************************************************************************
 * Name: get_errno_ptr
 *
 * Description:
 *   Return a pointer to the thread specific errno.
 *
 * Parameters:
 *   None
 *
 * Return Value:
 *   A pointer to the per-thread errno variable.
 *
 * Assumptions:
 *
 ****************************************************************************/

FAR int *get_errno_ptr(void)
{
	/* Check if this function was called from an interrupt handler.  In that
	 * case, we have to do things a little differently to prevent the interrupt
	 * handler from modifying the tasks errno value.
	 */

	if (!up_interrupt_context()) {
		/* We were called from the normal tasking context.  Verify that the
		 * task at the head of the ready-to-run list is actually running.  It
		 * may not be running during very brief times during context switching
		 * logic (see, for example, task_exit.c).
		 *
		 * There is also a corner case early in the initialization sequence:
		 * The ready to run list may not yet be initialized and g_readytorun.head
		 * may be NULL.
		 */

		FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head;
		if (rtcb && rtcb->task_state == TSTATE_TASK_RUNNING) {
			/* Yes.. the task is running normally.  Return a reference to the
			 * thread-private errno in the TCB of the running task.
			 */

			return &rtcb->pterrno;
		}
	}

	/* We were called either from (1) an interrupt handler or (2) from normally
	 * code but in an unhealthy state.  In either event, do not permit access to
	 * the errno in the TCB of the task at the head of the ready-to-run list.
	 * Instead, use a separate errno just for interrupt handlers.  Of course, this
	 * would have to change if we ever wanted to support nested interrupts or if
	 * we really cared about the stability of the errno during those "unhealthy
	 * states."
	 */

	return &g_irqerrno;
}


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

package com.google.security.zynamics.binnavi.Plugins;

import com.google.security.zynamics.binnavi.Log.NaviLogger;
import com.google.security.zynamics.zylib.general.Pair;
import com.google.security.zynamics.zylib.io.FileUtils;
import com.google.security.zynamics.zylib.plugins.FileClassLoader;

import java.io.File;
import java.util.List;

/**
 * Contains code for loading plugins from CLASS files.
 */
public final class ClassPluginLoader {
  /**
   * You are not supposed to instantiate this class.
   */
  private ClassPluginLoader() {
  }

  /**
   * Loads a single class file.
   *
   * @param file The class file to load.
   * @param pluginDirectory The plugin base directory.
   *
   * @return If the class contains an IPlugin object, a new instance of that object. Null,
   *         otherwise.
   *
   * @throws ClassNotFoundException Thrown if the class could not be found by the JVM.
   * @throws InstantiationException Thrown if the class object could not be instantiated.
   * @throws IllegalAccessException ???
   */
  @SuppressWarnings("unchecked")
  private static <T> com.google.security.zynamics.binnavi.api2.plugins.IPlugin<T> loadClassFile(final File file,
      final String pluginDirectory) throws ClassNotFoundException, InstantiationException,
      IllegalAccessException {
    NaviLogger.info("Loading class file %s", file.getAbsolutePath());

    final FileClassLoader loader =
        new FileClassLoader(file.getParentFile().getPath() + System.getProperty("file.separator"));

    // At this point we are trying to determine the fully qualified name of the class
    // depending on what sub-directory of the plugin directory it resides in.
    final String relativePath =
        pluginDirectory.length() == file.getParentFile().getPath().length() ? "" : file
            .getParentFile().getPath().substring(pluginDirectory.length());
    final String classPrefix = relativePath.replaceAll("[/\\\\]", ".");

    final Class<?> cls =
        loader.loadClass(("".equals(classPrefix) ? "" : classPrefix + ".")
            + FileUtils.getFileBasename(file));

    if (com.google.security.zynamics.binnavi.api2.plugins.IPlugin.class.isAssignableFrom(cls)) {
      return (com.google.security.zynamics.binnavi.api2.plugins.IPlugin<T>) cls.newInstance();
    } else {
      return null;
    }
  }

  /**
   * Processes a single class file that potentially contains a plugin.
   *
   * @param directory The plugin base directory.
   * @param pluginFile The class file to load.
   * @param loadedPlugins If the plugin is loaded, the plugin is added to this list.
   * @param failedPlugins If the plugin fails to load, the plugin is added to this list.
   */
  public static <T> void processClassFile(final String directory, final File pluginFile,
      final List<Pair<com.google.security.zynamics.binnavi.api2.plugins.IPlugin<T>, PluginStatus>> loadedPlugins,
      final List<Pair<String, Throwable>> failedPlugins) {
    // ESCA-JAVA0166:
    try {
      final com.google.security.zynamics.binnavi.api2.plugins.IPlugin<T> plugin = loadClassFile(pluginFile, directory);

      if (plugin == null) {
        return;
      }

      loadedPlugins.add(new Pair<com.google.security.zynamics.binnavi.api2.plugins.IPlugin<T>, PluginStatus>(plugin,
          PluginStatus.Valid));
    } catch (final Exception e) {
      // Will be displayed later

      failedPlugins.add(new Pair<String, Throwable>(pluginFile.getAbsolutePath(), e));
    }
  }
}


text:
package taip.social.domain.entity;

/**
 * @author Catalin Manolescu <cc.manolescu@gmail.com>
 */
public enum BookGenre {
}


text:
"""
### Tutorial Documentation
Documentation that goes along with the Airflow tutorial located
[here](http://pythonhosted.org/airflow/tutorial.html)
"""
import airflow
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import timedelta

# these args will get passed on to each operator
# you can override them on a per-task basis during operator initialization
default_args = {
    'owner': 'airflow',
    'depends_on_past': False,
    'start_date': airflow.utils.dates.days_ago(2),
    'email': ['airflow@airflow.com'],
    'email_on_failure': False,
    'email_on_retry': False,
    'retries': 1,
    'retry_delay': timedelta(minutes=5),
    # 'queue': 'bash_queue',
    # 'pool': 'backfill',
    # 'priority_weight': 10,
    # 'end_date': datetime(2016, 1, 1),
    # 'wait_for_downstream': False,
    # 'dag': dag,
    # 'adhoc':False,
    # 'sla': timedelta(hours=2),
    # 'execution_timeout': timedelta(seconds=300),
    # 'on_failure_callback': some_function,
    # 'on_success_callback': some_other_function,
    # 'on_retry_callback': another_function,
    # 'trigger_rule': u'all_success'
}

dag = DAG(
    'tutorial',
    default_args=default_args,
    description='A simple tutorial DAG',
    schedule_interval=timedelta(days=1))

# t1, t2 and t3 are examples of tasks created by instantiating operators
t1 = BashOperator(
    task_id='print_date',
    bash_command='date',
    dag=dag)

t1.doc_md = """\
#### Task Documentation
You can document your task using the attributes `doc_md` (markdown),
`doc` (plain text), `doc_rst`, `doc_json`, `doc_yaml` which gets
rendered in the UI's Task Instance Details page.
![img](http://montcs.bloomu.edu/~bobmon/Semesters/2012-01/491/import%20soul.png)
"""

dag.doc_md = __doc__

t2 = BashOperator(
    task_id='sleep',
    depends_on_past=False,
    bash_command='sleep 5',
    dag=dag)

templated_command = """
{% for i in range(5) %}
    echo "{{ ds }}"
    echo "{{ macros.ds_add(ds, 7)}}"
    echo "{{ params.my_param }}"
{% endfor %}
"""

t3 = BashOperator(
    task_id='templated',
    depends_on_past=False,
    bash_command=templated_command,
    params={'my_param': 'Parameter I passed in'},
    dag=dag)

t2.set_upstream(t1)
t3.set_upstream(t1)


text:
Daybreak instrumentation for NewRelic. Reports time spent inside Daybreak
transactions. Supports `get`, `set`, `update`, and `delete` methods.

## Installing

* Add the gem to your `Gemfile`:

```ruby
source 'https://rubygems.org'
gem 'newrelic-daybreak'
```

## License

MIT license. See LICENSE.

## Author

Warren Guy <warren@guy.net.au>

https://warrenguy.me


text:
lib = File.expand_path('../../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

require 'eot'

eot = Eot.new

p eot.ajd
p eot.ta # set on initializating using ajd
p eot.ma # set on initializating using ajd
# new date used
p ajd = DateTime.new(2000, 1, 1).jd
eot.ajd = ajd
eot.ma_ta_set # this sets the attributes
p ta = eot.ta # now these would be different
p ma = eot.ma # now these would be different
p ta_m = eot.eqc(ma, ta)
p om = eot.omega
p eot.al(ma, ta, om)
p eot.sun_dec(eot.al(ma, ta, om), eot.to_earth)
p eot.eoe(ta)
p eot.ml(ta)
p eot.era
p eot.tl_aries


text:
#ifndef __BASE__ADDR_TEST_UTIL_H__
#define __BASE__ADDR_TEST_UTIL_H__

#include "bgp/l3vpn/inetvpn_address.h"
#include "bgp/inet/inet_route.h"

namespace task_util {

Ip4Prefix Ip4PrefixIncrement(Ip4Prefix prefix, int incr = 1);
InetVpnPrefix InetVpnPrefixIncrement(InetVpnPrefix prefix, int incr = 1);

}

#endif // __ADDR_TEST_UTIL_H__


text:
package org.visallo.core.model.properties.types;

public class ByteArrayVisalloProperty extends IdentityVisalloProperty<byte[]> {
    public ByteArrayVisalloProperty(String key) {
        super(key);
    }
}