text:
/*jshint esversion: 6 */
import { run } from '@ember/runloop';
import { observer } from '@ember/object';
import Component from '@ember/component';
import layout from '../templates/components/ember-blockly-preview';

export default Component.extend({
  layout,
  block: null,
  classNames: ['ember-blockly-container'],
  workspace: '<xml xmlns="http://www.w3.org/1999/xhtml"></xml>',
  mediaFolder: "blockly-package/media/",
  readOnly: true,
  showCode: false,
  javascriptCode: '',

  blockObserver: observer('block', function () {
    this.clear_workspace();
    this.redraw_block();
  }),

  didInsertElement() {

    let options = {
      toolbox: "",
      trashcan: false,
      media: this.get("mediaFolder"),
      readOnly: this.get('readOnly'),
      scrollbars: false,
    };

    let blocklyDiv = this.element.querySelector('div');

    let workspace = Blockly.inject(blocklyDiv, options);

    this.set('workspace', workspace);
    this.redraw_block();

    Blockly.ContextMenu.show = (a, b, c) => { };

    workspace.addChangeListener(() => {
      run(() => {
        this.onUpdate();
      });
    });
  },

  onUpdate(event) {
    let xml = Blockly.Xml.workspaceToDom(this.get('workspace'));
    let xml_text = Blockly.Xml.domToText(xml);

    if (this.get('showCode')) {
      let code = Blockly.JavaScript.workspaceToCode(this.get('workspace'));
      this.set('javascriptCode', js_beautify(code));
    }

    if (this.onChangeWorkspace)
      this.onChangeWorkspace(xml_text);
  },

  redraw_block() {
    let workspace = this.get('workspace');
    let block = this.get('block');

    if (!Blockly.Blocks[block]) {
      throw new Error(`This block named '${block}' don't exist.`);
    }

    let newBlock = workspace.newBlock(block);

    newBlock.initSvg();
    newBlock.render();
    newBlock.moveBy(15, 15);
  },

  clear_workspace() {
    this.get('workspace').clear();
  }

});


text:
#include "eeprom_lib.h"

#include "spi_lib.h"
#include "nrf_drv_common.h"
#include "custom_board.h"

#include "app_util_platform.h"

#include "debug_lib.h"

#include "systick_lib.h"		// Needed for the timeout-checks

#define CMD_WREN	0b00000110	/**< Write enable command code */
#define CMD_RDSR	0b00000101	/**< Read status register command code */
#define CMD_WRSR	0b00000001	/**< Write status register command code */
#define CMD_WRITE	0b00000010	/**< Write to memory array command code */
#define CMD_READ	0b00000011	/**< Read from memory array command code */

#define EEPROM_OPERATION_TIMEOUT_MS		500	/**< The time in milliseconds to wait for an operation to finish. */
#define EEPROM_PAGE_SIZE 				128	/**< We need to align the bytes to write and read to the EEPROM boundaries (because of unknown reasons it couldn't be 256..) */

static ret_code_t eeprom_read_status(uint8_t* eeprom_status);
static bool eeprom_is_busy(void);
static ret_code_t eeprom_write_enable(void);
static ret_code_t eeprom_global_unprotect(void);

static uint8_t eeprom_buf[EEPROM_PAGE_SIZE + 4];	/**< Buffer for EEPROM read/store operations (+ 4 for header) */

typedef struct {
	uint8_t 	first_data[4];
	uint8_t*	p_data;
} eeprom_finish_operation_t;

static spi_instance_t spi_instance;	/**< The spi instance used to communicate with the EEPROM-IC via SPI */

static volatile eeprom_operation_t eeprom_operation = EEPROM_NO_OPERATION; /**< The current EEPROM operation */

static volatile eeprom_finish_operation_t eeprom_finish_operation;

// It is a little bit more complicate than flash, because there is no callback when the actual write operation is done in EEPROM!
void spi_event_handler(spi_evt_t const * p_event) {
	if(p_event->type == SPI_TRANSFER_DONE) {
		// Just copy the replaced 4 bytes at the beginning back to the data-array (rx_data or tx_data)
		memcpy((uint8_t*) eeprom_finish_operation.p_data, (uint8_t*) eeprom_finish_operation.first_data, 4);
	}
}

ret_code_t eeprom_init(void) {

	spi_instance.spi_peripheral = 0;
	spi_instance.nrf_drv_spi_config.frequency 		= NRF_DRV_SPI_FREQ_8M;
	spi_instance.nrf_drv_spi_config.bit_order 		= NRF_DRV_SPI_BIT_ORDER_MSB_FIRST;
	spi_instance.nrf_drv_spi_config.mode			= NRF_DRV_SPI_MODE_3;
	spi_instance.nrf_drv_spi_config.orc				= 0;
	spi_instance.nrf_drv_spi_config.irq_priority	= APP_IRQ_PRIORITY_MID;
	spi_instance.nrf_drv_spi_config.ss_pin 			= SPIM0_EEPROM_SS_PIN;
	spi_instance.nrf_drv_spi_config.miso_pin		= SPIM0_MISO_PIN;
	spi_instance.nrf_drv_spi_config.mosi_pin		= SPIM0_MOSI_PIN;
	spi_instance.nrf_drv_spi_config.sck_pin			= SPIM0_SCK_PIN;

	ret_code_t ret = spi_init(&spi_instance);

	// ret could be NRF_SUCCESS or NRF_ERROR_INVALID_PARAM
	if(ret != NRF_SUCCESS)
		return NRF_ERROR_INTERNAL;

	// Directly unprotect the EEPROM in the initialization step
	ret = eeprom_global_unprotect();

	// ret could be NRF_SUCCESS, NRF_ERROR_BUSY	or NRF_ERROR_TIMEOUT

	return ret;
}

/**@brief   Function for reading the status of the EEPROM.
 *
 * @param[in,out]	eeprom_status		Pointer to memory where to save current eeprom status.
 *
 * @retval  		NRF_SUCCESS    		If the spi operation was succesful.
 * @retval  		NRF_ERROR_BUSY  	If there is already an SPI operation ongoing on the same spi peripheral.
 */
static ret_code_t eeprom_read_status(uint8_t* p_eeprom_status) {
	uint8_t tx_buf[1] = {CMD_RDSR};
    uint8_t rx_buf[2] = {0, 0x01};

	ret_code_t ret = spi_transmit_receive(&spi_instance, tx_buf, 1, rx_buf, 2);

	// ret could be NRF_SUCCESS, NRF_ERROR_BUSY, NRF_ERROR_INVALID_ADDR (the last one can't happen here)
    if(ret != NRF_SUCCESS)
		ret = NRF_ERROR_BUSY;

	*p_eeprom_status = rx_buf[1];

	return ret;
}

/**@brief   Function for checking if the EEPROM is busy.
 *
 * @retval  0    		If the EEPROM and the spi interface is not busy.
 * @retval  1  			If the EEPROM or the spi interface is busy.
 */
static bool eeprom_is_busy(void) {
	uint8_t eeprom_status = 0x01;
	ret_code_t ret = eeprom_read_status(&eeprom_status);
	// Check if the SPI is busy
	if(ret != NRF_SUCCESS)
		return 1;

	// Check if busy flag of the EEPROM status is set
	if(eeprom_status & 0x01) {
		return 1;
	}
	return 0;
}

/**@brief   Function for enabling a write operation to the EEPROM.
 *
 * @retval  NRF_SUCCESS    		If the spi transmit operation was succesful.
 * @retval  NRF_ERROR_BUSY  	If there is already an SPI operation ongoing on the same spi peripheral.
 * @retval	NRF_ERROR_TIMEOUT	If the operation takes too long.
 */
static ret_code_t eeprom_write_enable(void) {
	// Generating one-byte buffer for writing the "write enable"-command
	uint8_t tx_buf[1] = {CMD_WREN};

	// SPI transmit in blocking mode
	ret_code_t ret = spi_transmit(&spi_instance, tx_buf, 1);
	// ret could be NRF_SUCCESS, NRF_ERROR_BUSY, NRF_ERROR_INVALID_ADDR (the last one can't happen here)
	if(ret != NRF_SUCCESS) {
		return NRF_ERROR_BUSY;
	}

	uint64_t end_ms = systick_get_continuous_millis() + EEPROM_OPERATION_TIMEOUT_MS;
	while(eeprom_get_operation() != EEPROM_NO_OPERATION && systick_get_continuous_millis() < end_ms);
	if(eeprom_get_operation() != EEPROM_NO_OPERATION) {
		// Reset the eeprom operation
		eeprom_operation = EEPROM_NO_OPERATION;
		return NRF_ERROR_TIMEOUT;
	}

	return NRF_SUCCESS;
}

/**@brief   Function for unprotecting all EEPROM blocks for writing to them.
 *
 * @retval  NRF_SUCCESS    		If the spi transmit operation was succesful.
 * @retval  NRF_ERROR_BUSY  	If there is already an SPI operation ongoing on the same spi peripheral.
 * @retval	NRF_ERROR_TIMEOUT	If the operation takes too long.
 */
static ret_code_t eeprom_global_unprotect(void) {

	// Enable writing
	ret_code_t ret = eeprom_write_enable();
	if(ret != NRF_SUCCESS)
		return ret;

	// Generating two-byte buffer for writing the "write status register"-command and the new value of the status register
	// Status register format (Datasheet p.20, Table 6)  | SRWD | 0 | 0 | 0 | BP1 | BP0 | WEL | WIP |
	// Only the Bits SRWD (Status Register Write Protect), BP1 and BP0 (Block Protect) can be manipulated
	uint8_t tx_buf[2] = {CMD_WRSR, 0x00};

	// SPI transmit in blocking mode
	ret = spi_transmit(&spi_instance, tx_buf, 2);

	// ret could be NRF_SUCCESS, NRF_ERROR_BUSY, NRF_ERROR_INVALID_ADDR (the last one can't happen here)
    if(ret != NRF_SUCCESS)
		ret = NRF_ERROR_BUSY;

	uint64_t end_ms = systick_get_continuous_millis() + EEPROM_OPERATION_TIMEOUT_MS;
	while(eeprom_get_operation() != EEPROM_NO_OPERATION && systick_get_continuous_millis() < end_ms);
	if(eeprom_get_operation() != EEPROM_NO_OPERATION) {
		// Reset the eeprom operation
		eeprom_operation = EEPROM_NO_OPERATION;
		return NRF_ERROR_TIMEOUT;
	}

	return ret;
}

ret_code_t eeprom_store(uint32_t address, const uint8_t* tx_data, uint32_t length_tx_data) {

	// Check if the specified address is valid. The EEPROM has 256kByte of memory.
	// Furthermore check if the data pointer is in RAM, not in read only-Memory
	if((address + length_tx_data > (EEPROM_SIZE)) ||  !nrf_drv_is_in_RAM(tx_data))
		return NRF_ERROR_INVALID_PARAM;

	if(tx_data == NULL)
		return NRF_ERROR_INVALID_PARAM;

	// Check if the EEPROM has already an ongoing operation.
	if(eeprom_get_operation() != EEPROM_NO_OPERATION) {
		return NRF_ERROR_BUSY;
	}

	uint32_t address_offset = 0;
	while(length_tx_data > 0) {
		// Set the eeprom operation to store
		eeprom_operation = EEPROM_STORE_OPERATION;

		// Enable writing
		ret_code_t ret = eeprom_write_enable();
		// ret could be NRF_SUCCESS or NRF_ERROR_BUSY
		if(ret != NRF_SUCCESS) {
			// Reset the eeprom operation
			eeprom_operation = EEPROM_NO_OPERATION;
			return ret;
		}

		uint32_t tmp_address = address + address_offset;
		// The header for writing {CMD_WRITE, address24_16, address15_8, address7_0}
		uint8_t tx_header[4] = {CMD_WRITE, ((tmp_address>>16)&0xFF), ((tmp_address>>8)&0xFF), ((tmp_address>>0)&0xFF)};

		// Round up to next Page-address
		uint32_t next_page_address = ((tmp_address/EEPROM_PAGE_SIZE) + 1) * EEPROM_PAGE_SIZE;
		uint32_t step_len = next_page_address - tmp_address;
		step_len = (length_tx_data > step_len) ? step_len : length_tx_data;

		memcpy(eeprom_buf, tx_header, 4);
		memcpy(&eeprom_buf[4], &tx_data[address_offset], step_len);

		// Start a blocking spi transmission
		ret = spi_transmit(&spi_instance, eeprom_buf, 4 + step_len);

		// ret could be NRF_SUCCESS, NRF_ERROR_BUSY, NRF_ERROR_INVALID_ADDR
		if(ret == NRF_ERROR_INVALID_ADDR) ret = NRF_ERROR_INVALID_PARAM;
		if(ret != NRF_SUCCESS) {
			// Reset the eeprom operation
			eeprom_operation = EEPROM_NO_OPERATION;
			return ret;
		}

		// Wait until the first 4 data bytes are stored into the EEPROM (important to not just check if they have been transmitted via spi, because the EEPROM needs time to store it internally)
		uint64_t end_ms = systick_get_continuous_millis() + EEPROM_OPERATION_TIMEOUT_MS;
		while(eeprom_get_operation() != EEPROM_NO_OPERATION && systick_get_continuous_millis() < end_ms);
		if(eeprom_get_operation() != EEPROM_NO_OPERATION) {
			// Reset the eeprom operation
			eeprom_operation = EEPROM_NO_OPERATION;
			return NRF_ERROR_TIMEOUT;
		}

		length_tx_data -= step_len;
		address_offset += step_len;
	}

	return NRF_SUCCESS;
}

ret_code_t eeprom_read(uint32_t address, uint8_t* rx_data, uint32_t length_rx_data) {
	// Check if the specified address is valid. The EEPROM has 256kByte of memory.
	// Furthermore check if the data pointer is in RAM, not in read only-Memory
	if((address + length_rx_data > (EEPROM_SIZE) ) ||  !nrf_drv_is_in_RAM(rx_data))
		return NRF_ERROR_INVALID_PARAM;

	if(rx_data == NULL)
		return NRF_ERROR_INVALID_PARAM;

	// Check if the EEPROM has already an ongoing operation.
	if(eeprom_get_operation() != EEPROM_NO_OPERATION) {
		return NRF_ERROR_BUSY;
	}

	uint32_t address_offset = 0;
	while(length_rx_data > 0) {
		// Set the eeprom operation to read
		eeprom_operation = EEPROM_READ_OPERATION;

		uint32_t tmp_address = address + address_offset;
		uint8_t tx_header[4] = {CMD_READ, ((tmp_address>>16)&0xFF), ((tmp_address>>8)&0xFF), ((tmp_address>>0)&0xFF)};

		// Round up to next Page-address
		uint32_t next_page_address = ((tmp_address/EEPROM_PAGE_SIZE) + 1) * EEPROM_PAGE_SIZE;
		uint32_t step_len = next_page_address - tmp_address;
		step_len = (length_rx_data > step_len) ? step_len : length_rx_data;
		memset(eeprom_buf, 0, sizeof(eeprom_buf));

		// Do a blocking transmit receive operation
		ret_code_t ret = spi_transmit_receive(&spi_instance, tx_header, 4, eeprom_buf, 4 + step_len);
		// ret could be NRF_SUCCESS, NRF_ERROR_BUSY, NRF_ERROR_INVALID_ADDR
		if(ret == NRF_ERROR_INVALID_ADDR) ret = NRF_ERROR_INVALID_PARAM;
		if(ret != NRF_SUCCESS) {
			// Reset the eeprom operation
			eeprom_operation = EEPROM_NO_OPERATION;
			return ret;
		}

		// Wait until the first 4 data bytes are stored into the EEPROM (important to not just check if they have been transmitted via spi, because the EEPROM needs time to store it internally)
		uint64_t end_ms = systick_get_continuous_millis() + EEPROM_OPERATION_TIMEOUT_MS;
		while(eeprom_get_operation() != EEPROM_NO_OPERATION && systick_get_continuous_millis() < end_ms);
		if(eeprom_get_operation() != EEPROM_NO_OPERATION) {
			// Reset the eeprom operation
			eeprom_operation = EEPROM_NO_OPERATION;
			return NRF_ERROR_TIMEOUT;
		}
		memcpy(&rx_data[address_offset], &eeprom_buf[4], step_len);

		length_rx_data -= step_len;
		address_offset += step_len;
	}

	return NRF_SUCCESS;
}

eeprom_operation_t eeprom_get_operation(void) {

	// Reset the eeprom operation if the EEPROM and the spi interface is not busy (this could not be done in an interrupt handler,
	// because there is no interrupt from the EEPROM only from the SPI, but this is not representative for internal EEPROM operation)
	if(eeprom_is_busy()) {
		// If no operation is set, but the EEPROM seems to be busy, there should be an store operation ongoing (e.g. unprotect-function)
		if(eeprom_operation == EEPROM_NO_OPERATION)
			eeprom_operation = EEPROM_STORE_OPERATION;
	} else {
		eeprom_operation = EEPROM_NO_OPERATION;

	}

	return eeprom_operation;

}

uint32_t eeprom_get_size(void) {
	return EEPROM_SIZE;
}

bool eeprom_selftest(void) {

	#define EEPROM_TEST_DATA_LEN	500
	#define EEPROM_TEST_ADDRESS		1234

	uint8_t data[EEPROM_TEST_DATA_LEN + 1];
	uint8_t rx_data[EEPROM_TEST_DATA_LEN + 1];

	for(uint32_t i = 0; i < EEPROM_TEST_DATA_LEN; i++) {
		data[i] = (i%52)+65;
		rx_data[i] = 0;
	}

	debug_log("EEPROM: Started EEPROM selftest...\n\r");

//********************** Read and write Tests ***********************
	ret_code_t ret = eeprom_store(EEPROM_TEST_ADDRESS, (uint8_t*) data, EEPROM_TEST_DATA_LEN);
	debug_log("EEPROM: Test store, Ret: %d\n\r", ret);
	if(ret != NRF_SUCCESS) {
		debug_log("EEPROM: Store failed!\n\r");
		return 0;
	}

	ret = eeprom_read(EEPROM_TEST_ADDRESS, rx_data, EEPROM_TEST_DATA_LEN);
	rx_data[EEPROM_TEST_DATA_LEN] = 0;
	data[EEPROM_TEST_DATA_LEN] = 0;

	debug_log("EEPROM: Test read, Ret: %d\n", ret);
	if(ret != NRF_SUCCESS) {
		debug_log("EEPROM: Read failed!\n\r");
		return 0;
	}

	if(memcmp(data, rx_data, EEPROM_TEST_DATA_LEN) != 0) {
		debug_log("EEPROM: Read data don't match written data!");
		return 0;
	}

//********************* No RAM memory tests *************************
	char* test = "HELLO";
	ret = eeprom_store(EEPROM_TEST_ADDRESS, (uint8_t*) test, 5);

	debug_log("EEPROM: Test store non RAM data, Ret: %d\n\r", ret);
	if(ret != NRF_ERROR_INVALID_PARAM) {
		debug_log("EEPROM: Test store non RAM data failed!\n\r");
		return 0;
	}

	ret = eeprom_read(EEPROM_TEST_ADDRESS, (uint8_t*) test, 5);

	debug_log("EEPROM: Test read to non RAM data, Ret: %d\n\r", ret);
	if(ret != NRF_ERROR_INVALID_PARAM) {
		debug_log("EEPROM: Test read to non RAM data failed!\n\r");
		return 0;
	}

//******************* False address test **************************
	ret = eeprom_store(EEPROM_SIZE - 2, (uint8_t*) data, EEPROM_TEST_DATA_LEN);

	debug_log("EEPROM: Test invalid address, Ret: %d\n\r", ret);
	if(ret != NRF_ERROR_INVALID_PARAM) {
		debug_log("EEPROM: Test invalid address failed!\n\r");
		return 0;
	}

	debug_log("EEPROM: EEPROM test successful!!\n\r");

	return 1;
}

redpajama_set_name: RedPajamaGithub


text:
from django import http
from django.core.exceptions import ObjectDoesNotExist, PermissionDenied

import olympia.core.logger

from olympia import amo
from olympia.access import acl
from olympia.addons.decorators import owner_or_unlisted_viewer_or_reviewer

log = olympia.core.logger.getLogger('z.addons')

def allowed(request, file):
    try:
        version = file.version
        addon = version.addon
    except ObjectDoesNotExist:
        raise http.Http404

    # General case: addon is listed.
    if version.channel == amo.RELEASE_CHANNEL_LISTED:
        # We don't show the file-browser publicly because of potential DOS
        # issues, we're working on a fix but for now, let's not do this.
        # (cgrebs, 06042017)
        is_owner = acl.check_addon_ownership(request, addon, dev=True)
        if acl.is_reviewer(request, addon) or is_owner:
            return True  # Public and sources are visible, or reviewer.
        raise PermissionDenied  # Listed but not allowed.
    # Not listed? Needs an owner or an "unlisted" admin.
    else:
        if owner_or_unlisted_viewer_or_reviewer(request, addon):
            return True
    raise http.Http404  # Not listed, not owner or admin.


text:
namespace EPiServer.Templates.Advanced.Workroom.Pages {

    public partial class CalendarEvent {

        /// <summary>
        /// DisplayPanel control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Panel DisplayPanel;

        /// <summary>
        /// EditButton control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.LinkButton EditButton;

        /// <summary>
        /// DeleteButton control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.LinkButton DeleteButton;

        /// <summary>
        /// EditPanel control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Panel EditPanel;

        /// <summary>
        /// EditPanelCaption control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.HtmlControls.HtmlGenericControl EditPanelCaption;

        /// <summary>
        /// EditPageName control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.TextBox EditPageName;

        /// <summary>
        /// Label1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label1;

        /// <summary>
        /// StartDatePicker control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::EPiServer.Templates.AlloyTech.Units.Placeable.DateTimePicker StartDatePicker;

        /// <summary>
        /// RequiredFieldValidator1 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;

        /// <summary>
        /// Label2 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Label Label2;

        /// <summary>
        /// StopDatePicker control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::EPiServer.Templates.AlloyTech.Units.Placeable.DateTimePicker StopDatePicker;

        /// <summary>
        /// RequiredFieldValidator2 control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2;

        /// <summary>
        /// EditMainBody control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::EPiServer.Templates.AlloyTech.Units.Placeable.TinyMCETextEditor EditMainBody;

        /// <summary>
        /// EditButtonSave control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Button EditButtonSave;

        /// <summary>
        /// EditButtonCancel control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Button EditButtonCancel;

        /// <summary>
        /// CalendarView control.
        /// </summary>
        /// <remarks>
        /// Auto-generated field.
        /// To modify move field declaration from designer file to code-behind file.
        /// </remarks>
        protected global::System.Web.UI.WebControls.Calendar CalendarView;
    }
}


text:
  <title>Zachary Dixon</title>

  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

  {{> layout}}

<template name="layout">

    {{> hero}}
    {{> about}}
    {{> work}}

    {{> quoteCard text="Do what you love, love what you do"}}
    {{> contact}}

</template>

<template name="hero">

Zachary Dixon

Web Developer - Husband - Gamer

        Learn More

</template>

<template name="about">

          My name is
          Zachary Dixon

          and I'm a
          Web Developer.

        See my work

I have a passion for front end application and web development. I'm constantly looking at new shiny technologies and love to see what people think of.

I'm a strong believer in the "do what you love, love what you do" philosophy. Life is too short, so just go for it.

</template>

<template name="work">

        {{#each projects}}

            {{> project}}

        {{/each}}

        Contact Me

</template>

<template name="project">

      {{title}}
      {{#if hasLink}}
{{link}}
{{/if}}

      {{title}}

{{description}}

Technologies Used:

        {{#each skills}}

{{this}}

        {{/each}}

      {{#if hasLink}}
{{link}}
{{/if}}

</template>

<template name="skills">

</template>

<template name="contact">

      <form id="form-contact" class="col offset-m6 m6 s12 card z-depth-1 animated wow fadeInRight">

Contact Me

Thanks for contacting me! I'll get back to you shortly.

            <input id="contact-name" type="text" class="validate" name="name" required>
            Name

            <input id="contact-email" type="email" class="validate" name="email" required>
            Email

            <textarea id="contact-message" class="materialize-textarea" name="message" required></textarea>
            Message

            <button type="submit" class="waves-effect waves-light blue btn btn-submit-contact">Send Message </button>

      </form>

</template>

<template name="quoteCard">

"{{text}}"

</template>


text:
package org.kie.workbench.common.stunner.bpmn.definition;

import java.util.Set;

import org.junit.Test;
import org.kie.workbench.common.stunner.core.backend.definition.adapter.ReflectionAdapterUtils;
import org.kie.workbench.common.stunner.core.definition.annotation.definition.Labels;

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

public class BaseSubprocessTest {

    @Test
    public void testBaseSubprocessCanBeContainedByALane() throws Exception {

        final FakeBaseSubprocess baseSubprocess = new FakeBaseSubprocess();
        final Set<String> labels = ReflectionAdapterUtils.getAnnotatedFieldValue(baseSubprocess, Labels.class);

        assertNotNull(labels);
        assertTrue(labels.contains("lane_child"));
    }

    private class FakeBaseSubprocess extends BaseSubprocess {

    }
}


text:
package nvimutil

import (
	"github.com/neovim/go-client/nvim"
)

// TabpageContext represents a Neovim tabpage context.
type TabpageContext struct {
	nvim.Tabpage
}


text:
/* global require */
/* global describe, it */
var assert = require("assert")
describe('Array', function() {
    describe('#indexOf()', function() {
        it('should return -1 when the value is not present', function() {
            assert.equal(-1, [1, 2, 3].indexOf(5))
            assert.equal(-1, [1, 2, 3].indexOf(0))
        })
    })
})
describe('Array', function() {
    describe('#indexOf()', function() {
        it('should return -1 when the value is not present', function() {
            assert.equal(-1, [1, 2, 3].indexOf(5))
            assert.equal(-1, [1, 2, 3].indexOf(0))
        })
    })
})
describe('Array', function() {
    describe('#indexOf()', function() {
        it('should return -1 when the value is not present', function() {
            assert.equal(-1, [1, 2, 3].indexOf(5))
            assert.equal(-1, [1, 2, 3].indexOf(0))
        })
    })
})
describe('Array', function() {
    describe('#indexOf()', function() {
        it('should return -1 when the value is not present', function() {
            assert.equal(-1, [1, 2, 3].indexOf(5))
            assert.equal(-1, [1, 2, 3].indexOf(0))
        })
    })
})


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="Content-Style-Type" content="text/css">
  <title>Content</title>
  <meta name="Generator" content="Cocoa HTML Writer">
  <meta name="CocoaVersion" content="1265.21">

 Welcome to DIScover

 Understanding DIScover

 Getting Started With DIScover

 The Model Browser Interface

 Querying an Information Model

 Working With Graphical Views

 Working With Source Code

 Impact Analysis

 Caliper

 Metrics

 Dormant

 Simplify.h

 Developer Xpress

    Starting Developer Xpress

    Configuring Developer Xpress

    The Developer Xpress Interface

    Basic Functions

    Navigating Your Source Code

       Using the Runtime List

       Querying Entities In Your Source Code

       Enabling Icons

       Groups

          Working With a Group

          Working With Multiple Groups

    Using Configuration Management Systems

    Using Submission Check

    Customizing Developer Xpress

    Troubleshooting


text:
package org.drip.state.forward;

/*
 * -*- mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 */

/*!
 * Copyright (C) 2017 Lakshmi Krishnamurthy
 * Copyright (C) 2016 Lakshmi Krishnamurthy
 * Copyright (C) 2015 Lakshmi Krishnamurthy
 * Copyright (C) 2014 Lakshmi Krishnamurthy
 * Copyright (C) 2013 Lakshmi Krishnamurthy
 *
 *  This file is part of DRIP, a free-software/open-source library for buy/side financial/trading model
 *  	libraries targeting analysts and developers
 *  	https://lakshmidrip.github.io/DRIP/
 *
 *  DRIP is composed of four main libraries:
 *
 *  - DRIP Fixed Income - https://lakshmidrip.github.io/DRIP-Fixed-Income/
 *  - DRIP Asset Allocation - https://lakshmidrip.github.io/DRIP-Asset-Allocation/
 *  - DRIP Numerical Optimizer - https://lakshmidrip.github.io/DRIP-Numerical-Optimizer/
 *  - DRIP Statistical Learning - https://lakshmidrip.github.io/DRIP-Statistical-Learning/
 *
 *  - DRIP Fixed Income: Library for Instrument/Trading Conventions, Treasury Futures/Options,
 *  	Funding/Forward/Overnight Curves, Multi-Curve Construction/Valuation, Collateral Valuation and XVA
 *  	Metric Generation, Calibration and Hedge Attributions, Statistical Curve Construction, Bond RV
 *  	Metrics, Stochastic Evolution and Option Pricing, Interest Rate Dynamics and Option Pricing, LMM
 *  	Extensions/Calibrations/Greeks, Algorithmic Differentiation, and Asset Backed Models and Analytics.
 *
 *  - DRIP Asset Allocation: Library for model libraries for MPT framework, Black Litterman Strategy
 *  	Incorporator, Holdings Constraint, and Transaction Costs.
 *
 *  - DRIP Numerical Optimizer: Library for Numerical Optimization and Spline Functionality.
 *
 *  - DRIP Statistical Learning: Library for Statistical Evaluation and Machine Learning.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *   	you may not use this file except in compliance with the License.
 *
 *  You may obtain a copy of the License at
 *  	http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  	distributed under the License is distributed on an "AS IS" BASIS,
 *  	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 *  See the License for the specific language governing permissions and
 *  	limitations under the License.
 */

/**
 * ForwardCurve is the stub for the forward curve functionality. It extends the Curve object by exposing the
 * 	following functions:
 * 	- The name/epoch of the forward rate instance.
 * 	- The index/currency/tenor associated with the forward rate instance.
 *  - Forward Rate to a specific date/tenor.
 *  - Generate scenario tweaked Latent State from the base forward curve corresponding to mode adjusted
 *  	(flat/parallel/custom) manifest measure/quantification metric.
 *  - Retrieve array of latent state manifest measure, instrument quantification metric, and the array of
 *  	calibration components.
 *  - Set/retrieve curve construction input instrument sets.
 *
 * @author Lakshmi Krishnamurthy
 */

public abstract class ForwardCurve implements org.drip.state.forward.ForwardRateEstimator,
	org.drip.analytics.definition.Curve {

	private int _iEpochDate = java.lang.Integer.MIN_VALUE;
	private org.drip.state.identifier.ForwardLabel _fri = null;

	protected ForwardCurve (
		final int iEpochDate,
		final org.drip.state.identifier.ForwardLabel fri)
		throws java.lang.Exception
	{
		if (null == (_fri = fri)) throw new java.lang.Exception ("ForwardCurve ctr: Invalid Inputs");

		_iEpochDate = iEpochDate;
	}

	@Override public org.drip.state.identifier.LatentStateLabel label()
	{
		return _fri;
	}

	@Override public java.lang.String currency()
	{
		return _fri.currency();
	}

	@Override public org.drip.analytics.date.JulianDate epoch()
	{
		try {
			return new org.drip.analytics.date.JulianDate (_iEpochDate);
		} catch (java.lang.Exception e) {
			e.printStackTrace();
		}

		return null;
	}

	@Override public java.lang.String tenor()
	{
		return _fri.tenor();
	}

	@Override public org.drip.state.identifier.ForwardLabel index()
	{
		return _fri;
	}

	@Override public double forward (
		final org.drip.analytics.date.JulianDate dt)
		throws java.lang.Exception
	{
		if (null == dt) throw new java.lang.Exception ("ForwardRate::forward got null for date");

		return forward (dt.julian());
	}

	@Override public double forward (
		final java.lang.String strTenor)
		throws java.lang.Exception
	{
		if (null == strTenor || strTenor.isEmpty())
			throw new java.lang.Exception ("ForwardRate::forward got bad tenor");

		return forward (epoch().addTenor (strTenor));
	}

	@Override public boolean setCCIS (
		final org.drip.analytics.input.CurveConstructionInputSet ccis)
	{
		return true;
	}

	@Override public org.drip.product.definition.CalibratableComponent[] calibComp()
	{
		return null;
	}

	@Override public org.drip.analytics.support.CaseInsensitiveTreeMap<java.lang.Double> manifestMeasure (
		final java.lang.String strInstrumentCode)
	{
		return null;
	}

	@Override public org.drip.state.representation.LatentState parallelShiftManifestMeasure (
		final java.lang.String strManifestMeasure,
		final double dblShift)
	{
		return null;
	}

	@Override public org.drip.state.representation.LatentState shiftManifestMeasure (
		final int iSpanIndex,
		final java.lang.String strManifestMeasure,
		final double dblShift)
	{
		return null;
	}

	@Override public org.drip.state.representation.LatentState customTweakManifestMeasure (
		final java.lang.String strManifestMeasure,
		final org.drip.param.definition.ManifestMeasureTweak rvtp)
	{
		return null;
	}

	@Override public org.drip.state.representation.LatentState parallelShiftQuantificationMetric (
		final double dblShift)
	{
		return null;
	}

	@Override public org.drip.state.representation.LatentState customTweakQuantificationMetric (
		final org.drip.param.definition.ManifestMeasureTweak rvtp)
	{
		return null;
	}

	/**
	 * Retrieve the Manifest Measure Jacobian of the Forward Rate to the given date
	 *
	 * @param strManifestMeasure Manifest Measure
	 * @param dblDate Date
	 *
	 * @return The Manifest Measure Jacobian of the Forward Rate to the given date
	 */

	public abstract org.drip.quant.calculus.WengertJacobian jackDForwardDManifestMeasure (
		final java.lang.String strManifestMeasure,
		final int dblDate);

	/**
	 * Retrieve the Manifest Measure Jacobian of the Forward Rate to the given date
	 *
	 * @param strManifestMeasure Manifest Measure
	 * @param dt Date
	 *
	 * @return The Manifest Measure Jacobian of the Forward Rate to the given date
	 */

	public org.drip.quant.calculus.WengertJacobian jackDForwardDManifestMeasure (
		final java.lang.String strManifestMeasure,
		final org.drip.analytics.date.JulianDate dt)
	{
		if (null == dt) return null;

		return jackDForwardDManifestMeasure (strManifestMeasure, dt.julian());
	}

	/**
	 * Retrieve the Manifest Measure Jacobian of the Forward Rate to the date implied by the given Tenor
	 *
	 * @param strManifestMeasure Manifest Measure
	 * @param strTenor Tenor
	 *
	 * @return The Manifest Measure Jacobian of the Forward Rate to the date implied by the given Tenor
	 */

	public org.drip.quant.calculus.WengertJacobian jackDForwardDManifestMeasure (
		final java.lang.String strManifestMeasure,
		final java.lang.String strTenor)
	{
		if (null == strTenor || strTenor.isEmpty()) return null;

		try {
			return jackDForwardDManifestMeasure (strManifestMeasure, epoch().addTenor (strTenor));
		} catch (java.lang.Exception e) {
			e.printStackTrace();
		}

		return null;
	}
}


text:
namespace UnicornHack.Services;

public interface IRepository
{
    T? Find<T>(params object[] keyValues) where T : class;
    void Add<T>(T entity) where T : class;
    void Remove(object entity);
    void RemoveTracked(object entity);
    void LoadLevels(IReadOnlyList<int> levelIds);
}


text:
# Optim Package

This package provides a set of optimization algorithms, which all follow
a unified, closure-based API.

This package is fully compatible with the [nn](http://nn.readthedocs.org) package, but can also be
used to optimize arbitrary objective functions.

For now, the following algorithms are provided:

  * [Stochastic Gradient Descent](#optim.sgd)
  * [Averaged Stochastic Gradient Descent](#optim.asgd)
  * [L-BFGS](#optim.lbfgs)
  * [Congugate Gradients](#optim.cg)

All these algorithms are designed to support batch optimization as
well as stochastic optimization. It's up to the user to construct an
objective function that represents the batch, mini-batch, or single sample
on which to evaluate the objective.

Some of these algorithms support a line search, which can be passed as
a function (L-BFGS), whereas others only support a learning rate (SGD).

## Overview

This package contains several optimization routines for [Torch](https://github.com/torch/torch7/blob/master/README.md).
Each optimization algorithm is based on the same interface:

```lua
x*, {f}, ... = optim.method(func, x, state)
```

where:

* `func`: a user-defined closure that respects this API: `f, df/dx = func(x)`
* `x`: the current parameter vector (a 1D `torch.Tensor`)
* `state`: a table of parameters, and state variables, dependent upon the algorithm
* `x*`: the new parameter vector that minimizes `f, x* = argmin_x f(x)`
* `{f}`: a table of all f values, in the order they've been evaluated (for some simple algorithms, like SGD, `#f == 1`)

## Example

The state table is used to hold the state of the algorihtm.
It's usually initialized once, by the user, and then passed to the optim function
as a black box. Example:

```lua
state = {
   learningRate = 1e-3,
   momentum = 0.5
}

for i,sample in ipairs(training_samples) do
    local func = function(x)
       -- define eval function
       return f,df_dx
    end
    optim.sgd(func,x,state)
end
```

## Algorithms

All the algorithms provided rely on a unified interface:
```lua
w_new,fs = optim.method(func,w,state)
```
where:
w is the trainable/adjustable parameter vector,
state contains both options for the algorithm and the state of the algorihtm,
func is a closure that has the following interface:
```lua
f,df_dw = func(w)
```
w_new is the new parameter vector (after optimization),
fs is a a table containing all the values of the objective, as evaluated during
the optimization procedure: fs[1] is the value before optimization, and fs[#fs]
is the most optimized one (the lowest).

### [x] sgd(func, w, state)

An implementation of Stochastic Gradient Descent (SGD).

Arguments:

  * `opfunc` : a function that takes a single input (`X`), the point of a evaluation, and returns `f(X)` and `df/dX`
  * `x`      : the initial point
  * `config` : a table with configuration parameters for the optimizer
  * `config.learningRate`      : learning rate
  * `config.learningRateDecay` : learning rate decay
  * `config.weightDecay`       : weight decay
  * `config.weightDecays`      : vector of individual weight decays
  * `config.momentum`          : momentum
  * `config.dampening`         : dampening for momentum
  * `config.nesterov`          : enables Nesterov momentum
  * `state`  : a table describing the state of the optimizer; after each call the state is modified
  * `state.learningRates`      : vector of individual learning rates

Returns :

  * `x`     : the new x vector
  * `f(x)`  : the function, evaluated before the update

### [x] asgd(func, w, state)

An implementation of Averaged Stochastic Gradient Descent (ASGD):

```
x = (1 - lambda eta_t) x - eta_t df/dx(z,x)
a = a + mu_t [ x - a ]

eta_t = eta0 / (1 + lambda eta0 t) ^ 0.75
mu_t = 1/max(1,t-t0)
```

Arguments:

  * `opfunc` : a function that takes a single input (`X`), the point of evaluation, and returns `f(X)` and `df/dX`
  * `x` : the initial point
  * `state` : a table describing the state of the optimizer; after each call the state is modified
  * `state.eta0` : learning rate
  * `state.lambda` : decay term
  * `state.alpha` : power for eta update
  * `state.t0` : point at which to start averaging

Returns:

  * `x`     : the new x vector
  * `f(x)`  : the function, evaluated before the update
  * `ax`    : the averaged x vector

### [x] lbfgs(func, w, state)

An implementation of L-BFGS that relies on a user-provided line
search function (`state.lineSearch`). If this function is not
provided, then a simple learningRate is used to produce fixed
size steps. Fixed size steps are much less costly than line
searches, and can be useful for stochastic problems.

The learning rate is used even when a line search is provided.
This is also useful for large-scale stochastic problems, where
opfunc is a noisy approximation of `f(x)`. In that case, the learning
rate allows a reduction of confidence in the step size.

Arguments :

  * `opfunc` : a function that takes a single input (`X`), the point of evaluation, and returns `f(X)` and `df/dX`
  * `x` : the initial point
  * `state` : a table describing the state of the optimizer; after each call the state is modified
  * `state.maxIter` : Maximum number of iterations allowed
  * `state.maxEval` : Maximum number of function evaluations
  * `state.tolFun` : Termination tolerance on the first-order optimality
  * `state.tolX` : Termination tol on progress in terms of func/param changes
  * `state.lineSearch` : A line search function
  * `state.learningRate` : If no line search provided, then a fixed step size is used

Returns :
  * `x*` : the new `x` vector, at the optimal point
  * `f`  : a table of all function values:
   * `f[1]` is the value of the function before any optimization and
   * `f[#f]` is the final fully optimized value, at `x*`

### [x] cg(func, w, state)

An implementation of the Conjugate Gradient method which is a rewrite of
`minimize.m` written by Carl E. Rasmussen.
It is supposed to produce exactly same results (give
or take numerical accuracy due to some changed order of
operations). You can compare the result on rosenbrock with
[minimize.m](http://www.gatsby.ucl.ac.uk/~edward/code/minimize/example.html).
```
[x fx c] = minimize([0 0]', 'rosenbrock', -25)
```

Note that we limit the number of function evaluations only, it seems much
more important in practical use.

Arguments :

  * `opfunc` : a function that takes a single input, the point of evaluation.
  * `x`      : the initial point
  * `state` : a table of parameters and temporary allocations.
  * `state.maxEval`     : max number of function evaluations
  * `state.maxIter`     : max number of iterations
  * `state.df[0,1,2,3]` : if you pass torch.Tensor they will be used for temp storage
  * `state.[s,x0]`      : if you pass torch.Tensor they will be used for temp storage

Returns :

  * `x*` : the new x vector, at the optimal point
  * `f`  : a table of all function values where
   * `f[1]` is the value of the function before any optimization and
   * `f[#f]` is the final fully optimized value, at x*


text:
<?php

namespace LOCKSSOMatic\CrudBundle\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * Content Providers make deposits to LOCKSS via LOCKSSOMatic.
 *
 * @ORM\Table(name="content_providers")
 * @ORM\Entity
 */
class ContentProvider implements GetPlnInterface
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * The UUID for the provider. SWORD requests must include this UUID in the
     * On-Behalf-Of header or in the URL.
     *
     * @var string
     *
     * @ORM\Column(name="uuid", type="string", length=36, nullable=false)
     * @Assert\Uuid(
     *  versions = {"Uuid:V4_RANDOM"},
     *  strict = false
     * )
     */
    private $uuid;

    /**
     * LOCKSS permission URL for the provider. Must be on the same host
     * as the content.
     *
     * @var string
     *
     * @ORM\Column(name="permissionUrl", type="string", length=255, nullable=false)
     */
    private $permissionurl;

    /**
     * Name of the provider.
     *
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=255, nullable=false)
     */
    private $name;

    /**
     * The maximum file size for the provider in 1000-byte units.
     *
     * @var int
     *
     * @ORM\Column(name="max_file_size", type="bigint", nullable=true)
     */
    private $maxFileSize;

    /**
     * The maximum AU size for the provider in 1000-byte units.
     *
     * @var int
     *
     * @ORM\Column(name="max_au_size", type="bigint", nullable=true)
     */
    private $maxAuSize;

    /**
     * The owner for the provider. Providers make deposit on behalf
     * of owners.
     *
     * @var ContentOwner
     *
     * @ORM\ManyToOne(targetEntity="ContentOwner", inversedBy="contentProviders")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="content_owner_id", referencedColumnName="id")
     * })
     */
    private $contentOwner;

    /**
     * PLN for the provider.
     *
     * @var Pln
     *
     * @ORM\ManyToOne(targetEntity="Pln", inversedBy="contentProviders")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="pln_id", referencedColumnName="id")
     * })
     */
    private $pln;

    /**
     * The LOCKSS Plugin for the content owner.
     *
     * @var Plugin
     *
     * @ORM\ManyToOne(targetEntity="Plugin", inversedBy="contentProviders")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="plugin_id", referencedColumnName="id")
     * })
     */
    private $plugin;

    /**
     * List of AUs for the provider.
     *
     * @ORM\OneToMany(targetEntity="Au", mappedBy="contentProvider")
     *
     * @var Au[]
     */
    private $aus;

    /**
     * Deposits made by the provider.
     *
     * @ORM\OneToMany(targetEntity="Deposit", mappedBy="contentProvider")
     *
     * @var ArrayCollection|Deposit[]
     */
    private $deposits;

    /**
     * Build an empty content provider.
     */
    public function __construct() {
        $this->aus = new ArrayCollection();
        $this->deposits = new ArrayCollection();
    }

    /**
     * Get id.
     *
     * @return int
     */
    public function getId() {
        return $this->id;
    }

    /**
     * Set uuid, converted to uppercase.
     *
     * @param string $uuid
     *
     * @return ContentProvider
     */
    public function setUuid($uuid) {
        $this->uuid = strtoupper($uuid);

        return $this;
    }

    /**
     * Get uuid.
     *
     * @return string
     */
    public function getUuid() {
        return strtoupper($this->uuid);
    }

    /**
     * Set permissionurl.
     *
     * @param string $permissionurl
     *
     * @return ContentProvider
     */
    public function setPermissionurl($permissionurl) {
        $this->permissionurl = $permissionurl;

        return $this;
    }

    /**
     * Get permissionurl.
     *
     * @return string
     */
    public function getPermissionurl() {
        return $this->permissionurl;
    }

    /**
     * Convenience method to get the host holding the permission statement
     * from the permission url.
     *
     * @return string
     */
    public function getPermissionHost() {
        return parse_url($this->getPermissionUrl(), PHP_URL_HOST);
    }

    /**
     * Set name.
     *
     * @param string $name
     *
     * @return ContentProvider
     */
    public function setName($name) {
        $this->name = $name;

        return $this;
    }

    /**
     * Get name.
     *
     * @return string
     */
    public function getName() {
        return $this->name;
    }

    /**
     * Set maxFileSize.
     *
     * @param int $maxFileSize
     *
     * @return ContentProvider
     */
    public function setMaxFileSize($maxFileSize) {
        $this->maxFileSize = $maxFileSize;

        return $this;
    }

    /**
     * Get maxFileSize.
     *
     * @return int
     */
    public function getMaxFileSize() {
        return $this->maxFileSize;
    }

    /**
     * Set maxAuSize.
     *
     * @param int $maxAuSize
     *
     * @return ContentProvider
     */
    public function setMaxAuSize($maxAuSize) {
        $this->maxAuSize = $maxAuSize;

        return $this;
    }

    /**
     * Get maxAuSize.
     *
     * @return int
     */
    public function getMaxAuSize() {
        return $this->maxAuSize;
    }

    /**
     * Set contentOwner.
     *
     * @param ContentOwner $contentOwner
     *
     * @return ContentProvider
     */
    public function setContentOwner(ContentOwner $contentOwner = null) {
        $this->contentOwner = $contentOwner;
        $contentOwner->addContentProvider($this);

        return $this;
    }

    /**
     * Get contentOwner.
     *
     * @return ContentOwner
     */
    public function getContentOwner() {
        return $this->contentOwner;
    }

    /**
     * Set pln.
     *
     * @param Pln $pln
     *
     * @return ContentProvider
     */
    public function setPln(Pln $pln = null) {
        $this->pln = $pln;
        $pln->addContentProvider($this);

        return $this;
    }

    /**
     * Get pln.
     *
     * @return Pln
     */
    public function getPln() {
        return $this->pln;
    }

    /**
     * Add aus.
     *
     * @param Au $aus
     *
     * @return ContentProvider
     */
    public function addAus(Au $aus) {
        $this->aus[] = $aus;

        return $this;
    }

    /**
     * Set plugin.
     *
     * @param Plugin $plugin
     *
     * @return ContentOwner
     */
    public function setPlugin(Plugin $plugin = null) {
        $this->plugin = $plugin;
        if ($plugin !== null) {
            $plugin->addContentProvider($this);
        }

        return $this;
    }

    /**
     * Get plugin.
     *
     * @return Plugin
     */
    public function getPlugin() {
        return $this->plugin;
    }

    /**
     * Remove aus.
     *
     * @param Au $aus
     */
    public function removeAus(Au $aus) {
        $this->aus->removeElement($aus);
    }

    /**
     * Get aus.
     *
     * @return Collection
     */
    public function getAus() {
        return $this->aus;
    }

    /**
     * Count the AUs associated with the provider.
     *
     * @return int
     */
    public function countAus() {
        return $this->aus->count();
    }

    /**
     * Add deposits.
     *
     * @param Deposit $deposits
     *
     * @return ContentProvider
     */
    public function addDeposit(Deposit $deposits) {
        $this->deposits[] = $deposits;

        return $this;
    }

    /**
     * Remove deposits.
     *
     * @param Deposit $deposits
     */
    public function removeDeposit(Deposit $deposits) {
        $this->deposits->removeElement($deposits);
    }

    /**
     * Get deposits.
     *
     * @return ArrayCollection|Deposit[]
     */
    public function getDeposits() {
        return $this->deposits;
    }

    /**
     * Get all of the content items associated with the provider.
     *
     * @return Content[]
     */
    public function getContent() {
        $contentList = array();
        foreach ($this->deposits as $deposit) {
            $content = $deposit->getContent();
            if ($content !== null && count($content) > 0) {
                $contentList = array_merge($contentList, $content->toArray());
            }
        }

        return $contentList;
    }

    /**
     * Synonym for getName().
     *
     * @return string
     */
    public function __toString() {
        return $this->name;
    }
}


text:
<?php

use Vinala\Kernel\Foundation\Application;
use Vinala\Kernel\MVC\View\View;

/**
 * class de controller helloController.
 */
class Intro
{
    public static $id = null;
    public static $object = null;

    public static function steps($step)
    {
        switch ($step) {
            case 'db_check': self::checkDb_step(); break;
            case 1: self::firstStep(); break;
            case 2: self::secondStep(); break;
            case 3: self::thirdStep(); break;
            case 4: self::fourthStep(); break;
        }
        //
        return true;
    }

    public static function hello()
    {
        return View::make('hello.hello');
    }

    protected static function appDoc($index)
    {
        $doc = [
            'project_name'     => "\n\t|  Your project name",
            'owner_name'       => "\n\t|  Your name",
            'project_url'      => "\n\t|  Your website root link, you should put your \n\t| root link , by default we using Application::root \n\t| function to get the root link even if you \n\t| working on localhost",
            'html_title'       => "\n\t|  Default HTML title",
            'timezone'         => "\n\t|  Here you should set your timezone after that \n\t| whenever you wanna get time, Vinala will give\n\t| you exact time for the timezone.\n\t| To get all of timezones supported in php \n\t| visite here : http://php.net/manual/en/timezones.php",
            'routing_inexists' => "\n\t|  When HttpNotFoundException trown if unrouted \n\t| parameter was true it will be show to \n\t| exception else the framework will redirect\n\t| user to Error::r_404 route,",
            'character_set'    => "\n\t|  Default encodage when you using HTML::charset",
            ];
        //
        return $doc[$index]."\n\t*/";
    }

    protected static function appTitles($index)
    {
        $titles = [
            'project_name'     => 'Project name',
            'owner_name'       => 'Owner name',
            'project_url'      => 'Project url',
            'html_title'       => 'HTML Default title',
            'timezone'         => 'Timezone',
            'routing_inexists' => 'Routing inexists event',
            'character_set'    => 'Default Character Set',
            ];
        //
        $sep = "\n\t|----------------------------------------------------------";

        return "\n\n\t/*".$sep."\n\t| ".$titles[$index].$sep;
    }

    protected static function appRow($index, $param)
    {
        $title = self::appTitles($index);
        $doc = self::appDoc($index);
        //
        return $title.$doc."\n\n\t$param\n";
    }

    protected static function appCont($name)
    {
        $project_name = self::appRow('project_name', "'project'=>'vinala',");
        $owner_name = self::appRow('owner_name', "'owner'=>'".$name."',");
        $project_url = self::appRow('project_url', "'url'=>Application::root(),");
        $html_title = self::appRow('html_title', "'title'=> 'Vinala PHP Framework',");
        $timezone = self::appRow('timezone', "'timezone'=> 'UTC',");
        $routing_inexists = self::appRow('routing_inexists', "'unrouted'=> true,");
        $character_set = self::appRow('character_set', "'charset'=> 'utf-8', ");
        //
        return "<?php \nuse Vinala\Kernel\Foundation\Application;\n\nreturn array(\n\t".$project_name.$owner_name.$project_url.$html_title.$timezone.$routing_inexists.$character_set."\n);";
    }

    protected static function langDoc($index)
    {
        $doc = [
            'default_lang' => "\n\t|  Default framework language ",
            'lang_cookie'  => "\n\t|  Langue cookie to store framework default language",
            ];
        //
        return $doc[$index]."\n\t*/";
    }

    protected static function langTitles($index)
    {
        $titles = [
            'default_lang' => 'Default lang',
            'lang_cookie'  => 'Lang Cookie name',
            ];
        //
        $sep = "\n\t|----------------------------------------------------------";

        return "\n\n\t/*".$sep."\n\t| ".$titles[$index].$sep;
    }

    protected static function langRow($index, $param)
    {
        $title = self::LangTitles($index);
        $doc = self::LangDoc($index);
        //
        return $title.$doc."\n\n\t$param\n";
    }

    protected static function langCont($langue)
    {
        $default_lang = self::langRow('default_lang', "'default'=>'$langue',");
        $lang_cookie = self::langRow('lang_cookie', "'cookie'=>'vinala_lang',");
        //
        return "<?php \n\nreturn array(\n\t".$default_lang.$lang_cookie."\n);";
    }

    /**
     * Loggin.
     */
    protected static function logginDoc($index)
    {
        $doc = [
            'debug'               => "\n\t|  Here to make the framework shows errors and\n\t|  exceptions, false to show friendly messages\n\t|  and true to debug",
            'error_debug_message' => "\n\t|  If loggin.debug was false the framework will\n\t|  show this message",
            'error_log'           => "\n\t|  The path of log file where Vinala store errors\n\t|  by default the framework use this path \n\t|  'app/storage/logs/vinala.log'",
            'background'          => "\n\t|  The color background of simple page error",
            ];
        //
        return $doc[$index]."\n\t*/";
    }

    protected static function logginTitles($index)
    {
        $titles = [
            'debug'               => 'Allow Debug',
            'error_debug_message' => 'Error Debug Message',
            'error_log'           => 'Error log',
            'background'          => 'Error simple page background color',
            ];
        //
        $sep = "\n\t|----------------------------------------------------------";

        return "\n\n\t/*".$sep."\n\t| ".$titles[$index].$sep;
    }

    protected static function logginRow($index, $param)
    {
        $title = self::LogginTitles($index);
        $doc = self::LogginDoc($index);
        //
        return $title.$doc."\n\n\t$param\n";
    }

    protected static function logginCont($loggin)
    {
        $debug = self::logginRow('debug', "'debug'=>$loggin,");
        $error_debug_message = self::logginRow('error_debug_message', "'msg' => \"Ohlala! il semble que quelque chose s'ait mal passé\",");
        $error_log = self::logginRow('error_log', "'log' => 'app/storage/logs/vinala.log',");
        $background = self::logginRow('background', "'bg' => '#a4003a',");
        //
        return "<?php \n\nreturn array(\n\t".$debug.$error_debug_message.$error_log.$background."\n);";
    }

    /**
     * Maintenance.
     */
    protected static function MaintDoc($index)
    {
        $doc = [
            'activate'   => '',
            'Message'    => '',
            'background' => '',
            'out'        => '',
            ];
        //
        return $doc[$index]."\n\t*/";
    }

    protected static function MaintTitles($index)
    {
        $titles = [
            'activate'   => 'App Maintenance',
            'Message'    => 'Maintenance Message',
            'background' => 'Maintenance background',
            'out'        => 'Out Maintenance Routes',
            ];
        //
        $sep = "\n\t|----------------------------------------------------------";

        return "\n\n\t/*".$sep."\n\t| ".$titles[$index].$sep;
    }

    protected static function MaintRow($index, $param)
    {
        $title = self::MaintTitles($index);
        $doc = self::MaintDoc($index);
        //
        return $title.$doc."\n\n\t$param\n";
    }

    protected static function MaintCont($maintenance)
    {
        $activate = self::MaintRow('activate', "'activate' => $maintenance, ");
        $Message = self::MaintRow('Message', "'msg'=>\"Le site web est en cours de maintenance...\",");
        $background = self::MaintRow('background', "'bg' => '#d6003e',");
        $out = self::MaintRow('out', "'outRoutes' => array(\n\t\tConfig::get('panel.route'),\n\t),");
        //
        return "<?php \nuse Vinala\Kernel\Config\Config;\n\nreturn array(\n\t".$activate.$Message.$background.$out."\n);";
    }

    /**
     * Security.
     */
    protected static function securityDoc($index)
    {
        $doc = [
            'keys' => "\n\t|  These keys are for the security of your app, the first should be string\n\t|  contains 32 chars and the second should be string contains at least 10\n\t|  chars, in first configuration the framework change automatically these\n\t|  keys",
            ];
        //
        return $doc[$index]."\n\t*/";
    }

    protected static function securityTitles($index)
    {
        $titles = [
            'keys' => 'Encryption Keys',
            ];
        //
        $sep = "\n\t|----------------------------------------------------------";

        return "\n\n\t/*".$sep."\n\t| ".$titles[$index].$sep;
    }

    protected static function securityRow($index, $param)
    {
        $title = self::securityTitles($index);
        $doc = self::securityDoc($index);
        //
        return $title.$doc."\n\n\t$param\n";
    }

    protected static function securityCont($sec_1, $sec_2)
    {
        $keys = self::securityRow('keys', "'key1' => '$sec_1',\n\t'key2' => '$sec_2',");
        //
        return "<?php \n\nreturn array(\n\t".$keys."\n);";
    }

    /**
     * Panel.
     */
    protected static function panelDoc($index)
    {
        $doc = [
            'activation'    => "\n\t|  To define if you wanna give access to the \n\t|  panel or not , for your security if you \n\t|  complete building your app, please turn \n\t|  this off",
            'route'         => "\n\t|  Route for panel, for your security please change it",
            'path'          => "\n\t|  Here the path of the panel index, you can \n\t|  search in the internet to change the panel, \n\t|  for your security you should change the panel\n\t|  folder name",
            'passwords'     => "\n\t|  Here are the passwords to access to the panel",
            'configuration' => "\n\t|  The framework will set true if you passed \n\t|  the first configuration",
            'ajax'          => "\n\t|  This is links of ajax functions",
            ];
        //
        return $doc[$index]."\n\t*/";
    }

    protected static function panelTitles($index)
    {
        $titles = [
            'activation'    => 'Panel Activation',
            'route'         => 'Panel Route',
            'path'          => 'Panel Path',
            'passwords'     => 'Panel Passwords',
            'configuration' => 'First Configuration',
            'ajax'          => 'Ajax Routes',
            ];
        //
        $sep = "\n\t|----------------------------------------------------------";

        return "\n\n\t/*".$sep."\n\t| ".$titles[$index].$sep;
    }

    protected static function panelRow($index, $param)
    {
        $title = self::panelTitles($index);
        $doc = self::panelDoc($index);
        //
        return $title.$doc."\n\n\t$param\n";
    }

    protected static function panelCont($state, $route, $pass_1, $pass_2)
    {
        $activation = self::panelRow('activation', "'enable'=> $state,");
        $route = self::panelRow('route', "'route'=>'$route',");
        $path = self::panelRow('path', "'path'=>'vendor/vinala/panel/index.php',");
        $passwords = self::panelRow('passwords', "'password1'=>'$pass_1',\n\t'password2'=>'$pass_2',");
        $configuration = self::panelRow('configuration', "'configured' => true,");
        $ajax = self::panelRow('ajax', "'ajax' => array(\n\n\t\t// for new seeds\n\t\t\t'new_seed' => 'new_seed',\n\n\t\t// to exec migrations\n\t\t\t'exec_migration' => 'exec_migration',\n\n\t\t// to rollback migrations\n\t\t\t'rollback_migration' => 'rollback_migration', \n\n\t\t// for new migrations\n\t\t\t'new_migration' => 'new_migration',\n\n\t\t// for new controllers\n\t\t\t'new_controller' => 'new_controller',\n\n\t\t// for new language folder\n\t\t\t'new_dir_lang' => 'new_dir_lang',\n\n\t\t// for new language file\n\t\t\t'new_file_lang' => 'new_file_lang',\n\n\t\t// for new links file\n\t\t\t'new_link' => 'new_link',\n\n\t\t// for new models\n\t\t\t'new_model' => 'new_model',\n\n\t\t// for new views\n\t\t\t'new_view' => 'new_view',\n\n\t\t// to exec costume migrations\n\t\t\t'exec_cos_migration' => 'exec_cos_migration',\n\n\t\t// to rollback costume migrations\n\t\t\t'rollback_cos_migration' => 'rollback_cos_migration',\n\t),");
        //
        return "<?php \n\nreturn array(\n\t".$activation.$route.$path.$passwords.$configuration.$ajax."\n);";
    }

    /**
     * Database.
     */
    protected static function dbDoc($index)
    {
        $doc = [
            'default'     => "\n\t|  Default used database driver",
            'connections' => "\n\t|  All drivers that Vinala Work with",
            'table'       => "\n\t|  Database used to store migrations info",
            'prefixing'   => "\n\t|  If true, Vinala will add prefixe for all \n\t|  Database tables created by the framework",
            'prefixe'     => "\n\t|  This string will be add to all tables names\n\t|  created by Vinala if prefixing parameter was true",
            ];
        //
        return $doc[$index]."\n\t*/";
    }

    protected static function dbTitles($index)
    {
        $titles = [
            'default'     => 'Default Database Connection',
            'connections' => 'Database Connections',
            'table'       => 'Schemas Table',
            'prefixing'   => 'Prefixing',
            'prefixe'     => 'The prefixe',
            ];
        //
        $sep = "\n\t|----------------------------------------------------------";

        return "\n\n\t/*".$sep."\n\t| ".$titles[$index].$sep;
    }

    protected static function dbRow($index, $param)
    {
        $title = self::dbTitles($index);
        $doc = self::dbDoc($index);
        //
        return $title.$doc."\n\n\t$param\n";
    }

    protected static function dbConnections($host, $name, $usr, $pass)
    {
        return "'connections' => array(\n\n\t\t'sqlite' => array(\n\t\t\t'driver'   => 'sqlite',\n\t\t\t'database' => __DIR__.'/../database/production.sqlite',\n\t\t),\n\n\t\t'mysql' => array(\n\t\t\t'driver'    => 'mysql',\n\t\t\t'host'      => '".$host."',\n\t\t\t'database'  => '".$name."',\n\t\t\t'username'  => '".$usr."',\n\t\t\t'password'  => '".$pass."',\n\t\t\t'charset'   => 'utf8',\n\t\t\t'collation' => 'utf8_unicode_ci',\n\t\t),\n\n\t\t'pgsql' => array(\n\t\t\t'driver'   => 'pgsql',\n\t\t\t'host'     => 'localhost',\n\t\t\t'database' => 'forge',\n\t\t\t'username' => 'forge',\n\t\t\t'password' => '',\n\t\t\t'charset'  => 'utf8',\n\t\t\t'schema'   => 'public',\n\t\t),\n\n\t\t'sqlsrv' => array(\n\t\t\t'driver'   => 'sqlsrv',\n\t\t\t'host'     => 'localhost',\n\t\t\t'database' => 'database',\n\t\t\t'username' => 'root',\n\t\t\t'password' => '',\n\t\t),\n\t),";
    }

    protected static function dbCont($host, $name, $usr, $pass, $prefixing, $prefix)
    {
        $default = self::dbRow('default', "'default' => 'mysql', ");
        $connections = self::dbRow('connections', self::dbConnections($host, $name, $usr, $pass));
        $table = self::dbRow('table', "'migration' => 'vinala_migrations',");
        $prefixing = self::dbRow('prefixing', "'prefixing' => $prefixing ,");
        $prefixe = self::dbRow('prefixe', "'prefixe' => '".$prefix."_',");

        //
        return "<?php \n\nreturn array(\n\t".$default.$connections.$table.$prefixing.$prefixe."\n);";
    }

    public static function checkDb_step($host, $name, $usr, $pass, $prefix)
    {
        $host = input('db_host');
        $name = input('db_name');
        $usr = input('db_usr');
        $pass = input('db_pass');
        $prefix = input('db_prefix');
        //
        try {
            if (mysqli_connect($host, $usr, $pass, $name)) {
                echo 'true';
            }
        } catch (Exception $e) {
            echo 'false';
        }
    }

    public static function firstStep()
    {
        $name = input('dev_name');
        $langue = input('langue');

        if (isset($_POST['ckeck_loggin'])) {
            $loggin = 'true';
        } else {
            $loggin = 'false';
        }

        if (isset($_POST['ckeck_maintenance'])) {
            $maintenance = 'true';
        } else {
            $maintenance = 'false';
        }

        if (!Application::$isTest) {
            file_put_contents(Application::$root.'config/app.php', self::appCont($name), 0);
            file_put_contents(Application::$root.'config/lang.php', self::langCont($langue), 0);
            file_put_contents(Application::$root.'config/loggin.php', self::logginCont($loggin), 0);
            file_put_contents(Application::$root.'config/maintenance.php', self::MaintCont($maintenance), 0);
            //
            echo 'ok';
        }
    }

    public static function secondStep()
    {
        $host = empty($_POST['db_host']) ? 'localhost' : input('db_host');
        $name = empty($_POST['db_name']) ? 'test' : input('db_name');
        $usr = empty($_POST['db_usr']) ? 'root' : input('db_usr');
        $pass = empty($_POST['db_pass']) ? '' : input('db_pass');
        $prefix = input('db_prefix');

        if (empty($prefix)) {
            $prefixing = 'false';
            $prefix = 'ysf';
        } else {
            $prefixing = 'true';
        }
        //
        if (!Application::$isTest) {
            file_put_contents(Application::$root.'config/database.php', self::dbCont($host, $name, $usr, $pass, $prefixing, $prefix), 0);
            //
            echo 'ok';
        }
    }

    public static function thirdStep()
    {
        $sec_1 = input('sec_1');
        $sec_2 = input('sec_2');
        //
        if (!Application::$isTest) {
            file_put_contents(Application::$root.'config/security.php', self::securityCont($sec_1, $sec_2), 0);
            //
            echo 'ok';
        }
    }

    public static function fourthStep()
    {
        if (isset($_POST['stat'])) {
            $state = 'true';
        } else {
            $state = 'false';
        }
        //
        $route = empty($_POST['route']) ? 'vinala' : input('route');
        $pass_1 = empty($_POST['pass_1']) ? '1234' : input('pass_1');
        $pass_2 = empty($_POST['pass_2']) ? '5678' : input('pass_2');
        //
        if (!Application::$isTest) {
            file_put_contents(Application::$root.'config/panel.php', self::panelCont($state, $route, $pass_1, $pass_2), 0);
            //
            echo 'ok';
        }
    }
}


text:
@interface ACTableViewCellDescribable : UITableViewCell<ACDescribable>
@property (nonatomic, strong) UIView<ACDescribable> *describableView;
@end

@implementation ACTableViewCellDescribable

- (void)setDescribableView:(UIView<ACDescribable> *)describableView {
    if (self.describableView) {
        [self.describableView removeFromSuperview];
    }

    [self ac_checkClass:describableView.class isConformsToProtocol:@protocol(ACDescribable)];

    _describableView = describableView;

    if (self.describableView) {
        [self.contentView addSubview:self.describableView];
        [self.describableView ac_addConstraintsEqualSuperview];
    }
}

- (void)configureWithViewDescriber:(ACViewDescriber *)viewDescriber {
    if (!viewDescriber) {
        return;
    }

    if (!self.describableView) {
        ACDesignableView<ACDescribable> *view = [viewDescriber.viewClass new];
        [view setup];

        self.describableView = view;
    }

    [self.describableView configureWithViewDescriber:viewDescriber];
}

@end

@interface ACTableViewHeaderFooterViewDescribable : UITableViewHeaderFooterView<ACDescribable>
@property (nonatomic, strong) UIView<ACDescribable> *describableView;
@end

@implementation ACTableViewHeaderFooterViewDescribable

- (void)setDescribableView:(UIView<ACDescribable> *)describableView {
    if (self.describableView) {
        [self.describableView removeFromSuperview];
    }

    [self ac_checkClass:describableView.class isConformsToProtocol:@protocol(ACDescribable)];

    _describableView = describableView;

    if (self.describableView) {
        [self.contentView addSubview:self.describableView];
        [self.describableView ac_addConstraintsEqualSuperview];
    }
}

- (void)configureWithViewDescriber:(ACViewDescriber *)viewDescriber {
    if (!viewDescriber) {
        return;
    }

    if (!self.describableView) {
        ACDesignableView<ACDescribable> *view = [viewDescriber.viewClass new];
        [view setup];

        self.describableView = view;
    }

    [self.describableView configureWithViewDescriber:viewDescriber];
}

@end

@implementation ACTemplateExtendedTVC

- (void)setTableHeaderViewDesctiber:(ACViewDescriber *)tableHeaderViewDesctiber {
    _tableHeaderViewDesctiber = tableHeaderViewDesctiber;

    UIView<ACDescribable> *tableHeaderView = nil;
    if (tableHeaderViewDesctiber) {
        tableHeaderView = [tableHeaderViewDesctiber.viewClass ac_newInstanceFromNib];
    }

    self.tableView.tableHeaderView = tableHeaderView;

    if (tableHeaderView && [tableHeaderView conformsToProtocol:@protocol(ACDescribable)]) {
        [tableHeaderView configureWithViewDescriber:tableHeaderViewDesctiber];
    }
}

- (void)setTableFooterViewDesctiber:(ACViewDescriber *)tableFooterViewDesctiber {
    _tableFooterViewDesctiber = tableFooterViewDesctiber;

    UIView<ACDescribable> *tableFooterView = nil;
    if (tableFooterViewDesctiber) {
        tableFooterView = [tableFooterViewDesctiber.viewClass ac_newInstanceFromNib];
    }

    self.tableView.tableFooterView = tableFooterView;

    if (tableFooterView && [tableFooterView conformsToProtocol:@protocol(ACDescribable)]) {
        [tableFooterView configureWithViewDescriber:tableFooterViewDesctiber];
    }
}

#pragma mark - UITableViewDelegate, UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return self.sectionDescribers.count;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.sectionDescribers[section].numberOfCells;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return self.sectionDescribers[section].header.height;
}

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    return [self tableView:tableView viewForHeaderFooterWithDescriber:self.sectionDescribers[section].header];
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return self.sectionDescribers[section].footer.height;
}

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
    return [self tableView:tableView viewForHeaderFooterWithDescriber:self.sectionDescribers[section].footer];
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return [self.sectionDescribers[indexPath.section] cellDescriberForIndex:indexPath.row].height;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    ACViewDescriber *cellDescriber = [self.sectionDescribers[indexPath.section] cellDescriberForIndex:indexPath.row];

    [self ac_checkClass:cellDescriber.viewClass isConformsToProtocol:@protocol(ACReusable)];
    NSString *reusableIdentifier = [cellDescriber.viewClass reusableIdentifier];

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reusableIdentifier];
    if (!cell) {
        if ([cellDescriber.viewClass isSubclassOfClass:UITableViewCell.class]) {
            [tableView ac_registerCellClass:cellDescriber.viewClass];
        } else {
            [tableView registerClass:ACTableViewCellDescribable.class forCellReuseIdentifier:reusableIdentifier];
        }

        cell = [tableView dequeueReusableCellWithIdentifier:reusableIdentifier forIndexPath:indexPath];
    }

    [self ac_checkClass:cell.class isConformsToProtocol:@protocol(ACDescribable)];
    [(id<ACDescribable>)cell configureWithViewDescriber:cellDescriber];

    return cell;
}

#pragma mark - Private
- (UIView *)tableView:(UITableView *)tableView viewForHeaderFooterWithDescriber:(ACViewDescriber *)headerFooterDescriber {
    if (!headerFooterDescriber) {
        return nil;
    }

    [self ac_checkClass:headerFooterDescriber.viewClass isConformsToProtocol:@protocol(ACReusable)];
    NSString *reusableIdentifier = [headerFooterDescriber.viewClass reusableIdentifier];

    UITableViewHeaderFooterView *headerFooterView = [tableView dequeueReusableHeaderFooterViewWithIdentifier:reusableIdentifier];
    if (!headerFooterView) {
        if ([headerFooterDescriber.viewClass isSubclassOfClass:UITableViewHeaderFooterView.class]) {
            [tableView ac_registerHeaderFooterViewClass:headerFooterDescriber.viewClass];
        } else {
            [tableView registerClass:ACTableViewHeaderFooterViewDescribable.class forHeaderFooterViewReuseIdentifier:reusableIdentifier];
        }

        headerFooterView = [tableView dequeueReusableHeaderFooterViewWithIdentifier:reusableIdentifier];
    }

    [self ac_checkClass:headerFooterView.class isConformsToProtocol:@protocol(ACDescribable)];
    [(id<ACDescribable>)headerFooterView configureWithViewDescriber:headerFooterDescriber];

    return headerFooterView;
}

#pragma mark - Utils
- (void)checkIfReusableProtocolWasImplementedIn:(Class)class {
    NSAssert([class conformsToProtocol:@protocol(ACReusable)], @"'%@' doesn't conform to 'ACReusable'", NSStringFromClass(class));
}

@end


text:
module GD
  module Base

    protected

    def struct
      @struct
    end
  end
end


text:
package test.org.apache.spark.sql

import org.apache.spark.rdd.RDD
import org.apache.spark.sql.catalyst.InternalRow
import org.apache.spark.sql.catalyst.expressions.{Literal, GenericInternalRow, Attribute}
import org.apache.spark.sql.catalyst.plans.logical.{Project, LogicalPlan}
import org.apache.spark.sql.execution.SparkPlan
import org.apache.spark.sql.{Row, Strategy, QueryTest}
import org.apache.spark.sql.test.SharedSQLContext
import org.apache.spark.unsafe.types.UTF8String

case class FastOperator(output: Seq[Attribute]) extends SparkPlan {

  override protected def doExecute(): RDD[InternalRow] = {
    val str = Literal("so fast").value
    val row = new GenericInternalRow(Array[Any](str))
    sparkContext.parallelize(Seq(row))
  }

  override def children: Seq[SparkPlan] = Nil
}

object TestStrategy extends Strategy {
  def apply(plan: LogicalPlan): Seq[SparkPlan] = plan match {
    case Project(Seq(attr), _) if attr.name == "a" =>
      FastOperator(attr.toAttribute :: Nil) :: Nil
    case _ => Nil
  }
}

class ExtraStrategiesSuite extends QueryTest with SharedSQLContext {
  import testImplicits._

  test("insert an extraStrategy") {
    try {
      sqlContext.experimental.extraStrategies = TestStrategy :: Nil

      val df = sqlContext.sparkContext.parallelize(Seq(("so slow", 1))).toDF("a", "b")
      checkAnswer(
        df.select("a"),
        Row("so fast"))

      checkAnswer(
        df.select("a", "b"),
        Row("so slow", 1))
    } finally {
      sqlContext.experimental.extraStrategies = Nil
    }
  }
}


text:
package com.baosight.weex;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationSet;
import android.view.animation.ScaleAnimation;

import com.alibaba.weex.commons.util.AppConfig;
import com.baosight.bxproject.BXMainActivity;
import com.baosight.bxproject.R;

public class SplashActivity extends AppCompatActivity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash);

    View textView = findViewById(R.id.fullscreen_content);
    ScaleAnimation scaleAnimation = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);

    AnimationSet animationSet = new AnimationSet(false);
    animationSet.addAnimation(scaleAnimation);
    animationSet.setDuration(1000);

    animationSet.setAnimationListener(new Animation.AnimationListener() {
      @Override
      public void onAnimationStart(Animation animation) {
      }

      @Override
      public void onAnimationEnd(Animation animation) {
        startMainActivity();
        finish();
      }

      @Override
      public void onAnimationRepeat(Animation animation) {
      }
    });
    textView.startAnimation(animationSet);
  }

  private void startMainActivity() {
    String url = AppConfig.getLaunchUrl();
    if (!TextUtils.isEmpty(url)) {
      Intent intent = new Intent(this, BXMainActivity.class);
      String scheme = Uri.parse(url).getScheme();
      StringBuilder builder = new StringBuilder();
      if (TextUtils.equals("file", scheme)) {
        intent.putExtra("isLocal", true);
      } else if (!TextUtils.equals("http", scheme) && !TextUtils.equals("https", scheme)) {
        builder.append("http:");
      }
      builder.append(url);

      Uri uri = Uri.parse(builder.toString());
      intent.setData(uri);
      intent.setPackage(getPackageName());
      startActivity(intent);
    }
  }

}


text:
import * as Lint from "../lint";

describe("<object-literal-sort-keys>", () => {
    const SortedKeyRule = Lint.Test.getRule("object-literal-sort-keys");
    const fileName = "rules/objectliteralsortkeys.test.ts";
    const failureString = SortedKeyRule.FAILURE_STRING;

    it("forbids unsorted keys in object literals", () => {
        const actualFailures = Lint.Test.applyRuleOnFile(fileName, SortedKeyRule);
        const createFailure1 = Lint.Test.createFailuresOnFile(fileName, failureString + "a'");
        const createFailure2 = Lint.Test.createFailuresOnFile(fileName, failureString + "a'");
        const createFailure3 = Lint.Test.createFailuresOnFile(fileName, failureString + "aa'");
        const createFailure4 = Lint.Test.createFailuresOnFile(fileName, failureString + "b'");
        const createFailure5 = Lint.Test.createFailuresOnFile(fileName, failureString + "asdf'");
        const createFailure6 = Lint.Test.createFailuresOnFile(fileName, failureString + "asdfn'");
        const expectedFailures = [
            createFailure1([8, 5], [8, 6]),
            createFailure2([20, 5], [20, 6]),
            createFailure3([37, 9], [37, 11]),
            createFailure4([56, 5], [56, 6]),
            createFailure5([68, 5], [68, 9]),
            createFailure6([78, 5], [78, 10])
        ];

        Lint.Test.assertFailuresEqual(actualFailures, expectedFailures);
    });
});


text:
<?php

namespace Faker\Provider\kk_KZ;

class Company extends \Faker\Provider\Company
{
    protected static $companyNameFormats = array(
        '{{companyPrefix}} {{companyNameElement}}',
        '{{companyPrefix}} {{companyNameElement}}{{companyNameElement}}',
        '{{companyPrefix}} {{companyNameElement}}{{companyNameElement}}{{companyNameElement}}',
        '{{companyPrefix}} {{companyNameElement}}{{companyNameElement}}{{companyNameElement}}{{companyNameSuffix}}',
    );

    protected static $companyPrefixes = array(
        'АҚ', 'ЖШС', 'ЖАҚ'
    );

    protected static $companyNameSuffixes = array(
        'Құрылыс', 'Машина', 'Бұзу', '-М', 'Лизинг', 'Страх', 'Ком', 'Телеком'
    );

    protected static $companyElements = array(
        'Қазақ', 'Кітап', 'Цемент', 'Лифт', 'Креп', 'Авто', 'Теле', 'Транс', 'Алмаз', 'Метиз',
        'Мотор', 'Қаз', 'Тех', 'Сантех', 'Алматы', 'Астана', 'Электро',
    );

    /**
     * @example 'ЖШС АлматыТелеком'
     */
    public function company()
    {
        $format = static::randomElement(static::$companyNameFormats);

        return $this->generator->parse($format);
    }

    public static function companyPrefix()
    {
        return static::randomElement(static::$companyPrefixes);
    }

    public static function companyNameElement()
    {
        return static::randomElement(static::$companyElements);
    }

    public static function companyNameSuffix()
    {
        return static::randomElement(static::$companyNameSuffixes);
    }

    /**
     * National Business Identification Numbers
     *
     * @link   http://egov.kz/wps/portal/!utWCM/p/b1/04_Sj9Q1MjAwsDQ1s9CP0I_KSyzLTE8syczPS8wB8aPM4oO8PE2cnAwdDSxMw4wMHE08nZ2CA0KDXcwMgQoikRUYWIY4gxS4hwU4mRkbGBgTp98AB3A0IKQ_XD8KVQkWF4AV4LHCzyM_N1U_uKhUPzcqx83SU9cRANth_Rk!/dl4/d5/L0lHSkovd0RNQU5rQUVnQSEhLzRKVUUvZW4!/
     * @param  \DateTime $registrationDate
     * @return string 12 digits, like 150140000019
     */
    public static function businessIdentificationNumber(\DateTime $registrationDate = null)
    {
        if (!$registrationDate) {
            $registrationDate = \Faker\Provider\DateTime::dateTimeThisYear();
        }

        $dateAsString              = $registrationDate->format('ym');
        $legalEntityType           = (string) static::numberBetween(4, 6);
        $legalEntityAdditionalType = (string) static::numberBetween(0, 3);
        $randomDigits              = (string) static::numerify('######');

        return $dateAsString . $legalEntityType . $legalEntityAdditionalType . $randomDigits;
    }
}


text:
package golf

import (
	"bytes"
	"testing"
)

func TestConfig(t *testing.T) {
	cases := []struct {
		key   string
		value interface{}
	}{
		{"foo", "bar"},
		{"foo", 123},
		{"foo", true},
		{"foo", 56.23},
		{"foo/bar", "bar"},
		{"123/foo/bar", "bar"},
		{"foo/bar/bar/bar", "bar"},
	}

	defaultValue := "None"

	for _, c := range cases {
		config := NewConfig()
		config.Set(c.key, c.value)

		value, err := config.Get(c.key, defaultValue)
		if err != nil {
			t.Error(err)
		}
		if value != c.value {
			t.Errorf("Value not match: %q != %q, key: %q", value, c.value, c.key)
		}
	}
}

func TestConfigWithMultipleEntires(t *testing.T) {
	settings := []struct {
		key, value string
	}{
		{"foo/bar/bar", "bar"},
		{"foo/bar/bar2", "bar2"},
		{"foo/bar3", "bar3"},
		{"foo2", "bar4"},
	}

	config := NewConfig()

	for _, c := range settings {
		config.Set(c.key, c.value)
	}

	for _, c := range settings {
		value, err := config.Get(c.key, "None")
		if err != nil {
			t.Error(err)
		}
		if value != c.value {
			t.Errorf("Value not match: %q != %q, key: %q", value, c.value, c.key)
		}
	}
}

func TestFromJSON(t *testing.T) {
	reader := bytes.NewReader([]byte(`{"cool" : {"foo" : "bar"}}`))
	config, err := ConfigFromJSON(reader)
	if err != nil {
		t.Error(err)
		t.Fail()
	}
	value, err := config.GetString("cool/foo", "")
	if err != nil {
		t.Error(err)
		t.Fail()
	}
	if value != "bar" {
		t.Errorf("expected value to be abc but it was %v", value)
	}
}

func TestGetStringException(t *testing.T) {
	defaultValue := "None"

	config := NewConfig()
	config.Set("foo", 123)
	val, err := config.GetString("foo", defaultValue)
	if err == nil {
		t.Errorf("Should have raised an type error when getting a non-string value by GetString.")
	}
	if val != defaultValue {
		t.Errorf("Should have used the default value when raising an error.")
	}

	val, err = config.GetString("bar", defaultValue)
	if err == nil {
		t.Errorf("Should have raised an type error when getting a non-existed value by GetString.")
	}
	if val != defaultValue {
		t.Errorf("Should have used the default value when raising an error.")
	}
}

func TestGetIntegerException(t *testing.T) {
	defaultValue := 123

	config := NewConfig()
	config.Set("foo", "bar")
	val, err := config.GetInt("foo", defaultValue)
	if err == nil {
		t.Errorf("Should have raised an type error when getting a non-string value by GetString.")
	}
	if val != defaultValue {
		t.Errorf("Should have used the default value when raising an error.")
	}

	val, err = config.GetInt("bar", defaultValue)
	if err == nil {
		t.Errorf("Should have raised an type error when getting a non-existed value by GetString.")
	}
	if val != defaultValue {
		t.Errorf("Should have used the default value when raising an error.")
	}
}

func TestGetBoolException(t *testing.T) {
	defaultValue := false

	config := NewConfig()
	config.Set("foo", "bar")
	val, err := config.GetBool("foo", defaultValue)
	if err == nil {
		t.Errorf("Should have raised an type error when getting a non-string value by GetString.")
	}
	if val != defaultValue {
		t.Errorf("Should have used the default value when raising an error.")
	}

	val, err = config.GetBool("bar", defaultValue)
	if err == nil {
		t.Errorf("Should have raised an type error when getting a non-existed value by GetString.")
	}
	if val != defaultValue {
		t.Errorf("Should have used the default value when raising an error.")
	}
}

func TestGetFloat64Exception(t *testing.T) {
	defaultValue := 0.5

	config := NewConfig()
	config.Set("foo", "bar")
	val, err := config.GetFloat("foo", defaultValue)
	if err == nil {
		t.Errorf("Should have raised an type error when getting a non-string value by GetString.")
	}
	if val != defaultValue {
		t.Errorf("Should have used the default value when raising an error.")
	}

	val, err = config.GetFloat("bar", defaultValue)
	if err == nil {
		t.Errorf("Should have raised an type error when getting a non-existed value by GetString.")
	}
	if val != defaultValue {
		t.Errorf("Should have used the default value when raising an error.")
	}
}


text:
require "rspec/expectations"
require "chefspec"
require "chefspec/server"
require "chefspec/berkshelf"

RSpec.configure do |config|
  config.platform  = "ubuntu"
  config.version   = "14.04"
  config.log_level = :error

  config.before do
    data_bag_path = "../../test/support/data_bags"
    Chef::Config[:data_bag_path] = File.expand_path(data_bag_path, __FILE__)
  end
end

at_exit { ChefSpec::Coverage.report! }


text:
package de.kuei.metafora.gwt.smack.client;

public class Student {
	String name;
	boolean online;
	//String project;
	int group;

	Student(String n, boolean o, int g){
		name = n;
		online = o;
		group = g;
	}

	public boolean isOnline(){
		if(online) return true;
		else return false;
	}
}