text:
define(function (require) {
    var $ = require('jquery');
    var bootstrap = require('bootstrap');
    var messages = require('./messages');
    var flat_ui = require("flat-ui.min");
    var ui_widget = require("jquery.ui.widget");
    var knob = require("jquery.knob");
    var iframe_transport = require("jquery.iframe-transport");
    var fileupload = require("jquery.fileupload");
    var slider = require("jquery.bxslider.min")
    var colorpicker = require('colorpicker');
    var log = require('log');
    var autoresize = require('./autoresize');
    var util = require('./util');
    $(function(){
        log(messages.getHello());
        log(bootstrap);
        var ul = $('#upload ul');

        $('.bxslider').bxSlider();

        // 自动调整body的大小
        autoresize.init();

        $('#drop a').click(function() {
            // Simulate a click on the file input button
            // to show the file browser dialog

            $(this).parent().find('input').click();
        });

        //select background color
        color_hex = "#353d48";
        var colorpicker = ColorPicker(
            document.getElementById('color-picker'),
            function(hex, hsv, rgb) {
              // console.log(hsv.h, hsv.s, hsv.v);         // [0-359], [0-1], [0-1]
              //console.log(rgb.r, rgb.g, rgb.b);         // [0-255], [0-255], [0-255]
              color_hex = hex;       // #HEX
              // console.log(color_hex)
              $("#colorPreview").css({"background-color": hex})
            });
        colorpicker.setHex(color_hex);

        util.logout()

        function add2tpl(data){
            var tpl = $('
<input type="text" value="0" data-width="48" data-height="48"' +
                    ' data-fgColor="#0788a5" data-readOnly="1" data-bgColor="#3e4043" />

');

            // Append the file name and file size
            tpl.find('p').html('' + data.name + '')
                .append('' + formatFileSize(data.size) + '');

            // Add the HTML to the UL element
            tpl.appendTo(ul);

            // Initialize the knob plugin
            tpl.find('input').knob();

            tpl.find('span').hover(
                function(){
                    $("#uploadtip>p").text("click icon to delet this item!");
                    $("#uploadtip").fadeIn();
                }, function(){
                    $("#uploadtip>p").text("click icon to delet this item!");
                    $("#uploadtip").fadeOut();
                }
            )
            // Listen for clicks on the cancel icon
            tpl.find('span').click(function() {
                $.ajax({
                    url: '/upload',
                    type: 'delete',
                    dataType: 'json',
                    data: {
                        'filename': tpl.find(".filename").text()
                    },
                    success: function(res) {
                        log(res)
                        log("delete success");
                        tpl.fadeOut(function() {
                            tpl.remove();
                        });
                    },
                    error: function() {
                        log("异常!");
                        tpl.fadeOut(function() {
                            tpl.remove();
                        });
                    }
                })
                $("#uploadtip").fadeOut();
            });

            return tpl.appendTo(ul);
        }

        // Initialize the jQuery File Upload plugin
        $('#upload').fileupload({

            // This element will accept file drag/drop uploading
            dropZone: $('#drop'),

            // This function is called when a file is added to the queue;
            // either via the browse button, or via drag/drop:
            add: function(e, data) {

                data.context = add2tpl(data.files[0]);
                // Automatically upload the file once it is added to the queue
                var jqXHR = data.submit();
            },

            progress: function(e, data) {

                // Calculate the completion percentage of the upload
                var progress = parseInt(data.loaded / data.total * 100, 10);

                // Update the hidden input field and trigger a change
                // so that the jQuery knob plugin knows to update the dial
                data.context.find('input').val(progress).change();

                if (progress == 100) {
                    data.context.removeClass('working');
                }
            },

            fail: function(e, data) {
                // Something has gone wrong!
                data.context.addClass('error');
            }

        });

        // Prevent the default action when a file is dropped on the window
        $(document).on('drop dragover', function(e) {
            e.preventDefault();
        });

        // Helper function that formats the file sizes
        function formatFileSize(bytes) {
            if (typeof bytes !== 'number') {
                return '';
            }

            if (bytes >= 1000000000) {
                return (bytes / 1000000000).toFixed(2) + ' GB';
            }

            if (bytes >= 1000000) {
                return (bytes / 1000000).toFixed(2) + ' MB';
            }

            return (bytes / 1000).toFixed(2) + ' KB';
            }
        });

        var languages = ['en', 'zh-CN', 'zh-TW']
        $("#onesetup").click(function(){
            var softwarename = $("#software-name").val();
            var outputfoldername = $("#outputfolder-name").val();
            var exename = $("#exe-name").val();
            var desktoplinkname = $("#desktoplink-name").val();
            var softwareversion = $("#software-version").val();
            var softwareauthor = $("#software-author").val();
            var softwareemail = $("#software-email").val();
            var softwarecompany = $("#software-company").val();
            var desktoplink_on = $(".bootstrap-switch-id-desktoplink").hasClass("bootstrap-switch-on");

            var language = languages[parseInt($("#Language").val())];
            var files = [];
            var templateindex = 0;

            if(softwarename.length == 0){
                $("#tipmessage").fadeIn();
                $("#tipmessage>p").html("software name's length must greater than zero!");
                return;
            }

            $.each($(".filename"), function(index, value){
                files.push($(value).text())
            });

            $.each($("div.bx-pager-item>a"), function(index, value){
                if($(value).hasClass('active')){
                    templateindex = index;
                }
            });

            $.ajax({
                url: '/',
                type: 'post',
                dataType: 'json',
                traditional: true,
                data: {
                    'softwarename': softwarename,
                    'outputfoldername': outputfoldername,
                    'exename':exename,
                    'desktoplinkname': desktoplinkname,
                    'softwareversion': softwareversion,
                    'softwareauthor': softwareauthor,
                    'softwareemail': softwareemail,
                    'softwarecompany': softwarecompany,
                    'desktoplink_on': desktoplink_on,
                    'language': language,
                    'background-color': color_hex,
                    'templateindex': templateindex,
                    'files': files
                },
                success: function(res) {
                    log(res)
                    $("#download>a").attr("href", res.link);
                    $("#download>a").removeClass("disabled");
                    $("#onesetup").addClass("disabled");
                    log("one setup success");
                },
                error: function() {
                    log("异常!");
                }
            })
        })

        if ($('[data-toggle="select"]').length) {
              $('[data-toggle="select"]').select2();
        }
        $('[data-toggle="switch"]').bootstrapSwitch();

        $.each($('[data-toggle="dropdown"]'), function(index, value){
            $(value).click(function(){
                $(this).siblings().fadeToggle();
            });
        })

        document.getElementById("container").addEventListener('click', function(){
            $('.dropdown-menu').fadeOut();
        })

        $('.bootstrap-switch-id-progressbar').click(function(){
            log($(this).hasClass("bootstrap-switch-on"));
        })

        var names = ["outputfolder-name", "exe-name", "desktoplink-name"]
        //监测input输入实时改变事件
        $("#software-name").bind("input propertychange", function(){
            $("#tipmessage").fadeOut();
            var v = $("#software-name").val();
            for (var i = names.length - 1; i >= 0; i--) {
                var id = "#" + names[i];
                $(id).val(v);
                localStorage[names[i]] = v;
            };
            $("#outputfolder-name").val(v);
            $("#exe-name").val(v);
            $("#desktoplink-name").val(v);
            if($("#software-name").val().length > 0){
                $("#onesetup").removeClass("disabled");
            }else{
                $("#onesetup").addClass("disabled");
            }
        });

        //存储界面输入值
        var storagekeys = ["software-name", "outputfolder-name", "exe-name", "desktoplink-name", "software-version", "software-author",
            "software-email", "software-company"]

        for (var i = 0; i < storagekeys.length; i++) {
            var id = "#" + storagekeys[i];
            if (storagekeys[i] in localStorage){
                $(id).val(localStorage[storagekeys[i]]);
            }
            $(id).bind("input propertychange",{'index': i, 'id': id}, function(event){
                var i = event.data.index;
                var id = event.data.id;
                localStorage[storagekeys[i]] = $(id).val();
            });
        };

        if ("software-name" in localStorage && $("#software-name").val().length > 0){
            $("#onesetup").removeClass("disabled");
        }

        function startWebSocket() {
            if ("WebSocket" in window) {
                // messageContainer.innerHTML = "WebSocket is supported by your Browser!";
                var ws = new WebSocket("ws://" + location.host + "/ws");
                ws.onopen = function() {
                    // ws.send("Message to send");
                };
                ws.onmessage = function (evt) {
                    var msg = JSON.parse(evt.data);
                    log(evt.data);
                    if('userCount' in msg){
                        $("#userCount>span").text(msg['userCount']);
                    }
                    if('allCount' in msg){
                        $("#allCount>span").text(msg['allCount']);
                    }
                };
                ws.onclose = function() {
                    log("Connection is closed...");
                    startWebSocket();
                };
            } else {
                log("WebSocket NOT supported by your Browser!");
            }
        }

        startWebSocket();
});


text:
<?php
namespace frontend\controllers;

use common\models\database\TestValues;
use common\models\database\Test;
use common\models\database\Question;
use common\models\database\TestValuesMatrix;
use Yii;
use yii\web\Controller;
use yii\web\Session;
use yii\db\Query;
use yii\filters\VerbFilter;
use yii\data\ArrayDataProvider;

/**
 * Site controller
*/
class TestController extends Controller
{
    /**
     * Displays homepage.
     *
     * @return mixed
     */
    public function actionIndex()
    {
        Yii::$app->view->registerJsFile('https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.1/jquery.min.js', ['depends' => 'yii\web\YiiAsset']);
        Yii::$app->view->registerJsFile('https://cdnjs.cloudflare.com/ajax/libs/flexie/1.0.3/flexie.min.js', ['depends' => 'yii\web\YiiAsset']);
        Yii::$app->view->registerCssFile('https://cdnjs.cloudflare.com/ajax/libs/bulma/0.0.16/css/bulma.min.css');
        Yii::$app->view->registerCssFile('https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css');

        $model = Test::find()->where(['sort' => 1])->all();
            return $this->render('_textimage', [
        ]);
    }

    /**
     * Displays homepage.
     *
     * @return mixed
     */
    public function actionInittest($id)
    {
        $testModel = Test::findOne($id);

        $session = Yii::$app->session;
        if (!$session->isActive) {
            $session->open();
        }

        $tests = $session->get('tests');

        $tests[$id]['type']= $testModel->getAttribute('result_type_id')==3?1:0;
        $tests[$id]['test_offset'] = 0;
        $tests[$id]['test_passed'] = 0;

        if($tests[$id]['type']){
            $tests[$id]['test_quantity']=count($testModel->testReferences);
            foreach ($testModel->testReferences as $key=> $test){
               $tests[$id]['tests'][$key]['test_id']=$test->getAttribute('test_child_id');
               $tests[$id]['tests'][$key]['passed_questions']=0;
               $tests[$id]['tests'][$key]['answewrs']=[];
               $tests[$id]['tests'][$key]['answewrsid']=[];
            }
        }
        else{
            $tests[$id]['test_quantity']=1;
            $tests[$id]['tests'][0]['test_id']=$id;
            $tests[$id]['tests'][0]['passed_questions']=0;
            $tests[$id]['tests'][0]['answewrs']=[];
            $tests[$id]['tests'][0]['answewrsid']=[];
        }

        $session->set('tests', $tests);
        $session->set('current_test', $id);
        //$session->remove('current_tests');
        $session->close();

        return $this->redirect(['test', 'number' => 1]);
    }

    /**
    * Displays homepage.
    *
    * @return mixed
    */
    public function actionTest($number)
    {
        $session = Yii::$app->session;
        if (!$session->isActive) {
            $session->open();
        }

        $currentTest = $session->get('current_test');
        $tests = $session->get('tests');
        //Check if not equal zero or empty
        if(!$number || !$tests || !$currentTest){
            $session->close();
            return $this->redirect(['site/list-test']);
        }

        $passedQuestions = $tests[$currentTest]['tests'][$tests[$currentTest]['test_offset']]['passed_questions'];

        //Check if $require number is more the
        if ($passedQuestions + 2 < $number) {
            $session->close();
            return $this->actionTest($passedQuestions + 1);
        }
        $questionsQuantity = count(Test::findOne( $tests[$currentTest]['tests'][$tests[$currentTest]['test_offset']]['test_id'])->question);

        //if isset post
        if (Yii::$app->request->post()) {
            $answewrs =  $tests[$currentTest]['tests'][$tests[$currentTest]['test_offset']]['answewrs'];
            $answewrsid= $tests[$currentTest]['tests'][$tests[$currentTest]['test_offset']]['answewrsid'];
            $answewrs[$number - 1] = Yii::$app->request->post('answer');
            $answewrsid[Yii::$app->request->post('answewrid')] = $number - 1;
            $tests[$currentTest]['tests'][$tests[$currentTest]['test_offset']]['answewrs']= $answewrs;
            $tests[$currentTest]['tests'][$tests[$currentTest]['test_offset']]['answewrsid']= $answewrsid;
            $tests[$currentTest]['tests'][$tests[$currentTest]['test_offset']]['passed_questions'] = $number - 1;
            $session->set('tests', $tests);
        }

        //if test has been passed
        if ($number > $questionsQuantity) {
            if( $tests[$currentTest]['test_offset']+1<$tests[$currentTest]['test_quantity']){
                $tests[$currentTest]['test_offset']++;
                $tests[$currentTest]['test_passed']=1;
                $session->set('tests', $tests);
                return $this->actionTest(1);
            }
            return $this->redirect(['/test/result', 'test' => $currentTest]);
        }

        $questionModel = Question::find()->where(['test_id' =>  $tests[$currentTest]['tests'][$tests[$currentTest]['test_offset']]['test_id']])->orderBy('priority')->offset($number - 1)->one();
        return $this->getQuestionSwith($questionModel, $number, $questionsQuantity);
    }

    /**
     * Switch form tampale when create new answers
     * @param object $model (model of Answer record)
     * @return mixed
     */
    protected function getQuestionSwith($model, $questionNumber, $questionsQuantity){
        Yii::$app->view->registerJsFile('https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.1/jquery.min.js', ['depends' => 'yii\web\YiiAsset']);
        Yii::$app->view->registerJsFile('https://cdnjs.cloudflare.com/ajax/libs/flexie/1.0.3/flexie.min.js', ['depends' => 'yii\web\YiiAsset']);
        Yii::$app->view->registerJsFile('js/jquery.cropit.js', ['depends' => 'frontend\assets\AppAsset']);

        Yii::$app->view->registerJsFile('js/main.js', ['depends' => 'frontend\assets\AppAsset']);
        Yii::$app->view->registerJsFile('js/custom.js', ['depends' => 'frontend\assets\AppAsset']);

        Yii::$app->view->registerCssFile('https://cdnjs.cloudflare.com/ajax/libs/bulma/0.0.16/css/bulma.min.css');
        Yii::$app->view->registerCssFile('https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css');
        //meta
        Yii::$app->view->registerMetaTag(['name' => 'description', 'content' => $model->test->getAttribute('meta_description')]);
        Yii::$app->view->registerMetaTag(['name' => 'title', 'content' => $model->test->getAttribute('meta_title')]);
        Yii::$app->view->registerMetaTag(['name' => 'keys', 'content' => $model->test->getAttribute('meta_keys')]);

        switch ($model->questionType->getAttribute('slug')) {
            case 'sympleText':
                return $this->render('_sympletext', [
                        'model' => $model,
                        'currentQuestion' => $questionNumber,
                        'questionsQuantity'=>$questionsQuantity
                    ]);
                break;
            case 'sympleImage':
                return $this->render('_sympleimage', [
                        'model' => $model,
                        'currentQuestion' => $questionNumber,
                        'questionsQuantity'=>$questionsQuantity
                    ]);
                break;
            case 'textImage':
                return $this->render('_textimage', [
                        'model' => $model,
                        'currentQuestion' => $questionNumber,
                        'questionsQuantity'=>$questionsQuantity
                    ]);
                break;
            case 'skinColor':
                return $this->render('_skincolor', [
                        'model' => $model,
                        'currentQuestion' => $questionNumber,
                        'questionsQuantity'=>$questionsQuantity
                    ]);
                break;
            case 'aboutMeColour':
                return $this->render('_aboutmecolour', [
                        'model' => $model,
                        'currentQuestion' => $questionNumber,
                        'questionsQuantity'=>$questionsQuantity
                    ]);
                break;
            case 'aboutMeTwo':
                return $this->render('_aboutmetwo', [
                        'model' => $model,
                        'currentQuestion' => $questionNumber,
                        'questionsQuantity'=>$questionsQuantity
                    ]);
                break;
            case 'aboutMeOne':
                return $this->render('_aboutmeone', [
                        'model' => $model,
                        'currentQuestion' => $questionNumber,
                        'questionsQuantity'=>$questionsQuantity
                    ]);
                break;
            case 'coloring':
                return $this->render('_coloring', [
                        'model' => $model,
                        'currentQuestion' => $questionNumber,
                        'questionsQuantity'=>$questionsQuantity,
                    ]);
                break;
            case 'face':
                return $this->render('_face', [
                        'model' => $model,
                        'currentQuestion' => $questionNumber,
                        'questionsQuantity'=>$questionsQuantity,
                    ]);
                break;
            case 'hair':
                return $this->render('_hair', [
                        'model' => $model,
                        'currentQuestion' => $questionNumber,
                        'questionsQuantity'=>$questionsQuantity
                    ]);
                break;
            case 'eyes':
                return $this->render('_eyes', [
                        'model' => $model,
                        'currentQuestion' => $questionNumber,
                        'questionsQuantity'=>$questionsQuantity
                    ]);
                break;
            case 'user_foto':
                return $this->render('_user_foto', [
                    'model' => $model,
                    'currentQuestion' => $questionNumber,
                    'questionsQuantity'=>$questionsQuantity,
                ]);
                break;
            default:
                $model->delete();
                return $this->redirect(['index']);
                break;
        }
    }

     /**
     * Displays homepage.
     *
     * @return mixed
     */
     public function actionResult($test) {
          Yii::$app->view->registerJsFile('js/custom.js', ['depends' => 'frontend\assets\AppAsset']);
        $session = Yii::$app->session;
        $tests = $session->get('tests');
        $current_test = $session->get('current_test');

        if ($session->get('current_test') != $test || !$current_test) {
            return $this->redirect(['test', 'number' => $session->get('passed_questions', 0)]);
        }

        $resultRender = [];

        foreach ($tests[$current_test]['tests'] as $testResult) {
            $testModel = $this->findModel($testResult['test_id']);

            if ($testModel->getAttribute('result_type_id') == 1) {
                $answewrs = $testResult['answewrs'];

                $result = 0;
                foreach ($answewrs as $answer) {
                    $result += $answer;
                }

                $query = new Query;
                $query->select('answer, query_values, query_colors')->from('test_values')->where(['and', "`from`<=$result", "`to`>=$result"])->andWhere(['test_id' => $testResult['test_id']]);

                $resultQuery = $query->one();
                $resultRender[$testResult['test_id']]['result'] = $resultQuery;
                $resultRender[$testResult['test_id']]['title'] = $testModel->getAttribute('title');
            } elseif ($testModel->getAttribute('result_type_id') == 2) {

                $answewrs = $testResult['answewrs'];

                $answewrsNumbersByid = $testResult['answewrsid'];

                $query = new Query;
                $query->select(' * ')->from('test_values_matrix')->where(['test_id' => $testResult['test_id']])->andWhere(['active_flag' => 1]);
                $result = $query->one();

                if (!$result) {
                    return $this->redirect(['list-test']);
                }

                //get matrix
                $matrix = unserialize($result['serialize']);
                $testValueId = $matrix[$answewrs[$answewrsNumbersByid[$result['question_vertical_id']]]][$answewrs[$answewrsNumbersByid[$result['question_horizontal_id']]]];

                if (!$testValueId) {
                    return $this->redirect(['list-test']);
                }

                $query = new Query;
                $query->select('answer, query_values')->from('test_values')->where(['id' => $testValueId]);
                $resultQuery = $query->one();

                $resultRender[$testResult['test_id']]['result'] = $resultQuery;
                $resultRender[$testResult['test_id']]['title'] = $testModel->getAttribute('title');
            } else {
                $answewrs = $testResult['answewrs'];
                $resultArr = [];
                foreach ($answewrs as $answer) {
                    if (!isset($resultArr[$answer])) {
                        $resultArr[$answer] = 0;
                    }
                    $resultArr[$answer] ++;
                }

                asort($resultArr);
                end($resultArr);
                $result = key($resultArr);

                $query = new Query;
                $query->select('answer, query_values')->from('test_values')->where(['from' => $result])->andWhere(['test_id' => $testResult['test_id']]);

                $resultQuery = $query->one();
                $resultRender[$testResult['test_id']]['result'] = $resultQuery;
                $resultRender[$testResult['test_id']]['title'] = $testModel->getAttribute('title');
            }
        }
        // parse query products
        $model = new Test;
        $query_sort = $model->sort(\Yii::$app->request->queryParams);
        $count = 100;
        foreach ($resultRender as $res) {
            if ($res['result']['query_colors'] != '') {
                $query_colors = implode(' OR ',explode(',', str_replace(' ', '', strtolower($res['result']['query_colors']))));
                $query = '('.implode(' OR ', explode(',', $res['result']['query_values'])) .') OR ('.$query_colors. ')';
                $url = "http://api.gdeslon.ru/api/search.xml?q=" . $query . "&l=" . $count . "&p=1&_gs_at=d6c372061a5f4acafe310c1a9a2bbbfbfff0a3f6";
            } else {
                $query = implode(' OR ', explode(',', $res['result']['query_values']));
                $url = "http://api.gdeslon.ru/api/search.xml?q=" . $query . "&l=" . $count . "&p=1&_gs_at=d6c372061a5f4acafe310c1a9a2bbbfbfff0a3f6";
            }
        }

        $xml = simplexml_load_file($url, 'SimpleXMLElement', LIBXML_NOCDATA);
        $offers = $xml->shop->offers;

        function xml2array($xmlObject) {
            $out = array();
            foreach ((array) $xmlObject as $index => $node)
                $out[$index] = ( is_object($node) ) ? xml2array($node) : $node;
            return $out;
        }
        $data = [];
        foreach ($offers->offer as $offer) {
            $data[] = xml2array($offer);
        }
        $dataProvider = new ArrayDataProvider([
            'allModels' => $data,
            'pagination' => [
                'pageSize' => 12,
            ],
        ]);

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

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

redpajama_set_name: RedPajamaGithub


text:
package com.ggj.springboot.event;

import org.springframework.context.ApplicationEvent;

/**
 * 自定义event
 * @author:gaoguangjin
 * @date 2016/9/1 9:58
 */
public class ContentEvent extends ApplicationEvent {
    public ContentEvent(String source) {
        super(source);
    }
}


text:
(function () {

    var assetDir = '../assets';
    var projPath = assetDir;
    var libPath = projPath + '/library';

    var grossini_uuid = '748321';
    var grossiniSprite_uuid = '1232218';

    largeModule('AssetLibrary', {
        setup: function () {
            Engine._reset();
            AssetLibrary.init(libPath);
        }
    });

    asyncTest('load asset with raw', function () {
        //var texture = new Fire.Texture();
        //texture.height = 123;
        //texture.width = 321;
        //Fire.log(Editor.serialize(texture));

        AssetLibrary.loadAsset(grossini_uuid, function (err, asset) {
            clearTimeout(timerId);
            ok(asset, 'can load asset by uuid');
            strictEqual(asset.width, 321, 'can get width');
            strictEqual(asset.height, 123, 'can get height');
            ok(asset.image, 'can get image');
            start();
        });
        var timerId = setTimeout(function () {
            ok(false, 'time out!');
            start();
        }, 100);
    });

    asyncTest('load asset with depends asset', function () {
        //var sprite = new Fire.Sprite();
        //sprite.texture = new Fire.Texture();
        //sprite.texture._uuid = grossini_uuid;
        //Fire.log(Editor.serialize(sprite));

        AssetLibrary.loadAsset(grossiniSprite_uuid, function (err, asset) {
            clearTimeout(timerId);
            ok(asset.texture, 'can load depends asset');
            strictEqual(asset.texture.height, 123, 'can get height');
            ok(asset.texture.image, 'can load depends asset\'s host');
            start();
        });
        var timerId = setTimeout(function () {
            ok(false, 'time out!');
            start();
        }, 100);
    });

})();


text:
redirect_from:
- /ucp/installation/install-offline/
description: Learn how to install Docker Universal Control Plane. on a machine with
  no internet access.
keywords:
- docker, ucp, install, offline
title: Install UCP offline
---

The procedure to install Docker Universal Control Plane on a host is the same,
whether that host has access to the internet or not.

The only difference when installing on an offline host,
is that instead of pulling the UCP images from Docker Hub, you use a
computer that is connected to the internet to download a single package with
all the images. Then you copy that package to the host where you'll install UCP.

1.  Get the UCP package.

    Use a computer with internet access to download a single package with all
    Docker Datacenter components:

    ```none
    $ wget https://packages.docker.com/caas/ucp-1.1.3_dtr-2.0.3.tar.gz -O docker-datacenter.tar.gz
    ```

2.  Transfer the package to the offline node.

    Now that you have the UCP package in your machine, you can transfer it to the
    host where you'll be installing Docker UCP. You can use the Secure Copy command
    for this:

    ```none
    $ scp docker-datacenter.tar.gz $USER@$UCP_HOST:/tmp
    ```

3.  Login into the host where you transferred the images.

4.  Load the UCP images.

    Once the UCP package is transferred to the host, you can use the
    `docker load` command, to load the images from the tar archive. On the host
    were you are going to install UCP, run:

    ```none
    $ docker load < docker-datacenter.tar.gz
    ```

5.  Install Docker UCP.

    Now that the offline host has all the images needed to install UCP,
    you can [install Docker UCP that host](install-production.md).

## Where to go next

* [Install UCP for production](install-production.md).
* [UCP system requirements](system-requirements.md)


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

        <title>Geometry package documetation</title>

        This package contains classes for handling of geometric objects in a
        geographical context, mainly for
        use with the GeoRSS library. The geometry objects closely mimics the model
        used for the geometry part of GML
        3.1.1 "simple features", and supports the whole GeoRSS GML profile.


text:
{{VERSION_HTML}}

    <textarea class="archetypeDeveloperModel" ng-show="model.config.developerMode" ng-model="model.value"></textarea>

            <archetype-localize key="addFieldset">Add an item</archetype-localize>

    <input type="hidden" name="archetypeMandatory" ng-model="model.mandatoryValidation" ng-required="model.validation.mandatory" />

<archetype-localize key="required">Required</archetype-localize>

            <fieldset ng-class="['archetype-fieldset-' + fieldset.alias, (getFieldsetValidity(fieldset) == false ? 'archetypeFieldsetError' : '')]" ng-init="fieldsetConfigModel = getConfigFieldsetByAlias(fieldset.alias)">

                    <form class="form-inline">

                                {{property.label}}

                                    {{property.helpText}}

                                <archetype-property class="archetypeEditor" property="property" property-editor-alias="model.alias" fieldset-index="$parent.$index" fieldset="fieldset" archetype-config="model.config" property-config-index="$index" archetype-render-model="model.value" umbraco-form="form"></archetype-property>
                                <archetype-submit-watcher active-submit-watcher="activeSubmitWatcher" load-callback="submitWatcherOnLoad" submit-callback="submitWatcherOnSubmit"></archetype-submit-watcher>

                                    <archetype-localize key="settings">Settings</archetype-localize>

                                        <archetype-localize key="publish">Publishing</archetype-localize>

                                            <archetype-localize key="publishHelpText">Configure automatic publishing and/or unpublishing of this item</archetype-localize>

                                                <archetype-localize key="publishReleaseDate">Publish at</archetype-localize>

                                            <umb-editor model="fieldset.releaseDateModel"></umb-editor>

                                                <archetype-localize key="publishExpireDate">Unpublish at</archetype-localize>

                                            <umb-editor model="fieldset.expireDateModel"></umb-editor>

                                        <archetype-submit-watcher active-submit-watcher="activeSubmitWatcher" load-callback="submitWatcherOnLoad" submit-callback="submitWatcherOnSubmit"></archetype-submit-watcher>

                                        <archetype-localize key="allowedMemberGroups">Allowed member groups</archetype-localize>

                                            <archetype-localize key="allowedMemberGroupsHelpText">Choose the member groups that should be allowed to see this item. Leave empty to allow all member groups.</archetype-localize>

                                        <umb-editor model="fieldset.allowedMemberGroupsModel"></umb-editor>

                                    <archetype-submit-watcher active-submit-watcher="activeSubmitWatcher" load-callback="submitWatcherOnLoad" submit-callback="submitWatcherOnSubmit"></archetype-submit-watcher>

                    </form>

            </fieldset>

 1}" ng-if="overlayMenu.show">

                    <archetype-localize key="addFieldset">Add an item</archetype-localize>

 1">

                            {{fieldsetGroup.name}}

                            {{fieldset.label}}

                            <archetype-localize key="previewFieldsetOpen">(see preview)</archetype-localize>

                    <archetype-localize key="previewFieldsetHeader">Preview: </archetype-localize>{{overlayMenu.fieldsetPreview.label}}

                    <archetype-localize key="previewFieldsetClose">(close preview)</archetype-localize>

                    <archetype-localize key="previewFieldsetClose">(close preview)</archetype-localize>


text:
class QDomDocument;
class QNetworkAccessManager;
class QTimer;

class VariableTable;

class EIRNETWORKSHARED_EXPORT HttpManager : public QObject
{
    Q_OBJECT

public:
    explicit HttpManager(QObject * parent=0);
    MillisecondTime get(const QUrl & url,
                        const MillisecondDelta timeout=10000);
    void get(QList<QUrl> urls,
                        const MillisecondDelta timeout=10000);
    QDomDocument statsReport(void) const;
    VariableTable takeHistory(void);

public:
    const static ResultCode HttpGotData;
    const static ResultCode HttpGetSuccess;
    const static ResultCode HttpGetTimeout;
    const static ResultCode HttpGetFailure;

public slots:
    void progress(qint64 count, qint64 total);
    void error(QNetworkReply::NetworkError errorCode);
    void abort(void);
    void clearHistory(void);

signals:
    void got(MillisecondTime mst, bool error, ResultSet rset);
    void progress(MillisecondTime mst, qint64 count, quint64 total);
    void statsFull(int size);

private:
    void calculate(const HttpRequest & rq);
    void timeout(QNetworkReply * reply,
                 HttpRequest & rq);

private slots:
    void pulse(void);

private:
    QNetworkAccessManager * _manager;
    QTimer * second_timer;
    int maxActive_i;
    int maxComplete_i;
    QMap<QNetworkReply *, HttpRequest> get_reply_request_map;
    QList<HttpRequest> get_request_list;
    QList<HttpRequest> complete_request_list;
};

#endif // HTTPMANAGER_H


text:
Allowed methods: `GET`, `PUT`, `DELETE`
Path: `/pacticipants/{pacticipant}/versions/{version}/tags/{tag}`

To create a tag, send an empty request with the URL specified above and `Content-Type` of `application/json`.

Tags must be applied before pacts or verification results are published to ensure that the webhook fires with the correct metadata.


text:
#ifdef USE_TI_CONTACTS
#import "TiContactsGroup.h"

@implementation TiContactsGroup

-(ABRecordRef)record
{
	// Force us to be on the main thread
	if (![NSThread isMainThread]) {
		return NULL;
	}

	if (record == NULL) {
		if (recordId != kABRecordInvalidID) {
			ABAddressBookRef ourAddressBook = [module addressBook];
			if (ourAddressBook != NULL) {
				record = ABAddressBookGetGroupWithRecordID(ourAddressBook, recordId);
			}
		}
	}
	return record;
}

-(NSNumber*)recordId
{
	return NUMINT(recordId);
}

-(id)_initWithPageContext:(id<TiEvaluator>)context recordId:(ABRecordID)id_ module:(ContactsModule*)module_
{
	if (self = [super _initWithPageContext:context]) {
		recordId = id_;
		record = NULL;
		module = module_;
	}
	return self;
}

-(void)dealloc
{
	[super dealloc];
}

-(NSString*)apiName
{
    return @"Ti.Contacts.Group";
}

#pragma mark Public API

-(NSString*)name
{
	if (![NSThread isMainThread]) {
		__block id result;
		TiThreadPerformOnMainThread(^{result = [[self name] retain];}, YES);
		return [result autorelease];
	}

	CFStringRef nameRef = ABRecordCopyValue([self record], kABGroupNameProperty);
    NSString* name = @"<unnamed group>";
    if (nameRef != NULL) {
        name = [NSString stringWithString:(NSString*)nameRef];
        CFRelease(nameRef);
    }

	return name;
}

-(void)setName:(id)arg
{
	ENSURE_SINGLE_ARG(arg,NSString)
	ENSURE_UI_THREAD(setName,arg)

	CFErrorRef error;
	if(!ABRecordSetValue([self record], kABGroupNameProperty, (CFStringRef)arg, &error)) {
		CFStringRef reason = CFErrorCopyDescription(error);
		NSString* str = [NSString stringWithString:(NSString*)reason];
		CFRelease(reason);
		[self throwException:[NSString stringWithFormat:@"Failed to set contact property name: %@",str]
				   subreason:nil
					location:CODELOCATION];
	}
}

-(NSArray*)members:(id)unused
{
	if (![NSThread isMainThread]) {
		__block id result;
		TiThreadPerformOnMainThread(^{result = [[self members:unused] retain];}, YES);
		return [result autorelease];
	}

	CFArrayRef arrayRef = ABGroupCopyArrayOfAllMembers([self record]);
	if (arrayRef == NULL) {
		return nil;
	}
	CFIndex count = CFArrayGetCount(arrayRef);
	NSMutableArray* members = [NSMutableArray arrayWithCapacity:count];
	for (CFIndex i=0; i < count; i++) {
		ABRecordRef personRef = CFArrayGetValueAtIndex(arrayRef, i);
		int id_ = ABRecordGetRecordID(personRef);
		TiContactsPerson* person = [[[TiContactsPerson alloc] _initWithPageContext:[self executionContext] recordId:id_ module:module] autorelease];
		[members addObject:person];
	}
	CFRelease(arrayRef);

	return members;
}

-(NSArray*)sortedMembers:(id)value
{
	ENSURE_SINGLE_ARG(value,NSNumber)
	if (![NSThread isMainThread]) {
		__block id result;
		TiThreadPerformOnMainThread(^{result = [[self sortedMembers:value] retain];}, YES);
		return [result autorelease];
	}

	int sortType = [value intValue];
	switch(sortType) {
		case kABPersonSortByFirstName:
		case kABPersonSortByLastName:
			break;
		default:
			[self throwException:[NSString stringWithFormat:@"Invalid sort value: %d",sortType]
					   subreason:nil
						location:CODELOCATION];
			return nil;
	}

	CFArrayRef arrayRef = ABGroupCopyArrayOfAllMembersWithSortOrdering([self record], sortType);
	if (arrayRef == NULL) {
		return nil;
	}
	CFIndex count = CFArrayGetCount(arrayRef);
	NSMutableArray* members = [NSMutableArray arrayWithCapacity:count];
	for (CFIndex i=0; i < count; i++) {
		ABRecordRef personRef = CFArrayGetValueAtIndex(arrayRef, i);
		int id_ = ABRecordGetRecordID(personRef);
		TiContactsPerson* person = [[[TiContactsPerson alloc] _initWithPageContext:[self executionContext] recordId:id_ module:module] autorelease];
		[members addObject:person];
	}
	CFRelease(arrayRef);

	return members;
}

-(void)add:(id)arg
{
	ENSURE_SINGLE_ARG(arg,TiContactsPerson)
	ENSURE_UI_THREAD(add,arg);

	CFErrorRef error;
	if (!ABGroupAddMember([self record], [arg record], &error)) {
		CFStringRef errorStr = CFErrorCopyDescription(error);
		NSString* str = [NSString stringWithString:(NSString*)errorStr];
		CFRelease(errorStr);

		[self throwException:[NSString stringWithFormat:@"Failed to add person %@ to group %@: %@",[arg fullName],[self name],str]
				   subreason:nil
					location:CODELOCATION];
	}
}

-(void)remove:(id)arg
{
	ENSURE_SINGLE_ARG(arg,TiContactsPerson)
	ENSURE_UI_THREAD(remove,arg);

	CFErrorRef error;
	if (!ABGroupRemoveMember([self record], [arg record], &error)) {
		CFStringRef errorStr = CFErrorCopyDescription(error);
		NSString* str = [NSString stringWithString:(NSString*)errorStr];
		CFRelease(errorStr);

		[self throwException:[NSString stringWithFormat:@"Failed to remove person %@ to group %@: %@",[arg fullName],[self name],str]
				   subreason:nil
					location:CODELOCATION];
	}
}

@end
#endif


text:
using System.Collections.Generic;
using MSG.DomainLogic;
using MSG.DomainLogic.Entities;
using NUnit.Framework;

namespace MSG.UnitTests
{
    [TestFixture]
    class EventualAdverbTests
    {
        private List<int> _defaults;

        [SetUp]
        public void SetUpDefaultNumbers()
        {
            _defaults = new List<int> {0, 17, 5, 9, 1, 1, 1};
        }

        [TearDown]
        public void UndoRandomNumberSetting()
        {
            MoqUtil.UndoMockRandomNumber();
        }

        [Test]
        public void VerifyEventualAdverbInteractively()
        {
            _defaults.Insert(4, 1);
            MoqUtil.SetupRandMock(_defaults.ToArray());

            Sentence output = DomainFactory.Generator.GetSentences(1)[0];

            Assert.AreEqual("We continue to work tirelessly and diligently to interactively streamline the process going forward.", output.Text);
        }

        [Test]
        public void VerifyEventualAdverbCredibly()
        {
            _defaults.Insert(4, 2);
            MoqUtil.SetupRandMock(_defaults.ToArray());
            Sentence output = DomainFactory.Generator.GetSentences(1)[0];

            Assert.AreEqual("We continue to work tirelessly and diligently to credibly streamline the process going forward.", output.Text);
        }

        [Test]
        public void VerifyEventualAdverbStrategically()
        {
            _defaults.Insert(4, 10);
            MoqUtil.SetupRandMock(_defaults.ToArray());
            Sentence output = DomainFactory.Generator.GetSentences(1)[0];

            Assert.AreEqual("We continue to work tirelessly and diligently to strategically streamline the process going forward.", output.Text);
        }

        [Test]
        public void VerifyEventualAdverbConservatively()
        {
            _defaults.Insert(4, 17);
            MoqUtil.SetupRandMock(_defaults.ToArray());
            Sentence output = DomainFactory.Generator.GetSentences(1)[0];

            Assert.AreEqual("We continue to work tirelessly and diligently to conservatively streamline the process going forward.", output.Text);
        }
    }
}


text:
package org.apache.nifi.processors.standard;

import org.apache.commons.lang3.StringUtils;
import org.apache.nifi.annotation.behavior.InputRequirement;
import org.apache.nifi.annotation.behavior.InputRequirement.Requirement;
import org.apache.nifi.annotation.behavior.SupportsBatching;
import org.apache.nifi.annotation.behavior.WritesAttribute;
import org.apache.nifi.annotation.behavior.WritesAttributes;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.components.PropertyDescriptor;
import org.apache.nifi.components.ValidationContext;
import org.apache.nifi.components.ValidationResult;
import org.apache.nifi.components.Validator;
import org.apache.nifi.expression.ExpressionLanguageScope;
import org.apache.nifi.processor.DataUnit;
import org.apache.nifi.processor.ProcessContext;
import org.apache.nifi.processor.util.StandardValidators;
import org.apache.nifi.processor.util.listen.AbstractListenEventBatchingProcessor;
import org.apache.nifi.processor.util.listen.dispatcher.ChannelDispatcher;
import org.apache.nifi.processor.util.listen.dispatcher.DatagramChannelDispatcher;
import org.apache.nifi.processor.util.listen.event.EventFactory;
import org.apache.nifi.processor.util.listen.event.StandardEvent;
import org.apache.nifi.processor.util.listen.event.StandardEventFactory;

import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.BlockingQueue;

@SupportsBatching
@Tags({"ingest", "udp", "listen", "source"})
@InputRequirement(Requirement.INPUT_FORBIDDEN)
@CapabilityDescription("Listens for Datagram Packets on a given port. The default behavior produces a FlowFile " +
        "per datagram, however for higher throughput the Max Batch Size property may be increased to specify the number of " +
        "datagrams to batch together in a single FlowFile. This processor can be restricted to listening for datagrams from  a " +
        "specific remote host and port by specifying the Sending Host and Sending Host Port properties, otherwise it will listen " +
        "for datagrams from all hosts and ports.")
@WritesAttributes({
        @WritesAttribute(attribute="udp.sender", description="The sending host of the messages."),
        @WritesAttribute(attribute="udp.port", description="The sending port the messages were received.")
})
public class ListenUDP extends AbstractListenEventBatchingProcessor<StandardEvent> {

    public static final PropertyDescriptor SENDING_HOST = new PropertyDescriptor.Builder()
            .name("Sending Host")
            .description("IP, or name, of a remote host. Only Datagrams from the specified Sending Host Port and this host will "
                    + "be accepted. Improves Performance. May be a system property or an environment variable.")
            .addValidator(new HostValidator())
            .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
            .build();

    public static final PropertyDescriptor SENDING_HOST_PORT = new PropertyDescriptor.Builder()
            .name("Sending Host Port")
            .description("Port being used by remote host to send Datagrams. Only Datagrams from the specified Sending Host and "
                    + "this port will be accepted. Improves Performance. May be a system property or an environment variable.")
            .addValidator(StandardValidators.PORT_VALIDATOR)
            .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
            .build();

    public static final String UDP_PORT_ATTR = "udp.port";
    public static final String UDP_SENDER_ATTR = "udp.sender";

    @Override
    protected List<PropertyDescriptor> getAdditionalProperties() {
        return Arrays.asList(
                SENDING_HOST,
                SENDING_HOST_PORT
        );
    }

    @Override
    protected Collection<ValidationResult> customValidate(ValidationContext validationContext) {
        final Collection<ValidationResult> result = new ArrayList<>();

        final String sendingHost = validationContext.getProperty(SENDING_HOST).getValue();
        final String sendingPort = validationContext.getProperty(SENDING_HOST_PORT).getValue();

        if (StringUtils.isBlank(sendingHost) && StringUtils.isNotBlank(sendingPort)) {
            result.add(
                    new ValidationResult.Builder()
                            .subject(SENDING_HOST.getName())
                            .valid(false)
                            .explanation("Must specify Sending Host when specifying Sending Host Port")
                            .build());
        } else if (StringUtils.isBlank(sendingPort) && StringUtils.isNotBlank(sendingHost)) {
            result.add(
                    new ValidationResult.Builder()
                            .subject(SENDING_HOST_PORT.getName())
                            .valid(false)
                            .explanation("Must specify Sending Host Port when specifying Sending Host")
                            .build());
        }

        return result;
    }

    @Override
    protected ChannelDispatcher createDispatcher(final ProcessContext context, final BlockingQueue<StandardEvent> events)
            throws IOException {
        final String sendingHost = context.getProperty(SENDING_HOST).evaluateAttributeExpressions().getValue();
        final Integer sendingHostPort = context.getProperty(SENDING_HOST_PORT).evaluateAttributeExpressions().asInteger();
        final Integer bufferSize = context.getProperty(RECV_BUFFER_SIZE).asDataSize(DataUnit.B).intValue();
        final BlockingQueue<ByteBuffer> bufferPool = createBufferPool(context.getMaxConcurrentTasks(), bufferSize);
        final EventFactory<StandardEvent> eventFactory = new StandardEventFactory();
        return new DatagramChannelDispatcher<>(eventFactory, bufferPool, events, getLogger(), sendingHost, sendingHostPort);
    }

    @Override
    protected Map<String, String> getAttributes(final FlowFileEventBatch batch) {
        final String sender = batch.getEvents().get(0).getSender();
        final Map<String,String> attributes = new HashMap<>(3);
        attributes.put(UDP_SENDER_ATTR, sender);
        attributes.put(UDP_PORT_ATTR, String.valueOf(port));
        return attributes;
    }

    @Override
    protected String getTransitUri(FlowFileEventBatch batch) {
        final String sender = batch.getEvents().get(0).getSender();
        final String senderHost = sender.startsWith("/") && sender.length() > 1 ? sender.substring(1) : sender;
        final String transitUri = new StringBuilder().append("udp").append("://").append(senderHost).append(":")
                .append(port).toString();
        return transitUri;
    }

    public static class HostValidator implements Validator {

        @Override
        public ValidationResult validate(String subject, String input, ValidationContext context) {
            try {
                InetAddress.getByName(input);
                return new ValidationResult.Builder().subject(subject).valid(true).input(input).build();
            } catch (final UnknownHostException e) {
                return new ValidationResult.Builder().subject(subject).valid(false).input(input).explanation("Unknown host: " + e).build();
            }
        }

    }

}


text:
// Generated by Haxe 3.3.0
#ifndef INCLUDED_openfl_system_LoaderContext
#define INCLUDED_openfl_system_LoaderContext

#ifndef HXCPP_H
#include <hxcpp.h>
#endif

HX_DECLARE_CLASS2(openfl,_hx_system,ApplicationDomain)
HX_DECLARE_CLASS2(openfl,_hx_system,LoaderContext)
HX_DECLARE_CLASS2(openfl,_hx_system,SecurityDomain)

namespace openfl{
namespace _hx_system{

class HXCPP_CLASS_ATTRIBUTES LoaderContext_obj : public hx::Object
{
	public:
		typedef hx::Object super;
		typedef LoaderContext_obj OBJ_;
		LoaderContext_obj();

	public:
		void __construct(hx::Null< Bool >  __o_checkPolicyFile, ::openfl::_hx_system::ApplicationDomain applicationDomain, ::openfl::_hx_system::SecurityDomain securityDomain);
		inline void *operator new(size_t inSize, bool inContainer=true,const char *inName="openfl.system.LoaderContext")
			{ return hx::Object::operator new(inSize,inContainer,inName); }
		inline void *operator new(size_t inSize, int extra)
			{ return hx::Object::operator new(inSize+extra,true,"openfl.system.LoaderContext"); }
		static hx::ObjectPtr< LoaderContext_obj > __new(hx::Null< Bool >  __o_checkPolicyFile, ::openfl::_hx_system::ApplicationDomain applicationDomain, ::openfl::_hx_system::SecurityDomain securityDomain);
		static Dynamic __CreateEmpty();
		static Dynamic __Create(hx::DynamicArray inArgs);
		//~LoaderContext_obj();

		HX_DO_RTTI_ALL;
		hx::Val __Field(const ::String &inString, hx::PropertyAccess inCallProp);
		hx::Val __SetField(const ::String &inString,const hx::Val &inValue, hx::PropertyAccess inCallProp);
		void __GetFields(Array< ::String> &outFields);
		static void __register();
		void __Mark(HX_MARK_PARAMS);
		void __Visit(HX_VISIT_PARAMS);
		::String __ToString() const { return HX_HCSTRING("LoaderContext","\xfc","\x3d","\x01","\xc1"); }

		Bool allowCodeImport;
		Bool allowLoadBytesCodeExecution;
		 ::openfl::_hx_system::ApplicationDomain applicationDomain;
		Bool checkPolicyFile;
		 ::openfl::_hx_system::SecurityDomain securityDomain;
};

} // end namespace openfl
} // end namespace system

#endif /* INCLUDED_openfl_system_LoaderContext */


text:
package org.dbmaintain.datasource.impl;

import org.dbmaintain.database.DatabaseInfo;
import org.dbmaintain.datasource.DataSourceFactory;
import org.dbmaintain.datasource.SimpleDataSource;

import javax.sql.DataSource;

/**
 * @author Tim Ducheyne
 * @author Filip Neven
 */
public class SimpleDataSourceFactory implements DataSourceFactory {

    public DataSource createDataSource(DatabaseInfo databaseInfo) {
        databaseInfo.validateFull();
        return SimpleDataSource.createDataSource(databaseInfo);
    }

}


text:
<?php include VIEWPATH.'/includes/head.php'; ?>
<?php include VIEWPATH.'/includes/menu.php'; ?>

Shop Name

                    Category 1
                    Category 2
                    Category 3
                    Category 3

                <legend>Mas vendidos</legend>

First Product

FEDERICO MASTROGIOVANI

$105.00

                            	<button class="btn btn-primary">Añadir a mi lista</button>

15 reviews

$64.99

Second Product

This is a short description. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

12 reviews

$74.99

Third Product

This is a short description. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

31 reviews

Fourth Product

$84.99

This is a short description. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

6 reviews

$94.99

Fifth Product

This is a short description. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

18 reviews

Like this template?

If you like this template, then check out this tutorial on how to build a working review system for your online store!

                        View Tutorial

    <?php include VIEWPATH.'/includes/footer.php'; ?>


text:
package org.apache.kylin.rest.metrics;

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

import com.codahale.metrics.Gauge;
import com.codahale.metrics.Metric;
import com.codahale.metrics.MetricSet;

/**
 * @author xduo
 *
 */
public class QueryMetrics implements MetricSet {

    private Map<String, Float> metrics = new HashMap<String, Float>();

    private QueryMetrics() {
        // register query metrics
        this.increase("duration", (float) 0);
        this.increase("totalScanCount", (float) 0);
        this.increase("count", (float) 0);
    }

    static class QueryMetricsHolder {
        static final QueryMetrics INSTANCE = new QueryMetrics();
    }

    public static QueryMetrics getInstance() {
        return QueryMetricsHolder.INSTANCE;
    }

    public synchronized void increase(String key, Float value) {
        if (metrics.containsKey(key)) {
            metrics.put(key, metrics.get(key) + value);
        } else {
            metrics.put(key, value);
        }
    }

    public synchronized Float getAndReset(String key) {
        float value = metrics.get(key);
        metrics.put(key, (float) 0);

        return value;
    }

    public synchronized Map<String, Metric> getMetrics() {
        Map<String, Metric> metricSet = new HashMap<String, Metric>();

        for (final String key : metrics.keySet()) {
            metricSet.put(key, new Gauge<Float>() {
                @Override
                public Float getValue() {
                    float value = getAndReset(key);

                    return value;
                }
            });
        }

        return metricSet;
    }
}


text:
//%LICENSE////////////////////////////////////////////////////////////////
//
// Licensed to The Open Group (TOG) under one or more contributor license
// agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
// this work for additional information regarding copyright ownership.
// Each contributor licenses this file to you under the OpenPegasus Open
// Source License; you may not use this file except in compliance with the
// License.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//////////////////////////////////////////////////////////////////////////
//
//%/////////////////////////////////////////////////////////////////////////////

#ifndef Pegasus_Monitor_h
#define Pegasus_Monitor_h

#include <Pegasus/Common/Config.h>
#include <Pegasus/Common/ArrayInternal.h>
#include <Pegasus/Common/String.h>
#include <Pegasus/Common/Message.h>
#include <Pegasus/Common/ModuleController.h>
#include <Pegasus/Common/Socket.h>
#include <Pegasus/Common/Sharable.h>
#include <Pegasus/Common/Linkage.h>
#include <Pegasus/Common/AutoPtr.h>

PEGASUS_NAMESPACE_BEGIN

class PEGASUS_COMMON_LINKAGE MonitorEntry
{
public:
    enum Status
    {
        STATUS_IDLE,
        STATUS_BUSY,
        STATUS_DYING,
        STATUS_EMPTY
    };

    enum Type
    {
        TYPE_ACCEPTOR,
        TYPE_CONNECTION,
        TYPE_TICKLER
    };

    MonitorEntry()
    {
        reset();
    }

    MonitorEntry(
        SocketHandle socket_,
        Uint32 queueId_,
        Uint32 status_,
        Uint32 type_)
        : socket(socket_),
          queueId(queueId_),
          status(status_),
          type(type_)
    {
    }

    // NOTE: Using the default implementation of the copy constructor and
    // assignment operator.

    void reset()
    {
        socket = PEGASUS_INVALID_SOCKET;
        queueId = 0;
        status = STATUS_EMPTY;
        type = TYPE_TICKLER;
    }

    SocketHandle socket;
    Uint32 queueId;
    Uint32 status;
    Uint32 type;
};

/** This message occurs when there is activity on a socket. */
class SocketMessage : public Message
{
public:

    enum Events { READ = 1, WRITE = 2, EXCEPTION = 4 };

    SocketMessage(SocketHandle socket_, Uint32 events_)
        : Message(SOCKET_MESSAGE), socket(socket_), events(events_)
    {
    }

    SocketHandle socket;
    Uint32 events;
};

/**
    This message is sent to a connection owner (HTTPAcceptor) so it can do
    any necessary cleanup of the connection.
*/
class CloseConnectionMessage : public Message
{
public:

    CloseConnectionMessage(SocketHandle socket_)
        : Message(CLOSE_CONNECTION_MESSAGE), socket(socket_)
    {
    }

    SocketHandle socket;
};

/**
    The Tickler class provides a loopback socket connection that can be
    included in a select() socket array to allow the select() call to return
    on demand.
*/
class Tickler
{
public:
    /**
        Constructs a Tickler object and initializes its connection.
        @exception Exception if the initialization fails.
    */
    Tickler();

    ~Tickler();

    /**
        Causes a read event on the tickle socket.
    */
    void notify();

    /**
        Consumes all read events on the tickle socket.
    */
    void reset();

    SocketHandle getReadHandle()
    {
        return _serverSocket;
    }

private:
    /**
        Initializes the Tickler connection.
        @exception Exception if the initialization fails.
    */
    void _initialize();

    /**
        Uninitializes the Tickler connection.
    */
    void _uninitialize();

    SocketHandle _listenSocket;
    SocketHandle _clientSocket;
    SocketHandle _serverSocket;
};

/** This class monitors system-level events and notifies its clients of these
    events by posting messages to their queues.

    The monitor generates following message types:

 SocketMessage - occurs when activity on a socket

    Clients solicit these messages by calling one of the following methods:

 solicitSocketMessages()

    The following example shows how to solicit socket messages:

    Monitor monitor;
    Sint32 socket;
    Uint32 queueId;

    ...

    monitor.solicitSocketMessages(
    socket,
    SocketMessage::READ | SocketMessage::WRITE,
    queueId);

    Each time activity occurs on the given socket, a SocketMessage is
    enqueued on the given queue.

    In order the monitor to generate messages, it must be run by calling
    the run() method as shown below:

    Monitor monitor;

    ...

    Uint32 milliseconds = 5000;
    monitor.run(milliseconds);

    In this example, the monitor is run for five seconds. The run method
    returns after the first message is occurs or five seconds has transpired
    (whichever occurs first).
*/
class PEGASUS_COMMON_LINKAGE Monitor
{
public:
    /** Default constructor. */
    Monitor();

    /** This destruct deletes all handlers which were installed. */
    ~Monitor();

    /** Sets the state of the monitor entry to the specified state.
        This is used to synchronize the monitor and the worker
        thread. Bug# 2057 */
    void setState(
        Uint32 index,
        MonitorEntry::Status status);

    void tickle();

    /** Monitor system-level for the given number of milliseconds. Post a
        message to the corresponding queue when such an event occurs.
        Return after the time has elapsed or a single event has occurred,
        whichever occurs first.

        @param timeoutMsec the number of milliseconds to wait for an event.
    */
    void run(Uint32 timeoutMsec);

    /** Solicit interest in SocketMessages. Note that there may only
        be one solicitor per socket.

        @param socket the socket to monitor for activity.
        @param events socket events to monitor (see the SocketMessage::Events
        enumeration for details).
        @param queueId of queue on which to post socket messages.
        @return false if messages have already been solicited on this socket.
    */
    int solicitSocketMessages(
        SocketHandle socket,
        Uint32 events,
        Uint32 queueId,
        Uint32 type);

    /** Unsolicit messages on the given socket.

        @param socket on which to unsolicit messages.
        @return false if no such solicitation has been made on the given socket.
    */
    void unsolicitSocketMessages(SocketHandle);

    /** stop listening for client connections
     */
    void stopListeningForConnections(Boolean wait);

private:

    Array<MonitorEntry> _entries;
    /**
        This mutex must be locked when accessing the _entries array or any
        of its MonitorEntry objects.
    */
    Mutex _entriesMutex;

    AtomicInt _stopConnections;
    Semaphore _stopConnectionsSem;

    /** tracks how many times solicitSocketCount() has been called */
    Uint32 _solicitSocketCount;

    Tickler _tickler;
};

PEGASUS_NAMESPACE_END

#endif /* Pegasus_Monitor_h */


text:
using System;
using System.Windows.Forms;
using ExampleBase;
using NetOffice;
using PowerPoint = NetOffice.PowerPointApi;
using NetOffice.PowerPointApi.Enums;
using NetOffice.OfficeApi.Enums;
using NetOffice.PowerPointApi.Tools.Contribution;

namespace PowerPointExamplesCS4
{
    /// <summary>
    /// Example 1 - Create a presentation
    /// </summary>
    internal class Example01 : IExample
    {
        public void RunExample()
        {
            // start powerpoint
            PowerPoint.Application powerApplication = new PowerPoint.Application();

            // create a utils instance, no need for but helpful to keep the lines of code low
            CommonUtils utils = new CommonUtils(powerApplication);

            // add a new presentation with one new slide
            PowerPoint.Presentation presentation = powerApplication.Presentations.Add(MsoTriState.msoTrue);
            presentation.Slides.Add(1, PpSlideLayout.ppLayoutClipArtAndVerticalText);

            // save the document
            string documentFile = utils.File.Combine(HostApplication.RootDirectory, "Example01", DocumentFormat.Normal);
            presentation.SaveAs(documentFile);

            // close power point and dispose reference
            powerApplication.Quit();
            powerApplication.Dispose();

            // show end dialog
            HostApplication.ShowFinishDialog(null, documentFile);
        }

        public void Connect(IHost hostApplication)
        {
            HostApplication = hostApplication;
        }

        public string Caption
        {
            get { return "Example01"; }
        }

        public string Description
        {
            get { return "Create a presentation with 1 empty slide"; }
        }

        public UserControl Panel
        {
            get { return null; }
        }

        internal IHost HostApplication { get; private set; }
    }
}


text:
import * as types from '../constants/ActionTypes';

export function simpleCounterIncrease(n) {
	return {
    type: types.SIMPLECOUNTER_INCREASE,
    amount: n
  };
}

export function simpleCounterDecrease(n) {
  return {
    type: types.SIMPLECOUNTER_DECREASE,
    amount: n
  };
}


text:
<?php namespace TwoBrosTest\Product;

use TwoBros\Product\AmazonProduct;

/**
 * Generated by PHPUnit_SkeletonGenerator 1.2.0 on 2012-12-12 at 13:17:14.
 */
class AmazonProductTest extends \PHPUnit_Framework_TestCase
{

    /**
     * @var AmazonProduct
     */
    protected $object;

    public function testProduct()
    {

        $data = simplexml_load_file( __DIR__ . '/../mock/searchProducts.xml' );
        $p    = $data->ListMatchingProductsResult->Products->Product;
        $obj  = new AmazonProduct( 'testStore', $p, true, null, __DIR__ . '/../test-config.php' );
        $o    = $obj->getData();
        $this->assertInternalType( 'array', $o );
        $this->assertFalse( $this->object->getData() );

        $same = $obj->getProduct();
        $this->assertEquals( $o, $same );
    }

    /**
     * Sets up the fixture, for example, opens a network connection.
     * This method is called before a test is executed.
     */
    protected function setUp()
    {

        setupDummyConfigFile();
        resetLog();
        $this->object = new AmazonProduct( 'testStore', null, true, null, __DIR__ . '/../test-config.php' );
    }

    /**
     * Tears down the fixture, for example, closes a network connection.
     * This method is called after a test is executed.
     */
    protected function tearDown()
    {

    }

}

require_once( 'test/helperFunctions.php' );


text:
using System;

namespace PVPNetConnect.RiotObjects.Team
{
    public class TeamId : RiotGamesObject
    {
        public override string TypeName
        {
            get { return this.type; }
        }

        private string type = "com.riotgames.team.TeamId";

        public TeamId()
        {
        }

        public TeamId(Callback callback)
        {
            this.callback = callback;
        }

        public TeamId(TypedObject result)
        {
            base.SetFields(this, result);
        }

        public delegate void Callback(TeamId result);

        private Callback callback;

        public override void DoCallback(TypedObject result)
        {
            base.SetFields(this, result);
            callback(this);
        }

        [InternalName("fullId")]
        public String FullId { get; set; }
    }
}


text:
'use strict';

describe('Controller: SkillBoostDetailCtrl', function () {

  // load the controller's module
  beforeEach(module('tbsApp'));

  var SkillBoostDetailCtrl,
    scope;

  // Initialize the controller and a mock scope
  beforeEach(inject(function ($controller, $rootScope) {
    scope = $rootScope.$new();
    SkillBoostDetailCtrl = $controller('SkillBoostDetailCtrl', {
      $scope: scope
    });
  }));

  it('should attach a list of awesomeThings to the scope', function () {
    expect(scope.awesomeThings.length).toBe(3);
  });
});


text:
  Montaigu-les-Bois est
       un village
       situé dans le département de Manche en Basse-Normandie. Elle comptait 230 habitants en 2008.

Si vous pensez demenager à Montaigu-les-Bois, vous pourrez facilement trouver une maison à acheter.

À proximité de Montaigu-les-Bois sont positionnées géographiquement les villes de
Saint-Denis-le-Gast localisée à 6 km, 529 habitants,
Sourdeval-les-Bois située à 1 km, 167 habitants,
Fleury située à 5 km, 847 habitants,
La Baleine située à 4 km, 93 habitants,
Le Mesnil-Villeman localisée à 4 km, 228 habitants,
Le Mesnil-Amand localisée à 6 km, 154 habitants,
 entre autres. De plus, Montaigu-les-Bois est située à seulement 28 km de Saint-Lô.

La ville compte quelques  aménagements, elle dispose, entre autres, de un terrain de sport.

Le parc d'habitations, à Montaigu-les-Bois, était réparti en 2011 en un appartements et 144 maisons soit
 un marché relativement équilibré.


text:
/**
 * Class: mxGenericChangeCodec
 *
 * Codec for <mxValueChange>s, <mxStyleChange>s, <mxGeometryChange>s,
 * <mxCollapseChange>s and <mxVisibleChange>s. This class is created
 * and registered dynamically at load time and used implicitly
 * via <mxCodec> and the <mxCodecRegistry>.
 *
 * Transient Fields:
 *
 * - model
 * - previous
 *
 * Reference Fields:
 *
 * - cell
 *
 * Constructor: mxGenericChangeCodec
 *
 * Factory function that creates a <mxObjectCodec> for
 * the specified change and fieldname.
 *
 * Parameters:
 *
 * obj - An instance of the change object.
 * variable - The fieldname for the change data.
 */
var mxGenericChangeCodec = function(obj, variable)
{
	var codec = new mxObjectCodec(obj,  ['model', 'previous'], ['cell']);

	/**
	 * Function: afterDecode
	 *
	 * Restores the state by assigning the previous value.
	 */
	codec.afterDecode = function(dec, node, obj)
	{
		// Allows forward references in sessions. This is a workaround
		// for the sequence of edits in mxGraph.moveCells and cellsAdded.
		if (mxUtils.isNode(obj.cell))
		{
			obj.cell = dec.decodeCell(obj.cell, false);
		}

		obj.previous = obj[variable];

		return obj;
	};

	return codec;
};

// Registers the codecs
mxCodecRegistry.register(mxGenericChangeCodec(new mxValueChange(), 'value'));
mxCodecRegistry.register(mxGenericChangeCodec(new mxStyleChange(), 'style'));
mxCodecRegistry.register(mxGenericChangeCodec(new mxGeometryChange(), 'geometry'));
mxCodecRegistry.register(mxGenericChangeCodec(new mxCollapseChange(), 'collapsed'));
mxCodecRegistry.register(mxGenericChangeCodec(new mxVisibleChange(), 'visible'));
mxCodecRegistry.register(mxGenericChangeCodec(new mxCellAttributeChange(), 'value'));


text:
package com.flockinger.unitstack.response.s3;

import java.util.Optional;

import org.apache.commons.lang3.StringUtils;

import com.flockinger.unitstack.model.MockRequest;
import com.flockinger.unitstack.model.MockResponse;
import com.flockinger.unitstack.model.s3.Bucket;
import com.flockinger.unitstack.model.s3.S3Action;

public class DoesObjectExistResponder extends S3Responder {

  @Override
  public boolean isSameAction(MockRequest request) {
    return S3ActionInvestigator.get().isAction(request, S3Action.OBJECT_EXISTS);
  }

  @Override
  public MockResponse createResponse(MockRequest request) {
    Optional<Bucket> bucket = getBucket(request);
    Optional<String> objectKey = getObjectKey(request);
    boolean isObjectExisting = false;

    if (bucket.isPresent()) {
      isObjectExisting = bucket.get().getObjects().stream()
          .filter(s3Object -> StringUtils.equals(s3Object.getKey(), objectKey.get())).findAny()
          .isPresent();
    }
    return new MockResponse(isObjectExisting ? 200 : 404, "");
  }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
    <CheckBoxPreference
        android:key="pref_notify"
        android:title="@string/pref_notify"
        android:summary="@string/pref_notify_summ"
        android:defaultValue="true" />
    <ListPreference
        android:dependency="pref_notify"
        android:key="pref_notify_when"
        android:title="@string/pref_notify_when"
        android:dialogTitle="@string/pref_notify_when"
        android:entries="@array/pref_notify_when_entries"
        android:entryValues="@array/pref_notify_when_values"
        android:defaultValue="@string/pref_notify_when_default" />
    <ListPreference
        android:key="pref_location_id"
        android:title="Set college"
        android:summary="Choose your college so you can get tailored freets!"
        android:entries="@array/pref_location_id_entries"
        android:entryValues="@array/pref_location_id_values"
        android:defaultValue="812"
        />
</PreferenceScreen>


text:
package com.leader.spring04.event;

public class MyDemoEvent2 {
	private int id;
	private String msg;

	public int getId() {
		return id;
	}

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

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}
}


text:
package mf.org.apache.xerces.jaxp.validation;

import mf.org.apache.xerces.xni.grammars.Grammar;
import mf.org.apache.xerces.xni.grammars.XMLGrammarDescription;
import mf.org.apache.xerces.xni.grammars.XMLGrammarPool;

/**
 *
Implementation of Schema for W3C XML Schemas
 * which contains no schema components.

 *
 * @author Michael Glavassevich, IBM
 * @version $Id: EmptyXMLSchema.java 447235 2006-09-18 05:01:44Z mrglavas $
 */
final class EmptyXMLSchema extends AbstractXMLSchema implements XMLGrammarPool {

    /** Zero length grammar array. */
    private static final Grammar [] ZERO_LENGTH_GRAMMAR_ARRAY = new Grammar [0];

    public EmptyXMLSchema() {}

    /*
     * XMLGrammarPool methods
     */

    public Grammar[] retrieveInitialGrammarSet(String grammarType) {
        return ZERO_LENGTH_GRAMMAR_ARRAY;
    }

    public void cacheGrammars(String grammarType, Grammar[] grammars) {}

    public Grammar retrieveGrammar(XMLGrammarDescription desc) {
        return null;
    }

    public void lockPool() {}

    public void unlockPool() {}

    public void clear() {}

    /*
     * XSGrammarPoolContainer methods
     */

    public XMLGrammarPool getGrammarPool() {
        return this;
    }

    public boolean isFullyComposed() {
        return true;
    }

} // EmptyXMLSchema


text:
growbox-automation
==================

Arduino Sketch.

Пример кода для подключения однопроводного датчика температуры DS18B20 и экрана Nokia5110 к Arduino.

Необходимые библиотеки:
* OneWire
* DallasTemperature_360
* LCD5110_Graph

Их необходимо импортировать через меню Arduino.app -> Sketch -> Import Library... -> Add library...

Цель - автоматизация гроубокса (growbox) описаного в боге [Экзотический сад дома](http://exotic-garden-at-home.blogspot.com "Экзотический сад дома").
Поддержание температуры внутри гроубокса в заданом диапазоне температур осуществляется путем включение кулеров [статья](http://exotic-garden-at-home.blogspot.com/2013/09/grow-box-2.html "статья").


text:
//
//  Camera.h
//  CV
//
//  Created by ThisUser on 22/6/19.
//  Copyright © 2019 ThisUser. All rights reserved.
//

#ifndef Camera_h
#define Camera_h

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

// Protocol for callback action
@protocol CameraDelegate <NSObject>

@end

// Public interface for camera. ViewController only needs to init, start and stop.
@interface Camera : NSObject

-(id) initWithController: (UIViewController<CameraDelegate>*)c andImageView: (UIImageView*)iv titleText: (Float32*)mainTitle bPressed: (int*)btnPressed;
-(void)start;
-(void)stop;

@end

#endif /* Camera_h */


text:
package com.facebook.buck.jvm.java;

import com.facebook.buck.core.rulekey.AddToRuleKey;
import com.facebook.buck.core.rulekey.AddsToRuleKey;
import com.facebook.buck.core.rules.modern.annotations.CustomFieldBehavior;
import com.facebook.buck.core.rules.modern.annotations.DefaultFieldSerialization;
import com.facebook.buck.core.sourcepath.PathSourcePath;
import com.facebook.buck.core.sourcepath.resolver.SourcePathResolver;
import com.facebook.buck.core.util.immutables.BuckStyleImmutable;
import com.facebook.buck.io.filesystem.ProjectFilesystem;
import com.facebook.buck.rules.modern.DefaultFieldInputs;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import java.io.File;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.net.URISyntaxException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.immutables.value.Value;

/**
 * Represents the command line options that should be passed to javac. Note that the options do not
 * include either the classpath or the directory for storing class files.
 */
@Value.Immutable(copy = true)
@BuckStyleImmutable
abstract class AbstractJavacOptions implements AddsToRuleKey {

  // Default combined source and target level.
  public static final String TARGETED_JAVA_VERSION = "7";

  /** The method in which the compiler output is spooled. */
  public enum SpoolMode {
    /**
     * Writes the compiler output directly to a .jar file while retaining the intermediate .class
     * files in memory. If {@link
     * com.facebook.buck.jvm.java.JavaLibraryDescription.AbstractJavaLibraryDescriptionArg}
     * postprocessClassesCommands are present, the builder will resort to writing .class files to
     * disk by necessity.
     */
    DIRECT_TO_JAR,

    /**
     * Writes the intermediate .class files from the compiler output to disk which is later packed
     * up into a .jar file.
     */
    INTERMEDIATE_TO_DISK,
  }

  @Value.Default
  @AddToRuleKey
  protected SpoolMode getSpoolMode() {
    return SpoolMode.INTERMEDIATE_TO_DISK;
  }

  @Value.Default
  @AddToRuleKey
  protected boolean isProductionBuild() {
    return false;
  }

  @Value.Default
  @CustomFieldBehavior(DefaultFieldSerialization.class)
  protected boolean isVerbose() {
    return false;
  }

  @Value.Default
  @AddToRuleKey
  public String getSourceLevel() {
    return TARGETED_JAVA_VERSION;
  }

  @VisibleForTesting
  @Value.Default
  @AddToRuleKey
  public String getTargetLevel() {
    return TARGETED_JAVA_VERSION;
  }

  @Value.Default
  @AddToRuleKey
  public AnnotationProcessingParams getAnnotationProcessingParams() {
    return AnnotationProcessingParams.EMPTY;
  }

  @AddToRuleKey
  public abstract List<String> getExtraArguments();

  // TODO(cjhopman): This should use SourcePaths
  @AddToRuleKey
  protected abstract Optional<String> getBootclasspath();

  // TODO(cjhopman): This should be resolved to the appropriate source.
  // TODO(cjhopman): Should this be added to the rulekey?
  @CustomFieldBehavior({DefaultFieldInputs.class, DefaultFieldSerialization.class})
  protected abstract Map<String, ImmutableList<PathSourcePath>> getSourceToBootclasspath();

  @AddToRuleKey
  protected boolean isDebug() {
    return !isProductionBuild();
  }

  @Value.Default
  @AddToRuleKey
  public boolean trackClassUsage() {
    return false;
  }

  @Value.Default
  @CustomFieldBehavior(DefaultFieldSerialization.class)
  protected boolean trackJavacPhaseEvents() {
    return false;
  }

  public void validateOptions(Function<String, Boolean> classpathChecker) throws IOException {
    if (getBootclasspath().isPresent()) {
      String bootclasspath = getBootclasspath().get();
      try {
        if (!classpathChecker.apply(bootclasspath)) {
          throw new IOException(
              String.format("Bootstrap classpath %s contains no valid entries", bootclasspath));
        }
      } catch (UncheckedIOException e) {
        throw e.getCause();
      }
    }
  }

  public JavacOptions withBootclasspathFromContext(ExtraClasspathProvider extraClasspathProvider) {
    String extraClasspath =
        Joiner.on(File.pathSeparator).join(extraClasspathProvider.getExtraClasspath());
    JavacOptions options = (JavacOptions) this;

    if (!extraClasspath.isEmpty()) {
      return options.withBootclasspath(extraClasspath);
    }

    return options;
  }

  public void appendOptionsTo(
      OptionsConsumer optionsConsumer,
      SourcePathResolver pathResolver,
      ProjectFilesystem filesystem) {

    // Add some standard options.
    optionsConsumer.addOptionValue("source", getSourceLevel());
    optionsConsumer.addOptionValue("target", getTargetLevel());

    // Set the sourcepath to stop us reading source files out of jars by mistake.
    optionsConsumer.addOptionValue("sourcepath", "");

    if (isDebug()) {
      optionsConsumer.addFlag("g");
    }

    if (isVerbose()) {
      optionsConsumer.addFlag("verbose");
    }

    // Override the bootclasspath if Buck is building Java code for Android.
    if (getBootclasspath().isPresent()) {
      optionsConsumer.addOptionValue("bootclasspath", getBootclasspath().get());
    } else {
      ImmutableList<PathSourcePath> bootclasspath =
          getSourceToBootclasspath().get(getSourceLevel());
      if (bootclasspath != null) {
        String bcp =
            bootclasspath
                .stream()
                .map(pathResolver::getAbsolutePath)
                .map(filesystem::relativize)
                .map(Path::toString)
                .collect(Collectors.joining(File.pathSeparator));
        optionsConsumer.addOptionValue("bootclasspath", bcp);
      }
    }

    // Add annotation processors.
    AnnotationProcessingParams annotationProcessingParams = getAnnotationProcessingParams();
    if (!annotationProcessingParams.isEmpty()) {
      ImmutableList<ResolvedJavacPluginProperties> annotationProcessors =
          annotationProcessingParams.getModernProcessors();

      // Specify processorpath to search for processors.
      optionsConsumer.addOptionValue(
          "processorpath",
          annotationProcessors
              .stream()
              .map(properties -> properties.getClasspath(pathResolver, filesystem))
              .flatMap(Arrays::stream)
              .distinct()
              .map(
                  url -> {
                    try {
                      return url.toURI();
                    } catch (URISyntaxException e) {
                      throw new RuntimeException(e);
                    }
                  })
              .map(Paths::get)
              .map(Path::toString)
              .collect(Collectors.joining(File.pathSeparator)));

      // Specify names of processors.
      optionsConsumer.addOptionValue(
          "processor",
          annotationProcessors
              .stream()
              .map(ResolvedJavacPluginProperties::getProcessorNames)
              .flatMap(Collection::stream)
              .collect(Collectors.joining(",")));

      // Add processor parameters.
      for (String parameter : annotationProcessingParams.getParameters()) {
        optionsConsumer.addFlag("A" + parameter);
      }

      if (annotationProcessingParams.getProcessOnly()) {
        optionsConsumer.addFlag("proc:only");
      }
    } else {
      // Disable automatic annotation processor lookup
      optionsConsumer.addFlag("proc:none");
    }

    // Add extra arguments.
    optionsConsumer.addExtras(getExtraArguments());
  }

  static JavacOptions.Builder builderForUseInJavaBuckConfig() {
    return JavacOptions.builder();
  }

  public static JavacOptions.Builder builder(JavacOptions options) {
    JavacOptions.Builder builder = JavacOptions.builder();

    return builder.from(options);
  }
}


text:
package org.knowm.xchart.internal.chartpart;

import java.text.*;
import org.knowm.xchart.style.AxesChartStyler;

/** @author timmolter */
class Formatter_LogNumber extends Format {

  private final AxesChartStyler styler;
  private final Axis.Direction axisDirection;
  private final NumberFormat numberFormat;
  private int yIndex;

  /** Constructor */
  public Formatter_LogNumber(AxesChartStyler styler, Axis.Direction axisDirection) {

    this.styler = styler;
    this.axisDirection = axisDirection;
    numberFormat = NumberFormat.getNumberInstance(styler.getLocale());
  }

  /**
   * Constructor
   *
   * @param styler
   * @param axisDirection
   * @param yIndex
   */
  public Formatter_LogNumber(AxesChartStyler styler, Axis.Direction axisDirection, int yIndex) {

    this.styler = styler;
    this.axisDirection = axisDirection;
    this.yIndex = yIndex;
    numberFormat = NumberFormat.getNumberInstance(styler.getLocale());
  }

  @Override
  public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos) {

    double number = (Double) obj;

    String decimalPattern;

    if (axisDirection == Axis.Direction.X && styler.getXAxisDecimalPattern() != null) {

      decimalPattern = styler.getXAxisDecimalPattern();
    } else if (axisDirection == Axis.Direction.Y
        && (styler.getYAxisGroupDecimalPatternMap().get(yIndex) != null
            || styler.getYAxisDecimalPattern() != null)) {
      if (styler.getYAxisGroupDecimalPatternMap().get(yIndex) != null) {
        decimalPattern = styler.getYAxisGroupDecimalPatternMap().get(yIndex);
      } else {
        decimalPattern = styler.getYAxisDecimalPattern();
      }
    } else if (styler.getDecimalPattern() != null) {

      decimalPattern = styler.getDecimalPattern();
    } else {
      if (Math.abs(number) > 1000.0 || Math.abs(number) < 0.001) {
        decimalPattern = "0E0";
      } else {
        decimalPattern = "0.###";
      }
    }

    DecimalFormat normalFormat = (DecimalFormat) numberFormat;
    normalFormat.applyPattern(decimalPattern);
    toAppendTo.append(normalFormat.format(number));

    return toAppendTo;
  }

  @Override
  public Object parseObject(String source, ParsePosition pos) {

    return null;
  }
}


text:
/**
 * Created by Corey600 on 2016/8/9.
 */

'use strict';

var os = require('os');
var sysPath = require('path');
var uuid = require('uuid');
var zookeeper = require('node-zookeeper-client');
var properties = require('properties');
var write = require('./utils/write');
var log = require('./utils/log')('ConfigNode');

/**
 * 主机名称
 *
 * @type {string}
 */
var HOSTNAME = os.hostname();

/**
 * @param {string} type
 * @param {string} key
 * @param {string} prefix
 * @param {DisconfClient} client
 * @constructor
 */
function ConfigNode(type, key, prefix, client) {
    /**
     * 配置类型 'item' or 'file'.
     * @type {string}
     * @private
     */
    this._type = type;

    /**
     * 配置节点名称
     * @type {string}
     * @private
     */
    this._key = key;

    /**
     * http客户端
     * @type {HttpClient}
     * @private
     */
    this._http = client._http;

    /**
     * node-zookeeper-client 的实例
     * @type {*}
     * @private
     */
    this._zk = client._zk;

    /**
     * 选项
     * @type {*}
     * @private
     */
    this._option = client._option;

    /**
     * 配置(持久)节点的路径
     * @type {string}
     * @private
     */
    this._path = this._buildPath(prefix);

    /**
     * 创建临时节点传入的名称
     * @type {string}
     * @private
     */
    this._tempPath = this._path + '/' + HOSTNAME + '_' + process.pid + '_' + uuid.v4().replace(/-/g, '');

    /**
     * 临时节点创建之后真实的名称
     * @type {string|null}
     * @private
     */
    this._realPath = null;
}

/**
 * Build the path string.
 *
 * @param {string} prefix
 * @returns {string}
 * @private
 */
ConfigNode.prototype._buildPath = function (prefix) {
    var option = this._option;
    return (prefix
    + '/' + option.app + '_' + option.version + '_' + option.env
    + '/' + this._type + '/' + this._key);
};

/**
 * Get the key.
 *
 * @returns {string}
 * @public
 */
ConfigNode.prototype.getKey = function () {
    return this._key;
};

/**
 * Watch the event of configuration node.
 *
 * @param {Function} watcher
 * @param {Function} callback
 * @returns {ConfigNode}
 * @public
 */
ConfigNode.prototype.nodeWatch = function (watcher, callback) {
    var self = this;
    self._createPersistentNode(self._path, HOSTNAME, function (err, path) {
        if (err) return callback(err);
        self._doWatch(path, null, watcher, callback);
    });
    return this;
};

/**
 * Do watch the event of configuration node.
 *
 * @param {string} path
 * @param {Event} event
 * @param {Function} watcher
 * @param {Function} callback
 * @private
 */
ConfigNode.prototype._doWatch = function (path, event, watcher, callback) {
    var self = this;
    self._zk.getData(path,
        function (event) {
            self._doWatch(path, event, watcher, callback);
        },
        function (err/*, data, stat*/) {
            if (err) return callback(err);
            self._getData(function (err, data) {
                if(event){
                    watcher(err, event, data);
                }else{
                    callback(err, data);
                }
            });
        }
    );
};

/**
 * Get the configuration data from server.
 *
 * @param {Function} callback
 * @returns {ConfigNode}
 * @private
 */
ConfigNode.prototype._getData = function (callback) {
    var self = this;
    self._http.getConfig(self._type, self._key, function (err, data) {
        if (err) return callback(err);
        try {
            // to deal with the configuration item
            if (self._type === 'item') {
                data = data.value;
            }

            // save the configuration data to a file
            write(
                sysPath.join(self._option.user_define_download_dir, self._key),
                data,
                function (err) {
                    if (err) {
                        log.warn('save the configuration data to a file error. key: %s, error: %s', self._key, err.stack);
                    } else {
                        log.info('save the configuration data to a file success. key: %s', self._key);
                    }
                }
            );

            // parse the configuration data
            if (self._type === 'file') {
                // file
                data = properties.parse(data);
                for(var item in data){
                    if(data.hasOwnProperty(item) && data[item] === null){
                        log.warn('item [%s] of config file [%s] is null, now transform to empty string.', item, self._key);
                        data[item] = '';
                    }
                }
                self._pushData(JSON.stringify(data));
            } else {
                // item
                self._pushData(data);
                data = properties.parse(self._key + '=' + data);
            }
        } catch (e) {
            return callback(e);
        }
        return callback(null, data);
    });
    return this;
};

/**
 * Returns the configuration data for the server check.
 *
 * @param {*} data
 * @returns {ConfigNode}
 * @private
 */
ConfigNode.prototype._pushData = function (data) {
    var self = this;
    var ephemeralHandle = function (err, path) {
        if (err) {
            log.warn('create ephemeral node error. path: %s, error: %s', path, err.stack);
        } else {
            log.info('push config data success. path: %s', path);
        }
    };
    var _path = self._realPath;
    if (_path === null) {
        // 临时节点还未创建则创建
        self._createEphemeralNode(self._tempPath, data, ephemeralHandle);
        return this;
    }
    self._zk.exists(_path, function (err, stat) {
        if (err) {
            log.warn('push config data error. path: %s, error: %s', _path, err.stack);
            return;
        }
        if (stat) {
            self._zk.setData(
                _path,
                new Buffer(data),
                function (err, stat) {
                    if (err) {
                        log.warn('push config data error. path: %s, error: %s', _path, err.stack);
                    } else {
                        log.info('push config data success. stat: %s', JSON.stringify(stat));
                    }
                }
            );
        } else {
            // 临时节点还未创建则创建
            self._createEphemeralNode(self._tempPath, data, ephemeralHandle);
        }
    });
    return this;
};

/**
 * 创建持久节点,父路径不存在则会主动创建
 * 如果原本就存在则回调传入的路径,如果是新创建的则回调新创建的真实路径
 *
 * @param {string} path
 * @param {*} data
 * @param {Function} callback
 * @returns {ConfigNode}
 * @private
 */
ConfigNode.prototype._createPersistentNode = function (path, data, callback) {
    var self = this;
    self._zk.exists(path, function (err, stat) {
        if (!err && !stat) {
            log.info('persistent node does need to create. path: %s', path);
            self._zk.mkdirp(
                path,
                new Buffer(data),
                zookeeper.CreateMode.PERSISTENT,
                callback
            );
        } else {
            callback(err, path);
        }
    });
    return this;
};

/**
 * 创建临时节点,父路径不存在不会主动创建,而会抛错
 * 如果原本就存在则回调传入的路径,如果是新创建的则回调新创建的真实路径
 *
 * @param {string} path
 * @param {*} data
 * @param {Function} callback
 * @returns {ConfigNode}
 * @private
 */
ConfigNode.prototype._createEphemeralNode = function (path, data, callback) {
    var self = this;
    self._zk.exists(path, function (err, stat) {
        if (!err && !stat) {
            log.info('ephemeral node does need to create. path: %s', path);
            self._zk.create(
                path,
                new Buffer(data),
                zookeeper.CreateMode.EPHEMERAL_SEQUENTIAL,
                function (errr, path) {
                    // 更新临时节点真实名称
                    self._realPath = path;
                    callback(err, path);
                }
            );
        } else {
            callback(err, path);
        }
    });
    return this;
};

/**
 * @type {Function}
 */
module.exports = ConfigNode;


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Beih. Sydowia 4: 58 (1961)

#### Original name
Cyphella subgelatinosa Berk. & Ravenel

### Remarks
null


text:
package ir.apend.slider.model;

import java.io.Serializable;

/**
 * Created by Farzad Farazmand on 28,June,2017
 * farzad.farazmand@gmail.com
 */

public class Slide implements Serializable{

    private int id;
    private String imageUrl;
    private int imageCorner;

    public Slide(int id, String imageUrl,int imageCorner) {
        this.id = id;
        this.imageUrl = imageUrl;
        this.imageCorner = imageCorner;
    }

    public int getId() {
        return id;
    }

    public String getImageUrl() {
        return imageUrl;
    }

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

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public int getImageCorner() {
        return imageCorner;
    }

    public void setImageCorner(int imageCorner) {
        this.imageCorner = imageCorner;
    }
}