text:
/*
 * Copyright (c) 1982, 1986, 1993
 *	The Regents of the University of California.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 * 4. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *	@(#)tcp_timer.h	8.1 (Berkeley) 6/10/93
 * $FreeBSD: src/sys/netinet/tcp_timer.h,v 1.18 1999/12/29 04:41:03 peter Exp $
 */

#ifndef _NETINET_TCP_TIMER_H_
#define _NETINET_TCP_TIMER_H_
#include <sys/appleapiopts.h>

/* Keep the external definition the same for binary compatibility */
#define TCPT_NTIMERS_EXT	4

/*
 * Definitions of the TCP timers.
 *
 * The TCPT_PTO timer is used for probing for a tail loss in a send window.
 * If this probe gets acknowledged using SACK, it will allow the connection
 * to enter fast-recovery instead of hitting a retransmit timeout. A probe
 * timeout will send the last unacknowledged segment to generate more acks
 * with SACK information which can be used for fast-retransmiting the lost
 * packets. This will fire in the order of 10ms.
 *
 * The TCPT_REXMT timer is used to force retransmissions.
 * The TCP has the TCPT_REXMT timer set whenever segments
 * have been sent for which ACKs are expected but not yet
 * received.  If an ACK is received which advances tp->snd_una,
 * then the retransmit timer is cleared (if there are no more
 * outstanding segments) or reset to the base value (if there
 * are more ACKs expected).  Whenever the retransmit timer goes off,
 * we retransmit one unacknowledged segment, and do a backoff
 * on the retransmit timer.
 *
 * The TCPT_DELACK timer is used for transmitting delayed acknowledgements
 * if an acknowledgement was delayed in anticipation of a new segment.
 *
 * The TCPT_PERSIST timer is used to keep window size information
 * flowing even if the window goes shut.  If all previous transmissions
 * have been acknowledged(so that there are no retransmissions in progress),
 * and the window is too small to bother sending anything, then we start
 * the TCPT_PERSIST timer.  When it expires, if the window is nonzero,
 * we go to transmit state.  Otherwise, at intervals send a single byte
 * into the peer's window to force him to update our window information.
 * We do this at most as often as TCPT_PERSMIN time intervals,
 * but no more frequently than the current estimate of round-trip
 * packet time.  The TCPT_PERSIST timer is cleared whenever we receive
 * a window update from the peer.
 *
 * The TCPT_KEEP timer is used to keep connections alive.  If an
 * connection is idle (no segments received) for TCPTV_KEEP_INIT amount
 * of time, but not yet established, then we drop the connection.
 * Once the connection is established, if the connection is idle for
 * TCPTV_KEEP_IDLE time (and keepalives have been enabled on the socket),
 * we begin to probe the connection.  We force the peer to send us a
 * segment by sending:
 *	<SEQ=SND.UNA-1><ACK=RCV.NXT><CTL=ACK>
 * This segment is (deliberately) outside the window, and should elicit
 * an ack segment in response from the peer.  If, despite the TCPT_KEEP
 * initiated segments we cannot elicit a response from a peer in
 * TCPT_MAXIDLE amount of time probing, then we drop the connection.
 *
 * The TCPT_2MSL timer is used for keeping the conenction in Time-wait state
 * before fully closing it so that the connection 4-tuple can be reused.
 */
#define	TCPT_REXMT	0		/* retransmit */
#define	TCPT_PERSIST	1		/* retransmit persistence */
#define	TCPT_KEEP	2		/* keep alive */
#define	TCPT_2MSL	3		/* 2*msl quiet time timer */
#define	TCPT_DELACK	4		/* delayed ack timer */
#if MPTCP
#define	TCPT_JACK_RXMT	5	/* retransmit timer for join ack */
#define	TCPT_MAX	5
#else /* MPTCP */
#define	TCPT_MAX	4
#endif /* !MPTCP */
#define	TCPT_NONE	(TCPT_MAX + 1)
#define	TCPT_NTIMERS	(TCPT_MAX + 1)

#endif /* !_NETINET_TCP_TIMER_H_ */


text:
@interface GameOfLifeView ()
@property (nonatomic) CGFloat cellWidth;
@property (nonatomic) NSInteger numRows;
@property (nonatomic) NSInteger numCols;
@property (nonatomic) CGRect viewRect;
@end

@implementation GameOfLifeView

-(void)setRowToHighlight:(NSInteger)rowToHighlight
{
    if(rowToHighlight < 0 || rowToHighlight >= self.numRows)
    {
        rowToHighlight = 0;
    }
    _rowToHighlight = rowToHighlight;
}

-(id)initWithRect:(CGRect)rect rows:(NSInteger)rows cols:(NSInteger)cols cellWidth:(CGFloat)cellWidth
{
    if((self = [super init]))
    {
        self.numRows = rows;
        self.numCols = cols;
        self.viewRect = rect;
        self.cellWidth = cellWidth;
        self.cellBeingPlayedColor = ccc4FFromccc3B(ccRED);
        self.cellColor = ccc4FFromccc3B(ccBLUE);
    }
    return self;
}

-(void)flipCellAtRow:(NSInteger)row col:(NSInteger)col
{
    if([self.rows[row][col] integerValue])
    {
        self.rows[row][col] = @(0);
    }
    else
    {
        self.rows[row][col] = @(1);
    }
}

-(void)draw
{
    ccDrawSolidRect(self.viewRect.origin,
                    CGPointMake(self.viewRect.size.width, self.viewRect.size.height),
                    ccc4f(0, 1, 1, 1));

    //Set the color in RGB to draw the line with:
    ccDrawColor4B(100, 0, 255, 255); //purple, values range from 0 to 255

    //Draw row lines
    for(int row = 0; row <= self.numRows; row ++)
    {
        //and now draw a line between them!
        ccDrawLine(CGPointMake(
                               self.viewRect.origin.x,
                               self.viewRect.origin.y + (row * self.cellWidth)
                               ),
                   CGPointMake(
                               self.viewRect.size.width,
                               self.viewRect.origin.y + (row * self.cellWidth)
                               ));
    }

    // Draw column lines
    for(int col = 0; col <= self.numCols; col ++)
    {
        //and now draw a line between them!
        ccDrawLine(CGPointMake(
                               self.viewRect.origin.x + (col * self.cellWidth),
                               self.viewRect.origin.y
                               ),
                   CGPointMake(
                               self.viewRect.origin.x + (col * self.cellWidth),
                               self.viewRect.size.height
                               ));
    }

    //Fill in active locations in the gameGrid
    for(int row = 0; row < self.numRows && self.rows; row ++)
    {
        for(int col = 0; col < self.numCols && self.rows[row]; col ++)
        {
            NSInteger cellValue = [self.rows[row][col] integerValue];
            if(cellValue)
            {
                ccDrawSolidRect(
                                CGPointMake(
                                            self.viewRect.origin.x + col * self.cellWidth,
                                            self.viewRect.origin.y + row * self.cellWidth),
                                CGPointMake(
                                            self.viewRect.origin.x + (col + 1) * self.cellWidth,
                                            self.viewRect.origin.y + (row + 1) * self.cellWidth),
                                (row == self.rowToHighlight ? self.cellBeingPlayedColor : self.cellColor)
                                );
            }
        }
    }
}

@end

redpajama_set_name: RedPajamaGithub


text:
/*
 * winc1500_wifi.c
 *
 * Created: 5/14/2018 7:16:29 PM
 *  Author: pvallone
 */
#include "winc1500_wifi.h"

extern void formatFloat(float f, char * buffer);
extern void store_file_packet(char *data, uint32_t length);
extern void update_credentials(void);
/** IP address of host. */
uint32_t gu32HostIp = 0;
/** TCP client socket handlers. */
SOCKET tcp_client_socket = -1;
/** Receive buffer definition. */
uint8_t gau8ReceivedBuffer[MAIN_WIFI_M2M_BUFFER_SIZE] = {0};
/** Wi-Fi status variable. */
bool gbConnectedWifi = false;
/** Get host IP status variable. */
bool gbHostIpByName = false;
/** TCP Connection status variable. */
bool gbTcpConnection = false;
uint8_t gau8MacAddr[] = MAIN_MAC_ADDRESS;
int8_t gacDeviceName[] = MAIN_M2M_DEVICE_NAME;
tstrM2MAPConfig gstrM2MAPConfig = {
	MAIN_M2M_DEVICE_NAME, 1, 0, WEP_40_KEY_STRING_SIZE, MAIN_M2M_AP_WEP_KEY, (uint8_t)MAIN_M2M_AP_SEC, MAIN_M2M_AP_SSID_MODE
};

CONST char gacHttpProvDomainName[] = MAIN_HTTP_PROV_SERVER_DOMAIN_NAME;

void winc1500_resolve_cb(uint8_t *hostName, uint32_t hostIp)
{
	gu32HostIp = hostIp;
	gbHostIpByName = true;
	#if defined(DEBUG_UART)
	printf("resolve_cb: %s IP address is %d.%d.%d.%d\r\n\r\n", hostName,
			(int)IPV4_BYTE(hostIp, 0), (int)IPV4_BYTE(hostIp, 1),
			(int)IPV4_BYTE(hostIp, 2), (int)IPV4_BYTE(hostIp, 3));
	#endif
	http_client_socket_resolve_handler(hostName, hostIp);

}

void winc1500_socket_cb(SOCKET sock, uint8_t u8Msg, void *pvMsg)
{
	/* Check for socket event on TCP socket. */
	if (sock == tcp_client_socket) {
		switch (u8Msg) {
		case SOCKET_MSG_CONNECT:
		{
			if (gbTcpConnection) {
				memset(gau8ReceivedBuffer, 0, sizeof(gau8ReceivedBuffer));
				sprintf((char *)gau8ReceivedBuffer, "%s%s", MAIN_PREFIX_BUFFER, MAIN_POST_BUFFER);

				//printf("URL: %s\n\r", gau8ReceivedBuffer);
				tstrSocketConnectMsg *pstrConnect = (tstrSocketConnectMsg *)pvMsg;
				if (pstrConnect && pstrConnect->s8Error >= SOCK_ERR_NO_ERROR) {
					send(tcp_client_socket, gau8ReceivedBuffer, strlen((char *)gau8ReceivedBuffer), 0);

					memset(gau8ReceivedBuffer, 0, MAIN_WIFI_M2M_BUFFER_SIZE);
					recv(tcp_client_socket, &gau8ReceivedBuffer[0], MAIN_WIFI_M2M_BUFFER_SIZE, 0);
				} else {
					#if defined(DEBUG_UART)
					printf("socket_cb: connect error!\r\n");
					#endif
					gbTcpConnection = false;
					close(tcp_client_socket);
					tcp_client_socket = -1;
				}

			}
		}
		break;

		case SOCKET_MSG_RECV:
		{
			char *pcIndxPtr;
			char *pcEndPtr;

			tstrSocketRecvMsg *pstrRecv = (tstrSocketRecvMsg *)pvMsg;
			if (pstrRecv && pstrRecv->s16BufferSize > 0) {

				/* Get city name. */
				pcIndxPtr = strstr((char *)pstrRecv->pu8Buffer, "version");

				if (NULL != pcIndxPtr) {
					pcIndxPtr = pcIndxPtr + strlen("version") + 1;
					pcEndPtr = strstr(pcIndxPtr, "</");
					if (NULL != pcEndPtr) {
						*pcEndPtr = 0;
					}

					char * val = (char *)pcIndxPtr;
					float f =  atof(val);

					#if defined(DEBUG_UART)
					formatFloat(f, float_temp_buffer);
					printf("Version %s found on server.\r\n", float_temp_buffer);
					formatFloat(pck.current_firmware_version, float_temp_buffer);
					printf("Local Version %s.\r\n", float_temp_buffer);
					#endif

					pck.new_firmware_version = f;
					if(pck.new_firmware_version > pck.current_firmware_version){
						#if defined(DEBUG_UART)
						printf("New Firmware found! Press PA04 to install\n\r");
						#endif
						pck.update_requested = true;
						update_credentials();
					}

					#if defined(DEBUG_UART)
					formatFloat(pck.current_firmware_version, float_temp_buffer);
					printf("Current Version %s. \r\n", float_temp_buffer);
					#endif
					request_firmware_version = f;
					close(tcp_client_socket);
					tcp_client_socket = -1;
				} else {
					#if defined(DEBUG_UART)
					printf("N/A\r\n");
					#endif
					break;
				}

				memset(gau8ReceivedBuffer, 0, sizeof(gau8ReceivedBuffer));
				recv(tcp_client_socket, &gau8ReceivedBuffer[0], MAIN_WIFI_M2M_BUFFER_SIZE, 0);
			} else {
				#if defined(DEBUG_UART)
				printf("socket_cb: recv error!\r\n");
				#endif
				close(tcp_client_socket);
				tcp_client_socket = -1;
			}
		}
		break;
        case M2M_WIFI_REQ_DHCP_CONF:
        {
			#if defined(DEBUG_UART)
	        uint8_t *pu8IPAddress = (uint8_t *)pvMsg;
	        printf("IP address is %u.%u.%u.%u\r\n",
	        pu8IPAddress[0], pu8IPAddress[1], pu8IPAddress[2], pu8IPAddress[3]);
			#endif
	        break;
        }
		default:
			break;
		}
	}
}

void winc1500_requestClient(void){

	// if wifi is connected and gbTcpConnection is true, request site

	if (gbConnectedWifi && !gbTcpConnection) {
		if (gbHostIpByName) {
			/* Open TCP client socket. */
			if (tcp_client_socket < 0) {
				if ((tcp_client_socket = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
					#if defined(DEBUG_UART)
					printf("main: failed to create TCP client socket error!\r\n");
					#endif
					return;
				}
			}

			/* Connect TCP client socket. */
			addr_in.sin_family = AF_INET;
			addr_in.sin_port = _htons(MAIN_SERVER_PORT);
			addr_in.sin_addr.s_addr = gu32HostIp;
			if (connect(tcp_client_socket, (struct sockaddr *)&addr_in, sizeof(struct sockaddr_in)) != SOCK_ERR_NO_ERROR) {
				#if defined(DEBUG_UART)
				printf("main: failed to connect socket error!\r\n");
				#endif
				return;
			}

			gbTcpConnection = true;
		}
	}
}
void winc1500_download_socket_cb(SOCKET sock, uint8_t u8Msg, void *pvMsg){

	http_client_socket_event_handler(sock, u8Msg, pvMsg);
}

void winc1500_wifi_cb(uint8_t u8MsgType, void *pvMsg){

	switch (u8MsgType) {
		case M2M_WIFI_RESP_CON_STATE_CHANGED:
		{
			tstrM2mWifiStateChanged *pstrWifiState = (tstrM2mWifiStateChanged *)pvMsg;
			if (pstrWifiState->u8CurrState == M2M_WIFI_CONNECTED) {
				add_state(STORAGE_READY);
				#if defined(DEBUG_UART)
				printf("Wifi Connection Established\r\n");
				#endif
				m2m_wifi_request_dhcp_client();
			} else if (pstrWifiState->u8CurrState == M2M_WIFI_DISCONNECTED) {
				#if defined(DEBUG_UART)
				printf("Wifi Disconnected\r\n");
				#endif
				clear_state(WIFI_CONNECTED);
				gbConnectedWifi = false;
			}

			if (is_state_set(GET_REQUESTED)) {
				clear_state(GET_REQUESTED);
			}

			break;
		}

		case M2M_WIFI_REQ_DHCP_CONF:
		{
			if(state == DOWNLOAD){
				#if defined(DEBUG_UART)
				uint8_t *pu8IPAddress = (uint8_t *)pvMsg;
				#if defined(DEBUG_UART)
				printf("wifi_cb: IP address is %u.%u.%u.%u\r\n",
				#endif
				pu8IPAddress[0], pu8IPAddress[1], pu8IPAddress[2], pu8IPAddress[3]);
				#endif
				add_state(WIFI_CONNECTED);
				start_download();

			} else {
				#if defined(DEBUG_UART)
				uint8_t *pu8IPAddress = (uint8_t *)pvMsg;
				printf("*** IP address is %u.%u.%u.%u\r\n",
				pu8IPAddress[0], pu8IPAddress[1], pu8IPAddress[2], pu8IPAddress[3]);
				#endif
				gbConnectedWifi = true;
					/* Obtain the IP Address by network name */
				gethostbyname((uint8_t *)MAIN_SERVER_NAME);
			}

			break;
		}

		case M2M_WIFI_RESP_PROVISION_INFO:
		{
			tstrM2MProvisionInfo *pstrProvInfo = (tstrM2MProvisionInfo *)pvMsg;

			if (pstrProvInfo->u8Status == M2M_SUCCESS) {

				m2m_wifi_connect((char *)pstrProvInfo->au8SSID, strlen((char *)pstrProvInfo->au8SSID), pstrProvInfo->u8SecType,
				pstrProvInfo->au8Password, M2M_WIFI_CH_ALL);
				pck.current_firmware_version = 0;
				pck.new_firmware_version = 0;
				pck.update_requested = true;
				strncpy(pck.password, (const char *)pstrProvInfo->au8Password, sizeof(pck.password));
				strncpy(pck.ssid, (const char *)pstrProvInfo->au8SSID , sizeof(pck.ssid));
				update_credentials();
				state = IDOL;

			} else {
			    #if defined(DEBUG_UART)
				printf("Credentials failed! Please reset the device and try again\r\n");
				#endif
			}
		}
		break;

		default:
		{
			break;
		}
	}
}

void start_download(void)
{
	if (!is_state_set(STORAGE_READY)) {
		#if defined(DEBUG_UART)
		printf("start_download: MMC storage not ready.\r\n");
		#endif
		return;
	}

	if (!is_state_set(WIFI_CONNECTED)) {
		#if defined(DEBUG_UART)
		printf("start_download: Wi-Fi is not connected.\r\n");
		#endif
		return;
	}

	if (is_state_set(GET_REQUESTED)) {
		#if defined(DEBUG_UART)
		printf("start_download: request is sent already.\r\n");
		#endif
		return;
	}

	if (is_state_set(DOWNLOADING)) {
		#if defined(DEBUG_UART)
		printf("start_download: running download already.\r\n");
		#endif
		return;
	}

	/* Send the HTTP request. */
	#if defined(DEBUG_UART)
	printf("start_download: sending HTTP request...\r\n");
	#endif
	http_client_send_request(&http_client_module_inst,MAIN_HTTP_FILE_URL, HTTP_METHOD_GET, NULL, NULL);

}

void http_client_callback(struct http_client_module *module_inst, int type, union http_client_data *data)
{
	switch (type) {
	case HTTP_CLIENT_CALLBACK_SOCK_CONNECTED:
		#if defined(DEBUG_UART)
		printf("http_client_callback: HTTP client socket connected.\r\n");
		#endif
		break;

	case HTTP_CLIENT_CALLBACK_REQUESTED:
		#if defined(DEBUG_UART)
		printf("http_client_callback: request completed.\r\n");
		#endif
		add_state(GET_REQUESTED);
		break;

	case HTTP_CLIENT_CALLBACK_RECV_RESPONSE:
		#if defined(DEBUG_UART)
		printf("http_client_callback: received response %u data size %u\r\n",
				(unsigned int)data->recv_response.response_code,
				(unsigned int)data->recv_response.content_length);
		#endif
		if ((unsigned int)data->recv_response.response_code == 200) {
			http_file_size = data->recv_response.content_length;
			received_file_size = 0;
		}
		else {

			add_state(CANCELED);
			return;
		}
		if (data->recv_response.content_length <= MAIN_BUFFER_MAX_SIZE) {
			store_file_packet(data->recv_response.content, data->recv_response.content_length);
			add_state(COMPLETED);

		}
		break;

	case HTTP_CLIENT_CALLBACK_RECV_CHUNKED_DATA:
		store_file_packet(data->recv_chunked_data.data, data->recv_chunked_data.length);
		if (data->recv_chunked_data.is_complete) {

			add_state(COMPLETED);

		}

		break;

	case HTTP_CLIENT_CALLBACK_DISCONNECTED:
		#if defined(DEBUG_UART)
		printf("http_client_callback: disconnection reason:%d\r\n", data->disconnected.reason);
		#endif
		/* If disconnect reason is equal to -ECONNRESET(-104),
		 * It means the server has closed the connection (timeout).
		 * This is normal operation.
		 */
		if (data->disconnected.reason == -EAGAIN) {
			/* Server has not responded. Retry immediately. */
			if (is_state_set(DOWNLOADING)) {

				clear_state(DOWNLOADING);
			}

			if (is_state_set(GET_REQUESTED)) {
				clear_state(GET_REQUESTED);
			}
			start_download();
		}

		break;
	}
}

void clear_state(download_state mask)
{
	down_state &= ~mask;
}

void add_state(download_state mask)
{
	down_state |= mask;

}

bool is_state_set(download_state mask)
{
	return ((down_state & mask) != 0);
}


text:
X-Tensions
=====

[![Gem Version](https://badge.fury.io/rb/x_tensions.svg)](http://badge.fury.io/rb/x_tensions)

x_tensions gem


text:
package org.unitils.mock.core.matching.impl;

import org.junit.Before;
import org.junit.Test;
import org.unitils.UnitilsJUnit4;
import org.unitils.mock.Mock;
import org.unitils.mock.core.MatchingInvocation;
import org.unitils.mock.core.ObservedInvocation;
import org.unitils.mock.core.Scenario;

import java.lang.reflect.Method;

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

/**
 * @author Tim Ducheyne
 */
public class AssertInvokedInSequenceVerifyingMatchingInvocationHandlerPerformAssertionTest extends UnitilsJUnit4 {

    private AssertInvokedInSequenceVerifyingMatchingInvocationHandler assertInvokedInSequenceVerifyingMatchingInvocationHandler;

    private Mock<Scenario> scenarioMock;
    private Mock<MatchingInvocation> matchingInvocationMock;
    private Mock<ObservedInvocation> observedInvocationMock;
    private Mock<ObservedInvocation> outOfSequenceInvocationMock;

    @Before
    public void initialize() throws Exception {
        assertInvokedInSequenceVerifyingMatchingInvocationHandler = new AssertInvokedInSequenceVerifyingMatchingInvocationHandler(scenarioMock.getMock(), null, null);

        Method testMethod1 = TestInterface.class.getMethod("testMethod1");
        Method testMethod2 = TestInterface.class.getMethod("testMethod2");
        Method testMethod3 = TestInterface.class.getMethod("testMethod3");
        matchingInvocationMock.returns(testMethod1).getMethod();
        observedInvocationMock.returns(testMethod2).getMethod();
        observedInvocationMock.returns(new StackTraceElement("class2", "method2", "file2", 222)).getInvokedAt();
        outOfSequenceInvocationMock.returns(testMethod3).getMethod();
        outOfSequenceInvocationMock.returns(new StackTraceElement("class3", "method3", "file3", 333)).getInvokedAt();
    }

    @Test
    public void nullWhenInvocationFoundInSequence() {
        scenarioMock.returns(observedInvocationMock).verifyInvocation(matchingInvocationMock.getMock());
        scenarioMock.returns(null).verifyInvocationInSequence(observedInvocationMock.getMock());

        String result = assertInvokedInSequenceVerifyingMatchingInvocationHandler.performAssertion(matchingInvocationMock.getMock());
        assertNull(result);
    }

    @Test
    public void errorMessageWhenNoInvocationFound() {
        scenarioMock.returns(null).verifyInvocation(matchingInvocationMock.getMock());

        String result = assertInvokedInSequenceVerifyingMatchingInvocationHandler.performAssertion(matchingInvocationMock.getMock());
        assertEquals("Expected invocation of TestInterface.testMethod1(), but it didn't occur.", result);
    }

    @Test
    public void errorMessageWhenInvocationFoundOutOfSequence() {
        scenarioMock.returns(observedInvocationMock).verifyInvocation(matchingInvocationMock.getMock());
        scenarioMock.returns(outOfSequenceInvocationMock).verifyInvocationInSequence(observedInvocationMock.getMock());

        String result = assertInvokedInSequenceVerifyingMatchingInvocationHandler.performAssertion(matchingInvocationMock.getMock());
        assertEquals("Invocation of TestInterface.testMethod1() invoked at class2.method2(file2:222)\n" +
                "was expected to be performed after TestInterface.testMethod3() invoked at class3.method3(file3:333)\n" +
                "but actually occurred before it.", result);
    }

    private interface TestInterface {

        void testMethod1();

        void testMethod2();

        void testMethod3();
    }
}


text:
/* Delete the tables if they already exist */
drop table if exists Highschooler;
drop table if exists Friend;
drop table if exists Likes;

/* Create the schema for our tables */
create table Highschooler(ID int, name text, grade int);
create table Friend(ID1 int, ID2 int);
create table Likes(ID1 int, ID2 int);

/* Populate the tables with our data */
insert into Highschooler values (1510, 'Jordan', 9);
insert into Highschooler values (1689, 'Gabriel', 9);
insert into Highschooler values (1381, 'Tiffany', 9);
insert into Highschooler values (1709, 'Cassandra', 9);
insert into Highschooler values (1101, 'Haley', 10);
insert into Highschooler values (1782, 'Andrew', 10);
insert into Highschooler values (1468, 'Kris', 10);
insert into Highschooler values (1641, 'Brittany', 10);
insert into Highschooler values (1247, 'Alexis', 11);
insert into Highschooler values (1316, 'Austin', 11);
insert into Highschooler values (1911, 'Gabriel', 11);
insert into Highschooler values (1501, 'Jessica', 11);
insert into Highschooler values (1304, 'Jordan', 12);
insert into Highschooler values (1025, 'John', 12);
insert into Highschooler values (1934, 'Kyle', 12);
insert into Highschooler values (1661, 'Logan', 12);

insert into Friend values (1510, 1381);
insert into Friend values (1510, 1689);
insert into Friend values (1689, 1709);
insert into Friend values (1381, 1247);
insert into Friend values (1709, 1247);
insert into Friend values (1689, 1782);
insert into Friend values (1782, 1468);
insert into Friend values (1782, 1316);
insert into Friend values (1782, 1304);
insert into Friend values (1468, 1101);
insert into Friend values (1468, 1641);
insert into Friend values (1101, 1641);
insert into Friend values (1247, 1911);
insert into Friend values (1247, 1501);
insert into Friend values (1911, 1501);
insert into Friend values (1501, 1934);
insert into Friend values (1316, 1934);
insert into Friend values (1934, 1304);
insert into Friend values (1304, 1661);
insert into Friend values (1661, 1025);
insert into Friend select ID2, ID1 from Friend;

insert into Likes values(1689, 1709);
insert into Likes values(1709, 1689);
insert into Likes values(1782, 1709);
insert into Likes values(1911, 1247);
insert into Likes values(1247, 1468);
insert into Likes values(1641, 1468);
insert into Likes values(1316, 1304);
insert into Likes values(1501, 1934);
insert into Likes values(1934, 1501);
insert into Likes values(1025, 1101);


text:
SHELL := /bin/bash

help:
	@echo 'Makefile for django-cache-url'
	@echo ''
	@echo 'Usage:'
	@echo '   make release      push to the PyPI'
	@echo '   make test         run the test suite'
	@echo ''

release:
	rm -rf dist/*
	python setup.py register bdist_wheel sdist
	twine upload dist/*

test:
	tox


text:
require 'cisco_node_utils' if Puppet.features.cisco_node_utils?
begin
  require 'puppet_x/cisco/autogen'
rescue LoadError # seen on master, not on agent
  # See longstanding Puppet issues #4248, #7316, #14073, #14149, etc. Ugh.
  require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..',
                                     'puppet_x', 'cisco', 'autogen.rb'))
end

Puppet::Type.type(:cisco_interface_channel_group).provide(:cisco) do
  desc 'The Cisco provider for cisco_interface_channel_group.'

  confine feature: :cisco_node_utils
  defaultfor operatingsystem: :nexus

  mk_resource_methods

  # Property symbol arrays for method auto-generation. There are separate arrays
  # because the boolean-based methods are processed slightly different.
  # Note: channel_group should always process first.
  INTF_CG_NON_BOOL_PROPS = [
    :channel_group,
    :channel_group_mode,
    :description,
  ]
  INTF_CG_BOOL_PROPS = [
    :shutdown
  ]
  INTF_CG_ALL_PROPS = INTF_CG_NON_BOOL_PROPS + INTF_CG_BOOL_PROPS

  PuppetX::Cisco::AutoGen.mk_puppet_methods(:non_bool, self, '@nu',
                                            INTF_CG_NON_BOOL_PROPS)
  PuppetX::Cisco::AutoGen.mk_puppet_methods(:bool, self, '@nu',
                                            INTF_CG_BOOL_PROPS)

  def initialize(value={})
    super(value)
    @nu = Cisco::InterfaceChannelGroup.interfaces[@property_hash[:name]]
    @property_flush = {}
  end

  def self.properties_get(intf_name, nu_obj)
    debug "Checking instance, #{intf_name}."
    current_state = {
      interface: intf_name,
      name:      intf_name,
      ensure:    :present,
    }
    # Call node_utils getter for each property
    INTF_CG_NON_BOOL_PROPS.each do |prop|
      current_state[prop] = nu_obj.send(prop)
    end
    INTF_CG_BOOL_PROPS.each do |prop|
      val = nu_obj.send(prop)
      if val.nil?
        current_state[prop] = nil
      else
        current_state[prop] = val ? :true : :false
      end
    end
    new(current_state)
  end # self.properties_get

  def self.instances
    all_intf = []
    Cisco::InterfaceChannelGroup.interfaces.each do |intf_name, nu_obj|
      begin
        all_intf << properties_get(intf_name, nu_obj)
      end
    end
    all_intf
  end # self.instances

  def self.prefetch(resources)
    all_intf = instances
    resources.keys.each do |name|
      provider = all_intf.find { |intf| intf.instance_name == name }
      resources[name].provider = provider unless provider.nil?
    end
  end # self.prefetch

  def exists?
    (@property_hash[:ensure] == :present)
  end

  def create
    @property_flush[:ensure] = :present
  end

  def destroy
    @property_flush[:ensure] = :absent
  end

  def instance_name
    interface
  end

  def properties_set(new_interface=false)
    INTF_CG_ALL_PROPS.each do |prop|
      next unless @resource[prop]
      send("#{prop}=", @resource[prop]) if new_interface
      unless @property_flush[prop].nil?
        @nu.send("#{prop}=", @property_flush[prop]) if
          @nu.respond_to?("#{prop}=")
      end
    end
    # custom setters which require one-shot multi-param setters
    channel_group_mode_set
  end

  def channel_group_mode_set
    group = @property_flush[:channel_group] ? @property_flush[:channel_group] : @nu.channel_group
    mode = @property_flush[:channel_group_mode] ? @property_flush[:channel_group_mode] : @nu.channel_group_mode
    group = false if @resource[:channel_group] == :default
    mode = false if @resource[:channel_group_mode] == :default
    @nu.channel_group_mode_set(group, mode)
  end

  def flush
    if @property_flush[:ensure] == :absent
      @nu.destroy
      @nu = nil
    else
      # Create/Update
      if @nu.nil?
        new_interface = true
        @nu = Cisco::InterfaceChannelGroup.new(@resource[:interface])
      end
      properties_set(new_interface)
    end
  end
end # Puppet::Type


text:
require 'chef/mixin/shell_out'

class Chef
  class Provider
    # The provider for lvm_logical_volume resource
    #
    class LvmLogicalVolume < Chef::Provider
      include Chef::Mixin::ShellOut

      # Loads the current resource attributes
      #
      # @return [Chef::Resource::LvmLogicalVolume] the lvm_logical_volume resource
      #
      def load_current_resource
        @current_resource ||= Chef::Resource::LvmLogicalVolume.new(@new_resource.name)
        @current_resource
      end

      # The create action
      #
      def action_create # rubocop:disable MethodLength
        require 'lvm'
        lvm = LVM::LVM.new
        name = new_resource.name
        group = new_resource.group
        fs_type = new_resource.filesystem
        device_name = "/dev/mapper/#{to_dm_name(group)}-#{to_dm_name(name)}"

        vg = lvm.volume_groups[new_resource.group]
        # Create the logical volume
        if vg.nil? || vg.logical_volumes.select { |lv| lv.name == name }.empty?
          device_name = "/dev/mapper/#{to_dm_name(group)}-#{to_dm_name(name)}"
          size =
            case new_resource.size
            when /\d+[kKmMgGtT]/
              "--size #{new_resource.size}"
            when /(\d{2}|100)%(FREE|VG|PVS)/
              "--extents #{new_resource.size}"
            when /(\d+)/
              "--size #{$1}" # rubocop:disable PerlBackrefs
            end

          stripes = new_resource.stripes ? "--stripes #{new_resource.stripes}" : ''
          stripe_size = new_resource.stripe_size ? "--stripesize #{new_resource.stripe_size}" : ''
          mirrors = new_resource.mirrors ? "--mirrors #{new_resource.mirrors}" : ''
          contiguous = new_resource.contiguous ? '--contiguous y' : ''
          readahead = new_resource.readahead ? "--readahead #{new_resource.readahead}" : ''
          physical_volumes = [new_resource.physical_volumes].flatten.join ' ' if new_resource.physical_volumes

          command = "lvcreate #{size} #{stripes} #{stripe_size} #{mirrors} #{contiguous} #{readahead} --name #{name} #{group} #{physical_volumes}"
          Chef::Log.debug "Executing lvm command: '#{command}'"
          output = lvm.raw(command)
          Chef::Log.debug "Command output: '#{output}'"
          new_resource.updated_by_last_action(true)
        else
          Chef::Log.info "Logical volume '#{name}' already exists. Not creating..."
        end

        # If file system is specified, format the logical volume
        if fs_type.nil?
          Chef::Log.info 'File system type is not set. Not formatting...'
        elsif device_formatted?(device_name, fs_type)
          Chef::Log.info "Volume '#{device_name}' is already formatted. Not formatting..."
        else
          shell_out!("yes | mkfs -t #{fs_type} #{device_name}")
          new_resource.updated_by_last_action(true)
        end

        # If the mount point is specified, mount the logical volume
        if new_resource.mount_point
          if new_resource.mount_point.is_a?(String)
            mount_spec = { :location => new_resource.mount_point }
          else
            mount_spec = new_resource.mount_point
          end

          # Create the mount point
          dir_resource = directory mount_spec[:location] do
            mode 0777
            owner 'root'
            group 'root'
            recursive true
            action :nothing
          end
          dir_resource.run_action(:create)
          # Mark the resource as updated if the directory resource is updated
          new_resource.updated_by_last_action(dir_resource.updated?)

          # Mount the logical volume
          mount_resource = mount mount_spec[:location] do
            ignore_failure true
            options mount_spec[:options]
            dump mount_spec[:dump]
            pass mount_spec[:pass]
            device device_name
            fstype fs_type
            action :nothing
          end
          mount_resource.run_action(:mount)
          mount_resource.run_action(:enable)
          # Mark the resource as updated if the mount resource is updated
          new_resource.updated_by_last_action(mount_resource.updated?)
        end
      end

      private

        # Converts the device name to the dm name format
        #
        # The device mapper will double any hyphens found in a volume group or
        # logical volume name so that it can properly locate the separator between
        # the volume group and the logical volume in the device name.
        #
        # @param name [String] the name to map
        #
        # @return [String] the mapped dm name
        #
        def to_dm_name(name)
          name.gsub(/-/, '--')
        end

        # Checks if the device is formatted with the given file system type
        #
        # @param device_name [String] the device name
        # @param fs_type [String] the file system type
        #
        # @return [Boolean] whether the device is formatted with the given file
        #   system type or not
        #
        def device_formatted?(device_name, fs_type)
          Chef::Log.debug "Checking to see if #{device_name} is formatted..."
          # Do not raise when there is an error in running the blkid command. If the exitstatus is not 0,
          # the device is perhaps not formatted.
          blkid = shell_out("blkid -o value -s TYPE #{device_name}")
          blkid.exitstatus == 0 && blkid.stdout.strip == fs_type.strip
        end

    end
  end
end


text:
#include "XMLReadWriteMachine.h"
#include "ReadWriteXMLCompound.h"
#include "ReadWriteXMLList.h"
#include "ReadWriteXMLBool.h"
#include "ReadWriteXMLInt32.h"
#include "ReadWriteXMLFloat64.h"
#include "ReadWriteXMLString.h"
#include "ReadWriteXMLBinary.h"

namespace Open3DMotion
{
	XMLReadWriteMachine::XMLReadWriteMachine()
	{
		element.push_back(new ReadWriteXMLCompound);
		element.push_back(new ReadWriteXMLList);
		element.push_back(new ReadWriteXMLBool);
		element.push_back(new ReadWriteXMLInt32);
		element.push_back(new ReadWriteXMLFloat64);
		element.push_back(new ReadWriteXMLString);
		element.push_back(new ReadWriteXMLBinary);
	}

	XMLReadWriteMachine::~XMLReadWriteMachine()
	{
		for (std::vector<ReadWriteXML*>::iterator iter_element( element.begin() ); iter_element != element.end(); iter_element++)
			delete *iter_element;
	}
}


text:
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

from ansible.errors import AnsibleError
from ansible.plugins.lookup import LookupBase

class LookupModule(LookupBase):

    def __init__(self, basedir=None, **kwargs):
        self.basedir = basedir

    def run(self, terms, variables, **kwargs):

        if not isinstance(terms, list):
            raise AnsibleError("with_indexed_items expects a list")

        items = self._flatten(terms)
        return list(zip(range(len(items)), items))


text:
import xlsxwriter

workbook = xlsxwriter.Workbook('hello_world.xlsx')
worksheet = workbook.add_worksheet()

worksheet.write('A1', 'Hello world')

workbook.close()


text:
import { GraphQLBoolean } from 'graphql'

// `silent` argument
export const getSilentArgument = function () {
  return SILENT_ARGS
}

const SILENT_ARGS = {
  silent: {
    type: GraphQLBoolean,
    description: `Do not output any result.
The action is still performed.`,
    defaultValue: false,
  },
}


text:
package iobjects.entity;

import java.util.*;

/**
 * Representa uma lista de EntityField's.
 * @since 3.1
 */
public class EntityFieldList {

  private Vector vector = new Vector();

  /**
   * Construtor padrão.
   */
  public EntityFieldList() {
  }

  /**
   * Adiciona o EntityField especificado à lista.
   * @param entityField EntityField para adicionar à lista.
   */
  public void add(EntityField entityField) {
    if (!contains(entityField.getFieldName()))
      vector.add(entityField);
  }

  /**
   * Remove todos os EntityField´s da lista.
   */
  public void clear() {
    vector.clear();
  }

  /**
   * Retorna true se existir um EntityField com o fieldName especificado.
   * @param fieldName fieldName do EntityField que se deseja localizar,
   *                  desprezando letras maiúsculas e minúsculas.
   * @return Retorna true se existir um EntityField com o fieldName especificado.
   */
  public boolean contains(String fieldName) {
    return indexOf(fieldName) >= 0;
  }

  /**
   * Retorna o EntityField na posição indicada por 'index'.
   * @param index Índice do EntityField que se dejesa retornar.
   * @return Retorna o EntityField na posição indicada por 'index'.
   */
  public EntityField get(int index) {
    return (EntityField)vector.get(index);
  }

  /**
   * Retorna o EntityField com o fieldName especificado.
   * @param fieldName fieldName do EntityField que se deseja localizar,
   *                  desprezando letras maiúsculas e minúsculas.
   * @return Retorna o EntityField com o fieldName especificado.
   */
  public EntityField get(String fieldName) {
    int index = indexOf(fieldName);
    if (index >= 0)
      return (EntityField)vector.get(index);
    else
      return null;
  }

  /**
   * Retorna o EntityField com o alias especificado.
   * @param alias Alias do EntityField que se deseja localizar,
   *              desprezando letras maiúsculas e minúsculas.
   * @return Retorna o EntityField com o alias especificado.
   */
  public EntityField getByAlias(String alias) {
    // procura o EntityField pelo alias
    int index = -1;
    for (int i=0; i<size(); i++) {
      if (get(i).getFieldAlias().compareToIgnoreCase(alias) == 0) {
        index = i;
        break;
      } // if
    } // for
    // retorna
    if (index >= 0)
      return (EntityField)vector.get(index);
    else
      return null;
  }

  /**
   * Retorna um String[] contendo os nomes dos campos contidos na lista.
   * @return String[] Contendo os nomes dos campos contidos na lista.
   */
  public String[] getFieldNames() {
    return getFieldNames(true);
  }

  /**
   * Retorna um String[] contendo os nomes dos campos contidos na lista.
   * @param readOnly True para que os campos ReadOnly sejam incluídos.
   * @return String[] Contendo os nomes dos campos contidos na lista.
   */
  public String[] getFieldNames(boolean readOnly) {
    // loop nos campos
    Vector vector = new Vector();
    for (int i=0; i<size(); i++) {
      // campo da vez
      EntityField field = get(i);
      // readOnly?
      if (field.getReadOnly() && !readOnly)
        continue;
      // põe na lista
      vector.add(field.getFieldName());
    } // for
    // retorna
    String[] result = new String[vector.size()];
    vector.copyInto(result);
    return result;
  }

  /**
   * Retorna um EntityField[] contendo os campos chave da entidade.
   * @return EntityField[] contendo os campos chave da entidade.
   */
  public EntityField[] getKeyFields() {
    // loop nos campos
    Vector vector = new Vector();
    for (int i=0; i<size(); i++) {
      // campo da vez
      EntityField field = get(i);
      // se não é chave...continua
      if (!field.getIsKey())
        continue;
      // põe na lista
      vector.add(field);
    } // for
    // retorna
    EntityField[] result = new EntityField[vector.size()];
    vector.copyInto(result);
    return result;
  }

  /**
   * Retorna o índice do EntityField com o fieldName especificado.
   * @param fieldName fieldName do EntityField que se deseja localizar,
   *                  desprezando letras maiúsculas e minúsculas.
   * @return Retorna o índice do EntityField com o fieldName especificado.
   */
  public int indexOf(String fieldName) {
    for (int i=0; i<size(); i++)
      if (get(i).getFieldName().compareToIgnoreCase(fieldName) == 0)
        return i;
    return -1;
  }

  /**
   * Remove o EntityField na posição indicada por index.
   * @param index Posição do EntityField para remover.
   */
  public void remove(int index) {
    vector.remove(index);
  }

  /**
   * Retorna a quantidade de EntityField´s existentes na lista.
   * @return Retorna a quantidade de EntityField´s existentes na lista.
   */
  public int size() {
    return vector.size();
  }

}


text:
using console;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace ConsoleTestProj
{

    ///
    ///This is a test class for _032_CaculateTreeTest and is intended
    ///to contain all _032_CaculateTreeTest Unit Tests
    ///
    [TestClass()]
    public class _032_CaculateTreeTest
    {

        private TestContext testContextInstance;

        ///
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        //
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion

        ///
        ///A test for CalcuateTree
        ///
        [TestMethod()]
        public void CalcuateTreeTest()
        {
            _032_CaculateTree target = new _032_CaculateTree(); // TODO: Initialize to an appropriate value

            StrTreeNode root = new StrTreeNode("+");
            root.leftChild = new StrTreeNode("*");
            root.leftChild.leftChild = new StrTreeNode("5");
            root.leftChild.rightChild = new StrTreeNode("10");
            root.rightChild = new StrTreeNode("/");
            root.rightChild.leftChild = new StrTreeNode("5");
            root.rightChild.rightChild = new StrTreeNode("10");

            double expected = 50.5;
            double actual;
            actual = target.CalcuateTree(root);
            Assert.AreEqual(expected, actual);

            root = new StrTreeNode("/");
            root.leftChild = new StrTreeNode("*");
            root.leftChild.leftChild = new StrTreeNode("5");
            root.leftChild.rightChild = new StrTreeNode("-");
            root.leftChild.rightChild.leftChild = new StrTreeNode("9");
            root.leftChild.rightChild.rightChild = new StrTreeNode("1");
            root.rightChild = new StrTreeNode("/");
            root.rightChild.leftChild = new StrTreeNode("5");
            root.rightChild.rightChild = new StrTreeNode("10");

            expected = 80;
            actual = target.CalcuateTree(root);
            Assert.AreEqual(expected, actual);
        }
    }
}


text:
id: 1392
title: Aggiornare il Galaxy Nexus alla versione 4.2.2 di Android
author: Stefano Marzorati
layout: post
guid: http://marzorati.co/?p=1392
permalink: /aggiornare-galaxy-nexus-4-2-2-android/
publicize_twitter_user:
  - marzorati_ste
  - marzorati_ste
authorsure_include_css:
  -
dsq_thread_id:
  - 2027210474
categories:
  - Varie
---
### Android 4.2.2 su Galaxy Nexus: AGGIORNAMENTO FORZATO

Se siete sulla ROM stock, la modalità più semplice è proprio questa: forzare l'arrivo dell'aggiornamento OTA in modo semplice e veloce.

  1. Disattivate la connessione Internet (sia WiFi che 3G)
  2. Andate nella scheda **Tutte** e scegliete **Google Service Framework**
  3. Ora tap su **Termina** e poi su **Cancella Dati**
  4. A questo punto provate nuovamente ad aggiornare **Impostazioni > Info sul telefono > Aggiornamenti di sistema**

<div id="dc_vk_code" style="display:none;">
</div>


text:
namespace Asser.ArmasSalesTracker.Models
{
    public class PremiumPrice
    {
        public string ProductId { get; set; }

        public Price Current { get; set; }

        public Price Default { get; set; }
    }
}


text:
package org.intellij.images.editor.actions;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import consulo.ui.annotation.RequiredUIAccess;
import org.intellij.images.editor.ImageEditor;
import org.intellij.images.editor.ImageZoomModel;
import org.intellij.images.editor.actionSystem.ImageEditorActionUtil;
import org.intellij.images.ui.ImageComponentDecorator;

import javax.annotation.Nonnull;

/**
 * Zoom in.
 *
 * @author Alexey Efimov
 * @see ImageEditor#getZoomModel
 */
public final class ZoomInAction extends AnAction
{
	@Override
	@RequiredUIAccess
	public void actionPerformed(@Nonnull AnActionEvent e)
	{
		ImageComponentDecorator decorator = ImageEditorActionUtil.getImageComponentDecorator(e);
		if(decorator != null)
		{
			ImageZoomModel zoomModel = decorator.getZoomModel();
			zoomModel.zoomIn();
		}
	}

	@Override
	@RequiredUIAccess
	public void update(AnActionEvent e)
	{
		ImageComponentDecorator decorator = ImageEditorActionUtil.getImageComponentDecorator(e);
		e.getPresentation().setEnabled(decorator != null && decorator.getZoomModel().canZoomIn());
	}
}


text:
package br.org.sae.repository;

import java.util.List;

import br.org.sae.model.Curso;

public interface CursoRepository extends Repository<Curso>{

	public List<Curso> all(String nome);
	public Curso findByName(String nome);

}


text:
package org.springframework.scheduling.quartz;

import java.util.Map;

import org.quartz.JobDetail;
import org.quartz.Scheduler;

import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
 * Convenience subclass of Quartz' JobDetail class that eases bean-style
 * usage.
 *
 *
JobDetail itself is already a JavaBean but lacks sensible defaults.
 * This class uses the Spring bean name as job name, and the Quartz
 * default group ("DEFAULT") as job group if not specified.
 *
 * @author Juergen Hoeller
 * @since 18.02.2004
 * @see #setName
 * @see #setGroup
 * @see org.springframework.beans.factory.BeanNameAware
 * @see org.quartz.Scheduler#DEFAULT_GROUP
 */
public class JobDetailBean extends JobDetail
    implements BeanNameAware, ApplicationContextAware, InitializingBean {

	private String beanName;

	private ApplicationContext applicationContext;

	private String applicationContextJobDataKey;

	/**
	 * Register objects in the JobDataMap via a given Map.
	 *
These objects will be available to this Job only,
	 * in contrast to objects in the SchedulerContext.
	 *
Note: When using persistent Jobs whose JobDetail will be kept in the
	 * database, do not put Spring-managed beans or an ApplicationContext
	 * reference into the JobDataMap but rather into the SchedulerContext.
	 * @param jobDataAsMap Map with String keys and any objects as values
	 * (for example Spring-managed beans)
	 * @see SchedulerFactoryBean#setSchedulerContextAsMap
	 */
	public void setJobDataAsMap(Map jobDataAsMap) {
		getJobDataMap().putAll(jobDataAsMap);
	}

	public void setBeanName(String beanName) {
		this.beanName = beanName;
	}

	public void setApplicationContext(ApplicationContext applicationContext) {
		this.applicationContext = applicationContext;
	}

	/**
	 * Set the key of an ApplicationContext reference to expose in the JobDataMap,
	 * for example "applicationContext". Default is none.
	 * Only applicable when running in a Spring ApplicationContext.
	 *
In case of a QuartzJobBean, the reference will be applied to the Job
	 * instance as bean property. An "applicationContext" attribute will correspond
	 * to a "setApplicationContext" method in that scenario.
	 *
Note that BeanFactory callback interfaces like ApplicationContextAware
	 * are not automatically applied to Quartz Job instances, because Quartz
	 * itself is reponsible for the lifecycle of its Jobs.
	 *
Note: When using persistent job stores where JobDetail contents will
	 * be kept in the database, do not put an ApplicationContext reference into
	 * the JobDataMap but rather into the SchedulerContext.
	 * @see SchedulerFactoryBean#setApplicationContextSchedulerContextKey
	 * @see org.springframework.context.ApplicationContext
	 */
	public void setApplicationContextJobDataKey(String applicationContextJobDataKey) {
		this.applicationContextJobDataKey = applicationContextJobDataKey;
	}

	public void afterPropertiesSet() {
		if (getName() == null) {
			setName(this.beanName);
		}
		if (getGroup() == null) {
			setGroup(Scheduler.DEFAULT_GROUP);
		}
		if (this.applicationContextJobDataKey != null) {
			if (this.applicationContext == null) {
				throw new IllegalStateException(
				    "JobDetailBean needs to be set up in an ApplicationContext " +
				    "to be able to handle an 'applicationContextJobDataKey'");
			}
			getJobDataMap().put(this.applicationContextJobDataKey, this.applicationContext);
		}
	}

}


text:
module.exports = function merge(src, dst) {
    // merging means merging src.prop to dst.prop, so we require here to avoid having dst.prop and dst.src.prop.

    var rsrc = require(src)

    // I don't want to clobber any exiting clobbered messages.

    if (!dst['clobbered']) {
        dst['clobbered'] = []
    }

    var rsrckeys = Object.keys(rsrc)

    // If something gets clobbered we log it and also append a timestamped message to dst['clobbered']

    function chkkey(key) {
        if (dst[key]) {
            var msg = Date.now() + " : merge clobbered " + key + ' with ' + src.slice(2) + '.' + key
            console.error(msg)
            dst['clobbered'].push(msg)
        }
        dst[key] = rsrc[key]
    }
    rsrckeys.map(chkkey)
    return dst

}


text:
package com.facebook.buck.parser.detector;

import com.facebook.buck.core.cell.nameresolver.CellNameResolver;
import com.facebook.buck.core.exceptions.HumanReadableException;
import com.facebook.buck.core.model.TargetConfiguration;
import com.facebook.buck.core.model.tc.factory.TargetConfigurationFactory;
import com.facebook.buck.core.parser.buildtargetparser.UnconfiguredBuildTargetViewFactory;
import com.facebook.buck.parser.config.ParserConfig;
import com.facebook.buck.util.environment.Platform;
import com.google.common.collect.ImmutableList;
import java.util.Arrays;
import java.util.EnumMap;
import java.util.stream.Collectors;

/** Utility to create {@link TargetConfigurationDetector} */
public class HostConfigurationDetectorFactory {
  private HostConfigurationDetectorFactory() {}

  private static Platform parsePlatform(String platformString) {
    for (Platform platform : Platform.values()) {
      if (platform.getAutoconfName().equals(platformString)) {
        return platform;
      }
    }

    throw new HumanReadableException(
        "Unknown platform: %s, possible variants: %s",
        platformString,
        Arrays.stream(Platform.values())
            .map(Platform::getAutoconfName)
            .collect(Collectors.joining(", ")));
  }

  /** Configure detector using provided {@code .buckconfig} */
  public static HostConfigurationDetector fromBuckConfig(
      ParserConfig parserConfig,
      UnconfiguredBuildTargetViewFactory unconfiguredBuildTargetViewFactory,
      CellNameResolver cellNameResolver) {

    TargetConfigurationFactory targetConfigurationFactory =
        new TargetConfigurationFactory(unconfiguredBuildTargetViewFactory, cellNameResolver);

    EnumMap<Platform, TargetConfiguration> rules = new EnumMap<>(Platform.class);

    String spec = parserConfig.getHostPlatformDetectorSpec();

    ImmutableList<ConfigurationDetectorFactoryCommon.RawRule> rawRules =
        ConfigurationDetectorFactoryCommon.parseRules(spec, targetConfigurationFactory);

    for (ConfigurationDetectorFactoryCommon.RawRule rawRule : rawRules) {

      if (rawRule.ruleType.equals("host_os")) {
        rules.put(parsePlatform(rawRule.ruleArg), rawRule.targetConfiguration);
      } else {
        throw new HumanReadableException(
            "unknown rule type '%s' in detector rule '%s'", rawRule.ruleType, rawRule);
      }
    }

    return new HostConfigurationDetector(rules);
  }

  private static final HostConfigurationDetector EMPTY =
      new HostConfigurationDetector(new EnumMap<>(Platform.class));

  /** Target configuration that detects to none */
  public static HostConfigurationDetector empty() {
    return EMPTY;
  }
}


text:
#include "GrCaps.h"
#include "GrBackendSurface.h"
#include "GrContextOptions.h"
#include "GrSurface.h"
#include "GrSurfaceProxy.h"
#include "GrTypesPriv.h"
#include "GrWindowRectangles.h"
#include "SkJSONWriter.h"

GrCaps::GrCaps(const GrContextOptions& options) {
    fMipMapSupport = false;
    fNPOTTextureTileSupport = false;
    fSRGBSupport = false;
    fSRGBWriteControl = false;
    fDiscardRenderTargetSupport = false;
    fReuseScratchTextures = true;
    fReuseScratchBuffers = true;
    fGpuTracingSupport = false;
    fOversizedStencilSupport = false;
    fTextureBarrierSupport = false;
    fSampleLocationsSupport = false;
    fMultisampleDisableSupport = false;
    fInstanceAttribSupport = false;
    fUsesMixedSamples = false;
    fUsePrimitiveRestart = false;
    fPreferClientSideDynamicBuffers = false;
    fPreferFullscreenClears = false;
    fMustClearUploadedBufferData = false;
    fShouldInitializeTextures = false;
    fSupportsAHardwareBufferImages = false;
    fFenceSyncSupport = false;
    fCrossContextTextureSupport = false;
    fHalfFloatVertexAttributeSupport = false;
    fDynamicStateArrayGeometryProcessorTextureSupport = false;
    fPerformPartialClearsAsDraws = false;
    fPerformColorClearsAsDraws = false;
    fPerformStencilClearsAsDraws = false;
    fAllowCoverageCounting = false;
    fTransferBufferSupport = false;
    fDriverBlacklistCCPR = false;

    fBlendEquationSupport = kBasic_BlendEquationSupport;
    fAdvBlendEqBlacklist = 0;

    fMapBufferFlags = kNone_MapFlags;

    fMaxVertexAttributes = 0;
    fMaxRenderTargetSize = 1;
    fMaxPreferredRenderTargetSize = 1;
    fMaxTextureSize = 1;
    fMaxWindowRectangles = 0;

    // An default count of 4 was chosen because of the common pattern in Blink of:
    //   isect RR
    //   diff  RR
    //   isect convex_poly
    //   isect convex_poly
    // when drawing rounded div borders.
    fMaxClipAnalyticFPs = 4;

    fSuppressPrints = options.fSuppressPrints;
#if GR_TEST_UTILS
    fWireframeMode = options.fWireframeMode;
#else
    fWireframeMode = false;
#endif
    fBufferMapThreshold = options.fBufferMapThreshold;
    fAvoidStencilBuffers = false;
    fAvoidWritePixelsFastPath = false;

    fPreferVRAMUseOverFlushes = true;

    fPreferTrianglesOverSampleMask = false;

    // Default to true, allow older versions of OpenGL to disable explicitly
    fClampToBorderSupport = true;

    fDriverBugWorkarounds = options.fDriverBugWorkarounds;
}

void GrCaps::applyOptionsOverrides(const GrContextOptions& options) {
    this->onApplyOptionsOverrides(options);
    if (options.fDisableDriverCorrectnessWorkarounds) {
        SkASSERT(!fDriverBlacklistCCPR);
        SkASSERT(!fAvoidStencilBuffers);
        SkASSERT(!fAdvBlendEqBlacklist);
        SkASSERT(!fPerformColorClearsAsDraws);
        SkASSERT(!fPerformStencilClearsAsDraws);
        // Don't check the partial-clear workaround, since that is a backend limitation, not a
        // driver workaround (it just so happens the fallbacks are the same).
    }
    if (GrContextOptions::Enable::kNo == options.fUseDrawInsteadOfClear) {
        fPerformColorClearsAsDraws = false;
        fPerformStencilClearsAsDraws = false;
    } else if (GrContextOptions::Enable::kYes == options.fUseDrawInsteadOfClear) {
        fPerformColorClearsAsDraws = true;
        fPerformStencilClearsAsDraws = true;
    }

    fAllowCoverageCounting = !options.fDisableCoverageCountingPaths;

    fMaxTextureSize = SkTMin(fMaxTextureSize, options.fMaxTextureSizeOverride);
    fMaxTileSize = fMaxTextureSize;
#if GR_TEST_UTILS
    // If the max tile override is zero, it means we should use the max texture size.
    if (options.fMaxTileSizeOverride && options.fMaxTileSizeOverride < fMaxTextureSize) {
        fMaxTileSize = options.fMaxTileSizeOverride;
    }
    if (options.fSuppressGeometryShaders) {
        fShaderCaps->fGeometryShaderSupport = false;
    }
#endif
    if (fMaxWindowRectangles > GrWindowRectangles::kMaxWindows) {
        SkDebugf("WARNING: capping window rectangles at %i. HW advertises support for %i.\n",
                 GrWindowRectangles::kMaxWindows, fMaxWindowRectangles);
        fMaxWindowRectangles = GrWindowRectangles::kMaxWindows;
    }
    fAvoidStencilBuffers = options.fAvoidStencilBuffers;

    fDriverBugWorkarounds.applyOverrides(options.fDriverBugWorkarounds);
}

#ifdef SK_ENABLE_DUMP_GPU
static const char* pixel_config_name(GrPixelConfig config) {
    switch (config) {
        case kUnknown_GrPixelConfig: return "Unknown";
        case kAlpha_8_GrPixelConfig: return "Alpha8";
        case kAlpha_8_as_Alpha_GrPixelConfig: return "Alpha8_asAlpha";
        case kAlpha_8_as_Red_GrPixelConfig: return "Alpha8_asRed";
        case kGray_8_GrPixelConfig: return "Gray8";
        case kGray_8_as_Lum_GrPixelConfig: return "Gray8_asLum";
        case kGray_8_as_Red_GrPixelConfig: return "Gray8_asRed";
        case kRGB_565_GrPixelConfig: return "RGB565";
        case kRGBA_4444_GrPixelConfig: return "RGBA444";
        case kRGBA_8888_GrPixelConfig: return "RGBA8888";
        case kRGB_888_GrPixelConfig: return "RGB888";
        case kRGB_888X_GrPixelConfig: return "RGB888X";
        case kRG_88_GrPixelConfig: return "RG88";
        case kBGRA_8888_GrPixelConfig: return "BGRA8888";
        case kSRGBA_8888_GrPixelConfig: return "SRGBA8888";
        case kSBGRA_8888_GrPixelConfig: return "SBGRA8888";
        case kRGBA_1010102_GrPixelConfig: return "RGBA1010102";
        case kRGBA_float_GrPixelConfig: return "RGBAFloat";
        case kRG_float_GrPixelConfig: return "RGFloat";
        case kAlpha_half_GrPixelConfig: return "AlphaHalf";
        case kAlpha_half_as_Red_GrPixelConfig: return "AlphaHalf_asRed";
        case kRGBA_half_GrPixelConfig: return "RGBAHalf";
        case kRGBA_half_Clamped_GrPixelConfig: return "RGBAHalfClamped";
        case kRGB_ETC1_GrPixelConfig: return "RGBETC1";
    }
    SK_ABORT("Invalid pixel config");
    return "<invalid>";
}

static SkString map_flags_to_string(uint32_t flags) {
    SkString str;
    if (GrCaps::kNone_MapFlags == flags) {
        str = "none";
    } else {
        SkASSERT(GrCaps::kCanMap_MapFlag & flags);
        SkDEBUGCODE(flags &= ~GrCaps::kCanMap_MapFlag);
        str = "can_map";

        if (GrCaps::kSubset_MapFlag & flags) {
            str.append(" partial");
        } else {
            str.append(" full");
        }
        SkDEBUGCODE(flags &= ~GrCaps::kSubset_MapFlag);
        if (GrCaps::kAsyncRead_MapFlag & flags) {
            str.append(" async_read");
        } else {
            str.append(" sync_read");
        }
        SkDEBUGCODE(flags &= ~GrCaps::kAsyncRead_MapFlag);
    }
    SkASSERT(0 == flags); // Make sure we handled all the flags.
    return str;
}

void GrCaps::dumpJSON(SkJSONWriter* writer) const {
    writer->beginObject();

    writer->appendBool("MIP Map Support", fMipMapSupport);
    writer->appendBool("NPOT Texture Tile Support", fNPOTTextureTileSupport);
    writer->appendBool("sRGB Support", fSRGBSupport);
    writer->appendBool("sRGB Write Control", fSRGBWriteControl);
    writer->appendBool("Discard Render Target Support", fDiscardRenderTargetSupport);
    writer->appendBool("Reuse Scratch Textures", fReuseScratchTextures);
    writer->appendBool("Reuse Scratch Buffers", fReuseScratchBuffers);
    writer->appendBool("Gpu Tracing Support", fGpuTracingSupport);
    writer->appendBool("Oversized Stencil Support", fOversizedStencilSupport);
    writer->appendBool("Texture Barrier Support", fTextureBarrierSupport);
    writer->appendBool("Sample Locations Support", fSampleLocationsSupport);
    writer->appendBool("Multisample disable support", fMultisampleDisableSupport);
    writer->appendBool("Instance Attrib Support", fInstanceAttribSupport);
    writer->appendBool("Uses Mixed Samples", fUsesMixedSamples);
    writer->appendBool("Use primitive restart", fUsePrimitiveRestart);
    writer->appendBool("Prefer client-side dynamic buffers", fPreferClientSideDynamicBuffers);
    writer->appendBool("Prefer fullscreen clears", fPreferFullscreenClears);
    writer->appendBool("Must clear buffer memory", fMustClearUploadedBufferData);
    writer->appendBool("Should initialize textures", fShouldInitializeTextures);
    writer->appendBool("Supports importing AHardwareBuffers", fSupportsAHardwareBufferImages);
    writer->appendBool("Fence sync support", fFenceSyncSupport);
    writer->appendBool("Cross context texture support", fCrossContextTextureSupport);
    writer->appendBool("Half float vertex attribute support", fHalfFloatVertexAttributeSupport);
    writer->appendBool("Specify GeometryProcessor textures as a dynamic state array",
                       fDynamicStateArrayGeometryProcessorTextureSupport);
    writer->appendBool("Use draws for partial clears", fPerformPartialClearsAsDraws);
    writer->appendBool("Use draws for color clears", fPerformColorClearsAsDraws);
    writer->appendBool("Use draws for stencil clip clears", fPerformStencilClearsAsDraws);
    writer->appendBool("Allow coverage counting shortcuts", fAllowCoverageCounting);
    writer->appendBool("Supports transfer buffers", fTransferBufferSupport);
    writer->appendBool("Blacklist CCPR on current driver [workaround]", fDriverBlacklistCCPR);
    writer->appendBool("Clamp-to-border", fClampToBorderSupport);

    writer->appendBool("Prefer VRAM Use over flushes [workaround]", fPreferVRAMUseOverFlushes);
    writer->appendBool("Prefer more triangles over sample mask [MSAA only]",
                       fPreferTrianglesOverSampleMask);
    writer->appendBool("Avoid stencil buffers [workaround]", fAvoidStencilBuffers);

    if (this->advancedBlendEquationSupport()) {
        writer->appendHexU32("Advanced Blend Equation Blacklist", fAdvBlendEqBlacklist);
    }

    writer->appendS32("Max Vertex Attributes", fMaxVertexAttributes);
    writer->appendS32("Max Texture Size", fMaxTextureSize);
    writer->appendS32("Max Render Target Size", fMaxRenderTargetSize);
    writer->appendS32("Max Preferred Render Target Size", fMaxPreferredRenderTargetSize);
    writer->appendS32("Max Window Rectangles", fMaxWindowRectangles);
    writer->appendS32("Max Clip Analytic Fragment Processors", fMaxClipAnalyticFPs);

    static const char* kBlendEquationSupportNames[] = {
        "Basic",
        "Advanced",
        "Advanced Coherent",
    };
    GR_STATIC_ASSERT(0 == kBasic_BlendEquationSupport);
    GR_STATIC_ASSERT(1 == kAdvanced_BlendEquationSupport);
    GR_STATIC_ASSERT(2 == kAdvancedCoherent_BlendEquationSupport);
    GR_STATIC_ASSERT(SK_ARRAY_COUNT(kBlendEquationSupportNames) == kLast_BlendEquationSupport + 1);

    writer->appendString("Blend Equation Support",
                         kBlendEquationSupportNames[fBlendEquationSupport]);
    writer->appendString("Map Buffer Support", map_flags_to_string(fMapBufferFlags).c_str());

    SkASSERT(!this->isConfigRenderable(kUnknown_GrPixelConfig));
    SkASSERT(!this->isConfigTexturable(kUnknown_GrPixelConfig));

    writer->beginArray("configs");

    for (size_t i = 1; i < kGrPixelConfigCnt; ++i) {
        GrPixelConfig config = static_cast<GrPixelConfig>(i);
        writer->beginObject(nullptr, false);
        writer->appendString("name", pixel_config_name(config));
        writer->appendS32("max sample count", this->maxRenderTargetSampleCount(config));
        writer->appendBool("texturable", this->isConfigTexturable(config));
        writer->endObject();
    }

    writer->endArray();

    this->onDumpJSON(writer);

    writer->appendName("shaderCaps");
    this->shaderCaps()->dumpJSON(writer);

    writer->endObject();
}
#else
void GrCaps::dumpJSON(SkJSONWriter* writer) const { }
#endif

bool GrCaps::surfaceSupportsWritePixels(const GrSurface* surface) const {
    return surface->readOnly() ? false : this->onSurfaceSupportsWritePixels(surface);
}

size_t GrCaps::transferFromOffsetAlignment(GrColorType bufferColorType) const {
    if (!this->transferBufferSupport()) {
        return 0;
    }
    size_t result = this->onTransferFromOffsetAlignment(bufferColorType);
    if (!result) {
        return 0;
    }
    // It's very convenient to access 1 byte-per-channel 32 bitvRGB/RGBA color types as uint32_t.
    // Make those aligned reads out of the buffer even if the underlying API doesn't require it.
    auto componentFlags = GrColorTypeComponentFlags(bufferColorType);
    if ((componentFlags == kRGBA_SkColorTypeComponentFlags ||
         componentFlags == kRGB_SkColorTypeComponentFlags) &&
        GrColorTypeBytesPerPixel(bufferColorType) == 4) {
        switch (result & 0b11) {
            // offset alignment already a multiple of 4
            case 0:     return result;
            // offset alignment is a multiple of 2 but not 4.
            case 2:     return 2 * result;
            // offset alignment is not a multiple of 2.
            default:    return 4 * result;
        }
    }
    return result;
}

bool GrCaps::canCopySurface(const GrSurfaceProxy* dst, const GrSurfaceProxy* src,
                            const SkIRect& srcRect, const SkIPoint& dstPoint) const {
    return dst->readOnly() ? false : this->onCanCopySurface(dst, src, srcRect, dstPoint);
}

bool GrCaps::validateSurfaceDesc(const GrSurfaceDesc& desc, GrMipMapped mipped) const {
    if (!this->isConfigTexturable(desc.fConfig)) {
        return false;
    }

    if (GrMipMapped::kYes == mipped && !this->mipMapSupport()) {
        return false;
    }

    if (desc.fWidth < 1 || desc.fHeight < 1) {
        return false;
    }

    if (SkToBool(desc.fFlags & kRenderTarget_GrSurfaceFlag)) {
        if (0 == this->getRenderTargetSampleCount(desc.fSampleCnt, desc.fConfig)) {
            return false;
        }
        int maxRTSize = this->maxRenderTargetSize();
        if (desc.fWidth > maxRTSize || desc.fHeight > maxRTSize) {
            return false;
        }
    } else {
        // We currently do not support multisampled textures
        if (desc.fSampleCnt > 1) {
            return false;
        }
        int maxSize = this->maxTextureSize();
        if (desc.fWidth > maxSize || desc.fHeight > maxSize) {
            return false;
        }
    }

    return true;
}

GrBackendFormat GrCaps::getBackendFormatFromColorType(SkColorType ct) const {
    return this->getBackendFormatFromGrColorType(SkColorTypeToGrColorType(ct), GrSRGBEncoded::kNo);
}


text:
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_HADDOCK hide #-}

-----------------------------------------------------------------------------
-- |
-- Module      :  GHC.GHCi
-- Copyright   :  (c) The University of Glasgow 2012
-- License     :  see libraries/base/LICENSE
--
-- Maintainer  :  cvs-ghc@haskell.org
-- Stability   :  internal
-- Portability :  non-portable (GHC Extensions)
--
-- The GHCi Monad lifting interface.
--
-- EXPERIMENTAL! DON'T USE.
--
-----------------------------------------------------------------------------

module GHC.GHCi {-# WARNING "This is an unstable interface." #-} (
        GHCiSandboxIO(..), NoIO()
    ) where

import GHC.Base (IO(), Monad, Functor(fmap), Applicative(..), (>>=), return, id, (.), ap)

-- | A monad that can execute GHCi statements by lifting them out of
-- m into the IO monad. (e.g state monads)
class (Monad m) => GHCiSandboxIO m where
    ghciStepIO :: m a -> IO a

instance GHCiSandboxIO IO where
    ghciStepIO = id

-- | A monad that doesn't allow any IO.
newtype NoIO a = NoIO { noio :: IO a }

instance Functor NoIO where
  fmap f (NoIO a) = NoIO (fmap f a)

instance Applicative NoIO where
  pure  = return
  (<*>) = ap

instance Monad NoIO where
    return a  = NoIO (return a)
    (>>=) k f = NoIO (noio k >>= noio . f)

instance GHCiSandboxIO NoIO where
    ghciStepIO = noio


text:
require 'rails_helper'

describe Article, type: :model do
  before(:all) do
    # Create some articles in different namespaces
    @article = build(:article,
                     title: 'Selfie',
                     namespace: 0,
                     views_updated_at: '2014-12-31'.to_date)
    @sandbox = build(:article, namespace: 2, title: 'Ragesoss/sandbox')
    @draft = build(:article, namespace: 118, title: 'My_Awesome_Draft!!!')
  end

  describe '#url' do
    it 'should get the url for an article' do
      expect(@article.url).to eq('https://en.wikipedia.org/wiki/Selfie')
      expect(@sandbox.url).to eq('https://en.wikipedia.org/wiki/User:Ragesoss/sandbox')
      expect(@draft.url).to eq('https://en.wikipedia.org/wiki/Draft:My_Awesome_Draft!!!')
    end
  end

  describe '#full_title' do
    it 'should get the title including namespace prefix for an article' do
      expect(@article.full_title).to eq('Selfie')
      expect(@sandbox.full_title).to eq('User:Ragesoss/sandbox')
      expect(@draft.full_title).to eq('Draft:My Awesome Draft!!!')
    end
  end
end


text:
package com.google.common.util.concurrent;

import java.util.concurrent.Callable;
import java.util.concurrent.Executor;
import java.util.concurrent.FutureTask;

import javax.annotation.Nullable;

/**
 * A {@link FutureTask} that also implements the {@link ListenableFuture}
 * interface.  Unlike {@code FutureTask}, {@code ListenableFutureTask} does not
 * provide an overrideable {@link FutureTask#done() done()} method.  For similar
 * functionality, call {@link #addListener}.
 *
 * @author Sven Mawson
 * @since 1.0
 */
public final class ListenableFutureTask<V> extends FutureTask<V>
    implements ListenableFuture<V> {

  // The execution list to hold our listeners.
  private final ExecutionList executionList = new ExecutionList();

  /**
   * Creates a {@code ListenableFutureTask} that will upon running, execute the
   * given {@code Callable}.
   *
   * @param callable the callable task
   * @since 10.0
   */
  public static <V> ListenableFutureTask<V> create(Callable<V> callable) {
    return new ListenableFutureTask<V>(callable);
  }

  /**
   * Creates a {@code ListenableFutureTask} that will upon running, execute the
   * given {@code Runnable}, and arrange that {@code get} will return the
   * given result on successful completion.
   *
   * @param runnable the runnable task
   * @param result the result to return on successful completion. If you don't
   *     need a particular result, consider using constructions of the form:
   *     {@code ListenableFuture<?> f = ListenableFutureTask.create(runnable,
   *     null)}
   * @since 10.0
   */
  public static <V> ListenableFutureTask<V> create(
      Runnable runnable, @Nullable V result) {
    return new ListenableFutureTask<V>(runnable, result);
  }

  private ListenableFutureTask(Callable<V> callable) {
    super(callable);
  }

  private ListenableFutureTask(Runnable runnable, @Nullable V result) {
    super(runnable, result);
  }

  @Override
  public void addListener(Runnable listener, Executor exec) {
    executionList.add(listener, exec);
  }

  /**
   * Internal implementation detail used to invoke the listeners.
   */
  @Override
  protected void done() {
    executionList.execute();
  }
}


text:
.PHONY:	clean image release prod tag test help version

APP ?= ukhpi
REGISTRY ?=  173681544495.dkr.ecr.eu-west-1.amazonaws.com/epimorphics
IMAGE ?= ${APP}
API_SERVICE_URL ?= http://localhost:8080/dsapi

ifeq ($(origin SECRET_KEY_BASE), undefined)
SECRET_KEY_BASE != rails secret
endif

APP_VERSION != ruby -I . -e 'require "app/lib/version" ; puts Version::VERSION'

RUBY_VERSION != cut -d '.' -f 1,2 .ruby-version

BUNDLER_VERSION != bundler -v | cut -d ' ' -f 3

all: test release

version:
	@echo App version is ${APP_VERSION}
	@echo Ruby version is ${RUBY_VERSION}
	@echo Bundler version is ${BUNDLER_VERSION}

image:
	docker build \
	  --build-arg APP_VERSION=${APP_VERSION} \
		--build-arg RUBY_VERSION=${RUBY_VERSION} \
		--build-arg BUNDLER_VERSION=${BUNDLER_VERSION} \
		--tag ${IMAGE}:${APP_VERSION} \
		.

prod: image
	docker run --network=host --rm --name ${APP} -e RAILS_ENV=production -e API_SERVICE_URL=${API_SERVICE_URL} -e SECRET_KEY_BASE=${SECRET_KEY_BASE} ${IMAGE}:${APP_VERSION}

test: image
	@-docker stop ${APP} 2> /dev/null || true
	@docker run -d --rm --name ${APP} --network=host -e API_SERVICE_URL=${API_SERVICE_URL} -e RAILS_ENV=development ${IMAGE}:${APP_VERSION}
	@docker exec -it -e API_SERVICE_URL=${API_SERVICE_URL} -e RAILS_ENV=test ${APP} ./bin/rails test
	@docker stop ${APP}

tag: image
	@docker tag ${IMAGE}:${APP_VERSION} ${REGISTRY}/${IMAGE}:${APP_VERSION}

release: tag
	@docker push ${REGISTRY}/${IMAGE}:${APP_VERSION}

clean:
	@rake assets:clobber webpacker:clobber tmp:clear

help:
	@echo "Make targets:"
	@echo "  prod - run the Docker image with Rails running in production mode"
	@echo "  test - run rails test in the container"
	@echo "  tag - tag the image with the REGISTRY, in preparation for release"
	@echo "  release - push the image to the Docker registry"
	@echo "  clean - remove temporary files"
	@echo "  version - show the current app version"
	@echo ""
	@echo "Environment variables (optional: all variables have defaults):"
	@echo "  PREFIX"
	@echo "  IMAGE"
	@echo "  API_SERVICE_URL"
	@echo "  SECRET_KEY_BASE"
	@echo "  APP_VERSION"
	@echo "  RUBY_VERSION"
	@echo "  BUNDLER_VERSION"


text:
//extern alias tpx;

using Microsoft.VisualStudio.TestTools.UnitTesting;
using Radical.ChangeTracking.Specialized;
using Radical.ComponentModel.ChangeTracking;
using SharpTestsEx;
using System;

namespace Radical.Tests.Model
{
    [TestClass()]
    public class PropertyValueChangeTest : ChangeTracking.ChangeTest
    {
        protected override IChange<T> Mock<T>(object owner, T value, RejectCallback<T> rejectCallback, CommitCallback<T> commitCallback, string description)
        {
            return MockPropertyValue<T>(owner, value, rejectCallback, commitCallback, description);
        }

        protected virtual PropertyValueChange<T> MockPropertyValue<T>(object owner, T value, RejectCallback<T> rejectCallback)
        {
            return new PropertyValueChange<T>(owner, "property-name", value, rejectCallback);
        }

        protected virtual PropertyValueChange<T> MockPropertyValue<T>(object owner, T value, RejectCallback<T> rejectCallback, string description)
        {
            return new PropertyValueChange<T>(owner, "property-name", value, rejectCallback, description);
        }

        protected virtual PropertyValueChange<T> MockPropertyValue<T>(object owner, T value, RejectCallback<T> rejectCallback, CommitCallback<T> commitCallback, string description)
        {
            return new PropertyValueChange<T>(owner, "property-name", value, rejectCallback, commitCallback, description);
        }

        [TestMethod]
        public void propertyValueChange_ctor_owner_value_rejectCallback_normal_should_set_expected_values()
        {
            var expected = new object();

            var target = MockPropertyValue(expected, "Foo", cv => { });
            var actual = target.Owner;

            actual.Should().Be.EqualTo(expected);
            target.Description.Should().Be.EqualTo(string.Empty);
        }

        [TestMethod]
        public void propertyValueChange_ctor_owner_value_rejectCallback_on_reject_should_return_expected_values()
        {
            var expected = "Foo";
            ChangeRejectedEventArgs<string> actual = null;
            var owner = new object();

            var target = MockPropertyValue(owner, expected, cv => { actual = cv; });
            target.Reject(RejectReason.RejectChanges);

            actual.Should().Not.Be.Null();
            actual.CachedValue.Should().Be.EqualTo(expected);
            actual.Reason.Should().Be.EqualTo(RejectReason.RejectChanges);
            actual.Source.Should().Be.EqualTo(target);
            actual.Entity.Should().Be.EqualTo(owner);
        }

        [TestMethod]
        public void propertyValueChange_getAdvisedAction_should_return_expected_values()
        {
            var expected = ProposedActions.Create | ProposedActions.Update;
            var owner = new object();

            var target = MockPropertyValue(owner, "Foo", cv => { });
            var actual = target.GetAdvisedAction(owner);

            actual.Should().Be.EqualTo(expected);
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentOutOfRangeException))]
        public void propertyVaueChange_getAdvisedAction_using_invalid_owner_should_raise_ArgumentOutOfRangeException()
        {
            var target = MockPropertyValue(new object(), "Foo", cv => { });
            target.GetAdvisedAction(new object());
        }

        [TestMethod]
        [ExpectedException(typeof(ArgumentNullException))]
        public void propertyVaueChange_getAdvisedAction_using_invalid_owner_should_raise_ArgumentNullException()
        {
            var target = MockPropertyValue(new object(), "Foo", cv => { });
            target.GetAdvisedAction(null);
        }

        [TestMethod]
        public void propertyValueChange_clone_normal_should_return_cloned_value()
        {
            var target = MockPropertyValue(new object(), "Foo", cv => { });
            var actual = target.Clone();

            actual.Should().Not.Be.EqualTo(target);
            actual.Owner.Should().Be.EqualTo(target.Owner);
            actual.Description.Should().Be.EqualTo(target.Description);
            actual.GetChangedEntities().Should().Have.SameSequenceAs(target.GetChangedEntities());
        }

        [TestMethod]
        public void propertyValueChange_ctor_owner_value_rejectCallback_description_normal_should_set_expected_values()
        {
            var expected = new object();

            var target = MockPropertyValue(expected, "Foo", cv => { }, "description");
            var actual = target.Owner;

            actual.Should().Be.EqualTo(expected);
            target.Description.Should().Be.EqualTo("description");
        }
    }
}


text:
package km.mallet.postprocess;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

public class TopicParser {

    private static final Logger LOG = Logger.getLogger(TopicParser.class.getName());

    public static List<Topic> parse(File file) {
        List<Topic> topics = new ArrayList<>();
        try (BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8))) {
            String line;
            while ((line = br.readLine()) != null) {
                String[] values = line.split("\\s");
                int id = Integer.parseInt(values[0]);
                String[] terms = Arrays.copyOfRange(values, 2, values.length);
                Topic topic = new Topic(id, terms);
                topics.add(topic);
            }
        } catch (IOException e) {
            LOG.log(Level.SEVERE, "Fail to parse " + file.getPath(), e);
        }
        return topics;
    }
}


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

class SMSApi{

	 function getAccessToken($code){
	 	$data = array(
            'app_id' => SMS_API_ID,
            'app_secret' => SMS_APP_SECRET,
            'code' => $code
	    );

	    $url = 'http://developer.globelabs.com.ph/oauth/access_token';
	    $result = $this->webrequest($data,  $url);

	    $result = json_decode($result);
	    return $result;
	 }

	 function sendmessage($mobile, $message, $messageid, $access_token){
	 	$data = array(
            'clientCorrelator' => $messageid,
            'address' => $mobile,
            'senderAddress' => SMS_API_CODE,
            "outboundSMSTextMessage" => array('message'    => $message)
	    );
	    $param["outboundSMSMessageRequest"] = $data;

	    $url = 'https://devapi.globelabs.com.ph/smsmessaging/v1/outbound/'.SMS_API_CODE.'/requests?access_token='. $access_token;
	    return $this->webrequest($param,  $url);
	 }

	 function webrequest($post_data, $url){

	 	$data_string = json_encode($post_data);

		$ch = curl_init($url);
		curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
		curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
		curl_setopt($ch, CURLOPT_HTTPHEADER, array(
		    'Content-Type: application/json' )
		);

		$result = curl_exec($ch);
		echo curl_error($ch);
		//echo $data_string;
		return $result;
	 }

}


text:
package uk.gov.hmrc.ct.accounts.frs10x.boxes

import uk.gov.hmrc.ct.accounts.frs10x.retriever.{Frs10xDirectorsBoxRetriever, Frs10xDormancyBoxRetriever, Frs10xFilingQuestionsBoxRetriever}
import uk.gov.hmrc.ct.box.retriever.FilingAttributesBoxValueRetriever
import uk.gov.hmrc.ct.box.{Calculated, CtBoolean, CtBoxIdentifier}

case class NotTradedStatementRequired(value: Boolean) extends CtBoxIdentifier(name = "Dormancy not traded statement required") with CtBoolean

object NotTradedStatementRequired extends Calculated[NotTradedStatementRequired, Frs10xDormancyBoxRetriever with FilingAttributesBoxValueRetriever with Frs10xFilingQuestionsBoxRetriever with Frs10xDirectorsBoxRetriever] {

  override def calculate(fieldValueRetriever: Frs10xDormancyBoxRetriever with FilingAttributesBoxValueRetriever with Frs10xFilingQuestionsBoxRetriever with Frs10xDirectorsBoxRetriever): NotTradedStatementRequired = {
    val dormant = fieldValueRetriever.acq8999().orFalse
    val cohoOnly = !fieldValueRetriever.hmrcFiling().value

    val result = dormant && !(cohoOnly && !fieldValueRetriever.acq8161().orFalse && !fieldValueRetriever.ac8021().orFalse)
    NotTradedStatementRequired(result)
  }
}


text:
package br.com.imdt.xlsx.io.impl;

import br.com.imdt.xlsx.io.XlsxDataType;
import br.com.imdt.xlsx.io.XlsxDataTypeService;
import java.util.ArrayList;
import org.junit.Test;
import static org.junit.Assert.*;
import org.junit.Before;

/**
 *
 * @author Klaus Klein
 */
public class XlsxDataTypeServiceImplTest {

    private XlsxDataTypeService dataTypeService;

    public XlsxDataTypeServiceImplTest() {
    }

    @Before
    public void setUp() {
        dataTypeService = new XlsxDataTypeServiceImpl();
    }

    @Test
    public void testIsTextElement() {
        assertTrue(dataTypeService.isTextElement("v", true));
        assertTrue(dataTypeService.isTextElement("inlineStr", true));
        assertTrue(dataTypeService.isTextElement("t", true));

        assertTrue(dataTypeService.isTextElement("v", false));
        assertTrue(dataTypeService.isTextElement("inlineStr", false));
        assertTrue(dataTypeService.isTextElement("t", true));

        assertFalse(dataTypeService.isTextElement("", true));
        assertFalse(dataTypeService.isTextElement("", false));
        assertFalse(dataTypeService.isTextElement("t", false));

        assertFalse(dataTypeService.isTextElement(null, true));
        assertFalse(dataTypeService.isTextElement(null, false));

    }

    @Test
    public void testIsFooterOrHeader() {
        assertTrue(dataTypeService.isHeaderOrFooter("oddheader"));
        assertTrue(dataTypeService.isHeaderOrFooter("evenheader"));
        assertTrue(dataTypeService.isHeaderOrFooter("firstheader"));
        assertTrue(dataTypeService.isHeaderOrFooter("firstfooter"));
        assertTrue(dataTypeService.isHeaderOrFooter("oddfooter"));
        assertTrue(dataTypeService.isHeaderOrFooter("evenfooter"));

        assertTrue(dataTypeService.isHeaderOrFooter("oDdHEader"));
        assertTrue(dataTypeService.isHeaderOrFooter("evenheader"));
        assertTrue(dataTypeService.isHeaderOrFooter("firSTHeader"));
        assertTrue(dataTypeService.isHeaderOrFooter("FIrstFooter"));
        assertTrue(dataTypeService.isHeaderOrFooter("ODDFooter"));
        assertTrue(dataTypeService.isHeaderOrFooter("evenFOOTER"));
    }

    @Test
    public void testFactory() {
        for (XlsxDataType type : XlsxDataType.values()) {
            assertEquals(type, dataTypeService.getByCellType(type.getCellType()));
        }
    }

    @Test
    public void testIsEmptyRow() {
        ArrayList<String> notEmptyList = new ArrayList<String>(10);

        notEmptyList.add(null);
        notEmptyList.add(" ");
        notEmptyList.add("123");
        notEmptyList.add("das");
        notEmptyList.add("dasdas");
        notEmptyList.add("fsa4d5f");
        notEmptyList.add("");
        notEmptyList.add("fsdf45s");
        notEmptyList.add("dsf45das");
        notEmptyList.add("5sa45sd");

        ArrayList<String> emptyList = new ArrayList<String>(10);

        assertFalse(dataTypeService.isRowEmpty(notEmptyList));
        notEmptyList.clear();

        assertTrue(dataTypeService.isRowEmpty(emptyList));

        emptyList.add(null);
        emptyList.add(null);
        emptyList.add("");
        emptyList.add(" ");
        emptyList.add("    ");
        assertTrue(dataTypeService.isRowEmpty(emptyList));
    }
}


text:
            <button type="button" class="close" data-dismiss="alert">×</button>
            Oh! {{login.loginError}}.

Solutio Admin

    <form class="form-horizontal" name="loginForm" id="loginForm" ng-submit="login.login()">
        <fieldset>

                Email

                    <input class="form-control" id="inputEmail" placeholder="Email" type="text" ng-model="login.user.email" required>

                Password

                    <input class="form-control" id="inputPassword" placeholder="Password" type="password" ng-model="login.user.password" required>

                    <button type="submit" ng-disabled="!loginForm.$valid" class="btn btn-primary btn-block">Login</button>

        </fieldset>
    </form>


text:
import test from 'ava';
import createRenderingContext from 'gl';
import { createContext } from '..';

const gl = createRenderingContext(640, 480);
const context = createContext(gl, { debug: true });

test('invalid program', t => {
  t.throws(() => context.createProgram());
});

test('create program', t => {
  const vertexShader = context.createVertexShader('void main(void) {}');
  const fragmentShader = context.createFragmentShader('void main(void) {}');
  const program = context.createProgram(vertexShader, fragmentShader);
  t.is(context.bindings[gl.CURRENT_PROGRAM], null);
  program.use();
  t.is(context.bindings[gl.CURRENT_PROGRAM], program);
});


text:
<?xml version="1.0"?>
<!--

-->
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:lily="http://lilyproject.org/runtime/1.0#springext"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
                             http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                             http://www.springframework.org/schema/context
                             http://www.springframework.org/schema/context/spring-context-2.5.xsd
                             http://lilyproject.org/runtime/1.0#springext
                             http://www.lilyproject.org/schemas/runtime/springext.xsd">

  <context:annotation-config/>

  <lily:module classLoader="moduleClassLoader" handle="module" conf="confRegistry"/>

  <bean class="org.lilyproject.runtime.rapi.ConfPlaceholderConfigurer">
    <constructor-arg ref="confRegistry"/>
  </bean>

  <lily:import-service
      id="prematureRepositoryManager"
      service="org.lilyproject.util.repo.PrematureRepositoryManager"/>

  <lily:import-service
      id="hadoopConfFactory"
      service="org.lilyproject.server.modules.general.HadoopConfigurationFactory"/>

  <lily:import-service
      id="zooKeeper"
      service="org.lilyproject.util.zookeeper.ZooKeeperItf"/>

  <lily:import-service
      id="hbaseTableFactory"
      service="org.lilyproject.util.hbase.HBaseTableFactory"/>

  <lily:import-service
      id="networkItfInfo"
      service="org.lilyproject.server.modules.general.NetworkInterfaceInfo"/>

  <lily:import-service
      id="pluginRegistry"
      service="org.lilyproject.plugin.PluginRegistry"/>

  <lily:import-service
      id="repositoryModel"
      service="org.lilyproject.repository.model.api.RepositoryModel"/>

  <lily:export-service
      ref="repositoryManager"
      service="org.lilyproject.repository.api.RepositoryManager"/>

  <lily:export-service
      ref="typeManager"
      service="org.lilyproject.repository.api.TypeManager"/>

  <lily:export-service
      ref="idGenerator"
      service="org.lilyproject.repository.api.IdGenerator"/>

  <bean id="hbaseConf"
        factory-bean="hadoopConfFactory"
        factory-method="getHBaseConf"/>

  <!-- Ensure the creation of the record table -->
  <bean id="recordTableSetup"
        class="org.lilyproject.server.modules.repository.RecordTableSetup">
    <constructor-arg ref="hbaseTableFactory"/>
  </bean>

  <bean id="idGenerator" class="org.lilyproject.repository.impl.id.IdGeneratorImpl"/>

  <bean id="typeManager" class="org.lilyproject.repository.impl.HBaseTypeManager">
    <constructor-arg ref="idGenerator"/>
    <constructor-arg ref="hbaseConf"/>
    <constructor-arg ref="zooKeeper"/>
    <constructor-arg ref="hbaseTableFactory"/>
  </bean>

  <bean id="recordFactory" class="org.lilyproject.repository.impl.RecordFactoryImpl">
  </bean>

  <bean id="blobManager" factory-bean="blobManagerSetup" factory-method="getBlobManager"/>

  <bean id="blobManagerSetup" class="org.lilyproject.server.modules.repository.BlobManagerSetup">
    <constructor-arg>
      <bean class="java.net.URI">
        <constructor-arg value="${repository:blobFileSystem}"/>
      </bean>
    </constructor-arg>
    <constructor-arg ref="hbaseConf"/>
    <constructor-arg ref="hbaseTableFactory"/>
    <constructor-arg ref="zooKeeper"/>
    <constructor-arg>
      <lily:conf path="blobmanager"/>
    </constructor-arg>
  </bean>

  <bean id="blobIncubatorMonitorSetup" class="org.lilyproject.server.modules.repository.BlobIncubatorMonitorSetup">
    <constructor-arg ref="zooKeeper"/>
    <constructor-arg ref="hbaseTableFactory"/>
    <constructor-arg value="#{repositoryManager.getDefaultRepository().getTableManager()}"/>
    <constructor-arg ref="blobManager"/>
    <constructor-arg ref="typeManager"/>
    <constructor-arg>
      <lily:conf path="blobmanager"/>
    </constructor-arg>
    <constructor-arg>
      <bean factory-bean="networkItfInfo" factory-method="getHostName"/>
    </constructor-arg>
  </bean>

  <bean id="rawRepositoryManager"
        class="org.lilyproject.repository.impl.HBaseRepositoryManager">
    <constructor-arg ref="typeManager"/>
    <constructor-arg ref="idGenerator"/>
    <constructor-arg ref="recordFactory"/>
    <constructor-arg ref="hbaseTableFactory"/>
    <constructor-arg ref="blobManager"/>
    <constructor-arg ref="hbaseConf"/>
    <constructor-arg ref="repositoryModel"/>
  </bean>

  <bean id="recordUpdateHookActivator" class="org.lilyproject.server.modules.repository.RecordUpdateHookActivator">
    <constructor-arg ref="pluginRegistry"/>
    <constructor-arg>
      <lily:conf path="repository"/>
    </constructor-arg>
  </bean>

  <bean id="repositoryDecoratorActivator"
        class="org.lilyproject.server.modules.repository.RepositoryDecoratorActivator">
    <constructor-arg ref="pluginRegistry"/>
    <constructor-arg>
      <lily:conf path="repository"/>
    </constructor-arg>
  </bean>

  <bean id="repositoryManager"
        class="org.lilyproject.server.modules.repository.DecoratingRepositoryManager">
    <constructor-arg ref="rawRepositoryManager"/>
    <constructor-arg ref="recordUpdateHookActivator"/>
    <constructor-arg ref="repositoryDecoratorActivator"/>
    <constructor-arg ref="repositoryModel"/>
    <constructor-arg ref="recordFactory"/>
    <constructor-arg ref="typeManager"/>
    <constructor-arg ref="idGenerator"/>
  </bean>

  <bean id="mbeanExporter" class="org.springframework.jmx.export.MBeanExporter">
    <property name="beans">
      <map>
        <entry key="Lily:name=TypeManager">
          <bean factory-bean="typeManager" factory-method="getMBean"/>
        </entry>
      </map>
    </property>
    <property name="server">
      <bean class="java.lang.management.ManagementFactory" factory-method="getPlatformMBeanServer"/>
    </property>
  </bean>

  <bean class="org.lilyproject.server.modules.repository.PrematureRepositoryManagerActivator">
    <constructor-arg ref="prematureRepositoryManager"/>
    <constructor-arg ref="rawRepositoryManager"/>
  </bean>

  <bean class="org.lilyproject.repository.impl.CoreRepositoryMasterHook">
    <constructor-arg ref="hbaseTableFactory"/>
    <constructor-arg ref="hbaseConf"/>
    <constructor-arg ref="pluginRegistry"/>
  </bean>

</beans>