text:
package io.subutai.common.metric;

import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;

import io.subutai.common.host.HostId;

/**
 * Alert value interface
 *
 * Example of usage:
 * QuotaAlertValue quotaAlertValue = alert.getAlertValue( QuotaAlertValue.class );
 * StringAlertValue stringAlertValue = alert.getAlertValue( StringAlertValue.class );
 * ExceededQuota v1 = quotaAlertValue.getValue();
 * String v2 = stringAlertValue.getValue();
 */
@JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type" )
@JsonSubTypes( {
        @JsonSubTypes.Type( value = QuotaAlert.class, name = "QuotaAlert" ),
        @JsonSubTypes.Type( value = StringAlert.class, name = "StringAlert" ),
} )
public interface Alert
{
    HostId getHostId();

    <T extends AlertValue> T getAlertValue( Class<T> format );

    String getId();

    long getCreatedTime();

    long getLiveTime();

    boolean validate();
}


text:
- Resolved #10 by adding factory method to return initialised instance of NSURLSessionDataTask (thanks @markst)

## 0.1.6

- Fix #9 by encoding request attribute separator.

## 0.1.5

- Added scripts to build and run tests (Bin/run-build.sh, Bin/run-tests.sh)
- Added fare and duration_in_traffic to response
- Added transit_mode, transit_routing_preference, traffic_model, arrival_time,
departure_time to request

## 0.1.2

- Fixed copy-paste error of kCGGoogleDirectionsResponseAttributeBounds. (thanks @djmadcat)

## 0.1.1

- Fixed init method to initialise locationString property properly.
- Fixed missing summary parsing. (thanks @DmitryPR)

## 0.1.0

Initial release.

redpajama_set_name: RedPajamaGithub


text:
#include "nomlib/graphics/scale2x/scale2x.hpp"

namespace nom {
  namespace priv {

bool scale3x  ( void* source_buffer, void* destination_buffer,
                const int32 source_width, const int32 source_height,
                const int32 bits_per_pixel,
                const int16 source_pitch, int16 destination_pitch
              )
{
  // Save a temporary copy of the *existing* width & height for scaling
  // calculation.
  //int32 width = source_width;
  //int32 height = source_height;

  // The existing video surface pitch (width) is used for scaling calculations.
  //uint16 srcpitch = source_pitch;

  // We must use the new video surface configuration for computing the pitch as
  // this is dependent upon width & height parameters.
  //uint16 dstpitch = destination_pitch;

  // Existing & resulting pixel arrays
  //uint8* srcpix = static_cast<uint8*> ( source_buffer );
  //uint8* dstpix = static_cast<uint8*> ( destination_buffer );

  // Use the existing video surface BPP for choosing scaling algorithm.
  switch ( bits_per_pixel )
  {
    default: // Err, we could not determine a valid color depth!
    {
      return false;
    } // end unsupported color depth
    break;

    case 8:
    {
      // Not implemented
    }
    break;

    case 16:
    {
      // Not implemented
    }
    break;

    case 24:
    {
      // Not implemented
    }
    break;

    case 32:
    {
      // Not implemented
    }
    break;
  } // end switch (bits_per_pixel)

  return false;
}

  } // namespace priv
} // namespace nom


text:
<!DOCTYPE html>

<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, width=device-width">
<link rel="stylesheet" type="text/css" href="../../css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="../../css/main.css">

<input type="hidden" id="sub_test"/>

Launch sub app "IAP Xiaomi Store Demo", choose "XiaoMi Store" and buy some in-app products.

Pre-condition:

Xiaomi MIUI OS 7.0+

      Sub app "IAP Xiaomi Store Demo" can only run a MIUI OS with the Xiaomi Game Center Service. Currently, this app can run on Redmi, Xiaomi Mi4 and Xiaomi Note devices successfully.

Xiaomi account

      To test the IAP API feature, you need a Xiaomi account to login in the MIUI system.

Verify to query the product details and buy the in-app product successfully.


text:
extern crate env_logger;
#[macro_use]
extern crate rosrust;
extern crate rosrust_msg;

use std::time;

fn main() {
    env_logger::init();

    // Fetch args that are not meant for rosrust
    let args: Vec<_> = rosrust::args();

    if args.len() != 3 {
        eprintln!("usage: client X Y");
        return;
    }

    let a = args[1].parse::<i64>().unwrap();
    let b = args[2].parse::<i64>().unwrap();

    // Initialize node
    rosrust::init("add_two_ints_client");

    // Wait ten seconds for the service to appear
    rosrust::wait_for_service("add_two_ints", Some(time::Duration::from_secs(10))).unwrap();

    // Create client for the service
    let client = rosrust::client::<rosrust_msg::roscpp_tutorials::TwoInts>("add_two_ints").unwrap();

    // Synchronous call that blocks the thread until a response is received
    ros_info!(
        "{} + {} = {}",
        a,
        b,
        client
            .req(&rosrust_msg::roscpp_tutorials::TwoIntsReq { a, b })
            .unwrap()
            .unwrap()
            .sum
    );

    // Asynchronous call that can be resolved later on
    let retval = client.req_async(rosrust_msg::roscpp_tutorials::TwoIntsReq { a, b });
    ros_info!("{} + {} = {}", a, b, retval.read().unwrap().unwrap().sum);
}


text:
Create or replace FUNCTION __temp_add_host_permissions_to_gluster_admin_role()
RETURNS VOID
   AS $procedure$
   DECLARE
      v_GLUSTER_ADMIN_ROLE_ID UUID;
BEGIN
      v_GLUSTER_ADMIN_ROLE_ID := 'DEF0000b-0000-0000-0000-DEF00000000b';

--CREATE_CLUSTER
INSERT INTO roles_groups(role_id,action_group_id) SELECT v_GLUSTER_ADMIN_ROLE_ID, 400
WHERE not exists (SELECT role_id, action_group_id FROM roles_groups
        WHERE role_id=v_GLUSTER_ADMIN_ROLE_ID and action_group_id=400);

--EDIT_CLUSTER_CONFIGURATION
INSERT INTO roles_groups(role_id,action_group_id) SELECT v_GLUSTER_ADMIN_ROLE_ID, 401
WHERE not exists (SELECT role_id, action_group_id FROM roles_groups
        WHERE role_id=v_GLUSTER_ADMIN_ROLE_ID and action_group_id=401);

--DELETE_CLUSTER
INSERT INTO roles_groups(role_id,action_group_id) SELECT v_GLUSTER_ADMIN_ROLE_ID, 402
WHERE not exists (SELECT role_id, action_group_id FROM roles_groups
        WHERE role_id=v_GLUSTER_ADMIN_ROLE_ID and action_group_id=402);

--CONFIGURE_CLUSTER_NETWORK
INSERT INTO roles_groups(role_id,action_group_id) SELECT v_GLUSTER_ADMIN_ROLE_ID, 403
WHERE not exists (SELECT role_id, action_group_id FROM roles_groups
        WHERE role_id=v_GLUSTER_ADMIN_ROLE_ID and action_group_id=403);

--ASSIGN_CLUSTER_NETWORK
INSERT INTO roles_groups(role_id,action_group_id) SELECT v_GLUSTER_ADMIN_ROLE_ID, 404
WHERE not exists (SELECT role_id, action_group_id FROM roles_groups
        WHERE role_id=v_GLUSTER_ADMIN_ROLE_ID and action_group_id=404);

--CREATE_HOST
INSERT INTO roles_groups(role_id,action_group_id) SELECT v_GLUSTER_ADMIN_ROLE_ID, 100
WHERE not exists (SELECT role_id, action_group_id FROM roles_groups
        WHERE role_id=v_GLUSTER_ADMIN_ROLE_ID and action_group_id=100);

--EDIT_HOST_CONFIGURATION
INSERT INTO roles_groups(role_id,action_group_id) SELECT v_GLUSTER_ADMIN_ROLE_ID, 101
WHERE not exists (SELECT role_id, action_group_id FROM roles_groups
        WHERE role_id=v_GLUSTER_ADMIN_ROLE_ID and action_group_id=101);

--DELETE_HOST
INSERT INTO roles_groups(role_id,action_group_id) SELECT v_GLUSTER_ADMIN_ROLE_ID, 102
WHERE not exists (SELECT role_id, action_group_id FROM roles_groups
        WHERE role_id=v_GLUSTER_ADMIN_ROLE_ID and action_group_id=102);

--MANIPULATE_HOST
INSERT INTO roles_groups(role_id,action_group_id) SELECT v_GLUSTER_ADMIN_ROLE_ID, 103
WHERE not exists (SELECT role_id, action_group_id FROM roles_groups
        WHERE role_id=v_GLUSTER_ADMIN_ROLE_ID and action_group_id=103);

--CONFIGURE_HOST_NETWORK
INSERT INTO roles_groups(role_id,action_group_id) SELECT v_GLUSTER_ADMIN_ROLE_ID, 104
WHERE not exists (SELECT role_id, action_group_id FROM roles_groups
        WHERE role_id=v_GLUSTER_ADMIN_ROLE_ID and action_group_id=104);

RETURN;
END; $procedure$
LANGUAGE plpgsql;

select __temp_add_host_permissions_to_gluster_admin_role();
drop function __temp_add_host_permissions_to_gluster_admin_role();


text:
<?php

namespace Faulancer\Test\Unit;

use Faulancer\ServiceLocator\ServiceLocator;
use Faulancer\Session\SessionManager;
use PHPUnit\Framework\TestCase;

/**
 * File SessionManagerTest.php
 *
 * @author Florian Knapp <office@florianknapp.de>
 */
class SessionManagerTest extends TestCase
{

    /** @var SessionManager */
    protected $sessionManager;

    /**
     * Define session manager instance
     */
    public function setUp()
    {
        $this->sessionManager = ServiceLocator::instance()->get(SessionManager::class);
    }

    public function tearDown()
    {
        $this->sessionManager->destroySession();
    }

    public function testGetSetKey()
    {
        $this->sessionManager->set('testKey', 'testValue');

        $this->assertTrue(is_string($this->sessionManager->get('testKey')));
        $this->assertSame('testValue', $this->sessionManager->get('testKey'));
    }

    public function testDeleteKey()
    {
        $this->sessionManager->set('testKey', 'testValue');

        $this->sessionManager->delete('testKey');
        $this->assertEmpty($this->sessionManager->get('testKey'));
    }

    public function testGetSetFlashbag()
    {
        $this->sessionManager->setFlashMessage('testKey', 'testValue');

        $value = $this->sessionManager->getFlashMessage('testKey');
        $this->assertTrue(is_string($value));
        $this->assertEmpty($this->sessionManager->getFlashMessage('testKey'));
        $this->assertNull($this->sessionManager->getFlashMessage('testKey'));

        $data = [
            'flashbagKey1' => 'flashbagValue1',
            'flashbagKey2' => 'flashbagValue2',
            'flashbagKey3' => 'flashbagValue3',
            'flashbagKey4' => 'flashbagValue4',
            'flashbagKey5' => 'flashbagValue5',
        ];

        $this->sessionManager->setFlashMessage($data);

        foreach ($data as $key => $value) {

            $this->assertTrue($this->sessionManager->hasFlashMessage($key));
            $this->assertSame($value, $this->sessionManager->getFlashMessage($key));
            $this->assertNull($this->sessionManager->getFlashMessage($key));

        }
    }

    public function testHasSession()
    {
        $this->assertFalse($this->sessionManager->hasSession());
    }

    public function testHasKeyValid()
    {
        $this->sessionManager->set('test', 'test2');
        $this->assertTrue($this->sessionManager->has('test'));
    }

    public function testHasKeyInvalid()
    {
        $this->assertFalse($this->sessionManager->has('non_existent'));
    }

    public function testDeleteNonExistentKey()
    {
        $this->assertFalse($this->sessionManager->delete('nonExistent'));
    }

    public function testHasFlashbagKey()
    {
        $this->sessionManager->setFlashMessage('testKey', 'testValue');
        $this->assertTrue($this->sessionManager->hasFlashMessage('testKey'));
        $this->assertTrue(is_string($this->sessionManager->getFlashMessage('testKey')));
    }

    public function testDestroyAndCheckForSession()
    {
        $this->sessionManager->destroySession();
        $this->assertFalse($this->sessionManager->hasSession());
    }

}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:ignore="UnusedAttribute">

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/my_toolbar"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary"
        android:elevation="4dp"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

    <!-- below is the top half of the screen -->

    <FrameLayout
        android:id="@+id/flTop"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight=".6"
        android:background="@color/main_activity_top_bg">

        <!-- input window -->

        <FrameLayout
            android:id="@+id/inputWindowWrapper"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:background="@android:color/white"
            android:elevation="2dp">

            <net.studymongolian.chimee.InputWindow
                android:id="@+id/resizingScrollView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />

        </FrameLayout>

        <FrameLayout
            android:id="@+id/showKeyboardButton"
            android:layout_width="48dp"
            android:layout_height="48dp"
            android:layout_margin="16dp"
            android:layout_gravity="bottom|end"
            android:background="@drawable/round_button"
            android:focusable="true"
            android:clickable="true"
            android:onClick="onShowKeyboardButtonClick"
            android:visibility="invisible"
            android:alpha="0.5"
            android:elevation="4dp">

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:contentDescription="@string/content_description_show_keyboard"
                android:src="@drawable/ic_keyboard_32dp" />
        </FrameLayout>

    </FrameLayout>

    <net.studymongolian.chimee.CustomImeContainer
        android:id="@+id/imeContainer"
        android:layout_width="wrap_content"
        android:layout_height="0dp"
        android:layout_weight=".4"
        android:background="@color/very_light_grey">

        <net.studymongolian.chimee.KeyboardChagaanTolgoi
            style="@style/KeyboardStyle"
            app:primaryTextSize="@dimen/aeiou_kbd_text_size"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:candidatesLocation="vertical_left" />

        <net.studymongolian.chimee.KeyboardComputer
            style="@style/KeyboardStyle"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:candidatesLocation="horizontal_top" />

        <net.studymongolian.mongollibrary.KeyboardLatin
            style="@style/KeyboardStyle"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:candidatesLocation="none" />

        <net.studymongolian.mongollibrary.KeyboardCyrillic
            style="@style/KeyboardStyle"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:candidatesLocation="none" />

    </net.studymongolian.chimee.CustomImeContainer>

</LinearLayout>


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<title>Hello World!</title>

	<meta name="author" content="Matt Winchell">

	<meta name="viewport" content="width=device-width, initial-scale=1.0">

	<link href="/assets/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
	<link href="/assets/resources/font-awesome/css/font-awesome.min.css" rel="stylesheet">
	<link href="/assets/resources/syntax/syntax.css" rel="stylesheet">
	<link href="/assets/css/style.css" rel="stylesheet">

	<link rel="alternate" type="application/rss+xml" title="" href="/feed.xml">

			<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
				Toggle navigation

			</button>

				Matt WInchell

Home

Categories

Tags

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

		</button>

 Home

 Categories

 Tags

 Top of Page

		<! -- sidebar.html -->

        Matt WInchell

	Jack of all trades, master of none

<! -- sidebar.html end -->

Hello World!

	   June
	   5th,

	   2014

With most things setup I will start documenting some of the projects I'm working on. There are several of them and all are at various stages of development.

					general (2)
					,

					tasks (1)

					tasks (4)
					,

					lists (3)

Share Post

          Twitter

          Facebook

          Google+

Matt Winchell

Jack of all trades, master of none

← Previous

Next →

				© 2014 Matt Winchell.


text:
killall -q polybar

# Wait until the processes have been shut down
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done

source ~/.dotfiles/polybar-variables.sh

PRIMARY=$(xrandr --query | grep " connected" | grep "primary" | cut -d" " -f1)
OTHERS=$(xrandr --query | grep " connected" | grep -v "primary" | cut -d" " -f1)

# Launch on primary monitor
MONITOR=$PRIMARY POLYBAR_TRAY_POSITION=right polybar --reload top &
MONITOR=$PRIMARY POLYBAR_TRAY_POSITION=right polybar --reload bottom &

# Launch on all other monitors
for m in $OTHERS; do
    MONITOR=$m polybar --reload top &
    MONITOR=$m polybar --reload bottom &
done


text:
package com.deftwun.zombiecopter;

public enum SpriteLayer {
	Back,
	Front
}


text:
package org.spongycastle.asn1.misc;

import org.spongycastle.asn1.ASN1ObjectIdentifier;

public interface MiscObjectIdentifiers
{
    //
    // Netscape
    //       iso/itu(2) joint-assign(16) us(840) uscompany(1) netscape(113730) cert-extensions(1) }
    //
    /** Netscape cert extensions OID base: 2.16.840.1.113730.1  */
    static final ASN1ObjectIdentifier    netscape                = new ASN1ObjectIdentifier("2.16.840.1.113730.1");
    /** Netscape cert CertType OID: 2.16.840.1.113730.1.1  */
    static final ASN1ObjectIdentifier    netscapeCertType        = netscape.branch("1");
    /** Netscape cert BaseURL OID: 2.16.840.1.113730.1.2  */
    static final ASN1ObjectIdentifier    netscapeBaseURL         = netscape.branch("2");
    /** Netscape cert RevocationURL OID: 2.16.840.1.113730.1.3  */
    static final ASN1ObjectIdentifier    netscapeRevocationURL   = netscape.branch("3");
    /** Netscape cert CARevocationURL OID: 2.16.840.1.113730.1.4  */
    static final ASN1ObjectIdentifier    netscapeCARevocationURL = netscape.branch("4");
    /** Netscape cert RenewalURL OID: 2.16.840.1.113730.1.7  */
    static final ASN1ObjectIdentifier    netscapeRenewalURL      = netscape.branch("7");
    /** Netscape cert CApolicyURL OID: 2.16.840.1.113730.1.8  */
    static final ASN1ObjectIdentifier    netscapeCApolicyURL     = netscape.branch("8");
    /** Netscape cert SSLServerName OID: 2.16.840.1.113730.1.12  */
    static final ASN1ObjectIdentifier    netscapeSSLServerName   = netscape.branch("12");
    /** Netscape cert CertComment OID: 2.16.840.1.113730.1.13  */
    static final ASN1ObjectIdentifier    netscapeCertComment     = netscape.branch("13");

    //
    // Verisign
    //       iso/itu(2) joint-assign(16) us(840) uscompany(1) verisign(113733) cert-extensions(1) }
    //
    /** Verisign OID base: 2.16.840.1.113733.1 */
    static final ASN1ObjectIdentifier   verisign                = new ASN1ObjectIdentifier("2.16.840.1.113733.1");

    /** Verisign CZAG (Country,Zip,Age,Gender) Extension OID: 2.16.840.1.113733.1.6.3 */
    static final ASN1ObjectIdentifier    verisignCzagExtension   = verisign.branch("6.3");
    /** Verisign D&B D-U-N-S number Extension OID: 2.16.840.1.113733.1.6.15 */
    static final ASN1ObjectIdentifier    verisignDnbDunsNumber   = verisign.branch("6.15");

    //
    // Novell
    //       iso/itu(2) country(16) us(840) organization(1) novell(113719)
    //
    /** Novell OID base: 2.16.840.1.113719 */
    static final ASN1ObjectIdentifier    novell                  = new ASN1ObjectIdentifier("2.16.840.1.113719");
    /** Novell SecurityAttribs OID: 2.16.840.1.113719.1.9.4.1 */
    static final ASN1ObjectIdentifier    novellSecurityAttribs   = novell.branch("1.9.4.1");

    //
    // Entrust
    //       iso(1) member-body(16) us(840) nortelnetworks(113533) entrust(7)
    //
    /** NortelNetworks Entrust OID base: 1.2.840.113533.7 */
    static final ASN1ObjectIdentifier    entrust                 = new ASN1ObjectIdentifier("1.2.840.113533.7");
    /** NortelNetworks Entrust VersionExtension OID: 1.2.840.113533.7.65.0 */
    static final ASN1ObjectIdentifier    entrustVersionExtension = entrust.branch("65.0");
}


text:
module Thinkspace
  module Common
    module Concerns
      module SerializerOptions
        module Admin
          module SpaceUsers

            def update(serializer_options); end;
            def create(serializer_options); end;
            def destroy(serializer_options); end;
            def resend(serializer_options); end;
            def activate(serializer_options); end;
            def inactivate(serializer_options); end;

          end
        end
      end
    end
  end
end


text:
require File.dirname(__FILE__) + '/pdf_parser'

class FPDIPDFParser < PDFParser
  attr_accessor :fpdi, :availableBoxes, :pages, :pageno, :filename, :c

  def initialize(filename, fpdi)
    @availableBoxes = ['/MediaBox','/CropBox','/BleedBox','/TrimBox','/ArtBox']
    @fpdi = fpdi
    @filename = filename
    @pages = []
    super(filename)
    pages = self.pdf_resolve_object(@c, @root[1][1]['/Pages'])
    self.read_pages(@c, pages, @pages)
    @page_count = @pages.length
  end

  def Error(msg)
    self.fpdi.Error(msg)
  end

  def getPageCount
    @page_count
  end

  def setPageno(pageno)
    pageno = pageno - 1
    if pageno < 0 || pageno >= self.getPageCount
      self.fpdi.Error("Pagenumber is wrong!")
    end

    @pageno = pageno
  end

  def getPageResources
    self._getPageResources(@pages[@pageno])
  end

  def _getPageResources(obj)
    obj = self.pdf_resolve_object(@c, obj)
    if obj[1][1]['/Resources']
      res = self.pdf_resolve_object(@c, obj[1][1]['/Resources'])
      return res[1] if res['0'] == PDF_TYPE_OBJECT
      return res
    else
      unless obj[1][1]['/Parent']
        return false
      else
        res = self.getPageResources(obj[1][1]['/Parent'])
        return res[1] if res['0'] == PDF_TYPE_OBJECT
        return res
      end
    end
  end

  def getContent
    buffer = ''

    if @pages[@pageno][1][1]['/Contents']
      contents = self.getPageContent(@pages[@pageno][1][1]['/Contents'])
      contents.each { |tmp_content| buffer += self.rebuildContentStream(tmp_content) + ' ' }
    end

    buffer
  end

  def getPageContent(content_ref)
    contents = []

    if content_ref[0] == PDF_TYPE_OBJREF
      content = self.pdf_resolve_object(@c, content_ref)
      if content[1][0] == PDF_TYPE_ARRAY
        contents = self.getPageContent(content[1])
      else
        contents.push(content)
      end
    elsif content_ref[0] == PDF_TYPE_ARRAY
      content_ref.each { |tmp_content_ref| contents.update(self.getPageContent(tmp_content_ref)) }
    end

    contents
  end

  def rebuildContentStream(obj)
    filters = []

    if obj[1][1]['/Filter']
      _filter = obj[1][1]['/Filter']

      if _filter[0] == PDF_TYPE_TOKEN
        filters.push(_filter)
      elsif _filter[0] == PDF_TYPE_ARRAY
        filters = _filter[1]
      end
    end

    stream = obj[2][1]

    filters.each do |filter|
      case _filter[1]
      when '/FlateDecode' then stream = Zlib::Deflate.deflate(stream)
      when nil then stream = stream
      else
        if filterName = _filter[1].match(/^\/[a-z85]*$/i)
          filterName = _filter[1][1..-1]
          # Load filter class
          # decoder = filterName.new(fpdi)
          stream = decoder.decode(stream)
        else
          self.fpdi.Error(sprintf("Unsupported Filter: %s",_filter[1]))
        end
      end
    end

    stream
  end

  def getPageBox(page, box_index)
    page = self.pdf_resolve_object(@c, page)
    box = nil
    box = page[1][1][box_index] if page[1][1][box_index]

    if box && box[0] == PDF_TYPE_OBJREF
      tmp_box = self.pdf_resolve_object(@c, box)
      box = tmp_box[1]
    end

    if box && box[0] == PDF_TYPE_ARRAY
      b = box[1]
      return {
              "x" => b[0][1].to_i / self.fpdi.k.to_i,
              "y" => b[1][1].to_i / self.fpdi.k.to_i,
              "w" => ((b[0][1].to_i - b[2][1].to_i)/self.fpdi.k.to_i).abs,
              "h" => ((b[1][1].to_i - b[3][1].to_i)/self.fpdi.k.to_i).abs
              }
    elsif !page[1][1]['/Parent']
      return false
    else
      self.getPageBox(self.pdf_resolve_object(@c, page[1][1]['/Parent']), box_index)
    end
  end

  def getPageBoxes(pageno)
    self._getPageBoxes(@pages[@pageno - 1])
  end

  def _getPageBoxes(page)
    boxes = {}

    @availableBoxes.each do |box|
      if _box = self.getPageBox(page, box)
        boxes[box] = _box
      end
    end

    boxes
  end

  def getPageRotation(pageno)
    self._getPageRotation(@pages[pageno - 1])
  end

  def _getPageRotation(obj)
    obj = self.pdf_resolve_object(@c, obj)
    if obj[1][1]['/Rotate']
      res = self.pdf_resolve_object(@c, obj[1][1]['/Rotate'])
      return res[1] if res[0] == PDF_TYPE_OBJECT
      return res
    else
      if obj[1][1]['/Parent']
        return false
      else
        res = self.getPageRotation(obj[1][1]['/Parent'])
        return res[1] if res[0] == PDF_TYPE_OBJECT
        return res
      end
    end
  end

  def read_pages(c, pages, result)
    kids = self.pdf_resolve_object(c, pages[1][1]['/Kids'])

    if !kids.is_a?(Array)
      self.fpdi.Error('Cannot find /Kids in current /Page-Dictionary')
    else
      kids[1].each do |v|
        pg = self.pdf_resolve_object(c, v)
        if pg[1][1]['/Type'][1] == '/Pages'
          self.read_pages(c, pg, result)
        else
          result.push(pg)
        end
    	end
    end
  end

  def getPDFVersion
    super

    if self.fpdi.importVersion && self.pdfVersion > self.fpdi.importVersion
      self.fpdi.importVersion = self.pdfVersion
    end
  end
end


text:
require 'typo_related_posts_plus'

ActiveRecord::Base.send :include, TypoRelatedPostsPlus


text:
       Gulp Angular

Home

About

Contact

Current date: {{ date | date:'yyyy-MM-dd' }}


text:
package org.test;

import com.kroger.oss.snowGlobe.AppServiceCluster;
import com.kroger.oss.snowGlobe.NginxRpBuilder;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;

import static com.kroger.oss.snowGlobe.AppServiceCluster.makeHttpWebService;
import static com.kroger.oss.snowGlobe.AppServiceCluster.makeHttpsWebService;
import static com.kroger.oss.snowGlobe.NginxRpBuilder.runNginxWithUpstreams;
import static com.kroger.oss.snowGlobe.call.CallUtility.make;
import static com.kroger.oss.snowGlobe.call.TestRequest.getRequest;

public class ExampleTest {

    public AppServiceCluster loginUpstreamApp = makeHttpsWebService("Login_Cluster");
    public AppServiceCluster contentUpstreamApp = makeHttpWebService("Content_Cluster");
    public AppServiceCluster cartUpstreamApp = makeHttpsWebService("Cart_Cluster");
    public NginxRpBuilder nginxReverseProxy = runNginxWithUpstreams(loginUpstreamApp, contentUpstreamApp, cartUpstreamApp);

    @Test
    public void should_301_http_to_https() {
        make(getRequest("http://www.nginx-test.com").to(nginxReverseProxy))
                .andExpectResponseHeader("Location", "https://www.nginx-test.com/")
                .expectResponseCode(301);
    }

    @Test
    public void should_properly_route_homepage() {
        make(getRequest("https://www.nginx-test.com").to(nginxReverseProxy))
                .andExpectClusterName("Content_Cluster")
                .expectResponseCode(200);
    }

    @Test
    public void should_properly_route_login() {
        make(getRequest("https://www.nginx-test.com/login").to(nginxReverseProxy))
                .andExpectClusterName("Login_Cluster")
                .expectResponseCode(200);
    }

    @Test
    public void should_properly_route_checkout() {
        make(getRequest("https://www.nginx-test.com/checkout").to(nginxReverseProxy))
                .andExpectClusterName("Cart_Cluster")
                .andExpectAppPath("/cart/checkout")
                .expectResponseCode(200);
    }
}


text:
import tkinter,tkinter.font
import time
import os
import random
import math
import simpleaudio as sa

#Beware: what you are about to read is ugly, bloody code...

class simpleapp_tk(tkinter.Tk):
    def __init__(self,parent):
        tkinter.Tk.__init__(self,parent)
        self.parent = parent
        self.initialize()

    def initialize(self):

        ##Defining variables and arrays

        self.HOME = os.getcwd()
        self.songDir = os.path.join(self.HOME,'.NTT')
        if not os.path.exists(self.songDir):
            os.mkdir(self.songDir)
        self.songListFile = os.path.join(self.songDir,"SongList.txt")
        self.randomListFile = os.path.join(self.songDir,"RandomList.txt")
        self.counter = 0

        self.colorArray = ["red","blue","yellow","green","orange","purple","brown","pink","white","black"]
        self.textColorArray = ["white","white","black","white","black","white","white","black","black","white"]

        self.TeamNum = tkinter.IntVar()
        self.TeamNum.set(2)

        self.countdownLength = 30
        self.countUp = 0
        self.timeOut = tkinter.StringVar()
        self.timeOut.set("Time's up!")
        self.p = sa.WaveObject(b'').play()

        self.defaultFontSize=12

        self.Font = tkinter.font.Font(family="system",size=self.defaultFontSize)
        self.scoreFont = tkinter.font.Font(family="system",size=int(self.defaultFontSize*0.75))
        self.gbFont = tkinter.font.Font(family="system",size=self.defaultFontSize)

        self.timer=tkinter.IntVar()
        self.timer.set(self.countdownLength)

        ##Making the Menu

        self.menu = tkinter.Menu()
        self.menu.add_command(label="Launch Board",command=self.launchBoard)
        self.menu.add_command(label="Launch editor",command=self.launchEditor)
        self.config(menu=self.menu)

        self.resizable(True,True)
        self.update()
        self.geometry(self.geometry())
        self.grid()

        #Creating the Control Window
        self.introLabel=tkinter.Label(self,text="Launch a new board to begin the game",font=self.Font)
        self.introLabel.grid(column=0,row=0,sticky="NSEW")

    ##Function definitions

    def redefineAndRandomize(self):
        with open(self.songListFile) as f:
            self.songString = f.read()
        self.songArray = self.songString.splitlines()
        self.songNumber = len(self.songArray)

        self.songRandom = random.sample(range(self.songNumber), self.songNumber)
        with open(self.randomListFile,'w') as self.RLF:
            self.newSongList = list(range(self.songNumber))
            for item in range(self.songNumber):
                self.newSongList[item] = self.songArray[self.songRandom[item]]
            self.RLF.writelines( "%s\n" % item for item in self.newSongList )

    def launchEditor(self):
        self.redefineAndRandomize()
        self.ed = tkinter.Toplevel(self)
        self.ed.total = tkinter.Label(self.ed,text="Songs in list: %s" % self.songNumber)
        self.ed.total.grid(row=0,sticky="NSEW")
        self.ed.filepath = tkinter.StringVar()
        self.ed.showName = tkinter.StringVar()
        self.ed.songName = tkinter.StringVar()
        self.ed.filepathEntry=tkinter.Entry(self.ed,textvariable=self.ed.filepath)
        self.ed.filepathEntry.grid(row=1,sticky="NSEW")
        self.ed.showNameEntry=tkinter.Entry(self.ed,textvariable=self.ed.showName)
        self.ed.showNameEntry.grid(row=2,sticky="NSEW")
        self.ed.songNameEntry=tkinter.Entry(self.ed,textvariable=self.ed.songName)
        self.ed.songNameEntry.grid(row=3,sticky="NSEW")
        self.ed.filepath.set("Enter file name here")
        self.ed.showName.set("Enter show/artist name here")
        self.ed.songName.set("Enter song name here")
        self.ed.saveNew = tkinter.Button(self.ed,text="Save",command=self.saveSong)
        self.ed.saveNew.grid(row=4,sticky="NSEW")
        self.ed.grid()

    def saveSong(self):
        self.ed.newAppendage = []
        if self.ed.showName.get():
            if self.ed.showName.get() != "Enter show name here":
                self.ed.newAppendage.append(self.ed.showName.get())
        if self.ed.songName.get():
            if self.ed.songName.get() != "Enter song name here":
                self.ed.newAppendage.append(self.ed.songName.get())
        if len(self.ed.newAppendage) == 2 and self.ed.filepath.get() != "Enter file name here":
            self.ed.confirm = tkinter.Toplevel(self.ed)
            self.ed.confirm.ask = tkinter.Label(self.ed.confirm,text="Add %s for the information for %s?" % (str(self.ed.newAppendage),self.ed.filepath.get()))
            self.ed.confirm.ask.grid(row=0,column=0,columnspan=2,sticky="NSEW")
            self.ed.confirm.yes = tkinter.Button(self.ed.confirm,text="Yes",command=self.saveConfirm)
            self.ed.confirm.yes.grid(row=1,column=0,sticky="NSEW")
            self.ed.confirm.no = tkinter.Button(self.ed.confirm,text="No",command=self.saveDeny)
            self.ed.confirm.no.grid(row=1,column=1,sticky="NSEW")
            self.ed.confirm.grid()

    def saveConfirm(self):
        with open(self.songListFile,'a') as tunes:
            tunes.write(str(self.ed.newAppendage+[self.ed.filepath.get()])+'\n')
        self.ed.filepath.set("Enter file name here")
        self.ed.showName.set("Enter show name here")
        self.ed.songName.set("Enter song name here")
        self.redefineAndRandomize()
        self.ed.total.config(text="Songs in list: %s" % self.songNumber)
        self.ed.confirm.destroy()

    def saveDeny(self):
        self.ed.confirm.destroy()

    def autoSize(self):
        scale=35
        self.ws = self.winfo_width()
        self.Font.config(size=int(math.ceil(self.ws/scale)))
        self.scoreFont.config(size=int(math.ceil(self.ws/scale*0.75)))
        self.gb.ws = self.gb.winfo_width()
        self.gbFont.config(size=int(math.ceil(self.gb.ws/scale)))

    def launchBoard(self):
        self.menu.add_command(label="Auto-adjust font size",command=self.autoSize)
        self.menu.delete(1,2)
        self.menu.team = tkinter.Menu(self,tearoff=0)
        for i in range(1,11):
            exec('def changeTo'+str(i)+'():'+
                '\n    app.TeamNum.set('+str(i)+')'+
                '\n    app.updateTeam()')
            exec('self.menu.team.add_command(label="'+str(i)+'",command=changeTo'+str(i)+')')
        self.menu.add_cascade(label="Number of Teams",menu=self.menu.team)
        self.menu.navi = tkinter.Menu(self,tearoff=0)
        self.menu.navi.add_command(label="Skip",command=self.skipIt)
        self.menu.navi.add_command(label="Previous",command=self.goBack)
        self.menu.navi.add_command(label="Play this song",command=self.playsnip)
        self.menu.add_cascade(label="Navigation",menu=self.menu.navi)
        self.changeControlBoard()

        self.gb = tkinter.Toplevel(self)
        self.gb.info = tkinter.Frame(self.gb)
        self.gb.info.grid(row=0,sticky="NSEW")
        self.songsRemaining = tkinter.StringVar()
        self.songsRemaining.set("Songs left: %r" % self.songNumber)
        self.gb.info.remaining = tkinter.Label(self.gb.info,bg="#dddddd",textvariable=self.songsRemaining,relief="sunken",font=self.gbFont)
        self.gb.info.remaining.grid(row=0,column=0,sticky="NSEW")
        self.gb.info.clock = tkinter.Label(self.gb.info,bg="#dddddd",textvariable=self.timer,relief="sunken",font=self.gbFont)
        self.gb.info.clock.grid(row=0,column=1,sticky="NSEW")
        for i,thing in enumerate(["Show","Song"]):
            exec('self.gb.info.'+thing+' = tkinter.Label(self.gb.info,bg="black",textvariable=self.current'+thing+',font=self.gbFont)')
            exec('self.gb.info.'+thing+'.grid(row='+str(i+1)+',column=0,columnspan=2,sticky="NSEW")')
        self.gb.info.rowconfigure(0,weight=1)
        self.gb.info.rowconfigure(1,weight=4)
        self.gb.info.rowconfigure(2,weight=4)
        self.gb.info.columnconfigure(0,weight=1)
        self.gb.info.columnconfigure(1,weight=1)

        self.gb.team = tkinter.Frame(self.gb)
        self.gb.team.grid(row=1,sticky="NSEW")
        for i in range(1,11):
            exec('app.team'+str(i)+'=tkinter.IntVar()')
            for op in ["+","-"]:
                if op == "+":
                    oper="Add"
                else:
                    oper="Sub"
                exec('def team'+str(i)+oper+'point():'+
                    '\n    app.team'+str(i)+'.set(eval(str(app.team'+str(i)+'.get())+"'+op+'1"))')
                exec('app.team'+str(i)+oper+'Butt=tkinter.Button(self.team,bg=self.colorArray['+str(i-1)+'],fg=self.textColorArray['+str(i-1)+'],text="'+oper+'",command=team'+str(i)+oper+'point,font=self.scoreFont)')
            exec('app.gb.team.team'+str(i)+'lab=tkinter.Label(self.gb.team,bg=self.colorArray['+str(i-1)+'],fg=self.textColorArray['+str(i-1)+'],textvariable=self.team'+str(i)+',font=self.gbFont)')
            exec('app.team'+str(i)+'lab=tkinter.Label(self.team,bg=self.colorArray['+str(i-1)+'],fg=self.textColorArray['+str(i-1)+'],textvariable=self.team'+str(i)+',font=self.scoreFont)')

        self.gb.team.rowconfigure(0,weight=1)
        self.gb.columnconfigure(0,weight=1)
        self.gb.rowconfigure(0,weight=7)
        self.gb.rowconfigure(1,weight=1)

        self.updateTeam()
        self.gb.resizable(True,True)
        self.gb.update()
        self.gb.geometry(self.gb.geometry())
        self.gb.grid()

    def changeControlBoard(self):
        self.introLabel.grid_remove()
        self.info = tkinter.Frame(self)
        self.info.grid(row=0,column=0,columnspan=3,sticky="NSEW")
        self.team = tkinter.Frame(self)
        self.team.grid(row=1,sticky="NSEW")
        self.PlayButt = tkinter.Button(self,text="Play song",command=self.beginCountdown,font=self.Font)
        self.PlayButt.grid(row=1,column=1,sticky="NSEW")
        self.clock = tkinter.Label(self,bg="#dddddd",textvariable=self.timer,relief="sunken",font=self.gbFont)
        self.clock.grid(row=1,column=2,sticky="NSEW")
        for thing in ["row","column"]:
            for i in [0,1]:
                exec('self.'+thing+'configure('+str(i)+',weight=1)')
        self.redefineAndRandomize()
        for i,thing in enumerate(["Show","Song"]):
            exec('self.current'+thing+'=tkinter.StringVar()')
            exec('self.current'+thing+'.set(eval(self.newSongList[0])['+str(i)+'])')
            exec('self.info.'+thing+' = tkinter.Label(self.info,textvariable=self.current'+thing+',font=self.Font,relief="sunken")')
            exec('self.info.'+thing+'.grid(row='+str(i)+',column=0,sticky="NSEW")')
            exec('def reveal'+thing+'():'+
                '\n    app.gb.palette = ["f","d","b"]'+
                '\n    app.gb.bg = "#"'+
                '\n    for i in range(6):'+
                '\n        app.gb.bg = app.gb.bg + app.gb.palette[int(random.random()*3)-1]'+
                '\n    if  app.info.reveal'+thing+'Butt.config("relief")[-1] == "raised":'+
                '\n        app.gb.info.'+thing+'.config(bg=app.gb.bg)'+
                '\n        app.info.reveal'+thing+'Butt.config(relief="sunken",text="Hide")'
                '\n    else:'
                '\n        app.gb.info.'+thing+'.config(bg="#000000")'+
                '\n        app.info.reveal'+thing+'Butt.config(relief="raised",text="Reveal")')
            exec('self.info.reveal'+thing+'Butt = tkinter.Button(self.info,state="disabled",text="Reveal",command=reveal'+thing+',font=self.Font)')
            exec('self.info.reveal'+thing+'Butt.grid(row='+str(i)+',column=1,sticky="NSEW")')
        for thing in ["row","column"]:
            for i in [0,1]:
                exec('self.info.'+thing+'configure('+str(i)+',weight=1)')
        for i in range(0,3):
            exec('self.team.rowconfigure('+str(i)+',weight=1)')

    def updateTeam(self):
        for i in range(1,11):
            if i <= self.TeamNum.get():
                exec('app.gb.team.team'+str(i)+'lab.grid(column='+str(i-1)+',row=0,sticky="NSEW")')
                exec('app.gb.team.columnconfigure('+str(i-1)+',weight=1)')
                exec('app.team'+str(i)+'lab.grid(column='+str(i-1)+',row=1,sticky="NSEW")')
                exec('app.team'+str(i)+'AddButt.grid(column='+str(i-1)+',row=0,sticky="NSEW")')
                exec('app.team'+str(i)+'SubButt.grid(column='+str(i-1)+',row=2,sticky="NSEW")')
                exec('app.team.columnconfigure('+str(i-1)+',weight=1)')
            else:
                exec('app.gb.team.team'+str(i)+'lab.grid_remove()')
                exec('app.gb.team.columnconfigure('+str(i-1)+',weight=0)')
                exec('app.team'+str(i)+'lab.grid_remove()')
                exec('app.team'+str(i)+'AddButt.grid_remove()')
                exec('app.team'+str(i)+'SubButt.grid_remove()')
                exec('app.team.columnconfigure('+str(i-1)+',weight=0)')

    def beginCountdown(self):
        if self.PlayButt.config("relief")[-1]=="sunken":
            self.skipIt()
            self.p.stop()
            self.ongoingTimer = False
        else:
            self.PlayButt.config(relief="sunken",text="Reset")
            self.playsnip()
            self.ongoingTimer = True
            self.countdown(self.currentSong.get())
            self.info.revealShowButt.config(state="normal")
            self.info.revealSongButt.config(state="normal")

    def skipIt(self):
        if self.songNumber > 0:
            if self.p.is_playing():
                self.p.stop()
            self.countUp=self.countUp+1
            self.songNumber=self.songNumber-1
            self.updateCells()

    def goBack(self):
        if self.songNumber < len(self.songArray):
            if self.p.is_playing():
                self.p.stop()
            self.countUp=self.countUp-1
            self.songNumber=self.songNumber+1
            self.updateCells()

    def updateCells(self):
        self.ongoingTimer = False
        self.PlayButt.config(relief="raised",text="Play song")
        self.songsRemaining.set("Songs left: %r" % self.songNumber)
        self.gb.info.Show.config(bg="black")
        self.gb.info.Song.config(bg="black")
        self.currentShow.set(eval(self.newSongList[self.countUp])[0])
        self.currentSong.set(eval(self.newSongList[self.countUp])[1])
        self.timer.set(self.countdownLength)
        self.gb.info.clock.config(textvariable=self.timer)
        self.info.revealShowButt.config(relief="raised",text="Reveal",state="disabled")
        self.info.revealSongButt.config(relief="raised",text="Reveal",state="disabled")

    def countdown(self,NP):
        if self.p.is_playing():
            self.after(100,self.countdown,NP)
        elif self.ongoingTimer and NP == self.currentSong.get():
            if self.timer.get() > 0:
                self.timer.set(self.timer.get()-1)
                self.after(1000,self.countdown,NP)
            else:
                self.ongoingTimer = False
                self.gb.info.clock.config(textvariable=self.timeOut)

    def playsnip(self):
        self.p = sa.WaveObject.from_wave_file(os.path.join(self.songDir,eval(self.newSongList[self.countUp])[2]))
        self.p = self.p.play()

if __name__ == "__main__":
    app = simpleapp_tk(None)
    app.title('Python ConGames --> Name That Tune!')
    app.mainloop()


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AboriginalHeroes.Data.DataModels.Awm
{
    public class Resources
    {
        public int enabled { get; set; }
        public string name { get; set; }
        public int maxrecords { get; set; }
        public int unlimitedrecords { get; set; }
        public string contact { get; set; }
        public string email { get; set; }
        public string comment { get; set; }
    }

    public class Result
    {
        public string url { get; set; }
        public string accession_number { get; set; }
        public string id { get; set; }
        public string description { get; set; }
        public string type { get; set; }
        public string title { get; set; }
        public List<string> related_subjects { get; set; }
        public List<string> object_type { get; set; }
        public List<string> maker { get; set; }
        public List<string> maker_text { get; set; }
        public List<string> makers_details { get; set; }
        public List<string> related_units { get; set; }
        public List<string> related_units_id { get; set; }
        public List<string> related_units_label { get; set; }
        public List<string> related_unit_all_ids { get; set; }
        public List<string> related_units_details { get; set; }
        public List<string> related_conflicts { get; set; }
        public List<string> conflict_category { get; set; }
        public List<string> related_conflict_sort { get; set; }
        public List<string> conflict_search { get; set; }
        public List<string> copyright_status { get; set; }
        public List<string> date_made { get; set; }
        public List<string> descriptor { get; set; }
        public List<string> object_type_main { get; set; }
        public List<string> other_numbers { get; set; }
        public List<string> related_places { get; set; }
        public List<string> related_places_id { get; set; }
        public List<string> related_places_label { get; set; }
        public List<string> related_people { get; set; }
        public List<string> object_type_sub { get; set; }
        public List<string> place_made { get; set; }
        public List<string> secondary_image { get; set; }

        public string base_rank { get; set; }
        public string birth_place { get; set; }
        public string birth_date { get; set; }
    }

    public class RootObject
    {
        public double version { get; set; }
        public int version_major { get; set; }
        public int version_minor { get; set; }
        public int build { get; set; }
        public int status { get; set; }
        public string error { get; set; }
        public string accesskey { get; set; }
        public int start { get; set; }
        public int count { get; set; }
        public string clientid { get; set; }
        public Resources resources { get; set; }
        public string format { get; set; }
        public string type { get; set; }
        public string query { get; set; }
        public bool showLabels { get; set; }
        public string statusCode { get; set; }
        public string statusMessage { get; set; }
        public int found { get; set; }
        public List<Result> results { get; set; }
        public List<object> labels { get; set; }
    }

}


text:
@implementation New

@end


text:
from __future__ import unicode_literals

from django.db import models, migrations
import django.db.models.deletion

class Migration(migrations.Migration):

    dependencies = [
        ('lists', '0007_auto_20150306_1815'),
    ]

    operations = [
        migrations.AddField(
            model_name='callmapping',
            name='data1_source',
            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.PROTECT, default=1, to='lists.CsvColumn'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='callmapping',
            name='data2_source',
            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.PROTECT, default=1, to='lists.CsvColumn'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='callmapping',
            name='data3_source',
            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.PROTECT, default=1, to='lists.CsvColumn'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='callmapping',
            name='data4_source',
            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.PROTECT, default=1, to='lists.CsvColumn'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='callmapping',
            name='data5_source',
            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.PROTECT, default=1, to='lists.CsvColumn'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='callmapping',
            name='data6_source',
            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.PROTECT, default=1, to='lists.CsvColumn'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='callmapping',
            name='data7_source',
            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.PROTECT, default=1, to='lists.CsvColumn'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='callmapping',
            name='data8_source',
            field=models.ForeignKey(related_name='+', on_delete=django.db.models.deletion.PROTECT, default=1, to='lists.CsvColumn'),
            preserve_default=False,
        ),
    ]


text:
/**
 * angular-egg - An AngularJS Directive implementation of egg.js by Mike Flynn
 * @author Paul Massey, paul.massey@scriptwerx.io
 * @version v1.0.1
 * @build 49 - Tue Mar 29 2016 09:19:04 GMT+0100 (BST)
 * @link http://www.scriptwerx.io
 * @license MIT
 */
/*
 ngEgg - Copyright (c)  2015 Scriptwerx

 An AngularJS Directive implementation of egg.js by Mike Flynn
 https://github.com/mikeflynn/egg.js/blob/master/egg.js

 Copyright (c) 2015 Mike Flynn

 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:
 The above copyright notice and this permission notice shall be included in
 all copies or substantial portions of the Software.
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
 */
(function(angular) {

  'use strict';

  // Default (Konami) keycode
  var defaultEgg = '38,up,40,down,left,right,left,right,b,a',
    ignoredKeys = [16];

  /**
   * @private
   * @ngdoc method
   * @methodOf ngEgg
   * @name __toCharCodes
   * @description
   * Converts literal character values to keyCodes
   *
   * @param {String} keys keycode String
   * @returns {String} Reformatted keycode String
   */
  function __toCharCodes(keys) {
    var special = {
        'up': 38, 'down': 40, 'left': 37, 'right': 39, 'enter': 13, 'space': 32, 'ctrl': 7, 'alt': 8, 'tab': 9
      },
      specialKeys = Object.keys(special);

    keys = keys.split(',').map(function(key) {
      return key.trim();
    });

    var characterKeyCodes = keys.map(function(key) {

      if (!isNaN(parseInt(key, 10))) {
        return key;
      }

      if (specialKeys.indexOf(key) > -1) {
        return special[key];
      }

      return (key).charCodeAt(0);
    });

    return characterKeyCodes.join(',');
  }

  /**
   * @ngdoc directive
   * @name ngEgg
   * @description
   *
   * @requires $document
   *
   * @param {Object} $document $document
   * @returns {Object} Directive Object
   */
  function ngEgg($document) {

    var kps = [],
      activeEgg;

    /**
    * @private
    * @ngdoc method
    * @methodOf ngEgg
    * @name link
    * @description
    *
    * @param {Object} scope $scope
    * @param {Object} elem DOM Element
    * @param {Object} attrs Attributes
    * @param {Object} ngModelCtrl ngModelController
    */
    function link(scope, elem, attrs, ngModelCtrl) {

      ngModelCtrl.$setViewValue(false);

      /**
       * @private
       * @ngdoc method
       * @methodOf ngEgg
       * @name handleEvent
       * @description
       *
       * @param {Object} e Event Object
       */
      function handleEvent(e) {

        var keyCode  = e.which,
          isLetter = keyCode >= 65 && keyCode <= 90,
          foundEgg;

        if (e.type === 'keydown' && !e.metaKey && !e.ctrlKey && !e.altKey && !e.shiftKey) {
          var tag = e.target.tagName;

          if ((tag === 'HTML' || tag === 'BODY') && isLetter) {
            e.preventDefault();
            return;
          }
        }

        if (e.type === 'keyup') {
          if (isLetter && !e.shiftKey) {
            keyCode = keyCode + 32;
          }

          if (ignoredKeys.indexOf(keyCode) === -1) {
            kps.push(keyCode);
          }

          foundEgg = kps.toString().indexOf(activeEgg) >= 0;

          if (foundEgg) {
            kps = [];
            scope.$apply(function() {
              ngModelCtrl.$setViewValue(true);
            });
          }
          else if (kps.length > 10) {

            var currentKeys = kps.toString(),
              firstEggKey = activeEgg.split(',')[0];

            if (!firstEggKey || currentKeys.indexOf(firstEggKey) === -1) {
              kps = [];
            }
            else {
              currentKeys = currentKeys.substr(currentKeys.indexOf(firstEggKey));
              if (currentKeys.length > activeEgg.length) {
                kps = [];
              }
            }
          }
        }
      }

      if (attrs.keycode) {
        activeEgg = __toCharCodes(attrs.keycode);
      }
      else {
        activeEgg = __toCharCodes(defaultEgg);
      }

      $document.on('keydown', handleEvent);
      $document.on('keyup', handleEvent);
    }

    return {
      restrict: 'EA',
      require: '^ngModel',
      scope: true,
      link: link
    };
  }
  ngEgg.$inject = ['$document'];

  angular
    .module('ngEgg', [])
    .directive('ngEgg', ngEgg);

})(window.angular);


text:
package org.apache.syncope.common.types;

import javax.xml.bind.annotation.XmlEnum;

@XmlEnum
public enum SyncopeClientExceptionType {

    AssociatedResources("Syncope.AssociatedResources", "Syncope.AssociatedResources.name"),
    Deadlock("Syncope.Deadlock", ""),
    DataIntegrityViolation("Syncope.DataIntegrityViolation", "Syncope.DataIntegrityViolation.name"),
    EntityExists("Syncope.EntityExists", "Syncope.EntityExists.name"),
    GenericPersistence("Syncope.GenericPersistence", "Syncope.GenericPersistence.cause"),
    InvalidLogger("Syncope.InvalidLogger", "Syncope.InvalidLogger.message"),
    InvalidConnInstance("Syncope.InvalidConnInstance", "Syncope.InvalidConnInstance.message"),
    InvalidConnIdConf("Syncope.InvalidConnIdConf", "Syncope.InvalidConnIdConf.message"),
    InvalidPasswordPolicy("Syncope.InvalidPasswordPolicy", "Syncope.InvalidPasswordPolicy.reason"),
    InvalidAccountPolicy("Syncope.InvalidAccountPolicy", "Syncope.InvalidAccountPolicy.reason"),
    InvalidSyncPolicy("Syncope.InvalidSyncPolicy", "Syncope.InvalidSyncPolicy.reason"),
    InvalidSyncopeRole("Syncope.InvalidSyncopeRole", "Syncope.InvalidSyncopeRole.reason"),
    InvalidReportExec("Syncope.InvalidReportExec", "Syncope.InvalidReportExec.reason"),
    InvalidRoles("Syncope.InvalidRoles", "Syncope.InvalidRoles.name"),
    InvalidSchemaDefinition("Syncope.InvalidSchemaDefinition", ""),
    InvalidSearchCondition("Syncope.InvalidSearchCondition", ""),
    InvalidPropagationTaskExecReport(
    "Syncope.InvalidPropagationTaskExecReport",
    "Syncope.InvalidPropagationTaskExecReport.element"),
    InvalidUSchema("Syncope.InvalidUSchemaUpdate", "Syncope.InvalidUSchemaUpdate.name"),
    InvalidUDerSchema("Syncope.InvalidUDerSchemaUpdate", "Syncope.InvalidUDerSchemaUpdate.name"),
    InvalidUVirSchema("Syncope.InvalidUVirSchemaUpdate", "Syncope.InvalidUVirSchemaUpdate.name"),
    InvalidRSchema("Syncope.InvalidRSchemaUpdate", "Syncope.InvalidRSchemaUpdate.name"),
    InvalidRDerSchema("Syncope.InvalidRDerSchemaUpdate", "Syncope.InvalidRDerSchemaUpdate.name"),
    InvalidRVirSchema("Syncope.InvalidRVirSchemaUpdate", "Syncope.InvalidRVirSchemaUpdate.name"),
    InvalidMSchema("Syncope.InvalidMSchemaUpdate", "Syncope.InvalidMSchemaUpdate.name"),
    InvalidMDerSchema("Syncope.InvalidMDerSchemaUpdate", "Syncope.InvalidMDerSchemaUpdate.name"),
    InvalidMVirSchema("Syncope.InvalidMVirSchemaUpdate", "Syncope.InvalidMVirSchemaUpdate.name"),
    InvalidSchemaMapping("Syncope.InvalidSchemaMapping", ""),
    InvalidSyncopeUser("Syncope.InvalidSyncopeUser", "Syncope.InvalidSyncopeUser.element"),
    InvalidExternalResource("Syncope.InvalidExternalResource", "Syncope.InvalidExternalResource.element"),
    InvalidNotification("Syncope.InvalidNotification", "Syncope.InvalidNotification.element"),
    InvalidPropagationTask("Syncope.InvalidPropagationTask", "Syncope.InvalidPropagationTask.element"),
    InvalidSchedTask("Syncope.InvalidSchedTask", "Syncope.InvalidSchedTask.element"),
    InvalidSyncTask("Syncope.InvalidSyncTask", "Syncope.InvalidSyncTask.element"),
    InvalidValues("Syncope.InvalidValues", "Syncope.InvalidValues.attributeName"),
    NotFound("Syncope.NotFound", "Syncope.NotFound.entity"),
    Propagation("Syncope.Propagation", "Syncope.Propagation.resourceName"),
    RejectedUserCreate("Syncope.RejectUserCreate", "Syncope.RejectUserCreate.userId"),
    RequiredValuesMissing("Syncope.RequiredValuesMissing", "Syncope.RequiredValuesMissing.attributeName"),
    Scheduling("Syncope.Scheduling", "Syncope.Scheduling.message"),
    UnauthorizedRole("Syncope.UnauthorizedRole", "Syncope.UnauthorizedRole.id"),
    Unknown("Syncope.Unknown", ""),
    Workflow("Syncope.Workflow", "Syncope.Workflow.message");

    private String headerValue;

    private String elementHeaderName;

    private SyncopeClientExceptionType(final String headerValue, final String elementHeaderName) {
        this.headerValue = headerValue;
        this.elementHeaderName = elementHeaderName;
    }

    public static SyncopeClientExceptionType getFromHeaderValue(final String exceptionTypeHeaderValue) {
        SyncopeClientExceptionType result = null;
        for (SyncopeClientExceptionType syncopeClientExceptionType : values()) {
            if (exceptionTypeHeaderValue.equals(syncopeClientExceptionType.getHeaderValue())) {
                result = syncopeClientExceptionType;
            }
        }

        if (result == null) {
            throw new IllegalArgumentException("Unexpected header value: " + exceptionTypeHeaderValue);
        }

        return result;
    }

    public String getElementHeaderName() {
        return elementHeaderName;
    }

    public String getHeaderValue() {
        return headerValue;
    }
}


text:
package gw.internal.gosu.ir.compiler.bytecode.expression;

import gw.internal.gosu.ir.compiler.bytecode.AbstractBytecodeCompiler;
import gw.internal.gosu.ir.compiler.bytecode.IRBytecodeContext;
import gw.lang.ir.expression.IRIdentifier;
import gw.internal.ext.org.objectweb.asm.Opcodes;

public class IRIdentifierCompiler extends AbstractBytecodeCompiler {

  public static void compile( IRIdentifier identifier, IRBytecodeContext context ) {
    int opcode = getIns(Opcodes.ILOAD, identifier.getType());
    context.getMv().visitVarInsn(opcode, context.getLocalVar(identifier.getSymbol()).getIndex());
  }
}


text:
"""Lessons model"""

import re

from flask_babel import gettext

from pysistem import db
from pysistem.lessons.const import AUTO_MARK_SCORE, AUTO_MARK_PLACE, AUTO_MARK_SOLVED

def parse_int(sin):
    """Javascript-like parseInt"""
    # https://gist.github.com/lsauer/6088767
    search = re.search(r'^(\d+)[.,]?\d*?', str(sin))
    return int(search.groups()[-1]) if search and not callable(sin) else None

def babel_translations(): # pragma: no cover
    gettext("lessons.automarks.score")
    gettext("lessons.automarks.score.atleast")
    gettext("lessons.automarks.place")
    gettext("lessons.automarks.place.atleast")
    gettext("lessons.automarks.solved")
    gettext("lessons.automarks.solved.atleast")

class LessonUserAssociation(db.Model):
    """Helper class to associate lessons and users between each other
    By default it acts like User

    Fields:
    mark -- user's mark for lesson

    Relationships:
    lesson, lesson_id -- Lesson
    user, user_id -- User
    """
    lesson_id = db.Column(db.Integer, db.ForeignKey('lesson.id'), primary_key=True)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), primary_key=True)
    mark = db.Column(db.String(4))

    lesson = db.relationship('Lesson', back_populates='users')
    user = db.relationship('User', back_populates='lessons')

    def __init__(self, mark=None, points=None):
        self.mark = mark
        self.points = points

    def __repr__(self):
        if self.user and self.lesson:
            return '<Lesson=%r User=%r>' % (self.lesson.name, self.user.username)
        else:
            return '<LessonUserAssociation Unknown>'

    def __getattr__(self, attr):
        if attr[0] != '_':
            return self.user.__getattribute__(attr)
        raise AttributeError

    def int_mark(self):
        """Turn string mark into int"""
        return parse_int(self.mark)

class AutoMark(db.Model):
    """Automatic mark and point pattern

    Fields:
    id -- unique auto mark id
    type -- type of auto mark, as in pysistem.lessons.const

    Relationships:
    lesson, lesson_id -- attached lesson
    """
    id = db.Column(db.Integer, primary_key=True)
    type = db.Column(db.Integer)
    required = db.Column(db.Integer)
    mark = db.Column(db.String(4))
    points = db.Column(db.Integer)

    lesson_id = db.Column(db.Integer, db.ForeignKey('lesson.id'))

    def __init__(self, type=AUTO_MARK_SCORE, required=0, mark=None, points=0):
        if type == "score":
            type = AUTO_MARK_SCORE
        if type == "place":
            type = AUTO_MARK_PLACE
        if type == "solved":
            type = AUTO_MARK_SOLVED
        self.type = type
        self.required = required
        self.mark = mark
        self.points = points

    def __repr__(self):
        if self.lesson_id:
            return '<AutoMark of %r>' % self.lesson.name
        return '<AutoMark>'

class Lesson(db.Model):
    """An event that has start, end, attached contest and attendance

    Fields:
    id -- unique lesson id
    name -- lesson name
    start -- lesson's start datetime
    end -- lesson's end datetime
    auto_marks_applied -- automarks already applied?

    Relationships:
    group, group_id -- group, whose lesson it is
    contest, contest_id -- attached contest
    users -- lesson's attendants (LessonUserAssociation)
    auto_marks -- lesson's auto marks settings (AutoMark)
    """
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(80))
    start = db.Column(db.DateTime)
    end = db.Column(db.DateTime)
    auto_marks_applied = db.Column(db.Boolean)

    group_id = db.Column(db.Integer, db.ForeignKey('group.id'))
    contest_id = db.Column(db.Integer, db.ForeignKey('contest.id'))

    users = db.relationship('LessonUserAssociation', back_populates='lesson',
                            cascade="all,delete", lazy="dynamic")
    auto_marks = db.relationship('AutoMark', cascade="all,delete", lazy="dynamic",
                                 backref='lesson', order_by=AutoMark.required.desc())

    def __init__(self, name=None, start=None, end=None):
        self.name = name
        self.start = start
        self.end = end
        self.auto_marks_applied = False

    def __repr__(self):
        if self.group_id:
            return '<Lesson %r at %r>' % (self.name, self.group.name)
        else:
            return '<Lesson %r>' % self.name

    def get_automarks(self, **kwargs):
        """Return (mark, points) by user's score, place or solved problems"""
        allowed = ("score", "place", "solved")
        valid_keys = list(filter(lambda x: x in allowed, kwargs.keys()))
        params = len(valid_keys)
        if params == 0:
            return (None, 0)
        if params > 1:
            results = []
            for key in valid_keys:
                results.append(self.get_automarks(**dict(((key, kwargs[key]),))))
            return max(results, key=lambda x: (x[1], x[0] or ''))
        auto_marks = self.auto_marks.filter(AutoMark.type == allowed.index(valid_keys[0])).all()
        if valid_keys[0] == "place":
            for mark in auto_marks[::-1]:
                if mark.required >= kwargs[valid_keys[0]]:
                    return (mark.mark, mark.points)
        else:
            for mark in auto_marks:
                if mark.required <= kwargs[valid_keys[0]]:
                    return (mark.mark, mark.points)
        return (None, 0)


text:
package com.flyingspaniel.nava.fp;

import junit.framework.TestCase;

import java.util.ArrayList;

public class FPTest extends TestCase {

   static ArrayList<Number> numbers = new ArrayList<Number>();
   static {
      for (int i=1; i<=6; i++)
         numbers.add(i);
   }
   static final double[] doubles = new double[] { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0};
   static final int[] ints = new int[] { 1, 2, 3, 4, 5, 6};

   public void testFold() throws Exception {

      Object foo = Fns.MIN.fn2(1.2, 3.4);

       assertEquals(6.0, FP.fold(Double.NEGATIVE_INFINITY, numbers, Fns.MAX).doubleValue());
       assertEquals(1.0, FP.fold(Double.MAX_VALUE, numbers, Fns.MIN).doubleValue());
       assertEquals(21.0, FP.fold(0.0, numbers, Fns.SUM).doubleValue());
       assertEquals(720.0, FP.fold(1.0, numbers, Fns.PRODUCT).doubleValue());
   }

   public void testFoldP() throws Exception {
      assertEquals(6.0, FP.foldp(Double.NEGATIVE_INFINITY, doubles, Fns.MAXpdouble));
      assertEquals(1.0, FP.foldp(Double.MAX_VALUE, doubles, Fns.MINpdouble));
      assertEquals(21.0, FP.foldp(0.0, doubles, Fns.SUMpdouble));
      assertEquals(720.0, FP.foldp(1.0, doubles, Fns.PRODUCTpdouble));

      assertEquals(6, FP.foldp(Integer.MIN_VALUE, ints, Fns.MAXpint));
      assertEquals(1, FP.foldp(Integer.MAX_VALUE, ints, Fns.MINpint));
      assertEquals(21, FP.foldp(0, ints, Fns.SUMpint));
      assertEquals(720, FP.foldp(1, ints, Fns.PRODUCTpint));
   }

   public void testReduce() throws Exception {
      assertEquals(6.0, FP.reduce(numbers, Fns.MAX).doubleValue());
      assertEquals(1.0, FP.reduce(numbers, Fns.MIN).doubleValue());
      assertEquals(21.0, FP.reduce(numbers, Fns.SUM).doubleValue());
      assertEquals(720.0, FP.reduce(numbers, Fns.PRODUCT).doubleValue());
   }

   public void testReduceP() throws Exception {
      assertEquals(6.0, FP.reducep(doubles, Fns.MAXpdouble));
      assertEquals(1.0, FP.reducep(doubles, Fns.MINpdouble));
      assertEquals(21.0, FP.reducep(doubles, Fns.SUMpdouble));
      assertEquals(720.0, FP.reducep(doubles, Fns.PRODUCTpdouble));

      assertEquals(6, FP.reducep(ints, Fns.MAXpint));
      assertEquals(1, FP.reducep(ints, Fns.MINpint));
      assertEquals(21, FP.reducep(ints, Fns.SUMpint));
      assertEquals(720, FP.reducep(ints, Fns.PRODUCTpint));
   }

   public void testFilter() throws Exception {
      ArrayList l = FP.filter(numbers, new GT(3.3));
      assertEquals("[4, 5, 6]", l.toString());
      l = FP.filter(numbers, new GT(4.4));
      assertEquals("[5, 6]", l.toString());
   }

   public void testMap() throws Exception {
      ArrayList l = FP.map(numbers, new Times(2.0));
      assertEquals("[2.0, 4.0, 6.0, 8.0, 10.0, 12.0]", l.toString());
   }

   public void testEvery() throws Exception {
      assertTrue(FP.every(numbers, new GT(-3.3)));
      assertFalse(FP.forAll(numbers, new GT(3.3)));
   }

   public void testExists() throws Exception {
      assertFalse(FP.exists(numbers, new GT(99.9)));
      assertTrue(FP.some(numbers, new GT(3.3)));
   }

   static class Times extends Fn.Base<Number, Number> {
      final double multiplier;
      Times(double d) { multiplier = d; }

      @Override
      public Number fn1(Number n1) {
         return n1.doubleValue() * multiplier;
      }

   }

   static class GT extends Fn.Base<Number, Number> {
      final double gt;
      GT(double d) { gt = d; }

      @Override
      public Number fn1(Number n1) {
         return (n1.doubleValue() > gt) ? n1 : null;
      }

   }
}


text:
package org.apache.skywalking.oap.server.configuration.etcd;

import java.io.FileNotFoundException;
import java.io.Reader;
import java.net.URI;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import mousio.etcd4j.EtcdClient;
import mousio.etcd4j.promises.EtcdResponsePromise;
import mousio.etcd4j.responses.EtcdKeysResponse;
import org.apache.skywalking.apm.util.PropertyPlaceholderHelper;
import org.apache.skywalking.oap.server.library.module.ApplicationConfiguration;
import org.apache.skywalking.oap.server.library.module.ModuleManager;
import org.apache.skywalking.oap.server.library.util.CollectionUtils;
import org.apache.skywalking.oap.server.library.util.ResourceUtils;
import org.junit.Before;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.yaml.snakeyaml.Yaml;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

public class ITEtcdConfigurationTest {

    private static final Logger LOGGER = LoggerFactory.getLogger(ITEtcdConfigurationTest.class);

    private final Yaml yaml = new Yaml();

    private EtcdServerSettings settings;

    private EtcdConfigurationTestProvider provider;

    private EtcdClient client;

    @Before
    public void setUp() throws Exception {
        final ApplicationConfiguration applicationConfiguration = new ApplicationConfiguration();
        loadConfig(applicationConfiguration);

        final ModuleManager moduleManager = new ModuleManager();
        moduleManager.init(applicationConfiguration);

        final String etcdHost = System.getProperty("etcd.host");
        final String etcdPort = System.getProperty("etcd.port");
        LOGGER.info("etcdHost: {}, etcdPort: {}", etcdHost, etcdPort);
        Properties properties = new Properties();
        properties.setProperty("serverAddr", etcdHost + ":" + etcdPort);

        List<URI> uris = EtcdUtils.parseProp(properties);
        client = new EtcdClient(uris.toArray(new URI[] {}));

        provider = (EtcdConfigurationTestProvider) moduleManager.find(EtcdConfigurationTestModule.NAME).provider();

        assertNotNull(provider);
    }

    @Test(timeout = 20000)
    public void shouldReadUpdated() throws Exception {
        assertNull(provider.watcher.value());

        assertTrue(publishConfig("test-module.default.testKey", "skywalking", "500"));

        for (String v = provider.watcher.value(); v == null; v = provider.watcher.value()) {
            LOGGER.info("value is : {}", provider.watcher.value());
        }

        assertEquals("500", provider.watcher.value());

        assertTrue(removeConfig("test-module.default.testKey", "skywalking"));

        for (String v = provider.watcher.value(); v != null; v = provider.watcher.value()) {
        }

        assertNull(provider.watcher.value());
    }

    @SuppressWarnings("unchecked")
    private void loadConfig(ApplicationConfiguration configuration) throws FileNotFoundException {
        Reader applicationReader = ResourceUtils.read("application.yml");
        Map<String, Map<String, Map<String, ?>>> moduleConfig = yaml.loadAs(applicationReader, Map.class);
        if (CollectionUtils.isNotEmpty(moduleConfig)) {
            moduleConfig.forEach((moduleName, providerConfig) -> {
                if (providerConfig.size() > 0) {
                    ApplicationConfiguration.ModuleConfiguration moduleConfiguration = configuration.addModule(moduleName);
                    providerConfig.forEach((name, propertiesConfig) -> {
                        Properties properties = new Properties();
                        if (propertiesConfig != null) {
                            propertiesConfig.forEach((key, value) -> {
                                properties.put(key, value);
                                final Object replaceValue = yaml.load(PropertyPlaceholderHelper.INSTANCE.replacePlaceholders(value + "", properties));
                                if (replaceValue != null) {
                                    properties.replace(key, replaceValue);
                                }
                            });
                        }
                        moduleConfiguration.addProviderConfiguration(name, properties);
                    });
                }
            });
        }
    }

    private boolean publishConfig(String key, String group, String value) {
        try {
            client.putDir(group).send().get();
            EtcdResponsePromise<EtcdKeysResponse> promise = client.put(generateKey(key, group), value).send();
            promise.get();
            return true;
        } catch (Exception e) {
            return false;
        }
    }

    private boolean removeConfig(String key, String group) throws Exception {
        client.delete(generateKey(key, group)).send().get();
        return true;
    }

    private String generateKey(String key, String group) {
        return new StringBuilder("/").append(group).append("/").append(key).toString();
    }

}


text:
import unittest
import os

from aggregator.db.schema import *
from test_settings import *

class TestSchema(unittest.TestCase):

    def setUp(self):
        self.hbase = create_client(HBASE_THRIFT_HOST, HBASE_THRIFT_PORT)

    def tearDown(self):
        self.dropAllTestTables()
        self.hbase = None

    def dropAllTestTables(self):
        tables = self.hbase.getTableNames()
        for table in tables:
            if 'test_' in table:
                self.hbase.disableTable(table)
                self.hbase.deleteTable(table)

    def testInitDb(self):
        initdb(self.hbase, 'test_')
        tables = self.hbase.getTableNames()
        for table in ['test_Urls', 'test_Feeds', 'test_UrlsIndex']:
            self.assertTrue(table in tables)


text:
id: 56592a60ddddeae28f7aa8e1
title: Access Multi-Dimensional Arrays With Indexes
challengeType: 1
videoUrl: 'https://scrimba.com/c/ckND4Cq'
forumTopicId: 16159
---

## Description

One way to think of a <dfn>multi-dimensional</dfn> array, is as an array of arrays. When you use brackets to access your array, the first set of brackets refers to the entries in the outer-most (the first level) array, and each additional pair of brackets refers to the next level of entries inside.
Example

```js
var arr = [
  [1,2,3],
  [4,5,6],
  [7,8,9],
  [[10,11,12], 13, 14]
];
arr[3]; // equals [[10,11,12], 13, 14]
arr[3][0]; // equals [10,11,12]
arr[3][0][1]; // equals 11
```

Note
There shouldn't be any spaces between the array name and the square brackets, like array [0][0] and even this array [0] [0] is not allowed. Although JavaScript is able to process this correctly, this may confuse other programmers reading your code.

## Instructions

Using bracket notation select an element from myArray such that myData is equal to 8.

## Tests

```yml
tests:
  - text: <code>myData</code> should be equal to <code>8</code>.
    testString: assert(myData === 8);
  - text: You should be using bracket notation to read the correct value from <code>myArray</code>.
    testString: assert(/myData=myArray\[2\]\[1\]/.test(code.replace(/\s/g, '')));

```

## Challenge Seed

```js
// Setup
var myArray = [[1,2,3], [4,5,6], [7,8,9], [[10,11,12], 13, 14]];

// Only change code below this line.
var myData = myArray[0][0];

```

### After Test

```js
if(typeof myArray !== "undefined"){(function(){return "myData: " + myData + " myArray: " + JSON.stringify(myArray);})();}
```

## Solution

```js
var myArray = [[1,2,3],[4,5,6], [7,8,9], [[10,11,12], 13, 14]];
var myData = myArray[2][1];
```


text:
//
//  UIMelonPickerView.m
//  DynamicRows
//
//  Created by William Miller on 6/16/15.
//  Copyright (c) 2015 Miller Computer Services. All rights reserved.
//

#import "UIMelonPickerView.h"

@interface UIMelonPickerView ()

{
@private

    NSString *rowTitles[4];
}

@end

@implementation UIMelonPickerView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (instancetype)init {

    self = [super init];

    self.dataSource = self;

    self.delegate = self;

    rowTitles[0] = @"Watermelon";
    rowTitles[1] = @"Honeydew";
    rowTitles[2] = @"cantaloupe";
    rowTitles[3] = @"Crenshaw";

    return self;

}

-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView {
    return 1;
}

-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component {
    return 4;
}

-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {

    self.selection = rowTitles[row];

}

-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {

    return rowTitles[row];

}

@end


text:
import Ember from 'ember';
const {getOwner, computed} = Ember;

export const getConfig = (instance) => {
    return getOwner(instance).resolveRegistration('config:environment')['ember-error-handler'] || {};
};

export const getEnvironment = (instance) => {
    return getOwner(instance).resolveRegistration('config:environment').environment;
};

export const ConfigMixin = Ember.Mixin.create({
    config: computed(function () {
        return getConfig(this);
    }),

    environment: computed(function () {
        return getEnvironment(this);
    })
});

export const InternalErrorManagmentMixin = Ember.Mixin.create({

    internalLogger: Ember.inject.service('ember-error-handler.logger.internal-logger'),

    logInternalError(context, error) {
        this.get('internalLogger').log(context, error)
    }
});

// Class name extraction tooling

const unknownFunction = 'UnknownFunction';
const unknownObject = 'UnknownObject';

export const stringify = (value) => {
    try {
        value = String(value);
    } catch (e) {
        value = 'unrecognized'
    }
    return value;
};

export const stringifyItems = (items) => {
    return items
        .map(i => "'" + stringify(i) + "'")
        .join(', ')
};

export const extractClassName = function(subject)  {
    return subject[Ember.NAME_KEY] || subject.modelName || subject.name || stringify(subject) || unknownFunction;
};

export const exportInstanceName = function(subject) {
    return subject._debugContainerKey || subject.modelName || (subject.constructor ? extractClassName(subject.constructor) : false) || stringify(subject) || unknownObject;
};

export const  extractName = function (subject) {

    if (typeof subject === 'undefined') {
        return 'undefined';
    }

    if (subject === null) {
        return 'null';
    }

    if (typeof subject === 'string') {
        return `String('${subject}')`;
    }

    if (typeof subject === 'number') {
        return `Number(${subject})`;
    }

    if (typeof subject === 'boolean') {
        return `Boolean(${subject ? 'true' : 'false'})`;
    }

    if (Array.isArray(subject)) {
        return `Array (${subject.length})`;
    }

    if (typeof subject === 'function') {
        return `Class ${extractClassName(subject)}`;
    } else {
        return `Instance of ${exportInstanceName(subject)}`;
    }
};


text:
namespace RefAndPointer.UnsafeClass
{
    using System;
    using System.Runtime.CompilerServices;

    class Program
    {
        static void Main()
        {
            unsafe
            {
                int x = 1;
                void* pointer = Unsafe.AsPointer(ref x);
                *(int*)pointer = 2;

                Console.WriteLine(x); // 2 になってる

                ref int r = ref Unsafe.AsRef<int>(pointer);
                r = 3;

                Console.WriteLine(*(int*)pointer); // 3 になってる
            }
        }
    }
}


text:
package mapElement;

import battle.Board;
import battle.CellPixelAbstraction;
import character.Character;

import javax.imageio.ImageIO;
import java.awt.geom.AffineTransform;
import java.awt.image.AffineTransformOp;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

/**
 * Created by Nathan on 11/16/2015.
 */
public class Water extends GroundElement {
    public Water() {
        imageFilename = "Assets/MapElements/water.png";
    }

    @Override
    protected BufferedImage modifyImage(BufferedImage img, int tick) {
        BufferedImage finalImg;
        int numFrames = img.getWidth();
        int xPixel = (int) (tick % numFrames);
        int cellWidth = CellPixelAbstraction.cellXDelta*2;
        int cellHeight = CellPixelAbstraction.cellYDelta*2;
        if(xPixel + cellWidth > numFrames) {
            // Merge the images from either end to make the animation seem infinite
            int remainingXPixels = numFrames-xPixel;
            BufferedImage img1 = img.getSubimage(xPixel, 0, remainingXPixels, cellHeight);
            BufferedImage img2 = img.getSubimage(0, 0, cellWidth-remainingXPixels, cellHeight);
            finalImg = new BufferedImage(cellWidth, cellHeight, img.getType());
            finalImg.createGraphics().drawImage(img1, 0, 0, null);
            finalImg.createGraphics().drawImage(img2, remainingXPixels, 0, null);
        } else {
            finalImg = img.getSubimage(xPixel, 0, cellWidth, cellHeight);
        }

        return finalImg;
    }

    @Override
    public boolean isElementMovementBlocking(Character character) {
        return true;
    }

    @Override
    public boolean isElementProjectileBlocking() {
        return false;
    }
}


text:
require('./angular-locale_en-sz');
module.exports = 'ngLocale';


text:
package com.intellij.codeInspection.reference;

import com.intellij.psi.PsiClass;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;
import java.util.Set;

public interface RefClass extends RefJavaElement {

  @NotNull
  Set<RefClass> getBaseClasses();

  @NotNull
  Set<RefClass> getSubClasses();

  @NotNull
  List<RefMethod> getConstructors();

  @NotNull
  Set<RefElement> getInTypeReferences();

  @NotNull
  Set<RefElement> getInstanceReferences();

  RefMethod getDefaultConstructor();

  @NotNull
  List<RefMethod> getLibraryMethods();

  boolean isAnonymous();

  boolean isInterface();

  boolean isUtilityClass();

  boolean isAbstract();

  boolean isApplet();

  boolean isServlet();

  boolean isTestCase();

  boolean isLocalClass();

  boolean isSelfInheritor(PsiClass psiClass);

  @Nullable
  @Override
  PsiClass getElement();
}


text:
package gp.math.jahuwaldt.jatex.latexeditor.symbolsmenu;

import gp.math.jahuwaldt.jatex.latexeditor.LatexEditorPane;

/**
 * Menu containing LaTeX AMS Negated Relation #2 items.
 *
 *
  Modified by:  Joseph A. Huwaldt

 *
 * @author Jess Thrysoee, 2006
 * @version May 14, 2013
 */
public class AmsNegatedRelationTwoMenu extends AbstractMathSymbolMenu {

    /**
     * Constructs a new
     * JMenu.
     *
     * @param editorPane
     */
    public AmsNegatedRelationTwoMenu(LatexEditorPane editorPane) {
        super(RESOURCES.getString("AmsNegRelation2"));
        String iconPath = RESOURCES.getString("iconPath");

        add(new MathSymbolMenuItem(editorPane, "\\ngtr", iconPath + "ngtr.png"));
        add(new MathSymbolMenuItem(editorPane, "\\ngeq", iconPath + "ngeq.png"));
        add(new MathSymbolMenuItem(editorPane, "\\ngeqslant", iconPath + "ngeqslant.png"));
        add(new MathSymbolMenuItem(editorPane, "\\ngeqq", iconPath + "ngeqq.png"));
        add(new MathSymbolMenuItem(editorPane, "\\gneq", iconPath + "gneq.png"));
        add(new MathSymbolMenuItem(editorPane, "\\gneqq", iconPath + "gneqq.png"));
        add(new MathSymbolMenuItem(editorPane, "\\gvertneqq", iconPath + "gvertneqq.png"));
        add(new MathSymbolMenuItem(editorPane, "\\gnsim", iconPath + "gnsim.png"));
        add(new MathSymbolMenuItem(editorPane, "\\gnapprox", iconPath + "gnapprox.png"));
        add(new MathSymbolMenuItem(editorPane, "\\nsucc", iconPath + "nsucc.png"));
        add(new MathSymbolMenuItem(editorPane, "\\nsucceq", iconPath + "nsucceq.png"));
        add(new MathSymbolMenuItem(editorPane, "\\succnsim", iconPath + "succnsim.png"));
        add(new MathSymbolMenuItem(editorPane, "\\succnapprox", iconPath + "succnapprox.png"));
        add(new MathSymbolMenuItem(editorPane, "\\ncong", iconPath + "ncong.png"));
        add(new MathSymbolMenuItem(editorPane, "\\nshortparallel", iconPath + "nshortparallel.png"));
        add(new MathSymbolMenuItem(editorPane, "\\nparallel", iconPath + "nparallel.png"));
        add(new MathSymbolMenuItem(editorPane, "\\nvDash", iconPath + "casenvDash.png"));
        add(new MathSymbolMenuItem(editorPane, "\\nVDash", iconPath + "casecasenVDash.png"));
        add(new MathSymbolMenuItem(editorPane, "\\ntriangleright", iconPath + "ntriangleright.png"));
        add(new MathSymbolMenuItem(editorPane, "\\ntrianglerighteq", iconPath + "ntrianglerighteq.png"));
        add(new MathSymbolMenuItem(editorPane, "\\nsupseteq", iconPath + "nsupseteq.png"));
        add(new MathSymbolMenuItem(editorPane, "\\nsupseteqq", iconPath + "nsupseteqq.png"));
        add(new MathSymbolMenuItem(editorPane, "\\supsetneq", iconPath + "supsetneq.png"));
        add(new MathSymbolMenuItem(editorPane, "\\varsupsetneq", iconPath + "varsupsetneq.png"));
        add(new MathSymbolMenuItem(editorPane, "\\supsetneqq", iconPath + "supsetneqq.png"));
        add(new MathSymbolMenuItem(editorPane, "\\varsupsetneqq", iconPath + "varsupsetneqq.png"));

        fireMaxIconWidth();
    }
}


text:
import { Api } from '../../api/api.service';
import { ContentContext } from '../content-context';

export class ContentTempResource {
	public static async getTempModelId(context: ContentContext) {
		const payload = await Api.sendRequest(
			`/web/content/temp-resource-id/${context}`,
			undefined,
			{
				noErrorRedirect: true,
			}
		);
		if (payload && payload.id) {
			return parseInt(payload.id);
		}
		throw new Error('Failed to fetch temp model id');
	}
}


text:
name             'xdebug-box'
maintainer       'Piotr Belina'
maintainer_email 'belina.piotr@gmail.com'
license          'All rights reserved'
description      'Installs/Configures xdebug-box'
long_description 'Installs/Configures xdebug-box'
version          '0.1.0'

depends 'apt', '~> 2.8.2'
depends 'apache2', '~> 3.1.0'
depends 'php',     '~> 1.7.2'
depends 'xdebug',  '~> 1.0.0'


text:
package com.amazonaws.services.apigatewayv2.model;

import java.io.Serializable;
import javax.annotation.Generated;

@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateModelResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable {

    /**
     *

     * The content-type for the model, for example, "application/json".
     *

     */
    private String contentType;
    /**
     *

     * The description of the model.
     *

     */
    private String description;
    /**
     *

     * The model identifier.
     *

     */
    private String modelId;
    /**
     *

     * The name of the model. Must be alphanumeric.
     *

     */
    private String name;
    /**
     *

     * The schema for the model. For application/json models, this should be JSON schema draft 4 model.
     *

     */
    private String schema;

    /**
     *

     * The content-type for the model, for example, "application/json".
     *

     *
     * @param contentType
     *        The content-type for the model, for example, "application/json".
     */

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    /**
     *

     * The content-type for the model, for example, "application/json".
     *

     *
     * @return The content-type for the model, for example, "application/json".
     */

    public String getContentType() {
        return this.contentType;
    }

    /**
     *

     * The content-type for the model, for example, "application/json".
     *

     *
     * @param contentType
     *        The content-type for the model, for example, "application/json".
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateModelResult withContentType(String contentType) {
        setContentType(contentType);
        return this;
    }

    /**
     *

     * The description of the model.
     *

     *
     * @param description
     *        The description of the model.
     */

    public void setDescription(String description) {
        this.description = description;
    }

    /**
     *

     * The description of the model.
     *

     *
     * @return The description of the model.
     */

    public String getDescription() {
        return this.description;
    }

    /**
     *

     * The description of the model.
     *

     *
     * @param description
     *        The description of the model.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateModelResult withDescription(String description) {
        setDescription(description);
        return this;
    }

    /**
     *

     * The model identifier.
     *

     *
     * @param modelId
     *        The model identifier.
     */

    public void setModelId(String modelId) {
        this.modelId = modelId;
    }

    /**
     *

     * The model identifier.
     *

     *
     * @return The model identifier.
     */

    public String getModelId() {
        return this.modelId;
    }

    /**
     *

     * The model identifier.
     *

     *
     * @param modelId
     *        The model identifier.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateModelResult withModelId(String modelId) {
        setModelId(modelId);
        return this;
    }

    /**
     *

     * The name of the model. Must be alphanumeric.
     *

     *
     * @param name
     *        The name of the model. Must be alphanumeric.
     */

    public void setName(String name) {
        this.name = name;
    }

    /**
     *

     * The name of the model. Must be alphanumeric.
     *

     *
     * @return The name of the model. Must be alphanumeric.
     */

    public String getName() {
        return this.name;
    }

    /**
     *

     * The name of the model. Must be alphanumeric.
     *

     *
     * @param name
     *        The name of the model. Must be alphanumeric.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateModelResult withName(String name) {
        setName(name);
        return this;
    }

    /**
     *

     * The schema for the model. For application/json models, this should be JSON schema draft 4 model.
     *

     *
     * @param schema
     *        The schema for the model. For application/json models, this should be JSON schema draft 4 model.
     */

    public void setSchema(String schema) {
        this.schema = schema;
    }

    /**
     *

     * The schema for the model. For application/json models, this should be JSON schema draft 4 model.
     *

     *
     * @return The schema for the model. For application/json models, this should be JSON schema draft 4 model.
     */

    public String getSchema() {
        return this.schema;
    }

    /**
     *

     * The schema for the model. For application/json models, this should be JSON schema draft 4 model.
     *

     *
     * @param schema
     *        The schema for the model. For application/json models, this should be JSON schema draft 4 model.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public CreateModelResult withSchema(String schema) {
        setSchema(schema);
        return this;
    }

    /**
     * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
     * redacted from this string using a placeholder value.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getContentType() != null)
            sb.append("ContentType: ").append(getContentType()).append(",");
        if (getDescription() != null)
            sb.append("Description: ").append(getDescription()).append(",");
        if (getModelId() != null)
            sb.append("ModelId: ").append(getModelId()).append(",");
        if (getName() != null)
            sb.append("Name: ").append(getName()).append(",");
        if (getSchema() != null)
            sb.append("Schema: ").append(getSchema());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof CreateModelResult == false)
            return false;
        CreateModelResult other = (CreateModelResult) obj;
        if (other.getContentType() == null ^ this.getContentType() == null)
            return false;
        if (other.getContentType() != null && other.getContentType().equals(this.getContentType()) == false)
            return false;
        if (other.getDescription() == null ^ this.getDescription() == null)
            return false;
        if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
            return false;
        if (other.getModelId() == null ^ this.getModelId() == null)
            return false;
        if (other.getModelId() != null && other.getModelId().equals(this.getModelId()) == false)
            return false;
        if (other.getName() == null ^ this.getName() == null)
            return false;
        if (other.getName() != null && other.getName().equals(this.getName()) == false)
            return false;
        if (other.getSchema() == null ^ this.getSchema() == null)
            return false;
        if (other.getSchema() != null && other.getSchema().equals(this.getSchema()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getContentType() == null) ? 0 : getContentType().hashCode());
        hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
        hashCode = prime * hashCode + ((getModelId() == null) ? 0 : getModelId().hashCode());
        hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
        hashCode = prime * hashCode + ((getSchema() == null) ? 0 : getSchema().hashCode());
        return hashCode;
    }

    @Override
    public CreateModelResult clone() {
        try {
            return (CreateModelResult) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

}


text:
import { range } from './range'

describe('common/range', () => {
  test('steps by 1', () => {
    expect(Array.from(range(0, 5))).toEqual([0, 1, 2, 3, 4])
    expect(Array.from(range(5, 7))).toEqual([5, 6])
  })

  test('ends immediately if start === end', () => {
    expect(Array.from(range(5, 5))).toEqual([])
    expect(Array.from(range(5, 5, -1))).toEqual([])
  })

  test('handles counting downward', () => {
    expect(Array.from(range(5, 0))).toEqual([5, 4, 3, 2, 1])
  })

  test("handles end values that don't fall on a step", () => {
    expect(Array.from(range(0, 9, 2))).toEqual([0, 2, 4, 6, 8])
    expect(Array.from(range(9, 0, -2))).toEqual([9, 7, 5, 3, 1])
  })

  test("throws if parameters wouldn't make progress", () => {
    expect(() => Array.from(range(0, 5, -1))).toThrowErrorMatchingInlineSnapshot(
      `"range was passed parameters that do not make progress: [start: 0, end: 5, step: -1]"`,
    )
    expect(() => Array.from(range(5, 0, 1))).toThrowErrorMatchingInlineSnapshot(
      `"range was passed parameters that do not make progress: [start: 5, end: 0, step: 1]"`,
    )
  })
})


text:
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Osu.UI;
using osu.Game.Rulesets.UI;
using osuTK;

namespace osu.Game.Rulesets.Osu.Edit
{
    public class DrawableOsuEditRuleset : DrawableOsuRuleset
    {
        public DrawableOsuEditRuleset(Ruleset ruleset, WorkingBeatmap beatmap)
            : base(ruleset, beatmap)
        {
        }

        protected override Playfield CreatePlayfield() => new OsuPlayfieldNoCursor { Size = Vector2.One };

        private class OsuPlayfieldNoCursor : OsuPlayfield
        {
            protected override GameplayCursorContainer CreateCursor() => null;
        }
    }
}