text:
(function ($) {
    $.fn.quicksand = function (collection, customOptions) {
        var options = {
            duration: 750,
            easing: 'swing',
            attribute: 'data-id', // attribute to recognize same items within source and dest
            adjustHeight: 'auto', // 'dynamic' animates height during shuffling (slow), 'auto' adjusts it before or after the animation, false leaves height constant
            useScaling: true, // disable it if you're not using scaling effect or want to improve performance
            enhancement: function(c) {}, // Visual enhacement (eg. font replacement) function for cloned elements
            selector: '> *',
            dx: 0,
            dy: 0
        };
        $.extend(options, customOptions);

        if ($.browser.msie || (typeof($.fn.scale) == 'undefined')) {
            // Got IE and want scaling effect? Kiss my ass.
            options.useScaling = false;
        }

        var callbackFunction;
        if (typeof(arguments[1]) == 'function') {
            var callbackFunction = arguments[1];
        } else if (typeof(arguments[2] == 'function')) {
            var callbackFunction = arguments[2];
        }

        return this.each(function (i) {
            var val;
            var animationQueue = []; // used to store all the animation params before starting the animation; solves initial animation slowdowns
            var $collection = $(collection).clone(); // destination (target) collection
            var $sourceParent = $(this); // source, the visible container of source collection
            var sourceHeight = $(this).css('height'); // used to keep height and document flow during the animation

            var destHeight;
            var adjustHeightOnCallback = false;

            var offset = $($sourceParent).offset(); // offset of visible container, used in animation calculations
            var offsets = []; // coordinates of every source collection item

            var $source = $(this).find(options.selector); // source collection items

            // Replace the collection and quit if IE6
            if ($.browser.msie && $.browser.version.substr(0,1)<7) {
                $sourceParent.html('').append($collection);
                return;
            }

            // Gets called when any animation is finished
            var postCallbackPerformed = 0; // prevents the function from being called more than one time
            var postCallback = function () {

                if (!postCallbackPerformed) {
                    postCallbackPerformed = 1;

                    // hack:
                    // used to be: $sourceParent.html($dest.html()); // put target HTML into visible source container
                    // but new webkit builds cause flickering when replacing the collections
                    $toDelete = $sourceParent.find('> *');
                    $sourceParent.prepend($dest.find('> *'));
                    $toDelete.remove();

                    if (adjustHeightOnCallback) {
                        $sourceParent.css('height', destHeight);
                    }
                    options.enhancement($sourceParent); // Perform custom visual enhancements on a newly replaced collection
                    if (typeof callbackFunction == 'function') {
                        callbackFunction.call(this);
                    }
                }
            };

            // Position: relative situations
            var $correctionParent = $sourceParent.offsetParent();
            var correctionOffset = $correctionParent.offset();
            if ($correctionParent.css('position') == 'relative') {
                if ($correctionParent.get(0).nodeName.toLowerCase() == 'body') {

                } else {
                    correctionOffset.top += (parseFloat($correctionParent.css('border-top-width')) || 0);
                    correctionOffset.left +=( parseFloat($correctionParent.css('border-left-width')) || 0);
                }
            } else {
                correctionOffset.top -= (parseFloat($correctionParent.css('border-top-width')) || 0);
                correctionOffset.left -= (parseFloat($correctionParent.css('border-left-width')) || 0);
                correctionOffset.top -= (parseFloat($correctionParent.css('margin-top')) || 0);
                correctionOffset.left -= (parseFloat($correctionParent.css('margin-left')) || 0);
            }

            // perform custom corrections from options (use when Quicksand fails to detect proper correction)
            if (isNaN(correctionOffset.left)) {
                correctionOffset.left = 0;
            }
            if (isNaN(correctionOffset.top)) {
                correctionOffset.top = 0;
            }

            correctionOffset.left -= options.dx;
            correctionOffset.top -= options.dy;

            // keeps nodes after source container, holding their position
            $sourceParent.css('height', $(this).height());

            // get positions of source collections
            $source.each(function (i) {
                offsets[i] = $(this).offset();
            });

            // stops previous animations on source container
            $(this).stop();
            var dx = 0; var dy = 0;
            $source.each(function (i) {
                $(this).stop(); // stop animation of collection items
                var rawObj = $(this).get(0);
                if (rawObj.style.position == 'absolute') {
                    dx = -options.dx;
                    dy = -options.dy;
                } else {
                    dx = options.dx;
                    dy = options.dy;
                }

                rawObj.style.position = 'absolute';
                rawObj.style.margin = '0';

                rawObj.style.top = (offsets[i].top - parseFloat(rawObj.style.marginTop) - correctionOffset.top + dy) + 'px';
                rawObj.style.left = (offsets[i].left - parseFloat(rawObj.style.marginLeft) - correctionOffset.left + dx) + 'px';
            });

            // create temporary container with destination collection
            var $dest = $($sourceParent).clone();
            var rawDest = $dest.get(0);
            rawDest.innerHTML = '';
            rawDest.setAttribute('id', '');
            rawDest.style.height = 'auto';
            rawDest.style.width = $sourceParent.width() + 'px';
            $dest.append($collection);
            // insert node into HTML
            // Note that the node is under visible source container in the exactly same position
            // The browser render all the items without showing them (opacity: 0.0)
            // No offset calculations are needed, the browser just extracts position from underlayered destination items
            // and sets animation to destination positions.
            $dest.insertBefore($sourceParent);
            $dest.css('opacity', 0.0);
            rawDest.style.zIndex = -1;

            rawDest.style.margin = '0';
            rawDest.style.position = 'absolute';
            rawDest.style.top = offset.top - correctionOffset.top + 'px';
            rawDest.style.left = offset.left - correctionOffset.left + 'px';

            if (options.adjustHeight === 'dynamic') {
                // If destination container has different height than source container
                // the height can be animated, adjusting it to destination height
                $sourceParent.animate({height: $dest.height()}, options.duration, options.easing);
            } else if (options.adjustHeight === 'auto') {
                destHeight = $dest.height();
                if (parseFloat(sourceHeight) < parseFloat(destHeight)) {
                    // Adjust the height now so that the items don't move out of the container
                    $sourceParent.css('height', destHeight);
                } else {
                    //  Adjust later, on callback
                    adjustHeightOnCallback = true;
                }
            }

            // Now it's time to do shuffling animation
            // First of all, we need to identify same elements within source and destination collections
            $source.each(function (i) {
                var destElement = [];
                if (typeof(options.attribute) == 'function') {

                    val = options.attribute($(this));
                    $collection.each(function() {
                        if (options.attribute(this) == val) {
                            destElement = $(this);
                            return false;
                        }
                    });
                } else {
                    destElement = $collection.filter('[' + options.attribute + '=' + $(this).attr(options.attribute) + ']');
                }
                if (destElement.length) {
                    // The item is both in source and destination collections
                    // It it's under different position, let's move it
                    if (!options.useScaling) {
                        animationQueue.push(
                                            {
                                                element: $(this),
                                                animation:
                                                    {top: destElement.offset().top - correctionOffset.top,
                                                     left: destElement.offset().left - correctionOffset.left,
                                                     opacity: 1.0
                                                    }
                                            });

                    } else {
                        animationQueue.push({
                                            element: $(this),
                                            animation: {top: destElement.offset().top - correctionOffset.top,
                                                        left: destElement.offset().left - correctionOffset.left,
                                                        opacity: 1.0,
                                                        scale: '1.0'
                                                       }
                                            });

                    }
                } else {
                    // The item from source collection is not present in destination collections
                    // Let's remove it
                    if (!options.useScaling) {
                        animationQueue.push({element: $(this),
                                             animation: {opacity: '0.0'}});
                    } else {
                        animationQueue.push({element: $(this), animation: {opacity: '0.0',
                                         scale: '0.0'}});
                    }
                }
            });

            $collection.each(function (i) {
                // Grab all items from target collection not present in visible source collection

                var sourceElement = [];
                var destElement = [];
                if (typeof(options.attribute) == 'function') {
                    val = options.attribute($(this));
                    $source.each(function() {
                        if (options.attribute(this) == val) {
                            sourceElement = $(this);
                            return false;
                        }
                    });

                    $collection.each(function() {
                        if (options.attribute(this) == val) {
                            destElement = $(this);
                            return false;
                        }
                    });
                } else {
                    sourceElement = $source.filter('[' + options.attribute + '=' + $(this).attr(options.attribute) + ']');
                    destElement = $collection.filter('[' + options.attribute + '=' + $(this).attr(options.attribute) + ']');
                }

                var animationOptions;
                if (sourceElement.length === 0) {
                    // No such element in source collection...
                    if (!options.useScaling) {
                        animationOptions = {
                            opacity: '1.0'
                        };
                    } else {
                        animationOptions = {
                            opacity: '1.0',
                            scale: '1.0'
                        };
                    }
                    // Let's create it
                    d = destElement.clone();
                    var rawDestElement = d.get(0);
                    rawDestElement.style.position = 'absolute';
                    rawDestElement.style.margin = '0';
                    rawDestElement.style.top = destElement.offset().top - correctionOffset.top + 'px';
                    rawDestElement.style.left = destElement.offset().left - correctionOffset.left + 'px';
                    d.css('opacity', 0.0); // IE
                    if (options.useScaling) {
                        d.css('transform', 'scale(0.0)');
                    }
                    d.appendTo($sourceParent);

                    animationQueue.push({element: $(d),
                                         animation: animationOptions});
                }
            });

            $dest.remove();
            options.enhancement($sourceParent); // Perform custom visual enhancements during the animation
            for (i = 0; i < animationQueue.length; i++) {
                animationQueue[i].element.animate(animationQueue[i].animation, options.duration, options.easing, postCallback);
            }
        });
    };
})(jQuery);

$(document).ready(function() {

  // get the action filter option item on page load
  var $filterType = $('.filter_nav li.active a').attr('class');

  // get and assign the ourHolder element to the
	// $holder varible for use later
  var $holder = $('ul.filter_content');

  // clone all items within the pre-assigned $holder element
  var $data = $holder.clone();

  // attempt to call Quicksand when a filter option
	// item is clicked
	$('.filter_nav li a').click(function(e) {
		// reset the active class on all the buttons
		$('.filter_nav li').removeClass('active');

		// assign the class of the clicked filter option
		// element to our $filterType variable
		var $filterType = $(this).attr('class');
		$(this).parent().addClass('active');

		if ($filterType == 'all') {
			// assign all li items to the $filteredData var when
			// the 'All' filter option is clicked
			var $filteredData = $data.find('li');
		}
		else {
			// find all li elements that have our required $filterType
			// values for the data-type element

			var $filteredData = $data.find('li[data-type~=' + $filterType + ']');
		}

		// call quicksand and assign transition parameters
		$holder.quicksand($filteredData, {
			duration: 400,
			easing: 'easeInOutQuad',
			  adjustHeight: 'auto',
			enhancement: function() {

  //prettyphoto

  $('a[data-rel]').each(function() {
    $(this).attr('rel', $(this).data('rel'));
});
$("a[rel^='prettyPhoto[gallery1]']").prettyPhoto({
	animation_speed: 'fast',
	slideshow: 5000,
	autoplay_slideshow: false,
	opacity: 0.80,
	show_title: false,
	theme: 'pp_default', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
	overlay_gallery: false,
	social_tools: false,
	changepicturecallback: function(){
	var $pp = $('.pp_default');
	if( parseInt( $pp.css('left') ) < 0 ){
	$pp.css('left', 0 );
	}
	}
});
    }

		});
		return false;
	});
});

ty: 0.80,
	show_title: false,
	theme: 'pp_default', /* light_rounded / dark_rounded / light_square / dark_square / facebook */
	overlay_gallery: false,
	social_tools: false,
	changepicturecallback: function(){
	var $pp = $('.pp_default');
	if( parseInt( $pp.css('left') ) < 0 ){
	$pp.css('left', 0 );
	}
	}
});
    }

		});
		return false;
	});
});


text:
package org.apache.hadoop.hive.ql.io;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hive.common.io.DataCache;
import org.apache.hadoop.hive.common.io.FileMetadataCache;

/** Marker interface for LLAP IO. */
public interface LlapCacheOnlyInputFormatInterface {
  void injectCaches(FileMetadataCache metadataCache, DataCache dataCache, Configuration cacheConf);
}

redpajama_set_name: RedPajamaGithub


text:
module Multitenancy
  VERSION = "0.0.5"
end


text:
<?php

namespace backend\controllers;

use Yii;
use backend\models\ProyectoVariableEjecucion;
use backend\models\ProyectoVariableEjecucionSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use \yii\web\Response;
use yii\helpers\Html;

/**
 * ProyectoVariableEjecucionController implements the CRUD actions for ProyectoVariableEjecucion model.
 */
class ProyectoVariableEjecucionController extends \common\controllers\BaseController
{
    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return parent::behaviors();
    }

    /**
     * Lists all ProyectoVariableEjecucion models.
     * @return mixed
     */
    public function actionIndex()
    {
        $searchModel = new ProyectoVariableEjecucionSearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }

    /**
     * Displays a single ProyectoVariableEjecucion model.
     * @param integer $id
     * @return mixed
     */
    public function actionView($id)
    {
        $request = Yii::$app->request;
        if($request->isAjax){
            Yii::$app->response->format = Response::FORMAT_JSON;
            return [
                    'title'=> "ProyectoVariableEjecucion #".$id,
                    'content'=>$this->renderAjax('view', [
                        'model' => $this->findModel($id),
                    ]),
                    'footer'=> Html::button('Close',['class'=>'btn btn-default pull-left','data-dismiss'=>"modal"]).
                            Html::a('Edit',['update','id'=>$id],['class'=>'btn btn-primary','role'=>'modal-remote'])
                ];
        }else{
            return $this->render('view', [
                'model' => $this->findModel($id),
            ]);
        }
    }

    /**
     * Creates a new ProyectoVariableEjecucion model.
     * For ajax request will return json object
     * and for non-ajax request if creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreate()
    {
        $request = Yii::$app->request;
        $model = new ProyectoVariableEjecucion();

        if($request->isAjax){
            /*
            *   Process for ajax request
            */
            Yii::$app->response->format = Response::FORMAT_JSON;
            if($request->isGet){
                return [
                    'title'=> "Create new ProyectoVariableEjecucion",
                    'content'=>$this->renderAjax('create', [
                        'model' => $model,
                    ]),
                    'footer'=> Html::button('Close',['class'=>'btn btn-default pull-left','data-dismiss'=>"modal"]).
                                Html::button('Save',['class'=>'btn btn-primary','type'=>"submit"])

                ];
            }else if($model->load($request->post()) && $model->save()){
                return [
                    'forceReload'=>'#crud-datatable-pjax',
                    'title'=> "Create new ProyectoVariableEjecucion",
                    'content'=>'Create ProyectoVariableEjecucion success',
                    'footer'=> Html::button('Close',['class'=>'btn btn-default pull-left','data-dismiss'=>"modal"]).
                            Html::a('Create More',['create'],['class'=>'btn btn-primary','role'=>'modal-remote'])

                ];
            }else{
                return [
                    'title'=> "Create new ProyectoVariableEjecucion",
                    'content'=>$this->renderAjax('create', [
                        'model' => $model,
                    ]),
                    'footer'=> Html::button('Close',['class'=>'btn btn-default pull-left','data-dismiss'=>"modal"]).
                                Html::button('Save',['class'=>'btn btn-primary','type'=>"submit"])

                ];
            }
        }else{
            /*
            *   Process for non-ajax request
            */
            if ($model->load($request->post()) && $model->save()) {
                return $this->redirect(['view', 'id' => $model->id]);
            } else {
                return $this->render('create', [
                    'model' => $model,
                ]);
            }
        }

    }

    /**
     * Updates an existing ProyectoVariableEjecucion model.
     * For ajax request will return json object
     * and for non-ajax request if update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     */
    public function actionUpdate($id)
    {
        $request = Yii::$app->request;
        $model = $this->findModel($id);

        if($request->isAjax){
            /*
            *   Process for ajax request
            */
            Yii::$app->response->format = Response::FORMAT_JSON;
            if($request->isGet){
                return [
                    'title'=> "Update ProyectoVariableEjecucion #".$id,
                    'content'=>$this->renderAjax('update', [
                        'model' => $model,
                    ]),
                    'footer'=> Html::button('Close',['class'=>'btn btn-default pull-left','data-dismiss'=>"modal"]).
                                Html::button('Save',['class'=>'btn btn-primary','type'=>"submit"])
                ];
            }else if($model->load($request->post()) && $model->save()){
                return [
                    'forceReload'=>'#crud-datatable-pjax',
                    'title'=> "ProyectoVariableEjecucion #".$id,
                    'content'=>$this->renderAjax('view', [
                        'model' => $model,
                    ]),
                    'footer'=> Html::button('Close',['class'=>'btn btn-default pull-left','data-dismiss'=>"modal"]).
                            Html::a('Edit',['update','id'=>$id],['class'=>'btn btn-primary','role'=>'modal-remote'])
                ];
            }else{
                 return [
                    'title'=> "Update ProyectoVariableEjecucion #".$id,
                    'content'=>$this->renderAjax('update', [
                        'model' => $model,
                    ]),
                    'footer'=> Html::button('Close',['class'=>'btn btn-default pull-left','data-dismiss'=>"modal"]).
                                Html::button('Save',['class'=>'btn btn-primary','type'=>"submit"])
                ];
            }
        }else{
            /*
            *   Process for non-ajax request
            */
            if ($model->load($request->post()) && $model->save()) {
                return $this->redirect(['view', 'id' => $model->id]);
            } else {
                return $this->render('update', [
                    'model' => $model,
                ]);
            }
        }
    }

    /**
     * Delete an existing ProyectoVariableEjecucion model.
     * For ajax request will return json object
     * and for non-ajax request if deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     */
    public function actionDelete($id)
    {
        $request = Yii::$app->request;
        $this->findModel($id)->delete();

        if($request->isAjax){
            /*
            *   Process for ajax request
            */
            Yii::$app->response->format = Response::FORMAT_JSON;
            return ['forceClose'=>true,'forceReload'=>'#crud-datatable-pjax'];
        }else{
            /*
            *   Process for non-ajax request
            */
            return $this->redirect(['index']);
        }

    }

     /**
     * Delete multiple existing ProyectoVariableEjecucion model.
     * For ajax request will return json object
     * and for non-ajax request if deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     */
    public function actionBulkDelete()
    {
        $request = Yii::$app->request;
        $pks = explode(',', $request->post( 'pks' )); // Array or selected records primary keys
        foreach ( $pks as $pk ) {
            $model = $this->findModel($pk);
            $model->delete();
        }

        if($request->isAjax){
            /*
            *   Process for ajax request
            */
            Yii::$app->response->format = Response::FORMAT_JSON;
            return ['forceClose'=>true,'forceReload'=>'#crud-datatable-pjax'];
        }else{
            /*
            *   Process for non-ajax request
            */
            return $this->redirect(['index']);
        }

    }

    /**
     * Finds the ProyectoVariableEjecucion model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $id
     * @return ProyectoVariableEjecucion the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id)
    {
        if (($model = ProyectoVariableEjecucion::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
}


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.semantic.lucene.handler;

import static com.semantic.ApplicationContext.*;
import com.semantic.lucene.fields.FileExtField;
import com.semantic.lucene.fields.FileNameField;
import com.semantic.lucene.fields.LastModifiedField;
import com.semantic.lucene.fields.MimeTypeField;
import com.semantic.lucene.fields.SizeField;
import com.semantic.lucene.util.IFieldProperty;
import com.semantic.plugin.PlugInManager;
import com.semantic.util.FileUtil;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.activation.MimetypesFileTypeMap;
import org.apache.lucene.document.Document;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.Term;

/**
 *
 * @author Christian Plonka (cplonka81@gmail.com)
 */
public abstract class LuceneFileHandler {

    protected static final Logger log = Logger.getLogger(LuceneFileHandler.class.getName());
    /**
     * repository of all registered fields
     */
    protected static final Map<String, IFieldProperty> repository = new HashMap<String, IFieldProperty>();
    /**
     * dummy handle
     */
    private static final IFieldProperty DUMMY = new DummyHandle();

    /**
     * Indexstate of the document
     */
    public static enum IndexState {

        CREATE,
        UPDATE,
        DELETE
    }
    /* */
    public static final MimetypesFileTypeMap MIME_MAP = new MimetypesFileTypeMap();
    public static final String[] IMAGE_MIME_TYPES = {
        "image/bmp bmp",
        "image/png png",
        "image/jpeg jpeg jpg",
        "image/gif gif"
    };
    public static final String[] TEXT_MIME_TYPES = {
        "text/plain txt"
    };

    static {
        for (String type : IMAGE_MIME_TYPES) {
            MIME_MAP.addMimeTypes(type);
        }
        for (String type : TEXT_MIME_TYPES) {
            MIME_MAP.addMimeTypes(type);
        }
        /* load all field definitions */
        PlugInManager mng = instance().get(PLUGIN_MANAGER);
        for (IFieldProperty def : mng.allInstances(IFieldProperty.class)) {
            repository.put(def.getName(), def);
        }
    }

    public static String[] convertMimeTypes(String[] types) {
        String[] ret = new String[types.length];
        for (int i = 0; i < ret.length; i++) {
            ret[i] = types[i].substring(0, types[i].indexOf(' '));
        }
        return ret;
    }

    public Document handleDocument(IndexWriter indexWriter, IndexState state, File file) throws Exception {
        switch (state) {
            case DELETE:
                indexWriter.deleteDocuments(new Term(FileNameField.NAME, file.getAbsolutePath()));
                return null;
        }
        Document doc = new Document();
        /* file name, when analyzed we're not find it per search query */
        get(FileNameField.NAME).add(doc, file.getAbsolutePath());
        /* file size, watch service problem: 0bytes after add */
        get(SizeField.NAME).add(doc, file.length());
        /* last date of modification */
        get(LastModifiedField.NAME).add(doc, file.lastModified());
        /* file extension */
        get(FileExtField.NAME).add(doc, FileUtil.getFileExtension(file));
        /* try to read mime type, attention detection case sensitive */
        get(MimeTypeField.NAME).add(doc, MIME_MAP.getContentType(
                file.getAbsolutePath().toLowerCase()));
        return doc;
    }

    public IFieldProperty get(String field) {
        IFieldProperty ret = repository.get(field);
        /* dummy handle */
        return ret == null ? DUMMY : ret;
    }

    public abstract String[] getFileExtensions();

    static class DummyHandle implements IFieldProperty<Object> {

        @Override
        public Class getType() {
            return Object.class;
        }

        @Override
        public String getName() {
            return "unknown";
        }

        @Override
        public void add(Document doc, Object value) {
            log.log(Level.FINE, String.format("No field handle found for value [%s]!", value));
        }
    }
}


text:
 My mails

									<button class="btn btn-success btn-sm"></button>

										<button class="btn btn-success btn-sm dropdown-toggle" data-toggle="dropdown">

										</button>

Action

Another action

Active

Separated link

									 Back to inbox

									<button data-toggle="tooltip" title="Move to archive" type="button" class="btn btn-success"></button>
									<button data-toggle="tooltip" title="Report spam" type="button" class="btn btn-success"></button>
									<button data-toggle="tooltip" title="Delete" type="button" class="btn btn-success"></button>

									<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown">

									</button>

Action

Another action

Something else here

Separated link

									<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown">

									</button>

Action

Another action

Something else here

Separated link

									<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown">
									  More

									</button>

Dropdown link

Dropdown link


text:
@echo off
SET basedir=%~dp0
set param=%~1
echo 'EXECUTE: powershell -executionPolicy bypass -file "%basedir%\ps\modfiy_user_variables.ps1" "%param%"'

REM echo | is neccessary to not block the execution if the cmd script is called from java
echo | powershell.exe -executionPolicy bypass -file "%basedir%\ps\modfiy_user_variables.ps1" "%param%"

echo 'END!'


text:
'use strict';

var hljs = require('highlight.js');
require('highlight-css');
var MarkdownIt = require('markdown-it');

var highlighter = function (str, lang) {
        if (lang && hljs.getLanguage(lang)) {
            try {
                return hljs.highlight(lang, str).value;
            } catch (__) {}
        }

        try {
            return hljs.highlightAuto(str).value;
        } catch (__) {}

        return ''; // use external default escaping
    };

// Full markdown renderer for views / wiki pages / pauses between typing
var markdown = new MarkdownIt('commonmark', {
    highlight: highlighter
})
    .use(require('markdown-it-video'))
    .use(require('markdown-it-toc'))
    .use(require('markdown-it-sanitizer'));

// Fast markdown renderer for active editing to prevent slow loading/rendering tasks
var markdownQuick = new MarkdownIt(('commonmark'), { })
    .use(require('markdown-it-sanitizer'))
    .disable('link')
    .disable('image');

module.exports = {
    full: markdown,
    quick: markdownQuick
};


text:
package org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact;

import org.gradle.api.artifacts.ResolvedArtifact;
import org.gradle.api.artifacts.component.ComponentArtifactIdentifier;
import org.gradle.api.internal.tasks.TaskDependencyContainer;
import org.gradle.internal.model.CalculatedValue;

import java.io.File;

/**
 * Represents an artifact that can be resolved. Call {@link #getFile()} or {@link ResolvedArtifact#getFile()} to resolve.
 */
public interface ResolvableArtifact extends TaskDependencyContainer {
    ComponentArtifactIdentifier getId();

    /**
     * Should this artifact be resolved synchronously? For example, is the result of {@link #getFile()} available in memory or can it be calculated quickly without IO calls?
     */
    boolean isResolveSynchronously();

    /**
     * Resolves the file, if not already, blocking until complete.
     */
    File getFile();

    /**
     * Returns the artifact file as a lazy type. Does not resolve the file, but the returned value can be used to do so.
     */
    CalculatedValue<File> getFileSource();

    ResolvableArtifact transformedTo(File file);

    ResolvedArtifact toPublicView();
}


text:
package ca.uhn.fhir.rest.server.method;

import java.io.IOException;
import java.io.Writer;
import java.lang.reflect.Method;
import java.util.Collections;
import java.util.EnumSet;
import java.util.Set;

import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang3.StringUtils;
import org.hl7.fhir.instance.model.api.IBaseOperationOutcome;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.instance.model.api.IIdType;

import ca.uhn.fhir.context.ConfigurationException;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.parser.IParser;
import ca.uhn.fhir.rest.api.Constants;
import ca.uhn.fhir.rest.api.EncodingEnum;
import ca.uhn.fhir.rest.api.MethodOutcome;
import ca.uhn.fhir.rest.api.PreferReturnEnum;
import ca.uhn.fhir.rest.api.RequestTypeEnum;
import ca.uhn.fhir.rest.api.RestOperationTypeEnum;
import ca.uhn.fhir.rest.api.SummaryEnum;
import ca.uhn.fhir.rest.api.server.IRestfulResponse;
import ca.uhn.fhir.rest.api.server.IRestfulServer;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import ca.uhn.fhir.rest.server.RestfulServer;
import ca.uhn.fhir.rest.server.RestfulServerUtils;
import ca.uhn.fhir.rest.server.exceptions.BaseServerResponseException;
import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor;

abstract class BaseOutcomeReturningMethodBinding extends BaseMethodBinding<MethodOutcome> {
	static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(BaseOutcomeReturningMethodBinding.class);

	private static EnumSet<RestOperationTypeEnum> ourOperationsWhichAllowPreferHeader = EnumSet.of(RestOperationTypeEnum.CREATE, RestOperationTypeEnum.UPDATE);

	private boolean myReturnVoid;

	public BaseOutcomeReturningMethodBinding(Method theMethod, FhirContext theContext, Class<?> theMethodAnnotation, Object theProvider) {
		super(theMethod, theContext, theProvider);

		if (!theMethod.getReturnType().equals(MethodOutcome.class)) {
			if (!allowVoidReturnType()) {
				throw new ConfigurationException("Method " + theMethod.getName() + " in type " + theMethod.getDeclaringClass().getCanonicalName() + " is a @" + theMethodAnnotation.getSimpleName() + " method but it does not return " + MethodOutcome.class);
			} else if (theMethod.getReturnType() == void.class) {
				myReturnVoid = true;
			}
		}
	}

	protected abstract void addParametersForServerRequest(RequestDetails theRequest, Object[] theParams);

	/**
	 * Subclasses may override to allow a void method return type, which is allowable for some methods (e.g. delete)
	 */
	protected boolean allowVoidReturnType() {
		return false;
	}

	/**
	 * For servers, this method will match only incoming requests that match the given operation, or which have no
	 * operation in the URL if this method returns null.
	 */
	protected abstract String getMatchingOperation();

	private int getOperationStatus(MethodOutcome response) {
		switch (getRestOperationType()) {
		case CREATE:
			if (response == null) {
				throw new InternalErrorException("Method " + getMethod().getName() + " in type " + getMethod().getDeclaringClass().getCanonicalName() + " returned null, which is not allowed for create operation");
			}
			if (response.getCreated() == null || Boolean.TRUE.equals(response.getCreated())) {
				return Constants.STATUS_HTTP_201_CREATED;
			}
			return Constants.STATUS_HTTP_200_OK;

		case UPDATE:
			if (response == null || response.getCreated() == null || Boolean.FALSE.equals(response.getCreated())) {
				return Constants.STATUS_HTTP_200_OK;
			}
			return Constants.STATUS_HTTP_201_CREATED;

		case VALIDATE:
		case DELETE:
		default:
			if (response == null) {
				if (isReturnVoid() == false) {
					throw new InternalErrorException("Method " + getMethod().getName() + " in type " + getMethod().getDeclaringClass().getCanonicalName() + " returned null");
				}
				return Constants.STATUS_HTTP_204_NO_CONTENT;
			}
			if (response.getOperationOutcome() == null) {
				return Constants.STATUS_HTTP_204_NO_CONTENT;
			}
			return Constants.STATUS_HTTP_200_OK;
		}
	}

	@Override
	public boolean incomingServerRequestMatchesMethod(RequestDetails theRequest) {
		Set<RequestTypeEnum> allowableRequestTypes = provideAllowableRequestTypes();
		RequestTypeEnum requestType = theRequest.getRequestType();
		if (!allowableRequestTypes.contains(requestType)) {
			return false;
		}
		if (!getResourceName().equals(theRequest.getResourceName())) {
			return false;
		}
		if (getMatchingOperation() == null && StringUtils.isNotBlank(theRequest.getOperation())) {
			return false;
		}
		if (getMatchingOperation() != null && !getMatchingOperation().equals(theRequest.getOperation())) {
			return false;
		}

		/*
		 * Note: Technically this will match an update (PUT) method even if
		 * there is no ID in the URL - We allow this here because there is no
		 * better match for that, and this allows the update/PUT method to give
		 * a helpful error if the client has forgotten to include the
		 * ID in the URL.
		 *
		 * It's also needed for conditional update..
		 */

		return true;
	}

	@Override
	public Object invokeServer(IRestfulServer<?> theServer, RequestDetails theRequest) throws BaseServerResponseException, IOException {

		Object[] params = createParametersForServerRequest(theRequest);
		addParametersForServerRequest(theRequest, params);

		/*
		 * No need to catch and handle exceptions here, we already handle them one level up including invoking interceptors
		 * on them
		 */
		MethodOutcome response;
		Object methodReturn = invokeServerMethod(theServer, theRequest, params);

		if (methodReturn instanceof IBaseOperationOutcome) {
			response = new MethodOutcome();
			response.setOperationOutcome((IBaseOperationOutcome) methodReturn);
		} else {
			response = (MethodOutcome) methodReturn;
		}

		if (response != null && response.getId() != null && response.getId().hasResourceType()) {
			if (getContext().getResourceDefinition(response.getId().getResourceType()) == null) {
				throw new InternalErrorException("Server method returned invalid resource ID: " + response.getId().getValue());
			}
		}

		IBaseOperationOutcome outcome = response != null ? response.getOperationOutcome() : null;
		IBaseResource resource = response != null ? response.getResource() : null;

		return returnResponse(theServer, theRequest, response, outcome, resource);
	}
	public boolean isReturnVoid() {
		return myReturnVoid;
	}

	protected abstract Set<RequestTypeEnum> provideAllowableRequestTypes();

	private Object returnResponse(IRestfulServer<?> theServer, RequestDetails theRequest, MethodOutcome response, IBaseResource originalOutcome, IBaseResource resource) throws IOException {
		boolean allowPrefer = false;
		int operationStatus = getOperationStatus(response);
		IBaseResource outcome = originalOutcome;

		if (ourOperationsWhichAllowPreferHeader.contains(getRestOperationType())) {
			allowPrefer = true;
		}

		if (resource != null && allowPrefer) {
			String prefer = theRequest.getHeader(Constants.HEADER_PREFER);
			PreferReturnEnum preferReturn = RestfulServerUtils.parsePreferHeader(prefer);
			if (preferReturn != null) {
				if (preferReturn == PreferReturnEnum.REPRESENTATION) {
					outcome = resource;
				}
			}
		}

		for (int i = theServer.getInterceptors().size() - 1; i >= 0; i--) {
			IServerInterceptor next = theServer.getInterceptors().get(i);
			boolean continueProcessing = next.outgoingResponse(theRequest, outcome);
			if (!continueProcessing) {
				return null;
			}
		}

		IRestfulResponse restfulResponse = theRequest.getResponse();

		if (response != null) {
			if (response.getResource() != null) {
				restfulResponse.setOperationResourceLastUpdated(RestfulServerUtils.extractLastUpdatedFromResource(response.getResource()));
			}

			IIdType responseId = response.getId();
			if (responseId != null && responseId.getResourceType() == null && responseId.hasIdPart()) {
				responseId = responseId.withResourceType(getResourceName());
			}

			if (responseId != null) {
				String serverBase = theRequest.getFhirServerBase();
				responseId = RestfulServerUtils.fullyQualifyResourceIdOrReturnNull(theServer, resource, serverBase, responseId);
				restfulResponse.setOperationResourceId(responseId);
			}
		}

		boolean prettyPrint = RestfulServerUtils.prettyPrintResponse(theServer, theRequest);
		Set<SummaryEnum> summaryMode = Collections.emptySet();

		return restfulResponse.streamResponseAsResource(outcome, prettyPrint, summaryMode, operationStatus, null, theRequest.isRespondGzip(), true);
//		return theRequest.getResponse().returnResponse(ParseAction.create(outcome), operationStatus, allowPrefer, response, getResourceName());
	}

	protected void streamOperationOutcome(BaseServerResponseException theE, RestfulServer theServer, EncodingEnum theEncodingNotNull, HttpServletResponse theResponse, RequestDetails theRequest) throws IOException {
		theResponse.setStatus(theE.getStatusCode());

		theServer.addHeadersToResponse(theResponse);

		if (theE.getOperationOutcome() != null) {
			theResponse.setContentType(theEncodingNotNull.getResourceContentType());
			IParser parser = theEncodingNotNull.newParser(theServer.getFhirContext());
			parser.setPrettyPrint(RestfulServerUtils.prettyPrintResponse(theServer, theRequest));
			Writer writer = theResponse.getWriter();
			try {
				parser.encodeResourceToWriter(theE.getOperationOutcome(), writer);
			} finally {
				writer.close();
			}
		} else {
			theResponse.setContentType(Constants.CT_TEXT);
			Writer writer = theResponse.getWriter();
			try {
				writer.append(theE.getMessage());
			} finally {
				writer.close();
			}
		}
	}

	protected static void parseContentLocation(FhirContext theContext, MethodOutcome theOutcomeToPopulate, String theLocationHeader) {
		if (StringUtils.isBlank(theLocationHeader)) {
			return;
		}

		IIdType id = theContext.getVersion().newIdType();
		id.setValue(theLocationHeader);
		theOutcomeToPopulate.setId(id);
	}

}


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>MeToo</title>

  <link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'/>

  <link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css'/>

  <link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css'/>

  <link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css'/>

  <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.css">

  <link rel="stylesheet" href="/static/css/style.css">

Create

Browse

See a map with activities around you

Create a group activity

        <form>
            <input name="textinput-4" id="textinput-4" placeholder="Title" value="" type="text">
            <fieldset data-role="controlgroup">
                <legend class="ui-hidden-accessible">Horizontal controlgroup, radio:</legend>
                <input name="radio-choice-h-4" id="radio-choice-h-4a" value="on" checked="checked" type="radio">
                Today, Sun 28th June
                <input name="radio-choice-h-4" id="radio-choice-h-4b" value="off" type="radio">
                Tomorrow, Mon 29th June
                <input name="radio-choice-h-4" id="radio-choice-h-4c" value="other" type="radio">
                Tue 30th June
            </fieldset>
            <input name="textinput-4" id="textinput-4" placeholder="Place to meet" value="" type="text">
            Hour to meet: <input name="slider-4" id="slider-4" value="10:00" min="1" max="24" data-highlight="true" data-mini="false" type="range">
            <textarea cols="40" rows="8" name="textarea-4" id="textarea-4">Description</textarea>
            Categories:
            <select multiple="multiple" data-native-menu="false" name="select-multiple-4" id="select-multiple-4">
                <option value="">Categories:</option>
                <option value="sightseeing">Sightseeing</option>
                <option value="drinks">Drinks</option>
                <option value="food">Food</option>
                <option value="sports">Sports</option>
            </select>
            <button class="ui-shadow ui-btn ui-corner-all" type="submit" id="submit-4">Submit</button>
        </form>

Tell us your preferences

      <form id="checkboxes">
        <input name="textinput-4" id="textinput-4" placeholder="Title" value="" type="text">
        <fieldset data-role="controlgroup">
          <legend class="ui-hidden-accessible">Horizontal controlgroup, radio:</legend>
          <input name="radio-choice-h-4" id="radio-choice-h-4a" value="on" checked="checked" type="radio">
          Today, Sun 28th June
          <input name="radio-choice-h-4" id="radio-choice-h-4b" value="off" type="radio">
          Tomorrow, Mon 29th June
          <input name="radio-choice-h-4" id="radio-choice-h-4c" value="other" type="radio">
          Tue 30th June
        </fieldset>
        <input name="textinput-4" id="textinput-4" placeholder="Place to meet" value="" type="text">
        Hour to meet: <input name="slider-4" id="slider-4" value="10:00" min="1" max="24" data-highlight="true" data-mini="false" type="range">
        <textarea cols="40" rows="8" name="textarea-4" id="textarea-4">Description</textarea>
        Categories:
        <select multiple="multiple" data-native-menu="false" name="select-multiple-4" id="select-multiple-4">
          <option value="">Categories:</option>
          <option value="sightseeing">Sightseeing</option>
          <option value="drinks">Drinks</option>
          <option value="food">Food</option>
          <option value="sports">Sports</option>
        </select>
        <button class="ui-shadow ui-btn ui-corner-all" type="submit" id="submit-4">Submit</button>
      </form>

      <fieldset style="display:none;" data-role="controlgroup">
        <input id="checkbox-food" type="checkbox">
        Food
        <input id="checkbox-drink" type="checkbox">
        Drink
        <input id="checkbox-party" type="checkbox">
        Party
        <input id="checkbox-sightseeing" type="checkbox">
        Sightseeing
        <input id="checkbox-culture_events" type="checkbox">
        Culture Events
        <input id="checkbox-concerts" type="checkbox">
        Concerts
        <input id="checkbox-dancing" type="checkbox">
        Dancing
        <input id="checkbox-sports" type="checkbox">
        Sports
        <input id="checkbox-exploring" type="checkbox">
        Exploring
      </fieldset>
      Find awesome People!

Proposed activities around you

    <input id="input-event-id" type="hidden">

Chat

      <input type="text" id="chat-input-form" placeholder="Type some lovely words..."/>
      <button id="chat-submit">Go!</button>


text: export * from './users.reducer';


text:
@interface BeeController : NSObject<BeeMessageExecutor>
{
	NSString *				_prefix;
	NSMutableDictionary *	_mapping;
}

@property (nonatomic, retain) NSString *			prefix;
@property (nonatomic, retain) NSMutableDictionary *	mapping;

AS_SINGLETON( BeeController );

+ (NSString *)MESSAGE;		// 消息类别
+ (NSString *)MESSAGE_TYPE;	// = MESSAGE

+ (NSArray *)allControllers;

+ (BeeController *)routes:(NSString *)message;

- (void)load;
- (void)unload;

- (void)index:(BeeMessage *)msg;
- (void)route:(BeeMessage *)msg;

- (void)map:(NSString *)name action:(SEL)action;
- (void)map:(NSString *)name action:(SEL)action target:(id)target;

@end


text:
jQuery.noConflict();
(function($,PLUGIN_ID){
	"use strict";
	/*---------------------------------------------------------------
	 valiable
	---------------------------------------------------------------*/
	var vars={
		limit:500,
		offset:0,
		splash:null,
		table:null,
		year:parseInt(new Date().format('Y')),
		config:{},
		fieldinfos:{},
		views:{},
		calculations:[],
		summaries:[],
	};
	var events={
		lists:[
			'app.record.index.show'
		]
	};
	var functions={
		/* calc display scale */
		calcscale:function(value,field)
		{
			var res=0;
			if (value)
			{
				res=parseFloat(value);
				if (vars.fieldinfos[field].displayScale)
				{
					var scale=parseInt(vars.fieldinfos[field].displayScale);
					var digit=(scale>0)?Math.pow(10,parseInt(scale)):1;
					res=Math.floor(res*digit)/digit;
				}
			}
			return res;
		},
		/* record summary */
		summary:function(row,records,summary){
			var basemonth=new Date((vars.year.toString()+'-'+vars.config.basemonth+'-1').dateformat());
			var tablecode=(function(field){
				if (field) return vars.fieldinfos[field].tablecode;
				return '';
			})(summary.date);
			var totalamount=(function(){
				var res=0;
				for (var i=0;i<records.length;i++)
				{
					switch (summary.pattern)
					{
						case '2':
							for (var i2=0;i2<records[i][tablecode].value.length;i2++)
								res+=functions.calcscale(records[i][tablecode].value[i2].value[summary.field].value,summary.field);
							break;
						case '8':
							res++;
							break;
					}
				}
				return res;
			})();
			for (var i=0;i<12;i++)
			{
				var counter=0;
				var amount=0;
				var monthlyamount=0;
				var fromdate=basemonth.calc(i.toString()+' month');
				var todate=fromdate.calc('1 month').calc('-1 day');
				(function(filter){
					var res=[];
					for (var i2=0;i2<filter.length;i2++)
					{
						var match=$.conditionsmatch(filter[i2],vars.fieldinfos,JSON.parse(summary.conditions));
						if (match)
						{
							switch (summary.pattern)
							{
								case '0':
								case '1':
								case '2':
								case '3':
								case '4':
								case '5':
									for (var i3=0;i3<match[tablecode].value.length;i3++)
										amount+=functions.calcscale(match[tablecode].value[i3].value[summary.field].value,summary.field);
									switch (summary.pattern)
									{
										case '5':
											counter++;
											break;
									}
									break;
								case '6':
								case '7':
								case '8':
								case '9':
									amount+=match[tablecode].value.length;
									break;
							}
						}
						switch (summary.pattern)
						{
							case '1':
								for (var i3=0;i3<filter[i2][tablecode].value.length;i3++)
									monthlyamount+=functions.calcscale(filter[i2][tablecode].value[i3].value[summary.field].value,summary.field);
								break;
							case '7':
								monthlyamount+=filter[i2][tablecode].value.length;
								break;
						}
					}
					switch (summary.pattern)
					{
						case '4':
							totalamount+=amount;
							break;
					}
					return res;
				})((function(){
					var filter=[];
					for (var i2=0;i2<records.length;i2++)
					{
						var record=$.extend(true,{},records[i2]);
						var tablerecord=record[vars.fieldinfos[summary.date].tablecode].value;
						record[vars.fieldinfos[summary.date].tablecode].value=$.grep(tablerecord,function(item,index){
							if (item.value[summary.date].value)
							{
								var date=new Date(new Date(item.value[summary.date].value.dateformat()).format('Y-m-d').dateformat());
								return (date>=fromdate && date<=todate);
							}
							else return false;
						});
						filter.push(record);
					}
					return filter;
				})());
				switch (summary.pattern)
				{
					case '0':
					case '3':
					case '9':
						row[i]=amount;
						break;
					case '1':
						if (monthlyamount!=0) row[i]=amount/monthlyamount*100;
						break;
					case '2':
						if (totalamount!=0) row[i]=amount/totalamount*100;
						break;
					case '4':
						row[i]=totalamount;
						break;
					case '5':
						if (counter!=0) row[i]=amount/counter;
						break;
					case '6':
						row[i]=amount;
						break;
					case '7':
						if (monthlyamount!=0) row[i]=amount/monthlyamount*100;
						break;
					case '8':
						if (totalamount!=0) row[i]=amount/totalamount*100;
						break;
				}
			}
		},
		/* reload view */
		load:function(){
			vars.splash.removeClass('hide');
			var counter=vars.summaries.length;
			var fromdate=new Date((vars.year.toString()+'-'+vars.config.basemonth+'-1').dateformat());
			var todate=fromdate.calc('12 month').calc('-1 day');
			var setuprecord=function(){
				for (var i=0;i<vars.summaries.length;i++)
					(function(row,record,denominators,summary){
						var unit=(function(field){
							if (field) return (vars.fieldinfos[field].unit)?vars.fieldinfos[field].unit:'';
							return '';
						})(summary.field);
						var unitposition=(function(field){
							if (field) return (vars.fieldinfos[field].unitPosition)?vars.fieldinfos[field].unitPosition.toUpperCase():'BEFORE';
							return '';
						})(summary.field);
						for (var i2=0;i2<12;i2++)
						{
							var cell=$('td',row).eq(i2+1);
							var denominator=0;
							switch (summary.pattern)
							{
								case '0':
									cell.text(record[i2].comma());
									if (unitposition=='BEFORE') cell.text(unit+cell.text());
									else cell.text(cell.text()+unit);
									break;
								case '1':
									cell.text(functions.rounding(record[i2]).comma()+'%');
									break;
								case '2':
									cell.text(functions.rounding(record[i2]).comma()+'%');
									break;
								case '3':
									denominator=denominators[parseInt(summary.denominator)][i2];
									if (denominator) cell.text(functions.rounding((record[i2]/denominator*100)).comma()+'%');
									else cell.text('0%');
									break;
								case '4':
									cell.text(record[i2].comma());
									if (unitposition=='BEFORE') cell.text(unit+cell.text());
									else cell.text(cell.text()+unit);
									break;
								case '5':
									cell.text(functions.rounding(record[i2]).comma());
									if (unitposition=='BEFORE') cell.text(unit+cell.text());
									else cell.text(cell.text()+unit);
									break;
								case '6':
									cell.text(record[i2].comma()+'件');
									break;
								case '7':
									cell.text(functions.rounding(record[i2]).comma()+'%');
									break;
								case '8':
									cell.text(functions.rounding(record[i2]).comma()+'%');
									break;
								case '9':
									denominator=denominators[parseInt(summary.denominator)][i2];
									if (denominator) cell.text(functions.rounding((record[i2]/denominator*100)).comma()+'%');
									else cell.text('0%');
									break;
							}
						}
					})($('tr',vars.table.contents).eq(i),vars.calculations[i],vars.calculations,vars.summaries[i]);
			};
			vars.calculations=[];
			for (var i=0;i<vars.summaries.length;i++)
			{
				vars.calculations.push([0,0,0,0,0,0,0,0,0,0,0,0]);
				(function(row,summary){
					functions.loaddatas([],summary.date,0,function(records){
						if (records.length!=0)
							for (var i2=0;i2<records.length;i2++)
							{
								var tablerecord=records[i2][vars.fieldinfos[summary.date].tablecode].value;
								records[i2][vars.fieldinfos[summary.date].tablecode].value=$.grep(tablerecord,function(item,index){
									if (item.value[summary.date].value)
									{
										var date=new Date(new Date(item.value[summary.date].value.dateformat()).format('Y-m-d').dateformat());
										return (date>=fromdate && date<=todate);
									}
									else return false;
								});
							}
						functions.summary(row,records,summary);
						counter--;
						if (counter==0)
						{
							vars.splash.addClass('hide');
							setuprecord();
						}
					});
				})(vars.calculations[i],vars.summaries[i]);
			}
		},
		/* load app datas */
		loaddatas:function(records,date,offset,callback){
			var fromdate=new Date((vars.year.toString()+'-'+vars.config.basemonth+'-1').dateformat());
			var todate=fromdate.calc('12 month').calc('-1 day');
			var body={
				app:kintone.app.getId(),
				query:kintone.app.getQueryCondition()
			};
			body.query+=((body.query)?' and ':'');
			if (vars.fieldinfos[date].type=='DATE') body.query+=date+'>="'+fromdate.format('Y-m-d')+'" and '+date+'<="'+todate.format('Y-m-d')+'"';
			else body.query+=date+'>="'+fromdate.format('Y-m-d')+'T00:00:00+0900" and '+date+'<="'+todate.format('Y-m-d')+'T23:59:59+0900"';
			body.query+=' limit '+vars.limit.toString();
			body.query+=' offset '+offset.toString();
			kintone.api(kintone.api.url('/k/v1/records',true),'GET',body,function(resp){
				Array.prototype.push.apply(records,resp.records);
				offset+=vars.limit;
				if (resp.records.length==vars.limit) functions.loaddatas(records,date,offset,callback);
				else callback(records);
			},function(error){
				vars.splash.addClass('hide');
				swal('Error!',error.message,'error');
			});
		},
		/* calculate rounding */
		rounding:function(value){
			var digit=1;
			var res=0;
			if (vars.config.digit>0) digit=Math.pow(10,parseInt(vars.config.digit));
			switch (vars.config.round)
			{
				case '1':
					res=Math.floor(value*digit)/digit;
					break;
				case '2':
					res=Math.ceil(value*digit)/digit;
					break;
				case '3':
					res=Math.round(value*digit)/digit;
					break;
			}
			return res;
		}
	};
	/*---------------------------------------------------------------
	 kintone events
	---------------------------------------------------------------*/
	kintone.events.on(events.lists,function(event){
		vars.config=kintone.plugin.app.getConfig(PLUGIN_ID);
		if (!vars.config) return event;
		if ('views' in vars.config) vars.views=JSON.parse(vars.config.views);
		/* check viewid */
		if (!('_'+event.viewId.toString() in vars.views)) return event;
		/* get views of app */
		kintone.api(kintone.api.url('/k/v1/app/views',true),'GET',{app:kintone.app.getId()},function(resp){
			$.each(resp.views,function(key,values){
				if (values.type.toUpperCase()=='LIST' && values.id==event.viewId)
				{
					var setupyear=function(amount){
						vars.year+=amount;
						$('.monthlysummary-headermenucontents #year').text(vars.year.toString());
						/* reload view */
						functions.load();
					};
					/* initialize valiable */
					vars.summaries=vars.views['_'+event.viewId.toString()];
					vars.splash=$('
').append(
						$('
')
						.append($('').text('now loading'))
						.append($('').text('.'))
						.append($('').text('.'))
						.append($('').text('.'))
						.append($('').text('.'))
						.append($('').text('.'))
					);
					/* append elements */
					$('.gaia-argoui-app-index-pager').hide();
					if ($('.monthlysummary-headermenucontents').size()) $('.monthlysummary-headermenucontents').remove();
					kintone.app.getHeaderMenuSpaceElement().appendChild(
						$('
')
						.append($('<button class="customview-button prev-button">').on('click',function(){setupyear(-1)}))
						.append($(''))
						.append($('<button class="customview-button next-button">').on('click',function(){setupyear(1)}))
						.append(
							$('')
							.on('click',function(){
								var output='';
								output+=',';
								for (var i=0;i<12;i++)
								{
									output+=$('thead th',vars.table.container).eq(i+1).text();
									if (i<11) output+=',';
								}
								output+='\n';
								for (var i=0;i<vars.table.rows.length;i++)
									$.each($('td',vars.table.rows[i]),function(index){
										output+=$(this).text().replace(/,/g,'');
										if (index<12) output+=',';
										else output+='\n';
									});
								$.downloadtext(output,'SJIS',values.name+'.csv');
							})
						)[0]
					);
					$('body').append(vars.splash);
					/* fixed header */
					var headeractions=$('div.contents-actionmenu-gaia');
					var headerspace=$(kintone.app.getHeaderSpaceElement());
					headeractions.parent().css({'position':'relative'});
					headerspace.parent().css({'position':'relative'});
					$(window).on('load resize scroll',function(e){
						headeractions.css({
							'left':$(window).scrollLeft().toString()+'px',
							'position':'absolute',
							'top':'0px',
							'width':$(window).width().toString()+'px'
						});
						headerspace.css({
							'left':$(window).scrollLeft().toString()+'px',
							'position':'absolute',
							'top':headeractions.outerHeight(false)+'px',
							'width':$(window).width().toString()+'px'
						});
						$('div#view-list-data-gaia').css({'margin-top':(headeractions.outerHeight(false)+headerspace.outerHeight(false))+'px','overflow-x':'visible'});
					});
					/* get fields of app */
					kintone.api(kintone.api.url('/k/v1/app/form/fields',true),'GET',{app:kintone.app.getId()},function(resp){
						vars.fieldinfos=$.fieldparallelize(resp.properties);
						/* create table */
						var basemonth=new Date((vars.year.toString()+'-'+vars.config.basemonth+'-1').dateformat());
						var head=$('
');
						var template=$('
');
						head.append($(''));
						template.append($(''));
						for (var i=0;i<12;i++)
						{
							head.append($('').text(basemonth.calc(i.toString()+' month').format('m')+'月'));
							template.append($(''));
						}
						vars.table=$('
').mergetable({
							container:$('div#view-list-data-gaia').empty(),
							head:head,
							template:template,
							merge:false
						});
						/* insert row */
						for (var i=0;i<vars.summaries.length;i++)
						{
							var summary=vars.summaries[i];
							vars.table.insertrow(null,function(row){
								$('td',row).first().text(summary.caption).css({'text-align':'left'});
								$('td',row).each(function(index){
									$(this).css({
										'background-color':'#'+summary.backcolor,
										'color':'#'+summary.forecolor,
										'text-align':'right'
									});
								});
							});
						}
						/* setup year value */
						setupyear(0);
					},function(error){swal('Error!',error.message,'error');});
				}
			})
		},function(error){swal('Error!',error.message,'error');});
		return event;
	});
})(jQuery,kintone.$PLUGIN_ID);


text:
// Provides the base class for plugins.
sap.ui.define(["sap/ui/core/Element"], function(Element) {
	"use strict";

	/**
	 * Provides the base class for plugins.
	 *
	 * @param {string} [sId] ID for the new plugin, generated automatically if no ID is given
	 * @param {object} [mSettings] Initial settings for the new plugin
	 *
	 * @abstract
	 * @class
	 * Provides the base class for plugins.
	 * @extends sap.ui.core.Element
	 *
	 * @author SAP SE
	 * @version ${version}
	 *
	 * @private
	 * @experimental Since 1.73. This class is experimental and provides only limited functionality. Also the API might be changed in future.
	 * @since 1.73
	 * @alias sap.m.plugins.PluginBase
	 */
	var PluginBase = Element.extend("sap.m.plugins.PluginBase", /** @lends sap.m.plugins.PluginBase.prototype */ {
		metadata: {
			"abstract": true,
			library: "sap.m",
			properties: {
				/**
				 * Indicates whether this plugin is active or not.
				 */
				enabled: {type: "boolean", defaultValue: true}
			}
		}
	});

	/**
	 * Internal data store for plugin-control configurations
	 */
	var mPluginControlConfigs = {};

	/**
	 * Defines a plugin-related multiple control configuration.
	 *
	 * @example
	 * PluginBase.setConfigs({
	 *     "sap.m.Table": {
	 *		    defaultAggregationName: "items"
	 *     },
	 *     "sap.ui.table.Table": {
	 *          defaultAggregationName: "rows"
	 *     }
	 * }, TablePluginConstructor);
	 *
	 * @param {object} mControlConfigs The configuration object for control types where the first level keys are full control names and values are configuration objects
	 * @param {string|function} vPlugin The full name or the constructor of the plugin
	 * @protected
	 * @static
	 */
	PluginBase.setConfigs = function(mControlConfigs, vPlugin) {
		var sPluginName = (typeof vPlugin == "function") ? vPlugin.getMetadata().getName() : vPlugin;
		Object.assign(mPluginControlConfigs[sPluginName] = mPluginControlConfigs[sPluginName] || {}, mControlConfigs);
	};

	/**
	 * Sets a control-related plugin configuration.
	 *
	 * @example
	 * PluginBase.setControlConfig("sap.m.Table", {
	 *     defaultAggregationName: "items"
	 * }, "my.table.plugin");
	 *
	 * @param {string|function} vControl The full name or the constructor of the control
	 * @param {object} mControlConfig The configuration object for a control type
	 * @param {string|function} vPlugin The full name or the constructor of the plugin
	 * @public
	 * @static
	 */
	PluginBase.setControlConfig = function(vControl, mControlConfig, vPlugin) {
		var mControlConfigs = {};
		var sControlName = (typeof vControl == "function") ? vControl.getMetadata().getName() : vControl;
		mControlConfigs[sControlName] = mControlConfig;
		this.setConfigs(mControlConfigs, vPlugin);
	};

	/**
	 * Returns the first applied plugin for the given control instance and the plugin name.
	 *
	 * @param {sap.ui.core.Control} oControl The control instance to check for
	 * @param {string|function} [vPlugin] The full name or the constructor of the plugin
	 * @return {undefined|sap.m.plugins.PluginBase} The found plugin instance or undefined if not found
	 * @public
	 * @static
	 */
	PluginBase.getPlugin = function(oControl, vPlugin) {
		if (vPlugin == undefined) {
			vPlugin = this.getMetadata().getName();
		} else if (typeof vPlugin == "function") {
			vPlugin = vPlugin.getMetadata().getName();
		}

		return oControl.findElements(false, function(oElement) {
			return oElement.isA(vPlugin);
		})[0];
	};

	/**
	 * Indicates whether the plugin is added to an applicable control and the enabled property of the plugin is true.
	 *
	 * @returns {boolean} true if the plugin is active, otherwise false
	 * @protected
	 */
	PluginBase.prototype.isActive = function() {
		return !!(this._bActive);
	};

	/**
	 * Returns the parent or the logical owner of the plugin instance.
	 *
	 * A composite control can implement the get[PluginName]PluginOwner method to define a logical plugin owner that will be responsible for the plugin.
	 * In this case, even though the plugin instance is added to the composite control, the return value of get[PluginName]PluginOwner will be the logical owner of the plugin.
	 * If a composite control instantiates internal controls asynchronously, then the get[PluginName]PluginOwner method must return a promise. After the Promise has been resolved,
	 * the get[PluginName]PluginOwner method must always return the instance of the internal control.

	 * If such a get[PluginName]PluginOwner method exists in the control where the plugin is inserted then the getControl method return the logical owner of the plugin.
	 *
	 * @returns {sap.ui.core.Control|null}
	 * @protected
	 */
	PluginBase.prototype.getControl = function() {
		var oParent = this.getParent();
		if (oParent) {
			var sPluginOwnerMethod = "get" + this.getMetadata().getName().split(".").pop() + "PluginOwner";
			oParent = oParent[sPluginOwnerMethod] ? oParent[sPluginOwnerMethod](this) : oParent;
		}

		return oParent;
	};

	/**
	 * Returns the plugin configuration of the control.
	 * If the configuration is a type of function, then it gets executed.
	 *
	 * @param {string} sKey The configuration key
	 * @param {any} [vParam1] The first parameter if the sKey configuration is a type of function
	 * @param {any} [vParam2] The second parameter if the sKey configuration is a type of function
	 * @param {any} [vParam3] The third parameter if the sKey configuration is a type of function
	 * @returns {*} The plugin configuration of the control, otherwise undefined
	 * @protected
	 */
	PluginBase.prototype.getConfig = function(sKey, vParam1, vParam2, vParam3) {
		var oControl = this.getControl();
		if (!oControl) {
			return;
		}

		var sPluginName = this.getMetadata().getName();
		var sControlName = oControl.getMetadata().getName();
		var mPluginConfig = mPluginControlConfigs[sPluginName] || {};
		var mControlConfig = mPluginConfig[sControlName] || {};
		var fnReturn = function(mConfig) {
			return (typeof mConfig[sKey] == "function") ? mConfig[sKey].call(mConfig, vParam1, vParam2, vParam3) : mConfig[sKey];
		};

		if (sKey in mControlConfig) {
			return fnReturn(mControlConfig);
		}

		for (var sControlType in mPluginConfig) {
			if (oControl.isA(sControlType)) {
				if (!sKey) {
					return mPluginConfig[sControlType];
				}
				if (sKey in mPluginConfig[sControlType]) {
					return fnReturn(mPluginConfig[sControlType]);
				}
			}
		}
	};

	/**
	 * This hook method gets called to determine whether the plugin is applicable for the defined control or not.
	 * By default, plugins can be applied if a control configuration has been defined for a particular plugin type.
	 *
	 * @param {sap.ui.core.Control} oControl The control that is connected to the plugin
	 * @returns {boolean} Whether applicable or not
	 * @virtual
	 */
	PluginBase.prototype.isApplicable = function(oControl) {
		return Object.keys(this.getConfig() || {}).length > 0;
	};

	/**
	 * This hook method gets called when the plugin is enabled and connected to the control.
	 *
	 * @param {sap.ui.core.Control} oControl The control that is connected to the plugin
	 * @abstract
	 */
	PluginBase.prototype.onActivate = function(oControl) {};

	/**
	 * This hook method gets called when the plugin is disabled or disconnected from the control.
	 *
	 * @param {sap.ui.core.Control} oControl The control that is connected to the plugin
	 * @abstract
	 */
	PluginBase.prototype.onDeactivate = function(oControl) {};

	/**
	 * Activates or deactivates the plugin when the parent of the plugin is set.
	 *
	 * @override
	 */
	PluginBase.prototype.setParent = function() {
		this._deactivate();

		Element.prototype.setParent.apply(this, arguments);

		if (this.getEnabled()) {
			this._activate();
		}

		return this;
	};

	/**
	 * Activates or deactivates the plugin when the enabled property is set.
	 *
	 * @override
	 */
	PluginBase.prototype.setEnabled = function(bEnabled) {
		var bOldEnabled = this.getEnabled();
		this.setProperty("enabled", bEnabled, true);

		if (this.getEnabled() != bOldEnabled) {
			if (bOldEnabled) {
				this._deactivate();
			} else {
				this._activate();
			}
		}

		return this;
	};

	/**
	 * Suppresses the invalidation when the invalidate attribute of the property metadata is set to false.
	 *
	 * @override
	 */
	PluginBase.prototype.setProperty = function(sProperty, vValue, bSuppressInvalidate) {
		bSuppressInvalidate = bSuppressInvalidate || (this.getMetadata().getProperty(sProperty).appData || {}).invalidate === false;
		return Element.prototype.setProperty.call(this, sProperty, vValue, bSuppressInvalidate);
	};

	/**
	 * Internal plugin activation handler
	 */
	PluginBase.prototype._activate = function() {
		if (this._bActive) {
			return;
		}

		var oControl = this.getControl();
		if (!oControl) {
			return;
		}

		if (oControl instanceof Promise) {
			return oControl.then(this._activate.bind(this));
		}

		if (!this.isApplicable(oControl)) {
			throw new Error(this + " is not applicable to " + oControl);
		}

		this.getConfig("onActivate", oControl, this);
		this.onActivate(oControl);
		this._bActive = true;
	};

	/**
	 * Internal plugin deactivation handler
	 */
	PluginBase.prototype._deactivate = function() {
		if (!this._bActive) {
			return;
		}

		var oControl = this.getControl();
		this.getConfig("onDeactivate", oControl, this);
		this.onDeactivate(oControl);
		this._bActive = false;
	};

	return PluginBase;

});


text:
<?php

namespace Doctrine\ODM\PHPCR\Mapping\Annotations;

use Doctrine\Common\Annotations\Annotation;

/**
 * @Annotation
 * @Target("METHOD")
 */
final class PostPersist
{
}


text:
package com.cardinity.exceptions;

public class CardinityClientException extends CardinityException {

    private static final long serialVersionUID = 5273072716090618133L;

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


text: bundle exec thin -s 2 -C config.yml -R config.ru start


text:
package net.java.sip.communicator.impl.gui.main.contactlist;

import java.awt.event.*;

import javax.swing.*;
import javax.swing.text.*;

import net.java.sip.communicator.impl.gui.main.chat.conference.*;
import net.java.sip.communicator.service.contactlist.*;

/**
 * The main goal of the <tt>CListKeySearchListener</tt> is to listen for key
 * events and to search the ContactList when a key is typed over it. It selects
 * the Contact name closest to the typed string.
 *
 * The time between two button presses is checked to determine whether the user
 * makes a new search or a continious search. When user types the same letter
 * consecutively the search mechanism selects the next Contact name starting
 * with the same letter.
 *
 * The <tt>CListKeySearchListener</tt> is added to the <tt>MainFrame</tt> and
 * the <tt>ContactListPanel</tt> to provide a search functionality over the
 * contact list when one of them is focused.
 *
 * The 'space' key, the '+' and the '-' keys are proccess seperately to provide
 * another functionality completely different from the search. When user types
 * a '-' or 'space' and there's currently a group selected, the selected group
 * is closed. When user types '+' the selected group is opened.
 *
 * @author Yana Stamcheva
 */
public class CListKeySearchListener implements KeyListener {

    private JList contactList;

    private char lastTypedKey = KeyEvent.CHAR_UNDEFINED;

    private long lastTypedTimestamp = 0;

    private StringBuffer keyBuffer = new StringBuffer();

    /**
     * Creates an instance of CListKeySearchListener for the given
     * ContactList.
     * @param contactList The contact list.
     */
    public CListKeySearchListener(JList contactList) {
        this.contactList = contactList;
    }

    public void keyPressed(KeyEvent e)
    {
        //Nothing to do if the contact list is empty
        if(contactList.getModel().getSize() <= 0)
            return;

        int keyCode = e.getKeyCode();

        if(keyCode == KeyEvent.VK_LEFT)
        {
            closeGroup();
        }
        else if(keyCode == KeyEvent.VK_RIGHT)
        {
            openGroup();
        }
        else if(keyCode == KeyEvent.VK_ENTER)
        {
            openOrCloseGroup();
        }
    }

    public void keyReleased(KeyEvent e) {
    }

    /**
     * Searches the contact list when any key, different from "space", "+" or
     * "-" is typed. Selects the Contact name closest to the typed string. The
     * time between two button presses is checked to determine whether the user
     * makes a new search or a continuous search. When user types the same
     * letter consecutively the search mechanism selects the next Contact name
     * starting with the same letter.
     */
    public void keyTyped(KeyEvent e) {

        //Nothing to do if the contact list is empty
        if(contactList.getModel().getSize() <= 0)
            return;

        long eventTimestamp = e.getWhen();
        char keyChar = e.getKeyChar();

        if(keyChar == ' ') {
            openOrCloseGroup();
        }
        else if(keyChar == '+') {
            openGroup();
        }
        else if(keyChar == '-') {
            closeGroup();
        }
        else {

            if ((lastTypedTimestamp - eventTimestamp) > 1000) {
                keyBuffer.delete(0, keyBuffer.length() - 1);
            }
            this.lastTypedTimestamp = eventTimestamp;
            this.keyBuffer.append(keyChar);

            boolean selectedSameLetterContact = false;

            int selectedIndex = this.contactList.getSelectedIndex();

            // Check if there's any selected contact node and get its name.
            if (selectedIndex != -1) {
                Object selectedObject = this.contactList.getSelectedValue();

                if (selectedObject instanceof MetaContact) {
                    String selectedContactName = ((MetaContact) selectedObject)
                            .getDisplayName();

                    if (selectedContactName != null) {
                        selectedSameLetterContact
                            = selectedContactName.substring(0, 1)
                                .equalsIgnoreCase(keyBuffer.toString());
                    }
                }
                else if(selectedObject instanceof ConferenceChatContact) {
                    String selectedContactName =
                            ((ConferenceChatContact) selectedObject).getName();

                    if (selectedContactName != null) {
                        selectedSameLetterContact
                            = selectedContactName.substring(0, 1)
                                .equalsIgnoreCase(keyBuffer.toString());
                    }
                }
            }
            // The search starts from the beginning if:
            // 1) the newly entered character is different from the last one
            // or
            // 2) the currently selected contact starts with a different letter
            int contactIndex = contactList.getNextMatch(
                    keyBuffer.toString(),
                    (lastTypedKey != keyChar || !selectedSameLetterContact)
                        ? 0
                        : selectedIndex + 1,
                    Position.Bias.Forward);

            int currentlySelectedIndex = this.contactList.getSelectedIndex();

            if (currentlySelectedIndex != contactIndex && contactIndex != -1) {
                this.contactList.setSelectedIndex(contactIndex);
                currentlySelectedIndex = contactList.getSelectedIndex();
            }

            this.contactList.ensureIndexIsVisible(currentlySelectedIndex);

            this.lastTypedKey = keyChar;
        }
    }

    /**
     * Closes a group when it's opened.
     */
    public void closeGroup() {
        Object selectedValue = this.contactList.getSelectedValue();

        if (selectedValue instanceof MetaContactGroup) {
            MetaContactGroup group = (MetaContactGroup) selectedValue;

            ContactListModel model
                = (ContactListModel)contactList.getModel();

            if (!model.isGroupClosed(group)) {
                model.closeGroup(group);
            }
        }
    }

    /**
     * Opens a group when it's closed.
     */
    public void openGroup() {
        Object selectedValue = this.contactList.getSelectedValue();

        if (selectedValue instanceof MetaContactGroup) {
            MetaContactGroup group = (MetaContactGroup) selectedValue;

            ContactListModel model
                = (ContactListModel) contactList.getModel();

            if (model.isGroupClosed(group)) {
                model.openGroup(group);
            }
        }
    }

    /**
     * Opens or closes a group depending the state.
     */
    public void openOrCloseGroup()
    {
        Object selectedValue = this.contactList.getSelectedValue();

        if (selectedValue instanceof MetaContactGroup)
        {
            MetaContactGroup group = (MetaContactGroup) selectedValue;

            ContactListModel model
                = (ContactListModel) contactList.getModel();

            if (model.isGroupClosed(group))
            {
                model.openGroup(group);
            }
            else
            {
                model.closeGroup(group);
            }
        }
    }
}


text:
from __future__ import print_function

# partially from package six by Benjamin Peterson

import sys
import os
import types

try:
    from ruamel.ordereddict import ordereddict
except:
    try:
        from collections import OrderedDict
    except ImportError:
        try:
            from orderddict import OrderedDict
        except ImportError:  # switch to the local compat one (python 2.6)
            from ruamel.yaml.compat_ordereddict import OrderedDict

    # to get the right name import ... as ordereddict doesn't do that

    class ordereddict(OrderedDict):
        if not hasattr(OrderedDict, 'insert'):
            def insert(self, pos, key, value):
                if pos >= len(self):
                    self[key] = value
                    return
                od = ordereddict()
                od.update(self)
                for k in od:
                    del self[k]
                for index, old_key in enumerate(od):
                    if pos == index:
                        self[key] = value
                    self[old_key] = od[old_key]

PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3

if PY3:
    def utf8(s):
        return s

    def to_str(s):
        return s

    def to_unicode(s):
        return s

else:
    def utf8(s):
        return s.encode('utf-8')

    def to_str(s):
        return str(s)

    def to_unicode(s):
        return unicode(s)

if PY3:
    string_types = str,
    integer_types = int,
    class_types = type,
    text_type = str
    binary_type = bytes

    MAXSIZE = sys.maxsize
    unichr = chr
    import io
    StringIO = io.StringIO
    BytesIO = io.BytesIO

else:
    string_types = basestring,
    integer_types = (int, long)
    class_types = (type, types.ClassType)
    text_type = unicode
    binary_type = str

    unichr = unichr  # to allow importing
    import StringIO
    StringIO = StringIO.StringIO
    import cStringIO
    BytesIO = cStringIO.StringIO

if PY3:
    builtins_module = 'builtins'
else:
    builtins_module = '__builtin__'

def with_metaclass(meta, *bases):
    """Create a base class with a metaclass."""
    return meta("NewBase", bases, {})

DBG_TOKEN = 1
DBG_EVENT = 2
DBG_NODE = 4

_debug = None

# used from yaml util when testing
def dbg(val=None):
    global _debug
    if _debug is None:
        # set to true or false
        _debug = os.environ.get('YAMLDEBUG')
        if _debug is None:
            _debug = 0
        else:
            _debug = int(_debug)
    if val is None:
        return _debug
    return _debug & val

def nprint(*args, **kw):
    if dbg:
        print(*args, **kw)


text:
package shaders;

import org.lwjgl.util.vector.Matrix4f;
import org.lwjgl.util.vector.Vector3f;

import toolBox.Maths;
import entities.Camera;
import entities.Light;

public class TerrainShader extends ShaderProgram{

	private static final String VERTEX_FILE = "src/shaders/terrainVertexShader.txt";
	private static final String FRAGMENT_FILE = "src/shaders/terrainFragmentShader.txt";

	private int location_transformationMatrix;
	private int location_projectionMatrix;
	private int location_viewMatrix;
	private int location_lightPosition;
	private int location_lightColor;
	private int location_shineDumper;
	private int location_reflectivity;
	private int location_skyColor;
	private int location_backgroundTexture;
	private int location_rTexture;
	private int location_gTexture;
	private int location_bTexture;
	private int location_blendMap;

	public TerrainShader() {
		super(VERTEX_FILE, FRAGMENT_FILE);
	}

	@Override
	protected void bindAttributes() {
		super.bindAttribute(0, "position");
		super.bindAttribute(1, "textureCoords");
		super.bindAttribute(2, "normal");
	}

	@Override
	protected void getAllUniformLocations() {
		location_transformationMatrix = super.getUniformLocation("transformationMatrix");
		location_projectionMatrix = super.getUniformLocation("projectionMatrix");
		location_viewMatrix = super.getUniformLocation("viewMatrix");
		location_lightPosition = super.getUniformLocation("lightPosition");
		location_lightColor = super.getUniformLocation("lightColor");
		location_shineDumper = super.getUniformLocation("shineDumper");
		location_reflectivity = super.getUniformLocation("reflectivity");
		location_skyColor = super.getUniformLocation("skyColor");
		location_backgroundTexture = super.getUniformLocation("backgroundTexture");
		location_rTexture = super.getUniformLocation("rTexture");
		location_gTexture = super.getUniformLocation("gTexture");
		location_bTexture = super.getUniformLocation("bTexture");
		location_blendMap = super.getUniformLocation("blendMap");
	}

	public void connectTextureUnits(){
		super.loadInt(location_backgroundTexture, 0);
		super.loadInt(location_rTexture, 1);
		super.loadInt(location_gTexture, 2);
		super.loadInt(location_bTexture, 3);
		super.loadInt(location_blendMap, 4);
	}

	public void loadSkyColor(float r, float g, float b){
		super.loadVector(location_skyColor, new Vector3f(r,g,b));
	}

	public void loadShineVariables(float dumper, float reflectivity){
		super.loadFloat(location_shineDumper, dumper);
		super.loadFloat(location_reflectivity, reflectivity);
	}

	public void loadLight(Light light){
		super.loadVector(location_lightPosition, light.getPosition());
		super.loadVector(location_lightColor, light.getColor());
	}

	public void loadTransformationMatrix(Matrix4f matrix){
		super.loadMatrix(location_transformationMatrix, matrix);
	};

	public void loadViewMatrix(Camera camera){
		Matrix4f viewMatrix = Maths.createViewMatrix(camera);
		super.loadMatrix(location_viewMatrix, viewMatrix);
	}

	public void loadProjectionMatrix(Matrix4f projection){
		super.loadMatrix(location_projectionMatrix, projection);
	};

}


text:
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../shared/call', __FILE__)
require File.expand_path('../shared/call_arguments', __FILE__)

language_version __FILE__, "call"

describe "Proc#call" do
  it_behaves_like :proc_call, :call

  ruby_version_is "1.8.7" do
    it_behaves_like :proc_call_block_args, :call
  end
end

describe "Proc#call on a Proc created with Proc.new" do
  it_behaves_like :proc_call_on_proc_new, :call
end

describe "Proc#call on a Proc created with Kernel#lambda or Kernel#proc" do
  it_behaves_like :proc_call_on_proc_or_lambda, :call
end


text:
<#macro script>
tinymce.init({
        selector: '.textarea',
        height: 100,
        language: 'zh_CN',
        menubar: false,
        automatic_uploads: true,
        paste_data_images: true,
        convert_urls: false,
        imagetools_toolbar: "rotateleft rotateright | flipv fliph | editimage imageoptions",
        imagetools_proxy: '${CPATH}/admin/tinymce/image/proxy',
        images_upload_url: '${CPATH}/admin/tinymce/image/upload',
        wordcount_countregex: /[\u4e00-\u9fa5_a-zA-Z0-9]/g,
		file_picker_callback: function(callback, value, meta) {
		 	layer.open({
			    type: 2,
			    title: '选择图片',
			    shadeClose: true,
			    shade: 0.8,
			    area: ['90%', '90%'],
			    content: '${CPATH}/admin/attachment/choose_layer',
			    end:function(){
			    	callback(data.url, {alt: data.alt});
			    }
			});
		 },
        plugins: [
		    "advlist autolink autosave link image imagetools lists charmap print preview hr anchor pagebreak spellchecker",
		    "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
		    "table contextmenu directionality emoticons template textcolor paste fullpage textcolor colorpicker textpattern"
		  ],
        toolbar1: '  bold italic underline strikethrough removeformat | blockquote hr  |  alignleft aligncenter alignright alignjustify | bullist numlist  |  outdent indent | forecolor backcolor | code   ',
    });
</#macro>
<#macro script_import>
<script src="${CPATH}/static/tinymce/tinymce.min.js"></script>
</#macro>


text:
module.exports = {
  extends: '@jstoolkit/configs/babel/env.babelrc.js',
  plugins: [
    '@babel/plugin-proposal-class-properties',
    'babel-plugin-transform-inline-environment-variables',
  ],
};


text:
nom: Gyromitra infula
date: 2017-03-24 00:00:00
image: https://c1.staticflickr.com/9/8455/7996468533_a6a0aa7ab9_n.jpg
image-originale: https://www.flickr.com/photos/kaufholtz/7996468533/in/photolist-dbC215-dbBZv8-dbBZ9e
album-flickr:
  - 72157676477017940

details:
  nom-francais: Gyromitre en turban
  domaine: Eucaryote
  regne: Fungi
  phylum: Ascomycota
  sous-phylum: Pezizomycotina
  classe: Pezizomycetes
  sous-classe: Pezizomycetidae
  ordre: Pezizales
  famille: Discinaceae
  genre: Gyromitra
  espece: Gyromitra infula (Schaeff.) Quél.
  litterature: Quélet, L. 1886. Enchiridion Fungorum in Europa media et praesertim in Gallia Vigentium. :1-352

collections:
  - fongarium: cKc0016
    date: 16 septembre 2012
    planche:
      numero:
      miniature: # Largeur 320px. ici
      originale: # Exemple: ici
    geolocalisation: 46°57'01.25"N 71°17'51.46"O
    elevation: 222 m
    determinee:
    confirmee: Claude Kaufholtz-Couture

description:
  acanthocytes:
  acanthophyses:
  aiguillons:
  aleurioconidies:
  anamorphe:
  anamorphe-conidien:
  anneau:
  apothecie: 20-100 x 25-100 mm Ø, souvent en forme de selle ou de mitre, parfois à 2-4 lobes pointus irréguliers ou en forme de corne, creuse ou chambrée, stipitée, à marge incurvée, ± soudée au stipe
  arete-lamellaire:
  arthroconidies:
  articles:
  ascome:
  ascospores:
  asques:
  asterohyphidies:
  avertissement:
  base-du-pied:
  base-sterile:
  base-stipitiforme:
  basides:
  basidiospores:
  basidioles:
  basidiome:
  bibliographies:
  biotopes: pousse au sol, souvent près et même sur des débris ligneux (sur vieux Fomes), ou sur bois pourri de conifères
  boucles:
  brachybasidioles:
  calicule:
  capillitium:
  capitule:
  caulobasides:
  caulocystides:
  caulocystides-medianes:
  caulocystides-sommitales:
  cellules-hymeniales-diverticulees:
  cellules-hymeniales-en-brosses:
  cellules-marginales-paracystides:
  cellules-peritheciales:
  cellules-stromatiques:
  chair: mince, cassante, blanchâtre
  chancre:
  cheilochrysocystides:
  cheilocystides:
  cheiloleptocystides:
  cheilomacrocystides:
  chlamydospores:
  chrysocystides:
  circumcystides:
  clavules:
  columelle:
  comestibilite: NON
  commentaires:
  conidies:
  conidiome:
  conidiophores:
  consistance:
  contexte:
  cordons-myceliens:
  cordons-rhizomorphiques:
  cortex:
  cortex-caulinaire:
  cortex-du-pied-et-du-bulbe:
  cortex-peridial:
  cortex-sclerotial:
  cortine:
  couches-de-tubes:
  coupe-sterile:
  cristaux:
  cristaux-d-oxalate:
  cuticule:
  cutis:
  cycle:
  cystides:
  cystides-hymeniales:
  cystides-intermediaires:
  cystidioles:
  dendrohyphydies:
  depots-de-pigment-interhyphal:
  dermatocystides-caulocystides-et-pileipellis:
  derniere-correction:
  dicaryophyses:
  dichophyses:
  disque-basal:
  distribution: occasionnel
  elateres:
  elements-acanthophyses:
  elements-cystidioides:
  elements-hyphoides:
  elements-setoides:
  elements-steriles:
  elements-sur-les-cotes:
  elements-velaires:
  endoperidium:
  especes-identification:
  especes-semblables:
  excipulum:
  excipulum-medullaire-superieur:
  excipulum-medullaire-moyen:
  excipulum-medullaire-inferieur:
  excipulum-ectal:
  exhalaison: ± fongique
  exhalaison-de-la-chair:
  exhalaison-des-lames:
  exoperidium:
  extremites-hyphales:
  face-externe: irrégulièrement plissée, ou un peu convolutée, pubescente, parfois sublisse
  face-poroïde:
  feutrage-basal:
  fragments-sporaux:
  glebe:
  gleocystides:
  gleocystides-hymeniales:
  gleocystides-subhymeniales:
  granules-calcaires:
  groupe:
  hymenium:
  hymenocystides:
  hymenophore: typiquement ondulé-rugueux, parfois convoluté-plissé à sublisse, brun jaunâtre, brun orangé à tan au frais, souvent taché de brun noirâtre, brun rougeâtre à brun foncé teinté de pourpré avec l'âge
  hyphes:
  hyphes-de-la-chair:
  hyphes-de-l-anneau:
  hyphes-du-pied:
  hyphes-glebales:
  hyphes-gleopleres:
  hyphes-hymeniales:
  hyphes-ligatives:
  hyphes-oleiferes:
  hyphes-pectinees:
  hyphes-primordiales:
  hyphes-setales:
  hyphes-squelettiques:
  hyphes-skeletoligative:
  hyphes-subiculaires:
  hyphes-tramales:
  hyphes-vesiculaires:
  hyphidies:
  hyphique:
  hypobasides:
  hypoderme:
  hypoge:
  hypophylle:
  hypothalle:
  hypothece:
  hysterothece:
  lames:
  lamprocystides:
  lamprocheilocystides:
  lampropleurocystides:
  lamprocaulocystides:
  latex:
  leptocystides:
  macrocystides:
  macropleurocystides:
  marge:
  marge-et-face-externe:
  mediostrate:
  medulla:
  medulla-caulinaire:
  medulla-clavariale:
  medulla-clavulaire:
  microconidies:
  mode-de-croissance: solitaire, dispersé ou grégaire
  mycelium-basal:
  myxocarpe:
  nouvelle-espece:
  note-taxonomique:
  oeuf:
  paracapillitium:
  paraphyses:
  parasite:
  paroi-peritheciale:
  peridiole:
  peridiopellis:
  peridium:
  peritheces:
  phenologie: de juillet à octobre
  phialoconidies:
  pieds-steriles:
  pigments:
  pileipellis:
  pileitrame:
  pileocystides:
  plasmode:
  pleurochrysocystides:
  pleurocystides:
  poils:
  poils-basaux:
  poils-caulinaires:
  poils-du-cortex:
  poils-externes:
  poils-lateraux-et-caulinaires:
  poils-marginaux:
  poils-mycelien-basaux:
  poils-peridiaux:
  poils-peritheciaux:
  poils-pileiques:
  pores:
  premiere-mention:
  pseudocapillitium:
  pseudocolumelle:
  pseudocystides:
  pseudo-peridioles:
  publications:
  publications-microscopiques:
  reactions-macrochimiques:
  receptacle:
  remarques:
  repartition:
  rhizomorphes:
  sac-sporifere:
  saveur: douce à légèrement astringente, indistincte
  sclerocystides:
  sclerote:
  soies:
  soies-hymeniales:
  sporee: blanche à crème pâle
  spherocytes:
  sporocystes:
  stipe: 20-80 x 20-30 mm Ø, égal ou élargi vers la base, comprimé ou souvent cannelé vers la base, creux ou farci, lisse ou légèrement irrégulier, pubescent, finement granuleux, blanchâtre, crème rosé à brun rougeâtre terne
  stipitipellis:
  stipititrame:
  stroma:
  subhymenium:
  subiculum:
  substrat:
  syndrome: |
    gyromitrien ou helvellien
    Les toxines dérivés hydraziniques sont responsables.
  symptomes: |
    Apparition retardée (+ de 6 heures); période d'incubation entre 6 et 12 heures.
    Nausées, vomissement, parfois de la fièvre (rare dans les intoxications par des champignons); puis régression ou aggravation, surtout entre 36 et 48 heures après le repas; atteinte hépatique s'accompagnant éventuellement d'une hémolyse, atteinte rénale, troubles neurologiques. La guérison est possible, mais l'atteinte hépatique peut être mortelle.
  synonymie: |
    Leptopodia monachella (Scop.) Boud.
    Phallus monachella Scop., Flora carniolica 2:476 (1772)
    Helvella infula Schaeff., Fungorum qui in Bavaria et Palatinatu circa Ratisbonam nascuntur Icones 4:105, t. 159 (1774)
    Elvela infula Schaeff. (1774)
    Helvella brunnea J.F. Gmel., Systema Naturae 2:1450 (1792)
    Helvella monachella (Scop.) Fr., Systema Mycologicum 2:18 (1822)
    Physomitra infula (Schaeff.) Boud., Histoire et Classification des Discomycètes d'Europe:35 (1907)
  systeme-hyphal:
  textura:
  tomentum-caulinaire:
  tomentum-pileique:
  trame-hymenophorale:
  trame-lamellaire:
  trame-tubulaire:
  type:
  typique:
  voile:
  voile-general:
  voile-partiel:
  volve:
  zone-perihymeniale:
---


text:
package test.routes;

import com.firefly.bo.Bo;

public class RouteBo extends Bo<RouteModel> {

}


text:
using namespace std;

//Compute MC pricing of vanilla options
template<typename T>
void mc_pricer_heston(const T& TheOption,
								const Parameters& r,
								unique_ptr<PathGenerationHeston>&  ThePaths,
								unsigned long NumberOfPaths,
								StatisticsMC& gatherer,
								StatisticsMC& gatherer_time)
{

	timer t;
	t.start();

	double Expiry(TheOption.GetExpiry());
	double discounting = exp(-r.Integral(0, Expiry));

	vector<MJArray> args(2);
	args[0] = MJArray(ThePaths->GetSteps());
	args[1] = MJArray(ThePaths->GetSteps());

	for (unsigned long i = 0; i < NumberOfPaths; i++)
	{
		double thisSpot = ThePaths->GetOnePath(args);
		double thisPayOff = TheOption.OptionPayOff(thisSpot);
		gatherer.DumpOneResult(thisPayOff*discounting);
		gatherer_time.DumpOneResult(t.elapsedTime());
	}

}

//Compute MC pricing of vanilla options - ls stands for long and short stepping respectively
template<typename T>
void mc_pricer_heston_ls(const T& TheOption,
	const Parameters& r,
	unique_ptr<PathGenerationHeston>&  ThePaths,
	unsigned long NumberOfPaths,
	StatisticsMC& gatherer,
	StatisticsMC& gatherer_time)
{

	timer t;
	t.start();

	double Expiry(TheOption.GetExpiry());
	double discounting = exp(-r.Integral(0, Expiry));

	vector<MJArray> args(2);
	args[0] = MJArray(ThePaths->GetSteps());
	args[1] = MJArray(ThePaths->GetSteps());

	for (unsigned long i = 0; i < NumberOfPaths; i++)
	{
		double thisSpot = ThePaths->GetOnePathLS(args);
		double thisPayOff = TheOption.OptionPayOff(thisSpot);
		gatherer.DumpOneResult(thisPayOff*discounting);
		gatherer_time.DumpOneResult(t.elapsedTime());
	}
	//cout << endl;
}

//compute price w/o convergence table
template<typename T>
double mc_pricer_heston(const T& TheOption,
								const Parameters& r,
								unique_ptr<PathGenerationHeston>&  ThePaths,
								unsigned long NumberOfPaths)
{
	double Expiry(TheOption.GetExpiry());
	double discounting = exp(-r.Integral(0, Expiry));

	vector<MJArray> args(2);
	args[0] = MJArray(ThePaths->GetSteps());
	args[1] = MJArray(ThePaths->GetSteps());

	double sum(0.0);

	for (unsigned long i = 0; i < NumberOfPaths; i++)
	{
		double thisSpot = ThePaths->GetOnePath(args);
		sum += TheOption.OptionPayOff(thisSpot);
	}

	return sum * discounting / NumberOfPaths;
}

#endif