text:
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Text;
using FirebirdSql.Data.FirebirdClient;

namespace Artem.Data.Access.Providers {

    /// <summary>
    /// A database provider for Firebird.
    /// </summary>
    public class FbDataProvider : DataProvider {

        #region Static Fields ///////////////////////////////////////////////////////////

        /// <summary>
        ///
        /// </summary>
        public const string DefaultName = "FbDataProvider";

        #endregion

        #region Properties //////////////////////////////////////////////////////////////

        /// <summary>
        ///
        /// </summary>
        public override string Name {
            get {
                return (base.Name != null) ? base.Name : DefaultName;
            }
        }
        #endregion

        //#region Construct ///////////////////////////////////////////////////////////////

        ///// <summary>
        /////
        ///// </summary>
        //public FbDataProvider()
        //    : base("FirebirdSql.Data.FirebirdClient",
        //    "FbConnection", "FbCommand", "FbDataAdapter", "FbParameter") {
        //}
        //#endregion

        #region Methods /////////////////////////////////////////////////////////////////

        /// <summary>
        ///
        /// </summary>
        /// <param name="commandText"></param>
        /// <param name="commandType"></param>
        /// <param name="connection"></param>
        /// <param name="transaction"></param>
        /// <returns></returns>
        public override System.Data.IDbCommand CreateCommand(
            string commandText, CommandType commandType, IDbConnection connection, IDbTransaction transaction) {

            ProvidersHelper.CheckConnection(connection, typeof(FbConnection));
            if (transaction != null) {
                ProvidersHelper.CheckTransaction(transaction, typeof(FbTransaction));
            }
            FbCommand __command = new FbCommand(commandText, (FbConnection)connection);
            __command.CommandType = commandType;
            if (transaction != null) {
                __command.Transaction = (FbTransaction)transaction;
            }
            return __command;
        }

        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override System.Data.IDbConnection CreateConnection() {

            return new FbConnection();
        }

        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override System.Data.IDbDataAdapter CreateDataAdapter() {

            return new FbDataAdapter();
        }

        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override System.Data.IDbDataParameter CreateParameter() {

            return new FbParameter();
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="name"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public override System.Data.IDbDataParameter CreateParameter(string name, object value) {

            return new FbParameter(name, value);
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="name"></param>
        /// <param name="dbType"></param>
        /// <param name="direction"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public override System.Data.IDbDataParameter CreateParameter(
            string name, int dbType, System.Data.ParameterDirection direction, object value) {

            FbParameter __parameter = new FbParameter(name, (SqlDbType)dbType);
            __parameter.Direction = direction;
            __parameter.Value = value;
            return __parameter;
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="name"></param>
        /// <param name="dbType"></param>
        /// <param name="direction"></param>
        /// <param name="size"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public override System.Data.IDbDataParameter CreateParameter(
            string name, int dbType, System.Data.ParameterDirection direction, int size, object value) {

            FbParameter __parameter = new FbParameter(name, (FbDbType)dbType, size);
            __parameter.Direction = direction;
            __parameter.Value = value;
            return __parameter;
        }
        #endregion
    }
}
#endif


text:
<?php

namespace Iniaf\Bundle\CertificacionBundle\Form;

use Doctrine\Common\Cache\ZendDataCache;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class HojaInspeccionType extends AbstractType
{
        /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('fechaInspeccion', 'text', array(
                'attr'  => array(
                    'onkeyup'=>'javascript:this.value=this.value.toUpperCase();',
                    'class' => 'form-control'
                )
            ))
            ->add('numeroInspeccion', 'text', array(
                'attr'  => array(
                    'onkeyup'=>'javascript:this.value=this.value.toUpperCase();',
                    'class' => 'form-control'
                )
            ))
            ->add('nombreLugar', 'text', array(
                'attr'  => array(
                    'onkeyup'=>'javascript:this.value=this.value.toUpperCase();',
                    'class' => 'form-control'
                )
            ))
            ->add('superficie', 'text', array(
                'attr'  => array(
                    'onkeyup'=>'javascript:this.value=this.value.toUpperCase();',
                    'class' => 'form-control'
                )
            ))
            ->add('fechaSiembra', 'text', array(
                'attr'  => array(
                    'onkeyup'=>'javascript:this.value=this.value.toUpperCase();',
                    'class' => 'form-control',
                    'OnFocus'   => 'this.blur()',
                    'disabled'  => '',
                ),
            ))
            ->add('fechaFloracion','text', array(
                'attr'  => array(
                    'onkeyup'=>'javascript:this.value=this.value.toUpperCase();',
                    'class' => 'form-control',
                    'OnFocus'   => 'this.blur()',
                    'disabled'  => '',
                ),
            ))
            ->add('fechaCosecha','text', array(
                'attr'  => array(
                    'onkeyup'=>'javascript:this.value=this.value.toUpperCase();',
                    'class' => 'form-control',
                    'OnFocus'   => 'this.blur()',
                    'disabled'  => '',
                ),

            ))
            ->add('aislamiento', 'choice', array(
                'choices'   =>  array(
                    'SI'    =>  'SI',
                    'NO'    =>  'NO'
                ),
                'attr'  => array(
                    'onkeyup'=>'javascript:this.value=this.value.toUpperCase();',
                    'class' => 'form-control')
            ))
            ->add('poblacionHectarea','text', array(
                'attr'  => array(
                    'onkeyup'=>'javascript:this.value=this.value.toUpperCase();',
                    'class' => 'form-control',
                    'OnFocus'   => 'this.blur()'
                ),
            ))
            ->add('controlMaleza', 'choice', array(
                'choices'   =>  array(
                    'BUENO'     =>  'BUENO',
                    'REGULAR'   =>  'REGULAR',
                    'MALO'      =>  'MALO'
                ),
                'attr'  => array(
                    'onkeyup'=>'javascript:this.value=this.value.toUpperCase();',
                    'class' => 'form-control')
            ))
            ->add('controlInsectos', 'choice', array(
                'choices'   =>  array(
                    'BUENO'     =>  'BUENO',
                    'REGULAR'   =>  'REGULAR',
                    'MALO'      =>  'MALO'
                ),
                'attr'  => array(
                    'onkeyup'=>'javascript:this.value=this.value.toUpperCase();',
                    'class' => 'form-control')
            ))
            ->add('controlEnfermedades', 'choice', array(
                'choices'   =>  array(
                    'BUENO'     =>  'BUENO',
                    'REGULAR'   =>  'REGULAR',
                    'MALO'      =>  'MALO'
                ),
                'attr'  => array(
                    'onkeyup'=>'javascript:this.value=this.value.toUpperCase();',
                    'class' => 'form-control')
            ))
            ->add('estadoGeneral', 'choice', array(
                'choices'   =>  array(
                    'BUENO'     =>  'BUENO',
                    'REGULAR'   =>  'REGULAR',
                    'MALO'      =>  'MALO'
                ),
                'attr'  => array(
                    'onkeyup'=>'javascript:this.value=this.value.toUpperCase();',
                    'class' => 'form-control')
            ))
            ->add('mezclaVarietal', 'text', array(
                'attr'  => array(
                    'onkeyup'=>'javascript:this.value=this.value.toUpperCase();',
                    'class' => 'form-control'
                )
            ))
            ->add('mvpi', 'text', array(
                'attr'  => array(
                    'onkeyup'=>'javascript:this.value=this.value.toUpperCase();',
                    'class' => 'form-control'
                )
            ))
            ->add('papi', 'text', array(
                'attr'  => array(
                    'onkeyup'=>'javascript:this.value=this.value.toUpperCase();',
                    'class' => 'form-control'
                )
            ))
            ->add('cumpleNorma', 'choice', array(
                'choices'   =>  array(
                    'SI'    =>  'SI',
                    'NO'    =>  'NO'
                ),
                'attr'  => array(
                    'onkeyup'=>'javascript:this.value=this.value.toUpperCase();',
                    'class' => 'form-control'
                )
            ))
            ->add('personaIndicaciones', 'text', array(
                'attr'  => array(
                    'onkeyup'=>'javascript:this.value=this.value.toUpperCase();',
                    'class' => 'form-control'
                )
            ))
            ->add('observaciones', 'textarea', array(
                'attr'  => array(
                    'onkeyup'=>'javascript:this.value=this.value.toUpperCase();',
                    'class' => 'form-control'
                )
            ))
            ->add('generacionUtilizada', 'hidden')
            ->add('generacionPretendida', 'hidden')
            ->add('cultivoAnterior', 'text', array(
                'attr'  => array(
                    'onkeyup'=>'javascript:this.value=this.value.toUpperCase();',
                    'class' => 'form-control',
                    'disabled'  => '',
                )
            ))
        ;
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Iniaf\Bundle\CertificacionBundle\Model\InspeccionModel'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'extranet_hojainspeccion';
    }
}

redpajama_set_name: RedPajamaGithub


text:
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
 * @file EprosimaServer.h
 *
 */

#ifndef EPROSIMASERVER_H_
#define EPROSIMASERVER_H_

#include "ClientServerTypes.h"

#include "fastrtps/fastrtps_fwd.h"
#include "fastrtps/subscriber/SampleInfo.h"

#include "fastrtps/publisher/PublisherListener.h"
#include "fastrtps/subscriber/SubscriberListener.h"

class EprosimaServer {
	friend class OperationListener;
	friend class ResultListener;
public:
	EprosimaServer();
	virtual ~EprosimaServer();
	bool init();
	//Serve indefinitely.
	void serve();
	//Serve for samples operations.
	void serve(uint32_t samples);
private:
	eprosima::fastrtps::Subscriber* mp_operation_sub;
	eprosima::fastrtps::Publisher* mp_result_pub;
	eprosima::fastrtps::Participant* mp_participant;
	clientserver::Result::RESULTTYPE calculate(clientserver::Operation::OPERATIONTYPE type, int32_t num1,int32_t num2,int32_t* result);
	clientserver::ResultDataType* mp_resultdatatype;
	clientserver::OperationDataType* mp_operationdatatype;
public:
	uint32_t m_n_served;
	class OperationListener:public eprosima::fastrtps::SubscriberListener
	{
	public:
		OperationListener(EprosimaServer* up):mp_up(up){}
		~OperationListener(){}
		EprosimaServer* mp_up;
        void onNewDataMessage(eprosima::fastrtps::Subscriber*sub);
        clientserver::Operation m_operation;
		eprosima::fastrtps::SampleInfo_t m_sampleInfo;
		clientserver::Result m_result;
	}m_operationsListener;

    class ResultListener: public eprosima::fastrtps::PublisherListener
	{
	public:
        ResultListener(EprosimaServer* up):mp_up(up){}
		~ResultListener(){}
		EprosimaServer* mp_up;
	}m_resultsListener;
};

#endif /* EPROSIMASERVER_H_ */


text:
/*!
 * \file
 * \brief EGL Test Case
 *//*--------------------------------------------------------------------*/

#include "teglTestCase.hpp"

#include "tcuPlatform.hpp"

#include "egluUtil.hpp"
#include "egluGLFunctionLoader.hpp"
#include "egluPlatform.hpp"

#include "gluRenderContext.hpp"
#include "glwInitFunctions.hpp"

#include <set>

using std::vector;
using std::set;

namespace deqp
{
namespace egl
{

namespace
{

void split (std::vector<std::string>& dst, const std::string& src)
{
	size_t start = 0;
	size_t end	 = std::string::npos;

	while ((end = src.find(' ', start)) != std::string::npos)
	{
		dst.push_back(src.substr(start, end-start));
		start = end+1;
	}

	if (start < end)
		dst.push_back(src.substr(start, end-start));
}

EGLint parseAPI (const std::string& api)
{
	if (api == "OpenGL")
		return EGL_OPENGL_API;
	else if (api == "OpenGL_ES")
		return EGL_OPENGL_ES_API;
	else if (api == "OpenVG")
		return EGL_OPENVG_API;
	else
	{
		tcu::print("Warning: Unknown API '%s'", api.c_str());
		return 0;
	}
}

} // anonymous

EglTestContext::EglTestContext (tcu::TestContext& testCtx, const eglu::NativeDisplayFactory& displayFactory, const eglu::NativeWindowFactory* windowFactory, const eglu::NativePixmapFactory* pixmapFactory)
	: m_testCtx					(testCtx)
	, m_displayFactory			(displayFactory)
	, m_windowFactory			(windowFactory)
	, m_pixmapFactory			(pixmapFactory)
	, m_defaultNativeDisplay	(DE_NULL)
	, m_defaultEGLDisplay		(DE_NULL)
{
	// Temporarily allocate default display for storing config list
	try
	{
		EGLDisplay	eglDisplay	= EGL_NO_DISPLAY;
		EGLint		majorVersion;
		EGLint		minorVersion;

		m_defaultNativeDisplay	= m_displayFactory.createDisplay();

		eglDisplay = eglu::getDisplay(*m_defaultNativeDisplay);
		TCU_CHECK_EGL_CALL(eglInitialize(eglDisplay, &majorVersion, &minorVersion));

		m_defaultEGLDisplay = new tcu::egl::Display(eglDisplay, majorVersion, minorVersion);

		// Create config list
		{
			vector<EGLConfig>	configs;
			set<EGLint>			idSet; // For checking for duplicate config IDs

			m_defaultEGLDisplay->getConfigs(configs);

			m_configs.resize(configs.size());
			for (int ndx = 0; ndx < (int)configs.size(); ndx++)
			{
				m_defaultEGLDisplay->describeConfig(configs[ndx], m_configs[ndx]);

				EGLint id = m_configs[ndx].configId;
				if (idSet.find(id) != idSet.end())
					tcu::print("Warning: Duplicate config ID %d\n", id);
				idSet.insert(id);
			}
		}

		// Query supported APIs
		{
			const char*					clientAPIs	= eglQueryString(eglDisplay, EGL_CLIENT_APIS);
			std::vector<std::string>	apis;
			TCU_CHECK(clientAPIs);

			split(apis, clientAPIs);
			for (std::vector<std::string>::const_iterator apiIter = apis.begin(); apiIter != apis.end(); apiIter++)
			{
				EGLint parsedAPI = parseAPI(*apiIter);
				if (parsedAPI != 0)
					m_supportedAPIs.insert(parsedAPI);
			}
		}

		delete m_defaultEGLDisplay;
		m_defaultEGLDisplay = DE_NULL;
		delete m_defaultNativeDisplay;
		m_defaultNativeDisplay = DE_NULL;
	}
	catch (...)
	{
		delete m_defaultEGLDisplay;
		m_defaultEGLDisplay = DE_NULL;
		delete m_defaultNativeDisplay;
		m_defaultNativeDisplay = DE_NULL;
		throw;
	}
}

EglTestContext::~EglTestContext (void)
{
	for (GLLibraryMap::iterator iter = m_glLibraries.begin(); iter != m_glLibraries.end(); ++iter)
		delete iter->second;

	delete m_defaultEGLDisplay;
	delete m_defaultNativeDisplay;
}

void EglTestContext::createDefaultDisplay (void)
{
	EGLDisplay	eglDisplay	= EGL_NO_DISPLAY;
	EGLint		majorVersion;
	EGLint		minorVersion;

	DE_ASSERT(!m_defaultEGLDisplay);
	DE_ASSERT(!m_defaultNativeDisplay);

	try
	{
		m_defaultNativeDisplay	= m_displayFactory.createDisplay();

		eglDisplay = eglu::getDisplay(*m_defaultNativeDisplay);
		TCU_CHECK_EGL_CALL(eglInitialize(eglDisplay, &majorVersion, &minorVersion));

		m_defaultEGLDisplay = new tcu::egl::Display(eglDisplay, majorVersion, minorVersion);
	}
	catch (const std::exception&)
	{
		delete m_defaultEGLDisplay;
		m_defaultEGLDisplay = DE_NULL;
		delete m_defaultNativeDisplay;
		m_defaultNativeDisplay = DE_NULL;
		throw;
	}
}

const eglu::NativeWindowFactory& EglTestContext::getNativeWindowFactory (void) const
{
	if (m_windowFactory)
		return *m_windowFactory;
	else
		throw tcu::NotSupportedError("No default native window factory available", "", __FILE__, __LINE__);
}

const eglu::NativePixmapFactory& EglTestContext::getNativePixmapFactory (void) const
{
	if (m_pixmapFactory)
		return *m_pixmapFactory;
	else
		throw tcu::NotSupportedError("No default native pixmap factory available", "", __FILE__, __LINE__);
}

void EglTestContext::destroyDefaultDisplay (void)
{
	DE_ASSERT(m_defaultEGLDisplay);
	DE_ASSERT(m_defaultNativeDisplay);

	delete m_defaultEGLDisplay;
	m_defaultEGLDisplay = DE_NULL;

	delete m_defaultNativeDisplay;
	m_defaultNativeDisplay = DE_NULL;
}

eglu::NativeWindow* EglTestContext::createNativeWindow (EGLDisplay display, EGLConfig config, const EGLAttrib* attribList, int width, int height, eglu::WindowParams::Visibility visibility)
{
	if (!m_windowFactory)
		throw tcu::NotSupportedError("Windows not supported", "", __FILE__, __LINE__);

	return m_windowFactory->createWindow(m_defaultNativeDisplay, display, config, attribList, eglu::WindowParams(width, height, visibility));
}

eglu::NativePixmap* EglTestContext::createNativePixmap (EGLDisplay display, EGLConfig config, const EGLAttrib* attribList, int width, int height)
{
	if (!m_pixmapFactory)
		throw tcu::NotSupportedError("Pixmaps not supported", "", __FILE__, __LINE__);

	return m_pixmapFactory->createPixmap(m_defaultNativeDisplay, display, config, attribList, width, height);
}

// \todo [2014-10-06 pyry] Quite hacky, expose ApiType internals?
static deUint32 makeKey (glu::ApiType apiType)
{
	return (apiType.getMajorVersion() << 8) | (apiType.getMinorVersion() << 4) | apiType.getProfile();
}

const tcu::FunctionLibrary* EglTestContext::getGLLibrary (glu::ApiType apiType) const
{
	tcu::FunctionLibrary*		library	= DE_NULL;
	const deUint32				key		= makeKey(apiType);
	GLLibraryMap::iterator		iter	= m_glLibraries.find(key);

	if (iter == m_glLibraries.end())
	{
		library = m_testCtx.getPlatform().getEGLPlatform().createDefaultGLFunctionLibrary(apiType, m_testCtx.getCommandLine());
		m_glLibraries.insert(std::make_pair(key, library));
	}
	else
		library = iter->second;

	return library;
}

deFunctionPtr EglTestContext::getGLFunction (glu::ApiType apiType, const char* name) const
{
	// \todo [2014-03-11 pyry] This requires fall-back to eglGetProcAddress(), right?
	const tcu::FunctionLibrary* const	library	= getGLLibrary(apiType);
	return library->getFunction(name);
}

void EglTestContext::getGLFunctions (glw::Functions& gl, glu::ApiType apiType) const
{
	const tcu::FunctionLibrary* const	library		= getGLLibrary(apiType);
	const eglu::GLFunctionLoader		loader		(library);

	// \note There may not be current context, so we can't use initFunctions().
	glu::initCoreFunctions(&gl, &loader, apiType);
}

TestCaseGroup::TestCaseGroup (EglTestContext& eglTestCtx, const char* name, const char* description)
	: tcu::TestCaseGroup	(eglTestCtx.getTestContext(), name, description)
	, m_eglTestCtx			(eglTestCtx)
{
}

TestCaseGroup::~TestCaseGroup (void)
{
}

TestCase::TestCase (EglTestContext& eglTestCtx, const char* name, const char* description)
	: tcu::TestCase		(eglTestCtx.getTestContext(), name, description)
	, m_eglTestCtx		(eglTestCtx)
{
}

TestCase::TestCase (EglTestContext& eglTestCtx, tcu::TestNodeType type,  const char* name, const char* description)
	: tcu::TestCase		(eglTestCtx.getTestContext(), type, name, description)
	, m_eglTestCtx		(eglTestCtx)
{
}

TestCase::~TestCase (void)
{
}

} // egl
} // deqp


text:
@class NSIndexPath, TNDRPassportActiveUserCell, TNDRPassportPopularLocationCell;

@protocol TNDRPassportPopularLocationCellDelegate <NSObject>
- (void)configureCell:(TNDRPassportActiveUserCell *)arg1 atIndexPath:(NSIndexPath *)arg2 onCell:(TNDRPassportPopularLocationCell *)arg3;
- (int)numberOfActiveUsersForCell:(TNDRPassportPopularLocationCell *)arg1;
- (void)tappedGoToLocationOnCell:(TNDRPassportPopularLocationCell *)arg1;
@end


text:
title: Managing Cloud Foundry
---

* [Monitoring](./monitoring.html)
* [Logging](./logging.html)
* [Managing Users](../../adminguide/uaa-user-management.html)
* [Creating and Modifying Quota Plans](./quota-plans.html)


text:
package itso.rad8.webapps.command;

import java.math.BigDecimal;

import itso.rad80.bank.exception.InvalidAmountException;
import itso.rad80.bank.ifc.Bank;
import itso.rad80.bank.impl.ITSOBank;
import itso.rad80.bank.model.Account;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Withdrawal command. Will perform a withdrawal of the specified amount
 * from the specified account.
 *
 * Parameters:
 *

 *
amount

The amount cents to withdraw

 *
accountId

The account number to withdraw from

 *

 */
public class WithdrawCommand implements Command {

	public void execute(HttpServletRequest req, HttpServletResponse resp)
			throws Exception {
		// Parameters
		String accountId = req.getParameter("accountId");
		String strAmount = req.getParameter("amount");
		BigDecimal amount = null;

		try { amount = new BigDecimal(strAmount); }
		catch (NumberFormatException x) {
			throw new InvalidAmountException(strAmount);
		}

		// Control logic
		Bank bank = ITSOBank.getBank();
		bank.withdraw(accountId, amount);

		// Response
		Account account = bank.searchAccountByAccountNumber(accountId);
		req.setAttribute("account", account);
	}

	public String getForwardView() {
		return "accountDetails.jsp";
	}
}


text:
import collections
import datetime
import enum
import struct
import time
from collections.abc import Sequence

from supriya.system import SupriyaValueObject

from .utils import format_datagram

BUNDLE_PREFIX = b"#bundle\x00"
IMMEDIATELY = struct.pack(">Q", 1)
NTP_TIMESTAMP_TO_SECONDS = 1.0 / 2.0**32.0
SECONDS_TO_NTP_TIMESTAMP = 2.0**32.0
SYSTEM_EPOCH = datetime.date(*time.gmtime(0)[0:3])
NTP_EPOCH = datetime.date(1900, 1, 1)
NTP_DELTA = (SYSTEM_EPOCH - NTP_EPOCH).days * 24 * 3600

class OscMessage(SupriyaValueObject):
    """
    An OSC message.

    ..  container:: example

        ::

            >>> from supriya.osc import OscMessage
            >>> osc_message = OscMessage("/g_new", 0, 0)
            >>> osc_message
            OscMessage('/g_new', 0, 0)

        ::

            >>> datagram = osc_message.to_datagram()
            >>> OscMessage.from_datagram(datagram)
            OscMessage('/g_new', 0, 0)

    ..  container:: example

        ::

            >>> osc_message = OscMessage("/foo", True, [None, [3.25]], OscMessage("/bar"))
            >>> osc_message
            OscMessage('/foo', True, [None, [3.25]], OscMessage('/bar'))

        ::

            >>> datagram = osc_message.to_datagram()
            >>> OscMessage.from_datagram(datagram)
            OscMessage('/foo', True, [None, [3.25]], OscMessage('/bar'))

    ..  container:: example

        ::

            >>> osc_message = supriya.osc.OscMessage(
            ...     "/foo",
            ...     1,
            ...     2.5,
            ...     supriya.osc.OscBundle(
            ...         contents=(
            ...             supriya.osc.OscMessage("/bar", "baz", 3.0),
            ...             supriya.osc.OscMessage("/ffff", False, True, None),
            ...         )
            ...     ),
            ...     ["a", "b", ["c", "d"]],
            ... )
            >>> osc_message
            OscMessage('/foo', 1, 2.5, OscBundle(
                contents=(
                    OscMessage('/bar', 'baz', 3.0),
                    OscMessage('/ffff', False, True, None),
                ),
            ), ['a', 'b', ['c', 'd']])

        ::

            >>> datagram = osc_message.to_datagram()
            >>> OscMessage.from_datagram(datagram)
            OscMessage('/foo', 1, 2.5, OscBundle(
                contents=(
                    OscMessage('/bar', 'baz', 3.0),
                    OscMessage('/ffff', False, True, None),
                ),
            ), ['a', 'b', ['c', 'd']])

    """

    ### CLASS VARIABLES ###

    __slots__ = ("address", "contents")

    ### INITIALIZER ###

    def __init__(self, address, *contents):
        if isinstance(address, enum.Enum):
            address = address.value
        if not isinstance(address, (str, int)):
            raise ValueError(f"address must be int or str, got {address}")
        self.address = address
        self.contents = tuple(contents)

    ### SPECIAL METHODS ###

    def __repr__(self):
        return "{}({})".format(
            type(self).__name__,
            ", ".join(repr(x) for x in (self.address,) + self.contents),
        )

    def __str__(self):
        return format_datagram(bytearray(self.to_datagram()))

    ### PRIVATE METHODS ###

    @staticmethod
    def _decode_blob(data):
        actual_length, remainder = struct.unpack(">I", data[:4])[0], data[4:]
        padded_length = actual_length
        if actual_length % 4 != 0:
            padded_length = (actual_length // 4 + 1) * 4
        return remainder[:padded_length][:actual_length], remainder[padded_length:]

    @staticmethod
    def _decode_string(data):
        actual_length = data.index(b"\x00")
        padded_length = (actual_length // 4 + 1) * 4
        return str(data[:actual_length], "ascii"), data[padded_length:]

    @staticmethod
    def _encode_string(value):
        result = bytes(value + "\x00", "ascii")
        if len(result) % 4 != 0:
            width = (len(result) // 4 + 1) * 4
            result = result.ljust(width, b"\x00")
        return result

    @staticmethod
    def _encode_blob(value):
        result = bytes(struct.pack(">I", len(value)) + value)
        if len(result) % 4 != 0:
            width = (len(result) // 4 + 1) * 4
            result = result.ljust(width, b"\x00")
        return result

    @classmethod
    def _encode_value(cls, value):
        if hasattr(value, "to_datagram"):
            value = bytearray(value.to_datagram())
        elif isinstance(value, enum.Enum):
            value = value.value
        type_tags, encoded_value = "", b""
        if isinstance(value, (bytearray, bytes)):
            type_tags += "b"
            encoded_value = cls._encode_blob(value)
        elif isinstance(value, str):
            type_tags += "s"
            encoded_value = cls._encode_string(value)
        elif isinstance(value, bool):
            type_tags += "T" if value else "F"
        elif isinstance(value, float):
            type_tags += "f"
            encoded_value += struct.pack(">f", value)
        elif isinstance(value, int):
            type_tags += "i"
            encoded_value += struct.pack(">i", value)
        elif value is None:
            type_tags += "N"
        elif isinstance(value, Sequence):
            type_tags += "["
            for sub_value in value:
                sub_type_tags, sub_encoded_value = cls._encode_value(sub_value)
                type_tags += sub_type_tags
                encoded_value += sub_encoded_value
            type_tags += "]"
        else:
            message = "Cannot encode {!r}".format(value)
            raise TypeError(message)
        return type_tags, encoded_value

    ### PUBLIC METHODS ###

    def to_datagram(self):
        # address can be a string or (in SuperCollider) an int
        if isinstance(self.address, str):
            encoded_address = self._encode_string(self.address)
        else:
            encoded_address = struct.pack(">i", self.address)
        encoded_type_tags = ","
        encoded_contents = b""
        for value in self.contents or ():
            type_tags, encoded_value = self._encode_value(value)
            encoded_type_tags += type_tags
            encoded_contents += encoded_value
        return (
            encoded_address + self._encode_string(encoded_type_tags) + encoded_contents
        )

    @classmethod
    def from_datagram(cls, datagram):
        remainder = datagram
        address, remainder = cls._decode_string(remainder)
        type_tags, remainder = cls._decode_string(remainder)
        contents = []
        array_stack = [contents]
        for type_tag in type_tags[1:]:
            if type_tag == "i":
                value, remainder = struct.unpack(">i", remainder[:4])[0], remainder[4:]
                array_stack[-1].append(value)
            elif type_tag == "f":
                value, remainder = struct.unpack(">f", remainder[:4])[0], remainder[4:]
                array_stack[-1].append(value)
            elif type_tag == "d":
                value, remainder = struct.unpack(">d", remainder[:8])[0], remainder[8:]
                array_stack[-1].append(value)
            elif type_tag == "s":
                value, remainder = cls._decode_string(remainder)
                array_stack[-1].append(value)
            elif type_tag == "b":
                value, remainder = cls._decode_blob(remainder)
                for class_ in (OscBundle, OscMessage):
                    try:
                        value = class_.from_datagram(value)
                        break
                    except Exception:
                        pass
                array_stack[-1].append(value)
            elif type_tag == "T":
                array_stack[-1].append(True)
            elif type_tag == "F":
                array_stack[-1].append(False)
            elif type_tag == "N":
                array_stack[-1].append(None)
            elif type_tag == "[":
                array = []
                array_stack[-1].append(array)
                array_stack.append(array)
            elif type_tag == "]":
                array_stack.pop()
            else:
                raise RuntimeError(f"Unable to parse type {type_tag!r}")
        return cls(address, *contents)

    def to_list(self):
        result = [self.address]
        for x in self.contents:
            if hasattr(x, "to_list"):
                result.append(x.to_list())
            else:
                result.append(x)
        return result

class OscBundle(SupriyaValueObject):
    """
    An OSC bundle.

    ::

        >>> import supriya.osc
        >>> message_one = supriya.osc.OscMessage("/one", 1)
        >>> message_two = supriya.osc.OscMessage("/two", 2)
        >>> message_three = supriya.osc.OscMessage("/three", 3)

    ::

        >>> inner_bundle = supriya.osc.OscBundle(
        ...     timestamp=1401557034.5,
        ...     contents=(message_one, message_two),
        ... )
        >>> inner_bundle
        OscBundle(
            contents=(
                OscMessage('/one', 1),
                OscMessage('/two', 2),
            ),
            timestamp=1401557034.5,
        )

    ::

        >>> outer_bundle = supriya.osc.OscBundle(
        ...     contents=(inner_bundle, message_three),
        ... )
        >>> outer_bundle
        OscBundle(
            contents=(
                OscBundle(
                    contents=(
                        OscMessage('/one', 1),
                        OscMessage('/two', 2),
                    ),
                    timestamp=1401557034.5,
                ),
                OscMessage('/three', 3),
            ),
        )

    ::

        >>> datagram = outer_bundle.to_datagram()

    ::

        >>> decoded_bundle = supriya.osc.OscBundle.from_datagram(datagram)
        >>> decoded_bundle
        OscBundle(
            contents=(
                OscBundle(
                    contents=(
                        OscMessage('/one', 1),
                        OscMessage('/two', 2),
                    ),
                    timestamp=1401557034.5,
                ),
                OscMessage('/three', 3),
            ),
        )

    ::

        >>> decoded_bundle == outer_bundle
        True

    """

    ### CLASS VARIABLES ###

    __slots__ = ("contents", "timestamp")

    ### INITIALIZER ###

    def __init__(self, timestamp=None, contents=None):
        prototype = (OscMessage, type(self))
        self.timestamp = timestamp
        contents = contents or ()
        for x in contents or ():
            if not isinstance(x, prototype):
                raise ValueError(contents)
        self.contents = tuple(contents)

    ### SPECIAL METHODS ###

    def __str__(self):
        return format_datagram(bytearray(self.to_datagram()))

    ### PRIVATE METHODS ###

    @staticmethod
    def _decode_date(data):
        data, remainder = data[:8], data[8:]
        if data == IMMEDIATELY:
            return None, remainder
        date = (struct.unpack(">Q", data)[0] / SECONDS_TO_NTP_TIMESTAMP) - NTP_DELTA
        return date, remainder

    @staticmethod
    def _encode_date(seconds, realtime=True):
        if seconds is None:
            return IMMEDIATELY
        if realtime:
            seconds = seconds + NTP_DELTA
        if seconds >= 4294967296:  # 2**32
            seconds = seconds % 4294967296
        return struct.pack(">Q", int(seconds * SECONDS_TO_NTP_TIMESTAMP))

    ### PUBLIC METHODS ###

    @classmethod
    def from_datagram(cls, datagram):
        if not datagram.startswith(BUNDLE_PREFIX):
            raise ValueError("datagram is not a bundle")
        remainder = datagram[8:]
        timestamp, remainder = cls._decode_date(remainder)
        contents = []
        while len(remainder):
            length, remainder = struct.unpack(">i", remainder[:4])[0], remainder[4:]
            if remainder.startswith(BUNDLE_PREFIX):
                item = cls.from_datagram(remainder[:length])
            else:
                item = OscMessage.from_datagram(remainder[:length])
            contents.append(item)
            remainder = remainder[length:]
        osc_bundle = cls(timestamp=timestamp, contents=tuple(contents))
        return osc_bundle

    @classmethod
    def partition(cls, messages, timestamp=None):
        bundles = []
        contents = []
        message = collections.deque(messages)
        remaining = maximum = 8192 - len(BUNDLE_PREFIX) - 4
        while messages:
            message = messages.popleft()
            datagram = message.to_datagram()
            remaining -= len(datagram) + 4
            if remaining > 0:
                contents.append(message)
            else:
                bundles.append(cls(timestamp=timestamp, contents=contents))
                contents = [message]
                remaining = maximum
        if contents:
            bundles.append(cls(timestamp=timestamp, contents=contents))
        return bundles

    def to_datagram(self, realtime=True):
        datagram = BUNDLE_PREFIX
        datagram += self._encode_date(self.timestamp, realtime=realtime)
        for content in self.contents:
            content_datagram = content.to_datagram()
            datagram += struct.pack(">i", len(content_datagram))
            datagram += content_datagram
        return datagram

    def to_list(self):
        result = [self.timestamp]
        result.append([x.to_list() for x in self.contents])
        return result


text:
<?php

namespace Core
{
	class CoreException extends \Core\Exception
	{
		public function __construct($msg = 'A system error has occured.')
		{
			parent::__construct($msg);
		}
	}
}


text:
function [tfr,t,f] = tfrpage(x,t,N,trace);
%TFRPAGE Page time-frequency distribution.
%	[TFR,T,F]=TFRPAGE(X,T,N,TRACE) computes the Page distribution
%	of a discrete-time signal X,
%	or the cross Page representation between two signals.
%
%	X     : signal if auto-Page, or [X1,X2] if cross-Page.
%	T     : time instant(s).
%	N     : number of frequency bins  (default : length(X)).
%	TRACE : if nonzero, the progression of the algorithm is shown
%	                                  (default : 0).
%	TFR   : time-frequency representation. When called without
%               output arguments, TFRPAGE runs TFRQVIEW.
%	F     : vector of normalized frequencies.
%
%	Example :
%	 sig=fmlin(128,0.1,0.4); tfrpage(sig);
%
%	See also all the time-frequency representations listed in
%	 the file CONTENTS (TFR*)

%	F. Auger, May-August 1994, July 1995.
%	Copyright (c) 1996 by CNRS (France).
%
%  This program is free software; you can redistribute it and/or modify
%  it under the terms of the GNU General Public License as published by
%  the Free Software Foundation; either version 2 of the License, or
%  (at your option) any later version.
%
%  This program is distributed in the hope that it will be useful,
%  but WITHOUT ANY WARRANTY; without even the implied warranty of
%  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%  GNU General Public License for more details.
%
%  You should have received a copy of the GNU General Public License
%  along with this program; if not, write to the Free Software
%  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

[xrow,xcol] = size(x);
if (nargin < 1),
 error('At least 1 parameter is required');
elseif (nargin == 1),
 t=1:xrow; N=xrow; trace=0;
elseif (nargin == 2),
 N=xrow; trace=0;
elseif (nargin == 3),
 trace = 0;
end;

if (N<0),
 error('N must be greater than zero');
end;
[trow,tcol] = size(t);
if (xcol==0) | (xcol>2),
 error('X must have one or two columns');
elseif (trow~=1),
 error('T must only have one row');
elseif (rem(log(N)/log(2),1)~=0),
 fprintf('For a faster computation, N should be a power of two\n');
end;

tfr= zeros (N,tcol) ;
if trace, disp('Page distribution'); end;
for icol=1:tcol,
 ti=t(icol); tau=-min([N-ti,xrow-ti]):(ti-1);
 indices=rem(N+tau,N)+1;
 if trace, disprog(icol,tcol,10); end;
 tfr(indices,icol)= x(ti,1)*conj(x(ti-tau,xcol));
end;
if trace, fprintf('\n'); end;
tfr= real(fft(tfr));

if (nargout==0),
 tfrqview(tfr,x,t,'tfrpage');
elseif (nargout==3),
 if rem(N,2)==0,
  f=[0:N/2-1 -N/2:-1]'/N;
 else
  f=[0:(N-1)/2 -(N-1)/2:-1]'/N;
 end;
end;


text:
import webiopi
from twoscriptscommon import VALUES

# Enable debug output
webiopi.setDebug()

# Called by WebIOPi at script loading
def setup():
    VALUES['b'] = 'bbbbb'  # Optional, show initialisation
    print(VALUES)

# Macros
@webiopi.macro
def setNamedValueTwo(someName, someValue):
    print('Setting in script two:')
    print(someName)
    print(someValue)
    VALUES[someName] = someValue
    print(VALUES)

@webiopi.macro
def getNamedValueTwo(someName):
    print('Getting in script two:')
    if someName in VALUES:
        return VALUES[someName]
    else:
        return 'Name %s is n/a.' % someName

@webiopi.macro
def useNamedValueTwo(someName):
    print('Using in script two:')
    if someName in VALUES:
        val = VALUES[someName]
        VALUES[someName] = val + val
        print(VALUES)
    else:
        return 'Using name %s is not possible.' % someName


text:
echo ""
echo "Updating the system..."
echo ""

apt-get update
apt-get -y upgrade

echo ""
echo "Installing prerequisites..."
echo ""

apt-get -y install curl gcc make g++ openssl libssl-dev libpcre3-dev

echo ""
echo "Zlib installation..."
echo ""

curl -O http://zlib.net/zlib-1.2.8.tar.gz
tar -xzf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure
make
make install
cd ..
rm -rf zlib-1.2.8 zlib-1.2.8.tar.gz

echo ""
echo "Nginx installation..."
echo ""

curl -O http://nginx.org/download/nginx-1.6.2.tar.gz
tar -xzf nginx-1.6.2.tar.gz
cd nginx-1.6.2
./configure --user=www-data --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_gzip_static_module --with-http_stub_status_module --with-http_ssl_module --with-pcre --with-file-aio --with-http_realip_module --with-http_spdy_module --without-http_scgi_module --without-http_uwsgi_module --without-http_fastcgi_module
make
make install
cd ..
rm -rf nginx-1.6.2 nginx-1.6.2.tar.gz

echo ""
echo "Copying Nginx script..."
echo ""
cat $PWD/nginx.script > /etc/init.d/nginx
chmod +x /etc/init.d/nginx

echo ""
echo "Cleaning up..."
echo ""

apt-get -y remove curl gcc make g++
apt-get -y autoremove

echo ""
echo "Done!"
echo "You can try 'service nginx start' or 'service nginx status' now."
echo ""


text:
package org.jasig.schedassist.portlet;

import org.jasig.schedassist.model.IScheduleVisitor;

/**
 * Simple interface for representing a schedule visitor in the portlet,
 * where the full {@link IScheduleVisitor} is not needed/constructable.
 *
 * @author Nicholas Blair
 * @version $Id: IPortletScheduleVisitor.java $
 */
public interface IPortletScheduleVisitor {

	/**
	 * Return a String that uniquely idenfies this visitor in the
	 * remote calendar service.
	 * This could be a username or an email address.
	 *
	 * @return a string that uniquely identifies this visitor.
	 */
	String getAccountId();

	/**
	 *
	 * @return true if this account is eligible for the remote calendar service
	 */
	boolean isEligible();
}


text:
Length
===
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependencies][dependencies-image]][dependencies-url]

> Validates if a value is a specific length.

## Installation

``` bash
$ npm install validate.io-length
```

For use in the browser, use [browserify](https://github.com/substack/node-browserify).

## Usage

``` javascript
var hasLength = require( 'validate.io-length' );
```

#### hasLength( value, length | lower[, upper] )

Validates if a `value` has either a specific `length` or has a `length` between a `lower` bound (inclusive) and an `upper` bound (inclusive).

``` javascript
var value = [ 1, 2, 3 ],
	len = 3,
	lower = 1,
	upper = 7;

var bool = hasLength( value, len );
// returns true

bool = hasLength( value, lower, upper );
// returns true
```

## Notes

This method applies __only__ to `string`, `array`, and `function` value types. For any other types, the method returns `false`.

## Examples

``` javascript
console.log( hasLength( 'beep', 4 ) );
// returns true

console.log( hasLength( 'foo', 2, 10 ) );
// returns true

console.log( hasLength( [1,2,3], 3 ) );
// returns true

console.log( hasLength( [4,5,6], 0, 5 ) );
// returns true

console.log( hasLength( function(a,b,c){}, 3 ) );
// returns true

console.log( hasLength( 'baz', 4 ) );
// returns false

console.log( hasLength( [1,2], 10, 12 ) );
// returns false
```

To run the example code from the top-level application directory,

``` bash
$ node ./examples/index.js
```

## Tests

### Unit

Unit tests use the [Mocha](http://mochajs.org) test framework with [Chai](http://chaijs.com) assertions. To run the tests, execute the following command in the top-level application directory:

``` bash
$ make test
```

All new feature development should have corresponding unit tests to validate correct functionality.

### Test Coverage

This repository uses [Istanbul](https://github.com/gotwarlost/istanbul) as its code coverage tool. To generate a test coverage report, execute the following command in the top-level application directory:

``` bash
$ make test-cov
```

Istanbul creates a `./reports/coverage` directory. To access an HTML version of the report,

``` bash
$ make view-cov
```

---
## License

[MIT license](http://opensource.org/licenses/MIT).

## Copyright

Copyright © 2014. Athan Reines.

[npm-image]: http://img.shields.io/npm/v/validate.io-length.svg
[npm-url]: https://npmjs.org/package/validate.io-length

[travis-image]: http://img.shields.io/travis/validate-io/length/master.svg
[travis-url]: https://travis-ci.org/validate-io/length

[coveralls-image]: https://img.shields.io/coveralls/validate-io/length/master.svg
[coveralls-url]: https://coveralls.io/r/validate-io/length?branch=master

[dependencies-image]: http://img.shields.io/david/validate-io/length.svg
[dependencies-url]: https://david-dm.org/validate-io/length

[dev-dependencies-image]: http://img.shields.io/david/dev/validate-io/length.svg
[dev-dependencies-url]: https://david-dm.org/dev/validate-io/length

[github-issues-image]: http://img.shields.io/github/issues/validate-io/length.svg
[github-issues-url]: https://github.com/validate-io/length/issues


text:
/////////////////////////////////////////////////////////////////////
// File: Character.h
// DSA2 PokemanSafari_M1
// Authors:
//      Ilan Isakov
//		Marty Kurtz
//		Mary Spencer
//
// Description:
//
/////////////////////////////////////////////////////////////////////

#ifndef _CHARACTER_H_
#define _CHARACTER_H_

#include "MyBoundingObjectClass.h"

typedef enum {
	CT_POKEMAN, CT_PLAYER, CT_SPACESHIP
} CHARACTER_TYPE;

class Character : public MyBoundingObjectClass
{
public:
	CHARACTER_TYPE charType;

	/////////////////////////////////////////////////////////////////
	// Constructor
	/////////////////////////////////////////////////////////////////
	Character(CHARACTER_TYPE type, String name,std::vector<vector3> movementPath, std::vector<vector3> a_lVectorList);

	/////////////////////////////////////////////////////////////////
	// Render()
	/////////////////////////////////////////////////////////////////
	void UpdateRender();

	void UpdateLocation();

	//TODO
	//Handle character path, stats updates here?...

private:
	std::vector<vector3> path;
	int currentSeg;
};

#endif   /* _CHARACTER_H_*/


text:
package build

import (
	"archive/zip"
	"bytes"
	"context"
	"io"
	"path/filepath"
	"reflect"
	"strings"
	"sync"

	"github.com/google/gapid/core/app/layout"
	"github.com/google/gapid/core/event"
	"github.com/google/gapid/core/log"
	"github.com/google/gapid/core/os/device"
	"github.com/google/gapid/test/robot/record"
	"github.com/google/gapid/test/robot/search"
	"github.com/google/gapid/test/robot/search/eval"
	"github.com/google/gapid/test/robot/stash"
)

type artifacts struct {
	mu      sync.Mutex
	store   *stash.Client
	ledger  record.Ledger
	entries []*Artifact
	byID    map[string]*Artifact
	onAdd   event.Broadcast
}

func (a *artifacts) init(ctx context.Context, store *stash.Client, library record.Library) error {
	ledger, err := library.Open(ctx, "artifacts", &Artifact{})
	if err != nil {
		return err
	}
	a.store = store
	a.ledger = ledger
	a.byID = map[string]*Artifact{}
	apply := event.AsHandler(ctx, a.apply)
	if err := ledger.Read(ctx, apply); err != nil {
		return err
	}
	ledger.Watch(ctx, apply)
	return nil
}

// apply is called with items coming out of the ledger
// it should be called with the mutation lock already held.
func (a *artifacts) apply(ctx context.Context, artifact *Artifact) error {
	old := a.byID[artifact.Id]
	if old == nil {
		a.entries = append(a.entries, artifact)
		a.byID[artifact.Id] = artifact
	} else {
		*old = *artifact
	}
	a.onAdd.Send(ctx, artifact)
	return nil
}

func (a *artifacts) search(ctx context.Context, query *search.Query, handler ArtifactHandler) error {
	filter := eval.Filter(ctx, query, reflect.TypeOf(&Artifact{}), event.AsHandler(ctx, handler))
	initial := event.AsProducer(ctx, a.entries)
	if query.Monitor {
		return event.Monitor(ctx, &a.mu, a.onAdd.Listen, initial, filter)
	}
	return event.Feed(ctx, filter, initial)
}

type zipEntry struct {
	file *zip.File
	id   string
}

type zipReader struct {
	file *zip.File
	r    io.ReadCloser
}

func (z *zipEntry) Open() (*zipReader, error) {
	r := &zipReader{file: z.file}
	return r, r.Reset()
}

func (z *zipReader) Read(data []byte) (int, error) {
	return z.r.Read(data)
}

func (z *zipReader) Reset() error {
	if err := z.Close(); err != nil {
		return err
	}
	r, err := z.file.Open()
	if err != nil {
		return err
	}
	z.r = r
	return nil
}

func (z *zipReader) Close() error {
	if z.r == nil {
		return nil
	}
	err := z.r.Close()
	z.r = nil
	return err
}

func (z *zipEntry) GetID(ctx context.Context, a *artifacts) string {
	if z.id != "" {
		return z.id
	}
	// we need to upload the content to stash to get an ID
	r, err := z.Open()
	if err != nil {
		return ""
	}
	defer r.Close()
	info := stash.Upload{
		Name:       []string{z.file.Name},
		Executable: z.file.Mode()&0111 != 0,
	}
	id, err := a.store.UploadStream(ctx, info, r)
	if err != nil {
		return ""
	}
	z.id = id
	return z.id
}

func (a *artifacts) get(ctx context.Context, id string, hostABIs []*device.ABI) (*Artifact, error) {
	a.mu.Lock()
	defer a.mu.Unlock()
	if entry := a.byID[id]; entry != nil {
		return entry, nil
	}
	data, err := a.store.Read(ctx, id)
	if err != nil {
		return nil, err
	}
	if len(data) == 0 {
		return nil, log.Err(ctx, nil, "Build not in the stash")
	}
	zipFile, err := zip.NewReader(bytes.NewReader(data), int64(len(data)))
	if err != nil {
		return nil, log.Err(ctx, nil, "File is not a build artifact.")
	}
	if len(hostABIs) != 1 {
		log.W(ctx, "(*artifacts) get() received multiple host ABIs, taking first one. %v", hostABIs[0])
	}
	toolSet := ToolSet{Abi: hostABIs[0], Host: new(HostToolSet)}
	// TODO(baldwinn): move these paths to layout
	toolSetIDByZipEntry := map[string]*string{
		"gapid/gapir":                          &toolSet.Host.Gapir,
		"gapid/gapis":                          &toolSet.Host.Gapis,
		"gapid/gapit":                          &toolSet.Host.Gapit,
		"gapid/libVkLayer_VirtualSwapchain.so": &toolSet.Host.VirtualSwapChainLib,
		"gapid/VirtualSwapchainLayer.json":     &toolSet.Host.VirtualSwapChainJson,
	}
	for _, f := range zipFile.File {
		f.Name = filepath.ToSlash(f.Name)
		z := &zipEntry{file: f}

		if dirs := strings.Split(f.Name, "/"); strings.HasPrefix(dirs[1], "android") {
			androidTool := &AndroidToolSet{Abi: device.ABIByName(layout.DirToBinABI(dirs[1])), GapidApk: z.GetID(ctx, a)}
			toolSet.Android = append(toolSet.Android, androidTool)
		} else if toolID, ok := toolSetIDByZipEntry[f.Name]; ok {
			*toolID = z.GetID(ctx, a)
		}
	}
	entry := &Artifact{Id: id, Tool: &toolSet}
	a.ledger.Add(ctx, entry)
	return entry, nil
}


text:
<!DOCTYPE html>

	<title>

            Landbridge Logistics Ltd. -

    Complete profile - Canadian Company Capabilities - Industries and Business - Industry Canada
  </title>

<meta charset="utf-8" />
<meta name="dcterms.language" title="ISO639-2" content="eng" />
<meta name="dcterms.title" content="" />
<meta name="description" content="" />
<meta name="dcterms.description" content="" />
<meta name="dcterms.type" content="report, data set" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.subject" content="businesses, industry" />
<meta name="dcterms.issued" title="W3CDTF" content="" />
<meta name="dcterms.modified" title="W3CDTF" content="" />
<meta name="keywords" content="" />

<meta name="dcterms.creator" content="" />
<meta name="author" content="" />
<meta name="dcterms.created" title="W3CDTF" content="" />
<meta name="dcterms.publisher" content="" />
<meta name="dcterms.audience" title="icaudience" content="" />
<meta name="dcterms.spatial" title="ISO3166-1" content="" />
<meta name="dcterms.spatial" title="gcgeonames" content="" />
<meta name="dcterms.format" content="HTML" />
<meta name="dcterms.identifier" title="ICsiteProduct" content="536" />

<meta http-equiv="X-UA-Compatible" content="IE=edge">

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

<meta name = "format-detection" content = "telephone=no">

<meta name="robots" content="noarchive">

<link href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/favicon.ico" rel="icon" type="image/x-icon">
<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/wet-boew.min.css">

<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/theme.min.css">

<link rel="stylesheet" href="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/css/noscript.min.css" />

<link rel="stylesheet" href="/eic/home.nsf/css/add_WET_4-0_Canada_Apps.css">

  	<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
  	<link href="/app/ccc/srch/css/print.css" media="print" rel="stylesheet" type="text/css" />

<meta property="legalName" content="Department_of_Industry">

Skip to main content

Skip to "About this site"

Language selection

Français

<object type="image/svg+xml" tabindex="-1" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/sig-blk-en.svg"></object> Government of Canada

Search and menus

Search and menus

Topics menu

Jobs

Immigration

Travel

Business

Benefits

Health

Taxes

More services

You are here:

Home

Industries and Business

Canadian Company Capabilities

<input id="showMore" type="hidden" value='more'/>
<input id="showLess" type="hidden" value='less'/>

 Company profile - Canadian Company Capabilities

New Search |

<form name="searchForm" method="post" action="/app/ccc/srch/bscSrch.do">

          <input type="hidden" name="lang" value="eng" />
          <input type="hidden" name="profileId" value="" />
          <input type="hidden" name="prtl" value="1" />
          <input type="hidden" name="searchPage" value="%2Fapp%2Fccc%2Fsrch%2FcccBscSrch.do%3Flang%3Deng%26amp%3Bprtl%3D1%26amp%3Btagid%3D"  />

          <input type="hidden" name="V_SEARCH.scopeCategory" value="CCC.Root" />

          <input type="hidden" name="V_SEARCH.depth" value="1" />
          <input type="hidden" name="V_SEARCH.showStricts" value="false" />
          <input id="repeatSearchBtn" class="btn btn-link" type="submit" value="Return to search results" />

  </form>

| Previous Company

| Next Company

      Third-Party Information Liability Disclaimer

Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.

      Landbridge Logistics Ltd.

Legal/Operating Name:

Landbridge Logistics Ltd.

http://www.landbridge.ca

info@landbridge.ca

Mailing Address:

              	<address class="mrgn-bttm-md">

                   P.O. Box 34073

                  Cloversquare RPO

                    SURREY,

                    British Columbia

                  V3S 8C4

                </address>

Location Address:

              	         <address class="mrgn-bttm-md">

                   226-18525 53rd Ave

                    SURREY,

                    British Columbia

                  V3S 7A4

                         </address>

Tel.:
		      (604) 542-6002

Tel.:
			      (866) 919-5001

Fax:
		      (604) 542-6004

Logo

Company Profile

            Landbridge Logistics Ltd. is a full-service logistics company. We provide transportation services for all kinds of freight: Road, Rail, Ocean and Air. We are a third party logistics (3PL) provider that has a wealth of industry knowledge and an extensive network of freight carriers. We are fully committed to our customers needs and will go the distance in providing logistics solutions in the quickest possible time and current market pricing.

The decision to choose Landbridge allows your organization to focus on what it does best whether that is product development, manufacturing or customer satisfaction. Finding ways to get your shipment, big or small, from point A to point B, while keeping you in the loop, is what we do best.

At Landbridge, we base our analysis on real time market conditions. It is critical that we educate our customers about current transportation trends and walk them through each shipment from origin to destination. Our logistics team is very well versed with transportation to and from anywhere in North America and Worldwide.

Transportation costs have increased with hikes in fuel prices, tougher regulations on transportation, more stringent security measures at our borders and airports and the fluctuating economy. More and more organizations have come on board knowing that we'll get it done because we are better prepared. At Landbridge, we believe that doing it right the first time will save our customers money. Our expertise enables us to consolidate freight volumes to keep costs lower, while maintaining an unprecedented service level.

				Full profile

				Full profile

				Contact information

                Karen
                Booiman

	                  Title:

  						Business Development

                  Telephone:

                (604) 542-6002

                  Facsimile:

                (604) 542-6004

                    Email:

                  karen@landbridge.ca

                Idongesit (Idy)
                Ema

	                  Title:

  						Operations

                  Telephone:

                (604) 542-6002

                  Facsimile:

                (604) 542-6004

                    Email:

                  Idy@landbridge.ca

  top of page

				Company description

            Country of Ownership:

              Canada

            Exporting:

              Yes

                Primary Industry (NAICS):

				488519 - Other Freight Transportation Arrangement

            Alternate Industries (NAICS):

            488990 - Other Support Activities for Transportation

            Primary Business Activity:

            Services

				Product / Service / Licensing

                              Service Name:

                            Third Party Logistics Services

                            Advancements in technology and the associated increases in supply chain visibility and inter-company communications have given rise to a relatively new model for third-party logistics operations – the "non-asset based logistics provider." Non-asset based providers perform functions such as consultation on packaging and transportation, freight quoting, financial settlement, auditing, tracking, customer service and issue resolution. However, they don't employ any truck drivers or warehouse personnel, and they don't own any physical freight distribution assets of their own – no trucks, no storage trailers, no pallets, and no warehousing. A non-assets based provider consists of a team of domain experts with accumulated freight industry expertise and information technology assets. They fill a role similar to freight agents or brokers, but maintain a significantly greater degree of "hands on" involvement in the transportation of products.

To be useful, this type of provider must show its customers a benefit in financial and operational terms by leveraging exceptional expertise and ability in the areas of operations, negotiations, and customer service in a way that complements its customers' preexisting physical assets.

  top of page

					Third-Party Information Liability Disclaimer

					Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.

				Contacts

				Contact information

                Karen
                Booiman

	                  Title:

  						Business Development

                  Telephone:

                (604) 542-6002

                  Facsimile:

                (604) 542-6004

                    Email:

                  karen@landbridge.ca

                Idongesit (Idy)
                Ema

	                  Title:

  						Operations

                  Telephone:

                (604) 542-6002

                  Facsimile:

                (604) 542-6004

                    Email:

                  Idy@landbridge.ca

				Description

				Company description

            Country of Ownership:

              Canada

            Exporting:

              Yes

                Primary Industry (NAICS):

				488519 - Other Freight Transportation Arrangement

            Alternate Industries (NAICS):

            488990 - Other Support Activities for Transportation

            Primary Business Activity:

            Services

				Products, services and licensing

				Product / Service / Licensing

                              Service Name:

                            Third Party Logistics Services

                            Advancements in technology and the associated increases in supply chain visibility and inter-company communications have given rise to a relatively new model for third-party logistics operations – the "non-asset based logistics provider." Non-asset based providers perform functions such as consultation on packaging and transportation, freight quoting, financial settlement, auditing, tracking, customer service and issue resolution. However, they don't employ any truck drivers or warehouse personnel, and they don't own any physical freight distribution assets of their own – no trucks, no storage trailers, no pallets, and no warehousing. A non-assets based provider consists of a team of domain experts with accumulated freight industry expertise and information technology assets. They fill a role similar to freight agents or brokers, but maintain a significantly greater degree of "hands on" involvement in the transportation of products.

To be useful, this type of provider must show its customers a benefit in financial and operational terms by leveraging exceptional expertise and ability in the areas of operations, negotiations, and customer service in a way that complements its customers' preexisting physical assets.

    Last Update Date 2016-01-04

Date Modified:

      <time>2017-03-02</time>

About government

Contact us

Departments and agencies

Public service and military

News

Treaties, laws and regulations

Government-wide reporting

Prime Minister

How government works

Open government

About this site

Social media

Mobile applications

About Canada.ca

Terms and conditions

Privacy

Top of Page

<object type="image/svg+xml" tabindex="-1" role="img" data="/utils/scripts/_WET_4-0/apps/themes-dist/gcweb/assets/wmms-blk.svg" aria-label="Symbol of the Government of Canada"></object>


text:
package org.apache.solr.update;

import org.apache.solr.request.SolrQueryRequest;

/**
 *
 * @since Solr 1.4
 */
public class RollbackUpdateCommand extends UpdateCommand {

  public RollbackUpdateCommand(SolrQueryRequest req) {
    super(req);
  }

  @Override
  public String name() {
    return "rollback";
  }

  @Override
  public String toString() {
    return super.toString() + '}';
  }
}


text:
void foo(const char* fmt, ...);

struct Bar {
  void foo(const char* fmt, ...);
};


text:
package com.ocpsoft.pretty.faces.el.processor;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import com.ocpsoft.pretty.faces.config.mapping.PathParameter;
import com.ocpsoft.pretty.faces.el.ConstantExpression;

public class NamedInjected implements PathParameterProcessor
{
   private static final String REGEX = "\\#\\{\\s*(\\w+)\\s*:\\s*([\\w\\.]{1,})\\s*\\}";
   public static final Pattern pattern = Pattern.compile(REGEX);

   public PathParameter process(final PathParameter param)
   {
      PathParameter result = param.copy();

      Matcher matcher = pattern.matcher(param.getExpression().getELExpression());
      if (matcher.matches())
      {
         String name = matcher.group(1);
         String el = matcher.group(2);

         result.setExpression(new ConstantExpression("#{" + el + "}"));
         result.setName(name);
         result.setExpressionIsPlainText(false);
      }
      return result;
   }

   public String getRegex()
   {
      return REGEX;
   }
}


text:
import React from 'react'
import { connect } from 'react-redux'
import SortableTree from 'react-sortable-tree'

import 'react-sortable-tree/style.css'

import {
  ancestrySelector,
  updateAncestry
} from 'ducks/ancestry'

import AncestryAppWrap from './styled/AncestryAppWrap'
import SerializedAncestry from './SerializedAncestry'
import AncestryItem from './AncestryItem'

function AncestryApp ({ ancestry, onChange }) {
  const onChangeWithDirty = (treeData) => {
    window.jQuery('.f-c-react-ancestry').trigger('change.folioDirtyForms')
    return onChange(treeData)
  }

  return (
    <AncestryAppWrap>
      <SortableTree
        maxDepth={ancestry.maxNestingDepth}
        rowHeight={80}
        treeData={ancestry.items}
        onChange={onChangeWithDirty}
        isVirtualized={false}
        canDrag={!ancestry.hasInvalid}
        generateNodeProps={({ node, path }) => ({
          title: <AncestryItem node={node} path={path} />
        })}
      />

      <SerializedAncestry ancestry={ancestry} />
    </AncestryAppWrap>
  )
}

const mapStateToProps = (state, props) => ({
  ancestry: ancestrySelector(state)
})

function mapDispatchToProps (dispatch) {
  return {
    onChange: (treeData) => { dispatch(updateAncestry(treeData)) }
  }
}

export default connect(mapStateToProps, mapDispatchToProps)(AncestryApp)


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="com.spigirls.spidevices.database.AccesoBD"
    tools:showIn="@layout/activity_acceso_bd">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="Cargando..."
        android:id="@+id/textView5"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="79dp" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="Espere por favor"
        android:id="@+id/textView6"
        android:layout_below="@+id/textView5"
        android:layout_centerHorizontal="true" />
</RelativeLayout>


text:
AdminUser.create!(:email => 'admin@example.com', :password => 'password', :password_confirmation => 'password')

# Create a default moderators group
Group.create!(:name => 'forum_moderator', :description => 'Модератор форума')
Group.create!(:name => 'comment_moderator', :description => 'Модератор комментариев')


text:
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.sakaiproject</groupId>
        <artifactId>master</artifactId>
        <version>10.4</version>
	<relativePath>../master/pom.xml</relativePath>
    </parent>

    <name>sakai-site-manage base pom</name>
    <groupId>org.sakaiproject.sitemanage</groupId>
    <artifactId>sitemanage</artifactId>
    <version>10.4</version>
    <packaging>pom</packaging>

    <profiles>
        <profile>
            <id>framework</id>
            <modules>
                <module>site-association-api/api</module>
                <module>site-association-hbm/hbm</module>
                <module>site-association-impl/impl</module>
                <module>site-association-impl/pack</module>
                <module>site-association-tool/tool</module>
                <module>site-association-util/util</module>
                <module>site-manage-api/api</module>
                <module>site-manage-hbm</module>
                <module>site-manage-impl/impl</module>
                <module>site-manage-impl/pack</module>
                <module>site-manage-tool/tool</module>
                <module>site-manage-util/util</module>
                <module>site-manage-group-helper/tool</module>
                <module>site-manage-participant-helper</module>
                <module>site-manage-link-helper</module>
            </modules>
        </profile>
        <profile>
            <id>full</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <modules>
                <module>pageorder/tool</module>
                <module>site-association-api/api</module>
                <module>site-association-hbm/hbm</module>
                <module>site-association-impl/impl</module>
                <module>site-association-impl/pack</module>
                <module>site-association-tool/tool</module>
                <module>site-association-util/util</module>
                <module>site-manage-api/api</module>
                <module>site-manage-hbm</module>
                <module>site-manage-impl/impl</module>
                <module>site-manage-impl/pack</module>
                <module>site-manage-tool/tool</module>
                <module>site-manage-util/util</module>
                <module>site-manage-group-helper/tool</module>
                <module>site-manage-group-section-role-helper/tool</module>
                <module>site-manage-group-section-role-helper/pack</module>
                <module>site-manage-participant-helper</module>
                <module>site-manage-link-helper</module>
            </modules>
        </profile>
    </profiles>

    <scm>
        <connection>scm:svn:https://source.sakaiproject.org/svn/site-manage/trunk</connection>
        <developerConnection>scm:svn:https://source.sakaiproject.org/svn/site-manage/trunk</developerConnection>
        <url>https://source.sakaiproject.org/svn/site-manage/trunk</url>
    </scm>

    <distributionManagement>
        <site>
            <id>sakai-site</id>
            <name>Sakai release Site</name>
            <url>scpexe://source.sakaiproject.org/var/www/html/release/site-manage/${project.version}</url>
        </site>
    </distributionManagement>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>sakai-site-manage-api</artifactId>
                <version>${project.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>sakai-site-manage-hbm</artifactId>
                <version>${project.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>sakai-site-manage-impl</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>sakai-site-manage-group-section-role-helper</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>sakai-site-manage-util</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>sakai-siteassociation-api</artifactId>
                <version>${project.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>sakai-siteassociation-hbm</artifactId>
                <version>${project.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>sakai-siteassociation-impl</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>sakai-siteassociation-util</artifactId>
                <version>${project.version}</version>
            </dependency>
	    <dependency>
	      <groupId>net.sf.opencsv</groupId>
	      <artifactId>opencsv</artifactId>
	      <version>2.3</version>
	      <scope>compile</scope>
	    </dependency>
        </dependencies>
    </dependencyManagement>

</project>


text:
import axios from 'axios';

let authToken = {
    getLocalToken () {
        if(!!localStorage.getItem("cnode_accesstoken")) {
            return {
                user_accessToken: localStorage.getItem("cnode_accesstoken"),
                user_avatar: localStorage.getItem("cnode_avatar"),
                user_id: localStorage.getItem("cnode_id"),
                user_name: localStorage.getItem("cnode_name")
            }
        }
        return false;
    },
    setLocalToken (userInfo) {
        localStorage.setItem("cnode_accesstoken", userInfo.accesstoken);
        localStorage.setItem("cnode_avatar", userInfo.avatar);
        localStorage.setItem("cnode_id", userInfo.id);
        localStorage.setItem("cnode_name", userInfo.name);
    },
    delLocalToken () {
        localStorage.removeItem("cnode_accesstoken");
        localStorage.removeItem("cnode_avatar");
        localStorage.removeItem("cnode_id");
        localStorage.removeItem("cnode_name");
    },
    authToken(id) {
        return new Promise((resolve, reject) => {
            axios.post('https://cnodejs.org/api/v1/accesstoken?accesstoken=' + id)
            .then((response) => {
                resolve({
                    status: "success",
                    data: response.data
                });
            })
            .catch((error) => {
                resolve({
                    status: "fail",
                    data: error
                });
            });
        });
    }
}
export default authToken;


text:
require "spec_helper"

describe Flickr::Object::Location do
  let(:it) { described_class.new({}) }
  record_api_methods

  test_attributes do
    api_call "flickr.people.getPhotos",
             "flickr.people.getPhotosOf",
             "flickr.people.getPublicPhotos",
             "flickr.people.getContactsPublicPhotos",
             "flickr.photos.search",
             "flickr.photos.getContactsPhotos",
             "flickr.photos.getNotInSet",
             "flickr.photos.getRecent",
             "flickr.interestingness.getList",
             "flickr.photos.getUntagged",
             "flickr.photos.getWithGeoData",
             "flickr.photos.getWithoutGeoData",
             "flickr.photos.recentlyUpdated",
             "flickr.photosets.getPhotos" do
      object -> { self[0].location },
        %w[latitude longitude accuracy context indoors outdoors]
    end
    api_call "flickr.photos.getInfo" do
      object -> { self.location },
        %w[latitude longitude accuracy context place_id woe_id
           indoors outdoors]
    end
  end
end

describe Flickr::Object::Location::Area do
  let(:it) { described_class.new({}) }
  record_api_methods

  test_attributes do
    api_call "flickr.photos.getInfo" do
      # object -> { self.location.neighbourhood },
      #   %w[name place_id woe_id]
      object -> { self.location.locality },
        %w[name place_id woe_id]
      object -> { self.location.county },
        %w[name place_id woe_id]
      object -> { self.location.region },
        %w[name place_id woe_id]
      object -> { self.location.country },
        %w[name place_id woe_id]
    end
  end
end


text:
package org.apache.hadoop.mapred.lib;

import java.io.IOException;

import org.apache.hadoop.mapred.MapReduceBase;
import org.apache.hadoop.mapred.Mapper;
import org.apache.hadoop.mapred.OutputCollector;
import org.apache.hadoop.mapred.Reporter;

/** A {@link Mapper} that swaps keys and values.
 */
public class InverseMapper<K, V>
    extends MapReduceBase implements Mapper<K, V, V, K> {

  /** The inverse function.  Input keys and values are swapped.*/
  public void map(K key, V value,
                  OutputCollector<V, K> output, Reporter reporter)
    throws IOException {
    output.collect(value, key);
  }

}


text:
package com.streamsets.pipeline.stage.destination.websocket;

import com.streamsets.pipeline.api.ConfigDefBean;
import com.streamsets.pipeline.api.ConfigGroups;
import com.streamsets.pipeline.api.ExecutionMode;
import com.streamsets.pipeline.api.GenerateResourceBundle;
import com.streamsets.pipeline.api.HideConfigs;
import com.streamsets.pipeline.api.StageDef;
import com.streamsets.pipeline.api.Target;
import com.streamsets.pipeline.api.base.configurablestage.DTarget;
import com.streamsets.pipeline.lib.websocket.Groups;

@StageDef(
    version = 3,
    label = "WebSocket Client",
    description = "Uses a WebSocket client to write data",
    icon = "websockets.png",
    recordsByRef = true,
    execution = {
        ExecutionMode.STANDALONE,
        ExecutionMode.CLUSTER_BATCH,
        ExecutionMode.CLUSTER_YARN_STREAMING,
        ExecutionMode.CLUSTER_MESOS_STREAMING,
        ExecutionMode.EDGE,
        ExecutionMode.EMR_BATCH

    },
    onlineHelpRefUrl ="index.html?contextID=task_erb_pjn_lz",
    upgrader = WebSocketTargetUpgrader.class,
    upgraderDef = "upgrader/WebSocketDTarget.yaml"
)
@ConfigGroups(Groups.class)
@HideConfigs({
    "conf.tlsConfig.useRemoteKeyStore",
    "conf.tlsConfig.keyStoreFilePath",
    "conf.tlsConfig.privateKey",
    "conf.tlsConfig.certificateChain",
    "conf.tlsConfig.keyStoreType",
    "conf.tlsConfig.keyStorePassword",
    "conf.tlsConfig.keyStoreAlgorithm"
})
@GenerateResourceBundle
public class WebSocketDTarget extends DTarget {

  @ConfigDefBean
  public WebSocketTargetConfig conf;

  @Override
  protected Target createTarget() {
    return new WebSocketTarget(conf);
  }
}


text:
package turtlecommands;
import objects.Turtle;
import commands.*;

/**
 *
 * @author williamjohnston
 *
 */
public class ShowTurtle extends TurtleCommand {

	public ShowTurtle(Turtle turtle) {
		super(turtle);
		// TODO Auto-generated constructor stub
	}

	@Override
	public double execute() {
		// TODO Auto-generated method stub
		double result = this.myTurtle.showTurtle();
		return result;
	}

}


text:
Transact-SQL - Control Flow
***************************

Case
====

`Select Case Example`_

::

  SELECT name, location,
      CASE
          WHEN(CHARINDEX('unsubscribe', body) > 0)
              THEN 'Unsubscribe'
          WHEN(CHARINDEX('registered successfully', body) > 0)
              THEN 'Registered'
          ELSE
             'Something else...'
      END
      FROM location

::

  CASE WHEN @totalResults > 0 THEN 1 ELSE 0 END AS totalResults

IF, ELSE
========

::

  IF @cost <= @compareprice
  BEGIN
      PRINT 'These products can be purchased for less than '
          + RTRIM(CAST(@compareprice AS varchar(20))) + '.'
  END
  ELSE
  BEGIN
      PRINT 'The prices for all products in this category exceed '
          + RTRIM(CAST(@compareprice AS varchar(20))) + '.'
  END

WHILE
=====

::

  DECLARE @counter INT
  SET @counter = 0
  WHILE @counter < 10
  BEGIN
      SET @counter = @counter + 1
      PRINT 'The counter is ' + CAST(@counter as CHAR)
  END

Note: To break out of a loop, use the ``BREAK`` statement.

.. _`Select Case Example`: http://jackdonnell.com/articles/Sql_Case.htm


text:
<?php

/**
 * commentAdmin module configuration.
 *
 * @package    vjCommentPlugin
 * @subpackage commentAdmin
 * @author     Jean-Philippe MORVAN <jp.morvan@ville-villejuif.fr>
 * @version    SVN: $Id: configuration.php 12474 2008-10-31 10:41:27Z fabien $
 */
class commentAdminGeneratorConfiguration extends BaseCommentAdminGeneratorConfiguration
{

    public function getFilterDefaults()
    {
        return array('is_delete' => 0);
    }

}


text:
<?php

namespace Elasticsearch\Endpoints\Indices\Aliases;

use Elasticsearch\Endpoints\AbstractEndpoint;
use Elasticsearch\Common\Exceptions;

/**
 * Class Update
 *
 * @category Elasticsearch
 * @package  Elasticsearch\Endpoints\Indices\Aliases
 * @author   Zachary Tong <zachary.tong@elasticsearch.com>
 * @license  http://www.apache.org/licenses/LICENSE-2.0 Apache2
 * @link     http://elasticsearch.org
 */
class Update extends AbstractEndpoint
{
    /**
     * @param array $body
     *
     * @throws \Elasticsearch\Common\Exceptions\InvalidArgumentException
     * @return $this
     */
    public function setBody($body)
    {
        if (isset($body) !== true) {
            return $this;
        }

        $this->body = $body;

        return $this;
    }

    /**
     * @return string
     */
    protected function getURI()
    {
        $uri   = "/_aliases";

        return $uri;
    }

    /**
     * @return string[]
     */
    protected function getParamWhitelist()
    {
        return array(
            'timeout',
            'master_timeout',
        );
    }

    /**
     * @return array
     * @throws \Elasticsearch\Common\Exceptions\RuntimeException
     */
    protected function getBody()
    {
        if (isset($this->body) !== true) {
            throw new Exceptions\RuntimeException('Body is required for Update Aliases');
        }

        return $this->body;
    }

    /**
     * @return string
     */
    protected function getMethod()
    {
        return 'POST';
    }
}


text:
package practicaltest02.pdsd.systems.cs.pub.ro.practicaltest02var01;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
 * Testing Fundamentals
 */
public class ApplicationTest extends ApplicationTestCase<Application> {
    public ApplicationTest() {
        super(Application.class);
    }
}


text:
#import "NSDate+Comparison.h"

@implementation NSDate (Comparison)

+ (BOOL)date:(NSDate *)date isBetweenDate:(NSDate *)beginDate andDate:(NSDate *)endDate
{
    if([date compare:beginDate] == NSOrderedAscending)
    {
        return NO;
    }
    if([date compare:endDate] == NSOrderedDescending)
    {
        return NO;
    }

    return YES;
}

@end


text:
package com.yourname.flixelgame.examples.audio;

import org.flixel.FlxButton;
import org.flixel.FlxG;
import org.flixel.FlxSound;
import org.flixel.FlxState;
import org.flixel.event.IFlxButton;

/**
 * Just a simple demo to play music and sound.
 * Take a look at Music and Sound class for more features.
 *
 * @author Ka Wing Chin
 */
public class PlayState extends FlxState
{
	static private final String SndMode = "examples/audio/mode.ogg";
	static private final String SndFlixel = "examples/audio/flixel.ogg";
	static private final String SndButtonHover = "examples/audio/ButtonHover.ogg";
	static private final String SndButtonDown = "examples/audio/ButtonDown.ogg";

	FlxSound flixel;
	private FlxButton _btnPlayMusic;
	protected boolean _paused;

	@Override
	public void create()
	{
		// Background
		FlxG.setBgColor(0xFFFFFFFF);

		// Add a play/pause button for the music.
		add(_btnPlayMusic = new FlxButton(10, 10, "play music", playMusic));
		// Add a stop button for the music.
		FlxButton button;
		add(button = new FlxButton(100, 10, "stop music", stopMusic));
		button.setSounds(SndButtonHover, 1.0f, null, 1.0f, SndButtonDown);

		// Add a play button for the sound.
		add(new FlxButton(10, 100, "play sound", playSound));

		// Load the sound in the memory, it will be recycled when needed.
		flixel = FlxG.loadSound(SndFlixel, 1f, false, false);
	}

	@Override
	public void destroy()
	{
		super.destroy();
	}

	IFlxButton playMusic = new IFlxButton()
	{
		@Override
		public void callback()
		{
			if(FlxG.music == null)
			{
				_btnPlayMusic.label.setText("pause music");
				FlxG.playMusic(SndMode, 1f);
			}
			else if(!FlxG.music.active)
			{
				_btnPlayMusic.label.setText("pause music");
				if(_paused)
					FlxG.music.resume();
				else
					FlxG.music.play();
				_paused = false;
			}
			else
			{
				_btnPlayMusic.label.setText("play music");
				FlxG.music.pause();
				_paused = true;
			}
		};
	};

	IFlxButton stopMusic = new IFlxButton()
	{
		@Override
		public void callback()
		{
			if(FlxG.music != null)
			{
				_btnPlayMusic.label.setText("play music");
				FlxG.music.stop();
				_paused = false;
			}
		};
	};

	IFlxButton playSound = new IFlxButton()
	{
		@Override
		public void callback()
		{
			flixel.play(true);
			// it can also be done by this:
//			FlxG.play(Asset.Sndflixel, 1, true);
			// but you can't force to restart.
		};
	};
}


text:
package io.wcm.handler.media.impl.ipeconfig;

import static io.wcm.handler.media.impl.ipeconfig.CroppingRatios.MEDIAFORMAT_FREE_CROP;
import static io.wcm.handler.media.impl.ipeconfig.PathParser.NN_ASPECT_RATIOS;
import static io.wcm.handler.media.impl.ipeconfig.PathParser.NN_CONFIG;
import static io.wcm.handler.media.impl.ipeconfig.PathParser.NN_MEDIA_FORMAT;

import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;

import org.apache.commons.lang3.StringUtils;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.api.resource.SyntheticResource;
import org.apache.sling.spi.resource.provider.ResolveContext;
import org.apache.sling.spi.resource.provider.ResourceContext;
import org.apache.sling.spi.resource.provider.ResourceProvider;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.osgi.service.component.annotations.Component;

import com.day.cq.wcm.api.components.ComponentManager;

import io.wcm.handler.media.format.MediaFormat;
import io.wcm.handler.media.format.MediaFormatHandler;
import io.wcm.sling.commons.adapter.AdaptTo;

/**
 * Resource provider that overlays a IPE config resource with a dynamically generated
 * set of cropping aspect ratios derived from given set of media formats.
 *

 * URL pattern for resource access:

 * /wcmio:mediaHandler/ipeConfig/{componentContentPath}/wcmio:mediaFormat/{mf1}/{mf2}/.../wcmio:config/{relativeConfigPath}
 *

 */
@Component(service = ResourceProvider.class, property = {
    ResourceProvider.PROPERTY_NAME + "=wcmioHandlerIPEConfig",
    ResourceProvider.PROPERTY_ROOT + "=" + IPEConfigResourceProvider.IPECONFIG_OVERLAY_ROOTPATH
})
public class IPEConfigResourceProvider extends ResourceProvider {

  /**
   * Root path for IPE config overlay resources.
   */
  public static final String IPECONFIG_OVERLAY_ROOTPATH = "/wcmio:mediaHandler/ipeConfig";

  @Override
  public @Nullable Resource getResource(@NotNull ResolveContext resolveContext, @NotNull String path,
      @NotNull ResourceContext resourceContext, @Nullable Resource parent) {

    PathParser parser = new PathParser(path);
    if (!parser.isValid()) {
      return null;
    }

    ResourceResolver resolver = resolveContext.getResourceResolver();
    if (parser.isAspectRatiosNode()) {
      // simulate 'aspectRatios' node
      return buildAspectRatiosResource(resolver, path);
    }
    else if (parser.isAspectRatioItem()) {
      // simulate 'aspectRatios/xxx' node
      String mediaFormatName = parser.getAspectRatioItemName();
      if (parser.getMediaFormatNames().contains(mediaFormatName)) {
        return buildAspectRatioItemResource(resolver, path, mediaFormatName, parser);
      }
    }
    else {
      // return wrapped overlaid resource
      String overlayResourcePath = getIpeConfigPath(resolver, parser);
      if (StringUtils.isNotEmpty(overlayResourcePath)) {
        Resource overlayResource = resolver.getResource(overlayResourcePath);
        if (overlayResource != null) {
          return new OverlayResource(overlayResource, path);
        }
      }
    }
    return null;
  }

  @Override
  public @Nullable Iterator<Resource> listChildren(@NotNull ResolveContext resolveContext, @NotNull Resource resource) {
    Map<String, Resource> childMap = getOverlayedResourceChilden(resource);

    String path = resource.getPath();
    PathParser parser = new PathParser(path);
    if (!parser.isValid()) {
      return null;
    }

    ResourceResolver resolver = resolveContext.getResourceResolver();
    if (parser.isPluginsCropNode()) {
      // add simulated 'aspectRatios' node
      childMap.put(NN_ASPECT_RATIOS, buildAspectRatiosResource(resolver, path + "/" + NN_ASPECT_RATIOS));
    }
    else if (parser.isAspectRatiosNode()) {
      // add simulated 'aspectRatios/xxx' nodes
      childMap.clear();
      for (String mediaFormatName : parser.getMediaFormatNames()) {
        Resource item = buildAspectRatioItemResource(resolver, path + "/" + mediaFormatName, mediaFormatName, parser);
        if (item != null) {
          childMap.put(mediaFormatName, item);
        }
      }
    }

    if (childMap.isEmpty()) {
      return null;
    }
    else {
      return childMap.values().iterator();
    }
  }

  /**
   * Gets children of overlaid resource and converts children to {@link OverlayResource}.
   * @param resource Requested resources
   * @return Map with all children
   */
  private Map<String, Resource> getOverlayedResourceChilden(Resource resource) {
    Map<String, Resource> childMap = new LinkedHashMap<>();
    if (resource instanceof OverlayResource) {
      Resource overlayResource = ((OverlayResource)resource).getOverlayedResource();
      Iterator<Resource> childrenIterator = overlayResource.listChildren();
      while (childrenIterator.hasNext()) {
        Resource child = childrenIterator.next();
        childMap.put(child.getName(), new OverlayResource(child,
            resource.getPath() + "/" + child.getName()));
      }
    }
    return childMap;
  }

  /**
   * Build resource for /aspectRatios node
   * @param resolver Resource resolver
   * @param path Path
   * @return Resource
   */
  private Resource buildAspectRatiosResource(ResourceResolver resolver, String path) {
    return new SyntheticResource(resolver, path, null);
  }

  /**
   * Build virtual resource with name and aspect ratio of given media format.
   * @param resolver Resource resolver
   * @param path Path
   * @param mediaFormatName Media format name
   * @param parser Path parser
   * @return Resource or null if media format not found or has no valid ratio
   */
  private Resource buildAspectRatioItemResource(ResourceResolver resolver, String path, String mediaFormatName,
      PathParser parser) {
    Resource componentContent = resolver.getResource(parser.getComponentContentPath());
    if (componentContent != null) {
      MediaFormatHandler mediaFormatHandler = AdaptTo.notNull(componentContent, MediaFormatHandler.class);
      MediaFormat mediaFormat = getMediaFormat(mediaFormatName, mediaFormatHandler);
      if (mediaFormat != null) {
        return new AspectRatioResource(resolver, mediaFormat, path);
      }
    }
    return null;
  }

  private MediaFormat getMediaFormat(String mediaFormatName, MediaFormatHandler mediaFormatHandler) {
    if (StringUtils.equals(mediaFormatName, MEDIAFORMAT_FREE_CROP.getName())) {
      return MEDIAFORMAT_FREE_CROP;
    }
    else {
      return mediaFormatHandler.getMediaFormat(mediaFormatName);
    }
  }

  /**
   * Get IPE config path from component associated with given resource and append the relative
   * config path from current resource request.
   * @param resolver Resource resolver
   * @param parser Path parser
   * @return Path or null
   */
  private String getIpeConfigPath(ResourceResolver resolver, PathParser parser) {
    Resource componentContent = resolver.getResource(parser.getComponentContentPath());
    if (componentContent != null) {
      ComponentManager componentManager = AdaptTo.notNull(resolver, ComponentManager.class);
      com.day.cq.wcm.api.components.Component component = componentManager.getComponentOfResource(componentContent);
      if (component != null
          && component.getEditConfig() != null
          && component.getEditConfig().getInplaceEditingConfig() != null) {
        String ipeConfigPath = component.getEditConfig().getInplaceEditingConfig().getConfigPath();
        if (StringUtils.isNotEmpty(ipeConfigPath)) {
          return ipeConfigPath + StringUtils.defaultString(parser.getRelativeConfigPath());
        }
      }
    }
    return null;
  }

  /**
   * Build path to overlaid IPE configuration services by this resource provider.
   * @param componentContentPath Content resource path containing reference component with image IPE enabled
   * @param mediaFormatNames Media format names
   * @return Path
   */
  public static String buildPath(String componentContentPath, Set<String> mediaFormatNames) {
    SortedSet<String> sortedMediaFormatNames = new TreeSet<>(mediaFormatNames);
    return IPECONFIG_OVERLAY_ROOTPATH + componentContentPath
        + "/" + NN_MEDIA_FORMAT + "/" + StringUtils.join(sortedMediaFormatNames, "/")
        + "/" + NN_CONFIG;
  }

}


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

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="config.xsd">

	<name>org.diretto.api.external.processing</name>
	<api-version>v2</api-version>
	<service-class>org.diretto.api.client.external.processing.ProcessingServiceImpl</service-class>

	<restlet-client>

		<connector-protocol>HTTP</connector-protocol>

		<!-- http://www.restlet.org/documentation/snapshot/jse/ext/org/restlet/ext/httpclient/HttpClientHelper.html -->

		<connector-parameters>
			<parameter name="followRedirects" value="false" />
			<parameter name="idleCheckInterval" value="0" />
			<parameter name="idleTimeout" value="40000" />
			<parameter name="maxConnectionsPerHost" value="64" />
			<parameter name="maxTotalConnections" value="128" />
			<parameter name="stopIdleTimeout" value="10000" />
			<parameter name="socketTimeout" value="0" />
			<parameter name="tcpNoDelay" value="false" />
		</connector-parameters>

	</restlet-client>

</config>


text:
import Vue from 'vue'

const style = {
    position: 'relative',
    backgroundColor: '#808080',
    background: 'linear-gradient(-90deg, rgba(0, 0, 0, .1) 1px, transparent 1px), linear-gradient(rgba(0, 0, 0, .1) 1px, transparent 1px)',
    backgroundSize: '20px 20px, 20px 20px',
    height: '400px',
    width: '400px',
    border: '1px solid blue',
    margin: '1em'
}

export default () => ({
  template: `

      <vue-draggable-resizable :parent="true" :grid=[20,20]>

You cannot move me or resize me outside my parent.

      </vue-draggable-resizable>

  `
})


text:
require 'spec_helper'

describe Project do
  it { should respond_to(:book_id) }
  it { should respond_to(:release_date) }
  it { should respond_to(:client_id) }

  context "when validating" do
    it "is invalid without a book_id" do
      project = build(:project, :book_id => nil)
      project.should_not be_valid
      project.should have(1).error_on(:book_id)
    end
  end

  context "when saving" do
    it "should belong to a book" do
      project = create(:project)
      project.book.should_not be_nil
      project.book.should be_an_instance_of(Book)
    end
  end

  context "when saving and a release date is set" do
    it "should accept only dates in the future" do
      project = build(:project, :release_date => Date.yesterday)
      project.should_not be_valid
      project.should have(1).error_on(:release_date)
    end

    it "should not accept dates before interval set by PROJECT::MANUFACTURE_TIME" do
      project = build(:project, :release_date => Date.tomorrow)
      project.should_not be_valid
      project.should have(1).error_on(:release_date)
    end

    it "should accept dates before interval set by PROJECT::MANUFACTURE_TIME" do
      project = build(:project, :release_date => (Date.tomorrow + Project::MANUFACTURE_TIME + 10.days))
      project.should be_valid
      project.should_not have(1).error_on(:release_date)
    end
  end

  context ".finish_date" do
    it "should return nil if no release date is set" do
      project = build(:project, :release_date => nil)
      project.finish_date.should be_nil
    end

    it "should return the release date minus the MANUFACTURE_TIME if release date is set" do
      project = build(:project, :release_date => (Date.tomorrow + Project::MANUFACTURE_TIME + 10.days))
      project.finish_date.should == (Date.tomorrow + 10.days)
    end
  end

  context ".remaining_days" do
    it "should calculate the number of dates between today and the finish_date" do
      release_date = (Date.tomorrow + Project::MANUFACTURE_TIME + 10.days)
      project = build(:project, :release_date => (Date.tomorrow + Project::MANUFACTURE_TIME + 10.days))
      project.remaining_days.should  == (project.finish_date - Date.today).to_i
    end

    # why should be nil, remove it
    # it "should be nil when invalid" do
    #   project = build(:project, :release_date => (Date.yesterday))
    #   project.remaining_days.should be_nil
    # end
  end
end