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">
    <parent>
        <artifactId>keycloak-parent</artifactId>
        <groupId>org.keycloak</groupId>
        <version>1.3.0.Final-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>keycloak-core-jaxrs</artifactId>
    <name>Keycloak Core JAX-RS</name>
    <description/>

    <dependencies>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-jaxrs</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.keycloak</groupId>
            <artifactId>keycloak-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-core-asl</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-jackson-provider</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.spec.javax.servlet</groupId>
            <artifactId>jboss-servlet-api_3.0_spec</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>


text:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

<TITLE>CLHS: Issue BOA-AUX-INITIALIZATION Writeup</TITLE>
<META HTTP-EQUIV="Author" CONTENT="Kent M. Pitman">
<META HTTP-EQUIV="Organization" CONTENT="The Harlequin Group Limited">
<LINK REL=TOP HREF="../FrontMatter/index.html">
<LINK REL=COPYRIGHT HREF="../FrontMatter/About-HyperSpec.html#Legal">
<LINK REL=DISCLAIMER HREF="../FrontMatter/About-HyperSpec.html#Disclaimer">
<LINK REL=PREV HREF="../Issues/iss017-writeup.html">
<LINK REL=UP HREF="../Issues/iss019.html">
<LINK REL=NEXT HREF="../Issues/iss020-writeup.html">

Issue BOA-AUX-INITIALIZATION Writeup

Forum:		Public Review

Issue:		BOA-AUX-INITIALIZATION

References:	Loosemore's public review comment #26

		Boa lambda lists, Section 3.4.6, page 3-48

		DEFSTRUCT :TYPE slot option, page 8-4

		DEFSTRUCT slot-initform, page 8-3

                CLtL-2 p 482

                Issue UNINITIALIZED-ELEMENTS

Category:	CLARIFICATION/CHANGE

Edit history:	26 Dec 1992, Version 1 by Loosemore

Status:         Proposal ERROR-ON-READ failed 7-3 on letter ballot 93-302.

		Proposal ERROR-ON-READ passed 7-0 at October 1993 meeting.

Problem description:

  In the discussion of BOA constructor lambda lists on page 3-48

  says that, for a slot whose name is given as an &AUX variable

  without an initialization form, the "slot is not initialized; its

  initial value is implementation-defined."  The corresponding

  passage from CLtL says the initial value is "undefined" rather

  than "implementation-defined".

  It is not clear whether and when errors about the uninitialized slot

  might be detected.  If the slot is given an "implementation-defined"

  value, for example, is it permissible for the implementation to

  signal an error at instance creation time if the slot :TYPE for

  the uninitialized slot doesn't match the type of the value that

  particular implementation has chosen?  Or is it permissible for

  implementations to signal an error if an attempt is later made to

  read the slot's value before it has been explicitly assigned a

  (type-correct) value?

Proposal (BOA-AUX-INITIALIZATION:ERROR-ON-READ):

  Make BOA constructors with &AUX variables without an initialization

  form treat the corresponding slots in the same way as slots defined

  without an slot-initform; the consequences are undefined if an attempt

  is later made to read the slot's value before a value is explicitly

  assigned.

  Clarify that, if such a slot has a :TYPE option specified, there can

  be no type mismatch error when initialization of the slot is suppressed

  in this way.

Rationale:

  This makes the treatment of uninitialized structure slots consistent.

  It also makes it permissible for implementations to diagnose references

  to uninitialized structure slots in high-safety code, which is helpful

  in debugging.  (See issue UNINITIALIZED-ELEMENTS.)

  The interpretation of the &AUX syntax in BOA constructors was carefully

  chosen to permit the default structure slot initializations to be

  overridden completely.  There are some circumstances -- such as when

  setting up complicated circular data structures -- when there is

  simply no appropriate value that could be used as a default.  While

  one could simply specify the DEFSTRUCT definition without slot-initforms

  for those slots to get the right behavior, one would also lose the

  benefit of type-checking on accesses to the slot since DEFSTRUCT

  syntax allows one to specify the :TYPE option only if a slot-initform

  is also specified.

Current practice:

  At least one implementation (CMU CL) signals a type mismatch error at

  instance creation time if the slot type you specified doesn't match

  that of the value that particular implementation has chosen to store

  in these slots.

  Other implementations either do no type checking, or defer type

  checking until when the slot's value is read.

Cost to implementors:

  Those implementations that now do type-checking at instance creation

  time will have to be changed.  This is probably not a huge change.

Cost to users:

  Some user code may be broken by this change; but such code is already

  nonportable.

Aesthetics:

  Making the language more consistent is a good idea.

Editorial impact:

  Tweaking two sentences on page 3-48.

Discussion:

  The consensus of the public review committee was that this proposal

  was the best of the alternatives.

  Clarifying that we really want the initial value of these slots to be

  "implementation-defined" would have the problem that it would be

  impossible for users to portably specify a slot :TYPE other than T.

  The possibility of having the standard specify an explicit value (NIL)

  for uninitialized slots was also mentioned, but this was considered

  unaesthetic; it would still weaken type-checking to some extent, make

  it harder to detect uninitialized slots, and be inconsistent with other

  parts of the language.

  Rob MacLachlan says, about CMU CL's behavior:

    Our interpretation is that the slot type declaration must encompass

    all values that the slot can be created with.  This is important,

    since we want all possible values of the slot accessor to be of that

    type.

  (In other words, it appears they want to do type-checking when the

  slots are written rather than when they are read, since writing is

  a less frequent operation.)

Copyright 1996, The Harlequin Group Limited.  All Rights Reserved.

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace yii\imperavi;
use yii\web\AssetBundle;

/**
 * @author Alexander Yaremchuk <alwex10@gmail.com>
 * @since 1.4
 */
class FontcolorImperaviRedactorPluginAsset extends AssetBundle
{
    public $sourcePath = '@yii/imperavi/assets/plugins/fontcolor';
    public $js = [
        'fontcolor.js',
    ];
    public $css = [

    ];
    public $depends = [
        'yii\imperavi\ImperaviRedactorAsset'
    ];
}


text:
#include "core_defs.h"
#include "VideoInterface_MMX.h"
#include "performance.h"
#include <mmintrin.h>

IVideoInterface_MMX::IVideoInterface_MMX():
IVideoInterface()
{

}

IVideoInterface_MMX::~IVideoInterface_MMX()
{
	IVideoInterface::Term();
}

GEN_RESULT IVideoInterface_MMX::DrawSurfaceAlpha(HSURFACE hSurface, int x, int y, float fAlpha, Rect2D *pRect)
{
#pragma message("FIXME: IVideoInterface_MMX::DrawSurfaceAlpha ignoring pRect...")

	if(NULL == hSurface)
	{
		return RESULT_ERROR;
	}

	ValidateSurface(hSurface);

	LPDIRECTDRAWSURFACE7 pSurface = ((LPDIRECTDRAWSURFACE7)hSurface);

	//TEST
	DDCOLORKEY ddck;
	pSurface->GetColorKey( DDCKEY_SRCBLT, &ddck );

	DDSURFACEDESC2 desc;
	ZeroMemory(&desc, sizeof(LPDDSURFACEDESC2));
	desc.dwSize = sizeof(DDSURFACEDESC2);
	//HRESULT hr = pSurface->GetSurfaceDesc(&desc);
	HRESULT hr = pSurface->Lock(NULL, &desc, DDLOCK_WAIT, NULL);
	if(hr != S_OK)
	{
		pSurface->Unlock(NULL);
		return RESULT_ERROR;
	}

	int nWidth = desc.dwWidth;
	int nHeight = desc.dwHeight;

	DDSURFACEDESC2 descBack;
	ZeroMemory(&descBack, sizeof(LPDDSURFACEDESC2));
	descBack.dwSize = sizeof(DDSURFACEDESC2);
	HRESULT hr1 = g_pDDSBack->Lock(NULL, &descBack, DDLOCK_WAIT, NULL);
	if(hr1 != S_OK)
	{
		g_pDDSBack->Unlock(NULL);
		return RESULT_ERROR;
	}

	//do 32-bit alpha...
	int nSrcWidth = desc.lPitch / sizeof(uint32);
	int nDestWidth = descBack.lPitch / sizeof(uint32);

	int nSrcSkip = (nSrcWidth - desc.dwWidth);
	int nDestSkip = /*x +*/ (nDestWidth - descBack.dwWidth);

	if((DWORD)y > descBack.dwHeight)
	{
		g_pDDSBack->Unlock(NULL);
		pSurface->Unlock(NULL);
		return RESULT_ERROR;
	}

	uint8 nAlpha = (int)(fAlpha * 255.0f);

	CPerformanceCounter counter;
	counter.Start();

#define REDMASK (0x00FF0000)
#define GREENMASK (0x0000FF00)
#define BLUEMASK (0x000000FF)
#define GET_MASK(a, b) (a & b)
#define GET_MASK_ASM(a, b, c) \
	__asm mov         ecx, dword ptr [ a ] \
	__asm and         ecx,b  \
	__asm mov         dword ptr [ c ],ecx

	//get the dest pixel starting point
	uint32 *pDest = (uint32*)descBack.lpSurface;
	pDest += (y * nDestWidth) + x;

	//get the source pixel starting point
	uint32 *pSrc = (uint32*)desc.lpSurface;

	// MMX
	__int64 i64Alpha;
	i64Alpha = nAlpha;
	i64Alpha |= ( i64Alpha << 16 ) | ( i64Alpha << 32 );

		//uint32 *lpbTarget = (uint32*)descBack.lpSurface;
		//pDest += (y * nDestWidth) + x;

		//get the source pixel starting point
		//uint32 *lpbSource = (uint32*)desc.lpSurface;

		nWidth /= 2;
		//__asm push edi
		//__asm push esi

		//__asm mov edi, pDest
		//__asm mov esi, pSrc

		// Load	the alpha value into an mmx register.
		__asm movq mm5, i64Alpha
			//__asm push eax

	bool bOdd = false;
	int nSkipped = 0;

	for(int vertical = 0; vertical < nHeight; ++vertical)
	{
		for(int horiz = 0; horiz < nWidth; ++horiz)
		{
			int a = horiz;

			// Setup our source a dest pixels...
			//__asm mov edi, pDest
			//__asm mov esi, pSrc

			// Are we skipping the first pixel?
			bool bSkipOne = false;
			if(*pSrc == (0xFF000000 | ddck.dwColorSpaceLowValue) )
			{
				bSkipOne = true;
			}

			// Are we skipping the second pixel?
			bool bSkipTwo = false;
			if(*(pSrc+1) == (0xFF000000 | ddck.dwColorSpaceLowValue) )
			{
				bSkipTwo = true;
			}

			// Are we skiping both?
			if(bSkipOne && bSkipTwo)
			{
				pDest +=2;
				pSrc  +=2;

				continue;
			}

			/*
			mm0:	target pixel one
			mm1:	source pixel one
			mm2:	target pixel two
			mm3:	source pixel two
			mm4:	working register
			mm5:	alpha value
			mm6:	original target
			mm7:	original source
			*/
			//__asm pxor		mm0, mm0				// Clear mm4 so we can unpack easily.
			//__asm pxor		mm1, mm1				// Clear mm4 so we can unpack easily.
			//__asm pxor		mm2, mm2				// Clear mm4 so we can unpack easily.
			//__asm pxor		mm3, mm3				// Clear mm4 so we can unpack easily.
			//__asm pxor		mm4, mm4				// Clear mm4 so we can unpack easily.
			//__asm pxor		mm5, mm5				// Clear mm4 so we can unpack easily.
			//__asm pxor		mm6, mm6				// Clear mm4 so we can unpack easily.
			//__asm pxor		mm7, mm7				// Clear mm4 so we can unpack easily.

			__asm mov edi, pDest
			__asm mov esi, pSrc

			// Move the source and target pixels into the regsiters
			__asm movq		mm6, [edi]				// Load the target pixels.
			__asm pxor		mm4, mm4				// Clear mm4 so we can unpack easily.

			//Source 1 & 2
			__asm movq		mm7, [esi]				// Load the source pixels.

			//Dest 1
			__asm movq		mm0, mm6				// Create copy one of the target.

			//Dest 2
			__asm movq		mm2, mm6				// Create copy two of the target.

			// Unpack the target
			__asm punpcklbw	mm0, mm4				// Unpack the first target copy.

			//Source 1
			__asm movq		mm1, mm7				// Create copy one of the source.
			__asm psrlq		mm2, 32					// Move the high order dword of target two.

			__asm punpcklbw	mm2, mm4				// Unpack the second target copy.
			__asm movq		mm3, mm7				// Create copy two of the source.

			__asm psrlq		mm3, 32					// Move the high order dword of source two.
			__asm punpcklbw	mm1, mm4				// Unpack the first source copy.

			__asm punpcklbw	mm3, mm4				// Unpack the second source copy.
			__asm pslld		mm7, 8					// Shift away original source highest bytes.

			__asm movq		mm4, mm0				// Save target one.
			__asm pmullw	mm0, mm5				// Multiply target one with alpha.

			__asm pmullw	mm1, mm5				// Multiply source one with alpha.
			__asm psrld		mm7, 8					// Complete high order byte clearance.

			__asm psrlw		mm1, 8					// Divide source one by 256.
			__asm nop

			__asm psrlw		mm0, 8					// Divide target one by 256.
			__asm nop

			__asm psubw		mm1, mm0				// Calculate source one minus target one.
			__asm nop

			__asm paddw		mm1, mm4				// Add the former target one to the result.
			__asm nop

			__asm movq		mm4, mm2				// Save target two.
			__asm pmullw	mm2, mm5				// Multiply target two with alpha.

			__asm pmullw	mm3, mm5				// Multiply source two with alpha.
			__asm nop

			__asm psrlw		mm2, 8					// Divide target two by 256.
			__asm nop

			__asm psrlw		mm3, 8					// Divide source two by 256.
			__asm nop

			__asm psubw		mm3, mm2				// Calculate source two minus source one.
			__asm nop

			__asm paddw		mm3, mm4				// Add the former target two to the result.

			__asm pxor		mm4, mm4				// Clear mm4 so we can pack easily.

			__asm packuswb	mm1, mm4				// Pack the new target one.
			__asm packuswb	mm3, mm4				// Pack the new target two.

			__asm psllq		mm3, 32					// Shift up the new target two.
			__asm pcmpeqd	mm4, mm7				// Create a color key mask.

			__asm por		mm1, mm3				// Combine the new targets.
			__asm pand		mm6, mm4				// Keep old target where color key applies.

			__asm pandn		mm4, mm1				// Clear new target where color key applies.
			__asm nop

			__asm por		mm6, mm4				// Assemble the new target value.
			__asm nop

			__asm movq		[edi], mm6				// Write back the new target value.

			pDest += 2;
			pSrc += 2;
		}

		pDest += nDestSkip;

		//if the source is smaller than the destination surface.
		if(nSrcWidth < nDestWidth)
		{
			pDest += ((descBack.dwWidth - x) - desc.dwWidth) + x;
		}

		pSrc += nSrcSkip;
	}

	_mm_empty();

	counter.Stop();
	float fDelta = counter.TimeInMilliseconds();
	//DEBUG_LOG(if(fp) {fprintf(fp, "[%06d] - %f\n", ++g_nLogCounter, fDelta);})

		g_pDDSBack->Unlock(NULL);
	pSurface->Unlock(NULL);

	return RESULT_OK;
}


text:
const path = require("path");

module.exports = {
    entry: "./index.js",
    devtool: process.env.WEBPACK_DEVTOOL || "source-map",
    output: {
        path: path.join(__dirname, "build"),
        filename: "bundle.js"
    }
};


text:
package org.cidrz.webapp.dynasite.dao;

import org.cidrz.project.zeprs.valueobject.Immunization;
import org.cidrz.webapp.dynasite.exception.ObjectNotFoundException;
import org.cidrz.webapp.dynasite.utils.DatabaseUtils;

import javax.servlet.ServletException;
import java.sql.SQLException;
import java.sql.Connection;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Chris Kelley
 *         Date: Jul 4, 2005
 *         Time: 9:22:16 AM
 */
public class ImmunizationDAO {

    /**
     * @return List of objects
     * @throws java.sql.SQLException
     * @throws javax.servlet.ServletException
     * @param conn
     */
    public static List getAll(Connection conn) throws SQLException, ServletException {
        List list = new ArrayList();
        ArrayList values = new ArrayList();
        values = new ArrayList();
        String sql = "select id, name from immunization";
        list = DatabaseUtils.getList(conn, Immunization.class, sql, values);
        return list;
    }

    /**
     * Returns one record
     *
     * @param id
     * @return
     * @throws java.sql.SQLException
     * @throws javax.servlet.ServletException
     */
    public static Immunization getOne(Connection conn, Long id) throws SQLException, ServletException, ObjectNotFoundException {
        Immunization item = null;
        String sql;
        ArrayList values;
        sql = "select id, name from immunization where id=? ";
        values = new ArrayList();
        values.add(id);
        item = (Immunization) DatabaseUtils.getBean(conn, Immunization.class, sql, values);
        return item;
    }
}


text:
class test_forwarding
{
public:
    typedef allocgc::byte byte;

    struct entry
    {
        entry(byte* from_, byte* to_)
            : from(from_)
            , to(to_)
        {}

        byte* from;
        byte* to;
    };

    typedef std::vector<entry> containter_t;

    void create(byte* from, byte* to)
    {
//        memcpy(to, from, obj_size);
        m_frwd_list.emplace_back(from, to);
    }

    void forward(allocgc::gc_handle* handle) const
    {
        using namespace allocgc;

        byte* ptr = gc_handle_access::get<std::memory_order_relaxed>(*handle);
        auto it = std::find_if(m_frwd_list.begin(), m_frwd_list.end(), [ptr] (const entry& e) {
            return ptr == e.from;
        });
        if (it != m_frwd_list.end()) {
            gc_handle_access::set<std::memory_order_relaxed>(*handle, it->to);
        }
    }

    containter_t& get_forwarding_list()
    {
        return m_frwd_list;
    }
private:
    std::vector<entry> m_frwd_list;
};

#endif //ALLOCGC_LIST_FORWARDING_HPP


text:
define(["lib-build/css!./Desktop",
		"../../utils/HeaderHelper",
		"../../builder/InlineFieldEdit",
		"../../utils/CommonHelper",
		"dojo/has",
		"dojo/topic"],
	function(
		viewCss,
		HeaderHelper,
		InlineFieldEdit,
		CommonHelper,
		has,
		topic
	){
		return function Desktop(container, isInBuilder)
		{
			this.init = function(hide, title, subtitle, socialCfg, bgColor, displaySwitchBuilderButton)
			{
				if (hide) {
					container.addClass('hideDesktop');
					return;
				}

				// Desktop builder
				if( isInBuilder ) {
					container.addClass('isBuilder');
					title =  "
" + (title || i18n.commonCore.inlineFieldEdit.editMe) + "
";
					title += "

";
					title += "<textarea rows='1' class='text_edit_input form-control' type='text'></textarea>";

					subtitle =  "" + (subtitle || i18n.commonCore.inlineFieldEdit.editMe) + "";
					subtitle += "

";
					subtitle += "<textarea rows='2' class='text_edit_input form-control' type='text'></textarea>";
				}

				container.find('.title').html(title);
				container.find('.subtitle').html(subtitle);

				// Desktop builder
				if( isInBuilder )
					new InlineFieldEdit(container, editFieldsEnterEvent, editFieldsExitEvent);

				if( ! isInBuilder && ! subtitle ) {
					container.find('.title').css("padding-top", 40);
					container.find('.subtitle').css("height", 32);
				}

				if ( displaySwitchBuilderButton )
					container.find(".switchBuilder").click(CommonHelper.switchToBuilder).show();

				setSocialArea(socialCfg);
				setColor(bgColor);
				HeaderHelper.initEvents(container);
			};

			this.resize = function(widthViewport)
			{
				var rightAreaWidth = Math.max(container.find(".logoImg").outerWidth() + 50, container.find(".rightArea").outerWidth() + 20);
				container.find(".textArea").width(widthViewport - rightAreaWidth - 15);
			};

			this.update = function(socialCfg, bgColor)
			{
				setColor(bgColor);
				setSocialArea(socialCfg);
			};

			this.getTitle = function()
			{
				if ( isInBuilder )
					return container.find('.title .text_edit_label').html();
				else
					return container.find('.title').html();
			};

			this.getSubtitle = function()
			{
				if ( isInBuilder )
					return container.find('.subtitle .text_edit_label').html();
				else
					return container.find('.subtitle').html();
			};

			this.setTitleAndSubtitle = function(title, subtitle)
			{
				var defaultText = isInBuilder ? i18n.commonCore.inlineFieldEdit.editMe : '';

				container.find('.title' + (isInBuilder ? ' .text_edit_label' : '')).html(title || defaultText);
				container.find('.subtitle' + (isInBuilder ? ' .text_edit_label' : '')).html(subtitle || defaultText);
			};

			function setColor(bgColor)
			{
				container.css("background-color", bgColor);
				container.find("#builderPanel").css("background-color", bgColor);
			}

			/*
			 * Social area init/update
			 */

			function setSocialArea(socialCfg)
			{
				HeaderHelper.setLogo(container, socialCfg);
				HeaderHelper.setLink(container, socialCfg);
				HeaderHelper.setSocial(container, socialCfg);
			}

			/*
			 * Builder
			 */

			function editFieldsEnterEvent()
			{
				//
			}

			function editFieldsExitEvent(src, value)
			{
				setTimeout(function(){
					topic.publish("HEADER_EDITED", {
						src: $(src).attr("class"),
						value: value
					});
				}, has("ios") || has("ie") >= 10 ? 700 : 0);

				app.builder.hideSaveConfirmation();
			}

			this.initLocalization = function()
			{
				container.find('.switchBuilder').html('

' + i18n.viewer.commonHeader.builderButton);
				container.find('.share_bitly').attr("title", i18n.viewer.commonHeader.bitlyTooltip);
			};
		};
	}
);


text:
<?php

namespace Psy\TabCompletion\Matcher;

use Psy\Command\Command;

/**
 * A Psy Command tab completion Matcher.
 *
 * This matcher provides completion for all registered Psy Command names and
 * aliases.
 *
 * @author Marc Garcia <markcial@gmail.com>
 */
class CommandsMatcher extends AbstractMatcher {

    /** @var string[] */
    protected $commands = array();

    /**
     * CommandsMatcher constructor.
     *
     * @param Command[] $commands
     */
    public function __construct(array $commands) {
        $this->setCommands($commands);
    }

    /**
     * Set Commands for completion.
     *
     * @param Command[] $commands
     */
    public function setCommands(array $commands) {
        $names = array();
        foreach ($commands as $command) {
            $names = array_merge(array($command->getName()), $names);
            $names = array_merge($command->getAliases(), $names);
        }
        $this->commands = $names;
    }

    /**
     * {@inheritDoc}
     */
    public function getMatches(array $tokens, array $info = array()) {
        $input = $this->getInput($tokens);

        return array_filter($this->commands, function ($command) use ($input) {
            return AbstractMatcher::startsWith($input, $command);
        });
    }

    /**
     * {@inheritDoc}
     */
    public function hasMatched(array $tokens) {
        $token = array_pop($tokens);
        $prevToken = array_pop($tokens);

        switch (true) {
            case self::tokenIs($prevToken, self::T_NEW):
                return false;
            case self::hasToken(array(self::T_OPEN_TAG, self::T_STRING), $token):
                return true;
        }

        return false;
    }

}


text:
using Microsoft.SharePoint.Client;
using OfficeDevPnP.Core;
using OfficeDevPnP.Core.Pages;
using System;
using System.Linq;
using System.Security;

namespace Provisioning.ModernPages
{
    class Program
    {
        static void Main(string[] args)
        {

            // Update the below variables to use your tenant and account information
            string siteUrl = "https://contoso.sharepoint.com/sites/modernpagedemo";
            string userName = "pnp@contoso.onmicrosoft.com";
            SecureString password = GetSecureString("Password");

            AuthenticationManager am = new AuthenticationManager();
            using (var cc = am.GetSharePointOnlineAuthenticatedContextTenant(siteUrl, userName, password))
            {
                // Demo 1: Add empty page
                var page = cc.Web.AddClientSidePage("PnPRocks.aspx", true);

                // Demo 2: Read existing page and Text control + custom web part.
                // Important: manually create a sample modern page called "Templatepage" in your demo site first
                ClientSidePage p = ClientSidePage.Load(cc, "Templatepage.aspx");
                // Add text control on top
                ClientSideText txt1 = new ClientSideText() { Text = "PnP Rocks" };
                p.AddControl(txt1, -1);
                // Find custom component and add as last control
                // Important: this assumes you've a custom client side web part with name "HelloWorld" deployed to the test site collection.
                var components = p.AvailableClientSideComponents();
                var myWebPart = components.Where(s => s.Name == "HelloWorld").FirstOrDefault();
                if (myWebPart != null)
                {
                    ClientSideWebPart helloWp = new ClientSideWebPart(myWebPart) { Order = 10 };
                    p.AddControl(helloWp);
                }
                // Save the page under a new name
                p.Save("pagewithcontrols.aspx");

                //Demo 3: Add OOB web part (Image)
                // Important: if you don't update the web part properties your client side impage web part will not be able to load the image
                ClientSidePage page5 = new ClientSidePage(cc);
                var imageWebPart = page5.InstantiateDefaultWebPart(DefaultClientSideWebParts.Image);
                imageWebPart.Properties["imageSourceType"] = 2;
                imageWebPart.Properties["siteId"] = "c827cb03-d059-4956-83d0-cd60e02e3b41";
                imageWebPart.Properties["webId"] = "9fafd7c0-e8c3-4a3c-9e87-4232c481ca26";
                imageWebPart.Properties["listId"] = "78d1b1ac-7590-49e7-b812-55f37c018c4b";
                imageWebPart.Properties["uniqueId"] = "3C27A419-66D0-4C36-BF24-BD6147719052";
                imageWebPart.Properties["imgWidth"] = 1002;
                imageWebPart.Properties["imgHeight"] = 469;
                //imageWebPart.PropertiesJson = "{\"imageSourceType\":2,\"altText\":\"\",\"fileName\":\"\",\"siteId\":\"c827cb03-d059-4956-83d0-cd60e02e3b41\",\"webId\":\"9fafd7c0-e8c3-4a3c-9e87-4232c481ca26\",\"listId\":\"78d1b1ac-7590-49e7-b812-55f37c018c4b\",\"uniqueId\":\"{3C27A419-66D0-4C36-BF24-BD6147719052}\",\"imgWidth\":1002,\"imgHeight\":469}";
                page5.AddControl(imageWebPart);
                page5.Save("pagewithimage.aspx");

                //Demo 4: delete page
                ClientSidePage p2 = ClientSidePage.Load(cc, "pagewithcontrols.aspx");
                p2.Delete();

                //Demo 5: delete control
                ClientSidePage deleteDemoPage = ClientSidePage.Load(cc, "pagewithimage.aspx");
                deleteDemoPage.Controls[0].Delete();
                deleteDemoPage.Save();
            }
        }

        #region Helper methods
        private static SecureString GetSecureString(string label)
        {
            SecureString sStrPwd = new SecureString();
            try
            {
                Console.Write(String.Format("{0}: ", label));

                for (ConsoleKeyInfo keyInfo = Console.ReadKey(true); keyInfo.Key != ConsoleKey.Enter; keyInfo = Console.ReadKey(true))
                {
                    if (keyInfo.Key == ConsoleKey.Backspace)
                    {
                        if (sStrPwd.Length > 0)
                        {
                            sStrPwd.RemoveAt(sStrPwd.Length - 1);
                            Console.SetCursorPosition(Console.CursorLeft - 1, Console.CursorTop);
                            Console.Write(" ");
                            Console.SetCursorPosition(Console.CursorLeft - 1, Console.CursorTop);
                        }
                    }
                    else if (keyInfo.Key != ConsoleKey.Enter)
                    {
                        Console.Write("*");
                        sStrPwd.AppendChar(keyInfo.KeyChar);
                    }

                }
                Console.WriteLine("");
            }
            catch (Exception e)
            {
                sStrPwd = null;
                Console.WriteLine(e.Message);
            }

            return sStrPwd;
        }

        private static String GetString(string label)
        {
            String sStrPwd = "";
            try
            {
                Console.Write(String.Format("{0}: ", label));

                for (ConsoleKeyInfo keyInfo = Console.ReadKey(true); keyInfo.Key != ConsoleKey.Enter; keyInfo = Console.ReadKey(true))
                {
                    if (keyInfo.Key == ConsoleKey.Backspace)
                    {
                        if (sStrPwd.Length > 0)
                        {
                            //sStrPwd.RemoveAt(sStrPwd.Length - 1);
                            sStrPwd.Remove(sStrPwd.Length - 1);
                            Console.SetCursorPosition(Console.CursorLeft - 1, Console.CursorTop);
                            Console.Write(" ");
                            Console.SetCursorPosition(Console.CursorLeft - 1, Console.CursorTop);
                        }
                    }
                    else if (keyInfo.Key != ConsoleKey.Enter)
                    {
                        Console.Write("*");
                        //sStrPwd.AppendChar(keyInfo.KeyChar);
                        sStrPwd = sStrPwd + keyInfo.KeyChar;
                    }

                }
                Console.WriteLine("");
            }
            catch (Exception e)
            {
                sStrPwd = null;
                Console.WriteLine(e.Message);
            }

            return sStrPwd;
        }
        #endregion
    }

}


text:
package manager

import (
	"sort"

	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/enum"
	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/log"
	"github.com/Comcast/traffic_control/traffic_monitor/experimental/traffic_monitor/peer"
)

// StartPeerManager listens for peer results, and when it gets one, it adds it to the peerStates list, and optimistically combines the good results into combinedStates
func StartPeerManager(peerChan <-chan peer.Result, localStates peer.CRStatesThreadsafe, peerStates peer.CRStatesPeersThreadsafe) peer.CRStatesThreadsafe {
	combinedStates := peer.NewCRStatesThreadsafe()
	go func() {
		for {
			select {
			case crStatesResult := <-peerChan:
				peerStates.Set(crStatesResult.Id, crStatesResult.PeerStats)
				combinedStates.Set(combineCrStates(peerStates.Get(), localStates.Get()))
				crStatesResult.PollFinished <- crStatesResult.PollID
			}
		}
	}()
	return combinedStates
}

// TODO JvD: add deliveryservice stuff
func combineCrStates(peerStates map[enum.TrafficMonitorName]peer.Crstates, localStates peer.Crstates) peer.Crstates {
	combinedStates := peer.NewCrstates()
	for cacheName, localCacheState := range localStates.Caches { // localStates gets pruned when servers are disabled, it's the source of truth
		downVotes := 0 // TODO JvD: change to use parameter when deciding to be optimistic or pessimistic.
		if localCacheState.IsAvailable {
			// log.Infof(cacheName, " is available locally - setting to IsAvailable: true")
			combinedStates.Caches[cacheName] = peer.IsAvailable{IsAvailable: true} // we don't care about the peers, we got a "good one", and we're optimistic
		} else {
			downVotes++ // localStates says it's not happy
			for _, peerCrStates := range peerStates {
				if peerCrStates.Caches[cacheName].IsAvailable {
					// log.Infoln(cacheName, "- locally we think it's down, but", peerName, "says IsAvailable: ", peerCrStates.Caches[cacheName].IsAvailable, "trusting the peer.")
					combinedStates.Caches[cacheName] = peer.IsAvailable{IsAvailable: true} // we don't care about the peers, we got a "good one", and we're optimistic
					break                                                                  // one peer that thinks we're good is all we need.
				} else {
					// log.Infoln(cacheName, "- locally we think it's down, and", peerName, "says IsAvailable: ", peerCrStates.Caches[cacheName].IsAvailable, "down voting")
					downVotes++ // peerStates for this peer doesn't like it
				}
			}
		}
		if downVotes > len(peerStates) {
			// log.Infoln(cacheName, "-", downVotes, "down votes, setting to IsAvailable: false")
			combinedStates.Caches[cacheName] = peer.IsAvailable{IsAvailable: false}
		}
	}

	for deliveryServiceName, localDeliveryService := range localStates.Deliveryservice {
		deliveryService := peer.Deliveryservice{}
		if localDeliveryService.IsAvailable {
			deliveryService.IsAvailable = true
		}
		deliveryService.DisabledLocations = localDeliveryService.DisabledLocations

		for peerName, iPeerStates := range peerStates {
			peerDeliveryService, ok := iPeerStates.Deliveryservice[deliveryServiceName]
			if !ok {
				log.Warnf("local delivery service %s not found in peer %s\n", deliveryServiceName, peerName)
				continue
			}
			if peerDeliveryService.IsAvailable {
				deliveryService.IsAvailable = true
			}
			deliveryService.DisabledLocations = intersection(deliveryService.DisabledLocations, peerDeliveryService.DisabledLocations)
		}
		combinedStates.Deliveryservice[deliveryServiceName] = deliveryService
	}

	return combinedStates
}

type CacheNameSlice []enum.CacheName

func (p CacheNameSlice) Len() int           { return len(p) }
func (p CacheNameSlice) Less(i, j int) bool { return p[i] < p[j] }
func (p CacheNameSlice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }

// intersection returns strings in both a and b.
// Note this modifies a and b. Specifically, it sorts them. If that isn't acceptable, pass copies of your real data.
func intersection(a []enum.CacheName, b []enum.CacheName) []enum.CacheName {
	sort.Sort(CacheNameSlice(a))
	sort.Sort(CacheNameSlice(b))
	var c []enum.CacheName
	for _, s := range a {
		i := sort.Search(len(b), func(i int) bool { return b[i] >= s })
		if i < len(b) && b[i] == s {
			c = append(c, s)
		}
	}
	return c
}


text:
<TITLE>Review for Holy Man (1998)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Holy Man (1998)

reviewed by
Matt Williams

HOLY MAN
A film review by Matt Williams

RATING: * out of * * * *

Billed as an Eddie Murphy comedy, viewers should beware of Holy Man.
Though it does feature Eddie Murphy, there's precious little comedy
herein this tired romantic comedy set amid a television-age satire.

GBSN (The Good Buy Shopping Network) is in trouble.  It's routine
infomercials and pathetic products just aren't selling anything. This
causes headaches for Ricky (Jeff Goldblum), the program director at
GBSN, who is given an ultimatum by his boss (Robert Loggia): improve
GBSN or be fired.

Kate (Kelly Preston), an analyst for the station, has a few ideas of how
a distinctive image could help the network.  But Ricky is more
interested in getting a date with her than with following her advice.

Enter G (Eddie Murphy), a bald, pajama-wearing, ground kissing, new-age
mystic.  He literally wanders into Ricky's life, initially an extreme
annoyance.  But Ricky is hit with a brainstorm:  why not put G on the
network.  Viewers will be able to enrich their lives while emptying
their pockets.

Unfortunately, the whole concept is about as interesting as watching an
infomercial.  The film tries to pack in a few product gimmicks, but most
of the humor is either mundane or missing.

Eddie Murphy is rarely given a chance to cut loose here.  Instead, he
spends most of the film reciting New Agey platitudes.  There are a
couple of fun moments (if you've seen the trailer...you've seen all of
them) where he starts to steal the show.  But, most of the time he is
curiously restrained.

That leaves us with the romance between Goldblum and Preston, a pair who
have zero chemistry together.  Goldblum isn't remotely likeable as the
lead, and Preston, though more sympathetic, has no defined character at
all.

There are moments of Holy Man where the filmmakers seem to be striving
toward some sort of social message about the power of television.
However, Holy Man is no Network...it's barely to the standards of Eddie
Murphy's career-derailing flop The Golden Child.

Copyright 1998 Matt Williams

- Matt Williams (matt@cinematter.com)
Reviewer for Cinematter: http://www.cinematter.com
Home of over 600 reviews, and information on nearly 700 upcoming
releases

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
namespace boost { namespace mpl {

namespace aux {

template< typename Pred, typename InsertOp > struct remove_if_helper
{
    template< typename Sequence, typename U > struct apply
    {
        typedef typename eval_if<
              typename apply1<Pred,U>::type
            , identity<Sequence>
            , apply2<InsertOp,Sequence,U>
            >::type type;
    };
};

template<
      typename Sequence
    , typename Predicate
    , typename Inserter
    >
struct remove_if_impl
    : fold<
          Sequence
        , typename Inserter::state
        , protect< aux::remove_if_helper<
              typename lambda<Predicate>::type
            , typename Inserter::operation
            > >
        >
{
};

template<
      typename Sequence
    , typename Predicate
    , typename Inserter
    >
struct reverse_remove_if_impl
    : reverse_fold<
          Sequence
        , typename Inserter::state
        , protect< aux::remove_if_helper<
              typename lambda<Predicate>::type
            , typename Inserter::operation
            > >
        >
{
};

} // namespace aux

BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(3, remove_if)

}}

#endif // BOOST_MPL_REMOVE_IF_HPP_INCLUDED


text:
package com.aspose.cells.examples.data;

import com.aspose.cells.BorderType;
import com.aspose.cells.CellBorderType;
import com.aspose.cells.Cells;
import com.aspose.cells.Color;
import com.aspose.cells.Font;
import com.aspose.cells.Row;
import com.aspose.cells.Style;
import com.aspose.cells.StyleFlag;
import com.aspose.cells.TextAlignmentType;
import com.aspose.cells.Workbook;
import com.aspose.cells.Worksheet;
import com.aspose.cells.examples.Utils;

public class FormattingARow {
	public static void main(String[] args) throws Exception {
		// The path to the documents directory.
		String dataDir = Utils.getSharedDataDir(FormattingARow.class) + "data/";
		// Instantiating a Workbook object
		Workbook workbook = new Workbook();

		// Accessing the added worksheet in the Excel file
		Worksheet worksheet = workbook.getWorksheets().get(0);
		Cells cells = worksheet.getCells();

		// Adding a new Style to the styles collection of the Excel object Accessing the newly added Style to the Excel object
		Style style = workbook.createStyle();

		// Setting the vertical alignment of the text in the cell
		style.setVerticalAlignment(TextAlignmentType.CENTER);

		// Setting the horizontal alignment of the text in the cell
		style.setHorizontalAlignment(TextAlignmentType.CENTER);

		// Setting the font color of the text in the cell
		Font font = style.getFont();
		font.setColor(Color.getGreen());

		// Shrinking the text to fit in the cell
		style.setShrinkToFit(true);

		// Setting the bottom border of the cell
		style.setBorder(BorderType.BOTTOM_BORDER, CellBorderType.MEDIUM, Color.getRed());

		// Creating StyleFlag
		StyleFlag styleFlag = new StyleFlag();
		styleFlag.setHorizontalAlignment(true);
		styleFlag.setVerticalAlignment(true);
		styleFlag.setShrinkToFit(true);
		styleFlag.setBottomBorder(true);
		styleFlag.setFontColor(true);

		// Accessing a row from the Rows collection
		Row row = cells.getRows().get(0);

		// Assigning the Style object to the Style property of the row
		row.applyStyle(style, styleFlag);

		// Saving the Excel file
		workbook.save(dataDir + "FormattingARow_out.xls");
	}
}


text:
拖拽下列 framework 从 `AdColony` 插件包的 __plugins/ios__ 目录到您的 Xcode 工程中,在添加 frameworks 的时候,请勾选 `Copy items if needed` 。

> sdkbox.framework

> PluginAppodeal.framework

> Appodeal.framework

> plugin_appodeal_res_bundle

上面的 frameworks 依赖于大量其他 frameworks。如果您没有添加它们,您也需要添加下列这些系统 frameworks:

> AdSupport.framework

> AudioToolbox.framework

> AVFoundation.framework

> CFNetwork.framework

> CoreFoundation.framework

> CoreGraphics.framework

> CoreImage.framework

> CoreLocation.framework

> CoreMedia.framework

> CoreMotion.framework

> CoreTelephony.framework

> EventKit.framework

> EventKitUI.framework

> libc++.tbd

> libsqlite3.tbd

> libxml2.2.tbd

> libz.tbd

> MediaPlayer.framework

> MessageUI.framework

> MobileCoreServices.framework

> QuartzCore.framework

> Security.framework

> Social.framework

> StoreKit.framework

> SystemConfiguration.framework

> Twitter.framework

> UIKit.framework

> WebKit.framework

> GameController.framework


text:
<?php

    include_once 'headOpen.php';
    include_once 'headExtIncl.php';
    include_once 'headHamBurEnd.php';
    include 'headerNav.php';

echo "

        <content>";

    include 'addTop.php'
?>

An Introduction To Programming With Processing

Display Window

  In our Hello World 1.0 program after pressing the Run button you will notice that a new smaller window was created. This is the Display Window and because Processing is a visually oriented language it automatically creates this window which you will usually use to draw to.
The default Display Window has dimensions 100 pixels in width by 100 pixels in height and it is automatically created when we run a sketch.

The size() function.

The size() function allows you to specify the dimensions of the Display Window in pixels. You use the size() function by supplying two parameters to it, a width value which defines the horizontal dimension of the Display Window and a height value which defines the vertical dimension of the Display Window. Just like the println() function, parameters for the size() function are entered between the function's parenthesis. For example if we wanted the dimension of the Display Window to be 640 pixels across by 480 pixels down we would type:

size(640,480);

                            Note that because we have just entered a statement telling Processing how big we want the Display Window to be we must terminate this statement with a semi-colon. You might also have noted that the two values 640 and 480 are separated with a comma. Do not try to separate parameter values such as these with a semi-colon because the statement is incomplete at that point and you are therefore attempting to terminate it prematurely. This will most commonly result in a syntax error or even worse in a logical error in some cases.
Parenthesis following a function's name is usually reserved for parameters relating to the function and these parameters are most commonly separated by commas. This is pretty easy to remember because in English you generally list items by separating them with a comma in Processing and many other higher level languages you separate parameter values for a function with a comma.
The two values 640 and 480 have been "listed" in this particular order because when Processing accepts parameters of dimensional type like X and Y or width and height in 2 dimensions, or X, Y and Z or width, height and depth in 3 dimensions it will generally accept values in the order X or width first, Y or height second and Z or depth third. This is with the exception of a trigonometric function called atan2() in which Y is read first followed by X due to the special circumstances of how this function works. Incidentally many other programming languages besides Processing accept parameters in that particular order for the atan2() function and in the standard format of X, Y, Z or width, height, depth for most other functions. Below the first statement type the second statement so that your code now reads:

println("Hello World");
size(640,480);

<?php
    include 'addBottom.php';
    include 'processingBNav01.php';

echo "";
    include 'processingBNav02.php';
echo "Logical Errors";

    include 'processingBNav03.php';

echo "";
     include 'processingBNav04.php';
echo "Standardized Coding Practices";

    include 'processingBNav05.php';

echo "

			</content>";

    include 'sideBarOpen.php';
    include 'processingNavMain.php';
    include 'sideBarClose.php';

echo "

";

    include 'footer.php';
    include 'analytics.php';
    include 'mainHTMLClose.php'
?>


text:
package com.amazonaws.ant.codedeploy;

/**
 * A class containing properties and references for tasks in the project to use
 * to communicate certain elements with each other
 */
public interface Constants extends com.amazonaws.ant.Constants {
    public static final String DEPLOYMENT_ID_PROPERTY = "deploymentId";
}


text:
<?php
// Vivu Esperanto cxiam!
// Traduko fare de Antono Vasiljev (anders[#]brainactive.org)

$ADODB_LANG_ARRAY = array (
             'LANG'                      => 'eo',
            DB_ERROR                    => 'nekonata eraro',
            DB_ERROR_ALREADY_EXISTS     => 'jam ekzistas',
            DB_ERROR_CANNOT_CREATE      => 'maleblas krei',
            DB_ERROR_CANNOT_DELETE      => 'maleblas elimini',
            DB_ERROR_CANNOT_DROP        => 'maleblas elimini (drop)',
            DB_ERROR_CONSTRAINT         => 'rompo de kondicxoj de provo',
            DB_ERROR_DIVZERO            => 'divido per 0 (nul)',
            DB_ERROR_INVALID            => 'malregule',
            DB_ERROR_INVALID_DATE       => 'malregula dato kaj tempo',
            DB_ERROR_INVALID_NUMBER     => 'malregula nombro',
            DB_ERROR_MISMATCH           => 'eraro',
            DB_ERROR_NODBSELECTED       => 'datumbazo ne elektita',
            DB_ERROR_NOSUCHFIELD        => 'ne ekzistas kampo',
            DB_ERROR_NOSUCHTABLE        => 'ne ekzistas tabelo',
            DB_ERROR_NOT_CAPABLE        => 'DBMS ne povas',
            DB_ERROR_NOT_FOUND          => 'ne trovita',
            DB_ERROR_NOT_LOCKED         => 'ne blokita',
            DB_ERROR_SYNTAX             => 'sintaksa eraro',
            DB_ERROR_UNSUPPORTED        => 'ne apogata',
            DB_ERROR_VALUE_COUNT_ON_ROW => 'nombrilo de valoroj en linio',
            DB_ERROR_INVALID_DSN        => 'malregula DSN-o',
            DB_ERROR_CONNECT_FAILED     => 'konekto malsukcesa',
            0                               => 'cxio bone', // DB_OK
            DB_ERROR_NEED_MORE_DATA     => 'ne suficxe da datumo',
            DB_ERROR_EXTENSION_NOT_FOUND=> 'etendo ne trovita',
            DB_ERROR_NOSUCHDB           => 'datumbazo ne ekzistas',
            DB_ERROR_ACCESS_VIOLATION   => 'ne suficxe da rajto por atingo'
);
?>


text:
.. _nuspatsourcespool:

nuspatsourcespool
===========================================

.. class:: nuspatsourcespool.NUSPATSourcesPool(bambou.nurest_object.NUMetaRESTObject,):

The list of source IPs from the provider domain to be SPATed.

Attributes
----------

- ``name``: The name for this address pool

- ``family``: The IP address family. Supported IPV4 for the time being.

- ``last_updated_by``: ID of the user who last updated the object.

- ``last_updated_date``: Time stamp when this object was last updated.

- ``address_list`` (**Mandatory**): The collection of IP addresses that will SPATed in the customer domain.

- ``embedded_metadata``: Metadata objects associated with this entity. This will contain a list of Metadata objects if the API request is made using the special flag to enable the embedded Metadata feature. Only a maximum of Metadata objects is returned based on the value set in the system configuration.

- ``entity_scope``: Specify if scope of entity is Data center or Enterprise level

- ``creation_date``: Time stamp when this object was created.

- ``owner``: Identifies the user that has created this object.

- ``external_id``: External object ID. Used for integration with third party systems

Children
--------

================================================================================================================================================               ==========================================================================================
**class**                                                                                **fetcher**

:ref:`nupermission.NUPermission<nupermission>`                                                                                ``permissions``
:ref:`numetadata.NUMetadata<numetadata>`                                                                                ``metadatas``
:ref:`nuglobalmetadata.NUGlobalMetadata<nuglobalmetadata>`                                                                                ``global_metadatas``
================================================================================================================================================               ==========================================================================================

Parents
--------

- :ref:`nudomain.NUDomain<nudomain>`

- :ref:`nuaggregateddomain.NUAggregatedDomain<nuaggregateddomain>`


text:
package xyz.zimuju.master.constant;

public class ShareConstants {

    public static final String APP_OFFICIAL_WEBSITE = "https://github.com/TommyLemon/ZBLibrary";
    public static final String APP_OFFICIAL_WEIBO = "weibo.com/5225556360";
    public static final String APP_OFFICIAL_BLOG = "http://my.oschina.net/u/2437072";
    public static final String APP_OFFICIAL_EMAIL = "1184482681@qq.com";
    public static final String APP_DOWNLOAD_WEBSITE = "http://files.cnblogs.com/files/tommylemon/ZBLibraryDemoApp.apk";

    public static final String APP_DEVELOPER_WEBSITE = "https://github.com/TommyLemon";

    public static final String UPDATE_LOG_WEBSITE = "github.com/TommyLemon/Android-ZBLibrary/commits/master";

}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="keywords" content="Hotel,Table Reservation,Booking,Marriage,Halls,Gardens,Decorators,Music,Dj,Resorts,Function halls" />
    <meta name="description" content="Our Plan, Your Joy.Table reservation app,custom search for any restaurant,marriage is made easier">
    <meta name="author" content="Plan Here">
    <title>Sign in | Plan Here</title>

    <link rel="apple-touch-icon" sizes="57x57" href="./favicons/apple-icon-57x57.png">
		<link rel="apple-touch-icon" sizes="60x60" href="./favicons/apple-icon-60x60.png">
		<link rel="apple-touch-icon" sizes="72x72" href="./favicons/apple-icon-72x72.png">
		<link rel="apple-touch-icon" sizes="76x76" href="./favicons/apple-icon-76x76.png">
		<link rel="apple-touch-icon" sizes="114x114" href="./favicons/apple-icon-114x114.png">
		<link rel="apple-touch-icon" sizes="120x120" href="./favicons/apple-icon-120x120.png">
		<link rel="apple-touch-icon" sizes="144x144" href="./favicons/apple-icon-144x144.png">
		<link rel="apple-touch-icon" sizes="152x152" href="./favicons/apple-icon-152x152.png">
		<link rel="apple-touch-icon" sizes="180x180" href="./favicons/apple-icon-180x180.png">
		<link rel="icon" type="image/png" sizes="192x192"  href="./favicons/android-icon-192x192.png">
		<link rel="icon" type="image/png" sizes="32x32" href="./favicons/favicon-32x32.png">
		<link rel="icon" type="image/png" sizes="96x96" href="./favicons/favicon-96x96.png">
		<link rel="icon" type="image/png" sizes="16x16" href="./favicons/favicon-16x16.png">
		<link rel="manifest" href="./favicons/manifest.json">
		<meta name="msapplication-TileColor" content="#ffffff">
		<meta name="msapplication-TileImage" content="./favicons/ms-icon-144x144.png">
		<meta name="theme-color" content="#ffffff">

    <link href="css/base.css" rel="stylesheet">

    <link href="css/flickity.css" rel="stylesheet">

   <link href='http://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
   <link href='http://fonts.googleapis.com/css?family=Gochi+Hand' rel='stylesheet' type='text/css'>
   <link href='http://fonts.googleapis.com/css?family=Lato:300,400' rel='stylesheet' type='text/css'>

    <?php
        include('./head_fun.php');
    ?>

    <?php
        include('./header.php');
    ?>

Sign In

                            <form action="loginbe.php" method="POST">

                                 Facebook

                                Twitter

or

                                    Username
                                    <input type="text" name="username" class=" form-control " placeholder="Username">

                                    Password
                                    <input type="password" name="password" class=" form-control" placeholder="Password">

                                    Forgot Password?

                                Sign in
                                Register

                            </form>

    <?php
        include('./footer.php');
    ?>


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginLeft="16dp"
              android:layout_marginTop="16dp"
    >
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_marginRight="4dp"
        >
        <ImageView android:id="@+id/crime_photo"
                   android:layout_width="80dp"
                   android:layout_height="80dp"
                   android:scaleType="centerInside"
                   android:background="@android:color/darker_gray"
                   android:cropToPadding="true"/>
        <ImageButton android:id="@+id/crime_camera"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:src="@android:drawable/ic_menu_camera"
            />
    </LinearLayout>
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_weight="1"
        >
        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/crime_title_label"
            style="?android:listSeparatorTextViewStyle"
            />
        <EditText android:id="@+id/crime_title"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginRight="16dp"
                  android:hint="@string/crime_title_hint"
            />
    </LinearLayout>
</LinearLayout>


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">

        <LinearLayout
            android:id="@+id/test"
            android:orientation="vertical"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" >

            <Button
                android:id="@+id/BbtnTranslate"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:onClick="startInsertionAtStart"
                android:text="Animate insertion at start" />

            <Button
                android:id="@+id/btnInsertAtEnd"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:onClick="startInsertionAtEnd"
                android:text="Animate insertion at end" />

            <!--<Button
                android:id="@+id/btnScaleAndRotate"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:onClick="startAnimationScaleAndRotate"
                android:text="Scale and Rotate" >
            </Button>-->

        </LinearLayout>

    </LinearLayout>

    <LinearLayout android:id="@+id/container"
        android:animateLayoutChanges="true"
        android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>

</LinearLayout>


text:
#ifndef __CROS_EC_NPCX_MONITOR_H
#define __CROS_EC_NPCX_MONITOR_H

#include <stdint.h>

#define NPCX_MONITOR_UUT_TAG 0xA5075001
#define NPCX_MONITOR_HEADER_ADDR 0x200C3000

/* Flag to record the progress of programming SPI flash */
#define SPI_PROGRAMMING_FLAG 0x200C4000

struct monitor_header_tag {
	/* offset 0x00: TAG NPCX_MONITOR_TAG */
	uint32_t tag;
	/* offset 0x04: Size of the binary being programmed (in bytes) */
	uint32_t size;
	/* offset 0x08: The RAM address of the binary to program into the SPI */
	uint32_t src_addr;
	/* offset 0x0C: The Flash address to be programmed (Absolute address) */
	uint32_t dest_addr;
	/* offset 0x10: Maximum allowable flash clock frequency */
	uint8_t max_clock;
	/* offset 0x11: SPI Flash read mode */
	uint8_t read_mode;
	/* offset 0x12: Reserved */
	uint16_t reserved;
} __packed;

#endif /* __CROS_EC_NPCX_MONITOR_H */


text:
import { expect } from 'chai';
import { describe, it } from 'mocha';

import { parse, Source, GraphQLError, formatError } from '../../';

describe('GraphQLError', () => {
  it('is a class and is a subclass of Error', () => {
    expect(new GraphQLError()).to.be.instanceof(Error);
    expect(new GraphQLError()).to.be.instanceof(GraphQLError);
  });

  it('has a name, message, and stack trace', () => {
    const e = new GraphQLError('msg');
    expect(e.name).to.equal('GraphQLError');
    expect(e.stack).to.be.a('string');
    expect(e.message).to.equal('msg');
  });

  it('uses the stack of an original error', () => {
    const original = new Error('original');
    const e = new GraphQLError(
      'msg',
      undefined,
      undefined,
      undefined,
      undefined,
      original,
    );
    expect(e.name).to.equal('GraphQLError');
    expect(e.stack).to.equal(original.stack);
    expect(e.message).to.equal('msg');
    expect(e.originalError).to.equal(original);
  });

  it('creates new stack if original error has no stack', () => {
    const original = { message: 'original' };
    const e = new GraphQLError('msg', null, null, null, null, original);
    expect(e.name).to.equal('GraphQLError');
    expect(e.stack).to.be.a('string');
    expect(e.message).to.equal('msg');
    expect(e.originalError).to.equal(original);
  });

  it('converts nodes to positions and locations', () => {
    const source = new Source(`{
      field
    }`);
    const ast = parse(source);
    const fieldNode = ast.definitions[0].selectionSet.selections[0];
    const e = new GraphQLError('msg', [fieldNode]);
    expect(e.nodes).to.deep.equal([fieldNode]);
    expect(e.source).to.equal(source);
    expect(e.positions).to.deep.equal([8]);
    expect(e.locations).to.deep.equal([{ line: 2, column: 7 }]);
  });

  it('converts single node to positions and locations', () => {
    const source = new Source(`{
      field
    }`);
    const ast = parse(source);
    const fieldNode = ast.definitions[0].selectionSet.selections[0];
    const e = new GraphQLError('msg', fieldNode); // Non-array value.
    expect(e.nodes).to.deep.equal([fieldNode]);
    expect(e.source).to.equal(source);
    expect(e.positions).to.deep.equal([8]);
    expect(e.locations).to.deep.equal([{ line: 2, column: 7 }]);
  });

  it('converts node with loc.start === 0 to positions and locations', () => {
    const source = new Source(`{
      field
    }`);
    const ast = parse(source);
    const operationNode = ast.definitions[0];
    const e = new GraphQLError('msg', [operationNode]);
    expect(e.nodes).to.deep.equal([operationNode]);
    expect(e.source).to.equal(source);
    expect(e.positions).to.deep.equal([0]);
    expect(e.locations).to.deep.equal([{ line: 1, column: 1 }]);
  });

  it('converts source and positions to locations', () => {
    const source = new Source(`{
      field
    }`);
    const e = new GraphQLError('msg', null, source, [10]);
    expect(e.nodes).to.equal(undefined);
    expect(e.source).to.equal(source);
    expect(e.positions).to.deep.equal([10]);
    expect(e.locations).to.deep.equal([{ line: 2, column: 9 }]);
  });

  it('serializes to include message', () => {
    const e = new GraphQLError('msg');
    expect(JSON.stringify(e)).to.equal('{"message":"msg"}');
  });

  it('serializes to include message and locations', () => {
    const node = parse('{ field }').definitions[0].selectionSet.selections[0];
    const e = new GraphQLError('msg', [node]);
    expect(JSON.stringify(e)).to.equal(
      '{"message":"msg","locations":[{"line":1,"column":3}]}',
    );
  });

  it('serializes to include path', () => {
    const e = new GraphQLError('msg', null, null, null, [
      'path',
      3,
      'to',
      'field',
    ]);
    expect(e.path).to.deep.equal(['path', 3, 'to', 'field']);
    expect(JSON.stringify(e)).to.equal(
      '{"message":"msg","path":["path",3,"to","field"]}',
    );
  });

  it('default error formatter includes path', () => {
    const e = new GraphQLError('msg', null, null, null, [
      'path',
      3,
      'to',
      'field',
    ]);

    expect(formatError(e)).to.deep.equal({
      message: 'msg',
      locations: undefined,
      path: ['path', 3, 'to', 'field'],
    });
  });

  it('default error formatter includes extension fields', () => {
    const e = new GraphQLError('msg', null, null, null, null, null, {
      foo: 'bar',
    });

    expect(formatError(e)).to.deep.equal({
      message: 'msg',
      locations: undefined,
      path: undefined,
      extensions: { foo: 'bar' },
    });
  });
});


text:
package com.mocircle.flow.handler.node;

import com.mocircle.android.logging.CircleLog;
import com.mocircle.flow.model.FlowNode;
import com.mocircle.flow.model.NullNode;
import com.mocircle.flow.model.Token;
import com.mocircle.flow.model.control.CustomControlNode;

import java.util.ArrayList;
import java.util.List;

/**
 * Handler for {@link CustomControlNode}.
 */
public class CustomControlNodeHandler extends AbstractFlowNodeHandler {

    private static final String TAG = "CustomControlNodeHandler";

    @Override
    public boolean isSupported(FlowNode node) {
        return node instanceof CustomControlNode;
    }

    @Override
    public NodeHandleResult handleNode(FlowNode node) {
        List<FlowNode> nextNodes = new ArrayList<>();

        CustomControlNode control = (CustomControlNode) node;
        String[] types = control.getAcceptedTokenTypes();
        Token outToken = control.getOutgoingToken();
        List<FlowNode> nodes = control.getOutgoingNodes(types);
        if (nodes.size() == 0) {
            NullNode next = new NullNode();
            next.receiveToken(control, outToken);
            nextNodes.add(next);
            CircleLog.w(TAG, "Cannot find outgoing node, auto create NullNode for it.");
        } else {
            for (FlowNode n : nodes) {
                n.receiveToken(control, outToken);
                nextNodes.add(n);
            }
        }
        control.destroyToken();
        return new NodeHandleResult(nextNodes, outToken);
    }
}


text:
'use strict';

if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) {
    console.log('Make sure the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are set.');

    process.exit(1);
}

var customLaunchers = {
    sauceLabsInternetExplorer9: {
        base: 'SauceLabs',
        browserName: 'internet explorer',
        platform: 'Windows 7',
        version: '9.0'
    },
    sauceLabsInternetExplorer10: {
        base: 'SauceLabs',
        browserName: 'internet explorer',
        platform: 'Windows 7',
        version: '10.0'
    },
    sauceLabsInternetExplorer11: {
        base: 'SauceLabs',
        browserName: 'internet explorer',
        platform: 'Windows 7',
        version: '11.0'
    },
    sauceLabsChrome: {
        base: 'SauceLabs',
        browserName: 'chrome',
        platform: 'Linux',
        version: '39.0'
    },
    sauceLabsFirefox: {
        base: 'SauceLabs',
        browserName: 'firefox',
        platform: 'Linux',
        version: '34.0'
    },
    sauceLabsSafari7: {
        base: 'SauceLabs',
        browserName: 'safari',
        platform: 'Mac 10.9',
        version: '7.0'
    },
    sauceLabsSafari8: {
        base: 'SauceLabs',
        browserName: 'safari',
        platform: 'Mac 10.10',
        version: '8.0'
    }
};

module.exports = function (config) {
    config.set({
        autoWatch: false,
        browsers: Object.keys(customLaunchers),
        captureTimeout: 120000,
        colors: true,
        customLaunchers: customLaunchers,
        files: [
            'test/ts.test.js'
        ],
        frameworks: [
            'browserify',
            'mocha'
        ],
        logLevel: 'LOG_DEBUG',
        preprocessors: {
            'test/ts.test.js': 'browserify'
        },
        reporters: [
            'saucelabs',
            'spec'
        ],
        sauceLabs: {
            connectOptions: {
                port: 5757
            },
            recordScreenshots: false,
            testName: 'typesystem browser test'
        },
        singleRun: true,
        browserify: {
            debug: true
        }
    });
};


text:
package ru.fabrikant.api.multi_integration.easuz.types;

import javax.xml.bind.annotation.XmlRegistry;

/**
 * This object contains factory methods for each
 * Java content interface and Java element interface
 * generated in the ru.fabrikant.api.multi_integration.easuz.types package.
 * <p>An ObjectFactory allows you to programatically
 * construct new instances of the Java representation
 * for XML content. The Java representation of XML
 * content can consist of schema derived interfaces
 * and classes representing the binding of schema
 * type definitions, element declarations and model
 * groups.  Factory methods for each of these are
 * provided in this class.
 *
 */
@XmlRegistry
public class ObjectFactory {

    /**
     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: ru.fabrikant.api.multi_integration.easuz.types
     *
     */
    public ObjectFactory() {
    }

    /**
     * Create an instance of {@link Header }
     *
     */
    public Header createHeader() {
        return new Header();
    }

    /**
     * Create an instance of {@link ErrorData }
     *
     */
    public ErrorData createErrorData() {
        return new ErrorData();
    }

    /**
     * Create an instance of {@link Customer }
     *
     */
    public Customer createCustomer() {
        return new Customer();
    }

    /**
     * Create an instance of {@link FileInstance }
     *
     */
    public FileInstance createFileInstance() {
        return new FileInstance();
    }

}


text:
const Statement = require('../entities/Statement.js');

class IfElseStatement extends Statement {
  constructor(condition, body, elseStmt) {
    super();
    this.condition = condition;
    this.body = body;
    this.elseStmt = elseStmt;
  }
  analyze(context) {
    console.log("pre condition analyzed");
    this.condition.analyze(context);
    console.log('condition analyzed');
    // this.condition.type.mustBeBoolean('Condition in "if else" statement must be boolean');
    this.body.analyze(context);
    if (this.elseStmt) {
      return this.elseStmt.analyze(context);
    }
  }
  optimize() {
    return this;
  }
  toString() {
    return (`(IfElseStatement if ${this.condition} { ${this.body} } else { ${this.elseStmt} })`);
  }
}

module.exports = IfElseStatement;


text:
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/**
 * @fileoverview The issue object shared between component extension
 *  and Chrome media router.
 */

goog.provide('mr.Issue');
goog.provide('mr.IssueAction');
goog.provide('mr.IssueSeverity');

goog.require('mr.Assertions');

/**
 * Note: keep synced with the issue severity supported by MR's issue manager.
 * @enum {string}
 * @export
 */
mr.IssueSeverity = {
  FATAL: 'fatal',
  WARNING: 'warning',
  NOTIFICATION: 'notification'
};

/**
 * Note: keep synced with the issue actions supported by MR's issue manager.
 * @enum {string}
 * @export
 */
mr.IssueAction = {
  DISMISS: 'dismiss',
  LEARN_MORE: 'learn_more'
};

mr.Issue = class {
  /**
   * @param {string} title
   * @param {mr.IssueSeverity} severity
   */
  constructor(title, severity) {
    /**
     * @type {?string}
     * @export
     */
    this.routeId = null;

    /**
     * @type {?string}
     * @export
     */
    this.sinkId = null;

    /**
     * @type {mr.IssueSeverity}
     * @export
     */
    this.severity = severity;

    /**
     * When true, this issue takes the whole dialog.
     * @type {boolean}
     * @export
     */
    this.isBlocking = this.severity == mr.IssueSeverity.FATAL ? true : false;

    /**
     * Short description about the issue. Localized string.
     * @type {string}
     * @export
     */
    this.title = title;

    /**
     * Message about issue detail or how to handle issue.
     * Messages should be suitable for end users to decide which actions to
     * take.
     * @type {?string}
     * @export
     */
    this.message = null;

    /**
     * @type {mr.IssueAction}
     * @export
     */
    this.defaultAction = mr.IssueAction.DISMISS;

    /**
     * @type {Array.<mr.IssueAction>}
     * @export
     */
    this.secondaryActions = null;

    /**
     * Required if one action is LEARN_MORE.
     * @type {?number}
     * @export
     */
    this.helpPageId = null;
  }

  /**
   * Sets the action to LEARN_MORE and sets the pageId that is required by the
   * action for targeting.
   * @param {number} pageId
   * @return {!mr.Issue} This object.
   */
  setDefaultActionLearnMore(pageId) {
    mr.Assertions.assert(pageId > 0);
    this.helpPageId = pageId;
    this.defaultAction = mr.IssueAction.LEARN_MORE;
    return this;
  }

  /**
   * @param {Array.<mr.IssueAction>} secondaryActions
   * @return {!mr.Issue} This object.
   */
  setSecondaryActions(secondaryActions) {
    this.secondaryActions = secondaryActions;
    return this;
  }

  /**
   * @param {string} message
   * @return {!mr.Issue} This object.
   */
  setMessage(message) {
    this.message = message;
    return this;
  }

  /**
   * @param {boolean} isBlocking
   * @return {!mr.Issue} This object.
   */
  setIsBlocking(isBlocking) {
    if (!isBlocking && this.severity == mr.IssueSeverity.FATAL) {
      throw Error('All FATAL issues must be blocking.');
    }
    this.isBlocking = isBlocking;
    return this;
  }

  /**
   * @param {string} routeId
   * @return {!mr.Issue} This object.
   */
  setRouteId(routeId) {
    this.routeId = routeId;
    return this;
  }

  /**
   * @param {string} sinkId
   * @return {!mr.Issue} This object.
   */
  setSinkId(sinkId) {
    this.sinkId = sinkId;
    return this;
  }
};


text:
from pybamboo.utils import safe_json_loads, safe_json_dumps
from pybamboo.tests.test_base import TestBase

class TestUtils(TestBase):

    def test_safe_json_loads(self):
        valid_json = '{"key": "value"}'
        invalid_json = '{"key": "value",}'
        try:
            safe_json_loads(valid_json, Exception)
        except Exception:  # pragma: no cover
            self.fail('Raised error on valid JSON.')
        with self.assertRaises(Exception):
            safe_json_loads(invalid_json, Exception)

    def test_safe_json_dumps(self):
        pass


text:
jQuery(function() {
       jQuery(document).ready( function($) {
                $('#fullscreenslider').slideshoWp({
                        color: setting.bordercolor
                });
        });

    });


text:
import gd from 'node-gd';
import { fromString } from './utils/randomNumber';

const defaultOptions = {
  size: 120,
};

export default async function monsterId(username = '', options = defaultOptions) {
  const { size } = options;
  const getRandomNumber = fromString(username);
  const monster = await gd.createTrueColor(size, size);
  const color = monster.colorAllocate(255, 255, 255);

  monster.fill(0, 0, color);

  const parts = {
    legs: getRandomNumber(1, 5),
    hair: getRandomNumber(1, 5),
    arms: getRandomNumber(1, 5),
    body: getRandomNumber(1, 15),
    eyes: getRandomNumber(1, 15),
    mouth: getRandomNumber(1, 10),
  };

  // eslint-disable-next-line no-restricted-syntax
  for (const [part] of Object.entries(parts)) {
    const path = `${__dirname}/../images/parts/${part}_${parts[part]}.png`;
    // eslint-disable-next-line no-await-in-loop
    const image = await gd.createFromPng(path);
    image.copyResized(monster, 0, 0, 0, 0, size, size, 120, 120);

    if (part === 'body') {
      monster.fill(0, 0, monster.colorAllocate(
        getRandomNumber(55, 200),
        getRandomNumber(55, 200),
        getRandomNumber(55, 200),
      ));
    }
  }

  return monster.pngPtr();
}


text:
namespace fsdict {
    typedef fsdict::PatternWeights PatternProbabilities;
}

#endif


text:
package com.contextawareframework.dbmanager;

import java.util.ArrayList;
import java.util.List;

import com.contextawareframework.globalvariable.CAFConfig;
import com.contextawareframework.sensors.positionsensors.Proximity;

import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

/**
 * This is a database helper class for all CRUD operation on Proximity Sensor in Android
 */
public class  ProximityDbHelper{

	// Database fields
	private SQLiteDatabase database;
	private ContextAwareSQLiteHelper dbHelper;
	private String TAG =  "ProximityDbHelper" ;
	private static ProximityDbHelper proximityDbHelper;
	private boolean enableDebugging = CAFConfig.isEnableDebugging();

	private String[] allColumns = { ContextAwareSQLiteHelper.COLUMN_PROXIMITY_ID,
			ContextAwareSQLiteHelper.COLUMN_PROXIMITY_TIMESTAMP, ContextAwareSQLiteHelper.COLUMN_PROXIMITY_NEAR, ContextAwareSQLiteHelper.COLUMN_PROXIMITY_FAR};
	/**
	 * Default Constructor
	 */
	private ProximityDbHelper(Context context) {
		dbHelper = new ContextAwareSQLiteHelper(context);
	}

	public static synchronized ProximityDbHelper getInstance(Context context)
	{
		if (proximityDbHelper == null)
			proximityDbHelper = new ProximityDbHelper(context);

		return proximityDbHelper;
	}

	/**
	 * Method to open the database for writing
	 */
	public void open() throws SQLException {
		database = dbHelper.getWritableDatabase();
	}

	/**
	 * Method to open the database in read only mode
	 */
	public void openReadOnly()
	{
		try
		{
			database = dbHelper.getReadableDatabase();
		}
		catch(SQLException e)
		{
			e.printStackTrace();
		}
	}
	/**
	 * Method to close the database connection
	 */
	public void close() {
		dbHelper.close();
	}

	/**
	 * Method to create insert a row of data into the database
	 */
	public Proximity createProximiytRowData(long timestamp,float near, float far)
	{
		ContentValues values = new ContentValues();
		Proximity newRow = null;
		try{
			values.put(ContextAwareSQLiteHelper.COLUMN_PROXIMITY_TIMESTAMP, timestamp);
			values.put(ContextAwareSQLiteHelper.COLUMN_PROXIMITY_NEAR,near);
			values.put(ContextAwareSQLiteHelper.COLUMN_PROXIMITY_FAR, far);

			long insertId = database.insert(ContextAwareSQLiteHelper.TABLE_PROXIMITY, null,
					values);
			Cursor cursor = database.query(ContextAwareSQLiteHelper.TABLE_PROXIMITY,
					allColumns, ContextAwareSQLiteHelper.COLUMN_PROXIMITY_ID + " = " + insertId, null,
					null, null, null);
			cursor.moveToFirst();
			newRow = cursorToProximityRow(cursor);
			cursor.close();
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		if(enableDebugging)
		{
			Log.d(TAG,"createAccelRowDataMethod");
		}
		return newRow;
	}

	/**
	 * Method to delete a row from database
	 */
	public void deleteProximityRowData(Proximity proximity) {
		try
		{
			long id = proximity.getId();
			System.out.println("Comment deleted with id: " + id);
			database.delete(ContextAwareSQLiteHelper.TABLE_PROXIMITY, ContextAwareSQLiteHelper.COLUMN_PROXIMITY_ID
					+ " = " + id, null);
		}
		catch(SQLException e)
		{
			e.printStackTrace();
		}
	}
	/**
	 * Method to list all row of the Proximity table
	 */
	public List<Proximity> getAllRows() {
		List<Proximity> proximityRow = new ArrayList<Proximity>();
		try
		{
			Cursor cursor = database.query(ContextAwareSQLiteHelper.TABLE_PROXIMITY,
					allColumns, null, null, null, null, null);

			cursor.moveToFirst();
			while (!cursor.isAfterLast()) {
				Proximity proximity = cursorToProximityRow(cursor);
				proximityRow.add(proximity);
				cursor.moveToNext();
			}
			// Make sure to close the cursor
			cursor.close();
		}
		catch(SQLException e)
		{
			e.printStackTrace();
		}
		if(enableDebugging)
		{
			Log.d(TAG,"createAccelRowDataMethod");
		}
		return proximityRow;
	}
	/**
	 * Method to intialize a Proximity POJO object
	 */
	private Proximity cursorToProximityRow(Cursor cursor) {
		Proximity proximityRow = new Proximity();
		try
		{
			proximityRow.setTimestamp(cursor.getLong(0));
			proximityRow.setNear(cursor.getFloat(1));
			proximityRow.setFar(cursor.getFloat(2));
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		if(enableDebugging)
		{
			Log.d(TAG,"createAccelRowDataMethod");
		}
		return proximityRow;
	}

	/**
	 * Method to enable debugging
	 * @param boolean
	 */
	public void setEnableDebugging(boolean value)
	{
		enableDebugging = value;
	}

	/**
	 * Method to get the present value of enableDebugging
	 * @return boolean
	 */
	public boolean getEnableDebugging()
	{
		return enableDebugging;
	}
}


text:
package com.facebook.hive.orc;

import static junit.framework.Assert.assertEquals;

import java.nio.ByteBuffer;
import java.util.Random;

import com.facebook.hive.orc.compression.CompressionCodec;
import com.facebook.hive.orc.compression.ZlibCodec;
import org.apache.hadoop.hive.serde2.ReaderWriterProfiler;
import org.junit.Test;

import com.facebook.hive.orc.OrcProto.RowIndex;
import com.facebook.hive.orc.OrcProto.RowIndexEntry;
import com.facebook.hive.orc.WriterImpl.RowIndexPositionRecorder;

public class TestRunLengthIntegerReader {

  public void runSeekTest(CompressionCodec codec) throws Exception {
    TestInStream.OutputCollector collect = new TestInStream.OutputCollector();
    ReaderWriterProfiler.setProfilerOptions(null);
    RunLengthIntegerWriter out = new RunLengthIntegerWriter(
        new OutStream("test", 1000, codec, collect, new MemoryEstimate()), true, 4, true);
    RowIndex.Builder rowIndex = OrcProto.RowIndex.newBuilder();
    RowIndexEntry.Builder rowIndexEntry = OrcProto.RowIndexEntry.newBuilder();
    WriterImpl.RowIndexPositionRecorder rowIndexPosition = new RowIndexPositionRecorder(rowIndexEntry);
    Random random = new Random(99);
    int[] junk = new int[2048];
    for(int i=0; i < junk.length; ++i) {
      junk[i] = random.nextInt();
    }
    for(int i=0; i < 4096; ++i) {
      out.getPosition(rowIndexPosition);
      rowIndex.addEntry(rowIndexEntry.build());
      rowIndexEntry.clear();
      // test runs, incrementing runs, non-runs
      if (i < 1024) {
        out.write(i/4);
      } else if (i < 2048) {
        out.write(2*i);
      } else {
        out.write(junk[i-2048]);
      }
    }
    out.flush();
    ByteBuffer inBuf = ByteBuffer.allocate(collect.buffer.size());
    collect.buffer.setByteBuffer(inBuf, 0, collect.buffer.size());
    inBuf.flip();
    ReaderWriterProfiler.setProfilerOptions(null);
    RunLengthIntegerReader in = new RunLengthIntegerReader(InStream.create
        ("test", inBuf, codec, 1000, true), true, 4);
    for(int i=0; i < 2048; ++i) {
      int x = (int) in.next();
      if (i < 1024) {
        assertEquals(i/4, x);
      } else if (i < 2048) {
        assertEquals(2*i, x);
      } else {
        assertEquals(junk[i-2048], x);
      }
    }
    in.loadIndeces(rowIndex.build().getEntryList(), 0);
    for(int i=2047; i >= 0; --i) {
      in.seek(i);
      int x = (int) in.next();
      if (i < 1024) {
        assertEquals(i/4, x);
      } else if (i < 2048) {
        assertEquals(2*i, x);
      } else {
        assertEquals(junk[i-2048], x);
      }
    }
  }

  @Test
  public void testUncompressedSeek() throws Exception {
    runSeekTest(null);
  }

  @Test
  public void testCompressedSeek() throws Exception {
    runSeekTest(new ZlibCodec());
  }

  @Test
  public void testSkips() throws Exception {
    TestInStream.OutputCollector collect = new TestInStream.OutputCollector();
    ReaderWriterProfiler.setProfilerOptions(null);
    RunLengthIntegerWriter out = new RunLengthIntegerWriter(
        new OutStream("test", 100, null, collect, new MemoryEstimate()), true, 4, true);
    for(int i=0; i < 2048; ++i) {
      if (i < 1024) {
        out.write(i);
      } else {
        out.write(256 * i);
      }
    }
    out.flush();
    ByteBuffer inBuf = ByteBuffer.allocate(collect.buffer.size());
    collect.buffer.setByteBuffer(inBuf, 0, collect.buffer.size());
    inBuf.flip();
    ReaderWriterProfiler.setProfilerOptions(null);
    RunLengthIntegerReader in = new RunLengthIntegerReader(InStream.create
        ("test", inBuf, null, 100, true), true, 4);
    for(int i=0; i < 2048; i += 10) {
      int x = (int) in.next();
      if (i < 1024) {
        assertEquals(i, x);
      } else {
        assertEquals(256 * i, x);
      }
      if (i < 2038) {
        in.skip(9);
      }
      in.skip(0);
    }
  }
}


text:
extract:
	${tooldir}/ecore2bgf QoS_Characteristic.ecore grammar.bgf

include ../../Makefile.grammar


text:
using Microsoft.VisualStudio.Services.Agent.Util;
using Moq;
using System;
using System.IO;
using Xunit;

namespace Microsoft.VisualStudio.Services.Agent.Tests.Listener
{
    public sealed class PagingLoggerL0
    {
        private const string LogData = "messagemessagemessagemessagemessagemessagemessagemessageXPLATmessagemessagemessagemessagemessagemessagemessagemessage";
        private const int PagesToWrite = 2;
        private Mock<IJobServerQueue> _jobServerQueue;

        public PagingLoggerL0()
        {
            _jobServerQueue = new Mock<IJobServerQueue>();
            PagingLogger.PagingFolder = "pages_" + Guid.NewGuid().ToString();
        }

        private void CleanLogFolder()
        {

            //clean test data if any old test forgot
            string pagesFolder = Path.Combine(IOUtil.GetDiagPath(), PagingLogger.PagingFolder);
            if (Directory.Exists(pagesFolder))
            {
                Directory.Delete(pagesFolder, true);
            }
        }

        //WriteAndShipLog test will write "PagesToWrite" pages of data,
        //verify file content on the disk and check if API to ship data is invoked
        [Fact]
        [Trait("Level", "L0")]
        [Trait("Category", "Common")]
        public void WriteAndShipLog()
        {
            CleanLogFolder();

            try
            {
                //Arrange
                using (var hc = new TestHostContext(this))
                {
                    var pagingLogger = new PagingLogger();
                    hc.SetSingleton<IJobServerQueue>(_jobServerQueue.Object);
                    pagingLogger.Initialize(hc);
                    Guid timeLineId = Guid.NewGuid();
                    Guid timeLineRecordId = Guid.NewGuid();
                    int totalBytes = PagesToWrite * PagingLogger.PageSize;
                    int bytesWritten = 0;
                    int logDataSize = System.Text.Encoding.UTF8.GetByteCount(LogData);
                    _jobServerQueue.Setup(x => x.QueueFileUpload(timeLineId, timeLineRecordId, It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), true))
                        .Callback((Guid timelineId, Guid timelineRecordId, string type, string name, string path, bool deleteSource) =>
                        {
                            bool fileExists = File.Exists(path);
                            Assert.True(fileExists);

                            using (var freader = new StreamReader(new FileStream(path, FileMode.Open, FileAccess.Read), System.Text.Encoding.UTF8))
                            {
                                string line;
                                while ((line = freader.ReadLine()) != null)
                                {
                                    Assert.True(line.EndsWith(LogData));
                                    bytesWritten += logDataSize;
                                }
                            }
                            File.Delete(path);
                        });

                    //Act
                    int bytesSent = 0;
                    pagingLogger.Setup(timeLineId, timeLineRecordId);
                    while (bytesSent < totalBytes)
                    {
                        pagingLogger.Write(LogData);
                        bytesSent += logDataSize;
                    }
                    pagingLogger.End();

                    //Assert
                    _jobServerQueue.Verify(x => x.QueueFileUpload(timeLineId, timeLineRecordId, It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), true), Times.AtLeast(PagesToWrite));
                    Assert.Equal(bytesSent, bytesWritten);
                }
            }
            finally
            {
                //cleanup
                CleanLogFolder();
            }
        }

        //Try to ship empty log
        [Fact]
        [Trait("Level", "L0")]
        [Trait("Category", "Common")]
        public void ShipEmptyLog()
        {
            CleanLogFolder();

            try
            {
                //Arrange
                using (var hc = new TestHostContext(this))
                {
                    var pagingLogger = new PagingLogger();
                    hc.SetSingleton<IJobServerQueue>(_jobServerQueue.Object);
                    pagingLogger.Initialize(hc);
                    Guid timeLineId = Guid.NewGuid();
                    Guid timeLineRecordId = Guid.NewGuid();
                    _jobServerQueue.Setup(x => x.QueueFileUpload(It.IsAny<Guid>(), It.IsAny<Guid>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), true));

                    //Act
                    pagingLogger.Setup(timeLineId, timeLineRecordId);
                    pagingLogger.End();

                    //Assert
                    _jobServerQueue.Verify(x => x.QueueFileUpload(It.IsAny<Guid>(), It.IsAny<Guid>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), true), Times.Exactly(0));
                }
            }
            finally
            {
                //cleanup
                CleanLogFolder();
            }
        }
    }
}


text: sudo apt-get install build-essential dh-make cdbs devscripts cmake qtbase5-dev cdbs git packaging-dev qtdeclarative5-dev qt5-default imagemagick


text:
<!DOCTYPE html>

        <title>George Mason University Department of Computer Science Prospective Student Survey</title>
         <link rel="stylesheet" type="text/css" href="lrhw2_styles.css"/>

  CS Department Information
  Larry Rodrigues Class Web Page
  Contact Larry Rodrigues
  Survey

George Mason University Department of Computer Science Prospective Student Survey

Please help us better understand our prospect Computer Science students by completing this survey

        <form action="" method="post" autocomplete="on">

                Username:	<input type="text" name="username"  size="20"  autocomplete="on" maxlength="20" autofocus="autofocus" required />
                Email Address:	<input required type="email" name="email" size="30"  autocomplete="on" maxlength="50" placeholder="name@domain-name.com" /> [name@domain-name.com]

                Name (First Last):	<input required type="text" name="namefirstlast"  size="30"  autocomplete="on" maxlength="50"/>
                Phone Number:	<input type="tel" name="phonenumber" pattern="\(\d{3}\)+\d{3}-\d{4}" placeholder="(###) ###-####"/> [(123)-456-7890]

                Street Address:	<input type="text" name="streetaddress"  size="100"  autocomplete="on" maxlength="100"/>

                City:	<input type="text" name="city"  size="30"  autocomplete="on" maxlength="50"/>
                State:	<select name="state" >
        <option value="--">----------</option>
	<option value="AL">Alabama</option>
	<option value="AK">Alaska</option>
	<option value="AZ">Arizona</option>
	<option value="AR">Arkansas</option>
	<option value="CA">California</option>
	<option value="CO">Colorado</option>
	<option value="CT">Connecticut</option>
	<option value="DE">Delaware</option>
	<option value="DC">District Of Columbia</option>
	<option value="FL">Florida</option>
	<option value="GA">Georgia</option>
	<option value="HI">Hawaii</option>
	<option value="ID">Idaho</option>
	<option value="IL">Illinois</option>
	<option value="IN">Indiana</option>
	<option value="IA">Iowa</option>
	<option value="KS">Kansas</option>
	<option value="KY">Kentucky</option>
	<option value="LA">Louisiana</option>
	<option value="ME">Maine</option>
	<option value="MD">Maryland</option>
	<option value="MA">Massachusetts</option>
	<option value="MI">Michigan</option>
	<option value="MN">Minnesota</option>
	<option value="MS">Mississippi</option>
	<option value="MO">Missouri</option>
	<option value="MT">Montana</option>
	<option value="NE">Nebraska</option>
	<option value="NV">Nevada</option>
	<option value="NH">New Hampshire</option>
	<option value="NJ">New Jersey</option>
	<option value="NM">New Mexico</option>
	<option value="NY">New York</option>
	<option value="NC">North Carolina</option>
	<option value="ND">North Dakota</option>
	<option value="OH">Ohio</option>
	<option value="OK">Oklahoma</option>
	<option value="OR">Oregon</option>
	<option value="PA">Pennsylvania</option>
	<option value="RI">Rhode Island</option>
	<option value="SC">South Carolina</option>
	<option value="SD">South Dakota</option>
	<option value="TN">Tennessee</option>
	<option value="TX">Texas</option>
	<option value="UT">Utah</option>
	<option value="VT">Vermont</option>
	<option value="VA">Virginia</option>
	<option value="WA">Washington</option>
	<option value="WV">West Virginia</option>
	<option value="WI">Wisconsin</option>
	<option value="WY">Wyoming</option>
</select>

                Home Page URL:	<input type="url" name="homepageurl"  placeholder="http://domain-name.com" size="30"  autocomplete="on" maxlength="50"/> [http://domain-name.com]

                Date Of Survey:	<input type="date" name="surveydate" pattern="yyyy-mm-dd" placeholder="yyyy-mm-dd"/> [yyyy-mm-dd]

                What is your high school graduation month and year?

                    <input type="text" name="hsgradmonth" placeholder="Select a Month" list="months"/>
                    <datalist id="months">
                        <option value="January"></option>
                        <option value="February"></option>
                        <option value="March"></option>
                        <option value="April"></option>
                        <option value="May"></option>
                        <option value="June"></option>
                        <option value="July"></option>
                        <option value="August"></option>
                        <option value="September"></option>
                        <option value="October"></option>
                        <option value="November"></option>
                        <option value="December"></option>
                    </datalist>

                    <input type="text" size="10" maxlength="4" minlength="4" placeholder="Year YYYY" pattern="[1,2][0-9][0-9][0-9]" /> [YYYY]

                What did you like best about the campus?

                      <input type="checkbox" name="campuslike" value="students" />Students

                      <input type="checkbox" name="campuslike" value="location" />Location

                      <input type="checkbox" name="campuslike" value="campus" />Campus

                      <input type="checkbox" name="campuslike" value="atmosphere" />Atmosphere

                      <input type="checkbox" name="campuslike" value="dormrooms" />Dorm Rooms

                      <input type="checkbox" name="campuslike" value="sports" />Sports

                How did you become interested in the University?

                      <input type="radio" name="interestind" value="friends" />Friends

                      <input type="radio" name="interestind" value="television" />Television

                      <input type="radio" name="interestind" value="internet" />Internet

                      <input type="radio" name="interestind" value="other" />Other

                How likely are you to recommend this school to other prospective students?

                    <select name="likelyrecommend">
                        <option value="verylikely">Very Likely</option>
                        <option value="likely">Likely</option>
                        <option value="unlikely">Unlikely</option>
                    </select>

Please rate a movie.

<input type="hidden" name="userid" value="1"/>
         Movie Title: <select name="movieid">
        <option value="-1">----------</option>
	<option value="1">Sweet Home Alabama</option>
	<option value="2">Godzilla</option>
	<option value="3">Raising Arizona</option>
	<option value="4">The Godfather</option>
	<option value="5">Pulp Fiction</option>
	<option value="6">Alien</option>
	<option value="7">Harry Potter and the Sorcerers Stone</option>
	<option value="8">Lion In Winter</option>
	<option value="9">Red</option>
        <option value="10">Life Of Pie</option>
        </select> Movie Rating:
        <select name="movierating">
        <option value="-1">----------</option>
	<option value="1">1 -- terrible</option>
	<option value="2">2</option>
	<option value="3">3</option>
	<option value="4">4</option>
	<option value="5">5</option>
	<option value="6">6</option>
	<option value="7">7</option>
	<option value="8">8</option>
	<option value="9">9</option>
        <option value="10">10 -- perfect</option>
                    </select> [1 (terrible)... 10 (perfect)]
                    <input type="hidden" name="ratingtstamp" id="ratingtimestamp"/>

Please enter any additional comments.

<textarea rows="10" cols="70" name="comments">Enter your comments here...</textarea>

<input type="submit" value="Submit now" />

        </form>


text:
@implementation OpenIDConnectLibrary

+(NSDictionary *)parseIDToken:(NSString *)idToken forClient:(NSString *)client_id withNonce:(NSString *)nonce
{
    // Used for the Implicit grant type without an access token

    JSONWebToken *jwt = [[JSONWebToken alloc] initWithToken:idToken ofType:@"id_token"];
    if ([OIDCHelper validateIDToken:jwt ForClientId:client_id WithNonce:nonce])
    {
        return [jwt parsed_payload];
    } else
    {
        return nil;
    }
}

+(NSDictionary *)parseIDToken:(NSString *)idToken forClient:(NSString *)client_id withAccessToken:(NSString *)access_token withNonce:(NSString *)nonce
{
    // Used for the Implicit grant type with an access token

    JSONWebToken *jwt = [[JSONWebToken alloc] initWithToken:idToken ofType:@"id_token"];
    if ([OIDCHelper validateIDToken:jwt ForClientId:client_id WithAccessToken:access_token AndNonce:nonce])
    {
        return [jwt parsed_payload];
    } else
    {
        return nil;
    }
}

+(NSDictionary *)parseIDToken:(NSString *)idToken forClient:(NSString *)client_id withAccessToken:(NSString *)access_token
{
    // Used for the AuthZ grant type with an access token

    JSONWebToken *jwt = [[JSONWebToken alloc] initWithToken:idToken ofType:@"id_token"];
    if ([OIDCHelper validateIDToken:jwt ForClientId:client_id WithAccessToken:access_token])
    {
        return [jwt parsed_payload];
    } else
    {
        return nil;
    }
}

+(BOOL)validateIDToken:(NSString *)idToken forClient:(NSString *)client_id withNonce:(NSString *)nonce
{
    return YES;
}

+(NSString *)getParsedHeaderForToken:(NSString *)token
{
    JSONWebToken *jwt = [[JSONWebToken alloc] initWithToken:token ofType:@"any"];
    return [OIDCHelper jsonPrettyPrint:[jwt parsed_header]];
}

+(NSString *)getParsedPayloadForToken:(NSString *)token
{
    JSONWebToken *jwt = [[JSONWebToken alloc] initWithToken:token ofType:@"any"];
    return [OIDCHelper jsonPrettyPrint:[jwt parsed_payload]];
}

@end


text:
<?php

namespace Concrete\Core\File\Component\Chooser;

class ChooserConfiguration implements ChooserConfigurationInterface
{

    /**
     * @var FilterCollectionInterface|null
     */
    protected $filters;

    /**
     * @var UploaderOptionInterface[]
     */
    protected $uploaders = [];

    /**
     * @var ChooserOptionInterface[]
     */
    protected $choosers = [];

    public function addChooser(ChooserOptionInterface $chooserOption)
    {
        $this->choosers[] = $chooserOption;
    }

    public function addUploader(UploaderOptionInterface $uploaderOption)
    {
        $this->uploaders[] = $uploaderOption;
    }

    /**
     * @return UploaderOptionInterface[]
     */
    public function getUploaders(): array
    {
        return $this->uploaders;
    }

    /**
     * @return ChooserOptionInterface[]
     */
    public function getChoosers(): array
    {
        return $this->choosers;
    }

    /**
     * @return FilterCollectionInterface|null
     */
    public function getFilters(): ?FilterCollectionInterface
    {
        return $this->filters;
    }

    /**
     * @param FilterCollectionInterface|null $filters
     */
    public function setFilters(FilterCollectionInterface $filters): void
    {
        $this->filters = $filters;
    }

}