text:
Create a vertical split.

> `:vsp`

Create a horizontal split

> `:sp`

By default, command duplicated the current buffer.

## Resizing splits

Max out heights of the current split

> `ctrl + w _`

Max out the width of the current split

> `ctrl + w |`

Back to initial size

> `ctrl + w =`

Increase/Decrease horizontal split

> `10 ctrl + w +`
> `20 ctrl + w -`

Increase/Decrease vertical split

> `20 ctrl + w >`
> `20 ctrl + w <`

## Move around

Swap top/bottom or left/right

> `ctrl + w r`

Move cursor to another windows

> `ctrl + w ctrl + w`

Close current window

> `:hide`

Keep only current window open

> `:only`

Show current buffers

> `:ls`

Open Buffer #2 in this windows
> `:b 2`

## More

> `:h splits`


text:
using System;

namespace AntData.ORM
{
	using Linq;

	public interface ITable<out T> : IExpressionQuery<T>
	{
	}
}

redpajama_set_name: RedPajamaGithub


text:
layout: page
title: Bullock - Martinez Wedding
date: 2016-05-24
author: Dorothy Compton
tags: weekly links, java
status: published
summary: Etiam eget bibendum purus. Donec id dui lacus.
banner: images/banner/office-01.jpg
booking:
  startDate: 10/17/2019
  endDate: 10/22/2019
  ctyhocn: BOSPBHX
  groupCode: BMW
published: true
---
Pellentesque tincidunt luctus euismod. Aliquam magna ligula, sollicitudin non odio ac, molestie semper justo. Nulla massa velit, dictum sed mattis ut, dapibus id tortor. In ut purus et ipsum vehicula congue non non libero. Fusce vitae ornare purus, feugiat lacinia metus. Nulla posuere nibh nec nibh hendrerit tincidunt. Cras tempus euismod tempor. Curabitur placerat massa a nibh porttitor, sit amet porta lorem sollicitudin.

* Aliquam eu ex gravida, cursus arcu mattis, varius neque
* Pellentesque efficitur quam nec sapien iaculis, sed iaculis leo scelerisque.

Nulla pellentesque nisl sit amet luctus maximus. Aenean eget suscipit eros, vel imperdiet nisi. Donec ornare nunc odio, et congue quam ornare eget. Donec cursus ex erat, at egestas ex euismod in. Nunc volutpat, augue ac pharetra commodo, purus orci luctus purus, id commodo odio nunc vel felis. Vivamus felis felis, commodo vitae urna eget, porttitor aliquam ipsum. Aliquam blandit urna in nulla tincidunt ultricies. Phasellus ut leo mattis sem pulvinar pharetra at non sapien. Ut vel purus tincidunt, ornare massa eu, tristique urna. Phasellus pharetra, mauris vel faucibus molestie, arcu enim blandit sem, a tincidunt sapien tortor eu nibh. Aliquam ac sagittis elit. Fusce imperdiet purus in nunc feugiat volutpat.
Aenean pulvinar in nisl non lobortis. Aliquam sagittis porttitor ante, ut rhoncus sapien efficitur in. Aliquam erat volutpat. Aliquam erat volutpat. Nunc id gravida erat. Nulla faucibus, risus quis pellentesque auctor, purus velit dapibus justo, vel suscipit metus ipsum maximus nunc. Fusce pellentesque pellentesque dui eu vestibulum. Nullam tempus efficitur felis. Phasellus ut sodales nulla, vel scelerisque dui. Pellentesque vulputate risus eu ultrices sagittis.


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Core.TestFramework;
using Azure.ResourceManager.CognitiveServices.Models;
using Azure.ResourceManager.CognitiveServices.Tests.Helpers;
using NUnit.Framework;

namespace Azure.ResourceManager.CognitiveServices.Tests
{
    public class DeploymentResourceTests : CognitiveServicesManagementTestBase
    {
        public DeploymentResourceTests(bool isAsync)
            : base(isAsync)//, RecordedTestMode.Record)
        {
        }

        private async Task<CognitiveServicesAccountDeploymentResource> CreateDeploymentAsync(string deploymentName)
        {
            var accountContainer = (await CreateResourceGroupAsync()).GetCognitiveServicesAccounts();
            var accountInput = ResourceDataHelper.GetBasicAccountData(AzureLocation.SouthCentralUS);
            accountInput.Kind = "OpenAI";
            accountInput.Sku = new CognitiveServicesSku("S0");
            var lro = await accountContainer.CreateOrUpdateAsync(WaitUntil.Completed, Recording.GenerateAssetName("testAccount-"), accountInput);
            var account = lro.Value;
            var container = account.GetCognitiveServicesAccountDeployments();
            var input = ResourceDataHelper.GetBasicDeploymentData();
            var lro_connection = await container.CreateOrUpdateAsync(WaitUntil.Completed, deploymentName, input);
            return lro_connection.Value;
        }

        [TestCase]
        public async Task DeploymentResourceApiTests()
        {
            //1.Get
            var deploymentName = Recording.GenerateAssetName("testDeployment-");
            var deployment1 = await CreateDeploymentAsync(deploymentName);
            CognitiveServicesAccountDeploymentResource deployment2 = await deployment1.GetAsync();

            ResourceDataHelper.AssertDeployment(deployment1.Data, deployment2.Data);
            //2.Delete
            await deployment1.DeleteAsync(WaitUntil.Completed);
        }
    }
}


text:
package tsocket.zby.com.tsocket;

/**
 * Created by zhuj on 2016/9/19 17:53.
 */
public class AppString {
  public static final java.lang.String FIRST = "first";
  public static final String HOUR = "hour";
  public static final String MINUTE = "minute";
  public static final String SECOND = "second";
  public static final String TITLE = "title";
  public static final String SHOW_HOUR = "show_hour";
  public static final String RXBUS_PUSH_BYTE = "rxbus_btye";
    public static java.lang.String language = "language";

  /**
   * 上次循环时间
   */
  public static java.lang.String Last_Delay_Timer = "last_delay_timer";
}


text:
module Azure::MachineLearning::Mgmt::V2017_01_01
  #
  # These APIs allow end users to operate on Azure Machine Learning Web
  # Services resources. They support the following operations:

Create or
  # update a web service

Get a web service

Patch a web
  # service

Delete a web service

Get All Web Services in a
  # Resource Group

Get All Web Services in a Subscription

Get
  # Web Services Keys

  #
  class Operations
    include MsRestAzure

    #
    # Creates and initializes a new instance of the Operations class.
    # @param client service class for accessing basic functionality.
    #
    def initialize(client)
      @client = client
    end

    # @return [AzureMLWebServicesManagementClient] reference to the AzureMLWebServicesManagementClient
    attr_reader :client

    #
    # Lists all the available REST API operations.
    #
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [OperationEntityListResult] operation results.
    #
    def list(custom_headers:nil)
      response = list_async(custom_headers:custom_headers).value!
      response.body unless response.nil?
    end

    #
    # Lists all the available REST API operations.
    #
    # @param custom_headers [Hash{String => String}] A hash of custom headers that
    # will be added to the HTTP request.
    #
    # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
    #
    def list_with_http_info(custom_headers:nil)
      list_async(custom_headers:custom_headers).value!
    end

    #
    # Lists all the available REST API operations.
    #
    # @param [Hash{String => String}] A hash of custom headers that will be added
    # to the HTTP request.
    #
    # @return [Concurrent::Promise] Promise object which holds the HTTP response.
    #
    def list_async(custom_headers:nil)
      fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?

      request_headers = {}
      request_headers['Content-Type'] = 'application/json; charset=utf-8'

      # Set Headers
      request_headers['x-ms-client-request-id'] = SecureRandom.uuid
      request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
      path_template = 'providers/Microsoft.MachineLearning/operations'

      request_url = @base_url || @client.base_url

      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          query_params: {'api-version' => @client.api_version},
          headers: request_headers.merge(custom_headers || {}),
          base_url: request_url
      }
      promise = @client.make_request_async(:get, path_template, options)

      promise = promise.then do |result|
        http_response = result.response
        status_code = http_response.status
        response_content = http_response.body
        unless status_code == 200
          error_model = JSON.load(response_content)
          fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
        end

        result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
        # Deserialize Response
        if status_code == 200
          begin
            parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
            result_mapper = Azure::MachineLearning::Mgmt::V2017_01_01::Models::OperationEntityListResult.mapper()
            result.body = @client.deserialize(result_mapper, parsed_response)
          rescue Exception => e
            fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
          end
        end

        result
      end

      promise.execute
    end

  end
end


text:
package net

import (
	"bytes"
	"fmt"
	"os"
	"path/filepath"
	"regexp"
	"sort"
	"strings"
	"text/template"
	"time"

	bosharp "github.com/cloudfoundry/bosh-agent/platform/net/arp"
	boship "github.com/cloudfoundry/bosh-agent/platform/net/ip"
	boshsettings "github.com/cloudfoundry/bosh-agent/settings"
	bosherr "github.com/cloudfoundry/bosh-utils/errors"
	boshlog "github.com/cloudfoundry/bosh-utils/logger"
	boshretry "github.com/cloudfoundry/bosh-utils/retrystrategy"
	boshsys "github.com/cloudfoundry/bosh-utils/system"

	ini "github.com/cloudfoundry/bosh-agent/ini"
)

const UbuntuNetManagerLogTag = "UbuntuNetManager"

type UbuntuNetManager struct {
	cmdRunner                     boshsys.CmdRunner
	fs                            boshsys.FileSystem
	ipResolver                    boship.Resolver
	macAddressDetector            MACAddressDetector
	interfaceConfigurationCreator InterfaceConfigurationCreator
	interfaceAddrsProvider        boship.InterfaceAddressesProvider
	dnsValidator                  DNSValidator
	addressBroadcaster            bosharp.AddressBroadcaster
	kernelIPv6                    KernelIPv6
	logger                        boshlog.Logger
}

func NewUbuntuNetManager(
	fs boshsys.FileSystem,
	cmdRunner boshsys.CmdRunner,
	ipResolver boship.Resolver,
	macAddressDetector MACAddressDetector,
	interfaceConfigurationCreator InterfaceConfigurationCreator,
	interfaceAddrsProvider boship.InterfaceAddressesProvider,
	dnsValidator DNSValidator,
	addressBroadcaster bosharp.AddressBroadcaster,
	kernelIPv6 KernelIPv6,
	logger boshlog.Logger,
) Manager {
	return UbuntuNetManager{
		cmdRunner:                     cmdRunner,
		fs:                            fs,
		ipResolver:                    ipResolver,
		macAddressDetector:            macAddressDetector,
		interfaceConfigurationCreator: interfaceConfigurationCreator,
		interfaceAddrsProvider:        interfaceAddrsProvider,
		dnsValidator:                  dnsValidator,
		addressBroadcaster:            addressBroadcaster,
		kernelIPv6:                    kernelIPv6,
		logger:                        logger,
	}
}

func (net UbuntuNetManager) GetConfiguredNetworkInterfaces() ([]string, error) {
	interfaces := []string{}

	interfacesByMacAddress, err := net.macAddressDetector.DetectMacAddresses()
	if err != nil {
		return interfaces, bosherr.WrapError(err, "Getting network interfaces")
	}

	for _, iface := range interfacesByMacAddress {
		if net.fs.FileExists(interfaceConfigurationFile(iface)) {
			interfaces = append(interfaces, iface)
		}
	}

	return interfaces, nil
}

func (net UbuntuNetManager) SetupIPv6(config boshsettings.IPv6, stopCh <-chan struct{}) error {
	if config.Enable {
		return net.kernelIPv6.Enable(stopCh)
	}
	return nil
}

func (net UbuntuNetManager) SetupNetworking(networks boshsettings.Networks, errCh chan error) error {
	if networks.IsPreconfigured() {
		// Note in this case IPs are not broadcast
		dnsNetwork, _ := networks.DefaultNetworkFor("dns")
		return net.writeResolvConf(dnsNetwork.DNS)
	}

	staticConfigs, dhcpConfigs, dnsServers, err := net.ComputeNetworkConfig(networks)
	if err != nil {
		return bosherr.WrapError(err, "Computing network configuration")
	}

	if StaticInterfaceConfigurations(staticConfigs).HasVersion6() {
		err := net.kernelIPv6.Enable(make(chan struct{}))
		if err != nil {
			return bosherr.WrapError(err, "Enabling IPv6 in kernel")
		}
	}

	changed, err := net.writeNetConfigs(dhcpConfigs, staticConfigs, dnsServers, boshsys.ConvergeFileContentsOpts{})
	if err != nil {
		return bosherr.WrapError(err, "Updating network configs")
	}

	if changed {
		err = net.removeDhcpDNSConfiguration()
		if err != nil {
			return err
		}

		err := net.restartNetworking()
		if err != nil {
			return bosherr.WrapError(err, "Failure restarting networking")
		}
	}

	staticAddresses, dynamicAddresses := net.ifaceAddresses(staticConfigs, dhcpConfigs)

	var staticAddressesWithoutVirtual []boship.InterfaceAddress
	r, err := regexp.Compile(`:\d+`)
	if err != nil {
		return bosherr.WrapError(err, "There is a problem with your regexp: ':\\d+'. That is used to skip validation of virtual interfaces(e.g., eth0:0, eth0:1)")
	}
	for _, addr := range staticAddresses {
		if r.MatchString(addr.GetInterfaceName()) == true {
			continue
		} else {
			staticAddressesWithoutVirtual = append(staticAddressesWithoutVirtual, addr)
		}
	}

	interfaceAddressesValidator := boship.NewInterfaceAddressesValidator(net.interfaceAddrsProvider, staticAddressesWithoutVirtual)
	retryIPValidator := boshretry.NewAttemptRetryStrategy(
		10,
		time.Second,
		interfaceAddressesValidator,
		net.logger,
	)
	err = retryIPValidator.Try()
	if err != nil {
		return bosherr.WrapError(err, "Validating static network configuration")
	}

	err = net.writeResolvConf(dnsServers)
	if err != nil {
		return bosherr.WrapError(err, "Updating /etc/resolv.conf")
	}

	err = net.dnsValidator.Validate(dnsServers)
	if err != nil {
		return bosherr.WrapError(err, "Validating dns configuration")
	}

	go net.addressBroadcaster.BroadcastMACAddresses(append(staticAddressesWithoutVirtual, dynamicAddresses...))

	return nil
}

func (net UbuntuNetManager) ComputeNetworkConfig(networks boshsettings.Networks) ([]StaticInterfaceConfiguration, []DHCPInterfaceConfiguration, []string, error) {
	nonVipNetworks := boshsettings.Networks{}
	for networkName, networkSettings := range networks {
		if networkSettings.IsVIP() {
			continue
		}
		nonVipNetworks[networkName] = networkSettings
	}

	staticConfigs, dhcpConfigs, err := net.buildInterfaces(nonVipNetworks)
	if err != nil {
		return nil, nil, nil, err
	}

	staticConfigs, err = net.collapseVirtualInterfaces(staticConfigs)
	if err != nil {
		return nil, nil, nil, err
	}

	dnsNetwork, _ := nonVipNetworks.DefaultNetworkFor("dns")
	dnsServers := dnsNetwork.DNS
	return staticConfigs, dhcpConfigs, dnsServers, nil
}

func (net UbuntuNetManager) collapseVirtualInterfaces(staticConfigs []StaticInterfaceConfiguration) ([]StaticInterfaceConfiguration, error) {
	configs := []StaticInterfaceConfiguration{}

	// collect any virtual interfaces
	virtualInterfacesByDevice := map[string][]VirtualInterface{}
	for _, config := range staticConfigs {
		if strings.Contains(config.Name, ":") {
			ifaceName := strings.Split(config.Name, ":")[0]

			if _, ok := virtualInterfacesByDevice[ifaceName]; !ok {
				virtualInterfacesByDevice[ifaceName] = []VirtualInterface{}
			}
			cidr, err := config.CIDR()
			if err != nil {
				return nil, err
			}

			virtualInterfacesByDevice[ifaceName] = append(
				virtualInterfacesByDevice[ifaceName],
				VirtualInterface{Label: config.Name, Address: fmt.Sprintf("%s/%s", config.Address, cidr)},
			)
		}
	}

	// keep non-virtual interfaces, and append if found
	for _, config := range staticConfigs {
		if !strings.Contains(config.Name, ":") {
			if virtualInterfaces, ok := virtualInterfacesByDevice[config.Name]; ok {
				config.VirtualInterfaces = virtualInterfaces
			}

			configs = append(configs, config)
		}
	}

	return configs, nil
}

func (net UbuntuNetManager) writeNetConfigs(
	dhcpConfigs DHCPInterfaceConfigurations,
	staticConfigs StaticInterfaceConfigurations,
	dnsServers []string,
	opts boshsys.ConvergeFileContentsOpts) (bool, error) {

	interfacesChanged, err := net.writeNetworkInterfaces(dhcpConfigs, staticConfigs, dnsServers, opts)
	if err != nil {
		return false, bosherr.WrapError(err, "Writing network configuration")
	}

	dhcpChanged := false

	if len(dhcpConfigs) > 0 {
		dhcpChanged, err = net.writeDHCPConfiguration(dnsServers, opts)
		if err != nil {
			return false, err
		}
	}

	return (interfacesChanged || dhcpChanged), nil
}

func (net UbuntuNetManager) removeDhcpDNSConfiguration() error {
	// Removing dhcp configuration from /etc/network/interfaces
	// and restarting network does not stop dhclient if dhcp
	// is no longer needed. See https://bugs.launchpad.net/ubuntu/+source/dhcp3/+bug/38140
	_, _, _, err := net.cmdRunner.RunCommand("pkill", "dhclient")
	if err != nil {
		net.logger.Error(UbuntuNetManagerLogTag, "Ignoring failure calling 'pkill dhclient': %s", err)
	}

	interfacesByMacAddress, err := net.macAddressDetector.DetectMacAddresses()
	if err != nil {
		return err
	}

	for _, ifaceName := range interfacesByMacAddress {
		// Explicitly delete the resolvconf record about given iface
		// It seems to hold on to old dhclient records after dhcp configuration
		// is removed from /etc/network/interfaces.
		_, _, _, err = net.cmdRunner.RunCommand("resolvconf", "-d", ifaceName+".dhclient")
		if err != nil {
			net.logger.Error(UbuntuNetManagerLogTag, "Ignoring failure calling 'resolvconf -d %s.dhclient': %s", ifaceName, err)
		}
	}

	return nil
}

func (net UbuntuNetManager) buildInterfaces(networks boshsettings.Networks) ([]StaticInterfaceConfiguration, []DHCPInterfaceConfiguration, error) {
	interfacesByMacAddress, err := net.macAddressDetector.DetectMacAddresses()
	if err != nil {
		return nil, nil, bosherr.WrapError(err, "Getting network interfaces")
	}

	// if len(interfacesByMacAddress) == 0 {
	// 	return nil, nil, bosherr.Error("No network interfaces found")
	// }

	staticConfigs, dhcpConfigs, err := net.interfaceConfigurationCreator.CreateInterfaceConfigurations(networks, interfacesByMacAddress)
	if err != nil {
		return nil, nil, bosherr.WrapError(err, "Creating interface configurations")
	}

	return staticConfigs, dhcpConfigs, nil
}

func (net UbuntuNetManager) ifaceAddresses(staticConfigs []StaticInterfaceConfiguration, dhcpConfigs []DHCPInterfaceConfiguration) ([]boship.InterfaceAddress, []boship.InterfaceAddress) {
	staticAddresses := []boship.InterfaceAddress{}
	for _, iface := range staticConfigs {
		staticAddresses = append(staticAddresses, boship.NewSimpleInterfaceAddress(iface.Name, iface.Address))
	}
	dynamicAddresses := []boship.InterfaceAddress{}
	for _, iface := range dhcpConfigs {
		dynamicAddresses = append(dynamicAddresses, boship.NewResolvingInterfaceAddress(iface.Name, net.ipResolver))
	}

	return staticAddresses, dynamicAddresses
}

func (net UbuntuNetManager) restartNetworking() error {
	_, _, _, err := net.cmdRunner.RunCommand("/var/vcap/bosh/bin/restart_networking")
	if err != nil {
		return err
	}
	return nil
}

func (net UbuntuNetManager) writeDHCPConfiguration(dnsServers []string, opts boshsys.ConvergeFileContentsOpts) (bool, error) {
	buffer := bytes.NewBuffer([]byte{})
	t := template.Must(template.New("dhcp-config").Parse(dhclientConfTemplate))

	// Keep DNS servers in the order specified by the network
	// because they are added by a *single* DHCP's prepend command
	dnsServersList := strings.Join(dnsServers, ", ")
	err := t.Execute(buffer, dnsServersList)
	if err != nil {
		return false, bosherr.WrapError(err, "Generating config from template")
	}

	dhclientConfigFile := "/etc/dhcp/dhclient.conf"

	changed, err := net.fs.ConvergeFileContents(dhclientConfigFile, buffer.Bytes(), opts)
	if err != nil {
		return changed, bosherr.WrapErrorf(err, "Writing to %s", dhclientConfigFile)
	}

	return changed, nil
}

func (net UbuntuNetManager) updateConfiguration(name, templateDefinition string, templateConfiguration interface{}, opts boshsys.ConvergeFileContentsOpts) (bool, error) {
	interfaceFile := interfaceConfigurationFile(name)
	buffer := bytes.NewBuffer([]byte{})
	templateFuncs := template.FuncMap{
		"NetmaskToCIDR": boshsettings.NetmaskToCIDR,
	}

	t := template.Must(template.New(name).Funcs(templateFuncs).Parse(templateDefinition))

	err := t.Execute(buffer, templateConfiguration)
	if err != nil {
		return false, bosherr.WrapError(err, fmt.Sprintf("Generating config from template %s", name))
	}

	net.logger.Error(UbuntuNetManagerLogTag, "Updating %s configuration with contents: %s", name, buffer.Bytes())
	return net.fs.ConvergeFileContents(
		interfaceFile,
		buffer.Bytes(),
		opts,
	)
}

const systemdNetworkFolder = "/etc/systemd/network"

func interfaceConfigurationFile(name string) string {
	interfaceBasename := fmt.Sprintf("09_%s.network", name)
	return filepath.Join(systemdNetworkFolder, interfaceBasename)
}

func (net UbuntuNetManager) writeNetworkInterfaces(
	dhcpConfigs DHCPInterfaceConfigurations,
	staticConfigs StaticInterfaceConfigurations,
	dnsServers []string,
	opts boshsys.ConvergeFileContentsOpts) (bool, error) {

	type networkInterfaceConfig struct {
		DNSServers        []string
		InterfaceConfig   interface{}
		HasDNSNameServers bool
	}

	sort.Stable(dhcpConfigs)
	sort.Stable(staticConfigs)

	staleNetworkConfigFiles := make(map[string]bool)
	err := net.fs.Walk(filepath.Join(systemdNetworkFolder), func(match string, _ os.FileInfo, err error) error {
		if err != nil {
			return err
		}
		staleNetworkConfigFiles[match] = true
		return nil
	})

	if err != nil {
		return false, err
	}

	anyChanged := false
	for _, dynamicAddressConfiguration := range dhcpConfigs {
		changed, err := net.writeDynamicInterfaceConfiguration(dynamicAddressConfiguration, dnsServers, opts)
		if err != nil {
			return false, bosherr.WrapError(err, fmt.Sprintf("Updating network configuration for %s", dynamicAddressConfiguration.Name))
		}

		newNetworkFile := interfaceConfigurationFile(dynamicAddressConfiguration.Name)
		if _, ok := staleNetworkConfigFiles[newNetworkFile]; ok {
			staleNetworkConfigFiles[newNetworkFile] = false
		}

		anyChanged = anyChanged || changed
	}

	for _, staticAddressConfiguration := range staticConfigs {
		changed, err := net.writeStaticInterfaceConfiguration(staticAddressConfiguration, dnsServers, opts)
		if err != nil {
			return false, bosherr.WrapError(err, fmt.Sprintf("Updating network configuration for %s", staticAddressConfiguration.Name))
		}

		newNetworkFile := interfaceConfigurationFile(staticAddressConfiguration.Name)
		if _, ok := staleNetworkConfigFiles[newNetworkFile]; ok {
			staleNetworkConfigFiles[newNetworkFile] = false
		}

		anyChanged = anyChanged || changed
	}

	for networkFile, isStale := range staleNetworkConfigFiles {
		if networkFile == systemdNetworkFolder {
			continue
		}
		if isStale {
			err := net.fs.RemoveAll(networkFile)
			if err != nil {
				return false, err
			}
			anyChanged = true
		}
	}
	return anyChanged, nil
}

func (net UbuntuNetManager) ifaceNames(dhcpConfigs DHCPInterfaceConfigurations, staticConfigs StaticInterfaceConfigurations) []string {
	ifaceNames := []string{}
	for _, config := range dhcpConfigs {
		ifaceNames = append(ifaceNames, config.Name)
	}
	for _, config := range staticConfigs {
		ifaceNames = append(ifaceNames, config.Name)
	}
	return ifaceNames
}

func (net UbuntuNetManager) writeResolvConf(dnsServers []string) error {
	buffer := bytes.NewBuffer([]byte{})

	t := template.Must(template.New("resolv-conf").Parse(resolvConfTemplate))

	type dnsConfigArg struct {
		DNSServers []string
	}

	dnsServersArg := dnsConfigArg{dnsServers}

	err := t.Execute(buffer, dnsServersArg)
	if err != nil {
		return bosherr.WrapError(err, "Generating DNS config from template")
	}

	if len(dnsServers) > 0 {
		// Write out base so that releases may overwrite head
		err = net.fs.WriteFile("/etc/resolvconf/resolv.conf.d/base", buffer.Bytes())
		if err != nil {
			return bosherr.WrapError(err, "Writing to /etc/resolvconf/resolv.conf.d/base")
		}
	} else {
		// For the first time before resolv.conf is symlinked to /run/...
		// inherit possibly configured resolv.conf

		targetPath, err := net.fs.ReadAndFollowLink("/etc/resolv.conf")
		if err != nil {
			return bosherr.WrapError(err, "Reading /etc/resolv.conf symlink")
		}

		expectedPath, err := filepath.Abs("/etc/resolv.conf")
		if err != nil {
			return bosherr.WrapError(err, "Resolving path to native OS")
		}
		if targetPath == expectedPath {
			err := net.fs.CopyFile("/etc/resolv.conf", "/etc/resolvconf/resolv.conf.d/base")
			if err != nil {
				return bosherr.WrapError(err, "Copying /etc/resolv.conf for backwards compat")
			}
		}
	}

	err = net.fs.Symlink("/run/resolvconf/resolv.conf", "/etc/resolv.conf")
	if err != nil {
		return bosherr.WrapError(err, "Setting up /etc/resolv.conf symlink")
	}

	_, _, _, err = net.cmdRunner.RunCommand("resolvconf", "-u")
	if err != nil {
		return bosherr.WrapError(err, "Updating resolvconf")
	}

	return nil
}

func (net UbuntuNetManager) writeStaticInterfaceConfiguration(config StaticInterfaceConfiguration, dnsServers []string, opts boshsys.ConvergeFileContentsOpts) (bool, error) {
	var err error
	configPath := interfaceConfigurationFile(config.Name)

	cidr, err := config.CIDR()
	if err != nil {
		return false, err
	}

	file := ini.Empty()
	file.Comment = "# Generated by bosh-agent"

	// Match Section
	matchSection := &ini.Section{Name: "Match"}
	matchSection.AddKey("Name", config.Name)
	file.AppendSection(matchSection)

	// Address Section
	addressSection := &ini.Section{Name: "Address"}
	addressSection.AddKey("Address", fmt.Sprintf("%s/%s", config.Address, cidr))
	if config.IsDefaultForGateway && !config.IsVersion6() {
		addressSection.AddKey("Broadcast", config.Broadcast)
	}
	file.AppendSection(addressSection)

	// Virtual Interfaces
	for _, virtualInterface := range config.VirtualInterfaces {
		addressSection := &ini.Section{Name: "Address"}
		addressSection.AddKey("Label", virtualInterface.Label)
		addressSection.AddKey("Address", virtualInterface.Address)
		file.AppendSection(addressSection)
	}

	// Network Section
	networkSection := &ini.Section{Name: "Network"}
	if config.IsDefaultForGateway {
		networkSection.AddKey("Gateway", config.Gateway)
	}

	if config.IsVersion6() {
		networkSection.AddKey("IPv6AcceptRA", "true")
	}

	for _, dnsServer := range dnsServers {
		networkSection.AddKey("DNS", dnsServer)
	}
	file.AppendSection(networkSection)

	// Route Sections
	for _, postUpRoute := range config.PostUpRoutes {
		routeSection := &ini.Section{Name: "Route"}
		postUpRouteCidr, err := boshsettings.NetmaskToCIDR(postUpRoute.Netmask, config.IsVersion6())
		if err != nil {
			return false, err
		}

		routeSection.AddKey("Destination", fmt.Sprintf("%s/%s", postUpRoute.Destination, postUpRouteCidr))
		routeSection.AddKey("Gateway", postUpRoute.Gateway)

		file.AppendSection(routeSection)
	}

	buffer := bytes.NewBuffer(nil)
	_, err = file.WriteTo(buffer)
	if err != nil {
		return false, err
	}

	return net.fs.ConvergeFileContents(configPath, buffer.Bytes(), opts)
}

func (net UbuntuNetManager) writeDynamicInterfaceConfiguration(config DHCPInterfaceConfiguration, dnsServers []string, opts boshsys.ConvergeFileContentsOpts) (bool, error) {
	if config.Address == "" {
		return false, nil
	}

	var err error
	configPath := interfaceConfigurationFile(config.Name)

	file := ini.Empty()
	file.Comment = "# Generated by bosh-agent"

	// Match Section
	matchSection := &ini.Section{Name: "Match"}
	matchSection.AddKey("Name", config.Name)
	file.AppendSection(matchSection)

	// Network Section
	networkSection := &ini.Section{Name: "Network"}
	networkSection.AddKey("DHCP", "yes")
	if config.IsVersion6() {
		networkSection.AddKey("IPv6AcceptRA", "true")
	}

	for _, dnsServer := range dnsServers {
		networkSection.AddKey("DNS", dnsServer)
	}
	file.AppendSection(networkSection)

	// DHCP Section
	dhcpSection := &ini.Section{Name: "DHCP"}
	dhcpSection.AddKey("UseDomains", "yes")
	file.AppendSection(dhcpSection)

	// Route Sections
	for _, postUpRoute := range config.PostUpRoutes {
		routeSection := &ini.Section{Name: "Route"}
		postUpRouteCidr, err := boshsettings.NetmaskToCIDR(postUpRoute.Netmask, config.IsVersion6())
		if err != nil {
			return false, err
		}

		routeSection.AddKey("Destination", fmt.Sprintf("%s/%s", postUpRoute.Destination, postUpRouteCidr))
		routeSection.AddKey("Gateway", postUpRoute.Gateway)

		file.AppendSection(routeSection)
	}

	buffer := bytes.NewBuffer(nil)
	_, err = file.WriteTo(buffer)
	if err != nil {
		return false, err
	}

	return net.fs.ConvergeFileContents(configPath, buffer.Bytes(), opts)
}

// DHCP Config file - /etc/dhcp/dhclient.conf
// Ubuntu 14.04 accepts several DNS as a list in a single prepend directive
const dhclientConfTemplate = `# Generated by bosh-agent

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;

send host-name = gethostname();

request subnet-mask, broadcast-address, time-offset, routers,
	domain-name, domain-name-servers, domain-search, host-name,
	netbios-name-servers, netbios-scope, interface-mtu,
	rfc3442-classless-static-routes, ntp-servers;
{{ if . }}
prepend domain-name-servers {{ . }};{{ end }}
`
const resolvConfTemplate = `# Generated by bosh-agent
{{ range .DNSServers }}nameserver {{ . }}
{{ end }}`


text:
import BackboneEvents from 'backbone-events-standalone';
import {browser, events, documentHiddenState} from 'pageflow/frontend';

export class Atmo {
  constructor({atmoSourceId, multiPlayer, backgroundMedia}){
    this.multiPlayer = multiPlayer;
    this.atmoSourceId = atmoSourceId;
    this.backgroundMedia = backgroundMedia;

    this.backgroundMedia.on('change:muted', () => {
      this.update();
    });

    documentHiddenState((hiddenState)=>{
      if (hiddenState === 'hidden') {
        this.multiPlayer.fadeOutIfPlaying();
      }
      else{
        this.update();
      }
    });

    this.listenTo(this.multiPlayer, 'playfailed', () => {
      backgroundMedia.mute(true);
    });
  }
  disable() {
    this.disabled = true;
    this.multiPlayer.fadeOutAndPause();

    events.trigger('atmo:disabled');
  }
  enable() {
    this.disabled = false;

    this.update();

    events.trigger('atmo:enabled');
  }
  pause() {
    if (browser.has('volume control support')) {
      return this.multiPlayer.fadeOutAndPause();
    }
    else {
      this.multiPlayer.pause();
    }
  }
  turnDown() {
    if (browser.has('volume control support')) {
      return this.multiPlayer.changeVolumeFactor(0.2);
    }
    else {
      this.multiPlayer.pause();
    }
  }
  resume() {
    if (this.multiPlayer.paused()) {
      if (this.disabled || this.backgroundMedia.muted) {
        return Promise.resolve();
      }
      else {
        return this.multiPlayer.resumeAndFadeIn();
      }
    }
    else {
      return this.multiPlayer.changeVolumeFactor(1);
    }
  }
  update() {
    if (!this.disabled) {
      if (this.backgroundMedia.muted) {
        this.multiPlayer.fadeOutAndPause();
      }
      else {
        this.multiPlayer.fadeTo(this.atmoSourceId);
      }
    }
  }
  createMediaPlayerHooks(atmoDuringPlayback) {
    var atmo = this;

    return {
      before: function() {
        if (atmoDuringPlayback === 'mute') {
          atmo.pause();
        }
        else if (atmoDuringPlayback === 'turnDown') {
          atmo.turnDown();
        }
      },

      after: function() {
        atmo.resume();
      }
    };
  }

}

Object.assign(Atmo.prototype, BackboneEvents);


text:
package org.apache.tester;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

/**
 * Test that insures we can include a servlet that does a forward, then
 * includes another servlet, and we see all of the output in the right order.
 *
 * @author Craig R. McClanahan
 * @version $Revision: 1.1 $ $Date: 2001/07/12 02:40:56 $
 */

public class Include07a extends HttpServlet {

    public void doGet(HttpServletRequest request, HttpServletResponse response)
        throws IOException, ServletException {

        // Prepare this response
	PrintWriter writer = response.getWriter();

        // Forward to our subsubservlet
        RequestDispatcher rd =
          getServletContext().getRequestDispatcher("/Include07b");
        if (rd == null) {
            writer.println("No RD for '/Include07b'");
        } else {
            rd.include(request, response);
        }

    }

}


text:
//
// Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.7 generiert
// Siehe http://java.sun.com/xml/jaxb
// nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren.
// Generiert: 2016.04.19 um 09:36:45 AM CEST
//

package de.immobilienscout24.rest.schema.entitlement._1;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java-Klasse fr anonymous complex type.
 *
 *
Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist.
 *
 *

 * <complexType>
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="entitlement" type="{http://rest.immobilienscout24.de/schema/entitlement/1.0}entitlement" maxOccurs="unbounded" minOccurs="0"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "entitlement"
})
@XmlRootElement(name = "userEntitlementsResponse")
public class UserEntitlementsResponse {

    protected List<Entitlement> entitlement;

    /**
     * Gets the value of the entitlement property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the entitlement property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getEntitlement().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link Entitlement }
     *
     *
     */
    public List<Entitlement> getEntitlement() {
        if (entitlement == null) {
            entitlement = new ArrayList<Entitlement>();
        }
        return this.entitlement;
    }

}


text:
//
//  RXJSToHtmlBlockViewController.m
//  RXJavaScriptDemo
//
//  Created by srx on 2017/1/9.
//  Copyright © 2017年 https://github.com/srxboys. All rights reserved.
//
//iOS 往html里注入js,js一旦被调用,就会回调

//参考 : https://www.bignerdranch.com/blog/javascriptcore-example/

#import "RXJSToHtmlBlockViewController.h"

#import <JavaScriptCore/JavaScriptCore.h>
#import "UIWebView+TS_JavaScriptContext.h"

@interface RXJSToHtmlBlockViewController ()
{
    JSContext * _jsContext;
}
@end

@implementation RXJSToHtmlBlockViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self settingHtmlLocalCodeWithType:HTMLTypeForth];
}

- (void)webView:(UIWebView *)webView didCreateJavaScriptContext:(JSContext *)ctx {
    dispatch_time_t delayTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2/*延迟执行时间*/ * NSEC_PER_SEC));
    dispatch_after(delayTime, dispatch_get_main_queue(), ^{
        [self addJavaScriptName:@"londingJS"];
        _jsContext = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
        JSValue * app = [_jsContext objectForKeyedSubscript:@"app"];
        app[@"londingJS"] = ^(id obj) {
            NSLog(@"londingJS=%@", obj);
        };

        NSLog(@"--register-->%zd",[[NSDate date] timeIntervalSince1970]);
        [self addJSAlterPrint];
    });
}

- (void)addJavaScriptName:(NSString *)functionName {
    /*
    NSString * jsString = [NSString stringWithFormat:@"var script = document.createElement('script');"
                           "script.type = 'text/javascript';"
                           "script.text = \"var app = {}; app.%@ = function() {};\";"
                           "document.getElementsByTagName('head')[0].appendChild(script);", functionName];

    [self.webView stringByEvaluatingJavaScriptFromString:jsString];
     */
    NSString * jsString2 = __RX_ADD_JS(
                                       var app = {};
                                       app.%@ = function() {};
                                       );

    jsString2 = [NSString stringWithFormat:jsString2, functionName];
    [self.webView stringByEvaluatingJavaScriptFromString:__RX_ADD_JSContent(jsString2)];
}

- (void)webViewDidFinishLoad:(UIWebView *)webView {
    [super webViewDidFinishLoad:webView];
    NSLog(@"--webViewDidFinishLoad-->%zd",[[NSDate date] timeIntervalSince1970]);

    //注入js 方法
    [self addJavaScriptName:@"share"];

    _jsContext = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];

    //获取 app变量的share方法
    __weak typeof(self)weakSelf = self;
    JSValue * app = [_jsContext objectForKeyedSubscript:@"app"];

    app[@"share"] = ^(id obj){
        [weakSelf webShare:obj];
    };

    [self addJSAlterPrint];
}

- (void)webShare:(id)obj {
//    NSData *data = [(NSString *)obj dataUsingEncoding:NSUTF8StringEncoding ];
//    NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
    //上面是对json的处理

    //对象、变量的 处理
    NSLog(@"obj=%@", obj);

    //看html 给你什么类型了
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end


text:
package io.cattle.platform.process.util;

import io.cattle.platform.object.ObjectManager;
import io.cattle.platform.object.process.ObjectProcessManager;
import io.cattle.platform.object.process.StandardProcess;

import java.util.Arrays;
import java.util.List;

public class ProcessHelpers {

    @SuppressWarnings("unchecked")
    public static <T> List<T> createOneChild(ObjectManager objectManager, ObjectProcessManager processManager, Object parent,
            Class<T> childClass, Object key, Object... values) {

        List<T> children = objectManager.children(parent, childClass);
        if (children.size() == 0) {
            children = Arrays.asList(objectManager.create(childClass, key, values));
        }

        for (T child : children) {
            processManager.executeStandardProcess(StandardProcess.CREATE, child, null);
        }

        return children;
    }

}


text:
var client, hub, notifier;

notifier = require('./notice/notifier').notifier;

client = require('./notice/client').client;

hub = require('./notice/hub').hub;

module.exports = notifier;

module.exports.create = notifier().create;

module.exports.connect = client().create;

module.exports.listen = hub().create;

module.exports.client = client;

module.exports.hub = hub;


text:
import { TextEquivalent } from "../../";

export = TextEquivalent;


text:
var db = require('./db');

var authenticate = function(uname,pwd,callback){
  db.getUser(uname,pwd,callback);
}

exports.auth = authenticate;


text:
import os
from django.db import models
from imagekit.models import ImageSpecField
from imagekit.processors import ResizeToFill, Adjust
from adminsortable.models import SortableMixin
from adminsortable.fields import SortableForeignKey
from django.template.defaultfilters import slugify

def imageLocation(instance, filename):
    from django.utils.timezone import now
    filename_base, filename_ext = os.path.splitext(filename)
    return 'images/%s%s%s' % (
        filename_base,
        now().strftime("%Y%m%d%H%M%S"),
        filename_ext.lower(),)

class Entry(SortableMixin):
    order = models.PositiveIntegerField(default=0, editable=False, db_index=True)
    publish = models.BooleanField(default=False)
    name = models.CharField(max_length=140)
    slug = models.SlugField(editable=False)
    text = models.TextField()
    dateCreated = models.DateField(auto_now_add=True)
    dateUpdated = models.DateField(auto_now=True)
    class Meta:
        ordering = ['order', 'name']

    def __str__(self):
        return self.name

    def save(self, *args, **kwargs):
        self.slug = slugify(self.name)
        super(Entry, self).save(*args, **kwargs)

class Image(SortableMixin):
    order = models.PositiveIntegerField(default=0, editable=False, db_index=True)
    publish = models.BooleanField(default=False)
    entry = SortableForeignKey('Entry', on_delete=models.CASCADE)
    order_with_respect_to = 'entry'
    name = models.CharField(max_length=140)
    caption = models.CharField(max_length=140, blank=True)
    image = models.ImageField(upload_to=imageLocation)
    dateCreated = models.DateField(auto_now_add=True)
    thumbnail = ImageSpecField(
        source='image',
        processors=[ResizeToFill(200, 200)],
        format='PNG',
        options={'quality': 100})
    thumbnailBW = ImageSpecField(
        source='image',
        processors=[Adjust(color=0.0),ResizeToFill(200, 200)],
        format='PNG',
        options={'quality': 100})

    class Meta:
        ordering = ['order', 'dateCreated']

    def __str__(self):
        return self.name

    def image_img(self):
        if self.image:
            return u'<img src="%s" style="width: 100px;'\
                ' height: auto; display: block;"/>' % self.thumbnail.url
        else:
            return 'No Image'
    image_img.short_description = 'Image'
    image_img.allow_tags = True


text:
def write(template, **kwargs):
    return template.serialize(output = 'plain', **kwargs)


text:
from __future__ import print_function

from flask import Blueprint, Flask, jsonify, json, abort, request, g
from os_reststack_manager.app import credentials, db, Tenant, logging

from lib.setup_tenant import tenant_create, extract_keys
from lib.erase_tenant import tenant_delete

import re
import jwt
import os_reststack_manager.config as CONF

mod = Blueprint('tenant-manager', __name__)
logger = logging.getLogger('tenant_manager')

@mod.before_request
def authenticate():
    # logger.debug("endpoint request: %s" % request.endpoint)
    if re.search('tenant_provisioned', str(request.endpoint)):
        g.user = "phone_home"
        logger.info("Authentication bypassed: tenant_provisioned")
        return

    try:
        decoded = jwt.decode(request.headers['X-Auth-Token'], credentials['tenant_secret'], algorithms=['HS256'])
        g.user = decoded['user']
    except KeyError:
        logger.error("Error: key error.")
        abort(401)
    except jwt.DecodeError:
        logger.error("Error: decode error")
        abort(401)

@mod.route('/', methods=['GET'])
def test_connection():
    logger.info("User " + g.user + " testing connection.")
    return 'Ok', 200

@mod.route('/tenant', methods=['POST'])
def create_tenant():
    logger.info("User %s requested creation", g.user)
    data = request.get_json(force=True)
    logger.debug("Request data: %s" % data)

    mconf = data['machine_conf'] if 'machine_conf' in data else CONF.MACHINE
    cconf = data['cloud_conf'] if 'cloud_conf' in data else CONF.CLOUD_CONFIG

    ip, machine_id = tenant_create(tenant_name=data['tenant'],
                                   tenant_keys=extract_keys(data['pub_key']),
                                   image_name_or_id=data['image_id'],
                                   credentials=credentials, cloud_conf=cconf,
                                   machine_conf=mconf)
    tenant = Tenant(tenant_name=data['tenant'], machine_id=machine_id, ip=ip)
    db.session.add(tenant)
    db.session.commit()

    return jsonify(tenant=data['tenant'], machine_id=machine_id, ip=ip), 202

@mod.route('/tenant/<tenant>', methods=['GET'])
def get_tenant(tenant):
    logger.info("User %s is enquiring about %s" % (g.user, tenant))
    tenant = Tenant.query.filter_by(tenant_name=tenant).first_or_404()
    return jsonify(tenant_name=tenant.tenant_name, machine_id=tenant.machine_id, ip=tenant.ip, status=tenant.status), 200

@mod.route('/tenant/<tenant>', methods=['DELETE'])
def delete_tenant(tenant):
    logger.info("User %s deleting tenant %s", (g.user, tenant))
    tenant_delete(tenant, CONF.CREDENTIALS)
    return "", 200

@mod.route('/tenant/provisioned/<machine_id>', methods=['POST'])
def tenant_provisioned(machine_id):
    logger.info("Tenant provisioned! %s" % machine_id)
    tenant = Tenant.query.filter_by(machine_id=machine_id).first_or_404()
    tenant.status = 'READY'
    db.session.commit()

    return "", 200


text:
require 'spec_helper'

describe BlabbrCore::Topic do
  let(:current_user) { Factory :user }
  let!(:topic)       { Factory :topic, author: current_user }
  let(:user)         { Factory :user }
  let(:admin)        { Factory :admin }

  context 'with a current_user' do
    let(:domain) {
      BlabbrCore::Topic.new(current_user, topic.limace)
    }

    it 'should find a specific topic' do
      domain.find.should eq topic
    end

    it 'should be able to add posts' do
      domain.add_post(body: "My new post").should be_true
    end

    it 'should be able to upadate posts' do
      domain.add_post(body: "My new post")
      domain.update_post(topic.posts.first.id.to_s, body: "My new post").should be_true
    end
  end

  context 'with an admin' do
    let(:domain) {
      BlabbrCore::Topic.new(admin, topic.limace)
    }

    it 'should find a specific topic' do
      BlabbrCore::Topic.new(admin, topic.limace).find.should eq topic
    end

    it 'should be able to add posts' do
      domain.add_post(body: "My new post").should be_true
    end

    it 'should be able to upadate posts' do
      domain.add_post(body: "My new post")
      domain.update_post(topic.posts.first.id.to_s, body: "My new post").should be_true
    end
  end

  context 'with a member' do
    let(:domain) {
      BlabbrCore::Topic.new(user, topic.limace)
    }

    before do
      topic.members.create(user: user)
    end

    it 'should find a specific topic' do
      BlabbrCore::Topic.new(user, topic.limace).find.should eq topic
    end

    it 'should be able to add posts' do
      domain.add_post(body: "My new post").should be_true
    end
  end

  context 'with a user' do
    let(:domain) {
      BlabbrCore::Topic.new(user, topic.limace)
    }

    it 'should not find a specific topic' do
      lambda {
        BlabbrCore::Topic.new(user, topic.limace).find
      }.should raise_error
    end

    it 'should not be able to add posts' do
      lambda {
        domain.add_post(body: "My new post")
      }.should raise_error
    end

    it 'should not be able to update posts' do
      topic.posts.create(author: topic.author, body: 'Not able to update')
      lambda {
        domain.update_post(topic.posts.first.id.to_s, body: "My new post")
      }.should raise_error
    end
  end

  context 'without a user' do
    let(:domain) {
      BlabbrCore::Topic.new(user, topic.limace)
    }

    it 'it should raise on :find' do
      lambda {BlabbrCore::Topic.new.find}.should raise_error
    end

  end
end


text:
/**
 * @file tgSimulation.cpp
 * @brief Contains the definitions of members of class tgSimulation
 * @author Ryan Adams, Brian Mirletz
 * $Id$
 */

// This module
#include "tgSimulation.h"
// This application
#include "tgModel.h"
#include "tgSimView.h"
#include "tgSimViewGraphics.h"
#include "tgWorld.h"
// The Bullet Physics Library
#include "LinearMath/btQuickprof.h"

// The C++ Standard Library
#include <stdexcept>

tgSimulation::tgSimulation(tgSimView& view) :
  m_view(view)
{
        m_view.bindToSimulation(*this);

    m_view.setup();

    // Postcondition
    assert(invariant());
}

tgSimulation::~tgSimulation()
{
    teardown();
    m_view.releaseFromSimulation();
    for (std::size_t i = 0; i < m_models.size(); i++)
    {
        delete m_models[i];
    }
}

void tgSimulation::addModel(tgModel* pModel)
{
    // Precondition
    if (pModel == NULL)
    {
        throw std::invalid_argument("NULL pointer to tgModel");
    }
    else
    {

        pModel->setup(m_view.world());
        m_models.push_back(pModel);
    }

    // Postcondition
    assert(invariant());
    assert(!m_models.empty());
}

void tgSimulation::addObstacle(tgModel* pObstacle)
{
    // Precondition
    if (pObstacle == NULL)
    {
        throw std::invalid_argument("NULL pointer to tgModel");
    }
    else
    {

        pObstacle->setup(m_view.world());
        m_obstacles.push_back(pObstacle);
    }

    // Postcondition
    assert(invariant());
    assert(!m_obstacles.empty());
}

void tgSimulation::onVisit(const tgModelVisitor& r) const
{
#ifndef BT_NO_PROFILE
    BT_PROFILE("tgSimulation::onVisit");
#endif //BT_NO_PROFILE
        // Removed sending the visitor to the world since it wasn't used
        // Write a worldVisitor if its necessary
        for (std::size_t i = 0; i < m_models.size(); i++) {
            m_models[i]->onVisit(r);
        }
        for (std::size_t i = 0; i < m_obstacles.size(); i++) {
            m_obstacles[i]->onVisit(r);
        }
}

void tgSimulation::reset()
{

    teardown();

    m_view.setup();
    for (std::size_t i = 0; i != m_models.size(); i++)
    {

        m_models[i]->setup(m_view.world());
    }

    // Don't need to set up obstacles since they will be added after this
}

void tgSimulation::reset(tgGround* newGround)
{

    teardown();

    // This will reset the world twice (once in teardown, once here), but that shouldn't hurt anything
    m_view.world().reset(newGround);

    m_view.setup();
    for (std::size_t i = 0; i != m_models.size(); i++)
    {

        m_models[i]->setup(m_view.world());
    }

    // Don't need to set up obstacles since they were just added
}

/**
 * @note This is not inlined because it depends on the definition of tgSimView.
 */
tgWorld& tgSimulation::getWorld() const
{
    return m_view.world();
}

void tgSimulation::step(double dt) const
{
// Trying to profile here creates trouble for tgLinearString -  this is outside of the profile loop

        if (dt <= 0)
    {
        throw std::invalid_argument("dt for step is not positive");
    }
    else
    {
        // Step the world.
        // This can be done before or after stepping the models.
        m_view.world().step(dt);

        // Step the models
        for (std::size_t i = 0; i < m_models.size(); i++)
        {
            m_models[i]->step(dt);
        }

        // Step the obstacles
        /// @todo determine if this is necessary
        for (std::size_t i = 0; i < m_obstacles.size(); i++)
        {
            m_obstacles[i]->step(dt);
        }
    }
}

void tgSimulation::teardown()
{
    const size_t n = m_models.size();
    for (std::size_t i = 0; i < n; i++)
    {
        tgModel * const pModel = m_models[i];
        assert(pModel != NULL);

        pModel->teardown();
    }

    while(m_obstacles.size() != 0)
    {
        tgModel * const pModel = m_obstacles.back();
        assert(pModel != NULL);

        pModel->teardown();

        // Remove and destroy element
        delete pModel;
        m_obstacles.pop_back();
    }

    assert(m_obstacles.empty());

    // Reset the world after the models - models need world info for
    // their onTeardown() functions
    m_view.world().reset();
    // Postcondition
    assert(invariant());
}

void tgSimulation::run() const
{
    m_view.run();
}

void tgSimulation::run(int steps) const
{
    m_view.run(steps);
}

bool tgSimulation::invariant() const
{
  return true;
}


text:
package com.zhu2chu.all.test.file;

import com.jfinal.log.Log;

public class FileMain {

    private static final Log log = Log.getLog(FileMain.class);

    public static void main(String[] args) {
        String filePath = System.getProperty("user.home");

        /*String srcFilename = "D:\\迅雷下载" + File.separator + "360cse_8.7.0.306.exe";
        String srcFilename2 = "D:\\迅雷下载" + File.separator + "360cse_8.7.0.306base64.txt";
        String srcFilename3 = filePath + File.separator + "desktop" + File.separator + "videobase64.mp4";

        FileKit.writeBase64(srcFilename, srcFilename2, 1024);*/
        // FileKit.readBase64(srcFilename2, srcFilename3);

        /*File file = new File("D:\\360Downloads\\wu_1bpo6fihe16jd1jlr1eo1jc1k30ta");
        File[] array = file.listFiles(new FileFilter() {
            @Override
            public boolean accept(File pathname) {
                if (pathname.isDirectory()) {
                    return false;
                }
                return true;
            }
        });
        System.out.println(array);

        String s = "D:\\360Downloads\\"+"\u0000"+"wu_1bpo6fihe16jd1jlr1eo1jc1k30ta";
        //FileKit.nioTransferCopy(srcFilename, srcFilename3);
        System.out.println(s.indexOf("\u0000")<0);
        System.out.println("file.exists:"+file.exists());*/

        System.out.println();
    }

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Nordic Jl Bot. 5(2): 201 (1985)

#### Original name
Cyathus costatus Lloyd ex H.J. Brodie

### Remarks
null


text:
namespace Bubblewrap
{
	namespace Base
	{

	}
}


text:
<com.tle.beans.mime.MimeEntry>
  <id>39240</id>
  <institution>
    <id>39169</id>
    <uniqueId>0</uniqueId>
    <enabled>true</enabled>
  </institution>
  <extensions class="list">
    <string>bz2</string>
  </extensions>
  <type>application/x-bzip</type>
  <description>Archive</description>
  <attributes>
    <entry>
      <string>PluginIconPath</string>
      <string>icons/zip.png</string>
    </entry>
  </attributes>
</com.tle.beans.mime.MimeEntry>


text:
/*******************************************************
           rss-converter function
(Google RSS Feed API >>>  <<<)

*******************************************************/

/*==============================
      Global variables:
===============================*/
var fishDate = new Date(); // sets a timestamp to first loading of pagge, then triggers a rss-update every 4 hours

var rssData = [];  // should make an array with 4 objects [{Willamette Falls}, {Bonneville Dam}, {The Dalles Dam}, {John Day Dam}]

var fishCount = 0;

var rawData = [];
var damsArray = [];
var chinookCohoData =[
                {                       // Object[0] = Bonneville Dam
                    Project: "empty",
                    Year: 2016,
                    Date: "empty",
                    Chinook: 0,
                    Coho: 0,
                    Steelhead: 0
                },
                {                       // Object[1] = The Dalles Dam
                    Project: "empty",
                    Year: 2016,
                    Date: "empty",
                    Chinook: 0,
                    Coho: 0,
                    Steelhead: 0
                }
                ];

/*==============================================
        Function for RSS-Feed:
===============================================*/

google.load("feeds", "1");

//****** Function returns an Array with objects from the RSS-Feed:

function initialize() {
      console.log("RSS-Feed first updated at: ", fishDate);

      var feed = new google.feeds.Feed("http://www.fpc.org/rss/rssAdultCounts.aspx");

      feed.load(function(result) {   // creates "result" object

        if (!result.error) {

          for (var i = 0; i < result.feed.entries.length; i++) {
            rssData.push(result.feed.entries[i]);
          }

          //***  rssData-manipulation function call here:
          makeStripData(rssData, rawData);
          makeProjectDate(rawData, chinookCohoData);
          makeChinookCoho(rawData, chinookCohoData);

          console.log('Current RSS-Feed Data --- chinookCohoData:  ', chinookCohoData);

          // calc total fish passed Bonneville Dam:
          fishCount = parseInt(chinookCohoData[0].Chinook) + parseInt(chinookCohoData[0].Coho);

          // display fishCount:
          var fishCountId = document.getElementById('fishCount');  // to display fishCount in the html
          fishCountId.textContent = 'Yesterday ' + fishCount + ' Salmon passed the Bonneville dam.';

          } // if close

       }); // feed.load close

} // initialize() close

// RSS-data is TIMESENSITIVE: will run when rss-data is ready:
google.setOnLoadCallback(initialize);

/*==============================================
      Functions for processing Rss-data:
    (called inside of initialize-function)
===============================================*/

//****** STEP 1 --- pull title and fish data for each dam pushes selected data into rawData-Array

function makeStripData (array1, array2) {

        for (var i = 1; i < 3; i++) {  // array1 = rssData, array2 = rawData // i = 1 and i < 3 is because we only need the 2nd and 3rd item,
            var stripData = [];

            stripData.push(array1[i].title);
            stripData.push(array1[i].content);
            array2.push(stripData);
        }

};

//****** STEP 2 --- turn title-property from rawData into new project- and date-properties in chinookCohoData-Objects:
function makeProjectDate(array1, array2) {   // array1 = rawData, array2 = chinookCohoData

    for (var i = 0; i < array2.length; i++) {

        var titleSplit = array1[i][0].split(" ");  // this accesses the title info in rawData at index [0]

        if (titleSplit[0] == "BONNEVILLE") {
            array2[i].Project = "BON";
        } else {
            array2[i].Project = "TDA";
        }

        array2[i].Date = titleSplit.pop();  // pops off last item (which should be date string "mm/dd/yyy")
    }  // for-loop close

} // makeProjectDate() close

//****** STEP 3 --- turn content property from rawData into new Chinook and Coho properties...
function makeChinookCoho(array1, array2) {    // array1 = rawData, array2 = chinookCohoData

    for (var i = 0; i < array1.length; i++) {

        var contentSplit = array1[i][1].split("; ");    // this accesses the content info in rawData at index [1],
                                                       // contentSplit is now an array ["Chinook Adult 90", "Chinook Jack 2"....]

        for (var k = 0; k < contentSplit.length; k++) {     // lops through contentSplit-Array
            var x = contentSplit[k].split(" ");     // creates array with ["Chinook", "Adult", "90"]

                if (x[0] == "Chinook" && x[1] == "Adult") {     // if x[0] is either ("Chinook" && "Adult") or ("Coho" && "Adult") pop off the number...
                    array2[i].Chinook = parseInt(x.pop());
                } else if (x[0] == "Coho" && x[1] == "Adult") {
                    array2[i].Coho = parseInt(x.pop());
                } else if (x[0] == "Steelhead") {
                    array2[i].Steelhead = parseInt(x.pop());
                }
        } // inner for-loop close

    }  // for-loop close

} // makeChinookCoho() close

/*==============================================================
     Function to run initialize() each day at 1200 hours
===============================================================*/

function updateRSS () {
    setInterval(initialize, 1000 * 60 * 60 * 4);  // runs Initialize ever 4 hours from first load
}

updateRSS();

//


text:
namespace autofill {

class CountryComboboxModelTest : public testing::Test {
 public:
  CountryComboboxModelTest()
      : pref_service_(autofill::test::PrefServiceForTesting()) {
    manager_.SetPrefService(pref_service_.get());
    manager_.set_timezone_country_code("KR");
    model_ = std::make_unique<CountryComboboxModel>();
    model_->SetCountries(
        manager_, base::RepeatingCallback<bool(const std::string&)>(), "en-US");
  }

  void TearDown() override { manager_.SetPrefService(nullptr); }

  TestPersonalDataManager* manager() { return &manager_; }
  CountryComboboxModel* model() { return model_.get(); }

 private:
  TestPersonalDataManager manager_;
  std::unique_ptr<PrefService> pref_service_;
  std::unique_ptr<CountryComboboxModel> model_;
};

TEST_F(CountryComboboxModelTest, DefaultCountryCode) {
  std::string default_country = model()->GetDefaultCountryCode();
  EXPECT_EQ(manager()->GetDefaultCountryCodeForNewAddress(), default_country);

  AutofillCountry country(default_country, "en-US");
  EXPECT_EQ(country.name(), model()->GetItemAt(0));
}

TEST_F(CountryComboboxModelTest, AllCountriesHaveComponents) {
  ::i18n::addressinput::Localization localization;
  std::string unused;
  for (size_t i = 0; i < model()->GetItemCount(); ++i) {
    if (model()->IsItemSeparatorAt(i))
      continue;

    std::string country_code = model()->countries()[i]->country_code();
    std::vector<::i18n::addressinput::AddressUiComponent> components =
        ::i18n::addressinput::BuildComponents(country_code, localization,
                                              std::string(), &unused);
    EXPECT_FALSE(components.empty()) << " for country " << country_code;
  }
}

}  // namespace autofill


text:
<?xml version="1.0" encoding="utf-8"?>
<com.zhy.autolayout.AutoRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentStart="true"
        android:layout_alignParentTop="true"
        android:scaleType="centerCrop"
        android:src="@drawable/background" />

    <com.zhy.autolayout.AutoRelativeLayout
        android:fitsSystemWindows="true"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <include layout="@layout/mytoolbar"
            android:id="@+id/mytoolbar"/>

        <com.zhy.autolayout.AutoRelativeLayout
            android:id="@+id/autoRelativeLayout"
            android:layout_width="700px"
            android:layout_height="100px"
            android:layout_below="@+id/imageView3"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="300px">

            <ImageView
                android:id="@+id/imageView4"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_alignParentTop="true"
                android:src="@drawable/phone" />

            <EditText
                android:id="@+id/phone"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_alignParentEnd="true"
                android:layout_alignParentTop="true"
                android:layout_toEndOf="@+id/imageView4"
                android:background="@null"
                android:hint="  Mobile Phone"
                android:textColorHint="#53e6e6e6"
                android:textSize="24sp" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="0.5dp"
                android:layout_alignParentBottom="true"
                android:background="#eeeeee" />
        </com.zhy.autolayout.AutoRelativeLayout>

        <com.zhy.autolayout.AutoRelativeLayout
            android:id="@+id/autoRelativeLayout1"
            android:layout_width="700px"
            android:layout_height="100px"
            android:layout_below="@+id/autoRelativeLayout"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="100px">

            <ImageView
                android:id="@+id/imageView5"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_alignParentTop="true"
                android:src="@drawable/pinumber" />

            <EditText
                android:id="@+id/Pi"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_alignParentEnd="true"
                android:layout_alignParentTop="true"
                android:layout_toEndOf="@+id/imageView5"
                android:background="@null"
                android:hint="  PINumber"
                android:textColorHint="#53e6e6e6"
                android:textSize="24sp" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="0.5dp"
                android:layout_alignParentBottom="true"
                android:background="#eeeeee" />

            <RelativeLayout
                android:id="@+id/get"
                android:layout_width="100dp"
                android:layout_height="wrap_content"
                android:background="@drawable/money_ll"
                android:layout_centerVertical="true"
                android:layout_alignParentEnd="true">

                <TextView
                    android:id="@+id/textView6"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentEnd="true"
                    android:layout_alignParentStart="true"
                    android:layout_alignParentTop="true"
                    android:gravity="center_horizontal"
                    android:text="获取验证码"
                    android:textColor="@color/white"
                    android:textSize="16sp" />
            </RelativeLayout>
        </com.zhy.autolayout.AutoRelativeLayout>

        <com.zhy.autolayout.AutoRelativeLayout
            android:id="@+id/autoRelativeLayout2"
            android:layout_width="700px"
            android:layout_height="100px"
            android:layout_below="@+id/autoRelativeLayout1"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="100px">

            <ImageView
                android:id="@+id/imageView6"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_alignParentTop="true"
                android:src="@drawable/password" />

            <EditText
                android:id="@+id/password"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_alignParentEnd="true"
                android:layout_alignParentTop="true"
                android:layout_toEndOf="@+id/imageView6"
                android:background="@null"
                android:hint="  New Password"
                android:textColorHint="#53e6e6e6"
                android:textSize="24sp" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="0.5dp"
                android:layout_alignParentBottom="true"
                android:background="#eeeeee" />

        </com.zhy.autolayout.AutoRelativeLayout>

        <com.zhy.autolayout.AutoRelativeLayout
            android:id="@+id/autoRelativeLayout3"
            android:layout_width="700px"
            android:layout_height="100px"
            android:layout_below="@+id/autoRelativeLayout2"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="100px">

            <ImageView
                android:id="@+id/imageView8"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_alignParentTop="true"
                android:src="@drawable/password" />

            <EditText
                android:id="@+id/Cpassword"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_alignParentEnd="true"
                android:layout_alignParentTop="true"
                android:layout_toEndOf="@+id/imageView8"
                android:background="@null"
                android:hint="  Confirm password"
                android:textColorHint="#53e6e6e6"
                android:textSize="24sp" />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="0.5dp"
                android:layout_alignParentBottom="true"
                android:background="#eeeeee" />
        </com.zhy.autolayout.AutoRelativeLayout>

        <RelativeLayout
            android:id="@+id/login"
            android:layout_width="100dp"
            android:layout_height="wrap_content"
            android:layout_alignEnd="@+id/autoRelativeLayout3"
            android:layout_alignStart="@+id/autoRelativeLayout3"
            android:layout_below="@+id/autoRelativeLayout3"
            android:layout_marginTop="66dp"
            android:background="@drawable/money_ll">

            <TextView
                android:id="@+id/textView5"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentStart="true"
                android:layout_alignParentTop="true"
                android:gravity="center_horizontal"
                android:text="确         认"
                android:textColor="@color/white"
                android:textSize="20sp" />
        </RelativeLayout>
    </com.zhy.autolayout.AutoRelativeLayout>
</com.zhy.autolayout.AutoRelativeLayout>


text:
<?php
/**
 * @file
 * A single location to store configuration.
 */

define('CONSUMER_KEY', apply_filters('prlipro_twitter_consumer_key', 'hQrf6vxql3WPGpcerNGdA'));
define('CONSUMER_SECRET', apply_filters('prlipro_twitter_consumer_secret', 'C5kWChGhnJ016AecJfYmGpToXNsWZ60tR6d5gT7cag'));
define('OAUTH_CALLBACK', get_option('home') . '/prli-twitter-oauth/callback');


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Father extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see https://codeigniter.com/user_guide/general/urls.html
	 */
	public function index()
	{
		if ($this->input->server('REQUEST_METHOD') == 'GET')
		{

		//cargar modelo
			$this->load->model('director/FatherModel');
				//metodo del modelo para obtener la lista de todos los profesores
			$fathers=$this->FatherModel->GetAll();

			$fathers['fathers']=$fathers;

			$this->load->view('director/header_view');
			$this->load->view('director/navigation_view');
			$this->load->view('director/wrapper_view');
			$this->load->view('director/father/father_view',$fathers);
			$this->load->view('director/footer_view');
		}
		//post
		else if ($this->input->server('REQUEST_METHOD') == 'POST')
		{

		}
	}

	public function add()
	{

		if ($this->input->server('REQUEST_METHOD') == 'GET')
		{

			$this->load->view('director/header_view');
			$this->load->view('director/navigation_view');
			$this->load->view('director/wrapper_view');
			$this->load->view('director/father/add_father_view');
			$this->load->view('director/footer_view');
		}
		//post
		else if ($this->input->server('REQUEST_METHOD') == 'POST')
		{

			//cargar modelo
			$this->load->model('director/FatherModel');
			$today = getdate();
			$photoName=hash('ripemd160', $today['seconds'].$today['minutes'].$today['hours'].$today['mday'].$today['mon'].$today['year']);

			$father['dniApoderado']=$this->input->post('dni');
			$father['nomApoderado']=$this->input->post('names');
			$father['apePaternoApoderado']=$this->input->post('father_last_name');
			$father['apeMaternoApoderado']=$this->input->post('mother_last_name');//FM
			$father['dirApoderado']=$this->input->post('address_street');
			$father['telfApoderado']=$this->input->post('cellphone');//*
			$father['sexoApoderado']=$this->input->post('sex');//*
			$father['fechaNacApoderado']=$this->input->post('date');
			$father['fotoApoderado']=$photoName;

			$archivo= $_FILES['photo']['name'];
			$explode= explode('.', $archivo);
			$extension=array_pop($explode);
			$father['fotoApoderado']=$photoName.'.'.$extension;

			$ftp_server = ftp_service_uri;
			$ftp_user_name = "web";
			$ftp_user_pass = "titulacion";
			$destination_file = "/imagenes/apoderado/";
			$source_file = $_FILES['photo']['tmp_name'];

			$conn_id = ftp_connect($ftp_server);
			ftp_pasv($conn_id, true);
			$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

			if ((!$conn_id) || (!$login_result))
			{
				//echo "La conexion a fallado";
				//echo "Intentando conectar a $ftp_server con el usuario $ftp_user_name";
				exit;
			}
			else
			{
				//echo "Conectado a $ftp_server, para el usuario $ftp_user_name
";
			}

			$upload = ftp_put($conn_id, $destination_file . $father['fotoApoderado'],

				$source_file, FTP_BINARY);

			if (!$upload)
			{
				//echo "Error al subir la imagen
";
			} else
			{
				//echo "Subido $source_file a $ftp_server como $destination_file
";
			}

			ftp_close($conn_id);

			//agregar apoderado
			$response=$this->FatherModel->add(json_encode($father,true));
			//var_dump($response);
			//cargar WEb
			$this->load->view('director/header_view');
			$this->load->view('director/navigation_view');
			$this->load->view('director/wrapper_view');
			$this->load->view('director/father/add_father_view');
			$this->load->view('director/footer_view');

		}
	}

	public function edit()
	{
		if ($this->input->server('REQUEST_METHOD') == 'POST')
		{
			if (is_null($data=$this->input->post('edit')))
			{
				//envio recepcion de datos.
				$data=$this->input->post('data');

				print_r(json_decode($data,true));
				$var['data']=json_decode($data,true);
				$this->load->view('director/header_view');
				$this->load->view('director/navigation_view');
				$this->load->view('director/wrapper_view');
				$this->load->view('director/father/edit_father_view',$var);
				$this->load->view('director/footer_view');
			}else{

				//respuesta proceso de edicion de datos
				//cargar modelo
				$this->load->model('director/FatherModel');

				$father['CodApoderado']=$this->input->post('CodApoderado');
				$father['DniApoderado']=$this->input->post('dni');
				$father['NomApoderado']=$this->input->post('names');
				$father['ApePaternoApoderado']=$this->input->post('father_last_name');
				$father['ApeMaternoApoderado']=$this->input->post('mother_last_name');//FM
				$father['DirApoderado']=$this->input->post('address_street');
				$father['TelfApoderado']=$this->input->post('cellphone');//*
				$father['SexoApoderado']=$this->input->post('sex');//*
				$father['FechaNacApoderado']=$this->input->post('date');
				$father['FotoApoderado']="";

				$archivo= $_FILES['photo']['name'];
			if ($archivo=="") {

			}else{
				$today = getdate();
				$photoName=hash('ripemd160', $today['seconds'].$today['minutes'].$today['hours'].$today['mday'].$today['mon'].$today['year']);

				$father['FotoApoderado']=$photoName;

				$explode= explode('.', $archivo);
				$extension=array_pop($explode);
				$father['FotoApoderado']=$photoName.'.'.$extension;

				$ftp_server = ftp_service_uri;
				$ftp_user_name = "web";
				$ftp_user_pass = "titulacion";
				$destination_file = "/imagenes/apoderado/";
				$source_file = $_FILES['photo']['tmp_name'];

				$conn_id = ftp_connect($ftp_server);
				ftp_pasv($conn_id, true);
				$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

				if ((!$conn_id) || (!$login_result))
				{
				//echo "La conexion a fallado";
				//echo "Intentando conectar a $ftp_server con el usuario $ftp_user_name";
					exit;
				}
				else
				{
				//echo "Conectado a $ftp_server, para el usuario $ftp_user_name
";
				}

				$upload = ftp_put($conn_id, $destination_file . $father['FotoApoderado'],

					$source_file, FTP_BINARY);

				if (!$upload)
				{
				//echo "Error al subir la imagen
";
				} else
				{
				//echo "Subido $source_file a $ftp_server como $destination_file
";
				}

				ftp_close($conn_id);
			}

			$jsonFather=json_encode($father,true);

			//agregar apoderado

			$response=$this->FatherModel->edit($jsonFather);

			//print_r($response);
			//cargar WEb
			//var_dump($father);
			$father['codApoderado']=$father['CodApoderado'];
			$father['nomApoderado']=$father['NomApoderado'];
			$father['apePaternoApoderado']=$father['ApePaternoApoderado'];
			$father['apeMaternoApoderado']=$father['ApeMaternoApoderado'];
			$var['data']=$father;
			$this->load->view('director/header_view');
			$this->load->view('director/navigation_view');
			$this->load->view('director/wrapper_view');
			$this->load->view('director/father/edit_father_view',$var);
			$this->load->view('director/footer_view');

		}

	}else{
		redirect('/Director/father/index');
	}

}

	public  function enabled()
	{
			if ($this->input->server('REQUEST_METHOD') == 'GET')
		{

			//echo  ;
		}
		else if ($this->input->server('REQUEST_METHOD') == 'POST')
		{

			$codApoderado=$this->input->post('codApoderado');

			$this->load->model('director/FatherModel');

			$response=$this->FatherModel->enabled($codApoderado);

			echo $response['resultado'];
		}

	}
	public  function disabled()
	{
		if ($this->input->server('REQUEST_METHOD') == 'GET')
		{

			//echo  ;
		}
		else if ($this->input->server('REQUEST_METHOD') == 'POST')
		{

			$codApoderado=$this->input->post('codApoderado');

			$this->load->model('director/FatherModel');

			$response=$this->FatherModel->disabled($codApoderado);
			//$response=json_decode($response,true);

			echo $response['resultado'];
		}

	}

}


text:
import os
import tempfile

import mock

from tvrenamer.processors import cache
from tvrenamer.tests import base

class CacheProcessorTests(base.BaseTest):

    def setUp(self):
        super(CacheProcessorTests, self).setUp()

        dbfile = os.path.join(tempfile.mkdtemp(), 'cache.json')
        self.CONF.set_override('dbfile', dbfile, 'cache')
        self.processor = cache.CacheResults()

    def _make_data(self):
        results = []
        ep1 = mock.Mock()
        ep1.status = {
            '/tmp/Lucy.2014.576p.BDRip.AC3.x264.DuaL-EAGLE.mkv': {
                'formatted_filename': None,
                'state': 'failed',
                'messages': 'Could not find season 20'}
            }
        results.append(ep1)

        ep2 = mock.Mock()
        ep2.status = {
            '/tmp/revenge.412.hdtv-lol.mp4': {
                'formatted_filename': 'S04E12-Madness.mp4',
                'state': 'finished',
                'messages': None}
            }
        results.append(ep2)
        return results

    @mock.patch('tvrenamer.cache.dbapi')
    def test_cache_result(self, mock_cache):

        self.CONF.set_override('cache_enabled', False)
        self.assertFalse(self.processor.enabled)
        self.processor.process([])
        self.assertFalse(mock_cache.called)

        self.CONF.set_override('cache_enabled', True)
        self.assertTrue(self.processor.enabled)
        self.processor.process(self._make_data())
        self.assertTrue(mock_cache.called)

        mock_cache.side_effect = RuntimeError
        self.processor.process(self._make_data())
        self.assertTrue(mock_cache.called)


text:
// Copyright (C) 2017 Jérôme Leclercq
// This file is part of the "Nazara Engine - Utility module"
// For conditions of distribution and use, see copyright notice in Config.hpp

#pragma once

#ifndef NAZARA_VERTEXBUFFER_HPP
#define NAZARA_VERTEXBUFFER_HPP

#include <Nazara/Prerequesites.hpp>
#include <Nazara/Core/ObjectRef.hpp>
#include <Nazara/Core/RefCounted.hpp>
#include <Nazara/Core/Signal.hpp>
#include <Nazara/Utility/Buffer.hpp>
#include <Nazara/Utility/VertexDeclaration.hpp>

namespace Nz
{
	class VertexBuffer;

	using VertexBufferConstRef = ObjectRef<VertexBuffer>;
	using VertexBufferRef = ObjectRef<VertexBuffer>;

	class NAZARA_UTILITY_API VertexBuffer : public RefCounted
	{
		public:
			VertexBuffer() = default;
			VertexBuffer(VertexDeclarationConstRef vertexDeclaration, BufferRef buffer);
			VertexBuffer(VertexDeclarationConstRef vertexDeclaration, BufferRef buffer, UInt32 offset, UInt32 size);
			VertexBuffer(VertexDeclarationConstRef vertexDeclaration, UInt32 length, DataStorage storage, BufferUsageFlags usage);
			VertexBuffer(const VertexBuffer& vertexBuffer);
			VertexBuffer(VertexBuffer&&) = delete;
			~VertexBuffer();

			bool Fill(const void* data, UInt32 startVertex, UInt32 length);
			bool FillRaw(const void* data, UInt32 offset, UInt32 size);

			inline const BufferRef& GetBuffer() const;
			inline UInt32 GetEndOffset() const;
			inline UInt32 GetStartOffset() const;
			inline UInt32 GetStride() const;
			inline UInt32 GetVertexCount() const;
			inline const VertexDeclarationConstRef& GetVertexDeclaration() const;

			inline bool IsValid() const;

			void* Map(BufferAccess access, UInt32 startVertex = 0, UInt32 length = 0);
			void* Map(BufferAccess access, UInt32 startVertex = 0, UInt32 length = 0) const;
			void* MapRaw(BufferAccess access, UInt32 offset = 0, UInt32 size = 0);
			void* MapRaw(BufferAccess access, UInt32 offset = 0, UInt32 size = 0) const;

			void Reset();
			void Reset(VertexDeclarationConstRef vertexDeclaration, BufferRef buffer);
			void Reset(VertexDeclarationConstRef vertexDeclaration, BufferRef buffer, UInt32 offset, UInt32 size);
			void Reset(VertexDeclarationConstRef vertexDeclaration, UInt32 length, DataStorage storage, BufferUsageFlags usage);
			void Reset(const VertexBuffer& vertexBuffer);

			void SetVertexDeclaration(VertexDeclarationConstRef vertexDeclaration);

			void Unmap() const;

			VertexBuffer& operator=(const VertexBuffer& vertexBuffer);
			VertexBuffer& operator=(VertexBuffer&&) = delete;

			template<typename... Args> static VertexBufferRef New(Args&&... args);

			// Signals:
			NazaraSignal(OnVertexBufferRelease, const VertexBuffer* /*vertexBuffer*/);

		private:
			BufferRef m_buffer;
			UInt32 m_endOffset;
			UInt32 m_startOffset;
			UInt32 m_vertexCount;
			VertexDeclarationConstRef m_vertexDeclaration;
	};
}

#include <Nazara/Utility/VertexBuffer.inl>

#endif // NAZARA_VERTEXBUFFER_HPP


text:
/*
 * 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.
 */
/*
 * This code was generated by https://github.com/googleapis/google-api-java-client-services/
 * Modify at your own risk.
 */

package com.google.api.services.androidmanagement.v1.model;

/**
 * An action to block access to apps and data on a fully managed device or in a work profile. This
 * action also triggers a device or work profile to displays a user-facing notification with
 * information (where possible) on how to correct the compliance issue. Note: wipeAction must also
 * be specified.
 *
 *
 This is the Java data model class that specifies how to parse/serialize into the JSON that is
 * transmitted over HTTP when working with the Android Management API. For a detailed explanation
 * see:
 * https://developers.google.com/api-client-library/java/google-http-java-client/json
 *

 *
 * @author Google, Inc.
 */
@SuppressWarnings("javadoc")
public final class BlockAction extends com.google.api.client.json.GenericJson {

  /**
   * Number of days the policy is non-compliant before the device or work profile is blocked. To
   * block access immediately, set to 0. blockAfterDays must be less than wipeAfterDays.
   * The value may be {@code null}.
   */
  @com.google.api.client.util.Key
  private java.lang.Integer blockAfterDays;

  /**
   * Number of days the policy is non-compliant before the device or work profile is blocked. To
   * block access immediately, set to 0. blockAfterDays must be less than wipeAfterDays.
   * @return value or {@code null} for none
   */
  public java.lang.Integer getBlockAfterDays() {
    return blockAfterDays;
  }

  /**
   * Number of days the policy is non-compliant before the device or work profile is blocked. To
   * block access immediately, set to 0. blockAfterDays must be less than wipeAfterDays.
   * @param blockAfterDays blockAfterDays or {@code null} for none
   */
  public BlockAction setBlockAfterDays(java.lang.Integer blockAfterDays) {
    this.blockAfterDays = blockAfterDays;
    return this;
  }

  @Override
  public BlockAction set(String fieldName, Object value) {
    return (BlockAction) super.set(fieldName, value);
  }

  @Override
  public BlockAction clone() {
    return (BlockAction) super.clone();
  }

}


text:
using System;
using System.Collections.Generic;
using System.Management.Automation.Runspaces;

namespace Sqlcollaborative.Dbatools.Connection
{
    /// <summary>
    /// Provides static tools for managing connections
    /// </summary>
    public static class ConnectionHost
    {
        /// <summary>
        /// List of all registered connections.
        /// </summary>
        public static Dictionary<string, ManagementConnection> Connections = new Dictionary<string, ManagementConnection>();

        #region Configuration Computer Management
        /// <summary>
        /// The time interval that must pass, before a connection using a known to not work connection protocol is reattempted
        /// </summary>
        public static TimeSpan BadConnectionTimeout = new TimeSpan(0, 15, 0);

        /// <summary>
        /// Globally disables all caching done by the Computer Management functions.
        /// </summary>
        public static bool DisableCache = false;

        /// <summary>
        /// Disables the caching of bad credentials. dbatools caches bad logon credentials for wmi/cim and will not reuse them.
        /// </summary>
        public static bool DisableBadCredentialCache = false;

        /// <summary>
        /// Disables the automatic registration of working credentials. dbatools will caches the last working credential when connecting using wmi/cim and will use those rather than using known bad credentials
        /// </summary>
        public static bool DisableCredentialAutoRegister = false;

        /// <summary>
        /// Enabling this will force the use of the last credentials known to work, rather than even trying explicit credentials.
        /// </summary>
        public static bool OverrideExplicitCredential = false;

        /// <summary>
        /// Enables automatic failover to working credentials, when passed credentials either are known, or turn out to not work.
        /// </summary>
        public static bool EnableCredentialFailover = false;

        /// <summary>
        /// Globally disables the persistence of Cim sessions used to connect to a target system.
        /// </summary>
        public static bool DisableCimPersistence = false;

        /// <summary>
        /// Whether the CM connection using Cim over WinRM is disabled globally
        /// </summary>
        public static bool DisableConnectionCimRM = false;

        /// <summary>
        /// Whether the CM connection using Cim over DCOM is disabled globally
        /// </summary>
        public static bool DisableConnectionCimDCOM = false;

        /// <summary>
        /// Whether the CM connection using WMI is disabled globally
        /// </summary>
        public static bool DisableConnectionWMI = true;

        /// <summary>
        /// Whether the CM connection using PowerShell Remoting is disabled globally
        /// </summary>
        public static bool DisableConnectionPowerShellRemoting = true;
        #endregion Configuration Computer Management

        #region Configuration Sql Connection
        /// <summary>
        /// The number of seconds before a sql connection attempt times out
        /// </summary>
        public static int SqlConnectionTimeout = 15;
        #endregion Configuration Sql Connection

        #region PowerShell remoting sessions
        /// <summary>
        /// List of all session containers used to maintain a cache
        /// </summary>
        public static Dictionary<Guid, PSSessionContainer> PSSessions = new Dictionary<Guid, PSSessionContainer>();

        #region Public operations
        /// <summary>
        /// Returns a registered session for a given computer on a given runspace. Returns null if nothing is registered.
        /// </summary>
        /// <param name="Runspace">The host runspace that opened the session</param>
        /// <param name="ComputerName">The computer connected to</param>
        /// <returns></returns>
        public static PSSession PSSessionGet(Guid Runspace, string ComputerName)
        {
            if (!PSSessions.ContainsKey(Runspace))
                return null;

            return PSSessions[Runspace].Get(ComputerName.ToLower());
        }

        /// <summary>
        /// Registeres a remote session under the owning runspace in its respective computer name
        /// </summary>
        /// <param name="Runspace">The runspace that owns the session</param>
        /// <param name="ComputerName">The computer the session connects to</param>
        /// <param name="Session">The session object</param>
        public static void PSSessionSet(Guid Runspace, string ComputerName, PSSession Session)
        {
            if (!PSSessionCacheEnabled)
                return;

            if (!PSSessions.ContainsKey(Runspace))
                PSSessions[Runspace] = new PSSessionContainer(Runspace);

            PSSessions[Runspace].Set(ComputerName.ToLower(), Session);
        }

        /// <summary>
        /// Searches the cache for an expired remoting session and purges it. After purging it from the list, it still needs to be closed!
        /// </summary>
        /// <returns>The session purged that then needs to be closed</returns>
        public static PSSession PSSessionPurgeExpired()
        {
            foreach (PSSessionContainer container in PSSessions.Values)
                if (container.CountExpired > 0)
                    return container.PurgeExpiredSession();

            return null;
        }

        /// <summary>
        /// The number of expired sessions
        /// </summary>
        public static int PSSessionCountExpired
        {
            get
            {
                int num = 0;

                foreach (PSSessionContainer container in PSSessions.Values)
                    num += container.CountExpired;

                return num;
            }
        }
        #endregion Public operations

        #region Configuration
        /// <summary>
        /// The time until established connections will be considered expired (if available)
        /// </summary>
        public static TimeSpan PSSessionTimeout = new TimeSpan(0, 5, 0);

        /// <summary>
        /// Whether sessions should be cached at all
        /// </summary>
        public static bool PSSessionCacheEnabled = true;
        #endregion Configuration
        #endregion PowerShell remoting sessions
    }
}


text:
package microsoft.exchange.webservices.data.property.complex;

import microsoft.exchange.webservices.data.attribute.EditorBrowsable;
import microsoft.exchange.webservices.data.core.EwsServiceXmlReader;
import microsoft.exchange.webservices.data.core.EwsServiceXmlWriter;
import microsoft.exchange.webservices.data.core.EwsUtilities;
import microsoft.exchange.webservices.data.core.XmlAttributeNames;
import microsoft.exchange.webservices.data.core.XmlElementNames;
import microsoft.exchange.webservices.data.enumeration.EditorBrowsableState;
import microsoft.exchange.webservices.data.enumeration.EmailAddressKey;
import microsoft.exchange.webservices.data.enumeration.ExchangeVersion;
import microsoft.exchange.webservices.data.enumeration.MailboxType;
import microsoft.exchange.webservices.data.exception.ServiceXmlSerializationException;

/**
 * Represents an entry of an EmailAddressDictionary.
 */
@EditorBrowsable(state = EditorBrowsableState.Never)
public final class EmailAddressEntry extends DictionaryEntryProperty<EmailAddressKey> implements
                                                                                IComplexPropertyChangedDelegate {
  // / The email address.
  /**
   * The email address.
   */
  private EmailAddress emailAddress;

  /**
   * Initializes a new instance of the <see cref="EmailAddressEntry"/> class.
   */
  protected EmailAddressEntry() {
    super(EmailAddressKey.class);
    this.emailAddress = new EmailAddress();
    this.emailAddress.addOnChangeEvent(this);
  }

  /**
   * Initializes a new instance of the "EmailAddressEntry" class.
   *
   * @param key          The key.
   * @param emailAddress The email address.
   */
  protected EmailAddressEntry(EmailAddressKey key,
      EmailAddress emailAddress) {
    super(EmailAddressKey.class, key);
    this.emailAddress = emailAddress;
  }

  /**
   * Reads the attribute from XML.
   *
   * @param reader accepts EwsServiceXmlReader
   * @throws Exception throws Exception
   */
  @Override
  public void readAttributesFromXml(EwsServiceXmlReader reader)
      throws Exception {
    super.readAttributesFromXml(reader);
    this.getEmailAddress().setName(
        reader.readAttributeValue(XmlAttributeNames.Name));
    this
        .getEmailAddress()
        .setRoutingType(
            reader
                .readAttributeValue(XmlAttributeNames.
                    RoutingType));
    String mailboxTypeString = reader
        .readAttributeValue(XmlAttributeNames.MailboxType);
    if ((mailboxTypeString != null) && (!mailboxTypeString.isEmpty())) {
      this.getEmailAddress().setMailboxType(
          EwsUtilities.parse(MailboxType.class, mailboxTypeString));
    } else {
      this.getEmailAddress().setMailboxType(null);
    }
  }

  /**
   * Reads the text value from XML.
   *
   * @param reader accepts EwsServiceXmlReader
   * @throws Exception the exception
   */
  @Override
  public void readTextValueFromXml(EwsServiceXmlReader reader)
      throws Exception {
    this.getEmailAddress().setAddress(reader.readValue());
  }

  /**
   * Writes the attribute to XML.
   *
   * @param writer accepts EwsServiceXmlWriter
   * @throws ServiceXmlSerializationException throws ServiceXmlSerializationException
   */
  @Override
  public void writeAttributesToXml(EwsServiceXmlWriter writer)
      throws ServiceXmlSerializationException {
    super.writeAttributesToXml(writer);
    if (writer.getService().getRequestedServerVersion().ordinal() >
        ExchangeVersion.Exchange2007_SP1
            .ordinal()) {
      writer.writeAttributeValue(XmlAttributeNames.Name, this
          .getEmailAddress().getName());
      writer.writeAttributeValue(XmlAttributeNames.RoutingType, this
          .getEmailAddress().getRoutingType());
      if (this.getEmailAddress().getMailboxType() != MailboxType.Unknown) {
        writer.writeAttributeValue(XmlAttributeNames.MailboxType, this
            .getEmailAddress().getMailboxType());
      }
    }
  }

  /**
   * Writes elements to XML.
   *
   * @param writer accepts EwsServiceXmlWriter
   * @throws ServiceXmlSerializationException throws ServiceXmlSerializationException
   */
  @Override
  public void writeElementsToXml(EwsServiceXmlWriter writer)
      throws ServiceXmlSerializationException {
    writer.writeValue(this.getEmailAddress().getAddress(),
        XmlElementNames.EmailAddress);
  }

  /**
   * Gets the e-mail address of the entry.
   *
   * @return the email address
   */
  public EmailAddress getEmailAddress() {
    return this.emailAddress;
    // set { this.SetFieldValue<EmailAddress>(ref this.emailAddress, value);
    // }
  }

  /**
   * Sets the e-mail address of the entry.
   *
   * @param value the new email address
   */
  public void setEmailAddress(Object value) {
    //this.canSetFieldValue((EmailAddress) this.emailAddress, value);
    if (this.canSetFieldValue(this.emailAddress, value)) {
      this.emailAddress = (EmailAddress) value;
    }
  }

  /**
   * E-mail address was changed.
   *
   * @param complexProperty the complex property
   */
  private void emailAddressChanged(ComplexProperty complexProperty) {
    this.changed();
  }

  /*
   * (non-Javadoc)
   *
   * @see
   * microsoft.exchange.webservices.ComplexPropertyChangedDelegateInterface
   * #complexPropertyChanged(microsoft.exchange.webservices.ComplexProperty)
   */
  @Override
  public void complexPropertyChanged(ComplexProperty complexProperty) {
    this.emailAddressChanged(complexProperty);

  }

}


text:
// source:

package nl.esciencecenter.vlet.vfs.ssh.jcraft;

import nl.esciencecenter.vlet.exception.NestedInterruptedException;
import nl.esciencecenter.vlet.vrs.vfs.VFSTransfer;

import com.jcraft.jsch.SftpProgressMonitor;

public class SftpTransferMonitor implements SftpProgressMonitor
{

    private VFSTransfer transfer;
    long count=0;

    public SftpTransferMonitor(VFSTransfer info)
    {
        this.transfer=info;
    }

    public void init(int start, String source, String dest, long size)
    {
        count=0;

        transfer.updateSubTaskDone(0);
        //System.err.println("arg0="+start);
        //System.err.println("arg1="+source);
        //System.err.println("arg2="+dest);
        //System.err.println("arg3="+arg3);
        transfer.startSubTask("SFTP Transfer",size);
    }

    public boolean count(long val)
    {
        count+=val; // jSch updates in intervals;
        transfer.updateSubTaskDone(count);
        // nice jSch has a preemeptive abort.
        // return value==true means continue!

        if (transfer.isCancelled())
        {
            transfer.setException(new NestedInterruptedException("SFTP has been Cancelled!"));
            return false; //abort
        }
        return true; // continue
    }

    public void end()
    {
        // setDone is for the full transfer
        // not 'current'
        transfer.endSubTask("SFTP Transfer");
    }

}