text:
<!DOCTYPE html>

      Image 01

      Image 02

      Image 03

      Image 04

      Image 05

重设密码

        <form class="form-sign" method="POST">

          <input type="hidden" th:field="*{token}"/>

            <input type="password" class="form-control" th:field="*{password}" placeholder="请输入您的新密码" required="required" autofocus="autofocus"/>

            <input type="password" class="form-control" th:field="*{repeatPassword}" placeholder="请确认您的新密码" required="required" autofocus="autofocus"/>

            <button type="button" class="close" data-dismiss="alert">×Close</button>

          <button type="submit" class="btn btn-primary btn-block">提交</button>
        </form>


text:
import strawberry

@strawberry.type
class NewsletterSubscription:
    id: strawberry.ID
    email: str

redpajama_set_name: RedPajamaGithub


text:
import logging
import time
from uuid import uuid4
from kubernetes.client.rest import ApiException

from ray.autoscaler._private.command_runner import KubernetesCommandRunner
from ray.autoscaler._private.kubernetes import core_api, log_prefix, \
    extensions_beta_api
from ray.autoscaler._private.kubernetes.config import bootstrap_kubernetes
from ray.autoscaler.node_provider import NodeProvider
from ray.autoscaler.tags import TAG_RAY_CLUSTER_NAME

logger = logging.getLogger(__name__)

MAX_TAG_RETRIES = 3
DELAY_BEFORE_TAG_RETRY = .5

def to_label_selector(tags):
    label_selector = ""
    for k, v in tags.items():
        if label_selector != "":
            label_selector += ","
        label_selector += "{}={}".format(k, v)
    return label_selector

class KubernetesNodeProvider(NodeProvider):
    def __init__(self, provider_config, cluster_name):
        NodeProvider.__init__(self, provider_config, cluster_name)
        self.cluster_name = cluster_name
        self.namespace = provider_config["namespace"]

    def non_terminated_nodes(self, tag_filters):
        # Match pods that are in the 'Pending' or 'Running' phase.
        # Unfortunately there is no OR operator in field selectors, so we
        # have to match on NOT any of the other phases.
        field_selector = ",".join([
            "status.phase!=Failed",
            "status.phase!=Unknown",
            "status.phase!=Succeeded",
            "status.phase!=Terminating",
        ])

        tag_filters[TAG_RAY_CLUSTER_NAME] = self.cluster_name
        label_selector = to_label_selector(tag_filters)
        pod_list = core_api().list_namespaced_pod(
            self.namespace,
            field_selector=field_selector,
            label_selector=label_selector)

        return [pod.metadata.name for pod in pod_list.items]

    def is_running(self, node_id):
        pod = core_api().read_namespaced_pod(node_id, self.namespace)
        return pod.status.phase == "Running"

    def is_terminated(self, node_id):
        pod = core_api().read_namespaced_pod(node_id, self.namespace)
        return pod.status.phase not in ["Running", "Pending"]

    def node_tags(self, node_id):
        pod = core_api().read_namespaced_pod(node_id, self.namespace)
        return pod.metadata.labels

    def external_ip(self, node_id):
        raise NotImplementedError("Must use internal IPs with Kubernetes.")

    def internal_ip(self, node_id):
        pod = core_api().read_namespaced_pod(node_id, self.namespace)
        return pod.status.pod_ip

    def get_node_id(self, ip_address, use_internal_ip=True) -> str:
        if not use_internal_ip:
            raise ValueError("Must use internal IPs with Kubernetes.")
        return super().get_node_id(ip_address, use_internal_ip=use_internal_ip)

    def set_node_tags(self, node_ids, tags):
        for _ in range(MAX_TAG_RETRIES - 1):
            try:
                self._set_node_tags(node_ids, tags)
                return
            except ApiException as e:
                if e.status == 409:
                    logger.info(log_prefix + "Caught a 409 error while setting"
                                " node tags. Retrying...")
                    time.sleep(DELAY_BEFORE_TAG_RETRY)
                    continue
                else:
                    raise
        # One more try
        self._set_node_tags(node_ids, tags)

    def _set_node_tags(self, node_id, tags):
        pod = core_api().read_namespaced_pod(node_id, self.namespace)
        pod.metadata.labels.update(tags)
        core_api().patch_namespaced_pod(node_id, self.namespace, pod)

    def create_node(self, node_config, tags, count):
        conf = node_config.copy()
        pod_spec = conf.get("pod", conf)
        service_spec = conf.get("service")
        ingress_spec = conf.get("ingress")
        node_uuid = str(uuid4())
        tags[TAG_RAY_CLUSTER_NAME] = self.cluster_name
        tags["ray-node-uuid"] = node_uuid
        pod_spec["metadata"]["namespace"] = self.namespace
        if "labels" in pod_spec["metadata"]:
            pod_spec["metadata"]["labels"].update(tags)
        else:
            pod_spec["metadata"]["labels"] = tags
        logger.info(log_prefix + "calling create_namespaced_pod "
                    "(count={}).".format(count))
        new_nodes = []
        for _ in range(count):
            pod = core_api().create_namespaced_pod(self.namespace, pod_spec)
            new_nodes.append(pod)

        new_svcs = []
        if service_spec is not None:
            logger.info(log_prefix + "calling create_namespaced_service "
                        "(count={}).".format(count))

            for new_node in new_nodes:

                metadata = service_spec.get("metadata", {})
                metadata["name"] = new_node.metadata.name
                service_spec["metadata"] = metadata
                service_spec["spec"]["selector"] = {"ray-node-uuid": node_uuid}
                svc = core_api().create_namespaced_service(
                    self.namespace, service_spec)
                new_svcs.append(svc)

        if ingress_spec is not None:
            logger.info(log_prefix + "calling create_namespaced_ingress "
                        "(count={}).".format(count))
            for new_svc in new_svcs:
                metadata = ingress_spec.get("metadata", {})
                metadata["name"] = new_svc.metadata.name
                ingress_spec["metadata"] = metadata
                ingress_spec = _add_service_name_to_service_port(
                    ingress_spec, new_svc.metadata.name)
                extensions_beta_api().create_namespaced_ingress(
                    self.namespace, ingress_spec)

    def terminate_node(self, node_id):
        logger.info(log_prefix + "calling delete_namespaced_pod")
        core_api().delete_namespaced_pod(node_id, self.namespace)
        try:
            core_api().delete_namespaced_service(node_id, self.namespace)
        except ApiException:
            pass
        try:
            extensions_beta_api().delete_namespaced_ingress(
                node_id,
                self.namespace,
            )
        except ApiException:
            pass

    def terminate_nodes(self, node_ids):
        for node_id in node_ids:
            self.terminate_node(node_id)

    def get_command_runner(self,
                           log_prefix,
                           node_id,
                           auth_config,
                           cluster_name,
                           process_runner,
                           use_internal_ip,
                           docker_config=None):
        return KubernetesCommandRunner(log_prefix, self.namespace, node_id,
                                       auth_config, process_runner)

    @staticmethod
    def bootstrap_config(cluster_config):
        return bootstrap_kubernetes(cluster_config)

def _add_service_name_to_service_port(spec, svc_name):
    """Goes recursively through the ingress manifest and adds the
    right serviceName next to every servicePort definition.
    """
    if isinstance(spec, dict):
        dict_keys = list(spec.keys())
        for k in dict_keys:
            spec[k] = _add_service_name_to_service_port(spec[k], svc_name)

            if k == "serviceName" and spec[k] != svc_name:
                raise ValueError(
                    "The value of serviceName must be set to "
                    "${RAY_POD_NAME}. It is automatically replaced "
                    "when using the autoscaler.")

    elif isinstance(spec, list):
        spec = [
            _add_service_name_to_service_port(item, svc_name) for item in spec
        ]

    elif isinstance(spec, str):
        # The magic string ${RAY_POD_NAME} is replaced with
        # the true service name, which is equal to the worker pod name.
        if "${RAY_POD_NAME}" in spec:
            spec = spec.replace("${RAY_POD_NAME}", svc_name)
    return spec


text:
struct PCFPushRegistrationAttributes {
    PCF_STRUCT_STRING *variantUUID;
    PCF_STRUCT_STRING *customUserId;
    PCF_STRUCT_STRING *deviceAlias;
    PCF_STRUCT_STRING *deviceManufacturer;
    PCF_STRUCT_STRING *deviceModel;
    PCF_STRUCT_STRING *deviceOS;
    PCF_STRUCT_STRING *deviceOSVersion;
    PCF_STRUCT_STRING *registrationToken;
    PCF_STRUCT_STRING *tags;
};

extern const struct PCFPushRegistrationAttributes PCFPushRegistrationAttributes;

@interface PCFPushRegistrationData : NSObject <PCFMapping>

@property NSString *variantUUID;
@property NSString *customUserId;
@property NSString *deviceAlias;
@property NSString *deviceManufacturer;
@property NSString *deviceModel;
@property NSString *os;
@property NSString *osVersion;
@property NSString *registrationToken;

+ (NSDictionary *)localToRemoteMapping;

@end


text:
<!DOCTYPE html>

    <title>Minimal 1.3 - Calendar</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta charset="UTF-8" />

    <link rel="icon" type="image/ico" href="assets/images/favicon.ico" />

    <link href="assets/css/vendor/bootstrap/bootstrap.min.css" rel="stylesheet">
    <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
    <link rel="stylesheet" href="assets/css/vendor/animate/animate.css">
    <link type="text/css" rel="stylesheet" media="all" href="assets/js/vendor/mmenu/css/jquery.mmenu.all.css" />
    <link rel="stylesheet" href="assets/js/vendor/videobackground/css/jquery.videobackground.css">
    <link rel="stylesheet" href="assets/css/vendor/bootstrap-checkbox.css">

    <link rel="stylesheet" href="assets/js/vendor/fullcalendar/fullcalendar.css">
    <link rel="stylesheet" href="assets/js/vendor/colorpalette/bootstrap-colorpalette.css">

    <link href="assets/css/minimal.css" rel="stylesheet">

              MINIMAL

               <input type="text" placeholder="Search...">

                  2

You have 2 new tasks

Layout

80%

                          40% Complete (success)

Schemes

15%

                          45% Complete

Forms

5%

                          5% Complete (warning)

JavaScript

30%

                          30% Complete (danger)

Dropdowns

60%

                          60% Complete

Check all tasks

                  1

You have 1 new message

                        Ing. Imrich Kamarel
                        12 mins

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum

                        Arnold Karlsberg
                        1 hour

Lorem ipsum dolor sit amet, consectetur adipisicing elit

                        John Douey
                        3 hours

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia

                        Peter Kay
                        5 hours

Ut enim ad minim veniam, quis nostrud exercitation

                        George McCain
                        6 hours

Lorem ipsum dolor sit amet, consectetur adipisicing elit

Check all messages

                  3

You have 3 new notifications

                      New user registered.
                      18 mins

                      Server down.
                      27 mins

                      New order.
                      36 mins

                      Server restared.
                      45 mins

                      Server started.
                      50 mins

Check all notifications

                  John Douey

Backgrounds:

Solid Backgrounds:

                      Video BG

                          <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="videobg-check">

Choose type:

                     Profile

                     Calendar

                     Inbox 3

                     Logout

                Navigation

                       Dashboard
                      1

                       Forms

                           Common Elements

                           Validation

                           Form Wizard

                       Interface

                           UI Elements

                           Typography

                           Tiles

                          Portlets
                          new

                           Nestable Lists
                          new

                       Buttons & Icons

                       Grid Layout

                       Tables

                           Bootstrap Tables

                           DataTables

                       Example Pages
                      mails

                           Login Page

                           Calendar

                           Page 404

                           Page 500

                           Page Offline

                           Blank Page
                          new

                           Locked Screen
                          new

                           Gallery

                           Timeline

                           Chat
                          new

                           Search Results
                          new

                           Profile Page
                          new

                           Weather Page
                          new

                           Front Page
                          new

                           Vertical Mail
                          5

                           Horizontal Mail
                          mails

                           Vector Maps

                           Google Maps

                       Widgets

                       Charts & Graphs

                Orders Summary

                    This week sales

26, 149

                    This week balance

318, 651

                General Settings

                  Switch ON

                      <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="switch-on" checked="">

                  Switch OFF

                      <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="switch-off">

 Calendar // Place subtitle here...

You are here

Minimal

Example Pages

Calendar

                      Draggable Events

The Custom Event #1

The Custom Event #2

The Custom Event #3

The Custom Event #4

The Custom Event #5

The Custom Event #6

                      <input type="checkbox" value="1" id="drop-remove">
                       Remove after drop

Month

Week

Day

Today

                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">Close</button>

Add New Event

                  <form role="form" id="add-event" parsley-validate>

                        Event title *
                        <input type="text" class="form-control" id="event-title" name="event-title" parsley-trigger="change" parsley-required="true" parsley-minlength="4" parsley-validation-minlength="1">

                        Color

                          <input type="text" class="form-control" id="event-color" name="event-color" readonly="">

                            <button type="button" class="btn btn-greensea dropdown-toggle" data-toggle="dropdown"></button>

                      <button class="btn btn-red" data-dismiss="modal" aria-hidden="true">Cancel</button>
                      <button type="submit" class="btn btn-green">Add event</button>

                  </form>

                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">Close</button>

Edit Event:

                  <form role="form" parsley-validate>

                        Event title *
                        <input type="text" class="form-control" id="edit-event-title" name="event-title" parsley-trigger="change" parsley-required="true" parsley-minlength="4" parsley-validation-minlength="1">

                        Color

                          <input type="text" class="form-control" id="edit-event-color" name="event-color" readonly="">

                            <button type="button" class="btn btn-greensea dropdown-toggle" data-toggle="dropdown"></button>

                      <button class="btn btn-green" id="save-event">Save</button>
                      <button class="btn btn-red" data-dismiss="modal" aria-hidden="true" id="remove-event">Delete</button>
                      <button class="btn btn-blue" data-dismiss="modal" aria-hidden="true">Cancel</button>

                  </form>

Online Users

Ing. Imrich Kamarel

                       Ulaanbaatar, Mongolia

                    3

Arnold Karlsberg

                       Bratislava, Slovakia

Peter Kay

                       Kosice, Slovakia

George McCain

                       Prague, Czech Republic

Lucius Cashmere

                       Wien, Austria

Jesse Phoenix

                       Berlin, Germany

Offline Users

Dell MacApple

                       Paris, France

Roger Flopple

                       Rome, Italia

Nico Vulture

                       Kyjev, Ukraine

Bobby Socks

                       Moscow, Russia

Anna Opichia

                       Budapest, Hungary

Chat History

Ing. Imrich Kamarel

                      Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor

                    3

Arnold Karlsberg

                      Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur

Peter Kay

                      Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit

Friends List

                    3

Arnold Karlsberg

                       Bratislava, Slovakia

Anna Opichia

                       Budapest, Hungary

Lucius Cashmere

                       Wien, Austria

Ing. Imrich Kamarel

                       Ulaanbaatar, Mongolia

Chat Settings

                    Show Offline Users

                        <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show-offline" checked="">

                    Show Fullname

                        <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show-fullname">

                    History Enable

                        <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show-history" checked="">

                    Show Locations

                        <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show-location" checked="">

                    Notifications

                        <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show-notifications">

                    Show Undread Count

                        <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show-unread" checked="">


text:
package com.hyh.download.sample.view;

import android.support.annotation.NonNull;
import android.view.View;
import android.widget.TextView;

import com.hyh.download.State;
import com.hyh.download.sample.presenter.IDownloadItemPresenter;
import com.hyh.download.sample.widget.ProgressButton;
import com.yly.mob.ssp.downloadsample.R;

import java.text.DecimalFormat;

/**
 * Created by Eric_He on 2019/1/8.
 */

public class DownloadItemView implements IDownloadItemView {

    private final TextView mTitle;
    private final TextView mName;
    private final TextView mSize;
    private final TextView mSpeed;
    private final ProgressButton mProgressButton;

    private IDownloadItemPresenter mDownloadItemPresenter;

    public DownloadItemView(View itemView) {
        mTitle = itemView.findViewById(R.id.item_download_tv_title);
        mName = itemView.findViewById(R.id.item_download_tv_name);
        mSize = itemView.findViewById(R.id.item_download_tv_size);
        mSpeed = itemView.findViewById(R.id.item_download_tv_speed);
        mProgressButton = itemView.findViewById(R.id.item_download_pb_progress);
    }

    @Override
    public void unBindDownloadItemPresenter(IDownloadItemPresenter downloadItemPresenter) {
        if (mDownloadItemPresenter == downloadItemPresenter) {
            mDownloadItemPresenter = null;
        }
    }

    @Override
    public void bindDownloadItemPresenter(IDownloadItemPresenter downloadItemPresenter) {
        if (mDownloadItemPresenter == downloadItemPresenter) {
            return;
        }
        if (mDownloadItemPresenter != null) {
            mDownloadItemPresenter.unBindDownloadItemView(this);
        }
        mDownloadItemPresenter = downloadItemPresenter;
    }

    @Override
    public void setOnClickListener(View.OnClickListener listener) {
        mProgressButton.setOnClickListener(listener);
    }

    @Override
    public void setTitle(String title) {
        mTitle.setText(title);
    }

    @Override
    public void setDownloadStatus(int downloadStatus) {
        mProgressButton.setText(getProgressButtonText(downloadStatus));
    }

    @Override
    public void setProgress(int progress) {
        mProgressButton.setProgress(progress);
    }

    @Override
    public void setSpeed(float speed) {
        mSpeed.setText(getSpeedStr(speed));
    }

    @Override
    public void setFileName(String fileName) {
        mName.setText(fileName);
    }

    @Override
    public void setTotalSize(long totalSize) {
        mSize.setText(getSizeStr(totalSize));
    }

    @NonNull
    private String getProgressButtonText(int status) {
        String text = "下载";
        switch (status) {
            case State.NONE: {
                text = "下载";
                break;
            }
            case State.PREPARE: {
                text = "准备中";
                break;
            }
            case State.WAITING_START: {
                text = "等待中";
                break;
            }
            case State.WAITING_END: {
                text = "下载中";
                break;
            }
            case State.CONNECTED: {
                text = "下载中";
                break;
            }
            case State.DOWNLOADING: {
                text = "下载中";
                break;
            }
            case State.RETRYING: {
                text = "重试中";
                break;
            }
            case State.DELETE: {
                text = "下载";
                break;
            }
            case State.PAUSE: {
                text = "继续";
                break;
            }
            case State.SUCCESS: {
                text = "成功";
                break;
            }
            case State.FAILURE: {
                text = "重试";
                break;
            }
        }
        return text;
    }

    @NonNull
    private String getSpeedStr(float speed) {
        if (speed >= 1024) {
            DecimalFormat decimalFormat = new DecimalFormat("0.0");
            return decimalFormat.format(speed / 1024.0f) + "M/s";
        } else {
            DecimalFormat decimalFormat = new DecimalFormat("0.0");
            return decimalFormat.format(speed) + "K/s";
        }
    }

    private String getSizeStr(long totalSize) {
        float mb = totalSize / 1024.0f / 1024.0f;
        DecimalFormat decimalFormat = new DecimalFormat("0.00");
        return decimalFormat.format(mb) + " MB";
    }
}


text:
<!DOCTYPE html>

	<meta charset="UTF-8">
	<link rel="stylesheet" href="./css/normalize.css">
	<link rel="stylesheet" href="./css/style.css">
	<title>Downtown Indianpolis</title>

Indianapolis


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>event-processor-feature</artifactId>
        <groupId>org.wso2.carbon.event-processing</groupId>
        <version>2.1.1-SNAPSHOT</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>org.wso2.carbon.event.processor.template.deployer.feature</artifactId>
    <name>WSO2 Carbon - Event processor template Deployer Feature</name>

    <dependencies>
        <dependency>
            <groupId>org.wso2.carbon.event-processing</groupId>
            <artifactId>org.wso2.carbon.event.processor.template.deployer</artifactId>
            <version>${carbon.event.processing.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>src/main/resources</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>resources</directory>
                                    <includes>
                                        <include>build.properties</include>
                                        <include>p2.inf</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.wso2.maven</groupId>
                <artifactId>carbon-p2-plugin</artifactId>
                <version>${carbon.p2.plugin.version}</version>
                <executions>
                    <execution>
                        <id>4-p2-feature-generation</id>
                        <phase>package</phase>
                        <goals>
                            <goal>p2-feature-gen</goal>
                        </goals>
                        <configuration>
                            <id>org.wso2.carbon.event.processor.template.deployer</id>
                            <propertiesFile>../../etc/feature.properties</propertiesFile>
                            <adviceFile>
                                <properties>
                                    <propertyDef>org.wso2.carbon.p2.category.type:server
                                    </propertyDef>
                                    <propertyDef>org.eclipse.equinox.p2.type.group:false
                                    </propertyDef>
                                </properties>
                            </adviceFile>
                            <bundles>
                                <bundleDef>
                                    org.wso2.carbon.event-processing:org.wso2.carbon.event.processor.template.deployer:${carbon.event.processing.version}
                                </bundleDef>
                            </bundles>
                            <importFeatures>
                                <importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}
                                </importFeatureDef>
                            </importFeatures>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>


text:
package org.apache.derby.impl.sql.execute;

import org.apache.derby.iapi.services.sanity.SanityManager;
import org.apache.derby.iapi.error.StandardException;

import org.apache.derby.iapi.sql.execute.ExecRow;
import org.apache.derby.iapi.sql.execute.ExecIndexRow;
import org.apache.derby.iapi.store.access.TransactionController;

/**
 * Checks a set or referential integrity constraints.  Used
 * to shield the caller from ReferencedKeyRIChecker and
 * ForeignKeyRICheckers.
 */
public class RISetChecker
{
	private GenericRIChecker[] 	checkers;

	/**
	 * @param tc		the xact controller
	 * @param fkInfo	the foreign key information
	 *
	 * @exception StandardException		Thrown on failure
	 */
	public RISetChecker(TransactionController tc, FKInfo fkInfo[])
		throws StandardException
	{
		if (fkInfo == null)
		{
			return;
		}

		checkers = new GenericRIChecker[fkInfo.length];

		for (int i = 0; i < fkInfo.length; i++)
		{
			checkers[i] = (fkInfo[i].type == FKInfo.FOREIGN_KEY) ?
				(GenericRIChecker)new ForeignKeyRIChecker(tc, fkInfo[i]) :
				(GenericRIChecker)new ReferencedKeyRIChecker(tc, fkInfo[i]);
		}
	}

	/**
	 * Do any work needed to reopen our ri checkers
	 * for another round of checks.  Must do a close()
	 * first.
	 *
	 * @exception StandardException on error
	 */
	void reopen() throws StandardException
	{
		// currently a noop
	}

	/**
	 * Check that there are no referenced primary keys in
	 * the passed in row.  So for each foreign key that
	 * references a primary key constraint, make sure
	 * that there is no row that matches the values in
	 * the passed in row.
	 *
	 * @param row	the row to check
	 *
	 * @exception StandardException on unexpected error, or
	 *		on a primary/unique key violation
	 */
	public void doPKCheck(ExecRow row, boolean restrictCheckOnly) throws StandardException
	{
		if (checkers == null)
			return;

		for (int i = 0; i < checkers.length; i++)
		{
			if (checkers[i] instanceof ReferencedKeyRIChecker)
			{
				checkers[i].doCheck(row,restrictCheckOnly);
			}
		}
	}

	/**
	 * Check that everything in the row is ok, i.e.
	 * that there are no foreign keys in the passed
	 * in row that have invalid values.
	 *
	 * @param row	the row to check
	 *
	 * @exception StandardException on unexpected error, or
	 *		on a primary/unique key violation
	 */
	public void doFKCheck(ExecRow row) throws StandardException
	{
		if (checkers == null)
			return;

		for (int i = 0; i < checkers.length; i++)
		{
			if (checkers[i] instanceof ForeignKeyRIChecker)
			{
				checkers[i].doCheck(row);
			}
		}
	}

	/**
	 * Execute the specific RI check on the passed in row.
	 *
	 * @param index	index into fkInfo
	 * @param row		the row to check
	 *
	 * @exception StandardException on unexpected error, or
	 *		on a primary/unique key violation
	 */
	public void doRICheck(int index, ExecRow row, boolean restrictCheckOnly) throws StandardException
	{
		if (SanityManager.DEBUG)
		{
			if (checkers == null)
			{
				SanityManager.THROWASSERT("no checkers, how can i execute checker "+index);
			}

			if (index >= checkers.length)
			{
				SanityManager.THROWASSERT("there are only "+
					checkers.length+" checkers, "+index+" is invalid");
			}
		}

		checkers[index].doCheck(row, restrictCheckOnly);
	}

	/**
	 * clean up
	 *
	 * @exception StandardException on error
	 */
	public void close() throws StandardException
	{
		if (checkers == null)
			return;

		for (int i = 0; i < checkers.length; i++)
		{
			checkers[i].close();
		}
	}
}


text:
using System;
using System.Collections.Generic;
using Cassandra.Data.Linq;
using Cassandra.IntegrationTests.Linq.Structures;
using Cassandra.IntegrationTests.TestBase;
using Cassandra.Mapping;
using NUnit.Framework;
#pragma warning disable 612

namespace Cassandra.IntegrationTests.Linq.LinqMethods
{
    [Category("short")]
    public class UpdateIfTests : TestGlobals
    {
        private ISession _session;
        private ICluster _cluster;
        private Table<Movie> _movieTable;

        [TestFixtureSetUp]
        public void TestFixtureSetUp()
        {
            var testCluster = TestClusterManager.GetTestCluster(1, DefaultMaxClusterCreateRetries, true, false);
            _cluster = Cluster.Builder().AddContactPoint(testCluster.InitialContactPoint).Build();
            _session = _cluster.Connect();
            var uniqueKsName = TestUtils.GetUniqueKeyspaceName();
            _session.CreateKeyspace(uniqueKsName);
            _session.ChangeKeyspace(uniqueKsName);

            _movieTable = new Table<Movie>(_session, new MappingConfiguration());
            _movieTable.Create();
        }

        [TestFixtureTearDown]
        public void TestFixtureTearDown()
        {
            _cluster.Dispose();
        }

        [Test]
        [TestCassandraVersion(2, 0)]
        public void LinqTable_UpdateIf_AppliedInfo_Test()
        {
            _movieTable.CreateIfNotExists();
            var movie = new Movie()
            {
                Title = "Dead Poets Society",
                Year = 1989,
                MainActor = "Robin Williams",
                Director = "Peter Weir",
                MovieMaker = "Touchstone"
            };
            _movieTable.Insert(movie).SetConsistencyLevel(ConsistencyLevel.Quorum).Execute();

            var retrievedMovie = _movieTable
                .FirstOrDefault(m => m.Title == "Dead Poets Society" && m.MovieMaker == "Touchstone")
                .Execute();
            Movie.AssertEquals(movie, retrievedMovie);
            Assert.NotNull(retrievedMovie);
            Assert.AreEqual(1989, retrievedMovie.Year);
            Assert.AreEqual("Robin Williams", retrievedMovie.MainActor);

            var appliedInfo = _movieTable
                .Where(m => m.Title == "Dead Poets Society" && m.MovieMaker == "Touchstone" && m.Director == "Peter Weir")
                .Select(m => new Movie { MainActor = "Robin McLaurin Williams" })
                .UpdateIf(m => m.Year == 1989)
                .Execute();
            Assert.True(appliedInfo.Applied);
            Assert.Null(appliedInfo.Existing);

            retrievedMovie = _movieTable
                .FirstOrDefault(m => m.Title == "Dead Poets Society" && m.MovieMaker == "Touchstone")
                .Execute();
            Assert.NotNull(retrievedMovie);
            Assert.AreEqual(1989, retrievedMovie.Year);
            Assert.AreEqual("Robin McLaurin Williams", retrievedMovie.MainActor);

            //Should not update as the if clause is not satisfied
            var updateIf = _movieTable
                .Where(m => m.Title == "Dead Poets Society" && m.MovieMaker == "Touchstone" && m.Director == "Peter Weir")
                .Select(m => new Movie { MainActor = "WHOEVER" })
                .UpdateIf(m => m.Year == 1500);
            string updateIfToStr = updateIf.ToString();
            Console.WriteLine(updateIfToStr);

            appliedInfo = updateIf.Execute();
            Assert.False(appliedInfo.Applied);
            Assert.AreEqual(1989, appliedInfo.Existing.Year);
            retrievedMovie = _movieTable
                .FirstOrDefault(m => m.Title == "Dead Poets Society" && m.MovieMaker == "Touchstone")
                .Execute();
            Assert.NotNull(retrievedMovie);
            Assert.AreEqual("Robin McLaurin Williams", retrievedMovie.MainActor);
        }
    }
}


text:
<?php

namespace Aimeos\Shop\Base;

/**
 * Service providing the page object
 *
 * @package laravel
 * @subpackage Base
 */
class Page
{
	/**
	 * @var \Illuminate\Contracts\Config\Repository
	 */
	private $config;

	/**
	 * @var \Aimeos\Shop\Base\Aimeos
	 */
	private $aimeos;

	/**
	 * @var \Aimeos\Shop\Base\Context
	 */
	private $context;

	/**
	 * @var \Aimeos\Shop\Base\View
	 */
	private $view;

	/**
	 * Initializes the object
	 *
	 * @param \Illuminate\Contracts\Config\Repository $config Configuration object
	 * @param \Aimeos\Shop\Base\Aimeos $aimeos Aimeos object
	 * @param \Aimeos\Shop\Base\Context $context Context object
	 * @param \Aimeos\Shop\Base\View $view View object
	 */
	public function __construct( \Illuminate\Contracts\Config\Repository $config,
		\Aimeos\Shop\Base\Aimeos $aimeos, \Aimeos\Shop\Base\Context $context, \Aimeos\Shop\Base\View $view )
	{
		$this->config = $config;
		$this->aimeos = $aimeos;
		$this->context = $context;
		$this->view = $view;
	}

	/**
	 * Returns the body and header sections created by the clients configured for the given page name.
	 *
	 * @param string $pageName Name of the configured page
	 * @return array Associative list with body and header output separated by client name
	 */
	public function getSections( $pageName )
	{
		$context = $this->context->get();
		$langid = $context->getLocale()->getLanguageId();
		$tmplPaths = $this->aimeos->get()->getCustomPaths( 'client/html' );
		$view = $this->view->create( $context->getConfig(), $tmplPaths, $langid );

		$pagesConfig = $this->config->get( 'shop.page', array() );
		$result = array( 'aibody' => array(), 'aiheader' => array() );

		if( isset( $pagesConfig[$pageName] ) )
		{
			foreach( (array) $pagesConfig[$pageName] as $clientName )
			{
				$client = \Client_Html_Factory::createClient( $context, $tmplPaths, $clientName );
				$client->setView( clone $view );
				$client->process();

				$result['aibody'][$clientName] = $client->getBody();
				$result['aiheader'][$clientName] = $client->getHeader();
			}
		}

		return $result;
	}
}


text:
package org.ovirt.engine.ui.common.gin;

import org.ovirt.engine.ui.common.CommonApplicationConstants;
import org.ovirt.engine.ui.common.CommonApplicationMessages;
import org.ovirt.engine.ui.common.CommonApplicationResources;
import org.ovirt.engine.ui.common.CommonApplicationTemplates;
import org.ovirt.engine.ui.common.auth.CurrentUser;
import org.ovirt.engine.ui.common.auth.LoggedInGatekeeper;
import org.ovirt.engine.ui.common.logging.ClientLogProvider;
import org.ovirt.engine.ui.common.logging.LocalStorageLogHandler;
import org.ovirt.engine.ui.common.restapi.RestApiSessionManager;
import org.ovirt.engine.ui.common.system.ApplicationFocusManager;
import org.ovirt.engine.ui.common.system.AsyncCallFailureHandler;
import org.ovirt.engine.ui.common.system.BrowserHacks;
import org.ovirt.engine.ui.common.system.ClientStorage;
import org.ovirt.engine.ui.common.system.ClientStorageImpl;
import org.ovirt.engine.ui.common.system.ErrorPopupManagerImpl;
import org.ovirt.engine.ui.common.system.LockInteractionManager;
import org.ovirt.engine.ui.common.uicommon.ClientAgentType;
import org.ovirt.engine.ui.common.utils.HttpUtils;
import org.ovirt.engine.ui.common.widget.AlertManager;
import org.ovirt.engine.ui.frontend.AppErrors;
import org.ovirt.engine.ui.frontend.Frontend;
import org.ovirt.engine.ui.frontend.VdsmErrors;
import org.ovirt.engine.ui.frontend.communication.CommunicationProvider;
import org.ovirt.engine.ui.frontend.communication.GWTRPCCommunicationProvider;
import org.ovirt.engine.ui.frontend.communication.OperationProcessor;
import org.ovirt.engine.ui.frontend.communication.SSOTokenChangeEvent;
import org.ovirt.engine.ui.frontend.communication.VdcOperationManager;
import org.ovirt.engine.ui.frontend.communication.XsrfRpcRequestBuilder;
import org.ovirt.engine.ui.frontend.gwtservices.GenericApiGWTService;
import org.ovirt.engine.ui.frontend.gwtservices.GenericApiGWTServiceAsync;
import org.ovirt.engine.ui.uicommonweb.DynamicMessages;
import org.ovirt.engine.ui.uicommonweb.ErrorPopupManager;

import com.google.gwt.core.client.GWT;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.SimpleEventBus;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.Response;
import com.google.gwt.inject.client.AbstractGinModule;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
import com.google.gwt.user.client.rpc.XsrfTokenService;
import com.google.gwt.user.client.rpc.XsrfTokenServiceAsync;
import com.google.inject.Provides;
import com.google.inject.Singleton;
import com.gwtplatform.common.client.CommonGinModule;
import com.gwtplatform.mvp.client.RootPresenter;
import com.gwtplatform.mvp.client.proxy.PlaceManager;
import com.gwtplatform.mvp.shared.proxy.ParameterTokenFormatter;
import com.gwtplatform.mvp.shared.proxy.TokenFormatter;

/**
 * GIN module containing common infrastructure and configuration bindings.
 */
public abstract class BaseSystemModule extends AbstractGinModule {

    protected void bindCommonInfrastructure(Class<? extends PlaceManager> placeManager) {
        install(new CommonGinModule());

        bindEventBus();
        bindFrontendInfrastructure();
        bind(TokenFormatter.class).to(ParameterTokenFormatter.class).in(Singleton.class);
        bind(RootPresenter.class).asEagerSingleton();
        bindTypeAndImplAsSingleton(PlaceManager.class, placeManager);
        bind(CurrentUser.class).in(Singleton.class);
        bind(LoggedInGatekeeper.class).in(Singleton.class);
        bind(ErrorPopupManager.class).to(ErrorPopupManagerImpl.class).in(Singleton.class);
        bind(AsyncCallFailureHandler.class).asEagerSingleton();
        bind(ClientAgentType.class).in(Singleton.class);
        bind(ClientStorage.class).to(ClientStorageImpl.class).in(Singleton.class);
        bind(ApplicationFocusManager.class).asEagerSingleton();
        bind(LockInteractionManager.class).asEagerSingleton();
        bind(AlertManager.class).in(Singleton.class);
        bindTypeAndImplAsSingleton(ClientLogProvider.class, LocalStorageLogHandler.class);
        bind(BrowserHacks.class).asEagerSingleton();
        requestStaticInjection(AssetProvider.class);
    }

    private void bindEventBus() {
        // Bind actual (non-legacy) EventBus to its legacy interface
        bind(com.google.web.bindery.event.shared.EventBus.class).to(com.google.gwt.event.shared.EventBus.class);
        // Bind legacy EventBus interface to SimpleEventBus implementation
        bind(com.google.gwt.event.shared.EventBus.class).to(SimpleEventBus.class).in(Singleton.class);
    }

    private void bindFrontendInfrastructure() {
        bind(Frontend.class).in(Singleton.class);
        requestStaticInjection(Frontend.InstanceHolder.class);
        bind(VdcOperationManager.class).in(Singleton.class);
        bind(OperationProcessor.class).in(Singleton.class);
        bind(CommunicationProvider.class).to(GWTRPCCommunicationProvider.class).in(Singleton.class);
        bind(RestApiSessionManager.class).in(Singleton.class);
    }

    protected void bindResourceConfiguration(
            Class<? extends CommonApplicationConstants> constants,
            Class<? extends CommonApplicationMessages> messages,
            Class<? extends CommonApplicationResources> resources,
            Class<? extends CommonApplicationTemplates> templates,
            Class<? extends DynamicMessages> dynamicMessages) {
        bindTypeAndImplAsSingleton(CommonApplicationConstants.class, constants);
        bindTypeAndImplAsSingleton(CommonApplicationMessages.class, messages);
        bindTypeAndImplAsSingleton(CommonApplicationResources.class, resources);
        bindTypeAndImplAsSingleton(CommonApplicationTemplates.class, templates);
        bindTypeAndImplAsSingleton(DynamicMessages.class, dynamicMessages);
        bind(AppErrors.class).in(Singleton.class);
        bind(VdsmErrors.class).in(Singleton.class);
    }

    /**
     * Binds {@code type} to its {@code impl} so that injecting any of these yields the singleton {@code impl} instance.
     */
    protected <T> void bindTypeAndImplAsSingleton(Class<T> type, Class<? extends T> impl) {
        bind(type).to(impl);
        bind(impl).in(Singleton.class);
    }

    @Provides
    @Singleton
    public GenericApiGWTServiceAsync getGenericApiGWTService(final XsrfRpcRequestBuilder requestBuilder) {
        // no need to use GenericApiGWTServiceAsync.Util as this is GIN-managed singleton anyway
        GenericApiGWTServiceAsync service = GWT.create(GenericApiGWTService.class);
        // cast to ServiceDefTarget and set RPC request builder as needed
        ((ServiceDefTarget) service).setRpcRequestBuilder(requestBuilder);
        return service;
    }

    @Provides
    @Singleton
    public XsrfRpcRequestBuilder getXsrfRequestBuilder(final EventBus eventBus) {
        return new XsrfRpcRequestBuilder() {
            @Override
            protected void doSetCallback(RequestBuilder rb, final RequestCallback callback) {
                rb.setCallback(new RequestCallback() {

                    @Override
                    public void onResponseReceived(Request request, Response response) {
                        String tokenValue = HttpUtils.getHeader(response, "OVIRT-SSO-TOKEN"); //$NON-NLS-1$
                        if (tokenValue != null) {
                            //Login result received.
                            SSOTokenChangeEvent.fire(eventBus, tokenValue);
                        }
                        callback.onResponseReceived(request, response);
                    }

                    @Override
                    public void onError(Request request, Throwable exception) {
                        callback.onError(request, exception);
                    }
                });
            }
        };
    }

    @Provides
    @Singleton
    public XsrfTokenServiceAsync getXsrfTokenService() {
        XsrfTokenServiceAsync service = GWT.create(XsrfTokenService.class);
        ((ServiceDefTarget) service).setServiceEntryPoint(GWT.getModuleBaseURL() + XsrfRpcRequestBuilder.XSRF_PATH);
        return service;
    }
}


text:
//     new_array = []
//     product = 1

//     array.each do |num|
//       product *= num
//       new_array.push(product)
//     end

//     new_array[-1]
//   end
// end

// Pseudocode:

// input: number
// output: number!

// IF number is 0
//   RETURN 1
// ELSE
//   initialize product at 1
//   FOR each integer i from 1 to number
//     multiply product by i and store new product as product
//   RETURN product

// Initial Solution:

// function factorial(num){
//   var product = 1
//   if(num === 0){
//     return product;
//   }
//   else{
//     for(i = 1; i <= num; i++){
//       product *= i;
//     }
//     return product;
//   }
// };

// Refactored:

function factorial(num){
  if(num === 0){
    return 1;
  }
  return num * factorial(num-1)
};

console.log(factorial(5));

// What concepts did you solidify in working on this challenge?
// I solidified recursion as well as some basic Javascript syntax.

// What was the most difficult part of this challenge?
// The most difficult part of this challenge was thinking about it in a new way
// from when I originally did it in Ruby. Before I started, I tried to think of
// how to solve this problem using the same steps and I realized that the first
// time around, I overcomplicated the problem and added a lot more steps than
// necessary. Once I gave up on the original logic, the problem became easier.

// Did you solve the problem in a new way this time?
// Yes. Originally I used arrays to store products and returned the final
// product in the array. This time I just set a product to 1 and iterated
// through a range, each time multiplying the product by the next number in the
// range, and storing the new product as the product. Eventually I found that
// this could also be done with recursion, which I did not even consider during
// the original Ruby challenge. I also found that this challenge took quite a
// long time the first time around, which is why I chose to review it this week.
// This time it took me a fraction of the time, which is reassuring to me that
// my problem-solving process and overall knowledge is improving.

// Was your pseudocode different from the Ruby version? What was the same and
// what was different?
// I don't think I really had pseudocode in the Ruby version, but if I did it
// would have been a lot different. I did not use arrays in this version. The
// only similarity was having an initial product that was set to 1.


text:
package com.jmelzer.myttr.activities;

import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.filters.LargeTest;
import androidx.test.rule.ActivityTestRule;

@RunWith(AndroidJUnit4.class)
@LargeTest
public class CalendarExportIT {

    @Rule
    public ActivityTestRule<CalendarExportActivity> mActivityRule = new ActivityTestRule<>(
            CalendarExportActivity.class);

    @Test
    public void test() {

    }
}


text:
<TITLE>Review for Henry Fool (1997)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Henry Fool (1997)

reviewed by
Dennis Schwartz

HENRY FOOL (director: Hal Hartley; cast: Thomas Jay Ryan, James
Urbaniak, Parker Posey, Maria Porter, Kevin Corrigan, 1998)

I was disappointed in Hartley's most ambitious film to date; I expected
more than what was delivered. The story is interesting enough, about a
passive, sexually repressed garbageman named Grim (Urbaniak), who is
content with his sullen life, and a disheveled drifter named Henry Fool
(Ryan), who we learn later on in the film has been released from prison
for child rape. He is articulate, full of mischievous zest, a scoundrel
passing himself off as an undiscovered writer. He influences Urbaniak to
write down his thoughts every day, and edits his work, and after they
are posted on a local deli's bulletin board, a high school newspaper
prints the poems and Grim gets a cult following. And as Urbaniak starts
to become known through the internet, and eventually wins the Nobel
Prize, Henry recedes to domesticity and obscurity. He also seduces
Urbaniac's nymphomaniac sister (Parker), who manages not to be as funny
as she ordinarily is (this is no fault of hers, the script is not that
funny for her part). He also seduces Parker's mother.

Henry Fool can best be viewed as an allegory of the good-guys
(non-conformist) versus the bad guys (the establishment). For Hartley
aficionados, his comedy is still there in flashes, his trademark drone
conversations and absurd situational humor: a marriage proposal takes
place between Henry and Parker while he is taking a wicked dump, this is
the best and most powerful scene in the film. But the film is boring at
times and belabors its points, and goes on for too long without seeming
to be moving with a spark of credibility or in any one direction; and,
is at best, an uneven attempt to say something serious (which Hartley
should be applauded for). But the film gets bogged down in telling too
many different stories, such as, one of domesticity, neighborhood
values, and the business of getting published.

I wanted to like this film and I thought about why I didn't feel
comfortable viewing it for a long time after seeing the movie, and I
still found that what I got from the film were some chuckles from the
zany characters, but what I was not clear about, was what else I was
supposed to get from this film. It just didn't add up as a work of
drama, it failed to provide a proper tension between plot and character.

REVIEWED ON 9/15/98                                        GRADE: C+

Dennis Schwartz: "Movie Reviews"

ozus@sover.net
 [Image]

http://www.sover.net/~ozus

© ALL RIGHTS RESERVED   DENNIS SCHWARTZ

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

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

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

Broken URLs inthe reviews are the responsibility of the author.

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

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


text:
@implementation MComunitySocialLastAuthorsModel

+ (NSDictionary *)JSONKeyPathsByPropertyKey {

        return @{
                 @"photo60": @"photo60",
                 @"photo160": @"photo160",
                 @"name": @"name",
                 @"photo": @"photo",
                 @"is_expert": @"is_expert",
                 @"mail": @"mail",
                 @"user_id": @"id"
                 };

}

@end

@implementation MComunitySocialModel

+ (NSDictionary *)JSONKeyPathsByPropertyKey {

    return @{
            @"latest_authors": @"latest_authors",
            @"name": @"name",
            @"desc": @"desc"
             };

}

// 模型里面的数组
+ (NSValueTransformer *)latest_authorsJSONTransformer {
    return [MTLJSONAdapter arrayTransformerWithModelClass:[MComunitySocialLastAuthorsModel class]];
}

@end


text:
<?php

namespace Qissues\Domain\Model;

use Qissues\Domain\Shared\Type;
use Qissues\Domain\Shared\User;
use Qissues\Domain\Shared\Status;
use Qissues\Domain\Shared\Priority;
use Qissues\Domain\Shared\Label;

/**
 * Value object for standardizing search criteria for trackers
 */
class SearchCriteria
{
    protected $numbers;
    protected $assigned;
    protected $statuses;
    protected $types;
    protected $priorities;
    protected $labels;
    protected $sortFields;
    protected $paging;

    public function __construct()
    {
        $this->numbers = array();
        $this->assigned = array();
        $this->statuses = array();
        $this->types = array();
        $this->priorities = array();
        $this->labels = array();
        $this->sortFields = array();
        $this->paging = array(1, 50);
        $this->keywords = '';
    }

    public function setKeywords($keywords)
    {
        $this->keywords = $keywords;
    }

    public function getKeywords()
    {
        return $this->keywords;
    }

    public function addStatus(Status $status)
    {
        $this->statuses[] = $status;
    }

    public function getStatuses()
    {
        return $this->statuses;
    }

    public function addPriority(Priority $priority)
    {
        $this->priorities[] = $priority;
    }

    public function getPriorities()
    {
        return $this->priorities;
    }

    public function addType(Type $type)
    {
        $this->types[] = $type;
    }

    public function getTypes()
    {
        return $this->types;
    }

    public function setNumbers(array $numbers)
    {
        $this->numbers = $numbers;
    }

    public function getNumbers()
    {
        return $this->numbers;
    }

    public function addAssignee(User $user)
    {
        $this->assigned[] = $user;
    }

    public function getAssignees()
    {
        return $this->assigned;
    }

    public function addLabel(Label $label)
    {
        $this->labels[] = $label;
    }

    public function getLabels()
    {
        return $this->labels;
    }

    public function addSortField($field)
    {
        $this->sortFields[] = $field;
    }

    public function getSortFields()
    {
        return $this->sortFields;
    }

    public function setPaging($page, $limit)
    {
        $this->paging = array($page, $limit);
    }

    public function getPaging()
    {
        return $this->paging;
    }
}


text:
package org.apache.cassandra.service;

public class PendingRangeCalculatorServiceMBean
{
}


text:
```sh

> git status
On branch estefi
> git checkout master
Switched to branch 'master'
> git pull
...
...
# se copian a mano la carpeta clase4 en otro lado
> git checkout estefi
# copian al repositorio la carpeta clase4
estefi
> git status
estefi

```


text:
function lastStepMeanSpeed = getLastStepMeanSpeed(laneID)
%getLastStepMeanSpeed Get the average speed on the lane.
%   lastStepMeanSpeed = getLastStepMeanSpeed(LANEID) Returns the average
%   speed in m/s for the last time step on the given lane.

%   Copyright 2019 Universidad Nacional de Colombia,
%   Politecnico Jaime Isaza Cadavid.
%   Authors: Andres Acosta, Jairo Espinosa, Jorge Espinosa.
%   $Id: getLastStepMeanSpeed.m 48 2018-12-26 15:35:20Z afacostag $

import traci.constants
lastStepMeanSpeed = traci.lane.getUniversal(constants.LAST_STEP_MEAN_SPEED, laneID);


text:
//
//  spiderActions.h
//  gSpiderMac
//
//  Created by reich on 14/11/9.
//  Copyright (c) 2014年 zhaohu. All rights reserved.
//

#ifndef __gSpiderMac__spiderActions__
#define __gSpiderMac__spiderActions__

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <string>

#include <v8.h>
#include "WZ_HTTPSocket.h"
#include "util.h"

using namespace v8;

extern int gClick_pages;
extern int gCurPage;

namespace gSpider {

    static void add_link_Callback(const v8::FunctionCallbackInfo<v8::Value>& args)
    {

    }

    static void save_Callback(const v8::FunctionCallbackInfo<v8::Value>& args)
    {
        for (int i = 0; i < args.Length(); i++) {

            String::Utf8Value str(args[i]);
            if (args[i]->IsString()) {
                printf("SAVING STRING=====>%s\n", *str);
            }else{
                printf("PRINT (OBJECT) --->%s\n", *str);
            }

        }
        printf("\n");
        fflush(stdout);

    }

    static void log_Callback(const v8::FunctionCallbackInfo<v8::Value>& args)
    {

        bool first = true;
        for (int i = 0; i < args.Length(); i++) {
            if (first) {
                first = false;
            } else {
                printf(" ");
            }
            String::Utf8Value str(args[i]);
            if (args[i]->IsString()) {
                printf("LOG (string) --->%s\n", *str);
            }
            else if (args[i]->IsInt32()){
                int x =  args[i]->Int32Value();
                printf("LOG (int) --> %d\n", x);
            }
            else if (args[i]->IsObject()){
                printf("LOG (Object) --> %s\n", *str);
            }

        }
        printf("\n");
        fflush(stdout);
    }

    static void startLinkPage_call(const v8::FunctionCallbackInfo<v8::Value>& args)
    {
        if (args[0]->IsInt32()) {
            gClick_pages = args[0]->Int32Value();
            gCurPage += 1;
        }
    }

    static void endLinkPage_call(const v8::FunctionCallbackInfo<v8::Value>& args)
    {
        if (gCurPage == gClick_pages) {
            printf("pages end.\n");
        }
    }

    // do the click on element
    //  two args need : gs_CLick(item, deepIndex);
    //  item : document.getElementById('xxx'), the element got
    //  deepIndex : the level of URL, default=0

    static void click_call(const v8::FunctionCallbackInfo<v8::Value>& args)
    {
        // first do the click
    }

}
#endif /* defined(__gSpiderMac__spiderActions__) */


text:
KAI_BEGIN

namespace Memory
{
    /// Commonality for all allocators
    struct BaseAllocator : IAllocator
    {
        typedef char Byte;
        typedef char *BytePtr;

        typename IAllocator::Allocator alloc;
        typename IAllocator::DeAllocator free;

    protected:
        BaseAllocator() : alloc(0), free(0)
        {
        }

    public:
        VoidPtr AllocateBytes(size_t N)
        {
            if (!alloc)
                return 0;
            return alloc(N);
        }
        void DeAllocateBytes(VoidPtr ptr, size_t num_bytes)
        {
            if (!free)
                return;
            free(ptr, num_bytes);
        }
    };
}

KAI_END


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

package com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.FunctionComments;

import com.google.security.zynamics.binnavi.Gui.GraphWindows.CGraphModel;
import com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.InitialTab;
import com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.OKButtonPanel;
import com.google.security.zynamics.binnavi.disassembly.INaviFunctionNode;
import com.google.security.zynamics.zylib.gui.CDialogEscaper;

import java.awt.BorderLayout;
import java.awt.Dimension;

import javax.swing.JDialog;

/**
 * Dialog used for editing the comments of a function node.
 */
public final class CDialogEditFunctionNodeComment extends JDialog {

  /**
   * Panel where local and global comments can be edited.
   */
  private final CFunctionCommentsPanel m_commentsPanel;

  /**
   * Creates a new dialog object.
   *
   * @param node Node whose comments are edited.
   * @param initialTab The initially visible tab.
   */
  public CDialogEditFunctionNodeComment(
      final CGraphModel model, final INaviFunctionNode node, final InitialTab initialTab) {
    super(model.getParent(), "Edit Function Node Comments", true);

    new CDialogEscaper(this);
    setLayout(new BorderLayout());
    m_commentsPanel = new CFunctionCommentsPanel(node.getFunction(), node);
    add(m_commentsPanel, BorderLayout.CENTER);
    add(new OKButtonPanel(this), BorderLayout.SOUTH);
    final Dimension dim = getPreferredSize();
    if (dim.height < 300) {
      dim.height = 300;
    }
    dim.width = 600;

    setPreferredSize(dim);
    setMinimumSize(dim);
    pack();

    if (initialTab == InitialTab.GlobalNodeComments) {
      m_commentsPanel.focusGlobalField();
    } else {
      m_commentsPanel.focusLocalField();
    }
  }
}


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
null

#### Original name
Lupinus glareosus Elmer

### Remarks
null


text:
package com.example.dynamicproxy;

import java.io.FileOutputStream;
import java.io.IOException;

import sun.misc.ProxyGenerator;

/**
 * @author VanceKing
 * @since 2017/6/13.
 */

public class ProxyUtil {
    /**
     * Save proxy class to path.<br/>
     * https://github.com/android-cn/android-open-project-demo/blob/master/java-dynamic-proxy/src/com/codekk/java/test/dynamicproxy/util/ProxyUtils.java
     *
     * @param path           path to save proxy class
     * @param proxyClassName name of proxy class
     * @param interfaces     interfaces of proxy class
     */
    public static boolean saveProxyClass(String path, String proxyClassName, Class[] interfaces) {
        if (proxyClassName == null || path == null) {
            return false;
        }

        // get byte of proxy class
        byte[] classFile = ProxyGenerator.generateProxyClass(proxyClassName, interfaces);
        FileOutputStream out = null;
        try {
            out = new FileOutputStream(path);
            out.write(classFile);
            out.flush();
            return true;
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if (out != null) {
                    out.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return false;
    }
}


text:
'use strict';

/**
 * @ngdoc directive
 * @name chusrodriguezApp.directive:imageField
 * @description
 * # imageField
 */
angular.module('chusrodriguezApp')
  .directive('imageField', ['Admin', 'Upload', '$rootScope', function (Admin, Upload, $rootScope) {
    return {
      templateUrl: 'views/admin/image-field.html',
      restrict: 'E',
      replace: true,
      link: function postLink(scope, element, attrs) {

        function init() {
          if(!scope.value.text) {
            scope.value.text = '';
            scope.images = [];
          }
          else {
            scope.images = scope.value.text.split(',');
          }
        }

        if(scope.entity.$resolved === false) {
          scope.$watch('entity.$resolved', function(newVal) {
            if(newVal) {
              init();
            }
          })
        }
        else {
          init()
        }

        scope.ready = true;
        scope.uploading = false;
        scope.process = '';

        scope.upload = function (file) {
          if(!file.length) return;
          scope.ready = false;
          scope.uploading = true;

      		var url = '/admin/photos/upload';
      		Upload.upload({
	        	url: url,
	        	data: {
	        	  file: file
	        	}
	        }).then(function (resp) {
	            scope.uploading = false;
	            scope.ready = true;

	            scope.images.push(resp.data);
	            scope.value.text = scope.images.map(function(item) { return item.trim() } ).join(',');

	        }, function (resp) {
	            console.log('Error status: ' + resp.status);
	        }, function (evt) {
	            var progressPercentage = parseInt(100.0 * evt.loaded / evt.total);
	            scope.process = 'Cargando: ' + progressPercentage + '%';
    		});

        scope.selectedPicture = null
    		scope.setSelectedPicture = function(picture) {
          scope.selectedPicture = picture;
    		};

    		scope.setDefaultPicture = function() {
          scope.entity.image_url = scope.selectedPicture;
        };

        scope.deleteSelectedPicture = function() {
          $rootScope.operations.confirm('Por favor confirma', '¿Realmente deseas borrar esta foto?', function(data) {

            scope.images.splice(scope.value.text.indexOf(scope.selectedPicture), 1);
            scope.value.text = scope.images.map(function(item) { return item.trim() } ).join(',');
            scope.selectedPicture = null;
            // TODO Delete from S3

          })
        };
    	};
      }
    };
  }]);


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

    <style name="SwipeBackLayout">
        <item name="edge_size">30dip</item>
        <item name="shadow_left">@drawable/shadow_left</item>
        <item name="shadow_right">@drawable/shadow_right</item>
        <item name="shadow_bottom">@drawable/shadow_bottom</item>
    </style>

</resources>


text:
class AddRequestingGeoToLoginSessions < ActiveRecord::Migration
  def change
    add_column :nopassword_login_sessions, :requesting_geo, :string

  end
end


text: require 'mattock/yard_extensions'


text:
package com.angkorteam.pluggable.framework.jdbc;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.sql.DataSource;

import org.springframework.jdbc.core.SqlTypeValue;
import org.springframework.jdbc.core.metadata.TableMetaDataProvider;
import org.springframework.jdbc.core.metadata.TableMetaDataProviderFactory;
import org.springframework.jdbc.core.metadata.TableParameterMetaData;
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
import org.springframework.jdbc.core.namedparam.SqlParameterSourceUtils;
import org.springframework.jdbc.support.JdbcUtils;
import org.springframework.jdbc.support.nativejdbc.NativeJdbcExtractor;

public class TableMetaDataContext {

	/** name of procedure to call **/
	private String tableName;

	/** name of catalog for call **/
	private String catalogName;

	/** name of schema for call **/
	private String schemaName;

	/** should we access insert parameter meta data info or not */
	private boolean accessTableColumnMetaData = true;

	/** should we override default for including synonyms for meta data lookups */
	private boolean overrideIncludeSynonymsDefault = false;

	/** the provider of table meta data */
	private TableMetaDataProvider metaDataProvider;

	/** NativeJdbcExtractor to be used to retrieve the native connection */
	private NativeJdbcExtractor nativeJdbcExtractor;

	/**
	 * Set the name of the table for this context.
	 */
	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	/**
	 * Get the name of the table for this context.
	 */
	public String getTableName() {
		return this.tableName;
	}

	/**
	 * Set the name of the catalog for this context.
	 */
	public void setCatalogName(String catalogName) {
		this.catalogName = catalogName;
	}

	/**
	 * Get the name of the catalog for this context.
	 */
	public String getCatalogName() {
		return this.catalogName;
	}

	/**
	 * Set the name of the schema for this context.
	 */
	public void setSchemaName(String schemaName) {
		this.schemaName = schemaName;
	}

	/**
	 * Get the name of the schema for this context.
	 */
	public String getSchemaName() {
		return this.schemaName;
	}

	/**
	 * Specify whether we should access table column meta data.
	 */
	public void setAccessTableColumnMetaData(boolean accessTableColumnMetaData) {
		this.accessTableColumnMetaData = accessTableColumnMetaData;
	}

	/**
	 * Are we accessing table meta data?
	 */
	public boolean isAccessTableColumnMetaData() {
		return this.accessTableColumnMetaData;
	}

	/**
	 * Specify whether we should override default for accessing synonyms.
	 */
	public void setOverrideIncludeSynonymsDefault(boolean override) {
		this.overrideIncludeSynonymsDefault = override;
	}

	/**
	 * Are we overriding include synonyms default?
	 */
	public boolean isOverrideIncludeSynonymsDefault() {
		return this.overrideIncludeSynonymsDefault;
	}

	/**
	 * Does this database support the JDBC 3.0 feature of retrieving generated
	 * keys {@link java.sql.DatabaseMetaData#supportsGetGeneratedKeys()}?
	 */
	public boolean isGetGeneratedKeysSupported() {
		return this.metaDataProvider.isGetGeneratedKeysSupported();
	}

	/**
	 * Does this database support simple query to retrieve generated keys when
	 * the JDBC 3.0 feature is not supported.
	 * {@link java.sql.DatabaseMetaData#supportsGetGeneratedKeys()}?
	 */
	public boolean isGetGeneratedKeysSimulated() {
		return this.metaDataProvider.isGetGeneratedKeysSimulated();
	}

	/**
	 * Does this database support simple query to retrieve generated keys when
	 * the JDBC 3.0 feature is not supported.
	 * {@link java.sql.DatabaseMetaData#supportsGetGeneratedKeys()}?
	 */
	public String getSimulationQueryForGetGeneratedKey(String tableName,
			String keyColumnName) {
		return this.metaDataProvider.getSimpleQueryForGetGeneratedKey(
				tableName, keyColumnName);
	}

	/**
	 * Is a column name String array for retrieving generated keys supported?
	 * {@link java.sql.Connection#createStruct(String, Object[])}?
	 */
	public boolean isGeneratedKeysColumnNameArraySupported() {
		return this.metaDataProvider.isGeneratedKeysColumnNameArraySupported();
	}

	/**
	 * Set {@link NativeJdbcExtractor} to be used to retrieve the native
	 * connection.
	 */
	public void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor) {
		this.nativeJdbcExtractor = nativeJdbcExtractor;
	}

	/**
	 * Process the current meta data with the provided configuration options.
	 *
	 * @param dataSource
	 *            the DataSource being used
	 * @param declaredColumns
	 *            any columns that are declared
	 * @param generatedKeyNames
	 *            name of generated keys
	 */
	public void processMetaData(DataSource dataSource) {
		// TODO: comment to explain this HORRIBLE thing!
		org.springframework.jdbc.core.metadata.TableMetaDataContext underlyingTableMetaDataContext = new org.springframework.jdbc.core.metadata.TableMetaDataContext();
		underlyingTableMetaDataContext
				.setAccessTableColumnMetaData(accessTableColumnMetaData);
		underlyingTableMetaDataContext.setCatalogName(catalogName);
		underlyingTableMetaDataContext
				.setNativeJdbcExtractor(nativeJdbcExtractor);
		underlyingTableMetaDataContext
				.setOverrideIncludeSynonymsDefault(overrideIncludeSynonymsDefault);
		underlyingTableMetaDataContext.setSchemaName(schemaName);
		underlyingTableMetaDataContext.setTableName(tableName);

		this.metaDataProvider = TableMetaDataProviderFactory
				.createMetaDataProvider(dataSource,
						underlyingTableMetaDataContext, nativeJdbcExtractor);
	}

	/**
	 * Compare columns created from metadata with declared columns and return a
	 * reconciled list.
	 *
	 * @param declaredColumns
	 *            declared column names
	 * @param generatedKeyNames
	 *            names of generated key columns
	 */
	protected List<String> reconcileColumnsToUse(List<String> declaredColumns,
			String[] generatedKeyNames) {
		if (declaredColumns.size() > 0) {
			return new ArrayList<String>(declaredColumns);
		}
		Set<String> keys = new HashSet<String>(generatedKeyNames.length);
		for (String key : generatedKeyNames) {
			keys.add(key.toUpperCase());
		}
		List<String> columns = new ArrayList<String>();
		for (TableParameterMetaData meta : metaDataProvider
				.getTableParameterMetaData()) {
			if (!keys.contains(meta.getParameterName().toUpperCase())) {
				columns.add(meta.getParameterName());
			}
		}
		return columns;
	}

	/**
	 * Match the provided column names and values with the list of columns used.
	 *
	 * @param sqlParameterSource
	 *            the parameter names and values
	 * @param reconciledUpdatingColumns
	 */
	public List<Object> sortAndTypeInParameter(
			SqlParameterSource sqlParameterSource,
			List<String> reconciledUpdatingColumns) {
		List<Object> values = new ArrayList<Object>();
		// for parameter source lookups we need to provide caseinsensitive
		// lookup support since the
		// database metadata is not necessarily providing case sensitive column
		// names
		Map<?, ?> caseInsensitiveParameterNames = SqlParameterSourceUtils
				.extractCaseInsensitiveParameterNames(sqlParameterSource);
		for (String column : reconciledUpdatingColumns) {
			if (sqlParameterSource.hasValue(column)) {
				values.add(SqlParameterSourceUtils.getTypedValue(
						sqlParameterSource, column));
			} else {
				String lowerCaseName = column.toLowerCase();
				if (sqlParameterSource.hasValue(lowerCaseName)) {
					values.add(SqlParameterSourceUtils.getTypedValue(
							sqlParameterSource, lowerCaseName));
				} else {
					String propertyName = JdbcUtils
							.convertUnderscoreNameToPropertyName(column);
					if (sqlParameterSource.hasValue(propertyName)) {
						values.add(SqlParameterSourceUtils.getTypedValue(
								sqlParameterSource, propertyName));
					} else {
						if (caseInsensitiveParameterNames
								.containsKey(lowerCaseName)) {
							values.add(SqlParameterSourceUtils.getTypedValue(
									sqlParameterSource,
									(String) caseInsensitiveParameterNames
											.get(lowerCaseName)));
						} else {
							values.add(null);
						}
					}
				}
			}
		}
		return values;
	}

	/**
	 * Match the provided column names and values with the list of columns used.
	 *
	 * @param inParameters
	 *            the parameter names and values
	 */
	public List<Object> sortAndTypeInParameter(
			Map<String, Object> inParameters,
			List<String> reconciledUpdatingColumns) {
		List<Object> values = new ArrayList<Object>();
		Map<String, Object> source = new HashMap<String, Object>();
		for (String key : inParameters.keySet()) {
			source.put(key.toLowerCase(), inParameters.get(key));
		}
		for (String column : reconciledUpdatingColumns) {
			values.add(source.get(column.toLowerCase()));
		}
		return values;
	}

	public List<String> createColumns() {
		List<TableParameterMetaData> tableParameterMetaDataList = this.metaDataProvider
				.getTableParameterMetaData();
		List<String> columnList = new ArrayList<String>(
				tableParameterMetaDataList.size());
		for (TableParameterMetaData tableParameterMetaData : tableParameterMetaDataList) {
			columnList.add(tableParameterMetaData.getParameterName());
		}
		return columnList;
	}

	/**
	 * Build the array of {@link java.sql.Types} based on configuration and
	 * metadata information
	 *
	 * @return the array of types to be used
	 */
	public int[] createColumnTypes(List<String> columns) {
		int[] types = new int[columns.size()];
		List<TableParameterMetaData> parameters = this.metaDataProvider
				.getTableParameterMetaData();
		Map<String, TableParameterMetaData> parameterMap = new HashMap<String, TableParameterMetaData>(
				parameters.size());
		for (TableParameterMetaData tpmd : parameters) {
			parameterMap.put(tpmd.getParameterName().toUpperCase(), tpmd);
		}
		int typeIndx = 0;
		for (String column : columns) {
			if (column == null) {
				types[typeIndx] = SqlTypeValue.TYPE_UNKNOWN;
			} else {
				TableParameterMetaData tpmd = parameterMap.get(column
						.toUpperCase());
				if (tpmd != null) {
					types[typeIndx] = tpmd.getSqlType();
				} else {
					types[typeIndx] = SqlTypeValue.TYPE_UNKNOWN;
				}
			}
			typeIndx++;
		}
		return types;
	}

}


text:
/**
 * Guise.
 *
 * @param {Function}
 * @return {Function}
 * @api public
 */

module.exports = function() {
	var args = arguments;
	return function() {
		var results = args[0].apply(null, arguments);
		for(var i = 1, l = args.length; i < l; i++) {
			results = args[i](results);
		}
		return results;
	};
};


text:
var roleHealer = require('role.healer');
var roleHarvester = require('role.harvester');

var roleBuilder = {

	/** @param {Creep} creep **/
	run: function(creep) {

		if (creep.memory.harvesting) {
			var sources = creep.room.find(FIND_SOURCES);
			var energy = creep.pos.findInRange(FIND_DROPPED_ENERGY, 3);
			var storage = creep.room.find(FIND_STRUCTURES, {
				filter: (structure) => {
					return (
								((structure.structureType == STRUCTURE_CONTAINER) &&
								 (structure.store[RESOURCE_ENERGY] > 0)) ||
							 (((structure.structureType == STRUCTURE_EXTENSION)||
								 (structure.structureType == STRUCTURE_SPAWN)) &&
								 (Game.spawns.Spawn1.room.energyAvailable > 550)));
				}
			});

			if (energy.length) {
				creep.pickup(energy[0]);
			}
			if (storage.length > 0) {
				var target = creep.pos.findClosestByRange(storage);

				if (!(creep.pos.isNearTo(target))) {
					creep.moveTo(target);
				}
				else {
					creep.withdraw(target, RESOURCE_ENERGY,
												(creep.carryCapacity - _.sum(creep.carry)));
				}
			}
			else {
				for (source in sources) {
					if (_.filter(Game.creeps, (creep) =>
											(creep.memory.sourceId == source.id)
					).length < 4) {
						creep.memory.sourceId = source.id;
					}
				}
				if (creep.harvest(
						Game.getObjectById(creep.memory.sourceId)) == ERR_NOT_IN_RANGE) {
					creep.moveTo(Game.getObjectById(creep.memory.sourceId));
				}
			}
			if (creep.carry.energy == creep.carryCapacity) {
					creep.say('Building');
			    creep.memory.harvesting = false;
			}
		}
		else {
		  var targets = creep.room.find(FIND_CONSTRUCTION_SITES, {
		  	filter: (structure) => {
		  		return (!(structure.structureType == STRUCTURE_CONTAINER));
		  	}
		  });

			if (targets.length) {
				var target = creep.pos.findClosestByRange(targets);
				if (creep.build(target) == ERR_NOT_IN_RANGE) {
					creep.moveTo(target);
				}
				if (creep.carry.energy == 0) {
					creep.say('Harvesting');
					creep.memory.harvesting = true;
				}
			}
			else {
					roleHealer.run(creep);
			}
		}

	} // function

}; // roleBuilder

module.exports = roleBuilder;


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics;
using System.Reflection;
using Ilaro.Admin.Core.DataAnnotations;
using Ilaro.Admin.Core.Extensions;
using Resources;

namespace Ilaro.Admin.Core
{
    [DebuggerDisplay("Property {Name}")]
    public class Property
    {
        public Entity Entity { get; private set; }

        public PropertyInfo PropertyInfo { get; internal set; }

        public string Name { get; internal set; }

        private string _column;
        public string Column
        {
            get { return _column; }
            internal set
            {
                if (value.StartsWith("[") && value.EndsWith("]"))
                    _column = value;
                else
                    _column = "[" + value + "]";
            }
        }

        public string Display { get; internal set; }

        public string Group { get; internal set; }

        public string Description { get; internal set; }

        public string Prompt { get; internal set; }

        public string Format { get; internal set; }

        /// <summary>
        /// If property is a entity key.
        /// </summary>
        public bool IsKey { get; internal set; }

        public bool IsAutoKey
        {
            get
            {
                return IsKey &&
                  TypeInfo.DataType != DataType.Text &&
                  (IsForeignKey == false && TypeInfo.IsCollection == false);
            }
        }

        public bool IsVisible { get; internal set; }

        public bool IsSearchable { get; internal set; }

        /// <summary>
        /// Is property is a foreign key.
        /// </summary>
        public bool IsForeignKey { get; internal set; }
        public Entity ForeignEntity { get; internal set; }
        public string ForeignEntityName { get; internal set; }
        public Property ReferenceProperty { get; internal set; }
        public string ReferencePropertyName { get; internal set; }

        public bool IsRequired { get; internal set; }

        public CascadeOption CascadeOption { get; internal set; }
        public FileOptions FileOptions { get; internal set; } = new FileOptions();
        public PropertyTemplate Template { get; internal set; } = new PropertyTemplate();
        public PropertyTypeInfo TypeInfo { get; private set; }

        public IList<ValidationAttribute> Validators { get; internal set; } = new List<ValidationAttribute>();

        public IDictionary<string, object> ControlsAttributes { get; set; }
        public string ForeignKeyName { get; private set; }
        public object OnCreateDefaultValue { get; internal set; }
        public object OnUpdateDefaultValue { get; internal set; }
        public object OnDeleteDefaultValue { get; internal set; }

        public bool IsCreatable { get; internal set; } = true;
        public bool IsTimestamp { get; internal set; }
        public bool IsConcurrencyCheck { get; internal set; }
        public OrderType? DefaultOrder { get; internal set; }
        public object DefaultFilter { get; internal set; }
        public bool IsFilterable { get; internal set; }
        public bool IsManyToMany { get; internal set; }

        public Property(Entity entity, PropertyInfo property)
        {
            if (property == null)
                throw new ArgumentNullException(nameof(property));
            if (entity == null)
                throw new ArgumentNullException(nameof(entity));

            Entity = entity;
            PropertyInfo = property;

            Name = property.Name;
            Column = property.Name;
            ControlsAttributes = new Dictionary<string, object>();

            TypeInfo = new PropertyTypeInfo(property.PropertyType);

            if (TypeInfo.DataType == DataType.Numeric)
            {
                if (TypeInfo.IsFloatingPoint)
                {
                    ControlsAttributes.Add("data-number-number-of-decimals", "4");
                }
                if (TypeInfo.IsNullable)
                {
                    ControlsAttributes.Add("data-number-value", "");
                }
            }

            SetForeignKey();

            Display = Name.SplitCamelCase();
        }

        internal void SetForeignKey(string foreignKeyName)
        {
            ForeignKeyName = foreignKeyName;
            if (ForeignKeyName.IsNullOrEmpty() == false)
            {
                IsForeignKey = true;

                if (TypeInfo.IsSystemType)
                {
                    ForeignEntityName = ForeignKeyName;
                }
                else
                {
                    ReferencePropertyName = Column = ForeignKeyName;
                    ForeignEntityName = TypeInfo.OriginalType.Name;
                }
            }
        }

        private void SetForeignKey()
        {
            if (TypeInfo.IsSystemType || TypeInfo.IsEnum)
            {
                IsForeignKey = false;
            }
            else
            {
                IsForeignKey = true;
                ForeignEntityName = TypeInfo.OriginalType.Name;
            }
        }
    }
}


text:
/*
 * An agent which sends messages.
 */
#include <iostream>

#include "a_bench_sender.hpp"
#include "a_bench_receiver.hpp"

void
a_bench_sender_t::so_define_agent()
{
	so_subscribe( m_arbiter_mbox )
		.event( &a_bench_sender_t::evt_generate_pack );

	so_subscribe( m_self_mbox )
		.event( &a_bench_sender_t::evt_generate_pack );
}

void
a_bench_sender_t::evt_generate_pack(
	const so_5::rt::event_data_t< msg_bench_start > & msg )
{
	const unsigned int curr_pack_size =
		m_packs_size[ m_iteration_count % m_packs_size.size() ];
	++m_iteration_count;

	for( int i = 0;
		i < curr_pack_size && m_sent_message_count < m_message_count;
		++i, ++m_sent_message_count )
	{
		m_target_mbox->deliver_message(
				new msg_some_message( m_sent_message_count ) );
	}

	if( m_sent_message_count < m_message_count )
	{
		// Not all messages sent. We should reinitiate youself.
		m_self_mbox->deliver_signal< msg_bench_start >();
	}
	else
	{
		// All messages send. We should finish work.
		m_target_mbox->deliver_signal< msg_finish_work >();
	}
}


text:
require 'mocha/single_return_value'

module Mocha # :nodoc:

  class ReturnValues # :nodoc:

    def self.build(*values)
      new(*values.map { |value| SingleReturnValue.new(value) })
    end

    attr_accessor :values

    def initialize(*values)
      @values = values
    end

    def next
      case @values.length
        when 0 then nil
        when 1 then @values.first.evaluate
        else @values.shift.evaluate
      end
    end

    def +(other)
      self.class.new(*(@values + other.values))
    end

  end

end


text:
body ul.cm_blue, body ul.cm_blue ul
{
	/* Required settings */
	top:-1000px; left:-1000px; position:absolute; z-index:999;
	/* Possibly inherited values overrides */
	border-width:0;  float:none; background-color:#d7e1eb; background-image:none; height:auto; margin:0; padding:0; width:auto;
	/* Additional settings */
	border-bottom:solid 1px #235a8b
}
body ul.cm_blue li
{
	/* Required settings */
	width:200px; list-style:none none outside;
	/* Possibly inherited values overrides */
	background-color:#d7e1eb; background-image:none; float:none; height:auto; letter-spacing:normal; margin:0;
	line-height:normal; margin:0; text-align:left; text-decoration:none; text-indent:0; text-transform:none; vertical-align:top;
	word-spacing:normal; font-family:Arial, Sans-Serif; font-size:13px; font-style:normal; font-variant:normal; font-weight:normal;
	/* Additional settings */
	overflow:hidden; cursor:default; padding:5px;
	color:#235a8b; border:solid 1px #235a8b; border-bottom-width:0
}
body ul.cm_blue li span.submenu{display:block; width:4px; height:12px; float:right; background:url(images/submenu.gif) no-repeat 0 5px}
body ul.cm_blue li.hover{background-color:#a4c5e9}


text:
package main

import (
	randbytes "crypto/rand"
	"crypto/sha256"
	"crypto/sha512"
	"flag"
	"github.com/Randomsock5/Randomsocks5/cipherConn"
	"github.com/Randomsock5/Randomsocks5/tool"
	"github.com/codahale/chacha20"
	"golang.org/x/crypto/poly1305"
	"io"
	"io/ioutil"
	"log"
	"net"
	"net/http"
	"os"
	"strconv"
	"strings"
	"time"
)

var (
	server   string
	sport    int
	local    string
	lport    int
	passwd   string
	pac_port int
	pac_file string
)

func init() {
	flag.StringVar(&server, "server", ConnDefaultServerAddr, "Set server addr")
	flag.IntVar(&sport, "sport", ConnDefaultServerPort, "Set server port")
	flag.StringVar(&local, "local", ConnDefaultLocalAddr, "Set local addr")
	flag.IntVar(&lport, "lport", ConnDefaultLocalPort, "Set local port")
	flag.StringVar(&pac_file, "pac", DefaultPACFilePath, "Set pac path")
	flag.IntVar(&pac_port, "pac_port", ConnDefaultPACPort, "Set pac port")
	flag.StringVar(&passwd, "passwd", DefaultPasswd, "Set passwd")
}

func main() {
	flag.Parse()

	//PAC
	if exist(pac_file) {
		b, err := ioutil.ReadFile(pac_file)
		if err != nil {
			log.Println("Can not read file: " + pac_file)
			os.Exit(1)
		}

		s := string(b[:])
		s = strings.Replace(s, ReplaceFlag, "SOCKS5 "+local+":"+strconv.Itoa(lport)+";", 1)

		mux := http.NewServeMux()
		mux.HandleFunc("/pac", func(w http.ResponseWriter, r *http.Request) {
			io.WriteString(w, s)
		})
		go http.ListenAndServe(":"+strconv.Itoa(pac_port), mux)

		log.Println("pac uri: http://127.0.0.1" + ":" + strconv.Itoa(pac_port) + "/pac")
	} else {
		log.Println("Can not find file: " + pac_file)
		os.Exit(1)
	}

	//Proxy
	l, err := net.Listen(ConnDefaultType, local+":"+strconv.Itoa(lport))
	if err != nil {
		log.Println("Error listening: ", err)
		os.Exit(1)
	}
	defer l.Close()

	for {
		// Listen for an incoming connection.
		conn, err := l.Accept()
		if err != nil {
			log.Println("Error accepting:  ", err)
			continue
		}
		go handleRequest(conn)
	}
}

func handleRequest(conn net.Conn) {
	timeCookie := tool.GetTimeCookie()
	initKey := sha256.Sum256([]byte(passwd + timeCookie))
	nonce := sha512.Sum512([]byte(timeCookie + passwd))

	es, err := chacha20.NewXChaCha(initKey[:], nonce[:XNonceSize])
	ds, err := chacha20.NewXChaCha(initKey[:], nonce[:XNonceSize])
	if err != nil {
		log.Println("Error chacha20 init:  ", err)
		return
	}

	pconn, err := net.Dial("tcp", server+":"+strconv.Itoa(sport))
	if err != nil {
		log.Println("Create connection failed :", err)
		return
	}
	cconn := cipherConn.NewCipherConn(ds,es,pconn)
	defer cconn.Close()

	randomDataLen, _ := tool.ReadInt(initKey[len(initKey)-2:])
	if randomDataLen < 32767 {
		randomDataLen = randomDataLen + 2984
	}

	randomData := make([]byte, randomDataLen+poly1305.TagSize)
	randbytes.Read(randomData)

	var mac [poly1305.TagSize]byte
	poly1305.Sum(&mac, randomData[:randomDataLen], &initKey)
	copy(randomData[randomDataLen:], mac[:])

	// Start proxying
	finish := make(chan bool,4)

	// write random data head
	_ , err = cconn.Write(randomData)
	if err != nil {
		log.Println("Connection write failed :", err)
		return
	}

	go proxy(cconn,conn,finish)
	go proxy(conn,cconn,finish)

	// Wait
	select{
	case <- finish:
	}

	time.Sleep(2*time.Second)
}

func proxy(dst net.Conn, src net.Conn, finish chan bool) {
	io.Copy(dst,src)
	time.Sleep(time.Second)
	finish <- true
}

func exist(filepath string) bool {
	_, err := os.Stat(filepath)
	return err == nil || os.IsExist(err)
}


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _reactDom = require('react-dom');

var _reactDom2 = _interopRequireDefault(_reactDom);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var Audio = _react2.default.createClass({
  displayName: 'Audio',
  play: function play() {
    _reactDom2.default.findDOMNode(this).play();
  },
  pause: function pause() {
    _reactDom2.default.findDOMNode(this).pause();
  },
  getDefaultProps: function getDefaultProps() {
    return {
      autoPlay: false,
      controls: false,
      loop: false,
      preload: 'metadata'
    };
  },
  componentWillMount: function componentWillMount() {
    this.props.onMount();
  },
  componentDidMount: function componentDidMount() {
    var audio = _reactDom2.default.findDOMNode(this);
    var _props = this.props,
        onEnded = _props.onEnded,
        onPause = _props.onPause,
        onPlaying = _props.onPlaying;

    audio.addEventListener('ended', onEnded);
    audio.addEventListener('pause', onPause);
    audio.addEventListener('playing', onPlaying);
  },
  componentWillUnmount: function componentWillUnmount() {
    var audio = _reactDom2.default.findDOMNode(this);
    var _props2 = this.props,
        onEnded = _props2.onEnded,
        onPause = _props2.onPause,
        onPlaying = _props2.onPlaying,
        onUnmount = _props2.onUnmount;

    audio.removeEventListener('ended', onEnded);
    audio.removeEventListener('pause', onPause);
    audio.removeEventListener('playing', onPlaying);
    onUnmount();
  },
  componentDidUpdate: function componentDidUpdate(prevProps) {
    if (this.props.command !== 'none' && this.props.command !== prevProps.command) {
      this[this.props.command]();
      this.props.onCommand(this.props.command);
    }
  },
  render: function render() {
    var _props3 = this.props,
        autoPlay = _props3.autoPlay,
        controls = _props3.controls,
        loop = _props3.loop,
        preload = _props3.preload,
        src = _props3.src;

    return _react2.default.createElement('audio', {
      autoPlay: autoPlay,
      controls: controls,
      loop: loop,
      preload: preload,
      src: src
    });
  },

  propTypes: {
    autoPlay: _react.PropTypes.bool,
    command: _react.PropTypes.oneOf(['play', 'pause', 'none']).isRequired,
    controls: _react.PropTypes.bool,
    loop: _react.PropTypes.bool,
    onEnded: _react.PropTypes.func.isRequired,
    onMount: _react.PropTypes.func.isRequired,
    onPause: _react.PropTypes.func.isRequired,
    onPlaying: _react.PropTypes.func.isRequired,
    onUnmount: _react.PropTypes.func.isRequired,
    onCommand: _react.PropTypes.func.isRequired,
    preload: _react.PropTypes.oneOf(['none', 'metadata', 'auto']),
    src: _react.PropTypes.string.isRequired,
    uniqueId: _react.PropTypes.string.isRequired
  }
});

exports.default = Audio;


text:
var _ = require('underscore');
var FormView = require('./__FormView'),
	$ = require('jquery'),
	Backbone = require('backbone'),
    departmentTpl = require('../templates/_entityDepartment.tpl');
var config = require('../conf');

Backbone.$ = $;

//** 模型
var Department = Backbone.Model.extend({
	idAttribute: '_id',
	urlRoot: config.api.host + '/protect/departments',

	validation: {
		name: {
			required : true,
			msg: '请输入渠道名称'
		},
	},
});

//** 主视图
exports = module.exports = FormView.extend({

	el: '#departmentForm',

	modelFilled: false,

	initialize: function(options) {
		this.router = options.router;
		this.model = new Department({_id: options.id});
		var page = $(departmentTpl);
		var editTemplate = $('#editTemplate', page).html();
		this.template = _.template(_.unescape(editTemplate || ''));
		FormView.prototype.initialize.apply(this, options);
	},

	events: {
		'keyup input[type=text]': 'inputText',
		'keyup input[name=path]': 'getDepartments',
		'click .department': 'selectDepartment',
		'submit form': 'submit',
		'click .back': 'cancel',
	},

	load: function(){
		if(this.model.isNew()){
			this.modelFilled = true;
			return;
		}
		this.model.fetch({
			xhrFields: {
				withCredentials: true
			},
		});
	},

	inputText: function(evt){
		var that = this;
		//clear error
		this.$(evt.currentTarget).parent().removeClass('has-error');
		this.$(evt.currentTarget).parent().find('span.help-block').empty();
		var arr = this.$(evt.currentTarget).serializeArray();
		_.each(arr,function(obj){
			var error = that.model.preValidate(obj.name,obj.value);
			if(error){
				//set error
				this.$(evt.currentTarget).parent().addClass('has-error');
				this.$(evt.currentTarget).parent().find('span.help-block').text(error);
			}
		})
		return false;
	},

	getDepartments: function(evt){
		this.$('#departments').empty();
		var that = this;
		var searchStr = this.$(evt.currentTarget).val() || '';
		if(searchStr.length >1){
			$.ajax({
				url: config.api.host + '/protect/departments?type=search&searchStr=' + searchStr,
				type: 'GET',
				xhrFields: {
					withCredentials: true
				},
			}).done(function(data){
				data = data || [];
				var departmentsView = '
';
				data.forEach(function(item){
					departmentsView += '
' + item.path + '
';
				});
				departmentsView += '
';
				that.$('#departments').html(departmentsView);
			});
		}
		return false;
	},

	selectDepartment: function(evt){
		var id = this.$(evt.currentTarget).attr('id');
		var path = this.$(evt.currentTarget).text();
		this.$('input[name=parent]').val(id);
		this.$('input[name=path]').val(path);
		this.$('#departments').empty();
		return false;
	},

	submit: function() {
		var that = this;
		//clear errors
		this.$('.form-group').removeClass('has-error');
		this.$('.form-group').find('span.help-block').empty();
		var arr = this.$('form').serializeArray();
		var errors = [];
		_.each(arr,function(obj){
			var error = that.model.preValidate(obj.name,obj.value);
			if(error){
				errors.push(error);
				that.$('[name="' + obj.name + '"]').parent().addClass('has-error');
				that.$('[name="' + obj.name + '"]').parent().find('span.help-block').text(error);
			}
		});
		if(!_.isEmpty(errors)) return false;
		//validate finished.

		var object = this.$('form').serializeJSON();
		this.model.set(object);
		// console.log(this.model.attributes);
		this.model.save(null, {
			xhrFields: {
				withCredentials: true
			},
		});
		return false;
	},

	cancel: function(){
		this.router.navigate('department/index',{trigger: true, replace: true});
		return false;
	},

	//fetch event: done
	done: function(response){
		var that = this;
		if(!this.modelFilled){
			//first fetch: get model
			this.modelFilled = true;
			this.render();

		}else{
			//second fetch: submit
			this.router.navigate('department/index',{trigger: true, replace: true});
		}
	},

	render: function(){
		this.$el.html(this.template({model: this.model.toJSON()}));
		if(this.model.isNew()) this.$('.panel-title').text('新增渠道');
		return this;
	},
});


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="search.css"/>

Loading...

  PLANE_X
  Plane.h

  PLANE_Y
  Plane.h

  PLANE_Z
  Plane.h

Searching...

No Matches


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

    <groupId>org.ecabrerar.codecampsdq40</groupId>
    <artifactId>javaee7-jsonp-basico</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>javaee7-jsonp-basico</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>javax.json</groupId>
            <artifactId>javax.json-api</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.json</artifactId>
            <version>1.0.4</version>
            <type>jar</type>
        </dependency>
    </dependencies>
</project>