text:
package org.apache.drill.exec.vector.accessor.impl;

import java.math.BigDecimal;

import org.apache.drill.exec.vector.ValueVector;
import org.apache.drill.exec.vector.accessor.ArrayWriter;
import org.apache.drill.exec.vector.complex.BaseRepeatedValueVector;
import org.joda.time.Period;

/**
 * Writer for an array-valued column. This writer appends values: once a value
 * is written, it cannot be changed. As a result, writer methods have no item index;
 * each set advances the array to the next position. This is an abstract base class;
 * subclasses are generated for each repeated value vector type.
 */

public abstract class AbstractArrayWriter extends AbstractColumnAccessor implements ArrayWriter {

  /**
   * Column writer that provides access to an array column by returning a
   * separate writer specifically for that array. That is, writing an array
   * is a two-part process:

   * tupleWriter.column("arrayCol").array().setInt(2);

   * This pattern is used to avoid overloading the column reader with
   * both scalar and array access. Also, this pattern mimics the way
   * that nested tuples (Drill maps) are handled.
   */

  public static class ArrayColumnWriter extends AbstractColumnWriter {

    private final AbstractArrayWriter arrayWriter;

    public ArrayColumnWriter(AbstractArrayWriter arrayWriter) {
      this.arrayWriter = arrayWriter;
    }

    @Override
    public ValueType valueType() {
      return ValueType.ARRAY;
    }

    @Override
    public void bind(RowIndex rowIndex, ValueVector vector) {
      arrayWriter.bind(rowIndex, vector);
      vectorIndex = rowIndex;
    }

    @Override
    public ArrayWriter array() {
      return arrayWriter;
    }

    /**
     * Arrays require a start step for each row, regardless of
     * whether any values are written for that row.
     */

    public void start() {
      arrayWriter.mutator().startNewValue(vectorIndex.index());
    }
  }

  protected abstract BaseRepeatedValueVector.BaseRepeatedMutator mutator();

  @Override
  public int size() {
    return mutator().getInnerValueCountAt(vectorIndex.index());
  }

  @Override
  public boolean valid() {
    // Not implemented yet
    return true;
  }

  @Override
  public void setInt(int value) {
    throw new UnsupportedOperationException();
  }

  @Override
  public void setLong(long value) {
    throw new UnsupportedOperationException();
  }

  @Override
  public void setDouble(double value) {
    throw new UnsupportedOperationException();
  }

  @Override
  public void setString(String value) {
    throw new UnsupportedOperationException();
  }

  @Override
  public void setBytes(byte[] value) {
    throw new UnsupportedOperationException();
  }

  @Override
  public void setDecimal(BigDecimal value) {
    throw new UnsupportedOperationException();
  }

  @Override
  public void setPeriod(Period value) {
    throw new UnsupportedOperationException();
  }
}


text:
<?xml version="1.0"?>
<!--
 * Copyright (c) 2011-2016, Qulice.com
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met: 1) Redistributions of source code must retain the above
 * copyright notice, this list of conditions and the following
 * disclaimer. 2) Redistributions in binary form must reproduce the above
 * copyright notice, this list of conditions and the following
 * disclaimer in the documentation and/or other materials provided
 * with the distribution. 3) Neither the name of the Qulice.com nor
 * the names of its contributors may be used to endorse or promote
 * products derived from this software without specific prior written
 * permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
 * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
 * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 * OF THE POSSIBILITY OF SUCH DAMAGE.
 -->
<project xmlns="http://maven.apache.org/DECORATION/1.3.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/DECORATION/1.3.0 http://maven.apache.org/xsd/decoration-1.3.0.xsd"
    name="qulice">
    <skin>
        <groupId>com.jcabi</groupId>
        <artifactId>jcabi-maven-skin</artifactId>
        <version>1.4</version>
    </skin>
    <googleAnalyticsAccountId>UA-1963507-25</googleAnalyticsAccountId>
    <bannerLeft>
        <name>Qulice</name>
        <src>http://img.qulice.com/logo.svg</src>
        <href>http://www.qulice.com/</href>
        <title>home page of Qulice.com</title>
        <width>214</width>
        <height>60</height>
    </bannerLeft>
    <body>
        <head>
            <link href="http://img.qulice.com/favicon.gif" rel="shortcut icon"/>
            <link href="https://plus.google.com/u/0/114792568016408327418?rel=author" rel="author"/>
        </head>
        <breadcrumbs>
            <item name="qulice.com" href="http://www.qulice.com"/>
        </breadcrumbs>
        <menu name="Overview">
            <item name="Introduction" href="./index.html"/>
            <item name="Quick Start" href="./qulice-maven-plugin/usage.html"/>
            <item name="What is Quality?" href="./quality.html"/>
        </menu>
        <menu ref="reports"/>
    </body>
</project>

redpajama_set_name: RedPajamaGithub


text:
package org.apache.wicket.util.watch;

import java.util.Set;

import org.apache.wicket.util.listener.IChangeListener;
import org.apache.wicket.util.time.Duration;

/**
 * Monitors one or more IModifiable objects, calling a {@link IChangeListener
 * IChangeListener} when a given object's modification time changes.
 *
 * @author Juergen Donnerstag
 */
public interface IModificationWatcher
{
	/**
	 * Adds an IModifiable object and an IChangeListener object to call
	 * when the modifiable object is modified.
	 *
	 * @param modifiable
	 *            an IModifiable object to monitor
	 * @param listener
	 *            an IChangeListener to call if the IModifiable object is
	 *            modified
	 * @return true if the set did not already contain the specified element
	 */
	boolean add(final IModifiable modifiable, final IChangeListener<IModifiable> listener);

	/**
	 * Removes all entries associated with an IModifiable object.
	 *
	 * @param modifiable
	 *            an IModifiable object
	 * @return the IModifiable object that was removed, else null
	 */
	IModifiable remove(final IModifiable modifiable);

	/**
	 * Starts watching at a given Duration polling rate.
	 *
	 * @param pollFrequency
	 *            the polling rate Duration
	 */
	void start(final Duration pollFrequency);

	/**
	 * Stops this ModificationWatcher.
	 */
	void destroy();

	/**
	 * Retrieves a key set of all IModifiable objects currently being monitored.
	 *
	 * @return a Set of all IModifiable entries currently maintained
	 */
	Set<IModifiable> getEntries();
}


text:
This is the source directory for the [command-line uploader tutorial][].

[command-line uploader tutorial]: https://gocloud.dev/tutorials/cli-uploader/


text:
<?php

namespace Emayk\Ics\Repo\Factory\User;

use Emayk\Ics\Repo\Factory\Response;

class impEloquent implements iUser {
	protected $user;

	function __construct(Eloquent $user)
	{
		$this->user = $user;
	}

	/**
	 * Menampilkan Daftar Resource
	 *
	 * @return Response
	 */
	public function all()
	{
		return $this->user->all();
	}

	/**
	 * Menyimpan Resource Baru
	 *
	 * @return Response
	 */
	public function store()
	{
		// TODO: Implement store() method.
	}

	/**
	 * Menampilkan Form New
	 *
	 * @return Response
	 */
	public function create()
	{
		// TODO: Implement create() method.
	}

	/**
	 * Menampilkan Resource
	 *
	 * @param  int $id
	 *
	 * @return Response
	 */
	public function show($id)
	{
		// TODO: Implement show() method.
		return $this->user->findOrFail($id);
	}

	/**
	 * Menampilkan Data Untuk di edit
	 *
	 * @param  int $id
	 *
	 * @return Response
	 */
	public function edit($id)
	{
		// TODO: Implement edit() method.
		return $this->user->findOrFail($id);
	}

	/**
	 * Update Resource Tertentu dari Storage
	 *
	 * @param  int $id
	 *
	 * @return Response
	 */
	public function update($id)
	{
		// TODO: Implement update() method.
		return $this->user->findOrFail($id);
	}

	/**
	 * Menghapus Spesifikasi Resource dari Storage
	 *
	 * @param  int $id
	 *
	 * @return Response
	 */
	public function delete($id)
	{
		// TODO: Implement delete() method.
		return $this->user->findOrFail($id)->delete();
	}

	/**
	 * Mencari Record berdasarkan Primary key
	 *
	 * @param  int $id
	 *
	 * @return Response
	 */
	public function find($id)
	{
		return $this->user->findOrFail($id);
	}

	/**
	 * Remove from Storage
	 *
	 */
	public function destroy($id)
	{
		// TODO: Implement destroy() method.
	}

}


text:
// Copyright (c) 2012 Ecma International.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
es5id: 10.4.3-1-59-s
description: >
    checking 'this' (Injected getter includes strict directive prologue)
---*/

var o = {};
Object.defineProperty(o, "foo", { get: function() { "use strict"; return this; } });

assert.sameValue(o.foo, o, 'o.foo');


text:
#ifndef __QLCNIC_DCBX_H
#define __QLCNIC_DCBX_H

#define QLCNIC_DCB_STATE	0
#define QLCNIC_DCB_AEN_MODE	1

#ifdef CONFIG_QLCNIC_DCB
int qlcnic_register_dcb(struct qlcnic_adapter *);
#else
static inline int qlcnic_register_dcb(struct qlcnic_adapter *adapter)
{ return 0; }
#endif

struct qlcnic_dcb;

struct qlcnic_dcb_ops {
	int (*query_hw_capability) (struct qlcnic_dcb *, char *);
	int (*get_hw_capability) (struct qlcnic_dcb *);
	int (*query_cee_param) (struct qlcnic_dcb *, char *, u8);
	void (*init_dcbnl_ops) (struct qlcnic_dcb *);
	void (*aen_handler) (struct qlcnic_dcb *, void *);
	int (*get_cee_cfg) (struct qlcnic_dcb *);
	void (*get_info) (struct qlcnic_dcb *);
	int (*attach) (struct qlcnic_dcb *);
	void (*free) (struct qlcnic_dcb *);
};

struct qlcnic_dcb {
	struct qlcnic_dcb_mbx_params	*param;
	struct qlcnic_adapter		*adapter;
	struct delayed_work		aen_work;
	struct workqueue_struct		*wq;
	const struct qlcnic_dcb_ops	*ops;
	struct qlcnic_dcb_cfg		*cfg;
	unsigned long			state;
};

static inline void qlcnic_clear_dcb_ops(struct qlcnic_dcb *dcb)
{
	kfree(dcb);
	dcb = NULL;
}

static inline int qlcnic_dcb_get_hw_capability(struct qlcnic_dcb *dcb)
{
	if (dcb && dcb->ops->get_hw_capability)
		return dcb->ops->get_hw_capability(dcb);

	return 0;
}

static inline void qlcnic_dcb_free(struct qlcnic_dcb *dcb)
{
	if (dcb && dcb->ops->free)
		dcb->ops->free(dcb);
}

static inline int qlcnic_dcb_attach(struct qlcnic_dcb *dcb)
{
	if (dcb && dcb->ops->attach)
		return dcb->ops->attach(dcb);

	return 0;
}

static inline int
qlcnic_dcb_query_hw_capability(struct qlcnic_dcb *dcb, char *buf)
{
	if (dcb && dcb->ops->query_hw_capability)
		return dcb->ops->query_hw_capability(dcb, buf);

	return 0;
}

static inline void qlcnic_dcb_get_info(struct qlcnic_dcb *dcb)
{
	if (dcb && dcb->ops->get_info)
		dcb->ops->get_info(dcb);
}

static inline int
qlcnic_dcb_query_cee_param(struct qlcnic_dcb *dcb, char *buf, u8 type)
{
	if (dcb && dcb->ops->query_cee_param)
		return dcb->ops->query_cee_param(dcb, buf, type);

	return 0;
}

static inline int qlcnic_dcb_get_cee_cfg(struct qlcnic_dcb *dcb)
{
	if (dcb && dcb->ops->get_cee_cfg)
		return dcb->ops->get_cee_cfg(dcb);

	return 0;
}

static inline void qlcnic_dcb_aen_handler(struct qlcnic_dcb *dcb, void *msg)
{
	if (dcb && dcb->ops->aen_handler)
		dcb->ops->aen_handler(dcb, msg);
}

static inline void qlcnic_dcb_init_dcbnl_ops(struct qlcnic_dcb *dcb)
{
	if (dcb && dcb->ops->init_dcbnl_ops)
		dcb->ops->init_dcbnl_ops(dcb);
}

static inline void qlcnic_dcb_enable(struct qlcnic_dcb *dcb)
{
	if (dcb && qlcnic_dcb_attach(dcb))
		qlcnic_clear_dcb_ops(dcb);
}
#endif


text:
namespace Beanulator.Common.Processors
{
    public abstract class Processor
    {
        public CooperativeThread thread;
        public int cycles;

        public Processor()
        {
            this.thread = new CooperativeThread(main);
        }

        protected virtual void main() { }
        protected virtual void tick(int cycles)
        {
            this.cycles -= cycles;

            if (this.cycles <= 0)
            {
                this.thread.Leave();
            }
        }
    }
}


text:
import { Injectable } from '@angular/core';

@Injectable()
export class AppConfig {
    private config: any = {
        IS_TABLET: false,
        IS_JAPAN_SERVER: true,
        IS_CHINA_SERVER: false,
        BASE_URL: 'https://iscsys.intasect.co.jp/home/InternalSystem/',
        BASE_URL_JAPAN: 'https://iscsys.intasect.co.jp/home/InternalSystem/',
        BASE_URL_CHINA: 'http://www.intalinx.cn/home/intalinxcloud/',
        // BASE_URL_CHINA: 'http://47.92.85.161/home/InternalSystem/',
        BIZNAVI_URL_JAPAN: 'https://iscsys.intasect.co.jp/biznavi/#/todo/1',
        BIZNAVI_URL_CHINA: 'http://www.intalinx.cn/biznavi/#/todo/1',
        // BIZNAVI_URL_CHINA: 'http://47.92.85.161/biznavi/#/todo/1',
        DOWNLOAD_GATEWAY_URL: 'com.eibus.web.tools.download.Download.wcp',
        GATEWAY_URL: 'com.eibus.web.soap.Gateway.wcp',
        PRE_LOGIN_INFO_URL: 'com.eibus.sso.web.authentication.PreLoginInfo.wcp',
        SAMLART_NAME: 'SAMLart',
        SAML_ARTIFACT_STORAGE_NAME: 'production_SAMLart',
        SAML_ARTIFACT_STORAGE_NAME_JAPAN: 'production_SAMLart',
        SAML_ARTIFACT_STORAGE_NAME_CHINA: 'defaultinst_SAMLart',
        // SAML_ARTIFACT_STORAGE_NAME_CHINA: 'biznavi_SAMLart',
        SAML_NOT_ON_AFTER_STORAGE_NAME: 'notOnAfter',
        AUTO_LOGIN_STORAGE_NAME: 'autoLogin',
        LOGIN_ID_STORAGE_NAME: 'loginID',
        PASSWORD_STORAGE_NAME: 'password',
        SERVER_STORAGE_NAME: 'server',
        USER_DEFAULT_AVATAR_IMAGE_URL: 'assets/img/default.png',
        VERSION_URL_JAPAN: 'https://intasect.github.io/version.json',
        VERSION_URL_CHINA: 'https://intalinx.oschina.io/version.json',
        DOWNLOAD_URL_JAPAN: 'https://intasect.github.io',
        DOWNLOAD_URL_CHINA: 'https://intalinx.oschina.io',
        USER_LANG: 'en-US',
        GOOGLE_ANALYTICS_TRACK_ID: 'UA-81438804-1',
        GOOGLE_ANALYTICS_TRACK_ID_JAPAN: 'UA-81438804-1',
        GOOGLE_ANALYTICS_TRACK_ID_CHINA: 'UA-81699991-1',
        DATETIME_YEAR_MONTH_DAY_MIN: '2014-01-01',
        DATETIME_YEAR_MONTH_DAY_MAX: '2030-12-31',
        DATETIME_MINUTE_VALUES: '00, 15, 30, 45'
    };
    get(key: string): any {
        return this.config[key];
    }
    set(key: string, value: any): void {
        this.config[key] = value;
    }
}


text:
from django.contrib.auth.models import User
from django.db import transaction
from jsonrpc import jsonrpc_method

from alexia.api.decorators import manager_required
from alexia.api.exceptions import InvalidParamsError, ObjectNotFoundError
from alexia.apps.organization.models import (
    AuthenticationData, Certificate, Membership, Profile,
)
from alexia.auth.backends import RADIUS_BACKEND_NAME, SAML2_BACKEND_NAME

from ..common import format_certificate, format_user
from ..config import api_v1_site

@jsonrpc_method('user.add(radius_username=String, first_name=String, last_name=String, email=String) -> Object',
                site=api_v1_site, authenticated=True)
@manager_required
@transaction.atomic
def user_add(request, radius_username, first_name, last_name, email):
    """
    Add a new user to Alexia.

    An user must have an unique username and a valid email address.

    Returns the user information on success.

    radius_username  -- Unique username
    first_name       -- First name
    last_name        -- Last name
    email            -- Valid email address

    Example result value:
    {
        "first_name": "John",
        "last_name": "Doe",
        "radius_username": "s0000000"
    }

    Raises error -32602 (Invalid params) if the username already exists.
    """
    if User.objects.filter(username=radius_username).exists() or \
            AuthenticationData.objects.filter(backend=RADIUS_BACKEND_NAME, username__iexact=radius_username).exists() \
            or AuthenticationData.objects.filter(backend=SAML2_BACKEND_NAME, username__iexact=radius_username).exists():
        raise InvalidParamsError('User with provided username already exists')

    user = User(username=radius_username, first_name=first_name, last_name=last_name, email=email)
    user.save()

    data = AuthenticationData(user=user, backend=SAML2_BACKEND_NAME, username=radius_username.lower())
    data.save()

    user.profile = Profile()
    user.profile.save()

    return format_user(user)

@jsonrpc_method('user.exists(radius_username=String) -> Boolean', site=api_v1_site, authenticated=True, safe=True)
def user_exists(request, radius_username):
    """
    Check if a user exists by his or her username.

    Returns true when the username exists, false otherwise.

    radius_username    -- Username to search for.
    """
    return User.objects.filter(authenticationdata__backend=RADIUS_BACKEND_NAME,
                               authenticationdata__username=radius_username).exists() or \
           User.objects.filter(authenticationdata__backend=SAML2_BACKEND_NAME,
                               authenticationdata__username=radius_username).exists()

@jsonrpc_method('user.get(radius_username=String) -> Object', site=api_v1_site, authenticated=True, safe=True)
def user_get(request, radius_username):
    """
    Retrieve information about a specific user.

    Returns a object representing the user. Result contains first_name,
    last_name and radius_username.

    radius_username    -- Username to search for.

    Raises error 404 if provided username cannot be found.

    Example result value:
    {
        "first_name": "John",
        "last_name": "Doe",
        "radius_username": "s0000000"
    }
    """
    try:
        user = User.objects.get(authenticationdata__backend=SAML2_BACKEND_NAME,
                                authenticationdata__username=radius_username)
    except User.DoesNotExist:
        try:
            user = User.objects.get(authenticationdata__backend=RADIUS_BACKEND_NAME,
                                    authenticationdata__username=radius_username)
        except:
            raise ObjectNotFoundError

    return format_user(user)

@jsonrpc_method('user.get_by_id(user_id=Number) -> Object', site=api_v1_site, authenticated=True, safe=True)
def user_get_by_id(request, user_id):
    """
    Retrieve information about a specific user.

    user_id    -- User id to search for.

    Raises error 404 if provided username cannot be found.

    Example result value:
    {
        "first_name": "John",
        "last_name": "Doe",
        "radius_username": "s0000000"
    }
    """
    try:
        user = User.objects.get(id=user_id)
    except User.DoesNotExist:
        raise ObjectNotFoundError

    return format_user(user)

@jsonrpc_method(
    'user.get_membership(radius_username=String) -> Object',
    site=api_v1_site,
    safe=True,
    authenticated=True
)
@manager_required
def user_get_membership(request, radius_username):
    """
    Retrieve the membership details for a specific user for the current organization.

    Required user level: Manager

    radius_username     -- Username to search for.

    Raises error 404 if the provided username cannot be found or the user has no membership with the current
    organization.

    Example result value:
    {
        "user": "s0000000",
        "organization": "Inter-Actief",
        "comments": "",
        "is_tender": True,
        "is_planner": False,
        "is_manager": False,
        "is_active": True
    }
    """
    try:
        user = User.objects.get(authenticationdata__backend=SAML2_BACKEND_NAME,
                                authenticationdata__username=radius_username)
    except User.DoesNotExist:
        try:
            user = User.objects.get(authenticationdata__backend=RADIUS_BACKEND_NAME,
                                    authenticationdata__username=radius_username)
        except:
            raise ObjectNotFoundError

    try:
        membership = Membership.objects.get(
            user=user,
            organization=request.organization
        )
    except Membership.DoesNotExist:
        raise ObjectNotFoundError

    return {
        "user": user.username,
        "organization": request.organization.name,
        "comments": membership.comments,
        "is_tender": membership.is_tender,
        "is_planner": membership.is_planner,
        "is_manager": membership.is_manager,
        "is_active": membership.is_active
    }

@jsonrpc_method(
    'user.get_iva_certificate(radius_username=String) -> Object',
    site=api_v1_site,
    safe=True,
    authenticated=True
)
@manager_required
def user_get_iva_certificate(request, radius_username):
    """
    Retrieve the IVA certificate file for a specific user.

    Required user level: Manager

    radius_username    -- Username to search for.

    Raises error 404 if provided username cannot be found or the user has no IVA certificate.

    Example result value:
    {
        "user": "s0000000",
        "certificate_data": "U29tZSBiYXNlIDY0IHRleHQgdGhhdCBtaWdodCBiZ.........BhIGxvdCBsb25nZXIgdGhhbiB0aGlzIGlzLi4u"
    }
    """
    try:
        user = User.objects.get(authenticationdata__backend=SAML2_BACKEND_NAME,
                                authenticationdata__username=radius_username)
    except User.DoesNotExist:
        try:
            user = User.objects.get(authenticationdata__backend=RADIUS_BACKEND_NAME,
                                    authenticationdata__username=radius_username)
        except:
            raise ObjectNotFoundError

    try:
        certificate = Certificate.objects.get(owner=user)
    except Certificate.DoesNotExist:
        raise ObjectNotFoundError

    return format_certificate(certificate)


text:
{% if include.owner %}
	{{ include.owner }}
{% else %}
	{% comment %} poor man's validation through missing file ;) {% endcomment %}
{% endif %}


text:
namespace v8 {
namespace internal {

class KeyedStoreGenericGenerator {
 public:
  static void Generate(compiler::CodeAssemblerState* state);

  // Building block for fast path of Object.assign implementation.
  static void SetProperty(compiler::CodeAssemblerState* state,
                          TNode<Context> context, TNode<JSReceiver> receiver,
                          TNode<BoolT> is_simple_receiver, TNode<Name> name,
                          TNode<Object> value, LanguageMode language_mode);

  // Same as above but more generic. I.e. the receiver can by anything and the
  // key does not have to be unique. Essentially the same as KeyedStoreGeneric.
  static void SetProperty(compiler::CodeAssemblerState* state,
                          TNode<Context> context, TNode<Object> receiver,
                          TNode<Object> key, TNode<Object> value,
                          LanguageMode language_mode);

  static void SetPropertyInLiteral(compiler::CodeAssemblerState* state,
                                   TNode<Context> context,
                                   TNode<JSObject> receiver, TNode<Object> key,
                                   TNode<Object> value);
};

class StoreICNoFeedbackGenerator {
 public:
  static void Generate(compiler::CodeAssemblerState* state);
};

}  // namespace internal
}  // namespace v8

#endif  // V8_IC_KEYED_STORE_GENERIC_H_


text:
<?php

class gen_anno {

	public static function make_block($gen_anno, $list_type) {
		foreach($gen_anno as $anno) {
			$current_timestamp = time();
			$end_date = $anno["end_date"];
			$end_timestamp = strtotime($end_date);
			$start_date = $anno["start_date"];
			$start_timestamp = strtotime($start_date);

			if($end_timestamp > $current_timestamp && $start_timestamp < $current_timestamp) {
				echo "<$list_type class='gen_list_item' >";
				//$title = $anno['title'];
				$description = $anno['description'];
				echo "<span class='gen_anno_description'> $description<span>";
				echo "</$list_type>";
			}
		}
	}
}

?>


text:
package org.figurate.cache;

public interface CacheEntry {

    String getKey(Object...args);

    Object load(Object...args);
}


text:
package client

import (
	"context"
	"net/http"
)

var defaultClient = (*http.Client)(nil)

// Default returns the default HTTP client to use (to avoid re-instantiating
// one for each request)
func Default(
	ctx context.Context,
) *http.Client {
	if defaultClient == nil {
		defaultClient = &http.Client{}
	}
	return defaultClient
}


text:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="?attr/grayContentBackground"
    tools:context="com.yang.yunfan.ui.news.NewsTabFragment">

    <com.aspsine.swipetoloadlayout.SwipeToLoadLayout
        android:id="@+id/swipeToLoadLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:swipe_style="classic">

        <include
            android:id="@id/swipe_refresh_header"
            layout="@layout/layout_refresh_header" />

        <android.support.v7.widget.RecyclerView
            android:id="@id/swipe_target"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:scrollbars="vertical"
            android:clipToPadding="false"
            />

        <include
            android:id="@id/swipe_load_more_footer"
            layout="@layout/layout_load_more_footer" />

    </com.aspsine.swipetoloadlayout.SwipeToLoadLayout>

    <include layout="@layout/layout_neterror_center"/>

</FrameLayout>


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

using NUnit.Framework;
using RedFoxMQ.Transports;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;

namespace RedFoxMQ.Tests
{
    [TestFixture]
    public class ServiceQueueReaderTests
    {
        [Test]
        public void Connect_with_timeout_to_non_existing_endpoint_should_throw_TimeoutException()
        {
            using (var serviceQueueReader = new ServiceQueueReader())
            {
                var endpoint = TestHelpers.CreateEndpointForTransport(RedFoxTransport.Tcp);

                var sw = Stopwatch.StartNew();

                Assert.Throws<TimeoutException>(() =>
                    serviceQueueReader.Connect(endpoint, TimeSpan.FromMilliseconds(100)));

                sw.Stop();
                Assert.GreaterOrEqual(sw.ElapsedMilliseconds, 100);
            }
        }

        [Test]
        public void ServiceQueueReader_should_obey_ReceiveTimeout_in_socket_configuration_and_disconnects_on_timeout()
        {
            using (var serviceQueue = new ServiceQueue())
            using (var serviceQueueReader = new ServiceQueueReader())
            {
                var endpoint = TestHelpers.CreateEndpointForTransport(RedFoxTransport.Tcp);
                var socketConfiguration = new SocketConfiguration { ReceiveTimeout = TimeSpan.FromMilliseconds(100) };

                serviceQueue.Bind(endpoint);
                serviceQueueReader.Connect(endpoint, socketConfiguration);

                var disconnected = new ManualResetEventSlim();
                serviceQueueReader.Disconnected += disconnected.Set;

                Assert.IsTrue(disconnected.Wait(TimeSpan.FromSeconds(1)));
            }
        }

        [TestCase(ServiceQueueRotationAlgorithm.FirstIdle)]
        [TestCase(ServiceQueueRotationAlgorithm.LoadBalance)]
        public void ServiceQueue_connect_AddMessageFrame_single_message_received(ServiceQueueRotationAlgorithm rotationAlgorithm)
        {
            var endpoint = new RedFoxEndpoint("/path");

            using (var serviceQueue = new ServiceQueue(rotationAlgorithm))
            using (var serviceQueueReader = new ServiceQueueReader())
            {
                IMessage messageReceived = null;
                var received = new ManualResetEventSlim();
                serviceQueueReader.MessageReceived += (s, m) =>
                {
                    messageReceived = m;
                    received.Set();
                };

                serviceQueue.Bind(endpoint);
                serviceQueueReader.Connect(endpoint);

                var testMessage = new TestMessage();
                var testMessageFrame = new MessageFrameCreator(DefaultMessageSerialization.Instance).CreateFromMessage(testMessage);

                serviceQueue.AddMessageFrame(testMessageFrame);

                Assert.IsTrue(received.Wait(TimeSpan.FromSeconds(1)));
                Assert.AreEqual(testMessage, messageReceived);
            }
        }

        [TestCase(ServiceQueueRotationAlgorithm.FirstIdle)]
        [TestCase(ServiceQueueRotationAlgorithm.LoadBalance)]
        public void ServiceQueue_AddMessageFrame_connect_single_message_received(ServiceQueueRotationAlgorithm rotationAlgorithm)
        {
            var endpoint = new RedFoxEndpoint("/path");

            using (var serviceQueue = new ServiceQueue(rotationAlgorithm))
            using (var serviceQueueReader = new ServiceQueueReader())
            {
                IMessage messageReceived = null;
                var received = new ManualResetEventSlim();
                serviceQueueReader.MessageReceived += (s, m) =>
                {
                    messageReceived = m;
                    received.Set();
                };

                var testMessage = new TestMessage();
                var testMessageFrame = new MessageFrameCreator(DefaultMessageSerialization.Instance).CreateFromMessage(testMessage);

                serviceQueue.AddMessageFrame(testMessageFrame);

                serviceQueue.Bind(endpoint);
                serviceQueueReader.Connect(endpoint);

                Assert.IsTrue(received.Wait(TimeSpan.FromSeconds(1)));
                Assert.AreEqual(testMessage, messageReceived);
            }
        }

        [TestCase(ServiceQueueRotationAlgorithm.FirstIdle)]
        [TestCase(ServiceQueueRotationAlgorithm.LoadBalance)]
        public void ServiceQueue_connect_AddMessageFrame_single_message_received_disconnect_connect_AddMessageFrame_single_message_received(ServiceQueueRotationAlgorithm rotationAlgorithm)
        {
            var endpoint = new RedFoxEndpoint("/path");

            using (var serviceQueue = new ServiceQueue(rotationAlgorithm))
            using (var serviceQueueReader = new ServiceQueueReader())
            {
                IMessage messageReceived = null;
                var received = new ManualResetEventSlim();
                serviceQueueReader.MessageReceived += (s, m) =>
                {
                    messageReceived = m;
                    received.Set();
                };

                var testMessage = new TestMessage();
                var testMessageFrame = new MessageFrameCreator(DefaultMessageSerialization.Instance).CreateFromMessage(testMessage);

                serviceQueue.Bind(endpoint);
                serviceQueueReader.Connect(endpoint);

                serviceQueue.AddMessageFrame(testMessageFrame);

                Assert.IsTrue(received.Wait(TimeSpan.FromSeconds(1)));
                Assert.AreEqual(testMessage, messageReceived);

                serviceQueueReader.Disconnect();

                messageReceived = null;
                received.Reset();

                serviceQueueReader.Connect(endpoint);

                serviceQueue.AddMessageFrame(testMessageFrame);

                Assert.IsTrue(received.Wait(TimeSpan.FromSeconds(1)));
                Assert.AreEqual(testMessage, messageReceived);
            }
        }

        [TestCase(ServiceQueueRotationAlgorithm.FirstIdle)]
        [TestCase(ServiceQueueRotationAlgorithm.LoadBalance)]
        public void ServiceQueue_AddMessageFrame_connect_multiple_readers_multiple_message_received(ServiceQueueRotationAlgorithm rotationAlgorithm)
        {
            var endpoint = new RedFoxEndpoint("/path");

            using (var serviceQueue = new ServiceQueue(rotationAlgorithm))
            using (var serviceQueueReader1 = new ServiceQueueReader())
            using (var serviceQueueReader2 = new ServiceQueueReader())
            {
                const int count = 1000;
                var counter = new CounterSignal(count, 0);

                var messagesReceived1 = new List<IMessage>();
                serviceQueueReader1.MessageReceived += (s, m) =>
                {
                    messagesReceived1.Add(m);
                    counter.Increment();
                };

                var messagesReceived2 = new List<IMessage>();
                serviceQueueReader2.MessageReceived += (s, m) =>
                {
                    messagesReceived2.Add(m);
                    counter.Increment();
                };

                var testMessage = new TestMessage();
                var testMessageFrame = new MessageFrameCreator(DefaultMessageSerialization.Instance).CreateFromMessage(testMessage);

                for (var i = 0; i < count; i++)
                    serviceQueue.AddMessageFrame(testMessageFrame);

                serviceQueue.Bind(endpoint);

                serviceQueueReader1.Connect(endpoint);
                serviceQueueReader2.Connect(endpoint);

                Assert.IsTrue(counter.Wait(TimeSpan.FromSeconds(10)));
                Assert.AreEqual(count, messagesReceived1.Count + messagesReceived2.Count);
            }
        }

        [Test]
        public void ServiceQueue_AddMessageFrame_connect_multiple_readers_LoadBalance()
        {
            var endpoint1 = new RedFoxEndpoint("/path1");
            var endpoint2 = new RedFoxEndpoint("/path2");

            using (var serviceQueue = new ServiceQueue(ServiceQueueRotationAlgorithm.LoadBalance))
            using (var serviceQueueReader1 = new ServiceQueueReader())
            using (var serviceQueueReader2 = new ServiceQueueReader())
            {
                const int count = 1000;
                var counter = new CounterSignal(count, 0);

                var messagesReceived1 = new List<IMessage>();
                serviceQueueReader1.MessageReceived += (s, m) =>
                {
                    messagesReceived1.Add(m);
                    counter.Increment();
                };

                var messagesReceived2 = new List<IMessage>();
                serviceQueueReader2.MessageReceived += (s, m) =>
                {
                    messagesReceived2.Add(m);
                    counter.Increment();
                };

                var testMessage = new TestMessage();
                var testMessageFrame = new MessageFrameCreator(DefaultMessageSerialization.Instance).CreateFromMessage(testMessage);

                serviceQueue.Bind(endpoint1);
                serviceQueue.Bind(endpoint2);

                serviceQueueReader1.Connect(endpoint1);
                serviceQueueReader2.Connect(endpoint2);

                for (var i = 0; i < count; i++)
                    serviceQueue.AddMessageFrame(testMessageFrame);

                Assert.IsTrue(counter.Wait());
                Assert.AreEqual(count, messagesReceived1.Count + messagesReceived2.Count);

                Assert.AreNotEqual(0, messagesReceived1.Count);
                Assert.AreNotEqual(0, messagesReceived2.Count);

                var ratio = (decimal)messagesReceived1.Count / messagesReceived2.Count;
                Assert.Greater(ratio, 0.9);
                Assert.Less(ratio, 1.1);
            }
        }

        [SetUp]
        public void Setup()
        {
            TestHelpers.InitializeMessageSerialization();
        }
    }
}


text:
require '../lib/uri/ssh_git'

url = URI::SshGit.parse('git@github.com:packsaddle/ruby-uri-ssh_git.git')
# => #<URI::SshGit::Generic git@github.com:packsaddle/ruby-uri-ssh_git.git>

# http://docs.ruby-lang.org/ja/2.2.0/class/URI=3a=3aGeneric.html
# :scheme ,:userinfo, :host, :port, :registry, :path, :opaque, :query, :fragment
url.scheme #=> nil
url.userinfo #=> 'git'
url.user #=> 'git'
url.password #=> nil
url.host #=> 'github.com'
url.port #=> nil
url.registry #=> nil
url.path #=> 'packsaddle/ruby-uri-ssh_git.git'
url.opaque #=> nil
url.query #=> nil
url.fragment #=> nil

URI::SshGit.build(
  userinfo: 'git',
  host: 'github.com',
  path: 'packsaddle/ruby-uri-ssh_git.git'
).to_s
#=> 'git@github.com:packsaddle/ruby-uri-ssh_git.git'


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Thelebolus lignicola Lloyd

### Remarks
null


text:
#ifndef FEC_DETAIL_LDPC_H
#define FEC_DETAIL_LDPC_H

#include <thread>
#include <random>
#include <chrono>
#include <algorithm>
#include <vector>
#include <unordered_map>

#include <boost/serialization/export.hpp>

#include "Codec.h"
#include "../BitMatrix.h"
#include "../Permutation.h"

namespace fec {

  namespace detail {

    namespace Ldpc {

      struct EncoderOptions
      {
        friend class Structure;
      public:
        EncoderOptions(const SparseBitMatrix& checkMatrix) {checkMatrix_ = checkMatrix;}

        SparseBitMatrix checkMatrix() const {return checkMatrix_;}

      private:
        SparseBitMatrix checkMatrix_;
      };

      struct DecoderOptions {
        friend class Structure;
      public:
        DecoderOptions() = default;

        DecoderOptions& algorithm(DecoderAlgorithm algorithm) {algorithm_ = algorithm; return *this;}
        DecoderOptions& iterations(size_t n) {iterations_ = n; return *this;}
        DecoderOptions& scalingFactor(double factor) {scalingFactor_ = {std::make_pair(0, std::vector<double>({factor}))}; return *this;}
        DecoderOptions& scalingFactor(const std::unordered_map<size_t,std::vector<double>>& factor) {scalingFactor_ = factor; return *this;}

        DecoderAlgorithm algorithm() const {return algorithm_;}
        size_t iterations() const {return iterations_;}
        std::unordered_map<size_t,std::vector<double>> scalingFactor() const {return scalingFactor_;}

      private:
        DecoderAlgorithm algorithm_ = Approximate;
        size_t iterations_;
        std::unordered_map<size_t,std::vector<double>> scalingFactor_ = {std::make_pair(0, std::vector<double>({1.0}))};
      };

      struct PunctureOptions {
        friend class Structure;
      public:
        PunctureOptions() = default;

        PunctureOptions& mask(std::vector<bool> mask) {mask_ = mask; return *this;}
        PunctureOptions& systMask(std::vector<bool> mask) {systMask_ = mask; return *this;}

        std::vector<bool> systMask() const {return systMask_;}
        std::vector<bool> mask() const {return mask_;}

      private:
        std::vector<bool> systMask_;
        std::vector<bool> mask_;
      };

      /**
       *  This class represents a ldpc code structure.
       *  It provides a usefull interface to store and acces the structure information.
       */
      class Structure : public Codec::Structure {
        friend class ::boost::serialization::access;
      public:
        Structure() = default;
        Structure(const EncoderOptions&, const DecoderOptions&);
        Structure(const EncoderOptions&);
        virtual ~Structure() = default;

        virtual const char * get_key() const;

        void setDecoderOptions(const DecoderOptions& decoder);
        DecoderOptions getDecoderOptions() const;
        Permutation puncturing(const PunctureOptions& options) const;

        inline const SparseBitMatrix& checks() const {return H_;}
        inline size_t iterations() const {return iterations_;}
        double scalingFactor(size_t i, size_t j) const; /**< Access the scalingFactor value used in decoder. */

        void syndrome(std::vector<uint8_t>::const_iterator parity, std::vector<uint8_t>::iterator syndrome) const;
        virtual bool check(std::vector<BitField<size_t>>::const_iterator parity) const;
        virtual void encode(std::vector<BitField<size_t>>::const_iterator msg, std::vector<BitField<size_t>>::iterator parity) const;

      protected:
        void setEncoderOptions(const EncoderOptions& encoder);

      private:
        template <typename Archive>
        void serialize(Archive & ar, const unsigned int version);

        void computeGeneratorMatrix(SparseBitMatrix H);
        std::vector<std::vector<double>> scalingMapToVector(const std::unordered_map<size_t,std::vector<double>>& map) const;
        std::unordered_map<size_t,std::vector<double>> scalingVectorToMap(const std::vector<std::vector<double>>& map) const;

        SparseBitMatrix H_;
        SparseBitMatrix DC_;
        SparseBitMatrix T_;
        SparseBitMatrix A_;
        SparseBitMatrix B_;

        size_t iterations_;
        std::vector<std::vector<double>> scalingFactor_;
      };
    }
  }
}

BOOST_CLASS_EXPORT_KEY(fec::detail::Ldpc::Structure);
BOOST_CLASS_TYPE_INFO(fec::detail::Ldpc::Structure,extended_type_info_no_rtti<fec::detail::Ldpc::Structure>);

template <typename Archive>
void fec::detail::Ldpc::Structure::serialize(Archive & ar, const unsigned int version) {
  using namespace boost::serialization;
  ar & ::BOOST_SERIALIZATION_BASE_OBJECT_NVP(Codec::Structure);
  ar & ::BOOST_SERIALIZATION_NVP(H_);
  ar & ::BOOST_SERIALIZATION_NVP(DC_);
  ar & ::BOOST_SERIALIZATION_NVP(T_);
  ar & ::BOOST_SERIALIZATION_NVP(A_);
  ar & ::BOOST_SERIALIZATION_NVP(B_);
  ar & ::BOOST_SERIALIZATION_NVP(iterations_);
  ar & ::BOOST_SERIALIZATION_NVP(scalingFactor_);
}

#endif


text:
package org.motechproject.nms.masterdata.service;

import org.motechproject.nms.masterdata.domain.HealthFacility;

/**
 * This interface is used for crud operations on HealthFacility
 */
public interface HealthFacilityService {
    /**
     * create HealthFacility type object
     *
     * @param record of the HealthFacility
     */
    HealthFacility create(HealthFacility record);

    /**
     * update Circle type object
     *
     * @param record of the HealthFacility
     */
    void update(HealthFacility record);

    /**
     * delete HealthFacility type object
     *
     * @param record of the HealthFacility
     */
    void delete(HealthFacility record);

    /**
     * delete All HealthFacility type object
     */
    void deleteAll();

    /**
     * Finds the Health Facility details by its Id
     *
     * @param id
     * @return Healthfacility
     */
    HealthFacility findById(Long id);

    /**
     * Finds the Health Facility details by its parent code
     *
     * @param stateCode
     * @param districtCode
     * @param talukaCode
     * @param healthBlockCode
     * @param healthFacilityCode
     * @return Healthfacility
     */
    HealthFacility findHealthFacilityByParentCode(Long stateCode, Long districtCode,
                                                  Long talukaCode, Long healthBlockCode,
                                                  Long healthFacilityCode);

}


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name='viewport' content='width=device-width, maximum-scale=1.0, minimum-scale=1.0, initial-scale=1.0' />

  <meta name="description" content="">
  <meta name="author" content="">
  <link rel="icon" href="../../favicon.ico">
  <title>Bootstrap site!!</title>

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

      pestle.
      <button class="navbar-toggler hidden-lg-up float-md-right float-sm-right float-xs-right" type="button" data-toggle="collapse"
        data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
      </button>

          Home(current)

          About

          Contact

          Dropdown

            Testimonials
            Another action
            Something else here

            <form class="form-inline float-lg-right">
              Register
              <button class="btn btn-outline-danger" type="submit">Sign in</button>

      </form>

            Welcome to Pestle colors.

Please feel free to use the pallet classes below on your next project.

Sign up today

              Welcome to Pestle colors.

Please feel free to use the pallet classes below on your next project.

Sign up today

                Welcome to Pestle colors.

Please feel free to use the pallet classes below on your next project.

Sign up today

PALLET 1

BACKGROUND COLOR

FONT COLOR

bk-p1-blue

clr-p1-blue

bk-p1-green

clr-p1-green

bk-p1-sand

clr-p1-sand

bk-p1-white

clr-p1-white

bk-p2-red

clr-p1-red

PALLET 2

BACKGROUND COLOR

FONT COLOR

bk-p2-blue

clr-p2-blue

bk-p2-green

clr-p2-green

bk-p2-yellow

clr-p2-yellow

bk-p2-sand

clr-p2-sand

bk-p2-orange

clr-p2-orange

PALLET 3

BACKGROUND COLOR

FONT COLOR

bk-p3-red

clr-p3-red

bk-p3-yellow

clr-p3-yellow

bk-p3-grey

clr-p3-grey

bk-p3-blue

clr-p3-blue

bk-p3-white

clr-p3-white

Join the Family

Sign up to receive our newsletter for a first look at new products, sales and good reads.

                  <form class="form-inline">

                      <input type="email" class="form-control col-xs-5" id="exampleInputEmail2" placeholder="email address" style="max-width:165px;font-size:12px;">
                      <button type="submit" class="btn btn-outline-primary col-xs-4" style="font-size:12px;margin-left:5px;">Sign Up</button>
                  </form>

Argus

About Us

Careers

Press

Policies

Help

Contact

Discover

Trust & Safety

Travel Credit

Gift Cards

In Action

Business Travel

Guidebooks

Connect

Instagram

Pinterest

Facebook

Twitter

Email

Phone

              © Argus, Inc.

              Terms & Privacy |
              Site Map              |
              Back to top


text:
namespace cgreen {
    extern "C" {
#endif

void expect_(TestReporter *test_reporter, const char *function, const char *test_file, int test_line, ...);
void always_expect_(TestReporter *test_reporter, const char *function, const char *test_file, int test_line, ...);
void never_expect_(TestReporter *test_reporter, const char *function, const char *test_file, int test_line, ...);
intptr_t mock_(TestReporter *test_reporter, const char *function, const char *mock_file, int mock_line, const char *parameters, ...);
Constraint *when_(const char *parameter, Constraint *constraint);

void clear_mocks(void);
void tally_mocks(TestReporter *reporter);

#ifdef __cplusplus
    }
}
#endif

#endif


text:
import {Route, RouteManager, Auth, AuthManager} from '../index';
import should from 'should';
import _ from 'lodash';

const user = { name: 'toto', age: 13, roles: ['role1']};
const state = { message: 'coucou'}

const loginSelector = () => {
  return {
    getUser(){ return user },
    isLoggedIn(){ return !!this.getUser() },
    getUserRoles(){ return user.roles },
  }
}

const personAuthManager = AuthManager([
  Auth({
    name: 'delete',
    roles: ['role1'],
  }),
  Auth({
    name: 'edit',
    roles: ['role2'],
    method: (user, getState) => user.age > 18 && getState().message === 'coucou' ,
  }),
  Auth({
    name: 'context',
    roles: ['role2'],
    method: (user, getState, {data}) => user.age > 18 && getState().message === 'coucou' && data === 1,
  }),

], {name: 'person'});

const companyRoutes = RouteManager([
  Route({
    name: 'list',
    path: '/companies',
    topic:'companies',
    label: 'Company',
    authRoles: ['role4']
  }),
], {name: 'company'});

const personRoutes = RouteManager([
  Route({
    name: 'list',
    path: '/people',
    topic:'people',
    label: 'People',
    component: 'PersonListApp',
    isMenu: true,
    iconName: 'users',
    authRequired: true
  }),
  Route({
    name: 'promote',
    path: '/person/promote',
    topic:'people',
    label: 'People',
    component: 'PersonListApp',
    isMenu: true,
    iconName: 'users',
    authRoles: ['role3'],
    authMethod: function(user){return user.age > 18},
  }),

], {name: 'person'});

const routes = RouteManager([
  personRoutes,
  companyRoutes,
  Route({
    name: 'notfound',
    path: '/notfound',
    component: 'NotFound',
  }),
]);

const auths = AuthManager([
  personAuthManager,
], {
  loginSelector,
  getState: () => state,
  routes
});

describe('route', function(){

  it('should get notfound', () => {
    should(routes.notfound.path).equal('/notfound');
    should(routes.notfound.name).equal('notfound');
    should(routes.notfound.component).equal('NotFound');
    should(routes.notfound.fullName).equal('notfound');
  });

  it('should get person', () => {
    should(routes.person.list.path).equal('/people');

    should(routes.getRoute(routes.person.list.fullName).path).equal('/people');
    should(routes.person.getRoute(routes.person.list.fullName).path).equal('/people');

    should(routes.person.list.name).equal('list');
    should(routes.person.list.component).equal('PersonListApp');
    should(routes.person.list.fullName).equal('person.list');
    should(auths.person.isAuthorized('promote')).equal(false);
    should(auths.isAuthorized(routes.person.promote)).equal(false);
    should(auths.person.isAuthorized(routes.person.promote)).equal(false);
  });

  it('should get company', () => {
    should(routes.company.list.path).equal('/companies');
    should(routes.company.fullName).equal('company');
    should(auths.company.isAuthorized('list')).equal(false);
    should(auths.isAuthorized('company.list')).equal(false);
  });

});

describe('auth', function(){
  it('should get person', () => {
    should(auths.person.delete.name).equal('delete');
  });

  it('should get company', () => {
    should(auths.company.list.path).equal('/companies');
  });

  it('should be authorized', () => {
    should(auths.person.isAuthorized('delete')).equal(true);
    should(auths.isAuthorized('person.delete')).equal(true);
  });

  it('should not be authorized', () => {
    should(auths.person.isAuthorized('edit')).equal(false);
  });

  it('should check method', () => {
    should(auths.person.isAuthorized('edit')).equal(false);
    user.roles = ['role2'];
    should(auths.person.isAuthorized('edit')).equal(false);
    user.age = 19;
    should(auths.person.isAuthorized('edit')).equal(true);
    user.age = 19;
    should(auths.person.isAuthorized('context', {data: 1})).equal(true);
    user.roles = ['role2', 'role3'];
    should(auths.person.isAuthorized('promote')).equal(true);
    user.age = 9;
    should(auths.isAuthorized('person.promote')).equal(false);
  });

});


text:
#include "settingsui/csettingspage.h"

namespace Ui {
class CSettingsPageGeneral;
}

class CSettingsPageGeneral : public CSettingsPage
{
public:
	explicit CSettingsPageGeneral(QWidget *parent = 0);
	~CSettingsPageGeneral();

	void acceptSettings() override;

private:
	Ui::CSettingsPageGeneral *ui;
};

#endif // CSETTINGSPAGEGENERAL_H


text:
namespace blink {

static void didLeaveScriptContextForModule(v8::Isolate* isolate)
{
    // Indexed DB requires that transactions are created with an internal |active| flag
    // set to true, but the flag becomes false when control returns to the event loop.
    V8PerIsolateData::from(isolate)->ensureIDBPendingTransactionMonitor()->deactivateNewTransactions();
}

void ModuleBindingsInitializer::init()
{
    ModuleProxy::moduleProxy().registerDidLeaveScriptContextForRecursionScope(didLeaveScriptContextForModule);
}

} // namespace blink


text:
@interface JailbrokenDetector : NSObject

+ (BOOL)isDeviceJailbroken;

@end


text:
package org.jenkinsci.plugins.youtrack;

import hudson.EnvVars;
import hudson.Extension;
import hudson.Launcher;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.AutoCompletionCandidates;
import hudson.model.BuildListener;
import hudson.scm.ChangeLogSet;
import hudson.tasks.BuildStepDescriptor;
import hudson.tasks.Builder;
import lombok.Getter;
import lombok.Setter;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.jenkinsci.plugins.youtrack.youtrackapi.Issue;
import org.jenkinsci.plugins.youtrack.youtrackapi.Suggestion;
import org.jenkinsci.plugins.youtrack.youtrackapi.User;
import org.jenkinsci.plugins.youtrack.youtrackapi.YouTrackServer;
import org.kohsuke.stapler.AncestorInPath;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * This is command for executing arbitrary commands on issues.
 */
public class ExecuteCommandAction extends Builder {
    private static final Logger LOGGER = Logger.getLogger(ExecuteCommandAction.class.getName());

    @Getter @Setter private String command;
    @Getter @Setter private String search;
    @Getter @Setter private String issueInText;
    @Getter @Setter private String comment;
    @Getter @Setter private String commentVisibility;

    @DataBoundConstructor
    public ExecuteCommandAction(String command, String search, String issueInText, String comment, String commentVisibility) {
        this.command = command;
        this.search = search;
        this.issueInText = issueInText;
        this.comment = comment;
        this.commentVisibility = commentVisibility;
    }

    @Override
    public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
        YouTrackSite youTrackSite = getYouTrackSite(build);
        if (youTrackSite != null) {
            if (youTrackSite.isPluginEnabled()) {

                YouTrackServer youTrackServer = getYouTrackServer(youTrackSite);
                User user = youTrackServer.login(youTrackSite.getUsername(), youTrackSite.getPassword());
                if (user != null && user.isLoggedIn()) {
                    EnvVars environment = build.getEnvironment(listener);

                    try {
                        String changes = createChangesString(build);
                        environment.put("YOUTRACK_CHANGES", changes);
                    } catch (InvocationTargetException e) {
                        LOGGER.error(e);
                    } catch (IllegalAccessException e) {
                        LOGGER.error(e);
                    }

                    String searchQuery = environment.expand(search);
                    String commandToExecute = environment.expand(command);
                    String expandedIssueInText = environment.expand(issueInText);

                    Set<Issue> issues = new HashSet<Issue>();
                    if (StringUtils.isNotBlank(searchQuery)) {
                        issues.addAll(youTrackServer.search(user, searchQuery));
                    }
                    if (StringUtils.isNotBlank(expandedIssueInText)) {
                        issues.addAll(findIssuesInText(build, environment, expandedIssueInText));
                    }
                    List<Command> appliedCommands = new ArrayList<Command>();
                    String expandedComment = environment.expand(comment);
                    for (Issue issue : issues) {
                        Command appliedCommand = youTrackServer.applyCommand(youTrackSite.getName(), user, issue, commandToExecute, expandedComment, commentVisibility, null, true);
                        appliedCommands.add(appliedCommand);
                        if (appliedCommand.getStatus() != Command.Status.OK) {
                            youTrackSite.failed(build);
                        }
                    }
                    if (!appliedCommands.isEmpty()) {
                        YouTrackCommandAction youTrackCommandAction = build.getAction(YouTrackCommandAction.class);
                        if (youTrackCommandAction == null) {
                            youTrackCommandAction = new YouTrackCommandAction(build);
                            build.addAction(youTrackCommandAction);
                        }
                        for (Command appliedCommand : appliedCommands) {
                            youTrackCommandAction.addCommand(appliedCommand);
                        }
                    }
                    if (issues.isEmpty()) {
                        listener.getLogger().println("No issues to apply command for");
                    }
                } else {
                    youTrackSite.failed(build);
                    listener.getLogger().println("User not logged in");
                }
            } else {
                listener.getLogger().println("Plugin not enabled");
            }
        } else {
            listener.getLogger().println("No site configured");
        }
        return true;
    }

    String createChangesString(AbstractBuild<?, ?> build) throws InvocationTargetException, IllegalAccessException {
        StringBuilder stringBuilder = new StringBuilder();
        ChangeLogSet<? extends ChangeLogSet.Entry> changeSet = build.getChangeSet();
        if (changeSet != null) {
            for (ChangeLogSet.Entry entry : changeSet) {
                String message = YoutrackIssueUpdater.getMessage(entry);
                stringBuilder.append(entry.getMsg());
                stringBuilder.append("\n\n");
            }
        }
        return stringBuilder.toString();
    }

    YouTrackServer getYouTrackServer(YouTrackSite youTrackSite) {
        return new YouTrackServer(youTrackSite.getUrl());
    }

    YouTrackSite getYouTrackSite(AbstractBuild<?, ?> build) {
        return YouTrackSite.get(build.getProject());
    }

    private List<Issue> findIssuesInText(AbstractBuild<?, ?> build, EnvVars environment, String issueInText) {
        String textToSearchForIssues = environment.expand(issueInText);
        YouTrackSaveProjectShortNamesAction projectShortNamesAction = build.getAction(YouTrackSaveProjectShortNamesAction.class);
        if (projectShortNamesAction != null) {
            return findIssuesIds(projectShortNamesAction.getShortNames(), textToSearchForIssues);
        }
        return new ArrayList<Issue>();
    }

    private List<Issue> findIssuesIds(List<String> projects, String issueText) {
        ArrayList<Issue> issues = new ArrayList<Issue>();
        String projectIds = StringUtils.join(projects, "|");
        Pattern projectPattern = Pattern.compile("((" + projectIds + ")-" + "(\\d+)" + ")");
        Matcher matcher = projectPattern.matcher(issueText);
        while (matcher.find()) {
            if (matcher.groupCount() >= 1) {
                String issueId = matcher.group(0);
                issues.add(new Issue(issueId));
            }
        }
        return issues;
    }

    @Extension
    public static final class DescriptorImpl extends BuildStepDescriptor<Builder> {
        public DescriptorImpl() {
            load();
        }

        public boolean isApplicable(Class<? extends AbstractProject> aClass) {
            return true;
        }

        /**
         * This human readable name is used in the configuration screen.
         */
        public String getDisplayName() {
            return "Execute YouTrack Command";
        }

        @Override
        public Builder newInstance(StaplerRequest req, JSONObject formData) throws FormException {
            return req.bindJSON(ExecuteCommandAction.class, formData);
        }

        @SuppressWarnings("UnusedDeclaration")
        public AutoCompletionCandidates doAutoCompleteSearch(@AncestorInPath AbstractProject project, @QueryParameter String value) {
            YouTrackSite youTrackSite = YouTrackSite.get(project);
            AutoCompletionCandidates autoCompletionCandidates = new AutoCompletionCandidates();
            if (youTrackSite != null) {
                YouTrackServer youTrackServer = new YouTrackServer(youTrackSite.getUrl());
                User user = youTrackServer.login(youTrackSite.getUsername(), youTrackSite.getPassword());
                if (user != null) {
                    List<Suggestion> suggestions = youTrackServer.searchSuggestions(user, value);
                    for (Suggestion suggestion : suggestions) {
                        if (suggestion.getCompletionStart() == 0) {
                            String completeSuggestion = emptyIfNull(suggestion.getPrefix()) + suggestion.getOption() + emptyIfNull(suggestion.getSuffix());
                            autoCompletionCandidates.add(completeSuggestion);
                        } else {
                            String validValue = value.substring(0, suggestion.getCompletionStart());
                            String completeSuggestion = emptyIfNull(suggestion.getPrefix()) + suggestion.getOption() + emptyIfNull(suggestion.getSuffix());
                            autoCompletionCandidates.add(validValue + completeSuggestion);
                        }
                    }
                }
            }
            return autoCompletionCandidates;
        }

        public String emptyIfNull(String text) {
            if (text == null) return "";
            return text;
        }

        @SuppressWarnings("UnusedDeclaration")
        public AutoCompletionCandidates doAutoCompleteCommentVisibility(@AncestorInPath AbstractProject project, @QueryParameter String value) {
            return YouTrackProjectProperty.getPossibleGroups(project, value);
        }

    }

}


text:
package mil.nga.giat.geowave.adapter.vector.plugin;

import org.geotools.process.factory.AnnotatedBeanProcessFactory;
import org.geotools.text.Text;

/**
 * This is the GeoTools Factory for introducing the nga:Decimation rendering
 * transform. GeoTools uses Java SPI to inject the WPS process (see
 * META-INF/services/org.geotools.process.ProcessFactory).
 *
 */
public class GeoWaveGSProcessFactory extends
		AnnotatedBeanProcessFactory
{

	public GeoWaveGSProcessFactory() {
		super(
				Text.text("GeoWave Process Factory"),
				"nga",
				DecimationProcess.class);
	}

}


text:
{% extends "layout.html" %}

{% block title %}Unauthorized{% endblock %}

{% block body %}

401 - Unauthorized

You are not allowed to see this page, so better...

...go somewhere nice
{% endblock %}


text:
import * as React from 'react';
import { classes } from './TextAreaOverrides.st.css';
import { TextArea } from '../../TextArea';

const TextAreaConnected = (props) => (
  <TextArea {...props} className={classes.root} />
);
TextAreaConnected.displayName = 'TextArea';

export { TextAreaConnected };


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

<title>SWI-Prolog for MS-Windows</title>

SWI-Prolog for MS-Windows

Jan Wielemaker

VU University Amsterdam

University of Amsterdam

The Netherlands

E-mail: jan@swi-prolog.org

Abstract
 This document gets you
started using SWI-Prolog on MS-Windows. It also describes the components
and issues that are specific to MS-Windows. It is by no means a manual
or Prolog tutorial. The reference manual is available online or can be
downloaded in HTML and PDF format from the SWI-Prolog
website, which also provides links to books, online tutorials and
other Prolog-related material.

Table of Contents

1 Using
SWI-Prolog

1.1 Starting
Prolog and loading a program

1.2 Executing
a query

1.3 Menu
commands

1.4 Editing
Prolog programs

1.5 Some
useful commands

2 Using
SWI-Prolog with C/C++

2.1 Using
MSVC

2.2 Using
swipl-ld.exe

3 The
installation

3.1 Supported
Windows versions

3.2 Choosing
the file extension

3.3 Installed
programs

3.4 Installed
Registry keys and menus

3.5 Execution
level

3.6 Creating
a desktop menu item

4 The
SWI-Prolog community and foundation

4.1 Website
and mailing lists

4.2 About
license conditions

4.3 Supporting
SWI-Prolog

1 Using
SWI-Prolog

1.1 Starting
Prolog and loading a program

The SWI-Prolog executable swipl-win.exe can be started from
the
StartMenu or by opening a .pl file holding Prolog
program text from the Windows explorer.1The
.PL file extension can be changed during installation. See section
3.2. The installation folder (by default
C:\Program Files\swipl) contains a subfolder
demo with the file likes.pl. This file can be
opened in Prolog from the StartMenu, by opening likes.pl in
the Windows explorer or by using the following command in the Prolog
application. Be sure to get the quotes right and terminate the command
with a full stop (.).

?- [swi('demo/likes')].

If Prolog is started from the start menu it is passed the option
--win-app, which causes it to start in the local
equivalent of MyDocuments\Prolog. This folder is created if
it does not exist.

1.2 Executing
a query

After loading a program, one can ask Prolog queries about the
program. The query below asks Prolog what food‘sam' likes. The
system responds with X = <<var>value</var>> if it can
prove the goal for a certain
<var>X</var>. The user can type the semi-colon (;) or spacebar. If you
want another solution. Use the return
key if you do not want to see the more answers. Prolog completes the
output a full stop (.) if the user uses the return
key or Prolog knowns there are no more answers. If Prolog
cannot find (more) answers, it writes
false. Finally, Prolog can answer using an error message to
indicate the query or program contains an error.

?- likes(sam, X).
X = dahl ;
X = tandoori ;
...
X = chips.

?-

Note that the answer written by Prolog is a valid Prolog program
that, when executed, produces the same set of answers as the original
program.

1.3 Menu
commands

The SWI-Prolog console provided by swipl-win.exe has a menu
for accessing the most commonly used commands. We assume not all menu
entries need to be explained in detail. We make some exceptions:

File/Reload modified files

This menu reloads all loaded source files that have been modified using
the make/0
command described in section 1.5.

File/Navigator ...

Opens an explorer-like view on Prolog files and the predicates they
contain.

Settings/Font ...

Allows for changing the font of the console. On some installations the
default font gives redraw and cursor dislocation problems. In this case
you may wish to select an alternative. Some built-in commands assume
non-proportional fonts.

Settings/User init file ...

Edits the user personalisation file. If no such file exists, it first
installs a default file as init.pl that contains commonly
used settings in comments.

Settings/Stack sizes ...

Allows for defining the maximum size to which the various Prolog stacks
are allowed to grow. The system defaults are chosen to make erroneous
programs fail quickly on modest hardware. Programs with large data
structures or many choice points often need larger stacks. Note that an
active Prolog process growing over the size of the physical memory of
your computer can make the system extremely slow.

Run/Interrupt

Try to interrupt the running Prolog process. This is the same as using Control-C.
Sometimes interrupts are not honoured or take very long to process.
Closing the window twice provides a way to force Prolog to stop.

Run/New thread

Creates a new interactor window running in a separate thread of
execution. This may be used to inspect the database or program while the
main task continues.

Debug/Edit spy points ...

Edit break points on predicates. From the PceEmacs editor (see
section 1.4) break points can also be
set on specific calls from specific clauses.

Debug/Graphical debugger ...

Use the source-level debugger on the next spy or break point or other
call that enables the debugger.

Help

The help menu provides various starting points to related documents.
Items flagged with (on www) open your default internet browser on
a page of the SWI-Prolog website.

1.4 Editing
Prolog programs

There are three options for editing. One is to run an editor of
choice in a separate window and use the make/0
command described below to reload modified files. In addition to this
option Prolog can be used to locate predicates, modules and loaded files
by specifying the editor of choice for use with the edit/1
command, described below. This is achieved by editing the
personalisation file (see section 1.3)
and following the instructions in the comments.

The default editor is the built-in editor called PceEmacs.
This editor provides colourisation support based on real-time parsing
and cross-reference analysis of the program.

Other options for editing include GNU-Emacs, SWI-Prolog-Editor and
the Eclipse-based PDT environment. See
http://www.swi-prolog.org/IDE.html
for an up-to-date overview.

1.5 Some
useful commands

This section provides a very brief overview of important or commonly
used SWI-Prolog predicates to control the environment.

consult(<var>:File</var>)

Load a source file. On Windows, folders may be specified with the
DOS/Windows \, which must be escaped, or by
using the POSIX standard
/. Especially when used in source code, /
is to be preferred as it is portable. A Prolog list ([ ... ]) can be
used to abbreviate the consult command. The file extension (.pl
as well as the selected alternative) can be omitted. Here are some
examples:

?- consult(likes).	Load likes.pl
from the current folder (see pwd/0).

?- ['C:/Program Files/pl/demo/likes']	Load likes.pl
using absolute path.

?- ['C:\\Program Files\\pl\\demo\\likes']	Same
using Windows-style path name

pwd

Print working directory (folder).

ls

List files in current directory.

edit

If Prolog is started by opening a .pl file in the explorer,
edit this file. Also available from the menu.

edit(<var>+Spec</var>)

Edit file, predicate, module, etc., with the given name. If multiple
items are named <var>Spec</var> it prompts for the desired alternative.

make

Reload all files that have been changed since they were last loaded.
Normally used after editing one or more files.

gtrace

Start the graphical debugger. There are three ways to use this. Entered
as a single goal at the top level, the next query will be traced.
Alternatively it can be used in conjunction with the goal to be
debugged: ?- gtrace, run. and finally you can include it in
your program to start tracing at a particular point or under a
particular condition:

        ...,
        (var(X) -> gtrace ; true),
        ...,

trace

Same as gtrace, but text-based on the console.

apropos(<var>+Keyword</var>)

Search for all predicates that contain <var>Keyword</var> in their name
or short description. If a GUI environment is available the results are
hyperlinks. Otherwise use help/1
to get details on selected hits.

help(<var>+Spec</var>)

Give help on <var>Spec</var>, which is normally the name of a predicate
or C interface function.

2 Using
SWI-Prolog with C/C++

Using MinGW or a
compiler with a compatible calling format you can write C or C++ code
that can be loaded into SWI-Prolog and called as a predicate. You can
also embed SWI-Prolog in C/C++ applications.

Details on how to interact with Prolog are in the
SWI-Prolog
reference manual. The mailing list archives and TWiki web provide
problems and solutions to the many problems that may occur.
Documentation of the
SWI-cpp.h C++ include file is available from the
package
documentation. This section only discusses some Windows-specific
issues.

2.1 Using
MSVC

 Because the current versions of SWI-Prolog are compiled and
linked with MinGW, we are unsure about the status with regard to
compiling extensions using MSVC and embedding SWI-Prolog into MSVC
projects.

Please send your comments to the SWI-Prolog mailinglist, and/or
mailto:bugs@swi-prolog.org.

First of all, add the include folder of the installation
to the search path for headers and the lib folder to the
search path for libraries. Both DLLs (extensions) or embedded
executables should link to
libswipl.dll.a and, if appropriate, to the multithreaded
DLL version of the MSVC runtime library.

To create extensions, create a Win32 DLL. To embed Prolog, care
should be taken that Prolog can find the Prolog installation. For
development, the simplest way to ensure this is by adding the
installation bin folder to the %PATH%
environment and calling PL_initialise() as illustrated below. PL_initialise()
uses the path of the loaded libswipl.dll module to find the
Prolog installation folder.2When
using the C++ interface from SWI-cpp.h, these comments
apply to the arguments for PlEngine().

  { static char *av[] = { "libswipl.dll", NULL };

    if ( !PL_initialise(1, av) )
    { <error>
    }
  }

To create an executable that does not rely on Prolog one must create
a saved state of the required Prolog code and attach this to the
executable. Creating saved states is described with qsave_program/2
in the reference manual. This can be attached to a state using the DOS
command below to create final.exe from the executable
produced by MSVC and the generated saved state.

> copy /b file.exe+file.state final.exe

2.2 Using
swipl-ld.exe

The swipl-ld.exe automates most of the above complications and
provides compatibility for common tasks on many platforms supported by
SWI-Prolog. To use it with MinGW, set the PATH environment
variables to include the SWI-Prolog binary folder as well as the MinGW
binary folders (typically C:\MinGW\bin) to find
gcc. An extension myext.dll can be created from the
source myext.c using the command below. Add -v
to see what commands are executed by swipl-ld.exe.

> swipl-ld.exe -shared -o myext myext.c

An embedded executable is created from C, C++ and Prolog files using

> swipl-ld.exe -o myexe file.c ... file.pl ...

3 The
installation

3.1 Supported
Windows versions

SWI-Prolog requiring Windows XP or later (XP, Vista, Windows-7). The
download site of SWI-Prolog contains older binaries that run on older
versions of Windows. We provide both 32-bit and 64-bit installers.

3.2 Choosing
the file extension

By default, Prolog uses the .pl extension to indicate
Prolog source files. Unfortunately this extension conflicts with the
Perl language. If you want to use both on the same Windows machine
SWI-Prolog allows you to choose a different extension during the
installation. The extension .pro is a commonly used
alternative. If portability is an issue, it is advised to use the
alternative extension only for the
load file, the source file that loads the entire program, and
use the normal .pl extension for libraries and files loaded
from other files.

3.3 Installed
programs

The table below lists the installed components. Some components are
marked (32-bits) or (64-bits). Most of this is because the 64-bit
version is built using more recent tools and from more recent versions
of required libraries using different naming conventions. This will
probably be synchronised in the future.

Programs

bin\swipl-win.exe 	Default
Windows application for interactive use.

bin\swipl.exe 	Console-based version for
scripting purposes.

Utilities

bin\swipl-ld.exe 	Linker
front-end to make single-file mixed Prolog/C/C++ executables.

Important directories

bin 	Executables and DLL
files

library 	Prolog library

boot 	Sources for system predicates

include 	C/C++ header files for embedding
or to create extensions

xpce 	XPCE graphics system

xpce\prolog\lib 	XPCE/Prolog library

DLLs and other supporting
files

boot32.prc 	Initial Prolog
state (32-bits)

boot64.prc 	Initial Prolog state (64-bits)

\bin\libswipl.dll 	The Prolog kernel

\bin\plterm.dll 	The window for swipl-win.exe

\bin\pthreadVC2.dll	POSIX thread runtime
library (64-bits)

Extension DLLs (plugins)

\bin\cgi.dll 	Gather CGI GET
and POST arguments

\bin\double_metaphone.dll 	Soundex (sounds
similar)

\bin\memfile.dll 	In-memory temporary‘files'

\bin\odbc4pl.dll 	ODBC interface

\bin\plregtry.dll 	Windows registry
interface

\bin\porter_stem.dll 	Porter stemming
implementation

\bin\random.dll 	Portable random number
generator

\bin\rdf_db.dll 	RDF database

\bin\readutil.dll 	Fast reading utility

\bin\sgml2pl.dll 	SGML/XML parser

\bin\socket.dll 	Prolog socket interface

\bin\table.dll 	Access structured files as
tables

\bin\time.dll 	Timing and alarm library

\bin\xpce2pl.dll 	The XPCE graphics system

\bin\zlib1.dll 	Compression library
(32-bits)

\bin\zlibwapi.dll 	Compression library
(64-bits)

\bin\zlib4pl.dll 	Compression library
interface

3.4 Installed
Registry keys and menus

The filetype .pl or chosen alternative (see section
3.2) is associated to swipl-win.exe. A chosen folder (default
SWI-Prolog) is added to the start menu holding shortcuts to Prolog and
some related utilities. The following registry keys are in use. The
64-bit version uses Prolog64 instead of Prolog
as a key to accommodate installation of both versions on the same
machine. Note that opening a
.pl file can be associated with one of the installed Prolog
versions only.

HKEY_LOCAL_MACHINE\Software\SWI\Prolog

fileExtension 	Extension used
for Prolog files

group 	Start menu group

home 	Installation directory

HKEY_CURRENT_USER\Software\SWI\Plwin\Console

Note: thread-windows store the same info
in sub-keys

Height 	Height of window in
character units

Width 	Width of window in character units

X 	Left edge of window in pixel units

Y 	Top edge of window in pixel units

SaveLines 	Number of lines available for
scrollback

3.5 Execution
level

The installer asks for the admin execution level (Vista
and later) to be able to write shortcuts and registry keys.

3.6 Creating
a desktop menu item

If you want a desktop entry for SWI-Prolog, right-drag
swipl-win.exe to the desktop and select‘Create shortcut'.
Then edit the properties and add --win-app to the
command line to make the application start in MyDocuments\Prolog.

4 The
SWI-Prolog community and foundation

4.1 Website
and mailing lists

The SWI-Prolog website is located at http://www.swi-prolog.org/.

4.2 About
license conditions

The SWI-Prolog license allows it to be used in a wide variety of
environments, including closed-source commercial applications. In
practice, redistribution and embedding is allowed, as long as
modifications to the SWI-Prolog source are published following
the Free Software rules.

The SWI-Prolog kernel and foreign libraries are licensed under the
Lesser General Public License (LGPL). The Prolog files are
licensed under the normal General Public License GPL with an
additional statement that allows for embedding in proprietary software:

 As a special exception, if you link this library with other
files compiled with a Free Software compiler to produce an executable,
this library does not by itself cause the resulting executable to be
covered by the GNU General Public License. This exception does not,
however, invalidate any other reasons why the executable file might be
covered by the GNU General Public License.

This exception is a proven construct used for libgcc, the
GNU C-compiler runtime library.

4.3 Supporting
SWI-Prolog

There are several ways to support SWI-Prolog:

Extend the system with contributions.

Improve the system by submitting bug reports and patches.

Link to http://www.swi-prolog.org
and refer to SWI-Prolog in publications.

For commercial users, it may be profitable to sponsor development
projects that make SWI-Prolog more useful for you and others. Example
projects from the part include adding the initial garbage collector,
unbounded integer support, SSL interface, (re-)introduction of the
stack-shifter, avoid C-recursion on Prolog data structures, the PlUnit
test environment and the PlDoc documentation environment.

Sponsoring development has several benefits: (1) it solves your
bottlenecks, (2) others help debugging it, and (3) it strengthens
SWI-Prolog's position, which gives you better guarantees that the system
remains actively developed and makes it easier to find resources and
programmers.

Index

?

apropos/1

consult/1

edit/0

edit/1

1.4

gtrace/0

help/1

1.5

ls/0

make/0

1.3 1.4

pwd/0

1.5

qsave_program/2

2.1

trace/0


text:
{% extends "staff/staff_base.html" %}

{% load staticfiles %}
{% load compile_static %}
{% block title %}学习中心编辑{% endblock %}

{% block addition_header %}
    <link rel="stylesheet" type="text/css" href="{% static 'staff/less/school/school.less'|compile %}">
{% endblock %}
{% block addition_js %}

{% endblock %}

{% block content %}

        <form class="form-inline school-edit" method="post" action="{% url 'staff:staff_school' %}" enctype="multipart/form-data" id="editForm">
            {% csrf_token %}
            <input type="hidden" name="schoolId" value="{{schoolId}}" />

                {%if school.id%}
                    中心编辑
                {%else%}
                    新增中心
                {%endif%}

                中心名称

                    <input type="text" class="form-control" id="schoolName" name="schoolName" placeholder="请输入中心名称" value="{{school.name }}" >

                中心类别

                    <select class="form-control" name="center">
                      <option {%if school.center%}selected{%else%}{%endif%} value="1">体验中心</option>
                      <option {%if school.center%}{%else%}selected{%endif%} value="0">社区中心</option>
                    </select>

                是否开放

                    <select class="form-control" name="opened">
                      <option {%if school.opened%}selected{%else%}{%endif%} value="1">是</option>
                      <option {%if school.opened%}{%else%}selected{%endif%} value="0">否</option>
                    </select>

                所属地区

                    <select class="form-control" name="regionId">
                    {% for region in region_list %}
                        <option value="{{region.id}}" {%if region.id == school.region.id %} selected="selected"{% endif %}>{{ region.name }}</option>
                    {% endfor %}
                    </select>

                详细地址

                    <input type="text" class="form-control" name="address" value="{{school.address}}" />

                联系电话

                    <input type="text" class="form-control" name="phone" value="{{school.phone|default_if_none:""}}" />

                上课座位

                    <input type="number" data-action="integer" class="form-control" name="class_seat" value="{{school.class_seat}}" />

                自习座位

                    <input type="number" data-action="integer" class="form-control" name="study_seat" value="{{school.study_seat}}" />

                分成比例

                    <input type="number" data-action="integer" class="form-control" name="share_rate" value="{{school.share_rate}}" />
                    (0 ~ 100)

                会员服务

                    {% for service in memberservices %}

                            {% if service.id in school.get_member_service_list %}
                                <input type="checkbox" name="services" value={{ service.id }} checked>
                            {% else %}
                                <input type="checkbox" name="services" value={{ service.id }}>
                            {% endif %}

                            {{ service.name }}

                    {% endfor %}

                环境图片

                    {% if not school.schoolphoto_set.all %}

                                上传/重传
                                <input title="请选择图片" type="file" name="schoolImg" multiple="" accept="image/*"/>

                            删除

                    {%else%}
                        {%for photo in school.schoolphoto_set.all %}

                            <input type="hidden" name="schoolImgId" value="{{photo.id}}"/>

                                    上传/重传
                                    <input title="请选择图片" type="file" name="schoolImg" multiple="" accept="image/*"/>

                                删除

                        {%endfor%}
                    {%endif%}

                        +

                        经度

                    <input type="text" class="form-control" id="longitude" name="longitude" value="{{school.longitude }}" data-old="{{school.longitude }}">

                        纬度

                    <input type="text" class="form-control" id="latitude" name="latitude" value="{{school.latitude }}" data-old="{{school.latitude }}">

                经纬度查询地址:点我

                描述标题

                    <input type="text" class="form-control" name="desc_title" value="{{school.desc_title|default_if_none:""}}" />

                描述内容

                    <textarea class="form-control" cols="19" rows="5" name="desc_content" id="desc_content">{{school.desc_content|default_if_none:""}}</textarea>

                <button class="btn btn-default submit_button" id="subBtn">提交</button>

        </form>

{% endblock %}


text:
[![Open in Cloud Shell][shell_img]][shell_link]

[shell_img]: http://gstatic.com/cloudssh/images/open-btn.png
[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor=blog/README.md

This directory contains samples used in the
[Cloud Platform Blog](http://cloud.google.com/blog). Each sample should have a
readme with instructions and a link to its respective blog post.


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MicroMsg.sdk;

namespace ZhiHuDaily.UWP.Core.Share
{
    public class WeChatRequest
    {
        string APP_ID = "123456789";

        public WeChatRequest(string app_id)
        {
            APP_ID = app_id;
        }
        /// <summary>
        /// 网页分享到微信好友
        /// </summary>
        /// <param name="url">网页url</param>
        /// <param name="title">分享标题</param>
        /// <param name="thumb">站位图标</param>
        public async void WebPageShare2SessionRequest(string url, string title, byte[] thumb)
        {
            var message = new WXWebpageMessage
            {
                WebpageUrl = url,
                ThumbData = thumb,
                Title = title
            };
            SendMessageToWX.Req request = new SendMessageToWX.Req(message, SendMessageToWX.Req.WXSceneSession);
            IWXAPI api = WXAPIFactory.CreateWXAPI(APP_ID);

            await api.SendReq(request);
        }
        /// <summary>
        /// 网页分享到微信朋友圈
        /// </summary>
        /// <param name="url"></param>
        /// <param name="title"></param>
        /// <param name="thumb"></param>
        public async void WebPageShare2TimelineRequest(string url, string title, byte[] thumb)
        {
            var message = new WXWebpageMessage
            {
                WebpageUrl = url,
                ThumbData = thumb,
                Title = title
            };
            SendMessageToWX.Req request = new SendMessageToWX.Req(message, SendMessageToWX.Req.WXSceneTimeline);
            IWXAPI api = WXAPIFactory.CreateWXAPI(APP_ID);

            await api.SendReq(request);
        }
        /// <summary>
        /// 文本分享到微信好友
        /// </summary>
        /// <param name="text"></param>
        /// <param name="title"></param>
        /// <param name="thumb"></param>
        public async void TextShare2SessionRequest(string text, string title, byte[] thumb)
        {
            var message = new WXTextMessage
            {
                Text = text,
                ThumbData = thumb,
                Title = title
            };
            SendMessageToWX.Req request = new SendMessageToWX.Req(message, SendMessageToWX.Req.WXSceneSession);
            IWXAPI api = WXAPIFactory.CreateWXAPI(APP_ID);

            await api.SendReq(request);
        }
        /// <summary>
        /// 文本分享到微信朋友圈
        /// </summary>
        /// <param name="text"></param>
        /// <param name="title"></param>
        /// <param name="thumb"></param>
        public async void TextShare2TimelineRequest(string text, string title, byte[] thumb)
        {
            var message = new WXTextMessage
            {
                Text = text,
                ThumbData = thumb,
                Title = title
            };
            SendMessageToWX.Req request = new SendMessageToWX.Req(message, SendMessageToWX.Req.WXSceneTimeline);
            IWXAPI api = WXAPIFactory.CreateWXAPI(APP_ID);

            await api.SendReq(request);
        }
    }
}


text:
package org.optaplanner.examples.nqueens.optional.solver.tracking;

import static org.assertj.core.api.Assertions.assertThat;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;
import org.optaplanner.core.api.solver.SolverFactory;
import org.optaplanner.core.config.heuristic.selector.common.SelectionOrder;
import org.optaplanner.core.config.heuristic.selector.move.generic.ChangeMoveSelectorConfig;
import org.optaplanner.core.config.localsearch.LocalSearchPhaseConfig;
import org.optaplanner.core.config.localsearch.decider.acceptor.AcceptorType;
import org.optaplanner.core.config.localsearch.decider.acceptor.LocalSearchAcceptorConfig;
import org.optaplanner.core.config.localsearch.decider.forager.LocalSearchForagerConfig;
import org.optaplanner.core.config.solver.SolverConfig;
import org.optaplanner.core.config.solver.termination.TerminationConfig;
import org.optaplanner.core.impl.solver.DefaultSolver;
import org.optaplanner.examples.nqueens.app.NQueensApp;
import org.optaplanner.examples.nqueens.domain.NQueens;
import org.optaplanner.examples.nqueens.persistence.NQueensGenerator;

class NQueensLocalSearchTrackingTest extends NQueensAbstractTrackingTest {

    private static final int N = 6;

    @ParameterizedTest(name = "AcceptorType: {0}")
    @MethodSource("parameters")
    void trackLocalSearch(LocalSearchAcceptorConfig acceptorConfig,
            LocalSearchForagerConfig localSearchForagerConfig,
            List<NQueensStepTracking> expectedCoordinates) {
        SolverConfig solverConfig = SolverConfig.createFromXmlResource(NQueensApp.SOLVER_CONFIG);

        NQueens problem = new NQueensGenerator().createNQueens(N);
        problem.getQueenList().forEach(queen -> queen.setRow(problem.getRowList().get(0)));

        LocalSearchPhaseConfig localSearchPhaseConfig = new LocalSearchPhaseConfig();
        localSearchPhaseConfig.setAcceptorConfig(acceptorConfig);
        localSearchPhaseConfig.setForagerConfig(localSearchForagerConfig);
        localSearchPhaseConfig.getForagerConfig().setBreakTieRandomly(false);
        localSearchPhaseConfig.setMoveSelectorConfig(new ChangeMoveSelectorConfig());
        localSearchPhaseConfig.getMoveSelectorConfig().setSelectionOrder(SelectionOrder.ORIGINAL);
        localSearchPhaseConfig.setTerminationConfig(new TerminationConfig().withStepCountLimit(20));
        solverConfig.getPhaseConfigList().set(1, localSearchPhaseConfig);

        NQueensStepTracker listener = new NQueensStepTracker();
        SolverFactory<NQueens> solverFactory = SolverFactory.create(solverConfig);
        DefaultSolver<NQueens> solver = (DefaultSolver<NQueens>) solverFactory.buildSolver();
        solver.addPhaseLifecycleListener(listener);
        NQueens bestSolution = solver.solve(problem);

        assertThat(bestSolution).isNotNull();
        assertTrackingList(expectedCoordinates, listener.getTrackingList());
    }

    static Collection<Object[]> parameters() {
        Collection<Object[]> params = new ArrayList<>();

        params.add(new Object[] {
                new LocalSearchAcceptorConfig()
                        .withAcceptorTypeList(Arrays.asList(AcceptorType.HILL_CLIMBING)),
                new LocalSearchForagerConfig()
                        .withAcceptedCountLimit(N * N),
                Arrays.asList(
                        new NQueensStepTracking(1, 5), new NQueensStepTracking(0, 1),
                        new NQueensStepTracking(4, 3), new NQueensStepTracking(2, 2),
                        new NQueensStepTracking(3, 5), new NQueensStepTracking(1, 4),
                        new NQueensStepTracking(1, 5), new NQueensStepTracking(1, 4),
                        new NQueensStepTracking(1, 5)) });
        params.add(new Object[] {
                new LocalSearchAcceptorConfig()
                        .withAcceptorTypeList(Arrays.asList(AcceptorType.ENTITY_TABU))
                        .withEntityTabuSize(N - 1),
                new LocalSearchForagerConfig()
                        .withAcceptedCountLimit(N * N),
                Arrays.asList(
                        new NQueensStepTracking(1, 5), new NQueensStepTracking(0, 1),
                        new NQueensStepTracking(4, 3), new NQueensStepTracking(2, 2),
                        new NQueensStepTracking(3, 5), new NQueensStepTracking(5, 4),
                        new NQueensStepTracking(1, 4), new NQueensStepTracking(0, 0),
                        new NQueensStepTracking(4, 1)) });
        params.add(new Object[] {
                new LocalSearchAcceptorConfig()
                        .withAcceptorTypeList(Arrays.asList(AcceptorType.LATE_ACCEPTANCE))
                        .withLateAcceptanceSize(1),
                new LocalSearchForagerConfig()
                        .withAcceptedCountLimit(1),
                Arrays.asList(
                        // (0, 0) is rejected due to high score
                        new NQueensStepTracking(0, 1), new NQueensStepTracking(0, 2),
                        new NQueensStepTracking(0, 1), new NQueensStepTracking(0, 2),
                        new NQueensStepTracking(0, 1), new NQueensStepTracking(0, 2)) });
        return params;
    }
}


text:
package com.sumologic.maven.stats.serializer;

import com.sumologic.maven.stats.profiler.SessionProfiler;
import org.codehaus.jackson.map.ObjectMapper;

/**
 * @author Chris (chris@sumologic.com)
 */
public class JsonProfilingSerializer implements ProfilingSerializer {
  private ObjectMapper mapper = new ObjectMapper();

  public String serialize(SessionProfiler session) throws Exception {
    return mapper.writeValueAsString(session);
  }
}


text:
require 'test/unit'
require 'authorize/graph/fixtures'

module Authorize
  module TestHelper
    # Assert that a given role explicitly has a given permission mode for a given resource
    # Example: assert_authorized(current_user, :read, :list, widget)
    # If a trustee is provided instead of a role, then the primary role of the trustee is used.
    def assert_authorized(*args)
      tor = args.shift
      role = tor.is_a?(Authorize::Role) ? tor : tor.role
      assert_block("Role #{role} is not authorized") {role.may?(*args)}
    end

    def assert_unauthorized(*args)
      tor = args.shift
      role = tor.is_a?(Authorize::Role) ? tor : tor.role
      assert_block("Role #{role} is authorized") {role.may_not?(*args)}
    end

    def assert_has_role(tor, subrole)
      role = tor.is_a?(Authorize::Role) ? tor : tor.role
      assert_block("Role #{role} does not include #{subrole}") {role.roles.include?(subrole)}
    end

    def assert_does_not_have_role(tor, subrole)
      role = tor.is_a?(Authorize::Role) ? tor : tor.role
      assert_block("Role #{role} includes #{subrole}") {!role.roles.include?(subrole)}
    end

    # A weak assertion of access
    # The assertion includes subordinate roles' permissions and considers global/class permissions
    def assert_permitted(tor, *args)
      role = tor.is_a?(Authorize::Role) ? tor : tor.role
      resource = args.pop
      request_mask = Authorize::Permission::Mask[*args]
      assert_block("Role #{role} is not permitted (#{request_mask})") do
        Authorize::Permission.over(resource).as(role.roles).permit?(request_mask)
      end
    end
  end
end


text:
import React, { Component } from 'react';
import Search from './Search';
import '../styles/home.css';

class Home extends Component {
    render() {
        return (

                            Create, Share, Enjoy

                <Search />

        );
    }
}

export default Home;


text:
/**
 * Maximum size of a node in a prefix tree. Smaller is slower, but the results
 * will contain fewer superfluous objects.
 */
const maxNodeSize = 5;

/**
 * A structure that allows to add objects at given string positions, and
 * retrieve all objects (together with some superfluous ones!) that at positions
 * that are prefixes of a given string. The string should not contain characters
 * '-' nor '?'.
 */
export default class PrefixTree {
  /** Constructs new empty PrefixTree. */
  constructor() {
    /** @private @const {!Map} The root node.*/
    this.root_ = new Map();
    this.root_.set('-', []);
  }

  /**
   * Adds an object at a given string position.
   * @param {string} position
   * @param {*} object
   */
  add(position, object) {
    let node = this.root_;
    let i = 0;
    for (const c of position) {
      // Go deeper into nodes as far as possible.
      if (node.has(c)) {
        node = node.get(c);
        i++;
      } else if (node.has('?')) {
        // If a node has already been split, add the next character to it.
        node.set(c, new Map());
        node.get(c).set('-', []);
        node = node.get(c);
        i++;
      } else {
        break;
      }
    }
    node.get('-').push([position.substr(i), object]);
    if (node.get('-').length > maxNodeSize)
      this.splitNode(node);
  }

  /**
   * Helper function that splits a node Map into a Map of Maps.
   * @param {!Map} node
   */
  splitNode(node) {
    const objectsEndingAtNode = [];
    for (const [position, object] of node.get('-')) {
      if (position.length == 0) {
        objectsEndingAtNode.push([position, object]);
        continue;
      }
      const c = position.charAt(0);
      if (!node.has(c)) {
        node.set(c, new Map());
        node.get(c).set('-', []);
      }
      node.get(c).get('-').push([position.substr(1), object]);
    }
    node.set('-', objectsEndingAtNode);
    node.set('?', true);
  }

  /**
   * Returns Array of all objects under positions that are prefixes of 'value'.
   * This returns some superfluous objects too!
   * @param {string} value
   * @return {Array<*>}
   */
  get(value) {
    let node = this.root_;
    let result = node.get('-');
    for (const c of value) {
      if (node.has(c)) {
        node = node.get(c);
        result = result.concat(node.get('-'));
      } else {
        break;
      }
    }
    return result.map(([_position, object]) => object);
  }
}