text:
package main

import (
	"fmt"
	"log"
	"os"
)

func MakeConfigFile(auth hardCodedAuthority, count int) {
	countStr := fmt.Sprintf("%d", count)
	file, err := os.OpenFile("configs/"+countStr+".conf", os.O_RDWR|os.O_CREATE, 0666)
	if err != nil {
		log.Fatal(err)
	}

	str := getString(auth)
	file.WriteString(str)
	file.Close()
}

func getString(auth hardCodedAuthority) string {
	sec, pub := getKeysFromAuth(auth)
	str := `; ------------------------------------------------------------------------------
; App settings
; ------------------------------------------------------------------------------
[app]
PortNumber                            = 8088
HomeDir                               = "/home/factom/"
; --------------- ControlPanel disabled | readonly | readwrite
ControlPanelSetting                   = readonly
ControlPanelPort                      = 8090
; --------------- DBType: LDB | Bolt | Map
DBType                                = "LDB"
LdbPath                               = "database/ldb"
BoltDBPath                            = "database/bolt"
DataStorePath                         = "data/export"
DirectoryBlockInSeconds               = 6
ExportData                            = false
ExportDataSubpath                     = "database/export/"
; --------------- Network: MAIN | TEST | LOCAL
Network                               = LOCAL
PeersFile            = "peers.json"
MainNetworkPort      = 8108
MainSeedURL          = "https://raw.githubusercontent.com/FactomProject/factomproject.github.io/master/seed/mainseed.txt"
MainSpecialPeers     = ""
TestNetworkPort      = 8109
TestSeedURL          = "https://raw.githubusercontent.com/FactomProject/factomproject.github.io/master/seed/testseed.txt"
TestSpecialPeers     = ""
LocalNetworkPort     = 8110
LocalSeedURL         = "https://raw.githubusercontent.com/FactomProject/factomproject.github.io/master/seed/localseed.txt"
LocalSpecialPeers    = ""
; --------------- NodeMode: FULL | SERVER | LIGHT ----------------
NodeMode                              = SERVER
IdentityChainID                       = ` + auth.ChainID.String() + `
LocalServerPrivKey                    = ` + sec + `
LocalServerPublicKey                  = ` + pub + `
ExchangeRate                          = 00100000
ExchangeRateChainId		              = eac57815972c504ec5ae3f9e5c1fe12321a3c8c78def62528fb74cf7af5e7389
ExchangeRateAuthorityAddress          = EC2DKSYyRcNWf7RS963VFYgMExoHRYLHVeCfQ9PGPmNzwrcmgm2r

; These define if the PRC and Control Panel connection to factomd should be encrypted, and if it is, what files
; are the secret key and the public certificate.  factom-cli and factom-walletd uses the certificate specified here if TLS is enabled.
; To use default files and paths leave /full/path/to/... in place.
FactomdTlsEnabled                     = false
FactomdTlsPrivateKey                  = "/full/path/to/factomdAPIpriv.key"
FactomdTlsPublicCert                  = "/full/path/to/factomdAPIpub.cert"

; These are the username and password that factomd requires for the RPC API and the Control Panel
; This file is also used by factom-cli and factom-walletd to determine what login to use
FactomdRpcUser                        = ""
FactomdRpcPass                        = ""

[anchor]
ServerECPrivKey                       = 397c49e182caa97737c6b394591c614156fbe7998d7bf5d76273961e9fa1edd4
ServerECPublicKey                     = 06ed9e69bfdf85db8aa69820f348d096985bc0b11cc9fc9dcee3b8c68b41dfd5
AnchorChainID                         = df3ade9eec4b08d5379cc64270c30ea7315d8a8a1a69efe2b98a60ecdd69e604
ConfirmationsNeeded                   = 20

[btc]
WalletPassphrase                      = "lindasilva"
CertHomePath                          = "btcwallet"
RpcClientHost                         = "localhost:18332"
RpcClientEndpoint                     = "ws"
RpcClientUser                         = "testuser"
RpcClientPass                         = "notarychain"
BtcTransFee                           = 0.000001
CertHomePathBtcd                      = "btcd"
RpcBtcdHost                           = "localhost:18334"

[wsapi]
ApplicationName                       = "Factom/wsapi"
PortNumber                            = 8088

; ------------------------------------------------------------------------------
; logLevel - allowed values are: debug, info, notice, warning, error, critical, alert, emergency and none
; ConsoleLogLevel - allowed values are: debug, standard
; ------------------------------------------------------------------------------
[log]
logLevel                              = error
LogPath                               = "database/Log"
ConsoleLogLevel                       = standard

; ------------------------------------------------------------------------------
; Configurations for fctwallet
; ------------------------------------------------------------------------------
[Wallet]
Address                               = localhost
Port                                  = 8089
DataFile                              = fctwallet.dat
RefreshInSeconds                      = 6
BoltDBPath                            = ""

; ------------------------------------------------------------------------------
; Configurations for factom-walletd
; ------------------------------------------------------------------------------
[Walletd]
; These are the username and password that factom-walletd requires
; This file is also used by factom-cli to determine what login to use
WalletRpcUser                         = ""
WalletRpcPass                         = ""

; These define if the connection to the wallet should be encrypted, and if it is, what files
; are the secret key and the public certificate.  factom-cli uses the certificate specified here if TLS is enabled.
; To use default files and paths leave /full/path/to/... in place.
WalletTlsEnabled                      = false
WalletTlsPrivateKey                   = "/full/path/to/walletAPIpriv.key"
WalletTlsPublicCert                   = "/full/path/to/walletAPIpub.cert"

; This is where factom-walletd and factom-cli will find factomd to interact with the blockchain
; This value can also be updated to authorize an external ip or domain name when factomd creates a TLS cert
FactomdLocation                       = "localhost:8088"

; This is where factom-cli will find factom-walletd to create Factoid and Entry Credit transactions
; This value can also be updated to authorize an external ip or domain name when factom-walletd creates a TLS cert
WalletdLocation                       = "localhost:8089"
`

	return str
}


text:
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>

// UnityEngine.GUISkin
struct GUISkin_t3371348110;
// UnityEngineInternal.GenericStack
struct GenericStack_t931085639;

#include "mscorlib_System_Object4170816371.h"
#include "mscorlib_System_DateTime4283661327.h"

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif

// UnityEngine.GUI
struct  GUI_t3134605553  : public Il2CppObject
{
public:

public:
};

struct GUI_t3134605553_StaticFields
{
public:
	// System.Single UnityEngine.GUI::s_ScrollStepSize
	float ___s_ScrollStepSize_0;
	// System.Int32 UnityEngine.GUI::s_HotTextField
	int32_t ___s_HotTextField_1;
	// System.Int32 UnityEngine.GUI::s_BoxHash
	int32_t ___s_BoxHash_2;
	// System.Int32 UnityEngine.GUI::s_RepeatButtonHash
	int32_t ___s_RepeatButtonHash_3;
	// System.Int32 UnityEngine.GUI::s_ToggleHash
	int32_t ___s_ToggleHash_4;
	// System.Int32 UnityEngine.GUI::s_ButtonGridHash
	int32_t ___s_ButtonGridHash_5;
	// System.Int32 UnityEngine.GUI::s_SliderHash
	int32_t ___s_SliderHash_6;
	// System.Int32 UnityEngine.GUI::s_BeginGroupHash
	int32_t ___s_BeginGroupHash_7;
	// System.Int32 UnityEngine.GUI::s_ScrollviewHash
	int32_t ___s_ScrollviewHash_8;
	// UnityEngine.GUISkin UnityEngine.GUI::s_Skin
	GUISkin_t3371348110 * ___s_Skin_9;
	// UnityEngineInternal.GenericStack UnityEngine.GUI::s_ScrollViewStates
	GenericStack_t931085639 * ___s_ScrollViewStates_10;
	// System.DateTime UnityEngine.GUI::<nextScrollStepTime>k__BackingField
	DateTime_t4283661327  ___U3CnextScrollStepTimeU3Ek__BackingField_11;

public:
	inline static int32_t get_offset_of_s_ScrollStepSize_0() { return static_cast<int32_t>(offsetof(GUI_t3134605553_StaticFields, ___s_ScrollStepSize_0)); }
	inline float get_s_ScrollStepSize_0() const { return ___s_ScrollStepSize_0; }
	inline float* get_address_of_s_ScrollStepSize_0() { return &___s_ScrollStepSize_0; }
	inline void set_s_ScrollStepSize_0(float value)
	{
		___s_ScrollStepSize_0 = value;
	}

	inline static int32_t get_offset_of_s_HotTextField_1() { return static_cast<int32_t>(offsetof(GUI_t3134605553_StaticFields, ___s_HotTextField_1)); }
	inline int32_t get_s_HotTextField_1() const { return ___s_HotTextField_1; }
	inline int32_t* get_address_of_s_HotTextField_1() { return &___s_HotTextField_1; }
	inline void set_s_HotTextField_1(int32_t value)
	{
		___s_HotTextField_1 = value;
	}

	inline static int32_t get_offset_of_s_BoxHash_2() { return static_cast<int32_t>(offsetof(GUI_t3134605553_StaticFields, ___s_BoxHash_2)); }
	inline int32_t get_s_BoxHash_2() const { return ___s_BoxHash_2; }
	inline int32_t* get_address_of_s_BoxHash_2() { return &___s_BoxHash_2; }
	inline void set_s_BoxHash_2(int32_t value)
	{
		___s_BoxHash_2 = value;
	}

	inline static int32_t get_offset_of_s_RepeatButtonHash_3() { return static_cast<int32_t>(offsetof(GUI_t3134605553_StaticFields, ___s_RepeatButtonHash_3)); }
	inline int32_t get_s_RepeatButtonHash_3() const { return ___s_RepeatButtonHash_3; }
	inline int32_t* get_address_of_s_RepeatButtonHash_3() { return &___s_RepeatButtonHash_3; }
	inline void set_s_RepeatButtonHash_3(int32_t value)
	{
		___s_RepeatButtonHash_3 = value;
	}

	inline static int32_t get_offset_of_s_ToggleHash_4() { return static_cast<int32_t>(offsetof(GUI_t3134605553_StaticFields, ___s_ToggleHash_4)); }
	inline int32_t get_s_ToggleHash_4() const { return ___s_ToggleHash_4; }
	inline int32_t* get_address_of_s_ToggleHash_4() { return &___s_ToggleHash_4; }
	inline void set_s_ToggleHash_4(int32_t value)
	{
		___s_ToggleHash_4 = value;
	}

	inline static int32_t get_offset_of_s_ButtonGridHash_5() { return static_cast<int32_t>(offsetof(GUI_t3134605553_StaticFields, ___s_ButtonGridHash_5)); }
	inline int32_t get_s_ButtonGridHash_5() const { return ___s_ButtonGridHash_5; }
	inline int32_t* get_address_of_s_ButtonGridHash_5() { return &___s_ButtonGridHash_5; }
	inline void set_s_ButtonGridHash_5(int32_t value)
	{
		___s_ButtonGridHash_5 = value;
	}

	inline static int32_t get_offset_of_s_SliderHash_6() { return static_cast<int32_t>(offsetof(GUI_t3134605553_StaticFields, ___s_SliderHash_6)); }
	inline int32_t get_s_SliderHash_6() const { return ___s_SliderHash_6; }
	inline int32_t* get_address_of_s_SliderHash_6() { return &___s_SliderHash_6; }
	inline void set_s_SliderHash_6(int32_t value)
	{
		___s_SliderHash_6 = value;
	}

	inline static int32_t get_offset_of_s_BeginGroupHash_7() { return static_cast<int32_t>(offsetof(GUI_t3134605553_StaticFields, ___s_BeginGroupHash_7)); }
	inline int32_t get_s_BeginGroupHash_7() const { return ___s_BeginGroupHash_7; }
	inline int32_t* get_address_of_s_BeginGroupHash_7() { return &___s_BeginGroupHash_7; }
	inline void set_s_BeginGroupHash_7(int32_t value)
	{
		___s_BeginGroupHash_7 = value;
	}

	inline static int32_t get_offset_of_s_ScrollviewHash_8() { return static_cast<int32_t>(offsetof(GUI_t3134605553_StaticFields, ___s_ScrollviewHash_8)); }
	inline int32_t get_s_ScrollviewHash_8() const { return ___s_ScrollviewHash_8; }
	inline int32_t* get_address_of_s_ScrollviewHash_8() { return &___s_ScrollviewHash_8; }
	inline void set_s_ScrollviewHash_8(int32_t value)
	{
		___s_ScrollviewHash_8 = value;
	}

	inline static int32_t get_offset_of_s_Skin_9() { return static_cast<int32_t>(offsetof(GUI_t3134605553_StaticFields, ___s_Skin_9)); }
	inline GUISkin_t3371348110 * get_s_Skin_9() const { return ___s_Skin_9; }
	inline GUISkin_t3371348110 ** get_address_of_s_Skin_9() { return &___s_Skin_9; }
	inline void set_s_Skin_9(GUISkin_t3371348110 * value)
	{
		___s_Skin_9 = value;
		Il2CppCodeGenWriteBarrier(&___s_Skin_9, value);
	}

	inline static int32_t get_offset_of_s_ScrollViewStates_10() { return static_cast<int32_t>(offsetof(GUI_t3134605553_StaticFields, ___s_ScrollViewStates_10)); }
	inline GenericStack_t931085639 * get_s_ScrollViewStates_10() const { return ___s_ScrollViewStates_10; }
	inline GenericStack_t931085639 ** get_address_of_s_ScrollViewStates_10() { return &___s_ScrollViewStates_10; }
	inline void set_s_ScrollViewStates_10(GenericStack_t931085639 * value)
	{
		___s_ScrollViewStates_10 = value;
		Il2CppCodeGenWriteBarrier(&___s_ScrollViewStates_10, value);
	}

	inline static int32_t get_offset_of_U3CnextScrollStepTimeU3Ek__BackingField_11() { return static_cast<int32_t>(offsetof(GUI_t3134605553_StaticFields, ___U3CnextScrollStepTimeU3Ek__BackingField_11)); }
	inline DateTime_t4283661327  get_U3CnextScrollStepTimeU3Ek__BackingField_11() const { return ___U3CnextScrollStepTimeU3Ek__BackingField_11; }
	inline DateTime_t4283661327 * get_address_of_U3CnextScrollStepTimeU3Ek__BackingField_11() { return &___U3CnextScrollStepTimeU3Ek__BackingField_11; }
	inline void set_U3CnextScrollStepTimeU3Ek__BackingField_11(DateTime_t4283661327  value)
	{
		___U3CnextScrollStepTimeU3Ek__BackingField_11 = value;
	}
};

#ifdef __clang__
#pragma clang diagnostic pop
#endif

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Framework;
using ESRI.ArcGIS.ADF.CATIDs;

namespace DesktopExtensionsCS
{
    [Guid("16567F33-694D-4ca7-AC11-BA30971C3DB4")]
    [ClassInterface(ClassInterfaceType.None)]
    [ProgId("DesktopExtensionsCS.ArcEditorOnlyExtension")]
    public class ArcEditorOnlyExtension : IExtension, IExtensionConfig
    {
        #region COM Registration Function(s)
        [ComRegisterFunction()]
        [ComVisible(false)]
        static void RegisterFunction(Type registerType)
        {
            // Required for ArcGIS Component Category Registrar support
            ArcGISCategoryRegistration(registerType);

            //
            // TODO: Add any COM registration code here
            //
        }

        [ComUnregisterFunction()]
        [ComVisible(false)]
        static void UnregisterFunction(Type registerType)
        {
            // Required for ArcGIS Component Category Registrar support
            ArcGISCategoryUnregistration(registerType);

            //
            // TODO: Add any COM unregistration code here
            //
        }

        #region ArcGIS Component Category Registrar generated code
        /// <summary>
        /// Required method for ArcGIS Component Category registration -
        /// Do not modify the contents of this method with the code editor.
        /// </summary>
        private static void ArcGISCategoryRegistration(Type registerType)
        {
            string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID);
            MxExtension.Register(regKey);
            SxExtensions.Register(regKey);
            GxExtensions.Register(regKey);
            GMxExtensions.Register(regKey);
        }
        /// <summary>
        /// Required method for ArcGIS Component Category unregistration -
        /// Do not modify the contents of this method with the code editor.
        /// </summary>
        private static void ArcGISCategoryUnregistration(Type registerType)
        {
            string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID);
            MxExtension.Unregister(regKey);
            SxExtensions.Unregister(regKey);
            GxExtensions.Unregister(regKey);
            GMxExtensions.Unregister(regKey);

        }

        #endregion
        #endregion
        private IApplication m_application;
        private esriExtensionState m_enableState;

        private const esriLicenseProductCode RequiredProductCode = esriLicenseProductCode.esriLicenseProductCodeStandard;

        #region IExtension Members

        /// <summary>
        /// Name of extension. Do not exceed 31 characters
        /// </summary>
        public string Name
        {
            get
            {
                return "ArcEditorOnlyExtension_CS";
            }
        }

        public void Shutdown()
        {
            m_application = null;
        }

        public void Startup(ref object initializationData)
        {
            m_application = initializationData as IApplication;
            if (m_application == null)
                return;
        }

        #endregion

        #region IExtensionConfig Members

        public string Description
        {
            get
            {
                return "Standard only extension (C# Sample)\r\n" +
                    "Copyright � ESRI 2006\r\n\r\n" +
                    "Only available with an Standard product license.";
            }
        }

        /// <summary>
        /// Friendly name shown in the Extension dialog
        /// </summary>
        public string ProductName
        {
            get
            {
              return "Standard Extension (C#)";
            }
        }

        public esriExtensionState State
        {
            get
            {
                return m_enableState;
            }
            set
            {
                if (m_enableState != 0 && value == m_enableState)
                    return;

                //Check if ok to enable or disable extension
                esriExtensionState requestState = value;
                if (requestState == esriExtensionState.esriESEnabled)
                {
                    //Cannot enable if it's already in unavailable state
                    if (m_enableState == esriExtensionState.esriESUnavailable)
                    {
                        throw new COMException("Not running the appropriate product license.");
                    }

                    //Determine if state can be changed
                    esriExtensionState checkState = StateCheck(true);
                    m_enableState = checkState;
                    if (m_enableState == esriExtensionState.esriESUnavailable)
                        throw new COMException("Not running the appropriate product license.");
                }
                else if (requestState == 0 || requestState == esriExtensionState.esriESDisabled)
                {
                    //Determine if state can be changed
                    esriExtensionState checkState = StateCheck(false);
                    if (checkState != m_enableState)
                        m_enableState = checkState;
                }

            }
        }

        #endregion

        /// <summary>
        /// Determine extension state
        /// </summary>
        /// <param name="requestEnable">true if to enable; false to disable</param>
        private esriExtensionState StateCheck(bool requestEnable)
        {
            //Turn on or off extension directly
            if (requestEnable)
            {
                //Check if the correct product is licensed
                IAoInitialize aoInitTestProduct = new AoInitializeClass();
                esriLicenseProductCode prodCode = aoInitTestProduct.InitializedProduct();
                if (prodCode == RequiredProductCode)
                    return esriExtensionState.esriESEnabled;

                return esriExtensionState.esriESUnavailable;
            }
            else
                return esriExtensionState.esriESDisabled;
        }

    }
}


text:
from scrapy.item import Item, Field
from scrapy.loader import ItemLoader
from scrapy.loader.processors import MapCompose, TakeFirst, Join

class JyeooCrawlItem(Item):
    # define the fields for your item here like:
    # name = Field()
    #question_txt = Field()
    type_html = Field()
    label_html = Field()
    question_html = Field()
    #ans_txt = Field()
    ans_html = Field()
    #parse_txt = Field()
    parse_html = Field()
    comments_html = Field()
    question_url = Field()
    pass

class JyeooCrawlLoader(ItemLoader):
    default_item_class = JyeooCrawlItem
    default_input_processor = MapCompose(lambda s: s.strip())
    default_output_processor = TakeFirst()
    question_html_out = Join()


text:
/**
 * Drilldown module.
 * @module foundation.drilldown
 * @requires foundation.util.keyboard
 * @requires foundation.util.motion
 * @requires foundation.util.nest
 */
!function($, Foundation){
  'use strict';

  /**
   * Creates a new instance of a drilldown menu.
   * @class
   * @param {jQuery} element - jQuery object to make into an accordion menu.
   * @param {Object} options - Overrides to the default plugin settings.
   */
  function Drilldown(element, options){
    this.$element = element;
    this.options = $.extend({}, Drilldown.defaults, this.$element.data(), options);

    Foundation.Nest.Feather(this.$element, 'drilldown');

    this._init();

    Foundation.registerPlugin(this);
    Foundation.Keyboard.register('Drilldown', {
      'ENTER': 'open',
      'SPACE': 'open',
      'ARROW_RIGHT': 'next',
      'ARROW_UP': 'up',
      'ARROW_DOWN': 'down',
      'ARROW_LEFT': 'previous',
      'ESCAPE': 'close',
      'TAB': 'down',
      'SHIFT_TAB': 'up'
    });
  }
  Drilldown.defaults = {
    /**
     * Markup used for JS generated back button. Prepended to submenu lists and deleted on `destroy` method, 'js-drilldown-back' class required. Remove the backslash (`\`) if copy and pasting.
     * @option
     * @example '<\li><\a>Back<\/a><\/li>'
     */
    backButton: '
Back
',
    /**
     * Markup used to wrap drilldown menu. Use a class name for independent styling; the JS applied class: `is-drilldown` is required. Remove the backslash (`\`) if copy and pasting.
     * @option
     * @example '<\div class="is-drilldown"><\/div>'
     */
    wrapper: '

',
    /**
     * Allow the menu to return to root list on body click.
     * @option
     * @example false
     */
    closeOnClick: false
    // holdOpen: false
  };
  /**
   * Initializes the drilldown by creating jQuery collections of elements
   * @private
   */
  Drilldown.prototype._init = function(){
    this.$submenuAnchors = this.$element.find('li.has-submenu');
    this.$submenus = this.$submenuAnchors.children('[data-submenu]');
    this.$menuItems = this.$element.find('li:visible').not('.js-drilldown-back').attr('role', 'menuitem');

    this._prepareMenu();

    this._keyboardEvents();
  };
  /**
   * prepares drilldown menu by setting attributes to links and elements
   * sets a min height to prevent content jumping
   * wraps the element if not already wrapped
   * @private
   * @function
   */
  Drilldown.prototype._prepareMenu = function(){
    var _this = this;
    // if(!this.options.holdOpen){
    //   this._menuLinkEvents();
    // }
    this.$submenuAnchors.each(function(){
      var $sub = $(this);
      var $link = $sub.find('a:first');
      $link.data('savedHref', $link.attr('href')).removeAttr('href');
      $sub.children('[data-submenu]')
          .attr({
            'aria-hidden': true,
            'tabindex': 0,
            'role': 'menu'
          });
      _this._events($sub);
    });
    this.$submenus.each(function(){
      var $menu = $(this),
          $back = $menu.find('.js-drilldown-back');
      if(!$back.length){
        $menu.prepend(_this.options.backButton);
      }
      _this._back($menu);
    });
    if(!this.$element.parent().hasClass('is-drilldown')){
      this.$wrapper = $(this.options.wrapper).addClass('is-drilldown').css(this._getMaxDims());
      this.$element.wrap(this.$wrapper);
    }

  };
  /**
   * Adds event handlers to elements in the menu.
   * @function
   * @private
   * @param {jQuery} $elem - the current menu item to add handlers to.
   */
  Drilldown.prototype._events = function($elem){
    var _this = this;

    $elem.off('click.zf.drilldown')
    .on('click.zf.drilldown', function(e){
      if($(e.target).parentsUntil('ul', 'li').hasClass('is-drilldown-submenu-parent')){
        e.stopImmediatePropagation();
        e.preventDefault();
      }

      // if(e.target !== e.currentTarget.firstElementChild){
      //   return false;
      // }
      _this._show($elem);

      if(_this.options.closeOnClick){
        var $body = $('body').not(_this.$wrapper);
        $body.off('.zf.drilldown').on('click.zf.drilldown', function(e){
          e.preventDefault();
          _this._hideAll();
          $body.off('.zf.drilldown');
        });
      }
    });
  };
  /**
   * Adds keydown event listener to `li`'s in the menu.
   * @private
   */
  Drilldown.prototype._keyboardEvents = function() {
    var _this = this;
    this.$menuItems.add(this.$element.find('.js-drilldown-back')).on('keydown.zf.drilldown', function(e){
      var $element = $(this),
          $elements = $element.parent('ul').children('li'),
          $prevElement,
          $nextElement;

      $elements.each(function(i) {
        if ($(this).is($element)) {
          $prevElement = $elements.eq(Math.max(0, i-1));
          $nextElement = $elements.eq(Math.min(i+1, $elements.length-1));
          return;
        }
      });
      Foundation.Keyboard.handleKey(e, _this, {
        next: function() {
          if ($element.is(_this.$submenuAnchors)) {
            _this._show($element);
            $element.on(Foundation.transitionend($element), function(){
              $element.find('ul li').filter(_this.$menuItems).first().focus();
            });
          }
        },
        previous: function() {
          _this._hide($element.parent('ul'));
          $element.parent('ul').on(Foundation.transitionend($element), function(){
            setTimeout(function() {
              $element.parent('ul').parent('li').focus();
            }, 1);
          });
        },
        up: function() {
          $prevElement.focus();
        },
        down: function() {
          $nextElement.focus();
        },
        close: function() {
          _this._back();
          //_this.$menuItems.first().focus(); // focus to first element
        },
        open: function() {
          if (!$element.is(_this.$menuItems)) { // not menu item means back button
            _this._hide($element.parent('ul'));
            setTimeout(function(){$element.parent('ul').parent('li').focus();}, 1);
          } else if ($element.is(_this.$submenuAnchors)) {
            _this._show($element);
            setTimeout(function(){$element.find('ul li').filter(_this.$menuItems).first().focus();}, 1);
          }
        },
        handled: function() {
          e.preventDefault();
          e.stopImmediatePropagation();
        }
      });
    }); // end keyboardAccess
  };

  /**
   * Closes all open elements, and returns to root menu.
   * @function
   * @fires Drilldown#closed
   */
  Drilldown.prototype._hideAll = function(){
    var $elem = this.$element.find('.is-drilldown-sub.is-active').addClass('is-closing');
    $elem.one(Foundation.transitionend($elem), function(e){
      $elem.removeClass('is-active is-closing');
    });
        /**
         * Fires when the menu is fully closed.
         * @event Drilldown#closed
         */
    this.$element.trigger('closed.zf.drilldown');
  };
  /**
   * Adds event listener for each `back` button, and closes open menus.
   * @function
   * @fires Drilldown#back
   * @param {jQuery} $elem - the current sub-menu to add `back` event.
   */
  Drilldown.prototype._back = function($elem){
    var _this = this;
    $elem.off('click.zf.drilldown');
    $elem.children('.js-drilldown-back')
      .on('click.zf.drilldown', function(e){
        e.stopImmediatePropagation();
        // console.log('mouseup on back');
        _this._hide($elem);
      });
  };
  /**
   * Adds event listener to menu items w/o submenus to close open menus on click.
   * @function
   * @private
   */
  Drilldown.prototype._menuLinkEvents = function(){
    var _this = this;
    this.$menuItems.not('.has-submenu')
        .off('click.zf.drilldown')
        .on('click.zf.drilldown', function(e){
          // e.stopImmediatePropagation();
          setTimeout(function(){
            _this._hideAll();
          }, 0);
      });
  };
  /**
   * Opens a submenu.
   * @function
   * @fires Drilldown#open
   * @param {jQuery} $elem - the current element with a submenu to open.
   */
  Drilldown.prototype._show = function($elem){
    $elem.children('[data-submenu]').addClass('is-active');

    this.$element.trigger('open.zf.drilldown', [$elem]);
  };
  /**
   * Hides a submenu
   * @function
   * @fires Drilldown#hide
   * @param {jQuery} $elem - the current sub-menu to hide.
   */
  Drilldown.prototype._hide = function($elem){
    var _this = this;
    $elem.addClass('is-closing')
         .one(Foundation.transitionend($elem), function(){
           $elem.removeClass('is-active is-closing');
         });
    /**
     * Fires when the submenu is has closed.
     * @event Drilldown#hide
     */
    $elem.trigger('hide.zf.drilldown', [$elem]);

  };
  /**
   * Iterates through the nested menus to calculate the min-height, and max-width for the menu.
   * Prevents content jumping.
   * @function
   * @private
   */
  Drilldown.prototype._getMaxDims = function(){
    var max = 0, result = {};
    this.$submenus.add(this.$element).each(function(){
      var numOfElems = $(this).children('li').length;
      max = numOfElems > max ? numOfElems : max;
    });

    result.height = max * this.$menuItems[0].getBoundingClientRect().height + 'px';
    result.width = this.$element[0].getBoundingClientRect().width + 'px';

    return result;
  };
  /**
   * Destroys the Drilldown Menu
   * @function
   */
  Drilldown.prototype.destroy = function(){
    this._hideAll();
    Foundation.Nest.Burn(this.$element, 'drilldown');
    this.$element.unwrap()
                 .find('.js-drilldown-back').remove()
                 .end().find('.is-active, .is-closing, .is-drilldown-sub').removeClass('is-active is-closing is-drilldown-sub')
                 .end().find('[data-submenu]').removeAttr('aria-hidden tabindex role')
                 .off('.zf.drilldown').end().off('zf.drilldown');
    this.$element.find('a').each(function(){
      var $link = $(this);
      if($link.data('savedHref')){
        $link.attr('href', $link.data('savedHref')).removeData('savedHref');
      }else{ return; }
    });
    Foundation.unregisterPlugin(this);
  };
  Foundation.plugin(Drilldown, 'Drilldown');
}(jQuery, window.Foundation);


text:
package org.mrgeo.mapalgebra.unarymath

import java.awt.image.DataBuffer

import org.mrgeo.mapalgebra.parser.ParserNode
import org.mrgeo.mapalgebra.raster.RasterMapOp
import org.mrgeo.mapalgebra.{MapOp, MapOpRegistrar}

object CosMapOp extends MapOpRegistrar {
  override def register: Array[String] = {
    Array[String]("cos")
  }
  def create(raster:RasterMapOp):MapOp =
    new CosMapOp(Some(raster))

  override def apply(node:ParserNode, variables: String => Option[ParserNode]): MapOp =
    new CosMapOp(node, variables)
}

class CosMapOp extends RawUnaryMathMapOp {
  private[unarymath] def this(raster: Option[RasterMapOp]) = {
    this()
    input = raster
  }

  private[unarymath] def this(node:ParserNode, variables: String => Option[ParserNode]) = {
    this()

    initialize(node, variables)
  }

  override private[unarymath] def function(a: Double): Double = Math.cos(a)

  override private[unarymath] def datatype():Int = { DataBuffer.TYPE_FLOAT }
  override private[unarymath] def nodata():Double = { Float.NaN }

}


text:
#ifndef DAGIMG_H
#define DAGIMG_H

#define	DAGSERIAL_SIZE	128
#define	DAGSERIAL_ID	0x12345678

/*
 * Backwards compatability struct for mapping PCI device IDs + xilinx to
 * image index when this is not available from firmware directly.
 */
typedef struct dag_img {
	int	device_id;
	int	load_idx;
	int	img_idx;
} dag_img_t;

#define DAG_IMG_END 0xffff

/*
 * Struct for mapping image index numbers to A record pefixes and B records
 * for type checking.
 */
typedef struct img_id {
	int	img_idx;
	char	*img_name;
	char	*img_type;
	int	copro_id;
	int	board_rev;
} img_id_t;

#define IMG_ID_END 0xffff

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

int dag_get_img_idx(int device_id, int device_index);
int dag_check_img(int img_idx, int copro_id, char *arec, char *brec, int board_rev);
int dag_check_img_ptr(int img_idx, int copro_id, char *img, int img_size, int board_rev);
int dag_check_img_type(int img_idx, int copro_id, char* img, int img_size, int board_rev);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* DAGIMG_H */


text:
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import styles from './RacerDisplay.css';
import OrdinalNumber from './OrdinalNumber';
import { getDistance, raceDuration, getSpeed } from '../../selectors';

const placementClass = (place) => {
  switch (place) {
    case 1:
      return 'first';
    case 2:
      return 'second';
    case 3:
      return 'third';
    case 4:
      return 'fourth';
    case -1:
      return 'dnf';
    default:
      return 'hide';
  }
};

export default class RacerDisplay extends Component {
  static propTypes = {
    bikeIndex: PropTypes.number.isRequired,
    bike: PropTypes.object.isRequired,
    racer: PropTypes.object.isRequired,
    race: PropTypes.object.isRequired,
    className: PropTypes.string
  };

  static defaultProps = {
    className: ''
  };

  render() {
    const {
      bikeIndex,
      bike,
      racer = {},
      race,
      className
    } = this.props;
    const speed = getSpeed(
      getDistance(race, bike, race.results[bikeIndex].bikeTicks),
      raceDuration(race, bikeIndex)
    );
    const place = styles[placementClass(race.results[bikeIndex].place)];
    return (
      <div className={`${styles.container} ${place} col-xs-3 ${className}`}>

          {bikeIndex + 1}

        <OrdinalNumber place={race.results[bikeIndex].place} />

          {racer.name}

            {race.measurementSystem === 'metric' ?
              `${speed.toFixed(1)} KPH` : `${speed.toFixed(1)} MPH`}

    );
  }
}


text:
layout: video
show_meta: false
title: "Video Template"
subheadline: "Templates"
teaser: "If you want to show videos in a large manner, the video template is the right choice."
tags:
    - post format
categories:
    - design
iframe: ""
---

## About the video by Kutiman

> Ophir Kutiel, professionally known as Kutiman, is an Israeli musician, composer, producer and animator. He is best known for creating the online music video project, ThruYOU, and a self-titled album. [Wikipedia](http://en.wikipedia.org/wiki/Kutiman)

Source: [Kutiman – Thru You Too – »Give It Up«](https://www.youtube.com/watch?v=WoHxoz_0ykI)


text:
package equellatests.tests

import equellatests.domain._
import equellatests._
import io.circe.generic.auto._
import io.circe.generic.semiauto._
import io.circe.{Decoder, Encoder}
import org.scalacheck.Arbitrary._
import equellatests.instgen.workflow._
import equellatests.pages.HomePage
import equellatests.pages.moderate.TaskListPage
import equellatests.pages.wizard.ContributePage
import equellatests.sections.moderate.{ModerationMessageDialog, ModerationView}
import equellatests.sections.wizard.EditBoxControl
import org.scalacheck.{Gen, Prop}
import org.scalacheck.Prop._

object WorkflowCommentProperties
    extends StatefulProperties("Workflow comments")
    with SimpleTestCase {

  type State   = WorkflowCommentState
  type Command = WorkflowCommentCommand

  object MessageTypes extends Enumeration {
    val Approve, Comment, Reject = Value
  }

  case class WorkflowComment(message: String, files: Set[String], typ: MessageTypes.Value)

  case class CommentItem(name: String, currentTask: Option[String], comments: Seq[WorkflowComment])

  case class WorkflowCommentState(
      items: Seq[CommentItem] = Seq.empty,
      item: Option[CommentItem] = None,
      moderating: Boolean = false,
      attemptedInvalid: Boolean = false,
      commentTypes: MessageTypes.ValueSet = MessageTypes.ValueSet.empty) {
    lazy val itemNames = items.map(_.name).toSet
  }

  sealed abstract class MessageType(val typ: MessageTypes.Value)

  object MessageType {
    def moderates(msg: MessageType): Boolean = msg match {
      case CommentMessage => false
      case _              => true
    }
  }

  case object ApproveMessage extends MessageType(MessageTypes.Approve)

  case object CommentMessage extends MessageType(MessageTypes.Comment)

  case class RejectMessage(step: Option[String]) extends MessageType(MessageTypes.Reject)

  sealed trait InvalidReason

  case object NoMessage extends InvalidReason

  case object BannedFile extends InvalidReason

  sealed trait WorkflowCommentCommand

  case class CreateItemCommand(name: String) extends WorkflowCommentCommand

  case class ModerateItemCommand(name: String) extends WorkflowCommentCommand

  case class InvalidCommentCommand(msgType: MessageType,
                                   file: TestFile,
                                   invalidReason: InvalidReason)
      extends WorkflowCommentCommand

  case class PostCommentCommand(msg: String,
                                files: Seq[(TestFile, String)],
                                msgType: MessageType,
                                cancel: Boolean)
      extends WorkflowCommentCommand

  case object CloseDialogCommand extends WorkflowCommentCommand

  case object VerifyComments extends WorkflowCommentCommand

  def genFile(banned: Boolean): Gen[TestFile] =
    Gen.oneOf(TestFile.testFiles.filterNot(tf => banned ^ TestFile.bannedExt(tf.extension)))

  val fileAndName = for {
    vfn <- arbitrary[ValidFilename]
    tf  <- genFile(false)
  } yield (tf, s"${vfn.filename}.${tf.extension}")

  def errorComment(inv: InvalidReason, genFile: Gen[TestFile])(
      msgType: MessageType): Gen[(List[WorkflowCommentCommand], Boolean)] = genFile.flatMap { tf =>
    val invalid = Gen.const {
      (List(InvalidCommentCommand(msgType, tf, inv), CloseDialogCommand), true)
    }
    Gen.oneOf(stdComment(RejectMessage(None)), invalid)
  }

  def stdComment(msgType: MessageType): Gen[(List[WorkflowCommentCommand], Boolean)] =
    for {
      comment  <- arbitrary[RandomWords]
      numFiles <- Gen.choose(0, 3)
      files    <- Gen.listOfN(numFiles, fileAndName)
      cancel   <- Gen.frequency(1 -> true, 4 -> false)
      blankMessage <- Gen
        .frequency(2 -> false, 1 -> true)
        .map(mb => mb && numFiles == 0 && msgType.typ == MessageTypes.Approve)
    } yield {
      val message   = if (blankMessage) "" else comment.asString
      val cancelCom = if (cancel) List(CloseDialogCommand) else Nil
      (List(PostCommentCommand(message, files, msgType, cancel)) ++ cancelCom,
       cancel || !MessageType.moderates(msgType))
    }

  def doComments(f: WorkflowCommentState => Boolean,
                 doComment: MessageType => Gen[(List[WorkflowCommentCommand], Boolean)])(
      state: WorkflowCommentState): Gen[List[WorkflowCommentCommand]] = state.item match {
    case Some(CommentItem(itemName, Some(task), _)) =>
      for {
        rejectStep <- Gen.frequency(
          rejectionTasks3Step(task).map(s => 3 -> Gen.const(Option(s))) :+ (1, Gen.const(None)): _*)
        msgType <- Fairness.favour3to1[MessageType](
          Seq(CommentMessage, ApproveMessage, RejectMessage(rejectStep)),
          t => state.commentTypes.contains(t.typ))
        (pcc, staysModerating) <- doComment(msgType)
      } yield {
        if (!state.moderating) List(ModerateItemCommand(itemName), VerifyComments) ++ pcc
        else if (staysModerating) pcc :+ VerifyComments
        else pcc
      }
    case _ if f(state) =>
      arbitrary[RandomWords].map { urw =>
        List(CreateItemCommand(Uniqueify.uniquelyNumbered(state.itemNames, urw.asString)))
      }
    case _ => Gen.const(List.empty)
  }

  val testCaseDecoder = deriveDecoder
  val testCaseEncoder = deriveEncoder

  override def initialState: WorkflowCommentState = WorkflowCommentState()

  override def runCommand(c: WorkflowCommentCommand, s: WorkflowCommentState) = c match {
    case CreateItemCommand(name) =>
      val newItem = CommentItem(name, Some("Step 1"), Seq.empty)
      s.copy(item = Some(newItem), items = s.items :+ newItem)
    case InvalidCommentCommand(msgType, file, invalidReason) => s.copy(attemptedInvalid = true)
    case CloseDialogCommand                                  => s
    case PostCommentCommand(msg, files, msgType, cancel) =>
      def nextTask(current: String) = msgType match {
        case ApproveMessage      => nextTask3Step(current)
        case CommentMessage      => Some(current)
        case RejectMessage(task) => task
      }

      if (cancel) s
      else
        s.item
          .map { item =>
            val newComments = WorkflowComment(msg, files.map(_._2).toSet, msgType.typ) +: item.comments
            s.copy(
              item = Some(
                item.copy(comments = newComments,
                          currentTask = item.currentTask.flatMap(nextTask))),
              moderating = !MessageType.moderates(msgType),
              commentTypes = s.commentTypes + msgType.typ
            )
          }
          .getOrElse(s)
    case ModerateItemCommand(name) => s
    case VerifyComments            => s
  }

  override def runCommandInBrowser(c: WorkflowCommentCommand,
                                   s: WorkflowCommentState,
                                   b: SimpleSeleniumBrowser) = c match {
    case CreateItemCommand(name) =>
      b.run {
        val page = new ContributePage(b.page.ctx).load().openWizard("Simple 3 Step")
        page.ctrl(EditBoxControl, 1).value = b.uniquePrefix(name)
        page.save().submitForModeration()
      }
    case CloseDialogCommand =>
      b.runOnPage {
        case md: ModerationMessageDialog => md.cancel()
      }
    case ModerateItemCommand(n) =>
      b.run {
        val tlp      = new TaskListPage(b.page.ctx).load()
        val realName = b.uniquePrefix(n)
        tlp.query = s"+$realName"
        tlp.search().resultForName(realName).moderate()
      }
    case InvalidCommentCommand(msgType, tf, invalidReason) =>
      b.verifyOnPage {
        case mv: ModerationView =>
          val md = msgType match {
            case CommentMessage   => mv.postComment()
            case ApproveMessage   => mv.approve()
            case RejectMessage(_) => mv.reject()
          }
          invalidReason match {
            case NoMessage =>
              msgType match {
                case ApproveMessage =>
                  md.uploadFile(tf, tf.realFilename)
                  md.submitError()
                case _ => md.submitError()
              }
            case BannedFile => md.uploadFileError(tf, tf.realFilename)
          }
          val errMsg = md.errorMessage
          md -> collect(s"invalid_$invalidReason") {
            errMsg ?= ((invalidReason, msgType) match {
              case (NoMessage, ApproveMessage) => "Please enter a message when files attached"
              case (NoMessage, _)              => "You must enter a message"
              case (BannedFile, _)             => "File upload cancelled. File extension has been banned"
            })
          }
      }
    case PostCommentCommand(msg, files, msgType, cancel) =>
      b.verifyOnPage {
        case mv: ModerationView =>
          val md = msgType match {
            case CommentMessage => mv.postComment()
            case ApproveMessage => mv.approve()
            case RejectMessage(step) =>
              val rd       = mv.reject()
              val stepName = step.getOrElse("Original Contributor")
              rd.rejectStep = stepName
              rd
          }
          md.message = msg
          files.foreach {
            case (tf, fn) => md.uploadFile(tf, fn)
          }
          val newpage =
            if (cancel) md
            else if (MessageType.moderates(msgType)) md.submitModeration()
            else md.submit()
          newpage -> classify(cancel, "cancelled") {
            collect(msgType)(true)
          }
      }
    case VerifyComments =>
      b.verifyOnPage {
        case mv: ModerationView =>
          val result = mv
            .allComments()
            .map(mc =>
              WorkflowComment(mc.message, mc.fileNames, mc.commentClass match {
                case "approval"  => MessageTypes.Approve
                case "rejection" => MessageTypes.Reject
                case _           => MessageTypes.Comment
              }))
          (mv, Option(result) ?= s.item.map(_.comments.filter(_.message.nonEmpty)))
      }
  }

  override def logon = adminLogon

//  statefulProp("comment on workflow steps") {
//    generateCommands(doComments(_.commentTypes != MessageTypes.values, stdComment))
//  }
//
//  statefulProp("comment with no message") {
//    generateCommands(doComments(!_.attemptedInvalid, errorComment(NoMessage, genFile(false))))
//  }
//
//  statefulProp("upload banned file") {
//    generateCommands(doComments(!_.attemptedInvalid, errorComment(BannedFile, genFile(true))))
//  }

}


text:
using System;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Cursor;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Graphics.Backgrounds;
using osu.Game.Graphics.UserInterface;
using OpenTK;
using OpenTK.Graphics;
using osu.Framework.Input;
using osu.Game.Graphics.Sprites;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.UserInterface;

namespace osu.Game.Beatmaps.Drawables
{
    public class BeatmapPanel : Panel, IHasContextMenu
    {
        public BeatmapInfo Beatmap;
        private readonly Sprite background;

        public Action<BeatmapPanel> GainedSelection;
        public Action<BeatmapPanel> StartRequested;
        public Action<BeatmapPanel> EditRequested;
        public Action<BeatmapInfo> HideRequested;

        private readonly Triangles triangles;
        private readonly StarCounter starCounter;

        protected override void Selected()
        {
            base.Selected();

            GainedSelection?.Invoke(this);

            background.Colour = ColourInfo.GradientVertical(
                new Color4(20, 43, 51, 255),
                new Color4(40, 86, 102, 255));

            triangles.Colour = Color4.White;
        }

        protected override void Deselected()
        {
            base.Deselected();

            background.Colour = new Color4(20, 43, 51, 255);
            triangles.Colour = OsuColour.Gray(0.5f);
        }

        protected override bool OnClick(InputState state)
        {
            if (State == PanelSelectedState.Selected)
                StartRequested?.Invoke(this);

            return base.OnClick(state);
        }

        protected override void ApplyState(PanelSelectedState last = PanelSelectedState.Hidden)
        {
            if (!IsLoaded) return;

            base.ApplyState(last);

            if (last == PanelSelectedState.Hidden && State != last)
                starCounter.ReplayAnimation();
        }

        public BeatmapPanel(BeatmapInfo beatmap)
        {
            if (beatmap == null)
                throw new ArgumentNullException(nameof(beatmap));

            Beatmap = beatmap;
            Height *= 0.60f;

            Children = new Drawable[]
            {
                background = new Box
                {
                    RelativeSizeAxes = Axes.Both,
                },
                triangles = new Triangles
                {
                    TriangleScale = 2,
                    RelativeSizeAxes = Axes.Both,
                    ColourLight = OsuColour.FromHex(@"3a7285"),
                    ColourDark = OsuColour.FromHex(@"123744")
                },
                new FillFlowContainer
                {
                    Padding = new MarginPadding(5),
                    Direction = FillDirection.Horizontal,
                    AutoSizeAxes = Axes.Both,
                    Anchor = Anchor.CentreLeft,
                    Origin = Anchor.CentreLeft,
                    Children = new Drawable[]
                    {
                        new DifficultyIcon(beatmap)
                        {
                            Scale = new Vector2(1.8f),
                        },
                        new FillFlowContainer
                        {
                            Padding = new MarginPadding { Left = 5 },
                            Direction = FillDirection.Vertical,
                            AutoSizeAxes = Axes.Both,
                            Children = new Drawable[]
                            {
                                new FillFlowContainer
                                {
                                    Direction = FillDirection.Horizontal,
                                    Spacing = new Vector2(4, 0),
                                    AutoSizeAxes = Axes.Both,
                                    Children = new[]
                                    {
                                        new OsuSpriteText
                                        {
                                            Font = @"Exo2.0-Medium",
                                            Text = beatmap.Version,
                                            TextSize = 20,
                                            Anchor = Anchor.BottomLeft,
                                            Origin = Anchor.BottomLeft
                                        },
                                        new OsuSpriteText
                                        {
                                            Font = @"Exo2.0-Medium",
                                            Text = "mapped by",
                                            TextSize = 16,
                                            Anchor = Anchor.BottomLeft,
                                            Origin = Anchor.BottomLeft
                                        },
                                        new OsuSpriteText
                                        {
                                            Font = @"Exo2.0-MediumItalic",
                                            Text = $"{(beatmap.Metadata ?? beatmap.BeatmapSet.Metadata).Author.Username}",
                                            TextSize = 16,
                                            Anchor = Anchor.BottomLeft,
                                            Origin = Anchor.BottomLeft
                                        },
                                    }
                                },
                                starCounter = new StarCounter
                                {
                                    CountStars = (float)beatmap.StarDifficulty,
                                    Scale = new Vector2(0.8f),
                                }
                            }
                        }
                    }
                }
            };
        }

        public MenuItem[] ContextMenuItems => new MenuItem[]
        {
            new OsuMenuItem("Play", MenuItemType.Highlighted, () => StartRequested?.Invoke(this)),
            new OsuMenuItem("Edit", MenuItemType.Standard, () => EditRequested?.Invoke(this)),
            new OsuMenuItem("Hide", MenuItemType.Destructive, () => HideRequested?.Invoke(Beatmap)),
        };
    }
}


text:
    <waltz-page-header name="{{ ctrl.dataType.name }}"
                       small="Data Type"
                       icon="qrcode">
        <breadcrumbs>

Home

Data

        </breadcrumbs>
    </waltz-page-header>

    <waltz-filter-change-watcher on-filters-changed="ctrl.filtersChanged">
    </waltz-filter-change-watcher>

    <waltz-data-type-overview parent-entity-ref="ctrl.entityRef"
                              filters="ctrl.filters">
    </waltz-data-type-overview>

        <waltz-dynamic-sections-view parent-entity-ref="ctrl.entityRef"
                                     filters="ctrl.filters">
        </waltz-dynamic-sections-view>


text:
package org.jabref.logic.importer.fetcher;

import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.util.List;

import javafx.collections.FXCollections;

import org.jabref.logic.importer.FetcherException;
import org.jabref.logic.importer.ImporterPreferences;
import org.jabref.logic.util.BuildInfo;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.field.StandardField;
import org.jabref.model.entry.types.StandardEntryType;
import org.jabref.testutils.category.FetcherTest;

import kong.unirest.json.JSONObject;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

@FetcherTest
public class BiodiversityLibraryTest {
    private final String BASE_URL = "https://www.biodiversitylibrary.org/api3?";
    private final String RESPONSE_FORMAT = "&format=json";
    private final BuildInfo buildInfo = new BuildInfo();

    private BiodiversityLibrary fetcher;

    @BeforeEach
    void setUp() {
        ImporterPreferences importerPreferences = mock(ImporterPreferences.class);
        when(importerPreferences.getApiKeys()).thenReturn(FXCollections.emptyObservableSet());
        fetcher = new BiodiversityLibrary(importerPreferences);
    }

    @Test
    public void testGetName() {
        assertEquals("Biodiversity Heritage", fetcher.getName());
        assertNotEquals("Biodiversity Heritage Library", fetcher.getName());
        assertNotEquals("Biodiversity Library", fetcher.getName());
    }

    @Test
    public void biodiversityHeritageApiKeyIsNotEmpty() {
        BuildInfo buildInfo = new BuildInfo();
        assertNotNull(buildInfo.biodiversityHeritageApiKey);
    }

    @Test
    public void baseURLConstruction() throws MalformedURLException, URISyntaxException {
        String expected = fetcher
                .getTestUrl()
                .concat(buildInfo.biodiversityHeritageApiKey)
                .concat(RESPONSE_FORMAT);

        assertEquals(expected, fetcher.getBaseURL().toString());
    }

    @ParameterizedTest
    @ValueSource(strings = {"1234", "331", "121"})
    public void getPartMetadaUrl(String id) throws MalformedURLException, URISyntaxException {
        String expected = fetcher
                .getTestUrl()
                .concat(buildInfo.biodiversityHeritageApiKey)
                .concat(RESPONSE_FORMAT)
                .concat("&op=GetPartMetadata&pages=f&names=f")
                .concat("&id=");

        assertEquals(expected.concat(id), fetcher.getPartMetadataURL(id).toString());
    }

    @ParameterizedTest
    @ValueSource(strings = {"1234", "4321", "331"})
    public void getItemMetadaUrl(String id) throws MalformedURLException, URISyntaxException {
        String expected = fetcher
                .getTestUrl()
                .concat(buildInfo.biodiversityHeritageApiKey)
                .concat(RESPONSE_FORMAT)
                .concat("&op=GetItemMetadata&pages=f&ocr=f&ocr=f")
                .concat("&id=");

        assertEquals(expected.concat(id), fetcher.getItemMetadataURL(id).toString());
    }

    @Test
    public void testPerformSearch() throws FetcherException {
        BibEntry expected = new BibEntry(StandardEntryType.Book)
            .withField(StandardField.AUTHOR, "Ingersoll, Ernest, ")
            .withField(StandardField.EDITOR, "University of Illinois Urbana-Champaign Alternates")
            .withField(StandardField.LANGUAGE, "English")
            .withField(StandardField.PUBLISHER, "University Library, University of Illinois Urbana Champaign")
            .withField(StandardField.LOCATION, "Chicago")
            .withField(StandardField.TITLE, "Dogs")
            .withField(StandardField.URL, "https://www.biodiversitylibrary.org/item/219826")
            .withField(StandardField.YEAR, "1879");

        // fetcher returns more than entry, by default up to 200, but we only want to check one here
        assertEquals(List.of(expected), fetcher.performSearch("dogs").subList(0, 1));
    }

    @Test
    public void jsonResultToBibEntry() {
        JSONObject input = new JSONObject("{\n\"BHLType\": \"Part\",\n\"FoundIn\": \"Metadata\",\n\"Volume\": \"3\",\n\"Authors\": [\n{\n\"Name\": \"Dimmock, George,\"\n}\n],\n\"PartUrl\": \"https://www.biodiversitylibrary.org/part/181199\",\n\"PartID\": \"181199\",\n\"Genre\": \"Article\",\n\"Title\": \"The Cocoons of Cionus Scrophulariae\",\n\"ContainerTitle\": \"Psyche.\",\n\"Date\": \"1882\",\n\"PageRange\": \"411--413\"\n}");
        BibEntry expected = new BibEntry(StandardEntryType.Article)
                .withField(StandardField.TITLE, "The Cocoons of Cionus Scrophulariae")
                .withField(StandardField.AUTHOR, "Dimmock, George, ")
                .withField(StandardField.PAGES, "411--413")
                .withField(StandardField.DATE, "1882")
                .withField(StandardField.JOURNALTITLE, "Psyche.")
                .withField(StandardField.VOLUME, "3");

        assertEquals(expected, fetcher.jsonResultToBibEntry(input));

        input = new JSONObject("""
                {
                            "BHLType": "Item",
                            "FoundIn": "Metadata",
                            "ItemID": "174333",
                            "TitleID": "96205",
                            "ItemUrl": "https://www.biodiversitylibrary.org/item/174333",
                            "TitleUrl": "https://www.biodiversitylibrary.org/bibliography/96205",
                            "MaterialType": "Published material",
                            "PublisherPlace": "Salisbury",
                            "PublisherName": "Frederick A. Blake,",
                            "PublicationDate": "1861",
                            "Authors": [
                                {
                                    "Name": "George, George"
                                }
                            ],
                            "Genre": "Book",
                            "Title": "Potatoes : the poor man's own crop : illustrated with plates, showing the decay and disease of the potatoe [sic] : with hints to improve the land and life of the poor man : published to aid the Industrial Marlborough Exhibition"
                        }""");
         expected = new BibEntry(StandardEntryType.Book)
                .withField(StandardField.TITLE, "Potatoes : the poor man's own crop : illustrated with plates, showing the decay and disease of the potatoe [sic] : with hints to improve the land and life of the poor man : published to aid the Industrial Marlborough Exhibition")
                .withField(StandardField.AUTHOR, "George, George ")
                .withField(StandardField.YEAR, "1861")
                .withField(StandardField.LOCATION, "Salisbury")
                .withField(StandardField.PUBLISHER, "Frederick A. Blake,");
        assertEquals(expected, fetcher.jsonResultToBibEntry(input));

        input = new JSONObject("""
                {
                            "BHLType": "Item",
                            "FoundIn": "Metadata",
                            "ItemID": "200116",
                            "TitleID": "115108",
                            "ItemUrl": "https://www.biodiversitylibrary.org/item/200116",
                            "TitleUrl": "https://www.biodiversitylibrary.org/bibliography/115108",
                            "MaterialType": "Published material",
                            "PublisherPlace": "Washington",
                            "PublisherName": "Government Prining Office,",
                            "PublicationDate": "1911",
                            "Authors": [
                                {
                                    "Name": "Whitaker, George M. (George Mason)"
                                }
                            ],
                            "Genre": "Book",
                            "Title": "The extra cost of producing clean milk."
                        }""");
        expected = new BibEntry(StandardEntryType.Book)
                .withField(StandardField.TITLE, "The extra cost of producing clean milk.")
                .withField(StandardField.AUTHOR, "Whitaker, George M. (George Mason) ")
                .withField(StandardField.YEAR, "1911")
                .withField(StandardField.LOCATION, "Washington")
                .withField(StandardField.PUBLISHER, "Government Prining Office,");
        assertEquals(expected, fetcher.jsonResultToBibEntry(input));
    }
}


text:
namespace x11 {

namespace {

template <typename T>
std::unique_ptr<Error> MakeError(Connection::RawError error_) {
  ReadBuffer buf(error_);
  auto error = std::make_unique<T>();
  ReadError(error.get(), &buf);
  return error;
}

}  // namespace

void Connection::InitErrorParsers() {
  uint8_t first_errors[256];
  memset(first_errors, 0, sizeof(first_errors));

  auto add_parser = [&](uint8_t error_code, uint8_t first_error,
                        ErrorParser parser) {
    if (!error_parsers_[error_code] || first_error > first_errors[error_code]) {
      first_errors[error_code] = error_code;
      error_parsers_[error_code] = parser;
    }
  };

  if (damage().present()) {
    uint8_t first_error = damage().first_error();
    {
      auto error_code = first_error + 0;
      auto parse = MakeError<Damage::BadDamageError>;
      add_parser(error_code, first_error, parse);
    }
  }

  if (glx().present()) {
    uint8_t first_error = glx().first_error();
    {
      auto error_code = first_error + 0;
      auto parse = MakeError<Glx::BadContextError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 1;
      auto parse = MakeError<Glx::BadContextStateError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 2;
      auto parse = MakeError<Glx::BadDrawableError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 3;
      auto parse = MakeError<Glx::BadPixmapError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 4;
      auto parse = MakeError<Glx::BadContextTagError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 5;
      auto parse = MakeError<Glx::BadCurrentWindowError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 6;
      auto parse = MakeError<Glx::BadRenderRequestError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 7;
      auto parse = MakeError<Glx::BadLargeRequestError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 8;
      auto parse = MakeError<Glx::UnsupportedPrivateRequestError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 9;
      auto parse = MakeError<Glx::BadFBConfigError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 10;
      auto parse = MakeError<Glx::BadPbufferError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 11;
      auto parse = MakeError<Glx::BadCurrentDrawableError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 12;
      auto parse = MakeError<Glx::BadWindowError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 13;
      auto parse = MakeError<Glx::GLXBadProfileARBError>;
      add_parser(error_code, first_error, parse);
    }
  }

  if (randr().present()) {
    uint8_t first_error = randr().first_error();
    {
      auto error_code = first_error + 0;
      auto parse = MakeError<RandR::BadOutputError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 1;
      auto parse = MakeError<RandR::BadCrtcError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 2;
      auto parse = MakeError<RandR::BadModeError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 3;
      auto parse = MakeError<RandR::BadProviderError>;
      add_parser(error_code, first_error, parse);
    }
  }

  if (record().present()) {
    uint8_t first_error = record().first_error();
    {
      auto error_code = first_error + 0;
      auto parse = MakeError<Record::BadContextError>;
      add_parser(error_code, first_error, parse);
    }
  }

  if (render().present()) {
    uint8_t first_error = render().first_error();
    {
      auto error_code = first_error + 0;
      auto parse = MakeError<Render::PictFormatError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 1;
      auto parse = MakeError<Render::PictureError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 2;
      auto parse = MakeError<Render::PictOpError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 3;
      auto parse = MakeError<Render::GlyphSetError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 4;
      auto parse = MakeError<Render::GlyphError>;
      add_parser(error_code, first_error, parse);
    }
  }

  if (shm().present()) {
    uint8_t first_error = shm().first_error();
    {
      auto error_code = first_error + 0;
      auto parse = MakeError<Shm::BadSegError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 2;
      auto parse = MakeError<ValueError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 3;
      auto parse = MakeError<WindowError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 4;
      auto parse = MakeError<PixmapError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 5;
      auto parse = MakeError<AtomError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 6;
      auto parse = MakeError<CursorError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 7;
      auto parse = MakeError<FontError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 9;
      auto parse = MakeError<DrawableError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 12;
      auto parse = MakeError<ColormapError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 13;
      auto parse = MakeError<GContextError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 14;
      auto parse = MakeError<IDChoiceError>;
      add_parser(error_code, first_error, parse);
    }
  }

  if (sync().present()) {
    uint8_t first_error = sync().first_error();
    {
      auto error_code = first_error + 0;
      auto parse = MakeError<Sync::CounterError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 1;
      auto parse = MakeError<Sync::AlarmError>;
      add_parser(error_code, first_error, parse);
    }
  }

  if (xf86vidmode().present()) {
    uint8_t first_error = xf86vidmode().first_error();
    {
      auto error_code = first_error + 0;
      auto parse = MakeError<XF86VidMode::BadClockError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 1;
      auto parse = MakeError<XF86VidMode::BadHTimingsError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 2;
      auto parse = MakeError<XF86VidMode::BadVTimingsError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 3;
      auto parse = MakeError<XF86VidMode::ModeUnsuitableError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 4;
      auto parse = MakeError<XF86VidMode::ExtensionDisabledError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 5;
      auto parse = MakeError<XF86VidMode::ClientNotLocalError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 6;
      auto parse = MakeError<XF86VidMode::ZoomLockedError>;
      add_parser(error_code, first_error, parse);
    }
  }

  if (xfixes().present()) {
    uint8_t first_error = xfixes().first_error();
    {
      auto error_code = first_error + 0;
      auto parse = MakeError<XFixes::BadRegionError>;
      add_parser(error_code, first_error, parse);
    }
  }

  if (xinput().present()) {
    uint8_t first_error = xinput().first_error();
    {
      auto error_code = first_error + 0;
      auto parse = MakeError<Input::DeviceError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 1;
      auto parse = MakeError<Input::EventError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 2;
      auto parse = MakeError<Input::ModeError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 3;
      auto parse = MakeError<Input::DeviceBusyError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 4;
      auto parse = MakeError<Input::ClassError>;
      add_parser(error_code, first_error, parse);
    }
  }

  if (xkb().present()) {
    uint8_t first_error = xkb().first_error();
    {
      auto error_code = first_error + 0;
      auto parse = MakeError<Xkb::KeyboardError>;
      add_parser(error_code, first_error, parse);
    }
  }

  if (xprint().present()) {
    uint8_t first_error = xprint().first_error();
    {
      auto error_code = first_error + 0;
      auto parse = MakeError<XPrint::BadContextError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 1;
      auto parse = MakeError<XPrint::BadSequenceError>;
      add_parser(error_code, first_error, parse);
    }
  }

  {
    uint8_t first_error = 0;
    {
      auto error_code = first_error + 1;
      auto parse = MakeError<RequestError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 2;
      auto parse = MakeError<ValueError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 3;
      auto parse = MakeError<WindowError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 4;
      auto parse = MakeError<PixmapError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 5;
      auto parse = MakeError<AtomError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 6;
      auto parse = MakeError<CursorError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 7;
      auto parse = MakeError<FontError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 8;
      auto parse = MakeError<MatchError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 9;
      auto parse = MakeError<DrawableError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 10;
      auto parse = MakeError<AccessError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 11;
      auto parse = MakeError<AllocError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 12;
      auto parse = MakeError<ColormapError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 13;
      auto parse = MakeError<GContextError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 14;
      auto parse = MakeError<IDChoiceError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 15;
      auto parse = MakeError<NameError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 16;
      auto parse = MakeError<LengthError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 17;
      auto parse = MakeError<ImplementationError>;
      add_parser(error_code, first_error, parse);
    }
  }

  if (xv().present()) {
    uint8_t first_error = xv().first_error();
    {
      auto error_code = first_error + 0;
      auto parse = MakeError<Xv::BadPortError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 1;
      auto parse = MakeError<Xv::BadEncodingError>;
      add_parser(error_code, first_error, parse);
    }
    {
      auto error_code = first_error + 2;
      auto parse = MakeError<Xv::BadControlError>;
      add_parser(error_code, first_error, parse);
    }
  }
}

}  // namespace x11


text:
package main

import (
	"bytes"
	"log"
	"net"
	"time"
	"fmt"
)

type XYZ struct {
	x, y, z float64
}

type Orientation struct {
	rotation float32
	pitch    float32
}

type Game struct {
	chunkManager  *ChunkManager
	mainQueue     chan func(*Game)
	entityManager EntityManager
	players       map[EntityID]*Player
	time          int64
}

func (game *Game) Login(conn net.Conn) {
	username, err := ReadHandshake(conn)
	if err != nil {
		log.Stderr("ReadHandshake: ", err.String())
		return
	}
	log.Stderr("Client ", conn.RemoteAddr(), " connected as ", username)
	WriteHandshake(conn, "-")

	_, _, err = ReadLogin(conn)
	if err != nil {
		log.Stderr("ReadLogin: ", err.String())
		return
	}
	WriteLogin(conn)

	StartPlayer(game, conn, username)
}

func (game *Game) Serve(addr string) {
	listener, e := net.Listen("tcp", addr)
	if e != nil {
		log.Exit("Listen: ", e.String())
	}
	log.Stderr("Listening on ", addr)

	for {
		conn, e2 := listener.Accept()
		if e2 != nil {
			log.Stderr("Accept: ", e2.String())
			continue
		}

		go game.Login(WrapConn(conn))
	}
}

func (game *Game) AddPlayer(player *Player) {
	game.entityManager.AddEntity(&player.Entity)
	game.players[player.EntityID] = player
	game.SendChatMessage(fmt.Sprintf("%s has joined", player.name))
	game.chunkManager.AddPlayer(player)
}

func (game *Game) RemovePlayer(player *Player) {
	game.chunkManager.RemovePlayer(player)
	game.players[player.EntityID] = nil, false
	game.entityManager.RemoveEntity(&player.Entity)
	game.SendChatMessage(fmt.Sprintf("%s has left", player.name))
}

func (game *Game) MulticastPacket(packet []byte, except *Player) {
	for _, player := range game.players {
		if player == except {
			continue
		}

		player.TransmitPacket(packet)
	}
}

func (game *Game) SendChatMessage(message string) {
	buf := &bytes.Buffer{}
	WriteChatMessage(buf, message)
	game.MulticastPacket(buf.Bytes(), nil)
}

func (game *Game) Enqueue(f func(*Game)) {
	game.mainQueue <- f
}

func (game *Game) mainLoop() {
	for {
		f := <-game.mainQueue
		f(game)
	}
}

func (game *Game) timer() {
	ticker := time.NewTicker(1000000000) // 1 sec
	for {
		<-ticker.C
		game.Enqueue(func(game *Game) { game.tick() })
	}
}

func (game *Game) sendTimeUpdate() {
	buf := &bytes.Buffer{}
	WriteTimeUpdate(buf, game.time)
	game.MulticastPacket(buf.Bytes(), nil)
}

func (game *Game) tick() {
	game.time += 20
	game.sendTimeUpdate()
}

func NewGame(chunkManager *ChunkManager) (game *Game) {
	game = &Game{
		chunkManager: chunkManager,
		mainQueue:    make(chan func(*Game), 256),
		players:      make(map[EntityID]*Player),
	}

	go game.mainLoop()
	go game.timer()
	return
}


text:
package org.apache.geode.internal.cache.tier.sockets.command;

import java.io.IOException;

import org.apache.geode.internal.cache.InternalCache;
import org.apache.geode.internal.cache.tier.Command;
import org.apache.geode.internal.cache.tier.MessageType;
import org.apache.geode.internal.cache.tier.sockets.BaseCommand;
import org.apache.geode.internal.cache.tier.sockets.Message;
import org.apache.geode.internal.cache.tier.sockets.ServerConnection;
import org.apache.geode.pdx.internal.EnumInfo;
import org.apache.geode.pdx.internal.TypeRegistry;

public class GetPDXIdForEnum extends BaseCommand {

  private final static GetPDXIdForEnum singleton = new GetPDXIdForEnum();

  public static Command getCommand() {
    return singleton;
  }

  private GetPDXIdForEnum() {}

  @Override
  public void cmdExecute(Message msg, ServerConnection servConn, long start)
      throws IOException, ClassNotFoundException {
    servConn.setAsTrue(REQUIRES_RESPONSE);
    if (logger.isDebugEnabled()) {
      logger.debug("{}: Received get pdx id for enum request ({} parts) from {}",
          servConn.getName(), msg.getNumberOfParts(), servConn.getSocketString());
    }

    EnumInfo enumInfo = (EnumInfo) msg.getPart(0).getObject();

    int enumId;
    try {
      InternalCache cache = servConn.getCache();
      TypeRegistry registry = cache.getPdxRegistry();
      enumId = registry.defineEnum(enumInfo);
    } catch (Exception e) {
      writeException(msg, e, false, servConn);
      servConn.setAsTrue(RESPONDED);
      return;
    }

    Message responseMsg = servConn.getResponseMessage();
    responseMsg.setMessageType(MessageType.RESPONSE);
    responseMsg.setNumberOfParts(1);
    responseMsg.setTransactionId(msg.getTransactionId());
    responseMsg.addIntPart(enumId);
    responseMsg.send(servConn);
    servConn.setAsTrue(RESPONDED);
  }
}


text:
"""
  Author:  Sparrow
  Purpose: downloading image from www.lofter.com in every blog's page once.
  Created: 2016-7.4
  E-mail:  sparrow629@163.com
"""
import re
import urllib
import time
import os

def getHtml(url):
	page = urllib.urlopen(url)
	html = page.read()
	return html

def getImg(html,url,posturl):
	global Number

	reg = r'src="(.*?\.jpg\?.*?)"'
	imgre = re.compile(reg)
	imglist_none = re.findall(imgre, html)
	imglist = list(set(imglist_none))
	# return imglist

	postfix = '.lofter.com'
	blogname = url[7:url.index(postfix)]
	path = 'Lofterimgdownload/%s/' % (blogname)
	if not os.path.exists(path):
		os.makedirs(path)

	if imglist:
		Postname = getPostname(posturl)
		print len(imglist)
		# print imglist
		i = 0
		for imgurl in imglist:
			Number += 1
			Name = Postname + '_' + str(i)
			print "Downloading %s image" % Name
			target = path + '%s.jpg' % Name
			i += 1
			print target
			urllib.urlretrieve(imgurl, target)
	else:
		print 'There is no image!'

def getPost(html):
	reg = r'href="(http://.*?\/post\/.*?)"'
	posturl = re.compile(reg)
	posturllist = re.findall(posturl, html)
	return list(set(posturllist))

def getPostname(posturl):
	reg = r'http://.*?\/post\/(.*)'
	postname = re.compile(reg)
	postnamelist = re.findall(postname, posturl)
	print postnamelist
	if postnamelist:
		return postnamelist[0]
	else:
		postnamelist = ['page1']
		return postnamelist[0]

def home(url):
	reg = r'http://.*?\.lofter\.com/post/.*'
	h = re.compile(reg)
	jhome = re.findall(h,url)
	print jhome
	if jhome :
		print 'Post'
		return False
	else:
		print 'Homepage'
		return True

def getnexturl(url):
	html = getHtml(url)
	reg = r'<a href="(\?page=.+?\&t=\d.*?)"'
	pageturl = re.compile(reg)
	page = re.findall(pageturl, html)
	if page:
		nexturl = pagelists[0] + page[(len(page)-1)]
		pagelists.append(nexturl)
		print nexturl,"adding page %s" % len(pagelists)
		getnexturl(nexturl)
		return pagelists

	else:
		print 'There is no more page'
		return False

if __name__ == '__main__':

	select = 'N'
	while (select == 'N'):
		print '''
		---------------------------------
		Welcome to lofter image download!
		---------------------------------
		Author:  Sparrow
  		Purpose: downloading images from xxx.lofter.com once.
  		Created: 2016-7.4
		'''
		URL = raw_input('Input url: ')
		html = getHtml(URL)

		global Number
		Number = 0

		if home(URL):
			print '''
			which mode you want:
			1.Downloading current page's images.
			2.Downloading all the images from current page to the end of this blog once.
			Notice: If you want to download the entire blog's images, you should copy the format like "http://xxxxxx.lofter.com/"
			'''
			Mode = int(raw_input())
			if Mode == 1:
				print getPost(html)
				print len(getPost(html))
				Posturl = getPost(html)
				for post_url in Posturl:
					imghtml = getHtml(post_url)
					getImg(imghtml,URL,post_url)
				print "Congratulation! Totally finished downloading %s images" % Number
			if Mode == 2:
				pagelists = [URL]
				i = 1
				print getnexturl(URL)
				for nexturl in pagelists:
					nexthtml = getHtml(nexturl)
					print "Downloading Page %s" % i
					i +=1
					print getPost(html)
					print len(getPost(html))
					Posturl = getPost(html)
					for post_url in Posturl:
						imghtml = getHtml(post_url)
						getImg(imghtml,URL,post_url)
				print "Congratulation! Totally finished downloading %s images" % Number

		else:
			post_url = URL
			getImg(html,URL,post_url)
			print "Congratulation! Totally finished downloading %s images" % Number

		select = raw_input("Do you want to quit? [Y/N]")


text:
                            Yesnut

                            Drowning with a Smile


text:
'use strict';var _extends=Object.assign || function(target){for(var i=1;i < arguments.length;i++) {var source=arguments[i];for(var key in source) {if(Object.prototype.hasOwnProperty.call(source,key)){target[key] = source[key];}}}return target;};

var RelayDefaultNetworkLayer=require('./RelayDefaultNetworkLayer');
var RelayPublic=require('./RelayPublic');

RelayPublic.injectNetworkLayer(new RelayDefaultNetworkLayer('/graphql'));

module.exports = _extends({},
RelayPublic,{

DefaultNetworkLayer:RelayDefaultNetworkLayer});


text:
package org.inbloom.gateway.persistence.domain;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import java.util.Date;

/**
 * Created by lloydengebretsen on 2/15/14.
 */
@MappedSuperclass
public abstract class BaseEntity {

    @Column
    private Date createdAt;
    @Column
    private String createdBy;
    @Column
    private Date updatedAt;
    @Column
    private String updatedBy;

    public BaseEntity(String createdBy){
        this.createdBy = createdBy;
        this.createdAt = new Date();
    }

    public BaseEntity()
    {
        super();
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    public String getUpdatedBy() {
        return updatedBy;
    }

    public void setUpdatedBy(String updatedBy) {
        this.updatedBy = updatedBy;
    }

}