text:
package buildpack_test

import (
	"github.com/cloudfoundry/cli/cf/api/apifakes"
	"github.com/cloudfoundry/cli/cf/commandregistry"
	"github.com/cloudfoundry/cli/cf/errors"
	"github.com/cloudfoundry/cli/cf/models"
	testcmd "github.com/cloudfoundry/cli/testhelpers/commands"
	testreq "github.com/cloudfoundry/cli/testhelpers/requirements"
	testterm "github.com/cloudfoundry/cli/testhelpers/terminal"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"

	. "github.com/cloudfoundry/cli/testhelpers/matchers"
)

var _ = Describe("delete-buildpack command", func() {
	var (
		ui                  *testterm.FakeUI
		buildpackRepo       *apifakes.OldFakeBuildpackRepository
		requirementsFactory *testreq.FakeReqFactory
		deps                commandregistry.Dependency
	)

	updateCommandDependency := func(pluginCall bool) {
		deps.UI = ui
		deps.RepoLocator = deps.RepoLocator.SetBuildpackRepository(buildpackRepo)
		commandregistry.Commands.SetCommand(commandregistry.Commands.FindCommand("delete-buildpack").SetDependency(deps, pluginCall))
	}

	BeforeEach(func() {
		ui = &testterm.FakeUI{}
		buildpackRepo = new(apifakes.OldFakeBuildpackRepository)
		requirementsFactory = &testreq.FakeReqFactory{}
	})

	runCommand := func(args ...string) bool {
		return testcmd.RunCLICommand("delete-buildpack", args, requirementsFactory, updateCommandDependency, false)
	}

	Context("when the user is not logged in", func() {
		BeforeEach(func() {
			requirementsFactory.LoginSuccess = false
		})

		It("fails requirements", func() {
			Expect(runCommand("-f", "my-buildpack")).To(BeFalse())
		})
	})

	Context("when the user is logged in", func() {
		BeforeEach(func() {
			requirementsFactory.LoginSuccess = true
		})

		Context("when the buildpack exists", func() {
			BeforeEach(func() {
				buildpackRepo.FindByNameBuildpack = models.Buildpack{
					Name: "my-buildpack",
					GUID: "my-buildpack-guid",
				}
			})

			It("deletes the buildpack", func() {
				ui = &testterm.FakeUI{Inputs: []string{"y"}}

				runCommand("my-buildpack")

				Expect(buildpackRepo.DeleteBuildpackGUID).To(Equal("my-buildpack-guid"))

				Expect(ui.Prompts).To(ContainSubstrings([]string{"delete the buildpack my-buildpack"}))
				Expect(ui.Outputs).To(ContainSubstrings(
					[]string{"Deleting buildpack", "my-buildpack"},
					[]string{"OK"},
				))
			})

			Context("when the force flag is provided", func() {
				It("does not prompt the user to delete the buildback", func() {
					runCommand("-f", "my-buildpack")

					Expect(buildpackRepo.DeleteBuildpackGUID).To(Equal("my-buildpack-guid"))

					Expect(len(ui.Prompts)).To(Equal(0))
					Expect(ui.Outputs).To(ContainSubstrings(
						[]string{"Deleting buildpack", "my-buildpack"},
						[]string{"OK"},
					))
				})
			})
		})

		Context("when the buildpack provided is not found", func() {
			BeforeEach(func() {
				ui = &testterm.FakeUI{Inputs: []string{"y"}}
				buildpackRepo.FindByNameNotFound = true
			})

			It("warns the user", func() {
				runCommand("my-buildpack")

				Expect(buildpackRepo.FindByNameName).To(Equal("my-buildpack"))
				Expect(buildpackRepo.FindByNameNotFound).To(BeTrue())

				Expect(ui.Outputs).To(ContainSubstrings(
					[]string{"Deleting", "my-buildpack"},
					[]string{"OK"},
				))

				Expect(ui.WarnOutputs).To(ContainSubstrings([]string{"my-buildpack", "does not exist"}))
			})
		})

		Context("when an error occurs", func() {
			BeforeEach(func() {
				ui = &testterm.FakeUI{Inputs: []string{"y"}}

				buildpackRepo.FindByNameBuildpack = models.Buildpack{
					Name: "my-buildpack",
					GUID: "my-buildpack-guid",
				}
				buildpackRepo.DeleteAPIResponse = errors.New("failed badly")
			})

			It("fails with the error", func() {
				runCommand("my-buildpack")

				Expect(buildpackRepo.DeleteBuildpackGUID).To(Equal("my-buildpack-guid"))

				Expect(ui.Outputs).To(ContainSubstrings(
					[]string{"Deleting buildpack", "my-buildpack"},
					[]string{"FAILED"},
					[]string{"my-buildpack"},
					[]string{"failed badly"},
				))
			})
		})
	})
})


text:
namespace WebApplicationApiClient
{
    using System;
    using System.Linq;
    using System.Collections.Generic;
    using System.Net;
    using System.Net.Http;
    using System.Net.Http.Headers;
    using System.Text;
    using System.Text.RegularExpressions;
    using System.Threading;
    using System.Threading.Tasks;
    using Microsoft.Rest;
    using Microsoft.Rest.Serialization;
    using Newtonsoft.Json;
    using Models;

    /// <summary>
    /// Activities operations.
    /// </summary>
    public partial class Activities : IServiceOperations<WebApiApplication>, IActivities
    {
        /// <summary>
        /// Initializes a new instance of the Activities class.
        /// </summary>
        /// <param name='client'>
        /// Reference to the service client.
        /// </param>
        public Activities(WebApiApplication client)
        {
            if (client == null)
            {
                throw new ArgumentNullException("client");
            }
            this.Client = client;
        }

        /// <summary>
        /// Gets a reference to the WebApiApplication
        /// </summary>
        public WebApiApplication Client { get; private set; }

        /// <summary>
        /// Gets all activities.
        /// </summary>
        /// <param name='customHeaders'>
        /// Headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        public async Task<HttpOperationResponse<IList<Activity>>> GetWithHttpMessagesAsync(Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            // Tracing
            bool shouldTrace = ServiceClientTracing.IsEnabled;
            string invocationId = null;
            if (shouldTrace)
            {
                invocationId = ServiceClientTracing.NextInvocationId.ToString();
                Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
                tracingParameters.Add("cancellationToken", cancellationToken);
                ServiceClientTracing.Enter(invocationId, this, "Get", tracingParameters);
            }
            // Construct URL
            var baseUrl = this.Client.BaseUri.AbsoluteUri;
            var url = new Uri(new Uri(baseUrl + (baseUrl.EndsWith("/") ? "" : "/")), "api/Activities").ToString();
            // Create HTTP transport objects
            HttpRequestMessage httpRequest = new HttpRequestMessage();
            httpRequest.Method = new HttpMethod("GET");
            httpRequest.RequestUri = new Uri(url);
            // Set Headers
            if (customHeaders != null)
            {
                foreach(var header in customHeaders)
                {
                    if (httpRequest.Headers.Contains(header.Key))
                    {
                        httpRequest.Headers.Remove(header.Key);
                    }
                    httpRequest.Headers.TryAddWithoutValidation(header.Key, header.Value);
                }
            }

            // Send Request
            if (shouldTrace)
            {
                ServiceClientTracing.SendRequest(invocationId, httpRequest);
            }
            cancellationToken.ThrowIfCancellationRequested();
            HttpResponseMessage httpResponse = await this.Client.HttpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false);
            if (shouldTrace)
            {
                ServiceClientTracing.ReceiveResponse(invocationId, httpResponse);
            }
            HttpStatusCode statusCode = httpResponse.StatusCode;
            cancellationToken.ThrowIfCancellationRequested();
            if (!(statusCode == (HttpStatusCode)Enum.Parse(typeof(HttpStatusCode), "OK")))
            {
                var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", statusCode));
                ex.Request = httpRequest;
                ex.Response = httpResponse;
                if (shouldTrace)
                {
                    ServiceClientTracing.Error(invocationId, ex);
                }
                throw ex;
            }
            // Create Result
            var result = new HttpOperationResponse<IList<Activity>>();
            result.Request = httpRequest;
            result.Response = httpResponse;
            // Deserialize Response
            if (statusCode == (HttpStatusCode)Enum.Parse(typeof(HttpStatusCode), "OK"))
            {
                string responseContent = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
                result.Body = JsonConvert.DeserializeObject<IList<Activity>>(responseContent, this.Client.DeserializationSettings);
            }
            if (shouldTrace)
            {
                ServiceClientTracing.Exit(invocationId, result);
            }
            return result;
        }

        /// <summary>
        /// Creates a new activity.
        /// </summary>
        /// <param name='value'>
        /// </param>
        /// <param name='customHeaders'>
        /// Headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        public async Task<HttpOperationResponse<object>> PostWithHttpMessagesAsync(Activity value, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (value == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "value");
            }
            // Tracing
            bool shouldTrace = ServiceClientTracing.IsEnabled;
            string invocationId = null;
            if (shouldTrace)
            {
                invocationId = ServiceClientTracing.NextInvocationId.ToString();
                Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
                tracingParameters.Add("value", value);
                tracingParameters.Add("cancellationToken", cancellationToken);
                ServiceClientTracing.Enter(invocationId, this, "Post", tracingParameters);
            }
            // Construct URL
            var baseUrl = this.Client.BaseUri.AbsoluteUri;
            var url = new Uri(new Uri(baseUrl + (baseUrl.EndsWith("/") ? "" : "/")), "api/Activities").ToString();
            // Create HTTP transport objects
            HttpRequestMessage httpRequest = new HttpRequestMessage();
            httpRequest.Method = new HttpMethod("POST");
            httpRequest.RequestUri = new Uri(url);
            // Set Headers
            if (customHeaders != null)
            {
                foreach(var header in customHeaders)
                {
                    if (httpRequest.Headers.Contains(header.Key))
                    {
                        httpRequest.Headers.Remove(header.Key);
                    }
                    httpRequest.Headers.TryAddWithoutValidation(header.Key, header.Value);
                }
            }

            // Serialize Request
            string requestContent = JsonConvert.SerializeObject(value, this.Client.SerializationSettings);
            httpRequest.Content = new StringContent(requestContent, Encoding.UTF8);
            httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
            // Send Request
            if (shouldTrace)
            {
                ServiceClientTracing.SendRequest(invocationId, httpRequest);
            }
            cancellationToken.ThrowIfCancellationRequested();
            HttpResponseMessage httpResponse = await this.Client.HttpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false);
            if (shouldTrace)
            {
                ServiceClientTracing.ReceiveResponse(invocationId, httpResponse);
            }
            HttpStatusCode statusCode = httpResponse.StatusCode;
            cancellationToken.ThrowIfCancellationRequested();
            if (!(statusCode == (HttpStatusCode)Enum.Parse(typeof(HttpStatusCode), "OK") || statusCode == (HttpStatusCode)Enum.Parse(typeof(HttpStatusCode), "Created")))
            {
                var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", statusCode));
                ex.Request = httpRequest;
                ex.Response = httpResponse;
                if (shouldTrace)
                {
                    ServiceClientTracing.Error(invocationId, ex);
                }
                throw ex;
            }
            // Create Result
            var result = new HttpOperationResponse<object>();
            result.Request = httpRequest;
            result.Response = httpResponse;
            // Deserialize Response
            if (statusCode == (HttpStatusCode)Enum.Parse(typeof(HttpStatusCode), "OK"))
            {
                string responseContent = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
                result.Body = JsonConvert.DeserializeObject<object>(responseContent, this.Client.DeserializationSettings);
            }
            if (shouldTrace)
            {
                ServiceClientTracing.Exit(invocationId, result);
            }
            return result;
        }

        /// <summary>
        /// Deletes an activity by id.
        /// </summary>
        /// <param name='id'>
        /// </param>
        /// <param name='customHeaders'>
        /// Headers that will be added to request.
        /// </param>
        /// <param name='cancellationToken'>
        /// The cancellation token.
        /// </param>
        public async Task<HttpOperationResponse<bool?>> DeleteWithHttpMessagesAsync(int? id, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            if (id == null)
            {
                throw new ValidationException(ValidationRules.CannotBeNull, "id");
            }
            // Tracing
            bool shouldTrace = ServiceClientTracing.IsEnabled;
            string invocationId = null;
            if (shouldTrace)
            {
                invocationId = ServiceClientTracing.NextInvocationId.ToString();
                Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
                tracingParameters.Add("id", id);
                tracingParameters.Add("cancellationToken", cancellationToken);
                ServiceClientTracing.Enter(invocationId, this, "Delete", tracingParameters);
            }
            // Construct URL
            var baseUrl = this.Client.BaseUri.AbsoluteUri;
            var url = new Uri(new Uri(baseUrl + (baseUrl.EndsWith("/") ? "" : "/")), "api/Activities/{id}").ToString();
            url = url.Replace("{id}", Uri.EscapeDataString(JsonConvert.SerializeObject(id, this.Client.SerializationSettings).Trim('"')));
            // Create HTTP transport objects
            HttpRequestMessage httpRequest = new HttpRequestMessage();
            httpRequest.Method = new HttpMethod("DELETE");
            httpRequest.RequestUri = new Uri(url);
            // Set Headers
            if (customHeaders != null)
            {
                foreach(var header in customHeaders)
                {
                    if (httpRequest.Headers.Contains(header.Key))
                    {
                        httpRequest.Headers.Remove(header.Key);
                    }
                    httpRequest.Headers.TryAddWithoutValidation(header.Key, header.Value);
                }
            }

            // Send Request
            if (shouldTrace)
            {
                ServiceClientTracing.SendRequest(invocationId, httpRequest);
            }
            cancellationToken.ThrowIfCancellationRequested();
            HttpResponseMessage httpResponse = await this.Client.HttpClient.SendAsync(httpRequest, cancellationToken).ConfigureAwait(false);
            if (shouldTrace)
            {
                ServiceClientTracing.ReceiveResponse(invocationId, httpResponse);
            }
            HttpStatusCode statusCode = httpResponse.StatusCode;
            cancellationToken.ThrowIfCancellationRequested();
            if (!(statusCode == (HttpStatusCode)Enum.Parse(typeof(HttpStatusCode), "OK") || statusCode == (HttpStatusCode)Enum.Parse(typeof(HttpStatusCode), "NotFound")))
            {
                var ex = new HttpOperationException(string.Format("Operation returned an invalid status code '{0}'", statusCode));
                ex.Request = httpRequest;
                ex.Response = httpResponse;
                if (shouldTrace)
                {
                    ServiceClientTracing.Error(invocationId, ex);
                }
                throw ex;
            }
            // Create Result
            var result = new HttpOperationResponse<bool?>();
            result.Request = httpRequest;
            result.Response = httpResponse;
            // Deserialize Response
            if (statusCode == (HttpStatusCode)Enum.Parse(typeof(HttpStatusCode), "OK"))
            {
                string responseContent = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
                result.Body = JsonConvert.DeserializeObject<bool?>(responseContent, this.Client.DeserializationSettings);
            }
            // Deserialize Response
            if (statusCode == (HttpStatusCode)Enum.Parse(typeof(HttpStatusCode), "NotFound"))
            {
                string responseContent = await httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
                result.Body = JsonConvert.DeserializeObject<bool?>(responseContent, this.Client.DeserializationSettings);
            }
            if (shouldTrace)
            {
                ServiceClientTracing.Exit(invocationId, result);
            }
            return result;
        }

    }
}

redpajama_set_name: RedPajamaGithub


text:
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_DOWNLOAD_PUBLIC_COMMON_DOWNLOAD_JOB_H_
#define COMPONENTS_DOWNLOAD_PUBLIC_COMMON_DOWNLOAD_JOB_H_

#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "components/download/public/common/download_export.h"
#include "components/download/public/common/download_file.h"
#include "components/download/public/common/download_interrupt_reasons.h"

namespace download {

class DownloadItem;

// DownloadJob lives on UI thread and subclasses implement actual download logic
// and interact with DownloadItem.
// The base class is a friend class of DownloadItem.
class COMPONENTS_DOWNLOAD_EXPORT DownloadJob {
 public:
  // Callback to cancel the download request.
  using CancelRequestCallback =
      base::OnceCallback<void(bool /* user_cancel */)>;
  CancelRequestCallback cancel_request_callback;

  DownloadJob(DownloadItem* download_item,
              CancelRequestCallback cancel_request_callback);
  virtual ~DownloadJob();

  // Download operations.
  // TODO(qinmin): Remove the |callback| and |download_file_| parameter if
  // DownloadJob owns download file.
  void Start(DownloadFile* download_file_,
             DownloadFile::InitializeCallback callback,
             const DownloadItem::ReceivedSlices& received_slices);

  virtual void Cancel(bool user_cancel);
  virtual void Pause();
  virtual void Resume(bool resume_request);

  bool is_paused() const { return is_paused_; }

  // Returns whether the download is parallelizable. The download may not send
  // parallel requests as it can be disabled through flags.
  virtual bool IsParallelizable() const;

  // Cancel a particular request starts from |offset|, while the download is not
  // canceled. Used in parallel download.
  // TODO(xingliu): Remove this function if download job owns download file.
  virtual void CancelRequestWithOffset(int64_t offset);

  // Whether the download is save package.
  virtual bool IsSavePackageDownload() const;

 protected:
  // Callback from file thread when we initialize the DownloadFile.
  virtual void OnDownloadFileInitialized(
      DownloadFile::InitializeCallback callback,
      DownloadInterruptReason result,
      int64_t bytes_wasted);

  // Add an input stream to the download sink. Return false if we start to
  // destroy download file.
  bool AddInputStream(std::unique_ptr<InputStream> stream, int64_t offset);

  DownloadItem* download_item_;

  // Callback to cancel the download, can be null.
  CancelRequestCallback cancel_request_callback_;

 private:
  // If the download progress is paused by the user.
  bool is_paused_;

  base::WeakPtrFactory<DownloadJob> weak_ptr_factory_{this};

  DISALLOW_COPY_AND_ASSIGN(DownloadJob);
};

}  // namespace download

#endif  // COMPONENTS_DOWNLOAD_PUBLIC_COMMON_DOWNLOAD_JOB_H_


text:
'use strict';
const logger = require('sonos-discovery/lib/helpers/logger');
const lockVolumes = {};

function lockvolumes(player) {
  logger.debug('locking volumes');
  // Locate all volumes
  var system = player.system;

  system.players.forEach((player) => {
    lockVolumes[player.uuid] = player.state.volume;
  });

  // prevent duplicates, will ignore if no event listener is here
  system.removeListener('volume-change', restrictVolume);
  system.on('volume-change', restrictVolume);
  return Promise.resolve();
}

function unlockvolumes(player) {
  logger.debug('unlocking volumes');
  var system = player.system;
  system.removeListener('volume-change', restrictVolume);
  return Promise.resolve();
}

function restrictVolume(info) {
  logger.debug(`should revert volume to ${lockVolumes[info.uuid]}`);
  const player = this.getPlayerByUUID(info.uuid);
  // Only do this if volume differs
  if (player.state.volume != lockVolumes[info.uuid])
    return player.setVolume(lockVolumes[info.uuid]);
}

module.exports = function (api) {
  api.registerAction('lockvolumes', lockvolumes);
  api.registerAction('unlockvolumes', unlockvolumes);
}


text: require 'devise/orm/couchrest_model'


text:
* void unload(string key_or_url)
* void unload(asset)

## Parameter
| Parameter | type | Description |
| ------------- | ------------- | -------------|
| key_or_url | string | Key or Url of resource|
| asset | * | the asset object |

## Description
Release resource from memory.

## Example
````javascript
	// use url
	game.assets.unload('Assets/atlas/dota.bin');

	// use key
	game.assets.unload('dota');

	// use object
	game.assets.unload(game.assets.find('Assets/atlas/dota.bin'));
````


text:
OC.L10N.register(
    "files_trashbin",
    {
    "Couldn't delete %s permanently" : "Não foi possível excluir %s permanentemente",
    "Couldn't restore %s" : "Não foi possível restaurar %s",
    "Deleted files" : "Arquivos apagados",
    "Restore" : "Restaurar",
    "Delete permanently" : "Excluir permanentemente",
    "Error" : "Erro",
    "restored" : "restaurado",
    "No deleted files" : "Aquivos não removidos",
    "You will be able to recover deleted files from here" : "Você pode recuperar arquivos removidos daqui",
    "No entries found in this folder" : "Nenhuma entrada foi encontrada nesta pasta",
    "Select all" : "Selecionar tudo",
    "Name" : "Nome",
    "Deleted" : "Excluído",
    "Delete" : "Excluir"
},
"nplurals=2; plural=(n > 1);");


text:
import React, { Component, PropTypes } from 'react';

export default class Square extends Component {
  static propTypes = {
    black: PropTypes.bool
  }

  render() {
    const { black } = this.props;
    const fill = black ? 'black' : 'white';
    const stroke = black ? 'white' : 'black';

    return (
      <div style={{
        backgroundColor: fill,
        color: stroke,
        width: '100%',
        height: '100%'
      }}>
        {this.props.children}
      </div>
    );
  }
}


text:
var express = require('express');
var router = express.Router();

/* GET activity page. */
router.get('/', function(req, res) {
	console.log('====================');
  res.render('favorite', { title: '我的收藏' });
});

module.exports = router;


text:
@interface voteNotificationController : WKUserNotificationInterfaceController

@end


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

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
インタフェース org.apache.mina.filter.codec.demux.MessageDecoderFactory の使用 (Apache MINA Core 2.0.0-RC1 API)
</TITLE>

<META NAME="date" CONTENT="2010-05-29">

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

      概要
      パッケージ
      クラス
    使用
      階層ツリー
      非推奨 API
      索引
      ヘルプ

 前
 次

  フレームあり
 フレームなし

  すべてのクラス

インタフェース
org.apache.mina.filter.codec.demux.MessageDecoderFactory の使用

MessageDecoderFactory を使用しているパッケージ

org.apache.mina.filter.codec.demux
Protocol codecs that helps you to implement even more complex protocols by
splitting a codec into multiple sub-codecs.

org.apache.mina.filter.codec.demux での MessageDecoderFactory の使用

MessageDecoderFactory 型のパラメータを持つ org.apache.mina.filter.codec.demux のメソッド

 void
DemuxingProtocolDecoder.addMessageDecoder(MessageDecoderFactory factory)

 void
DemuxingProtocolCodecFactory.addMessageDecoder(MessageDecoderFactory factory)

      概要
      パッケージ
      クラス
    使用
      階層ツリー
      非推奨 API
      索引
      ヘルプ

 前
 次

  フレームあり
 フレームなし

  すべてのクラス

Copyright © 2004-2010 Apache MINA Project. All Rights Reserved.


text:
#region copyright

#endregion

//------------------------------------------------------------------------------
// <auto-generated>
//    This code was generated from a template.
//
//    Manual changes to this file may cause unexpected behavior in your application.
//    Manual changes to this file will be overwritten if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace VZF.Types.Data
{

    public partial class extension_edit_Result
    {
        public int ExtensionID { get; set; }
        public int BoardId { get; set; }
        public string Extension { get; set; }
    }
}


text:
namespace blink {

StereoPannerHandler::StereoPannerHandler(AudioNode& node,
                                         float sample_rate,
                                         AudioParamHandler& pan)
    : AudioHandler(kNodeTypeStereoPanner, node, sample_rate),
      pan_(&pan),
      sample_accurate_pan_values_(audio_utilities::kRenderQuantumFrames) {
  AddInput();
  AddOutput(2);

  // The node-specific default mixing rules declare that StereoPannerNode
  // can handle mono to stereo and stereo to stereo conversion.
  channel_count_ = 2;
  SetInternalChannelCountMode(kClampedMax);
  SetInternalChannelInterpretation(AudioBus::kSpeakers);

  Initialize();
}

scoped_refptr<StereoPannerHandler> StereoPannerHandler::Create(
    AudioNode& node,
    float sample_rate,
    AudioParamHandler& pan) {
  return base::AdoptRef(new StereoPannerHandler(node, sample_rate, pan));
}

StereoPannerHandler::~StereoPannerHandler() {
  Uninitialize();
}

void StereoPannerHandler::Process(uint32_t frames_to_process) {
  AudioBus* output_bus = Output(0).Bus();

  if (!IsInitialized() || !Input(0).IsConnected() || !stereo_panner_.get()) {
    output_bus->Zero();
    return;
  }

  scoped_refptr<AudioBus> input_bus = Input(0).Bus();
  if (!input_bus) {
    output_bus->Zero();
    return;
  }

  bool is_sample_accurate = pan_->HasSampleAccurateValues();

  if (is_sample_accurate && pan_->IsAudioRate()) {
    // Apply sample-accurate panning specified by AudioParam automation.
    DCHECK_LE(frames_to_process, sample_accurate_pan_values_.size());
    float* pan_values = sample_accurate_pan_values_.Data();
    pan_->CalculateSampleAccurateValues(pan_values, frames_to_process);
    stereo_panner_->PanWithSampleAccurateValues(input_bus.get(), output_bus,
                                                pan_values, frames_to_process);
    return;
  }

  // The pan value is not sample-accurate or not a-rate.  In this case, we have
  // a fixed pan value for the render and just need to incorporate any inputs to
  // the value, if any.
  float pan_value = is_sample_accurate ? pan_->FinalValue() : pan_->Value();

  stereo_panner_->PanToTargetValue(input_bus.get(), output_bus, pan_value,
                                   frames_to_process);
}

void StereoPannerHandler::ProcessOnlyAudioParams(uint32_t frames_to_process) {
  float values[audio_utilities::kRenderQuantumFrames];
  DCHECK_LE(frames_to_process, audio_utilities::kRenderQuantumFrames);

  pan_->CalculateSampleAccurateValues(values, frames_to_process);
}

void StereoPannerHandler::Initialize() {
  if (IsInitialized())
    return;

  stereo_panner_ = std::make_unique<StereoPanner>(Context()->sampleRate());

  AudioHandler::Initialize();
}

void StereoPannerHandler::SetChannelCount(unsigned channel_count,
                                          ExceptionState& exception_state) {
  DCHECK(IsMainThread());
  BaseAudioContext::GraphAutoLocker locker(Context());

  // A PannerNode only supports 1 or 2 channels
  if (channel_count > 0 && channel_count <= 2) {
    if (channel_count_ != channel_count) {
      channel_count_ = channel_count;
      if (InternalChannelCountMode() != kMax)
        UpdateChannelsForInputs();
    }
  } else {
    exception_state.ThrowDOMException(
        DOMExceptionCode::kNotSupportedError,
        ExceptionMessages::IndexOutsideRange<uint32_t>(
            "channelCount", channel_count, 1,
            ExceptionMessages::kInclusiveBound, 2,
            ExceptionMessages::kInclusiveBound));
  }
}

void StereoPannerHandler::SetChannelCountMode(const String& mode,
                                              ExceptionState& exception_state) {
  DCHECK(IsMainThread());
  BaseAudioContext::GraphAutoLocker locker(Context());

  ChannelCountMode old_mode = InternalChannelCountMode();

  if (mode == "clamped-max") {
    new_channel_count_mode_ = kClampedMax;
  } else if (mode == "explicit") {
    new_channel_count_mode_ = kExplicit;
  } else if (mode == "max") {
    // This is not supported for a StereoPannerNode, which can only handle
    // 1 or 2 channels.
    exception_state.ThrowDOMException(DOMExceptionCode::kNotSupportedError,
                                      "StereoPanner: 'max' is not allowed");
    new_channel_count_mode_ = old_mode;
  } else {
    // Do nothing for other invalid values.
    new_channel_count_mode_ = old_mode;
  }

  if (new_channel_count_mode_ != old_mode)
    Context()->GetDeferredTaskHandler().AddChangedChannelCountMode(this);
}

// ----------------------------------------------------------------

StereoPannerNode::StereoPannerNode(BaseAudioContext& context)
    : AudioNode(context),
      pan_(AudioParam::Create(context,
                              Uuid(),
                              AudioParamHandler::kParamTypeStereoPannerPan,
                              0,
                              AudioParamHandler::AutomationRate::kAudio,
                              AudioParamHandler::AutomationRateMode::kVariable,
                              -1,
                              1)) {
  SetHandler(StereoPannerHandler::Create(*this, context.sampleRate(),
                                         pan_->Handler()));
}

StereoPannerNode* StereoPannerNode::Create(BaseAudioContext& context,
                                           ExceptionState& exception_state) {
  DCHECK(IsMainThread());

  return MakeGarbageCollected<StereoPannerNode>(context);
}

StereoPannerNode* StereoPannerNode::Create(BaseAudioContext* context,
                                           const StereoPannerOptions* options,
                                           ExceptionState& exception_state) {
  StereoPannerNode* node = Create(*context, exception_state);

  if (!node)
    return nullptr;

  node->HandleChannelOptions(options, exception_state);

  node->pan()->setValue(options->pan());

  return node;
}

void StereoPannerNode::Trace(Visitor* visitor) {
  visitor->Trace(pan_);
  AudioNode::Trace(visitor);
}

AudioParam* StereoPannerNode::pan() const {
  return pan_;
}

void StereoPannerNode::ReportDidCreate() {
  GraphTracer().DidCreateAudioNode(this);
  GraphTracer().DidCreateAudioParam(pan_);
}

void StereoPannerNode::ReportWillBeDestroyed() {
  GraphTracer().WillDestroyAudioParam(pan_);
  GraphTracer().WillDestroyAudioNode(this);
}

}  // namespace blink


text:
package com.github.autoscaler.core;

import com.github.autoscaler.api.ScalingConfiguration;
import org.junit.Assert;
import org.junit.Test;

import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

public class ServiceValidatorTest
{
    private static final String VALID_METRIC = "a";
    private static final String INVALID_METRIC = "b";
    private static final Collection<String> METRIC_NAMES = Collections.singletonList(VALID_METRIC);

    @Test
    public void testAppName()
    {
        ServiceValidator validator = new ServiceValidator(METRIC_NAMES);
        ScalingConfiguration sc1 = new ScalingConfiguration();
        sc1.setId("unitTest1");
        sc1.setWorkloadMetric(VALID_METRIC);
        ScalingConfiguration sc2 = new ScalingConfiguration();
        sc2.setId("unitTest2");
        sc2.setWorkloadMetric(VALID_METRIC);
        Set<ScalingConfiguration> in = new HashSet<>();
        in.add(sc1);
        in.add(sc2);
        Set<ScalingConfiguration> out = validator.getValidatedServices(in);
        Assert.assertTrue(out.contains(sc2));
        Assert.assertTrue(out.contains(sc1));
    }

    @Test
    public void testInvalidId()
    {
        ServiceValidator validator = new ServiceValidator(METRIC_NAMES);
        ScalingConfiguration sc1 = new ScalingConfiguration();
        sc1.setWorkloadMetric(VALID_METRIC);
        Set<ScalingConfiguration> in = new HashSet<>();
        in.add(sc1);
        Set<ScalingConfiguration> out = validator.getValidatedServices(in);
        Assert.assertFalse(out.contains(sc1));
    }

    @Test
    public void testInvalidMetric()
    {
        ServiceValidator validator = new ServiceValidator(METRIC_NAMES);
        ScalingConfiguration sc1 = new ScalingConfiguration();
        sc1.setId("unitTest");
        Set<ScalingConfiguration> in = new HashSet<>();
        in.add(sc1);
        Set<ScalingConfiguration> out = validator.getValidatedServices(in);
        Assert.assertFalse(out.contains(sc1));
    }

    @Test
    public void testUnrecognisedMetric()
    {
        ServiceValidator validator = new ServiceValidator(METRIC_NAMES);
        ScalingConfiguration sc1 = new ScalingConfiguration();
        sc1.setId("unitTest");
        sc1.setWorkloadMetric(INVALID_METRIC);
        Set<ScalingConfiguration> in = new HashSet<>();
        in.add(sc1);
        Set<ScalingConfiguration> out = validator.getValidatedServices(in);
        Assert.assertFalse(out.contains(sc1));
    }

    @Test
    public void testInvalidScale()
    {
        ServiceValidator validator = new ServiceValidator(METRIC_NAMES);
        ScalingConfiguration sc1 = new ScalingConfiguration();
        sc1.setId("unitTest1");
        sc1.setWorkloadMetric(VALID_METRIC);
        sc1.setMinInstances(-1);
        sc1.setMaxInstances(5);
        ScalingConfiguration sc2 = new ScalingConfiguration();
        sc2.setId("unitTest2");
        sc2.setWorkloadMetric(VALID_METRIC);
        sc2.setMinInstances(0);
        sc2.setMaxInstances(-1);
        Set<ScalingConfiguration> in = new HashSet<>();
        in.add(sc1);
        Set<ScalingConfiguration> out = validator.getValidatedServices(in);
        Assert.assertFalse(out.contains(sc1));
        Assert.assertFalse(out.contains(sc2));
    }
}


text:
"""
test_mincntr
----------------------------------

Tests for `mincntr` module.
"""
import uuid

from mincntr import k8s_api
from mincntr import docker_api
from mincntr.tests import base

class TestMincntr(base.TestCase):

    def test_docker_api(self):
        api = docker_api.DockerAPI()
        print(api.list())
        print(api.create('ping-test' + str(uuid.uuid4()), 'ubuntu:14.04',
                         command='ping 8.8.8.8'))

    def test_k8s_api(self):
        api = k8s_api.KubernetesAPI()
        print(api.list())
        print(api.create('ping-test' + str(uuid.uuid4()), 'ubuntu:14.04',
                 command='ping 8.8.8.8'))


text:
package api

import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
	"strconv"
	"strings"

	"github.com/andreluzz/cas-xog/constant"
	"github.com/andreluzz/cas-xog/model"
	"github.com/andreluzz/cas-xog/util"
	"github.com/tealeg/xlsx"
)

type project struct {
	ID    int              `json:"_internalId,omitempty"`
	Code  string           `json:"code"`
	Tasks map[string]*task `json:"tasks,omitempty"`
}

type task struct {
	ID               int                  `json:"_internalId,omitempty"`
	Name             string               `json:"name"`
	Code             string               `json:"code"`
	Start            string               `json:"startDate"`
	Finish           string               `json:"finishDate"`
	Status           string               `json:"status"`
	PercentComplete  float64              `json:"percentComplete"`
	CustomAttributes map[string]string    `json:"customAttributes,omitempty"`
	Resources        map[string]*resource `json:"resource,omitempty"`
}

type resource struct {
	ResourceID    string `json:"resource"`
	Start         string `json:"startDate"`
	Finish        string `json:"finishDate"`
	EstimateCurve struct {
		SegmentList struct {
			Segments []*segment `json:"segments,omitempty"`
		} `json:"segmentList,omitempty"`
	} `json:"estimateCurve,omitempty"`
}

type segment struct {
	Start  string  `json:"start"`
	Finish string  `json:"finish"`
	Value  float64 `json:"value"`
}

func migrateTask(file *model.DriverFile, outputFolder string, environments *model.Environments, restFunc util.Rest) error {
	xlFile, err := xlsx.OpenFile(util.ReplacePathSeparatorByOS(file.ExcelFile))
	if err != nil {
		return fmt.Errorf("migration - error opening excel. Debug: %s", err.Error())
	}

	excelStartRowIndex := 0
	if file.ExcelStartRow != constant.Undefined {
		excelStartRowIndex, err = strconv.Atoi(file.ExcelStartRow)
		if err != nil {
			return fmt.Errorf("migration - tag 'startRow' not a number. Debug: %s", err.Error())
		}
		excelStartRowIndex--
	}

	projects := make(map[string]project, len(xlFile.Sheets[0].Rows))

	for index, row := range xlFile.Sheets[0].Rows {
		if index >= excelStartRowIndex {
			rowMap := make(map[string]string, len(file.MatchExcel))
			for _, match := range file.MatchExcel {
				index := match.Col - 1
				if index >= len(row.Cells) {
					break
				}
				cell := row.Cells[index]
				if cell.IsTime() {
					cellDate, _ := cell.GetTime(false)
					fmt.Println("Date: ", cellDate.String())
					rowMap[match.AttributeName] = cellDate.Format("YYYY-MM-DDTHH:MM:SS")
				}
				rowMap[match.AttributeName] = cell.String()
			}

			p, ok := projects[rowMap["project"]]
			if !ok {
				p = project{
					Code:  rowMap["project"],
					Tasks: make(map[string]*task),
				}
			}

			t, ok := p.Tasks[rowMap["code"]]
			if !ok {
				perc, _ := strconv.ParseFloat(rowMap["percentComplete"], 64)
				t = &task{
					Name:             rowMap["name"],
					Code:             rowMap["code"],
					Start:            rowMap["start"],
					Finish:           rowMap["finish"],
					PercentComplete:  perc,
					Status:           "0",
					Resources:        make(map[string]*resource),
					CustomAttributes: make(map[string]string),
				}
				if perc > 0 {
					t.Status = "1"
				}
				if perc == 1 {
					t.Status = "2"
				}
				p.Tasks[rowMap["code"]] = t
			}

			for attr, val := range rowMap {
				if isCustomAttribute(attr) {
					t.CustomAttributes[attr] = val
				}
			}

			if len(t.CustomAttributes) == 0 {
				t.CustomAttributes = nil
			}

			if rowMap["resourceId"] == "" {
				t.Resources = nil
				break
			}

			r, ok := t.Resources[rowMap["resourceId"]]
			if !ok {
				r = &resource{
					ResourceID: rowMap["resourceId"],
					Start:      rowMap["start"],
					Finish:     rowMap["finish"],
				}
				t.Resources[rowMap["resourceId"]] = r
			}

			val, _ := strconv.ParseFloat(rowMap["segmentValue"], 64)
			s := segment{
				Start:  rowMap["segmentStart"],
				Finish: rowMap["segmentFinish"],
				Value:  val,
			}

			r.EstimateCurve.SegmentList.Segments = append(r.EstimateCurve.SegmentList.Segments, &s)

			projects[rowMap["project"]] = p
		}
	}

	projectslice := []project{}
	for _, value := range projects {
		projectslice = append(projectslice, value)
	}

	data, _ := json.MarshalIndent(projectslice, "", "    ")
	taskPath := outputFolder + file.Type + "/" + file.Path
	ioutil.WriteFile(taskPath, util.JSONAvoidEscapeText(data), 0644)
	return nil
}

func writeTask(file *model.DriverFile, sourceFolder, outputFolder string, environments *model.Environments, restFunc util.Rest) error {
	tmPath := sourceFolder + file.Type + "/" + file.Path
	jsonFile, err := ioutil.ReadFile(tmPath)
	if err != nil {
		return err
	}

	endpoint := environments.Target.URL + environments.Target.API.Context + constant.APIEndpoint

	targetConfig := util.APIConfig{
		Client: environments.Target.API.Client,
		Cookie: environments.Target.Cookie,
		Proxy:  environments.Target.Proxy,
	}

	targetConfig.Token = environments.Target.API.Token
	if environments.Target.AuthToken != "" {
		targetConfig.Token = environments.Target.AuthToken
	}

	projects := []project{}
	json.Unmarshal(jsonFile, &projects)

	errors := []string{}

	for _, p := range projects {
		url := endpoint + "projects?filter=(code = '" + p.Code + "')"
		targetConfig.Endpoint = url
		targetConfig.Method = http.MethodGet
		// get project id from project code
		response, status, err := restFunc(nil, targetConfig, nil)
		if err != nil {
			errors = append(errors, err.Error())
			break
		}
		if status != 200 {
			errors = append(errors, fmt.Sprintf("status code: %d | response: %s | url: %s", status, string(response), url))
			break
		}
		pr := &results{}
		json.Unmarshal(response, pr)
		if len(pr.Results) == 0 {
			errors = append(errors, fmt.Sprintf("invalid project id %s", p.Code))
			break
		}
		p.ID = pr.Results[0].ID

		for _, t := range p.Tasks {
			// check if task exists
			url := endpoint + "projects/" + strconv.Itoa(p.ID) + "/tasks?filter=(code = '" + t.Code + "')"
			targetConfig.Endpoint = url
			targetConfig.Method = http.MethodGet
			response, status, err := restFunc(nil, targetConfig, nil)
			newTask := false
			if err != nil || status != 200 {
				newTask = true
			}

			url = endpoint + "projects/" + strconv.Itoa(p.ID) + "/tasks"
			targetConfig.Endpoint = url
			targetConfig.Method = http.MethodPost

			existingTask := &results{}
			json.Unmarshal(response, existingTask)
			if !newTask && len(existingTask.Results) > 0 {
				t.ID = existingTask.Results[0].ID
				url = endpoint + "projects/" + strconv.Itoa(p.ID) + "/tasks/" + strconv.Itoa(t.ID)
				targetConfig.Endpoint = url
				targetConfig.Method = http.MethodPut
			}

			body := fmt.Sprintf(`{
				"name": "%s",
				"code": "%s",
				"startDate": "%s",
				"finishDate": "%s",
				"status": "%s",
				"percentComplete": %f`, t.Name, t.Code, t.Start, t.Finish, t.Status, t.PercentComplete)

			if len(t.CustomAttributes) > 0 {
				customAttr := ""
				for attr, val := range t.CustomAttributes {
					customAttr = fmt.Sprintf(`%s, "%s": "%s"`, customAttr, attr, val)
				}
				body = body + customAttr
			}

			body = body + "}"

			// create new task and get task id
			response, status, err = restFunc([]byte(body), targetConfig, nil)
			if err != nil {
				errors = append(errors, err.Error())
				break
			}
			if status != 200 {
				errors = append(errors, fmt.Sprintf("status code: %d | response: %s | url: %s", status, string(response), url))
				break
			}
			tr := &result{}
			json.Unmarshal(response, tr)
			t.ID = tr.ID

			url = endpoint + "projects/" + strconv.Itoa(p.ID) + "/tasks/" + strconv.Itoa(t.ID) + "/assignments"

			// assign resources to task
			for _, r := range t.Resources {
				// check resource already assigned to the task
				targetConfig.Endpoint = url + "?filter=(resource = '" + r.ResourceID + "')"
				targetConfig.Method = http.MethodGet
				response, status, err := restFunc(nil, targetConfig, nil)
				newAssignment := false
				if err != nil || status != 200 {
					newAssignment = true
				}

				targetConfig.Endpoint = url
				targetConfig.Method = http.MethodPost

				existingAssignment := &results{}
				json.Unmarshal(response, existingAssignment)
				if !newAssignment && len(existingAssignment.Results) > 0 {
					targetConfig.Endpoint = url + "/" + strconv.Itoa(existingAssignment.Results[0].ID)
					targetConfig.Method = http.MethodPut
				}

				body, _ := json.Marshal(r)
				response, status, err = restFunc(body, targetConfig, nil)
				if err != nil {
					errors = append(errors, err.Error())
				}
				if status != 200 {
					errors = append(errors, fmt.Sprintf("status code: %d | response: %s | url: %s", status, string(response), url))
				}
			}
		}
	}

	if len(errors) > 0 {
		return fmt.Errorf("%s", strings.Join(errors, "\n"))
	}

	return nil
}

func isCustomAttribute(attributeLabel string) bool {
	switch attributeLabel {
	case "project", "name", "code", "start", "finish", "percentComplete", "resourceId", "segmentStart", "segmentFinish", "segmentValue":
		return false
	default:
		return true
	}
}


text:
package com.uzielasto.app.prot;

/**
 * Created with IntelliJ IDEA.
 * User: Aleksandr
 * Date: 10.11.12
 * Time: 18:51
 * All rights recieved.(c)
 */

import javax.media.Format;
import javax.media.control.FormatControl;
import javax.media.format.AudioFormat;
import javax.media.format.VideoFormat;
import javax.media.protocol.CaptureDevice;
import javax.media.protocol.DataSource;
import java.awt.*;

public class DeviceInfo
{

    public static Format formatMatches (Format format, Format supported[] )
    {
        if (supported == null)
            return null;
        for (int i = 0;  i < supported.length;  i++)
            if (supported[i].matches(format))
                return supported[i];
        return null;
    }

    public static boolean setFormat(DataSource dataSource, Format format)
    {
        boolean formatApplied = false;

        FormatControl formatControls[] = null;
        formatControls = ((CaptureDevice) dataSource).getFormatControls();
        for (int x = 0; x < formatControls.length; x++)
        {
            if (formatControls[x] == null)
                continue;

            Format supportedFormats[] = formatControls[x].getSupportedFormats();
            if (supportedFormats == null)
                continue;

            if (DeviceInfo.formatMatches(format, supportedFormats) != null)
            {
                formatControls[x].setFormat(format);
                formatApplied = true;
            }
        }

        return formatApplied;
    }

    public static boolean isVideo(Format format)
    {
        return (format instanceof VideoFormat);
    }

    public static boolean isAudio(Format format)
    {
        return (format instanceof AudioFormat);
    }

    public static String formatToString(Format format)
    {
        if (isVideo(format))
            return videoFormatToString((VideoFormat) format);

        if (isAudio(format))
            return audioFormatToString((AudioFormat) format);

        return ("--- unknown media device format ---");
    }

    public static String videoFormatToString(VideoFormat videoFormat)
    {
        StringBuffer result = new StringBuffer();

        // add width x height (size)
        Dimension d = videoFormat.getSize();
        result.append("size=" + (int) d.getWidth() + "x" + (int) d.getHeight() + ", ");

        /*
          // try to add color depth
          if (videoFormat instanceof IndexedColorFormat)
          {
              IndexedColorFormat f = (IndexedColorFormat) videoFormat;
              result.append("color depth=" + f.getMapSize() + ", ");
          }
          */

        // add encoding
        result.append("encoding=" + videoFormat.getEncoding() + ", ");

        // add max data length
        result.append("maxdatalength=" + videoFormat.getMaxDataLength() + "");

        return result.toString();
    }

    public static String audioFormatToString(AudioFormat audioFormat)
    {
        StringBuffer result = new StringBuffer();

        // short workaround
        result.append(audioFormat.toString().toLowerCase());

        return result.toString();
    }
}


text:
<!--
  ~ Copyright 2016-present Open Networking Laboratory
  ~
  ~ 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.
-->

<scenario name="distributed leader elector test"
          description="ONOS LeaderElector distributed primitive Test">
    <group name="Distributed-Primitive-Value">

        <!--<import file="${ONOS_SCENARIOS}/setup.xml"/>
        <dependency name="Setup" requires="Prerequisites"/>-->

        <step name="Activate-Distributed-Primitives-App"
            exec="onos ${OCI} app activate org.onosproject.distributedprimitives"/>

        <step name="Test-Initial-No-Leader" requires="^"
              exec="onos-cluster-execute-expect leader-test test-elector show foo --expect leader=none#candidates=none"/>

        <step name="Test-Leader-Run" requires="^"
              exec="onos-execute-expect ${OCI} leader-test test-elector run foo --expect leader=${OCI}#term=1#candidates=${OCI}"/>

        <step name="Test-Leader-Withdraw" requires="^"
              exec="onos ${OCI} leader-test test-elector withdraw foo"/>

        <step name="Test-No-Leader-After-Withdraw" requires="^"
              exec="onos-cluster-execute-expect leader-test test-elector show foo --expect leader=none#candidates=none"/>

        <!--Check with check logs-->
        <step name="Check-Log-Exceptions" requires="^"
              exec="onos-check-logs ${OCI}"/>

        <step name="Teardown-Distributed-Primitives-Test-App" requires="^"
              exec="onos ${OCI} app deactivate org.onosproject.distributedprimitives"/>
    </group>
</scenario>


text:
var produtoModulo =angular.module('produtoModulo',['rest']);

produtoModulo.directive('produtoform', function(){
    return{
      restrict:'E',
      replace:true,
      templateUrl:'/static/categoria_app/js/categoria_form.html',
      scope:{
          product: '=',
          saveComplete: '&'
      },
     controller:function($scope,ProdutoApi){
         $scope.salvandoFlag=false;
         $scope.salvar = function(){
             $scope.salvandoFlag=true;
             $scope.errors={};
             if($scope.product.id == null){
                 var promessa = ProdutoApi.salvar($scope.product);
                 promessa.success(function(product){
                     $scope.product.nome='';

                     $scope.product.descricao='';

                     $scope.salvandoFlag=false;
                     if($scope.saveComplete != undefined){
                         $scope.saveComplete({'produto':product});
                     }
                 });
             } else {
                 var promessa = ProdutoApi.editar($scope.product);
                 promessa.success(function(product){
                     $scope.product = null;
                     $scope.salvandoFlag=false;
                 });
             }

             promessa.error(function(errors){
                 $scope.errors=errors;
                 $scope.salvandoFlag=false;

             })

         }
     }

    };
});

produtoModulo.directive('produtolinha', function(){
    return{

      replace:true,
      templateUrl:'/static/categoria_app/js/categoria_linha_tabela.html',
      /*scope:{
          product: '@',
          deleteComplete: '&'
      },*/
     controller:function($scope, ProdutoApi){

     }

    };
});


text:
require "spec_helper"

describe "linking an OAuth account to a user" do
  it "associates a user with a GitHub account" do
    sign_in(create(:user))
    manage_github_accounts

    connect_github_account

    expect_to_see_success_message
  end
end

describe "unlinking an OAuth account on a user" do
  it "unassociates a user with a GitHub account" do
    sign_in(create(:user))
    manage_github_accounts
    connect_github_account
    manage_github_accounts

    follow_relation "disconnect_github"

    expect_to_see_success_message
  end
end


text:
<?php

final class PhameBlogViewController extends PhameLiveController {

  public function handleRequest(AphrontRequest $request) {
    $response = $this->setupLiveEnvironment();
    if ($response) {
      return $response;
    }

    $viewer = $this->getViewer();
    $blog = $this->getBlog();

    $is_live = $this->getIsLive();
    $is_external = $this->getIsExternal();

    $pager = id(new AphrontCursorPagerView())
      ->readFromRequest($request);

    $post_query = id(new PhamePostQuery())
      ->setViewer($viewer)
      ->withBlogPHIDs(array($blog->getPHID()))
      ->setOrder('datePublished')
      ->withVisibility(array(
        PhameConstants::VISIBILITY_PUBLISHED,
        PhameConstants::VISIBILITY_DRAFT,
      ));

    if ($is_live) {
      $post_query->withVisibility(array(PhameConstants::VISIBILITY_PUBLISHED));
    }

    $posts = $post_query->executeWithCursorPager($pager);

    $hero = $this->buildPhameHeader($blog);

    $header = id(new PHUIHeaderView())
      ->addClass('phame-header-bar')
      ->setUser($viewer);

    if (!$is_external) {
      if ($blog->isArchived()) {
        $header_icon = 'fa-ban';
        $header_name = pht('Archived');
        $header_color = 'dark';
      } else {
        $header_icon = 'fa-check';
        $header_name = pht('Active');
        $header_color = 'bluegrey';
      }
      $header->setStatus($header_icon, $header_color, $header_name);

      $actions = $this->renderActions($blog);
      $header->setActionList($actions);
      $header->setPolicyObject($blog);
    }

    if ($posts) {
      $post_list = id(new PhamePostListView())
        ->setPosts($posts)
        ->setViewer($viewer)
        ->setIsExternal($is_external)
        ->setIsLive($is_live)
        ->setNodata(pht('This blog has no visible posts.'));
    } else {
      $create_button = id(new PHUIButtonView())
        ->setTag('a')
        ->setText(pht('Write a Post'))
        ->setHref($this->getApplicationURI('post/edit/?blog='.$blog->getID()))
        ->setColor(PHUIButtonView::GREEN);

      $post_list = id(new PHUIBigInfoView())
        ->setIcon('fa-star')
        ->setTitle($blog->getName())
        ->setDescription(
          pht('No one has written any blog posts yet.'));

      $can_edit = PhabricatorPolicyFilter::hasCapability(
        $viewer,
        $blog,
        PhabricatorPolicyCapability::CAN_EDIT);

      if ($can_edit) {
        $post_list->addAction($create_button);
      }
    }

    $page = id(new PHUIDocumentView())
      ->setHeader($header)
      ->appendChild($post_list);

    $description = null;
    if (strlen($blog->getDescription())) {
      $description = new PHUIRemarkupView(
        $viewer,
        $blog->getDescription());
    } else {
      $description = phutil_tag('em', array(), pht('No description.'));
    }

    $about = id(new PhameDescriptionView())
      ->setTitle(pht('About %s', $blog->getName()))
      ->setDescription($description)
      ->setImage($blog->getProfileImageURI());

    $crumbs = $this->buildApplicationCrumbs();

    $page = $this->newPage()
      ->setTitle($blog->getName())
      ->setPageObjectPHIDs(array($blog->getPHID()))
      ->setCrumbs($crumbs)
      ->appendChild(
        array(
          $hero,
          $page,
          $about,
      ));

    return $page;
  }

  private function renderActions(PhameBlog $blog) {
    $viewer = $this->getViewer();

    $actions = id(new PhabricatorActionListView())
      ->setObject($blog)
      ->setUser($viewer);

    $can_edit = PhabricatorPolicyFilter::hasCapability(
      $viewer,
      $blog,
      PhabricatorPolicyCapability::CAN_EDIT);

    $actions->addAction(
      id(new PhabricatorActionView())
        ->setIcon('fa-plus')
        ->setHref($this->getApplicationURI('post/edit/?blog='.$blog->getID()))
        ->setName(pht('Write Post'))
        ->setDisabled(!$can_edit)
        ->setWorkflow(!$can_edit));

    $actions->addAction(
      id(new PhabricatorActionView())
        ->setUser($viewer)
        ->setIcon('fa-search')
        ->setHref(
          $this->getApplicationURI('post/?blog='.$blog->getPHID()))
        ->setName(pht('Search Posts')));

    $actions->addAction(
      id(new PhabricatorActionView())
        ->setUser($viewer)
        ->setIcon('fa-globe')
        ->setHref($blog->getLiveURI())
        ->setName(pht('View Live')));

    $actions->addAction(
      id(new PhabricatorActionView())
        ->setIcon('fa-pencil')
        ->setHref($this->getApplicationURI('blog/manage/'.$blog->getID().'/'))
        ->setName(pht('Manage Blog')));

    return $actions;
  }

  private function buildPhameHeader(
    PhameBlog $blog) {

    $image = null;
    if ($blog->getHeaderImagePHID()) {
      $image = phutil_tag(
        'div',
        array(
          'class' => 'phame-header-hero',
        ),
        phutil_tag(
          'img',
          array(
            'src'     => $blog->getHeaderImageURI(),
            'class'   => 'phame-header-image',
          )));
    }

    $title = phutil_tag_div('phame-header-title', $blog->getName());
    $subtitle = null;
    if ($blog->getSubtitle()) {
      $subtitle = phutil_tag_div('phame-header-subtitle', $blog->getSubtitle());
    }

    return phutil_tag_div(
      'phame-mega-header', array($image, $title, $subtitle));

  }

}


text:
using System.Collections.Generic;

namespace GorgonTriangulator
{
    /// <summary>
    /// Implements a LinkedList that is both indexable as well as cyclical. Thus
    /// indexing into the list with an out-of-bounds index will automatically cycle
    /// around the list to find a valid node.
    /// </summary>
    internal class IndexableCyclicalLinkedList<T> : LinkedList<T>
    {
        /// <summary>
        /// Gets the LinkedListNode at a particular index.
        /// </summary>
        /// <param name="index">The index of the node to retrieve.</param>
        /// <returns>The LinkedListNode found at the index given.</returns>
        public LinkedListNode<T> this[int index]
        {
            get
            {
                //perform the index wrapping
                while (index < 0)
                {
                    index = Count + index;
                }

                if (index >= Count)
                {
                    index %= Count;
                }

                //find the proper node
                LinkedListNode<T> node = First;
                for (int i = 0; i < index; i++)
                {
                    node = node?.Next;
                }

                return node;
            }
        }

        /// <summary>
        /// Removes the node at a given index.
        /// </summary>
        /// <param name="index">The index of the node to remove.</param>
        public void RemoveAt(int index) => Remove(this[index]);

        /// <summary>
        /// Finds the index of a given item.
        /// </summary>
        /// <param name="item">The item to find.</param>
        /// <returns>The index of the item if found; -1 if the item is not found.</returns>
        public int IndexOf(T item)
        {
            for (int i = 0; i < Count; i++)
            {
                if (this[i].Value.Equals(item))
                {
                    return i;
                }
            }

            return -1;
        }
    }
}


text:
package com.pt2121.envi.model.nyc;

import com.google.gson.annotations.Expose;

public class Column {

    @Expose
    private Integer id;

    @Expose
    private String name;

    @Expose
    private String dataTypeName;

    @Expose
    private String fieldName;

    @Expose
    private Integer position;

    @Expose
    private String renderTypeName;

    @Expose
    private Format format;

    @Expose
    private Integer tableColumnId;

    @Expose
    private Integer width;

    @Expose
    private CachedContents cachedContents;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDataTypeName() {
        return dataTypeName;
    }

    public void setDataTypeName(String dataTypeName) {
        this.dataTypeName = dataTypeName;
    }

    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public Integer getPosition() {
        return position;
    }

    public void setPosition(Integer position) {
        this.position = position;
    }

    public String getRenderTypeName() {
        return renderTypeName;
    }

    public void setRenderTypeName(String renderTypeName) {
        this.renderTypeName = renderTypeName;
    }

    public Format getFormat() {
        return format;
    }

    public void setFormat(Format format) {
        this.format = format;
    }

    public Integer getTableColumnId() {
        return tableColumnId;
    }

    public void setTableColumnId(Integer tableColumnId) {
        this.tableColumnId = tableColumnId;
    }

    public Integer getWidth() {
        return width;
    }

    public void setWidth(Integer width) {
        this.width = width;
    }

    public CachedContents getCachedContents() {
        return cachedContents;
    }

    public void setCachedContents(CachedContents cachedContents) {
        this.cachedContents = cachedContents;
    }

}


text:
// Copyright © 2012 onwards, Andrew Whewell
// All rights reserved.
//
// Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
//    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
//    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
//    * Neither the name of the author nor the names of the program's contributors may be used to endorse or promote products derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OF THE SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VirtualRadar.Interface
{
    /// <summary>
    /// A class exposing the addresses of online help pages.
    /// </summary>
    /// <remarks>
    /// The website is configured to redirect from the addresses here to wherever the online help is being stored nowadays.
    /// </remarks>
    public static class OnlineHelpAddress
    {
        /// <summary>
        /// The prefix for every online help address.
        /// </summary>
        private const string Prefix = "http://www.virtualradarserver.co.uk/OnlineHelp/";

        /// <summary>
        /// The address of the online help page for the About WinForms dialog.
        /// </summary>
        public static readonly string WinFormsAboutDialog = Prefix + "WinFormsAboutDialog.aspx";

        /// <summary>
        /// The address of the online help page for the Connection Client Log dialog.
        /// </summary>
        public static readonly string WinFormsConnectionClientLogDialog = Prefix + "WinFormsConnectionClientLogDialog.aspx";

        /// <summary>
        /// The address of the online help page for the Connection Session Log dialog.
        /// </summary>
        public static readonly string WinFormsConnectionSessionLogDialog = Prefix + "WinFormsConnectionSessionLogDialog.aspx";

        /// <summary>
        /// The address of the online help page for the Flight Simulator X dialog.
        /// </summary>
        public static readonly string WinFormsFlightSimulatorXDialog = Prefix + "WinFormsFlightSimulatorXDialog.aspx";

        /// <summary>
        /// The address of the online help page for the Main dialog.
        /// </summary>
        public static readonly string WinFormsMainDialog = Prefix + "WinFormsMainDialog2.aspx";

        /// <summary>
        /// The address of the online help page for the Rebroadcast Options dialog.
        /// </summary>
        public static readonly string WinFormsRebroadcastOptionsView = Prefix + "WinFormsRebroadcastServersView.aspx";

        /// <summary>
        /// The address of the online help page for the Receiver Locations dialog.
        /// </summary>
        public static readonly string WinFormsReceiverLocationsView = Prefix + "WinFormsReceiverLocationsView.aspx";

        /// <summary>
        /// The address of the online help page for the Options dialog.
        /// </summary>
        public static readonly string WinFormsOptionsDialog = Prefix + "WinFormsOptionsDialog2.aspx";

        /// <summary>
        /// The address of the online help page for the Statistics dialog.
        /// </summary>
        public static readonly string WinFormsStatisticsDialog = Prefix + "WinFormsStatisticsDialog.aspx";
    }
}


text:
package com.silsglass.taskmanager;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.media.AudioManager;
import android.media.SoundPool;
import android.os.Bundle;
import android.os.Handler;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;

import com.google.android.glass.media.Sounds;
import com.google.android.glass.widget.CardScrollView;

/**
 * This activity hosts a card scroller that shows the results of the game (the score and the
 * results for each phrase) after the game has ended.
 */
public class RunResultsActivity extends Activity {

    /**
     * The intent extra that holds the instance of {@link TaskCoachingModel} to display in the
     * results.
     */
    public static final String EXTRA_MODEL = "model";

    /**
     * Handler used to post requests to start new activities so that the menu closing animation
     * works properly.
     */
    private final Handler mHandler = new Handler();

    /** Audio manager used to play system sound effects. */
    private AudioManager mAudioManager;

    /** Sound pool used to play the game winning/losing sound effects. */
    private SoundPool mSoundPool;

    /** Card scroller that shows the game results (summary card and phrase list). */
    private CardScrollView mCardScroller;

    /**
     * Stores the standard margin for a card, which is used when dynamically creating the table
     * rows for the result cards.
     */
    private int mCardMargin;

    /** Listener that displays the options menu when the card scroller is tapped. */
    private final AdapterView.OnItemClickListener mOnClickListener =
            new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
            mAudioManager.playSoundEffect(Sounds.TAP);
            openOptionsMenu();
        }
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
        TaskCoachingModel model = (TaskCoachingModel) getIntent().getSerializableExtra(EXTRA_MODEL);

        mCardMargin = (int) getResources().getDimension(R.dimen.card_margin);

        mCardScroller = new CardScrollView(this);
        mCardScroller.setHorizontalScrollBarEnabled(true);
        mCardScroller.setAdapter(
                new RunResultsAdapter(getLayoutInflater(), getResources(), model));
        mCardScroller.setOnItemClickListener(mOnClickListener);
        mCardScroller.activate();
        setContentView(mCardScroller);

        // Initialize the sound pool and play the losing or winning sound immediately once it has
        // been loaded.
        mSoundPool = new SoundPool(1, AudioManager.STREAM_MUSIC, 0);
        mSoundPool.setOnLoadCompleteListener(new SoundPool.OnLoadCompleteListener() {
            @Override
            public void onLoadComplete(SoundPool soundPool, int sampleId, int status) {
                soundPool.play(sampleId, 1.0f, 1.0f, 0, 0, 1.0f);
            }
        });
        int soundResId = model.areAllPhrasesGuessedCorrectly() ?
                R.raw.triumph : R.raw.sad_trombone;
        mSoundPool.load(this, soundResId, 0);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.run_results, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // The startGame() method starts a new activity, and if we call it directly here then
        // the new activity will start without giving the menu a chance to slide back down first.
        // By posting the call to a handler instead, it will be processed on an upcoming pass
        // through the message queue, after the animation has completed, which results in a
        // smoother transition between activities.
        if (item.getItemId() == R.id.run_task) {
            mHandler.post(new Runnable() {
                @Override
                public void run() {
                    startGame();
                }
            });
            return true;
        } else {
            return false;
        }
    }

    /**
     * Starts a new game by launching the game play activity and finishes this result activity.
     */
    private void startGame() {
        startActivity(new Intent(this, TaskRunActivity.class));
        finish();
    }
}


text:
<?php
/**
 * German language file
 *
 * @license    GPL 2 (http://www.gnu.org/licenses/gpl.html)
 * @author     Esther Brunner <wikidesign@gmail.com>
 */

// for the configuration manager
$lang['noheader']      = 'Zeige nicht den ersten Header von eingeschlossenen Seiten/Sektionen';
$lang['firstseconly']  = 'Nur erster Abschnitt von eingebundenen Seiten';
$lang['showtaglogos']  = 'Bild für erstes Tag anzeigen';
$lang['showfooter']    = 'Infos über eingebundene Seite darunter anzeigen';
$lang['showlink']      = 'Erste Überschrift der eingebundenen Seite als Link anzeigen';
$lang['showpermalink'] = 'Permalink unter eingebunderer Seite anzeigen';
$lang['showdate']      = 'Datum unter eingebundender Seite anzeigen';
$lang['showmdate']     = 'Datum der Bearbeitung unter eingebundender Seite anzeigen';
$lang['showuser']      = 'Autorenname unter eingebunderer Seite anzeigen';
$lang['showcomments']  = 'Kommentare unter eingebundener Seite anzeigen (Discussion Plugin wird benötigt)';
$lang['showlinkbacks'] = 'Linkbacks unter eingebundener Seite anzeigen (Linkback Plugin wird benötigt)';
$lang['showtags']      = 'Tags unter eingebundener Seite anzeigen (Tag Plugin wird benötigt)';
$lang['showeditbtn']   = 'Bearbeiten-Tasten anzeigen';
$lang['doredirect']    = 'Nach dem Bearbeiten der eingebundenen Seite zur ursprünglichen Seite weiterleiten';
$lang['doindent']      = 'Eingebundene Seiten relativ zur Seite, in der sie eingebunden sind einrücken';
$lang['linkonly']      = 'Nur einen Link anzeigen statt dem Inhalt der eingebundenen Seite';
$lang['title']         = 'Erste Überschrift im Link benutzen auch wenn "useheading" ausgeschaltet ist (betrifft nur den "linkonly"-Modus)';
$lang['pageexists']    = 'Keinen Link anzeigen, wenn die verlinkte Seite nicht existiert (betrifft nur den "linkonly"-Modus)';
$lang['parlink']       = 'Einen Absatz um den Link herum anzeigen (betrifft nur den "linkonly"-Modus)';
$lang['safeindex']     = 'Verhindern der Indizierung der Metadaten von nicht-öffentlichen Seiten';
$lang['order']         = 'Sortierkriterium von Einschlüssen mit multiplen Seiten';
$lang['rsort']         = 'Kehre die Sortierreihenfolge von eingeschlossenen Seiten um';
$lang['depth']         = 'Maximale Tiefe von Namespace Einschlüssen, 0 für unbegrenzte Tiefe';


text:
package org.apache.asterix.common.feeds.api;

import java.util.Map;

import org.apache.asterix.common.feeds.FeedFrameCollector;

public interface ISubscriberRuntime {

    public Map<String, String> getFeedPolicy();

    public FeedFrameCollector getFrameCollector();
}


text:
This is just a brief list of things done to create the additional target for the arduino due in the overlay directory
This is still a work in progress

## Directory layout

It looks like cmsis.h is the main entry point for the target in cmsis and device.h for hal

 * cmsis is the first set of files to be setup, they specfy CPU specific values, typically surrounding the IRQ Numbers / vector (address) positions
 * hal specify's how the CPU ties into peripherals such as gpio / pmw / serial etc on the chip

Layouts generally are:

 * CMSIS     - Target_Manufacturer\Target_Family\Target_CPU
 * ToolChain - Target_Manufacturer\Target_Family\Target_CPU\TOOLCHAIN_GCC_ARM
 * HAL       - Target_Manufacturer\Target_Family\Target_CPU\Target_Board(Optional)

In some cases the target just relates to a CPU, in others a board which uses that CPU and may have additional features
This is the optional Target_Board directory within the HAL tree

Within the ASF library the Atmel ARM devices seem to be split into 2 directories sam and sam0
I've left SAM21 as the sam0 directory, and created a new TARGET_SAM directory to match against the atmel-asf\sam directory
since the SAM3X8E falls into this other catagory

for the arduino I'm using the following layout

 * lib\mbed\extra_targets\cmsis\TARGET_Atmel\TARGET_SAM\TARGET_SAM3X8E
 * lib\mbed\extra_targets\cmsis\TARGET_Atmel\TARGET_SAM\TARGET_SAM3X8E\TOOLCHAIN_GCC_ARM
 * lib\mbed\extra_targets\hal\TARGET_Atmel\TARGET_SAM\TARGET_SAM3X8E\TARGET_ARDUINODUE

## Targets

The name of the class within the target.py file (ARDUINODUE) will first pick up the directory TARGET_ARDUINODUE
I've also added the parent directories to extra labels self.extra_labels = ['Atmel', 'SAM', 'SAM3X8E']
I'm not sure if this is needed, but I think it might indicate to the build system to look in those parent directories for additional headers
which is what I need anyway

From what I can gather mbed auto compiles and links any .c files it finds in the cmsis / hal directories
so we need to be careful about only including what we need

Additional values within the target include

 * ARDUINO_DUE_X for the board definition in the macros's
 *  __SAM3X8E__ to select the right CPU in the macro's

## CMSIS Core Files

Because I'm using a seperate directory for the targets, I've copied the core headers across
This is something used for all ARM devices

 * deps/mbed/libraries/mbed/targets/cmsis -> lib/mbed/extra_targets/cmsis

## TARGET_Atmel Directory

For the Atmel directory at the top I needed to first copy over some files from the common directory for cmsis compile
First I created a new directory TARGET_Atmel\common\utils
Then copied across some of the files from the asf common directory atmel-asf\common\utils

 * parts.*
 * interrupt.h
 * interrupt directory

## TARGET_SAM Directory

For the SAM directory TARGET_Atmel\TARGET_SAM

First we create a directory called utils
TARGET_Atmel\TARGET_SAM\utils

next we're going to copy across some but not all of the files from the ASF
from atmel-asf\sam\utils

  utils\compiler.h
  utils\status_codes.h
  utils\preprocessor\*
  utils\header_files\*
  utils\cmsis\sam3x\include\*

## TARGET_SAM3X8E Directory

For the SAM3X8E directory TARGET_Atmel\TARGET_SAM\TARGET_SAM3X8E

I've copied a generic cmsis.h across from another target
the only line to modify here is the one that includes the device header, in this case I've set it to sam3xa.h

Also I've copied cmsis_nvic.h / cmsis_nvic.c from one of the other SAM Targets
it looks like the only values to look out for are

 * cmsis_nvic.h - NVIC_NUM_VECTORS / NVIC_USER_IRQ_OFFSET
 * cmsis_nvic.c - NVIC_FLASH_VECTOR_ADDRESS / NVIC_RAM_VECTOR_ADDRESS

We also need a couple of system files

 * atmel-asf\sam\utils\cmsis\sam3x\source\templates\system_sam3x.*
 * atmel-asf\sam\utils\cmsis\sam3x\source\templates\exceptions.*

## TOOLCHAIN_GCC_ARM Directory

For the toolchain directory TARGET_Atmel\TARGET_SAM\TARGET_SAM3X8E\TOOLCHAIN_GCC_ARM

I've copied files from

 * deps\atmel-asf\sam\utils\cmsis\sam3x\source\templates\gcc

For the linker scripts located under
deps\atmel-asf\sam\utils\linker_scripts\sam3x\sam3x8\gcc

we should only copy one of the files - flash.ld, this is because the mbed build scripts just use the first one they can find

### cmsis_nvic.h

For the IRQ Numbers it looks like these can be split into 2 sections

 * IRQ's specific to the ARM Cortex type (M0 / M3 etc) for exception purposes
 * IRQ's specific to the device type

For NVIC_USER_IRQ_OFFSET this is the offset for the start of the device specific IRQ's (2nd section)
these are the ones labled in the sam3x83 pdf as IRQ0 - IRQ29, starting after Systick typically
Looking at the source code of sam3x8e.h and the pdf for the sam3x8e means the offset is 16
This seems to be standard for M3 / M4 I think, although M0 I think might be shorter

 * http://www.atmel.com/images/atmel-11057-32-bit-cortex-m3-microcontroller-sam3x-sam3a_datasheet.pdf

For NVIC_NUM_VECTORS this needs to be the total number of bytes allocated to the device specific IRQ's
(IRQ0 - IRQ29 in the pdf) in this case 44 looking at the enum of IRQn in sam3x8e.h and the pdf on **page 74**

### cmsis_nvic.c

For the Flash Vector address NVIC_FLASH_VECTOR_ADDRESS it seems to be quite common for this to be set to address 0x00
so we can ignore this one

Looking at the pdf on page 62 the SRAM address NVIC_RAM_VECTOR_ADDRESS should be 0x20000000

## TODO

 * The startup file in the toolchain directory is C instead of .S assembler
   this seems to compile into the cmsis source okay so I've left it in, not sure if it's needed though
   gcc4mbed seems to use the .ld file for linkage so hopefully we can ignore the startup file
   further investigation needed to see if it's required


text:
package in.twizmwaz.cardinal.module.event;

import in.twizmwaz.cardinal.module.ModuleHandler;
import lombok.Getter;
import lombok.NonNull;
import org.bukkit.event.HandlerList;

@Getter
public class ModuleLoadCompleteEvent extends ModuleEvent {

  @Getter
  private static final HandlerList handlerList = new HandlerList();

  public ModuleLoadCompleteEvent(@NonNull ModuleHandler moduleHandler) {
    super(moduleHandler);
  }

  @Override
  public HandlerList getHandlers() {
    return handlerList;
  }
}


text:
<?php

namespace Derby\Tests\Unit\Media;

use Derby\Media\LocalFile;
use Derby\Media\LocalFileInterface;
use Derby\Media\RemoteFileInterface;
use Mockery;
use PHPUnit_Framework_TestCase;
use Derby\Media;

class LocalFileTest extends PHPUnit_Framework_TestCase
{

    protected static $fileAdapterInterface = 'Derby\Adapter\LocalFileAdapterInterface';
    protected static $remoteFileAdapterInterface = 'Derby\Adapter\RemoteFileAdapterInterface';

    public function testInterface()
    {
        $key     = 'Foo';
        $adapter = Mockery::mock(self::$fileAdapterInterface);

        $sut = new LocalFile($key, $adapter);

        $this->assertTrue($sut instanceof \Derby\Media);
        $this->assertTrue($sut instanceof LocalFileInterface);
    }

    public function testConstructor()
    {
        $key     = 'Foo';
        $adapter = Mockery::mock(self::$fileAdapterInterface);

        $sut = new LocalFile($key, $adapter);

        $this->assertEquals($key, $sut->getKey());
        $this->assertEquals($adapter, $sut->getAdapter());
    }

    public function testType()
    {
        $key     = 'Foo';
        $adapter = Mockery::mock(self::$fileAdapterInterface);

        $sut = new LocalFile($key, $adapter);

        $this->assertEquals(LocalFileInterface::TYPE_MEDIA_LOCAL_FILE, $sut->getMediaType());
    }

    public function testDeleteSuccessful()
    {

        $key     = 'Foo';
        $adapter = Mockery::mock(self::$fileAdapterInterface);

        $sut = new LocalFile($key, $adapter);
        $adapter->shouldReceive('delete')->andReturn(true);

        $this->assertTrue($sut->delete());
    }

    public function testDeleteUnsuccessful()
    {

        $key     = 'Foo';
        $adapter = Mockery::mock(self::$fileAdapterInterface);

        $sut = new LocalFile($key, $adapter);
        $adapter->shouldReceive('delete')->andReturn(false);

        $this->assertFalse($sut->delete());
    }

    public function testReadSuccessful()
    {

        $key     = 'Foo';
        $adapter = Mockery::mock(self::$fileAdapterInterface);

        $sut = new LocalFile($key, $adapter);
        $adapter->shouldReceive('read')->andReturn('lorem ipsum');

        $this->assertEquals('lorem ipsum', $sut->read());
    }

    public function testReadUnsuccessful()
    {
        $key     = 'Foo';
        $adapter = Mockery::mock(self::$fileAdapterInterface);

        $sut = new LocalFile($key, $adapter);
        $adapter->shouldReceive('read')->andReturn(false);

        $this->assertEquals(false, $sut->read());
    }

    public function testWriteSuccessful()
    {
        $key     = 'Foo';
        $adapter = Mockery::mock(self::$fileAdapterInterface);
        $data    = 'lorem ipsum';

        $sut = new LocalFile($key, $adapter);

        $adapter->shouldReceive('write')->with($key, $data)->andReturn(11);

        $this->assertEquals(11, $sut->write($data));
    }

    public function testWriteUnsuccessful()
    {
        $key     = 'Foo';
        $adapter = Mockery::mock(self::$fileAdapterInterface);
        $data    = 'lorem ipsum';

        $sut = new LocalFile($key, $adapter);

        $adapter->shouldReceive('write')->with($key, $data)->andReturn(false);

        $this->assertFalse($sut->write($data));
    }

    public function testRenameSuccessful()
    {
        $key     = 'foo';
        $adapter = Mockery::mock(self::$fileAdapterInterface);

        $sut = new LocalFile($key, $adapter);
        $adapter->shouldReceive('rename')->with('foo', 'bar')->andReturn(true);

        $this->assertEquals(true, $sut->rename('bar'));
    }

    public function testRenameUnsuccessful()
    {
        $key     = 'foo';
        $adapter = Mockery::mock(self::$fileAdapterInterface);

        $sut = new LocalFile($key, $adapter);
        $adapter->shouldReceive('rename')->with('foo', 'bar')->andReturn(false);

        $this->assertEquals(false, $sut->rename('bar'));
    }

//    public function testUploadSuccessful()
//    {
//        $key     = 'foo';
//        $adapter = Mockery::mock(self::$fileAdapterInterface);
//        $remoteAdapter = Mockery::mock(self::$remoteFileAdapterInterface);
//
//        $sut = new LocalFile($key, $adapter);
//
//        // local adapter will receive a read to get contents of file.
//        // remote adapter will receive a write and return amt of bytes written
//        $adapter->shouldReceive('read')->andReturn('foo bar');
//        $remoteAdapter->shouldReceive('write');
//
//        // upload call on local file should return remote file interface
//        $this->assertTrue($sut->upload($remoteAdapter) instanceof RemoteFileInterface);
//    }
}


text:
package com.lzy.demo.base;

import rx.Subscription;
import rx.subscriptions.CompositeSubscription;

/**
 * ================================================
 * 作    者:jeasonlzy(廖子尧)Github地址:https://github.com/jeasonlzy
 * 版    本:1.0
 * 创建日期:16/10/1
 * 描    述:统一管理所有的订阅生命周期
 * 修订历史:
 * ================================================
 */
public abstract class BaseRxDetailActivity extends BaseDetailActivity {

    private CompositeSubscription compositeSubscription;

    public void addSubscribe(Subscription subscription) {
        if (compositeSubscription == null) {
            compositeSubscription = new CompositeSubscription();
        }
        compositeSubscription.add(subscription);
    }

    public void unSubscribe() {
        if (compositeSubscription != null) compositeSubscription.unsubscribe();
    }
}


text:
namespace gpopt
{
	using namespace gpos;

	//---------------------------------------------------------------------------
	//	@class:
	//		CXformImplementPartitionSelector
	//
	//	@doc:
	//		Implement PartitionSelector
	//
	//---------------------------------------------------------------------------
	class CXformImplementPartitionSelector : public CXformImplementation
	{

		private:

			// private copy ctor
			CXformImplementPartitionSelector(const CXformImplementPartitionSelector &);

		public:

			// ctor
			explicit
			CXformImplementPartitionSelector(IMemoryPool *pmp);

			// dtor
			virtual
			~CXformImplementPartitionSelector()
			{}

			// ident accessors
			virtual
			EXformId Exfid() const
			{
				return ExfImplementPartitionSelector;
			}

			// xform name
			virtual
			const CHAR *SzId() const
			{
				return "CXformImplementPartitionSelector";
			}

			// compute xform promise for a given expression handle
			virtual
			EXformPromise Exfp
				(
				CExpressionHandle & //exprhdl
				)
				const
			{
				return CXform::ExfpHigh;
			}

			// actual transform
			virtual
			void Transform(CXformContext *, CXformResult *, CExpression *) const;

	}; // class CXformImplementPartitionSelector

}

#endif // !GPOPT_CXformImplementPartitionSelector_H

// EOF


text:
<?php

namespace Application\Migrations;

use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

class Version20131127183632 extends AbstractMigration
{
    public function up(Schema $schema)
    {
        $this->addSql("ALTER TABLE user_prediction_set_score ADD season INT DEFAULT NULL");
        $this->addSql("UPDATE user_prediction_set_score SET season = 2012");
        $this->addSql("ALTER TABLE user_prediction_set_score ALTER season SET NOT NULL");
        $this->addSql("ALTER TABLE user_prediction_set_score DROP CONSTRAINT user_prediction_set_score_pkey");
        $this->addSql("ALTER TABLE user_prediction_set_score ADD CONSTRAINT user_prediction_set_score_pkey PRIMARY KEY (user_id, league_id, season, predictionset_id, pickset_id )");
    }

    public function down(Schema $schema)
    {
        $this->addSql("ALTER TABLE user_prediction_set_score DROP CONSTRAINT user_prediction_set_score_pkey");
        $this->addSql("ALTER TABLE user_prediction_set_score DROP season");
        $this->addSql("ALTER TABLE user_prediction_set_score ADD CONSTRAINT user_prediction_set_score_pkey PRIMARY KEY (user_id, league_id, predictionset_id, pickset_id )");
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/root"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@mipmap/background">

    <TextView
        android:id="@+id/hello_word"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:fontFamily="sans-serif-light"
        android:textSize="22sp" />
</FrameLayout>


text:
module.exports = {
  artifactDirectory: "./src/__generated__",
  language: "typescript",
  src: "./src",
  schema: "./data/schema.graphql",
  exclude: ["**/node_modules/**", "**/__mocks__/**",  "**/__generated__/**"],
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<title>Option: accessibility_warnings</title>
<link href="css/screen.css" rel="stylesheet" type="text/css" />

Option: accessibility_warnings

		If this option is set to true some accessibility warnings will be presented to the user if they miss specifying that information. This option is set to true default, since we should all try to make this world a better place for disabled people. But if you are annoyed with the warnings, set this option to false.

Example of usage of the accessibility_warnings option:

tinyMCE.init({
	...
	accessibility_warnings : false
});

Index

Copyright © 2003-2006 Moxiecode Systems AB