text:
from pathlib import Path

class MarkdownParser():

    def __init__(self, text):
        self.text = text
        self.lines = text.split('\n')

    def title(self):
        return self.lines[0].split(' ')[1]

    def header(self, name, level, include_header=False):
        start = False
        end = False
        content = []
        mark = '#' * level
        for line in self.lines:
            if start and not end:
                end |= (f'{mark} ' in line[:(level + 1)]) and (not f'{mark} {name}' in line)
                if end:
                    start = False
                else:
                    content.append(line)
            else:
                start = (f'{mark} {name}' in line)
                if start:
                    end = False
                    if include_header:
                        content.append(line)

        content = '\n'.join(content)
        return content

    def overview(self):
        overview = self.header('Overview', 2)
        overview = overview.split('\n')
        overview = '\n'.join(overview[1:])  # remove the first line
        return overview

    def features(self):
        return self.header('C++', 2, True)

def combine(text, parsers):
    overview = ''
    features = ''
    title = ''
    for p in parsers:
        title += p.title().replace('C++', '') + '/'
        overview += p.overview() + '\n'
        features += p.features() + '\n'

    title = title[:-1]
    overview = overview.replace('README.md#', '#')
    features = features.replace('README.md#', '#')

    text = text.replace('# C++\n', f'# C++{title}\n')
    text = text.replace(f'<!-- overview -->', overview)
    text = text.replace(f'<!-- features -->', features)

    return text

def main():
    src_dir = Path(__file__).parent
    parsers = []

    srcs = list(src_dir.glob('CPP*.md'))
    srcs.sort(reverse=True)
    for file in srcs:
        with open(file, 'r') as fp:
            text = fp.read()
        p = MarkdownParser(text)
        parsers.append(p)

    template_file = src_dir / 'readme-template.md'
    with open(template_file, 'r') as fp:
        text = fp.read()

    text = combine(text, parsers)

    readme_file = src_dir / 'README.md'
    with open(readme_file, 'w') as fp:
        fp.write(text)

if __name__ == '__main__':
    main()


text:
<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel app\models\SearchEdital */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Edital Abertos';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="edital-index">

    <?php // echo $this->render('_search', ['model' => $searchModel]);

            //nao fui eu quem comentei essa linha cima!
     ?>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'summary' => '',
        'columns' => [
            //['class' => 'yii\grid\SerialColumn'],

            'numero',
            'cartarecomendacao',
            'datainicio',
            'datafim',
            'documento',

            ['class' => 'yii\grid\ActionColumn','template'=>'{view}' ],
        ],
    ]); ?>
</div>

redpajama_set_name: RedPajamaGithub


text:
package de.hshannover.f4.trust.visitmeta.ifmap;

import org.apache.log4j.Logger;

import de.hshannover.f4.trust.ifmapj.channel.ARC;
import de.hshannover.f4.trust.visitmeta.dataservice.factories.InternalIdentifierFactory;
import de.hshannover.f4.trust.visitmeta.dataservice.factories.InternalMetadataFactory;
import de.hshannover.f4.trust.visitmeta.exceptions.ifmap.ConnectionCloseException;
import de.hshannover.f4.trust.visitmeta.exceptions.ifmap.ConnectionException;
import de.hshannover.f4.trust.visitmeta.interfaces.connections.MapServerConnection;
import de.hshannover.f4.trust.visitmeta.persistence.Writer;

/**
 * When a <tt>UpdateService</tt> is started, it will subscribe for the
 * configured start identifier and after that continuously poll for new
 * information on that subscription.
 *
 * @author Ralf Steuerwald
 *
 */
public class UpdateService implements Runnable {

	private static final Logger log = Logger.getLogger(UpdateService.class);

	protected final static int DEFAULT_MAX_RETRY = 10;
	protected final static int DEFAULT_RETRY_INTERVAL = 10;

	private MapServerConnection mConnection;

	protected Writer mWriter;

	protected InternalIdentifierFactory mIdentifierFactory;

	protected InternalMetadataFactory mMetadataFactory;

	protected de.hshannover.f4.trust.visitmeta.ifmap.IfmapJHelper mIfmapJHelper;

	/**
	 * Create a new {@link UpdateService} which uses the given writer to submit
	 * new {@link PollResult}s to the application.
	 *
	 * @param writer
	 * @param identifierFactory
	 * @param metadataFactory
	 */
	public UpdateService(MapServerConnection connection, Writer writer,
			InternalIdentifierFactory identifierFactory,
			InternalMetadataFactory metadataFactory) {
		log.trace("new UpdateService() ...");

		if (writer == null) {
			throw new IllegalArgumentException("writer cannot be null");
		}
		if (identifierFactory == null) {
			throw new IllegalArgumentException(
					"identifierFactory cannot be null");
		}
		if (metadataFactory == null) {
			throw new IllegalArgumentException("metadataFactory cannot be null");
		}

		mConnection = connection;
		mWriter = writer;
		mIdentifierFactory = identifierFactory;
		mMetadataFactory = metadataFactory;

		mIfmapJHelper = new de.hshannover.f4.trust.visitmeta.ifmap.IfmapJHelper(
				mIdentifierFactory);

		log.trace("... new UpdateService() OK");
	}

	/**
	 * Establish a new {@link ARC} to the MAPS and continuously poll for new
	 * data. The poll results get forwarded to the application.
	 */
	@Override
	public void run() {
		log.debug("run() ...");

		while (!Thread.interrupted()) {
			PollTask task = new PollTask(mConnection, mMetadataFactory, mIfmapJHelper);
			try {

				PollResult pollResult = task.call();
				mWriter.submitPollResult(pollResult);

			} catch (ConnectionCloseException e) {
				log.debug("Stop polling while: " + e.toString());
				break;

			} catch (PollException e) {
				log.error(e.toString(), e);
				break;

			} catch (ConnectionException e) {
				log.error(e.toString(), e);
				break;
			}
		}
		log.debug("... run()");
	}
}


text:
package api.web.gw2.jsonp.v2.characters.id.skills;

import api.web.gw2.mapping.core.IdValue;
import api.web.gw2.mapping.core.SetValue;
import api.web.gw2.mapping.v2.characters.id.skills.CharacterSkillPets;

import java.util.Collections;
import java.util.Set;

/**
 * Default JSON-P implementation of a Ranger's equipped pets.
 *
 * @author Fabrice Bouyé
 */
public final class JsonpCharacterSkillPets implements CharacterSkillPets {

    @SetValue
    @IdValue
    private Set<Integer> terrestrial = Collections.EMPTY_SET;
    @SetValue
    @IdValue
    private Set<Integer> aquatic = Collections.EMPTY_SET;

    /**
     * Creates a new empty instance.
     */
    public JsonpCharacterSkillPets() {
    }

    @Override
    public Set<Integer> getTerrestrial() {
        return terrestrial;
    }

    @Override
    public Set<Integer> getAquatic() {
        return aquatic;
    }
}


text:
//
// Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 generiert
// Siehe http://java.sun.com/xml/jaxb
// Änderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren.
// Generiert: 2016.07.29 um 11:26:52 AM CEST
//

package org.osgi.xmlns.scr.v1_1;

import java.util.HashMap;
import java.util.Map;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyAttribute;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
import javax.xml.namespace.QName;

/**
 *
Java-Klasse für Tproperty complex type.
 *
 *
Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist.
 *
 *

 * <complexType name="Tproperty">
 *   <simpleContent>
 *     <extension base="<http://www.w3.org/2001/XMLSchema>string">
 *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
 *       <attribute name="type" type="{http://www.osgi.org/xmlns/scr/v1.1.0}Tjava-types" default="String" />
 *       <anyAttribute/>
 *     </extension>
 *   </simpleContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Tproperty", propOrder = {
    "value"
})
public class Tproperty {

    @XmlValue
    protected String value;
    @XmlAttribute(name = "name", required = true)
    protected String name;
    @XmlAttribute(name = "type")
    protected TjavaTypes type;
    @XmlAnyAttribute
    private Map<QName, String> otherAttributes = new HashMap<QName, String>();

    /**
     * Ruft den Wert der value-Eigenschaft ab.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getValue() {
        return value;
    }

    /**
     * Legt den Wert der value-Eigenschaft fest.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setValue(String value) {
        this.value = value;
    }

    /**
     * Ruft den Wert der name-Eigenschaft ab.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getName() {
        return name;
    }

    /**
     * Legt den Wert der name-Eigenschaft fest.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setName(String value) {
        this.name = value;
    }

    /**
     * Ruft den Wert der type-Eigenschaft ab.
     *
     * @return
     *     possible object is
     *     {@link TjavaTypes }
     *
     */
    public TjavaTypes getType() {
        if (type == null) {
            return TjavaTypes.STRING;
        } else {
            return type;
        }
    }

    /**
     * Legt den Wert der type-Eigenschaft fest.
     *
     * @param value
     *     allowed object is
     *     {@link TjavaTypes }
     *
     */
    public void setType(TjavaTypes value) {
        this.type = value;
    }

    /**
     * Gets a map that contains attributes that aren't bound to any typed property on this class.
     *
     *

     * the map is keyed by the name of the attribute and
     * the value is the string value of the attribute.
     *
     * the map returned by this method is live, and you can add new attribute
     * by updating the map directly. Because of this design, there's no setter.
     *
     *
     * @return
     *     always non-null
     */
    public Map<QName, String> getOtherAttributes() {
        return otherAttributes;
    }

}


text:
package net.metanotion.scripting;

import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import net.metanotion.util.reflect.GetInitializer;
import net.metanotion.util.reflect.Initializer;
import net.metanotion.util.reflect.ReflectiveFieldInitializer;

/** This class stores a collection of constructors for "structs" indexed by class name.
*/
public final class StructManager implements Iterable<Map.Entry<String,GetInitializer>> {
	private final ConcurrentHashMap<String,GetInitializer> structs = new ConcurrentHashMap<>();

	/** Look up the initializer for a given struct by type name.
		@param name The type name of the struct to look up.
		@return an Initializer instance to create an instance of the struct.
	*/
	public Initializer getStruct(final String name) {
		final GetInitializer init = structs.get(name);
		if(init != null) { return init.initializer(); }
		try {
			final GetInitializer gi = ReflectiveFieldInitializer.getInitializer(Class.forName(name));
			structs.put(name, gi);
			return gi.initializer();
		} catch (ClassNotFoundException cnfe) { }
		/*
			Return a struct initializer
			#1 - look in cache for initializer
			#2 - Class.forName(name)
				#2a - bean utility class (ala my IDL compiler)
				#2b - Deal with final fields via constructor
				#2c - "field injector"
				#2d - Java Standard bean
			#3 - driver look up
		*/
		return null;
	}

	/** Add a new type to the cache of structs.
		@param name The type name of the struct we're adding.
		@param init The GetInitializer of the struct to produce initializers.
	*/
	public void setStruct(final String name, final GetInitializer init) { structs.put(name, init); }
	@Override public Iterator<Map.Entry<String,GetInitializer>> iterator() { return structs.entrySet().iterator(); }
}


text:
<template name="feed">

    {{>nav title="What's Cooking"}}

        {{#if ready}}
          {{#each activities}}
            {{> activity}}
          {{else}}

No one is cooking yet!

Share that you made a recipe and it will show up here.

          {{/each}}
        {{else}}

Loading

        {{/if}}

</template>


text:
/////////////////////////////////////////////////////////////////////////////
// Name:        dcclient.h
// Purpose:     wxClientDC class
// Author:      Julian Smart
// Modified by:
// Created:     01/02/97
// RCS-ID:      $Id: dcclient.h,v 1.21 2005/05/31 09:18:31 JS Exp $
// Copyright:   (c) Julian Smart
// Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////////

#ifndef _WX_DCCLIENT_H_
#define _WX_DCCLIENT_H_

// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------

#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
    #pragma interface "dcclient.h"
#endif

#include "wx/dc.h"
#include "wx/dynarray.h"

// ----------------------------------------------------------------------------
// array types
// ----------------------------------------------------------------------------

// this one if used by wxPaintDC only
struct WXDLLEXPORT wxPaintDCInfo;

WX_DECLARE_EXPORTED_OBJARRAY(wxPaintDCInfo, wxArrayDCInfo);

// ----------------------------------------------------------------------------
// DC classes
// ----------------------------------------------------------------------------

class WXDLLEXPORT wxWindowDC : public wxDC
{
public:
    // default ctor
    wxWindowDC();

    // Create a DC corresponding to the whole window
    wxWindowDC(wxWindow *win);

protected:
    // initialize the newly created DC
    void InitDC();

    // override some base class virtuals
    virtual void DoGetSize(int *width, int *height) const;

private:
    DECLARE_DYNAMIC_CLASS_NO_COPY(wxWindowDC)
};

class WXDLLEXPORT wxClientDC : public wxWindowDC
{
public:
    // default ctor
    wxClientDC();

    // Create a DC corresponding to the client area of the window
    wxClientDC(wxWindow *win);

    virtual ~wxClientDC();

protected:
    void InitDC();

    // override some base class virtuals
    virtual void DoGetSize(int *width, int *height) const;

private:
    DECLARE_DYNAMIC_CLASS_NO_COPY(wxClientDC)
};

class WXDLLEXPORT wxPaintDC : public wxClientDC
{
public:
    wxPaintDC();

    // Create a DC corresponding for painting the window in OnPaint()
    wxPaintDC(wxWindow *win);

    virtual ~wxPaintDC();

    // find the entry for this DC in the cache (keyed by the window)
    static WXHDC FindDCInCache(wxWindow* win);

protected:
    static wxArrayDCInfo ms_cache;

    // find the entry for this DC in the cache (keyed by the window)
    wxPaintDCInfo *FindInCache(size_t *index = NULL) const;

private:
    DECLARE_DYNAMIC_CLASS_NO_COPY(wxPaintDC)
};

/*
 * wxPaintDCEx
 * This class is used when an application sends an HDC with the WM_PAINT
 * message. It is used in HandlePaint and need not be used by an application.
 */

class WXDLLEXPORT wxPaintDCEx : public wxPaintDC
{
public:
    wxPaintDCEx(wxWindow *canvas, WXHDC dc);
    virtual ~wxPaintDCEx();
private:
    int saveState;

    DECLARE_CLASS(wxPaintDCEx)
    DECLARE_NO_COPY_CLASS(wxPaintDCEx)
};

#endif
    // _WX_DCCLIENT_H_


text:
from django.contrib.auth.models import User, Permission, Group
from .models import Key

class KeyAuthBackend(object):
    """
    Authentication backend
    """
    def authenticate(self, token=None):
        keys = Key.objects.filter(token=token).select_related('user')
        if keys and not keys[0].has_expired():
            return keys[0]

    def get_user(self, user_id):
        try:
            return User.objects.get(pk=user_id)
        except User.DoesNotExist:
            return None


text:
<?php

$languageStrings = array(
	'LBL_SELECT_PICKLIST_IN'       => 'Seleccionar lista desplegable en'          ,
	'LBL_ADD_VALUE'                => 'Agregar Elemento'                   ,
	'LBL_RENAME_VALUE'             => 'Renombrar Elemento'                ,
	'LBL_DELETE_VALUE'             => 'Eliminar Elemento'                ,
	'LBL_ITEMS'                    => 'Elementos'                      ,
	'LBL_DRAG_ITEMS_TO_RESPOSITION' => 'Arrastra los elementos para reposicionarlos',
	'LBL_SELECT_AN_ITEM_TO_RENAME_OR_DELETE' => 'Selecciona un elemento para renombrarlo o eliminarlo',
	'LBL_TO_DELETE_MULTIPLE_HOLD_CONTROL_KEY' => 'Para eliminar múltiples elementos, oprime la tecla Ctrl mientras seleccionas los elementos a borrar',
	'LBL_ADD_ITEM_TO'              => 'Agregar elemento a'                 ,
	'LBL_ITEM_VALUE'               => 'Valor del elemento'                  ,
	'LBL_ITEM_TO_RENAME'           => 'Elemento a renombrar'              ,
	'LBL_ENTER_NEW_NAME'           => 'Agrega el nuevo nombre'              ,
	'LBL_RENAME_PICKLIST_ITEM'     => 'Renombrar elemento de lista desplegable'        ,
	'LBL_DELETE_PICKLIST_ITEMS'    => 'Eliminar elementos de lista desplegable'       ,
	'LBL_ITEMS_TO_DELETE'          => 'Elementos a eliminar'             ,
	'LBL_REPLACE_IT_WITH'          => 'Reemplazar con'             ,
	'LBL_ASSIGN_TO_ROLE'           => 'Asignar a Rol'              ,
	'LBL_ALL_ROLES'                => 'Todos los roles'                   ,
	'LBL_CHOOSE_ROLES'             => 'Seleccionar roles'                ,
	'LBL_ALL_VALUES'               => 'Todos los Elementos'                  ,
	'LBL_VALUES_ASSIGNED_TO_A_ROLE' => 'Elementos asignados al rol'   ,
	'LBL_ASSIGN_VALUE'             => 'Asignar Elemento'                ,
	'LBL_SAVE_ORDER'               => 'Guardar Orden'                  ,
	'LBL_ROLE_NAME'                => 'Nombre del Rol'                   ,
	'LBL_SELECTED_VALUES_MESSGAE'  => 'Se mostrará para el usuario con este rol',
	'LBL_ENABLE/DISABLE_MESSGAE'   => 'Clic en el elemento para habilitar/deshabilitar. Despues clic en Guardar',
	'LBL_ASSIGN_VALUES_TO_ROLES'   => 'Asignar Elementos a roles'      ,
	'LBL_SELECTED_VALUES'          => 'Elementos seleccionados'             ,
	'NO_PICKLIST_FIELDS'           => 'No existen campos de lista desplegable',

	//Translation for module
	'Calendar' 						=> 'Por hacer',
);
$jsLanguageStrings = array(
	'JS_ITEM_RENAMED_SUCCESSFULLY' => 'Elemento renombrado exitosamente'   ,
	'JS_ITEM_ADDED_SUCCESSFULLY'   => 'Elemento agregado exitosamente'     ,
	'JS_NO_ITEM_SELECTED'          => 'Elemento no seleccionado'            ,
	'JS_MORE_THAN_ONE_ITEM_SELECTED' => 'Más de un elemento seleccionado' ,
	'JS_ITEMS_DELETED_SUCCESSFULLY' => 'Elementos eliminados exitosamente'  ,
	'JS_YOU_CANNOT_DELETE_ALL_THE_VALUES' => 'No puedes eliminar todos los elementos',
	'JS_ALL_ROLES_SELECTED'        => 'Todos los roles seleccionados'          ,
	'JS_LIST_UPDATED_SUCCESSFULLY' => 'Lista actualizada exitosamente'   ,
	'JS_SEQUENCE_UPDATED_SUCCESSFULLY' => 'Secuencia actualizada exitosamente',
	'JS_VALUE_ASSIGNED_SUCCESSFULLY' => 'Elemento asignado exitosamente' ,
	'JS_PLEASE_SELECT_MODULE'      => 'Selecciona el módulo'        ,
);


text:
using System.Collections;
using UnityEngine;

public enum UIBaseTypes {
    UI_TYPE_ROOT = 0,
    UI_TYPE_LOADER = 1,
    UI_TYPE_STATIC = 2,
    UI_TYPE_DYNAMIC = 3,
    UI_TYPE_DYNAMIC_GAME = 4
}


text:
class IFacebookParse : public IModuleInterface
{

public:

	static inline IFacebookParse& Get()
	{
		return FModuleManager::LoadModuleChecked< IFacebookParse >( "FacebookParse" );
	}

	static inline bool IsAvailable()
	{
		return FModuleManager::Get().IsModuleLoaded( "FacebookParse" );
	}
};


text:
__author__ = 'jsommers@colgate.edu'
__doc__ = '''
Storage upload functions for capture daemon proxy server that handles
calls from GIMS UI-side client.

This source code is licensed under the GENI public license.
See www.geni.net, or "geni_public_license.txt" that should
have accompanied this software.
'''

import os
import sys
import threading
import logging
import multiprocessing
import Queue
import signal
import xml.etree.ElementTree
import time
import StringIO

running = True

def sighandler(signum, stackframe):
    global running
    running = False

try:
    import paramiko
    have_ssh = True
except:
    have_ssh = False

try:
    import boto.s3 as s3
    have_s3 = True
except:
    have_s3 = False

def mark_complete_upload(basedir, expt, storetype, metaname, logger):
    '''
    Includes into the completed_upload file entry for the uploaded file
    and records the new number of uploaded files for getExperimentStats
    '''
    completed_upload = './' + os.sep + 'completed_upload.txt'

    try:
        fd = os.open(completed_upload, os.O_WRONLY|os.O_APPEND|os.O_CREAT)
        xstr = '%s %s %s %s\n' % (expt,os.path.basename(metaname),storetype,time.strftime("%Y%m%d-%H%M%S",time.gmtime()))
        os.write(fd,xstr)
        os.close(fd)
        logger.info('%s Uploaded file %s. Storage type is %s.' % (expt, metaname, storetype))
    except OSError,e:
        print >>sys.stderr,'Unable to write to completed_upload.txt file:',str(e)

def local_upload(basedir, log, exptid, filelist):
    '''
    Local upload handler.  Basically does a whole lot of nothing.
    '''
    for ftup in filelist:
        log.info('%s Local file %s for experiment is ready.' % (exptid, ftup[0]))
        mark_complete_upload(basedir, exptid, 'local', ftup[0], log)

def s3_upload(basedir, log, exptid, s3accesskey, s3secretkey, bucketname, filelist):
    '''
    Amazon S3 upload handler.  Normally spawned in a separate thread to handle
    uploading a list of files to a given bucket, with the given credentials.
    '''
    if not len(filelist): return

    try:
        #log.debug('s3 access key: %s' % (s3accesskey))
        #log.debug('s3 secret key: %s' % (s3secretkey))
        #log.debug('s3 bucket: %s' % (bucketname))
        conn = s3.Connection(aws_access_key_id=s3accesskey, aws_secret_access_key=s3secretkey)
        cid = conn.get_canonical_user_id()
        log.debug('%s Got s3 connection for experiment; canonical s3 user id: %s' % (exptid, cid))

        b = None
        try:
            b = conn.get_bucket(bucketname)
        except:
            pass

        if not b:
            log.warn('%s No such bucket %s exists for experiment --- creating it' % (exptid, bucketname))
            conn.create_bucket(bucketname)

        for ftup in filelist:
            log.info('%s Uploading file %s to s3 bucket %s' % (exptid, str(ftup[0]), bucketname))
            key = b.new_key(ftup[1])
            key.set_contents_from_filename(ftup[0])
            mark_complete_upload(basedir, exptid, 's3', ftup[0], log)

    except Exception,e:
        log.warn('%s Upload of file to bucket %s failed: %s' % (exptid, bucketname, str(e)))

def sftp_upload(basedir, log, exptid, hostname, username, pkeystr, filelist, remotepath, port=22):
    '''
    SSH upload handler.  Needs a string containing the private SSH key
    (as well as other relevant SSH info).  Normally spawned in a
    separate thread to upload a list of files to the given remote
    destination.
    '''
    if not len(filelist): return

    log.debug('%s In sftp_upload; uploading to %s@%s' % (exptid, username, hostname))
    for f in filelist:
        log.debug('%s Going to move %s -> %s' % (exptid, f[0], f[1]))

    maxattempts = 5
    attempts = maxattempts
    success = False
    sleeptime = 0.5
    while attempts > 0 and not success:
        try:
            fobj = StringIO.StringIO(pkeystr)
            privkey = paramiko.RSAKey.from_private_key(fobj)
            fobj.close()
            t = paramiko.Transport((hostname, port))
            t.use_compression(True)
            t.connect(username=username, pkey=privkey)
            sftp = paramiko.SFTPClient.from_transport(t)
            success = True
        except paramiko.SSHException,e:
            log.warn(exptid + ' Error connecting to remote SSH server: ' + str(e) + '.  Trying ' + str(attempts) + '  more times.')
            attempts -= 1
            time.sleep(sleeptime)
            sleeptime *= 2

    if not success:
        log.warn(exptid + ' Gave up trying to connect to remote SSH server after ' + str(maxattempts) + ' attempts.')
        return

    remotepath = remotepath+os.sep+exptid

    try:
        sftp.mkdir(remotepath)
    except:
        # essentially ignore errors; really fail if we can't chdir
        pass

    try:
        sftp.chdir(remotepath)
    except Exception,e:
        log.warn(exptid + ' Error chdiring to destination folder on SSH server: ' + str(e))
        return

    for ftup in filelist:
        success = False

        log.info(exptid + ' Starting upload of file '+str(ftup[0])+' to '+username+'@'+hostname+':'+str(ftup[1]))
        try:
            sftp.put(ftup[0], ftup[1])
            log.info(exptid + ' Finished upload of file '+str(ftup[0])+' to '+username+'@'+hostname+':'+str(ftup[1]))
            success = True
        except Exception,e:
            log.warn(exptid + ' Error transferring file over sftp: ' + str(e))

        mark_complete_upload(basedir, exptid, 'ssh', ftup[0], log)

    try:
        t.close()
    except paramiko.SSHException,e:
        log.warn(exptid + ' Error disconnecting from remote SSH server: ' + str(e))

def update_metadata(filelist):
    '''
    Update file metadata prior to upload.   ** FIXME **
    '''
    # print filelist
    pass

def uploader_entry(logger, exptid, basedir, metadir, metafile, storetype, storecred):
    '''
    Thread entrypoint for performing upload of a metadata file and
    data file.
    '''
    filelist = [ metafile ]
    etree = xml.etree.ElementTree.parse(metadir + os.sep + filelist[0])
    datael = etree.find('data_file')
    if datael != None:
        filelist.append(datael.text[:].strip())

    # full-path list of source files to transfer
    srcflist = [ metadir + os.sep + f for f in filelist ]

    # perform updates to metadata
    update_metadata(srcflist)

    if storetype == 's3':
        s3_upload(basedir, logger, exptid, storecred[0], storecred[1], storecred[2], zip(srcflist, filelist))

    elif storetype == 'ssh':
        # basenames = filelist[:]
        remotepath = storecred[3] + os.sep
        # destflist = [ xpath + f for f in basenames ]
        sftp_upload(basedir, logger, exptid, storecred[1], storecred[0], storecred[2], zip(srcflist, filelist), remotepath, storecred[4])

    else: # local storage
        local_upload(basedir, logger, exptid, zip(srcflist, filelist))

def storage_agent(recvq, sendq, basedir, debug):
    '''
    Main process entrypoint for a storage agent.  One storage agent is
    started up per capture proxy daemon process and handles all available
    types of uploading capabilities (local, s3, ssh).
    '''

    fileout = logging.FileHandler('storage_agent.log')
    format = logging.Formatter('%(asctime)s %(name)-14s %(levelname)-8s %(message)s')
    fileout.setFormatter(format)
    logger = logging.getLogger('storage_agent')
    logger.addHandler(fileout)

    if debug:
        logger.setLevel(logging.DEBUG)
    else:
        logger.setLevel(logging.INFO)
    logger.info("GEN Storage agent starting up.")
    logger.info("GEN Using local storage.")

    if have_s3:
        logger.info("GEN Using s3 storage.")
    else:
        logger.info("GEN No s3 storage capability.")

    if have_ssh:
        logger.info("GEN Using ssh storage.")
        try:
            # underlying crypto library requires that rng is reseeded post-fork
            # ugh.  need to unconditionally handle any exceptions; different
            # versions of the library behave differently.
            import Crypto.Random
            Crypto.Random.atfork()
        except:
            pass
    else:
        logger.info("GEN No ssh storage capability.")

    signal.signal(signal.SIGINT, sighandler)
    signal.signal(signal.SIGTERM, sighandler)

    recvq.cancel_join_thread()
    sendq.cancel_join_thread()

    experiments = {}
    moverthreads = {}
    experimentstoremove = []
    completed_capture = './' + os.sep + 'completed_capture.txt'
    completed_upload = './' + os.sep + 'completed_upload.txt'

    # read in file that contains list of meta files that have been
    # handled for upload already.  use this list to determine whether
    # a given file needs to be uploaded or not.
    try:
        upload_inf = open(completed_upload)
        for line in upload_inf:
            (expt,metafile,stype,ts) = line.strip().split()
            if expt in experiments:
                expt_info = experiments[expt]
            else:
                expt_info = [ 'Unknown', 'Unknown', set() ]
                experiments[expt] = expt_info
            expt_info[-1].add(metafile)
        upload_inf.close()
    except Exception,e:
        logger.info("GEN completed_upload.txt didn't previously exist.")

    global running
    while running or len(moverthreads):
        task = None
        try:
            task = recvq.get(True, 5.0)
        except Queue.Empty:
            pass
        except IOError,e:
            logger.info('GEN IO exception while waiting for queue receive: %s' % (str(e)))
            continue

        # test whether we should exit; we've been asked to exit, but can't
        # until no more upload threads remain.
        if not running and len(moverthreads):
         #put id here
            logger.info("GEN Storage task waiting to die --- waiting for %d upload thread to complete" % (len(moverthreads)))

        # go through list of experiments to remove; test whether there
        # are any remaining upload threads left.  if not, remove the
        # experiment
        for expt in experimentstoremove:
            count = len([ t for t in moverthreads if moverthreads[t] == expt ])
            if count == 0:
                # no more upload threads, and experiments was stopped, so
                # remove it.
                del experiments[expt]
                logger.info("%s Experiment removed; no more upload threads remain." % (expt))

        if task:
            # we'll get one of three commands: STOP, NEWEXPT, or RMEXPT
            if task[0] == 'STOP':
                # time for the storage process to die
                logger.info("GEN Received STOP command.")
                running = False
                if len(moverthreads):
                    logger.info("GEN Waiting for %d upload thread to complete" % (len(moverthreads)))

            elif task[0] == 'NEWEXPT':
                # a new experiment has started; organize the experiment
                # info and register the directory to be periodically
                # checked to upload contents
                expt = task[1]
                storetype = task[2]
                storecred = task[3]
                exptdir = task[4]
                if expt in experiments:
                    # if experiment already exists, just update storage info
                    experiments[expt][0] = storetype
                    experiments[expt][1] = storecred
                else:
                    experiments[expt] = [ storetype, storecred, set()]
                logger.info("%s new experiment of interest registered." % (expt))
            elif task[0] == 'RMEXPT':
                # an experiment has stopped.  don't remove this experiment
                # from interest until any uploads have completed.  for now,
                # don't bother removing any local files.
                expt = task[1]
                logger.info("%s Experiment marked for removal." % (expt))
                experimentstoremove.append(expt)

        # test whether any mover threads are done; clean them up if
        # possible.
        deadmovers = []
        for t in moverthreads:
            if not t.isAlive():
                t.join(timeout=1)
                deadmovers.append(t)

        for t in deadmovers:
            del moverthreads[t]

        # go through "completed_capture.txt" file that contains
        # a list of all metadata files that are completely done with
        # capture and are awaiting upload
        try:
            completed_inf = open(completed_capture)
            for line in completed_inf:
                (expname, metafullfile) = line.strip().split()
                metadir = os.path.dirname(metafullfile)
                metafile = os.path.basename(metafullfile)

                if expname not in experiments:
                    experiments[expname] = ['Unknown']
                    logger.info("%s Metadump produced by unknown experiment" % (expname))
                    continue

                # get experiment info for this experiment: storage type,
                # storage credentials, and set of files already transferred
                expt_info = experiments[expname]
                if expt_info[0] == 'Unknown':
                    logger.debug("%s Ignoring experiment with unknown storage details" % (expname))
                    continue

                # if this file has already been uploaded, ignore it.
                if metafile in expt_info[-1]:
                    logger.debug("%s File %s for experiment has already been uploaded." % (expname, metafile))
                    continue

                else:
                    # handle upload for this new file.  add it to set
                    # of metafiles that have been "handled", and do
                    # the upload.
                    expt_info[2].add(metafile)
                    t = threading.Thread(target=uploader_entry, args=(logger, expname, basedir, metadir, metafile, storetype, storecred))
                    moverthreads[t] = expname
                    t.start()
                    logger.debug('GEN Spawned upload thread %s' % (t.getName()))
            completed_inf.close()

        except OSError,e:
            logger.info("GEN exception while probing completed_capture.txt: " + str(e))
        except IOError,e:
            logger.debug("GEN completed_capture.txt doesn't exist.  Nothing to transfer.")

    logger.info("GEN Storage agent terminated.")
    return 0

if __name__ == '__main__':
    '''
    Unit tests for storage capabilities.  Simple method for noting local files,
    and uploading to ssh or s3.
    '''
    xkey = '''
'''
    logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s')
    toc,fromc = multiprocessing.Queue(),multiprocessing.Queue()
    basedir = os.getcwd() + os.sep + 'capture-daemon'
    # local
    # toc.put( ('NEWEXPT', 'unnamed', 'local', os.getcwd(), os.getcwd()) )
    # ssh
    # toc.put( ('NEWEXPT', 'EXP_A4605CED', 'ssh', ('jsommers','cs.colgate.edu',xkey,'','22'), os.getcwd()))
    # s3
    # toc.put( ('NEWEXPT', 'EXP_A4605CED', 's3', ('access','secret','sommers.joel.buckettest'), os.getcwd()))

    storage_agent(toc, fromc, basedir, 1)


text:
package com.simplegame.server.bus.sync;

import javax.annotation.Resource;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

import com.simplegame.core.message.Message;
import com.simplegame.core.sync.Lock;
import com.simplegame.core.sync.LockManager;
import com.simplegame.server.bus.client.io.command.ClientIoCommands;
import com.simplegame.server.bus.share.constants.BusShareConstant;
import com.simplegame.server.bus.share.service.IRoleStateService;

/**
 * @Author zeusgooogle@gmail.com
 * @sine 2015年9月12日 上午10:36:25
 *
 */
@Component
@Aspect
public class BusSyncAspect {

	private Logger LOG = LogManager.getLogger(getClass());

	@Resource
	private LockManager lockManager;

	@Resource
	private IRoleStateService roleStateService;

	@Pointcut(value = "execution(* com.simplegame.server.bus..*Action.*(..) )")
	public void pointcut() {

	}

	@Around(value = "pointcut()")
	public void run(ProceedingJoinPoint joinpoint) throws Throwable {
		LOG.info(joinpoint.toShortString());

		Message message = (Message) joinpoint.getArgs()[0];
		String command = message.getCommand();
		String roleId = message.getRoleId();

		Lock lock = this.lockManager.getLock(BusShareConstant.COMPONENT_NAME, roleId);

		synchronized (lock) {

			if (this.roleStateService.isOnline(roleId) || ClientIoCommands.ROLE_IN.equals(command)) {
				joinpoint.proceed();
				return;
			}

			LOG.error("role: {} bus not online. message: {}", roleId, message.toString());
		}
	}

	@AfterThrowing(value = "pointcut()", throwing = "e")
    public void exception(Exception e) {
        LOG.error("execute bus sync aspect error: {}", e.getMessage(), e);
    }

}


text:
Imports System
Imports System.Drawing
Imports System.Collections
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Diagnostics
Imports System.IO
Imports System.Xml
Imports AnimatGuiCtrls.Controls
Imports AnimatGUI.Framework

Namespace DataObjects.Behavior.Nodes

    Public Class PhysicalToNodeAdapter
        Inherits Behavior.Nodes.Adapter

#Region " Attributes "

        <Browsable(False)> _
        Public Overrides ReadOnly Property IsValid() As Boolean
            Get
                If Not m_bIsInitialized Then
                    Return False
                End If

                If m_bnOrigin Is Nothing Then
                    Return False
                End If

                If m_bnDestination Is Nothing Then
                    Return False
                End If

                'If the origin or destination is an offpage then take care of that.
                Dim bnOrigin As AnimatGUI.DataObjects.Behavior.Node
                Dim bnDestination As AnimatGUI.DataObjects.Behavior.Node

                If TypeOf m_bnOrigin Is AnimatGUI.DataObjects.Behavior.Nodes.OffPage Then
                    Dim bnOffpage As Behavior.Nodes.OffPage = DirectCast(m_bnOrigin, Behavior.Nodes.OffPage)
                    bnOrigin = bnOffpage.LinkedNode.Node
                Else
                    bnOrigin = m_bnOrigin
                End If

                If TypeOf m_bnDestination Is AnimatGUI.DataObjects.Behavior.Nodes.OffPage Then
                    Dim bnOffpage As Behavior.Nodes.OffPage = DirectCast(m_bnDestination, Behavior.Nodes.OffPage)
                    bnDestination = bnOffpage.LinkedNode.Node
                Else
                    bnDestination = m_bnDestination
                End If

                'Do not attempt to save this adapter if there is no source data type specified.
                If m_thSourceDataTypes.ID.Trim.Length = 0 Then
                    Return False
                End If

                'If the destination is not a body part type (physics engine part) then we can not save the adapter.
                If Not Util.IsTypeOf(bnOrigin.GetType(), GetType(DataObjects.Behavior.Nodes.BodyPart), False) Then
                    Return False
                End If

                Dim bpPart As DataObjects.Behavior.Nodes.BodyPart = DirectCast(bnOrigin, DataObjects.Behavior.Nodes.BodyPart)
                Dim nmTarget As NeuralModule = DirectCast(m_doOrganism.NeuralModules(bnDestination.NeuralModuleType.FullName), NeuralModule)

                'If the linked physical body part is not set then we can not save the adapter.
                If bpPart.LinkedPart Is Nothing OrElse bpPart.LinkedPart.BodyPart Is Nothing OrElse m_doOrganism.FindBodyPart(bpPart.LinkedPart.BodyPart.ID, False) Is Nothing Then
                    Return False
                End If

                Return True
            End Get
        End Property

#End Region

#Region " Properties "

        Public Overrides ReadOnly Property TypeName() As String
            Get
                Return "Physical To Node Adapter"
            End Get
        End Property

        Public Overrides ReadOnly Property AdapterType() As String
            Get
                Return "PhysicalToNode"
            End Get
        End Property
#End Region

#Region " Methods "

        Public Sub New(ByVal doParent As AnimatGUI.Framework.DataObject)
            MyBase.New(doParent)

            Me.Name = "Physical To Node Adapter"
            Me.Description = "Provides an interface adapter between an item in the physics engine and a node."
        End Sub

        Public Overrides Function Clone(ByVal doParent As AnimatGUI.Framework.DataObject, ByVal bCutData As Boolean, _
                                        ByVal doRoot As AnimatGUI.Framework.DataObject) As AnimatGUI.Framework.DataObject
            Dim oNewNode As New Behavior.Nodes.PhysicalToNodeAdapter(doParent)
            oNewNode.CloneInternal(Me, bCutData, doRoot)
            If Not doRoot Is Nothing AndAlso doRoot Is Me Then oNewNode.AfterClone(Me, bCutData, doRoot, oNewNode)
            Return oNewNode
        End Function

        Protected Overridable Sub SaveSimulationXmlInternal(ByVal oXml As ManagedAnimatInterfaces.IStdXml, _
                                         ByVal nmTarget As NeuralModule, _
                                         ByVal bnOrigin As AnimatGUI.DataObjects.Behavior.Node, ByVal bnDestination As AnimatGUI.DataObjects.Behavior.Node, _
                                         ByVal bpPart As DataObjects.Behavior.Nodes.BodyPart, _
                                         Optional ByRef nmParentControl As AnimatGUI.Framework.DataObject = Nothing, Optional ByVal strName As String = "")

            oXml.AddChildElement("Adapter")
            oXml.IntoElem()

            oXml.AddChildElement("ID", Me.ID)
            oXml.AddChildElement("Name", Me.Name)
            oXml.AddChildElement("Enabled", Me.Enabled)

            oXml.AddChildElement("ModuleName", Me.ModuleName)

            oXml.AddChildElement("Type", Me.AdapterType)
            oXml.AddChildElement("SourceModule", "AnimatLab")
            oXml.AddChildElement("SourceID", bpPart.LinkedPart.BodyPart.ID())
            oXml.AddChildElement("SourceDataType", m_thSourceDataTypes.ID)
            oXml.AddChildElement("TargetModule", nmTarget.ModuleName)
            oXml.AddChildElement("TargetID", bnDestination.ID)
            oXml.AddChildElement("TargetDataType", m_thTargetDataTypes.ID)
            oXml.AddChildElement("DelayBufferMode", Convert.ToInt32(m_eDelayBufferMode))
            m_snDelayBufferInterval.SaveSimulationXml(oXml, Me, "DelayBufferInterval")
            oXml.AddChildElement("RobotIOScale", m_fltRobotIOScale)
            m_snInitIODisableDuration.SaveSimulationXml(oXml, Me, "InitIODisableDuration")

            oXml.AddChildElement("SynchWithRobot", m_bSynchWithRobot)
            m_snSynchUpdateInterval.SaveSimulationXml(oXml, Me, "SynchUpdateInterval")
            m_snSynchUpdateStartInterval.SaveSimulationXml(oXml, Me, "SynchUpdateStartInterval")

            m_gnGain.SaveSimulationXml(oXml, Nothing, "Gain")

            oXml.OutOfElem() 'Outof Neuron

        End Sub

        Public Overrides Sub SaveSimulationXml(ByVal oXml As ManagedAnimatInterfaces.IStdXml, Optional ByRef nmParentControl As AnimatGUI.Framework.DataObject = Nothing, Optional ByVal strName As String = "")

            If Not m_bIsInitialized Then
                Return
            End If

            If m_bnOrigin Is Nothing Then
                Throw New System.Exception("The origin node for adapter '" & Me.Name & "' is not defined!")
            End If

            If m_bnDestination Is Nothing Then
                Throw New System.Exception("The destination node for adapter '" & Me.Name & "' is not defined!")
            End If

            'If the origin or destination is an offpage then take care of that.
            Dim bnOrigin As AnimatGUI.DataObjects.Behavior.Node
            Dim bnDestination As AnimatGUI.DataObjects.Behavior.Node

            If TypeOf m_bnOrigin Is AnimatGUI.DataObjects.Behavior.Nodes.OffPage Then
                Dim bnOffpage As Behavior.Nodes.OffPage = DirectCast(m_bnOrigin, Behavior.Nodes.OffPage)
                bnOrigin = bnOffpage.LinkedNode.Node
            Else
                bnOrigin = m_bnOrigin
            End If

            If TypeOf m_bnDestination Is AnimatGUI.DataObjects.Behavior.Nodes.OffPage Then
                Dim bnOffpage As Behavior.Nodes.OffPage = DirectCast(m_bnDestination, Behavior.Nodes.OffPage)
                bnDestination = bnOffpage.LinkedNode.Node
            Else
                bnDestination = m_bnDestination
            End If

            'Do not attempt to save this adapter if there is no source data type specified.
            If m_thSourceDataTypes.ID.Trim.Length = 0 Then
                Return
            End If

            'If the destination is not a body part type (physics engine part) then we can not save the adapter.
            If Not Util.IsTypeOf(bnOrigin.GetType(), GetType(DataObjects.Behavior.Nodes.BodyPart), False) Then
                Return
            End If

            Dim bpPart As DataObjects.Behavior.Nodes.BodyPart = DirectCast(bnOrigin, DataObjects.Behavior.Nodes.BodyPart)
            Dim nmTarget As NeuralModule = DirectCast(m_doOrganism.NeuralModules(bnDestination.NeuralModuleType.FullName), NeuralModule)

            'If the linked physical body part is not set then we can not save the adapter.
            If bpPart.LinkedPart Is Nothing OrElse bpPart.LinkedPart.BodyPart Is Nothing OrElse m_doOrganism.FindBodyPart(bpPart.LinkedPart.BodyPart.ID, False) Is Nothing Then
                Return
            End If

            If Not m_thSourceDataTypes Is Nothing AndAlso m_thSourceDataTypes.ID.Trim.Length > 0 AndAlso _
                Not bpPart Is Nothing AndAlso Not bpPart.LinkedPart Is Nothing AndAlso Not bpPart.LinkedPart.BodyPart Is Nothing AndAlso _
                Not m_gnGain Is Nothing Then
                SaveSimulationXmlInternal(oXml, nmTarget, bnOrigin, bnDestination, bpPart, nmParentControl, strName)
            End If

        End Sub

#Region " DataObject Methods "

#End Region

#End Region

    End Class

End Namespace


text:
`Math_RemainderInt32` returns the remainder of two 32-bit signed integers.

```csharp
Math_RemainderInt32 (
	@a INT,
	@b INT)
RETURNS INT
```

## Parameters

 - **a**: A dividend.
 - **b**: A divisor

## Returns

The remainder of the specified numbers.

## Example

```csharp
SELECT SQLNET::Math_RemainderInt32(2147483647, 2000)
```


text:
package xyz.enhorse.lfp.media;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
 * 25.06.2015.
 */
public class BanerTest {
    @Test
    public void testToString() throws Exception {
        Baner baner = new Baner("литойбанер");
        assertEquals("Media {литой банер (литобанер)}", baner.toString());

        baner = new Baner("лмбнр");
        assertEquals("Media {ламинированный банер (ламбанер)}", baner.toString());

        baner = new Baner("бнр");
        assertEquals("Media {литой банер 400-500гр. (банер)}",
                baner.toString());

        baner = new Baner("трбнр");
        assertEquals("Media {транслюсцентный банер (трансбанер)}", baner.toString());

        baner = new Baner("трансбаннер");
        assertEquals("Media {транслюсцентный банер (трансбанер)}", baner.toString());

        baner = new Baner("транслюсцентный баннер");
        assertEquals("Media {транслюсцентный банер (трансбанер)}", baner.toString());
    }
}


text:
module.exports = function() {
	'use strict';

	var _ = require('lodash');
	var filters = {};
	var mapWidth = 4;
	var mapHeight = 3;

	filters.empty = function(targets, me) {
		return _.filter(targets, function(target) {
			return !target.card;
		});
	};

	filters.full = function(targets, me) {
		return _.filter(targets, function(target) {
			return !!target.card;
		});
	};

	filters.spaceAhead = function(targets, me) {
		return _.filter(targets, function(target) {
			return target.rowNum < mapHeight-1;
		});
	};

	filters.friend = function(targets, me) {
		return _.filter(targets, function(target) {
			return target.account.team === me.team;
		});
	};

	filters.enemy = function(targets, me) {
		return _.filter(targets, function(target) {
			return target.account.team !== me.team;
		});
	};

	filters.front = function(targets, me) {
		return _.filter(targets, function(target) {
			if(!target.card) {
				return false;
			}
			if(target.rowNum === mapHeight-1) {
				return true;
			}
			for(var i=(target.rowNum+1); i<mapHeight; i++) {
				var higherTarget = target.column[i];
				if(higherTarget && higherTarget.card) {
					return false;
				}
			};
			return true;
		});
	};

	filters.male = function(targets, me) {
		return _.filter(targets, function(target) {
			return target.card && target.card.abilities.indexOf('male') !== -1;
		});
	};

	filters.female = function(targets, me) {
		return _.filter(targets, function(target) {
			return target.card && target.card.abilities.indexOf('feml') !== -1;
		});
	};

	filters.owned = function(targets, me) {
		return _.filter(targets, function(target) {
			return target.account._id === me._id;
		});
	};

	return filters;

}();


text:
<?php
namespace Tuum\Router;

/**
 * Interface RouteNamesInterface
 *
 * an interface for obtaining url from route names.
 *
 */
interface ReverseRouteInterface
{
    /**
     * @param string $name
     * @param array  $args
     * @return string
     */
    public function generate($name, $args=[]);
}


text:
using System;

public class ForChooseServer
{
    public string host;
    public string id;
    public string name;
    public int status;
}


text:
title: Describe
weight: 100
---

# `formica describe`

Through the describe command you can see the changes that would be performed with the current ChangeSet. The output
created by the describe command is also printed when running [`formica new`]({{< relref "new.md" >}}) or [`formica change`]({{< relref "change.md" >}}).

## Example

Before printing the actual changes the output constists of all parameters, tags and capabilities given to either
[`formica new`]({{< relref "new.md" >}}) or [`formica change`]({{< relref "change.md" >}}) when creating the ChangeSet.

After that a table with the following action will be printed:

* **Action**: Action on that resource
* **LogicalId**: Id in the CloudFormationTemplate
* **PhysicalId**: Id of the actual AWS resource (if available), e.g. S3 Bucket name
* **Type**: Type of the Resource
* **Replacement**: True if Resource will be replaced due to action performed against it, empty otherwise
* **Changed**: Any attribute of that resource that will be changed when the ChangeSet gets deployed

```
root@07e549506145:/app/docs/examples/s3-bucket# formica change  --stack formica-example-stack
Removing existing change set
Change set submitted, waiting for CloudFormation to calculate changes ...
Change set created successfully
Deployment metadata:
+---------------+--+
| Parameters    |  |
+---------------+--+
| Tags          |  |
+---------------+--+
| Capabilities  |  |
+---------------+--+

Resource Changes:
+--------+-------------------+-------------------------------------------------------+-----------------+-------------+------------+
| Action |     LogicalId     |                      PhysicalId                       |      Type       | Replacement |  Changed   |
+========+===================+=======================================================+=================+=============+============+
| Remove | DeploymentBucket  | formica-example-stack-deploymentbucket-57ouvt2o46yh   | AWS::S3::Bucket |             |            |
+--------+-------------------+-------------------------------------------------------+-----------------+-------------+------------+
| Modify | DeploymentBucket2 | formica-example-stack-deploymentbucket2-1ov3l9pces9mu | AWS::S3::Bucket | True        | BucketName |
+--------+-------------------+-------------------------------------------------------+-----------------+-------------+------------+
| Add    | DeploymentBucket3 |                                                       | AWS::S3::Bucket |             |            |
+--------+-------------------+-------------------------------------------------------+-----------------+-------------+------------+
```

## Usage

```
usage: formica describe [-h] [--region REGION] [--profile PROFILE]
                        [--stack STACK]
                        [--config-file CONFIG_FILE [CONFIG_FILE ...]]

Describe the latest change-set of the stack

optional arguments:
  -h, --help            show this help message and exit
  --region REGION       The AWS region to use
  --profile PROFILE     The AWS profile to use
  --stack STACK, -s STACK
                        The Stack to use
  --config-file CONFIG_FILE [CONFIG_FILE ...], -c CONFIG_FILE [CONFIG_FILE ...]
                        Set the config files to use
```


text:
(function () {
    function redirectToTaskView(e) {
        var ignoreParentElement = KB.dom(e.target).parent('a, .task-board-change-assignee');
        if (ignoreParentElement) {
            return;
        }

        var taskElement = KB.dom(e.target).parent('.task-board');
        if (taskElement) {
            var taskUrl = KB.dom(taskElement).data('taskUrl');

            if (taskUrl) {
                window.location = taskUrl;
            }
        }
    }

    function openEditTask(e) {
        var baseElement = KB.dom(e.target).parent('.task-board-change-assignee');
        var url = KB.dom(baseElement).data('url');

        if (url) {
            KB.modal.open(url, 'medium', false);
        }
    }

    KB.onClick('.task-board *', redirectToTaskView, true);
    KB.onClick('.task-board-change-assignee *', openEditTask, true);
}());


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

	<title>FCKeditor - Adobe AIR Sample</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="robots" content="noindex, nofollow" />
	<link href="../sample.css" rel="stylesheet" type="text/css" />

		FCKeditor - Adobe AIR Sample

		This sample loads FCKeditor with full features enabled.


text:
package prometheus

import (
	"fmt"
	"math"
	"testing"
	"time"

	//nolint:staticcheck // Ignore SA1019. Need to keep deprecated package for compatibility.
	"github.com/golang/protobuf/proto"
	"google.golang.org/protobuf/types/known/timestamppb"

	dto "github.com/m3db/prometheus_client_model/go"
)

func TestCounterAdd(t *testing.T) {
	counter := NewCounter(CounterOpts{
		Name:        "test",
		Help:        "test help",
		ConstLabels: Labels{"a": "1", "b": "2"},
	}).(*counter)
	counter.Inc()
	if expected, got := 0.0, math.Float64frombits(counter.valBits); expected != got {
		t.Errorf("Expected %f, got %f.", expected, got)
	}
	if expected, got := uint64(1), counter.valInt; expected != got {
		t.Errorf("Expected %d, got %d.", expected, got)
	}
	counter.Add(42)
	if expected, got := 0.0, math.Float64frombits(counter.valBits); expected != got {
		t.Errorf("Expected %f, got %f.", expected, got)
	}
	if expected, got := uint64(43), counter.valInt; expected != got {
		t.Errorf("Expected %d, got %d.", expected, got)
	}

	counter.Add(24.42)
	if expected, got := 24.42, math.Float64frombits(counter.valBits); expected != got {
		t.Errorf("Expected %f, got %f.", expected, got)
	}
	if expected, got := uint64(43), counter.valInt; expected != got {
		t.Errorf("Expected %d, got %d.", expected, got)
	}

	if expected, got := "counter cannot decrease in value", decreaseCounter(counter).Error(); expected != got {
		t.Errorf("Expected error %q, got %q.", expected, got)
	}

	m := &dto.Metric{}
	counter.Write(m)

	if expected, got := `label:<name:"a" value:"1" > label:<name:"b" value:"2" > counter:<value:67.42 > `, m.String(); expected != got {
		t.Errorf("expected %q, got %q", expected, got)
	}
}

func decreaseCounter(c *counter) (err error) {
	defer func() {
		if e := recover(); e != nil {
			err = e.(error)
		}
	}()
	c.Add(-1)
	return nil
}

func TestCounterVecGetMetricWithInvalidLabelValues(t *testing.T) {
	testCases := []struct {
		desc   string
		labels Labels
	}{
		{
			desc:   "non utf8 label value",
			labels: Labels{"a": "\xFF"},
		},
		{
			desc:   "not enough label values",
			labels: Labels{},
		},
		{
			desc:   "too many label values",
			labels: Labels{"a": "1", "b": "2"},
		},
	}

	for _, test := range testCases {
		counterVec := NewCounterVec(CounterOpts{
			Name: "test",
		}, []string{"a"})

		labelValues := make([]string, len(test.labels))
		for _, val := range test.labels {
			labelValues = append(labelValues, val)
		}

		expectPanic(t, func() {
			counterVec.WithLabelValues(labelValues...)
		}, fmt.Sprintf("WithLabelValues: expected panic because: %s", test.desc))
		expectPanic(t, func() {
			counterVec.With(test.labels)
		}, fmt.Sprintf("WithLabelValues: expected panic because: %s", test.desc))

		if _, err := counterVec.GetMetricWithLabelValues(labelValues...); err == nil {
			t.Errorf("GetMetricWithLabelValues: expected error because: %s", test.desc)
		}
		if _, err := counterVec.GetMetricWith(test.labels); err == nil {
			t.Errorf("GetMetricWith: expected error because: %s", test.desc)
		}
	}
}

func expectPanic(t *testing.T, op func(), errorMsg string) {
	defer func() {
		if err := recover(); err == nil {
			t.Error(errorMsg)
		}
	}()

	op()
}

func TestCounterAddInf(t *testing.T) {
	counter := NewCounter(CounterOpts{
		Name: "test",
		Help: "test help",
	}).(*counter)

	counter.Inc()
	if expected, got := 0.0, math.Float64frombits(counter.valBits); expected != got {
		t.Errorf("Expected %f, got %f.", expected, got)
	}
	if expected, got := uint64(1), counter.valInt; expected != got {
		t.Errorf("Expected %d, got %d.", expected, got)
	}

	counter.Add(math.Inf(1))
	if expected, got := math.Inf(1), math.Float64frombits(counter.valBits); expected != got {
		t.Errorf("valBits expected %f, got %f.", expected, got)
	}
	if expected, got := uint64(1), counter.valInt; expected != got {
		t.Errorf("valInts expected %d, got %d.", expected, got)
	}

	counter.Inc()
	if expected, got := math.Inf(1), math.Float64frombits(counter.valBits); expected != got {
		t.Errorf("Expected %f, got %f.", expected, got)
	}
	if expected, got := uint64(2), counter.valInt; expected != got {
		t.Errorf("Expected %d, got %d.", expected, got)
	}

	m := &dto.Metric{}
	counter.Write(m)

	if expected, got := `counter:<value:inf > `, m.String(); expected != got {
		t.Errorf("expected %q, got %q", expected, got)
	}
}

func TestCounterAddLarge(t *testing.T) {
	counter := NewCounter(CounterOpts{
		Name: "test",
		Help: "test help",
	}).(*counter)

	// large overflows the underlying type and should therefore be stored in valBits.
	large := math.Nextafter(float64(math.MaxUint64), 1e20)
	counter.Add(large)
	if expected, got := large, math.Float64frombits(counter.valBits); expected != got {
		t.Errorf("valBits expected %f, got %f.", expected, got)
	}
	if expected, got := uint64(0), counter.valInt; expected != got {
		t.Errorf("valInts expected %d, got %d.", expected, got)
	}

	m := &dto.Metric{}
	counter.Write(m)

	if expected, got := fmt.Sprintf("counter:<value:%0.16e > ", large), m.String(); expected != got {
		t.Errorf("expected %q, got %q", expected, got)
	}
}

func TestCounterAddSmall(t *testing.T) {
	counter := NewCounter(CounterOpts{
		Name: "test",
		Help: "test help",
	}).(*counter)
	small := 0.000000000001
	counter.Add(small)
	if expected, got := small, math.Float64frombits(counter.valBits); expected != got {
		t.Errorf("valBits expected %f, got %f.", expected, got)
	}
	if expected, got := uint64(0), counter.valInt; expected != got {
		t.Errorf("valInts expected %d, got %d.", expected, got)
	}

	m := &dto.Metric{}
	counter.Write(m)

	if expected, got := fmt.Sprintf("counter:<value:%0.0e > ", small), m.String(); expected != got {
		t.Errorf("expected %q, got %q", expected, got)
	}
}

func TestCounterExemplar(t *testing.T) {
	now := time.Now()

	counter := NewCounter(CounterOpts{
		Name: "test",
		Help: "test help",
	}).(*counter)
	counter.now = func() time.Time { return now }

	ts := timestamppb.New(now)
	if err := ts.CheckValid(); err != nil {
		t.Fatal(err)
	}
	expectedExemplar := &dto.Exemplar{
		Label: []*dto.LabelPair{
			&dto.LabelPair{Name: proto.String("foo"), Value: proto.String("bar")},
		},
		Value:     proto.Float64(42),
		Timestamp: ts,
	}

	counter.AddWithExemplar(42, Labels{"foo": "bar"})
	if expected, got := expectedExemplar.String(), counter.exemplar.Load().(*dto.Exemplar).String(); expected != got {
		t.Errorf("expected exemplar %s, got %s.", expected, got)
	}

	addExemplarWithInvalidLabel := func() (err error) {
		defer func() {
			if e := recover(); e != nil {
				err = e.(error)
			}
		}()
		// Should panic because of invalid label name.
		counter.AddWithExemplar(42, Labels{":o)": "smile"})
		return nil
	}
	if addExemplarWithInvalidLabel() == nil {
		t.Error("adding exemplar with invalid label succeeded")
	}

	addExemplarWithOversizedLabels := func() (err error) {
		defer func() {
			if e := recover(); e != nil {
				err = e.(error)
			}
		}()
		// Should panic because of 65 runes.
		counter.AddWithExemplar(42, Labels{
			"abcdefghijklmnopqrstuvwxyz": "26+16 characters",
			"x1234567":                   "8+15 characters",
		})
		return nil
	}
	if addExemplarWithOversizedLabels() == nil {
		t.Error("adding exemplar with oversized labels succeeded")
	}
}


text:
package org.apache.reef.io.data.loading.api;

import org.apache.reef.driver.evaluator.EvaluatorRequest;
import org.apache.reef.driver.evaluator.EvaluatorRequestor;
import org.apache.reef.wake.EventHandler;

import java.util.concurrent.CountDownLatch;
import java.util.logging.Level;
import java.util.logging.Logger;

public class ResourceRequestHandler implements EventHandler<EvaluatorRequest> {

  private static final Logger LOG = Logger.getLogger(ResourceRequestHandler.class.getName());

  private final EvaluatorRequestor requestor;

  private CountDownLatch resourceRequestGate = new CountDownLatch(1);

  public ResourceRequestHandler(final EvaluatorRequestor requestor) {
    this.requestor = requestor;
  }

  public void releaseResourceRequestGate() {
    LOG.log(Level.FINE, "Releasing Gate");
    this.resourceRequestGate.countDown();
  }

  @Override
  public void onNext(final EvaluatorRequest request) {
    try {

      LOG.log(Level.FINE,
          "Processing a request with count: {0} - Waiting for gate to be released",
          request.getNumber());

      this.resourceRequestGate.await();

      LOG.log(Level.FINE, "Gate released. Submitting request: {0}", request);
      this.resourceRequestGate = new CountDownLatch(1);
      this.requestor.submit(request);

    } catch (final InterruptedException ex) {
      LOG.log(Level.FINEST, "Interrupted", ex);
    }
  }
}


text:
Sort stuff with React.js

Based on [jasonslyvia/react-anything-sortable](https://github.com/jasonslyvia/react-anything-sortable) but without jQuery.

# Usage
react-sortable-items requires React with addons.

You can install react-sortable-items with `npm i react-sortable-items` and include it using webpack, Browserify, etc. If you're having trouble, Gulpfiles using webpack are included in the examples directory.

If you just want to include the components directly in your pages, files that can be used with script tags are included in the `dist` directory. Both `Sortable{.min}.js` and `SortableItemMixin{.min}.js` expose the `Sortable` and `SortableItemMixin` global vars for use by your React components.

To run the examples, run `gulp` in the respective example directories and open index.html in your favorite browser.

```javascript
var React = require('react');
var Sortable = require('react-sortable-items');
var SortableMixin = require('react-sortable-items/SortableItemMixin');
var style = require('react-sortable-items/style.css'); // If you're using webpack or Browserify

var Item = React.createClass({
	propTypes: { title: React.PropTypes.string.isRequired },
	mixins: [SortableMixin],
	render: function() {
		return this.renderWithSortable(<div>{this.props.title}</div>)
	}
});

var List = React.createClass({
	getInitialState: function() {
		return {
			items: ["Item 1", "Item 2", "Item 3"]
		}
	},
	handleSort: function(reorder) {
		this.setState({
			items: reorder.map(function (idx) {
				return this.state.items[idx];
			}.bind(this))
		});
	},
	render: function() {
		var items = this.state.items.map(function (item, idx) {
			return <Item title={item} key={idx} sortData={idx} isDraggable={true} />;
		});

		return (
			<div>
				<h1>Sortable List</h1>
				<Sortable onSort={this.handleSort}>
					{items}
				</Sortable>
			</div>
		);
	}
});

React.render(<List />, document.getElementById('boourns'));

```

# Configuration

On `<Sortable />`:

Property | Description
-----|-----
onSort | Callback that returns sorted array of data from `sortData`.
horizontal | Default false. Whether to sort horizontally.
floatUndraggables | Default false. Whether to only allow sorting below items with isDraggable set to false, sending undraggable items to the top of the list over time.
sinkUndraggables | Default false. Whether to only allow sorting above items with isDraggable set to false, sending undraggable items to the bottom of the list over time.
sensitivity | Default 1. A value 0-1 (0 for least sensitive, 1 for most) that will be used to determine the sensitivity of sorting. The smaller the number, the further from the center of an element you can drag before the list re-sorts. This is especially useful when you replace the placeholder contents with something at a smaller width or height than the sortable items in a horizontal or vertically sorted list respectively.
minDragDistance | Default 0. A value in pixels that the mouse can be moved after clicking before a drag starts.

On components with `SortableItemMixin`:

Property | Description
-----|-----------
isDraggable | Default true. Whether the item can be dragged.
sortData | Any data added here will be sent to the `onSort` callback on Sortable in the correct re-sorted order.

Additionally, sortable items can define a `getPlaceholderContent()` function (example in the "simple" example directory) that will replace the placeholder for the item being dragged with whatever component you return.

Styles for elements:

Class | Description
------|------------
`.Sortable` | Class for the Sortable component.
`.SortableItem` | Class for each sortable item.
`.SortableItem.is-dragging` | Set on the item currently being dragged.
`.SortableItem.is-placeholder` | Set on the placeholder item in the list.
`.is-isolated` | A class you can set on any element inside a sortable item to prevent it from triggering a sort on click.

# TODO
- [x] Horizontal sorting
- [ ] Grid sorting
- [ ] Optional classnames if you're not using [SUIT CSS](http://suitcss.github.io/)
- [x] npm
- [x] CSS
- [x] Examples
- [ ] Tests


text:
using namespace Treehopper::Libraries;

namespace Treehopper {
    namespace Libraries {
        namespace Sensors {
            double ProximitySensor::centimeters() {
                return meters() * 100;
            }

            double ProximitySensor::inches() {
                return meters() * 39.3701;
            }

            double ProximitySensor::millimeters() {
                return meters() * 1000;
            }

            double ProximitySensor::feet() {
                return meters() * 3.28085;
            }

            double ProximitySensor::meters() {
                if (autoUpdateWhenPropertyRead) update();

                return _meters;
            }
        }
    }
}


text:
+++
date = "2016-12-24T14:49:14+01:00"
title = "Merci de nous avoir contacté - Agence Magento LUMAO"
h1 = "Merci de nous avoir contacté"
draft = false
private = true

work = true
blog = true
subtitle = "📝✈"
+++

Nous avons bien reçu votre e-mail, nous vous contacterons prochainement.

À bientôt,

L'équipe Lumao


text:
import core from './core';
import utils from '../utils/index';

export default function conditionalRace(fns, test, min = 1) {
  const funcs = utils.collection.arrayize(fns);

  return new core.Promise((resolve, reject) => {
    let len = funcs.length;
    let passed = 0;
    let done = false;

    function fulfilled(val) {
      len -= 1;
      if (done) {
        return;   // Resolved/Rejected already
      }

      if (test(val)) {
        passed += 1;
        if (passed === min) {
          done = true;
          resolve(val);
          return;
        }
      }

      if (len === 0) {
        // < min passed
        done = true;
        resolve(false);
      }
    }

    function rejected(reason) {
      len -= 1;
      if (done) {
        return;   // Resolved/Rejected already
      }

      done = true;
      reject(reason);
    }

    // Call all functions individually and simultaneously
    funcs.forEach(fn => fn().then(fulfilled, rejected));
  });
}


text:
<div class=canvases>
  <canvas drawing commands=record.commands width=320 height=400></canvas>
  <canvas draw onpath=newStroke(command) width=320 height=400></canvas>
</div>

<!-- undo/redo and save buttons -->


text:
/* Author: Brian Gerkey */

#include <stdexcept> // for std::runtime_error
#include <gtest/gtest.h>
#include "map_server/image_loader.h"
#include "test_constants.h"

/* Try to load a valid PNG file.  Succeeds if no exception is thrown, and if
 * the loaded image matches the known dimensions and content of the file.
 *
 * This test can fail on OS X, due to an apparent limitation of the
 * underlying SDL_Image library. */
TEST(MapServer, loadValidPNG)
{
  try
  {
    nav_msgs::GetMap::Response map_resp;
    double origin[3] = { 0.0, 0.0, 0.0 };
    map_server::loadMapFromFile(&map_resp, g_valid_png_file, g_valid_image_res, false, 0.65, 0.1, origin);
    EXPECT_FLOAT_EQ(map_resp.map.info.resolution, g_valid_image_res);
    EXPECT_EQ(map_resp.map.info.width, g_valid_image_width);
    EXPECT_EQ(map_resp.map.info.height, g_valid_image_height);
    for(unsigned int i=0; i < map_resp.map.info.width * map_resp.map.info.height; i++)
      EXPECT_EQ(g_valid_image_content[i], map_resp.map.data[i]);
  }
  catch(...)
  {
    ADD_FAILURE() << "Uncaught exception : " << "This is OK on OS X";
  }
}

/* Try to load a valid BMP file.  Succeeds if no exception is thrown, and if
 * the loaded image matches the known dimensions and content of the file. */
TEST(MapServer, loadValidBMP)
{
  try
  {
    nav_msgs::GetMap::Response map_resp;
    double origin[3] = { 0.0, 0.0, 0.0 };
    map_server::loadMapFromFile(&map_resp, g_valid_bmp_file, g_valid_image_res, false, 0.65, 0.1, origin);
    EXPECT_FLOAT_EQ(map_resp.map.info.resolution, g_valid_image_res);
    EXPECT_EQ(map_resp.map.info.width, g_valid_image_width);
    EXPECT_EQ(map_resp.map.info.height, g_valid_image_height);
    for(unsigned int i=0; i < map_resp.map.info.width * map_resp.map.info.height; i++)
      EXPECT_EQ(g_valid_image_content[i], map_resp.map.data[i]);
  }
  catch(...)
  {
    ADD_FAILURE() << "Uncaught exception";
  }
}

/* Try to load an invalid file.  Succeeds if a std::runtime_error exception
 * is thrown. */
TEST(MapServer, loadInvalidFile)
{
  try
  {
    nav_msgs::GetMap::Response map_resp;
    double origin[3] = { 0.0, 0.0, 0.0 };
    map_server::loadMapFromFile(&map_resp, "foo", 0.1, false, 0.65, 0.1, origin);
  }
  catch(std::runtime_error &e)
  {
    SUCCEED();
    return;
  }
  catch(...)
  {
    FAIL() << "Uncaught exception";
  }
  ADD_FAILURE() << "Didn't throw exception as expected";
}

int main(int argc, char **argv)
{
  testing::InitGoogleTest(&argc, argv);
  return RUN_ALL_TESTS();
}


text:
require 'spec_helper'

describe FbGraph::RequestFilters::Debugger do
  let(:resource_endpoint) { 'https://graph.facebook.com/matake' }
  let(:request) { HTTP::Message.new_request(:get, URI.parse(resource_endpoint)) }
  let(:response) { HTTP::Message.new_response({:hello => 'world'}.to_json) }
  let(:request_filter) { FbGraph::RequestFilters::Debugger.new }

  describe '#filter_request' do
    it 'should log request' do
      [
        "======= [FbGraph] API REQUEST STARTED =======",
        request.dump
      ].each do |output|
        FbGraph.logger.should_receive(:info).with output
      end
      request_filter.filter_request(request)
    end
  end

  describe '#filter_response' do
    it 'should log response' do
      [
        "--------------------------------------------------",
        response.dump,
        "======= [FbGraph] API REQUEST FINISHED ======="
      ].each do |output|
        FbGraph.logger.should_receive(:info).with output
      end
      request_filter.filter_response(request, response)
    end
  end
end


text:
/*表示領域全体*/
div.tabbox { margin: 0px; padding: 0px; width: 1202px; }
/* タブ部分 */
p.tabs { margin: 0px; padding: 0px; }
p.tabs a { display: block; width: 5em; float: left; margin: 0px 10px 0px 0px; padding: 3px; text-align: center; border-radius: 12px 12px 0px 0px; }
p.tabs a.create { background-color: blue;  color: white; }
p.tabs a.insert { background-color: #FFA500; color: white; }
p.tabs a.update { background-color: #9932CC;   color: white; }
p.tabs a.delete { background-color: #FF1000;   color: white; }
p.tabs a.select { background-color: green;  color: white; }
p.tabs a.hover { color: yellow; text-decoration: underline; }
/* 対応表示領域 */
div.tab { height: 743px; overflow: auto; clear: left; }
/* CREATE画面 */
div#create { border: 2px solid blue; background-color: #00FFFF; }
div#create div.cmain { float: left; width: 1198px; background-color: #E0FFFF; height: 700px; }
div#create div.cmain div.cmain_table { float: left; border: 1px solid blue; border-bottom-width: 0px; border-left-width: 0px; border-top-width: 2px; width: 398px; height: 698px; }
div#create div.cmain div.cmain_parts { float: left; border: 1px solid blue; border-bottom-width: 0px; border-top-width: 2px; width: 198px; height: 698px; }
div#create div.cmain div.cmain_create { float: left; border: 1px solid blue; border-right-width: 0px; border-top-width: 2px; width: 598px; height: 398px; }
div#create div.cmain div.cmain_create span.cspace{float: left;border-collapse: separate;border-spacing: 3px 3px; border: 1px solid black; border-right-width: 2px; border-top-width: 2px; width: 590px; height: 348px; overflow-x:scroll;}
div#create div.cmain div.cmain_sql { float: right; border: 1px solid blue; border-right-width: 0px; border-bottom-width: 0px; width: 598px; height: 298px; }
div#create div.clear { clear: both; }

/* CREATE画面のパーツのCSS */
div#create div.cmain div.cmain_parts div#find_columname { width: 180px; height: 50px; margin: 1px; padding: 7px; border: solid 1px #333; background-color:#ba6; float:left; }
div#create div.cmain div.cmain_parts div#find_columname input#input_cname{ width: 170px; margin-left: auto; }
div#create div.cmain div.cmain_parts div#find_num { width: 180px; height: 75px; margin: 1px; padding: 7px; border: solid 1px #333; background-color:#ba6; float:left; }
div#create div.cmain div.cmain_parts div#find_num select#numtype{ width: 90px; }
div#create div.cmain div.cmain_parts div#find_num input#input_num{ width: 170px; }
div#create div.cmain div.cmain_parts div#find_limit { width: 180px; height: 50px; margin: 1px; padding: 7px; border: solid 1px #333; background-color:#ba6; float:left; }
div#create div.cmain div.cmain_parts div#find_limit select#columlimit { width: 150px; margin-left: auto; }
.cdrop{width: 180px; min-width: 180px; margin-left: 3px; margin-top: 10px;  background-color:#178fe5; display:table-cell; }
.cdropHead{width: 180px; height:30px; background-color:#a2f570;}
.dragcdrop{ width: 180px; height: 150px; margin: 10px; border: solid 1px #333; opacity:0.7; float:left; }
.limit{background-color: #66b8da; padding:1px;}
.num{background-color: #66b8da;}
.cdrop_sortable{height: 270px; background-color: #FFFFFF; overflow-y:scroll;}

/* INSERT画面 */
div#insert { border: 2px solid #FFA500; width: 1198px; background-color: #FFFF99; }
div#insert div.imain { float: left; width: 1198px; background-color: #FFFFE0; height: 700px; }
div#insert div.imain div.imain_table { float: left; border: 1px solid #FFA500; border-bottom-width: 0px; border-left-width: 0px; border-top-width: 2px; width: 598px; height: 698px; }
div#insert div.imain div.imain_sql { float: left; border: 1px solid #FFA500; border-bottom-width: 0px; border-right-width: 0px; border-top-width: 2px; width: 598px; height: 698px; }
div#insert div.clear { clear: both; }
/* UPDATE画面 */
div#update { border: 2px solid #9932CC; width: 1198px; background-color: #EBB3FF; }
div#update div.umain { float: left; width: 1198px; background-color: #F2E6FF; height: 700px; }
div#update div.umain div.umain_table { float: left; border: 1px solid #9932CC; border-bottom-width: 0px; border-left-width: 0px; border-top-width: 2px; width: 398px; height: 698px; }
div#update div.umain div.umain_parts { float: left; border: 1px solid #9932CC; border-bottom-width: 0px; border-top-width: 2px; width: 198px; height: 698px; }
div#update div.umain div.umain_create { float: left; border: 1px solid #9932CC; border-right-width: 0px; border-top-width: 2px; width: 598px; height: 398px; }
div#update div.umain div.umain_sql { float: right; border: 1px solid #9932CC; border-right-width: 0px; border-bottom-width: 0px; width: 598px; height: 298px; }
div#update div.clear { clear: both; }
div#update div.umain div.umain_create div.uspace{float: left; border: 1px solid black; border-right-width: 2px; border-top-width: 2px; width: 540px; height: 350px;}

/* UPDATE画面のパーツのCSS */
.updateset { width: 190px; height: 100px; margin: 3px; border: solid 1px #333; background-color:#ba6; }
.updatecondition { width: 190px; height: 100px; margin: 3px; border: solid 1px #333; background-color:#ba6; }
input#ucolum { width: 170px; margin-left: auto; }
input#ucvalue { width: 170px; margin-left: auto; }
input#uconvalue { width: 170px; margin-left: auto; }
input#ucondition { width: 170px; margin-left: auto; }
div#update div.umain div.umain_parts div#updatecondition select#uconsid{ width: 35px; }
.udrop{ width: 180px; height: 150px; margin: 10px; border: solid 1px #333; background-color:#cf6; float:left; }
.dragudrop{ width: 180px; height: 150px; margin: 10px; border: solid 1px #333; background-color:orangered; float:left; }

/* DELETE画面 */
div#delete { border: 2px solid #FF1000; width: 1198px; background-color: #FF8F66; }
div#delete div.dmain { float: left; width: 1198px; background-color: #FFD8CC; height: 700px; }
div#delete div.dmain div.dmain_table { float: left; border: 1px solid #FF1000; border-bottom-width: 0px; border-left-width: 0px; border-top-width: 2px; width: 398px; height: 698px; }
div#delete div.dmain div.dmain_parts { float: left; border: 1px solid #FF1000; border-bottom-width: 0px; border-top-width: 2px; width: 198px; height: 698px; }
div#delete div.dmain div.dmain_create { float: left; border: 1px solid #FF1000; border-right-width: 0px; border-top-width: 2px; width: 598px; height: 398px; }
div#delete div.dmain div.dmain_sql { float: right; border: 1px solid #FF1000; border-right-width: 0px; border-bottom-width: 0px; width: 598px; height: 298px; }
div#delete div.clear { clear: both; }
div#delete div.dmain div.dmain_create div.dspace{float: left; border: 1px solid black; border-right-width: 2px; border-top-width: 2px; width: 540px; height: 350px;}

/* DELETE画面のパーツのCSS */
div#delete div.dmain div.dmain_parts div#dtable { width: 190px; height: 50px; margin: 3px; border: solid 1px #333; background-color:#ba6; }
input#input_dtable { width: 170px; margin-left: auto; }
.ddrag { width: 190px; height: 100px; margin: 3px; border: solid 1px #333; background-color:#ba6; }
input#dcondition1 { width: 170px; margin-left: auto; }
div#delete div.dmain div.dmain_parts div#deletecondition select#dcondition2{ width: 35px; }
input#dcondition3 { width: 170px; margin-left: auto; }
.ddrop{ width: 180px; height: 150px; margin: 10px; border: solid 1px #333; background-color:#cf6; float:left; }
.dragddrop{ width: 180px; height: 150px; margin: 10px; border: solid 1px #333; background-color:deepskyblue; float:left; }

/* SELECT画面 */
div#select { border: 2px solid green; width: 1198px; background-color: #00FA9A; }
div#select div.smain { float: left; width: 1198px; background-color: #CCFFEE; height: 700px; }
div#select div.smain div.smain_table { float: left; border: 1px solid green; border-bottom-width: 0px; border-left-width: 0px; border-top-width: 2px; width: 398px; height: 698px; }
div#select div.smain div.smain_parts { float: left; border: 1px solid green; border-bottom-width: 0px; border-top-width: 2px; width: 198px; height: 698px; }
div#select div.smain div.smain_create { float: left; border: 1px solid green; border-right-width: 0px; border-top-width: 2px; width: 598px; height: 398px; }
div#select div.smain div.smain_sql { float: right; border: 1px solid green; border-right-width: 0px; border-bottom-width: 0px; width: 598px; height: 298px; }
div#select div.clear { clear: both; }
div.tab p { margin: 0.5em; }
/* 装飾 */
div.tab ul, div.tab ol { margin-top: 0.5em; margin-bottom: 0.5em; }
div.tab li { line-height: 1.35; margin-bottom: 0px; margin-top: 0px; }
div.tab ul li { list-style-type: disc; }
div.tab p.tabhead { font-weight: bold; border-bottom: 3px double gray; }
div#select div.smain div.smain_create div.sspace{float: left; border: 1px solid black; border-right-width: 2px; border-top-width: 2px; width: 540px; height: 350px;}

/* SELECT画面のパーツのCSS */

div#select div.smain div.smain_parts div#find_selecttable { width: 190px; height: 50px; margin: 3px; border: solid 1px #333; background-color:#ba6; }
div#select div.smain div.smain_parts div.selecttable input#input_stable{ width: 170px; margin-left: auto; }
div#select div.smain div.smain_parts div#find_selectcondition { width: 190px; height: 100px; margin: 3px; border: solid 1px #333; background-color:#ba6; }
div#select div.smain div.smain_parts div.selectcondition select#scondition2{ width: 35px; }
div#select div.smain div.smain_parts div#find_selectall{ width: 190px; height: 25px; margin: 3px; border: solid 1px #333; background-color:#ba6; }
input#scondition1 { width: 170px; margin-left: auto; }
div#select div.smain div.smain_parts div.selectcondition select#scondition2{ width: 35px; }
input#scondition3 { width: 170px; margin-left: auto; }
.sdrop{ width: 180px; height: 150px; margin: 10px; border: solid 1px #333; background-color:#cf6; float:left; }
.dragsdrop{ width: 180px; height: 150px; margin: 10px; border: solid 1px #333; background-color:deepskyblue; float:left; }