text:
/* @test
 * @bug 4115696

 * @summary synopsis: cannot use socket factories with Activatable objects
 * @author Ann Wollrath
 *
 * @library ../../../../testlibrary
 * @build TestLibrary Echo EchoImpl EchoImpl_Stub
 * @run main/othervm/policy=security.policy/timeout=360 UseCustomSocketFactory
 */

import java.io.*;
import java.rmi.*;
import java.rmi.activation.*;
import java.rmi.server.*;
import java.rmi.registry.*;

public class UseCustomSocketFactory {
    static final int REGISTRY_PORT = TestLibrary.getUnusedRandomPort();

    static String[] protocol = new String[] { "", "compress", "xor" };

    public static void main(String[] args) {

        System.out.println("\nRegression test for bug 4115696\n");

        TestLibrary.suggestSecurityManager("java.rmi.RMISecurityManager");

        try {
            LocateRegistry.createRegistry(REGISTRY_PORT);
        } catch (Exception e) {
            TestLibrary.bomb("creating registry", e);
        }

        RMID rmid = null;

        try {
            rmid = RMID.createRMID(true);
            rmid.addArguments(new String[] {
                "-C-Djava.security.policy=" +
                    TestParams.defaultGroupPolicy +
                    " -C-Djava.security.manager=java.rmi.RMISecurityManager "});
            rmid.start();

            Echo[] echo = spawnAndTest(rmid.getPort());
            reactivateAndTest(echo);
        } catch (IOException e) {
            TestLibrary.bomb("creating rmid", e);
        } finally {
            if (rmid != null)
                rmid.destroy();
        }
    }

    private static Echo[] spawnAndTest(int rmidPort) {

        System.err.println("\nCreate Test-->");

        Echo[] echo = new Echo[protocol.length];

        for (int i = 0; i < protocol.length; i++) {
            JavaVM serverVM = new JavaVM("EchoImpl",
                                         "-Djava.security.policy=" +
                                         TestParams.defaultPolicy +
                                         " -Drmi.registry.port=" +
                                         REGISTRY_PORT +
                                         " -Djava.rmi.activation.port=" +
                                         rmidPort,
                                         protocol[i]);

            System.err.println("\nusing protocol: " +
                               (protocol[i] == "" ? "none" : protocol[i]));

            try {
                /* spawn VM for EchoServer */
                serverVM.start();

                /* lookup server */
                int tries = 12;        // need enough tries for slow machine.
                echo[i] = null;
                do {
                    try {
                        echo[i] = (Echo) Naming.lookup("//:" + REGISTRY_PORT +
                                                       "/EchoServer");
                        break;
                    } catch (NotBoundException e) {
                        try {
                            Thread.sleep(2000);
                        } catch (Exception ignore) {
                        }
                        continue;
                    }
                } while (--tries > 0);

                if (echo[i] == null)
                    TestLibrary.bomb("server not bound in 12 tries", null);

                /* invoke remote method and print result*/
                System.err.println("Bound to " + echo[i]);
                byte[] data = ("Greetings, citizen " +
                               System.getProperty("user.name") + "!"). getBytes();
                byte[] result = echo[i].echoNot(data);
                for (int j = 0; j < result.length; j++)
                    result[j] = (byte) ~result[j];
                System.err.println("Result: " + new String(result));
                echo[i].shutdown();

            } catch (Exception e) {
                TestLibrary.bomb("test failed", e);

            } finally {
                serverVM.destroy();
                try {
                    Naming.unbind("//:" + REGISTRY_PORT + "/EchoServer");
                } catch (Exception e) {
                    TestLibrary.bomb("unbinding EchoServer", e);

                }
            }
        }
        return echo;
    }

    private static void reactivateAndTest(Echo[] echo) {

        System.err.println("\nReactivate Test-->");

        for (int i = 0; i < echo.length; i++) {
            try {
                System.err.println("\nusing protocol: " +
                                   (protocol[i] == "" ? "none" : protocol[i]));
                byte[] data = ("Greetings, citizen " +
                               System.getProperty("user.name") + "!").getBytes();
                byte[] result = echo[i].echoNot(data);
                for (int j = 0; j < result.length; j++)
                    result[j] = (byte) ~result[j];
                System.err.println("Result: " + new String(result));
                echo[i].shutdown();
            } catch (Exception e) {
                TestLibrary.bomb("activating EchoServer for protocol " + protocol[i], e);
            }
        }
    }
}


text:
<?php

namespace frontend\modules\region\behaviors;

use Yii;
use yii\base\Event;
use yii\behaviors\AttributeBehavior;
use yii\db\BaseActiveRecord;
use frontend\modules\region\models\Country;

/**
 * handling country property
 * when typing a name instead of selecting, it will be inserted as new country
 *
 * @property string $countryAttribute
 *
 * @author fredy
 */
class CountryBehavior extends AttributeBehavior
{

	public $countryAttribute = 'country_id';

	public $value;

	/**
	 * @inheritdoc
	 */
	public function init()
	{
		parent::init();

		if (empty($this->attributes))
		{
			$this->attributes = [
				BaseActiveRecord::EVENT_BEFORE_INSERT	 => $this->countryAttribute,
				BaseActiveRecord::EVENT_BEFORE_UPDATE	 => $this->countryAttribute,
			];
		}

	}

	/**
	 * Evaluates the value of the user.
	 * The return result of this method will be assigned to the current attribute(s).
	 * @param Event $event
	 * @return mixed the value of the user.
	 */
	protected function getValue($event)
	{
		$attribute = $this->countryAttribute;
		$value = $this->owner->$attribute;

		if (is_numeric($value))
		{
			return $value;
		}
		else if (empty($value))
		{
			return NULL;
		}
		else
		{
			$model = new Country([
				'name'			 => $value,
				'recordStatus'	 => Country::RECORDSTATUS_USED,
			]);

			return $model->save(FALSE) ? $model->id : 0;
		}

	}

}

redpajama_set_name: RedPajamaGithub


text:
<!-- start custom head snippets -->

<!-- insert favicons. use https://realfavicongenerator.net/ -->
<!-- <link rel="shortcut icon" type="image/png" href="asset/image/favicon.ico/>
<link rel="shortcut icon" type="image/png" href="http://example.com/favicon.png"/> -->

<!-- end custom head snippets -->


text:
"This module is a thin layer of abstraction around the library. It exposes all core functionality."

import capabilities
import operations
import transport

import logging
logger = logging.getLogger('ncclient.manager')

CAPABILITIES = [
    "urn:ietf:params:netconf:base:1.0",
    "urn:ietf:params:netconf:capability:writable-running:1.0",
    "urn:ietf:params:netconf:capability:candidate:1.0",
    "urn:ietf:params:netconf:capability:confirmed-commit:1.0",
    "urn:ietf:params:netconf:capability:rollback-on-error:1.0",
    "urn:ietf:params:netconf:capability:startup:1.0",
    "urn:ietf:params:netconf:capability:url:1.0?scheme=http,ftp,file,https,sftp",
    "urn:ietf:params:netconf:capability:validate:1.0",
    "urn:ietf:params:netconf:capability:xpath:1.0",
    "urn:liberouter:params:netconf:capability:power-control:1.0"
    "urn:ietf:params:netconf:capability:interleave:1.0"
    #'urn:ietf:params:netconf:capability:notification:1.0', # TODO
]
"""A list of URI's representing the client's capabilities. This is used during the initial
capability exchange. Modify this if you need to announce some capability not already included.
"""

OPERATIONS = {
    "get": operations.Get,
    "get_config": operations.GetConfig,
    "edit_config": operations.EditConfig,
    "copy_config": operations.CopyConfig,
    "validate": operations.Validate,
    "commit": operations.Commit,
    "discard_changes": operations.DiscardChanges,
    "delete_config": operations.DeleteConfig,
    "lock": operations.Lock,
    "unlock": operations.Unlock,
    "close_session": operations.CloseSession,
    "kill_session": operations.KillSession,
    "poweroff_machine": operations.PoweroffMachine,
    "reboot_machine": operations.RebootMachine
}
"""Dictionary of method names and corresponding `~ncclient.operations.RPC` subclasses. It is used to
lookup operations, e.g. "get_config" is mapped to `~ncclient.operations.GetConfig`. It is thus
possible to add additional operations to the `Manager` API."""

def connect_ssh(*args, **kwds):
    """Initializes a NETCONF session over SSH, and creates a connected `Manager` instance. *host*
    must be specified, all the other arguments are optional and depend on the kind of host key
    verification and user authentication you want to complete.

    For the purpose of host key verification, on -NIX systems a user's :file:`~/.ssh/known_hosts`
    file is automatically considered. The *unknown_host_cb* argument specifies a callback that will
    be invoked when the server's host key cannot be verified. See
    :func:`~ncclient.transport.ssh.default_unknown_host_cb` for function signature.

    First, ``publickey`` authentication is attempted. If a specific *key_filename* is specified, it
    will be loaded and authentication attempted using it. If *allow_agent* is :const:`True` and an
    SSH agent is running, the keys provided by the agent will be tried. If *look_for_keys* is
    :const:`True`, keys in the :file:`~/.ssh/id_rsa` and :file:`~.ssh/id_dsa` will be tried. In case
    an encrypted key file is encountered, the *password* argument will be used as a decryption
    passphrase.

    If ``publickey`` authentication fails and the *password* argument has been supplied,
    ``password`` / ``keyboard-interactive`` SSH authentication will be attempted.

    :param host: hostname or address on which to connect
    :type host: `string`

    :param port: port on which to connect
    :type port: `int`

    :param timeout: timeout for socket connect
    :type timeout: `int`

    :param unknown_host_cb: optional; callback that is invoked when host key verification fails
    :type unknown_host_cb: `function`

    :param username: username to authenticate with, if not specified the username of the logged-in user is used
    :type username: `string`

    :param password: password for ``password`` authentication or passphrase for decrypting private key files
    :type password: `string`

    :param key_filename: location of a private key file on the file system
    :type key_filename: `string`

    :param allow_agent: whether to try connecting to SSH agent for keys
    :type allow_agent: `bool`

    :param look_for_keys: whether to look in usual locations for keys
    :type look_for_keys: `bool`

    :raises: :exc:`~ncclient.transport.SSHUnknownHostError`
    :raises: :exc:`~ncclient.transport.AuthenticationError`

    :rtype: `Manager`
    """
    session = transport.SSHSession(capabilities.Capabilities(CAPABILITIES))
    session.load_known_hosts()
    session.connect(*args, **kwds)
    return Manager(session)

connect = connect_ssh
"Same as :func:`connect_ssh`, since SSH is the default (and currently, the only) transport."

class Manager(object):

    def __init__(self, session):
        self._session = session
        self._async_mode = False
        self._timeout = None
        self._raise_mode = 'all'

    def __enter__(self):
        return self

    def __exit__(self, *argss):
        self.close_session()
        return False

    def __getattr__(self, name):
        op = OPERATIONS.get(name, None)
        if op is None:
            raise AttributeError
        else:
            return op(self._session,
                      async=self._async_mode,
                      timeout=self._timeout,
                      raise_mode=self._raise_mode).request

    def locked(self, target):
        return operations.LockContext(self._session, target)

    @property
    def client_capabilities(self):
        return self._session._client_capabilities

    @property
    def server_capabilities(self):
        return self._session._server_capabilities

    @property
    def session_id(self):
        return self._session.id

    @property
    def connected(self):
        return self._session.connected

    def set_async_mode(self, mode):
        self._async_mode = mode

    def set_raise_mode(self, mode):
        assert(choice in ("all", "errors", "none"))
        self._raise_mode = mode

    async_mode = property(fget=lambda self: self._async_mode, fset=set_async_mode)

    raise_mode = property(fget=lambda self: self._raise_mode, fset=set_raise_mode)


text:
#include "win32/uuid.hpp"
#include "util/methodscope.hpp"
#include "win32/exception.hpp"

using namespace Windows;

Uuid::Uuid()
{
  RPC_STATUS res;

  if ((res = UuidCreateNil(&_uuid)) != RPC_S_OK)
  {
    SetLastError(static_cast< DWORD >(res));
    throw Exception();
  }

  if ((res = UuidCreate(&_uuid)) != RPC_S_OK)
  {
    SetLastError(static_cast< DWORD >(res));
    throw Exception();
  }
}

std::wstring Uuid::value(const std::wstring &sPrefix) const
{
  RPC_WSTR sUuid = NULL;

  MethodScope m([&sUuid] () { RpcStringFree(&sUuid); });

  RPC_STATUS res;
  if ((res =

  #if defined(__GNUC__)
    UuidToString(const_cast<UUID *>(&_uuid), &sUuid)
  #else
    UuidToString(&_uuid, &sUuid)
  #endif
    ) != RPC_S_OK)
  {
    SetLastError(static_cast< DWORD >(res));
    throw Exception();
  }

  return sPrefix + std::wstring(reinterpret_cast< wchar_t * >(sUuid));
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace SlidingCardsDemo.Controllers
{
    public class DefaultController : Controller
    {
        public ActionResult Default()
        {
            return View("~/Views/Default.cshtml");
        }
    }
}


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

<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Package org.apache.hadoop.hbase.zookeeper (HBase 0.98.7-hadoop2 API)</title>
<meta name="date" content="2014-10-08">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Package
org.apache.hadoop.hbase.zookeeper

Packages that use org.apache.hadoop.hbase.zookeeper

Package
Description

org.apache.hadoop.hbase

org.apache.hadoop.hbase.backup.example

org.apache.hadoop.hbase.catalog

org.apache.hadoop.hbase.master

org.apache.hadoop.hbase.procedure

org.apache.hadoop.hbase.regionserver

org.apache.hadoop.hbase.regionserver.handler

org.apache.hadoop.hbase.regionserver.wal

org.apache.hadoop.hbase.replication

Multi Cluster Replication

org.apache.hadoop.hbase.security.access

org.apache.hadoop.hbase.security.token

org.apache.hadoop.hbase.security.visibility

org.apache.hadoop.hbase.util.hbck

org.apache.hadoop.hbase.zookeeper

org.apache.hadoop.hbase.zookeeper.lock

Classes in org.apache.hadoop.hbase.zookeeper used by org.apache.hadoop.hbase

Class and Description

ZooKeeperListener

Base class for internal listeners of ZooKeeper events.

ZooKeeperWatcher

Acts as the single ZooKeeper Watcher.

Classes in org.apache.hadoop.hbase.zookeeper used by org.apache.hadoop.hbase.backup.example

Class and Description

ZooKeeperListener

Base class for internal listeners of ZooKeeper events.

ZooKeeperWatcher

Acts as the single ZooKeeper Watcher.

Classes in org.apache.hadoop.hbase.zookeeper used by org.apache.hadoop.hbase.catalog

Class and Description

ZooKeeperWatcher

Acts as the single ZooKeeper Watcher.

Classes in org.apache.hadoop.hbase.zookeeper used by org.apache.hadoop.hbase.master

Class and Description

MasterAddressTracker

Manages the location of the current active Master for the RegionServer.

ZKTable

Helper class for table state tracking for use by AssignmentManager.

ZooKeeperListener

Base class for internal listeners of ZooKeeper events.

ZooKeeperWatcher

Acts as the single ZooKeeper Watcher.

Classes in org.apache.hadoop.hbase.zookeeper used by org.apache.hadoop.hbase.procedure

Class and Description

ZooKeeperListener

Base class for internal listeners of ZooKeeper events.

ZooKeeperWatcher

Acts as the single ZooKeeper Watcher.

Classes in org.apache.hadoop.hbase.zookeeper used by org.apache.hadoop.hbase.regionserver

Class and Description

MasterAddressTracker

Manages the location of the current active Master for the RegionServer.

ZooKeeperListener

Base class for internal listeners of ZooKeeper events.

ZooKeeperWatcher

Acts as the single ZooKeeper Watcher.

Classes in org.apache.hadoop.hbase.zookeeper used by org.apache.hadoop.hbase.regionserver.handler

Class and Description

ZooKeeperWatcher

Acts as the single ZooKeeper Watcher.

Classes in org.apache.hadoop.hbase.zookeeper used by org.apache.hadoop.hbase.regionserver.wal

Class and Description

ZooKeeperWatcher

Acts as the single ZooKeeper Watcher.

Classes in org.apache.hadoop.hbase.zookeeper used by org.apache.hadoop.hbase.replication

Class and Description

ZooKeeperListener

Base class for internal listeners of ZooKeeper events.

ZooKeeperNodeTracker

Tracks the availability and value of a single ZooKeeper node.

ZooKeeperWatcher

Acts as the single ZooKeeper Watcher.

Classes in org.apache.hadoop.hbase.zookeeper used by org.apache.hadoop.hbase.security.access

Class and Description

ZooKeeperListener

Base class for internal listeners of ZooKeeper events.

ZooKeeperWatcher

Acts as the single ZooKeeper Watcher.

Classes in org.apache.hadoop.hbase.zookeeper used by org.apache.hadoop.hbase.security.token

Class and Description

ZooKeeperListener

Base class for internal listeners of ZooKeeper events.

ZooKeeperWatcher

Acts as the single ZooKeeper Watcher.

Classes in org.apache.hadoop.hbase.zookeeper used by org.apache.hadoop.hbase.security.visibility

Class and Description

ZooKeeperListener

Base class for internal listeners of ZooKeeper events.

ZooKeeperWatcher

Acts as the single ZooKeeper Watcher.

Classes in org.apache.hadoop.hbase.zookeeper used by org.apache.hadoop.hbase.util.hbck

Class and Description

ZooKeeperWatcher

Acts as the single ZooKeeper Watcher.

Classes in org.apache.hadoop.hbase.zookeeper used by org.apache.hadoop.hbase.zookeeper

Class and Description

EmptyWatcher

An empty ZooKeeper watcher

RecoverableZooKeeper

A zookeeper that can handle 'recoverable' errors.

ZKUtil.NodeAndData

Deprecated.

Unused

ZKUtil.ZKUtilOp

Represents an action taken by ZKUtil, e.g.

ZooKeeperListener

Base class for internal listeners of ZooKeeper events.

ZooKeeperNodeTracker

Tracks the availability and value of a single ZooKeeper node.

ZooKeeperWatcher

Acts as the single ZooKeeper Watcher.

Classes in org.apache.hadoop.hbase.zookeeper used by org.apache.hadoop.hbase.zookeeper.lock

Class and Description

ZooKeeperWatcher

Acts as the single ZooKeeper Watcher.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2014 The Apache Software Foundation. All rights reserved.


text:
using System.IO;
using Castle.MonoRail.Framework;
using Spark.FileSystem;

namespace Castle.MonoRail.Views.Spark.Wrappers
{
    public class ViewSourceWrapper : IViewFile
    {
        private readonly IViewSource _source;

        public ViewSourceWrapper(IViewSource source)
        {
            _source = source;
        }

        public long LastModified
        {
            get { return _source.LastModified; }
        }

        public Stream OpenViewStream()
        {
            return _source.OpenViewStream();
        }
    }
}


text:
<?php

namespace App;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Zizaco\Entrust\Traits\EntrustUserTrait;
use App\Role;

class User extends Authenticatable
{
    use Notifiable;
    use EntrustUserTrait;
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];

    /**
     * get Role user
     * @return mixed
     */
    public function scopeRole()
    {
        return $this->roles->first();
    }

    /**
     * get only active
     */
    public function scopeisActive()
    {
        return $this->where('active', 1);
    }
}


text:
package vswitch

import (
	"flag"

	"github.com/juju/govmomi/govc/cli"
	"github.com/juju/govmomi/govc/flags"
	"github.com/juju/govmomi/vim25/types"
	"golang.org/x/net/context"
)

type add struct {
	*flags.HostSystemFlag

	nic  string
	spec types.HostVirtualSwitchSpec
}

func init() {
	cli.Register("host.vswitch.add", &add{})
}

func (cmd *add) Register(f *flag.FlagSet) {
	f.IntVar(&cmd.spec.NumPorts, "ports", 128, "Number of ports")
	f.IntVar(&cmd.spec.Mtu, "mtu", 0, "MTU")
	f.StringVar(&cmd.nic, "nic", "", "Bridge nic device")
}

func (cmd *add) Process() error { return nil }

func (cmd *add) Usage() string {
	return "NAME"
}

func (cmd *add) Run(f *flag.FlagSet) error {
	ns, err := cmd.HostNetworkSystem()
	if err != nil {
		return err
	}

	if cmd.nic != "" {
		cmd.spec.Bridge = &types.HostVirtualSwitchBondBridge{
			NicDevice: []string{cmd.nic},
		}
	}

	return ns.AddVirtualSwitch(context.TODO(), f.Arg(0), &cmd.spec)
}


text:
import * as React from 'react';
import { StandardProps } from '..';

export interface DialogActionsProps
  extends StandardProps<React.HTMLAttributes<HTMLDivElement>, DialogActionsClassKey> {
  disableSpacing?: boolean;
}

export type DialogActionsClassKey = 'root' | 'spacing';

declare const DialogActions: React.ComponentType<DialogActionsProps>;

export default DialogActions;


text:
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.

/*=============================================================================
	IOSTargetPlatformPrivatePCH.h: Pre-compiled header file for the IOSTargetPlatform module.
=============================================================================*/

#pragma once

/* Dependencies
 *****************************************************************************/

#include "Core.h"
#include "ModuleInterface.h"
#include "ModuleManager.h"
#include "LaunchDaemonMessages.h"
#include "Messaging.h"
#include "TargetDeviceServices.h"
#include "IOSPlatformProperties.h"

#if WITH_ENGINE
	#include "Engine.h"
#endif

#include "TargetPlatform.h"
#include "TargetPlatformBase.h"

/* Private includes
 *****************************************************************************/

#include "IOSTargetDevice.h"
#include "IOSDeviceHelper.h"
#include "IOSTargetPlatform.h"


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Beih. Nova Hedwigia 104: 73 (1992)

#### Original name
Trichothelium montanum f. montanum Lücking

### Remarks
null


text:
using System;
using System.Collections.Generic;
using System.Text;
using WO.Core;

namespace WOEmu.Misc
{
    /// <summary>
    /// Contains all possible tiletypes
    /// </summary>
    public enum TileType
    {
        Hole, //0
        Sand,
        Grass,
        Tree,
        Rock,
        Dirt,
        Clay,
        Field,
        PackedDirt,
        CobbleStone,
        Mycelium,
        InfectedTree,
        Lava,
        EnchantedGrass,
        EnchantedTree,
        WoodenPlanks,
        StoneSlabs,
        Gravel,
        Peat,
        Tundra,
        Moss,
        Cliff,
        Steppe,
        Marsh,
        Tar,
        Door,
        Rock2,
        DoorGold,
        DoorSilver,
        DoorSteel,

        Cave = 200,
        Cave2,
        CaveWall,
        ReinforcedCaveWall,

        GoldVein = 220,
        SilverVein,
        IronVein,
        CopperVein,
        LeadVein,
        ZincVein,
        TinVein
    }

    /// <summary>
    /// All tree types
    /// </summary>
    public enum TreeType
    {
        Birch,
        Pine,
        Oak,
        Cedar,
        Willow,
        Maple,
        Apple,
        Lemon,
        Olive,
        Cherry,
        Lavender,
        Rose,
        Thorn,
        Grape,
        Camellia,
        Oleander
    }

    public class Tile
    {
        /// <summary>
        /// Default constructor
        /// </summary>
        /// <param name="x">X coord</param>
        /// <param name="y">Y coord</param>
        /// <param name="Z">Height</param>
        public Tile(short x, short y, short Z)
        {
            X = x;
            Y = y;
            Height = Z;
            NormalTile = true;
            Age = 0;
        }

        /// <summary>
        /// Set tiletype
        /// </summary>
        /// <param name="t">The tiletype</param>
        public void SetType(TileType t)
        {
            Type = t;
        }

        public void SetAge(byte age)
        {
            Age = age;
        }

        /// <summary>
        /// Returns string representation
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return Type.ToString() + ": [" + X + ", " + Y + ", " + Height + "]";
        }

        /// <summary>
        /// Return tile flags
        /// </summary>
        /// <returns>int to push in bytebuffer</returns>
        public int TileFlags()
        {
            //return (Height * 10) + ((int)Type << 16);

            //we still need a byte value somewhere, but I dont know what it is
            //after llooking in the client code, your AGE variable ISNT age, it is the " subtype "
            // say the Type was of Tree, then what you have called " Age " here would actually be wether it is a Maple/Lemon/Oak/Ceder etc.... not AGE
            // i has found your missing byte too wich is the " REAL " age so you wanna implement something liek
            // return (Height * 10) + ((int)Type << 24) + (SubType << 16) + (Age << 4);
            //age = [0: New, 1-3: Young, 4-7: Mature, 8-11: Old, 12-14: Very old, 15: Shriveled]
            return (Height * 10) + ((int)Type << 24) + (SubType << 16);
        }

        /// <summary>
        /// Retrieves not tile positions, but real positions
        /// </summary>
        /// <returns>Vector</returns>
        public Vector3 GetRealPos()
        {
            return new Vector3(X * 4, Y * 4, Height);
        }

        public short X;
        public short Y;
        public short Height;
        public TileType Type;
        /// <summary>
        /// Normal tile, instead of the border types.
        /// </summary>
        public bool NormalTile;
        public byte Age;
        public byte SubType;
    }
}


text:
package nanocad.util;

/*
	A basic extension of the java.awt.Dialog class
 */

import java.awt.*;
import java.awt.event.*;

public class QuitDialog extends Dialog
{
	// Used for addNotify check.
	boolean fComponentsAdjusted = false;

	//{{DECLARE_CONTROLS
	java.awt.Button yesButton;
	java.awt.Button noButton;
	java.awt.Label label1;
	java.awt.Label label2;
	//}}

	class SymWindow extends java.awt.event.WindowAdapter
	{
		public void windowClosing(java.awt.event.WindowEvent event)
		{
			Object object = event.getSource();
			if (object == QuitDialog.this)
				QuitDialog_WindowClosing(event);
		}
	}

	class SymAction implements java.awt.event.ActionListener
	{
		public void actionPerformed(java.awt.event.ActionEvent event)
		{
			Object object = event.getSource();
			if (object == noButton)
				noButton_Clicked(event);
			else if (object == yesButton)
				yesButton_Clicked(event);
		}
	}

	public QuitDialog(Frame parent, String title, boolean modal)
	{
		this(parent, modal);
		setTitle(title);
	}
	public QuitDialog(Frame parent, boolean modal)
	{
		super(parent, modal);

		// This code is automatically generated by Visual Cafe when you add
		// components to the visual environment. It instantiates and initializes
		// the components. To modify the code, only use code syntax that matches
		// what Visual Cafe can generate, or Visual Cafe may be unable to back
		// parse your Java file into its visual environment.
		//{{INIT_CONTROLS
		setLayout(null);
		setVisible(false);
		setSize(insets().left + insets().right + 337,insets().top + insets().bottom + 135);
		yesButton = new java.awt.Button();
		yesButton.setLabel(" Yes ");
		yesButton.setBounds(insets().left + 72,insets().top + 96,79,22);
		yesButton.setFont(new Font("Dialog", Font.BOLD, 12));
		add(yesButton);
		noButton = new java.awt.Button();
		noButton.setLabel("  No  ");
		noButton.setBounds(insets().left + 192,insets().top + 96,79,22);
		noButton.setFont(new Font("Dialog", Font.BOLD, 12));
		add(noButton);
		label1 = new java.awt.Label("If you have not saved file, changes will be lost.",Label.CENTER);
		label1.setBounds(insets().left + 12,insets().top + 12,312,23);
		add(label1);
		label2 = new java.awt.Label("Really quit?",Label.CENTER);
		label2.setBounds(insets().left + 72,insets().top + 48,203,22);
		add(label2);
		setTitle("A Basic Application - Quit");
		//}}

		//{{REGISTER_LISTENERS
		SymWindow aSymWindow = new SymWindow();
		this.addWindowListener(aSymWindow);
		SymAction lSymAction = new SymAction();
		noButton.addActionListener(lSymAction);
		yesButton.addActionListener(lSymAction);
		//}}
	}
	public void addNotify()
	{
	    // Record the size of the window prior to calling parents addNotify.
	    Dimension d = getSize();

		super.addNotify();

		if (fComponentsAdjusted)
			return;

		// Adjust components according to the insets
		setSize(insets().left + insets().right + d.width, insets().top + insets().bottom + d.height);
		Component components[] = getComponents();
		for (int i = 0; i < components.length; i++)
		{
			Point p = components[i].getLocation();
			p.translate(insets().left, insets().top);
			components[i].setLocation(p);
		}
		fComponentsAdjusted = true;
	}
	void noButton_Clicked(java.awt.event.ActionEvent event)
	{
	    dispose();
	}
	void QuitDialog_WindowClosing(java.awt.event.WindowEvent event)
	{
		   dispose();
	}
	public synchronized void show()
	{
		Rectangle bounds = getParent().bounds();
		Rectangle abounds = bounds();

		move(bounds.x + (bounds.width - abounds.width)/ 2,
			 bounds.y + (bounds.height - abounds.height)/2);

		super.show();
	}
	void yesButton_Clicked(java.awt.event.ActionEvent event)
	{
		Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(new WindowEvent((java.awt.Window)getParent(), WindowEvent.WINDOW_CLOSING));
	}
}


text:
<?xml version='1.0' encoding='utf-8' ?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % BOOK_ENTITIES SYSTEM "cloudstack.ent">
%BOOK_ENTITIES;
]>

<!-- Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you 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.
-->

<section id="basic-zone-physical-network-configuration">
	<title>Basic Zone Physical Network Configuration</title>
	<para>In a basic network, configuring the physical network is fairly straightforward. You only need to configure one guest network to carry traffic that is generated by guest VMs. When you first add a zone to CloudPlatform, you set up the guest network through the Add Zone screens.</para>

	</section>


text:
package com.android.proxyhandler;

import android.app.Service;
import android.content.Intent;
import android.net.Proxy;
import android.net.ProxyProperties;
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
import android.text.TextUtils;

import com.android.net.IProxyCallback;
import com.android.net.IProxyPortListener;

/**
 * @hide
 */
public class ProxyService extends Service {

    private static ProxyServer server = null;

    /** Keep these values up-to-date with PacManager.java */
    public static final String KEY_PROXY = "keyProxy";
    public static final String HOST = "localhost";
    // STOPSHIP This being a static port means it can be hijacked by other apps.
    public static final int PORT = 8182;
    public static final String EXCL_LIST = "";

    @Override
    public void onCreate() {
        super.onCreate();
        if (server == null) {
            server = new ProxyServer();
            server.startServer();
        }
    }

    @Override
    public void onDestroy() {
        if (server != null) {
            server.stopServer();
            server = null;
        }
    }

    @Override
    public IBinder onBind(Intent intent) {
        return new IProxyCallback.Stub() {
            @Override
            public void getProxyPort(IBinder callback) throws RemoteException {
                if (server != null) {
                    IProxyPortListener portListener = IProxyPortListener.Stub.asInterface(callback);
                    if (portListener != null) {
                        server.setCallback(portListener);
                    }
                }
            }
        };
    }
}


text:
package com.zilabs.multiscreenframework.utils;

import javafx.scene.Node;
import javafx.scene.layout.AnchorPane;

/**
 *
 * @version 2.0.1
 * @author S.Karanja <dev.zilabs@gmail.com>
 *
 * This class holds all utility methods for this framework.
 */
public class Utils {

    /**
     * This method allow the AnchorPane to stretch 100% of the application's
     * viewport, if allow is set to true, otherwise the AnchorPane will use it's
     * preferred size.
     * If you need your UI to to scale with the display area, then you must pass
     * true as the first parameter to this method.
     *
     * @param allow - True, to allow stretch, false otherwise
     * @param node     - The Node to stretch.
     */
    public static void allowStrech(boolean allow, Node node) {
        if (allow) {
            AnchorPane.setTopAnchor(node, Double.valueOf(0));
            AnchorPane.setLeftAnchor(node, Double.valueOf(0));
            AnchorPane.setRightAnchor(node, Double.valueOf(0));
            AnchorPane.setBottomAnchor(node, Double.valueOf(0));
        }
    }
}


text:
<!doctype html>

<meta charset="utf-8">
<title>Javascript for grown-ups</title>
<link rel="stylesheet" href="css/bootstrap.css">

Javascript for grown-ups

Language traits

Interpreted

Dynamically typed

Object oriented

Functional (functions are 1st class citizens)

Prototype-based

Talk is cheap, show me the code!

Variables...


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package agendaex;

import com.db4o.ObjectContainer;
import com.db4o.Db4o;
/**
 *
 * @author Eduardo Avila Malheiros
 */
public class agendaex {
    public static void main(String[] args){
        jprincipal principal = new jprincipal();

        principal.setVisible(true);
    }
}


text:
using namespace LCBTest;
using std::list;

extern "C" {
static void
server_runfunc(void *arg)
{
    TestServer *server = (TestServer *)arg;
    server->run();
}
}

void
TestServer::run()
{
    if (closed) {
        return;
    }

    fd_set fds;
    struct timeval tmout = { 1, 0 };

    FD_ZERO(&fds);
    FD_SET(*lsn, &fds);

    while (!closed) {
        struct sockaddr_in newaddr;
        socklen_t naddr = sizeof(newaddr);

        if (select(*lsn + 1, &fds, NULL, NULL, &tmout) == 1) {
            int newsock = accept(*lsn, (struct sockaddr *)&newaddr, &naddr);

            if (newsock == -1) {
                break;
            }

            TestConnection *newconn = new TestConnection(this, factory(newsock));
            startConnection(newconn);
        }
    }
}

void
TestServer::startConnection(TestConnection *conn)
{
    mutex.lock();
    if (isClosed()) {
        conn->close();
        delete conn;
    } else {
        conns.push_back(conn);
    }
    mutex.unlock();
}

TestServer::TestServer()
{
    lsn = SockFD::newListener();
    closed = false;
    factory = plainSocketFactory;

    // Now spin up a thread to start the accept loop
    thr = new Thread(server_runfunc, this);
}

TestServer::~TestServer()
{
    close();
    mutex.lock();
    std::list<TestConnection*>::iterator iter = conns.begin();
    for (; iter != conns.end(); ++iter) {
        (*iter)->close();
        delete *iter;
    }
    mutex.unlock();
    // We don't want to explicitly call join() here since that
    // gets called in the destructor.  This is unncessary
    // and broken on musl.
    // thr->join();
    delete thr;
    mutex.close();
    delete lsn;
}

std::string
TestServer::getPortString()
{
    char buf[4096];
    sprintf(buf, "%d", lsn->getLocalPort());
    return std::string(buf);
}

TestConnection *
TestServer::findConnection(uint16_t port)
{
    TestConnection *ret = NULL;
    list<TestConnection *>::iterator iter;

    while (ret == NULL) {
        sched_yield();
        mutex.lock();
        iter = conns.begin();

        for (; iter != conns.end(); ++iter) {
            if ((*iter)->getPeerPort() == port) {
                ret = *iter;
                break;
            }
        }
        mutex.unlock();
    };

    return ret;
}


text:
var mysql = require('./loader/mysqlLoader');
var dbType = 'sqlite';

function getDbObj() {
    var obj = mysql;

    if(dbType == 'mysql') {
        obj = mysql;
    }

    return obj;
}

module.exports = {
    setDbType: function(dbType_) {
        dbType = dbType_;
    },
    query: function(sql, callback) {
        getDbObj().query(sql, callback);
    },
    getSchemas: function(callback) {
        getDbObj().getSchemas(callback);
    },
    getTables: function(schema, callback) {
        getDbObj().getTables(schema, callback);
    },
    getColumns: function(schema, table, callback) {
        getDbObj().getColumns(schema, table, callback);
    }
};


text:
<?php
namespace Bigbank\Gcm;

/**
 * Message for GCM server
 */
class Message
{

    /**
     * Specifies the recipient of a message
     *
     * How to use:
     * String - message topic if sent for all devices
     * String - registration token/device id if message is sent to one device
     * Array - list of registration tokens/device ids if message is sent to multiple devices
     *          It must contain at least 1 and at most 1000 registration IDs.
     *
     * Required.
     *
     * @var string|array
     */
    private $recipients = '';

    /**
     * An arbitrary string (such as "Updates Available") that is used to collapse a group of like messages
     * when the device is offline, so that only the last message gets sent to the client.
     * This is intended to avoid sending too many messages to the phone when it comes back online.
     * Note that since there is no guarantee of the order in which messages get sent, the "last" message
     * may not actually be the last message sent by the application server.
     *
     * Optional.
     *
     * @var string|null
     */
    private $collapseKey = null;

    /**
     * Message payload data.
     * If present, the payload data it will be included in the Intent as application data,
     * with the key being the extra's name.
     *
     * Optional.
     *
     * @var array|null
     */
    private $data = null;

    /**
     * Notification payload.
     * This parameter specifies the key-value pairs of the notification payload.
     * See Notification payload support for more information
     * (https://developers.google.com/cloud-messaging/server-ref#notification-payload-support).
     *
     * Optional.
     *
     * @var array|null
     */
    private $notification = null;

    /**
     * Indicates that the message should not be sent immediately if the device is idle.
     * The server will wait for the device to become active, and then only the last message
     * for each collapse_key value will be sent.
     *
     * Optional.
     *
     * @var boolean
     */
    private $delayWhileIdle = false;

    /**
     * How long (in seconds) the message should be kept on GCM storage if the device is offline.
     *
     * Optional (default time-to-live is 4 weeks).
     *
     * @var int
     */
    private $ttl = null;

    /**
     * A string containing the package name of your application.
     * When set, messages will only be sent to registration IDs that match the package name.
     *
     * Optional.
     *
     * @var string|null
     */
    private $restrictedPackageName = null;

    /**
     * Allows developers to test their request without actually sending a message.
     *
     * Optional.
     *
     * @var boolean
     */
    private $dryRun = false;

    /**
     * On iOS, use this field to represent content-available in the APNS payload. When a notification or message is
     * sent and this is set to true, an inactive client app is awoken. On Android, data messages wake the app by
     * default. On Chrome, currently not supported.
     *
     * Optional
     *
     * @var bool
     */
    private $contentAvailable = true;

    /**
     * Sets the priority of the message. Valid values are "normal" and "high." On iOS, these correspond to APNs
     * priority 5 and 10.
     *
     * Optional
     *
     * @var string
     */
    private $priority = 'high';

    /**
     * @param string|array $recipients
     * @param array        $data
     * @param string         $collapseKey
     */
    public function __construct($recipients = null, $data = null, $collapseKey = null)
    {

        $this->bulkSet($recipients, $data, $collapseKey);
    }

    /**
     * Set multiple fields at once.
     *
     * @param string|array $recipients
     * @param array|null   $data
     * @param string|null  $collapseKey
     */
    public function bulkSet($recipients = '', $data = null, $collapseKey = null)
    {

        $this->setRecipients($recipients);
        $this->setData($data);
        $this->setCollapseKey($collapseKey);
    }

    /**
     * @return array|string
     */
    public function getRecipients()
    {

        return $this->recipients;
    }

    /**
     * @param string|array $recipients
     *
     * @return $this
     */
    public function setRecipients($recipients)
    {

        $this->recipients = $recipients;

        return $this;
    }

    /**
     * @return string|null
     */
    public function getCollapseKey()
    {

        return $this->collapseKey;
    }

    /**
     * @param string $collapseKey
     *
     * @return $this
     */
    public function setCollapseKey($collapseKey)
    {

        $this->collapseKey = $collapseKey;

        return $this;
    }

    /**
     * @return array|null
     */
    public function getData()
    {

        return $this->data;
    }

    /**
     * @param array $data
     *
     * @return $this
     */
    public function setData($data)
    {

        $this->data = $data;

        return $this;
    }

    /**
     * @return array|null
     */
    public function getNotification()
    {

        return $this->notification;
    }

    /**
     * @param array $notification
     *
     * @return $this
     */
    public function setNotification($notification)
    {

        $this->notification = $notification;

        return $this;
    }

    /**
     * @return bool
     */
    public function getDelayWhileIdle()
    {

        return $this->delayWhileIdle;
    }

    /**
     * @param bool $delayWhileIdle
     *
     * @return $this
     */
    public function setDelayWhileIdle($delayWhileIdle)
    {

        $this->delayWhileIdle = $delayWhileIdle;

        return $this;
    }

    /**
     * @return int
     */
    public function getTtl()
    {

        return $this->ttl;
    }

    /**
     * @param int $ttl
     *
     * @return $this
     */
    public function setTtl($ttl)
    {

        $this->ttl = $ttl;

        return $this;
    }

    /**
     * @return string|null
     */
    public function getRestrictedPackageName()
    {

        return $this->restrictedPackageName;
    }

    /**
     * @param string $restrictedPackageName
     *
     * @return $this
     */
    public function setRestrictedPackageName($restrictedPackageName)
    {

        $this->restrictedPackageName = $restrictedPackageName;

        return $this;
    }

    /**
     * @return bool
     */
    public function getDryRun()
    {

        return $this->dryRun;
    }

    /**
     * @param bool $dryRun
     *
     * @return $this
     */
    public function setDryRun($dryRun)
    {

        $this->dryRun = $dryRun;

        return $this;
    }

    /**
     * @return bool
     */
    public function getContentAvailable()
    {

        return $this->contentAvailable;
    }

    /**
     * @param bool $contentAvailable
     */
    public function setContentAvailable($contentAvailable)
    {

        $this->contentAvailable = $contentAvailable;
    }

    /**
     * @return string
     */
    public function getPriority()
    {

        return $this->priority;
    }

    /**
     * @param string $priority
     */
    public function setPriority($priority)
    {

        $this->priority = $priority;
    }
}


text:
set CoverageOnly=true
dotnet test test/Qwack.Dates.Tests/Qwack.Dates.Tests.csproj
dotnet test test/Qwack.Math.Tests/Qwack.Math.Tests.csproj
dotnet test test/Qwack.Core.Tests/Qwack.Core.Tests.csproj
dotnet test test/Qwack.Excel.Tests/Qwack.Excel.Tests.csproj
dotnet test test/Qwack.Serialization.Test/Qwack.Serialization.Test.csproj
dotnet test test/Qwack.Models.Tests/Qwack.Models.Tests.csproj
dotnet test test/Qwack.MonteCarlo.Test/Qwack.MonteCarlo.Test.csproj


text:
package gaia3d.weather.wind.service;

import gaia3d.weather.wind.domain.Wind;

import java.io.File;

public interface Reader {
    Wind read(File file);
}


text:
#import "USLVImageBufferRGBX8888.h"

#import "USLFunctions.h"
#import "USLVImageBufferRGBFFF.h"

@implementation USLVImageBufferRGBX8888
{
    vImage_Buffer _vImageBuffer;
    CFMutableDataRef _data;
}
- (instancetype)initWithCGImage:(CGImageRef)image
{
    if(self = [super init])
    {
        size_t width = CGImageGetWidth(image);
        size_t height = CGImageGetHeight(image);
        size_t bytesPerRow = align16(4 * width);

        _data = CFDataCreateMutable(kCFAllocatorDefault, bytesPerRow * height);
        CFDataSetLength(_data, bytesPerRow * height);

        _vImageBuffer.data = CFDataGetMutableBytePtr(_data);
        _vImageBuffer.width = width;
        _vImageBuffer.height = height;
        _vImageBuffer.rowBytes = bytesPerRow;

        size_t bitsPerComponent = 8;
        CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
        CGBitmapInfo bitmapInfo = kCGBitmapByteOrderDefault | kCGImageAlphaNoneSkipLast;
        CGContextRef context = CGBitmapContextCreate(_vImageBuffer.data,
                                                     width,
                                                     height,
                                                     bitsPerComponent,
                                                     bytesPerRow,
                                                     colorSpace,
                                                     bitmapInfo);
        CGContextSetBlendMode(context, kCGBlendModeCopy);
        CGContextSetInterpolationQuality(context, kCGInterpolationNone);
        CGContextDrawImage(context, CGRectMake(0, 0, width, height), image);
        CGContextRelease(context);
        context = NULL;
        CGColorSpaceRelease(colorSpace);
        colorSpace = NULL;
    }
    return self;
}
- (instancetype)initWithWidth:(size_t)width height:(size_t)height
{
    if(self = [super init])
    {
        size_t bytesPerRow = align16(4 * width);
        _data = CFDataCreateMutable(kCFAllocatorDefault, bytesPerRow * height);
        CFDataSetLength(_data, bytesPerRow * height);

        _vImageBuffer.data = CFDataGetMutableBytePtr(_data);
        _vImageBuffer.width = width;
        _vImageBuffer.height = height;
        _vImageBuffer.rowBytes = bytesPerRow;
    }
    return self;
}
- (instancetype)initWithRGBFFF:(USLVImageBufferRGBFFF *)image
{
    if(self = [super init])
    {
        size_t width = image.vImageBufferR->width;
        size_t height = image.vImageBufferR->height;
        size_t bytesPerRow = align16(4 * width);
        _data = CFDataCreateMutable(kCFAllocatorDefault, bytesPerRow * height);
        CFDataSetLength(_data, bytesPerRow * height);

        _vImageBuffer.data = CFDataGetMutableBytePtr(_data);
        _vImageBuffer.width = width;
        _vImageBuffer.height = height;
        _vImageBuffer.rowBytes = bytesPerRow;

        float minFloat[] = {0.0f, 0.0f, 0.0f, 0.0f};
        float maxFloat[] = {1.0f, 1.0f, 1.0f, 1.0f};
        vImageConvert_PlanarFToRGBX8888(image.vImageBufferR, image.vImageBufferG, image.vImageBufferB, 255, &_vImageBuffer, maxFloat, minFloat, kvImageNoFlags);
    }
    return self;
}
- (void)dealloc
{
    CFRelease(_data);
    _data = NULL;
}
- (vImage_Buffer *)vImageBuffer
{
    return &_vImageBuffer;
}
- (CFMutableDataRef)data
{
    return _data;
}
- (void)generateCGImageWithReciver:(void(^)(CGImageRef image))reciver
{
    CGDataProviderRef dataProvider = CGDataProviderCreateWithCFData(_data);
    size_t bitsPerComponent = 8;
    size_t bitsPerPixel = 32;
    size_t bytesPerRow = _vImageBuffer.rowBytes;
    CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
    CGBitmapInfo bitmapInfo = kCGBitmapByteOrderDefault | kCGImageAlphaNoneSkipLast;
    CGImageRef dstImage = CGImageCreate(_vImageBuffer.width,
                                        _vImageBuffer.height,
                                        bitsPerComponent,
                                        bitsPerPixel,
                                        bytesPerRow,
                                        colorSpace,
                                        bitmapInfo,
                                        dataProvider,
                                        NULL,
                                        NO,
                                        kCGRenderingIntentDefault);
    reciver(dstImage);
    CGImageRelease(dstImage);
    dstImage = NULL;
    CGColorSpaceRelease(colorSpace);
    colorSpace = NULL;
    CGDataProviderRelease(dataProvider);
    dataProvider = NULL;
}
@end


text:
<?xml version='1.0' encoding='utf-8'?>
<widget id="reverse.domain.package" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <preference name="loglevel" value="DEBUG" />
    <preference name="AndroidLaunchMode" value="singleTop" />
    <feature name="App">
        <param name="android-package" value="org.apache.cordova.App" />
    </feature>
    <name>ApplicationName</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="dev@cordova.apache.org" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <access origin="*" />
    <feature name="Device">
        <param name="android-package" value="org.apache.cordova.device.Device" />
    </feature>
</widget>


text:
[![Build Status](https://travis-ci.org/kojiy7214/jsclass-serializer.svg?branch=master)](https://travis-ci.org/kojiy7214/jsclass-serializer)

# jsclass-serializer
Yet another serialize module for Node.js, with unique feature that deserialize to its original class based Object.

## What Makes class-serializer Unique
Amoung many serializers, jsclass-serializer module is unique for its class
restore ability.  That is, deserializing does not result in creating
Object object, but original class-based object are restored.

## How to Use
Just extend your class based on "Serializable" class.  And everything works.

## Save and/or Load from File (new @0.2.0)
You can save your serialized json text to file, and load it back easily.
You can also load all objects under storage path.
```
const Serializable = require('jsclass-serializer');

// Save and load to/from file
class SampleClass extends Serializable{};

let source = new SampleClass();

Serializable.setStoragePath('./data/');
source.saveToFile();

let target = new SampleClass();
target.loadFromFile(source.uuid);

//load all objects under storage path
let array_of_object = Serializable.loadAll();

```

## Date Ready
"jsclass-serializer" can de/serialize built-in Date type object.

## Works with "jsclass-mixin"
When developer decide to extend his/her class from Serializable, developer
should give up to extend from other classes.  That is a huge limitation, while
Java Script allows only single inheritance.
Now its not a limitation any more!  "jsclass-serializable" can be used with
["jsclass-mixin"](https://www.npmjs.com/package/jsclass-mixin)!
Check out the code below!
```
// Serializable with jsclass-mixin
const Serializable = require('jsclass-serializer');
const mix = require('jsclass-mixin');

class B {};

class A extends mix(B, Serializable) {
  constructor() {
    super();

    //call Serializable constructor with "this" makes class A serializable
    Serializable.new(this);
  }
};

let source = new A();
let json = source.serialize();
let target = Serializable.deserialize(json);

//below code return true!
console.log(target instanceof A);
```

## Some Notes
### Use of Global Namespace
Class serializer consumes global with namespace "__serializable_classes__".
Within this name space, every constructor of Serializable subclasses are
stored.  This is because of its module-scoped nature of node, by default
class-serializer can not recognize target class definition.  Please note that
this results in extra node instance memory space
consuming.

### Property "classname" and "uuid" Are Attached Automatically
Serializable attaches property "classname" and "uuid" to its subclasses.
"classname" is to retrieve original class info, and "uuid" is use as filename
when you save/load to/from files.

## Code Usage
Please take a look at  test/test.js for more sample codes.

### usage1:
```
const Serializable = require('jsclass-serializer');

// Serialize and Deserialize Using Static Methods

class SampleClass extends Serializable{};
let c = new SampleClass();

let json = Serializable.serialize(c);
let o = Serializable.deserialize(json);

//o is not a [Object object], but an instance of SampleClass
//below code returns, true.
console.log(o instanceof SampleClass);
```

### usage2:
```
const Serializable = require('jsclass-serializer');

// Serialize and Deserialize Using Normal Methods
//
class SampleClass extends Serializable{};
let c1 = new SampleClass();
c1.a = "A";

let json = c1.serialize();

let c2 = new SampleClass();
c2.deserialize(json);

//You can deserialize back to its original class.
//below code returns "A"
console.log(c2.a);
```

## API
## Modules

jsclass-serializer

A module for de/serializing objects.

## Classes

Serializable

## Functions

constructor(baseclass)

"jsclass-serializer" provides features to serialize and deserialize to memory
and to file in json format.  Deserializing returns instance of original class.

## jsclass-serializer
A module for de/serializing objects.

## Serializable
**Kind**: global class

* [Serializable](#Serializable)
    * [new Serializable()](#new_Serializable_new)
    * _instance_
        * [.serialize()](#Serializable+serialize) ⇒ json
        * [.saveToFile()](#Serializable+saveToFile) ⇒ json
        * [.deserialize(json)](#Serializable+deserialize)
        * [.loadFromFile(uuid)](#Serializable+loadFromFile)
    * _static_
        * [.setStoragePath(p)](#Serializable.setStoragePath)
        * [.saveToFile(o, filename)](#Serializable.saveToFile) ⇒ json
        * [.loadFromFile(filename)](#Serializable.loadFromFile) ⇒ any
        * [.loadAll(Callback)](#Serializable.loadAll) ⇒ Array
        * [.serialize(o)](#Serializable.serialize) ⇒ json
        * [.deserialize(json)](#Serializable.deserialize)

### new Serializable()
Serializable object and deserialize back to its original class instance.
Also supports save/load to/from file system.

### serializable.serialize() ⇒ json
Serialize object to json format.

**Kind**: instance method of [Serializable](#Serializable)
**Returns**: json - Json text.

### serializable.saveToFile() ⇒ json
Save serialized json object to file.  Where directory path would be the
path previously set by setStoragePath(), and file name would be set equally
to given objects uuid.

**Kind**: instance method of [Serializable](#Serializable)
**Returns**: json - Json text.

### serializable.deserialize(json)
Deserialize json text to object

**Kind**: instance method of [Serializable](#Serializable)

| Param | Type | Description |
| --- | --- | --- |
| json | json | [description] |

### serializable.loadFromFile(uuid)
Load json text from file and convert to object. Where directory path would
be the path previously set by setStoragePath().

**Kind**: instance method of [Serializable](#Serializable)

| Param | Type | Description |
| --- | --- | --- |
| uuid | string | Unique identifier to specify the file to load from. |

### Serializable.setStoragePath(p)
Set directory path to save/load serialized information to/from file.

**Kind**: static method of [Serializable](#Serializable)

| Param | Type | Description |
| --- | --- | --- |
| p | string | Absolute or relative directory path |

### Serializable.saveToFile(o, filename) ⇒ json
Save serialized json object to file.  Where directory path would be the
path previously set by setStoragePath().
This method can serialize any type of object.

**Kind**: static method of [Serializable](#Serializable)
**Returns**: json - Json text.

| Param | Type | Description |
| --- | --- | --- |
| o | any | Object to serialize. |
| filename | string | Filename to save object. |

### Serializable.loadFromFile(filename) ⇒ any
Load json text from file and convert to object. Where directory path would
be the path previously set by setStoragePath().
This method can deserialize any file with json text.

**Kind**: static method of [Serializable](#Serializable)
**Returns**: any - Deserialized object.

| Param | Type | Description |
| --- | --- | --- |
| filename | string | Filename to load json from. |

### Serializable.loadAll(Callback) ⇒ Array
Load all json files under storage directory.

**Kind**: static method of [Serializable](#Serializable)
**Returns**: Array - Retrieved objects.

| Param | Type | Description |
| --- | --- | --- |
| Callback | function | function applies to retrieved objects. |

### Serializable.serialize(o) ⇒ json
Serialize object to json format.
This method can serialize any type of object.

**Kind**: static method of [Serializable](#Serializable)
**Returns**: json - Json text.

| Param | Type | Description |
| --- | --- | --- |
| o | any | Object to serialize. |

### Serializable.deserialize(json)
Deserialize json text to object
This method can deserialize any file with json text.

**Kind**: static method of [Serializable](#Serializable)

| Param | Type | Description |
| --- | --- | --- |
| json | json | [description] |

## constructor(baseclass)
"jsclass-serializer" provides features to serialize and deserialize to memory
and to file in json format.  Deserializing returns instance of original class.

**Kind**: global function

| Param | Type | Description |
| --- | --- | --- |
| baseclass | any | Set "this", when use with jsclass-mixin. |


text:
/**
 * Gaussian kernel - applied within the smoothKernel function
 * @param {number} x1 - point being adjusted
 * @param {number} x2 - point used to make adjustment
 * @param {number} b - scaling parameter
 * @returns {number} result of expression
 */
function k_G(x1 , x2 , b ) {
    return (1/Math.sqrt(2*Math.PI))*Math.exp(-(Math.pow((x1 - x2),2) / (2*Math.pow(b,2))));
}

/**
 * Epanechnikov kernel - applied within the smoothKernel function
 * @param {number} x1 - point being adjusted
 * @param {number} x2 - point used to make adjustment
 * @param {number} b - scaling parameter
 * @returns {number} result of expression
 */
function k_E(x1 , x2 , b ) {
    if (Math.abs((x1 - x2) / b) > 1) {
        return 0;
    } else {
        return (3 / 4) * (1 - Math.pow(((x1 - x2) / b), 2));
    }
}

/**
 * Logistic kernel - applied within the smoothKernel function
 * @param {number} x1 - point being adjusted
 * @param {number} x2 - point used to make adjustment
 * @param {number} b - scaling parameter
 * @returns {number} result of expression
 */
function k_L(x1 , x2 , b ) {
    return 1 / (Math.exp((x1 - x2) / b) + Math.exp(-(x1 - x2) / b));
}

/**
 * Uniform kernel - applied within the smoothKernel function
 * @param {number} x1 - point being adjusted
 * @param {number} x2 - point used to make adjustment
 * @param {number} b - scaling parameter
 * @returns {number} result of expression
 */
function k_U(x1 , x2 , b ) {
    if (Math.abs((x1 - x2) / b) > 1) {
        return 0;
    } else {
        return 1 / 2;
    }
}

/**
 * Triangular kernel - applied within the smoothKernel function
 * @param {number} x1 - point being adjusted
 * @param {number} x2 - point used to make adjustment
 * @param {number} b - scaling parameter
 * @returns {number} result of expression
 */
function k_T(x1 , x2 , b ) {
    if (Math.abs((x1 - x2) / b) > 1) {
        return 0;
    } else {
        return (1 - Math.abs((x1 - x2) / b));
    }
}

/**
 * Quartic kernel - applied within the smoothKernel function
 * @param {number} x1 - point being adjusted
 * @param {number} x2 - point used to make adjustment
 * @param {number} b - scaling parameter
 * @returns {number} result of expression
 */
function k_Q(x1 , x2 , b ) {
    if (Math.abs((x1 - x2) / b) > 1) {
        return 0;
    } else {
        return (15 / 16) * Math.pow((1 - Math.pow(((x1 - x2) / b), 2)), 2);
    }
}

/**
 * Triweight kernel - applied within the smoothKernel function
 * @param {number} x1 - point being adjusted
 * @param {number} x2 - point used to make adjustment
 * @param {number} b - scaling parameter
 * @returns {number} result of expression
 */
function k_TW(x1 , x2 , b ) {
    if (Math.abs((x1 - x2) / b) > 1) {
        return 0;
    } else {
        return (35 / 32) * Math.pow((1 - Math.pow(((x1 - x2) / b), 2)), 3);
    }
}

/**
 * Cosine kernel - applied within the smoothKernel function
 * @param {number} x1 - point being adjusted
 * @param {number} x2 - point used to make adjustment
 * @param {number} b - scaling parameter
 * @returns {number} result of expression
 */
function k_Co(x1 , x2 , b) {
    if (Math.abs((x1 - x2) / b) > 1) {
        return 0;
    } else {
        return (Math.PI / 4) * Math.cos((Math.PI / 2) * ((x1 - x2) / b));
    }
}

/**
 * Tricube kernel - applied within the smoothKernel function
 * @param {number} x1 - point being adjusted
 * @param {number} x2 - point used to make adjustment
 * @param {number} b - scaling parameter
 * @returns {number} result of expression
 */
function k_TC(x1 , x2 , b) {
    if (Math.abs((x1 - x2) / b) > 1) {
        return 0;
    } else {
        return (70 / 81) * Math.pow((1 - Math.pow(Math.abs((x1 - x2) / b), 3)), 3);
    }
}

/**
 * Silverman kernel - applied within the smoothKernel function
 * @param {number} x1 - point being adjusted
 * @param {number} x2 - point used to make adjustment
 * @param {number} b - scaling parameter
 * @returns {number} result of expression
 */
function k_S(x1, x2, b){
    var u = Math.abs((x2-x1)/b);

    return 0.5 * Math.exp(-u/Math.SQRT2) * Math.sin(u/Math.SQRT2 + Math.PI/4);
}


text:
from __future__ import (absolute_import, division, print_function,
                        unicode_literals)

from . import util

class Repo(object):
    """
    Base class for repository handlers.

    There are no commands that modify the source repository.
    """
    def __init__(self, url, mirror_path):
        """
        Create a mirror of the repository at `url`, without a working tree.

        Parameters
        ----------
        url : str
            The URL to the repository to clone

        mirror_path : str
            The local path into which to put a mirror of the repository.
            Creating the local mirror is optional, and may be skipped if
            the performance is adequate also without it.

        """
        raise NotImplementedError()

    def _raise_bad_mirror_error(self, path):
        """
        Internal routine for raising an error message if mirror directory already exists,
        but appears incorrect.
        """
        raise util.UserError("Directory '{0}' already exists, but is not a mirror "
                             "of the project repository. Please remove it and try again. "
                             "If the benchmark suite is in the project repository, you can "
                             "also adjust the configuration to use the current "
                             "repository (e.g. \"repo\": \".\") instead of a remote URL "
                             "as the source.".format(path))

    def checkout(self, path, commit_hash):
        """
        Check out a clean working tree from the current repository
        to the given path

        Parameters
        ----------
        path : str
            The local path to check out into
        commit_hash : str
            The commit hash to check out

        """
        raise NotImplementedError()

    @classmethod
    def url_match(cls, url):
        """
        Returns `True` if the url is of the right type for this kind
        of repository.
        """
        raise NotImplementedError()

    def get_range_spec(self, commit_a, commit_b):
        """
        Returns a formatted string giving the results between
        commit_a (exclusive) and commit_b (inclusive).
        """
        raise NotImplementedError()

    def get_new_range_spec(self, latest_result, branch=None):
        """
        Returns a formatted string giving the results between the
        latest result and the newest hash in a given branch.
        If no branch given, use the 'master' branch.
        """
        raise NotImplementedError()

    def get_branch_range_spec(self, branch):
        """
        Returns a formatted string giving the results in a given branch.
        If branch is None, use the 'master' branch.
        """
        raise NotImplementedError()

    def get_date(self, hash):
        """
        Get a Javascript timestamp for a particular commit.
        """
        raise NotImplementedError()

    def get_hashes_from_range(self, range):
        """
        Get a list of commit hashes given a range specifier.  The
        syntax of the range specifier will depend on the DVCS used.
        """
        raise NotImplementedError()

    def get_hash_from_name(self, name):
        """
        Get a hash from a given tag, branch or hash.  The acceptable
        syntax will depend on the DVCS used.
        """
        raise NotImplementedError()

    def get_hash_from_master(self):
        """
        Get the hash of the current master branch commit.
        """
        raise NotImplementedError()

    def get_hash_from_parent(self, name):
        """
        Checkout the parent of the currently checked out commit.
        """
        raise NotImplementedError()

    def get_tags(self):
        """
        Get a list of all of the tags defined in the repo.
        """
        raise NotImplementedError()

    def get_date_from_name(self, name):
        """
        Get a Javascript timestamp for a particular name.
        """
        raise NotImplementedError()

class NoRepository(Repo):
    """
    Project installed in the current environment
    """

    dvcs = "none"

    def __init__(self, url=None, path=None):
        self.url = None
        self.path = None

    def _raise_error(self):
        raise ValueError("Using the currently installed project version: "
                         "operations requiring repository are not possible")

    def _check_branch(self, branch):
        if branch is not None:
            self._raise_error()

    @classmethod
    def url_match(cls, url):
        return False

    def checkout(self, path, commit_hash):
        self._check_branch(commit_hash)

    def get_date(self, hash):
        self._raise_error()

    def get_hashes_from_range(self, range):
        return [None]

    def get_hash_from_master(self):
        return None

    def get_hash_from_name(self, name):
        return None

    def get_hash_from_parent(self, name):
        self._raise_error()

    def get_tags(self):
        return []

    def get_date_from_name(self, name):
        self._raise_error()

def get_repo(conf):
    """
    Get a Repo subclass for the given configuration.

    If the configuration does not explicitly specify a repository
    type, it will attempt to automatically determine one from the
    ``conf.repo`` URL.
    """
    if conf.repo is None:
        return None

    if conf.dvcs is not None:
        for cls in util.iter_subclasses(Repo):
            if getattr(cls, 'dvcs') == conf.dvcs:
                return cls(conf.repo, conf.project)
    else:
        for cls in util.iter_subclasses(Repo):
            if cls.url_match(conf.repo):
                return cls(conf.repo, conf.project)

    raise util.UserError(
        "Can not determine what kind of DVCS to use for URL '{0}'".format(conf.repo))


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Say Hello – Michael Cranston</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="google-site-verification" content="Y-w8dNKFzmQ82mqiiXbeiZrUTyGSwJ3uV94hrI1jf-o" />
    <meta name="description" content="">
    <meta name="author" content="Michael Cranston">

    <link rel="canonical" href="http://localhost:4000/contact/">
    <link rel=icon href="/assets/images/favicon.png?v=2" sizes="16x16" type="image/png">

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

    <link href='//fonts.googleapis.com/css?family=Merriweather:900,900italic,300,300italic' rel='stylesheet' type='text/css'>
    <link href='//fonts.googleapis.com/css?family=Lato:900,300' rel='stylesheet' type='text/css'>

    <meta property="og:locale" content="en_US">
    <meta property="og:type" content="article">
    <meta property="og:title" content="Say Hello">
    <meta property="og:description" content="">
    <meta property="og:url" content="http://localhost:4000/contact/">
    <meta property="og:site_name" content="Michael Cranston">

    Michael Cranston

    Blog
Github
E-mail

Say Hello

  <form action="https://forms.brace.io/cranston.michaelrichard@gmail.com" method="POST" class="form-stacked form-light">
    <input type="text" name="email" class="input mobile-block" placeholder="Email Address">
    <textarea type="text" name="content" class="input mobile-block" rows="5" placeholder="What would you like to say?"></textarea>
    <input type="submit" class="button button-blue button-big mobile-block" value="Say Hello">
  </form>


text:
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <EditTextPreference
        android:key="@string/pref_location_key"
        android:title="@string/pref_location_title"
        android:defaultValue="@string/pref_location_default"
        android:selectAllOnFocus="true"
        android:inputType="textCapWords"
        android:capitalize="words"
        android:singleLine="true"
        android:maxLines="1" />

    <EditTextPreference
        android:key="@string/pref_days_key"
        android:title="@string/pref_days_title"
        android:defaultValue="@string/pref_days_default"
        android:selectAllOnFocus="true"
        android:inputType="textCapWords"
        android:capitalize="words"
        android:singleLine="true"
        android:maxLines="1" />

    <ListPreference
        android:key="@string/pref_temperature_units_key"
        android:title="@string/pref_temperature_units_title"
        android:defaultValue="@string/pref_temperature_units_metric"
        android:entries="@array/pref_temperature_unit_names"
        android:entryValues="@array/pref_temperature_unit_values"
        android:negativeButtonText="@null"
        android:positiveButtonText="@null" />

    <CheckBoxPreference
        android:key="example_checkbox"
        android:title="@string/pref_title_social_recommendations"
        android:summary="@string/pref_description_social_recommendations"
        android:defaultValue="true" />

</PreferenceScreen>


text:
import { nativeTimeout, nativeRaf } from '../util/dom';
import { ScrollView } from '../util/scroll-view';
export var Events = (function () {
    function Events() {
        this._channels = [];
    }
    Events.prototype.subscribe = function (topic) {
        var _this = this;
        var handlers = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            handlers[_i - 1] = arguments[_i];
        }
        if (!this._channels[topic]) {
            this._channels[topic] = [];
        }
        handlers.forEach(function (handler) {
            _this._channels[topic].push(handler);
        });
    };
    Events.prototype.unsubscribe = function (topic, handler) {
        if (handler === void 0) { handler = null; }
        var t = this._channels[topic];
        if (!t) {
            return false;
        }
        if (!handler) {
            delete this._channels[topic];
            return true;
        }
        var i = t.indexOf(handler);
        if (i < 0) {
            return false;
        }
        t.splice(i, 1);
        if (!t.length) {
            delete this._channels[topic];
        }
        return true;
    };
    Events.prototype.publish = function (topic) {
        var args = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            args[_i - 1] = arguments[_i];
        }
        var t = this._channels[topic];
        if (!t) {
            return null;
        }
        var responses = [];
        t.forEach(function (handler) {
            responses.push(handler(args));
        });
        return responses;
    };
    return Events;
}());
export function setupEvents(platform) {
    var events = new Events();
    nativeTimeout(function () {
        window.addEventListener('online', function (ev) {
            events.publish('app:online', ev);
        }, false);
        window.addEventListener('offline', function (ev) {
            events.publish('app:offline', ev);
        }, false);
        window.addEventListener('orientationchange', function (ev) {
            events.publish('app:rotated', ev);
        });
        window.addEventListener('statusTap', function (ev) {
            var el = document.elementFromPoint(platform.width() / 2, platform.height() / 2);
            if (!el) {
                return;
            }
            var content = el.closest('.scroll-content');
            if (content) {
                var scroll = new ScrollView(content);
                content.style['WebkitBackfaceVisibility'] = 'hidden';
                content.style['WebkitTransform'] = 'translate3d(0,0,0)';
                nativeRaf(function () {
                    content.style.overflow = 'hidden';
                    function finish() {
                        content.style.overflow = '';
                        content.style['WebkitBackfaceVisibility'] = '';
                        content.style['WebkitTransform'] = '';
                    }
                    var didScrollTimeout = setTimeout(function () {
                        finish();
                    }, 400);
                    scroll.scrollTo(0, 0, 300).then(function () {
                        clearTimeout(didScrollTimeout);
                        finish();
                    });
                });
            }
        });
        window.addEventListener('resize', function () {
            platform.windowResize();
        });
    }, 2000);
    return events;
}
export function setupProvideEvents(platform) {
    return function () {
        return setupEvents(platform);
    };
}
//# sourceMappingURL=events.js.map


text:
package buildin

import (
	"fmt"
	"github.com/ServiceComb/service-center/pkg/util"
	"github.com/ServiceComb/service-center/server/core"
	"github.com/ServiceComb/service-center/server/core/registry"
	"github.com/ServiceComb/service-center/server/core/registry/store"
	"github.com/ServiceComb/service-center/server/infra/quota"
	"golang.org/x/net/context"
)

type BuildInQuota struct {
}

func New() quota.QuotaManager {
	return &BuildInQuota{}
}
func init() {
	core.SchemaIdRule.Length = SCHEMA_NUM_MAX_FOR_ONESERVICE
	core.TagRule.Length = TAG_MAX_NUM_FOR_ONESERVICE
	quota.QuotaPlugins["buildin"] = New
}

const (
	SERVICE_MAX_NUMBER            = 12000
	INSTANCE_MAX_NUMBER           = 150000
	RULE_NUM_MAX_FOR_ONESERVICE   = 100
	SCHEMA_NUM_MAX_FOR_ONESERVICE = 1000
	TAG_MAX_NUM_FOR_ONESERVICE    = 100
)

//申请配额sourceType serviceinstance servicetype
func (q *BuildInQuota) Apply4Quotas(ctx context.Context, quotaType quota.ResourceType, tenant string, serviceId string, quotaSize int16) (quota.QuotaReporter, bool, error) {
	var key string = ""
	var max int64 = 0
	var indexer *store.Indexer
	switch quotaType {
	case quota.MicroServiceInstanceQuotaType:
		key = core.GetInstanceRootKey(tenant) + "/"
		max = INSTANCE_MAX_NUMBER
		indexer = store.Store().Instance()
	case quota.MicroServiceQuotaType:
		key = core.GetServiceRootKey(tenant) + "/"
		max = SERVICE_MAX_NUMBER
		indexer = store.Store().Service()
	default:
		return ResourceLimitHandler(ctx, quotaType, tenant, serviceId, quotaSize)
	}
	resp, err := indexer.Search(ctx,
		registry.WithStrKey(key),
		registry.WithPrefix(),
		registry.WithCountOnly())
	if err != nil {
		return nil, false, err
	}
	num := resp.Count + int64(quotaSize)
	util.Logger().Debugf("resource num is %d", num)
	if num > max {
		util.Logger().Errorf(nil, "no quota to apply this source, %s", serviceId)
		return nil, false, nil
	}
	return nil, true, nil
}

//向配额中心上报配额使用量
func (q *BuildInQuota) RemandQuotas(ctx context.Context, quotaType quota.ResourceType) {
}

func ResourceLimitHandler(ctx context.Context, quotaType quota.ResourceType, tenant string, serviceId string, quotaSize int16) (quota.QuotaReporter, bool, error) {
	var key string
	var max int64 = 0
	var indexer *store.Indexer
	switch quotaType {
	case quota.RULEQuotaType:
		key = core.GenerateServiceRuleKey(tenant, serviceId, "")
		max = RULE_NUM_MAX_FOR_ONESERVICE
		indexer = store.Store().Rule()
	case quota.SCHEMAQuotaType:
		key = core.GenerateServiceSchemaKey(tenant, serviceId, "")
		max = SCHEMA_NUM_MAX_FOR_ONESERVICE
		indexer = store.Store().Schema()
	case quota.TAGQuotaType:
		num := quotaSize
		if num > TAG_MAX_NUM_FOR_ONESERVICE {
			util.Logger().Errorf(nil,
				"fail to add tag for one service max tag num is %d, %s",
				TAG_MAX_NUM_FOR_ONESERVICE, serviceId)
			return nil, false, nil
		}
		return nil, true, nil
	default:
		return nil, false, fmt.Errorf("Unsurported Type %v", quotaType)
	}
	resp, err := indexer.Search(ctx,
		registry.WithStrKey(key),
		registry.WithPrefix(),
		registry.WithCountOnly())
	if err != nil {
		return nil, false, err
	}
	num := resp.Count + int64(quotaSize)
	util.Logger().Debugf("resource num is %d", num)
	if num > max {
		util.Logger().Errorf(nil, "no quota to apply this source, %s", serviceId)
		return nil, false, nil
	}
	return nil, true, nil
}


text:
package net.devh.boot.grpc.test.server;

import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;

import io.grpc.stub.StreamObserver;
import net.devh.boot.grpc.server.service.GrpcService;
import net.devh.boot.grpc.test.proto.SomeType;

@GrpcService
public class ScopedTestServiceImpl extends TestServiceImpl {

    @Autowired
    private RequestId requestId;

    @Override
    public StreamObserver<SomeType> secureBidi(StreamObserver<SomeType> responseObserver) {
        return new StreamObserver<SomeType>() {

            @Override
            public void onNext(final SomeType input) {
                final SomeType version =
                        input.toBuilder().setVersion(ScopedTestServiceImpl.this.requestId.getId()).build();
                responseObserver.onNext(version);
            }

            @Override
            public void onError(final Throwable t) {
                responseObserver.onError(t);
            }

            @Override
            public void onCompleted() {
                responseObserver.onCompleted();
            }

        };
    }

    /**
     * Fake scoped bean used to simulate variable contents. May not be a final class.
     */
    public static class RequestId {

        private final String id = UUID.randomUUID().toString();

        public String getId() {
            return this.id;
        }

        @Override
        public String toString() {
            return getId();
        }

    }

}


text:
/**
 * makeSpiralSphere - Generates line geometry for a spiral
 *
 * @param  {numebr} r=20              Radius of sphere
 * @param  {number} spiralNumber = 16 number of coils in spiral
 * @param  {number} smoothness = 100  How smooth the spiral is
 * @return {THREE.Geometry}           The Spiral Geometry that is returned
 */
function makeSpiralSphere(r=20, spiralNumber = 16, smoothness = 100) {

  var geometry = new THREE.Geometry();

      var cz = smoothness * spiralNumber;
      var hxy = Math.PI / smoothness;
      var hz = Math.PI / cz;

      for (var i = -cz; i < cz; i++) {
          var lxy = i * hxy;
          var lz = i * hz;
          var rxy = r /  Math.cosh(lz);
          var x = rxy * Math.cos(lxy);
          var y = rxy * Math.sin(lxy);
          var z = r * Math.tanh(lz);
          geometry.vertices.push(new THREE.Vector3(x, y, z));
  }

  return geometry;

}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Telopea 6:242. 1995

#### Original name
Eucalyptus nesophila Blakely

### Remarks
null


text: A prometheus client for the D language


text:
from __future__ import absolute_import

import logging
import os
import sys
import unittest

from ryu import log

def load_tests(loader, tests, pattern):
    dirname = os.path.dirname(os.path.abspath(__file__))
    base_path = os.path.abspath(dirname + '/../../..')
    suite = unittest.TestSuite()
    for test_dir in ['ryu/tests/integrated/bgp']:
        if not pattern:
            suite.addTests(loader.discover(test_dir,
                                           top_level_dir=base_path))
        else:
            suite.addTests(loader.discover(test_dir, pattern=pattern,
                                           top_level_dir=base_path))
    return suite

if __name__ == '__main__':
    log.early_init_log(logging.DEBUG)
    log.init_log()
    LOG = logging.getLogger(__name__)
    pattern = None
    if len(sys.argv) == 2:
        pattern = sys.argv[1]
    loader = unittest.defaultTestLoader
    suite = load_tests(loader, None, pattern)
    res = unittest.TextTestRunner(verbosity=2).run(suite)
    ret = 0
    if res.errors or res.failures:
        ret = 1
    sys.exit(ret)


text:
/* Home section */

.navbar {
    border: none;
    top: 120px;
}

.navbar-default {
    background-color: transparent !important;
}

#index-page {
    margin-top: -15px;
}

.container-fluid {
    padding-left: 100px;
    padding-right: 100px;
}

.navbar-toggle {
    border: none;
}

#login-button {
    text-decoration: none;
    border: 2px solid;
    transition: 0.3s ease all;
    font-weight: 400;
    font-size: 15px;
    border-radius: 5px;
    padding: 8px 20px !important;
    margin-top: 0px;
    color: #FF0053 !important;
    border-radius: 2px;
    margin-left: 10px;
}

#login-button:hover {
    color: white !important;
}

.home-section a {
    padding: 10px 15px !important;
    color: #ff0053 !important;
}

.home-section {
    background-image: url(../images/index-background.jpg);
    background-position: bottom;
    background-size: cover;
    background-repeat: no-repeat;
}

.home-section .nav > li > a {
    color: white !important;
    padding-right: 20px;
    padding-left: 20px;
    transition: 0.3s ease all !important;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.home-section .nav > li > a:hover {
    color: #ff0053 !important;
}

#welcome-text {
    color: white;
    font-weight: 300;
    letter-spacing: 2px;
    margin-top: 15%;
    font-size: 50px;
    cursor: default;
}

#welcome-paragraph {
    color: white;
    font-size: 18px;
    margin-top: 15px;
    cursor: default;
}

#sign-up-button,
#food-menu-button {
    color: white !important;
    background-color: #ff0053;
    text-transform: uppercase;
    padding: 15px;
    font-size: 15px;
    letter-spacing: 1px;
    border-radius: 2px;
    cursor: pointer;
    font-weight: 500 !important;
}

#sign-up-button {
    margin-top: 30px;
    padding: 15px !important;
}

#sign-up-button:hover {
    text-decoration: none;
    border: 2px solid white;
    padding: 12px !important;
}

/* Login card */

#login-card {
    height: 400px;
    margin-top: 50px !important;
}
#forget-password {
    color: #ff0053;
    font-size: 17px;
    margin-top: 80px;
    text-transform: uppercase;
}

#forget-password:hover {
    text-decoration: none;
    color: #232934;
}

/* Sign up card */

#sign-up-card {
    position: absolute;
    overflow-y: scroll;
    height     : 590px;
    margin-top: -50px !important;
}

#sign-up-card .action-button {
    margin-bottom: 30px;
}

/* Reservaion section */

.reservation-section {
    background-image: url(../images/reservation-background.jpg) !important;
    background-position: center;
    background-size: cover;
    height: 100%;
}

.reservation-section #reservation-card {
    display: inline;
    position: relative;
    margin-top: 0% !important;
    height: 100%;
    box-shadow: none;
    overflow-y: scroll;
}

.reservation-section #reservation-card .close {
    display: none !important;
}

#reservation-order-card-index-page .action-button:hover {
    box-shadow: none !important;
    border: 5px solid white !important;
}

/* Food menu section */

.food-menu-section {
    width: 100%;
    position: relative;
    background-color: white;
}

.headline {
    margin-top: 5%;
    width: 100%;
    text-transform: uppercase;
    font-weight: 300;
    letter-spacing: 4px;
    font-size: 40px;
    color: #232934;
    cursor: default;
}

#food-menu-button {
    margin-top: 5%;
    transition: 0.3s ease all;
}

#food-menu-button:hover {
    text-decoration: none;
    box-shadow: 2px 2px 5px gray;
}

.food-menu-section .food-card {
    margin-top: 2%;
    height: 300px;
    background-color: white;
    box-shadow: 1px 1px 5px gray;
    border-radius: 5px;
    z-index: 2;
    cursor: pointer;
    margin-left: 5%;
    padding: 0px !important;
}

.food-menu-section .food-card h1 {
    text-transform: uppercase;
    font-size: 45px;
    letter-spacing: 5px;
    position: absolute;
    top: 40%;
    width: 100%;
    color: white;
    transition: 0.5s ease all;
}

#big-mac-card,
#pizza-card,
#chicken-macdo-card {
    background-position: center;
    background-size: cover;
}

#big-mac-card {
    background-image: url(../images/Big-Mac.jpg);
}

#pizza-card {
    background-image: url(../images/Pizza.jpg);
}

#chicken-macdo-card {
    background-image: url(../images/Chicken-macdo.jpg);
}

#image-edit {
    display: block;
}

.food-card .image-edit {
    height: 100%;
    z-index: 1;
    background: rgba(0, 0, 0, .5);
}

.food-menu-section .food-card p {
    color: white;
    font-size: 18px;
    font-weight: 100;
    position: absolute;
    top: 45%;
    height: 45%;
    visibility: hidden;
    opacity: 0;
    transition: 0.4s ease;
}

.food-menu-section .food-card:hover h1 {
    top: 15%;
}

.food-menu-section .food-card:hover p {
    visibility: visible;
    opacity: 1;
}

.first {
    margin-left: 7.5%;
    padding: 0px !important;
}

/* Contact us section */

.contact-us .map {
    height: 69%;
    padding: 0px;
    margin-top: 2.1%;
}

.contact-us-section {
    background-color: #232934;
}

.contact-us-section .headline {
    margin-top: 3.5%;
    color: white;
}

.contact-us-section .email {
    margin-top: 0%;
    padding-top: 3%;
}

.email .first-input {
    margin-top: 4%;
}

.email input,
.email textarea {
    color: white !important;
}

#message textarea {
    outline: none;
    overflow: hidden;
    resize: none;
    padding-left: 10px !important;
    padding-bottom: 90px;
}

.contact-us-section .map {
    margin-top: -300px;
    height: 350px;
    width: 600px;
    border: 4px solid #ff0053;
    padding: 0px !important;
}

.contact-us-section #send-email {
    margin-top: 20px;
    transition: none !important;
}

.contact-us-section #send-email:hover {
    box-shadow: none !important;
    border: 2px solid white !important;
    padding: 11px;
}

.contact-us-section .info {
    margin-top: 32%;
    color: white;
    cursor: default;
}

.contact-us-section .social-media {
    margin-top: 0%;
    font-size: 25px;
}

.contact-us-section a {
    color: white !important;
    cursor: pointer;
    transition: 0.2s ease all;
}

.contact-us-section a:hover {
    text-decoration: none !important;
}

.contact-us-section #facebook:hover {
    color: #3e5b98;
}

.contact-us-section #twitter:hover {
    color: #4da7de;
}

/*Controlling tables view size*/

#user-view {
  position    : relative;
  width       : 80%;
  height      : 300px;
  margin-left : 10%;
}

/*
  Tables pane
  - Table view (Table div)
  - Table info (Table card)
  - Table box
  - Table info > label
  - New Table
  - Table control buttons
*/

.tables-view {
  position   : relative;
  width      : 90%;
  height     : 400px;
  margin     : 5%;
  margin-top : 5px;
  overflow   : hidden;
}

.table-info {
  position         : absolute !important;
  top              : 10px;
  left             : 10px;
  width            : 45px;
  height           : 45px;
  overflow         : hidden;
  border-radius    : 30px;
  background-color : white;
  transition       : width 0.8s;
}

.existing-table:hover {
  width  : 100px;
  height : 45px;
}

.table-box {
  display : none;
}

.table-box + label {
  display             : inline-block;
  position            : relative;
  width               : 25px;
  height              : 25px;
  margin-top          : 8px;
  margin-left         : 10px;
  padding             : 0 0 0 0px;
  background          : url(../icons/table-normal.png) no-repeat;
  background-size     : cover;
  -webkit-user-select : none;
  cursor              : pointer;
}

.table-box:checked + label {
  display             : inline-block;
  width               : 25px;
  height              : 25px;
  padding             : 0 0 0 0px;
  background          : url(../icons/table-selected.png) no-repeat;
  background-size     : cover;
  -webkit-user-select : none;
  cursor              : pointer;
}

.info {
  opacity          : 0;
  transition       : opacity 0.3s ease-in-out;
  transition-delay : 0.5s !important;
}

.existing-table:hover .info {
  display     : inline;
  position    : relative;
  top         : -3px !important;
  margin-left : 5px;
  opacity     : 1;
  cursor      : pointer;
}

.info label {
  opacity : 0;
}

.existing-table:hover .info label {
  opacity             : 1;
  font-size           : 12px;
  font-weight         : 400;
  line-height         : 14px;
  -webkit-user-select : none;
  cursor              : pointer;
}

.unaviable-table {
  background-color : #B71C1C !important;
}

#user-view .table-info {
  background-color : #4CAF50;
}

#user-view .table-box:checked + label {
  display             : inline-block;
  width               : 25px;
  height              : 25px;
  padding             : 0 0 0 0px;
  background          : url(../icons/table-white.png) no-repeat;
  background-size     : cover;
  -webkit-user-select : none;
  cursor              : pointer;
}

#user-view .table-info label,
.unaviable-table .info label {
  color : white;
}

.tables-buttons {
  position     : absolute !important;
  top          : 90% !important;
  width        : auto !important;
  margin-right : 5% !important;
}