text:
namespace gpu {

VulkanSwapChain::VulkanSwapChain() {}

VulkanSwapChain::~VulkanSwapChain() {
  DCHECK(images_.empty());
  DCHECK_EQ(static_cast<VkSwapchainKHR>(VK_NULL_HANDLE), swap_chain_);
  DCHECK_EQ(static_cast<VkSemaphore>(VK_NULL_HANDLE), next_present_semaphore_);
}

bool VulkanSwapChain::Initialize(VulkanDeviceQueue* device_queue,
                                 VkSurfaceKHR surface,
                                 const VkSurfaceCapabilitiesKHR& surface_caps,
                                 const VkSurfaceFormatKHR& surface_format) {
  DCHECK(device_queue);
  device_queue_ = device_queue;
  return InitializeSwapChain(surface, surface_caps, surface_format) &&
         InitializeSwapImages(surface_caps, surface_format);
}

void VulkanSwapChain::Destroy() {
  DestroySwapImages();
  DestroySwapChain();
}

gfx::SwapResult VulkanSwapChain::SwapBuffers() {
  VkResult result = VK_SUCCESS;

  VkDevice device = device_queue_->GetVulkanDevice();
  VkQueue queue = device_queue_->GetVulkanQueue();

  std::unique_ptr<ImageData>& current_image_data = images_[current_image_];

  // Submit our command buffer for the current buffer.
  if (!current_image_data->command_buffer->Submit(
          1, &current_image_data->present_semaphore, 1,
          &current_image_data->render_semaphore)) {
    return gfx::SwapResult::SWAP_FAILED;
  }

  // Queue the present.
  VkPresentInfoKHR present_info = {};
  present_info.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR;
  present_info.waitSemaphoreCount = 1;
  present_info.pWaitSemaphores = &current_image_data->render_semaphore;
  present_info.swapchainCount = 1;
  present_info.pSwapchains = &swap_chain_;
  present_info.pImageIndices = &current_image_;

  result = vkQueuePresentKHR(queue, &present_info);
  if (VK_SUCCESS != result) {
    return gfx::SwapResult::SWAP_FAILED;
  }

  // Acquire then next image.
  result = vkAcquireNextImageKHR(device, swap_chain_, UINT64_MAX,
                                 next_present_semaphore_, VK_NULL_HANDLE,
                                 &current_image_);
  if (VK_SUCCESS != result) {
    DLOG(ERROR) << "vkAcquireNextImageKHR() failed: " << result;
    return gfx::SwapResult::SWAP_FAILED;
  }

  // Swap in the "next_present_semaphore" into the newly acquired image. The
  // old "present_semaphore" for the image becomes the place holder for the next
  // present semaphore for the next image.
  std::swap(images_[current_image_]->present_semaphore,
            next_present_semaphore_);

  return gfx::SwapResult::SWAP_ACK;
}

bool VulkanSwapChain::InitializeSwapChain(
    VkSurfaceKHR surface,
    const VkSurfaceCapabilitiesKHR& surface_caps,
    const VkSurfaceFormatKHR& surface_format) {
  VkDevice device = device_queue_->GetVulkanDevice();
  VkResult result = VK_SUCCESS;

  VkSwapchainCreateInfoKHR swap_chain_create_info = {};
  swap_chain_create_info.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR;
  swap_chain_create_info.surface = surface;
  swap_chain_create_info.minImageCount =
      std::max(2u, surface_caps.minImageCount);
  swap_chain_create_info.imageFormat = surface_format.format;
  swap_chain_create_info.imageColorSpace = surface_format.colorSpace;
  swap_chain_create_info.imageExtent = surface_caps.currentExtent;
  swap_chain_create_info.imageArrayLayers = 1;
  swap_chain_create_info.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
  swap_chain_create_info.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE;
  swap_chain_create_info.preTransform = surface_caps.currentTransform;
  swap_chain_create_info.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
  swap_chain_create_info.presentMode = VK_PRESENT_MODE_FIFO_KHR;
  swap_chain_create_info.clipped = true;
  swap_chain_create_info.oldSwapchain = swap_chain_;

  VkSwapchainKHR new_swap_chain = VK_NULL_HANDLE;
  result = vkCreateSwapchainKHR(device, &swap_chain_create_info, nullptr,
                                &new_swap_chain);
  if (VK_SUCCESS != result) {
    DLOG(ERROR) << "vkCreateSwapchainKHR() failed: " << result;
    return false;
  }

  Destroy();

  swap_chain_ = new_swap_chain;
  size_ = gfx::Size(swap_chain_create_info.imageExtent.width,
                    swap_chain_create_info.imageExtent.height);

  return true;
}

void VulkanSwapChain::DestroySwapChain() {
  VkDevice device = device_queue_->GetVulkanDevice();

  if (swap_chain_ != VK_NULL_HANDLE) {
    vkDestroySwapchainKHR(device, swap_chain_, nullptr);
    swap_chain_ = VK_NULL_HANDLE;
  }
}

bool VulkanSwapChain::InitializeSwapImages(
    const VkSurfaceCapabilitiesKHR& surface_caps,
    const VkSurfaceFormatKHR& surface_format) {
  VkDevice device = device_queue_->GetVulkanDevice();
  VkResult result = VK_SUCCESS;

  uint32_t image_count = 0;
  result = vkGetSwapchainImagesKHR(device, swap_chain_, &image_count, nullptr);
  if (VK_SUCCESS != result) {
    DLOG(ERROR) << "vkGetSwapchainImagesKHR(NULL) failed: " << result;
    return false;
  }

  std::vector<VkImage> images(image_count);
  result =
      vkGetSwapchainImagesKHR(device, swap_chain_, &image_count, images.data());
  if (VK_SUCCESS != result) {
    DLOG(ERROR) << "vkGetSwapchainImagesKHR(images) failed: " << result;
    return false;
  }

  // Generic semaphore creation structure.
  VkSemaphoreCreateInfo semaphore_create_info = {};
  semaphore_create_info.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO;

  // Default image subresource range.
  VkImageSubresourceRange image_subresource_range = {};
  image_subresource_range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
  image_subresource_range.baseMipLevel = 0;
  image_subresource_range.levelCount = 1;
  image_subresource_range.baseArrayLayer = 0;
  image_subresource_range.layerCount = 1;

  // The image memory barrier is used to setup the image layout.
  VkImageMemoryBarrier image_memory_barrier = {};
  image_memory_barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER;
  image_memory_barrier.dstAccessMask = VK_ACCESS_MEMORY_READ_BIT;
  image_memory_barrier.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;
  image_memory_barrier.newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
  image_memory_barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
  image_memory_barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
  image_memory_barrier.subresourceRange = image_subresource_range;

  command_pool_ = device_queue_->CreateCommandPool();
  if (!command_pool_)
    return false;

  images_.resize(image_count);
  for (uint32_t i = 0; i < image_count; ++i) {
    images_[i].reset(new ImageData);
    std::unique_ptr<ImageData>& image_data = images_[i];
    image_data->image = images[i];

    // Setup semaphores.
    result = vkCreateSemaphore(device, &semaphore_create_info, nullptr,
                               &image_data->render_semaphore);
    if (VK_SUCCESS != result) {
      DLOG(ERROR) << "vkCreateSemaphore(render) failed: " << result;
      return false;
    }

    result = vkCreateSemaphore(device, &semaphore_create_info, nullptr,
                               &image_data->present_semaphore);
    if (VK_SUCCESS != result) {
      DLOG(ERROR) << "vkCreateSemaphore(present) failed: " << result;
      return false;
    }

    // Initialize the command buffer for this buffer data.
    image_data->command_buffer = command_pool_->CreatePrimaryCommandBuffer();

    // Setup the Image Layout as the first command that gets issued in each
    // command buffer.
    ScopedSingleUseCommandBufferRecorder recorder(*image_data->command_buffer);
    image_memory_barrier.image = images[i];
    vkCmdPipelineBarrier(recorder.handle(), VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
                         VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, 0, nullptr, 0,
                         nullptr, 1, &image_memory_barrier);

    // Create the image view.
    image_data->image_view.reset(new VulkanImageView(device_queue_));
    if (!image_data->image_view->Initialize(
            images[i], VK_IMAGE_VIEW_TYPE_2D, VulkanImageView::IMAGE_TYPE_COLOR,
            surface_format.format, size_.width(), size_.height(), 0, 1, 0, 1)) {
      return false;
    }
  }

  result = vkCreateSemaphore(device, &semaphore_create_info, nullptr,
                             &next_present_semaphore_);
  if (VK_SUCCESS != result) {
    DLOG(ERROR) << "vkCreateSemaphore(next_present) failed: " << result;
    return false;
  }

  // Acquire the initial buffer.
  result = vkAcquireNextImageKHR(device, swap_chain_, UINT64_MAX,
                                 next_present_semaphore_, VK_NULL_HANDLE,
                                 &current_image_);
  if (VK_SUCCESS != result) {
    DLOG(ERROR) << "vkAcquireNextImageKHR() failed: " << result;
    return false;
  }

  std::swap(images_[current_image_]->present_semaphore,
            next_present_semaphore_);

  return true;
}

void VulkanSwapChain::DestroySwapImages() {
  VkDevice device = device_queue_->GetVulkanDevice();

  if (VK_NULL_HANDLE != next_present_semaphore_) {
    vkDestroySemaphore(device, next_present_semaphore_, nullptr);
    next_present_semaphore_ = VK_NULL_HANDLE;
  }

  for (const std::unique_ptr<ImageData>& image_data : images_) {
    if (image_data->command_buffer) {
      // Make sure command buffer is done processing.
      image_data->command_buffer->Wait(UINT64_MAX);

      image_data->command_buffer->Destroy();
      image_data->command_buffer.reset();
    }

    // Destroy Image View.
    if (image_data->image_view) {
      image_data->image_view->Destroy();
      image_data->image_view.reset();
    }

    // Destroy Semaphores.
    if (VK_NULL_HANDLE != image_data->present_semaphore) {
      vkDestroySemaphore(device, image_data->present_semaphore, nullptr);
      image_data->present_semaphore = VK_NULL_HANDLE;
    }

    if (VK_NULL_HANDLE != image_data->render_semaphore) {
      vkDestroySemaphore(device, image_data->render_semaphore, nullptr);
      image_data->render_semaphore = VK_NULL_HANDLE;
    }

    image_data->image = VK_NULL_HANDLE;
  }
  images_.clear();

  if (command_pool_) {
    command_pool_->Destroy();
    command_pool_.reset();
  }
}

VulkanSwapChain::ImageData::ImageData() {}

VulkanSwapChain::ImageData::~ImageData() {}

}  // namespace gpu


text:
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.

package com.intellij.codeInsight.highlighting;

import com.intellij.openapi.extensions.ProjectExtensionPointName;
import com.intellij.psi.PsiErrorElement;
import org.jetbrains.annotations.NotNull;

/**
 * @author spleaner
 */
public abstract class HighlightErrorFilter {
  public static final ProjectExtensionPointName<HighlightErrorFilter> EP_NAME = new ProjectExtensionPointName<>("com.intellij.highlightErrorFilter");

  public abstract boolean shouldHighlightErrorElement(@NotNull final PsiErrorElement element);

}

redpajama_set_name: RedPajamaGithub


text:
/**
 * Made by Kay Lerch (https://twitter.com/KayLerch)
 *
 * Attached license applies.
 * This library is licensed under GNU GENERAL PUBLIC LICENSE Version 3 as of 29 June 2007
 */
package io.klerch.alexa.state.model.dummies;

import io.klerch.alexa.state.model.AlexaScope;
import io.klerch.alexa.state.model.AlexaStateIgnore;
import io.klerch.alexa.state.model.AlexaStateModel;
import io.klerch.alexa.state.model.AlexaStateSave;

@AlexaStateSave(Scope= AlexaScope.APPLICATION)
public class ApplicationModel extends AlexaStateModel {
    private String privateField;
    @AlexaStateSave public String sampleString;
    @AlexaStateIgnore
    public String sampleIgnore;
    @AlexaStateIgnore (Scope=AlexaScope.SESSION) public String sampleIgnoreSession;
    @AlexaStateIgnore (Scope=AlexaScope.USER) public String sampleIgnoreUser;
    @AlexaStateIgnore (Scope=AlexaScope.APPLICATION) public String sampleIgnoreApplication;
    public ApplicationModel() {}
}


text:
from mock import MagicMock

from .test_base import CliCommandTest

class TokensTest(CliCommandTest):

    def setUp(self):
        super(TokensTest, self).setUp()
        self.client.tokens.get = MagicMock()
        self.use_manager()

    def test_tokens_command(self):
        self.use_manager()
        self.invoke('cfy tokens get')

    def test_tokens_wrong_argument(self):
        outcome = self.invoke('cfy tokens get -t',
                              err_str_segment='2',
                              exception=SystemExit)
        self.assertIn('Error: no such option: -t', outcome.output)


text:
import React from 'react';
import { UISref } from '@uirouter/react';

import { IExecutionDetailsSectionProps, ExecutionDetailsSection } from '../common';
import { StageFailureMessage } from '../../../details';
import _ from 'lodash';

export function MonitorPipelineStageExecutionDetails(props: IExecutionDetailsSectionProps) {
  const {
    application,
    execution,
    stage: { context = {}, outputs = {} },
    stage,
    name,
    current,
  } = props;

  const statuses = _.sortBy(
    Object.keys(outputs.executionStatuses).map((executionId) => {
      const status = { ...outputs.executionStatuses[executionId] };
      status.executionId = executionId;

      const generalException: any = status.exception;
      if (generalException) {
        const errors = (generalException.details?.errors ?? []).filter((m: any) => !!m);

        if (errors.length) {
          status.failureMessage = errors.join('\n\n');
        } else {
          status.failureMessage = generalException.details?.error ?? null;
        }
      }

      return status;
    }),
    'status',
  );

  return (
    <ExecutionDetailsSection name={name} current={current}>

Monitor behavior

          {context.monitorBehavior}

Executions

          {statuses.map((status) => {
            return (

                {status.status}{' '}
                <UISref
                  key={status.executionId}
                  to="home.applications.application.pipelines.executionDetails.execution"
                  params={{
                    application: status.application,
                    executionId: status.executionId,
                    executionParams: { application: application.name, executionId: execution.id },
                  }}
                  options={{ inherit: false, reload: 'home.applications.application.pipelines.executionDetails' }}
                >
                  {status.executionId}
                </UISref>{' '}
                ({status.application})
                {status.failureMessage && <StageFailureMessage stage={stage} message={status.failureMessage} />}

            );
          })}

      <StageFailureMessage stage={stage} message={stage.failureMessage} />
    </ExecutionDetailsSection>
  );
}

// TODO: refactor this to not use namespace
// eslint-disable-next-line
export namespace MonitorPipelineStageExecutionDetails {
  export const title = 'monitorPipelineConfig';
}


text:
GlassView
===========

GlassView is an Android library that allows developers to easily add a glass-like effect inspired by a
[GlassActionBar][1].

GlassView extends a RelativeLayout and it blurs the parent view behind it using the [ScriptIntrinsicBlur][2]
from v8 Support Library "[android.support.v8.renderscript][3]" package.

Try out the sample application:

Requirements
-------------
API Level 8 (Froyo) and above.

Setup
------
You just need to add the followings to your ***build.gradle*** file:

```
repositories {
    maven { url 'http://Manabu-GT.github.com/GlassView/mvn-repo' }
}

dependencies {
    compile 'com.ms.square:glassview:0.1.0'
}

android {
    defaultConfig {
        renderscriptTargetApi 19
        renderscriptSupportMode true
    }
}
```

Usage
------
Using the library is really simple, just look at the source code of the [provided sample][4].

Also, you can optionally set the following attributes in your layout xml file to customize the behavior
of the GlassView.

 * `downSampling` (defaults to 3)
 The value used to downscale bitmap for faster blur processing. For example, if this value is
 set to 2, the 1/4 size of the original view will be used to apply the blur effect.
 This is important because as the view gets bigger, the more pixels need to be blurred and it significantly
 affects the speed of the blur processing.

 * `blurRadius` (defaults to 5)
 Radius of blur effect (allowed values are between 0 and 25)

```
  <!-- sample xml -->
  <merge xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:glassview="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent">

      <ScrollView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:scrollbars="none">
          <FrameLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content">
              <ImageView
                  android:id="@+id/bg_img"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:src="@drawable/lolipop_bg"/>
          </FrameLayout>
      </ScrollView>

      <com.ms.square.android.glassview.GlassView
          android:id="@+id/glass_view"
          android:layout_width="match_parent"
          android:layout_height="200dp"
          android:layout_gravity="bottom"
          android:background="#55ffffff"
          glassview:blurRadius="10">
            <!-- Child views could go here -->
      </com.ms.square.android.glassview.GlassView>

  </merge>
```

License
----------

    Copyright 2014 Manabu Shimobe

    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.

[1]: https://github.com/ManuelPeinado/GlassActionBar
[2]: http://developer.android.com/reference/android/renderscript/ScriptIntrinsicBlur.html
[3]: http://developer.android.com/reference/android/support/v8/renderscript/package-summary.html
[4]: https://github.com/Manabu-GT/GlassView/tree/master/sample


text:
namespace YAGNIBicycleBefore
{
    public interface IBicycle
    {
        int Wheels { get; }

        int Seat { get; }

        string Body { get; }

        int Breaks { get; }

        string Chain { get; }

        string Steering { get; }

        bool IsElectric { get; }

        string Engine { get; }

        string TypeOfFuel { get; }

        int AssistingWheels { get; }

        string Umbrella { get; }

        string Gps { get; }

        int Mirrors { get; }

        int Stickers { get; }

        int LuggageVolume { get; }
    }
}


text:
package vars_test

import (
	"github.com/concourse/concourse/vars"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	"sigs.k8s.io/yaml"
)

var _ = Describe("Template", func() {
	var (
		paramPayload  []byte
		configPayload []byte
		staticVars    vars.StaticVariables
	)

	BeforeEach(func() {
		paramPayload = []byte(`
secret:
  concourse_repo:
    private_key: some-private-key

env: some-env

env-tags: ["speedy"]
`)
	})

	JustBeforeEach(func() {
		err := yaml.Unmarshal(paramPayload, &staticVars)
		Expect(err).NotTo(HaveOccurred())
	})

	Describe("Evaluate", func() {
		Context("when all of the variables are defined", func() {
			BeforeEach(func() {
				configPayload = []byte(`
resources:
- name: my-repo
  source:
    uri: git@github.com:concourse/concourse.git
    private_key: ((secret.concourse_repo.private_key))

- name: env-state
  source:
    bucket: ((env))-ci
    key: state

jobs:
- name: do-some-stuff
  plan:
  - get: my-repo
  - task: build-thing-on-env
    tags: ((env-tags))
`)
			})

			It("evaluates all params", func() {
				evaluatedContent1, err := vars.NewTemplateResolver(configPayload, []vars.Variables{staticVars}).Resolve(false, true)
				Expect(err).NotTo(HaveOccurred())

				evaluatedContent2, err := vars.NewTemplateResolver(configPayload, []vars.Variables{staticVars}).Resolve(true, true)
				Expect(err).NotTo(HaveOccurred())

				Expect(evaluatedContent1).To(Equal(evaluatedContent2))
				Expect(evaluatedContent1).To(MatchYAML([]byte(`
resources:
- name: my-repo
  source:
    uri: git@github.com:concourse/concourse.git
    private_key: some-private-key

- name: env-state
  source:
    bucket: some-env-ci
    key: state

jobs:
- name: do-some-stuff
  plan:
  - get: my-repo
  - task: build-thing-on-env
    tags: ["speedy"]
`,
				)))
			})
		})

		Context("when not all of the variables are defined", func() {
			BeforeEach(func() {
				configPayload = []byte(`
resources:
- name: my-repo
  source:
    uri: git@github.com:concourse/concourse.git
    private_key: ((secret.concourse_repo.private_key))
- name: env-state
  source:
    bucket: ((bucket))
    key: ((state))
`)
			})

			It("evaluates only given params if expectAllKeys = false", func() {
				evaluatedContent, err := vars.NewTemplateResolver(configPayload, []vars.Variables{staticVars}).Resolve(false, true)
				Expect(err).NotTo(HaveOccurred())
				Expect(evaluatedContent).To(MatchYAML([]byte(`
resources:
- name: my-repo
  source:
    uri: git@github.com:concourse/concourse.git
    private_key: some-private-key
- name: env-state
  source:
    bucket: ((bucket))
    key: ((state))
`,
				)))
			})

			It("fails with an error if expectAllKeys = true", func() {
				_, err := vars.NewTemplateResolver(configPayload, []vars.Variables{staticVars}).Resolve(true, true)
				Expect(err).To(HaveOccurred())
			})
		})

		Context("when multiple variable sources are given", func() {

			var staticVars2 vars.StaticVariables

			BeforeEach(func() {
				configPayload = []byte(`
resources:
- name: my-repo
  source:
    uri: git@github.com:concourse/concourse.git
    private_key: ((secret.concourse_repo.private_key))

- name: env-state
  source:
    bucket: ((env))-ci
    key: state

jobs:
- name: do-some-stuff
  plan:
  - get: my-repo
  - task: build-thing-on-env
    tags: ((env-tags))
`)

				paramPayload2 := []byte(`
secret:
  concourse_repo:
    private_key: some-private-key-override

env: some-env-override
`)
				err := yaml.Unmarshal(paramPayload2, &staticVars2)
				Expect(err).NotTo(HaveOccurred())
			})

			It("evaluates params using param sources in the given order", func() {
				// forward order
				evaluatedContent1, err := vars.NewTemplateResolver(configPayload, []vars.Variables{staticVars, staticVars2}).Resolve(false, true)
				Expect(err).NotTo(HaveOccurred())
				Expect(evaluatedContent1).To(MatchYAML([]byte(`
resources:
- name: my-repo
  source:
    uri: git@github.com:concourse/concourse.git
    private_key: some-private-key

- name: env-state
  source:
    bucket: some-env-ci
    key: state

jobs:
- name: do-some-stuff
  plan:
  - get: my-repo
  - task: build-thing-on-env
    tags: ["speedy"]
`,
				)))

				// reverse order
				evaluatedContent2, err := vars.NewTemplateResolver(configPayload, []vars.Variables{staticVars2, staticVars}).Resolve(false, true)
				Expect(err).NotTo(HaveOccurred())
				Expect(evaluatedContent2).To(MatchYAML([]byte(`
resources:
- name: my-repo
  source:
    uri: git@github.com:concourse/concourse.git
    private_key: some-private-key-override

- name: env-state
  source:
    bucket: some-env-override-ci
    key: state

jobs:
- name: do-some-stuff
  plan:
  - get: my-repo
  - task: build-thing-on-env
    tags: ["speedy"]
`,
				)))

			})
		})
	})

	It("can template values into a byte slice", func() {
		byteSlice := []byte("{{key}}")
		variables := vars.StaticVariables{
			"key": "foo",
		}

		result, err := vars.NewTemplateResolver(byteSlice, []vars.Variables{variables}).ResolveDeprecated(false)
		Expect(err).NotTo(HaveOccurred())
		Expect(result).To(Equal([]byte(`"foo"`)))
	})

	It("can template multiple values into a byte slice", func() {
		byteSlice := []byte("{{key}}={{value}}")
		variables := vars.StaticVariables{
			"key":   "foo",
			"value": "bar",
		}

		result, err := vars.NewTemplateResolver(byteSlice, []vars.Variables{variables}).ResolveDeprecated(false)
		Expect(err).NotTo(HaveOccurred())
		Expect(result).To(Equal([]byte(`"foo"="bar"`)))
	})

	It("can template unicode values into a byte slice", func() {
		byteSlice := []byte("{{Ω}}")
		variables := vars.StaticVariables{
			"Ω": "☃",
		}

		result, err := vars.NewTemplateResolver(byteSlice, []vars.Variables{variables}).ResolveDeprecated(false)
		Expect(err).NotTo(HaveOccurred())
		Expect(result).To(Equal([]byte(`"☃"`)))
	})

	It("can template keys with dashes and underscores into a byte slice", func() {
		byteSlice := []byte("{{with-a-dash}} = {{with_an_underscore}}")
		variables := vars.StaticVariables{
			"with-a-dash":        "dash",
			"with_an_underscore": "underscore",
		}

		result, err := vars.NewTemplateResolver(byteSlice, []vars.Variables{variables}).ResolveDeprecated(false)
		Expect(err).NotTo(HaveOccurred())
		Expect(result).To(Equal([]byte(`"dash" = "underscore"`)))
	})

	It("can template the same value multiple times into a byte slice", func() {
		byteSlice := []byte("{{key}}={{key}}")
		variables := vars.StaticVariables{
			"key": "foo",
		}

		result, err := vars.NewTemplateResolver(byteSlice, []vars.Variables{variables}).ResolveDeprecated(false)
		Expect(err).NotTo(HaveOccurred())
		Expect(result).To(Equal([]byte(`"foo"="foo"`)))
	})

	It("ignores values referencing local var sources", func() {
		byteSlice := []byte("((key))=((.:key))")
		variables := vars.StaticVariables{
			"key": "foo",
		}

		result, err := vars.NewTemplateResolver(byteSlice, []vars.Variables{variables}).Resolve(false, true)
		Expect(err).NotTo(HaveOccurred())
		Expect(string(result)).To(Equal("foo=((.:key))\n"))
	})

	It("ignores values referencing var sources", func() {
		byteSlice := []byte("((key))=((source:key))")
		variables := vars.StaticVariables{
			"key": "foo",
		}

		result, err := vars.NewTemplateResolver(byteSlice, []vars.Variables{variables}).Resolve(false, true)
		Expect(err).NotTo(HaveOccurred())
		Expect(string(result)).To(Equal("foo=((source:key))\n"))
	})

	It("can template values with strange newlines", func() {
		byteSlice := []byte("{{key}}")
		variables := vars.StaticVariables{
			"key": "this\nhas\nmany\nlines",
		}

		result, err := vars.NewTemplateResolver(byteSlice, []vars.Variables{variables}).ResolveDeprecated(false)
		Expect(err).NotTo(HaveOccurred())
		Expect(result).To(Equal([]byte(`"this\nhas\nmany\nlines"`)))
	})

	It("raises an error for each variable that is undefined", func() {
		byteSlice := []byte("{{not-specified-one}}{{not-specified-two}}")
		variables := vars.StaticVariables{}
		errorMsg := `2 errors occurred:
	* unbound variable in template: 'not-specified-one'
	* unbound variable in template: 'not-specified-two'

`

		_, err := vars.NewTemplateResolver(byteSlice, []vars.Variables{variables}).ResolveDeprecated(false)
		Expect(err).To(HaveOccurred())
		Expect(err.Error()).To(Equal(errorMsg))
	})

	It("ignores an invalid input", func() {
		byteSlice := []byte("{{}")
		variables := vars.StaticVariables{}

		result, err := vars.NewTemplateResolver(byteSlice, []vars.Variables{variables}).ResolveDeprecated(false)
		Expect(err).NotTo(HaveOccurred())
		Expect(result).To(Equal([]byte("{{}")))
	})

})


text:
package se.toxbee.sleepfighter.challenge.memory;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.Button;

/**
 * Represents a memory card graphically
 *
 * @author Eric Arneb�ck
 * @version 1.0
 * @since Sep 28, 2013
 */

public class MemoryCardView extends Button {

	// what to show when the memory card is flipped over and hidden.
  	private static String HIDDEN =  "";
  	// what to show when the memory card s flipped over and shown.
  	private String SHOWN;

  	private int position;

  	private String currentImage;

  	private float FONT_SIZE = 40;

    public MemoryCardView(Context context) {
        super(context);
        this.setTextSize(FONT_SIZE);
    }

    public MemoryCardView(Context context, AttributeSet attrs) {
        super(context, attrs);
        this.setTextSize(FONT_SIZE);
    }

	public void hide() {
		currentImage = HIDDEN;
		super.setText(currentImage);
		super.setClickable(true);
	}

	public void show() {
		currentImage = SHOWN;
		super.setText(currentImage);

		// it should not be clickable when it is flipped.
		super.setClickable(false);
	}

	public boolean isHidden() {
		return this.currentImage.equals(HIDDEN);
	}

	public boolean isShown() {
		return !isHidden();
	}

	public void flip() {
		if(isHidden()) {
			this.show();
		} else {
			this.hide();
		}
	}

	public void setImage(String image) {

		SHOWN = image;

		// all cards are hidden by default.
		hide();
	}

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

	public int getPosition() {
		return this.position;
	}
}


text:
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("File Renamer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Si13n7 Dev. ®")]
[assembly: AssemblyProduct("FileRenamer")]
[assembly: AssemblyCopyright("Copyright © Si13n7 Dev. ® 2018")]
[assembly: AssemblyTrademark("Si13n7 Dev. ®")]
[assembly: AssemblyCulture("")]

[assembly: ComVisible(false)]

[assembly: Guid("cf7e442e-2093-4976-8f4d-3c0c538757a8")]

[assembly: AssemblyVersion("18.1.29.*")]


text:
package org.apache.spark.ml.feature

import org.apache.hadoop.fs.Path

import org.apache.spark.annotation.{Experimental, Since}
import org.apache.spark.broadcast.Broadcast
import org.apache.spark.ml.{Estimator, Model}
import org.apache.spark.ml.param._
import org.apache.spark.ml.param.shared.{HasInputCol, HasOutputCol}
import org.apache.spark.ml.util._
import org.apache.spark.mllib.linalg.{Vectors, VectorUDT}
import org.apache.spark.rdd.RDD
import org.apache.spark.sql.{DataFrame, Dataset}
import org.apache.spark.sql.functions._
import org.apache.spark.sql.types._
import org.apache.spark.util.collection.OpenHashMap

/**
 * Params for [[CountVectorizer]] and [[CountVectorizerModel]].
 */
private[feature] trait CountVectorizerParams extends Params with HasInputCol with HasOutputCol {

  /**
   * Max size of the vocabulary.
   * CountVectorizer will build a vocabulary that only considers the top
   * vocabSize terms ordered by term frequency across the corpus.
   *
   * Default: 2^18^
   * @group param
   */
  val vocabSize: IntParam =
    new IntParam(this, "vocabSize", "max size of the vocabulary", ParamValidators.gt(0))

  /** @group getParam */
  def getVocabSize: Int = $(vocabSize)

  /**
   * Specifies the minimum number of different documents a term must appear in to be included
   * in the vocabulary.
   * If this is an integer >= 1, this specifies the number of documents the term must appear in;
   * if this is a double in [0,1), then this specifies the fraction of documents.
   *
   * Default: 1
   * @group param
   */
  val minDF: DoubleParam = new DoubleParam(this, "minDF", "Specifies the minimum number of" +
    " different documents a term must appear in to be included in the vocabulary." +
    " If this is an integer >= 1, this specifies the number of documents the term must" +
    " appear in; if this is a double in [0,1), then this specifies the fraction of documents.",
    ParamValidators.gtEq(0.0))

  /** @group getParam */
  def getMinDF: Double = $(minDF)

  /** Validates and transforms the input schema. */
  protected def validateAndTransformSchema(schema: StructType): StructType = {
    val typeCandidates = List(new ArrayType(StringType, true), new ArrayType(StringType, false))
    SchemaUtils.checkColumnTypes(schema, $(inputCol), typeCandidates)
    SchemaUtils.appendColumn(schema, $(outputCol), new VectorUDT)
  }

  /**
   * Filter to ignore rare words in a document. For each document, terms with
   * frequency/count less than the given threshold are ignored.
   * If this is an integer >= 1, then this specifies a count (of times the term must appear
   * in the document);
   * if this is a double in [0,1), then this specifies a fraction (out of the document's token
   * count).
   *
   * Note that the parameter is only used in transform of [[CountVectorizerModel]] and does not
   * affect fitting.
   *
   * Default: 1
   * @group param
   */
  val minTF: DoubleParam = new DoubleParam(this, "minTF", "Filter to ignore rare words in" +
    " a document. For each document, terms with frequency/count less than the given threshold are" +
    " ignored. If this is an integer >= 1, then this specifies a count (of times the term must" +
    " appear in the document); if this is a double in [0,1), then this specifies a fraction (out" +
    " of the document's token count). Note that the parameter is only used in transform of" +
    " CountVectorizerModel and does not affect fitting.", ParamValidators.gtEq(0.0))

  setDefault(minTF -> 1)

  /** @group getParam */
  def getMinTF: Double = $(minTF)

  /**
   * Binary toggle to control the output vector values.
   * If True, all nonzero counts (after minTF filter applied) are set to 1. This is useful for
   * discrete probabilistic models that model binary events rather than integer counts.
   * Default: false
   * @group param
   */
  val binary: BooleanParam =
    new BooleanParam(this, "binary", "If True, all non zero counts are set to 1.")

  /** @group getParam */
  def getBinary: Boolean = $(binary)

  setDefault(binary -> false)
}

/**
 * :: Experimental ::
 * Extracts a vocabulary from document collections and generates a [[CountVectorizerModel]].
 */
@Experimental
class CountVectorizer(override val uid: String)
  extends Estimator[CountVectorizerModel] with CountVectorizerParams with DefaultParamsWritable {

  def this() = this(Identifiable.randomUID("cntVec"))

  /** @group setParam */
  def setInputCol(value: String): this.type = set(inputCol, value)

  /** @group setParam */
  def setOutputCol(value: String): this.type = set(outputCol, value)

  /** @group setParam */
  def setVocabSize(value: Int): this.type = set(vocabSize, value)

  /** @group setParam */
  def setMinDF(value: Double): this.type = set(minDF, value)

  /** @group setParam */
  def setMinTF(value: Double): this.type = set(minTF, value)

  /** @group setParam */
  def setBinary(value: Boolean): this.type = set(binary, value)

  setDefault(vocabSize -> (1 << 18), minDF -> 1)

  @Since("2.0.0")
  override def fit(dataset: Dataset[_]): CountVectorizerModel = {
    transformSchema(dataset.schema, logging = true)
    val vocSize = $(vocabSize)
    val input = dataset.select($(inputCol)).rdd.map(_.getAs[Seq[String]](0))
    val minDf = if ($(minDF) >= 1.0) {
      $(minDF)
    } else {
      $(minDF) * input.cache().count()
    }
    val wordCounts: RDD[(String, Long)] = input.flatMap { case (tokens) =>
      val wc = new OpenHashMap[String, Long]
      tokens.foreach { w =>
        wc.changeValue(w, 1L, _ + 1L)
      }
      wc.map { case (word, count) => (word, (count, 1)) }
    }.reduceByKey { case ((wc1, df1), (wc2, df2)) =>
      (wc1 + wc2, df1 + df2)
    }.filter { case (word, (wc, df)) =>
      df >= minDf
    }.map { case (word, (count, dfCount)) =>
      (word, count)
    }.cache()
    val fullVocabSize = wordCounts.count()

    val vocab = wordCounts
      .top(math.min(fullVocabSize, vocSize).toInt)(Ordering.by(_._2))
      .map(_._1)

    require(vocab.length > 0, "The vocabulary size should be > 0. Lower minDF as necessary.")
    copyValues(new CountVectorizerModel(uid, vocab).setParent(this))
  }

  override def transformSchema(schema: StructType): StructType = {
    validateAndTransformSchema(schema)
  }

  override def copy(extra: ParamMap): CountVectorizer = defaultCopy(extra)
}

@Since("1.6.0")
object CountVectorizer extends DefaultParamsReadable[CountVectorizer] {

  @Since("1.6.0")
  override def load(path: String): CountVectorizer = super.load(path)
}

/**
 * :: Experimental ::
 * Converts a text document to a sparse vector of token counts.
 * @param vocabulary An Array over terms. Only the terms in the vocabulary will be counted.
 */
@Experimental
class CountVectorizerModel(override val uid: String, val vocabulary: Array[String])
  extends Model[CountVectorizerModel] with CountVectorizerParams with MLWritable {

  import CountVectorizerModel._

  def this(vocabulary: Array[String]) = {
    this(Identifiable.randomUID("cntVecModel"), vocabulary)
    set(vocabSize, vocabulary.length)
  }

  /** @group setParam */
  def setInputCol(value: String): this.type = set(inputCol, value)

  /** @group setParam */
  def setOutputCol(value: String): this.type = set(outputCol, value)

  /** @group setParam */
  def setMinTF(value: Double): this.type = set(minTF, value)

  /** @group setParam */
  def setBinary(value: Boolean): this.type = set(binary, value)

  /** Dictionary created from [[vocabulary]] and its indices, broadcast once for [[transform()]] */
  private var broadcastDict: Option[Broadcast[Map[String, Int]]] = None

  @Since("2.0.0")
  override def transform(dataset: Dataset[_]): DataFrame = {
    transformSchema(dataset.schema, logging = true)
    if (broadcastDict.isEmpty) {
      val dict = vocabulary.zipWithIndex.toMap
      broadcastDict = Some(dataset.sparkSession.sparkContext.broadcast(dict))
    }
    val dictBr = broadcastDict.get
    val minTf = $(minTF)
    val vectorizer = udf { (document: Seq[String]) =>
      val termCounts = new OpenHashMap[Int, Double]
      var tokenCount = 0L
      document.foreach { term =>
        dictBr.value.get(term) match {
          case Some(index) => termCounts.changeValue(index, 1.0, _ + 1.0)
          case None => // ignore terms not in the vocabulary
        }
        tokenCount += 1
      }
      val effectiveMinTF = if (minTf >= 1.0) minTf else tokenCount * minTf
      val effectiveCounts = if ($(binary)) {
        termCounts.filter(_._2 >= effectiveMinTF).map(p => (p._1, 1.0)).toSeq
      } else {
        termCounts.filter(_._2 >= effectiveMinTF).toSeq
      }

      Vectors.sparse(dictBr.value.size, effectiveCounts)
    }
    dataset.withColumn($(outputCol), vectorizer(col($(inputCol))))
  }

  override def transformSchema(schema: StructType): StructType = {
    validateAndTransformSchema(schema)
  }

  override def copy(extra: ParamMap): CountVectorizerModel = {
    val copied = new CountVectorizerModel(uid, vocabulary).setParent(parent)
    copyValues(copied, extra)
  }

  @Since("1.6.0")
  override def write: MLWriter = new CountVectorizerModelWriter(this)
}

@Since("1.6.0")
object CountVectorizerModel extends MLReadable[CountVectorizerModel] {

  private[CountVectorizerModel]
  class CountVectorizerModelWriter(instance: CountVectorizerModel) extends MLWriter {

    private case class Data(vocabulary: Seq[String])

    override protected def saveImpl(path: String): Unit = {
      DefaultParamsWriter.saveMetadata(instance, path, sc)
      val data = Data(instance.vocabulary)
      val dataPath = new Path(path, "data").toString
      sqlContext.createDataFrame(Seq(data)).repartition(1).write.parquet(dataPath)
    }
  }

  private class CountVectorizerModelReader extends MLReader[CountVectorizerModel] {

    private val className = classOf[CountVectorizerModel].getName

    override def load(path: String): CountVectorizerModel = {
      val metadata = DefaultParamsReader.loadMetadata(path, sc, className)
      val dataPath = new Path(path, "data").toString
      val data = sqlContext.read.parquet(dataPath)
        .select("vocabulary")
        .head()
      val vocabulary = data.getAs[Seq[String]](0).toArray
      val model = new CountVectorizerModel(metadata.uid, vocabulary)
      DefaultParamsReader.getAndSetParams(model, metadata)
      model
    }
  }

  @Since("1.6.0")
  override def read: MLReader[CountVectorizerModel] = new CountVectorizerModelReader

  @Since("1.6.0")
  override def load(path: String): CountVectorizerModel = super.load(path)
}


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

using System;
using System.Linq;
using Microsoft.CodeAnalysis.Diagnostics;
using Test.Utilities;
using Xunit;

namespace Microsoft.CodeQuality.Analyzers.ApiDesignGuidelines.UnitTests
{
    public class IdentifiersShouldDifferByMoreThanCaseTests : DiagnosticAnalyzerTestBase
    {
        protected override DiagnosticAnalyzer GetBasicDiagnosticAnalyzer()
        {
            return new IdentifiersShouldDifferByMoreThanCaseAnalyzer();
        }

        protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer()
        {
            return new IdentifiersShouldDifferByMoreThanCaseAnalyzer();
        }

        #region Namespace Level

        [Fact]
        public void TestGlobalNamespaceNames()
        {
            VerifyCSharp(@"
namespace N
{
    public class C { }
}
namespace n
{
    public class C { }
}
",
                GetCA1708CSharpResult(Namespace, GetSymbolDisplayString("n", "N")));
        }

        [Fact]
        public void TestNestedNamespaceNames()
        {
            VerifyCSharp(@"
namespace N
{
    class C { }
    namespace n
    {
        public class C { }
    }
    namespace n { }
}

namespace n
{
    public class C { }
    namespace n
    {
        public class C { }
    }
}
",
                GetCA1708CSharpResult(Namespace, GetSymbolDisplayString("n", "N")));
        }

        [Fact]
        public void TestGlobalTypeNames()
        {
            VerifyCSharp(@"
public class Ni
{
}
public struct ni
{
}
public interface nI
{
}
",
                GetCA1708CSharpResult(Type, GetSymbolDisplayString("nI", "ni", "Ni")));
        }

        [Fact]
        public void TestGenericClasses()
        {
            VerifyCSharp(@"
public class C<T>
{
}
public class c<S>
{
}
public class c
{
}
public class C<T,X>
{
}
",
                GetCA1708CSharpResult(Type, GetSymbolDisplayString("c<S>", "C<T>")));
        }

        [Fact]
        public void TestPartialTypes()
        {
            VerifyCSharp(new[]
                {
                    @"
namespace N
{
    public partial class C
    {
        public int x;
    }
    public partial class C
    {
        public int X;
    }
    public partial class F
    {
        public int x;
    }
}
",
                    @"
namespace N
{
    public class c
    {
    }
    public partial class F
    {
        public int X;
    }
}"
                },
                GetCA1708CSharpResult(Type, GetSymbolDisplayString("N.C", "N.c")),
                GetCA1708CSharpResultAt(Member, GetSymbolDisplayString("N.C.x", "N.C.X"), "Test0.cs(4,26)", "Test0.cs(8,26)"),
                GetCA1708CSharpResultAt(Member, GetSymbolDisplayString("N.F.x", "N.F.X"), "Test0.cs(12,26)", "Test1.cs(7,26)"));
        }

        #endregion

        #region Type Level

        [Fact]
        public void TestNestedTypeNames()
        {
            VerifyCSharp(@"
namespace NI
{
    public class Ni
    {
        public struct Nd { }
        public delegate void nd();
        public class C
        {
            public struct nD { }
            public class nd
            {
                public class CI { }
                public struct ci
                {
                    public int x;
                    public void X() { }
                }
                public interface Ci
                {
                    void foo();
                    void Foo();
                }
           }
        }
    }

    class NI
    {
        public class N
        {
        }
        public class n { }
    }
}
",
            GetCA1708CSharpResult(Type, GetSymbolDisplayString("NI.Ni", "NI.NI")),
            GetCA1708CSharpResultAt(Member, GetSymbolDisplayString("NI.Ni.Nd", "NI.Ni.nd"), 4, 18),
            GetCA1708CSharpResultAt(Member, GetSymbolDisplayString("NI.Ni.C.nD", "NI.Ni.C.nd"), 8, 22),
            GetCA1708CSharpResultAt(Member, GetSymbolDisplayString("NI.Ni.C.nd.CI", "NI.Ni.C.nd.ci", "NI.Ni.C.nd.Ci"), 11, 26),
            GetCA1708CSharpResultAt(Member, GetSymbolDisplayString("NI.Ni.C.nd.ci.x", "NI.Ni.C.nd.ci.X()"), 14, 31),
            GetCA1708CSharpResultAt(Member, GetSymbolDisplayString("NI.Ni.C.nd.Ci.foo()", "NI.Ni.C.nd.Ci.Foo()"), 19, 34));
        }

        [Fact]
        public void TestNestedTypeNamesWithScope()
        {
            VerifyCSharp(@"
using System;
namespace NI
{
    public class Ni
    {
        public struct Nd { }
        public delegate void nd();
        public class C
        {
            public struct nD { }
            public class nd
            {
                public class CI { }
                public struct ci
                {
                    public int x;
                    public void X() { }
                }
                public interface Ci
                {
                    void foo();
                    void Foo();
                }
           }
        }
    }

    [|class NI
    {
        public class N
        {
        }
        public class n { }
    }|]
}
",
            GetCA1708CSharpResult(Type, GetSymbolDisplayString("NI.Ni", "NI.NI")));
        }

        [Fact]
        public void TestMethodOverloads()
        {
            VerifyCSharp(@"
namespace NI
{
    public class C
    {
        public void foo() { }
        public void foo(int x) { }
        public void foo<T>(T x) { }
    }
}
");
        }

        [Fact]
        public void TestGenericMethods()
        {
            VerifyCSharp(@"
namespace NI
{
    public class C
    {
        public void foo() { }
        public void foO(int x) { }
        public void fOo(int x) { }
        public void FOO<T>(T x) { }
        public void fOo<T, X>(T x, X y) { }
    }
}
",
            GetCA1708CSharpResultAt(Member, GetSymbolDisplayString("NI.C.foo()", "NI.C.foO(int)", "NI.C.fOo(int)", "NI.C.FOO<T>(T)"), 4, 18));
        }

        [Fact]
        public void TestMembers()
        {
            VerifyCSharp(@"
namespace NI
{
    public class CASE1
    {
        public int Case1;
        void CAse1() { caSE1(); }
        public void CAse1(int x) { }
        public void CaSe1<T>(T x) { }
        public delegate void CASe1();
        public interface CasE1 { }
        public event CASe1 caSE1;
        public int CAsE1
        {
            get { return Case1; }
            set { Case1 = value; }
        }
        public CASE1() { }
        public int this[int x]
        {
            get { return x; }
            set { }
        }
        ~CASE1() { }
        static CASE1() { }
        public static int operator +(CASE1 y, int x) { return 1; }
    }
}
",
            GetCA1708CSharpResultAt(Member, GetSymbolDisplayStringNoSorting("NI.CASE1.CASe1", "NI.CASE1.CAsE1", "NI.CASE1.CAse1(int)", "NI.CASE1.CaSe1<T>(T)", "NI.CASE1.CasE1", "NI.CASE1.Case1", "NI.CASE1.caSE1"), 4, 18));
        }

        [Fact]
        public void TestCultureSpecificNames()
        {
            VerifyCSharp(@"
public class C
{
    public int γ;
    public int Γ;
}
",
            GetCA1708CSharpResultAt(Member, GetSymbolDisplayString("C.\u03B3", "C.\u0393"), 2, 14));
        }

        [Fact]
        public void TestParameters()
        {
            VerifyCSharp(@"
namespace N
{
    public class C
    {
        int x;
        public delegate void Delegate(int a, int A);
        public void Method(int b, int B) {}
        public C(int d, int D)
        {
        }
        public static int operator +(C e, int E) { return 1; }
        public int X
        {
            get { return x; }
            set { x = value; }
        }
        public int this[int f, int F]
        {
            get { return x; }
            set { }
        }
        public System.Action<int, int> action = (a, A) => { };
    }
    public partial class D
    {
    }
    public partial class D
    {
        public delegate void Foo(int x, int X);
    }
}
",
            GetCA1708CSharpResultAt(Parameter, "N.C.Delegate", 7, 30),
            GetCA1708CSharpResultAt(Parameter, "N.C.Method(int, int)", 8, 21),
            GetCA1708CSharpResultAt(Parameter, "N.C.C(int, int)", 9, 16),
            GetCA1708CSharpResultAt(Parameter, "N.C.operator +(N.C, int)", 12, 36),
            GetCA1708CSharpResultAt(Parameter, "N.C.this[int, int]", 18, 20),
            GetCA1708CSharpResultAt(Parameter, "N.D.Foo", 30, 30));
        }

        #endregion

        #region Helper Methods

        private const string RuleName = IdentifiersShouldDifferByMoreThanCaseAnalyzer.RuleId;
        private static readonly string s_message = MicrosoftApiDesignGuidelinesAnalyzersResources.IdentifiersShouldDifferByMoreThanCaseMessage;

        private const string Namespace = IdentifiersShouldDifferByMoreThanCaseAnalyzer.Namespace;
        private const string Type = IdentifiersShouldDifferByMoreThanCaseAnalyzer.Type;
        private const string Member = IdentifiersShouldDifferByMoreThanCaseAnalyzer.Member;
        private const string Parameter = IdentifiersShouldDifferByMoreThanCaseAnalyzer.Parameter;

        private static string GetSymbolDisplayString(params string[] objectName)
        {
            return string.Join(", ", objectName.OrderByDescending(x => x, StringComparer.InvariantCulture));
        }

        private static string GetSymbolDisplayStringNoSorting(params string[] objectName)
        {
            return string.Join(", ", objectName);
        }

        private static DiagnosticResult GetCA1708CSharpResult(string typeName, string objectName)
        {
            return GetGlobalResult(RuleName, string.Format(s_message, typeName, objectName));
        }

        private static DiagnosticResult GetCA1708CSharpResultAt(string typeName, string objectName, int line, int column)
        {
            return GetCSharpResultAt(line, column, RuleName, string.Format(s_message, typeName, objectName));
        }

        private static DiagnosticResult GetCA1708CSharpResultAt(string typeName, string objectName, params string[] locations)
        {
            return GetCSharpResultAt(RuleName, string.Format(s_message, typeName, objectName), locations);
        }

        #endregion
    }
}


text:
class Pixelpeeper < Cask
  version :latest
  sha256 :no_check

  url 'https://www.irradiatedsoftware.com/download/PixelPeeper.zip'
  appcast 'http://www.irradiatedsoftware.com/updates/profiles/pixelpeeper.php'
  homepage 'http://www.irradiatedsoftware.com/labs'
  license :unknown

  app 'PixelPeeper.app'
end


text:
package org.efaps.admin.user;

import java.io.Serializable;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.UUID;

import org.efaps.admin.AbstractAdminObject;
import org.efaps.admin.datamodel.Type;
import org.efaps.ci.CIAdminUser;
import org.efaps.db.Context;
import org.efaps.db.Instance;
import org.efaps.db.MultiPrintQuery;
import org.efaps.db.QueryBuilder;
import org.efaps.db.transaction.ConnectionResource;
import org.efaps.util.EFapsException;
import org.efaps.util.UUIDUtil;
import org.efaps.util.cache.CacheReloadException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

/**
 * @author The eFaps Team
 *
 */
public abstract class AbstractUserObject
    extends AbstractAdminObject
    implements Serializable
{
    /**
     * Needed for serialization.
     */
    private static final long serialVersionUID = 1L;

    /**
     * Logging instance used to give logging information of this class.
     */
    private static final Logger LOG = LoggerFactory.getLogger(AbstractUserObject.class);

    /**
     * Instance variable holding the Status (active, inactive).
     */
    private boolean status;

    /**
     * Constructor to set instance variables of the user object.
     *
     * @param _id       id to set
     * @param _uuid     uuid to set
     * @param _name     name to set
     * @param _status   status to set
     */
    protected AbstractUserObject(final long _id,
                                 final String _uuid,
                                 final String _name,
                                 final boolean _status)
    {
        super(_id, _uuid, _name);
        this.status = _status;
    }

    /**
     * Checks, if the given person is assigned to this user object. The method
     * must be overwritten by the special implementations.
     *
     * @param _person person to test
     * @return true if the person is assigned to this user object,
     *         otherwise false
     * @see #persons
     * @see #getPersons
     */
    public abstract boolean hasChildPerson(Person _person);

    /**
     * Checks, if the context user is assigned to this user object. The instance
     * method uses {@link #hasChildPerson} to test this.
     *
     * @see #hasChildPerson
     * @return true if person is assigned
     */
    public boolean isAssigned()
    {
        boolean ret = false;
        try {
            ret = hasChildPerson(Context.getThreadContext().getPerson());
        } catch (final EFapsException e) {
            AbstractUserObject.LOG.error("could not read Person ", e);
        }
        return ret;
    }

    /**
     * Assign this user object to the given JAAS system under the given JAAS
     * key.
     *
     * @param _jaasSystem   JAAS system to which the person is assigned
     * @param _jaasKey      key under which the person is know in the JAAS
     *                      system
     * @throws EFapsException if the assignment could not be made
     */
    @SuppressFBWarnings("SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING")
    public void assignToJAASSystem(final JAASSystem _jaasSystem,
                                   final String _jaasKey)
        throws EFapsException
    {
        Connection con = null;
        try {
            final Context context = Context.getThreadContext();
            con = Context.getConnection();
            final Type keyType = CIAdminUser.JAASKey.getType();

            PreparedStatement stmt = null;
            final StringBuilder cmd = new StringBuilder();
            try {
                long keyId = 0;
                if (Context.getDbType().supportsGetGeneratedKeys()) {
                    cmd.append("insert into ").append(keyType.getMainTable().getSqlTable())
                        .append("(JAASKEY,CREATOR,CREATED,MODIFIER,MODIFIED,").append("USERABSTRACT,USERJAASSYSTEM) ")
                                    .append("values (");
                } else {
                    keyId = Context.getDbType().getNewId(new ConnectionResource(con),
                                    keyType.getMainTable().getSqlTable(),
                                    "ID");
                    cmd.append("insert into ").append(keyType.getMainTable().getSqlTable()).append(
                                    "(ID,JAASKEY,CREATOR,CREATED,MODIFIER,MODIFIED,").append(
                                    "USERABSTRACT,USERJAASSYSTEM) ").append("values (").append(keyId).append(",");
                }
                cmd.append("'").append(_jaasKey).append("',").append(context.getPersonId()).append(",").append(
                                Context.getDbType().getCurrentTimeStamp()).append(",").append(context.getPersonId())
                                .append(",").append(Context.getDbType().getCurrentTimeStamp()).append(",").append(
                                                getId()).append(",").append(_jaasSystem.getId()).append(")");

                stmt = con.prepareStatement(cmd.toString());
                final int rows = stmt.executeUpdate();
                if (rows == 0) {
                    AbstractUserObject.LOG.error("could not execute '" + cmd.toString()
                            + "' for JAAS system '" + _jaasSystem.getName()
                            + "' for user object '" + toString() + "' with JAAS key '" + _jaasKey + "'");
                    throw new EFapsException(getClass(), "assignToJAASSystem.NotInserted", _jaasSystem.getName(),
                                    _jaasKey, toString());
                }
            } catch (final SQLException e) {
                AbstractUserObject.LOG.error("could not execute '" + cmd.toString()
                        + "' to assign user object '" + toString()
                        + "' with JAAS key '" + _jaasKey + "' to JAAS system '" + _jaasSystem.getName() + "'", e);
                throw new EFapsException(getClass(), "assignToJAASSystem.SQLException", e, cmd.toString(), _jaasSystem
                                .getName(), _jaasKey, toString());
            } finally {
                try {
                    if (stmt != null) {
                        stmt.close();
                    }
                    con.commit();
                } catch (final SQLException e) {
                    AbstractUserObject.LOG.error("Could not close a statement.", e);
                }
            }
        } finally {
            try {
                if (con != null && !con.isClosed()) {
                    con.close();
                }
            } catch (final SQLException e) {
                AbstractUserObject.LOG.error("Could not close a connection.", e);
            }
        }
    }

    /**
     * Assign this user object to the given user object for given JAAS system.
     *
     * @param _assignType   type used to assign (in other words the
     *                      relationship type)
     * @param _jaasSystem   JAAS system for which this user object is assigned
     *                      to the given object
     * @param _object user object to which this user object is assigned
     * @throws EFapsException if assignment could not be done
     */
    @SuppressFBWarnings("SQL_PREPARED_STATEMENT_GENERATED_FROM_NONCONSTANT_STRING")
    protected void assignToUserObjectInDb(final Type _assignType,
                                          final JAASSystem _jaasSystem,
                                          final AbstractUserObject _object)
        throws EFapsException
    {
        Connection con = null;
        try {
            final Context context = Context.getThreadContext();
            con = Context.getConnection();

            Statement stmt = null;
            final StringBuilder cmd = new StringBuilder();
            try {

                cmd.append("insert into ").append(_assignType.getMainTable().getSqlTable()).append("(");
                long keyId = 0;
                if (!Context.getDbType().supportsGetGeneratedKeys()) {
                    keyId = Context.getDbType().getNewId(new ConnectionResource(con),
                                    _assignType.getMainTable().getSqlTable(), "ID");
                    cmd.append("ID,");
                }
                cmd.append("TYPEID,CREATOR,CREATED,MODIFIER,MODIFIED,").append(
                                "USERABSTRACTFROM,USERABSTRACTTO,USERJAASSYSTEM) ").append("values (");
                if (keyId != 0) {
                    cmd.append(keyId).append(",");
                }
                cmd.append(_assignType.getId()).append(",").append(context.getPersonId()).append(",").append(
                                Context.getDbType().getCurrentTimeStamp()).append(",").append(context.getPersonId())
                                .append(",").append(Context.getDbType().getCurrentTimeStamp()).append(",").append(
                                                getId()).append(",").append(_object.getId()).append(",").append(
                                                _jaasSystem.getId()).append(")");

                stmt = con.createStatement();
                final int rows = stmt.executeUpdate(cmd.toString());
                if (rows == 0) {
                    AbstractUserObject.LOG.error("could not execute '" + cmd.toString()
                            + "' to assign user object '" + toString()
                            + "' to object '" + _object + "' for JAAS system '" + _jaasSystem + "' ");
                    throw new EFapsException(getClass(), "assignInDb.NotInserted", _jaasSystem.getName(), _object
                                    .getName(), getName());
                }
            } catch (final SQLException e) {
                AbstractUserObject.LOG.error("could not execute '" + cmd.toString()
                        + "' to assign user object '" + toString()
                        + "' to object '" + _object + "' for JAAS system '" + _jaasSystem + "' ", e);
                throw new EFapsException(getClass(), "assignInDb.SQLException", e, cmd.toString(), getName());
            } finally {
                try {
                    if (stmt != null) {
                        stmt.close();
                    }
                    con.commit();
                } catch (final SQLException e) {
                    AbstractUserObject.LOG.error("Could not close a statement.", e);
                }
            }

        } finally {
            try {
                if (con != null && !con.isClosed()) {
                    con.close();
                }
            } catch (final SQLException e) {
                AbstractUserObject.LOG.error("Could not close a connection.", e);
            }
        }
    }

    /**
     * Unassign this user object from the given user object for given JAAS
     * system.
     *
     * @param _unassignType type used to unassign (in other words the
     *            relationship type)
     * @param _jaasSystem JAAS system for which this user object is unassigned
     *            from given object
     * @param _object user object from which this user object is unassigned
     * @throws EFapsException if unassignment could not be done
     */
    protected void unassignFromUserObjectInDb(final Type _unassignType,
                                              final JAASSystem _jaasSystem,
                                              final AbstractUserObject _object)
        throws EFapsException
    {
        Connection con = null;
        try {
            con = Context.getConnection();
            Statement stmt = null;
            final StringBuilder cmd = new StringBuilder();
            try {
                cmd.append("delete from ").append(_unassignType.getMainTable().getSqlTable()).append(" ").append(
                                "where USERJAASSYSTEM=").append(_jaasSystem.getId()).append(" ").append(
                                "and USERABSTRACTFROM=").append(getId()).append(" ").append("and USERABSTRACTTO=")
                                .append(_object.getId());

                stmt = con.createStatement();
                stmt.executeUpdate(cmd.toString());

            } catch (final SQLException e) {
                AbstractUserObject.LOG.error("could not execute '" + cmd.toString()
                        + "' to unassign user object '" + toString()
                        + "' from object '" + _object + "' for JAAS system '" + _jaasSystem + "' ", e);
                throw new EFapsException(getClass(), "unassignFromUserObjectInDb.SQLException", e, cmd.toString(),
                                getName());
            } finally {
                try {
                    if (stmt != null) {
                        stmt.close();
                    }
                    con.commit();
                } catch (final SQLException e) {
                    AbstractUserObject.LOG.error("Could not close a statement.", e);
                }
            }
        } finally {
            try {
                if (con != null && !con.isClosed()) {
                    con.close();
                }
            } catch (final SQLException e) {
                throw new CacheReloadException("Cannot read a type for an attribute.", e);
            }
        }
    }

    /**
     * This is the getter method for the instance variable {@link #status}.
     *
     * @return value of instance variable {@link #status}
     */
    public boolean getStatus()
    {
        return this.status;
    }

    /**
     * This is the setter method for the instance variable {@link #status}.
     *
     * @param _status the status to set
     */
    public void setStatus(final boolean _status)
    {
        this.status = _status;
    }

    /**
     * Get the note belonging to this UserObject.
     * Careful. Executes Query against the Database and therefore might be slow.
     * @return the note belonging to the UserObject
     * @throws EFapsException on error during reading
     */
    public String getNote()
        throws EFapsException
    {
        String ret = "";
        final QueryBuilder queryBldr = new QueryBuilder(CIAdminUser.Abstract);
        queryBldr.addWhereAttrEqValue(CIAdminUser.Abstract.ID, getId());
        final MultiPrintQuery multi = queryBldr.getPrint();
        multi.addAttribute(CIAdminUser.Abstract.Note);
        if (multi.execute()) {
            multi.next();
            ret = multi.getAttribute(CIAdminUser.Abstract.Note);
        }
        return ret;
    }

    /**
     * Gets the single instance of AbstractUserObject.
     *
     * @return single instance of AbstractUserObject
     * @throws EFapsException the e faps exception
     */
    public abstract Instance getInstance()
        throws EFapsException;

    /**
     * Method to set the status of a UserObject in the eFaps Database.
     *
     * @param _status status to set
     * @throws EFapsException on error
     */
    protected void setStatusInDB(final boolean _status)
        throws EFapsException
    {
        Connection con = null;
        try {
            con = Context.getConnection();

            PreparedStatement stmt = null;
            final StringBuilder cmd = new StringBuilder();
            try {
                cmd.append(" update T_USERABSTRACT set STATUS=? where ID=").append(getId());
                stmt = con.prepareStatement(cmd.toString());
                stmt.setBoolean(1, _status);
                final int rows = stmt.executeUpdate();
                if (rows == 0) {
                    AbstractUserObject.LOG.error("could not execute '" + cmd.toString()
                            + "' to update status information for person '" + toString() + "'");
                    throw new EFapsException(getClass(), "setStatusInDB.NotUpdated", cmd.toString(), getName());
                }
            } catch (final SQLException e) {
                AbstractUserObject.LOG.error("could not execute '" + cmd.toString()
                        + "' to update status information for person '" + toString() + "'", e);
                throw new EFapsException(getClass(), "setStatusInDB.SQLException", e, cmd.toString(), getName());
            } finally {
                try {
                    if (stmt != null) {
                        stmt.close();
                    }
                    con.commit();
                } catch (final SQLException e) {
                    throw new EFapsException(getClass(), "setStatusInDB.SQLException", e, cmd.toString(), getName());
                }
            }
        } finally {
            try {
                if (con != null && !con.isClosed()) {
                    con.close();
                }
            } catch (final SQLException e) {
                throw new CacheReloadException("Cannot read a type for an attribute.", e);
            }
        }
    }

    /**
     * Returns for given parameter _uuid the instance of class
     * {@link AbstractUserObject}. The returned AbstractUserObject can be a
     * {@link Role}, {@link Group}, {@link Company}, {@link Consortium}
     * or {@link Person}. It is searched in the given sequence. User is searched last
     * due to the reason that it is the only object that is not always stored
     * in a cache an might produce queries against the DataBase
     *
     * @param _uuid UUID to search in the cache
     * @return instance of class {@link AbstractUserObject}
     * @throws EFapsException on error
     */
    public static AbstractUserObject getUserObject(final UUID _uuid)
        throws EFapsException
    {
        AbstractUserObject ret = Role.get(_uuid);
        if (ret == null) {
            ret = Group.get(_uuid);
        }
        if (ret == null) {
            ret = Company.get(_uuid);
        }
        if (ret == null) {
            ret = Consortium.get(_uuid);
        }
        if (ret == null) {
            ret = Person.get(_uuid);
        }
        return ret;
    }

    /**
     * Returns for given parameter _id the instance of class
     * {@link AbstractUserObject}. The returned AbstractUserObject can be a
     * {@link Role}, {@link Group}, {@link Company}, {@link Consortium}
     * or {@link Person}. It is searched in the given sequence. User is searched last
     * due to the reason that it is the only object that is not always stored
     * in a cache an might produce queries against the DataBase
     *
     * @param _id id to search in the cache
     * @return instance of class {@link AbstractUserObject}
     * @throws EFapsException on error
     */
    public static AbstractUserObject getUserObject(final long _id)
        throws EFapsException
    {
        AbstractUserObject ret = Role.get(_id);
        if (ret == null) {
            ret = Group.get(_id);
        }
        if (ret == null) {
            ret = Company.get(_id);
        }
        if (ret == null) {
            ret = Consortium.get(_id);
        }
        if (ret == null) {
            ret = Person.get(_id);
        }
        return ret;
    }

    /**
     * Returns for given parameter _name the instance of class
     * {@link AbstractUserObject}.The returned AbstractUserObject can be a
     * {@link Role}, {@link Group}, {@link Company}, {@link Consortium}
     * or {@link Person}. It is searched in the given sequence. User is searched
     * last due to the reason that it is the only object that is not always stored
     * in a cache an might produce queries against the DataBase
     *
     * @param _name name to search in the cache
     * @return instance of class {@link AbstractUserObject}
     * @throws EFapsException on error
     */
    public static AbstractUserObject getUserObject(final String _name)
        throws EFapsException
    {
        AbstractUserObject ret = UUIDUtil.isUUID(_name) ? Role.get(UUID.fromString(_name)) : Role.get(_name);
        if (ret == null) {
            ret = UUIDUtil.isUUID(_name) ? Group.get(UUID.fromString(_name)) : Group.get(_name);
        }
        if (ret == null) {
            ret = UUIDUtil.isUUID(_name) ? Company.get(UUID.fromString(_name)) : Company.get(_name);
        }
        if (ret == null) {
            ret = UUIDUtil.isUUID(_name) ? Consortium.get(UUID.fromString(_name)) : Consortium.get(_name);
        }
        if (ret == null) {
            ret = UUIDUtil.isUUID(_name) ? Person.get(UUID.fromString(_name)) : Person.get(_name);
        }
        return ret;
    }
}


text:
package com.vmware.vim25;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

/**
 *
Java class for StorageDrsDatacentersCannotShareDatastore complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="StorageDrsDatacentersCannotShareDatastore">
 *   <complexContent>
 *     <extension base="{urn:vim25}VimFault">
 *       <sequence>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "StorageDrsDatacentersCannotShareDatastore")
public class StorageDrsDatacentersCannotShareDatastore
    extends VimFault
{

}


text:
<!DOCTYPE html>

  <meta charset="UTF-8">
  <title>S.W.E.A.T</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
  <link href='https://fonts.googleapis.com/css?family=Montserrat|PT+Serif|Roboto+Condensed' rel='stylesheet'
        type='text/css'>
  <link rel="stylesheet" href="main.css">

S.W.E.A.T

Lorem Ipsum

        ENTER

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab aliquam autem cumque excepturi fugit hic itaque labore magni maxime nemo neque, nisi, pariatur quaerat quis reiciendis similique sint voluptates. Fugit.

Workout Generator

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias cupiditate dignissimos doloremque error, eum expedita nisi obcaecati qui ratione sint ut voluptate. Aliquid aut consequatur eaque facilis, in iure voluptatum.

        START

Workout Statistics

          Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusantium animi debitis dolor doloremque eum eveniet, exercitationem facilis fuga harum id in incidunt ipsum minima molestias neque officiis perspiciatis totam ut.

Features

Workout Generator

            Get Started

Workout Statistics

            Get Started

Timer

            Get Started

Item 1

Item 2

Item 3

Item 4

Item 5


text:
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Localization;
using Newtonsoft.Json.Linq;
using OrchardCore.Entities;
using OrchardCore.Workflows.Abstractions.Models;
using OrchardCore.Workflows.Models;

namespace OrchardCore.Workflows.Activities
{
    public interface IActivity : IEntity
    {
        string Name { get; }
        LocalizedString DisplayText { get; }
        LocalizedString Category { get; }
        new JObject Properties { get; set; }
        bool HasEditor { get; }

        /// <summary>
        /// List of possible outcomes when the activity is executed.
        /// </summary>
        IEnumerable<Outcome> GetPossibleOutcomes(WorkflowExecutionContext workflowContext, ActivityContext activityContext);

        /// <summary>
        /// Whether the activity can transition to the next outcome. Can prevent the activity from being transitioned
        /// because a condition is not valid.
        /// </summary>
        Task<bool> CanExecuteAsync(WorkflowExecutionContext workflowContext, ActivityContext activityContext);

        /// <summary>
        /// Executes the specified activity.
        /// </summary>
        Task<ActivityExecutionResult> ExecuteAsync(WorkflowExecutionContext workflowContext, ActivityContext activityContext);

        /// <summary>
        /// Resumes the specified activity.
        /// </summary>
        Task<ActivityExecutionResult> ResumeAsync(WorkflowExecutionContext workflowContext, ActivityContext activityContext);

        /// <summary>
        /// Executes before a workflow starts or resumes, giving activities an opportunity to read and store any values of interest.
        /// </summary>
        Task OnInputReceivedAsync(WorkflowExecutionContext workflowContext, IDictionary<string, object> input);

        /// <summary>
        /// Called on each activity when a workflow is about to start.
        /// </summary>
        Task OnWorkflowStartingAsync(WorkflowExecutionContext context, CancellationToken cancellationToken = default(CancellationToken));

        /// <summary>
        /// Called on each activity when a workflow has started.
        /// </summary>
        Task OnWorkflowStartedAsync(WorkflowExecutionContext context);

        /// <summary>
        /// Called on each activity when a workflow is about to be resumed.
        /// </summary>
        Task OnWorkflowResumingAsync(WorkflowExecutionContext context, CancellationToken cancellationToken = default(CancellationToken));

        /// <summary>
        /// Called on each activity when a workflow is resumed.
        /// </summary>
        Task OnWorkflowResumedAsync(WorkflowExecutionContext context);

        /// <summary>
        /// Called on each activity when an activity is about to be executed.
        /// </summary>
        Task OnActivityExecutingAsync(WorkflowExecutionContext workflowContext, ActivityContext activityContext, CancellationToken cancellationToken = default(CancellationToken));

        /// <summary>
        /// Called on each activity when an activity has been executed.
        /// </summary>
        Task OnActivityExecutedAsync(WorkflowExecutionContext workflowContext, ActivityContext activityContext);
    }
}


text:
<?xml version="1.0" encoding="UTF-8" ?>
<module>
	<name>producttooltip</name>
	<displayName><![CDATA[Product tooltips]]></displayName>
	<version><![CDATA[1.1]]></version>
	<description><![CDATA[Shows information on a product page: how many people are viewing it, the last time it was sold and the last time it was added to a cart.]]></description>
	<author><![CDATA[PrestaShop]]></author>
	<tab><![CDATA[front_office_features]]></tab>
	<is_configurable>1</is_configurable>
	<need_instance>0</need_instance>
	<limited_countries></limited_countries>
</module>


text:
<?php

namespace PedroTroller\ApiDoc\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;

class NelmioPass implements CompilerPassInterface
{
    /**
     * {@inheritdoc}
     */
    public function process(ContainerBuilder $container)
    {
        $extractor = $container->getDefinition('nelmio_api_doc.extractor.api_doc_extractor');
        $extractor->addMethodCall('setRouteDescriptionBuilder', array(new Reference('api_doc.route.description_builder')));
    }
}


text:
package com.twitter.penguin.korean.util

import java.io.InputStream
import java.util.zip.GZIPInputStream

import com.twitter.penguin.korean.util.KoreanConjugation._
import com.twitter.penguin.korean.util.KoreanPos._

import scala.collection.JavaConversions._
import scala.io.Source

/**
 * Provides a singleton Korean dictionary
 */
object KoreanDictionaryProvider {
  private[this] def readStreamByLine(stream: InputStream, filename: String): Iterator[String] = {
    require(stream != null, "Resource not loaded: " + filename)
    Source.fromInputStream(stream)(io.Codec("UTF-8"))
        .getLines()
        .map(_.trim)
        .filter(_.length > 0)
  }

  private[this] def readWordFreqs(filename: String): collection.mutable.Map[CharSequence, Float] = {
    var freqMap: collection.mutable.Map[CharSequence, Float] =
      new java.util.HashMap[CharSequence, Float]

    readFileByLineFromResources(filename).foreach {
      case line => if (line.contains("\t")) {
        val data = line.split("\t")
        freqMap += (data(0) -> data(1).slice(0, 6).toFloat)
      }
    }
    freqMap
  }

  private[this] def readWordMap(filename: String): Map[String, String] = {
    readFileByLineFromResources(filename).filter {
      case line: String => line.contains(" ")
    }.map {
      case line =>
        val data = line.split(" ")
        (data(0), data(1))
    }.toMap
  }

  protected[korean] def readWordsAsSeq(filename: String): Seq[String] =
    readFileByLineFromResources(filename).toSeq

  protected[korean] def readWordsAsSet(filenames: String*): Set[String] = {
    filenames.foldLeft(Set[String]()) {
      case (output: Set[String], filename: String) =>
        output.union(
          readFileByLineFromResources(filename).toSet
        )
    }
  }

  protected[korean] def readWords(filenames: String*): CharArraySet = {
    val set = newCharArraySet
    filenames.foreach(
      filename => readFileByLineFromResources(filename).foreach(set.add)
    )
    set
  }

  protected[korean] def readFileByLineFromResources(filename: String): Iterator[String] = {
    readStreamByLine(
      if (filename.endsWith(".gz")) {
        new GZIPInputStream(getClass.getResourceAsStream(filename))
      } else {
        getClass.getResourceAsStream(filename)
      }
      , filename
    )
  }

  protected[korean] def newCharArraySet: CharArraySet = {
    new CharArraySet(10000, false)
  }

  lazy val koreanEntityFreq: collection.mutable.Map[CharSequence, Float] =
    readWordFreqs("freq/entity-freq.txt.gz")

  def addWordsToDictionary(pos: KoreanPos, words: Seq[String]): Unit = {
    koreanDictionary(pos).addAll(words)
  }

  val koreanDictionary: collection.mutable.Map[KoreanPos, CharArraySet] = {
    val map: collection.mutable.Map[KoreanPos, CharArraySet] =
      new java.util.HashMap[KoreanPos, CharArraySet]

    map += Noun -> readWords(
      "noun/nouns.txt", "noun/entities.txt", "noun/spam.txt",
      "noun/names.txt", "noun/twitter.txt", "noun/lol.txt",
      "noun/slangs.txt", "noun/company_names.txt",
      "noun/foreign.txt", "noun/geolocations.txt", "noun/profane.txt",
      "substantives/given_names.txt", "noun/kpop.txt", "noun/bible.txt",
      "noun/pokemon.txt", "noun/congress.txt", "noun/wikipedia_title_nouns.txt"
    )
    map += Verb -> conjugatePredicatesToCharArraySet(readWordsAsSet("verb/verb.txt"))
    map += Adjective -> conjugatePredicatesToCharArraySet(readWordsAsSet("adjective/adjective.txt"), isAdjective = true)
    map += Adverb -> readWords("adverb/adverb.txt")
    map += Determiner -> readWords("auxiliary/determiner.txt")
    map += Exclamation -> readWords("auxiliary/exclamation.txt")
    map += Josa -> readWords("josa/josa.txt")
    map += Eomi -> readWords("verb/eomi.txt")
    map += PreEomi -> readWords("verb/pre_eomi.txt")
    map += Conjunction -> readWords("auxiliary/conjunctions.txt")
    map += NounPrefix -> readWords("substantives/noun_prefix.txt")
    map += VerbPrefix -> readWords("verb/verb_prefix.txt")
    map += Suffix -> readWords("substantives/suffix.txt")
    map
  }

  lazy val spamNouns = readWords("noun/spam.txt", "noun/profane.txt")

  val properNouns: CharArraySet = readWords("noun/entities.txt",
    "noun/names.txt", "noun/twitter.txt", "noun/lol.txt", "noun/company_names.txt",
    "noun/foreign.txt", "noun/geolocations.txt",
    "substantives/given_names.txt", "noun/kpop.txt", "noun/bible.txt",
    "noun/pokemon.txt", "noun/congress.txt", "noun/wikipedia_title_nouns.txt")

  lazy val nameDictionary = Map(
    'family_name -> readWords("substantives/family_names.txt"),
    'given_name -> readWords("substantives/given_names.txt"),
    'full_name -> readWords("noun/kpop.txt", "noun/foreign.txt", "noun/names.txt")
  )

  lazy val typoDictionaryByLength = readWordMap("typos/typos.txt").groupBy {
    case (key: String, value: String) => key.length
  }

  lazy val predicateStems = {
    def getConjugationMap(words: Set[String], isAdjective: Boolean): Map[String, String] = {
      words.flatMap {
        word: String => conjugatePredicated(Set(word), isAdjective).map {
          conjugated => (conjugated.toString, word + "다")
        }
      }.toMap
    }

    Map(
      Verb -> getConjugationMap(readWordsAsSet("verb/verb.txt"), isAdjective = false),
      Adjective -> getConjugationMap(readWordsAsSet("adjective/adjective.txt"), isAdjective = true)
    )
  }
}


text:
class SessionsController < ApplicationController

  def index
  end

  def new
  end

  def create
    user = User.find_by_email(params[:session][:email].downcase)

    if user && user.authenticate(params[:session][:password])
      sign_in user
      redirect_to user
    elsif user.nil?
      render 'users/new'
    else
      render 'sessions/new'
    end

  end

  def destroy
    sign_out
    redirect_to root_url
  end

end


text:
using System;
using System.Drawing;
using System.Windows.Forms;

using BizHawk.Emulation.Common;
using BizHawk.Client.Common;

namespace BizHawk.Client.EmuHawk
{
	public partial class MacroInputTool
	{
		private CheckBox[] _buttonBoxes;
		private void SetUpButtonBoxes()
		{
			ControllerDefinition def = Global.Emulator.ControllerDefinition;
			int count = def.BoolButtons.Count + def.FloatControls.Count;
			_buttonBoxes = new CheckBox[count];

			for (int i = 0; i < def.FloatControls.Count; i++)
			{
				CheckBox box = new CheckBox();
				box.Text = def.FloatControls[i];
				_buttonBoxes[i] = box;
			}
			for (int i = 0; i < def.BoolButtons.Count; i++)
			{
				CheckBox box = new CheckBox();
				box.Text = def.BoolButtons[i];
				_buttonBoxes[i + def.FloatControls.Count] = box;
			}

			for (int i = 0; i < _buttonBoxes.Length; i++)
			{
				_buttonBoxes[i].Parent = this;
				_buttonBoxes[i].AutoSize = true;
				_buttonBoxes[i].Checked = true;
				_buttonBoxes[i].CheckedChanged += ButtonBox_CheckedChanged;
			}

			PositionBoxes();
		}

		private bool _setting = false;
		private void ButtonBox_CheckedChanged(object sender, EventArgs e)
		{
			if (selectedZone == null || _setting)
				return;

			CheckBox s = sender as CheckBox;
			s.ForeColor = s.Checked ? SystemColors.ControlText : SystemColors.ButtonShadow;
			s.Refresh();

			// Update the selected zone's key
			var lg = Global.MovieSession.LogGeneratorInstance() as Bk2LogEntryGenerator;
			lg.SetSource(Global.MovieSession.MovieControllerAdapter);
			string key = lg.GenerateLogKey();
			key = key.Replace("LogKey:", "").Replace("#", "");

			for (int i = 0; i < _buttonBoxes.Length; i++)
			{
				if (!_buttonBoxes[i].Checked)
					key = key.Replace(_buttonBoxes[i].Text + "|", "");
			}
			key = key.Substring(0, key.Length - 1);

			selectedZone.InputKey = key;
		}
		private void SetButtonBoxes()
		{
			if (selectedZone == null)
				return;

			_setting = true;
			for (int i = 0; i < _buttonBoxes.Length; i++)
				_buttonBoxes[i].Checked = selectedZone.InputKey.Contains(_buttonBoxes[i].Text);
			_setting = false;
		}

		private void PositionBoxes()
		{
			int X = this.ClientSize.Width - 3;
			int Y = this.ClientSize.Height - _buttonBoxes[0].Height - 3;

			for (int i = _buttonBoxes.Length - 1; i >= 0; i--)
			{
				X -= _buttonBoxes[i].Width;
				if (X <= 3)
				{
					X = this.ClientSize.Width - 3 - _buttonBoxes[i].Width;
					Y -= (_buttonBoxes[0].Height + 6);
				}

				_buttonBoxes[i].Location = new Point(X, Y);
			}
		}
		private void MacroInputTool_Resize(object sender, EventArgs e)
		{
			if (_initializing)
				return;

			PositionBoxes();
		}

	}
}


text:
using System;
using System.ComponentModel;
using System.Windows.Controls;
using System.Windows.Input;
using SilverlightMappingToolBasic.UI.SuperGraph.ViewModel;
using System.Windows;
using SilverlightMappingToolBasic.UI.ViewModel;

namespace SilverlightMappingToolBasic.UI.SuperGraph.View.BreadcrumbSupportClasses
{
    public partial class BreadcrumbControl : UserControl
    {

        public IBreadcrumbItem BreadcrumbData
        {
            get
            {
                return DataContext as IBreadcrumbItem;
            }
        }

        public event EventHandler PropertiesClicked;
        public event EventHandler<BreadcrumbChangedEventArgs> BreadcrumbChanged;
        public event EventHandler BreadcrumbClicked;

        public BreadcrumbControl()
        {
            InitializeComponent();
            DataContextChanged += OnDataContextChanged;
            MapList.SelectionChanged += MapList_SelectionChanged;
            MapList.BreadcrumbClicked += TextBlock_MouseLeftButtonUp;
            MapList.PropertiesClicked += Image_MouseLeftButtonUp;
            TextBlock.BreadcrumbClicked += TextBlock_MouseLeftButtonUp;
            TextBlock.PropertiesClicked += Image_MouseLeftButtonUp;
        }

        private void OnDataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            var value = e.NewValue as IBreadcrumbItem;
            if (value != null)
            {
                if (value is MultiBreadcrumbItem)
                {
                    TextBlock.Visibility = Visibility.Collapsed;
                    MapList.Visibility = Visibility.Visible;
                    MapList.DataContext = null;
                    MapList.DataContext = value;
                }

                var item = value as BreadcrumbItem;
                if (item != null)
                {
                    item.PropertyChanged += OnPropertyChanged;
                    TextBlock.BreadcrumbText = value.Name;
                    TextBlock.PropertiesVisibility = value.PropertiesVisibility;
                }

            }
        }

        private void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            switch (e.PropertyName)
            {
                case "PropertiesVisibility":
                    TextBlock.PropertiesVisibility = BreadcrumbData.PropertiesVisibility;
                    break;
                case "Name":
                    TextBlock.BreadcrumbText = BreadcrumbData.Name;
                    break;
                case "Items":
                    MapList.DataContext = null;
                    MapList.DataContext = DataContext;
                    break;
            }
        }

        private void TextBlock_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            e.Handled = true;

            if (BreadcrumbClicked != null)
            {
                BreadcrumbClicked(this, new EventArgs());
            }
        }

        private void Image_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            e.Handled = true;

            if (PropertiesClicked != null)
            {
                PropertiesClicked(this, new EventArgs());
            }
        }

        private void MapList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var mapList = sender as ComboBox;
            if (mapList != null && BreadcrumbChanged != null)
            {
                var item = mapList.SelectedItem as ComboBoxItem;

                if (item != null)
                {
                    var multiBreadcrumb = BreadcrumbData as MultiBreadcrumbItem;
                    if (multiBreadcrumb != null)
                    {
                        RaiseBreadcrumbChangedEvent(multiBreadcrumb, item.DataContext as IBreadcrumbItem);
                    }

                }
            }
        }

        private void RaiseBreadcrumbChangedEvent(MultiBreadcrumbItem breadcrumb, IBreadcrumbItem item)
        {
            breadcrumb.SelectedBreadcrumb = item;
            BreadcrumbChanged(this, new BreadcrumbChangedEventArgs { NewItem = breadcrumb.SelectedBreadcrumb });
        }
    }
}


text:
/*!
  \class SoSFVec2d SoSFVec2d.h Inventor/fields/SoSFVec2d.h
  \brief The SoSFVec2d class is a container for an SbVec2d vector.
  \ingroup fields

  This field is used where nodes, engines or other field containers
  needs to store a single vector with two elements.

  \sa SbVec2d, SoMFVec2d
  \COIN_CLASS_EXTENSION
  \since Coin 2.5
*/

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

#include <Inventor/fields/SoSFVec2d.h>

#include <Inventor/SoInput.h>
#include <Inventor/SoOutput.h>
#include <Inventor/errors/SoDebugError.h>

#include "fields/SoSubFieldP.h"
#include "fields/shared.h"

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

SO_SFIELD_SOURCE(SoSFVec2d, SbVec2d, const SbVec2d &);

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

// Override from parent class.
void
SoSFVec2d::initClass(void)
{
  SO_SFIELD_INTERNAL_INIT_CLASS(SoSFVec2d);
}

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

// No need to document readValue() and writeValue() here, as the
// necessary information is provided by the documentation of the
// parent classes.
#ifndef DOXYGEN_SKIP_THIS

SbBool
SoSFVec2d::readValue(SoInput * in)
{
  return
    in->read(this->value[0]) &&
    in->read(this->value[1]);
}

void
SoSFVec2d::writeValue(SoOutput * out) const
{
  sosfvec2d_write_value(out, this->getValue());
}

#endif // DOXYGEN_SKIP_THIS

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

/*!
  Set value of vector.
*/
void
SoSFVec2d::setValue(double x, double y)
{
  this->setValue(SbVec2d(x, y));
}

/*!
  Set value of vector.
*/
void
SoSFVec2d::setValue(const double xy[2])
{
  this->setValue(SbVec2d(xy));
}

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

#ifdef COIN_TEST_SUITE

BOOST_AUTO_TEST_CASE(initialized)
{
  SoSFVec2d field;
  BOOST_CHECK_MESSAGE(SoSFVec2d::getClassTypeId() != SoType::badType(),
                      "SoSFVec2d class not initialized");
  BOOST_CHECK_MESSAGE(field.getTypeId() != SoType::badType(),
                      "missing class initialization");
}

#endif // COIN_TEST_SUITE


text:
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE QuasiQuotes #-}
module NixFromNpm.Git.Types where

import Data.Aeson
import Data.Aeson.Types (Parser, typeMismatch)
import Data.HashMap.Strict (HashMap)
import qualified Data.HashMap.Strict as H
import qualified Data.Text as T
import Text.Regex.PCRE.Heavy (Regex, scan, re)

import NixFromNpm.Common

data Commit = Commit {
  cSha :: Text,
  cUrl :: Text
  } deriving (Show, Eq)

data Tag = Tag {
  tName :: Name,
  tCommit :: Commit
  } deriving (Show, Eq)

data Branch = Branch {
  bName :: Name,
  bCommit :: Commit
  } deriving (Show, Eq)

data Repo = Repo {
  rName :: Name,
  rDefaultBranch :: Name
  } deriving (Show, Eq)

-- | A git ref might be a commit hash, or something that could be anything.
data GitRef
  = SomeRef Text -- ^ Case where it's not yet known
  | BranchName Name
  | TagName Name
  | CommitHash Text
  deriving (Show, Eq, Ord)

instance IsString GitRef where
  fromString = SomeRef . fromString

refText :: GitRef -> Text
refText (SomeRef r) = r
refText (CommitHash h) = h

-- | Various public git hosting services that nixfromnpm is aware of
data GitSource
  = Github
  | Bitbucket
  | Gist
  | GitLab
  deriving (Show, Eq, Ord, Enum)

-- | Represents a git repo at a particular commit.
data GitIdentifier = GitId {
  giSource::GitSource,
  giOwner::Name,
  giRepo::Name,
  giRef:: Maybe GitRef
  } deriving (Eq, Ord)

instance Show GitIdentifier where
  show (GitId source account repo ref) = do
    let ref' = case ref of
          Nothing -> ""
          Just r -> "#" <> refText r
        proto = toLower (show source) <> "://"
    proto <> unpack (account <> "/" <> repo <> ref')

data GithubError
  = GithubUnreachable
  | InvalidJsonFromGithub Text
  | InvalidGitRef GitRef
  | InvalidGithubUri URI
  | NoSuchRepo Name Name
  deriving (Show, Eq, Typeable)

instance Exception GithubError

instance FromJSON Commit where
  parseJSON = getObject "commit info" >=> \o -> do
    sha <- o .: "sha"
    url <- o .: "url"
    return $ Commit sha url

instance FromJSON Tag where
  parseJSON = getObject "tag info" >=> \o -> do
    name <- o .: "name"
    commit <- o .: "commit"
    return $ Tag name commit

instance FromJSON Branch where
  parseJSON = getObject "branch info" >=> \o -> do
    name <- o .: "name"
    commit <- o .: "commit"
    return $ Branch name commit

instance FromJSON Repo where
  parseJSON = getObject "repo info" >=> \o -> do
    name <- o .: "name"
    defaultBranch <- o .: "default_branch"
    return $ Repo name defaultBranch

getObject :: String -> Value -> Parser (HashMap Text Value)
getObject _ (Object o) = return o
getObject msg v =
  typeMismatch ("object (got " <> show v <> ", message " <> msg <> ")") v

-- | Convert a vector of tags to a hashmap mapping tag names to SHAs.
tagListToMap :: Vector Tag -> Record Text
tagListToMap tags = foldl' step mempty tags where
  step result tag = H.insert (tName tag) (cSha $ tCommit tag) result

-- | Read a git source from a URI server name.
sourceFromServer :: String -> Maybe GitSource
sourceFromServer regname
  | "github.com" `isInfixOf` regname = Just Github
  | "bitbucket.com" `isInfixOf` regname = Just Bitbucket
  | "gist" `isInfixOf` regname = Just Gist
  | "gitlab.com" `isInfixOf` regname = Just GitLab
  | otherwise = Nothing

-- | Get the repo owner and repo name from a URI path.
ownerRepoFromPath :: String -> Maybe (Name, Name)
ownerRepoFromPath path = case scan [re|^/([\w_-]+)/([\w_-]+)$|] $ pack path of
  [(_, [owner, repo])] -> Just (owner, repo)
  _ -> Nothing

-- | Parse a git ref from a URI fragment.
refFromFragment :: String -> Maybe GitRef
refFromFragment ('#':frag) = Just $ SomeRef $ pack frag
refFromFragment _ = Nothing

class IsGitId t where
  parseGitId :: t -> Maybe GitIdentifier

instance IsGitId GitIdentifier where
  parseGitId = Just

instance IsGitId URI where
  parseGitId uri = case uri of
    -- In order to determine which git service this is, we need to
    -- examine the uri authority (which contains the server info).
    -- If that's not there this isn't a git identifier.
    URI _ Nothing _ _ _ -> Nothing
    URI scheme (Just (URIAuth _ regname _)) path _ fragment -> do
      source <- sourceFromServer regname
      (owner, repo) <- ownerRepoFromPath path
      return $ GitId source owner repo (refFromFragment fragment)

instance IsGitId String where
  -- | Github URLs are a special case of git URLs; they can be specified
  -- simply by owner/repo or owner/repo#ref
  parseGitId str = case scan githubIdRegex str of
    [(_, [owner, repo])] -> do
      return $ GitId Github (pack owner) (pack repo) Nothing
    [(_, [owner, repo, '#':ref])] -> do
      return $ GitId Github (pack owner) (pack repo) $ Just $ fromString ref
    _ -> do
      parseGitId =<< parseURI str
    where
      githubIdRegex = [re|^([\w._-]+)/([\w._-]+)(\#[^\s]+)?$|]