text:
/*global define, echarts*/
; (function (global, factory) {
    if (typeof exports === 'object' && typeof module !== 'undefined') {
        var VeloxScriptLoader = require("velox-loader") ;
        var VeloxWebView = require("../velox-web-view") ;
        module.exports = factory(VeloxScriptLoader, VeloxWebView) ;
    } else if (typeof define === 'function' && define.amd) {
        define(['VeloxScriptLoader', 'VeloxWebView'], factory);
    } else {
        global.VeloxWebView.registerExtension(factory(global.veloxScriptLoader, global.VeloxWebView));
    }
}(this, (function (VeloxScriptLoader, VeloxWebView) { 'use strict';

    /**
     * contains loaded libs
     */
    var libs = {} ;

    var sortableCSSLoaded = false;

    ///// DEPENDENCIES LIBRARIES LOADING ////////
    var SORTABLE_VERSION = "1.7.0";

    var SORTABLE_LIB = {
        name: "sortablejs",
        type: "js",
        version: SORTABLE_VERSION,
        cdn: "https://cdn.jsdelivr.net/npm/sortablejs@$VERSION/Sortable.min.js",
        bowerPath: "Sortable/Sortable.min.js",
        npmPath: "sortablejs/Sortable.min.js",
    } ;

    /**
     * field extension definition
     */
    var extension = {} ;
    extension.name = "list" ;

    extension.libs = [
        SORTABLE_LIB
    ] ;
    //must run before fields extension
    extension.mustRunAfter = ["fields"] ;

    /**
     * called on view init
     */
    extension.init = function(){
        var view = this ;
        doInitView.bind(view)() ;
    } ;
    /**
     * called on view compile
     */
    extension.prepare = function(params, cb){
        var view = this ;
        doPrepareView.bind(view)(params, cb) ;
    } ;
    extension.extendsGlobal = {} ;

    extension.extendsProto = {} ;

    extension.extendsProto.startListAuto = function(viewId){
        this.setListAuto(viewId, true) ;
    } ;

    extension.extendsProto.stopListAuto = function(viewId){
        this.setListAuto(viewId, false) ;
    } ;

    extension.extendsProto.setListAuto = function(active){
        if(this.isListAuto){
            //if this view is a list auto view, set its active flag
            this.listAutoActive = active ;
        }
        //apply on sub views if there is any one of them that may be a list auto
        Object.keys(this.views).forEach(function(viewId){
            var viewDef = this.views[viewId] ;
            if(viewDef.el.hasAttribute("data-list-auto")){
                viewDef.listAutoActive = active ;
            }

            this.views[viewId].instances.forEach(function(subView){
                subView.setListAuto(active) ;
            }) ;
            if(active){
                if(viewDef.el.hasAttribute("data-list-auto")){
                    var mustAddLine = false;
                    if(this.views[viewId].instances.length === 0){
                        //no line at all
                        mustAddLine = true ;
                    }else{
                        var lastObj = this.views[viewId].instances[this.views[viewId].instances.length-1].getBoundObject() ;
                        if(lastObj && JSON.stringify(lastObj) !== "{}"){
                            //last line is not an empty line
                            mustAddLine = true;
                        }
                    }
                    if(mustAddLine){
                        //add an instance to start input
                        var v = this.addViewInstance(viewId) ;
                        v.listAutoActive = active ;
                    }
                    if(viewDef.el.hasAttribute("data-list-sortable")){
                        libs.Sortable.create(viewDef.elParent, {
                            draggable: ".list-sortable",
                            handle: ".list-sort-handle",
                            onEnd: function (/**Event*/evt) {
                                if (evt.newIndex >= viewDef.instances.length) {
                                    var k = evt.newIndex - viewDef.instances.length;
                                    while ((k--) + 1) {
                                        viewDef.instances.push(undefined);
                                    }
                                }
                                viewDef.instances.splice(evt.newIndex, 0, viewDef.instances.splice(evt.oldIndex, 1)[0]);
                            },
                        });
                    }
                }
            }
        }.bind(this));

        if(this.isListAuto){
            toggleRemoveEls.bind(this)() ;
        }
    } ;

    extension.extendsObj = {} ;

    extension.extendsObj._getSubviewData = function (viewId, viewData) {
        var viewData = VeloxWebView.prototype._getSubviewData.call(this, viewId, viewData);
        if(this.views[viewId].listAutoActive && Array.isArray(viewData)){
            //remove the last entry of the array because it is always an empty line if list auto is active
            viewData.splice(viewData.length - 1, 1) ;
        }
        return viewData ;
    } ;

    /**
     * Manage the visibility of remove elements
     */
    function toggleRemoveEls(){
        var elsRemove = this.elementsHavingAttribute("data-list-remove");
        var elsHandles = this.elementsHavingAttribute("data-list-sort-handle");
        if(this.listAutoActive){
            var viewDef = this.parentView.views[this.viewId] ;
            var listIndex = viewDef.instances.indexOf(this) ;
            if(listIndex === viewDef.instances.length - 1){
                //this instance is the last instance, don't allow to remove it
                elsRemove.forEach(function(elRemove){
                    elRemove.style.display = "none" ;
                });
                elsHandles.forEach(function(el){
                    el.style.display = "none" ;
                });
                this.container.className = this.container.className.replace("list-sortable", "") ;
            }else{
                //this instance is not the last, allow to remove it
                elsRemove.forEach(function(elRemove){
                    elRemove.style.display = "" ;
                });
                elsHandles.forEach(function(el){
                    el.style.display = "" ;
                });
                if(this.container.className.indexOf("list-sortable") === -1){
                    this.container.className += " list-sortable" ;
                }
            }
        }else{
            //not active, hide all
            elsRemove.forEach(function(elRemove){
                elRemove.style.display = "none" ;
            });
            elsHandles.forEach(function(el){
                el.style.display = "none" ;
            });
            this.container.className = this.container.className.replace("list-sortable", "") ;
        }
    }

    /**
     * Prepare sort handles
     */
    function prepareSortHandlers(){
        var elsSortables = this.elementsHavingAttribute("data-list-sort-handle");
        elsSortables.forEach(function(elHandle){
            if(elHandle.className.indexOf("list-sort-handle") === -1){
                elHandle.className += " list-sort-handle" ;
            }
        });
        // var elsSortables = this.elementsHavingAttribute("data-list-sortable");
        // elsSortables.forEach(function(el){
        //     if(el.className.indexOf("list-sortable") === -1){
        //         el.className += " list-sortable" ;
        //     }
        // });
    }

    /**
     * init view fields
     *
     * get all HTML elements having data-field attribute
     *
     * @private
     */
    function doInitView(){
        this.on("load", function(){
            //on load (after render) on the parent view, we must propagate the list auto status to all created instances
            Object.keys(this.views).forEach(function(viewId){
                this.views[viewId].instances.forEach(function(v){
                    v.listAutoActive = this.views[viewId].listAutoActive ;
                }.bind(this)) ;
            }.bind(this)) ;
        }.bind(this)) ;

        if(this.isMultiple){
            //I am a view 'item' of a list

            //get my view definition from parent
            var viewDef = this.parentView.views[this.viewId] ;

            if(viewDef.el.hasAttribute("data-list-auto")){
                this.isListAuto = true ;
                viewDef.getValue = function(){
                    return this.parentView._getSubviewData(this.viewId) ;
                }.bind(this) ;
            }

            this.once("load", function(){
                //first time render on this item, search for all fields to listen on changes

                //get the list array from data
                var elements = this.elementsHavingAttribute("data-bind");
                elements.forEach(function(element){
                    var eventType = "change" ;
                    if(element.tagName === "INPUT" && element.type === "text"){
                        eventType = "keyup" ;
                    }else if(element.hasAttribute("data-field") && element.getAttribute("data-field") === "varchar"){
                        eventType = "keyup" ;
                    }
                    element.addEventListener(eventType, function(){
                        //a change happen
                        if(this.listAutoActive){ //the list is active
                            var listIndex = viewDef.instances.indexOf(this) ; //recompute because it may have change with remove actions
                            if(listIndex === viewDef.instances.length - 1){
                                //where are on the last line, add a line
                                var v = this.parentView.addViewInstance(this.viewId, function(){}) ;
                                v.listAutoActive = true ;
                            }
                        }
                    }.bind(this)) ;
                }.bind(this));

                //get the potential remove buttons
                var elsRemove = this.elementsHavingAttribute("data-list-remove");
                elsRemove.forEach(function(elRemove){
                    elRemove.addEventListener("click", function(){
                        //click on remove button
                        if(this.listAutoActive){ //the list is active
                            //remove the line
                            var listIndex = viewDef.instances.indexOf(this) ;
                            this.parentView.removeViewInstance(this.viewId, listIndex) ;
                        }
                    }.bind(this)) ;
                }.bind(this)) ;

                //listen to load (render), remove and add instance events in parent view
                this.parentView.on('load', toggleRemoveEls.bind(this)) ;
                this.parentView.on('viewInstanceRemoved', toggleRemoveEls.bind(this)) ;
                this.parentView.on('viewInstanceAdded', toggleRemoveEls.bind(this)) ;
                this.parentView.on('viewInstanceAdded', prepareSortHandlers.bind(this)) ;
            }.bind(this)) ;
        }
    }

     /**
     * init view fields
     *
     * get all HTML elements having data-field attribute
     *
     * @private
     */
    function doPrepareView(params, callback){
        var elements = params.doc.querySelectorAll("[data-list-sortable]");
        if(elements.length>0){
            loadSortableCSS() ;
            loadLib("Sortable", SORTABLE_VERSION, SORTABLE_LIB, callback) ;
        }else{
            callback() ;
        }
    }

    /**
     * load the Switch CSS
     */
    function loadSortableCSS(){
        if(sortableCSSLoaded){ return ;}

        var css = ".list-sort-handle { cursor: move; }";

        var head = document.getElementsByTagName('head')[0];
        var s = document.createElement('style');
        s.setAttribute('type', 'text/css');
        if (s.styleSheet) {   // IE
            s.styleSheet.cssText = css;
        } else {                // the world
            s.appendChild(document.createTextNode(css));
        }
        head.appendChild(s);
        sortableCSSLoaded = true ;
    }

    /**
     * Load a lib from CDN/Bower if not already loaded or given in configure.libs
     *
     * @param {string} name lib name
     * @param {string} version the lib version
     * @param {object} libDef the lib def for VeloxScriptLoader
     * @param {function(Err)} callback called on loaded
     */
    function loadLib(name, version, libDef, callback){
        if(!libs[name]){
            if(window[name]){
                libs[name] = window[name] ;
                return callback() ;
            }

            console.debug("No "+name+" object given, we will load from CDN/bower"+
            ". If you don't want this, add the lib "+name+ " (version "+version+")"+
                " in your global import scripts or give "+name+" object to VeloxWebView.field.configure({libs : { "+name+": __here__ }})");

            if (!VeloxScriptLoader) {
                return callback("To have automatic script loading, you need to import VeloxScriptLoader");
            }

            VeloxScriptLoader.load(libDef, function(err, result){
                if(err){ return callback(err); }
                libs[name] = window[name] ;
                callback(null, result) ;
            }) ;
        }else{
            callback() ;
        }
    }

    return extension ;

})));


text:
<!DOCTYPE html>
<!--
Copyright 2015 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<link rel="import" href="/tracing/core/test_utils.html">

<link rel="import" href="group_report.html">

<script>
'use strict';

tr.b.unittest.testSuite(function() {

  var testOptions = {
    setUp: function() {
      window.SUBTESTS = {
        'ChromiumPerf/chromium-rel-mac': {
          'page_cycler.morejs': {
            'cold_times': {
              'has_rows': false,
              'sub_tests': {
                'test.blogspot.com': {
                  'has_rows': true,
                  'sub_tests': {}
                },
                'www.yahoo.com': {
                  'has_rows': true,
                  'sub_tests': {}
                },
                'page_load_time': {
                  'has_rows': true,
                  'sub_tests': {}
                },
                'page_load_time_ref': {
                  'has_rows': true,
                  'sub_tests': {}
                }
              }
            },
            'idle_wakeups_gpu': {
              'has_rows': true,
              'sub_tests': {
                'test.blogspot.com': {
                  'has_rows': true,
                  'sub_tests': {}
                },
                'www.yahoo.com': {
                  'has_rows': true,
                  'sub_tests': {}
                },
                'ref': {
                  'has_rows': true,
                  'sub_tests': {}
                }
              }
            }
          }
        }
      };
    }
  };

  test('getTestPathAndSelectedSeries for alert on summary series', function() {
    var alert = {
      'master': 'ChromiumPerf',
      'bot': 'chromium-rel-mac',
      'testsuite': 'page_cycler.morejs',
      'test': 'idle_wakeups_gpu'
    };
    var result = group_report.getTestPathAndSelectedSeries(alert);
    assert.equal(result.length, 2);
    assert.equal(
        result[0],
        'ChromiumPerf/chromium-rel-mac/page_cycler.morejs/idle_wakeups_gpu');
    assert.deepEqual(result[1], ['idle_wakeups_gpu', 'ref']);
  }, testOptions);

  test('getTestPathAndSelectedSeries for alert on leaf series', function() {
    var alert = {
      'master': 'ChromiumPerf',
      'bot': 'chromium-rel-mac',
      'testsuite': 'page_cycler.morejs',
      'test': 'cold_times/page_load_time'
    };
    var result = group_report.getTestPathAndSelectedSeries(alert);
    assert.equal(result.length, 2);
    assert.equal(
        result[0],
        'ChromiumPerf/chromium-rel-mac/page_cycler.morejs/cold_times');
    assert.deepEqual(result[1], ['page_load_time', 'page_load_time_ref']);
  }, testOptions);

});
</script>

redpajama_set_name: RedPajamaGithub


text:
package beans;

import java.io.IOException;

import junit.framework.Assert;

import org.jdal.util.Serializer;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * Test Serializable Proxies.
 *
 * @author Jose Luis Martin
 * @since 2.0
 */
 @RunWith(SpringJUnit4ClassRunner.class)
 @ContextConfiguration("serializable.xml")
public class SerializableTest {

	 @Autowired
	 private SerializableBean sbean;

	 /**
	  * Test if @Serializable can apply on transactional proxies
	  */
	 @Test
	 public void testTransactionalProxy() throws IOException {
		 System.out.println(sbean.getTransactionalBean().toString());
		 byte[] bytes = Serializer.serialize(sbean);
		 SerializableBean deserialized = (SerializableBean) Serializer.deSerialize(bytes);
		 Assert.assertNotNull(deserialized.getTransactionalBean());
	 }

}


text:
from .MainMenu import MainMenu
from .SetupGame import SetupGame
from .PlayGame import PlayGame
from .GameCompleted import GameCompleted


text:
layout: page
title : Projects
permalink: /projects/
order: 4
---

 Coming Soon!


text:
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.Logging;
using Moq;
using NBitcoin;
using Stratis.Bitcoin.Base;
using Stratis.Bitcoin.Base.Deployments;
using Stratis.Bitcoin.Configuration;
using Stratis.Bitcoin.Configuration.Logging;
using Stratis.Bitcoin.Configuration.Settings;
using Stratis.Bitcoin.Consensus;
using Stratis.Bitcoin.Consensus.Rules;
using Stratis.Bitcoin.Features.Consensus.CoinViews;
using Stratis.Bitcoin.Features.PoA.Voting;
using Stratis.Bitcoin.Signals;
using Stratis.Bitcoin.Tests.Common;
using Stratis.Bitcoin.Utilities;

namespace Stratis.Bitcoin.Features.PoA.Tests
{
    public class PoATestsBase
    {
        protected readonly ChainedHeader currentHeader;
        protected readonly TestPoANetwork network;
        protected readonly PoAConsensusOptions consensusOptions;

        protected PoAConsensusRuleEngine rulesEngine;
        protected readonly LoggerFactory loggerFactory;
        protected readonly PoABlockHeaderValidator poaHeaderValidator;
        protected readonly SlotsManager slotsManager;
        protected readonly ConsensusSettings consensusSettings;
        protected readonly ConcurrentChain chain;
        protected readonly FederationManager federationManager;
        protected readonly VotingManager votingManager;
        protected readonly Mock<IPollResultExecutor> resultExecutorMock;
        protected readonly ISignals signals;
        protected readonly DBreezeSerializer dBreezeSerializer;
        protected readonly ChainState chainState;

        public PoATestsBase(TestPoANetwork network = null)
        {
            this.signals = new Signals.Signals();
            this.loggerFactory = new LoggerFactory();
            this.network = network == null ? new TestPoANetwork() : network;
            this.consensusOptions = this.network.ConsensusOptions;
            this.dBreezeSerializer = new DBreezeSerializer(this.network);

            this.chain = new ConcurrentChain(this.network);
            IDateTimeProvider timeProvider = new DateTimeProvider();
            this.consensusSettings = new ConsensusSettings(NodeSettings.Default(this.network));

            this.federationManager = CreateFederationManager(this, this.network, this.loggerFactory);
            this.slotsManager = new SlotsManager(this.network, this.federationManager, this.loggerFactory);

            this.poaHeaderValidator = new PoABlockHeaderValidator(this.loggerFactory);

            var dataFolder = new DataFolder(TestBase.CreateTestDir(this));
            var finalizedBlockRepo = new FinalizedBlockInfoRepository(new KeyValueRepository(dataFolder, this.dBreezeSerializer), this.loggerFactory);
            finalizedBlockRepo.LoadFinalizedBlockInfoAsync(this.network).GetAwaiter().GetResult();

            this.resultExecutorMock = new Mock<IPollResultExecutor>();

            this.votingManager = new VotingManager(this.federationManager, this.loggerFactory, this.slotsManager, this.resultExecutorMock.Object, new NodeStats(timeProvider),
                 dataFolder, this.dBreezeSerializer, this.signals, finalizedBlockRepo);

            this.votingManager.Initialize();

            this.chainState = new ChainState();

            this.rulesEngine = new PoAConsensusRuleEngine(this.network, this.loggerFactory, new DateTimeProvider(), this.chain, new NodeDeployments(this.network, this.chain),
                this.consensusSettings, new Checkpoints(this.network, this.consensusSettings), new Mock<ICoinView>().Object, this.chainState, new InvalidBlockHashStore(timeProvider),
                new NodeStats(timeProvider), this.slotsManager, this.poaHeaderValidator, this.votingManager, this.federationManager);

            List<ChainedHeader> headers = ChainedHeadersHelper.CreateConsecutiveHeaders(50, null, false, null, this.network);

            this.currentHeader = headers.Last();
        }

        public static FederationManager CreateFederationManager(object caller, Network network, LoggerFactory loggerFactory)
        {
            string dir = TestBase.CreateTestDir(caller);
            var keyValueRepo = new KeyValueRepository(dir, new DBreezeSerializer(network));

            var settings = new NodeSettings(network, args: new string[] { $"-datadir={dir}" });
            var federationManager = new FederationManager(settings, network, loggerFactory, keyValueRepo);
            federationManager.Initialize();

            return federationManager;
        }

        public static FederationManager CreateFederationManager(object caller)
        {
            return CreateFederationManager(caller, new TestPoANetwork(), new ExtendedLoggerFactory());
        }

        public void InitRule(ConsensusRuleBase rule)
        {
            rule.Parent = this.rulesEngine;
            rule.Logger = this.loggerFactory.CreateLogger(rule.GetType().FullName);
            rule.Initialize();
        }
    }

    public class TestPoANetwork : PoANetwork
    {
        public TestPoANetwork(List<PubKey> pubKeysOverride = null)
        {
            var federationPublicKeys = new List<PubKey>()
            {
                new PubKey("02d485fc5ae101c2780ff5e1f0cb92dd907053266f7cf3388eb22c5a4bd266ca2e"),
                new PubKey("026ed3f57de73956219b85ef1e91b3b93719e2645f6e804da4b3d1556b44a477ef"),
                new PubKey("03895a5ba998896e688b7d46dd424809b0362d61914e1432e265d9539fe0c3cac0"),
                new PubKey("020fc3b6ac4128482268d96f3bd911d0d0bf8677b808eaacd39ecdcec3af66db34"),
                new PubKey("038d196fc2e60d6dfc533c6a905ba1f9092309762d8ebde4407d209e37a820e462"),
                new PubKey("0358711f76435a508d98a9dee2a7e160fed5b214d97e65ea442f8f1265d09e6b55")
            };

            if (pubKeysOverride != null)
                federationPublicKeys = pubKeysOverride;

            var baseOptions = this.Consensus.Options as PoAConsensusOptions;

            this.Consensus.Options = new PoAConsensusOptions(
                maxBlockBaseSize: baseOptions.MaxBlockBaseSize,
                maxStandardVersion: baseOptions.MaxStandardVersion,
                maxStandardTxWeight: baseOptions.MaxStandardTxWeight,
                maxBlockSigopsCost: baseOptions.MaxBlockSigopsCost,
                maxStandardTxSigopsCost: baseOptions.MaxStandardTxSigopsCost,
                federationPublicKeys: federationPublicKeys,
                targetSpacingSeconds: 60,
                votingEnabled: baseOptions.VotingEnabled
            );

            this.Consensus.SetPrivatePropertyValue(nameof(this.Consensus.MaxReorgLength), (uint)5);
        }
    }
}


text:
package org.openqa.selenium.remote.session;

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSortedMap;
import com.google.common.collect.Ordering;

import java.util.Map;
import java.util.Objects;
import java.util.TreeMap;
import java.util.function.Supplier;
import java.util.stream.Collectors;

public class ChromeFilter implements CapabilitiesFilter {
  @Override
  public Map<String, Object> apply(Map<String, Object> unmodifiedCaps) {
    Map<String, Object> caps = unmodifiedCaps.entrySet().parallelStream()
        .filter(
            entry ->
                ("browserName".equals(entry.getKey()) && "chrome".equals(entry.getValue())) ||
                entry.getKey().startsWith("goog:") ||
                "chromeOptions".equals(entry.getKey()))
        .filter(entry -> Objects.nonNull(entry.getValue()))
        .distinct()
        .collect(Collectors.toMap(
            Map.Entry::getKey,
            Map.Entry::getValue,
            (l, r) -> r,
            TreeMap::new));

    // We may need to map the chromeoptions to the new form
    if (caps.containsKey("chromeOptions") && !caps.containsKey("goog:chromeOptions")) {
      caps.put("goog:chromeOptions", caps.get("chromeOptions"));
    }

    return caps.isEmpty() ? null : caps;
  }

}


text:
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Imaging;
using System.Windows.Forms;

namespace MakarovDev.ExpandCollapsePanel
{
    /// <summary>
    /// Button with two states: expanded/collapsed
    /// </summary>
    public partial class ExpandCollapseButton : UserControl
    {
        /// <summary>
        /// Image displays expanded state of button
        /// </summary>
        private Image _expanded;
        /// <summary>
        /// Image displays collapsed state of button
        /// </summary>
        private Image _collapsed;

        /// <summary>
        /// Set flag for expand or collapse button
        /// (true - expanded, false - collapsed)
        /// </summary>
        private bool _isExpanded;

        /// <summary>
        /// Set flag for expand or collapse button
        /// (true - expanded, false - collapsed)
        /// </summary>
        [Browsable(true)]
        [Category("ExpandCollapseButton")]
        [Description("Expand or collapse button.")]
        [DefaultValue(true)]
        public bool IsExpanded
        {
            get { return _isExpanded; }
            set
            {
                _isExpanded = value;
                OnExpandCollapse();
            }
        }

        /// <summary>
        /// Header
        /// </summary>
        [Category("ExpandCollapseButton")]
        [Description("Header")]
        [Browsable(true)]
        public override string Text
        {
            get
            {
                return lblHeader.Text;
            }
            set
            {
                lblHeader.Text = value;
            }
        }

        /// <summary>
        /// Font used for displays header text
        /// </summary>
        public override Font Font
        {
            get
            {
                return lblHeader.Font;
            }
            set
            {
                lblHeader.Font = value;
            }
        }

        /// <summary>
        /// Foreground color used for displays header text
        /// </summary>
        public override Color ForeColor
        {
            get
            {
                return lblHeader.ForeColor;
            }
            set
            {
                lblHeader.ForeColor = value;
            }
        }

        /// <summary>
        /// Occurs when the button has expanded or collapsed
        /// </summary>
        [Category("ExpandCollapseButton")]
        [Description("Occurs when the button has expanded or collapsed.")]
        [Browsable(true)]
        public event EventHandler<ExpandCollapseEventArgs> ExpandCollapse;

        public ExpandCollapseButton()
        {
            InitializeComponent();

            #region initialize expanded/collapsed state bitmaps:
            InitButtonStyle(ExpandButtonStyle.Circle);
            InitButtonSize(ExpandButtonSize.Small);
            #endregion

            // initial state of panel - collapsed
            _isExpanded = true;
        }

        #region ExpandButtonStyles
        /// <summary>
        /// Visual styles of the expand-collapse button.
        /// </summary>
        public enum ExpandButtonStyle
        {
            Classic,
            Circle,
            MagicArrow,
            Triangle,
            FatArrow
        }

        private ExpandButtonStyle _expandButtonStyle = ExpandButtonStyle.Circle;

        /// <summary>
        /// Visual style of the expand-collapse button.
        /// </summary>
        [Category("ExpandCollapseButton")]
        [Description("Visual style of the expand-collapse button.")]
        [Browsable(true)]
        public ExpandButtonStyle ButtonStyle
        {
            get { return _expandButtonStyle; }
            set
            {
                if (_expandButtonStyle != value)
                {
                    InitButtonStyle(value);
                }
            }
        }

        private void InitButtonStyle(ExpandButtonStyle style)
        {
            _expandButtonStyle = style;

            switch (_expandButtonStyle)
            {
                case ExpandButtonStyle.MagicArrow:
                    var bmp = Properties.Resources.Upload;
                    bmp.RotateFlip(RotateFlipType.Rotate180FlipNone);
                    pictureBox1.Image = bmp;
                    break;
                case ExpandButtonStyle.Circle:
                    bmp = Properties.Resources.icon_expand;
                    pictureBox1.Image = bmp;
                    break;
                case ExpandButtonStyle.Triangle:
                    pictureBox1.Image = Properties.Resources._1downarrow1;
                    break;
                case ExpandButtonStyle.FatArrow:
                    bmp = Properties.Resources.up_256;
                    bmp.RotateFlip(RotateFlipType.Rotate180FlipNone);
                    pictureBox1.Image = bmp;
                    break;
                case ExpandButtonStyle.Classic:
                    bmp = Properties.Resources.icon_struct_hide_collapsed;
                    bmp.RotateFlip(RotateFlipType.Rotate180FlipNone);
                    pictureBox1.Image = bmp;
                    break;
                default:
                    throw new ArgumentOutOfRangeException("style");
            }

            // collapsed bitmap:
            _collapsed = pictureBox1.Image;

            // expanded bitmap is rotated collapsed bitmap:
            _expanded = MakeGrayscale3(pictureBox1.Image);
            _expanded.RotateFlip(RotateFlipType.Rotate180FlipNone);

            // finally set appropriate bitmap for current state
            pictureBox1.Image = _isExpanded ? _expanded : _collapsed;
        }
        #endregion ExpandButtonStyles

        #region ExpandButtonSizes
        /// <summary>
        /// Size presets of the expand-collapse button.
        /// </summary>
        public enum ExpandButtonSize
        {
            Small,
            Normal,
            Large
        }
        private ExpandButtonSize _expandButtonSize = ExpandButtonSize.Small;

        /// <summary>
        /// Size preset of the expand-collapse button.
        /// </summary>
        [Category("ExpandCollapseButton")]
        [Description("Size preset of the expand-collapse button.")]
        [Browsable(true)]
        [DefaultValue(ExpandButtonSize.Small)]
        public ExpandButtonSize ButtonSize
        {
            get { return _expandButtonSize; }
            set
            {
                if (_expandButtonSize != value)
                {
                    InitButtonSize(value);
                }
            }
        }

        /// <summary>
        /// Resize and arrange child controls according to ButtonSize preset
        /// </summary>
        /// <param name="size">ButtonSize preset</param>
        private void InitButtonSize(ExpandButtonSize size)
        {
            _expandButtonSize = size;

            switch (_expandButtonSize)
            {
                case ExpandButtonSize.Small:
                    pictureBox1.Location = new Point(0, 3);
                    pictureBox1.Size = new Size(16, 16);
                    lblLine.Location = new Point(20, 18);
                    lblHeader.Location = new Point(20, 1);
                    break;
                case ExpandButtonSize.Normal:
                    pictureBox1.Location = new Point(0, 3);
                    pictureBox1.Size = new Size(24, 24);
                    lblLine.Location = new Point(30, 22);
                    lblHeader.Location = new Point(30, 3);
                    break;
                case ExpandButtonSize.Large:
                    pictureBox1.Location = new Point(0, 3);
                    pictureBox1.Size = new Size(35, 35);
                    lblLine.Location = new Point(41, 28);
                    lblHeader.Location = new Point(41, 3);
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }

            // after resize all child controls - do resize for entire ExpandCollapseButton control:
            Height = pictureBox1.Location.Y + pictureBox1.Height + 2;
        }
        #endregion ExpandButtonSizes

        /// <summary>
        /// Handle clicks from PictureBox and Header
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected virtual void OnMouseDown(object sender, EventArgs e)
        {
            // just invert current state
            IsExpanded = !IsExpanded;
        }

        /// <summary>
        /// Handle state changing
        /// </summary>
        protected virtual void OnExpandCollapse()
        {
            // set appropriate bitmap
            pictureBox1.Image = _isExpanded ? _expanded : _collapsed;
            //lblHeader.ForeColor = _isExpanded ? Color.DarkGray : Color.SteelBlue;

            // and fire the event:
            EventHandler<ExpandCollapseEventArgs> handler = ExpandCollapse;
            if (handler != null)
                handler(this, new ExpandCollapseEventArgs(_isExpanded));
        }

        /// <summary>
        /// Utillity method for createing a grayscale copy of image
        /// </summary>
        /// <param name="original">original image</param>
        /// <returns>grayscale copy of image</returns>
        public static Bitmap MakeGrayscale3(Image original)
        {
            // create a blank bitmap the same size as original
            var newBitmap = new Bitmap(original.Width, original.Height);

            // get a graphics object from the new image
            using (var g = Graphics.FromImage(newBitmap))
            {

                // create the grayscale ColorMatrix
                var colorMatrix = new ColorMatrix(
                    new float[][]
                        {
                            new float[] {.3f, .3f, .3f, 0, 0},
                            new float[] {.59f, .59f, .59f, 0, 0},
                            new float[] {.11f, .11f, .11f, 0, 0},
                            new float[] {0, 0, 0, 1, 0},
                            new float[] {0, 0, 0, 0, 1}
                        });

                // create some image attributes
                var attributes = new ImageAttributes();

                // set the color matrix attribute
                attributes.SetColorMatrix(colorMatrix);

                // draw the original image on the new image
                // using the grayscale color matrix
                g.DrawImage(original, new Rectangle(0, 0, original.Width, original.Height),
                            0, 0, original.Width, original.Height, GraphicsUnit.Pixel, attributes);

                // dispose the Graphics object
                g.Dispose();
            }

            return newBitmap;
        }
    }
}


text:
"""
The API basically only provides one class. You can create a :class:`Script` and
use its methods.

Additionally you can add a debug function with :func:`set_debug_function`.
Alternatively, if you don't need a custom function and are happy with printing
debug messages to stdout, simply call :func:`set_debug_function` without
arguments.

.. warning:: Please, note that Jedi is **not thread safe**.
"""
import os
import warnings
import sys

from jedi._compatibility import unicode
from jedi.parser import load_grammar
from jedi.parser import tree
from jedi.parser.fast import FastParser
from jedi.parser.utils import save_parser
from jedi import debug
from jedi import settings
from jedi import common
from jedi import cache
from jedi.api import classes
from jedi.api import interpreter
from jedi.api import usages
from jedi.api import helpers
from jedi.api.completion import Completion
from jedi.evaluate import Evaluator
from jedi.evaluate import representation as er
from jedi.evaluate import imports
from jedi.evaluate.param import try_iter_content
from jedi.evaluate.helpers import get_module_names
from jedi.evaluate.sys_path import get_venv_path
from jedi.evaluate.iterable import unpack_tuple_to_dict

# Jedi uses lots and lots of recursion. By setting this a little bit higher, we
# can remove some "maximum recursion depth" errors.
sys.setrecursionlimit(2000)

class NotFoundError(Exception):
    """A custom error to avoid catching the wrong exceptions.

    .. deprecated:: 0.9.0
       Not in use anymore, Jedi just returns no goto result if you're not on a
       valid name.
    .. todo:: Remove!
    """

class Script(object):
    """
    A Script is the base for completions, goto or whatever you want to do with
    |jedi|.

    You can either use the ``source`` parameter or ``path`` to read a file.
    Usually you're going to want to use both of them (in an editor).

    The script might be analyzed in a different ``sys.path`` than |jedi|:

    - if `sys_path` parameter is not ``None``, it will be used as ``sys.path``
      for the script;

    - if `sys_path` parameter is ``None`` and ``VIRTUAL_ENV`` environment
      variable is defined, ``sys.path`` for the specified environment will be
      guessed (see :func:`jedi.evaluate.sys_path.get_venv_path`) and used for
      the script;

    - otherwise ``sys.path`` will match that of |jedi|.

    :param source: The source code of the current file, separated by newlines.
    :type source: str
    :param line: The line to perform actions on (starting with 1).
    :type line: int
    :param column: The column of the cursor (starting with 0).
    :type column: int
    :param path: The path of the file in the file system, or ``''`` if
        it hasn't been saved yet.
    :type path: str or None
    :param encoding: The encoding of ``source``, if it is not a
        ``unicode`` object (default ``'utf-8'``).
    :type encoding: str
    :param source_encoding: The encoding of ``source``, if it is not a
        ``unicode`` object (default ``'utf-8'``).
    :type encoding: str
    :param sys_path: ``sys.path`` to use during analysis of the script
    :type sys_path: list

    """
    def __init__(self, source=None, line=None, column=None, path=None,
                 encoding='utf-8', source_path=None, source_encoding=None,
                 sys_path=None):
        if source_path is not None:
            warnings.warn("Use path instead of source_path.", DeprecationWarning)
            path = source_path
        if source_encoding is not None:
            warnings.warn("Use encoding instead of source_encoding.", DeprecationWarning)
            encoding = source_encoding

        self._orig_path = path
        # An empty path (also empty string) should always result in no path.
        self.path = os.path.abspath(path) if path else None

        if source is None:
            # TODO add a better warning than the traceback!
            with open(path, 'rb') as f:
                source = f.read()

        self._source = common.source_to_unicode(source, encoding)
        self._code_lines = common.splitlines(self._source)
        line = max(len(self._code_lines), 1) if line is None else line
        if not (0 < line <= len(self._code_lines)):
            raise ValueError('`line` parameter is not in a valid range.')

        line_len = len(self._code_lines[line - 1])
        column = line_len if column is None else column
        if not (0 <= column <= line_len):
            raise ValueError('`column` parameter is not in a valid range.')
        self._pos = line, column
        self._path = path

        cache.clear_time_caches()
        debug.reset_time()
        self._grammar = load_grammar(version='%s.%s' % sys.version_info[:2])
        if sys_path is None:
            venv = os.getenv('VIRTUAL_ENV')
            if venv:
                sys_path = list(get_venv_path(venv))
        self._evaluator = Evaluator(self._grammar, sys_path=sys_path)
        debug.speed('init')

    def _get_module(self):
        cache.invalidate_star_import_cache(self._path)
        parser = FastParser(self._grammar, self._source, self.path)
        save_parser(self.path, parser, pickling=False)

        module = self._evaluator.wrap(parser.module)
        imports.add_module(self._evaluator, unicode(module.name), module)
        return parser.module

    @property
    def source_path(self):
        """
        .. deprecated:: 0.7.0
           Use :attr:`.path` instead.
        .. todo:: Remove!
        """
        warnings.warn("Use path instead of source_path.", DeprecationWarning)
        return self.path

    def __repr__(self):
        return '<%s: %s>' % (self.__class__.__name__, repr(self._orig_path))

    def completions(self):
        """
        Return :class:`classes.Completion` objects. Those objects contain
        information about the completions, more than just names.

        :return: Completion objects, sorted by name and __ comes last.
        :rtype: list of :class:`classes.Completion`
        """
        debug.speed('completions start')
        completion = Completion(
            self._evaluator, self._get_module(), self._code_lines,
            self._pos, self.call_signatures
        )
        completions = completion.completions()
        debug.speed('completions end')
        return completions

    def goto_definitions(self):
        """
        Return the definitions of a the path under the cursor.  goto function!
        This follows complicated paths and returns the end, not the first
        definition. The big difference between :meth:`goto_assignments` and
        :meth:`goto_definitions` is that :meth:`goto_assignments` doesn't
        follow imports and statements. Multiple objects may be returned,
        because Python itself is a dynamic language, which means depending on
        an option you can have two different versions of a function.

        :rtype: list of :class:`classes.Definition`
        """
        leaf = self._get_module().name_for_position(self._pos)
        if leaf is None:
            leaf = self._get_module().get_leaf_for_position(self._pos)
            if leaf is None:
                return []
        definitions = helpers.evaluate_goto_definition(self._evaluator, leaf)

        names = [s.name for s in definitions]
        defs = [classes.Definition(self._evaluator, name) for name in names]
        # The additional set here allows the definitions to become unique in an
        # API sense. In the internals we want to separate more things than in
        # the API.
        return helpers.sorted_definitions(set(defs))

    def goto_assignments(self, follow_imports=False):
        """
        Return the first definition found, while optionally following imports.
        Multiple objects may be returned, because Python itself is a
        dynamic language, which means depending on an option you can have two
        different versions of a function.

        :rtype: list of :class:`classes.Definition`
        """
        def filter_follow_imports(names):
            for name in names:
                definition = name.get_definition()
                if definition.type in ('import_name', 'import_from'):
                    imp = imports.ImportWrapper(self._evaluator, name)
                    for name in filter_follow_imports(imp.follow(is_goto=True)):
                        yield name
                else:
                    yield name

        names = self._goto()
        if follow_imports:
            names = filter_follow_imports(names)

        defs = [classes.Definition(self._evaluator, d) for d in set(names)]
        return helpers.sorted_definitions(defs)

    def _goto(self):
        """
        Used for goto_assignments and usages.
        """
        name = self._get_module().name_for_position(self._pos)
        if name is None:
            return []
        return list(self._evaluator.goto(name))

    def usages(self, additional_module_paths=()):
        """
        Return :class:`classes.Definition` objects, which contain all
        names that point to the definition of the name under the cursor. This
        is very useful for refactoring (renaming), or to show all usages of a
        variable.

        .. todo:: Implement additional_module_paths

        :rtype: list of :class:`classes.Definition`
        """
        temp, settings.dynamic_flow_information = \
            settings.dynamic_flow_information, False
        try:
            user_stmt = self._get_module().get_statement_for_position(self._pos)
            definitions = self._goto()
            if not definitions and isinstance(user_stmt, tree.Import):
                # For not defined imports (goto doesn't find something, we take
                # the name as a definition. This is enough, because every name
                # points to it.
                name = user_stmt.name_for_position(self._pos)
                if name is None:
                    # Must be syntax
                    return []
                definitions = [name]

            if not definitions:
                # Without a definition for a name we cannot find references.
                return []

            if not isinstance(user_stmt, tree.Import):
                # import case is looked at with add_import_name option
                definitions = usages.usages_add_import_modules(self._evaluator,
                                                               definitions)

            module = set([d.get_parent_until() for d in definitions])
            module.add(self._get_module())
            names = usages.usages(self._evaluator, definitions, module)

            for d in set(definitions):
                names.append(classes.Definition(self._evaluator, d))
        finally:
            settings.dynamic_flow_information = temp

        return helpers.sorted_definitions(set(names))

    def call_signatures(self):
        """
        Return the function object of the call you're currently in.

        E.g. if the cursor is here::

            abs(# <-- cursor is here

        This would return the ``abs`` function. On the other hand::

            abs()# <-- cursor is here

        This would return an empty list..

        :rtype: list of :class:`classes.CallSignature`
        """
        call_signature_details = \
            helpers.get_call_signature_details(self._get_module(), self._pos)
        if call_signature_details is None:
            return []

        with common.scale_speed_settings(settings.scale_call_signatures):
            definitions = helpers.cache_call_signatures(
                self._evaluator,
                call_signature_details.bracket_leaf,
                self._code_lines,
                self._pos
            )
        debug.speed('func_call followed')

        return [classes.CallSignature(self._evaluator, d.name,
                                      call_signature_details.bracket_leaf.start_pos,
                                      call_signature_details.call_index,
                                      call_signature_details.keyword_name_str)
                for d in definitions if hasattr(d, 'py__call__')]

    def _analysis(self):
        self._evaluator.is_analysis = True
        self._evaluator.analysis_modules = [self._get_module()]
        try:
            for node in self._get_module().nodes_to_execute():
                if node.type in ('funcdef', 'classdef'):
                    if node.type == 'classdef':
                        continue
                        raise NotImplementedError
                    er.Function(self._evaluator, node).get_decorated_func()
                elif isinstance(node, tree.Import):
                    import_names = set(node.get_defined_names())
                    if node.is_nested():
                        import_names |= set(path[-1] for path in node.paths())
                    for n in import_names:
                        imports.ImportWrapper(self._evaluator, n).follow()
                elif node.type == 'expr_stmt':
                    types = self._evaluator.eval_element(node)
                    for testlist in node.children[:-1:2]:
                        # Iterate tuples.
                        unpack_tuple_to_dict(self._evaluator, types, testlist)
                else:
                    try_iter_content(self._evaluator.goto_definitions(node))
                self._evaluator.reset_recursion_limitations()

            ana = [a for a in self._evaluator.analysis if self.path == a.path]
            return sorted(set(ana), key=lambda x: x.line)
        finally:
            self._evaluator.is_analysis = False

class Interpreter(Script):
    """
    Jedi API for Python REPLs.

    In addition to completion of simple attribute access, Jedi
    supports code completion based on static code analysis.
    Jedi can complete attributes of object which is not initialized
    yet.

    >>> from os.path import join
    >>> namespace = locals()
    >>> script = Interpreter('join("").up', [namespace])
    >>> print(script.completions()[0].name)
    upper
    """

    def __init__(self, source, namespaces, **kwds):
        """
        Parse `source` and mixin interpreted Python objects from `namespaces`.

        :type source: str
        :arg  source: Code to parse.
        :type namespaces: list of dict
        :arg  namespaces: a list of namespace dictionaries such as the one
                          returned by :func:`locals`.

        Other optional arguments are same as the ones for :class:`Script`.
        If `line` and `column` are None, they are assumed be at the end of
        `source`.
        """
        try:
            namespaces = [dict(n) for n in namespaces]
        except Exception:
            raise TypeError("namespaces must be a non-empty list of dicts.")

        super(Interpreter, self).__init__(source, **kwds)
        self.namespaces = namespaces

        parser_module = super(Interpreter, self)._get_module()
        self._module = interpreter.MixedModule(self._evaluator, parser_module, self.namespaces)

    def _get_module(self):
        return self._module

def defined_names(source, path=None, encoding='utf-8'):
    """
    Get all definitions in `source` sorted by its position.

    This functions can be used for listing functions, classes and
    data defined in a file.  This can be useful if you want to list
    them in "sidebar".  Each element in the returned list also has
    `defined_names` method which can be used to get sub-definitions
    (e.g., methods in class).

    :rtype: list of classes.Definition

    .. deprecated:: 0.9.0
       Use :func:`names` instead.
    .. todo:: Remove!
    """
    warnings.warn("Use call_signatures instead.", DeprecationWarning)
    return names(source, path, encoding)

def names(source=None, path=None, encoding='utf-8', all_scopes=False,
          definitions=True, references=False):
    """
    Returns a list of `Definition` objects, containing name parts.
    This means you can call ``Definition.goto_assignments()`` and get the
    reference of a name.
    The parameters are the same as in :py:class:`Script`, except or the
    following ones:

    :param all_scopes: If True lists the names of all scopes instead of only
        the module namespace.
    :param definitions: If True lists the names that have been defined by a
        class, function or a statement (``a = b`` returns ``a``).
    :param references: If True lists all the names that are not listed by
        ``definitions=True``. E.g. ``a = b`` returns ``b``.
    """
    def def_ref_filter(_def):
        is_def = _def.is_definition()
        return definitions and is_def or references and not is_def

    # Set line/column to a random position, because they don't matter.
    script = Script(source, line=1, column=0, path=path, encoding=encoding)
    defs = [classes.Definition(script._evaluator, name_part)
            for name_part in get_module_names(script._get_module(), all_scopes)]
    return sorted(filter(def_ref_filter, defs), key=lambda x: (x.line, x.column))

def preload_module(*modules):
    """
    Preloading modules tells Jedi to load a module now, instead of lazy parsing
    of modules. Usful for IDEs, to control which modules to load on startup.

    :param modules: different module names, list of string.
    """
    for m in modules:
        s = "import %s as x; x." % m
        Script(s, 1, len(s), None).completions()

def set_debug_function(func_cb=debug.print_to_stdout, warnings=True,
                       notices=True, speed=True):
    """
    Define a callback debug function to get all the debug messages.

    If you don't specify any arguments, debug messages will be printed to stdout.

    :param func_cb: The callback function for debug messages, with n params.
    """
    debug.debug_function = func_cb
    debug.enable_warning = warnings
    debug.enable_notice = notices
    debug.enable_speed = speed


text:
'use strict'

/**
 * Module dependencies.
 */

const EventEmitter = require('events').EventEmitter
const debug = require('debug')('koa-generic-session:store')
const copy = require('copy-to')

const defaultOptions = {
  prefix: 'koa:sess:'
}

class Store extends EventEmitter {
  constructor(client, options) {
    super()
    this.client = client
    this.options = options
    copy(options).and(defaultOptions).to(this.options)

    // delegate client connect / disconnect event
    if (typeof client.on === 'function') {
      client.on('disconnect', this.emit.bind(this, 'disconnect'))
      client.on('connect', this.emit.bind(this, 'connect'))
    }
  }

  async get(sid) {
    sid = this.options.prefix + sid
    debug('GET %s', sid)
    const data = await this.client.get(sid)
    if (!data) {
      debug('GET empty')
      return null
    }
    if (data && data.cookie && typeof data.cookie.expires === 'string') {
      // make sure data.cookie.expires is a Date
      data.cookie.expires = new Date(data.cookie.expires)
    }
    debug('GOT %j', data)
    return data
  }

  async set(sid, sess, ctx) {
    let ttl = this.options.ttl
    if (!ttl) {
      const maxAge = sess.cookie && sess.cookie.maxAge
      if (typeof maxAge === 'number') {
        ttl = maxAge
      }
      // if has cookie.expires, ignore cookie.maxAge
      if (sess.cookie && sess.cookie.expires) {
        ttl = Math.ceil(sess.cookie.expires.getTime() - Date.now())
      }
    }

    sid = this.options.prefix + sid
    debug('SET key: %s, value: %s, ttl: %d', sid, sess, ttl)
    await this.client.set(sid, sess, ttl, ctx)
    debug('SET complete')
  }

  async destroy(sid) {
    sid = this.options.prefix + sid
    debug('DEL %s', sid)
    await this.client.destroy(sid)
    debug('DEL %s complete', sid)
  }
}

module.exports = Store


text:
package com.magic.spi;

import com.magic.transfrom.TransfromTemplate;

/**
 * Created by magicdog on 2017/4/12.
 */
public interface Plugins {
    void setPluginContext(TransfromTemplate transfromTemplate);
}


text:
<?xml version="1.0" encoding="utf-8"?>
<Monster xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Name>dust vortex</Name>
  <Attack1>Engulf 2d8 blind</Attack1>
  <Difficulty>6</Difficulty>
  <BaseLevel>4</BaseLevel>
  <BaseExperience>54</BaseExperience>
  <Speed>20</Speed>
  <BaseAC>2</BaseAC>
  <BaseMR>30</BaseMR>
  <Alignment>0 (neutral)</Alignment>
  <Frequency>(by normal means) 2 (Quite rare)</Frequency>
  <GenoCidable>Yes</GenoCidable>
  <Weight>0</Weight>
  <NutritionalValue>0</NutritionalValue>
  <Size>Huge</Size>
  <Resistances>conveyed None</Resistances>
  <ResistancesConveyed>None</ResistancesConveyed>
  <Characteristics>
    <string>can fly. </string>
    <string>does not breathe. </string>
    <string>has no eyes. </string>
    <string>has no limbs. </string>
    <string>has no head. </string>
    <string>is mindless. </string>
    <string>does not eat. (*) </string>
    <string>is neither male nor female. </string>
    <string>is normally generated hostile. </string>
    <string>never leaves a corpse.</string>
  </Characteristics>
</Monster>


text:
package gov.samhsa.consent2share.infrastructure.eventlistener;

import gov.samhsa.consent2share.domain.account.Users;
import gov.samhsa.consent2share.domain.account.UsersRepository;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.event.AuthenticationSuccessEvent;
import org.springframework.stereotype.Component;

@Component("loginSuccessEventListener")
public class LoginSuccessEventListener extends EventListener{
	 @Autowired
	 UsersRepository usersRepository;

	@Override
	public boolean canHandle(Object event) {
		return event instanceof
				AuthenticationSuccessEvent;
	}

	@Override
	public void handle(Object event) {
		AuthenticationSuccessEvent loginSuccessEvent=(AuthenticationSuccessEvent)event;
		Object name = loginSuccessEvent.getAuthentication()
                .getPrincipal();
		if(name!=null){
			Users user=(Users)name;
			user.setFailedLoginAttemptsToZero();
			usersRepository.updateUser(user);
		}

	}

}


text:
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { SprkDividerDirective } from './sprk-divider.directive';

@NgModule({
  imports: [CommonModule],
  declarations: [SprkDividerDirective],
  exports: [SprkDividerDirective],
})
export class SprkDividerDirectiveModule {}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2009-2012 Ansgar Konermann
  ~
  ~ This file is part of the "Maven 3 Drools Support" Package.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>de.lightful.maven.drools.poms</groupId>
    <artifactId>knowledge-module</artifactId>
    <version>11</version>
  </parent>

  <groupId>de.lightful.maven.drools.plugin.its.test-artifacts</groupId>
  <artifactId>drools-fruit-types-5.4.0.Final</artifactId>
  <version>0.1.13-SNAPSHOT</version>
  <packaging>knowledge-module</packaging>

  <name>Maven Drools Support :: Plugin :: IT Artifacts :: Drools Fruit Types :: 5.4.0.Final</name>
  <description>A pre-compiled drools knowledge package containing fruit data types for 5.4.0.Final, used for integration testing</description>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <properties>
    <drools.runtime.version>5.4.0.Final</drools.runtime.version>
    <drools.plugin.version>0.3.1</drools.plugin.version>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>de.lightful.maven.plugins</groupId>
        <artifactId>maven-drools-plugin</artifactId>
        <configuration>
          <passes>
            <pass>
              <ruleSourceRoot>${basedir}/../src/main/rules/pass-one</ruleSourceRoot>
            </pass>
          </passes>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.drools</groupId>
            <artifactId>knowledge-api</artifactId>
            <version>[${drools.runtime.version}]</version>
          </dependency>
          <dependency>
            <groupId>org.drools</groupId>
            <artifactId>drools-core</artifactId>
            <version>[${drools.runtime.version}]</version>
          </dependency>
          <dependency>
            <groupId>org.drools</groupId>
            <artifactId>drools-compiler</artifactId>
            <version>[${drools.runtime.version}]</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>

</project>


text:
using Repsaj.Submerged.Common.SubscriptionSchema;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Repsaj.Submerged.Infrastructure.Repository
{
    public interface ISubscriptionRepository
    {
        /// <summary>
        /// Adds a subscription asynchronously.
        /// </summary>
        /// <param name="subscription">The subscription.</param>
        /// <returns></returns>
        Task<SubscriptionModel> AddSubscriptionAsync(SubscriptionModel subscription);

        /// <summary>
        /// Gets a subscription asynchronously.
        /// </summary>
        /// <param name="subscriptionId">The subscription identifier.</param>
        /// <returns></returns>
        Task<SubscriptionModel> GetSubscriptionAsync(Guid subscriptionId, string subscriptionUser);

        /// <summary>
        /// Gets a subscription asynchronously.
        /// </summary>
        /// <param name="subscriptionUser">The subscription user.</param>
        /// <returns></returns>
        Task<SubscriptionModel> GetSubscriptionAsync(string subscriptionUser);

        Task<SubscriptionModel> GetSubscriptionByDeviceId(string deviceId, string subscriptionUser, bool skipValidation = false);

        /// <summary>
        /// Updates a subscription asynchronously.
        /// </summary>
        /// <param name="subscription">The subscription.</param>
        /// <returns></returns>
        Task<SubscriptionModel> UpdateSubscriptionAsync(SubscriptionModel subscription, string subscriptionUser, bool skipValidation = false);

        Task<DeviceModel> GetDeviceAsync(string deviceId);

        /// <summary>
        /// Deletes a subscription asynchronously
        /// </summary>
        /// <param name="subscription"></param>
        /// <returns></returns>
        Task DeleteSubscriptionAsync(SubscriptionModel subscription);
    }
}


text:
import Ember from 'ember';
import BasicMetadata from '../core/basic-metadata';

/**
 * @class  TurnTeam
 * @namespace Turns
 */
export default Ember.Object.extend(BasicMetadata, {

  _type: Ember.computed(function() {
    return 'TurnTeam';
  }),

  color: null,

  teamRelationships: Ember.computed(function() { return Ember.A(); }),

  teamRelationshipsChanged: Ember.observer('teamRelationships.@each', function() {
    Ember.assert(this.get('teamRelationships').every(function(tr) {
      return tr.get('_type') === 'TurnTeamRelationship';
    }), 'turnTeam.teamRelationships must contain instances of TurnTeamRelationship');
  })

});


text:
OIIO::TypeDesc fromTypeDesc(TypeDesc fmt);
TypeDesc toTypeDesc(OIIO::TypeDesc fmt);

#endif


text:
package knot.net.config

import knot.core.config.Configs

object NetConfigs {

  /**
    * Config for tcp
    */
  lazy val tcp: TcpConfig = TcpConfig(Configs.knotConfig.getConfig("net.tcp"))

  /**
    * Config for http
    */
  lazy val http: HttpConfig = HttpConfig(Configs.knotConfig.getConfig("net.http"))
}


text:
i.headerbtn:hover {
    cursor: pointer;
}

i.headerbtn {
    font-size: 16px;
    position: relative;
    margin-left: -20px;
    padding-right: 5px;
    color: rgb(161, 161, 161);
    -webkit-transition: opacity 1s;
    transition: opacity 1s;
    opacity: 0;
}

h1:hover i.headerbtn,
h2:hover i.headerbtn,
h3:hover i.headerbtn{
    opacity: 1;
    visibility: visible;
}


text:
<!DOCTYPE html>
<title>
  Tests that the margin-bottom of the last flex item is taken into account
  when fragmenting.
</title>
<link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#pagination">
<link rel="match" href="../../reference/ref-filled-green-100px-square.xht">

Test passes if there is a filled green square and no red.


text:
  #define REND
void draw_parallax(GContext* ctx);
void draw_moving_platforms(GContext* ctx);
void layer_update_proc(Layer* layer, GContext* ctx);
void draw_2px_border_text(GContext* ctx, char* text, int x, int y, int fontType);
void draw_state_ui(GContext* ctx);
#endif


text:
<?php
/**
 *
 * @author Jeck Lamnent
 * @version 1.02
 * @GNU public dec 2007
 * modify it and change it as much as you'd like
 * I made it quickly for what I needed so its not optimized for a 15,000 charts per second server
 *

Examples after these quick field/function descriptions

The chart is displayed as an image. The style sheet class is class="googleChart"

If your new to using classes then look at the examples section.
For the below "var something;" entries, instance is a references to
the $blah variable in $blah=new googleChart();

Google charts require supplied data to be separated using commas and | pipes so I
keep the commas and pipes in check inside the functions. If things don't work
right then look at the examples so see what to do.

If the supplied data is negative numbers then set negativeMode=true and load the data using ->loadData();.

data/labels can be arrays or strings.
var $barWidth=null; 					//sets the width of the bars for vert/horiz bar charts.
	instance->barWidth=10;
var $negativeMode;						//Set to true if data is negative data
	instance->negativeMode=true;
var $dimensions;						//dimensions are width x height
	instance->dimensions='300x100';
var $colors; 							//colors are separated by commas
	instance->colors='8888ff,4444ff'; 	//used to colour charts, can be 1 or many colour sets separated by commas
var $legend; 							//legend items are separated by pipes
	instance->legend='Cows|Dogs|Buffalo';
var $title;								//title is plane text
	instance->title='My chart';
var $fillColor;							//colors don't have # preceeding them
	instance->fillcolor='76A4FB';
var $showGrid;							//if 1 tries to auto calc grid. If > 1 then show this many grid lines
	instance->showGrid=1;
	instance->showGrid=30;

f googleChart($data=null,$type=null,$title=null,$dimensions=null);
	-data is an array or a comma separated string.

f setLabels(string or array,string); default 'left'
	-sets labels on the chart, 2nd param is 'top' 'left' 'bottom' or 'right'

f draw(boolean,$append='&chxr.png'); default (true,'&chxr.png')
	-prints an img tag with the chart, if set to false, returns the chart url.
	-The value of $append is append to the chart url. By default it will append &chxr.png so the url is detected as an image

f smartDataLabel(array);
	-Adds a legend and data based on array keys
	$dat2=array(
		'cows'=>array(4,5,6,7,9),
		'dogs'=>array(6,1,4,2,6),
		'peas'=>array(5.4,9,1,6,2)
	);

f simpleDataMode()
	-for 0..61 different plottable values. Default options can plot 1000 values
f setLabelsMinMax(integer,string); default (3,'left')
	-
f setType(string) default ('line')
	-sets the type of chart (pie,pie3d,barx,bary,line)

******EXAMPLES******

BASIC CHART:
	$data=array('4,6,21,7,1,6,17,5,2,1,7,9'); //note arrays don't have | pipes in them
	$moo=new googleChart($data);
	$moo->draw();

CHART WITH LABEL:
	$moo= new googleChart('4,6,21,7,1,6,17,5,2,1,7,9');
	$moo->setLabels('june|july|aug','bottom');
	$moo->draw();

CHART BASIC WITH LABELS
	$chart1= new googleChart('4,1,6,8,1','pie','foods','300x200');
	$chart1->setLabels('cake|pie|muffins|cookies|icecream');
	$chart1->draw();

CHART WITH LABEL AND MIN/MAX VALUES ON RIGHT
	$moo= new googleChart('4,6,21,7,1,6,17,5,2,1,7,9');
	$moo->setLabelsMinMax(5,'right'); //call before other funcs that make labels
	$moo->setLabels('june|july|aug','bottom');
	$moo->draw();

PIE CHART WITH LABELS
	$data='4,23,65';
	$moo= new googleChart($data,'pie');
	$moo->setLabels('cows|dogs|peas');
	$moo->draw(true);

	//or an alternative to above 'pie' you can use $moo->setType('pie');

CHART WITH 3 DIFFERENT DATA SETS using smartDataLabel(), A LEGEND AND MINMAX LABELS
	$data=array(
		'cows'=>array(4,5,6,7,9),
		'dogs'=>array(6,1,4,2,6),
		'peas'=>array(5.4,9,1,6,2)
	);
	$moo= new googleChart();
	$moo->smartDataLabel($data);
	$moo->setLabelsMinMax(5,'left');
	$moo->draw(true);

CHART USING NEGATIVE NUMBERS
	$chart=new googleChart(null,$chartType); //don't load data yet
	$chart->negativeMode=true; //set negative mode first
	$chart->loadData($chartData); //then load data
	$chart->setLabelsMinMax();
	$chart->draw();

CHART WITH LOTS OF OPTIONS, data sets are supplied in a string
	$data='1,4,6,8,2|3,7,8,3,2';
	$chart1=new googleChart($data);
	$chart1->dimensions='400x125';
	$chart1->fillColor='76A4FB';
	$chart1->setLabelsMinMax();
	$chart1->legend='Ammount of cookies|Raisens';
	$chart1->setLabels('jan|feb|march|apr|may','bottom');
	$chart1->setLabels('+low|mid|top','left');
	$chart1->showGrid=1;
	$chart1->draw();

CHART USING NEGATIVE NUMBERS AND GRID
	$month='May';
	$daysInMonth=31;
	$chartDates='';
	for ($i=1;$i<=$daysInMonth;$i++) {
		if ($chartDates) $chartDates.='|';
		$chartDates.=$i;
	}
	$chartData='0,0,-109.9,0,0,0,-12310.58,-478.5,0,0,-473.38,0,0,0,-398,0,0,0,0,0,-134.6,-1513.1,0,0,-454.26,0,0,0,0,-1258.04,-2237.8';
	$chart=new googleChart(null,'line','Expenses','700x250');
	$chart->negativeMode=true; //values are negative
	$chart->loadData($chartData);
	$chart->barWidth=10; //makes bars thinner
	$chart->setLabelsMinMax();
	$chart->setLabels($chartDates,'bottom');
	$chart->setLabels($month,'bottom');
	$chart->showGrid=1;
	$chart->draw();

TO ADD A LEGEND MANUALLY:
$moo->legend='cows|dogs|carrots|rubber';

CHART WITH OTHER FUNCTIONS

To convert data to simple mode (for smaller data sets I guess. I don't see a purpose)
	$moo->simpleDataMode();

To changes some colors (you can supply more than needed)
	$moo->colors='8888ff,4444ff,670032';
*/

/**
 * Displays a visual data chart
 * $data can be an array of values from 0.0 to 100.0 or a comma separated string
 * Separate multiple data sets with |
 * Put -1 for any missing values
 * If the last parameter set is 'noreturn' then the chart is output as an image
 * EXAMPLE: googleChart('4,6,2.3,5|7,9.2,1,12','noreturn');
 *
 * @param string or array $data
 * @param string $type
 * @param string $label
 * @param string $dimensions
 */
class googleChart {

	var $url='http://chart.apis.google.com/chart?';
	var $simple = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; //simple data chart
	var $numericBase='t'; //'t' = numeric 0-1000 url data, 's' = simple 0..61 data
	var $dimensions='450x200';
	var $data=''; //array of 0.0 to 100.0 or comman separated string (use -1 for missing values)
	var $type='lc'; //type of chart
	var $title;	//chart's title
	var $legend=''; //data description legend
	var $labels=''; //for pie charts
	var $minMaxLabel=false; //is turned on via function
	var $lineLabels=''; //for non pie charts
	var $lineLabelAxis=''; //for non pie charts
	var $labelCount=0; //for non pie chart labels
	var $colors='0088ff,8800ff,4444ff'; //colors for multiple sets
	var $fillColor=''; //used to paint fill. hex rgb ('8054a1')
	var $showGrid=''; //if more than one data set it wiil auto create a grid, else will place (int)showGrid gridlines
	var $max=100; //is autoset when data is supplied
	var $min=0; //is autoset when data is supplied
	var $negativeMode=false; //negative mode converts numbers to positive so google can display them
	var $barWidth=null; //sets the width of the bars for vert/horiz bar charts.

	function __construct($data=null,$type=null,$title=null,$dimensions=null) {
		if ($data) $this->loadData($data);
		if ($type) $this->setType($type);
		if ($title) $this->title=$title;
		if ($dimensions) $this->dimensions=$dimensions;
	}

	/**
	 * Draw chart or return chart
	 *
	 * @param string_or_boolean $noReturn
	 * @return string
	 */
	function draw($noReturn=true,$append='&chxr.png') {
		//convert arrays
		if ($this->numericBase=='t') $this->normalDataMode();
		if (is_array($this->data)) $this->data=implode(',',$this->data);
		if (is_array($this->legend)) $this->legend=implode('|',$this->legend);
		//build chart url
		$return=$this->url.'chs='.$this->dimensions;
		$return.='&cht='.$this->type; //chart type
		if ($this->title) $return.='&chtt='.str_replace(' ','+',$this->title); //chart label
		if ($this->legend) $return.='&chdl='.$this->legend;
		if ($this->labels) $return.='&chl='.$this->labels;
		if ($this->barWidth) $return.='&chbh='.$this->barWidth;
		if ($this->minMaxLabel) {

		}
		if ($this->lineLabelAxis) {
			$this->lineLabelAxis=rtrim($this->lineLabelAxis,'|');
			$return.='&chxt='.$this->lineLabels.'&chxl='.$this->lineLabelAxis;
		}
		if ($this->fillColor) $return.='&chm=B,'.$this->fillColor.',0,0,0';
		if ($this->showGrid) {
			if (($gridx=$this->showGrid)==1) {
				$items=substr_count($this->data,',');
				$sets=substr_count($this->data,'|')+1;
				$items+=$sets;
				if ($sets>=1)
					$gridx=round($items/$sets);//get count of items per set
				else
					$gridx=0;
				if ($gridx==0) $gridx=$this->showGrid;
				if ($this->type=='lc') $gridx--;
			}
			if ($this->minMaxLabel)
				$gridy=round(100/($this->minMaxLabel));
			else
				$gridy=25;
			$return.='&chg='.(floor(10000/$gridx)/100).','.$gridy.',1';
		}
		$return.='&chco='.$this->colors;
		$return.='&chd='.$this->numericBase.':'.$this->data; //chart data
		$return.='&chxr=';
		if ($noReturn) echo ''; else return $return.$append;
	}

	/**
	 * Sets the type of chart
	 *
	 * @param unknown_type $type
	 */
	function setType($type) {
		switch ($type) {
			case 'barx': case 'bhg': $type='bhg';break; //horizontal bars
			case 'bary': case 'bvg': $type='bvg';break; //vertical bars
			case 'pie': case 'p':	$type='p';break; //pie chart
			case 'pie3d': case'p3':$type='p3';break; //3d pie chart
			case 'line': case 'lc': //line graph
			default: $type='lc';
		}
		$this->type=$type;
	}

	/**
	 * Put labels on the sides of the chart. This must be called first before any other labels
	 *
	 */
	function setLabelsMinMax($spread=3,$side='left') {
		$this->minMaxLabel=$spread-1;
		$this->setLabels('minmax',$side);
	}

	/**
	 * Put labels on the sides of the chart
	 *
	 * @param array or string $labels
	 * @param string(left,right,bottom,top) $side
	 */
	function setLabels($labels,$side='left') {
		if (is_array($labels)) $labels=implode('|',$labels);
		$labels=str_replace(' ','+',$labels);
		switch ($side) {
			case 'top':$type='t';break;
			case 'left':$type='y';break;
			case 'bottom':$type='x';break;
			case 'right':$type='r';break;
		}
		if ($this->type[0]=='p') { //for pie charts
			if ($labels=='minmax') { //for auto settings min/max range
				$this->labels='';
				$xLabel=round($this->max/$this->minMaxLabel);
				for ($i=0;$i++;$i<=$xLabel) {
					if ($this->labels) $this->labels.='|';
					$this->labels.=$xLabel*$i;
				}

			}
			else if ($this->labels) $this->labels.='|'; //do pie chart label
				$this->labels.=$labels;

		} else { //non pie charts
			if ($labels=='minmax') { //auto set min/max range
				$this->lineLabels='';
				$this->labels='';

				if($this->minMaxLabel == 0)
					$this->minMaxLabel = 1;

				$xLabel=round($this->max/$this->minMaxLabel);
				$this->lineLabels=$type; //set side to display on
				$this->lineLabelAxis='0:';
				if ($this->lineLabelAxis!='') $this->lineLabelAxis.='|';
				for ($i=0;$i<=($this->minMaxLabel);$i++) {

					$this->lineLabelAxis.=($xLabel*$i);
					$this->lineLabelAxis.='|';
				}
				$this->labelCount++;
			} else {
				if ($this->lineLabels) $this->lineLabels.=','; //don't separate if empty
				$this->lineLabels.=$type;
				$this->lineLabelAxis.=(string)$this->labelCount.':|'.$labels.'|';//strip trailing pipe in draw proc
				$this->labelCount++;
			}
		}
	}

	/**
	 * Is auto loaded, don't need to call this func
	 *
	 * @param string or array $data
	 */
	function loadData($data) {
		if (is_array($data)) $data=implode(',',$data);
		$this->data.=$data;
		//determine min/max
		$data=str_replace('|',',',$data);
		$data=explode(',',$data);
		if ($this->negativeMode)
			foreach ($data as &$datum)
				$datum=abs($datum);
		$this->max=max($data);
		$this->min=min($data);

	}

	/**
	 * Sets mode to Allow for 1000 different values. Is default. Don't need to call this func
	 *
	 */
	function normalDataMode() {
		$delta=$this->max/100; //convert to 0.0 to 100.0
		if ($delta==0) $delta=1; //stops div by 0
		$data=explode('|',$this->data);
		$newData='';
		foreach ($data as $datum) {
			$dataInner=explode(',',$datum);
			if($newData) $newData.='|';
			$innerData='';
			foreach ($dataInner as $item) {
				if ($item===-1) $val=$item; //missing val
				else if ($item===0) $val=(-1); //missing val
				else {
					if ($this->negativeMode) $item=abs($item);
					$val=round(($item*10) / $delta)/10;
					if ($val>100) $val=100; //limit val.
				}
				if($innerData != '') $innerData.=',';
				$innerData.=$val;
			}
			$newData.=$innerData;

		}echo '
';
		if ($newData) {
			$this->numericBase='t';//simple mode
			$this->data=$newData;
		}
	}

	/**
	 * Sets the chart mode to simple (62 different values. Only call this mode if data was already specified
	 *
	 */
	function simpleDataMode() { //values 0 to 61;
		$delta=$this->max/strlen($this->simple); //convert to 0..61
		if ($delta==0) $delta=1; //stops div by 0
		$data=explode('|',$this->data);
		$newData='';
		foreach ($data as $datum) {
			$dataInner=explode(',',$datum);
			if($newData) $newData.=',';
			foreach ($dataInner as $item) {
				if ($item==-1) $newData.='_'; //missing val
				elseif ($item===0) $newData.='_'; //missing val
				else {
					if ($this->negativeMode) $item=abs($item);
					$val=round(($item*10) / $delta)/10;
					if ($val>61) $val=61; //limit val.
					$newData.=$this->simple[$val];
				}
			}
		}
		if ($newData) {
			$this->numericBase='s';//set simple mode
			$this->data=$newData;
		}
	}

	function smartDataLabel($labelData) {
		$newData='';
		foreach ($labelData as $label => $data) {
			$this->legend.=str_replace(' ','+',$label).'|';
			$label=str_replace(' ','+',$label);
			if (is_array($data)) $this->data.=implode(',',$data).'|';
			else $this->data.=$data.'|';
		}
		$this->legend=rtrim($this->legend,'|'); //trim trailing pipe
		$this->loadData(rtrim($this->data,'|')); //load Data
	}

}

?>