text:
package fredboat.command.util;

import fredboat.Config;
import fredboat.command.fun.RemoteFileCommand;
import fredboat.command.fun.TextCommand;
import fredboat.commandmeta.CommandRegistry;
import fredboat.commandmeta.abs.*;
import fredboat.feature.I18n;
import fredboat.perms.PermissionLevel;
import fredboat.perms.PermsUtil;
import fredboat.util.DiscordUtil;
import net.dv8tion.jda.core.Permission;
import net.dv8tion.jda.core.entities.Guild;

import java.text.MessageFormat;
import java.util.*;

/**
 * Created by napster on 22.03.17.
 *

 * YO DAWG I HEARD YOU LIKE COMMANDS SO I PUT
 * THIS COMMAND IN YO BOT SO YOU CAN SHOW MORE
 * COMMANDS WHILE YOU EXECUTE THIS COMMAND
 *

 * Display available commands
 */
public class CommandsCommand extends Command implements IUtilCommand {

    //design inspiration by Weiss Schnee's bot
    //https://cdn.discordapp.com/attachments/230033957998166016/296356070685671425/unknown.png
    @Override
    public void onInvoke(CommandContext context) {

        //is this the music boat? shortcut to showing those commands
        //taking this shortcut we're missing out on showing a few commands to pure music bot users
        // http://i.imgur.com/511Hb8p.png screenshot from 1st April 2017
        //bot owner and debug commands (+ ;;music and ;;help) missing + the currently defunct config command
        //this is currently fine but might change in the future
        if (DiscordUtil.isMusicBot()) {
            new MusicHelpCommand().onInvoke(context);
        }

        if (DiscordUtil.isMainBot()) {
            mainBotHelp(context);
        }
    }

    private void mainBotHelp(CommandContext context) {
        Set<String> commandsAndAliases = CommandRegistry.getRegisteredCommandsAndAliases();
        Set<String> unsortedAliases = new HashSet<>(); //hash set = only unique commands
        for (String commandOrAlias : commandsAndAliases) {
            String mainAlias = CommandRegistry.getCommand(commandOrAlias).name;
            unsortedAliases.add(mainAlias);
        }
        //alphabetical order
        List<String> sortedAliases = new ArrayList<>(unsortedAliases);
        Collections.sort(sortedAliases);

        ResourceBundle i18n = I18n.get(context.guild);
        String fun = "**" + i18n.getString("commandsFun") + ":** ";
        String memes = "**" + i18n.getString("commandsMemes") + ":**";
        String util = "**" + i18n.getString("commandsUtility") + ":** ";
        String mod = "**" + i18n.getString("commandsModeration") + ":** ";
        String maint = "**" + i18n.getString("commandsMaintenance") + ":** ";
        String owner = "**" + i18n.getString("commandsBotOwner") + ":** ";

        for (String alias : sortedAliases) {
            Command c = CommandRegistry.getCommand(alias).command;
            String formattedAlias = "`" + alias + "` ";

            if (c instanceof ICommandRestricted
                    && ((ICommandRestricted) c).getMinimumPerms() == PermissionLevel.BOT_OWNER) {
                owner += formattedAlias;
            } else if (c instanceof TextCommand || c instanceof RemoteFileCommand) {
                memes += formattedAlias;
            } else {
                //overlap is possible in here, that's ok
                if (c instanceof IFunCommand) {
                    fun += formattedAlias;
                }
                if (c instanceof IUtilCommand) {
                    util += formattedAlias;
                }
                if (c instanceof IModerationCommand) {
                    mod += formattedAlias;
                }
                if (c instanceof IMaintenanceCommand) {
                    maint += formattedAlias;
                }
            }
        }

        String out = fun;
        out += "\n" + util;
        out += "\n" + memes;

        if (context.invoker.hasPermission(Permission.MESSAGE_MANAGE)) {
            out += "\n" + mod;
        }

        if (PermsUtil.isUserBotOwner(context.invoker.getUser())) {
            out += "\n" + maint;
            out += "\n" + owner;
        }

        out += "\n\n" + MessageFormat.format(i18n.getString("commandsMoreHelp"), "`" + Config.CONFIG.getPrefix() + "help <command>`");
        context.reply(out);
    }

    @Override
    public String help(Guild guild) {
        String usage = "{0}{1}\n#";
        return usage + I18n.get(guild).getString("helpCommandsCommand");
    }
}


text:
@interface MOAspectsAppDelegate ()

@end

@implementation MOAspectsAppDelegate

#pragma mark - Load

+ (void)load
{
    NSArray *selectors = @[NSStringFromSelector(@selector(viewWillAppear:)),
                           NSStringFromSelector(@selector(viewDidAppear:))];

    for (NSString *selectorStr in selectors) {
        [MOAspects hookInstanceMethodForClass:[MOAspectsViewController class]
                                     selector:NSSelectorFromString(selectorStr)
                              aspectsPosition:MOAspectsPositionBefore
                                   usingBlock:^(MOAspectsViewController *viewController){
                                       NSString *log = [NSString stringWithFormat:@"-[%@ %@]",
                                                        NSStringFromClass([MOAspectsViewController class]),
                                                        selectorStr];
                                       NSLog(@"%@", log);
                                       viewController.aspectsLogView.text = log;
                                   }];
        [MOAspects hookInstanceMethodForClass:[UINavigationController class]
                                     selector:NSSelectorFromString(selectorStr)
                              aspectsPosition:MOAspectsPositionBefore
                                   usingBlock:^(UINavigationController *viewController){
                                       NSString *log = [NSString stringWithFormat:@"-[%@ %@]",
                                                        NSStringFromClass([UINavigationController class]),
                                                        selectorStr];
                                       NSLog(@"%@", log);
                                   }];

    }
}

#pragma mark - Property

- (UIWindow *)window
{
    if (!_window) {
        _window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
        _window.rootViewController = self.navigationController;
    }
    return _window;
}

- (UINavigationController *)navigationController
{
    if (!_navigationController) {
        MOAspectsViewController *viewController = [[MOAspectsViewController alloc] init];
        _navigationController = [[UINavigationController alloc] initWithRootViewController:viewController];
    }
    return _navigationController;
}

#pragma makr - Application Life cycle

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [self.window makeKeyAndVisible];
    return YES;
}

@end

redpajama_set_name: RedPajamaGithub


text:
namespace {

const int kIntMax = std::numeric_limits<int>::max();

}  // namespace

namespace remoting {

TEST(EncoderVp8Test, TestEncoder) {
  EncoderVp8 encoder;
  TestEncoder(&encoder, false);
}

class EncoderCallback {
 public:
  void DataAvailable(scoped_ptr<VideoPacket> packet) {
  }
};

// Test that calling Encode with a differently-sized CaptureData does not
// leak memory.
TEST(EncoderVp8Test, TestSizeChangeNoLeak) {
  int height = 1000;
  int width = 1000;
  const int kBytesPerPixel = 4;

  EncoderVp8 encoder;
  EncoderCallback callback;

  std::vector<uint8> buffer(width * height * kBytesPerPixel);
  DataPlanes planes;
  planes.data[0] = &buffer.front();
  planes.strides[0] = width;

  scoped_refptr<CaptureData> capture_data(new CaptureData(
      planes, SkISize::Make(width, height), media::VideoFrame::RGB32));
  encoder.Encode(capture_data, false,
                 base::Bind(&EncoderCallback::DataAvailable,
                            base::Unretained(&callback)));

  height /= 2;
  capture_data = new CaptureData(planes, SkISize::Make(width, height),
                                 media::VideoFrame::RGB32);
  encoder.Encode(capture_data, false,
                 base::Bind(&EncoderCallback::DataAvailable,
                            base::Unretained(&callback)));
}

TEST(EncoderVp8Test, AlignAndClipRect) {
  // Simple test case (no clipping).
  SkIRect r1(SkIRect::MakeXYWH(100, 200, 300, 400));
  EXPECT_EQ(EncoderVp8::AlignAndClipRect(r1, kIntMax, kIntMax), r1);

  // Should expand outward to r1.
  SkIRect r2(SkIRect::MakeXYWH(101, 201, 298, 398));
  EXPECT_EQ(EncoderVp8::AlignAndClipRect(r2, kIntMax, kIntMax), r1);

  // Test clipping to screen size.
  EXPECT_EQ(EncoderVp8::AlignAndClipRect(r1, 110, 220),
            SkIRect::MakeXYWH(100, 200, 10, 20));

  // Rectangle completely off-screen.
  EXPECT_TRUE(EncoderVp8::AlignAndClipRect(r1, 50, 50).isEmpty());

  // Clipping to odd-sized screen.  An unlikely case, and we might not deal
  // with it cleanly in the encoder (we possibly lose 1px at right & bottom
  // of screen).
  EXPECT_EQ(EncoderVp8::AlignAndClipRect(r1, 199, 299),
            SkIRect::MakeXYWH(100, 200, 98, 98));
}

}  // namespace remoting


text:
import { monthsNames, weekDays } from './config';

/**
 * Convert date to YYYY-MM-DD format, e.g. "2016-09-11"
 * @param  {(!Date|!string)} date  Date object or string in 2016/09/11
 * @return {string}                string in YYYY-MM-DD format
 */
export const convertDate = function(date) {
  if (!(date instanceof Date)) {
    // Use slash separator instead of "-" need for Firefox
    date = new Date(date.replace(/-/g, '/'));
  }
  return `${date.getFullYear()}-${date.getMonth() < 9 ? '0'+(date.getMonth() + 1) : date.getMonth() + 1}-${date.getDate() < 10 ? '0'+date.getDate() : date.getDate()}`;
};
/**
 * Return human-readable date string, e.g. September 11, 2016, Sunday. Format depends on locale (en or ru)
 * @param  {(!Date|!string)} date Date object or string in 2016/09/11
 * @return {string}               human-readable string, e.g. September 11, 2016, Sunday
 */
export const getHumanDate = function(date) {
  if (!(date instanceof Date)) {
    // Use slash separator instead of "-" need for Firefox
    date = new Date(date.replace(/-/g, '/'));
  }
  return `${date.getDate()} ${ monthsNames[date.getMonth()].vocative } ${ date.getFullYear() }г., ${ weekDays[date.getDay()] }`;
};

/**
 * Create date from string in format YYYY-MM-DD. Moustly for cross-browser compatibility
 * @param  {string} date  Date string in YYYY-MM-DD format
 * @return {Date}         Date object
 */
export const makeDate = function(date) {
  return new Date(date.replace(/-/g, '/'));
};

export const datesMixin = {
  methods: {
    makeDate,
    convertDate,
    getHumanDate
  }
};


text:
{# AUTOGENERATED. DO NOT EDIT. #}

{% extends "config-connector/_base.html" %}

{% block page_title %}BigtableInstance{% endblock %}
{% block body %}

Property
Value

{{gcp_name_short}} Service Name
Cloud Bigtable

{{gcp_name_short}} Service Documentation
/bigtable/docs/

{{gcp_name_short}} REST Resource Name
bigtableadmin/v2/projects.instances

{{gcp_name_short}} REST Resource Documentation
/bigtable/docs/reference/admin/rest/v2/projects.instances

{{product_name_short}} Resource Short Names
gcpbigtableinstance
gcpbigtableinstances
bigtableinstance

{{product_name_short}} Service Name
bigtableadmin.googleapis.com

{{product_name_short}} Resource Fully Qualified Name
bigtableinstances.bigtable.cnrm.cloud.google.com

    Can Be Referenced by IAMPolicy/IAMPolicyMember
    Yes

    Supports IAM Conditions
    Yes

    Supports IAM Audit Configs
    No

    IAM External Reference Format

{% verbatim %}projects/{{project}}/instances/{{name}}{% endverbatim %}

## Custom Resource Definition Properties

### Annotations

        Fields

        cnrm.cloud.google.com/project-id

        cnrm.cloud.google.com/state-into-spec

### Spec
#### Schema
```yaml
cluster:
- autoscalingConfig:
    cpuTarget: integer
    maxNodes: integer
    minNodes: integer
    storageTarget: integer
  clusterId: string
  kmsKeyRef:
    external: string
    name: string
    namespace: string
  numNodes: integer
  storageType: string
  zone: string
deletionProtection: boolean
displayName: string
instanceType: string
resourceID: string
```

        Fields

cluster

Optional

list (object)

{% verbatim %}A block of cluster configuration options. This can be specified at least once.{% endverbatim %}

cluster[]

Optional

object

{% verbatim %}{% endverbatim %}

cluster[].autoscalingConfig

Optional

object

{% verbatim %}A list of Autoscaling configurations. Only one element is used and allowed.{% endverbatim %}

cluster[].autoscalingConfig.cpuTarget

Required*

integer

{% verbatim %}The target CPU utilization for autoscaling. Value must be between 10 and 80.{% endverbatim %}

cluster[].autoscalingConfig.maxNodes

Required*

integer

{% verbatim %}The maximum number of nodes for autoscaling.{% endverbatim %}

cluster[].autoscalingConfig.minNodes

Required*

integer

{% verbatim %}The minimum number of nodes for autoscaling.{% endverbatim %}

cluster[].autoscalingConfig.storageTarget

Optional

integer

{% verbatim %}The target storage utilization for autoscaling, in GB, for each node in a cluster. This number is limited between 2560 (2.5TiB) and 5120 (5TiB) for a SSD cluster and between 8192 (8TiB) and 16384 (16 TiB) for an HDD cluster. If not set, whatever is already set for the cluster will not change, or if the cluster is just being created, it will use the default value of 2560 for SSD clusters and 8192 for HDD clusters.{% endverbatim %}

cluster[].clusterId

Required*

string

{% verbatim %}The ID of the Cloud Bigtable cluster.{% endverbatim %}

cluster[].kmsKeyRef

Optional

object

{% verbatim %}Describes the Cloud KMS encryption key that will be used to protect the destination Bigtable
cluster. The requirements for this key are: 1) The Cloud Bigtable service account associated with the project that contains
this cluster must be granted the cloudkms.cryptoKeyEncrypterDecrypter role on the CMEK key.
2) Only regional keys can be used and the region of the CMEK key must match the region of the cluster.
3) All clusters within an instance must use the same CMEK key access to this encryption key.{% endverbatim %}

cluster[].kmsKeyRef.external

Optional

string

{% verbatim %}Allowed value: The `selfLink` field of a `KMSCryptoKey` resource.{% endverbatim %}

cluster[].kmsKeyRef.name

Optional

string

{% verbatim %}Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names{% endverbatim %}

cluster[].kmsKeyRef.namespace

Optional

string

{% verbatim %}Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/{% endverbatim %}

cluster[].numNodes

Optional

integer

{% verbatim %}The number of nodes in your Cloud Bigtable cluster. For PRODUCTION instances where the numNodes will be managed by Config Connector, this field is required with a minimum of 1. For a DEVELOPMENT instance or for an existing instance where the numNodes is managed outside of Config Connector, this field must be left unset.{% endverbatim %}

cluster[].storageType

Optional

string

{% verbatim %}The storage type to use. One of "SSD" or "HDD". Defaults to "SSD".{% endverbatim %}

cluster[].zone

Required*

string

{% verbatim %}The zone to create the Cloud Bigtable cluster in. Each cluster must have a different zone in the same region. Zones that support Bigtable instances are noted on the Cloud Bigtable locations page.{% endverbatim %}

deletionProtection

Optional

boolean

{% verbatim %}DEPRECATED. This field no longer serves any function and is intended to be dropped in a later version of the resource.{% endverbatim %}

displayName

Optional

string

{% verbatim %}The human-readable display name of the Bigtable instance. Defaults to the instance name.{% endverbatim %}

instanceType

Optional

string

{% verbatim %}DEPRECATED. It is recommended to leave this field unspecified since the distinction between "DEVELOPMENT" and "PRODUCTION" instances is going away, and all instances will become "PRODUCTION" instances. This means that new and existing "DEVELOPMENT" instances will be converted to "PRODUCTION" instances. It is recommended for users to use "PRODUCTION" instances in any case, since a 1-node "PRODUCTION" instance is functionally identical to a "DEVELOPMENT" instance, but without the accompanying restrictions. The instance type to create. One of "DEVELOPMENT" or "PRODUCTION". Defaults to "PRODUCTION".{% endverbatim %}

resourceID

Optional

string

{% verbatim %}Immutable. Optional. The name of the resource. Used for creation and acquisition. When unset, the value of `metadata.name` is used as the default.{% endverbatim %}

{% verbatim %}* Field is required when parent field is specified{% endverbatim %}

### Status
#### Schema
```yaml
conditions:
- lastTransitionTime: string
  message: string
  reason: string
  status: string
  type: string
observedGeneration: integer
```

        Fields

        conditions

list (object)

{% verbatim %}Conditions represent the latest available observation of the resource's current state.{% endverbatim %}

        conditions[]

object

{% verbatim %}{% endverbatim %}

        conditions[].lastTransitionTime

string

{% verbatim %}Last time the condition transitioned from one status to another.{% endverbatim %}

        conditions[].message

string

{% verbatim %}Human-readable message indicating details about last transition.{% endverbatim %}

        conditions[].reason

string

{% verbatim %}Unique, one-word, CamelCase reason for the condition's last transition.{% endverbatim %}

        conditions[].status

string

{% verbatim %}Status is the status of the condition. Can be True, False, Unknown.{% endverbatim %}

        conditions[].type

string

{% verbatim %}Type is the type of the condition.{% endverbatim %}

        observedGeneration

integer

{% verbatim %}ObservedGeneration is the generation of the resource that was most recently observed by the Config Connector controller. If this is equal to metadata.generation, then that means that the current reported status reflects the most recent desired state of the resource.{% endverbatim %}

## Sample YAML(s)

### Auto Scaling
```yaml
# Copyright 2020 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.

apiVersion: bigtable.cnrm.cloud.google.com/v1beta1
kind: BigtableInstance
metadata:
  name: bigtableinstance-sample
spec:
  displayName: BigtableSample
  cluster:
  - clusterId: bigtableinstance-dep1
    zone: us-central1-a
    autoscalingConfig:
      cpuTarget: 60
      maxNodes: 3
      minNodes: 1
```

### Replicated Instance
```yaml
# Copyright 2020 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.

apiVersion: bigtable.cnrm.cloud.google.com/v1beta1
kind: BigtableInstance
metadata:
  name: bigtableinstance-sample
spec:
  displayName: BigtableSample
  cluster:
  - clusterId: bigtableinstance-dep1
    zone: us-central1-a
    numNodes: 3
  - clusterId: bigtableinstance-dep2
    zone: us-west1-a
    numNodes: 3
```

### Simple Instance
```yaml
# Copyright 2020 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.

apiVersion: bigtable.cnrm.cloud.google.com/v1beta1
kind: BigtableInstance
metadata:
  name: bigtableinstance-sample
spec:
  displayName: BigtableSample
  cluster:
  - clusterId: bigtableinstance-dep1
    zone: us-central1-a
    numNodes: 3
```

{% endblock %}


text:
require 'spec_helper'

describe ETL::Processor do
  # @todo: Do.
end


text:
<?php

namespace app\models;

use Yii;
use yii\db\ActiveQuery;

/**
 * This is the model class for table "{{%request_tags}}".
 *
 * Свойства:
 * @property integer $request_id
 * @property integer $tag_id
 *
 * Связи:
 * @property Tag $tag
 * @property Requests $request
 */
class RequestTags extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName(): string
    {
        return '{{%request_tags}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules(): array
    {
        return [
            [['request_id', 'tag_id'], 'required'],
            [['request_id', 'tag_id'], 'integer'],
            [
                ['tag_id'],
                'exist',
                'skipOnError' => true,
                'targetClass' => Tag::class,
                'targetAttribute' => ['tag_id' => 'id'],
            ],
            [
                ['request_id'],
                'exist',
                'skipOnError' => true,
                'targetClass' => Requests::class,
                'targetAttribute' => ['request_id' => 'id'],
            ],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels(): array
    {
        return [
            'request_id' => Yii::t('app', 'Заявка'),
            'tag_id' => Yii::t('app', 'Метка'),
        ];
    }

    /**
     * @return ActiveQuery
     */
    public function getTag(): ActiveQuery
    {
        return $this->hasOne(Tag::class, ['id' => 'tag_id']);
    }

    /**
     * @return ActiveQuery
     */
    public function getRequest(): ActiveQuery
    {
        return $this->hasOne(Requests::class, ['id' => 'request_id']);
    }
}


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

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * Holds a map of most recently used items of a given maximum size. Old entries are expired when the
 * map exceeds that maximum size.
 *
 * @author Jonathan Locke
 * @param <K>
 *            key type
 * @param <V>
 *            value type
 */
public class MostRecentlyUsedMap<K, V> extends LinkedHashMap<K, V>
{
	private static final long serialVersionUID = 1L;

	/** Value most recently removed from map */
	protected V removedValue;

	/** Maximum number of entries allowed in this map */
	private final int maxEntries;

	/**
	 * Constructor
	 *
	 * @param maxEntries
	 *            Maximum number of entries allowed in the map
	 */
	public MostRecentlyUsedMap(final int maxEntries)
	{
		super(10, 0.75f, true);

		if (maxEntries <= 0)
		{
			throw new IllegalArgumentException("Must have at least one entry");
		}

		this.maxEntries = maxEntries;
	}

	/**
	 * @return Returns the removedValue.
	 */
	public V getRemovedValue()
	{
		return removedValue;
	}

	/**
	 * @see java.util.LinkedHashMap#removeEldestEntry(java.util.Map.Entry)
	 */
	@Override
	protected boolean removeEldestEntry(final Map.Entry<K, V> eldest)
	{
		final boolean remove = size() > maxEntries;
		// when it should be removed remember the oldest value that will be removed
		if (remove)
		{
			this.removedValue = eldest.getValue();
		}
		else
		{
			removedValue = null;
		}
		return remove;
	}
}


text:
module Feediscovery
  VERSION = "0.0.1"
end


text:
var config = {};

config.golang = {};
config.golang.path = 'build/bin';

config.isDevelopmentEnvironment = true;

module.exports = config;


text:
package com.mcoding.base.member.web.controller.department;

import java.util.List;

import javax.annotation.Resource;

import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import com.mcoding.base.core.CommonException;
import com.mcoding.base.core.JsonResult;
import com.mcoding.base.core.PageView;
import com.mcoding.base.member.bean.department.Department;
import com.mcoding.base.member.bean.department.DepartmentExample;
import com.mcoding.base.member.service.department.DepartmentService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import springfox.documentation.annotations.ApiIgnore;

@Api(value="会员_所属部门表")
@Controller
@RequestMapping("memberDepartment")
public class DepartmentController {
    @Resource
    protected DepartmentService memberDepartmentService;

    @ApiIgnore
    @RequestMapping("service/toAddView")
    public ModelAndView toAddView(Integer parentId) {
    	ModelAndView view = new ModelAndView("member/memberDepartment/toAddView");
    	if (parentId !=null && parentId > 0) {
    		Department parent = this.memberDepartmentService.queryObjById(parentId);
    		view.addObject("parent", parent);
		}
        return view;
    }

    @ApiIgnore
    @RequestMapping("service/toDepartmentListView")
    public ModelAndView toDepartmentListView(int parentId) {
    	Department department = this.memberDepartmentService.queryObjById(parentId);

    	ModelAndView view =new ModelAndView("member/memberDepartment/toDepartmentListView");
    	view.addObject("parent", department);
        return view;
    }

    @ApiIgnore
    @RequestMapping("service/toUpdateViewById")
    public ModelAndView toUpdateViewById(int id) {
        ModelAndView view = new ModelAndView();
        Department memberDepartment = this.memberDepartmentService.queryObjById(id);
        view.addObject("memberDepartment", memberDepartment);

        Department parent = this.memberDepartmentService.queryObjById(memberDepartment.getParentId());
        view.addObject("parent", parent);

        view.setViewName("member/memberDepartment/toAddView");
        return view;
    }

    @ApiIgnore
    @RequestMapping("service/toMainView")
    public ModelAndView toMainView() {
        return new ModelAndView("member/memberDepartment/toMainView");
    }

    @ApiOperation(httpMethod="POST", value="创建会员_所属部门表")
    @RequestMapping("service/create")
    @ResponseBody
    public JsonResult<String> create(@RequestBody Department memberDepartment) {
        JsonResult<String> result = new JsonResult<>();
        this.memberDepartmentService.addObj(memberDepartment);
        result.setData(null);
        result.setMsg("ok");
        result.setStatus("00");
        return result;
    }

    @ApiOperation(httpMethod="POST", value="编辑会员_所属部门表")
    @RequestMapping("service/edit")
    @ResponseBody
    public JsonResult<String> edit(@RequestBody Department memberDepartment) {
        if (memberDepartment.getId() == null || memberDepartment.getId() <=0) {
            throw new CommonException("id 为空,保存失败");
        }
        JsonResult<String> result = new JsonResult<>();
        this.memberDepartmentService.modifyObj(memberDepartment);
        result.setData(null);
        result.setMsg("ok");
        result.setStatus("00");
        return result;
    }

    /*@ApiOperation(httpMethod="POST", value="删除会员_所属部门表")
    @RequestMapping("service/deleteById")
    @ResponseBody
    public JsonResult<String> deleteById(int id) {
        JsonResult<String> result = new JsonResult<>();
        this.memberDepartmentService.deleteObjById(id);
        result.setData(null);
        result.setMsg("ok");
        result.setStatus("00");
        return result;
    }*/

    @ApiOperation(httpMethod="GET", value="查询会员_所属部门表")
    @RequestMapping("service/findByPage")
    @ResponseBody
    public PageView<Department> findByPage(
    		@ApiParam(name="分页索引",defaultValue="0") @RequestParam(defaultValue="0") String iDisplayStart,
    		@ApiParam(name="每页的数量",defaultValue="10") @RequestParam(defaultValue="10") String iDisplayLength,
    		@ApiParam(value="查询条件") String sSearch,
    		@ApiParam(value="上级id", defaultValue="0") @RequestParam(defaultValue="0") int parentId) {
        PageView<Department> pageView = new PageView<>(iDisplayStart, iDisplayLength);

        DepartmentExample example = new DepartmentExample();
        DepartmentExample.Criteria cri = example.createCriteria();
        cri.andParentIdEqualTo(parentId);

        example.setPageView(pageView);
        if (StringUtils.isNotBlank(sSearch)) {
        	cri.andCompanyNameLike(sSearch + "%");
        }
        return this.memberDepartmentService.queryObjByPage(example);
    }

    @ApiOperation(httpMethod="GET", value="查询所有公司")
    @RequestMapping("service/findAllCompany")
    @ResponseBody
    public JsonResult<List<Department>> findAllCompany() {

        DepartmentExample example = new DepartmentExample();
        DepartmentExample.Criteria cri = example.createCriteria();
        cri.andDepartmentTypeEqualTo(Department.TYPE_COMPANY);

        JsonResult<List<Department>> result = new JsonResult<>();
        result.setData(this.memberDepartmentService.queryAllObjByExample(example));
        result.setStatus("00");
        result.setMsg("ok");
        return result;
    }
}


text:
//@author Marc Woodyard
/********************************************************************************************************
*Program Name: Zipcode to Barcode Program                                                               *
*Description: Encode a zipcode to a bar code.											                *
*Author: Marc Woodyard                                                                                *
*Class: CSC-15 TuTh 12:00pm                                                                             *
*Teacher: Gita Faroughi                                                                                *
*********************************************************************************************************/

import java.io.*;
import java.util.*;
public class ZipcodeDriver {
	public static void main(String[] args) throws FileNotFoundException {
		Scanner kb = new Scanner(System.in);
		PrintStream out = OutputFile( kb, "Enter the file name that you want to store the barcodes: ");
		Scanner input = Inputfile(kb, "Enter the file name that contains the zip codes: ");
		processZipCodes(input, out);
		System.out.println("Now converting the bar codes back to the original zipcode.");
		input = Inputfile(kb, "Enter the file name that contains the barcodes: ");
		out =  OutputFile( kb, "Enter the file name that that you want to store the zip codes to: ");
		processBarCodes(input, out);
	}

	/*this method gets the output file name so that we output the result in this file*/
	public static PrintStream OutputFile(Scanner console, String instructions) throws FileNotFoundException {
		String outputFileName;
    	boolean validFile = false;
    	do {
    		System.out.print(instructions);
            outputFileName = console.nextLine();
            if(outputFileName.contains(".txt"))
            	validFile = true;
            else
            	System.out.println("[Program] SAVE FAILED! Not a valid file type. Make sure you include \nthe file type (file.txt).\n");
    	} while(validFile == false);
    	System.out.println("[Program] File saved successfully!\n");
    	return new PrintStream(System.getProperty("user.home") + "/Desktop/" + outputFileName);
	}

	/*This method gets the name of the input file. It should keep asking the user until you get a valid file name */
	public static Scanner Inputfile(Scanner console, String instructions) throws FileNotFoundException {
		File dataFile;
    	boolean fileExists = false;
    	do {
	    	System.out.print(instructions);
	    	dataFile = new File(System.getProperty("user.home") + "/Desktop/" + console.nextLine());
	    	if(dataFile.exists())
	    		fileExists = true;
	    	else
	    		System.out.println("[Program] UPLOAD FAILED! File not found. Make sure the data file is\non your desktop"
	    				+ "and you included the file type (file.txt).\n");
    	} while(fileExists == false);
    	System.out.println("[Program] Zipcode data imported successfully!\n");
    	return new Scanner(dataFile);
	}

	//Encodes the zipcodes and assigns them to the matching city.
	public static void processZipCodes(Scanner dataFile,  PrintStream writer) {
		while(dataFile.hasNext()) {
			//Get the zipcode and city name.
			String data = dataFile.nextLine();
			//Seperate the zipcode and city name.
			int zipcode = ZipCode.getZip(data);
			String city = ZipCode.getCity(data, 1);
			//Encode the information.
			String encoding = ZipCode.generateEncoding(zipcode);
			//Generate a barcode.
			String barcode = ZipCode.generateBarcode(encoding);
			//Write the bar code and city to the file.
			writer.println(barcode + " " + city);
		}
	}

	//Decode the barcoes and print the zipcodes to a file.
	public static void processBarCodes(Scanner dataFile, PrintStream writer) {
		while(dataFile.hasNext()) {
			//Get the zipcode and city name.
			String data = dataFile.nextLine();
			//Get the city name.
			String city = ZipCode.getCity(data, 2);
			//Get the zipcode.
			String zipcode = ZipCode.readBarcode(data);
			//Write the bar code and city to the file.
			writer.print(ZipCode.printCity(city));
			writer.println(zipcode);
		}
	}
}


text:
using GenderPayGap.Core;
using GenderPayGap.Extensions;
using System;
using System.Collections.Generic;

namespace GenderPayGap.Database
{
    public partial class Return
    {
        public Return()
        {
            Organisations = new HashSet<Organisation>();
            ReturnStatuses = new HashSet<ReturnStatus>();
        }

        public long ReturnId { get; set; }
        public long OrganisationId { get; set; }
        public DateTime AccountingDate { get; set; }
        public decimal DiffMeanHourlyPayPercent { get; set; }
        public decimal DiffMedianHourlyPercent { get; set; }
        public decimal? DiffMeanBonusPercent { get; set; }
        public decimal? DiffMedianBonusPercent { get; set; }
        public decimal MaleMedianBonusPayPercent { get; set; }
        public decimal FemaleMedianBonusPayPercent { get; set; }
        public decimal MaleLowerPayBand { get; set; }
        public decimal FemaleLowerPayBand { get; set; }
        public decimal MaleMiddlePayBand { get; set; }
        public decimal FemaleMiddlePayBand { get; set; }
        public decimal MaleUpperPayBand { get; set; }
        public decimal FemaleUpperPayBand { get; set; }
        public decimal MaleUpperQuartilePayBand { get; set; }
        public decimal FemaleUpperQuartilePayBand { get; set; }
        public string CompanyLinkToGPGInfo { get; set; }
        public ReturnStatuses Status { get; set; }
        public DateTime StatusDate { get; set; } = VirtualDateTime.Now;
        public string StatusDetails { get; set; }
        public DateTime Created { get; set; } = VirtualDateTime.Now;

        public DateTime Modified { get; set; } = VirtualDateTime.Now;
        public string JobTitle { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public int MinEmployees { get; set; }
        public int MaxEmployees { get; set; }
        public string LateReason { get; set; }
        public string Modifications { get; set; }
        public bool EHRCResponse { get; set; }

        public virtual Organisation Organisation { get; set; }
        public virtual ICollection<Organisation> Organisations { get; set; }
        public virtual ICollection<ReturnStatus> ReturnStatuses { get; set; }
    }
}


text:
'use strict';

/*
 * offscreen - Off canvas sidebar directive
 */

function offscreen($rootScope, $timeout) {
  return {
    restrict: 'EA',
    replace: true,
    transclude: true,
    templateUrl: 'views/directives/toggle-offscreen.html',
    link: function (scope, element, attrs) {
      scope.offscreenDirection = attrs.move;
    },
    controller: function ($scope, $element, $timeout) {
      var dir,
        offscreenDirectionClass;

      $scope.offscreen = function () {
        dir = $scope.offscreenDirection ? $scope.offscreenDirection : 'ltr';

        if ($scope.app.layout.isChatOpen) {
          $scope.app.layout.isChatOpen = !$scope.app.layout.isChatOpen;
        }

        if (dir === 'rtl' || angular.element('.app').hasClass('layout-right-sidebar')) {
          offscreenDirectionClass = 'move-right';
        } else {
          offscreenDirectionClass = 'move-left';
        }

        if ($scope.app.layout.isOffscreenOpen) {
          angular.element('.app').removeClass('offscreen move-left move-right');
          $scope.app.layout.isOffscreenOpen = false;
        } else {
          angular.element('.app').addClass('offscreen ' + offscreenDirectionClass);
          $scope.app.layout.isOffscreenOpen = true;
        }
      };
    }
  };
}

angular.module('ControlElectoralApp').directive('offscreen', offscreen);


text:
package com.avaje.ebean.dbmigration.model.visitor;

import com.avaje.ebeaninternal.server.deploy.BeanDescriptor;

/**
 * Visitor pattern for visiting a BeanDescriptor and potentially all its bean
 * properties.
 */
public interface BeanVisitor {

	/**
	 * Visit a BeanDescriptor and return a PropertyVisitor to use to visit each
   * property on the entity bean (return null to skip visiting this bean).
	 */
  BeanPropertyVisitor visitBean(BeanDescriptor<?> descriptor);

}


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System;
using System.Diagnostics;
using System.IO;

namespace Microsoft.CodeAnalysis
{
    internal abstract partial class CommonCompiler
    {
        /// <summary>
        /// This implementation of <see cref="Compilation.EmitStreamProvider"/> will delay the creation
        /// of the PE / PDB file until the compiler determines the compilation has succeeded.  This prevents
        /// the compiler from deleting output from the previous compilation when a new compilation
        /// fails.
        /// </summary>
        private sealed class CompilerEmitStreamProvider : Compilation.EmitStreamProvider, IDisposable
        {
            private static Stream s_uninitialized = Stream.Null;

            private readonly CommonCompiler _compiler;
            private readonly string _filePath;
            private readonly bool _streamCreatedByNativePdbWriter;

            private Stream _lazyStream;

            internal CompilerEmitStreamProvider(CommonCompiler compiler, string filePath, bool streamCreatedByNativePdbWriter)
            {
                _compiler = compiler;
                _filePath = filePath;
                _streamCreatedByNativePdbWriter = streamCreatedByNativePdbWriter;
                _lazyStream = s_uninitialized;
            }

            public void Dispose()
            {
                if (_lazyStream != s_uninitialized)
                {
                    _lazyStream?.Dispose();
                    _lazyStream = s_uninitialized;
                }
            }

            public override Stream GetStream(DiagnosticBag diagnostics)
            {
                if (_lazyStream == s_uninitialized)
                {
                    _lazyStream = _streamCreatedByNativePdbWriter ? null : OpenFile(_filePath, diagnostics);
                }

                return _lazyStream;
            }

            private Stream OpenFile(string filePath, DiagnosticBag diagnostics)
            {
                try
                {
                    return _compiler.FileOpen(filePath, FileMode.Create, FileAccess.ReadWrite, FileShare.None);
                }
                catch (Exception e)
                {
                    var messageProvider = _compiler.MessageProvider;
                    diagnostics.Add(messageProvider.CreateDiagnostic(messageProvider.ERR_CantOpenFileWrite, Location.None, filePath, e.Message));
                    return null;
                }
            }
        }
    }
}


text:
using System;

namespace Sangria.Exceptions
{
    public class InvalidBindingException : Exception
    {
        public InvalidBindingException(string message)
            :base(message)
        {
        }
    }
}


text:
<?php

namespace Valdi\Validator;

/**
 * Validator for a date time being in the future compared to the current moment.
 * For the format, see:
 * http://php.net/manual/en/datetime.createfromformat.php
 */
class InTheFuture extends AbstractDateTimeComparator
{

    /**
     * Holds the amount of parameters.
     */
    protected $amountOfParameters = 0;

    /**
     * Holds whether to parse the parameters as \DateTimes so the child class
     * can decide.
     */
    protected $dateTimeParameters = false;

    /**
     * Holds the type of the validator.
     */
    protected $type = 'inTheFuture';

    /**
     * {@inheritdoc}
     */
    protected function isValidComparison(\DateTime $date, array $datetimes, array $parameters)
    {
        $now = new \DateTime();
        return $date->getTimestamp() > $now->getTimestamp();
    }

}


text:
set -e;

echo "starting to install dependencies"

sudo apt-get -qq update
echo "updated for the first time"
sudo apt-get install -y software-properties-common | grep -v "^[(Selecting)|(Preparing)|(Unpacking)]"
echo "installed"
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
echo "added ubuntu-toolchain-r/test"
sudo apt-get -qq update
echo "updated for the second time"
sudo DEBIAN_FRONTEND=noninteractive apt-get -q install -y apache2 apache2-dev apt-file apt-utils autoconf build-essential clang clang-3.8 cmake curl cython cython3 default-jdk default-jre g++-6 gcc gcc-6 gfortran git libapache2-mod-wsgi libatlas-base-dev libblas3 libblas-dev liblapack-dev libboost-all-dev libc6 libcgal-dev libgdal1-dev libgeos-dev libgmp3-dev liblapack3 libmpfr-dev libmpfr-doc libmpfr4 libmpfr4-dbg libopenblas-dev libproj-dev libpq-dev libxslt1-dev locales make maven osmctools pkg-config postgresql postgresql-contrib postgresql-server-dev-all ^postgresql-[0-9].[0-9]-postgis-[0-9].[0-9]$ python3 software-properties-common vim zip zlib1g-dev | grep -v '^[(Get)|(Adding)|(Enabling)|(Selecting)|(Preparing)|(Unpacking)|(update)]';
echo "installed system packages"
sudo locale-gen en_US.UTF-8
echo "ran locale-gen"
LANG=en_US.UTF-8
echo "set LANG"
LANGUAGE=en_US:en
echo "set LANGUAGE"

echo "INSTALLING PIP"
sudo curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo -H python3

echo "INSTALL virtualenv"
sudo -H pip install virtualenv

sudo git clone https://github.com/DanielJDufour/safecast /safecast
cd /safecast
sudo make install
echo "installed safecast"


text:
If you want your eloquent models to have the primary key as an UUID instead of the default incremental integer, you must use this abstract model on top of your models to convert them to an *Eloquent UUID Model*.

## Install

Just require this package within your composer:

    composer require danielcosta/eloquent-uuid:^1.0

## Sample usage

Using *Eloquent UUID Model* is as simple as just extending the abstract `UUIDEloquentModel`.

```php
use DCST\Database\Eloquent\Models\UUIDEloquentModel;

class Product extends UUIDEloquentModel
{
    // your class model
}

$product = new Product;
$product->name = 'My Awesome Product';
$product->save();

var_dump($product->id); // 55d53549-e772-4765-9467-5a75d33cbf6a
```


text:
Ext.define("DARPA.EntityTab", {

	extend:'Ext.tab.Panel',
//	extend:'Ext.Container',
	layout: {
		type:'vbox',
		align:'stretch'
	},
	items:[],
	entity:{},
	constructor:function(config) {

		var details = Ext.create("DARPA.EntityDetailsFrame", {
			title:'ENTITY DETAILS',
			id:config.id + '-Details',
			entityname:config.title,
                        institution: config.institution,
			entity:config.entity});
/*
// Only showing transfers for Enron
		var transactions = Ext.create("DARPA.Ledger", {
			title:'TRANSACTIONS',
			id:config.id + "-Ledger",
                        institution: config.institution,
			disabled:true

		});
*/
		var transfers = Ext.create("DARPA.TransfersLedger", {
			title:'EMAILS',
			id:config.id + '-Transfers',
                        institution: config.institution,
			disabled:true
		});

		var transactionGraph = Ext.create("DARPA.TransactionGraph", {
			title:'EMAIL GRAPH',
			id:config.id + '-TransGraph',
			entityId: config.id,
                        institution: config.institution,
			disabled:true
		});

		/* Graphene-Enron does not have a shared attribute entity graph */
		/*
		var entityGraph = Ext.create("DARPA.PBGraph", {
			hidden:true, // no shared entities for this data set
			title:'ENTITY GRAPH',
			entityId: config.id,
			id:config.id + '-EntityGraph',
                        institution: config.institution
		});
		*/

		this.items = [
		details,
//		transactions,
		transfers,
		transactionGraph,
		//entityGraph
		];

		this.callParent(arguments);

		/* Graphene-Enron does not have a shared attribute entity graph */
		/*
		entityGraph.load(config.id);
		if (entityGraph.prevLoadParams) {
			entityGraph.prevLoadParams.prevNumber = config.id;
		}
		else {
			entityGraph.prevLoadParams = {prevNumber: config.id};
		}
		*/
	},
/*
	loadLedger:function(account) {
		var t = this.getTransactions();
		t.getAllTransactions(account);
		t.setDisabled(false);
		this.setActiveTab(t);
	},
*/
	loadTransfers:function(account) {
		var t = this.getTransfers();
		t.getAllTransactions(account);
		t.setDisabled(false);
	},

	loadTransactionGraph:function(accountNumber, hasData) {
		var self=this;
		var t = self.getTransactionGraph();
		t.setDisabled(!hasData);
		if (hasData)
			t.load([accountNumber]);
	},

	getDetailsTab:function()
	{
		return Ext.getCmp(this.id+'-Details');
	},
/*
	getTransactions:function()
	{
		return this.items.items[1];
	},
*/
	getTransfers:function()
	{
		return Ext.getCmp(this.id+'-Transfers');
	},
	getTransactionGraph:function()
	{
		return Ext.getCmp(this.id+'-TransGraph');
	},
	getEntityGraph:function()
	{
		// note: this should return undefined, since Graphene-Enron does not have an entity graph
		var self = this;
		return Ext.getCmp(this.id+'-EntityGraph');
	}

});


text:
struct AMF0String;

struct AMF0Property {
  AMF0Property();
  ~AMF0Property();
  AMFType* value;
  AMF0String* name;
};

#endif


text:
/**
 * The last pass of the lexer, transforms the inline-level token stream and
 * transforms them into blocks of text.  These include sections, paragraphs,
 * images, tables, etc.
 *
 */
module.exports = {
  // Ignore paragraph breaks - they're just there to create new paragraph blocks
  // Also ignore unmatched code-blocks
  defaultLexeme: {
    token: 'IGNORE',
    partialMatchAttributeValue: function (history, input) {},
    attributeValue: function (history, input) {}
  },
  lexemes: [
    // Headings pass through
    {
      token: 'h1',
      pattern: [{token: 'h1'}],
      attributeValue: passThroughAttrValGenerator
    },
    {
      token: 'h2',
      pattern: [{token: 'h2'}],
      attributeValue: passThroughAttrValGenerator
    },
    {
      token: 'h3',
      pattern: [{token: 'h3'}],
      attributeValue: passThroughAttrValGenerator
    },

    // Figures and scripts pass through
    {
      token: 'figure',
      pattern: [{token: 'figure'}],
      attributeValue: passThroughAttrValGenerator
    },
    {
      token: 'blogImage',
      pattern: [{token: 'blogImage'}],
      attributeValue: passThroughAttrValGenerator
    },

    {
      token: 'script',
      pattern: [{token: 'script'}],
      attributeValue: passThroughAttrValGenerator
    },

    // HR passes through
    {
      token: 'hr',
      pattern: [{token: 'hr', repeat: true}],
      attributeValue: null
    },

    // Text blocks
    {
      token: 'paragraph',
      pattern: [{token: 'paragraph-line', repeat: true}],
      attributeValue: lineAggregator
    },
    {
      token: 'blockquote',
      pattern: [{token: 'quote-line', repeat: true}],
      attributeValue: lineAggregator
    },

    // TODO: Handle nesting within lists
    {
      token: 'list',
      pattern: [{token: 'list-line', repeat: true}],
      attributeValue: lineAggregator
    },

    {
      token: 'html',
      pattern: [
        {token: 'html-open'},
        {token: 'paragraph-line'},
        {token: 'html-open'}
      ],
      attributeValue: function (history) {
        return history[2].input.attributeValue.text; // Return the HTML text
      }
    }
  ]
};

/**
 * Return the attribute value as-is to the next level
 */
function passThroughAttrValGenerator(history, input) {
  return history.pop().input.attributeValue;
}

/**
 * For block-level elements, aggregate the lines into single blocks
 */
function lineAggregator(history) {
  history.shift(); // Remove the root node

  // Transform the history to remove the state and focus only on the tokens
  // remove empty paragraph lines
  var result = [];
  history.forEach(function (visit) {
    var input = visit.input;
    if (input.token !== 'paragraph-line') {
      return result.push(input);
    }

    if (input.attributeValue.type !== 'text') {
      return result.push(input);
    }

    if (input.attributeValue.text !== '') {
      result.push(visit.input);
    }
  });

  return result;
}


text:
ADAPTIVE PLUGIN README
======================

Information
-----------

### Description

Adaptive Modal is a jQuery plugin to display multiple modal windows.

### Author

Pierre Urban

### Version

0.0.1

### License

Free to use under the [MIT](http://www.opensource.org/licenses/mit-license.php) license, see LICENSE file.

Usage
-----

### JS

    $('a[data-adaptive-modal-id]').adaptiveModal();

### HTML

    First modal
    Second modal

      Hello World! Close the modal

      Peace off! Close the modal

### CSS

    .adaptive-modal {
      display: none;
    }
    #adaptive-modal-overlay {
      z-index: 42001;
      position: fixed;
      top: 0px;
      left: 0px;
      height: 100%;
      width: 100%;
      background: #000;
      display: none;
    }
    #adaptive-modal-window {
      z-index: 42002;
      position: absolute;
      border: 1px solid #333;
      background-color: #fff;
      width: 750px;
      padding: 0 0 0 0;
      top: 150px;
      left: 50%;
      margin-left: -375px;
      display: none;
      -moz-box-shadow: 2px 2px 15px #000000;
      -webkit-box-shadow: 2px 2px 15px #000000;
      box-shadow: 2px 2px 15px #000000;
      filter: "progid: DXImageTransform.Microsoft.Shadow(strength = 2, direction = 135, color = '#000000')";
      -ms-filter: "progid: DXImageTransform.Microsoft.Shadow(strength = 2, Direction = 135, Color = '#000000')";
    }
    #adaptive-modal-content {
      margin: 10px;
      font-size: 16px;
      font-family: Arial;
    }

Options
-------

You can customize Adaptive Modal with some options:

* name: the prefix use which defines `name`-overlay (the overlay), `name`-window (the modal), `name`-content (the modal's content), `name`-close (class to bind a click event to close the modal)
* duration: the number of milliseconds before hiding the modal
* opacity: the overlay opacity

### Example

    $('a[data-my-specific-name-id]').adaptiveModal({
      name : 'my-specific-name',
      duration : 1000,
      opacity: 0.5
    });


text:
namespace Platformer.Engine
{
    /// <summary>
    /// Enumeration containing options which effect how entities behave.
    /// </summary>
    public enum EntityOptions
    {
        /// <summary>
        /// No options set.
        /// </summary>
        None = 0,

        /// <summary>
        /// The entity has been spawned.
        /// </summary>
        Spawned = (1 << 0),

        /// <summary>
        /// The entity has been killed.
        /// </summary>
        Killed = (1 << 1),

        /// <summary>
        /// The entity participates in collisions.
        /// </summary>
        Collidable = (1 << 2),

        /// <summary>
        /// The entity is visible and should be rendered.
        /// </summary>
        Visible = (1 << 3)
    }
}


text:
using System;
//•	Write a program that finds in given array of integers a sequence of given sum S (if present).

class FindSumInArray
{
    static void Main()
    {
        Console.Write("Enter array lenght: ");
        int lenght = int.Parse(Console.ReadLine());
        Console.Write("Enter wanted sum S: ");
        double s = double.Parse(Console.ReadLine());
        double[] array = new double[lenght];
        //double bestSum = double.MinValue;
        int bestStartIndex = 0;
        int endIndex = 0;
        double sum = 0;

        for (int i = 0; i < array.Length; i++)
        {
            Console.Write("Enter element [{0}]: ", i);
            array[i] = double.Parse(Console.ReadLine());
        }

        for (int j = 0; j < array.Length; j++)
        {
            sum = array[j];
            for (int i = j+1; i < array.Length; i++)
            {
                sum += array[i];
                if (sum == s)
                {
                    bestStartIndex = j;
                    endIndex = i;
                }
                else if (sum < s)
                {
                    continue;
                }
                else
                {
                    break;
                }
            }

        }
        if (endIndex-bestStartIndex > 1)
        {

            Console.WriteLine("The elements with sum {0}:", s);
            for (int i = bestStartIndex; i <= endIndex; i++)
            {
                if (i < endIndex)
                {
                    Console.Write(array[i] + ", ");
                }
                else
                {
                    Console.WriteLine(array[i]);
                }
            }
        }
        else
        {
            Console.WriteLine("No such sequence!");
        }

    }
}


text:
require 'cloudflair/entity'

module Cloudflair
  class Websockets
    include Cloudflair::Entity

    attr_reader :zone_id

    patchable_fields :value
    path 'zones/:zone_id/settings/websockets'

    def initialize(zone_id)
      @zone_id = zone_id
    end
  end
end


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

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
pl.burningice.plugins.image.ast.intarface (BurningImage)
</TITLE>

<META NAME="date" CONTENT="2010-06-27">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">

pl.burningice.plugins.image.ast.intarface

Interfaces

DBImageContainer

FileImageContainer

ImageContainer


text:
package org.librairy.boot.storage.system.column.domain;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.librairy.boot.model.domain.resources.Annotation;
import org.librairy.boot.model.domain.resources.Listener;
import org.springframework.data.cassandra.mapping.Table;

/**
 * Created by cbadenes on 22/12/15.
 */
@Table(value = "listeners")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ListenerColumn extends Listener {

}


text:
/**
 * Author: gnomjogson
 * Date: 28.03.14
 * Created: 16:18
 **/
(function(window){

    UserProfileImages.prototype.constructor = UserProfileImages;
    UserProfileImages.prototype = {
        git_api: "https://api.github.com/users/",
        twitter_api :"http://www.wartegarten.de/cfg/php/get_tweets.php"
    }

    var ref, $members;
    function UserProfileImages(){
        ref = this;
    };

    UserProfileImages.prototype.init = function()
    {
        $members = $('.lab-members').find('img');
        $members.each(function(i){
            var vo = {};
            vo.index = i;
            vo.uTwitter = $(this).data('username-twitter');
            vo.uGit = $(this).data('username-git');
            this.vo = vo;

            if(vo.uGit.length > 0){
                //when its a git user, we grap profile pic from here
                ref.getGitProfileImage(this);
            } else {
                if(vo.uTwitter.length > 0){
                    ref.getTwitterProfileImage(this);
                } else {
                    // haz no account anywhere
                }
            }

        });
        //console.log("$members -> " + $members.length);
    }

    UserProfileImages.prototype.getGitProfileImage = function(pImg)
    {
        //console.log("get git info for -> " + pImg.vo.uGit);
        $.getJSON(ref.git_api + pImg.vo.uGit,
            function(data){
                $(pImg).attr('src', data.avatar_url);
                //console.log("data -> " + data.avatar_url + " " + $(pImg).attr('src'));
            });
    }

    UserProfileImages.prototype.getTwitterProfileImage = function(pImg)
    {
        //console.log("get twitter info for -> " + pImg.vo.uTwitter);
        /*$.getJSON(ref.twitter_api + "?user=" + pImg.vo.uTwitter + "&size=original",
            function(data){
                //profile_image_url
                var url = data.profile_image_url;
                var _index = url.lastIndexOf(".");
                var format = url.substr(_index,url.length);
                var _index = url.lastIndexOf("_");
                var org = url.substr(0,_index) + format;
                $(pImg).attr('src', org);
            });*/
    }

    window.UserProfileImages = UserProfileImages;

}(window));


text:
#ifndef _CORE_BLUETOOTH_H_
#warning Please do not import this header file directly. Use <CoreBluetooth/CoreBluetooth.h> instead.
#endif

#import <CoreBluetooth/CBDefines.h>
#import <CoreBluetooth/CBPeer.h>

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

/*!
 *  @enum CBPeripheralState
 *
 *  @discussion Represents the current connection state of a CBPeripheral.
 *
 */
typedef NS_ENUM(NSInteger, CBPeripheralState) {
	CBPeripheralStateDisconnected = 0,
	CBPeripheralStateConnecting,
	CBPeripheralStateConnected,
	CBPeripheralStateDisconnecting NS_AVAILABLE(NA, 9_0),
} NS_AVAILABLE(NA, 7_0);

/*!
 *  @enum CBCharacteristicWriteType
 *
 *  @discussion Specifies which type of write is to be performed on a CBCharacteristic.
 *
 */
typedef NS_ENUM(NSInteger, CBCharacteristicWriteType) {
	CBCharacteristicWriteWithResponse = 0,
	CBCharacteristicWriteWithoutResponse,
};

@protocol CBPeripheralDelegate;
@class CBService, CBCharacteristic, CBDescriptor, CBUUID;

/*!
 *  @class CBPeripheral
 *
 *  @discussion Represents a peripheral.
 */
NS_CLASS_AVAILABLE(10_7, 5_0)
CB_EXTERN_CLASS @interface CBPeripheral : CBPeer

/*!
 *  @property delegate
 *
 *  @discussion The delegate object that will receive peripheral events.
 */
@property(assign, nonatomic, nullable) id<CBPeripheralDelegate> delegate;

/*!
 *  @property name
 *
 *  @discussion The name of the peripheral.
 */
@property(retain, readonly, nullable) NSString *name;

/*!
 *  @property RSSI
 *
 *  @discussion The most recently read RSSI, in decibels.
 *
 *  @deprecated Use {@link peripheral:didReadRSSI:error:} instead.
 */
@property(retain, readonly, nullable) NSNumber *RSSI NS_DEPRECATED(NA, NA, 5_0, 8_0);

/*!
 *  @property state
 *
 *  @discussion The current connection state of the peripheral.
 */
@property(readonly) CBPeripheralState state;

/*!
 *  @property services
 *
 *  @discussion A list of CBService objects that have been discovered on the peripheral.
 */
@property(retain, readonly, nullable) NSArray<CBService *> *services;

/*!
 *  @method readRSSI
 *
 *  @discussion While connected, retrieves the current RSSI of the link.
 *
 *  @see        peripheral:didReadRSSI:error:
 */
- (void)readRSSI;

/*!
 *  @method discoverServices:
 *
 *  @param serviceUUIDs A list of CBUUID objects representing the service types to be discovered. If nil,
 *						all services will be discovered, which is considerably slower and not recommended.
 *
 *  @discussion			Discovers available service(s) on the peripheral.
 *
 *  @see				peripheral:didDiscoverServices:
 */
- (void)discoverServices:(nullable NSArray<CBUUID *> *)serviceUUIDs;

/*!
 *  @method discoverIncludedServices:forService:
 *
 *  @param includedServiceUUIDs A list of CBUUID objects representing the included service types to be discovered. If nil,
 *								all of services included services will be discovered, which is considerably slower and not recommended.
 *  @param service				A GATT service.
 *
 *  @discussion					Discovers the specified included service(s) of service.
 *
 *  @see						peripheral:didDiscoverIncludedServicesForService:error:
 */
- (void)discoverIncludedServices:(nullable NSArray<CBUUID *> *)includedServiceUUIDs forService:(CBService *)service;

/*!
 *  @method discoverCharacteristics:forService:
 *
 *  @param characteristicUUIDs	A list of CBUUID objects representing the characteristic types to be discovered. If nil,
 *								all characteristics of service will be discovered, which is considerably slower and not recommended.
 *  @param service				A GATT service.
 *
 *  @discussion					Discovers the specified characteristic(s) of service.
 *
 *  @see						peripheral:didDiscoverCharacteristicsForService:error:
 */
- (void)discoverCharacteristics:(nullable NSArray<CBUUID *> *)characteristicUUIDs forService:(CBService *)service;

/*!
 *  @method readValueForCharacteristic:
 *
 *  @param characteristic	A GATT characteristic.
 *
 *  @discussion				Reads the characteristic value for characteristic.
 *
 *  @see					peripheral:didUpdateValueForCharacteristic:error:
 */
- (void)readValueForCharacteristic:(CBCharacteristic *)characteristic;

/*!
 *  @method		maximumWriteValueLengthForType:
 *
 *  @discussion	The maximum amount of data, in bytes, that can be sent to a characteristic in a single write type.
 *
 *  @see		writeValue:forCharacteristic:type:
 */
- (NSUInteger)maximumWriteValueLengthForType:(CBCharacteristicWriteType)type NS_AVAILABLE(NA, 9_0);

/*!
 *  @method writeValue:forCharacteristic:type:
 *
 *  @param data				The value to write.
 *  @param characteristic	The characteristic whose characteristic value will be written.
 *  @param type				The type of write to be executed.
 *
 *  @discussion				Writes value to characteristic's characteristic value.
 *							If the CBCharacteristicWriteWithResponse type is specified, {@link peripheral:didWriteValueForCharacteristic:error:}
 *							is called with the result of the write request.
 *							If the CBCharacteristicWriteWithoutResponse type is specified, the delivery of the data is best-effort and not
 *							guaranteed.
 *
 *  @see					peripheral:didWriteValueForCharacteristic:error:
 *	@see					CBCharacteristicWriteType
 */
- (void)writeValue:(NSData *)data forCharacteristic:(CBCharacteristic *)characteristic type:(CBCharacteristicWriteType)type;

/*!
 *  @method setNotifyValue:forCharacteristic:
 *
 *  @param enabled			Whether or not notifications/indications should be enabled.
 *  @param characteristic	The characteristic containing the client characteristic configuration descriptor.
 *
 *  @discussion				Enables or disables notifications/indications for the characteristic value of characteristic. If characteristic
 *							allows both, notifications will be used.
 *                          When notifications/indications are enabled, updates to the characteristic value will be received via delegate method
 *                          @link peripheral:didUpdateValueForCharacteristic:error: @/link. Since it is the peripheral that chooses when to send an update,
 *                          the application should be prepared to handle them as long as notifications/indications remain enabled.
 *
 *  @see					peripheral:didUpdateNotificationStateForCharacteristic:error:
 *  @seealso                CBConnectPeripheralOptionNotifyOnNotificationKey
 */
- (void)setNotifyValue:(BOOL)enabled forCharacteristic:(CBCharacteristic *)characteristic;

/*!
 *  @method discoverDescriptorsForCharacteristic:
 *
 *  @param characteristic	A GATT characteristic.
 *
 *  @discussion				Discovers the characteristic descriptor(s) of characteristic.
 *
 *  @see					peripheral:didDiscoverDescriptorsForCharacteristic:error:
 */
- (void)discoverDescriptorsForCharacteristic:(CBCharacteristic *)characteristic;

/*!
 *  @method readValueForDescriptor:
 *
 *  @param descriptor	A GATT characteristic descriptor.
 *
 *  @discussion			Reads the value of descriptor.
 *
 *  @see				peripheral:didUpdateValueForDescriptor:error:
 */
- (void)readValueForDescriptor:(CBDescriptor *)descriptor;

/*!
 *  @method writeValue:forDescriptor:
 *
 *  @param data			The value to write.
 *  @param descriptor	A GATT characteristic descriptor.
 *
 *  @discussion			Writes data to descriptor's value. Client characteristic configuration descriptors cannot be written using
 *						this method, and should instead use @link setNotifyValue:forCharacteristic: @/link.
 *
 *  @see				peripheral:didWriteValueForCharacteristic:error:
 */
- (void)writeValue:(NSData *)data forDescriptor:(CBDescriptor *)descriptor;

@end

/*!
 *  @protocol CBPeripheralDelegate
 *
 *  @discussion Delegate for CBPeripheral.
 *
 */
@protocol CBPeripheralDelegate <NSObject>

@optional

/*!
 *  @method peripheralDidUpdateName:
 *
 *  @param peripheral	The peripheral providing this update.
 *
 *  @discussion			This method is invoked when the @link name @/link of peripheral changes.
 */
- (void)peripheralDidUpdateName:(CBPeripheral *)peripheral NS_AVAILABLE(NA, 6_0);

/*!
 *  @method peripheral:didModifyServices:
 *
 *  @param peripheral			The peripheral providing this update.
 *  @param invalidatedServices	The services that have been invalidated
 *
 *  @discussion			This method is invoked when the @link services @/link of peripheral have been changed.
 *						At this point, the designated CBService objects have been invalidated.
 *						Services can be re-discovered via @link discoverServices: @/link.
 */
- (void)peripheral:(CBPeripheral *)peripheral didModifyServices:(NSArray<CBService *> *)invalidatedServices NS_AVAILABLE(NA, 7_0);

/*!
 *  @method peripheralDidUpdateRSSI:error:
 *
 *  @param peripheral	The peripheral providing this update.
 *	@param error		If an error occurred, the cause of the failure.
 *
 *  @discussion			This method returns the result of a @link readRSSI: @/link call.
 *
 *  @deprecated			Use {@link peripheral:didReadRSSI:error:} instead.
 */
- (void)peripheralDidUpdateRSSI:(CBPeripheral *)peripheral error:(nullable NSError *)error NS_DEPRECATED(NA, NA, 5_0, 8_0);

/*!
 *  @method peripheral:didReadRSSI:error:
 *
 *  @param peripheral	The peripheral providing this update.
 *  @param RSSI			The current RSSI of the link.
 *  @param error		If an error occurred, the cause of the failure.
 *
 *  @discussion			This method returns the result of a @link readRSSI: @/link call.
 */
- (void)peripheral:(CBPeripheral *)peripheral didReadRSSI:(NSNumber *)RSSI error:(nullable NSError *)error NS_AVAILABLE(NA, 8_0);

/*!
 *  @method peripheral:didDiscoverServices:
 *
 *  @param peripheral	The peripheral providing this information.
 *	@param error		If an error occurred, the cause of the failure.
 *
 *  @discussion			This method returns the result of a @link discoverServices: @/link call. If the service(s) were read successfully, they can be retrieved via
 *						peripheral's @link services @/link property.
 *
 */
- (void)peripheral:(CBPeripheral *)peripheral didDiscoverServices:(nullable NSError *)error;

/*!
 *  @method peripheral:didDiscoverIncludedServicesForService:error:
 *
 *  @param peripheral	The peripheral providing this information.
 *  @param service		The CBService object containing the included services.
 *	@param error		If an error occurred, the cause of the failure.
 *
 *  @discussion			This method returns the result of a @link discoverIncludedServices:forService: @/link call. If the included service(s) were read successfully,
 *						they can be retrieved via service's includedServices property.
 */
- (void)peripheral:(CBPeripheral *)peripheral didDiscoverIncludedServicesForService:(CBService *)service error:(nullable NSError *)error;

/*!
 *  @method peripheral:didDiscoverCharacteristicsForService:error:
 *
 *  @param peripheral	The peripheral providing this information.
 *  @param service		The CBService object containing the characteristic(s).
 *	@param error		If an error occurred, the cause of the failure.
 *
 *  @discussion			This method returns the result of a @link discoverCharacteristics:forService: @/link call. If the characteristic(s) were read successfully,
 *						they can be retrieved via service's characteristics property.
 */
- (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForService:(CBService *)service error:(nullable NSError *)error;

/*!
 *  @method peripheral:didUpdateValueForCharacteristic:error:
 *
 *  @param peripheral		The peripheral providing this information.
 *  @param characteristic	A CBCharacteristic object.
 *	@param error			If an error occurred, the cause of the failure.
 *
 *  @discussion				This method is invoked after a @link readValueForCharacteristic: @/link call, or upon receipt of a notification/indication.
 */
- (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(nullable NSError *)error;

/*!
 *  @method peripheral:didWriteValueForCharacteristic:error:
 *
 *  @param peripheral		The peripheral providing this information.
 *  @param characteristic	A CBCharacteristic object.
 *	@param error			If an error occurred, the cause of the failure.
 *
 *  @discussion				This method returns the result of a {@link writeValue:forCharacteristic:type:} call, when the CBCharacteristicWriteWithResponse type is used.
 */
 - (void)peripheral:(CBPeripheral *)peripheral didWriteValueForCharacteristic:(CBCharacteristic *)characteristic error:(nullable NSError *)error;

/*!
 *  @method peripheral:didUpdateNotificationStateForCharacteristic:error:
 *
 *  @param peripheral		The peripheral providing this information.
 *  @param characteristic	A CBCharacteristic object.
 *	@param error			If an error occurred, the cause of the failure.
 *
 *  @discussion				This method returns the result of a @link setNotifyValue:forCharacteristic: @/link call.
 */
- (void)peripheral:(CBPeripheral *)peripheral didUpdateNotificationStateForCharacteristic:(CBCharacteristic *)characteristic error:(nullable NSError *)error;

/*!
 *  @method peripheral:didDiscoverDescriptorsForCharacteristic:error:
 *
 *  @param peripheral		The peripheral providing this information.
 *  @param characteristic	A CBCharacteristic object.
 *	@param error			If an error occurred, the cause of the failure.
 *
 *  @discussion				This method returns the result of a @link discoverDescriptorsForCharacteristic: @/link call. If the descriptors were read successfully,
 *							they can be retrieved via characteristic's descriptors property.
 */
- (void)peripheral:(CBPeripheral *)peripheral didDiscoverDescriptorsForCharacteristic:(CBCharacteristic *)characteristic error:(nullable NSError *)error;

/*!
 *  @method peripheral:didUpdateValueForDescriptor:error:
 *
 *  @param peripheral		The peripheral providing this information.
 *  @param descriptor		A CBDescriptor object.
 *	@param error			If an error occurred, the cause of the failure.
 *
 *  @discussion				This method returns the result of a @link readValueForDescriptor: @/link call.
 */
- (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForDescriptor:(CBDescriptor *)descriptor error:(nullable NSError *)error;

/*!
 *  @method peripheral:didWriteValueForDescriptor:error:
 *
 *  @param peripheral		The peripheral providing this information.
 *  @param descriptor		A CBDescriptor object.
 *	@param error			If an error occurred, the cause of the failure.
 *
 *  @discussion				This method returns the result of a @link writeValue:forDescriptor: @/link call.
 */
- (void)peripheral:(CBPeripheral *)peripheral didWriteValueForDescriptor:(CBDescriptor *)descriptor error:(nullable NSError *)error;

@end

NS_ASSUME_NONNULL_END


text:
<?php

namespace App\Http\Middleware;

use Closure;
use \Firebase\JWT\JWT;
use Illuminate\Encryption\Encrypter;

class ParseLaravelToken
{
    private $encrypter;

    public function __construct(Encrypter $encrypter) {
        $this->encrypter = $encrypter;
    }

    public function handle($request, Closure $next, $guard = null)
    {
        $encryptedToken = $request->cookie('laravel_token');

        if (!empty($encryptedToken)) {
            $key = $this->encrypter->getKey();
            $token = $this->encrypter->decrypt($encryptedToken);
            $data = JWT::decode($token, $key, ['HS256']);
            if (false === $request->headers->get('x-csrf-token', false)) {
                $request->headers->add([
                    'X-CSRF-TOKEN' => $data->csrf,
                    'X-Requested-With' => 'XMLHttpRequest',
                    'X-XSRF-TOKEN' => $request->cookie('laravel_token'),
                ]);
            }
        }

        return $next($request);
    }
}


text:
package br.com.senai.stayFilm.enumeration;

public enum TypeAttachment {

	FOTO("foto"), VIDEO("Video"), FILME("filme");

	private String typeAttachment;

	TypeAttachment(String typeAttachment) {
		this.typeAttachment = typeAttachment;
	}

	public String getTypeAttachment() {
		return typeAttachment;
	}

	public void setTypeAttachment(String typeAttachment) {
		this.typeAttachment = typeAttachment;
	}

}


text:
cask "treesheets" do
  version :latest
  sha256 :no_check

  url "http://strlen.com/treesheets/treesheets_osx.zip"
  name "TreeSheets"
  homepage "http://strlen.com/treesheets/"

  app "TreeSheetsBeta/TreeSheets.app"
end


text:
package org.apache.jackrabbit.oak.plugins.index.elastic;

import org.apache.jackrabbit.oak.Oak;
import org.apache.jackrabbit.oak.jcr.Jcr;
import org.apache.jackrabbit.oak.plugins.index.IndexSuggestionCommonTest;
import org.apache.jackrabbit.oak.plugins.index.TestUtil;
import org.junit.ClassRule;

import javax.jcr.Repository;

public class ElasticIndexSuggestionCommonTest extends IndexSuggestionCommonTest {

    @ClassRule
    public static final ElasticConnectionRule elasticRule =
            new ElasticConnectionRule(ElasticTestUtils.ELASTIC_CONNECTION_STRING);

    protected Repository createJcrRepository() {
        indexOptions = new ElasticIndexOptions();
        repositoryOptionsUtil = new ElasticTestRepositoryBuilder(elasticRule).build();
        Oak oak = repositoryOptionsUtil.getOak();
        Jcr jcr = new Jcr(oak);
        return jcr.createRepository();
    }

    protected void assertEventually(Runnable r) {
        TestUtil.assertEventually(r,
                ((repositoryOptionsUtil.isAsync() ? repositoryOptionsUtil.defaultAsyncIndexingTimeInSeconds : 0) + ElasticIndexDefinition.BULK_FLUSH_INTERVAL_MS_DEFAULT) * 5);
    }
}


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

<TITLE>
ConsistentAreaTester
</TITLE>

<META NAME="keywords" CONTENT="com.vividsolutions.jts.operation.valid.ConsistentAreaTester class">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

com.vividsolutions.jts.operation.valid

Class ConsistentAreaTester

java.lang.Object
  com.vividsolutions.jts.operation.valid.ConsistentAreaTester

public class ConsistentAreaTester
extends java.lang.Object

Checks that a GeometryGraph representing an area
 (a Polygon or MultiPolygon )
 has consistent semantics for area geometries.
 This check is required for any reasonable polygonal model
 (including the OGC-SFS model, as well as models which allow ring self-intersection at single points)

 Checks include:

test for rings which properly intersect
 (but not for ring self-intersection, or intersections at vertices)

test for consistent labelling at all node points
 (this detects vertex intersections with invalid topology,
 i.e. where the exterior side of an edge lies in the interior of the area)

test for duplicate rings

 If an inconsistency is found the location of the problem
 is recorded and is available to the caller.

Version:

1.7

Constructor Summary

ConsistentAreaTester(GeometryGraph geomGraph)

          Creates a new tester for consistent areas.

Method Summary

 Coordinate
getInvalidPoint()

 boolean
hasDuplicateRings()

          Checks for two duplicate rings in an area.

 boolean
isNodeConsistentArea()

          Check all nodes to see if their labels are consistent with area topology.

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

ConsistentAreaTester

public ConsistentAreaTester(GeometryGraph geomGraph)

Creates a new tester for consistent areas.

Parameters:
geomGraph - the topology graph of the area geometry

Method Detail

getInvalidPoint

public Coordinate getInvalidPoint()

Returns:
the intersection point, or null if none was found

isNodeConsistentArea

public boolean isNodeConsistentArea()

Check all nodes to see if their labels are consistent with area topology.

Returns:
true if this area has a consistent node labelling

hasDuplicateRings

public boolean hasDuplicateRings()

Checks for two duplicate rings in an area.
 Duplicate rings are rings that are topologically equal
 (that is, which have the same sequence of points up to point order).
 If the area is topologically consistent (determined by calling the
 isNodeConsistentArea,
 duplicate rings can be found by checking for EdgeBundles which contain
 more than one EdgeEnd.
 (This is because topologically consistent areas cannot have two rings sharing
 the same line segment, unless the rings are equal).
 The start point of one of the equal rings will be placed in
 invalidPoint.

Returns:
true if this area Geometry is topologically consistent but has two duplicate rings

      Overview
      Package
    Class
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD


text:
<?php namespace net\xp_forge\token;

class TokenSequenceIterator extends \lang\Object implements \util\XPIterator {
  private $sequence= null;
  private $pos= 0;

  public function __construct(TokenSequence $sequence) {
    $this->sequence= $sequence;
  }

  public function hasNext() {
    return $this->pos < $this->sequence->length();
  }

  public function next() {
    if ($this->sequence->length() <= $this->pos) {
      return null;
    }

    return $this->sequence->at($this->pos++);
  }
}


text:
import { compose, withState } from 'recompose'
import { withData } from 'spunky'
import { injectIntl } from 'react-intl'

import withAuthData from '../../../hocs/withAuthData'

import ContactForm from './ContactForm'
import contactsActions from '../../../actions/contactsActions'
import withChainData from '../../../hocs/withChainData'
import withCameraAvailability from '../../../hocs/withCameraAvailability'

const mapContactsDataToProps = (contacts: Object) => ({ contacts })

export default compose(
  withAuthData(),
  withChainData(),
  withData(contactsActions, mapContactsDataToProps),
  withState('formName', 'setName', ({ formName }) => formName || ''),
  withState(
    'formAddress',
    'setAddress',
    ({ formAddress }) => formAddress || '',
  ),
  injectIntl,
  withCameraAvailability,
)(ContactForm)


text:
package org.apache.reef.driver.context;

import org.apache.reef.annotations.Provided;
import org.apache.reef.annotations.audience.DriverSide;
import org.apache.reef.annotations.audience.Public;

/**
 * Represents a Context that has been closed succesfully.
 */
@Public
@DriverSide
@Provided
public interface ClosedContext extends ContextBase {

  /**
   * @return the new top of the stack of context.
   */
  ActiveContext getParentContext();
}


text:
FROM nginx:alpine
MAINTAINER iaroki
COPY . /usr/share/nginx/html


text:
  Épreville-près-le-Neubourg est
       un village
       localisé dans le département de l'Eure en Haute-Normandie. Elle totalisait 423 habitants en 2008.

La commune offre quelques  équipements sportifs, elle propose entre autres un terrain de tennis et un terrain de sport.

Si vous pensez venir habiter à Épreville-près-le-Neubourg, vous pourrez aisément trouver une maison à vendre.

Le parc d'habitations, à Épreville-près-le-Neubourg, était réparti en 2011 en un appartements et 192 maisons soit
 un marché plutôt équilibré.

À coté de Épreville-près-le-Neubourg sont localisées les villes de
Sainte-Colombe-la-Commanderie localisée à 4 km, 639 habitants,
Le Tremblay-Omonville à 2 km, 283 habitants,
Villez-sur-le-Neubourg à 2 km, 284 habitants,
Vitot localisée à 3 km, 474 habitants,
Combon située à 4 km, 700 habitants,
Rouge-Perriers située à 3 km, 243 habitants,
 entre autres. De plus, Épreville-près-le-Neubourg est située à seulement 23 km de Évreux.


text:
package ua.com.fielden.platform.entity.query.generation;

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

import ua.com.fielden.platform.entity.query.fluent.enums.TokenCategory;
import ua.com.fielden.platform.entity.query.generation.elements.GroupBy;
import ua.com.fielden.platform.entity.query.generation.elements.GroupBys;
import ua.com.fielden.platform.utils.Pair;

public class QryGroupsBuilder extends AbstractTokensBuilder {

    protected QryGroupsBuilder(final EntQueryGenerator queryBuilder, final Map<String, Object> paramValues) {
        super(null, queryBuilder, paramValues);
    }

    @Override
    public boolean isClosing() {
        return false;
    }

    public GroupBys getModel() {
        if (getChild() != null && getSize() == 0) {
            throw new RuntimeException("Unable to produce result - unfinished model state!");
        }
        final List<GroupBy> groups = new ArrayList<>();
        for (final Pair<TokenCategory, Object> pair : getTokens()) {
            groups.add((GroupBy) pair.getValue());
        }

        return new GroupBys(groups);
    }

    @Override
    public Pair<TokenCategory, Object> getResult() {
        throw new RuntimeException("Not applicable!");
    }
}


text:
drop table if exists order_detail_approval;
drop table if exists order_detail;
drop table if exists customer_order;
drop table if exists sku;
drop table if exists product;
drop table if exists vendor_address;
drop table if exists vendor;
drop table if exists customer;

create table customer (
  id bigserial primary key
  , name text not null
  , zip_code text not null
  , address text not null
  , phone_number text not null
  , registered_at timestamp with time zone not null
);
COMMENT ON TABLE customer IS 'Customer Information';
COMMENT ON COLUMN customer.name IS 'Customer Name';
COMMENT ON COLUMN customer.zip_code IS 'Customer Zip Code';
COMMENT ON COLUMN customer.address IS 'Customer Address';
COMMENT ON COLUMN customer.phone_number IS 'Customer Phone Number';

create table vendor (
  id bigserial primary key
  , name text not null
  , phone_number text not null
);

create table vendor_address (
  vendor_id bigint primary key
  , zip_code text not null
  , state text not null
  , city text not null
  , line1 text not null
  , line2 text not null
  , FOREIGN KEY(vendor_id) REFERENCES vendor (id)
);

create table product (
  id bigserial primary key
  , vendor_id bigint not null
  , name text not null
  , country text not null
  , category text not null
  , FOREIGN KEY(vendor_id) REFERENCES vendor (id)
);

create table sku (
  id bigserial primary key
  , product_id bigint not null
  , color text not null
  , size text not null
  , weight numeric not null
  , sales_unit_price numeric not null
  , purchase_unit_price numeric not null
  , FOREIGN KEY(product_id) REFERENCES product (id)
);

create table customer_order (
  id bigserial primary key
  , customer_id bigint not null
  , delivery_method text not null
  , shipping_address text not null
  , payment_method text not null
  , total_price numeric not null
  , total_tax_amount numeric not null
  , ordered_at timestamp with time zone not null
  , FOREIGN KEY(customer_id) REFERENCES customer (id)
);

create table order_detail (
  id bigserial not null
  , customer_order_id bigint not null
  , sku_id bigint not null
  , amount bigint not null
  , price_before_tax numeric not null
  , price_after_tax numeric not null
  , ordered_at timestamp with time zone not null
  , PRIMARY KEY(id, customer_order_id)
  , FOREIGN KEY(customer_order_id) REFERENCES customer_order (id)
  , FOREIGN KEY(sku_id) REFERENCES sku (id)
);

create table order_detail_approval (
  order_detail_id bigint not null
  , customer_order_id bigint not null
  , operator_id bigint not null
  , approved_at timestamp with time zone not null
  , PRIMARY KEY(order_detail_id, customer_order_id)
  , FOREIGN KEY(order_detail_id, customer_order_id) REFERENCES order_detail (id, customer_order_id)
)


text:
layout: post
title: "0x00000015"
date: 2018-01-06
---

Many actors when an attempt to phish a user will tend to use bit.ly link to hide the original URL from end-user.

> Example: http://bit.ly/2CJ4oib ===> https://area1337.com

This link is redirection to the front-page to area1337.com but we can't really identify unless we visit the bit.ly link. Bit.ly has an option that will allow you to see the link behind the URL by adding a plus sign to the end of link.

> Example: https://bitly.com/2CJ4oib+

![]({{ site.url }}/img/20180106/Greenshot-2018-01-06-00.32.22-1024x428.png)

Above is screenshot of what it looks like after adding the plus sign at the end.


text:
namespace capnp {
namespace {

TEST(Common, Version) {
#ifdef VERSION
  auto expectedVersion =
      kj::str(CAPNP_VERSION_MAJOR, '.', CAPNP_VERSION_MINOR, '.', CAPNP_VERSION_MICRO);
  auto devVersion =
      kj::str(CAPNP_VERSION_MAJOR, '.', CAPNP_VERSION_MINOR, "-dev");
  kj::StringPtr actualVersion = VERSION;
  KJ_ASSERT(actualVersion == expectedVersion ||
            actualVersion.startsWith(kj::str(expectedVersion, '-')) ||
            (actualVersion == devVersion && CAPNP_VERSION_MICRO == 0),
            expectedVersion, actualVersion);
#endif
}

}  // namespace
}  // namespace capnp


text:
package bat

import (
	"context"
	"strconv"

	"github.com/ciao-project/ciao/ssntp/uuid"
)

// TenantSummary is a short form of Tenant
type TenantSummary struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

// TenantsListResponse stores a list of tenants retrieved by listTenants
type TenantsListResponse struct {
	Tenants []TenantSummary `json:"tenants"`
}

// TenantConfig stores the configurable attributes of a tenant.
type TenantConfig struct {
	Name       string `json:"name"`
	SubnetBits int    `json:"subnet_bits"`
}

// GetAllTenants retrieves a list of all tenants in the cluster by calling
// ciao-cli tenant list -all. An error will be returned if the following
// environment variables are not set; CIAO_ADMIN_CLIENT_CERT_FILE,
// CIAO_CONTROLLER.
func GetAllTenants(ctx context.Context) (TenantsListResponse, error) {
	var tenants TenantsListResponse

	args := []string{"tenant", "list", "-all", "-f", "{{tojson .}}"}
	err := RunCIAOCLIAsAdminJS(ctx, "", args, &tenants)
	if err != nil {
		return tenants, err
	}

	return tenants, nil
}

// CreateTenant creates a new tenant with the given config.
// It calls ciao-cli tenant create.
func CreateTenant(ctx context.Context, config TenantConfig) (TenantSummary, error) {
	var summary TenantSummary

	args := []string{"tenant", "create", "-tenant", uuid.Generate().String(), "-name", config.Name, "-subnet-bits", strconv.Itoa(config.SubnetBits), "-f", "{{tojson .}}"}
	err := RunCIAOCLIAsAdminJS(ctx, "", args, &summary)

	return summary, err
}

// UpdateTenant updates a new tenant with the given config.
// It calls ciao-cli tenant update.
func UpdateTenant(ctx context.Context, ID string, config TenantConfig) error {
	args := []string{"tenant", "update", "-for-tenant", ID}
	if config.Name != "" {
		name := []string{"-name", config.Name}
		args = append(args, name...)
	}

	if config.SubnetBits != 0 {
		bits := []string{"-subnet-bits", strconv.Itoa(config.SubnetBits)}
		args = append(args, bits...)
	}

	_, err := RunCIAOCLIAsAdmin(ctx, "", args)
	return err
}

// GetTenantConfig retrieves the configuration for the given tenant.
func GetTenantConfig(ctx context.Context, ID string) (TenantConfig, error) {
	var config TenantConfig

	args := []string{"tenant", "list", "-config", "-for-tenant", ID, "-f", "{{tojson .}}"}
	err := RunCIAOCLIAsAdminJS(ctx, "", args, &config)

	return config, err
}

// DeleteTenant will delete the given tenant.
// It calls ciao-cli tenant delete.
func DeleteTenant(ctx context.Context, ID string) error {
	args := []string{"tenant", "delete", "-tenant", ID}
	_, err := RunCIAOCLIAsAdmin(ctx, "", args)

	return err
}


text:
<?xml version="1.0" encoding="UTF-8" ?>
<class name="VisualShaderNodeIntFunc" inherits="VisualShaderNode" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
	<brief_description>
		A scalar integer function to be used within the visual shader graph.
	</brief_description>
	<description>
		Accept an integer scalar ([code]x[/code]) to the input port and transform it according to [member function].
	</description>
	<tutorials>
	</tutorials>
	<members>
		<member name="function" type="int" setter="set_function" getter="get_function" enum="VisualShaderNodeIntFunc.Function" default="2">
			A function to be applied to the scalar. See [enum Function] for options.
		</member>
	</members>
	<constants>
		<constant name="FUNC_ABS" value="0" enum="Function">
			Returns the absolute value of the parameter. Translates to [code]abs(x)[/code] in the Godot Shader Language.
		</constant>
		<constant name="FUNC_NEGATE" value="1" enum="Function">
			Negates the [code]x[/code] using [code]-(x)[/code].
		</constant>
		<constant name="FUNC_SIGN" value="2" enum="Function">
			Extracts the sign of the parameter. Translates to [code]sign(x)[/code] in the Godot Shader Language.
		</constant>
		<constant name="FUNC_BITWISE_NOT" value="3" enum="Function">
			Returns the result of bitwise [code]NOT[/code] operation on the integer. Translates to [code]~a[/code] in the Godot Shader Language.
		</constant>
		<constant name="FUNC_MAX" value="4" enum="Function">
			Represents the size of the [enum Function] enum.
		</constant>
	</constants>
</class>


text:
  app.controller('driverRegisterCtrl', ["$scope", "$timeout", "$location", "$http", function ($scope, $timeout, $location, $http) {
    $scope.firstname = '';
    $scope.lastname = '';
    $scope.dlState = '';
    $scope.dlNum = '';
    $scope.sponsorID = '';
    let newDriver = {};

    // create a new driver locally save it remotely
    $scope.createDriver = function () {
        newDriver = {
            firstname: $scope.firstname,
            lastname: $scope.lastname,
            dlState: $scope.dlState,
            dlNum: $scope.dlNum,
            sponsorID: $scope.sponsorID
        };
        $http.post('/driver', JSON.stringify(newDriver))
        .success(function (data, status, headers) {
             console.log(status);
             $location.path('/home');
        })
        .error(function (data, status, header) {
            console.log(status);
        });
        newDriver = {};
    };

}]);


text:
<!DOCTYPE html>

<title>#title#</title>
        #include#
<link rel="stylesheet" href="#path#/css/colorbox.css" />

    #header#
        #msg#

                                                        #tabs#

                                                          #tab_content#

						#footer#


text:
<?php

namespace StepStone\DAO;

use StepStone\Domain\Order;

class OrderDAO extends DAO
{
    /**
     * Return a list of 10 random cakes.
     *
     * @return array A list of cakes.
     */
    public function findAll() {

        //die('hello');
        $sql = "SELECT filling_flavour.id_filling_flavour as id,cakes.name as cake_name,filling.name as filling_name,flavour.name as flavour_name
        FROM cakes
        left join cakes_filling
        on cakes_filling.id_cake=cakes.id_cake

        left join filling_flavour
        on filling_flavour.id_filling=cakes_filling.id_filling

        left join filling on filling.id_filling=filling_flavour.id_filling

        left join flavour on flavour.id_flavour=filling_flavour.id_flavour

        ORDER BY RAND() limit 0,10";

        $result = $this->getDb()->fetchAll($sql);

        // Convert query result to an array
        $cakes = array();
        foreach ($result as $row) {
            $cakeId = $row['id'];
            $cakes[$cakeId] = $row;
        }
        return $cakes;
    }

    /**
     * Returns a list of 10 random cakes matching the supplied id.
     *
     * @param integer $id The article id.
     *
     * @return \StepStone\Domain\Order or stop if no matching cake is found
     */
    public function find($id) {

        $sql = "SELECT filling_flavour.id_filling_flavour as id,cakes.name as cake_name,filling.name as filling_name,flavour.name as flavour_name FROM cakes left join cakes_filling on cakes_filling.id_cake=cakes.id_cake

        left join filling_flavour
        on filling_flavour.id_filling=cakes_filling.id_filling

        left join filling on filling.id_filling=filling_flavour.id_filling

        left join flavour on flavour.id_flavour=filling_flavour.id_flavour

        WHERE cakes.id_cake=$id
        ORDER BY RAND() limit 0,10";

        $result = $this->getDb()->fetchAll($sql);

        if ($result){
            $cakes = array();

            foreach ($result as $row) {
                $cakeId = $row['id'];
                $cakes[$cakeId] = $row;
            }
            return $cakes;
        }
        else
        {
            die("No cake matching id " . $id);
        }

    }

    /**
     * Returns an order matching the supplied id.
     *
     * @param integer $id The order id.
     *
     * @return \StepStone\Domain\Order or stop if no matching cake is found
     */
    public function findOrder($id) {

        $sql = "SELECT id_order,cakes.name as cake_name,filling.name as filling_name,flavour.name as flavour_name,client_name FROM orders
            left join cakes_filling
            on cakes_filling.id_cakes_filling=orders.id_cakes_filling

            left join filling_flavour
            on filling_flavour.id_filling_flavour=orders.id_filling_flavour

            left join cakes
            on cakes.id_cake=cakes_filling.id_cake

            left join filling on filling.id_filling=filling_flavour.id_filling

            left join flavour on flavour.id_flavour=filling_flavour.id_flavour

            WHERE id_order=$id";

            $order = $this->getDb()->fetchAll($sql);

        if ($order){

            return (object)$order[0];
        }
        else
        {
            die("No order matching id " . $id);
        }

    }

    /**
     * Saves an order into the database.
     *
     * @param \StepStone\Domain\Order $cake The order to save
     */
     public function save(Order $cake) {

        $id_cakes_filling=$cake->getIdCakesFilling();

        // Request to verify the matching between cake and filling
        $sql = "SELECT id_filling_flavour
        FROM cakes_filling
        left join filling_flavour
        on filling_flavour.id_filling=cakes_filling.id_filling
        WHERE id_cakes_filling=$id_cakes_filling
        ";

            $result = $this->getDb()->fetchAll($sql);

            $tab=array();

            foreach($result as $row)
            {
                $tab[]=$row['id_filling_flavour'];
            }

            if (!in_array($cake->getIdFillingFlavour(), $tab))
            {
                    echo "No matching with filling flavour";
                    die();
            }

        //If the matching is correct, build an array with data to save
        $cakeData = array(
            'id_cakes_filling' => $cake->getIdCakesFilling(),
            'id_filling_flavour' => $cake->getIdFillingFlavour(),
            'client_name'=>$cake->getClientName()
            );

       /* var_dump($cakeData);
        die();*/

        if ($cake->getIdOrder()) {
            // The order has already been saved : update it
            $this->getDb()->update('orders', $cakeData, array('id_order' => $cake->getIdOrder()));
        } else {

            // The order has never been saved : insert it
            $this->getDb()->insert('orders', $cakeData);
            // Get the id of the newly created order and set it on the entity.

            $id = $this->getDb()->lastInsertId();
            $cake->setIdOrder($id);
        }
    }

}


text:
/**
 *
 */
package com.netflix.conductor.contribs.http;

import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.config.ClientConfig;
import com.sun.jersey.client.apache4.ApacheHttpClient4;
import com.sun.jersey.client.apache4.config.DefaultApacheHttpClient4Config;

import javax.inject.Singleton;

/**
 * @author Viren
 * Provider for Jersey Client.  This class provides an
 */
@Singleton
public class RestClientManager {

	public Client getClient(Input input) {
		ClientConfig config = new DefaultApacheHttpClient4Config();
		config.getProperties().put("http.protocol.handle-redirects", input.isFollowRedirects());
		return ApacheHttpClient4.create(config);
	}
}