text:
using System.Collections.Generic;
using System.ComponentModel;
using YamlDotNet.Serialization;

namespace PaletteInsightAgent
{

    #region PaletteInsight.Conf description

    namespace Configuration
    {
        // Where the default value of a property is different than the default of its type
        // (like 0 for int or "" for string or null for object) we signal our default
        // value through [DefaultValue()] attribute, so that the YML parser won't write
        // the default values during serialization. And this way we are free to change
        // the default values in the future.

        public class DatabaseConfig
        {
            [DefaultValue("workgroup")]
            [YamlMember(Alias = "Database")]
            public string Database { get; set; } = "workgroup";

            [DefaultValue("localhost")]
            [YamlMember(Alias = "Host")]
            public string Host { get; set; } = "localhost";

            [DefaultValue(8060)]
            [YamlMember(Alias = "Port")]
            public int Port { get; set; } = 8060;

            [DefaultValue("readonly")]
            [YamlMember(Alias = "User")]
            public string User { get; set; } = "readonly";

            [YamlMember(Alias = "Password")]
            public string Password { get; set; }

            [YamlMember(Alias = "CommandTimeout")]
            public int CommandTimeout { get; set; }
        }

        public class LogFolder
        {
            [YamlMember(Alias = "Directory")]
            public string Directory { get; set; }

            [YamlMember(Alias = "Filter")]
            public string Filter { get; set; }

            [YamlMember(Alias = "Format")]
            //public string Format { get; set; } = "json";
            // Until the Talend side is not updated, the default format name should remain "server"
            public string Format { get; set; } = "server";
        }

        public class ProcessData
        {
            [YamlMember(Alias = "Name")]
            public string Name { get; set; }

            [YamlMember(Alias = "Granularity")]
            public string Granularity { get; set; } = "Process";
        }

        public class RepoTable
        {
            [YamlMember(Alias = "Name")]
            public string Name { get; set; }

            [YamlMember(Alias = "Full")]
            public bool Full { get; set; } = true;

            [YamlMember(Alias = "Field")]
            public string Field { get; set; }

            [YamlMember(Alias = "Filter")]
            public string Filter { get; set; }

            [YamlMember(Alias = "HistoryNeeded")]
            public bool HistoryNeeded { get; set; } = false;
        }

        public class Webservice
        {
            [YamlMember(Alias = "Endpoint")]
            public string Endpoint { get; set; }

            [YamlMember(Alias = "UseProxy")]
            public bool UseProxy { get; set; } = false;

            [DefaultValue("")]
            [YamlMember(Alias = "ProxyAddress")]
            public string ProxyAddress { get; set; } = "";

            [DefaultValue("")]
            [YamlMember(Alias = "ProxyUsername")]
            public string ProxyUsername { get; set; }

            [DefaultValue("")]
            [YamlMember(Alias = "ProxyPassword")]
            public string ProxyPassword { get; set; }
        }

        public class PaletteInsightConfiguration
        {
            [DefaultValue(30)]
            [YamlMember(Alias = "PollInterval")]
            public int PollInterval { get; set; } = 30;

            [DefaultValue(15)]
            [YamlMember(Alias = "ThreadInfoPollInterval")]
            public int ThreadInfoPollInterval { get; set; } = 15;

            [DefaultValue(10)]
            [YamlMember(Alias = "UploadInterval")]
            public int UploadInterval { get; set; } = 10; // Every ten seconds

            [DefaultValue(3600)]
            [YamlMember(Alias = "RepoTablesPollInterval")]
            public int RepoTablesPollInterval { get; set; } = 3600; // Hourly

            [DefaultValue(600)]
            [YamlMember(Alias = "StreamingTablesPollInterval")]
            public int StreamingTablesPollInterval { get; set; } = 600; // 10 minutes

            [DefaultValue(true)]
            [YamlMember(Alias = "PreferPassiveRepository")]
            public bool PreferPassiveRepository { get; set; } = true;   // Poll passive Tableau repository if it exists by default

            [YamlMember(Alias = "ProcessedFilesTTL")]
            public int ProcessedFilesTTL { get; set; } = 0; // Default is delete immediately

            [DefaultValue(10 * 1024)]
            [YamlMember(Alias = "StorageLimit")]
            public int StorageLimit { get; set; } = 10 * 1024; // Default is 10 GB. This value is given in megabytes.

            [DefaultValue(300)]
            [YamlMember(Alias = "LogPollInterval")]
            public int LogPollInterval { get; set; } = 300;

            [DefaultValue(true)]
            [YamlMember(Alias = "AllProcesses")]
            public bool AllProcesses { get; set; } = true;

            [YamlMember(Alias = "InsightAuthToken")]
            public string InsightAuthToken { get; set; }

            [YamlMember(Alias = "Webservice")]
            public Webservice Webservice { get; set; }

            [YamlMember(Alias = "Logs")]
            public List<LogFolder> Logs { get; set; }

            [YamlMember(Alias = "TableauRepo")]
            public DatabaseConfig TableauRepo { get; set; }

            // Log polling options

            [DefaultValue(true)]
            [YamlMember(Alias = "UseCounterSamples")]
            public bool UseCounterSamples { get; set; } = true;

            [DefaultValue(true)]
            [YamlMember(Alias = "UseThreadInfo")]
            public bool UseThreadInfo { get; set; } = true;

            [DefaultValue(true)]
            [YamlMember(Alias = "UseLogPolling")]
            public bool UseLogPolling { get; set; } = true;

            [DefaultValue(true)]
            [YamlMember(Alias = "UseRepoPolling")]
            public bool UseRepoPolling { get; set; } = true;

            /// <summary>
            /// The maximum lines to be parsed in a batch from a log file
            /// </summary>
            [DefaultValue(10000)]
            [YamlMember(Alias = "LogLinesPerBatch")]
            public int LogLinesPerBatch { get; set; } = 10000;

            /// <summary>
            /// The maximum records to be read in a batch from a streaming table
            /// </summary>
            [DefaultValue(100000)]
            [YamlMember(Alias = "StreamingTablesPollLimit")]
            public int StreamingTablesPollLimit { get; set; } = 100000;
        }

        #endregion
    }

}


text:
package com.forestry.controller.sys;

import java.io.IOException;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.forestry.core.ForestryBaseController;
import com.forestry.model.sys.Config;
import com.forestry.service.sys.ConfigService;

import core.extjs.ExtJSBaseParameter;
import core.extjs.ListView;
import core.support.Item;
import core.support.QueryResult;
import core.web.SystemCache;

/**
 * @author Yang Tian
 * @email 1298588579@qq.com
 */
@Controller
@RequestMapping("/sys/config")
public class ConfigController extends ForestryBaseController<Config> {

	private static final Logger log = Logger.getLogger(ConfigController.class);

	@Resource
	private ConfigService configService;

	@RequestMapping("/getConfigTypeName")
	public void getConfigTypeName(HttpServletRequest request, HttpServletResponse response) throws Exception {
		JSONArray jsonArray = new JSONArray();
		for (Map.Entry<String, Item> configTypeMap : SystemCache.DICTIONARY.get("CONFIG_TYPE").getItems().entrySet()) {
			Item item = configTypeMap.getValue();
			JSONObject jsonObject = new JSONObject();
			jsonObject.element("ItemText", item.getValue());
			jsonObject.element("ItemValue", item.getKey());
			jsonArray.add(jsonObject);
		}
		JSONObject resultJSONObject = new JSONObject();
		resultJSONObject.element("list", jsonArray);
		writeJSON(response, resultJSONObject);
	}

	@Override
	@RequestMapping(value = "/saveConfig", method = { RequestMethod.POST, RequestMethod.GET })
	public void doSave(Config entity, HttpServletRequest request, HttpServletResponse response) throws IOException {
		ExtJSBaseParameter parameter = ((ExtJSBaseParameter) entity);
		Config checkConfigType = configService.getByProerties("configType", entity.getConfigType());
		if (null != checkConfigType && null == entity.getId()) {
			parameter.setSuccess(false);
		} else {
			if (CMD_EDIT.equals(parameter.getCmd())) {
				configService.update(entity);
			} else if (CMD_NEW.equals(parameter.getCmd())) {
				configService.persist(entity);
			}
			commonConfig();
			parameter.setCmd(CMD_EDIT);
			parameter.setSuccess(true);
		}
		writeJSON(response, parameter);
	}

	private void commonConfig() {
		try {
			HttpClient client = new HttpClient();
			client.getHttpConnectionManager().getParams().setConnectionTimeout(5000);//设置连接超时时间为5秒(连接初始化时间)
			GetMethod method = new GetMethod("http://192.168.1.86:27730/sensor/cfg?missingthreshold=90");
			int statusCode = client.executeMethod(method);//状态,一般200为OK状态,其他情况会抛出如404,500,403等错误
			if (statusCode != HttpStatus.SC_OK) {
				log.error("失踪警报设置的HTTP GET访问失败!");
			}
			log.info("失踪警报设置的HTTP GET访问结果:" + method.getResponseBodyAsString());
			client.getHttpConnectionManager().closeIdleConnections(1);
		} catch (Exception e) {
			log.error(e.getMessage());
		}
	}

	@RequestMapping(value = "/getConfig")
	public void getConfig(HttpServletRequest request, HttpServletResponse response) throws Exception {
		Integer firstResult = Integer.valueOf(request.getParameter("start"));
		Integer maxResults = Integer.valueOf(request.getParameter("limit"));
		String sortedObject = null;
		String sortedValue = null;
		List<LinkedHashMap<String, Object>> sortedList = mapper.readValue(request.getParameter("sort"), List.class);
		for (int i = 0; i < sortedList.size(); i++) {
			Map<String, Object> map = sortedList.get(i);
			sortedObject = (String) map.get("property");
			sortedValue = (String) map.get("direction");
		}
		Config config = new Config();
		config.setFirstResult(firstResult);
		config.setMaxResults(maxResults);
		Map<String, String> sortedCondition = new HashMap<String, String>();
		sortedCondition.put(sortedObject, sortedValue);
		config.setSortedConditions(sortedCondition);
		QueryResult<Config> queryResult = configService.doPaginationQuery(config);
		List<Config> configList = configService.getConfigList(queryResult.getResultList());
		ListView<Config> configListView = new ListView<Config>();
		configListView.setData(configList);
		configListView.setTotalRecord(queryResult.getTotalCount());
		writeJSON(response, configListView);
	}

	@RequestMapping("/deleteConfig")
	public void deleteConfig(HttpServletRequest request, HttpServletResponse response, @RequestParam("ids") Long[] ids) throws IOException {
		boolean flag = configService.deleteByPK(ids);
		if (flag) {
			writeJSON(response, "{success:true}");
		} else {
			writeJSON(response, "{success:false}");
		}
	}

}

redpajama_set_name: RedPajamaGithub


text:
package com.thoughtworks.go.apiv1.securityauthconfig.representers;

import com.thoughtworks.go.api.base.OutputWriter;
import com.thoughtworks.go.api.representers.ConfigurationPropertyRepresenter;
import com.thoughtworks.go.api.representers.ErrorGetter;
import com.thoughtworks.go.api.representers.JsonReader;
import com.thoughtworks.go.config.SecurityAuthConfig;
import com.thoughtworks.go.spark.Routes;

import java.util.Collections;
import java.util.Map;

public class SecurityAuthConfigRepresenter {

    public static void toJSON(OutputWriter outputWriter, SecurityAuthConfig securityAuthConfig) {
        outputWriter
                .addLinks(linksWriter -> linksWriter
                        .addLink("self", Routes.SecurityAuthConfigAPI.id(securityAuthConfig.getId()))
                        .addAbsoluteLink("doc", Routes.SecurityAuthConfigAPI.DOC)
                        .addLink("find", Routes.SecurityAuthConfigAPI.find()))
                .add("id", securityAuthConfig.getId())
                .add("plugin_id", securityAuthConfig.getPluginId())
                .addChildList("properties", listWriter ->
                        securityAuthConfig.forEach(property -> listWriter.addChild(propertyWriter -> ConfigurationPropertyRepresenter.toJSON(propertyWriter, property))));

        if (securityAuthConfig.hasErrors()) {
            Map<String, String> fieldMapping = Collections.singletonMap("pluginId", "plugin_id");
            outputWriter.addChild("errors", errorWriter -> new ErrorGetter(fieldMapping).toJSON(errorWriter, securityAuthConfig));
        }
    }

    public static SecurityAuthConfig fromJSON(JsonReader jsonReader) {
        SecurityAuthConfig securityAuthConfig = new SecurityAuthConfig(
                jsonReader.optString("id").orElse(null),
                jsonReader.getString("plugin_id"));
        securityAuthConfig.addConfigurations(ConfigurationPropertyRepresenter.fromJSONArray(jsonReader, "properties"));

        return securityAuthConfig;
    }
}


text:
using System;
using System.IO;

namespace System.Web.Mvc
{
    //Also part of the Markdown converter that I downloaded
	public static class MarkdownDeepExtensions
	{
		public static void RenderMarkdown(this HtmlHelper helper, string filename)
		{
			// Load source text
			var text = File.ReadAllText(helper.ViewContext.HttpContext.Server.MapPath(filename));

			// Setup processor
		    var md = new MarkdownDeep.Markdown
		                 {
		                     SafeMode = false,
                             ExtraMode = true,
                             AutoHeadingIDs = true,
                             MarkdownInHtml = true,
                             NewWindowForExternalLinks = true
		                 };

		    // Write it
			helper.ViewContext.HttpContext.Response.Write(md.Transform(text));
		}
	}
}


text:
package md5_test

import (
	"testing"

	"cuelang.org/go/pkg/internal/builtintest"
)

func TestBuiltin(t *testing.T) {
	builtintest.Run("md5", t)
}


text:
package com.tvd12.ezyfox.codec.testing;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.tvd12.ezyfox.codec.EzyMessageDeserializer;
import com.tvd12.ezyfox.codec.JacksonSimpleDeserializer;
import com.tvd12.ezyfox.entity.EzyArray;
import com.tvd12.test.base.BaseTest;
import org.testng.annotations.Test;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.nio.ByteBuffer;
import java.util.UUID;

public class JacksonSimpleDeserializerTest extends BaseTest {

    private final ObjectMapper objectMapper
        = new ObjectMapper();
    private final EzyMessageDeserializer deserializer
        = new JacksonSimpleDeserializer(objectMapper);

    @Test(expectedExceptions = {IllegalArgumentException.class})
    public void test() {
        EzyArray a1 = deserializer.deserialize(ByteBuffer.wrap(new byte[]{1, 2, 3}));
        System.out.print("a1: " + a1);
    }

    @Test
    public void test2() {
        EzyArray a1 = deserializer.deserialize("[1, 2, 3]");
        System.out.println(a1);
        String json = "[\"1\", \"2.3\", \"" + UUID.randomUUID() + "\"]";
        EzyArray a2 = deserializer.deserialize(json);
        System.out.println("a2: " + a2);
        assert a2.get(0, BigInteger.class).equals(new BigInteger("1"));
        assert a2.get(1, BigDecimal.class).equals(new BigDecimal("2.3"));
        System.out.println(a2.get(2, UUID.class));
    }

    @Test(expectedExceptions = IllegalArgumentException.class)
    public void test3() {
        EzyArray a1 = deserializer.deserialize("1, 2, 3");
        System.out.println(a1);
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable

    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.
-->
<!DOCTYPE Test SYSTEM "test.dtd">
<!--
Author:  Maxim V. Makarov
Version: $Revision: 1.2 $
-->
<Test ID="putstatic2603" date-of-creation="2006-04-26" timeout="1">
  <Author value="Maxim V. Makarov"/>
  <Description>
   Checks that putstatic instruction puts an int value if description of the referenced field is short
   Covered assertions assert_instr211a047
  </Description>
  <Source name="putstatic2603p.j"/>
  <Runner ID="Runtime">
    <Param name="toRun" value="org.apache.harmony.vts.test.vm.jvms.instructions.reftypes.putstatic.putstatic26.putstatic2603.putstatic2603p"/>
  </Runner>
</Test>


text:
package gojenkins

import (
	"fmt"
	"testing"
	"time"
)

func NewJenkinsWithTestData() *Jenkins {
	var auth Auth
	return NewJenkins(&auth, "http://example.com")
}

func Test(t *testing.T) {
	jenkins := NewJenkinsWithTestData()
	jobs, err := jenkins.GetJobs()

	if err != nil {
		t.Errorf("error %v\n", err)
	}

	if len(jobs) == 0 {
		t.Errorf("return no jobs\n")
	}
}

func TestAddJobToView(t *testing.T) {
	jenkins := NewJenkinsWithTestData()

	scm := Scm{
		Class: "hudson.scm.SubversionSCM",
	}
	jobItem := MavenJobItem{
		Plugin:               "maven-plugin@2.7.1",
		Description:          "test description",
		Scm:                  scm,
		Triggers:             Triggers{},
		RunPostStepsIfResult: RunPostStepsIfResult{},
		Settings:             JobSettings{Class: "jenkins.mvn.DefaultSettingsProvider"},
		GlobalSettings:       JobSettings{Class: "jenkins.mvn.DefaultSettingsProvider"},
	}
	newJobName := fmt.Sprintf("test-with-view-%d", time.Now().UnixNano())
	newViewName := fmt.Sprintf("test-view-%d", time.Now().UnixNano())
	jenkins.CreateJob(jobItem, newJobName)
	jenkins.CreateView(NewListView(newViewName))

	job := Job{Name: newJobName}
	err := jenkins.AddJobToView(newViewName, job)

	if err != nil {
		t.Errorf("error %v\n", err)
	}
}

func TestCreateView(t *testing.T) {
	jenkins := NewJenkinsWithTestData()

	newViewName := fmt.Sprintf("test-view-%d", time.Now().UnixNano())
	err := jenkins.CreateView(NewListView(newViewName))

	if err != nil {
		t.Errorf("error %v\n", err)
	}
}

func TestCreateJobItem(t *testing.T) {
	jenkins := NewJenkinsWithTestData()
	scm := Scm{
		ScmContent: ScmSvn{
			Locations: Locations{
				[]ScmSvnLocation{
					ScmSvnLocation{IgnoreExternalsOption: "false", DepthOption: "infinity", Local: ".", Remote: "http://some-svn-url"},
				},
			},
			IgnoreDirPropChanges: "false",
			FilterChanglog:       "false",
			WorkspaceUpdater:     WorkspaceUpdater{Class: "hudson.scm.subversion.UpdateUpdater"},
		},
		Class:  "hudson.scm.SubversionSCM",
		Plugin: "subversion@1.54",
	}
	triggers := Triggers{[]Trigger{ScmTrigger{}}}
	postStep := RunPostStepsIfResult{Name: "FAILURE", Ordinal: "2", Color: "RED", CompleteBuild: "true"}
	settings := JobSettings{Class: "jenkins.mvn.DefaultSettingsProvider"}
	globalSettings := JobSettings{Class: "jenkins.mvn.DefaultSettingsProvider"}
	jobItem := MavenJobItem{
		Plugin:               "maven-plugin@2.7.1",
		Description:          "test description",
		Scm:                  scm,
		Triggers:             triggers,
		RunPostStepsIfResult: postStep,
		Settings:             settings,
		GlobalSettings:       globalSettings,
	}

	newJobName := fmt.Sprintf("test-%d", time.Now().UnixNano())
	err := jenkins.CreateJob(jobItem, newJobName)

	if err != nil {
		t.Errorf("error %v\n", err)
	}

	jobs, _ := jenkins.GetJobs()
	foundNewJob := false
	for _, v := range jobs {
		if v.Name == newJobName {
			foundNewJob = true
		}
	}

	if !foundNewJob {
		t.Errorf("error %s not found\n", newJobName)
	}
}


text:
<?php

namespace Sylius\Component\Core\Model;

use Doctrine\Common\Collections\ArrayCollection;
use Sylius\Component\Customer\Model\Customer as BaseCustomer;
use Sylius\Component\User\Model\UserInterface as BaseUserInterface;

/**
 * @author Michał Marcinkowski <michal.marcinkowski@lakion.com>
 */
class Customer extends BaseCustomer implements CustomerInterface, ProductReviewerInterface
{
    /**
     * @var ArrayCollection
     */
    protected $orders;

    /**
     * @var AddressInterface
     */
    protected $billingAddress;

    /**
     * @var AddressInterface
     */
    protected $shippingAddress;

    /**
     * @var ArrayCollection
     */
    protected $addresses;

    /**
     * @var UserInterface
     */
    protected $user;

    public function __construct()
    {
        parent::__construct();

        $this->orders = new ArrayCollection();
        $this->addresses = new ArrayCollection();
    }

    /**
     * {@inheritdoc}
     */
    public function getOrders()
    {
        return $this->orders;
    }

    /**
     * {@inheritdoc}
     */
    public function setBillingAddress(AddressInterface $billingAddress = null)
    {
        $this->billingAddress = $billingAddress;

        if (null !== $billingAddress) {
            $this->addAddress($billingAddress);
        }
    }

    /**
     * {@inheritdoc}
     */
    public function getBillingAddress()
    {
        return $this->billingAddress;
    }

    /**
     * {@inheritdoc}
     */
    public function setShippingAddress(AddressInterface $shippingAddress = null)
    {
        $this->shippingAddress = $shippingAddress;

        if (null !== $shippingAddress) {
            $this->addAddress($shippingAddress);
        }
    }

    /**
     * {@inheritdoc}
     */
    public function getShippingAddress()
    {
        return $this->shippingAddress;
    }

    /**
     * {@inheritdoc}
     */
    public function addAddress(AddressInterface $address)
    {
        if (!$this->hasAddress($address)) {
            $this->addresses[] = $address;
            $address->setCustomer($this);
        }
    }

    /**
     * {@inheritdoc}
     */
    public function removeAddress(AddressInterface $address)
    {
        $this->addresses->removeElement($address);
        $address->setCustomer(null);
    }

    /**
     * {@inheritdoc}
     */
    public function hasAddress(AddressInterface $address)
    {
        return $this->addresses->contains($address);
    }

    /**
     * {@inheritdoc}
     */
    public function getAddresses()
    {
        return $this->addresses;
    }

    /**
     * {@inheritdoc}
     */
    public function hasUser()
    {
        return null !== $this->user;
    }

    /**
     * {@inheritdoc}
     */
    public function getUser()
    {
        return $this->user;
    }

    /**
     * {@inheritdoc}
     */
    public function setUser(BaseUserInterface $user = null)
    {
        if ($this->user !== $user) {
            $this->user = $user;
            $this->assignCustomer($user);
        }
    }

    /**
     * @param UserInterface $user
     */
    protected function assignCustomer(UserInterface $user = null)
    {
        if (null !== $user) {
            $user->setCustomer($this);
        }
    }
}


text:
.class synthetic Lorg/apache/http/impl/cookie/RFC6265CookieSpecProvider$2;
.super Ljava/lang/Object;
.source "RFC6265CookieSpecProvider.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lorg/apache/http/impl/cookie/RFC6265CookieSpecProvider;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x1008
    name = null
.end annotation

# static fields
.field static final synthetic $SwitchMap$org$apache$http$impl$cookie$RFC6265CookieSpecProvider$CompatibilityLevel:[I

# direct methods
.method static constructor <clinit>()V
    .locals 3

    invoke-static {}, Lorg/apache/http/impl/cookie/RFC6265CookieSpecProvider$CompatibilityLevel;->values()[Lorg/apache/http/impl/cookie/RFC6265CookieSpecProvider$CompatibilityLevel;

    move-result-object v0

    array-length v0, v0

    new-array v0, v0, [I

    sput-object v0, Lorg/apache/http/impl/cookie/RFC6265CookieSpecProvider$2;->$SwitchMap$org$apache$http$impl$cookie$RFC6265CookieSpecProvider$CompatibilityLevel:[I

    :try_start_0
    sget-object v0, Lorg/apache/http/impl/cookie/RFC6265CookieSpecProvider$2;->$SwitchMap$org$apache$http$impl$cookie$RFC6265CookieSpecProvider$CompatibilityLevel:[I

    sget-object v1, Lorg/apache/http/impl/cookie/RFC6265CookieSpecProvider$CompatibilityLevel;->STRICT:Lorg/apache/http/impl/cookie/RFC6265CookieSpecProvider$CompatibilityLevel;

    invoke-virtual {v1}, Lorg/apache/http/impl/cookie/RFC6265CookieSpecProvider$CompatibilityLevel;->ordinal()I

    move-result v1

    const/4 v2, 0x1

    aput v2, v0, v1
    :try_end_0
    .catch Ljava/lang/NoSuchFieldError; {:try_start_0 .. :try_end_0} :catch_1

    :goto_0
    :try_start_1
    sget-object v0, Lorg/apache/http/impl/cookie/RFC6265CookieSpecProvider$2;->$SwitchMap$org$apache$http$impl$cookie$RFC6265CookieSpecProvider$CompatibilityLevel:[I

    sget-object v1, Lorg/apache/http/impl/cookie/RFC6265CookieSpecProvider$CompatibilityLevel;->IE_MEDIUM_SECURITY:Lorg/apache/http/impl/cookie/RFC6265CookieSpecProvider$CompatibilityLevel;

    invoke-virtual {v1}, Lorg/apache/http/impl/cookie/RFC6265CookieSpecProvider$CompatibilityLevel;->ordinal()I

    move-result v1

    const/4 v2, 0x2

    aput v2, v0, v1
    :try_end_1
    .catch Ljava/lang/NoSuchFieldError; {:try_start_1 .. :try_end_1} :catch_0

    :goto_1
    return-void

    :catch_0
    move-exception v0

    goto :goto_1

    :catch_1
    move-exception v0

    goto :goto_0
.end method


text:
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Options;

namespace OrchardCore.Localization.DataAnnotations
{
    internal class LocalizedDataAnnotationsMvcOptions : IConfigureOptions<MvcOptions>
    {
        private readonly IStringLocalizerFactory _stringLocalizerFactory;

        public LocalizedDataAnnotationsMvcOptions(IStringLocalizerFactory stringLocalizerFactory)
        {
            _stringLocalizerFactory = stringLocalizerFactory;
        }

        public void Configure(MvcOptions options)
        {
            var localizer = _stringLocalizerFactory.Create(typeof(LocalizedDataAnnotationsMvcOptions));

            options.ModelMetadataDetailsProviders.Add(new LocalizedValidationMetadataProvider(localizer));
        }
    }
}


text:
// Copyright 2015 The Project Buendia Authors
//
// 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 distrib-
// uted 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
// specific language governing permissions and limitations under the License.

package org.projectbuendia.client.widget;

import android.content.Context;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;

/**
 * Same as {@link GridLayoutManager}, but sets the height based on the height of the content. This
 * is necessary in order to put the {@link RecyclerView} into a {@link android.widget.ScrollView}.
 */
final class WrapContentGridLayoutManager extends GridLayoutManager {

    public WrapContentGridLayoutManager(
            Context context, int spanCount, int orientation, boolean reverseLayout) {
        super(context, spanCount, orientation, reverseLayout);
    }

    @Override
    public void onMeasure(RecyclerView.Recycler recycler, RecyclerView.State state,
                          int widthSpec, int heightSpec) {
        final int heightMode = View.MeasureSpec.getMode(heightSpec);
        if (heightMode != View.MeasureSpec.UNSPECIFIED) {
            super.onMeasure(recycler, state, widthSpec, heightSpec);
            return;
        }
        // Do default behaviour for width
        final int widthMode = View.MeasureSpec.getMode(widthSpec);
        final int widthSize = View.MeasureSpec.getSize(widthSpec);
        int width = 0;
        switch (widthMode) {
            case View.MeasureSpec.EXACTLY:
            case View.MeasureSpec.AT_MOST:
                width = widthSize;
                break;
            case View.MeasureSpec.UNSPECIFIED:
            default:
                width = getMinimumWidth();
                break;
        }

        // Compute the total height based on the first column
        int totalHeight = getPaddingTop() + getPaddingBottom();
        for (int i = 0; i < getSpanCount(); ++i) {
            int currentHeight = measureScrapChild(recycler, i,
                    View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
                    View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED),
                    HORIZONTAL);
            totalHeight += currentHeight;
        }

        setMeasuredDimension(width, totalHeight);
    }

    private int measureScrapChild(RecyclerView.Recycler recycler, int position, int widthSpec,
                                  int heightSpec, int queriedDimension) {
        View view = recycler.getViewForPosition(position);
        if (view != null) {
            RecyclerView.LayoutParams p = (RecyclerView.LayoutParams) view.getLayoutParams();
            int childWidthSpec = ViewGroup.getChildMeasureSpec(widthSpec,
                    getPaddingLeft() + getPaddingRight(), p.width);
            int childHeightSpec = ViewGroup.getChildMeasureSpec(heightSpec,
                    getPaddingTop() + getPaddingBottom(), p.height);
            view.measure(childWidthSpec, childHeightSpec);
            int result = (queriedDimension == VERTICAL)
                    ? view.getMeasuredWidth()
                    : view.getMeasuredHeight();
            recycler.recycleView(view);
            return result;
        } else {
            throw new IllegalArgumentException("invalid position " + position);
        }
    }
}


text:
var webview = null;
var loadcount = 0;

var LOG = function(msg) {
  window.console.log(msg);
};

var startTest = function(guestURL) {
  window.addEventListener('message', receiveMessage, false);
  chrome.test.sendMessage('guest-loaded');
  webview = document.getElementById('webview');
  webview.addEventListener('loadstop', onWebviewLoaded);
  webview.addEventListener('consolemessage', function(e) {
    LOG('[Guest]: ' + e.message);
  });

  webview.setAttribute('src', guestURL);
};

var onWebviewLoaded = function(event) {
  window.console.log('onWebviewLoaded');
  loadcount++;
  webview.contentWindow.postMessage('msg', '*');
};

var receiveMessage = function(event) {
  LOG('receiveMessage, loadcount: ' + loadcount);
  if (loadcount == 1) {
    var webviewContainer = document.querySelector('#webview-tag-container')
    webviewContainer.removeChild(webview);
    webviewContainer.appendChild(webview);
  } else if (loadcount == 2) {
    chrome.test.succeed();
  } else {
    chrome.test.fail();
  }
};

chrome.test.getConfig(function(config) {
  var guestURL = 'http://localhost:' + config.testServer.port +
      '/extensions/platform_apps/web_view/addremove/guest.html';
  document.querySelector('#webview-tag-container').innerHTML =
      '<webview id=\'webview\' style="width: 400px; height: 400px; ' +
      'margin: 0; padding: 0;"' +
      '></webview>';
  startTest(guestURL);
});


text:
"""
sentry.utils.cache
~~~~~~~~~~~~~~~~~~

:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function

import functools

from django.core.cache import cache

default_cache = cache

class memoize(object):
    """
    Memoize the result of a property call.

    >>> class A(object):
    >>>     @memoize
    >>>     def func(self):
    >>>         return 'foo'
    """

    def __init__(self, func):
        self.__name__ = func.__name__
        self.__module__ = func.__module__
        self.__doc__ = func.__doc__
        self.func = func

    def __get__(self, obj, type=None):
        if obj is None:
            return self
        d, n = vars(obj), self.__name__
        if n not in d:
            value = self.func(obj)
            d[n] = value
        value = d[n]
        return value

class cached_for_request(memoize):
    """
    Memoize the result of a for the duration of a request. If the system does
    not think it's in a request, the result is never saved.

    >>> class A(object):
    >>>     @memoize_for_request
    >>>     def func(self):
    >>>         return 'foo'
    """

    def _get_key(self, args, kwargs):
        return (self, tuple(args), tuple(kwargs.items()))

    def __call__(self, *args, **kwargs):
        from sentry.app import env

        request = env.request
        if not request:
            return self.func(*args, **kwargs)

        if not hasattr(request, '__func_cache'):
            data = request.__func_cache = {}
        else:
            data = request.__func_cache

        key = self._get_key(args, kwargs)

        if key not in data:
            value = self.func(*args, **kwargs)
            data[key] = value
        return data[key]

    def __get__(self, obj, type=None):
        return functools.partial(self.__call__, obj)


text:
/*--------------------------------------------------------------------*/
/*--- Interface to CPUID.                         pub_tool_cpuid.h ---*/
/*--------------------------------------------------------------------*/

/*
   This file is part of Valgrind, a dynamic binary instrumentation
   framework.

   Copyright (C) 2000-2012 Julian Seward
      jseward@acm.org

   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
   published by the Free Software Foundation; either version 2 of the
   License, or (at your option) any later version.

   This program is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   02111-1307, USA.

   The GNU General Public License is contained in the file COPYING.
*/

#ifndef __PUB_TOOL_CPUID_H
#define __PUB_TOOL_CPUID_H

#if defined(VGA_x86) || defined(VGA_amd64)
extern Bool VG_(has_cpuid) ( void );

extern void VG_(cpuid) ( UInt eax, UInt ecx,
                         UInt* eax_ret, UInt* ebx_ret,
                         UInt* ecx_ret, UInt* edx_ret );
#endif

#endif   // __PUB_TOOL_CPUID_H

/*--------------------------------------------------------------------*/
/*--- end                                                          ---*/
/*--------------------------------------------------------------------*/


text:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.Vector;
import java.awt.image.BufferedImage;
import javax.imageio.ImageIO;
import java.io.File;
public class MarioEditor extends JPanel implements MouseListener{
Vector<Block> blocks;
Vector<BufferedImage> images;
int offset = 0;
int placetype = 0;
int mx;
int my;
boolean placemode = true;
	public static void main(String[] args) throws Exception{
		new MarioEditor();
	}
	public MarioEditor() throws Exception{

		blocks = new Vector<Block>();
		images = new Vector<BufferedImage>();

		images.add(ImageIO.read(this.getClass().getResource("blockground.png")));
		images.add(ImageIO.read(this.getClass().getResource("blockbreak.png")));
		images.add(ImageIO.read(this.getClass().getResource("blockbreakstar.png")));
		images.add(ImageIO.read(this.getClass().getResource("blockbreakcoinhidden.png")));
		images.add(ImageIO.read(this.getClass().getResource("blockquestionhidden.png")));
		images.add(ImageIO.read(this.getClass().getResource("blockquestionmushroom.png")));
		images.add(ImageIO.read(this.getClass().getResource("blockquestioncoin.png")));
		images.add(ImageIO.read(this.getClass().getResource("pipetop.png")));
		images.add(ImageIO.read(this.getClass().getResource("pipemiddle.png")));

		JFrame f = new JFrame("Mario Editor");
		f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		f.add(this);
		f.addMouseListener(this);
		f.addMouseMotionListener(new MouMo());
		f.addKeyListener(new KeyList());
		f.setSize(600, 600);
		f.setVisible(true);
	}

	public void paintComponent(Graphics g){
	super.paintComponent(g);
	g.setColor(Color.BLACK);
	for(int j = 0; j < 600; j+=16){
		g.drawLine(j, 0, j, 600);
		g.drawLine(0, j, 600, j);
	}
		if(placemode)g.drawImage(images.get(placetype), mx, my, 32, 32, null);
		g.setColor(Color.RED);
		g.fillOval(mx-2, my-2, 4, 4);
		if(!blocks.isEmpty()){
		for(Block b: blocks){
			g.drawImage(images.get(b.type), b.bound.x-offset, b.bound.y, b.bound.width, b.bound.height, null);
		}
		}
	}

public void mousePressed(MouseEvent e) {
    }

    public void mouseReleased(MouseEvent e) {
    }

    public void mouseEntered(MouseEvent e) {

    }

    public void mouseExited(MouseEvent e) {

    }

    public void mouseClicked(MouseEvent e) {
	if(placemode){
		blocks.add(new Block(placetype, (mx+offset)-((mx+offset)%16), my-(my%16)));
	}else{
		for(Block b: blocks){
			if( b.bound.contains(mx+offset, my)){
				blocks.remove(b);
				break;
			}
		}
	}
repaint();
    }

public class MouMo implements MouseMotionListener{
public void mouseMoved(MouseEvent e) {
       mx = e.getX();
       my = e.getY();
	repaint();
    }

    public void mouseDragged(MouseEvent e) {
    }
}

public class KeyList extends KeyAdapter{
public void keyReleased(KeyEvent e) {
}

public void keyPressed(KeyEvent e) {

    int key = e.getKeyCode();
if (key == KeyEvent.VK_UP) {
        if(placetype<8)placetype++;
    }
if (key == KeyEvent.VK_DOWN) {
        if(placetype>0)placetype--;
    }

    if (key == KeyEvent.VK_RIGHT) {
        offset+=16;
    }
if (key == KeyEvent.VK_LEFT) {
        offset-=16;
    }

if (key == KeyEvent.VK_Q) {
        placemode = !placemode;
    }

if (key == KeyEvent.VK_E) {
        for(Block b: blocks){
		System.out.println(b.type+","+b.bound.x+","+b.bound.y);
	}
    }

repaint();

}
}
public class Block{
	public int type;
	public Rectangle bound;

public Block(int type, int x, int y){
	this.type = type;
	if(type<7){
		bound = new Rectangle(x, y, 16, 16);
	}else{
		bound = new Rectangle(x, y, 32, 32);
	}
}
}

}


text:
package org.waveprotocol.wave.model.document;

import org.waveprotocol.wave.model.document.indexed.LocationMapper;
import org.waveprotocol.wave.model.document.operation.DocInitialization;

/**
 * Document containing everything you need for a readable persistent view
 *
 * TODO(danilatos) Rename:
 *   ReadableDocument -> ReadableDomDocument
 *   RawDocument -> DomDocument
 *   ReadableWDocument -> ReadableDocument
 *
 * @author danilatos@google.com (Daniel Danilatos)
 */
public interface ReadableWDocument<N, E extends N, T extends N> extends
    ReadableDocument<N, E, T>,
    ReadableAnnotationSet<String>,
    LocationMapper<N> {

  /**
   * Returns the string representation of the document. Useful for equality
   * comparisons and some forms of serialization.
   *
   * Equivalent to {@code DocOpUtil.toXmlString(toInitialization())}
   *
   * NOTE(danilatos): Should we deprecate this method? Or does is it useful to
   * allow more efficient implementations than the definition above?
   *
   * @return Minimal normalized xml string.
   *
   *         WARNING(danilatos): Do not use this for debugging or logging
   *         purposes. Instead, use {@link #toDebugString()}
   */
  String toXmlString();

  /**
   * Returns a debug representation of the document. The format is not stable.
   * It is not useful for equality comparisons. It is useful for debugging and
   * logging. It is safe to call even if the document is potentially corrupted.
   *
   * If a document is based on an inner ReadableWDocument, it should delegate
   * to the inner instance for this method.
   *
   * Otherwise, a typical implementation might look something like
   *
   * try {
   *   return DocOpUtil.toXmlString(DocOpScrub.maybeScrub(toInitialization()));
   * } catch (RuntimeException e) {
   *   return "#broken document#";
   * }
   *
   *
   * @return A (scrubbed if necessary) representation of the document. Should
   *         not contain decorations e.g. reporting the implementation type.
   *         That way, adapter or wrapper classes can delegate without a large
   *         amount of cruft building up. {@link #toString()} should contain the
   *         extra decorations.
   */
  String toDebugString();

  /**
   * Returns a useful, scrubbed if necessary, representation of the document.
   * Should not be usable for equality comparisons. A typical implementation
   * might look like
   *
   *
   * return "ImplName@" + Integer.toHexString(System.identityHashCode(this))
   *     + "[" + toDebugString() + "]";
   *
   */
  @Override String toString();

  /**
   * @return this document represented as an initialization, suitable for
   *         {@link org.waveprotocol.wave.model.document.MutableDocument#hackConsume(org.waveprotocol.wave.model.document.operation.Nindo)
   *         copying} this document's content into another document.
   */
  DocInitialization toInitialization();
}