text:
1. Get an idea of the editor hierarchy
2. Best way to hook up events en masse
3. Touch scrolling
4. How to re-indent a document
5. Have editor.find return a value
6. Ranges are never fixed for screen vs editor line numbers
7. Editor.navigateLineStart has inconsistent behaviour
    1. When the carat is before any non-whitespace character, the function moves to the 0th column in the line
    2. Otherwise the function moves the carat to before the first non-whitespace character
8. Folded lines are a one-shot. Can we have folds that can be refolded by double clicking?


text:
typedef void vd;
using namespace std;

struct container { //base struct with two parameters
    int pkg; //integer declaration
    container* nextContainer; //pointer declaration to the nextContainer address position
};

// only for the first container
vd initFirstContainer(struct container *top,int n){ //here initialize the first container
    top->pkg = n; //point gets the member called pkg from the struct that top point to
    top->nextContainer = nullptr;//point gets the member called nextContainer from the struct that top point to
}

// appending
vd addcontainer(struct container *top, int n) { // this function take a pointer and an integer n
    auto *newcontainer = new container; //create a new container
    newcontainer->pkg = n;  //point gets the member called pkg from the struct that newcontainer point to
    newcontainer->nextContainer = nullptr; //point gets the member called nextContainer from the struct that top point to

    container *ptr = top;     //initialize a struct pointer to top variable
    while(ptr != nullptr) {  //while there is other top to point at in O(n)
        if(ptr->nextContainer == nullptr) { //if point gets the member called nextContainer from the struct that ptr point to in O(1)
            ptr->nextContainer = newcontainer; //point gets the member called nextContainer from the struct that ptr point to
            return;
        }
        ptr = ptr->nextContainer; //ptr assigned to the point that gets the member called nextContainer from the struct that top point to
    }
}

struct container *srccontainer(struct container *top, int n) { //search for a container take two parameters  pointer and value
    container *ptr = top; //initialize ptr pointer to top
    while(ptr != nullptr) {   // O(n)
        if(ptr->pkg == n) return ptr; //if point gets the member called nextContainer from the struct that ptr point to in O(1)
        ptr = ptr->nextContainer; //ptr assigned to the point that gets the member called nextContainer from the struct that top point to
    }

}

bool delcontainer(struct container **top, container *ptrDel) { //in O(1) pointer-to-pointer
    container *ptr = *top; //point gets the member called nextContainer from the struct that ptr point to
    if(ptrDel == *top) {
        *top = ptr->nextContainer;
        delete ptrDel; //delete ptrDel
        return true;
    }

    while(ptr != nullptr) {// in O(n)
        if(ptr->nextContainer == ptrDel) {
            ptr->nextContainer = ptrDel->nextContainer;
            delete ptrDel;
            return true;
        }
        ptr = ptr->nextContainer;
    }
    return false;
}

vd delLinkedList(struct container **container) //pointer-to-pointer
{
    struct container *tmpcontainer; //create a pointer tmpcontainer
    while(*container != nullptr) { //and while the pointer is not point to nullptr
        tmpcontainer = *container; //copy the container into a temporary container
        *container = tmpcontainer->nextContainer; //the container pointer assigned the value to the instance pointer of tmpcontainer inside struct to the next container
        delete tmpcontainer; //deallocate memory from the free-store
    }
}

vd show(struct container *top) {
    container *list = top;
    while(list != nullptr) {
        cout << list->pkg << " ";
        list = list->nextContainer;
    }
}

int main()
{
    struct container *newtop;
    auto *top = new container;
    initFirstContainer(top,5);

}

redpajama_set_name: RedPajamaGithub


text:
* Username - root
* Password - root
* Database Name - bwitter


text:
describe('Binding: Options', {
    before_each: JSSpec.prepareTestNode,

    // Todo: when the options list is populated, this should trigger a change event so that observers are notified of the new value (i.e., the default selection)

    'Should only be applicable to SELECT nodes': function () {
        var threw = false;
        testNode.innerHTML = "<input data-bind='options:{}' />";
        try { ko.applyBindings({}, testNode); }
        catch (ex) { threw = true; }
        value_of(threw).should_be(true);
    },

    'Should set the SELECT node\'s options set to match the model value': function () {
        var observable = new ko.observableArray(["A", "B", "C"]);
        testNode.innerHTML = "<select data-bind='options:myValues'><option>should be deleted</option></select>";
        ko.applyBindings({ myValues: observable }, testNode);
        var displayedOptions = ko.utils.arrayMap(testNode.childNodes[0].childNodes, function (node) { return node.innerHTML; });
        value_of(displayedOptions).should_be(["A", "B", "C"]);
    },

    'Should accept optionsText and optionsValue params to display subproperties of the model values': function() {
        var modelValues = new ko.observableArray([
            { name: 'bob', id: ko.observable(6) }, // Note that subproperties can be observable
            { name: ko.observable('frank'), id: 13 }
        ]);
        testNode.innerHTML = "<select data-bind='options:myValues, optionsText: \"name\", optionsValue: \"id\"'><option>should be deleted</option></select>";
        ko.applyBindings({ myValues: modelValues }, testNode);
        var displayedText = ko.utils.arrayMap(testNode.childNodes[0].childNodes, function (node) { return node.innerHTML; });
        var displayedValues = ko.utils.arrayMap(testNode.childNodes[0].childNodes, function (node) { return node.value; });
        value_of(displayedText).should_be(["bob", "frank"]);
        value_of(displayedValues).should_be(["6", "13"]);
    },

    'Should accept function in optionsText param to display subproperties of the model values': function() {
        var modelValues = new ko.observableArray([
            { name: 'bob', job: 'manager' },
            { name: 'frank', job: 'coder & tester' }
        ]);
        testNode.innerHTML = "<select data-bind='options:myValues, optionsText: function (v) { return v[\"name\"] + \" (\" + v[\"job\"] + \")\"; }'><option>should be deleted</option></select>";
        ko.applyBindings({ myValues: modelValues }, testNode);
        var displayedText = ko.utils.arrayMap(testNode.childNodes[0].childNodes, function (node) { return node.innerText || node.textContent; });
        value_of(displayedText).should_be(["bob (manager)", "frank (coder & tester)"]);
    },

    'Should accept a function in optionsValue param to select subproperties of the model values (and use that for the option text)': function() {
        var modelValues = new ko.observableArray([
            { name: 'bob', job: 'manager' },
            { name: 'frank', job: 'coder & tester' }
        ]);
        testNode.innerHTML = "<select data-bind='options: myValues, optionsValue: function (v) { return v.name + \" (\" + v.job + \")\"; }'><option>should be deleted</option></select>";
        ko.applyBindings({ myValues: modelValues }, testNode);
        var values = ko.utils.arrayMap(testNode.childNodes[0].childNodes, function (node) { return node.value; });
        value_of(values).should_be(["bob (manager)", "frank (coder & tester)"]);
        var displayedText = ko.utils.arrayMap(testNode.childNodes[0].childNodes, function (node) { return node.innerText || node.textContent; });
        value_of(displayedText).should_be(["bob (manager)", "frank (coder & tester)"]);
    },

    'Should exclude any items marked as destroyed': function() {
        var modelValues = new ko.observableArray([
            { name: 'bob', _destroy: true },
            { name: 'frank' }
        ]);
        testNode.innerHTML = "<select data-bind='options: myValues, optionsValue: \"name\"'></select>";
        ko.applyBindings({ myValues: modelValues }, testNode);
        var values = ko.utils.arrayMap(testNode.childNodes[0].childNodes, function (node) { return node.value; });
        value_of(values).should_be(["frank"]);
    },

    'Should include items marked as destroyed if optionsIncludeDestroyed is set': function() {
        var modelValues = new ko.observableArray([
            { name: 'bob', _destroy: true },
            { name: 'frank' }
        ]);
        testNode.innerHTML = "<select data-bind='options: myValues, optionsValue: \"name\", optionsIncludeDestroyed: true'></select>";
        ko.applyBindings({ myValues: modelValues }, testNode);
        var values = ko.utils.arrayMap(testNode.childNodes[0].childNodes, function (node) { return node.value; });
        value_of(values).should_be(["bob", "frank"]);
    },

    'Should update the SELECT node\'s options if the model changes': function () {
        var observable = new ko.observableArray(["A", "B", "C"]);
        testNode.innerHTML = "<select data-bind='options:myValues'><option>should be deleted</option></select>";
        ko.applyBindings({ myValues: observable }, testNode);
        observable.splice(1, 1);
        var displayedOptions = ko.utils.arrayMap(testNode.childNodes[0].childNodes, function (node) { return node.innerHTML; });
        value_of(displayedOptions).should_be(["A", "C"]);
    },

    'Should retain as much selection as possible when changing the SELECT node\'s options': function () {
        var observable = new ko.observableArray(["A", "B", "C"]);
        testNode.innerHTML = "<select data-bind='options:myValues' multiple='multiple'><option>A</option><option selected='selected'>B</option><option selected='selected'>X</option></select>";
        ko.applyBindings({ myValues: observable }, testNode);
        value_of(testNode.childNodes[0]).should_have_selected_values(["B"]);
    },

    'Should place a caption at the top of the options list and display it when the model value is undefined': function() {
        testNode.innerHTML = "<select data-bind='options:[\"A\", \"B\"], optionsCaption: \"Select one...\"'></select>";
        ko.applyBindings({}, testNode);
        var displayedOptions = ko.utils.arrayMap(testNode.childNodes[0].childNodes, function (node) { return node.innerHTML; });
        value_of(displayedOptions).should_be(["Select one...", "A", "B"]);
    },

    'Should allow the caption to be given by an observable, and update it when the model value changes (without affecting selection)': function() {
        var myCaption = ko.observable("Initial caption"),
            mySelectedValue = ko.observable("B");
        testNode.innerHTML = "<select data-bind='options:[\"A\", \"B\"], optionsCaption: myCaption, value: mySelectedValue'></select>";
        ko.applyBindings({ myCaption: myCaption, mySelectedValue: mySelectedValue }, testNode);

        var displayedOptions = ko.utils.arrayMap(testNode.childNodes[0].childNodes, function (node) { return node.innerHTML; });
        value_of(testNode.childNodes[0].selectedIndex).should_be(2);
        value_of(mySelectedValue()).should_be("B");
        value_of(displayedOptions).should_be(["Initial caption", "A", "B"]);

        // Also show we can update the caption without affecting selection
        myCaption("New caption");
        var displayedOptions2 = ko.utils.arrayMap(testNode.childNodes[0].childNodes, function (node) { return node.innerHTML; });
        value_of(testNode.childNodes[0].selectedIndex).should_be(2);
        value_of(mySelectedValue()).should_be("B");
        value_of(displayedOptions2).should_be(["New caption", "A", "B"]);
    }
});


text:
@interface OrderDetailViewController : UIViewController<UITableViewDataSource, UITableViewDelegate>

@property(nonatomic, strong)NSArray* tableData;
@property(nonatomic,strong)NSString* orderId;

@end


text:
package org.elasticsearch.action.admin.indices.refresh;

import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import org.junit.Test;

import java.util.Arrays;

import static org.elasticsearch.cluster.metadata.IndexMetaData.*;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertBlocked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.equalTo;

@ClusterScope(scope = ESIntegTestCase.Scope.TEST)
public class RefreshBlocksIT extends ESIntegTestCase {

    @Test
    public void testRefreshWithBlocks() {
        createIndex("test");
        ensureGreen("test");

        NumShards numShards = getNumShards("test");

        // Request is not blocked
        for (String blockSetting : Arrays.asList(SETTING_BLOCKS_READ, SETTING_BLOCKS_WRITE)) {
            try {
                enableIndexBlock("test", blockSetting);
                RefreshResponse response = client().admin().indices().prepareRefresh("test").execute().actionGet();
                assertNoFailures(response);
                assertThat(response.getSuccessfulShards(), equalTo(numShards.totalNumShards));
            } finally {
                disableIndexBlock("test", blockSetting);
            }
        }

        // Request is blocked
        for (String blockSetting : Arrays.asList(SETTING_READ_ONLY, SETTING_BLOCKS_METADATA)) {
            try {
                enableIndexBlock("test", blockSetting);
                assertBlocked(client().admin().indices().prepareRefresh("test"));
            } finally {
                disableIndexBlock("test", blockSetting);
            }
        }

        // Refreshing all indices is blocked when the cluster is read-only
        try {
            RefreshResponse response = client().admin().indices().prepareRefresh().execute().actionGet();
            assertNoFailures(response);
            assertThat(response.getSuccessfulShards(), equalTo(numShards.totalNumShards));

            setClusterReadOnly(true);
            assertBlocked(client().admin().indices().prepareRefresh());
        } finally {
            setClusterReadOnly(false);
        }
    }
}


text:
module Metasploit::Model::Search::Operation::Value::String
  #
  # Methods
  #

  # Sets {Metasploit::Model::Search::Operation::Base#value} by type casting to a String.
  #
  # @param formatted_value [#to_s]
  # @return [String]
  def value=(formatted_value)
    @value = formatted_value.to_s
  end
end


text:
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StaticPointers #-}
{-# LANGUAGE TypeApplications #-}

-- | A short program that illustrates the dangers of manual memory management
-- inherent to using inline-java (and by extension, sparkle). In this program,
-- we deallocate a reference to an RDD, allocate a new reference, then try to
-- reference the old one. This will lead to some sort of error (explained more
-- in readme).

module Main where

import Control.Distributed.Closure
import Control.Distributed.Spark as RDD
import Foreign.JNI
import Foreign.JNI.Types
import Data.Text (Text)

main :: IO ()
main = forwardUnhandledExceptionsToSpark $ do
    conf <- newSparkConf "Use after free"
    sc   <- getOrCreateSparkContext conf
    rdd   <- parallelize sc ["yes", "no", "maybe"]
    rdd'  <- RDD.map (closure $ static (id @Text)) rdd
    -- deallocate reference
    deleteLocalRef rdd'
    -- allocate new reference
    rdd'' <- RDD.map (closure $ static id) rdd
    -- try to do something to rdd referenced by deallocated reference
    n     <- RDD.count rdd'
    m     <- RDD.count rdd''
    putStrLn $ "new ref length: " ++ show m
    putStrLn $ "old ref length: " ++ show n


text:
#ifndef __INTERRUPTS__
#define __INTERRUPTS__
#ifndef __DRIVERSERVICES__
#include <DriverServices.h>
#endif
/*
    The contents of Interrupts.h has been merged into DriverServices.h
*/
#endif /* __INTERRUPTS__ */


text:
package com.glaf.oa.ltravel.service;

import java.util.*;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.ibatis.session.RowBounds;
import org.mybatis.spring.SqlSessionTemplate;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.glaf.core.id.*;
import com.glaf.core.dao.*;
import com.glaf.oa.ltravel.mapper.*;
import com.glaf.oa.ltravel.model.*;
import com.glaf.oa.ltravel.query.*;

@Service("ltravelService")
@Transactional(readOnly = true)
public class LtravelServiceImpl implements LtravelService {
	protected final Logger logger = LoggerFactory.getLogger(getClass());

	protected EntityDAO entityDAO;

	protected IdGenerator idGenerator;

	protected SqlSessionTemplate sqlSessionTemplate;

	protected LtravelMapper ltravelMapper;

	public LtravelServiceImpl() {

	}

	@Transactional
	public void deleteById(Long travelid) {
		if (travelid != 0L) {
			ltravelMapper.deleteLtravelById(travelid);
		}
	}

	@Transactional
	public void deleteByIds(List<Long> travelids) {
		if (travelids != null && !travelids.isEmpty()) {
			for (Long travelid : travelids) {
				ltravelMapper.deleteLtravelById(travelid);
			}
		}
	}

	public int count(LtravelQuery query) {
		query.ensureInitialized();
		return ltravelMapper.getLtravelCount(query);
	}

	public List<Ltravel> list(LtravelQuery query) {
		query.ensureInitialized();
		List<Ltravel> list = ltravelMapper.getLtravels(query);
		return list;
	}

	public int getLtravelCountByQueryCriteria(LtravelQuery query) {
		return ltravelMapper.getLtravelCount(query);
	}

	public List<Ltravel> getLtravelsByQueryCriteria(int start, int pageSize,
			LtravelQuery query) {
		RowBounds rowBounds = new RowBounds(start, pageSize);
		List<Ltravel> rows = sqlSessionTemplate.selectList("getLtravels",
				query, rowBounds);
		return rows;
	}

	public Ltravel getLtravel(Long travelid) {
		if (travelid == 0L) {
			return null;
		}
		Ltravel ltravel = ltravelMapper.getLtravelById(travelid);
		return ltravel;
	}

	@Transactional
	public void save(Ltravel ltravel) {
		if (ltravel.getTravelid() == 0L) {
			ltravel.setTravelid(idGenerator.nextId("oa_ltravel"));
			// ltravel.setCreateDate(new Date());
			// ltravel.setDeleteFlag(0);
			ltravelMapper.insertLtravel(ltravel);
		} else {
			ltravelMapper.updateLtravel(ltravel);
		}
	}

	@javax.annotation.Resource
	public void setEntityDAO(EntityDAO entityDAO) {
		this.entityDAO = entityDAO;
	}

	@javax.annotation.Resource
	public void setIdGenerator(IdGenerator idGenerator) {
		this.idGenerator = idGenerator;
	}

	@javax.annotation.Resource
	public void setLtravelMapper(LtravelMapper ltravelMapper) {
		this.ltravelMapper = ltravelMapper;
	}

	@javax.annotation.Resource
	public void setSqlSessionTemplate(SqlSessionTemplate sqlSessionTemplate) {
		this.sqlSessionTemplate = sqlSessionTemplate;
	}

	public int getReviewLtravelCountByQueryCriteria(LtravelQuery query) {
		return ltravelMapper.getReviewLtravelCount(query);
	}

	public List<Ltravel> getReviewLtravelsByQueryCriteria(int start,
			int pageSize, LtravelQuery query) {
		RowBounds rowBounds = new RowBounds(start, pageSize);
		List<Ltravel> rows = sqlSessionTemplate.selectList("getReviewLtravels",
				query, rowBounds);
		return rows;
	}

}


text: Basic Memory Handler


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<title>ApePubSub Index</title>

	<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">

	<link type="text/css" rel="stylesheet" href="styles/site.spacelab.css">

			ApePubSub

					Namespaces

							Ape

					Modules

							Client

							Server

					Classes

							APS

							Channel

							CUser

							Session

							User

							channel

							GetRequest

							pipe

							PostRequest

							Request

							subuser

							user

	Index

What is it?

ApePubSub is an alternative event driven pub/sub framework to the official APE_JSF for the APE Server. It is written in plain javascript.

The client framework is based on @paraboul's next generation APE_JSF draft and the server framework is a compilation of custom commads, hooks and rewrites from the official framework, the actual server binary do not requires modification.

Getting Started

Read more about the project

Get Started

See what is new in the Changelog

Checkout the live demos, the demo sources can be found here

Code documentation

Public Documentation - wiki

Simple program example:

// Initialize the client object
var client = new APS('ape.ptejada.com');

// Subscribe to the channel and add some event listeners
client.sub('test', {
  // Event triggered when a user joins channel
  join: function(){
    alert('A user has joined the channel :)');
  },
  // Event triggered when a user leaves a channel
  left: function(){
    alert('A user has left the channel :(')
  }
});

Is that simple and pretty much self explanatory what the above will do.

For more information check the wiki

NOTE: when updating the framework make sure that you update the server scripts as well, you can tell if the server scripts need updating if the the folder APE_Server has been changed in the commit or recently.

Browser Support

The framework is tested and developed in the following modern browers:

Internet Explorer 9+

Google Chrome

Mozilla Firefox

It should also work in other webkit and mobile browsers such as Opera, Safari, Safari Mobile and the stock Android Browser.
Internet Explorer 8 and below is not supported.

Feedback?

For reporting issues use the github issues system, is really good and organized :)

For discussions, join the Google Group

					Version 1.6.4

		Pablo Tejada Copyright © 2012-2014.

		Documentation generated by JSDoc 3.2.2
		on Tue Feb 25 2014 20:19:28 GMT-0500 (EST) using the DocStrap template.


text:
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F4xx_HAL_HASH_EX_H
#define __STM32F4xx_HAL_HASH_EX_H

#ifdef __cplusplus
 extern "C" {
#endif

#if defined(STM32F437xx) || defined(STM32F439xx) || defined(STM32F479xx)
/* Includes ------------------------------------------------------------------*/
#include "stm32f4xx_hal_def.h"

/** @addtogroup STM32F4xx_HAL_Driver
  * @{
  */

/** @addtogroup HASHEx
  * @brief HASHEx HAL Extension module driver
  *  @{
  */

/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/

/** @defgroup HASHEx_Exported_Functions HASHEx Exported Functions
  * @{
  */

/** @defgroup HASHEx_Exported_Functions_Group1 HASHEx processing using polling functions
  * @{
  */

HAL_StatusTypeDef HAL_HASHEx_SHA224_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout);
HAL_StatusTypeDef HAL_HASHEx_SHA256_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout);
HAL_StatusTypeDef HAL_HASHEx_SHA224_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
HAL_StatusTypeDef HAL_HASHEx_SHA256_Accumulate(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);

/**
  * @}
  */

/** @defgroup HASHEx_Exported_Functions_Group2 HMAC processing using polling functions
  * @{
  */

HAL_StatusTypeDef HAL_HMACEx_SHA224_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout);
HAL_StatusTypeDef HAL_HMACEx_SHA256_Start(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer, uint32_t Timeout);

/**
  * @}
  */

/** @defgroup HASHEx_Exported_Functions_Group3 HASHEx processing using  functions
  * @{
  */

HAL_StatusTypeDef HAL_HASHEx_SHA224_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer);
HAL_StatusTypeDef HAL_HASHEx_SHA256_Start_IT(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size, uint8_t* pOutBuffer);

/**
  * @}
  */

/** @defgroup HASHEx_Exported_Functions_Group4 HASHEx processing using DMA
  * @{
  */

HAL_StatusTypeDef HAL_HASHEx_SHA224_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
HAL_StatusTypeDef HAL_HASHEx_SHA224_Finish(HASH_HandleTypeDef *hhash, uint8_t* pOutBuffer, uint32_t Timeout);
HAL_StatusTypeDef HAL_HASHEx_SHA256_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
HAL_StatusTypeDef HAL_HASHEx_SHA256_Finish(HASH_HandleTypeDef *hhash, uint8_t* pOutBuffer, uint32_t Timeout);

/**
  * @}
  */

/** @defgroup HASHEx_Exported_Functions_Group5 HMAC processing using DMA
  * @{
  */

HAL_StatusTypeDef HAL_HMACEx_SHA224_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
HAL_StatusTypeDef HAL_HMACEx_SHA256_Start_DMA(HASH_HandleTypeDef *hhash, uint8_t *pInBuffer, uint32_t Size);
/**
  * @}
  */

/** @defgroup HASHEx_Exported_Functions_Group6 HASHEx processing functions
  * @{
  */

void HAL_HASHEx_IRQHandler(HASH_HandleTypeDef *hhash);

/**
  * @}
  */

/**
  * @}
  */

 /* Private types -------------------------------------------------------------*/
/** @defgroup HASHEx_Private_Types HASHEx Private Types
  * @{
  */

/**
  * @}
  */

/* Private variables ---------------------------------------------------------*/
/** @defgroup HASHEx_Private_Variables HASHEx Private Variables
  * @{
  */

/**
  * @}
  */

/* Private constants ---------------------------------------------------------*/
/** @defgroup HASHEx_Private_Constants HASHEx Private Constants
  * @{
  */

/**
  * @}
  */

/* Private macros ------------------------------------------------------------*/
/** @defgroup HASHEx_Private_Macros HASHEx Private Macros
  * @{
  */

/**
  * @}
  */

/* Private functions ---------------------------------------------------------*/
/** @defgroup HASHEx_Private_Functions HASHEx Private Functions
  * @{
  */

/**
  * @}
  */

#endif /* STM32F437xx || STM32F439xx || STM32F479xx */
/**
  * @}
  */

/**
  * @}
  */

#ifdef __cplusplus
}
#endif

#endif /* __STM32F4xx_HAL_HASH_EX_H */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


text:
FROM ubuntu:18.04

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update -yqq && apt-get install -yqq software-properties-common > /dev/null
RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
RUN apt-get update -yqq > /dev/null && \
    apt-get install -yqq nginx git unzip php7.2 php7.2-common php7.2-cli php7.2-fpm php7.2-mysql php7.2-mongodb  > /dev/null

RUN apt-get install -yqq composer > /dev/null

COPY deploy/conf/* /etc/php/7.2/fpm/

ADD ./ /phalcon
WORKDIR /phalcon

RUN apt-get install -yqq php7.2-phalcon  > /dev/null

RUN if [ $(nproc) = 2 ]; then sed -i "s|pm.max_children = 1024|pm.max_children = 512|g" /etc/php/7.2/fpm/php-fpm.conf ; fi;

RUN composer install --optimize-autoloader --classmap-authoritative --no-dev --quiet

RUN chmod -R 777 app

CMD service php7.2-fpm start && \
    nginx -c /phalcon/deploy/nginx.conf -g "daemon off;"


text:
angular.module('ui.summary', ['ui.chart'])

.controller('SummaryController', function($scope) {
    function convert(data) {
        return {
            maintainability: [
                {
                    bar: true,
                    key: 'Total Maintainability',
                    values: data.map(function(item) {
                        return {
                            key: item.date,
                            value: item.summary.total.maintainability
                        };
                    })
                },
                {
                    key: 'Average Maintainability',
                    values: data.map(function(item) {
                        return {
                            key: item.date,
                            value: item.summary.average.maintainability
                        };
                    })
                }
            ],
            sloc: [
                {
                    bar: true,
                    key: 'Total SLOC',
                    values: data.map(function(item) {
                        return {
                            key: item.date,
                            value: item.summary.total.sloc
                        };
                    })
                },
                {
                    key: 'Average SLOC',
                    values: data.map(function(item) {
                        return {
                            key: item.date,
                            value: item.summary.average.sloc
                        };
                    })
                }
            ]
        };
    }
    //console.log($scope.data);
    // $scope.chartData = convert($scope.data);

    $scope.$watch('data', function(newValue, oldValue) {
        console.log($scope.data)
        $scope.chartData = convert(newValue);
    }, true);
    //var handler;

    // angular.element($window).bind('resize', function(argument) {
    //     $scope.options.chart.width = $element[0].clientWidth;
    //     //console.log(r);
    //     $timeout.cancel(handler);
    //     handler = $timeout($scope.api.refresh, 0, false);
    // });
})
.directive('summary', function () {
    return {
        restrict: 'E',
        replace: true,
        controller: 'SummaryController',
        templateUrl: 'src/ui/summary/summary.html',
        scope: {
            data: '=data'
        },
        link: function ($scope, $element, $attrs) {

        }
    };
});


text:
package org.apache.polygene.manual.travel;

import org.apache.polygene.api.property.Property;
import org.apache.polygene.library.constraints.annotation.Matches;
import org.apache.polygene.library.constraints.annotation.Range;

// START SNIPPET: configuration
public interface TravelPlanConfiguration
{
    Property<String> hostName();

    @Range( min=0, max=65535 )
    Property<Integer> portNumber();

    @Matches( "(ssh|rlogin|telnet)" )
    Property<String> protocol();
}
// END SNIPPET: configuration


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>7</version>
  </parent>
  <artifactId>fcrepo-filesystem-modeshape-federation-connector</artifactId>
  <name>fcrepo-filesystem-modeshape-federation-connector</name>
  <description>Connects ModeShape to a filesystem directory, and monitors it for changes.</description>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <fcrepo-build-tools.version>1.3</fcrepo-build-tools.version>
    <modeshape.version>3.7-SNAPSHOT</modeshape.version>
    <maven.surefire.report.plugin.version>2.4.3</maven.surefire.report.plugin.version>
    <maven.surefire.plugin.version>2.7.1</maven.surefire.plugin.version>
    <maven.assembly.plugin.version>2.2</maven.assembly.plugin.version>
    <maven.install.plugin.version>2.3.1</maven.install.plugin.version>
    <maven.jar.plugin.version>2.3.1</maven.jar.plugin.version>
    <maven.compiler.plugin.version>2.3.2</maven.compiler.plugin.version>
    <maven.source.plugin.version>2.1.2</maven.source.plugin.version>
    <maven.resources.plugin.version>2.4.3</maven.resources.plugin.version>
    <!-- plugin versions -->
    <!-- Until MCHECKSTYLE-169 is resolved, we're using our own, patched version
      of checkstyle deployed to fcrepo.maven.org -->
    <checkstyle.plugin.version>2.10-fcrepo</checkstyle.plugin.version>
  </properties>
  <dependencyManagement>
    <dependencies>
      <!-- Import the ModeShape BOM for embedded usage. This adds to the "dependenciesManagement" section
                 defaults for all of the modules we might need, but we still have to include in the
                 "dependencies" section the modules we DO need. The benefit is that we don't have to
                 specify the versions of any of those modules.-->
      <dependency>
        <groupId>org.modeshape.bom</groupId>
        <artifactId>modeshape-bom-embedded</artifactId>
        <version>${modeshape.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.modeshape</groupId>
      <artifactId>modeshape-jcr-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.modeshape</groupId>
      <artifactId>modeshape-jcr</artifactId>
    </dependency>
    <dependency>
      <groupId>org.modeshape</groupId>
      <artifactId>modeshape-common</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.4</version>
    </dependency>
  </dependencies>
  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>src/main/java</directory>
        <includes>
          <include>**</include>
        </includes>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </resource>
    </resources>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <configuration>
            <includes>
              <include>**/*Test.java</include>
            </includes>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>${checkstyle.plugin.version}</version>
          <dependencies>
            <dependency>
              <groupId>org.fcrepo</groupId>
              <artifactId>fcrepo-build-tools</artifactId>
              <version>${fcrepo-build-tools.version}</version>
            </dependency>
          </dependencies>
          <configuration>
            <consoleOutput>true</consoleOutput>
            <configLocation>fcrepo-checkstyle/checkstyle.xml</configLocation>
            <suppressionsLocation>fcrepo-checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
          </configuration>
          <executions>
            <execution>
              <id>checkstyle</id>
              <phase>verify</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>com.mycila.maven-license-plugin</groupId>
          <artifactId>maven-license-plugin</artifactId>
          <version>1.10.b1</version>
          <configuration>
            <header>fcrepo-license/LICENSE_HEADER.txt</header>
            <includes>
              <include>**/src/main/java/**</include>
              <include>**/src/test/java/**</include>
            </includes>
            <excludes>
              <exclude>target/**</exclude>
              <exclude>**/src/test/resources/**</exclude>
              <exclude>**/src/main/resources/**</exclude>
              <exclude>**/*.properties</exclude>
            </excludes>
            <properties>
              <name>${project.artifactId}</name>
              <year>${project.inceptionYear}</year>
              <holder>${project.organization.name}</holder>
            </properties>
            <encoding>UTF-8</encoding>
            <strictCheck>true</strictCheck>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>org.fcrepo</groupId>
              <artifactId>fcrepo-build-tools</artifactId>
              <version>${fcrepo-build-tools.version}</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <!-- Specify the compiler options and settings -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven.compiler.plugin.version}</version>
        <configuration>
          <source>1.7</source>
          <target>1.7</target>
          <showDeprecation>false</showDeprecation>
          <showWarnings>false</showWarnings>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven.surefire.plugin.version}</version>
        <configuration>
          <includes>
            <include>**/*TestCase.java</include>
            <include>**/*Test.java</include>
          </includes>
        </configuration>
      </plugin>
      <!-- Produce source jars during the 'verify' phase -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>${maven.source.plugin.version}</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>verify</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!--
				Build a test-jar for each project, so that src/test/* resources and
				classes can be used in other projects. Also customize how the jar
				files are assembled.
			-->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${maven.jar.plugin.version}</version>
        <executions>
          <execution>
            <id>test-jar</id>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!-- Checkstyles -->
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
  <repositories>
    <repository>
      <id>JBoss-Releases</id>
      <url>https://repository.jboss.org/nexus/content/repositories/releases/</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>fcrepo-thirdparty</id>
      <name>Fcrepo Thirdparty Repository</name>
      <url>http://maven.fcrepo.org/nexus/content/repositories/thirdparty/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>
</project>


text:
<?php

namespace Blog\LikeBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Likes
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="Blog\LikeBundle\Entity\LikesRepository")
 */
class Likes
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var integer
     *
     * @ORM\Column(name="id_user", type="integer")
     */
    private $idUser;

    /**
     * @var integer
     *
     * @ORM\Column(name="id_article", type="integer")
     */
    private $idArticle;

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

    /**
     * Set idUser
     *
     * @param integer $idUser
     * @return Likes
     */
    public function setIdUser($idUser)
    {
        $this->idUser = $idUser;

        return $this;
    }

    /**
     * Get idUser
     *
     * @return integer
     */
    public function getIdUser()
    {
        return $this->idUser;
    }

    /**
     * Set idArticle
     *
     * @param integer $idArticle
     * @return Likes
     */
    public function setIdArticle($idArticle)
    {
        $this->idArticle = $idArticle;

        return $this;
    }

    /**
     * Get idArticle
     *
     * @return integer
     */
    public function getIdArticle()
    {
        return $this->idArticle;
    }

    /**
     * Get idArticle by user ID
     *
     * @return integer
     */
    public function getIdArticleByUser($userID)
    {
        if($this->idUser == $userID) {
            return $this->idArticle;
        }
    }
}


text:
describe('ng-pageslide: ', function() {
  'use strict';

  var $compile;
  var $timeout;
  var $document = jasmine.createSpyObj('$document', ['on', 'off']);
  var scope;
  var isolateScope;
  var element;
  var compilePageslide;

  beforeEach(function (done) {
    module('pageslide-directive', [
      '$provide',
      function ($provide) {
        $provide.value('$document', $document);
      }
    ]);
    compilePageslide = function (html) {
      inject([
        '$compile',
        '$rootScope',
        '$document',
        '$timeout',
        function(_$compile_, $rootScope, $document, _$timeout_){
          $compile = _$compile_;
          $timeout = _$timeout_;
          scope = $rootScope.$new();
          element = angular.element(html);
          $compile(element)(scope);
          scope.$digest();
          isolateScope = element.isolateScope();
        }
      ]);
    };
    done();
  });

  afterEach(function(){
    // try to clean Dom
    var slider = document.querySelector('.ng-pageslide');
    var pageslide = document.querySelector('#test-pageslide');
    document.body.innerHTML = '';
  });

  describe('initialization', function () {
    describe('when the element is invalid', function () {
      describe('because there is no content inside of the root element', function () {
        it('should throw an exception for no content', function (done) {
          expect(function () {compilePageslide('<pageslide></pageslide>');}).toThrow();
          done();
        });
      });
      describe('because the root element is not a div', function () {
        it('should throw an exception for no content', function (done) {
          expect(function () {compilePageslide('

');}).toThrow();
          done();
        });
      });
    });

    describe('when the element is valid', function () {
      describe('and has defined the container', function () {
        beforeEach(function (done) {
          angular.element(document.body).append('
custom container text
');
          compilePageslide([
            '
',
            '
test
',
            '
'
          ].join(''));
          done();
        });

        afterEach(function (done) {
          var customContainer = document.querySelector('#customContainer');
          document.body.removeChild(customContainer);
          done();
        });

        it('should contain the pageslide with the custom defined container', function (done) {
          expect(angular.element(document.querySelector('#customContainer')).html())
          .toContain('pageslide');
          done();
        });
        it('should set the position to absolute', function (done) {
          //TODO: find out why it won't set to absolute, but is setting fixed fine
          var slider = document.querySelector('#customContainer');
          expect(angular.element(slider).css('position')).toEqual('');
          done();
        });
      });

      describe('and has defined the body class', function () {
        //TODO: right now, it looks like there is a mixup between className and bodyClass, most likely a bug
        beforeEach(function (done) {
          compilePageslide([
            '
',
            '
test
',
            '
'
          ].join(''));
          done();
        });

        it('should add the class to the pageslide element', function (done) {
          expect(angular.element(document.querySelector('.customBodyClass')).html()).toBeDefined();
          done();
        });
      });

      describe('and has set squeeze to true', function () {
        beforeEach(function (done) {
          compilePageslide([
            '
',
            '
test
',
            '
'
          ].join(''));
          done();
        });

        it('should set the width ', function (done) {
          var body = angular.element(document.body);
          scope.is_open = true;
          scope.$digest();
          //TODO: find out why this fails on Travis CI but not locally
          // expect(body.css('transition')).toContain('0.5s');
          expect(body.css('-webkit-transition')).toContain('0.5s');
          expect(body.html()).toContain('width: 300px;');
          scope.is_open = false;
          scope.$digest();
          expect(body.css('right')).toEqual('0px');
          done();
        });
      });
      describe('and has set push to true', function () {
        beforeEach(function (done) {
          compilePageslide([
            '
',
            '
test
',
            '
'
          ].join(''));
          done();
        });

        it('should set the width ', function (done) {
          var body = angular.element(document.body);
          scope.is_open = true;
          scope.$digest();
          scope.is_open = false;
          scope.$digest();
          expect(body.css('right')).toEqual('0px');
          expect(body.css('left')).toEqual('0px');
          done();
        });
      });

      describe('when the psSize is set', function () {
        beforeEach(function (done) {
          compilePageslide([
            '<pageslide ps-size="{{size}}" ps-open="is_open">',
            '
test
',
            '</pageslide>'
          ].join(''));
          done();
        });
        it('should set the size accordingly', function (done) {
          scope.is_open = false;
          scope.$digest();
          expect(isolateScope.psOpen).toEqual(false);
          scope.size = '150px';
          scope.$digest();
          expect(isolateScope.psOpen).toEqual(true);
          var body = angular.element(document.body);
          expect(body.html()).toContain('width: 150px;');
          done();
        });
      });

      describe('when psAutoClose is set', function () {
        beforeEach(function (done) {
          compilePageslide([
            '<pageslide ps-auto-close="true" ps-open="is_open">',
            '
test
',
            '</pageslide>'
          ].join(''));
          done();
        });
        it('should open on $locationChangeStart', function (done) {
          isolateScope.psOpen = true;
          scope.$broadcast('$locationChangeStart');
          expect(isolateScope.psOpen).toEqual(false);
          isolateScope.$digest();
          isolateScope.psOpen = true;
          scope.$broadcast('$stateChangeStart');
          expect(isolateScope.psOpen).toEqual(false);
          done();
        });
      });
    });
  });

  describe('functionality', function () {
    describe('default/right pageslide', function () {
      it('Should attach the pageslide panel to ', function(done) {
        // Create template DOM for directive
        compilePageslide([
          '
',
          '
',
          '
',
          '
some random content...
',
          'Click to close',
          '
',
          '
',
          '
'
        ].join(''));

        // Check for DOM Manipulation
        var el = document.querySelector('.ng-pageslide');
        var attached_to = el.parentElement.tagName;
        expect(attached_to).toBe('BODY');
        done();
      });

      it('Should open and close watching for ps-open', function (done) {
        // Create template DOM for directive
        compilePageslide([
          '
',
          '
',
          '
',
          '
some random content...
',
          'Click to close',
          '
',
          '
',
          '
'
        ].join(''));

        scope.is_open = true;
        scope.$digest();
        var width = document.querySelector('.ng-pageslide').style.width;
        expect(width).toBe('300px');

        scope.is_open = false;
        scope.$digest();
        width = document.querySelector('.ng-pageslide').style.width;
        expect(width).toBe('0px');
        done();
      });

      it('Should attach the pageslide inner content to ', function (done) {
        // Create template DOM for directive
        compilePageslide([
          '<pageslide ps-open="is_open">',
          '
',
          '
some random content...
',
          '
',
          '</pageslide>'
        ].join(''));

        // Check for DOM Manipulation
        var el = document.querySelector('.ng-pageslide');
        var attached_to = el.parentNode.localName;
        expect(attached_to).toBe('body');
        done();
      });

      it('Should remove slider when pageslide\'s scope be destroyed', function (done) {
        // Create template DOM for directive
        compilePageslide([
          '
',
          '
',
          '
',
          '
some random content...
',
          'Click to close',
          '
',
          '
',
          '
'
        ].join(''));
        scope.is_open = true;
        scope.$digest();
        scope.$destroy();
        expect(isolateScope).toBeUndefined();
        done();
      });

      describe('when binding the key listener', function () {
        beforeEach(function (done) {
          // Create template DOM for directive
          compilePageslide([
            '
',
            '
',
            '
',
            '
some random content...
',
            'Click to close',
            '
',
            '
',
            '
'
          ].join(''));
          done();
        });
        describe('and the user presses the escape key', function () {
          describe('and the keyCode is populated', function () {
            it('should close the slider', function (done) {
              $document.on.and.callFake(function (actionType, callback) {
                callback({
                  keyCode: 27 //same as ESC_KEY
                });
              });
              scope.is_open = true;
              scope.$digest();
              expect($document.on).toHaveBeenCalled();
              expect(scope.is_open).toEqual(false);
              done();
            });
          });

          describe('and the "which" property is populated', function () {
            it('should close the slider', function (done) {
              $document.on.and.callFake(function (actionType, callback) {
                callback({
                  which: 27 //same as ESC_KEY
                });
              });
              scope.is_open = true;
              scope.$digest();
              expect($document.on).toHaveBeenCalled();
              expect(scope.is_open).toEqual(false);
              done();
            });
          });
        });

        describe('and the user presses a key thats not the escape key', function () {
          describe('and the keyCode is populated', function () {
            it('should close the slider', function (done) {
              $document.on.and.callFake(function (actionType, callback) {
                callback({
                  keyCode: 99 //random key
                });
              });
              scope.is_open = true;
              scope.$digest();
              expect($document.on).toHaveBeenCalled();
              expect(scope.is_open).toEqual(true);
              done();
            });
          });

          describe('and the "which" property is populated', function () {
            it('should close the slider', function (done) {
              $document.on.and.callFake(function (actionType, callback) {
                callback({
                  which: 99 //random key
                });
              });
              scope.is_open = true;
              scope.$digest();
              expect($document.on).toHaveBeenCalled();
              expect(scope.is_open).toEqual(true);
              done();
            });
          });
        });
      });
    });

    describe('left pageslide', function () {
      describe('by default', function () {
        beforeEach(function (done) {
          compilePageslide([
            '
',
            '
',
            '
',
            '
some random content...
',
            'Click to close',
            '
',
            '
',
            '
'
          ].join(''));
          done();
        });

        it('should set the appropriate styles', function (done) {
          // Check for DOM Manipulation
          var slider = angular.element(document.body);
          expect(slider.html()).toContain('height: 100%;');
          expect(slider.html()).toContain('top: 0px;');
          expect(slider.html()).toContain('bottom: 0px;');
          expect(slider.html()).toContain('left: 0px;');
          //when opening the slider
          scope.is_open = true;
          scope.$digest();
          expect(slider.html()).toContain('width: 300px;');
          //when closing the slider
          scope.is_open = false;
          scope.$digest();
          expect(slider.html()).toContain('width: 0px;');
          done();
        });
      });
      describe('when squeeze is set', function () {
        beforeEach(function (done) {
          compilePageslide([
            '
',
            '
',
            '
',
            '
some random content...
',
            'Click to close',
            '
',
            '
',
            '
'
          ].join(''));
          done();
        });

        it('should set the appropriate styles', function (done) {
          // Check for DOM Manipulation
          var slider = angular.element(document.body);
          expect(slider.html()).toContain('height: 100%;');
          expect(slider.html()).toContain('top: 0px;');
          expect(slider.html()).toContain('bottom: 0px;');
          expect(slider.html()).toContain('left: 0px;');
          //when opening the slider
          scope.is_open = true;
          scope.$digest();
          expect(slider.html()).toContain('width: 300px;');
          //TODO: find out why this isn't being set in the test
          // expect(slider.html()).toContain('left: 300px;');
          //when closing the slider
          scope.is_open = false;
          scope.$digest();
          expect(slider.html()).toContain('width: 0px;');
          expect(slider.html()).toContain('left: 0px;');
          done();
        });
      });

      describe('when push is set', function () {
        beforeEach(function (done) {
          compilePageslide([
            '
',
            '
',
            '
',
            '
some random content...
',
            'Click to close',
            '
',
            '
',
            '
'
          ].join(''));
          done();
        });

        it('should set the appropriate styles', function (done) {
          // Check for DOM Manipulation
          var slider = angular.element(document.body);
          expect(slider.html()).toContain('height: 100%;');
          expect(slider.html()).toContain('top: 0px;');
          expect(slider.html()).toContain('bottom: 0px;');
          expect(slider.html()).toContain('left: 0px;');
          //when opening the slider
          scope.is_open = true;
          scope.$digest();
          expect(slider.html()).toContain('width: 300px;');
          //TODO: find out why these are not being set in the test
          // expect(slider.html()).toContain('left: 300px;');
          // expect(slider.html()).toContain('right: -300px;');
          //when closing the slider
          scope.is_open = false;
          scope.$digest();
          expect(slider.html()).toContain('width: 0px;');
          expect(slider.html()).toContain('left: 0px;');
          done();
        });
      });
    });

    describe('top pageslide', function () {
      describe('by default', function () {
        beforeEach(function (done) {
          compilePageslide([
            '
',
            '
',
            '
',
            '
some random content...
',
            'Click to close',
            '
',
            '
',
            '
'
          ].join(''));
          done();
        });

        it('should set the appropriate styles', function (done) {
          // Check for DOM Manipulation
          var slider = angular.element(document.body);
          expect(slider.html()).toContain('width: 100%;');
          expect(slider.html()).toContain('top: 0px;');
          expect(slider.html()).toContain('left: 0px;');
          expect(slider.html()).toContain('right: 0px;');
          //when opening the slider
          scope.is_open = true;
          scope.$digest();
          expect(slider.html()).toContain('height: 300px;');
          //when closing the slider
          scope.is_open = false;
          scope.$digest();
          expect(slider.html()).toContain('height: 0px;');
          done();
        });
      });
      describe('when squeeze is set', function () {
        beforeEach(function (done) {
          compilePageslide([
            '
',
            '
',
            '
',
            '
some random content...
',
            'Click to close',
            '
',
            '
',
            '
'
          ].join(''));
          done();
        });

        it('should set the appropriate styles', function (done) {
          // Check for DOM Manipulation
          var slider = angular.element(document.body);
          expect(slider.html()).toContain('width: 100%;');
          expect(slider.html()).toContain('top: 0px;');
          expect(slider.html()).toContain('left: 0px;');
          expect(slider.html()).toContain('right: 0px;');
          //when opening the slider
          scope.is_open = true;
          scope.$digest();
          expect(slider.html()).toContain('height: 300px;');
          //TODO: find out why this isn't being set in the test
          // expect(slider.html()).toContain('top: 300px;');
          //when closing the slider
          scope.is_open = false;
          scope.$digest();
          expect(slider.html()).toContain('height: 0px;');
          expect(slider.html()).toContain('top: 0px;');
          done();
        });
      });

      describe('when push is set', function () {
        beforeEach(function (done) {
          compilePageslide([
            '
',
            '
',
            '
',
            '
some random content...
',
            'Click to close',
            '
',
            '
',
            '
'
          ].join(''));
          done();
        });

        it('should set the appropriate styles', function (done) {
          // Check for DOM Manipulation
          var slider = angular.element(document.body);
          expect(slider.html()).toContain('width: 100%;');
          expect(slider.html()).toContain('top: 0px;');
          expect(slider.html()).toContain('left: 0px;');
          expect(slider.html()).toContain('right: 0px;');
          //when opening the slider
          scope.is_open = true;
          scope.$digest();
          expect(slider.html()).toContain('height: 300px;');
          //TODO: find out why these are not being set in the test
          // expect(slider.html()).toContain('top: 300px;');
          // expect(slider.html()).toContain('bottom: -300px;');
          //when closing the slider
          scope.is_open = false;
          scope.$digest();
          expect(slider.html()).toContain('height: 0px;');
          expect(slider.html()).toContain('top: 0px;');
          done();
        });
      });
    });

    describe('bottom pageslide', function () {
      describe('by default', function () {
        beforeEach(function (done) {
          compilePageslide([
            '
',
            '
',
            '
',
            '
some random content...
',
            'Click to close',
            '
',
            '
',
            '
'
          ].join(''));
          done();
        });

        it('should set the appropriate styles', function (done) {
          // Check for DOM Manipulation
          var slider = angular.element(document.body);
          expect(slider.html()).toContain('width: 100%;');
          expect(slider.html()).toContain('bottom: 0px;');
          expect(slider.html()).toContain('left: 0px;');
          expect(slider.html()).toContain('right: 0px;');
          //when opening the slider
          scope.is_open = true;
          scope.$digest();
          expect(slider.html()).toContain('height: 300px;');
          //when closing the slider
          scope.is_open = false;
          scope.$digest();
          expect(slider.html()).toContain('height: 0px;');
          done();
        });
      });
      describe('when squeeze is set', function () {
        beforeEach(function (done) {
          compilePageslide([
            '
',
            '
',
            '
',
            '
some random content...
',
            'Click to close',
            '
',
            '
',
            '
'
          ].join(''));
          done();
        });

        it('should set the appropriate styles', function (done) {
          // Check for DOM Manipulation
          var slider = angular.element(document.body);
          expect(slider.html()).toContain('width: 100%;');
          expect(slider.html()).toContain('bottom: 0px;');
          expect(slider.html()).toContain('left: 0px;');
          expect(slider.html()).toContain('right: 0px;');
          //when opening the slider
          scope.is_open = true;
          scope.$digest();
          expect(slider.html()).toContain('height: 300px;');
          //TODO: find out why this isn't being set in the test
          // expect(slider.html()).toContain('bottom: 300px;');
          //when closing the slider
          scope.is_open = false;
          scope.$digest();
          expect(slider.html()).toContain('height: 0px;');
          expect(slider.html()).toContain('bottom: 0px;');
          done();
        });
      });

      describe('when push is set', function () {
        beforeEach(function (done) {
          compilePageslide([
            '
',
            '
',
            '
',
            '
some random content...
',
            'Click to close',
            '
',
            '
',
            '
'
          ].join(''));
          done();
        });

        it('should set the appropriate styles', function (done) {
          // Check for DOM Manipulation
          var slider = angular.element(document.body);
          expect(slider.html()).toContain('width: 100%;');
          expect(slider.html()).toContain('bottom: 0px;');
          expect(slider.html()).toContain('left: 0px;');
          expect(slider.html()).toContain('right: 0px;');
          //when opening the slider
          scope.is_open = true;
          scope.$digest();
          expect(slider.html()).toContain('height: 300px;');
          //TODO: find out why these are not being set in the test
          // expect(slider.html()).toContain('bottom: 300px;');
          // expect(slider.html()).toContain('top: -300px;');
          //when closing the slider
          scope.is_open = false;
          scope.$digest();
          expect(slider.html()).toContain('height: 0px;');
          expect(slider.html()).toContain('bottom: 0px;');
          done();
        });
      });
    });

    xit('Should sync ps-open state between pageslide\'s scope and parent scope', function () {
      //TODO: refactor code to properly assign isolateScope
      // Create template DOM for directive
      compilePageslide([
        '
',
        '
',
        '
',
        '
some random content...
',
        'Click to close',
        '
',
        '
',
        '
'
      ].join(''));

      scope.is_open = true;
      scope.$digest();

      expect(isolateScope.psOpen).toBe(true);

      scope.is_open = false;
      scope.$digest();

      expect(isolateScope.psOpen).toBe(false);
    });
  });
});


text:
import React, { Component } from 'react';
import { PropTypes } from 'prop-types';

import Loading from '../Loading';

class RichEditor extends Component {
  static genStyle(tags = []) {
    const res = {};
    const styles = [
      'color', 'font-size', 'font-family', 'position', 'display', 'font-weight', 'cursor',
      'letter-spacing', 'line-height', 'vertical-align', 'text-align',
      'width', 'height',
      'padding', 'padding-top', 'padding-left', 'padding-right', 'padding-bottom',
      'margin', 'margin-top', 'margin-left', 'margin-right', 'margin-bottom',
      'border', 'border-top', 'border-left', 'border-right', 'border-bottom', 'border-collapse', 'border-color', 'border-collapse',
      'background', 'background-color', 'word-break',
      'list-style-type'
    ];
    for (let i = 0; i < tags.length; i++) {
      res[tags[i]] = styles;
    }

    return res;
  }
  static genAttr(tags = []) {
    const res = {};
    const attrs = [
      'src', 'alt', 'width', 'height', 'title', 'color',
      'class', 'align', 'valign', 'size', 'bgColor', 'cols',
      'rows', 'colspan', 'rowspan', 'align', 'size', 'cellpadding',
      'cellspacing', 'border', 'nowrap'
    ];
    for (let i = 0; i < tags.length; i++) {
      res[tags[i]] = attrs;
    }

    return res;
  }
  constructor(props) {
    super(props);

    this.state = {
      isFull: false,
      isLoading: true,
    };

    this.showModal = this.showModal.bind(this);
    this.hideModal = this.hideModal.bind(this);
    this.htmlTags = [
      'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'b',
      'strong', 'i', 'em', 'ul', 'ol', 'li', 'font',
      'br', 'p', 'sub', 'sup', 'del', 'hr',
      'table', 'th', 'tr', 'thead', 'tbody', 'td', 'colgroup', 'col',
      'div', 'pre', 'dl', 'dt', 'dd', 'a', 'span', 'code', 'blockquote',
      'header', 'footer', 'nav', 'aside', 'section', 'figure', 'time', 'cite',
    ];
  }
  componentDidMount() {
    const { editorOnload } = this.props;
    require.ensure([], (require) => {
      window.jquery = require('jquery/dist/jquery');
      this.Simditor = require('simditor');
      this.style = require('./simditor.css');

      this.setState({
        isLoading: false
      });

      this.initEditor();

      // 确保已经载入
      setTimeout(() => {
        editorOnload();
      });
    });
  }
  componentWillUnmount() {
    this.editor.destroy();
  }
  getContent() {
    return this.editor.getValue();
  }
  setContent(v) {
    this.editor.setValue(v);
  }
  initEditor() {
    const textbox = this.textarea;

    this.editor = new this.Simditor({
      textarea: window.jquery(textbox),
      upload: false,
      toolbarFloat: false,
      toolbar: [
        'title',
        'bold',
        'italic',
        'underline',
        'strikethrough',
        'fontScale',
        'color',
        'ol',
        'ul',
        'blockquote',
        // 'code',
        'table',
        // 'link',
        'hr',
        'indent',
        'outdent',
        'alignment'
      ],
      allowedTags: this.htmlTags,
      allowedAttributes: RichEditor.genAttr(this.htmlTags),
      allowedStyles: RichEditor.genStyle(this.htmlTags)
    });
    this.editor.on('valuechanged', () => {
      this.props.change(this.getContent());
    });
  }
  showModal() {
    this.setState({
      isFull: true
    });
    document.body.style.overflow = 'hidden';

    // 编辑器全屏
    window.jquery('.simditor').addClass('full');
  }
  hideModal() {
    this.setState({
      isFull: false
    });
    document.body.style.overflow = 'auto';

    window.jquery('.simditor').removeClass('full');
  }
  render() {
    const { isFull, isLoading } = this.state;

    if (isLoading) {
      return (
        <Loading />
      );
    }
    return (
      <div>
        <div
          onClick={this.hideModal}
          className={isFull ? 'full editor-modal' : 'editor-modal'}
        />
        <textarea
          ref={(item) => {
            this.textarea = item;
          }}
        />
      </div>
    );
  }
}

RichEditor.propTypes = {
  change: PropTypes.func,
  editorOnload: PropTypes.func,
};

RichEditor.defaultProps = {
  change: () => {},
  editorOnload: () => {}
};

export default RichEditor;


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Welcome extends CI_Controller {
	public function index(){
		$this->load->view('login_registration');
	}

	public function register(){
		$this->form_validation->set_rules('email', 'Email', 'required|trim|valid_email|is_unique[users.email]');
		$this->form_validation->set_rules('first_name', 'First Name', 'required|alpha|min_length[3]');
		$this->form_validation->set_rules('last_name', 'Last Name', 'required|alpha|min_length[3]');
		$this->form_validation->set_rules('password', 'Password', 'required|trim|min_length[8]|matches[passconf]|md5');
		$this->form_validation->set_rules('passconf', 'Confirm Password', 'required');
		if ($this->form_validation->run() == FALSE){
			$this->index();
		}
		else{
			$user = $this->user->register_user($this->input->post('email'), $this->input->post('first_name'), $this->input->post('last_name'), $this->input->post('password'));
			$this->session->set_userdata('user', $user);
			redirect("/travels/");
		}
	}

	public function login(){
		$password = md5($this->input->post('password'));
		$login = $this->user->login_user($this->input->post('email'), $password);
		if (!empty($login)){
			$this->session->set_userdata('user', $login);
			redirect("/travels/");
		}
		else {
			$this->session->set_flashdata('errors', 'The login information you provided is incorrect');
			redirect("/");
		}
	}
	public function logout(){
		$this->session->sess_destroy();
		redirect("/");
	}
}


text:
package org.springframework.security.access;

/**
 * Thrown if an {@link org.springframework.security.core.Authentication Authentication}
 * object does not hold a required authority.
 *
 * @author Ben Alex
 */
public class AccessDeniedException extends RuntimeException {
	// ~ Constructors
	// ===================================================================================================

	/**
	 * Constructs an AccessDeniedException with the specified message.
	 *
	 * @param msg the detail message
	 */
	public AccessDeniedException(String msg) {
		super(msg);
	}

	/**
	 * Constructs an AccessDeniedException with the specified message and
	 * root cause.
	 *
	 * @param msg the detail message
	 * @param t root cause
	 */
	public AccessDeniedException(String msg, Throwable t) {
		super(msg, t);
	}
}


text:
#ifndef ARABICA_XSLT_CHOOSE_HANDLER_HPP
#define ARABICA_XSLT_CHOOSE_HANDLER_HPP

#include "../xslt_choose.hpp"

namespace Arabica
{
namespace XSLT
{

template<class stringT, class adaptorT>
class WhenHandler : public ItemContainerHandler<When<stringT, adaptorT> >
{
public:
  typedef stringT string_type;
  typedef adaptorT string_adaptor;

private:
  typedef ItemContainerHandler<When<string_type, string_adaptor> > baseT;
  typedef StylesheetConstant<string_type, string_adaptor> SC;
  typedef AttributeValidators<string_type, string_adaptor> AV;
public:
  WhenHandler(Choose<string_type, string_adaptor>* choose,
              CompilationContext<string_type, string_adaptor>& context) :
      baseT(context),
      choose_(choose)
  {
  } // WhenHandler

  virtual When<string_type, string_adaptor>* createContainer(const string_type& /* namespaceURI */,
				const string_type& /* localName */,
				const string_type& qName,
				const SAX::Attributes<string_type, string_adaptor>& atts)
  {
    static const AV rules = AV::rule(SC::test, true);
    string_type test = rules.gather(qName, atts)[SC::test];

    return new When<string_type, string_adaptor>(baseT::context().xpath_expression(test));
  } // startElement

  virtual void endElement(const string_type& /* namespaceURI */,
			  const string_type& /* localName */,
			  const string_type& /* qName */)
  {
    choose_->add_when(baseT::container());
    baseT::context().pop();
  } // endElement

private:
  Choose<string_type, string_adaptor>* choose_;
}; // class WhenHandler

template<class string_type, class string_adaptor>
class OtherwiseHandler : public ItemContainerHandler<Otherwise<string_type, string_adaptor> >
{
  typedef ItemContainerHandler<Otherwise<string_type, string_adaptor> > baseT;
  typedef StylesheetConstant<string_type, string_adaptor> SC;

public:
  OtherwiseHandler(Choose<string_type, string_adaptor>* choose,
                   CompilationContext<string_type, string_adaptor>& context) :
      baseT(context),
      choose_(choose)
  {
  } // OtherwiseHandler

  virtual Otherwise<string_type, string_adaptor>* createContainer(const string_type& /* namespaceURI */,
                                     const string_type& /* localName */,
                                     const string_type& /* qName */,
                                     const SAX::Attributes<string_type, string_adaptor>& atts)
  {
    if(atts.getLength())
      throw SAX::SAXException("xsl:otherwise may not have any attributes");

    return new Otherwise<string_type, string_adaptor>();
  } // createContainer

  virtual void endElement(const string_type& /* namespaceURI */,
                          const string_type& /* localName */,
                          const string_type& /* qName */)
  {
    choose_->set_otherwise(baseT::container());
    baseT::context().pop();
  } // endElement

private:
  Choose<string_type, string_adaptor>* choose_;
}; // class OtherwiseHandler

template<class string_type, class string_adaptor>
class ChooseHandler : public SAX::DefaultHandler<string_type, string_adaptor>
{
  typedef StylesheetConstant<string_type, string_adaptor> SC;
public:
  ChooseHandler(CompilationContext<string_type, string_adaptor>& context) :
      context_(context),
      choose_(0),
      seenWhere_(false),
      seenOtherwise_(false)
  {
  } // ChooseHandler

  virtual void startElement(const string_type& namespaceURI,
                            const string_type& localName,
                            const string_type& qName,
                            const SAX::Attributes<string_type, string_adaptor>& atts)
  {
    if(!choose_)
    {
      if(atts.getLength() != 0)
        throw SAX::SAXException("xsl:choose can not have attributes");

      choose_ = new Choose<string_type, string_adaptor>();
      return;
    } // if ...

    if(namespaceURI == StylesheetConstant<string_type, string_adaptor>::NamespaceURI)
    {
      if(localName == SC::when)
      {
        seenWhere_ = true;
        if(seenOtherwise_)
          throw SAX::SAXException("xsl:otherwise must be the last element in an xsl:choose");

        context_.push(0,
                      new WhenHandler<string_type, string_adaptor>(choose_, context_),
                      namespaceURI,
                      localName,
                      qName,
                      atts);
        return;
      } // if(localName == "when")

      if(localName == SC::otherwise)
      {
        if(seenOtherwise_)
          throw SAX::SAXException("xsl:choose may only have one xsl:otherwise element");
        seenOtherwise_ = true;
        context_.push(0,
                      new OtherwiseHandler<string_type, string_adaptor>(choose_, context_),
                      namespaceURI,
                      localName,
                      qName,
                      atts);
        return;
      } // if(localName == "otherwise")
    } // if ...
    throw SAX::SAXException("xsl:choose can not contain " + string_adaptor::asStdString(qName) + ".  Only xsl:when and xsl:otherwise are allowed");
  } // startElement

  virtual void endElement(const string_type& /* namespaceURI */,
                          const string_type& /* localName */,
                          const string_type& /* qName */)
  {
    if(!seenWhere_)
      throw SAX::SAXException("xsl:choose must contain at least one xsl:where element");
    context_.parentContainer().add_item(choose_);
    context_.pop();
  } // endElement

  virtual void characters(const string_type& ch)
  {
    verifyNoCharacterData<string_type, string_adaptor>(ch, SC::choose);
  } // characters

private:
  CompilationContext<string_type, string_adaptor>& context_;
  Choose<string_type, string_adaptor>* choose_;
  bool seenWhere_;
  bool seenOtherwise_;
}; // class ChooseHandler

} // namespace XSLT
} // namespace Arabica

#endif


text:
from __future__ import (absolute_import, division, print_function,
                        unicode_literals)
from copy import deepcopy
from ggplot.components import aes
from pandas import DataFrame

__ALL__ = ["geom"]

class geom(object):
    """Base class of all Geoms"""
    VALID_AES = []
    data = None
    aes = None
    def __init__(self, *args, **kwargs):
        # new dict for each geom
        self.aes = {}
        for arg in args:
            if isinstance(arg, aes):
                for k, v in arg.items():
                    if k in self.VALID_AES:
                        self.aes[k] = v
            elif isinstance(arg, DataFrame):
                self.data = arg
            else:
                raise Exception('Unknown argument of type "{0}".'.format(type(arg)))
        if "data" in kwargs:
            self.data = kwargs.pop("data")
        if "mapping" in kwargs:
            for k, v in kwargs.pop("mapping").items():
                if k in self.VALID_AES:
                    self.aes[k] = v
        if "colour" in kwargs:
            kwargs["color"] = kwargs["colour"]
            del kwargs["colour"]

        self.manual_aes = {}
        for k, v in kwargs.items():
            if k in self.VALID_AES:
                self.manual_aes[k] = v

    def __radd__(self, gg):
        gg = deepcopy(gg)
        gg.geoms.append(self)
        return gg


text:
<?php

namespace Fungku\HubSpot\Tests\Integration\Api;

use Fungku\HubSpot\Api\BlogPosts;
use Fungku\HubSpot\Http\Client;

class BlogPostsTest extends \PHPUnit_Framework_TestCase
{
    private $blogPosts;

    public function setUp()
    {
        parent::setUp();
        $this->blogPosts = new BlogPosts('demo', new Client());
        sleep(1);
    }

    /*
     * Lots of tests need an existing object to modify.
     */
    private function createBlogPost()
    {
        sleep(1);

        $response = $this->blogPosts->create([
            'name'             => 'My Super Awesome Post ' . uniqid(),
            'content_group_id' => 351076997,
        ]);

        $this->assertEquals(201, $response->getStatusCode());

        return $response;
    }

    /** @test */
    public function all_with_no_params()
    {
        $response = $this->blogPosts->all();

        $this->assertEquals(200, $response->getStatusCode());
    }

    /** @test */
    public function all_with_params()
    {
        $response = $this->blogPosts->all([
            'limit'  => 2,
            'offset' => 3,
        ]);

        $this->assertEquals(200, $response->getStatusCode());
        $this->assertLessThanOrEqual(2, count($response->objects));
        $this->assertGreaterThanOrEqual(3, $response->offset);
    }

    /** @test */
    public function all_with_params_and_array_access()
    {
        $response = $this->blogPosts->all([
            'limit'  => 2,
            'offset' => 3,
        ]);

        $this->assertEquals(200, $response->getStatusCode());
        $this->assertLessThanOrEqual(2, count($response['objects']));
        $this->assertGreaterThanOrEqual(3, $response['offset']);
    }

    /** @test */
    public function update()
    {
        $post = $this->createBlogPost();

        $response = $this->blogPosts->update($post->id, [
            'post_body' => '
Hey man!
',
        ]);

        $this->assertEquals(200, $response->getStatusCode());
    }

    /** @test */
    public function getById()
    {
        $post = $this->createBlogPost();

        $response = $this->blogPosts->getById($post->id);

        $this->assertEquals(200, $response->getStatusCode());
    }

    /** @test */
    public function updateAutoSaveBuffer()
    {
        $post = $this->createBlogPost();

        $response = $this->blogPosts->updateAutoSaveBuffer($post->id, [
            'post_body' => '
Hey! It is a test!
',
        ]);

        $this->assertEquals(200, $response->getStatusCode());
    }

    /** @test */
    public function getAutoSaveBufferContents()
    {
        $post = $this->createBlogPost();

        $response = $this->blogPosts->getAutoSaveBufferContents($post->id);

        $this->assertEquals(200, $response->getStatusCode());
    }

    /** @test */
    public function clonePost()
    {
        $post = $this->createBlogPost();

        $response = $this->blogPosts->clonePost($post->id);

        $this->assertEquals(200, $response->getStatusCode());
    }

    /** @test */
    public function hasBufferedChanges()
    {
        $post = $this->createBlogPost();

        $response = $this->blogPosts->hasBufferedChanges($post->id);

        $this->assertEquals(200, $response->getStatusCode());
        $this->assertFalse($response->has_changes);
    }

    /** @test */
    public function publishAction()
    {
        $post = $this->createBlogPost();

        $response = $this->blogPosts->publishAction($post->id, "push-buffer-live");

        $this->assertEquals(200, $response->getStatusCode());
    }

    /** @test */
    public function pushBufferLive()
    {
        $post = $this->createBlogPost();

        $response = $this->blogPosts->pushBufferLive($post->id);

        $this->assertEquals(200, $response->getStatusCode());
    }

    /** @test */
    public function delete_restoreDeleted()
    {
        $post = $this->createBlogPost();

        $deleteResponse = $this->blogPosts->delete($post->id);
        $response = $this->blogPosts->restoreDeleted($post->id);

        $this->assertEquals(200, $deleteResponse->getStatusCode());
        $this->assertEquals(200, $response->getStatusCode());
    }

    /** @test */
    public function validateBuffer()
    {
        $post = $this->createBlogPost();

        $response = $this->blogPosts->validateBuffer($post->id);

        $this->assertEquals(200, $response->getStatusCode());
        $this->assertTrue($response->succeeded);
    }

    /** @test */
    public function versions_getVersion_restoreVersion()
    {
        $post = $this->createBlogPost();

        // versions()
        $listResponse = $this->blogPosts->versions($post->id);
        $versions = $listResponse->getData();

        // getVersion()
        $getResponse = $this->blogPosts->getVersion($post->id, $versions[0]->version_id);

        // restoreVersion()
        $restoreResponse = $this->blogPosts->restoreVersion($post->id, $versions[0]->version_id);

        $this->assertEquals(200, $listResponse->getStatusCode());
        $this->assertEquals(200, $getResponse->getStatusCode());
        $this->assertEquals(200, $restoreResponse->getStatusCode());
    }
}


text:
document.getElementById('link').addEventListener('keyup', function(event) {
  if (event.keyCode == 13) {
    event.preventDefault();
    shortenLink();
  }
});

function shortenLink() {
  var result = document.getElementById('result');
  var label = document.getElementById('label');
  var target = document.getElementById('shortened');

  result.classList.remove('active');
  label.classList.remove('error');
  document.getElementById('shortened').innerHTML = 'Kopioi linkki';

  var eventId = getEventId(document.getElementById('link').value);

  if ( eventId === false ) {
    label.classList += ' error';
    return false;
  }

  target.value = 'kuksaan.fi/' + eventId;

  setTimeout(function(){
    result.classList += ' active';
  }, 100);

  ga('send', 'event', 'Link', 'Link shortened', eventId);
}

function getEventId(link) {
  var isKuksaLink = /kuksa\.partio\.fi/i;

  if ( !isKuksaLink.test(link) ) {
    ga('send', 'event', 'Link', 'Link short failed', link);
    return false;
  }

  var getId = /Id=([0-9]*)/i;

  return link.match(getId)[1];
}

var clipboard = new Clipboard('#copypaste', {
  text: function() {
      return document.getElementById('shortened').value;
  }
});

clipboard.on('success', function(e) {
  document.getElementById('copypaste').innerHTML = 'Kopioitu :)';
  ga('send', 'event', 'Link', 'Link copied to clipboard');
});


text:
<?xml version="1.0" encoding="utf-8"?>

<selector xmlns:android="http://schemas.android.com/apk/res/android">
	<item android:state_pressed="true"
          android:drawable="@drawable/dk_icon_customer_press" />

	<item android:state_focused="true"
          android:drawable="@drawable/dk_icon_customer_press" />

    <item android:drawable="@drawable/dk_icon_customer_normal" />
 </selector>


text:
package org.ovirt.engine.core.dal.dbbroker.generic;

import static org.junit.Assert.assertNotNull;

import java.lang.reflect.Field;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.ovirt.engine.core.common.config.Config;
import org.ovirt.engine.core.common.config.ConfigCommon;
import org.ovirt.engine.core.common.config.ConfigValues;
import org.ovirt.engine.core.common.config.OptionBehaviour;
import org.ovirt.engine.core.common.config.OptionBehaviourAttribute;
import org.ovirt.engine.core.common.config.TypeConverterAttribute;
import org.ovirt.engine.core.dao.BaseDaoTestCase;

public class DBConfigUtilsTest extends BaseDaoTestCase {
    private DBConfigUtils config;

    @Override
    @Before
    public void setUp() throws Exception {
        super.setUp();
        config = new DBConfigUtils(false);
        config.refreshVdcOptionCache(dbFacade);
    }

    @Test
    public void testDefaultValues() {
        ConfigValues[] values = ConfigValues.values();

        for (ConfigValues curConfig : values) {
            if (curConfig == ConfigValues.Invalid)
                continue;

            Field configField = null;
            try {
                configField = ConfigValues.class.getField(curConfig.name());
            } catch (Exception e) {
                Assert.fail("Failed to look up" + curConfig.name());
                e.printStackTrace();
            }

            OptionBehaviourAttribute behaviourAttr = configField.getAnnotation(OptionBehaviourAttribute.class);
            if (behaviourAttr != null
                    && (behaviourAttr.behaviour() == OptionBehaviour.Password ||
                            behaviourAttr.behaviour() == OptionBehaviour.DomainsPasswordMap)) {
                continue; // no cert available for password decrypt
            }

            TypeConverterAttribute typeAttr = configField.getAnnotation(TypeConverterAttribute.class);
            assertNotNull("The following field is missing the " + TypeConverterAttribute.class.getSimpleName()
                    + " annotation: " + curConfig.name(), typeAttr);
            Class<?> c = typeAttr.value();

            Object obj = config.getValue(curConfig, ConfigCommon.defaultConfigurationVersion);

            Assert.assertTrue("null return for " + curConfig.name(), obj != null);
            Assert.assertTrue(
                    curConfig.name() + " is a " + obj.getClass().getName() + " but should be a " + c.getName(),
                    c.isInstance(obj));
        }
    }

    @Test
    public void testGetValue() {
        // Verify that values for 3.0 and 3.2 are from DB (since the entries are present in fixtures.xml)
        // and for 3.1, it's the default value from annotation in ConfigValues.
        // 3.0 -> false, 3.1 -> true, 3.2 -> true
        Assert.assertFalse(Config.<Boolean> getValue(ConfigValues.NonVmNetworkSupported, "3.0"));
        Assert.assertTrue(Config.<Boolean> getValue(ConfigValues.NonVmNetworkSupported, "3.1"));
        Assert.assertTrue(Config.<Boolean> getValue(ConfigValues.NonVmNetworkSupported, "3.2"));
    }
}


text:
{% assign current = page %}
{% assign is_banner_post = true %}

{% if page.is_post_index %}
  {% assign current = post %}
{% endif %}

{% if current.tags %}
    {% assign tag = current.tags[0] %}
{% else %}
  {% assign tag = 'Blog' %}
{% endif %}

  {% include amp/entry_image.html %}

{{current.title}}

  {% if current.description %}

    {{ current.description | markdownify }}

  {% endif %}

      {{current.author.name | truncatewords: 2, ''}}

        <amp-social-share type="twitter" width="20" height="20"
        data-param-url={{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url|replace:'amp/',''}}
        data-param-attribution="Auth0"
        data-param-text="{{current.title}} @auth0"
        ></amp-social-share>
        <amp-social-share type="linkedin" width="20" height="20"
        data-param-url={{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url|replace:'amp/',''}}
        data-param-attribution="Auth0"
        data-param-text="{{current.title}} @auth0"
        ></amp-social-share>
        <amp-social-share type="facebook" width="20" height="20"
        data-param-url={{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url|replace:'amp/',''}}
        data-param-attribution="Auth0"
        data-param-app_id="625852750947273"
        ></amp-social-share>


text:
var bridge = function (presenterPath)
{
    window.rhubarb.viewBridgeClasses.BackgroundTaskViewBridge.apply( this, arguments );
};

bridge.prototype = new window.rhubarb.viewBridgeClasses.BackgroundTaskViewBridge();
bridge.prototype.constructor = bridge;

bridge.prototype.onReady = function ()
{
    this.viewNode.style.display = 'none';
    this.progressNode = this.viewNode.querySelector( '.progress' );
    this.messageNode = this.viewNode.querySelector( '.message' );
};

bridge.prototype.onStart = function()
{
    this.viewNode.style.display = 'block';

    this.progressNode.style.width = "0%";
    this.messageNode.innerHTML = 'Please wait...';
};

bridge.prototype.onProgressReported = function(progress)
{
    this.viewNode.style.display = 'block';

    this.progressNode.style.width = progress.percentageComplete + "%";
    this.messageNode.innerHTML = progress.message;
};

bridge.prototype.onComplete = function(result)
{
    this.viewNode.style.display = 'none';
};

bridge.prototype.onFailed = function(result)
{
    this.viewNode.style.display = 'none';
};

window.rhubarb.viewBridgeClasses.BackgroundTaskProgressViewBridge = bridge;


text:
using System;
using System.ComponentModel;
using System.Windows.Forms;
using Scada.Server.Modules.DbExport.Config;
using Scada.UI;

namespace Scada.Server.Modules.DbExport.UI
{
    /// <summary>
    /// Represents a control for editing general options.
    /// <para>Представляет элемент управления для редактирования общих настроек.</para>
    /// </summary>
    public partial class CtrlGeneralOptions : UserControl
    {
        private GeneralOptions generalOptions;

        /// <summary>
        /// Initializes a new instance of the class.
        /// </summary>
        public CtrlGeneralOptions()
        {
            InitializeComponent();
            generalOptions = null;
        }

        /// <summary>
        /// Gets or sest an editable general options.
        /// </summary>
        internal GeneralOptions GeneralOptions
        {
            get
            {
                return generalOptions;
            }
            set
            {
                if (value != null)
                {
                    generalOptions = null;
                    txtTargetID.Text = value.ID.ToString();
                    txtName.Text = value.Name;
                    chkActive.Checked = value.Active;
                    numMaxQueueSize.Value = value.MaxQueueSize;
                    numDataLifetime.Value = value.DataLifetime;
                    numOutCnlNum.Value = value.OutCnlNum;
                }

                generalOptions = value;
            }
        }

        /// <summary>
        /// Trigger an event GeneralOptionsChanged.
        /// </summary>
        private void OnGeneralOptionsChanged()
        {
            GeneralOptionsChanged?.Invoke(this, new ObjectChangedEventArgs(generalOptions));
        }

        /// <summary>
        /// An event that occurs when the properties of an edited gerenal options change.
        /// </summary>
        [Category("Property Changed")]
        public event ObjectChangedEventHandler GeneralOptionsChanged;

        /// <summary>
        /// Set input focus.
        /// </summary>
        public void SetFocus()
        {
            txtName.Select();
        }

        private void txtName_TextChanged(object sender, EventArgs e)
        {
            if (generalOptions != null)
            {
                generalOptions.Name = txtName.Text;
                OnGeneralOptionsChanged();
            }
        }

        private void chkActive_CheckedChanged(object sender, EventArgs e)
        {
            if (generalOptions != null)
            {
                generalOptions.Active = chkActive.Checked;
                OnGeneralOptionsChanged();
            }
        }

        private void numMaxQueueSize_ValueChanged(object sender, EventArgs e)
        {
            if (generalOptions != null)
            {
                generalOptions.MaxQueueSize = Convert.ToInt32(numMaxQueueSize.Value);
                OnGeneralOptionsChanged();
            }
        }

        private void numDataLifetime_ValueChanged(object sender, EventArgs e)
        {
            if (generalOptions != null)
            {
                generalOptions.DataLifetime = Convert.ToInt32(numDataLifetime.Value);
                OnGeneralOptionsChanged();
            }
        }

        private void numOutCnlNum_ValueChanged(object sender, EventArgs e)
        {
            if (generalOptions != null)
            {
                generalOptions.OutCnlNum = Convert.ToInt32(numOutCnlNum.Value);
                OnGeneralOptionsChanged();
            }
        }
    }
}


text:
package com.linecorp.armeria.server.throttling;

import static java.util.Objects.requireNonNull;

import java.util.function.Function;

import com.linecorp.armeria.common.HttpStatus;
import com.linecorp.armeria.common.RpcRequest;
import com.linecorp.armeria.common.RpcResponse;
import com.linecorp.armeria.server.HttpStatusException;
import com.linecorp.armeria.server.RpcService;
import com.linecorp.armeria.server.Service;

/**
 * Builds a new {@link ThrottlingRpcService}.
 */
public final class ThrottlingRpcServiceBuilder
        extends AbstractThrottlingServiceBuilder<RpcRequest, RpcResponse> {

    /**
     * Provides default throttling reject behaviour for {@link RpcRequest}.
     * Responds with {@link HttpStatusException} with {@code 503 Service Unavailable}.
     */
    private static final ThrottlingRejectHandler<RpcRequest, RpcResponse> DEFAULT_REJECT_HANDLER =
            (delegate, ctx, req, cause) ->
                    RpcResponse.ofFailure(HttpStatusException.of(HttpStatus.SERVICE_UNAVAILABLE));

    ThrottlingRpcServiceBuilder(ThrottlingStrategy<RpcRequest> strategy) {
        super(strategy, DEFAULT_REJECT_HANDLER);
    }

    /**
     * Sets {@link ThrottlingAcceptHandler}.
     */
    public ThrottlingRpcServiceBuilder onAcceptedRequest(
            ThrottlingAcceptHandler<RpcRequest, RpcResponse> acceptHandler) {
        setAcceptHandler(acceptHandler);
        return this;
    }

    /**
     * Sets {@link ThrottlingRejectHandler}.
     */
    public ThrottlingRpcServiceBuilder onRejectedRequest(
            ThrottlingRejectHandler<RpcRequest, RpcResponse> rejectHandler) {
        setRejectHandler(rejectHandler);
        return this;
    }

    /**
     * Returns a newly-created {@link ThrottlingRpcService} based on the {@link ThrottlingStrategy}s added to
     * this builder.
     */
    public ThrottlingRpcService build(RpcService delegate) {
        return new ThrottlingRpcService(requireNonNull(delegate, "delegate"), getStrategy(),
                                        getAcceptHandler(), getRejectHandler());
    }

    /**
     * Returns a newly-created decorator that decorates an {@link Service} with a new
     * {@link ThrottlingService} based on the {@link ThrottlingStrategy}s added to this builder.
     */
    public Function<? super RpcService, ThrottlingRpcService> newDecorator() {
        final ThrottlingStrategy<RpcRequest> strategy = getStrategy();
        final ThrottlingAcceptHandler<RpcRequest, RpcResponse> acceptHandler = getAcceptHandler();
        final ThrottlingRejectHandler<RpcRequest, RpcResponse> rejectHandler = getRejectHandler();
        return service ->
                new ThrottlingRpcService(service, strategy, acceptHandler, rejectHandler);
    }
}


text:
@setlocal enableextensions
@set scriptdir=%~dp0
@set gf=%scriptdir:\bin\=%
@if exist "%gf%\lib\gemfire.jar" @goto gfok
@echo Could not determine GEMFIRE location
@verify other 2>nul
@goto done
:gfok
@set GEMFIRE=%gf%
@set GEMFIRE_JARS=%GEMFIRE%\lib\agent-dependencies.jar
@if defined CLASSPATH set GEMFIRE_JARS=%GEMFIRE_JARS%;%CLASSPATH%

@if not defined GF_JAVA (
@REM %GF_JAVA% is not defined, assume it is on the PATH
@set GF_JAVA=java
)

@"%GF_JAVA%" %JAVA_ARGS% -classpath "%GEMFIRE_JARS%;%MX4J_JARS%" -Xmx128m com.gemstone.gemfire.admin.jmx.internal.AgentLauncher %*
:done
@set scriptdir=
@set gf=
@set GEMFIRE_JARS=


text:
pytx.request package
====================

Module contents
---------------

.. automodule:: pytx.request
    :members:
    :undoc-members:
    :show-inheritance:


text:
'use strict';

/***********************************************/
/** Use this controller to customize the menu **/
/***********************************************/

angular.module('backAnd.controllers')
.controller('myMenuController', ['$scope', 'Global', '$compile', 'configService', 'menuService', '$timeout', '$rootScope', '$http', '$location', '$route',
    function ($scope, Global, $compile, configService, menuService, $timeout, $rootScope, $http, $location, $route) {

        /* Uncomment to see an example of how to add your own menu item  */
        //$scope.$on('appConfigCompleted', function (event, data) {
        //    /*  this example adds a menu item to page1 */
        //    if (data && data.workspace && data.workspace.pages && data.workspace.pages.length > 3) {
        //        data.workspace.pages.splice(3, 0, {name: "page1", partType: "content"})
        //    }
        //})

        /*  Uncomment to see an example of how to navigate when menu item is selected  */
        //$scope.$on('menuItemSelected', function (event, data) {
        //    /*  this example navigates to page1 see the routings at \themes\AdminLTE-master\backand\js\app.js */
        //    if (data.name == 'page1')
        //        $location.path("/page1");
        //})
    }
])