text:
#include <boost/static_assert.hpp>

#include "Validator.hh"
#include "ValidSchema.hh"
#include "NodeImpl.hh"

namespace avro {

Validator::Validator(const ValidSchema &schema) :
    schema_(schema),
    nextType_(AVRO_NULL),
    expectedTypesFlag_(0),
    compoundStarted_(false),
    waitingForCount_(false),
    count_(0)
{
    setupOperation(schema_.root());
}

void
Validator::setWaitingForCount()
{
    waitingForCount_ = true;
    count_ = 0;
    expectedTypesFlag_ = typeToFlag(AVRO_INT) | typeToFlag(AVRO_LONG);
    nextType_ = AVRO_LONG;
}

void
Validator::enumAdvance()
{
    if(compoundStarted_) {
        setWaitingForCount();
        compoundStarted_ = false;
    }
    else {
        waitingForCount_ = false;
        compoundStack_.pop_back();
    }
}

bool
Validator::countingSetup()
{
    bool proceed = true;
    if(compoundStarted_) {
        setWaitingForCount();
        compoundStarted_ = false;
        proceed = false;
    }
    else if(waitingForCount_) {
        waitingForCount_ = false;
        if(count_ == 0) {
            compoundStack_.pop_back();
            proceed = false;
        }
        else {
            counters_.push_back(count_);
        }
    }

    return proceed;
}

void
Validator::countingAdvance()
{
    if(countingSetup()) {

        size_t index = (compoundStack_.back().pos)++;
        const NodePtr &node = compoundStack_.back().node;

        if(index < node->leaves() ) {
            setupOperation(node->leafAt(index));
        }
        else {
            compoundStack_.back().pos = 0;
            int count = --counters_.back();
            if(count == 0) {
                counters_.pop_back();
                compoundStarted_ = true;
                nextType_ = node->type();
                expectedTypesFlag_ = typeToFlag(nextType_);
            }
            else {
                size_t index = (compoundStack_.back().pos)++;
                setupOperation(node->leafAt(index));
            }
        }
    }
}

void
Validator::unionAdvance()
{
    if(compoundStarted_) {
        setWaitingForCount();
        compoundStarted_ = false;
    }
    else {
        waitingForCount_ = false;
        NodePtr node = compoundStack_.back().node;

        if(count_ < static_cast<int64_t>(node->leaves())) {
            compoundStack_.pop_back();
            setupOperation(node->leafAt(count_));
        }
        else {
            throw Exception(
                boost::format("Union selection out of range, got %1%," \
                    " expecting 0-%2%")
                    % count_ % (node->leaves() -1)
            );
        }
    }
}

void
Validator::fixedAdvance()
{
    compoundStarted_ = false;
    compoundStack_.pop_back();
}

int
Validator::nextSizeExpected() const
{
    return compoundStack_.back().node->fixedSize();
}

void
Validator::doAdvance()
{
    typedef void (Validator::*AdvanceFunc)();

    // only the compound types need advance functions here
    static const AdvanceFunc funcs[] = {
        0, // string
        0, // bytes
        0, // int
        0, // long
        0, // float
        0, // double
        0, // bool
        0, // null
        &Validator::countingAdvance, // Record is treated like counting with count == 1
        &Validator::enumAdvance,
        &Validator::countingAdvance,
        &Validator::countingAdvance,
        &Validator::unionAdvance,
        &Validator::fixedAdvance
    };
    BOOST_STATIC_ASSERT( (sizeof(funcs)/sizeof(AdvanceFunc)) == (AVRO_NUM_TYPES) );

    expectedTypesFlag_ = 0;
    // loop until we encounter a next expected type, or we've exited all compound types
    while(!expectedTypesFlag_ && !compoundStack_.empty() ) {

        Type type = compoundStack_.back().node->type();

        AdvanceFunc func = funcs[type];

        // only compound functions are put on the status stack so it is ok to
        // assume that func is not null
        assert(func);

        ((this)->*(func))();
    }

    if(compoundStack_.empty()) {
        nextType_ = AVRO_NULL;
    }
}

void Validator::advance()
{
    if(!waitingForCount_) {
        doAdvance();
    }
}

void
Validator::setCount(int64_t count)
{
    if(!waitingForCount_) {
        throw Exception("Not expecting count");
    }
    else if(count_ < 0) {
        throw Exception("Count cannot be negative");
    }
    count_ = count;

    doAdvance();
}

void
Validator::setupFlag(Type type)
{
    // use flags instead of strictly types, so that we can be more lax about the type
    // (for example, a long should be able to accept an int type, but not vice versa)
    static const flag_t flags[] = {
        typeToFlag(AVRO_STRING) | typeToFlag(AVRO_BYTES),
        typeToFlag(AVRO_STRING) | typeToFlag(AVRO_BYTES),
        typeToFlag(AVRO_INT),
        typeToFlag(AVRO_INT) | typeToFlag(AVRO_LONG),
        typeToFlag(AVRO_FLOAT),
        typeToFlag(AVRO_DOUBLE),
        typeToFlag(AVRO_BOOL),
        typeToFlag(AVRO_NULL),
        typeToFlag(AVRO_RECORD),
        typeToFlag(AVRO_ENUM),
        typeToFlag(AVRO_ARRAY),
        typeToFlag(AVRO_MAP),
        typeToFlag(AVRO_UNION),
        typeToFlag(AVRO_FIXED)
    };
    BOOST_STATIC_ASSERT( (sizeof(flags)/sizeof(flag_t)) == (AVRO_NUM_TYPES) );

    expectedTypesFlag_ = flags[type];
}

void
Validator::setupOperation(const NodePtr &node)
{
    nextType_ = node->type();

    if(nextType_ == AVRO_SYMBOLIC) {
        NodePtr actualNode = resolveSymbol(node);
        assert(actualNode);
        setupOperation(actualNode);
        return;
    }

    assert(nextType_ < AVRO_SYMBOLIC);

    setupFlag(nextType_);

    if(!isPrimitive(nextType_)) {
        compoundStack_.push_back(CompoundType(node));
        compoundStarted_ = true;
    }
}

bool
Validator::getCurrentRecordName(std::string &name) const
{
    bool found = false;
    name.clear();

    int idx = -1;
    // if the top of the stack is a record I want this record name
    if(!compoundStack_.empty() && (isPrimitive(nextType_) || nextType_ == AVRO_RECORD)) {
        idx = compoundStack_.size() -1;
    }
    else {
        idx = compoundStack_.size() -2;
    }

    if(idx >= 0 && compoundStack_[idx].node->type() == AVRO_RECORD) {
        name = compoundStack_[idx].node->name();
        found = true;
    }
    return found;
}

bool
Validator::getNextFieldName(std::string &name) const
{
    bool found = false;
    name.clear();
    int idx = isCompound(nextType_) ? compoundStack_.size()-2 : compoundStack_.size()-1;
    if(idx >= 0 && compoundStack_[idx].node->type() == AVRO_RECORD) {
        size_t pos = compoundStack_[idx].pos-1;
        const NodePtr &node = compoundStack_[idx].node;
        if(pos < node->leaves()) {
            name = node->nameAt(pos);
            found = true;
        }
    }
    return found;
}

} // namespace avro


text:
<resources>
    <attr name="config_name" format="string" />
    <attr name="file_name" format="string" />
	<declare-styleable name="BitFragment">
		<attr name="config_name" />
	</declare-styleable>
	<declare-styleable name="DrawerFragment">
		<attr name="file_name" />
	</declare-styleable>
</resources>

redpajama_set_name: RedPajamaGithub


text:
jQuery.noConflict();
(function($,PLUGIN_ID){
	"use strict";
	/*---------------------------------------------------------------
	 valiable
	---------------------------------------------------------------*/
	var vars={
		calendar:null,
		fields:[],
		fieldinfos:{}
	};
	var events={
		show:[
			'app.record.create.show',
			'app.record.edit.show'
		]
	};
	var limit=500;
	var functions={
		/* append buttons */
		appendbuttons:function(fieldcode){
			$.each($('body').fields(fieldcode),function(){
				var target=$(this).addClass('multicalendar');
				if ($.data(target[0],'multicalendar-added')==null) $.data(target[0],'multicalendar-added',false);
				if ($.data(target[0],'multicalendar-added')) return true;
				var buttons={
					calendar:$('<button class="customoperation-button calendar">').on('click',function(){
						var target=$(this);
						vars.calendar.show({
							activedates:target.closest('div').find('.multicalendar').val().split(','),
							buttons:{
								ok:function(selection){
									target.closest('div').find('.multicalendar').val(selection.join(','));
									/* close calendar */
									vars.calendar.hide();
								},
								cancel:function(){
									/* close calendar */
									vars.calendar.hide();
								}
							}
						});
					}),
					clear:$('<button class="customoperation-button clear">').on('click',function(){
						$(this).closest('div').find('.multicalendar').val('');
					})
				}
				/* adjust button size */
				var height=target.outerHeight(false);
				$.each(buttons,function(key,values){
					if (height-30>0)
					{
						values.css({
							'margin':((height-30)/2).toString()+'px',
							'min-height':'30px',
							'min-width':'30px'
						});
					}
					else
					{
						values.css({
							'background-size':height.toString()+'px '+height.toString()+'px',
							'margin':'0px',
							'min-height':height.toString()+'px',
							'min-width':height.toString()+'px'
						});
					}
				})
				target.closest('div').append(buttons.calendar).append(buttons.clear);
				target.css({'padding-right':(buttons.calendar.outerWidth(true)+buttons.clear.outerWidth(true)).toString()+'px'});
				buttons.calendar.css({'right':buttons.clear.outerWidth(true).toString()+'px'});
				$.data(target[0],'multicalendar-added',true);
			});
		},
		/* get field sorted index */
		fieldsort:function(layout){
			var codes=[];
			$.each(layout,function(index,values){
				switch (values.type)
				{
					case 'ROW':
						$.each(values.fields,function(index,values){
							/* exclude spacer */
							if (!values.elementId) codes.push(values.code);
						});
						break;
					case 'GROUP':
						$.merge(codes,functions.fieldsort(values.layout));
						break;
					case 'SUBTABLE':
						$.each(values.fields,function(index,values){
							/* exclude spacer */
							if (!values.elementId) codes.push(values.code);
						});
						break;
				}
			});
			return codes;
		},
	};
	/*---------------------------------------------------------------
	 kintone events
	---------------------------------------------------------------*/
	kintone.events.on(events.show,function(event){
		vars.config=kintone.plugin.app.getConfig(PLUGIN_ID);
		if (!vars.config) return false;
		/* day pickup button */
		vars.calendar=$('body').calendar({
			multi:true,
			span:vars.config['span']
		});
		/* get layout */
		kintone.api(kintone.api.url('/k/v1/app/form/layout',true),'GET',{app:kintone.app.getId()},function(resp){
			var sorted=functions.fieldsort(resp.layout);
			/* get fieldinfo */
			kintone.api(kintone.api.url('/k/v1/app/form/fields',true),'GET',{app:kintone.app.getId()},function(resp){
				vars.fields=vars.config['field'].split(',');
				vars.fieldinfos=$.fieldparallelize(resp.properties);
				$.each(sorted,function(index){
					if ($.inArray(sorted[index],vars.fields)>-1 && (sorted[index] in vars.fieldinfos))
					{
						var fieldinfo=vars.fieldinfos[sorted[index]];
						/* append buttons */
						functions.appendbuttons(fieldinfo.code);
						if (fieldinfo.tablecode.length!=0)
						{
							var events=[];
							events.push('app.record.create.change.'+fieldinfo.tablecode);
							events.push('app.record.edit.change.'+fieldinfo.tablecode);
							kintone.events.on(events,function(event){
								functions.appendbuttons(fieldinfo.code);
								return event;
							});
						}
					}
				});
			},function(error){});
		},function(error){});
		return event;
	});
})(jQuery,kintone.$PLUGIN_ID);


text:
"""
fits2hdf.py
@author Cassandra Henderson
cassandra.s.henderson@gmail.com

Program Description:
    Turns a fits file into an HDF file.

Inputs for this correlation astronomy code are all in HDF objects, so a user
might want to use this to convert their files over.

Currently, loads the entire fits file into memory to do this, which is very
memory inefficient, but unfortunately astropy doesn't effectively chunk tables,
so until I implement pyfits this will have to do.
"""

import os
import numpy    as np
import pandas   as pd
import warnings
from astropy.io import fits

def fits_to_hdf(path, new_path, overwrite=False):
    """
    Take a fits file and use astropy to retrieve the data. Save the data in
    an hdf5 table file.

    performance: low (astropy.io.fits memory limited)

    @params
        path
            Path to get the fits file from
        new_path
            Path to save the hdf5 table to
        overwrite=False
            If false, raise an error if something is already at new_path
    """
    if overwrite == False and os.path.isfile(new_path):
        raise IOError("Overwrite = False but there is a file at " + new_path)

    f = fits.open(path)
    dat = f[1].data
    names = f[1].columns.names
    types = [f[1].columns.dtype[i] for i in range(len(names))]

    shapes = [len(np.shape(types[i])) for i in range(len(names))]
    not_list_columns = np.where(np.less(shapes, 1))[0]

    if len(not_list_columns) == len(names):
        frame = pd.DataFrame(data = dat)
        frame.to_hdf(new_path, key="primary", format="table")
    else:
        dropped_names = [names[i] for i in np.where(np.greater(shapes,0))[0]]
        warnings.warn(path + " has lists stored in columns " +
                      str(dropped_names) + ", which will be dropped.")
        dct = {}
        for i in not_list_columns:
            dct[names[i]] = dat[names[i]]
        frame = pd.DataFrame.from_dict(dct)
        frame.to_hdf(new_path, key="primary",format="table")


text:
<?php
declare(strict_types=1);

namespace ManaPHP\Filters;

use ManaPHP\Exception\AbortException;
use ManaPHP\Http\Filter;
use ManaPHP\Http\Filter\BeginFilterInterface;

/**
 * @property-read \ManaPHP\ConfigInterface        $config
 * @property-read \ManaPHP\Http\RequestInterface  $request
 * @property-read \ManaPHP\Http\ResponseInterface $response
 */
class CorsFilter extends Filter implements BeginFilterInterface
{
    protected int $max_age;
    protected ?string $origin;
    protected bool $credentials;

    public function __construct(int $max_age = 86400, ?string $origin = null, bool $credentials = true)
    {
        $this->max_age = $max_age;
        $this->origin = $origin;
        $this->credentials = $credentials;
    }

    public function onBegin(): void
    {
        $origin = $this->request->getServer('HTTP_ORIGIN');
        $host = $this->request->getServer('HTTP_HOST');

        if ($origin !== '' && $origin !== $host) {
            if ($this->origin) {
                $allow_origin = $this->origin;
            } elseif ($this->config->get('env') === 'prod') {
                $origin_pos = strpos($origin, '.');
                $host_pos = strpos($host, '.');

                if (($origin_pos !== false && $host_pos !== false)
                    && substr($origin, $origin_pos) === substr($host, $host_pos)
                ) {
                    $allow_origin = $origin;
                } else {
                    $allow_origin = '*';
                }
            } else {
                $allow_origin = $origin;
            }

            $allow_headers = 'Origin, Accept, Authorization, Content-Type, X-Requested-With';
            $allow_methods = 'HEAD,GET,POST,PUT,DELETE';
            $this->response
                ->setHeader('Access-Control-Allow-Origin', $allow_origin)
                ->setHeader('Access-Control-Allow-Credentials', $this->credentials ? 'true' : 'false')
                ->setHeader('Access-Control-Allow-Headers', $allow_headers)
                ->setHeader('Access-Control-Allow-Methods', $allow_methods)
                ->setHeader('Access-Control-Max-Age', (string)$this->max_age);
        }

        if ($this->request->isOptions()) {
            throw new AbortException();
        }
    }
}


text: """Tests for all the service components."""


text:
import * as React from 'react'
import KB2 from '../../util/electron.desktop'

const {makeRenderer, closeRenderer} = KB2.functions

export type UseBrowserOptions = {
  windowOpts: {
    hasShadow?: boolean
    height: number
    transparent?: boolean
    width: number
  }
  windowPositionBottomRight?: true
  windowComponent?: string // undefined to kill the browserwindow
  windowTitle: string
  windowParam?: string
}

function useBrowserWindow(options: UseBrowserOptions) {
  const {windowOpts, windowComponent, windowParam, windowPositionBottomRight} = options
  React.useEffect(() => {
    if (windowComponent) {
      makeRenderer?.({
        windowComponent,
        windowOpts,
        windowParam,
        windowPositionBottomRight,
      })
    }
    return () => {
      closeRenderer?.({windowComponent, windowParam})
    }
  }, [windowComponent, windowParam, windowOpts, windowPositionBottomRight])
}

export default useBrowserWindow


text:
<!DOCTYPE HTML>

    <title>PhoneGap</title>
    <meta name="viewport" content="width=device-width, user-scalable=no">
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <meta http-equiv="Content-Security-Policy" content="default-src * data:; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'">

    <link rel="stylesheet" type="text/css" href="components/loader.css">

    <link rel="stylesheet" href="phonegap-demo/master.css" type="text/css" media="screen" title="no title">

Welcome to Cordova!

this file is located at phonegap-demo.html

Platform:   ,   Version:

UUID:   ,   Name:

Width:   ,   Height:
                   , Color Depth:

X:

Y:

Z:

    Toggle Accelerometer
    Get Location
    Call 411
    Vibrate
    Get a Picture
    Get Phone's Contacts
    Check Network

Compass Heading:

Off

    Toggle Compass


text:
cask 'exodus' do
  version '19.3.31'
  sha256 'be295402ce35ffab0ec718945daef21f0c537f2f705b1fb00a0bdbbe7b313223'

  # exodusbin.azureedge.net was verified as official when first introduced to the cask
  url "https://exodusbin.azureedge.net/releases/exodus-macos-#{version}.dmg"
  appcast 'https://www.exodus.io/releases/'
  name 'Exodus'
  homepage 'https://www.exodus.io/'

  auto_updates true

  app 'Exodus.app'

  zap trash: [
               '~/Library/Application Support/Exodus',
               '~/Library/Preferences/com.electron.exodus.helper.plist',
               '~/Library/Preferences/com.electron.exodus.plist',
               '~/Library/Saved Application State/com.electron.exodus.savedState',
             ]
end


text:
namespace base {
class DictionaryValue;
class ListValue;
}

class GURL;
class PluginInstaller;

class PluginFinder {
 public:
  typedef base::Callback<void(PluginInstaller*)> FindPluginCallback;

  static PluginFinder* GetInstance();

  // Loads the plug-in information from the browser resources and parses it.
  // Returns NULL if the plug-in list couldn't be parsed.
  static scoped_ptr<base::ListValue> LoadPluginList();

  // Finds a plug-in for the given MIME type and language (specified as an IETF
  // language tag, i.e. en-US) and calls the callback with the PluginInstaller
  // for the plug-in, or NULL if no plug-in is found.
  void FindPlugin(const std::string& mime_type,
                  const std::string& language,
                  const FindPluginCallback& callback);

  // Finds the plug-in with the given identifier and calls the callback.
  void FindPluginWithIdentifier(const std::string& identifier,
                                const FindPluginCallback& callback);

 private:
  friend struct DefaultSingletonTraits<PluginFinder>;

  PluginFinder();
  ~PluginFinder();

  static base::ListValue* LoadPluginListInternal();

  PluginInstaller* CreateInstaller(const std::string& identifier,
                                   const base::DictionaryValue* plugin_dict);
  PluginInstaller* FindPluginInternal(const std::string& mime_type,
                                      const std::string& language);

  scoped_ptr<base::ListValue> plugin_list_;
  std::map<std::string, PluginInstaller*> installers_;

  DISALLOW_COPY_AND_ASSIGN(PluginFinder);
};

#endif  // CHROME_BROWSER_PLUGIN_FINDER_H_


text:
package com.sfs.jbtimporter;

/**
 * The Class JBTException.
 *
 * @author David Harrison
 * 11th May 2010
 */
public class JBTException extends Exception {

    /** The unique serial version id for the class. */
    private static final long serialVersionUID = -3871420844558129915L;

    /**
     * Constructs an instance of JBTException
     * with the specified detail message.
     *
     * @param msg the detail message.
     */
    public JBTException(final String msg) {
        super(msg);
    }
}


text:
DixiecoinAmountField::DixiecoinAmountField(QWidget *parent):
        QWidget(parent), amount(0), currentUnit(-1)
{
    amount = new QDoubleSpinBox(this);
    amount->setLocale(QLocale::c());
    amount->setDecimals(8);
    amount->installEventFilter(this);
    amount->setMaximumWidth(170);
    amount->setSingleStep(0.001);

    QHBoxLayout *layout = new QHBoxLayout(this);
    layout->addWidget(amount);
    unit = new QValueComboBox(this);
    unit->setModel(new DixiecoinUnits(this));
    layout->addWidget(unit);
    layout->addStretch(1);
    layout->setContentsMargins(0,0,0,0);

    setLayout(layout);

    setFocusPolicy(Qt::TabFocus);
    setFocusProxy(amount);

    // If one if the widgets changes, the combined content changes as well
    connect(amount, SIGNAL(valueChanged(QString)), this, SIGNAL(textChanged()));
    connect(unit, SIGNAL(currentIndexChanged(int)), this, SLOT(unitChanged(int)));

    // Set default based on configuration
    unitChanged(unit->currentIndex());
}

void DixiecoinAmountField::setText(const QString &text)
{
    if (text.isEmpty())
        amount->clear();
    else
        amount->setValue(text.toDouble());
}

void DixiecoinAmountField::clear()
{
    amount->clear();
    unit->setCurrentIndex(0);
}

bool DixiecoinAmountField::validate()
{
    mpq value = 0; bool valid = false;
    if (DixiecoinUnits::parse(currentUnit, text(), &value) && MoneyRange(value))
        valid = true;

    setValid(valid);

    return valid;
}

void DixiecoinAmountField::setValid(bool valid)
{
    if (valid)
        amount->setStyleSheet("");
    else
        amount->setStyleSheet(STYLE_INVALID);
}

QString DixiecoinAmountField::text() const
{
    if (amount->text().isEmpty())
        return QString();
    else
        return amount->text();
}

bool DixiecoinAmountField::eventFilter(QObject *object, QEvent *event)
{
    if (event->type() == QEvent::FocusIn)
    {
        // Clear invalid flag on focus
        setValid(true);
    }
    else if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease)
    {
        QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
        if (keyEvent->key() == Qt::Key_Comma)
        {
            // Translate a comma into a period
            QKeyEvent periodKeyEvent(event->type(), Qt::Key_Period, keyEvent->modifiers(), ".", keyEvent->isAutoRepeat(), keyEvent->count());
            qApp->sendEvent(object, &periodKeyEvent);
            return true;
        }
    }
    return QWidget::eventFilter(object, event);
}

QWidget *DixiecoinAmountField::setupTabChain(QWidget *prev)
{
    QWidget::setTabOrder(prev, amount);
    return amount;
}

qint64 DixiecoinAmountField::value(bool *valid_out) const
{
    mpq qValue = valueAsMpq(valid_out);
    mpz zValue = qValue.get_num() / qValue.get_den();
    return mpz_to_i64(zValue);
}

void DixiecoinAmountField::setValue(qint64 value)
{
    setValue(i64_to_mpq(value));
}

mpq DixiecoinAmountField::valueAsMpq(bool *valid_out) const
{
    mpq val_out = 0;
    bool valid = DixiecoinUnits::parse(currentUnit, text(), &val_out);
    if(valid_out)
    {
        *valid_out = valid;
    }
    return val_out;
}

void DixiecoinAmountField::setValue(const mpq& value)
{
    setText(DixiecoinUnits::format(currentUnit, RoundAbsolute(value, ROUND_TOWARDS_ZERO)));
}

void DixiecoinAmountField::unitChanged(int idx)
{
    // Use description tooltip for current unit for the combobox
    unit->setToolTip(unit->itemData(idx, Qt::ToolTipRole).toString());

    // Determine new unit ID
    int newUnit = unit->itemData(idx, DixiecoinUnits::UnitRole).toInt();

    // Parse current value and convert to new unit
    bool valid = false;
    mpq currentValue = valueAsMpq(&valid);

    currentUnit = newUnit;

    // Set max length after retrieving the value, to prevent truncation
    amount->setDecimals(DixiecoinUnits::decimals(currentUnit));
    amount->setMaximum(qPow(10, DixiecoinUnits::amountDigits(currentUnit)) - qPow(10, -amount->decimals()));

    if(DixiecoinUnits::decimals(currentUnit)<3)
        amount->setSingleStep(0.01);
    else
        amount->setSingleStep(0.001);

    if(valid)
    {
        // If value was valid, re-place it in the widget with the new unit
        setValue(currentValue);
    }
    else
    {
        // If current value is invalid, just clear field
        setText("");
    }
    setValid(true);
}

void DixiecoinAmountField::setDisplayUnit(int newUnit)
{
    unit->setValue(newUnit);
}


text:
package tk.fmmc.nose.main;

import net.minecraft.client.Minecraft;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;

public class ServerProxy extends CommonProxy {

	@Override
	void preInit(FMLPreInitializationEvent e) throws Exception {
		super.preInit(e);
	}

	@Override
	void init(FMLInitializationEvent e) {
		super.init(e);
		MinecraftForge.EVENT_BUS.register(new ServerTickHandler());
	}

	@Override
	void postInit(FMLPostInitializationEvent e) throws Exception {
		super.postInit(e);
	}

}


text:
#ifndef ICMPTUNNEL_CLIENT_H
#define ICMPTUNNEL_CLIENT_H

struct options;

/* run the client. */
int client(const char *hostname, struct options *options);

#endif


text:
<? namespace Matura\Tests;

require('vendor/autoload.php');
require('day/9.php');

use AoC\Day;

describe('AoC Day 9', function($ctx) {
    $ctx->tests = array(
        "London to Dublin = 464\nLondon to Belfast = 518\nDublin to Belfast = 141\n"
        => array(605, null)
    );

    before(function($ctx) {
        $ctx->Day = new Day();
    });

    foreach (array_keys($ctx->tests) as $case) {
        $expected = $ctx->tests[$case];
        it('should correctly solve "' . $case . '"',
           function($ctx) use ($case, $expected) {
               expect($ctx->Day->solve($case))->to->equal($expected);
           });
    };
});
?>


text:
/**
 * 路由识别
 * @type {Object}
 */
var Dispatcher = module.exports = Class(function(){
  'use strict';
  return {
    /**
     * 初始化
     * @param  {[type]} http [description]
     * @return {[type]}      [description]
     */
    init: function(http){
      this.http = http;
    },
    /**
     * 准备pathanem
     * @return {[type]} [description]
     */
    preparePathName: function(){
      var pathname = Dispatcher.splitPathName(this.http.pathname).join('/');
      //去除pathname前缀
      var prefix = C('url_pathname_prefix');
      if (prefix && pathname.indexOf(prefix) === 0) {
        pathname = pathname.substr(prefix.length);
      }
      //判断URL后缀
      var suffix = C('url_pathname_suffix');
      if (suffix && pathname.substr(0 - suffix.length) === suffix) {
        pathname = pathname.substr(0, pathname.length - suffix.length);
      }
      this.http.pathname = pathname;
    },
    /**
     * 解析pathname
     * @return {[type]} [description]
     */
    parsePathName: function(){
      if (this.http.group) {
        return true;
      }
      var paths = Dispatcher.splitPathName(this.http.pathname);
      //将group list变为小写
      var groupList = C('app_group_list');
      var group = '';
      if (groupList.length && paths[0] && groupList.indexOf(paths[0].toLowerCase()) > -1) {
        group = paths.shift();
      }
      var controller = paths.shift();
      var action = paths.shift();
      //解析剩余path的参数
      if (paths.length) {
        for(var i = 0,length = Math.ceil(paths.length) / 2; i < length; i++){
          this.http.get[paths[i * 2]] = paths[i * 2 + 1] || '';
        }
      }
      this.http.group = Dispatcher.getGroup(group);
      this.http.controller = Dispatcher.getController(controller);
      this.http.action = Dispatcher.getAction(action);
    },
    /**
     * run
     * @return {[type]} [description]
     */
    run: function(){
      var self = this;
      return tag('resource_check', this.http).then(function(){
        return self.preparePathName();
      }).then(function(){
        return tag('path_info', self.http);
      }).then(function(){
        return tag('route_check', self.http);
      }).then(function(){
        return self.parsePathName();
      });
    }
  };
});
/**
 * 分割pathname
 * @param  {[type]} pathname [description]
 * @return {[type]}          [description]
 */
Dispatcher.splitPathName = function(pathname){
  'use strict';
  var ret = [];
  var j = 0;
  pathname = pathname.split('/');
  for(var i = 0, length = pathname.length, item; i < length; i++){
    item = pathname[i].trim();
    if (item) {
      ret[j++] = item;
    }
  }
  return ret;
}
/**
 * 获取group
 * @param  {[type]} group [description]
 * @return {[type]}       [description]
 */
Dispatcher.getGroup = function(group){
  'use strict';
  group = group || C('default_group');
  return ucfirst(group);
};

/**
 * 检测Controller和Action是否合法的正则
 * @type {RegExp}
 */
var nameReg = /^[A-Za-z\_]\w*$/;
/**
 * 获取controller
 * @param  {[type]} controller [description]
 * @return {[type]}            [description]
 */
Dispatcher.getController = function(controller){
  'use strict';
  if (!controller) {
    return ucfirst(C('default_controller'));
  }else if (!nameReg.test(controller)) {
    return '';
  }
  return ucfirst(controller);
};
/**
 * 获取action
 * @param  {[type]} action [description]
 * @return {[type]}        [description]
 */
Dispatcher.getAction = function(action){
  'use strict';
  if (!action) {
    return C('default_action');
  }else if (!nameReg.test(action)) {
    return '';
  }
  return action;
};


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Etuville - L'Utcéenne</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="generator" content="Mobirise v2.11.1, mobirise.com">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="shortcut icon" href="images/favicon.png">
	<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:700,400&subset=cyrillic,latin,greek,vietnamese">
	<link rel="stylesheet" href="assets/animate.css/animate.min.css">
	<link rel="stylesheet" href="assets/mobirise/css/style.css">
	<link rel="stylesheet" href="assets/mobirise-gallery/style.css">
	<link rel="stylesheet" href="assets/mobirise-slider/style.css">
	<link rel="stylesheet" href="assets/mobirise/css/mbr-additional.css" type="text/css">
	<link rel="stylesheet" media="screen" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,700">
	<link rel="stylesheet" href="css/bootstrap.min.css">
	<link rel="stylesheet" href="css/font-awesome.min.css">
	<link rel="stylesheet" href="css/style.css">

	<?php include('header.php');?>

	<?php include('logo_header.php');?>

			<?php include('utceenne_pres.php');?>

<?php
require_once('connexionBDD.php');

$requete = $pdo->prepare('SELECT id,date,video, titre, contenu_long FROM 2016_articles WHERE page="u" ORDER BY date DESC LIMIT 5');
$requete->execute();
?>

<?php
while($donnees = $requete->fetchObject()) {
?>
				<a name = <?php echo $donnees->titre; ?>

<?php echo $donnees->titre; ?>

						<?php echo $donnees->contenu_long; ?>

											<iframe class="embed-responsive-item" src="<?php echo $donnees->video ?>">

<?php
}
?>

	                        Previous

	                        Next

	                        Close

	<?include('copyright.php');?>


text:
(function() {
  'use strict';

  angular.module('blocks.recursion')
    .factory('RecursionHelper', RecursionHelperFactory);

  /** @ngInject */
  function RecursionHelperFactory($compile) {
    var service = {
      compile: compile
    };

    return service;

    /**
     * Manually compiles the element, fixing the recursion loop.
     * @param element
     * @param [link] A post-link function, or an object with function(s) registered via pre and post properties.
     * @returns object An object containing the linking functions.
     */
    function compile(element, link) {
      // Break the recursion loop by removing the contents
      var contents = element.contents().remove();
      var compiledContents;

      // Normalize the link parameter
      if (angular.isFunction(link)) {
        link = {post: link};
      }

      return {
        pre: (link && link.pre) ? link.pre : null,
        post: post
      };

      /**
       * Compiles and re-adds the contents
       */
      function post(scope, element) {
        // Compile the contents
        if (!compiledContents) {
          compiledContents = $compile(contents);
        }
        // Re-add the compiled contents to the element
        compiledContents(scope, function(clone) {
          element.append(clone);
        });

        // Call the post-linking function, if any
        if (link && link.post) {
          link.post.apply(null, arguments);
        }
      }
    }
  }
})();


text:
<template name="geoHaystackSearch">

        {{_ "x_axis"}}

            <input id="inputXAxis" min="0" required="true" type="number" class="form-control">

        {{_ "y_axis"}}

            <input id="inputYAxis" min="0" required="true" type="number" class="form-control">

        {{_ "options"}}

            <select id="cmbGeoHaystackSearchOptions"
                    data-placeholder="{{_ "select_options"}}"
                    multiple="true"
                    class="chosen-select form-control"
                    tabindex="-1">
            </select>

    {{> geoHaystackSearchOptions}}
</template>


text:
import sys
import unittest
import StringIO
import atexit
from test import test_support

class TestCase(unittest.TestCase):
    def test_args(self):
        # be sure args are handled properly
        s = StringIO.StringIO()
        sys.stdout = sys.stderr = s
        save_handlers = atexit._exithandlers
        atexit._exithandlers = []
        try:
            atexit.register(self.h1)
            atexit.register(self.h4)
            atexit.register(self.h4, 4, kw="abc")
            atexit._run_exitfuncs()
        finally:
            sys.stdout = sys.__stdout__
            sys.stderr = sys.__stderr__
            atexit._exithandlers = save_handlers
        self.assertEqual(s.getvalue(), "h4 (4,) {'kw': 'abc'}\nh4 () {}\nh1\n")

    def test_badargs(self):
        s = StringIO.StringIO()
        sys.stdout = sys.stderr = s
        save_handlers = atexit._exithandlers
        atexit._exithandlers = []
        try:
            atexit.register(lambda: 1, 0, 0, (x for x in (1,2)), 0, 0)
            self.assertRaises(TypeError, atexit._run_exitfuncs)
        finally:
            sys.stdout = sys.__stdout__
            sys.stderr = sys.__stderr__
            atexit._exithandlers = save_handlers

    def test_order(self):
        # be sure handlers are executed in reverse order
        s = StringIO.StringIO()
        sys.stdout = sys.stderr = s
        save_handlers = atexit._exithandlers
        atexit._exithandlers = []
        try:
            atexit.register(self.h1)
            atexit.register(self.h2)
            atexit.register(self.h3)
            atexit._run_exitfuncs()
        finally:
            sys.stdout = sys.__stdout__
            sys.stderr = sys.__stderr__
            atexit._exithandlers = save_handlers
        self.assertEqual(s.getvalue(), "h3\nh2\nh1\n")

    def test_sys_override(self):
        # be sure a preset sys.exitfunc is handled properly
        save_handlers = atexit._exithandlers
        atexit._exithandlers = []
        exfunc = sys.exitfunc
        sys.exitfunc = self.h1
        reload(atexit)
        s = StringIO.StringIO()
        sys.stdout = sys.stderr = s
        try:
            atexit.register(self.h2)
            atexit._run_exitfuncs()
        finally:
            sys.stdout = sys.__stdout__
            sys.stderr = sys.__stderr__
            atexit._exithandlers = save_handlers
            sys.exitfunc = exfunc
        self.assertEqual(s.getvalue(), "h2\nh1\n")

    def test_raise(self):
        # be sure raises are handled properly
        s = StringIO.StringIO()
        sys.stdout = sys.stderr = s
        save_handlers = atexit._exithandlers
        atexit._exithandlers = []
        try:
            atexit.register(self.raise1)
            atexit.register(self.raise2)
            self.assertRaises(TypeError, atexit._run_exitfuncs)
        finally:
            sys.stdout = sys.__stdout__
            sys.stderr = sys.__stderr__
            atexit._exithandlers = save_handlers

    ### helpers
    def h1(self):
        print "h1"

    def h2(self):
        print "h2"

    def h3(self):
        print "h3"

    def h4(self, *args, **kwargs):
        print "h4", args, kwargs

    def raise1(self):
        raise TypeError

    def raise2(self):
        raise SystemError

def test_main():
    test_support.run_unittest(TestCase)

if __name__ == "__main__":
    test_main()


text:
package com.epam.ta.reportportal.entity.widget.content;

import javax.persistence.Column;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

import static com.epam.ta.reportportal.dao.constant.WidgetContentRepositoryConstants.*;

/**
 * @author Ivan Budaev
 */
public class CriteriaHistoryItem implements Serializable {

	@Column(name = UNIQUE_ID)
	private String uniqueId;

	@Column(name = "name")
	private String name;

	@Column(name = TOTAL)
	private Long total;

	@Column(name = CRITERIA)
	private Long criteria;

	@Column(name = STATUS_HISTORY)
	private Boolean[] status;

	@Column(name = START_TIME_HISTORY)
	private List<Date> startTime;

	public String getUniqueId() {
		return uniqueId;
	}

	public void setUniqueId(String uniqueId) {
		this.uniqueId = uniqueId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Long getTotal() {
		return total;
	}

	public void setTotal(Long total) {
		this.total = total;
	}

	public Long getCriteria() {
		return criteria;
	}

	public void setCriteria(Long criteria) {
		this.criteria = criteria;
	}

	public Boolean[] getStatus() {
		return status;
	}

	public void setStatus(Boolean[] status) {
		this.status = status;
	}

	public List<Date> getStartTime() {
		return startTime;
	}

	public void setStartTime(List<Date> startTime) {
		this.startTime = startTime;
	}
}


text:
FROM chrisfranko/xgo-base

MAINTAINER Christopher Franko <chrisjfranko@gmail.com>

# Configure the root Go distribution and bootstrap based on it
ENV GO_VERSION 1103

RUN \
  export ROOT_DIST=https://storage.googleapis.com/golang/go1.10.3.linux-amd64.tar.gz    && \
  export ROOT_DIST_SHA=fa1b0e45d3b647c252f51f5e1204aba049cde4af177ef9f2181f43004f901035 && \
  \
  $BOOTSTRAP_PURE


text:
module.exports = function(config, lessConfig, pathConfig) {
  'use strict';
  var resolve = require('path').resolve;

  var file = {};
  file[pathConfig.buildTarget+'/styles/styles.css'] = pathConfig.sourceDir + '/styles/styles.less';

  var includePaths = [
    resolve(process.cwd(), '<%= pkg.gruntConfig.commonsUiDir %>/node_modules/bootstrap/less'),
    resolve(process.cwd(), '<%= pkg.gruntConfig.commonsUiDir %>/lib/widgets'),
    resolve(process.cwd(), '<%= pkg.gruntConfig.commonsUiDir %>/resources/less'),
    resolve(process.cwd(), '<%= pkg.gruntConfig.commonsUiDir %>/resources/css'),
    resolve(process.cwd(), '<%= pkg.gruntConfig.commonsUiDir %>/node_modules'),
    resolve(process.cwd(), 'ui/common/styles'),
    resolve(process.cwd(), 'ui/' + pathConfig.appName, 'styles'),
    resolve(process.cwd(), 'ui/' + pathConfig.appName, 'client/scripts'),
    resolve(process.cwd(), 'node_modules/camunda-bpm-webapp/ui/common/styles'),
    resolve(process.cwd(), 'node_modules/camunda-bpm-webapp/ui/' + pathConfig.appName, 'styles'),
    resolve(process.cwd(), 'node_modules/camunda-bpm-webapp/ui/' + pathConfig.appName, 'client/scripts'),

    // resolve(__dirname, '../../..', 'camunda-bpm-webapp/webapp/src/main/resources-plugin'),
    // resolve(__dirname, '../../..', 'camunda-bpm-platform-ee/webapps/camunda-webapp/plugins/src/main/resources-plugin')
  ];

  lessConfig[pathConfig.appName + '_styles'] = {
    options: {
      paths: includePaths,

      dumpLineNumbers: '<%= buildMode === "prod" ? "" : "comments" %>',
      compress: '<%= buildMode === "prod" ? "true" : "" %>',
      sourceMap: '<%= buildMode === "prod" ? "true" : "" %>',

      sourceMapURL: './styles.css.map',
      sourceMapFilename: pathConfig.buildTarget + '/styles/styles.css.map'
    },
    files: file
  };

};


text:
using System;
using System.Threading.Tasks;
using ProGaudi.Tarantool.Client.Model;
using ProGaudi.Tarantool.Client.Model.Responses;

namespace ProGaudi.Tarantool.Client
{
    public interface IBox : IDisposable
    {
        Task Connect();

        bool IsConnected { get; }

        Metrics Metrics { get; }

        ISchema Schema { get; }

        BoxInfo Info { get; }

        [Obsolete]
        ISchema GetSchema();

        Task ReloadSchema();

        Task ReloadBoxInfo();

        Task Call_1_6(string functionName);

        Task Call_1_6<TTuple>(string functionName, TTuple parameters);

        Task<DataResponse<TResponse[]>> Call_1_6<TResponse>(string functionName);

        Task<DataResponse<TResponse[]>> Call_1_6<TTuple, TResponse>(string functionName, TTuple parameters);

        Task Call(string functionName);

        Task Call<TTuple>(string functionName, TTuple parameters);

        Task<DataResponse<TResponse[]>> Call<TResponse>(string functionName);

        Task<DataResponse<TResponse[]>> Call<TTuple, TResponse>(string functionName, TTuple parameters);

        Task<DataResponse<TResponse[]>> Eval<TTuple, TResponse>(string expression, TTuple parameters);

        Task<DataResponse<TResponse[]>> Eval<TResponse>(string expression);

        Task<DataResponse<TResponse[]>> ExecuteSql<TResponse>(string query, params SqlParameter[] parameters);

        Task<DataResponse> ExecuteSql(string query, params SqlParameter[] parameters);
    }
}


text:
#ifndef PRECOMPILED_OOVISUALIZATION_H_
#define PRECOMPILED_OOVISUALIZATION_H_

// Include here the precompiled headers of other plug-ins that this plug-in uses. Only the "public" part of
// those headers will be included here
#include "VisualizationBase/src/precompiled.h"
#include "OOModel/src/precompiled.h"
#include "ModelBase/src/precompiled.h"
#include "Logger/src/precompiled.h"
#include "SelfTest/src/precompiled.h"
#include "Core/src/precompiled.h"
#include "Core/src/global.h"

// Put here includes which appear in header files. This will also be visible to other plug-in which depend on this one
// and will be included in their precompiled headers

#if defined(OOVisualization_EXPORTS)
// Put here includes which only appear in compilation units and do not appear in headers. Precompiled headers of
// plug-ins which depend on this one will not include these headers.
#include <QtWidgets/QDesktopWidget>
#include <QtCore/QDir>
#include <QtCore/QFileSystemWatcher>

#endif

#endif /* PRECOMPILED_OOVISUALIZATION_H_ */


text:
package com.piasy.client.controller;

import java.io.File;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Queue;

import org.json.JSONException;
import org.json.JSONObject;

import android.content.Context;
import android.os.Handler;
import android.os.Message;
import android.widget.Toast;

import com.piasy.client.model.Config;
import com.piasy.client.model.Constant;
import com.piasy.client.model.ControlChannel;
import com.piasy.client.model.Request;
import com.piasy.client.model.TransferTask;

/**
 *
This class is the controller class in the MVC design pattern.
 * This class takes charge of responding the viewer's(activities presented
 * to user) request, by driving models to process data, sending
 * process result to viewer, maintaining the top level logic of this
 * software. It also implements the singletom design pattern, to make
 * sure that all activities will get the same controller, and get the
 * same data in the whole life cycle of this application.

 *
 *
 *
author: 	Piasy Xu

 *
date:		19:44 2013/12/17

 *
email:	xz4215@gmail.com

 *
github:	Piasy

 * */
public class Controller
{
	private static int instanceCount = 0;
	private static Controller instance = null;

	/**
	 * The static method to get the reference of the singel
	 * controller.
	 * If there is no instance of controller, this method will
	 * new an instance, and return it, otherwise return it directly.
	 * @return the single instance of controller
	 * */
	public static Controller getController()
	{
		if (instanceCount == 0)
		{
			instance = new Controller();
			instanceCount ++;
		}

		return instance;
	}

	static Context context;
	public static void setContext(Context cont)
	{
		context = cont;
	}

	public static void makeToast(String text)
	{
		Toast.makeText(context, text, Toast.LENGTH_LONG).show();
	}

	ControlChannel controlChannel = null;
	String username = null;
	Handler viewerHandler = null;
	Thread controllerThread = null;
	Queue<Request> requests = new LinkedList<Request>();
	/**
	 * Initialize the necessary modules of this application, including
	 * the database manager, handler, and control channel. All the query
	 * result won't be returned by the query method, but be sent to viewer
	 * through handler, because the activity's thread can't be blocked.
	 * @param
	 * the viewer's handler,
	 * the database manager,
	 * the name of this user
	 * */
	public boolean init(Handler viewerHandler, String username)
	{
		boolean ret = true;
		this.username = username;
		this.viewerHandler = viewerHandler;

		File cloudDir = new File(Constant.APP_BASE_DIR);
		cloudDir.mkdir();
		File logDir = new File(Constant.APP_BASE_DIR + "/log");
		logDir.mkdir();
		File tmpDir = new File(Constant.TMP_DIR);
		tmpDir.mkdir();

		if (ret)
		{
			controllerThread = new Thread(controllerRunnable);
			controllerThread.start();
		}
		return ret;
	}

	/**
	 * The exit method, it will be called when user want to
	 * exit this application. We also only note down this
	 * request here, it will be processed in controller's
	 * thread.
	 * */
	public void exit()
	{
		synchronized (requests)
		{
			Request exit = new Request();
			exit.type = Constant.REQUEST_TYPE_EXIT;
			requests.offer(exit);
		}
	}

	/**
	 * Get the username.
	 * @return the user name.
	 * */
	public String getName()
	{
		return username;
	}

	/**
	 * The query method, just note down that the user has made
	 * a query request, and it will be processed in the controller's
	 * own thread. The query result will be sent to viewer via handler.
	 * */
	public void query()
	{
		synchronized (requests)
		{
			Request query = new Request();
			query.type = Constant.REQUEST_TYPE_QUERY;
			requests.offer(query);
		}
	}

	/**
	 * The upload method, just note down that the user has made
	 * a upload request, and save the file(s) name to be sent,
	 * and it will be processed in the controller's own thread.
	 * After the upload, controller will make a query request
	 * itself, and than the viewer could update the cloud file
	 * information. If there are many files to upload, call this
	 * method one by one.
	 * @param params : upload params
	 * {
	 * "filename" : filename
	 * }
	 * */
	public void upload(JSONObject params)
	{
		synchronized (requests)
		{
			Request upload = new Request();
			upload.type = Constant.REQUEST_TYPE_UPLOAD;
			upload.params = params;
			requests.offer(upload);
		}
	}

	/**
	 * The download method, just note down that the user has made
	 * a download request, and save the file(s) name to be sent,
	 * and it will be processed in the controller's own thread.
	 * If there are many files to download, call this
	 * method one by one.
	 * @param params : download params, the same format as upload
	 * */
	public void download(JSONObject params)
	{
		synchronized (requests)
		{
			Request download = new Request();
			download.type = Constant.REQUEST_TYPE_DOWNLOAD;
			download.params = params;
			requests.offer(download);
		}
	}

	public void parseResponse(String rcvStr)
	{
		try
		{
			JSONObject response = new JSONObject(rcvStr);
			String type = response.getString("type");

			if (type.equals("query"))
			{
				Message msg = Message.obtain();
				msg.obj = rcvStr;	//TODO add some information
				synchronized (viewerHandler)
				{
					viewerHandler.sendMessage(msg);
				}
			}
			else
			{

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

	public void transferFinish()
	{
		synchronized (runningTasks)
		{
			for (int i = 0; i < runningTasks.size(); i ++)
			{
				if (runningTasks.get(i).finished())
				{
					runningTasks.remove(i);
					break;
				}
			}

			synchronized (waitingTasks)
			{
				while (!waitingTasks.isEmpty()
						&& (runningTasks.size() < Constant.CHANNEL_POOL_SIZE))
				{
					TransferTask task = waitingTasks.poll();
					task.start();
					runningTasks.add(task);
				}
			}
		}
	}

	public void transferFileFinish(String filename, int mode)
	{
		try
		{
			JSONObject info = new JSONObject();
			switch (mode)
			{
			case Constant.TRANSFER_MODE_DOWNLOAD:
				info.put("type", "download");
				break;
			case Constant.TRANSFER_MODE_UPLOAD:
				info.put("type", "upload");
				break;
			default:
				break;
			}
			info.put("filename", filename);
			info.put("status", "success");
			Message msg = Message.obtain();
			msg.obj = info.toString();
			System.out.println("Controller.transferFileFinish() " + info.toString());
			synchronized (viewerHandler)
			{
				viewerHandler.sendMessage(msg);
			}
		}
		catch (JSONException e)
		{
			e.printStackTrace();
		}
	}

	int dataport;
	public void setDataPort(int port)
	{
		dataport = port;
	}

	//the queue of transfer tasks
	Queue<TransferTask> waitingTasks = new LinkedList<TransferTask>();
	ArrayList<TransferTask> runningTasks = new ArrayList<TransferTask>();

	boolean keepRunning = true;
	Runnable controllerRunnable = new Runnable()
	{
		/**
		 * The thread body of controller.
		 * All works are done in the time-sharing mechanism,
		 * this thread will check all possible transaction,
		 * if there is any of them, process it via driving
		 * different models.
		 * */
		@Override
		public void run()
		{
			controlChannel = new ControlChannel(username);
			if(controlChannel.init())
			{
				Message msg = Message.obtain();
				JSONObject info = new JSONObject();
				try
				{
					info.put("type", "init");
					info.put("status", "success");
					msg.obj = info.toString();
					synchronized (viewerHandler)
					{
						viewerHandler.sendMessage(msg);
					}
				}
				catch (JSONException e)
				{
					e.printStackTrace();
				}
			}
			else
			{
				Message msg = Message.obtain();
				JSONObject info = new JSONObject();
				try
				{
					info.put("type", "init");
					info.put("status", "fail");
					msg.obj = info.toString();
					synchronized (viewerHandler)
					{
						viewerHandler.sendMessage(msg);
					}
				}
				catch (JSONException e)
				{
					e.printStackTrace();
				}

				return;
			}

			while (keepRunning)
			{
				synchronized (requests)
				{
					if (!requests.isEmpty())
					{
						Request request = requests.poll();
						switch (request.type)
						{
						case Constant.REQUEST_TYPE_QUERY:
							controlChannel.query();
							break;
						case Constant.REQUEST_TYPE_UPLOAD:
						case Constant.REQUEST_TYPE_DOWNLOAD:
							try
							{
								TransferTask task = new TransferTask(request.type,
										request.params.getString("filename"), dataport);
								synchronized (runningTasks)
								{
									if (runningTasks.size() < Constant.CHANNEL_POOL_SIZE)
									{
										task.start();
										runningTasks.add(task);
									}
									else
									{
										synchronized (waitingTasks)
										{
											waitingTasks.offer(task);
										}
									}
								}
							}
							catch (JSONException e)
							{
								e.printStackTrace();
							}
							break;
						case Constant.REQUEST_TYPE_EXIT:

							break;
						default:
							break;
						}
					}
				}

			}
		}
	};

	public Config getConf(long size)
	{
		//TODO init index model according to
		//network speed and split time/efficiency
		return new Config(Constant.CDC_MAGIC, Constant.CDC_MASK,
				Constant.MIN_BLOCK_SIZE, Constant.MAX_BLOCK_SIZE, Constant.SLID_WINDOW_STEP);
	}

	private Controller()
	{
	}
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CaratFileManagementLib;
using System.Printing;
using System.Web.UI.WebControls;
using System.Web.UI;
using System.IO;
using System.Drawing;

namespace CaratManagementReports.SmartReports {

  [SmartReport(ReportTypeEnum.Table, "List all projects with dupes in HTML table", PageOrientation.Portrait, ReportDestinationEnum.Html)]
  public class ListProjectsWithDupesHtml : SmartReport, IReportPrint, IReportEmail {

    private TCaratProjectCollection Projects;

    public ListProjectsWithDupesHtml(TCaratProjectCollection projects, string title = "")
      : base() {
      Projects = new TCaratProjectCollection(projects);
      LastResult = "";
      Title = title;
    }

    public override string Execute() {
      ListAllProjectsHtml AllProjectsHtmlReport = new ListAllProjectsHtml(new TCaratProjectCollection(Projects.ToList().Where(p => p.ContainsDuped)), Title == "" ? DefaultDescription : Title);
      LastResult = AllProjectsHtmlReport.Execute();

      return LastResult;
    }

  }
}


text:
.class public Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;
.super Ljava/lang/Object;
.source "LppConfig.java"

# interfaces
.implements Ljava/io/Serializable;

# static fields
.field private static final serialVersionUID:J = 0x1L

# instance fields
.field private GPSAlways:Z

.field public GPSKeepOn_Timer:I

.field public GPSRequest_APDR:I

.field private GPSRequest_By:I

.field public GPSRequest_Timer:I

.field private LogConfig:Ljava/lang/String;

.field private LogFlags:[Z

.field private LogFolderName:Ljava/lang/String;

.field private flag_log:Z

.field public transient looper:Landroid/os/Looper;

.field private mcontext:Landroid/content/Context;

# direct methods
.method public constructor <init>(Landroid/content/Context;III)V
    .locals 2

    const/4 v1, 0x0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-boolean v1, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->flag_log:Z

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSAlways:Z

    const-string/jumbo v0, "LPPTest"

    iput-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFolderName:Ljava/lang/String;

    const-string/jumbo v0, "[LPPTest Configuration]\r\n"

    iput-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogConfig:Ljava/lang/String;

    iput v1, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSRequest_By:I

    const/16 v0, 0x64

    iput v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSRequest_APDR:I

    const/16 v0, 0x2d

    iput v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSRequest_Timer:I

    const/16 v0, 0xf

    iput v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSKeepOn_Timer:I

    const/4 v0, 0x4

    new-array v0, v0, [Z

    fill-array-data v0, :array_0

    iput-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFlags:[Z

    iput p2, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSRequest_APDR:I

    iput p3, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSRequest_Timer:I

    iput p4, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSKeepOn_Timer:I

    iput-object p1, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->mcontext:Landroid/content/Context;

    return-void

    :array_0
    .array-data 1
        0x0t
        0x0t
        0x0t
        0x0t
    .end array-data
.end method

.method public constructor <init>(Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;)V
    .locals 5

    const/4 v4, 0x4

    const/4 v3, 0x0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-boolean v3, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->flag_log:Z

    const/4 v2, 0x1

    iput-boolean v2, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSAlways:Z

    const-string/jumbo v2, "LPPTest"

    iput-object v2, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFolderName:Ljava/lang/String;

    const-string/jumbo v2, "[LPPTest Configuration]\r\n"

    iput-object v2, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogConfig:Ljava/lang/String;

    iput v3, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSRequest_By:I

    const/16 v2, 0x64

    iput v2, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSRequest_APDR:I

    const/16 v2, 0x2d

    iput v2, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSRequest_Timer:I

    const/16 v2, 0xf

    iput v2, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSKeepOn_Timer:I

    new-array v2, v4, [Z

    fill-array-data v2, :array_0

    iput-object v2, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFlags:[Z

    invoke-virtual {p1}, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->getLogFlags()[Z

    move-result-object v1

    const/4 v0, 0x0

    :goto_0
    if-ge v0, v4, :cond_0

    iget-object v2, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFlags:[Z

    aget-boolean v3, v1, v0

    aput-boolean v3, v2, v0

    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    :cond_0
    iget v2, p1, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSRequest_APDR:I

    iput v2, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSRequest_APDR:I

    iget v2, p1, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSRequest_Timer:I

    iput v2, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSRequest_Timer:I

    iget v2, p1, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSKeepOn_Timer:I

    iput v2, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSKeepOn_Timer:I

    invoke-virtual {p1}, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->getConfigStr()Ljava/lang/String;

    move-result-object v2

    iput-object v2, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogConfig:Ljava/lang/String;

    invoke-virtual {p1}, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->getLogFolderNameStr()Ljava/lang/String;

    move-result-object v2

    iput-object v2, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFolderName:Ljava/lang/String;

    invoke-virtual {p1}, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->getContext()Landroid/content/Context;

    move-result-object v2

    iput-object v2, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->mcontext:Landroid/content/Context;

    return-void

    :array_0
    .array-data 1
        0x0t
        0x0t
        0x0t
        0x0t
    .end array-data
.end method

.method public constructor <init>(ZZZZIIIILjava/lang/String;Ljava/lang/String;)V
    .locals 3

    const/4 v2, 0x1

    const/4 v1, 0x0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-boolean v1, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->flag_log:Z

    iput-boolean v2, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSAlways:Z

    const-string/jumbo v0, "LPPTest"

    iput-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFolderName:Ljava/lang/String;

    const-string/jumbo v0, "[LPPTest Configuration]\r\n"

    iput-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogConfig:Ljava/lang/String;

    iput v1, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSRequest_By:I

    const/16 v0, 0x64

    iput v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSRequest_APDR:I

    const/16 v0, 0x2d

    iput v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSRequest_Timer:I

    const/16 v0, 0xf

    iput v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSKeepOn_Timer:I

    const/4 v0, 0x4

    new-array v0, v0, [Z

    fill-array-data v0, :array_0

    iput-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFlags:[Z

    iget-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFlags:[Z

    aput-boolean p1, v0, v1

    iget-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFlags:[Z

    aput-boolean p2, v0, v2

    iget-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFlags:[Z

    const/4 v1, 0x2

    aput-boolean p3, v0, v1

    iget-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFlags:[Z

    const/4 v1, 0x3

    aput-boolean p4, v0, v1

    iput p5, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSRequest_By:I

    iput p6, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSRequest_APDR:I

    iput p7, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSRequest_Timer:I

    iput p8, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSKeepOn_Timer:I

    iput-object p9, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogConfig:Ljava/lang/String;

    iput-object p10, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFolderName:Ljava/lang/String;

    return-void

    :array_0
    .array-data 1
        0x0t
        0x0t
        0x0t
        0x0t
    .end array-data
.end method

.method public constructor <init>(ZZZZIZLjava/lang/String;)V
    .locals 3

    const/4 v2, 0x1

    const/4 v1, 0x0

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-boolean v1, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->flag_log:Z

    iput-boolean v2, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSAlways:Z

    const-string/jumbo v0, "LPPTest"

    iput-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFolderName:Ljava/lang/String;

    const-string/jumbo v0, "[LPPTest Configuration]\r\n"

    iput-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogConfig:Ljava/lang/String;

    iput v1, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSRequest_By:I

    const/16 v0, 0x64

    iput v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSRequest_APDR:I

    const/16 v0, 0x2d

    iput v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSRequest_Timer:I

    const/16 v0, 0xf

    iput v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSKeepOn_Timer:I

    const/4 v0, 0x4

    new-array v0, v0, [Z

    fill-array-data v0, :array_0

    iput-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFlags:[Z

    iget-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFlags:[Z

    aput-boolean p1, v0, v1

    iget-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFlags:[Z

    aput-boolean p2, v0, v2

    iget-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFlags:[Z

    const/4 v1, 0x2

    aput-boolean p3, v0, v1

    iget-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFlags:[Z

    const/4 v1, 0x3

    aput-boolean p4, v0, v1

    iput-boolean p6, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->GPSAlways:Z

    iput-object p7, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFolderName:Ljava/lang/String;

    return-void

    :array_0
    .array-data 1
        0x0t
        0x0t
        0x0t
        0x0t
    .end array-data
.end method

# virtual methods
.method public getConfigStr()Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogConfig:Ljava/lang/String;

    return-object v0
.end method

.method public getContext()Landroid/content/Context;
    .locals 1

    iget-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->mcontext:Landroid/content/Context;

    return-object v0
.end method

.method public getLogCommand()Z
    .locals 1

    iget-boolean v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->flag_log:Z

    return v0
.end method

.method public getLogFlags()[Z
    .locals 1

    iget-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFlags:[Z

    return-object v0
.end method

.method public getLogFolderNameStr()Ljava/lang/String;
    .locals 1

    iget-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFolderName:Ljava/lang/String;

    return-object v0
.end method

.method public setContext(Landroid/content/Context;)V
    .locals 0

    iput-object p1, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->mcontext:Landroid/content/Context;

    return-void
.end method

.method public setLogParameter(ZZZZLjava/lang/String;Ljava/lang/String;)V
    .locals 3

    const/4 v2, 0x1

    iput-boolean v2, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->flag_log:Z

    iget-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFlags:[Z

    const/4 v1, 0x0

    aput-boolean p1, v0, v1

    iget-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFlags:[Z

    aput-boolean p2, v0, v2

    iget-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFlags:[Z

    const/4 v1, 0x2

    aput-boolean p3, v0, v1

    iget-object v0, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFlags:[Z

    const/4 v1, 0x3

    aput-boolean p4, v0, v1

    iput-object p5, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogConfig:Ljava/lang/String;

    iput-object p6, p0, Lcom/samsung/android/contextaware/aggregator/lpp/LppConfig;->LogFolderName:Ljava/lang/String;

    return-void
.end method


text:
package com.criteo.dev.cluster.docker

import com.criteo.dev.cluster.config.GlobalConfig
import com.criteo.dev.cluster.{CliAction, Public}

/**
  * List gateways that can be restarted.
  */
@Public object ListGatewayCliAction extends CliAction[Unit] {
  override def command: String = "list-gateway"

  override def usageArgs: List[Any] = List()

  override def help: String = "Lists recently exited gateway docker containers, which can be resumed."

  override def applyInternal(args: List[String], config: GlobalConfig): Unit = {
    val conf = config.backCompat
    val dockerMetas = DockerUtilities.getDockerContainerMetadata(
      DockerConstants.gatewayLabel)
    DockerUtilities.printGatewayDockerContainerInfo(conf, dockerMetas)
  }
}


text:
"""flask_factory
~~~~~~~~~~~~~

"""
from .factory import Factory

__all__ = ['Factory']


text:
<?php

namespace h4cc\AliceFixturesBundle\Tests\testdata;

class User
{
    public $username;

    public $fullname;

    public $birthDate;

    public $email;

    public $favoriteNumber;

    public $friends;

    public function __construct($username = null, $email = null, \DateTime $birthDate = null)
    {
        $this->username = $username;
        $this->email = $email;
        $this->birthDate = $birthDate;
    }

    public function getAge()
    {
        return 25;
    }

    public function doStuff($dummy, $dummy2, $arg)
    {
        $this->username = $arg;
    }
}


text:
This repo is for [Udacity](https://www.udacity.com/)'s Front End Frameworks course. This is the Backbone version of the project.

## Required software

* [Git](https://git-scm.com/)
* [Bower](http://bower.io/)

## Getting set up

### Set up the project
* clone this repo
* `cd` into the newly cloned project
* install Bower dependencies via `bower install`

### Set up the server
* clone the [backend server](https://github.com/udacity/FEF-UdaciMeals-Backbone-Server)
* launch the binary for your platform
  - don't forget the `--www` flag pointing to the UdaciMeals Backbone project you just cloned above
  - check out that project's `Running the server` section of its README for specific details

### View the app

Using your favorite browser, load [http://localhost:8000/](http://localhost:8000/) and :boom:


text:
using System.Linq;
using System.Management;

namespace FinalstreamCommons.Utils
{
    public static class ProcessUtils
    {

        /// <summary>
        /// プロセスIDから実行ファイルパスを取得します。
        /// </summary>
        /// <param name="processId"></param>
        /// <returns></returns>
        public static string GetExecutablePath(int processId)
        {
            var wmiQueryString = "SELECT ExecutablePath FROM Win32_Process WHERE ProcessId = " + processId;
            using (var searcher = new ManagementObjectSearcher(wmiQueryString))
            {
                using (var results = searcher.Get())
                {
                    var mo = results.Cast<ManagementObject>().FirstOrDefault();
                    if (mo != null)
                    {
                        return (string)mo["ExecutablePath"];
                    }
                }
            }
            return null;
        }

    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Http;
using System.IO;
using System.Runtime.Serialization.Json;
using System.Net.Http.Headers;
using Emc.Documentum.Rest.Http.Utility;
using System.Runtime.Serialization;
using System.Runtime.InteropServices;

namespace Emc.Documentum.Rest.DataModel
{
    /// <summary>
    /// Batch resource model
    /// </summary>
    [DataContract(Name = "batch", Namespace = "http://identifiers.emc.com/vocab/documentum")]
    [ClassInterface(ClassInterfaceType.AutoDual)]
    public partial class Batch
    {
        [DataMember(Name = "description")]
        public string Description { get; set; }

        [DataMember(Name = "state")]
        public string State { get; set; }

        [DataMember(Name = "substate")]
        public string Substate { get; set; }

        [DataMember(Name = "owner")]
        public string Owner { get; set; }

        [DataMember(Name = "submitted")]
        public string Submitted { get; set; }

        [DataMember(Name = "started")]
        public string Started { get; set; }

        [DataMember(Name = "finished")]
        public string Finished { get; set; }

        [DataMember(Name = "transactional")]
        public Boolean Transactional { get; set; }

        [DataMember(Name = "sequential")]
        public Boolean Sequential { get; set; }

        [DataMember(Name = "on-error")]
        public string OnError { get; set; }

        [DataMember(Name = "return-request")]
        public Boolean ReturnRequest { get; set; }

        [DataMember(Name = "operations")]
        public List<BatchOperation> Operations
        {
            get
            {
                if (_operations == null)
                {
                    _operations = new List<BatchOperation>();
                }
                return _operations;
            }
            set { _operations = value; }
        }

        private List<BatchOperation> _operations = new List<BatchOperation>();
    }

    /// <summary>
    /// Batch operation model
    /// </summary>
    [DataContract(Name = "operation", Namespace = "http://identifiers.emc.com/vocab/documentum")]
    public partial class BatchOperation
    {
        [DataMember(Name = "id")]
        public string Id { get; set; }

        [DataMember(Name = "description")]
        public string Description { get; set; }

        [DataMember(Name = "state")]
        public string State { get; set; }

        [DataMember(Name = "started")]
        public string Started { get; set; }

        [DataMember(Name = "finished")]
        public string Finished { get; set; }

        [DataMember(Name = "request")]
        public BatchOperationRequest Request { get; set; }

        [DataMember(Name = "response")]
        public BatchOperationResponse Response { get; set; }
    }

    /// <summary>
    /// Batch operation request model
    /// </summary>
    [DataContract(Name = "request", Namespace = "http://identifiers.emc.com/vocab/documentum")]
    public partial class BatchOperationRequest : BatchOperationItem
    {
        [DataMember(Name = "method")]
        public string Method { get; set; }

        [DataMember(Name = "uri")]
        public string Uri { get; set; }
    }

    /// <summary>
    /// Batch operation response model
    /// </summary>
    [DataContract(Name = "response", Namespace = "http://identifiers.emc.com/vocab/documentum")]
    public partial class BatchOperationResponse : BatchOperationItem
    {
        [DataMember(Name = "status")]
        public Int32 Status { get; set; }
    }

    /// <summary>
    /// Batch operation basic model
    /// </summary>
    [DataContract(Name = "response", Namespace = "http://identifiers.emc.com/vocab/documentum")]
    public partial class BatchOperationItem
    {
        [DataMember(Name = "headers")]
        public List<BatchOperationHeader> Headers { get; set; }

        [DataMember(Name = "entity")]
        public string Entity { get; set; }
    }

    /// <summary>
    /// Batch operation header model
    /// </summary>
    [DataContract(Name = "header", Namespace = "http://identifiers.emc.com/vocab/documentum")]
    public partial class BatchOperationHeader
    {
        [DataMember(Name = "name")]
        public string Name { get; set; }

        [DataMember(Name = "value")]
        public string Value { get; set; }
    }
}


text:
<!DOCTYPE html>

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

<title>Transform a stageRunnerNode according to a functional. — stageRunnerNode_transform • stagerunner</title>

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">

<link href="../pkgdown.css" rel="stylesheet">

      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">

      </button>
      stagerunner

  Reference

  News

Transform a stageRunnerNode according to a functional.

Transform a stageRunnerNode according to a functional.

stageRunnerNode_transform(transformation)

 Arguments

    <colgroup><col class="name" /><col class="desc" /></colgroup>

      transformation

function. An arity-1 function which takes the
callable of a stageRunnerNode and transforms it
into another callable (i.e. a function or a stagerunner). If the
original callable is a stagerunner, its terminal nodes in
turn will be transformed recursively.

Value

The transformed callable.

Examples

not_run({
  increment <- 1
  adder     <- function(x) x + increment
  node      <- stageRunnerNode$new(function(e) print(adder(1)))
  node$transform(function(fn) {
    environment(fn)$increment <- environment(fn)$increment + 1; fn
  })
  node$run() # Prints 3, rather than 2
})

Contents

Arguments

Value

Examples

Developed by Robert Krzyzanowski.

Site built with pkgdown.


text:
package info.budiyanto.appengine.endpoints.locationtracker;

import com.google.api.server.spi.Constant;

/**
 * Contains the client IDs and scopes for allowed clients consuming the helloworld API.
 */
public class Constants {
  public static final String WEB_CLIENT_ID = "280801875406-r9il7roirrv5k25him376m7igtcfqg2j.apps.googleusercontent.com";
  public static final String ANDROID_CLIENT_ID = "replace this with your Android client ID";
  public static final String IOS_CLIENT_ID = "replace this with your iOS client ID";
  public static final String ANDROID_AUDIENCE = WEB_CLIENT_ID;
  public static final String API_EXPLORER_CLIENT_ID = Constant.API_EXPLORER_CLIENT_ID;

  public static final String EMAIL_SCOPE = "https://www.googleapis.com/auth/userinfo.email";
}


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class AdminController extends CI_Controller{

    function __construct()
    {
        parent::__construct();
        $this->load->model('ControlUsers', '', TRUE);
//session check from the custom helper
        is_logged_in();
    }
//Upload Notes
    public function uploadNotes()
    {
        $this->load->view('admin/uploadnotes');
    }

}


text:
using System;
using System.Diagnostics.CodeAnalysis;
using System.Windows.Input;

namespace TripToPrint
{
    [ExcludeFromCodeCoverage]
    public sealed class NormalCursor : IDisposable
    {
        private readonly Cursor _previousCursor;

        public NormalCursor()
        {
            _previousCursor = Mouse.OverrideCursor;

            Mouse.OverrideCursor = Cursors.Arrow;
        }

        public void Dispose()
        {
            Mouse.OverrideCursor = _previousCursor;
        }
    }
}


text:
<?php
/**
 * Templater plugin
 *
 * Collects all called images, groups them by group parameter and output
 tag with assigned class
 *
 * @param array params
 * 		src 	- link to image like in img tag
 *		group 	- name of used sprite
 *		id 		- identifier attribute for tag
 *		name 	- name attribute for tag
 *		class	- to add additional class to resulted div
 * 		title	- add popup title
 */

function smarty_function_image_sprite($params, &$smarty) {

	if (!isset($params['src']) || empty($params['src'])) {
		$smarty->trigger_error("assign: missing 'src' parameter");
		return;
	}

	if (!isset($params['group']) || empty($params['group'])) {
		$smarty->trigger_error("assign: missing 'group' parameter");
		return;
	}

	$smarty->_smarty_vars['sprites'][$params['group']][] = $params['src'];

	$add_class	= !empty($params['class']) 	? ' ' . $params['class'] 				: '';
	$ident		= !empty($params['id']) 	? ' id="' . $params['id'] . '"' 		: '';
	$name		= !empty($params['name']) 	? ' name="' . $params['name'] . '"' 	: '';
	$title		= !empty($params['title']) 	? ' title="' . $params['title'] . '"' 	: '';

	// classname based on constants qpimg::MAP_CSS_SELECTOR_MASK and qpimg::OBJ_CSS_SELECTOR_MASK
	// can change in config, use params map_css_selector_mask and obj_css_selector_mask
	// if change in config, need change string below and function cw_generate_css_sprites !!!
	$class_name = "qpimg_map_" . $params['group'] . " qpimg_obj_" . $params['group'] . "_sprite" . count($smarty->_smarty_vars['sprites'][$params['group']]);

	return '

';
}

?>


text:
package com.pinterest.secor.timestamp;

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

public class KafkaMessageTimestampFactory {
    private static final Logger LOG = LoggerFactory.getLogger(KafkaMessageTimestampFactory.class);

    private KafkaMessageTimestamp kafkaMessageTimestamp;

    public KafkaMessageTimestampFactory(String kafkaTimestampClassName) {
        try {
            Class timestampClass = Class.forName(kafkaTimestampClassName);
            this.kafkaMessageTimestamp = KafkaMessageTimestamp.class.cast(timestampClass.newInstance());
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }

    public KafkaMessageTimestamp getKafkaMessageTimestamp() {
        return this.kafkaMessageTimestamp;
    }
}


text:
#include "threadsClientGame.hpp"

#include <AL/alut.h>
#include <pthread.h>
#include "system.hpp"

extern bool evtRunEngine;

namespace threadsClientGame
{
	CEngine *engineInstance = 0;

	pthread_t updateThreadHandle;

	pthread_mutex_t canDrawMutex = PTHREAD_MUTEX_INITIALIZER;
	pthread_mutex_t canUpdateMutex = PTHREAD_MUTEX_INITIALIZER;

	void *updateThread(void *arg)
	{
		const double MS_PER_UPDATE = 1.0 / 60.0;
		const double MS_PER_UPDATE_INV = 1.0 / MS_PER_UPDATE;
		double previous = platform::get_wall_time();
		double lag = 0.0;

		while(evtRunEngine)
		{
			pthread_mutex_lock(&canUpdateMutex);

			double current = platform::get_wall_time();
			double elapsed = current - previous;
			previous = current;
			lag += elapsed;

			processEvents();

			while(lag >= MS_PER_UPDATE)
			{
				engineInstance->update(MS_PER_UPDATE, lag * MS_PER_UPDATE_INV);
				lag -= MS_PER_UPDATE;
			}

			pthread_mutex_unlock(&canDrawMutex);
		}

		pthread_exit(NULL);
	}
}

void threadsClientGame::init(int argc, char **argv)
{
	InfoLog << "reVision work log from: " << asctime(CTimer::currentTimeInfo()) << NL;

	// Initialize OpenAL
	alutInit(&argc, argv);

	// Set some random seed for pseudo random number generation.
	srand(time(0));
}

void threadsClientGame::run(CEngine *engine)
{
	if((engineInstance = engine) == 0)
	{
		ErrorLog << "Engine instance not initialized" << NL;
		return;
	}

	pthread_mutex_lock(&canDrawMutex);
	pthread_mutex_lock(&canUpdateMutex);

	// Run all support threads
	pthread_create(&updateThreadHandle, NULL, updateThread, NULL);

	// Start update thread
	pthread_mutex_unlock(&canUpdateMutex);

	// Main thread drawing loop
	while(evtRunEngine)
	{
		pthread_mutex_lock(&canDrawMutex);

		engineInstance->updateOpenGL();

		pthread_mutex_unlock(&canUpdateMutex);

		engineInstance->draw();
	}

	// Wait until the remaining threads are ready to be joined
	pthread_join(updateThreadHandle, NULL);

	if(engineInstance)
	{
		delete engineInstance;
	}
}

void threadsClientGame::cleanup()
{
	// Finish OpenAL
	alutExit();

	// Ensure the log stream is properly closed.
	CLogger::close();
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Epicr. syst. mycol. (Upsaliae) 186 (1838)

#### Original name
Agaricus contortus Bull., 1781

### Remarks
null


text:
var arguments = process.argv.slice(2);
var connect = require('connect');
var http = require('http');
var port = arguments[1] || 3001;

connect()
    .use(connect.static(arguments[0]))
    .listen(port);