text:
import platform
import json
import argparse
import urllib
import urllib.request
from subprocess import check_call, CalledProcessError
import sys
import os
import zipfile
import tarfile
import time

from packaging.version import Version
from packaging.version import parse
from packaging.version import InvalidVersion

# SOURCE OF THIS FILE: https://github.com/actions/python-versions
# this is the official mapping file for gh-actions to retrieve python installers
MANIFEST_LOCATION = "https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json"

MAX_INSTALLER_RETRY = 3
CURRENT_UBUNTU_VERSION = "20.04"  # full title is ubuntu-20.04
MAX_PRECACHED_VERSION = "3.10.0"

UNIX_INSTALL_ARRAY = ["sh", "setup.sh"]
WIN_INSTALL_ARRAY = ["pwsh", "setup.ps1"]

def download_installer(remote_path, local_path):
    retries = 0

    while True:
        try:
            urllib.request.urlretrieve(remote_path, local_path)
            break
        except Exception as e:
            print(e)
            retries += 1

            if retries >= MAX_INSTALLER_RETRY:
                print(
                    "Unable to recover after attempting to download {} {} times".format(
                        remote_path, retries
                    )
                )
                exit(1)
            time.sleep(10)

def install_selected_python_version(installer_url, installer_folder):
    current_plat = platform.system().lower()

    installer_folder = os.path.normpath(os.path.abspath(installer_folder))
    if not os.path.exists(installer_folder):
        os.mkdir(installer_folder)
    local_installer_ref = os.path.join(
        installer_folder,
        "local" + (".zip" if installer_folder.endswith("zip") else ".tar.gz"),
    )

    download_installer(installer_url, local_installer_ref)

    if current_plat == "windows":
        with zipfile.ZipFile(local_installer_ref, "r") as zip_file:
            zip_file.extractall(installer_folder)
        try:
            check_call(WIN_INSTALL_ARRAY, cwd=installer_folder)
        except CalledProcessError as err:
            print(err)
            exit(1)

    else:
        with tarfile.open(local_installer_ref) as tar_file:
            tar_file.extractall(installer_folder)
        try:
            check_call(UNIX_INSTALL_ARRAY, cwd=installer_folder)
        except CalledProcessError as err:
            print(err)
            exit(1)

def get_installer_url(requested_version, version_manifest):
    current_plat = platform.system().lower()

    print("Current Platform Is {}".format(platform.platform()))

    if version_manifest[requested_version]:
        found_installers = version_manifest[requested_version]["files"]

        # filter anything that's not x64. we don't care.
        x64_installers = [
            file_def for file_def in found_installers if file_def["arch"] == "x64"
        ]

        if current_plat == "windows":
            return [
                installer
                for installer in x64_installers
                if installer["platform"] == "win32"
            ][0]
        elif current_plat == "darwin":
            return [
                installer
                for installer in x64_installers
                if installer["platform"] == current_plat
            ][0]
        else:
            return [
                installer
                for installer in x64_installers
                if installer["platform"] == "linux"
                and installer["platform_version"] == CURRENT_UBUNTU_VERSION
            ][0]

if __name__ == "__main__":
    parser = argparse.ArgumentParser(
        description="This python script ensures that a requested python version is present in the hostedtoolcache on azure devops agents. It does this by retrieving new versions of python from the gh-actions python manifest."
    )

    parser.add_argument(
        "version_spec",
        nargs="?",
        help=("The version specifier passed in to the UsePythonVersion extended task."),
    )

    parser.add_argument(
        "--installer_folder",
        dest="installer_folder",
        help=(
            "The folder where the found installer will be extracted into and run from."
        ),
    )

    args = parser.parse_args()
    max_precached_version = Version(MAX_PRECACHED_VERSION)
    try:
        version_from_spec = Version(args.version_spec)
    except InvalidVersion:
        print("Invalid Version Spec. Skipping custom install.")
        exit(0)

    with urllib.request.urlopen(MANIFEST_LOCATION) as url:
        version_manifest = json.load(url)

    version_dict = {i["version"]: i for i in version_manifest}

    if version_from_spec > max_precached_version:
        print(
            "Requested version {} is newer than versions pre-cached on agent. Invoking.".format(
                args.version_spec
            )
        )
        install_file_details = get_installer_url(args.version_spec, version_dict)
        install_selected_python_version(
            install_file_details["download_url"], args.installer_folder
        )


text:
using NUnit.Framework;
using SteamTrade;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SteamKit2;
using System.Collections.Specialized;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using System.IO;
using SteamBotUnitTest.Properties;
using System.Runtime.Serialization.Formatters.Binary;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using System.Reflection;
using SteamTrade.Exceptions;

namespace SteamBotUnitTest.SteamTrade
{
    [TestFixture]
    public class GenericInventoryTests
    {
        [Test]
        public void LoadTest()
        {
            var GenericInventory = new GenericInventory(new DelegateFetchSteamWeb(url =>
            {
                if (url == "https://steamcommunity.com/inventory/76561198101672411/570/2?l=schinese&count=5000")
                {
                    using (var reader = new StreamReader(new MemoryStream(Resources.NewApiSampleInventoryPage1)))
                    {
                        return reader.ReadToEndAsync();
                    }
                }
                if (url == "https://steamcommunity.com/inventory/76561198101672411/570/2?l=schinese&count=5000&start_assetid=12942034383")
                {
                    using (var reader = new StreamReader(new MemoryStream(Resources.NewApiSampleInventoryPage2)))
                    {
                        return reader.ReadToEndAsync();
                    }
                }
                if (url == "https://steamcommunity.com/inventory/76561198101672411/570/2?l=schinese&count=5000&start_assetid=8432580706")
                {
                    using (var reader = new StreamReader(new MemoryStream(Resources.NewApiSampleInventoryPage3)))
                    {
                        return reader.ReadToEndAsync();
                    }
                }
                throw new AssertionException("Failed.");
            }), 76561198101672411UL, 570U, 2U, "schinese");
            GenericInventory.Wait();
            Assert.AreEqual(10873, GenericInventory.GetItemCount());

            var item = GenericInventory.GetDescription<ItemDescription>(230751399U, 2748948653U);
            Assert.AreEqual("动能:魔狱霸主!", item.MarketName);
            Assert.AreEqual("Kinetic: Crown of Hells!", item.MarketHashName);

            item = GenericInventory.GetDescription<ItemDescription>(GenericInventory.GetItem(12997738541UL));
            Assert.AreEqual("流浪剑客壁垒", item.MarketName);
            Assert.AreEqual("Bulwark of the Rogue Knight", item.MarketHashName);
            Assert.True(item.Tradable);

            item = GenericInventory.GetDescription<ItemDescription>(12997738541UL);
            Assert.AreEqual("流浪剑客壁垒", item.MarketName);
            Assert.AreEqual("Bulwark of the Rogue Knight", item.MarketHashName);
            Assert.True(item.Tradable);

            item = GenericInventory.GetDescription<ItemDescription>(8611853506UL);
            Assert.AreEqual("战乱天堂", item.MarketName);
            Assert.AreEqual("Wartorn Heavens", item.MarketHashName);
            Assert.False(item.Tradable);

            foreach (var asset in GenericInventory)
            {
                Assert.NotNull(GenericInventory.GetDescription(asset));
            }
        }

        [Test]
        public void SerializationTest()
        {
            var GenericInventory = new GenericInventory(new DelegateFetchSteamWeb(url =>
            {
                byte[] b;
                if (url.Contains("start_assetid=3916401012"))
                    b = Resources.SampleInventory2;
                else
                    b = Resources.SampleInventory;
                using (var reader = new StreamReader(new MemoryStream(b)))
                {
                    return reader.ReadToEndAsync();
                }
            }), 76561198058183411UL, 570U, 2U);
            GenericInventory.Wait();

            var serializer = new JsonSerializer() { ContractResolver = new DefaultContractResolver() { IgnoreSerializableAttribute = false } };
            var tempFileName = Path.GetTempFileName();
            using (var stream = File.Create(tempFileName))
            using (var writer = new StreamWriter(stream))
            {
                serializer.Serialize(writer, GenericInventory);
            }
            using (var stream = File.OpenRead(tempFileName))
            using (var streamReader = new StreamReader(stream))
            using (var reader = new JsonTextReader(streamReader))
            {
                GenericInventory = serializer.Deserialize<GenericInventory>(reader);
                var item = GenericInventory.GetDescription<ItemDescription>(GenericInventory.GetItem(3918797072UL));
                Assert.AreEqual("The Scorch Shot", item.Name);
                Assert.AreEqual("The Scorch Shot", item.MarketName);
                Assert.AreEqual("The Scorch Shot", item.MarketHashName);
                item = GenericInventory.GetDescription<ItemDescription>(GenericInventory.GetItem(946383887UL));
                Assert.AreEqual("Alien Swarm Parasite", item.Name);
                Assert.AreEqual("Alien Swarm Parasite", item.MarketName);
                Assert.AreEqual("Alien Swarm Parasite", item.MarketHashName);
            }
            File.Delete(tempFileName);
        }

        [Test]
        public void SerializationExceptionTest()
        {
            var GenericInventory = new GenericInventory(new DelegateFetchSteamWeb(async () =>
            {
                await Task.Delay(10000);
                throw new InvalidOperationException();
            }), 76561198058183411UL, 570U, 2U);
            var serializer = new JsonSerializer() { ContractResolver = new DefaultContractResolver() { IgnoreSerializableAttribute = false } };
            var tempFileName = Path.GetTempFileName();
            using (var stream = File.Create(tempFileName))
            using (var writer = new StreamWriter(stream))
            {
                Assert.Throws(typeof(TargetInvocationException), () => serializer.Serialize(writer, GenericInventory));
            }
            File.Delete(tempFileName);
        }

        [Test]
        public void LoadErrorTest()
        {
            var GenericInventory = new GenericInventory(new DelegateFetchSteamWeb(() =>
            {
                using (var reader = new StreamReader(new MemoryStream(Resources.inventoryError)))
                {
                    return reader.ReadToEndAsync();
                }
            }), 76561198058183411UL, 570U, 2U);
            var exception = (AggregateException)Assert.Throws(typeof(AggregateException), () => GenericInventory.Wait());
            Assert.True(exception.InnerExceptions[0].Message.Contains("此个人资料是私密的。"));
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

  <title>Screenshots</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  <link rel="stylesheet" href="style.css">

SCREENSHOTS

		Oh snap! The package you are trying to view is not hosted on this repository.

CONTACT


text:
option(CATKIN_ENABLE_TESTING "Catkin enable testing" ON)
option(CATKIN_SKIP_TESTING "Catkin skip testing" OFF)

# check if testing is explicity skipped
if(CATKIN_SKIP_TESTING)
  set(CATKIN_ENABLE_TESTING OFF)
  message(STATUS "Using CATKIN_SKIP_TESTING: ${CATKIN_SKIP_TESTING} (implying CATKIN_ENABLE_TESTING=${CATKIN_ENABLE_TESTING})")
else()
  message(STATUS "Using CATKIN_ENABLE_TESTING: ${CATKIN_ENABLE_TESTING}")
endif()

# creates dummy functions in case testing has been explicitly disabled (and not only skipping)
# which outputs an error message when being invoked
macro(_generate_function_if_testing_is_disabled)
  if(DEFINED CATKIN_ENABLE_TESTING AND NOT CATKIN_ENABLE_TESTING AND NOT CATKIN_SKIP_TESTING)
    foreach(_arg ${ARGN})
      function(${_arg})
        message(FATAL_ERROR
          "${_arg}() is not available when tests are not enabled. The CMake code should only use it inside a conditional block which checks that testing is enabled:\n"
          "if(CATKIN_ENABLE_TESTING)\n"
          "  ${_arg}(...)\n"
          "endif()\n")
      endfunction()
    endforeach()
    return()
  endif()
endmacro()

# creates dummy functions in case C++ is not a language specified, which outputs an error
macro(_generate_function_if_no_cxx_language)
  get_property(ENABLED_LANGUAGES_LIST GLOBAL PROPERTY ENABLED_LANGUAGES)
  list(FIND ENABLED_LANGUAGES_LIST "CXX" _cxx_index)
  if ("${_cxx_index}" EQUAL -1) # if C++ isn't an enabled language
    foreach(_arg ${ARGN})
      set(tmp_func_name ${_arg})
      function(${_arg})
        message(FATAL_ERROR
          "${tmp_func_name}() is not available when the CXX language isn't enabled. "
          "Check the `LANGUAGES` argument of the `project()` function to make sure `CXX` is not excluded.")
      endfunction()
    endforeach()
    return()
  endif()
endmacro()

# checks if a function has been called while testing is skipped
# and outputs a warning message
macro(_warn_if_skip_testing funcname)
  if(DEFINED CATKIN_ENABLE_TESTING AND NOT CATKIN_ENABLE_TESTING)
    message(WARNING
      "${funcname}() should only be used inside a conditional block which checks that testing is enabled:\n"
      "if(CATKIN_ENABLE_TESTING)\n"
      "  ${funcname}(...)\n"
      "endif()\n")
  endif()
endmacro()

if(DEFINED CATKIN_ENABLE_TESTING AND NOT CATKIN_ENABLE_TESTING AND NOT CATKIN_SKIP_TESTING)
  return()
endif()

# do not enable ctest's on the farm, since they are automatically executed by the current rules files
# and since the tests have not been build rostests would hang forever
if(NOT CATKIN_BUILD_BINARY_PACKAGE)
  # do not enable ctest's for dry packages, since they have a custom test target which must not be overwritten
  if(NOT ROSBUILD_init_called)
    message(STATUS "Call enable_testing()")
    enable_testing()
    if(DEFINED CATKIN_ENABLE_TESTING)
      # configure CTest not to truncate the dashboard summary
      file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake"
        "set(CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE 0)\n"
        "set(CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE 0)\n")
      # create dart configuration from template
      site_name(SITE)
      configure_file(
        ${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
        ${PROJECT_BINARY_DIR}/CTestConfiguration.ini)
    endif()
  else()
    message(STATUS "Skip enable_testing() for dry packages")
  endif()
else()
  message(STATUS "Skip enable_testing() when building binary package")
endif()

# allow overriding CATKIN_TEST_RESULTS_DIR when explicitly passed to CMake as a command line argument
if(DEFINED CATKIN_TEST_RESULTS_DIR)
  set(CATKIN_TEST_RESULTS_DIR ${CATKIN_TEST_RESULTS_DIR} CACHE INTERNAL "")
else()
  set(CATKIN_TEST_RESULTS_DIR ${CMAKE_BINARY_DIR}/test_results CACHE INTERNAL "")
endif()
message(STATUS "Using CATKIN_TEST_RESULTS_DIR: ${CATKIN_TEST_RESULTS_DIR}")
file(MAKE_DIRECTORY ${CATKIN_TEST_RESULTS_DIR})

# create target to build tests
if(NOT TARGET tests)
  add_custom_target(tests)
endif()

# create target to run all tests
# it uses the dot-prefixed test targets to depend on building all tests and cleaning test results before the tests are executed
if(NOT TARGET run_tests)
  add_custom_target(run_tests)
endif()

# create target to clean all test results
if(NOT TARGET clean_test_results)
  add_custom_target(clean_test_results
    COMMAND ${PYTHON_EXECUTABLE} "${catkin_EXTRAS_DIR}/test/remove_test_results.py" "${CATKIN_TEST_RESULTS_DIR}")
endif()

#
# Create a test target, integrate it with the run_tests infrastructure
# and post-process the junit result.
#
# All test results go under ${CATKIN_TEST_RESULTS_DIR}/${PROJECT_NAME}
#
# This function is only used internally by the various
# catkin_add_*test() functions.
#
function(catkin_run_tests_target type name xunit_filename)
  cmake_parse_arguments(_testing "" "WORKING_DIRECTORY" "COMMAND;DEPENDENCIES" ${ARGN})
  if(_testing_UNPARSED_ARGUMENTS)
    message(FATAL_ERROR "catkin_run_tests_target() called with unused arguments: ${_testing_UNPARSED_ARGUMENTS}")
  endif()

  # Friendly error message for ros/catkin#961
  if(TARGET run_tests_${PROJECT_NAME} AND NOT TARGET _run_tests_${PROJECT_NAME})
    message(FATAL_ERROR "catkin_run_tests_target() needs to create a target called `run_tests_${PROJECT_NAME}`, but it already exists. Please rename the existing `run_tests_${PROJECT_NAME}` target/executable/library to something else.")
  endif()

  # create meta target to trigger all tests of a project
  if(NOT TARGET run_tests_${PROJECT_NAME})
    add_custom_target(run_tests_${PROJECT_NAME})
    # create hidden meta target which depends on hidden test targets which depend on clean_test_results
    add_custom_target(_run_tests_${PROJECT_NAME})
    # run_tests depends on this hidden target hierarchy to clear test results before running all tests
    add_dependencies(run_tests _run_tests_${PROJECT_NAME})
  endif()
  # create meta target to trigger all tests of a specific type of a project
  if(NOT TARGET run_tests_${PROJECT_NAME}_${type})
    add_custom_target(run_tests_${PROJECT_NAME}_${type})
    add_dependencies(run_tests_${PROJECT_NAME} run_tests_${PROJECT_NAME}_${type})
    # hidden meta target which depends on hidden test targets which depend on clean_test_results
    add_custom_target(_run_tests_${PROJECT_NAME}_${type})
    add_dependencies(_run_tests_${PROJECT_NAME} _run_tests_${PROJECT_NAME}_${type})
  endif()
  if(NOT DEFINED CATKIN_ENABLE_TESTING OR CATKIN_ENABLE_TESTING)
    # create target for test execution
    set(results ${CATKIN_TEST_RESULTS_DIR}/${PROJECT_NAME}/${xunit_filename})
    if (_testing_WORKING_DIRECTORY)
      set(working_dir_arg "--working-dir" ${_testing_WORKING_DIRECTORY})
    endif()
    assert(CATKIN_ENV)
    set(cmd_wrapper ${CATKIN_ENV} ${PYTHON_EXECUTABLE}
      ${catkin_EXTRAS_DIR}/test/run_tests.py ${results} ${working_dir_arg})
    # for ctest the command needs to return non-zero if any test failed
    set(cmd ${cmd_wrapper} "--return-code" ${_testing_COMMAND})
    add_test(NAME _ctest_${PROJECT_NAME}_${type}_${name} COMMAND ${cmd})
    # for the run_tests target the command needs to return zero so that testing is not aborted
    set(cmd ${cmd_wrapper} ${_testing_COMMAND})
    add_custom_target(run_tests_${PROJECT_NAME}_${type}_${name}
      COMMAND ${cmd}
      VERBATIM
    )
  else()
    # create empty dummy target
    set(cmd "${CMAKE_COMMAND}" "-E" "echo" "Skipping test target \\'run_tests_${PROJECT_NAME}_${type}_${name}\\'. Enable testing via -DCATKIN_ENABLE_TESTING.")
    add_custom_target(run_tests_${PROJECT_NAME}_${type}_${name} ${cmd})
  endif()
  add_dependencies(run_tests_${PROJECT_NAME}_${type} run_tests_${PROJECT_NAME}_${type}_${name})
  if(_testing_DEPENDENCIES)
    add_dependencies(run_tests_${PROJECT_NAME}_${type}_${name} ${_testing_DEPENDENCIES})
  endif()
  # hidden test target which depends on building all tests and cleaning test results
  add_custom_target(_run_tests_${PROJECT_NAME}_${type}_${name}
    COMMAND ${cmd}
    VERBATIM
  )
  add_dependencies(_run_tests_${PROJECT_NAME}_${type} _run_tests_${PROJECT_NAME}_${type}_${name})

  # create target to clean project specific test results
  if(NOT TARGET clean_test_results_${PROJECT_NAME})
    add_custom_target(clean_test_results_${PROJECT_NAME}
      COMMAND ${PYTHON_EXECUTABLE} "${catkin_EXTRAS_DIR}/test/remove_test_results.py" "${CATKIN_TEST_RESULTS_DIR}/${PROJECT_NAME}"
      VERBATIM
    )
  endif()
  add_dependencies(_run_tests_${PROJECT_NAME}_${type}_${name} clean_test_results_${PROJECT_NAME} tests ${_testing_DEPENDENCIES})
endfunction()


text:
#include <cstdlib>
#include <sstream>
#include <iostream>

#include <thrift/config.h>
#include <thrift/transport/THttpServer.h>
#include <thrift/transport/TSocket.h>
#if defined(_MSC_VER) || defined(__MINGW32__)
  #include <Shlwapi.h>
#endif

using std::string;

namespace apache {
namespace thrift {
namespace transport {

THttpServer::THttpServer(stdcxx::shared_ptr<TTransport> transport) : THttpTransport(transport) {
}

THttpServer::~THttpServer() {
}

#if defined(_MSC_VER) || defined(__MINGW32__)
  #define THRIFT_GMTIME(TM, TIME)             gmtime_s(&TM, &TIME)
  #define THRIFT_strncasecmp(str1, str2, len) _strnicmp(str1, str2, len)
  #define THRIFT_strcasestr(haystack, needle) StrStrIA(haystack, needle)
#else
  #define THRIFT_GMTIME(TM, TIME)             gmtime_r(&TIME, &TM)
  #define THRIFT_strncasecmp(str1, str2, len) strncasecmp(str1, str2, len)
  #define THRIFT_strcasestr(haystack, needle) strcasestr(haystack, needle)
#endif

void THttpServer::parseHeader(char* header) {
  char* colon = strchr(header, ':');
  if (colon == NULL) {
    return;
  }
  size_t sz = colon - header;
  char* value = colon + 1;

  if (THRIFT_strncasecmp(header, "Transfer-Encoding", sz) == 0) {
    if (THRIFT_strcasestr(value, "chunked") != NULL) {
      chunked_ = true;
    }
  } else if (THRIFT_strncasecmp(header, "Content-length", sz) == 0) {
    chunked_ = false;
    contentLength_ = atoi(value);
  } else if (strncmp(header, "X-Forwarded-For", sz) == 0) {
    origin_ = value;
  }
}

bool THttpServer::parseStatusLine(char* status) {
  char* method = status;

  char* path = strchr(method, ' ');
  if (path == NULL) {
    throw TTransportException(string("Bad Status: ") + status);
  }

  *path = '\0';
  while (*(++path) == ' ') {
  };

  char* http = strchr(path, ' ');
  if (http == NULL) {
    throw TTransportException(string("Bad Status: ") + status);
  }
  *http = '\0';

  if (strcmp(method, "POST") == 0) {
    // POST method ok, looking for content.
    return true;
  } else if (strcmp(method, "OPTIONS") == 0) {
    // preflight OPTIONS method, we don't need further content.
    // how to graciously close connection?
    uint8_t* buf;
    uint32_t len;
    writeBuffer_.getBuffer(&buf, &len);

    // Construct the HTTP header
    std::ostringstream h;
    h << "HTTP/1.1 200 OK" << CRLF << "Date: " << getTimeRFC1123() << CRLF
      << "Access-Control-Allow-Origin: *" << CRLF << "Access-Control-Allow-Methods: POST, OPTIONS"
      << CRLF << "Access-Control-Allow-Headers: Content-Type" << CRLF << CRLF;
    string header = h.str();

    // Write the header, then the data, then flush
    transport_->write((const uint8_t*)header.c_str(), static_cast<uint32_t>(header.size()));
    transport_->write(buf, len);
    transport_->flush();

    // Reset the buffer and header variables
    writeBuffer_.resetBuffer();
    readHeaders_ = true;
    return true;
  }
  throw TTransportException(string("Bad Status (unsupported method): ") + status);
}

void THttpServer::flush() {
  // Fetch the contents of the write buffer
  uint8_t* buf;
  uint32_t len;
  writeBuffer_.getBuffer(&buf, &len);

  // Construct the HTTP header
  std::ostringstream h;
  h << "HTTP/1.1 200 OK" << CRLF << "Date: " << getTimeRFC1123() << CRLF << "Server: Thrift/"
    << PACKAGE_VERSION << CRLF << "Access-Control-Allow-Origin: *" << CRLF
    << "Content-Type: application/x-thrift" << CRLF << "Content-Length: " << len << CRLF
    << "Connection: Keep-Alive" << CRLF << CRLF;
  string header = h.str();

  // Write the header, then the data, then flush
  // cast should be fine, because none of "header" is under attacker control
  transport_->write((const uint8_t*)header.c_str(), static_cast<uint32_t>(header.size()));
  transport_->write(buf, len);
  transport_->flush();

  // Reset the buffer and header variables
  writeBuffer_.resetBuffer();
  readHeaders_ = true;
}

std::string THttpServer::getTimeRFC1123() {
  static const char* Days[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
  static const char* Months[]
      = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
  char buff[128];

  time_t t = time(NULL);
  struct tm tmb;
  THRIFT_GMTIME(tmb, t);

  sprintf(buff,
          "%s, %d %s %d %d:%d:%d GMT",
          Days[tmb.tm_wday],
          tmb.tm_mday,
          Months[tmb.tm_mon],
          tmb.tm_year + 1900,
          tmb.tm_hour,
          tmb.tm_min,
          tmb.tm_sec);
  return std::string(buff);
}
}
}
} // apache::thrift::transport


text:
package com.alibaba.json.bvt.parser;

import java.io.StringReader;

import org.junit.Assert;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONReader;

import junit.framework.TestCase;

public class UnquoteNameTest extends TestCase {
    public void test_unquote() throws Exception {
        String text = "{_id:1001}";

        Model model = JSON.parseObject(text, Model.class);
        Assert.assertEquals(1001, model._id);
    }

    public void test_unquote_parse() throws Exception {
        String text = "{ _id:1001}";

        JSONObject model = JSON.parseObject(text);
        Assert.assertEquals(1001, model.get("_id"));
    }

    public void test_unquote_parse_1() throws Exception {
        String text = "{ $id:1001}";

        JSONObject model = JSON.parseObject(text);
        Assert.assertEquals(1001, model.get("$id"));
    }

    public void test_unquote_reader() throws Exception {
        String text = "{_id:1001}";

        JSONReader reader = new JSONReader(new StringReader(text));
        Model model = reader.readObject(Model.class);
        Assert.assertEquals(1001, model._id);
        reader.close();
    }

    public void test_unquote_reader_parse() throws Exception {
        String text = "{_id:1001}";

        JSONReader reader = new JSONReader(new StringReader(text));
        JSONObject model = (JSONObject) reader.readObject();
        Assert.assertEquals(1001, model.get("_id"));
        reader.close();
    }

    public void test_obj() throws Exception {
        JSONReader reader = new JSONReader(new StringReader("{_id:123}"));

        reader.startObject();
        Assert.assertEquals("_id", reader.readString());
        Assert.assertEquals(Integer.valueOf(123), reader.readInteger());
        reader.endObject();

        reader.close();
    }

    public void test_obj_1() throws Exception {
        JSONReader reader = new JSONReader(new StringReader("{$id:123}"));

        reader.startObject();
        Assert.assertEquals("$id", reader.readString());
        Assert.assertEquals(Integer.valueOf(123), reader.readInteger());
        reader.endObject();

        reader.close();
    }

    public static class Model {
        public int _id;
    }
}


text:
#ifndef LIBGAV1_SRC_UTILS_COMMON_H_
#define LIBGAV1_SRC_UTILS_COMMON_H_

#if defined(_MSC_VER)
#include <intrin.h>
#pragma intrinsic(_BitScanForward)
#pragma intrinsic(_BitScanReverse)
#if defined(_M_X64) || defined(_M_ARM) || defined(_M_ARM64)
#pragma intrinsic(_BitScanReverse64)
#define HAVE_BITSCANREVERSE64
#endif  // defined(_M_X64) || defined(_M_ARM) || defined(_M_ARM64)
#endif  // defined(_MSC_VER)

#include <cassert>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <type_traits>

#include "src/utils/bit_mask_set.h"
#include "src/utils/constants.h"
#include "src/utils/types.h"

namespace libgav1 {

// Aligns |value| to the desired |alignment|. |alignment| must be a power of 2.
template <typename T>
inline T Align(T value, T alignment) {
  assert(alignment != 0);
  const T alignment_mask = alignment - 1;
  return (value + alignment_mask) & ~alignment_mask;
}

// Aligns |addr| to the desired |alignment|. |alignment| must be a power of 2.
inline uint8_t* AlignAddr(uint8_t* const addr, const uintptr_t alignment) {
  const auto value = reinterpret_cast<uintptr_t>(addr);
  return reinterpret_cast<uint8_t*>(Align(value, alignment));
}

inline int32_t Clip3(int32_t value, int32_t low, int32_t high) {
  return value < low ? low : (value > high ? high : value);
}

// The following 2 templates set a block of data with uncontiguous memory to
// |value|. The compilers usually generate several branches to handle different
// cases of |columns| when inlining memset() and std::fill(), and these branches
// are unfortunately within the loop of |rows|. So calling these templates
// directly could be inefficient. It is recommended to specialize common cases
// of |columns|, such as 1, 2, 4, 8, 16 and 32, etc. in advance before
// processing the generic case of |columns|. The code size may be larger, but
// there would be big speed gains.
// Call template MemSetBlock<> when sizeof(|T|) is 1.
// Call template SetBlock<> when sizeof(|T|) is larger than 1.
template <typename T>
void MemSetBlock(int rows, int columns, T value, T* dst, ptrdiff_t stride) {
  static_assert(sizeof(T) == 1, "");
  do {
    memset(dst, value, columns);
    dst += stride;
  } while (--rows != 0);
}

template <typename T>
void SetBlock(int rows, int columns, T value, T* dst, ptrdiff_t stride) {
  do {
    std::fill(dst, dst + columns, value);
    dst += stride;
  } while (--rows != 0);
}

#if defined(__GNUC__)

inline int CountLeadingZeros(uint32_t n) {
  assert(n != 0);
  return __builtin_clz(n);
}

inline int CountLeadingZeros(uint64_t n) {
  assert(n != 0);
  return __builtin_clzll(n);
}

inline int CountTrailingZeros(uint32_t n) {
  assert(n != 0);
  return __builtin_ctz(n);
}

#elif defined(_MSC_VER)

inline int CountLeadingZeros(uint32_t n) {
  assert(n != 0);
  unsigned long first_set_bit;  // NOLINT(runtime/int)
  const unsigned char bit_set = _BitScanReverse(&first_set_bit, n);
  assert(bit_set != 0);
  static_cast<void>(bit_set);
  return 31 - static_cast<int>(first_set_bit);
}

inline int CountLeadingZeros(uint64_t n) {
  assert(n != 0);
  unsigned long first_set_bit;  // NOLINT(runtime/int)
#if defined(HAVE_BITSCANREVERSE64)
  const unsigned char bit_set =
      _BitScanReverse64(&first_set_bit, static_cast<unsigned __int64>(n));
#else   // !defined(HAVE_BITSCANREVERSE64)
  const auto n_hi = static_cast<unsigned long>(n >> 32);  // NOLINT(runtime/int)
  if (n_hi != 0) {
    const unsigned char bit_set = _BitScanReverse(&first_set_bit, n_hi);
    assert(bit_set != 0);
    static_cast<void>(bit_set);
    return 31 - static_cast<int>(first_set_bit);
  }
  const unsigned char bit_set = _BitScanReverse(
      &first_set_bit, static_cast<unsigned long>(n));  // NOLINT(runtime/int)
#endif  // defined(HAVE_BITSCANREVERSE64)
  assert(bit_set != 0);
  static_cast<void>(bit_set);
  return 63 - static_cast<int>(first_set_bit);
}

#undef HAVE_BITSCANREVERSE64

inline int CountTrailingZeros(uint32_t n) {
  assert(n != 0);
  unsigned long first_set_bit;  // NOLINT(runtime/int)
  const unsigned char bit_set = _BitScanForward(&first_set_bit, n);
  assert(bit_set != 0);
  static_cast<void>(bit_set);
  return static_cast<int>(first_set_bit);
}

#else  // !defined(__GNUC__) && !defined(_MSC_VER)

template <const int kMSB, typename T>
inline int CountLeadingZeros(T n) {
  assert(n != 0);
  const T msb = T{1} << kMSB;
  int count = 0;
  while ((n & msb) == 0) {
    ++count;
    n <<= 1;
  }
  return count;
}

inline int CountLeadingZeros(uint32_t n) { return CountLeadingZeros<31>(n); }

inline int CountLeadingZeros(uint64_t n) { return CountLeadingZeros<63>(n); }

// This is the algorithm on the left in Figure 5-23, Hacker's Delight, Second
// Edition, page 109. The book says:
//   If the number of trailing 0's is expected to be small or large, then the
//   simple loops shown in Figure 5-23 are quite fast.
inline int CountTrailingZeros(uint32_t n) {
  assert(n != 0);
  // Create a word with 1's at the positions of the trailing 0's in |n|, and
  // 0's elsewhere (e.g., 01011000 => 00000111).
  n = ~n & (n - 1);
  int count = 0;
  while (n != 0) {
    ++count;
    n >>= 1;
  }
  return count;
}

#endif  // defined(__GNUC__)

inline int FloorLog2(int32_t n) {
  assert(n > 0);
  return 31 - CountLeadingZeros(static_cast<uint32_t>(n));
}

inline int FloorLog2(uint32_t n) {
  assert(n > 0);
  return 31 - CountLeadingZeros(n);
}

inline int FloorLog2(int64_t n) {
  assert(n > 0);
  return 63 - CountLeadingZeros(static_cast<uint64_t>(n));
}

inline int FloorLog2(uint64_t n) {
  assert(n > 0);
  return 63 - CountLeadingZeros(n);
}

inline int CeilLog2(unsigned int n) {
  // The expression FloorLog2(n - 1) + 1 is undefined not only for n == 0 but
  // also for n == 1, so this expression must be guarded by the n < 2 test. An
  // alternative implementation is:
  // return (n == 0) ? 0 : FloorLog2(n) + static_cast<int>((n & (n - 1)) != 0);
  return (n < 2) ? 0 : FloorLog2(n - 1) + 1;
}

constexpr int Ceil(int dividend, int divisor) {
  return dividend / divisor + static_cast<int>(dividend % divisor != 0);
}

inline int32_t RightShiftWithRounding(int32_t value, int bits) {
  assert(bits >= 0);
  return (value + ((1 << bits) >> 1)) >> bits;
}

inline uint32_t RightShiftWithRounding(uint32_t value, int bits) {
  assert(bits >= 0);
  return (value + ((1 << bits) >> 1)) >> bits;
}

// This variant is used when |value| can exceed 32 bits. Although the final
// result must always fit into int32_t.
inline int32_t RightShiftWithRounding(int64_t value, int bits) {
  assert(bits >= 0);
  return static_cast<int32_t>((value + ((int64_t{1} << bits) >> 1)) >> bits);
}

inline int32_t RightShiftWithRoundingSigned(int32_t value, int bits) {
  assert(bits > 0);
  // The next line is equivalent to:
  // return (value >= 0) ? RightShiftWithRounding(value, bits)
  //                     : -RightShiftWithRounding(-value, bits);
  return RightShiftWithRounding(value + (value >> 31), bits);
}

// This variant is used when |value| can exceed 32 bits. Although the final
// result must always fit into int32_t.
inline int32_t RightShiftWithRoundingSigned(int64_t value, int bits) {
  assert(bits > 0);
  // The next line is equivalent to:
  // return (value >= 0) ? RightShiftWithRounding(value, bits)
  //                     : -RightShiftWithRounding(-value, bits);
  return RightShiftWithRounding(value + (value >> 63), bits);
}

constexpr int DivideBy2(int n) { return n >> 1; }
constexpr int DivideBy4(int n) { return n >> 2; }
constexpr int DivideBy8(int n) { return n >> 3; }
constexpr int DivideBy16(int n) { return n >> 4; }
constexpr int DivideBy32(int n) { return n >> 5; }
constexpr int DivideBy64(int n) { return n >> 6; }
constexpr int DivideBy128(int n) { return n >> 7; }

// Convert |value| to unsigned before shifting to avoid undefined behavior with
// negative values.
inline int LeftShift(int value, int bits) {
  assert(bits >= 0);
  assert(value >= -(int64_t{1} << (31 - bits)));
  assert(value <= (int64_t{1} << (31 - bits)) - ((bits == 0) ? 1 : 0));
  return static_cast<int>(static_cast<uint32_t>(value) << bits);
}
inline int MultiplyBy2(int n) { return LeftShift(n, 1); }
inline int MultiplyBy4(int n) { return LeftShift(n, 2); }
inline int MultiplyBy8(int n) { return LeftShift(n, 3); }
inline int MultiplyBy16(int n) { return LeftShift(n, 4); }
inline int MultiplyBy32(int n) { return LeftShift(n, 5); }
inline int MultiplyBy64(int n) { return LeftShift(n, 6); }

constexpr int Mod32(int n) { return n & 0x1f; }
constexpr int Mod64(int n) { return n & 0x3f; }

//------------------------------------------------------------------------------
// Bitstream functions

constexpr bool IsIntraFrame(FrameType type) {
  return type == kFrameKey || type == kFrameIntraOnly;
}

inline TransformClass GetTransformClass(TransformType tx_type) {
  constexpr BitMaskSet kTransformClassVerticalMask(
      kTransformTypeIdentityDct, kTransformTypeIdentityAdst,
      kTransformTypeIdentityFlipadst);
  if (kTransformClassVerticalMask.Contains(tx_type)) {
    return kTransformClassVertical;
  }
  constexpr BitMaskSet kTransformClassHorizontalMask(
      kTransformTypeDctIdentity, kTransformTypeAdstIdentity,
      kTransformTypeFlipadstIdentity);
  if (kTransformClassHorizontalMask.Contains(tx_type)) {
    return kTransformClassHorizontal;
  }
  return kTransformClass2D;
}

inline int RowOrColumn4x4ToPixel(int row_or_column4x4, Plane plane,
                                 int8_t subsampling) {
  return MultiplyBy4(row_or_column4x4) >> (plane == kPlaneY ? 0 : subsampling);
}

constexpr PlaneType GetPlaneType(Plane plane) {
  return static_cast<PlaneType>(plane != kPlaneY);
}

// 5.11.44.
constexpr bool IsDirectionalMode(PredictionMode mode) {
  return mode >= kPredictionModeVertical && mode <= kPredictionModeD67;
}

// 5.9.3.
//
// |a| and |b| are order hints, treated as unsigned order_hint_bits-bit
// integers. |order_hint_shift_bits| equals (32 - order_hint_bits) % 32.
// order_hint_bits is at most 8, so |order_hint_shift_bits| is zero or a
// value between 24 and 31 (inclusive).
//
// If |order_hint_shift_bits| is zero, |a| and |b| are both zeros, and the
// result is zero. If |order_hint_shift_bits| is not zero, returns the
// signed difference |a| - |b| using "modular arithmetic". More precisely, the
// signed difference |a| - |b| is treated as a signed order_hint_bits-bit
// integer and cast to an int. The returned difference is between
// -(1 << (order_hint_bits - 1)) and (1 << (order_hint_bits - 1)) - 1
// (inclusive).
//
// NOTE: |a| and |b| are the order_hint_bits least significant bits of the
// actual values. This function returns the signed difference between the
// actual values. The returned difference is correct as long as the actual
// values are not more than 1 << (order_hint_bits - 1) - 1 apart.
//
// Example: Suppose order_hint_bits is 4 and |order_hint_shift_bits|
// is 28. Then |a| and |b| are in the range [0, 15], and the actual values for
// |a| and |b| must not be more than 7 apart. (If the actual values for |a| and
// |b| are exactly 8 apart, this function cannot tell whether the actual value
// for |a| is before or after the actual value for |b|.)
//
// First, consider the order hints 2 and 6. For this simple case, we have
//   GetRelativeDistance(2, 6, 28) = 2 - 6 = -4, and
//   GetRelativeDistance(6, 2, 28) = 6 - 2 = 4.
//
// On the other hand, consider the order hints 2 and 14. The order hints are
// 12 (> 7) apart, so we need to use the actual values instead. The actual
// values may be 34 (= 2 mod 16) and 30 (= 14 mod 16), respectively. Therefore
// we have
//   GetRelativeDistance(2, 14, 28) = 34 - 30 = 4, and
//   GetRelativeDistance(14, 2, 28) = 30 - 34 = -4.
//
// The following comments apply only to specific CPUs' SIMD implementations,
// such as intrinsics code.
// For the 2 shift operations in this function, if the SIMD packed data is
// 16-bit wide, try to use |order_hint_shift_bits| - 16 as the number of bits to
// shift; If the SIMD packed data is 8-bit wide, try to use
// |order_hint_shift_bits| - 24 as as the number of bits to shift.
// |order_hint_shift_bits| - 16 and |order_hint_shift_bits| - 24 could be -16 or
// -24. In these cases diff is 0, and the behavior of left or right shifting -16
// or -24 bits is defined for x86 SIMD instructions and ARM NEON instructions,
// and the result of shifting 0 is still 0. There is no guarantee that this
// behavior and result apply to other CPUs' SIMD instructions.
inline int GetRelativeDistance(const unsigned int a, const unsigned int b,
                               const unsigned int order_hint_shift_bits) {
  const int diff = a - b;
  assert(order_hint_shift_bits <= 31);
  if (order_hint_shift_bits == 0) {
    assert(a == 0);
    assert(b == 0);
  } else {
    assert(order_hint_shift_bits >= 24);  // i.e., order_hint_bits <= 8
    assert(a < (1u << (32 - order_hint_shift_bits)));
    assert(b < (1u << (32 - order_hint_shift_bits)));
    assert(diff < (1 << (32 - order_hint_shift_bits)));
    assert(diff >= -(1 << (32 - order_hint_shift_bits)));
  }
  // Sign extend the result of subtracting the values.
  // Cast to unsigned int and then left shift to avoid undefined behavior with
  // negative values. Cast to int to do the sign extension through right shift.
  // This requires the right shift of a signed integer be an arithmetic shift,
  // which is true for clang, gcc, and Visual C++.
  // These two casts do not generate extra instructions.
  // Don't use LeftShift(diff) since a valid diff may fail its assertions.
  // For example, GetRelativeDistance(2, 14, 28), diff equals -12 and is less
  // than the minimum allowed value of LeftShift() which is -8.
  // The next 3 lines are equivalent to:
  // const int order_hint_bits = Mod32(32 - order_hint_shift_bits);
  // const int m = (1 << order_hint_bits) >> 1;
  // return (diff & (m - 1)) - (diff & m);
  return static_cast<int>(static_cast<unsigned int>(diff)
                          << order_hint_shift_bits) >>
         order_hint_shift_bits;
}

// Applies |sign| (must be 0 or -1) to |value|, i.e.,
//   return (sign == 0) ? value : -value;
// and does so without a branch.
constexpr int ApplySign(int value, int sign) { return (value ^ sign) - sign; }

// 7.9.3. (without the clamp for numerator and denominator).
inline void GetMvProjection(const MotionVector& mv, int numerator,
                            int denominator, MotionVector* projection_mv) {
  // Allow numerator and denominator to be 0 so that this function can be called
  // unconditionally. When either numerator or denominator is 0, |projection_mv|
  // will be 0, and this is what we want.
  assert(std::abs(numerator) <= kMaxFrameDistance);
  assert(denominator >= 0);
  assert(denominator <= kMaxFrameDistance);
  for (int i = 0; i < 2; ++i) {
    projection_mv->mv[i] = Clip3(
        RightShiftWithRoundingSigned(
            mv.mv[i] * numerator * kProjectionMvDivisionLookup[denominator],
            14),
        -kProjectionMvClamp, kProjectionMvClamp);
  }
}

// 7.9.4.
constexpr int Project(int value, int delta, int dst_sign) {
  return value + ApplySign(delta / 64, dst_sign);
}

inline bool IsBlockSmallerThan8x8(BlockSize size) {
  return size < kBlock8x8 && size != kBlock4x16;
}

// Returns true if the either the width or the height of the block is equal to
// four.
inline bool IsBlockDimension4(BlockSize size) {
  return size < kBlock8x8 || size == kBlock16x4;
}

// Converts bitdepth 8, 10, and 12 to array index 0, 1, and 2, respectively.
constexpr int BitdepthToArrayIndex(int bitdepth) { return (bitdepth - 8) >> 1; }

// Maps a square transform to an index between [0, 4]. kTransformSize4x4 maps
// to 0, kTransformSize8x8 maps to 1 and so on.
inline int TransformSizeToSquareTransformIndex(TransformSize tx_size) {
  assert(kTransformWidth[tx_size] == kTransformHeight[tx_size]);

  // The values of the square transform sizes happen to be in the right
  // ranges, so we can just divide them by 4 to get the indexes.
  static_assert(
      std::is_unsigned<std::underlying_type<TransformSize>::type>::value, "");
  static_assert(kTransformSize4x4 < 4, "");
  static_assert(4 <= kTransformSize8x8 && kTransformSize8x8 < 8, "");
  static_assert(8 <= kTransformSize16x16 && kTransformSize16x16 < 12, "");
  static_assert(12 <= kTransformSize32x32 && kTransformSize32x32 < 16, "");
  static_assert(16 <= kTransformSize64x64 && kTransformSize64x64 < 20, "");
  return DivideBy4(tx_size);
}

// Gets the corresponding Y/U/V position, to set and get filter masks
// in deblock filtering.
// Returns luma_position if it's Y plane, whose subsampling must be 0.
// Returns the odd position for U/V plane, if there is subsampling.
constexpr int GetDeblockPosition(const int luma_position,
                                 const int subsampling) {
  return luma_position | subsampling;
}

// Returns the size of the residual buffer required to hold the residual values
// for a block or frame of size |rows| by |columns| (taking into account
// |subsampling_x|, |subsampling_y| and |residual_size|). |residual_size| is the
// number of bytes required to represent one residual value.
inline size_t GetResidualBufferSize(const int rows, const int columns,
                                    const int subsampling_x,
                                    const int subsampling_y,
                                    const size_t residual_size) {
  // The subsampling multipliers are:
  //   Both x and y are subsampled: 3 / 2.
  //   Only x or y is subsampled: 2 / 1 (which is equivalent to 4 / 2).
  //   Both x and y are not subsampled: 3 / 1 (which is equivalent to 6 / 2).
  // So we compute the final subsampling multiplier as follows:
  //   multiplier = (2 + (4 >> subsampling_x >> subsampling_y)) / 2.
  // Add 32 * |kResidualPaddingVertical| padding to avoid bottom boundary checks
  // when parsing quantized coefficients.
  const int subsampling_multiplier_num =
      2 + (4 >> subsampling_x >> subsampling_y);
  const int number_elements =
      (rows * columns * subsampling_multiplier_num) >> 1;
  const int tx_padding = 32 * kResidualPaddingVertical;
  return residual_size * (number_elements + tx_padding);
}

// This function is equivalent to:
// std::min({kTransformWidthLog2[tx_size] - 2,
//           kTransformWidthLog2[left_tx_size] - 2,
//           2});
constexpr LoopFilterTransformSizeId GetTransformSizeIdWidth(
    TransformSize tx_size, TransformSize left_tx_size) {
  return static_cast<LoopFilterTransformSizeId>(
      static_cast<int>(tx_size > kTransformSize4x16 &&
                       left_tx_size > kTransformSize4x16) +
      static_cast<int>(tx_size > kTransformSize8x32 &&
                       left_tx_size > kTransformSize8x32));
}

// This is used for 7.11.3.4 Block Inter Prediction Process, to select convolve
// filters.
inline int GetFilterIndex(const int filter_index, const int length) {
  if (length <= 4) {
    if (filter_index == kInterpolationFilterEightTap ||
        filter_index == kInterpolationFilterEightTapSharp) {
      return 4;
    }
    if (filter_index == kInterpolationFilterEightTapSmooth) {
      return 5;
    }
  }
  return filter_index;
}

constexpr int SubsampledValue(int value, int subsampling) {
  return (value + subsampling) >> subsampling;
}

}  // namespace libgav1

#endif  // LIBGAV1_SRC_UTILS_COMMON_H_


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

using LibNLPCSharp.util;
using LibNLPCSharp.simpletokenizing;

using LibHTreeProcessing.src.simplexml;
using LibHTreeProcessing.src.treesearch;
using LibHTreeProcessing.src.transformation2.impl;

namespace LibHTreeProcessing.src.transformation2.operations
{

	public class RemoveAllChildren_ParserComponent : AbstractOperationParserComponent
	{

		////////////////////////////////////////////////////////////////
		// Constants
		////////////////////////////////////////////////////////////////

		////////////////////////////////////////////////////////////////
		// Variables
		////////////////////////////////////////////////////////////////

		////////////////////////////////////////////////////////////////
		// Constructors
		////////////////////////////////////////////////////////////////

		public RemoveAllChildren_ParserComponent()
			: base(EnumDataType.SingleNode)
		{
		}

		////////////////////////////////////////////////////////////////
		// Properties
		////////////////////////////////////////////////////////////////

		public override string[] ShortHelp
		{
			get {
				return new string[] {
					"remove all children"
				};
			}
		}

		public override string[] LongHelpText
		{
			get {
				return new string[] {
					"This operator will remove all child nodes and child text chunks of the nodes received. Only attributes will remain untouched."
				};
			}
		}

		////////////////////////////////////////////////////////////////
		// Methods
		////////////////////////////////////////////////////////////////

		public override AbstractOperation TryParse(IParsingContext ctx, TokenStream tokens)
		{
			int lineNo = tokens.LineNumber;

			Token[] tokensMatched;

			if ((tokensMatched = tokens.TryEatSequence(
				TokenPattern.MatchWord("remove"),
				TokenPattern.MatchWord("all"),
				TokenPattern.MatchWord("children")
				)) == null)
				return null;

			return new RemoveAllChildren_Operation(lineNo);
		}

	}

}


text:
<?php
/**
 * The template part for displaying a message that posts cannot be found.
 *
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package Briar
 * @since 1.0
 */
?>

	<div <?php post_class( array( 'post-item', 'clearfix' ) ); ?>>
		<div class="<?php if ( has_post_thumbnail() ) : ?>col-sm-8<?php else : ?>col-sm-12<?php endif; ?>">

<?php _e( 'Nothing Found', 'briar' ); ?>

			<?php if ( is_home() && current_user_can( 'publish_posts' ) ) : ?>

<?php printf( __( 'Ready to publish your first post? Get started here.', 'briar' ), esc_url( admin_url( 'post-new.php' ) ) ); ?>

			<?php elseif ( is_search() ) : ?>

<?php _e( 'Sorry, but nothing matched your search terms. Please try again with some different keywords.', 'briar' ); ?>

			<?php get_search_form(); ?>

			<?php else : ?>

<?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'briar' ); ?>

			<?php get_search_form(); ?>

			<?php endif; ?>


text:
<!DOCTYPE html>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>Startuply</title>
  <link rel="shortcut icon" href="/images/favicon.ico">
  <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css">


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Icones Fungorum Javan 91 (1904)

#### Original name
Diplodia arthrophylli Penz. & Sacc.

### Remarks
null


text:
var url = require('url')
var http = require('http')
var https = require('https')

module.exports = function (inherits, EventEmitter, Endpoint, RequestSet) {

	//////////////////////////////////////
	//
	//  Pool
	//
	// nodes: array of strings formatted like 'ip:port'
	//
	// options:
	// {
	//    maxPending: number of pending requests allowed (1000)
	//    ping: ping path (default = no ping checks)
	//    pingTimeout: number (milliseconds) default 2000
	//    retryFilter: function (response) { return true to reject response and retry }
	//    retryDelay: number (milliseconds) default 20
	//    keepAlive: use an alternate Agent that does keep-alive properly (boolean) default false
	//    name: string (optional)
	//    maxRetries: number (default = 5)
	//    agentOptions: {} an object for passing options directly to the Http Agent
	// }
	function Pool(http, nodes, options) {
		options = options || {}
		if (!http || !http.request || !http.Agent) {
			throw new Error('invalid http module')
		}

		options.retryFilter = options.retryFilter || options.retry_filter
		options.retryDelay = options.retryDelay || options.retry_delay
		options.ping = options.ping || options.path
		options.maxRetries = options.maxRetries === 0 ? 0 : options.maxRetries || 5

		if (!options.retryDelay && options.retryDelay !== 0) {
			options.retryDelay = 20
		}

		this.http = http
		this.name = options.name
		this.options = options
		this.maxPending = options.maxPending || 1000
		this.nodes = []
		if (Array.isArray(nodes)) {
			for (var i = 0; i < nodes.length; i++) {
				this.addNode(nodes[i])
			}
		}

		if (this.nodes.length === 0) {
			throw new Error('no valid nodes')
		}
		this.length = this.nodes.length
	}
	inherits(Pool, EventEmitter)

	Pool.request = function (options, data, cb) {
		if (typeof(options) === 'string') {
			options = { url: options }
		}
		var uri = url.parse(options.url)
		var secure = (uri.protocol === 'https:')
		var host = uri.host
		var port = uri.port || secure ? 443 : 80
		options.path = uri.path
		var p = new Pool(
			secure ? https : http,
			[host + ':' + port]
		)
		p.request(options, data, cb)
	}

	// Bound handlers

	function node_health_changed(node) {
		this.emit('health', node.ip + ':' + node.port + ' health: ' + node.healthy)
	}

	function node_timed_out(request) {
		this.emit('timeout', request.node.ip + ':' + request.node.port + request.options.path)
	}

	// returns an array of healthy Endpoints
	Pool.prototype.healthy_nodes = function () {
		var healthy = [], len = this.nodes.length
		for (var i = 0; i < len; i++) {
			var n = this.nodes[i]
			if (n.healthy) {
				healthy.push(n)
			}
		}
		return healthy
	}
	Pool.prototype.healthyNodes = Pool.prototype.healthy_nodes

	Pool.prototype.onRetry = function (err) {
		this.emit('retrying', err)
	}

	function optionsFu(options) {
		return (typeof options === 'string') ? { path: options } : (options || {})
	}

	// options:
	// {
	//   path: string
	//   method: ['POST', 'GET', 'PUT', 'DELETE', 'HEAD'] (GET)
	//   retryFilter: function (response) { return true to reject response and retry }
	//   attempts: number (optional, default = nodes.length)
	//   retryDelay: number (milliseconds) default Pool.retry_delay
	//   timeout: request timeout in ms
	//   encoding: response body encoding (utf8)
	//   stream: stream instead of buffer response body (default based on callback)
	// }
	//
	// data: string, buffer, or stream (optional)
	//
	// callback:
	// function(err, res, body) {}
	// function(err, res) {}
	Pool.prototype.request = function (options, data, callback) {
		var self = this
		options = optionsFu(options)

		if (!options.data && (typeof data === 'string' || Buffer.isBuffer(data))) {
			options.data = data
		}
		else if (typeof data === 'function') {
			callback = data
		}

		options.method = options.method || 'GET'

		options.retryDelay = options.retryDelay || options.retry_delay
		if (!options.retryDelay && options.retryDelay !== 0) {
			options.retryDelay = this.options.retryDelay
		}

		options.retryFilter = options.retryFilter || options.retry_filter
		if (!options.retryFilter) {
			options.retryFilter = this.options.retryFilter
		}
		options.stream = (options.stream === undefined) ? callback.length === 2 : options.stream

		var started = Date.now()
		RequestSet.request(this, options, function (err, res, body) {
			options.success = !err
			options.reused = res && res.socket && (res.socket._requestCount || 1) > 1
			self.emit('timing', Date.now() - started, options)
			callback(err, res, body)
		})
	}

	Pool.prototype.get = Pool.prototype.request

	Pool.prototype.put = function (options, data, callback) {
		options = optionsFu(options)
		options.method = 'PUT'
		return this.request(options, data, callback)
	}

	Pool.prototype.post = function (options, data, callback) {
		options = optionsFu(options)
		options.method = 'POST'
		return this.request(options, data, callback)
	}

	Pool.prototype.del = function (options, callback) {
		options = optionsFu(options)
		options.method = 'DELETE'
		options.agent = false // XXX
		return this.request(options, callback)
	}

	Pool.prototype.stats = function () {
		var stats = []
		var len = this.nodes.length
		for (var i = 0; i < len; i++) {
			var node = this.nodes[i]
			stats.push(node.stats())
		}
		return stats
	}

	Pool.prototype.get_node = function () {
		var len = this.nodes.length
		var h = []
		var sum = 0
		var totalPending = 0
		var r = Math.floor(Math.random() * len)
		for (var i = 0; i < len; i++) {
			r = (r + 1) % len
			var node = this.nodes[r]
			if (node.ready()) {
				return node //fast path
			}
			else if (node.healthy) {
				h.push(node)
				sum += node.pending
			}
			totalPending += node.pending
		}
		if (totalPending >= this.maxPending) {
			return Endpoint.overloaded()
		}
		var avg = sum / h.length
		while (h.length) {
			var node = h.pop()
			if (node.pending <= avg) {
				return node
			}
		}
		return Endpoint.unhealthy()
	}

	Pool.prototype.getNode = Pool.prototype.get_node //must keep the old _ api

	Pool.prototype.pending = function () {
		return this.nodes.reduce(function (a, b) { return a + b.pending }, 0)
	}

	Pool.prototype.rate = function () {
		return this.nodes.reduce(function (a, b) { return a + b.requestRate }, 0)
	}

	Pool.prototype.requestCount = function () {
		return this.nodes.reduce(function (a, b) { return a + b.requestCount }, 0)
	}

	Pool.prototype.addNode = function (name) {
		var ip_port = name.split(':')
		var ip = ip_port[0]
		var port = +ip_port[1]
		if (port > 0 && port < 65536) {
			var node = new Endpoint(this.http, ip, port, this.options)
			node.on('health', node_health_changed.bind(this))
			node.on('timeout', node_timed_out.bind(this))
			this.nodes.push(node)
		}
		this.length = this.nodes.length
	}

	Pool.prototype.removeNode = function(name) {
		for (var i = 0; i < this.nodes.length; i++) {
			var n = this.nodes[i]
			if (n.name === name) {
				this.nodes.splice(i, 1)
				i--
			}
		}
		this.length = this.nodes.length
	}

	return Pool
}


text:
			<form role="form" name="auditForm" class="form-horizontal animate-switch-container" data-ng-switch on="activeform">

					<fieldset>
						<legend class="white-font text-center">Step 1: Enter The Following Audit Information (All details are required)</legend>

							Advisor’s Name

								<select name="advisor" class="form-control input-sm" data-ng-model="auditData.mentorId" data-ng-options="ac.academicId as ac.academicName for ac in Academics" required></select>

							Contact Number

								<input type="text" id="contacts" class="form-control input-sm" data-ng-bind="auditData.contact" data-ng-model="auditData.contact" required>

							Current CGPA

								<input type="text" id="cgpa" class="form-control input-sm" data-ng-bind="auditData.cgpa" data-ng-model="auditData.cgpa" required>

							Graduating Session

								<select type="text" id="gradsession" class="form-control input-sm" data-ng-model="auditData.gradSession" required>
									<option value=""></option>
									<option value="1/13/34">1/13/34</option>
									<option value="2/13/34">2/13/34</option>
									<option value="3/13/34">3/13/34</option>
									<option value="1/14/34">1/14/34</option>
									<option value="2/14/34">2/14/34</option>
									<option value="3/14/34">3/14/34</option>
									<option value="1/15/34">1/15/34</option>
									<option value="2/15/34">2/15/34</option>
									<option value="3/15/34">3/15/34</option>
									<option value="1/16/34">1/16/34</option>
									<option value="2/16/34">2/16/34</option>
									<option value="3/16/34">3/16/34</option>
									<option value="1/16/34">1/17/34</option>
									<option value="2/16/34">2/17/34</option>
									<option value="3/16/34">3/17/34</option>
									<option value="1/16/34">1/18/34</option>
									<option value="2/16/34">2/18/34</option>
									<option value="3/16/34">3/18/34</option>
								</select>

							Any Extended Semester?

								<input type="radio" name="extendedSem" id="extensionOption_1" value="Yes" data-ng-model="auditData.extendedSem" required />

								Yes

								<input type="radio" name="extendedSem" id="extensionOption_2" value="No" data-ng-model="auditData.extendedSem" />

								No

							Total Semesters Taken

								<input type="number" id="totalsem" class="form-control input-sm" data-ng-bind="auditData.totalSem" data-ng-model="auditData.totalSem" required />
								*(including extended and defered semester)

							Student Orientation

								<input type="radio" id="orientationOpt_1" value="International" data-ng-model="auditData.orientationOpt" required />

								International Student

								<input type="radio" id="orientationOpt_2" value="Local" data-ng-model="auditData.orientationOpt" />

								Local Student

							Any CE/CT Records

								<input type="radio" id="cectOpt_1" value="Yes" data-ng-model="auditData.cectOpt" required>

								Yes

								<input type="radio" id="cectOpt_2" data-ng-model="auditData.cectOpt" value="No">

								No

								*(Credit Exemption or Credit Transfer)

					</fieldset>

					<fieldset>
						<legend class="white-font text-center">Step 2: You only need to fill this section, if you are a local student</legend>

							SPM BM Results

								<select type="text" id="spmResult" class="form-control input-sm" data-ng-model="auditData.spmResult">
									<option value="NA">N/A</option>
									<option value="1A">1A</option>
									<option value="2A">2A</option>
									<option value="3B">3B</option>
									<option value="4B">4B</option>
									<option value="5C">5C</option>
									<option value="6C">6C</option>
									<option value="7D">7D</option>
									<option value="9G">9G</option>
								</select>

							MUET Results

								<select type="text" id="muetResult" class="form-control input-sm text-left" data-ng-model="auditData.muetResult">
									<option value="NA">N/A</option>
									<option value="Band 6">Band 6</option>
									<option value="Band 5">Band 5</option>
									<option value="Band 4">Band 4</option>
									<option value="Band 3">Band 3</option>
									<option value="Band 2">Band 2</option>
									<option value="Band 1">Band 1</option>
								</select>

IMPORTANT!!

									Drag and drop your spm and muet result BELOW, please make sure
									to name the result file with your matric number e.g. 4102007651_spm.jpg
									and 4102007651_muet.jpg respectively.......

					</fieldset>

					<fieldset>
						<legend class="white-font text-center">Seeing this section means you acknowledged to have done Credit Exemption/Credit Transfer</legend>

								If you're reading this message, it means there's no record of
								your course transfer in our database, please check to make sure
								you've actually done a Credit Exemptions/Credit Transfer or just
								click next if you're here by "accident".If you're sure to have
								actually done any credit exemption or transfer whatsoever, please
								click the REMARK button below

								<button class="btn btn-lg btn-info active" data-target="#courseRemark" data-toggle="modal">Remark</button>

											#
											Course ID
											Course Name
											Course Grade
											Grade Point
											CECT Type

					</fieldset>

					<fieldset>
						<legend class="white-font text-center">Audit Request Information Complete</legend>
					</fieldset>

							Your Audit Information as collected is now prepared for submission,
							please click the send button to enable forwarding to appropriate
							quaters.

							<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
							Sent! Your Audit request has been sent for review.

							<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
							Heads Up! Your Audit request has already been approved, no point in re-applying.

							<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
							Sabar la! Your Audit Request is still pending, please be patient.

							<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
							Oops! Your Audit Request submission failed, change some few things and try again

							<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
							Sorry! We have trouble processing your request now, please try again later

							<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
							Yay! And your CE/CT course remark has been noted!

							<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
							Unfortunately! We cannot seem to process your CE/CT course remark right now

							We advise that you contact your mentor directly for further instructions.

			</form>

				<button class="btn btn-danger active" data-ng-bind="buttons.back" data-ng-click="prevForm()"></button>

				<button class="btn btn-danger active" data-ng-bind="buttons.next" data-ng-click="nextForm()" data-ng-disabled="auditForm.sectionForm1.$invalid"></button>

						<button type="button" class="close" data-dismiss="modal" data-aria-hidden="true" style="background: red">×</button>

Audit Remark for Credit Exemption and Transfer

								Course

									<select class="form-control" data-ng-model="selectedCourse" data-ng-options="course.courses for course in Courses" required></select>

								Result Type

									<select type="text" name="cectResult" class="form-control" data-ng-model="selectedResult" required>
										<option value=""></option>
										<option value="Credit Exemption">Credit Exemption</option>
										<option value="Credit Transfer">Credit Transfer</option>
									</select>

								Any Specific Comments

									<textarea class="form-control" name="comments" row="5" col="10" data-ng-model="selectedComments" required></textarea>

								<button class="btn btn-large btn-success text-center remark-button" data-ng-click="doRemark()" data-ng-disabled="remarkForm.$invalid">Remark</button>

										#
										Course Code
										Course Name
										Course Units
										Result Type
										Comments

										<button class="btn btn-danger btn-xs" data-ng-click="doDelete($index)">Remove</button>


text:
package gen

var delete = &Template{
	Name: "Delete",
	Text: `
func (m *{{.Name}}) Delete() (bool, *ar.Errors) {
        errs := &ar.Errors{}
        if _, err := ar.NewDelete(db, logger).Table("{{.TableName}}").Where("{{.PrimaryKeyColumn}}", m.{{.PrimaryKeyField}}).Exec(); err != nil {
                errs.AddError("base", err)
                return false, errs
        }
        return true, nil
}

func (m {{.Name}}) DeleteAll() (bool, *ar.Errors) {
        errs := &ar.Errors{}
        if _, err := ar.NewDelete(db, logger).Table("{{.TableName}}").Exec(); err != nil {
                errs.AddError("base", err)
                return false, errs
        }
        return true, nil
}
`}


text:
<?php

namespace Drupal\Core\Password;

/**
 * Provides a default password generator.
 */
class DefaultPasswordGenerator implements PasswordGeneratorInterface {

  /**
   * The allowed characters for the password.
   *
   * Note that the number 0 and the letter 'O' have been removed to avoid
   * confusion between the two. The same is true of 'I', 1, and 'l'.
   *
   * @var string
   */
  protected $allowedChars = 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789';

  /**
   * Generates a password.
   *
   * @param int $length
   *   (optional) The length of the password.
   *
   * @return string
   *   The password.
   */
  public function generate(int $length = 10): string {
    // The maximum integer we want from random_int().
    $max = strlen($this->allowedChars) - 1;

    $pass = '';

    for ($i = 0; $i < $length; $i++) {
      $pass .= $this->allowedChars[random_int(0, $max)];
    }

    return $pass;
  }

}


text:
package org.springframework.cloud.netflix.ribbon.okhttp;

import java.net.URI;
import java.util.concurrent.TimeUnit;

import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.loadbalancer.LoadBalancedRetryContext;
import org.springframework.cloud.client.loadbalancer.LoadBalancedRetryPolicyFactory;
import org.springframework.cloud.netflix.ribbon.ServerIntrospector;
import org.springframework.cloud.netflix.ribbon.support.RetryableLoadBalancingClient;
import org.springframework.retry.RetryCallback;
import org.springframework.retry.RetryContext;
import org.springframework.web.util.UriComponentsBuilder;

import com.netflix.client.config.CommonClientConfigKey;
import com.netflix.client.config.IClientConfig;
import com.netflix.loadbalancer.ILoadBalancer;
import com.netflix.loadbalancer.Server;

import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;

import static org.springframework.cloud.netflix.ribbon.RibbonUtils.updateToHttpsIfNeeded;

/**
 * @author Spencer Gibb
 * @author Ryan Baxter
 */
public class OkHttpLoadBalancingClient
		extends RetryableLoadBalancingClient<OkHttpRibbonRequest, OkHttpRibbonResponse, OkHttpClient> {

	@Deprecated
	public OkHttpLoadBalancingClient() {
		super();
	}

	@Deprecated
	public OkHttpLoadBalancingClient(final ILoadBalancer lb) {
		super(lb);
	}

	public OkHttpLoadBalancingClient(IClientConfig config,
			ServerIntrospector serverIntrospector) {
		super(config, serverIntrospector);
	}

	public OkHttpLoadBalancingClient(IClientConfig config,
									 ServerIntrospector serverIntrospector,
									 LoadBalancedRetryPolicyFactory loadBalancedRetryPolicyFactory) {
		super(config, serverIntrospector, loadBalancedRetryPolicyFactory);
	}

	public OkHttpLoadBalancingClient(OkHttpClient delegate, IClientConfig config,
									 ServerIntrospector serverIntrospector) {
		super(delegate, config, serverIntrospector);
	}

	@Override
	protected OkHttpClient createDelegate(IClientConfig config) {
		return new OkHttpClient();
	}

	@Override
	public OkHttpRibbonResponse execute(final OkHttpRibbonRequest ribbonRequest,
			final IClientConfig configOverride) throws Exception {
		return this.executeWithRetry(ribbonRequest, new RetryCallback() {
			@Override
			public OkHttpRibbonResponse doWithRetry(RetryContext context) throws Exception {
				//on retries the policy will choose the server and set it in the context
				//extract the server and update the request being made
				OkHttpRibbonRequest newRequest = ribbonRequest;
				if(context instanceof LoadBalancedRetryContext) {
					ServiceInstance service = ((LoadBalancedRetryContext)context).getServiceInstance();
					if(service != null) {
						//Reconstruct the request URI using the host and port set in the retry context
						newRequest = newRequest.withNewUri(new URI(service.getUri().getScheme(),
								newRequest.getURI().getUserInfo(), service.getHost(), service.getPort(),
								newRequest.getURI().getPath(), newRequest.getURI().getQuery(),
								newRequest.getURI().getFragment()));
					}
				}
				if (isSecure(configOverride)) {
					final URI secureUri = UriComponentsBuilder.fromUri(newRequest.getUri())
							.scheme("https").build().toUri();
					newRequest = newRequest.withNewUri(secureUri);
				}
				OkHttpClient httpClient = getOkHttpClient(configOverride, secure);

				final Request request = newRequest.toRequest();
				Response response = httpClient.newCall(request).execute();
				return new OkHttpRibbonResponse(response, newRequest.getUri());
			}
		});
	}

	OkHttpClient getOkHttpClient(IClientConfig configOverride, boolean secure) {
		OkHttpClient.Builder builder = this.delegate.newBuilder();
		IClientConfig config = configOverride != null ? configOverride : this.config;
		builder.connectTimeout(config.get(
				CommonClientConfigKey.ConnectTimeout, this.connectTimeout), TimeUnit.MILLISECONDS);
		builder.readTimeout(config.get(
				CommonClientConfigKey.ReadTimeout, this.readTimeout), TimeUnit.MILLISECONDS);
		builder.followRedirects(config.get(
				CommonClientConfigKey.FollowRedirects, this.followRedirects));
		if (secure) {
			builder.followSslRedirects(configOverride.get(
					CommonClientConfigKey.FollowRedirects, this.followRedirects));
		}

		return builder.build();
	}

	@Override
	public URI reconstructURIWithServer(Server server, URI original) {
		URI uri = updateToHttpsIfNeeded(original, this.config, this.serverIntrospector,
				server);
		return super.reconstructURIWithServer(server, uri);
	}
}


text:
namespace Envoy {
namespace LocalInfo {

class MockLocalInfo : public LocalInfo {
public:
  MockLocalInfo();
  ~MockLocalInfo() override;

  MOCK_METHOD(Network::Address::InstanceConstSharedPtr, address, (), (const));
  MOCK_METHOD(const std::string&, zoneName, (), (const));
  MOCK_METHOD(const std::string&, clusterName, (), (const));
  MOCK_METHOD(const std::string&, nodeName, (), (const));
  MOCK_METHOD(const Stats::StatName&, zoneStatName, (), (const));
  MOCK_METHOD(envoy::config::core::v3::Node&, node, (), (const));
  MOCK_METHOD(Config::ContextProvider&, contextProvider, ());
  MOCK_METHOD(const Config::ContextProvider&, contextProvider, (), (const));

  const Stats::StatName& makeZoneStatName() const;

  Network::Address::InstanceConstSharedPtr address_;
  // TODO(htuch): Make this behave closer to the real implementation, with the various property
  // methods using node_ as the source of truth.
  envoy::config::core::v3::Node node_;
  mutable Stats::TestUtil::TestSymbolTable symbol_table_;
  mutable std::unique_ptr<Stats::StatNameManagedStorage> zone_stat_name_storage_;
  mutable Stats::StatName zone_stat_name_;
  testing::NiceMock<Config::MockContextProvider> context_provider_;
};

} // namespace LocalInfo
} // namespace Envoy


text:
package bimoku.crawler.crawlerimpl;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.Properties;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import bimoku.crawler.ipproxy.SetIpProxy;
import bimoku.crawler.common.DBUtils;
import bimoku.crawler.contro.Controlpub;
import bimoku.crawler.crawler.Crawler;
import bimoku.crawler.download.DownLoadFile;
import bimoku.crawler.parse.TitleParse;
import bimoku.crawler.parse.UrlParse;
import bimoku.crawler.queue.IpProxy;
import bimoku.crawler.queue.IpProxylist;
import bimoku.crawler.queue.TitleQueue;
import bimoku.crawler.queue.UrlQueue;
import bimoku.crawler.spider.HttpConnectionManager;
import bimoku.extract.parser.Parser;

public class Crawlerpub implements Crawler {
	public void crawler(Parser parser) {

		Properties p = new Properties();
		p = DBUtils.propertiesReader("chinapub.properties");

		UrlQueue firstUrlQueue = new UrlQueue();

		HttpConnectionManager httpConnectionManager = new HttpConnectionManager();

		/*
		 * String classifyHtml =
		 * HttpConnectionManager.getHtml(p.getProperty("classify"));
		 *
		 * downfile.downloadFile(p.getProperty("classify"),classifyHtml,p.
		 * getProperty("classifyFile"));
		 */

		String html = "";
		try {
			html = httpConnectionManager.getHtml(p.getProperty("starturl"));
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		try {
			UrlParse.getparse(firstUrlQueue, html,
					p.getProperty("firstcategoryurl"));
		} catch (MalformedURLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		ExecutorService pool = Executors.newFixedThreadPool(20);
		while (!firstUrlQueue.isQueueEmpty()) {

			String firstUrl = new String();
			firstUrl = firstUrlQueue.deQueue();

			Controlpub controlpub = new Controlpub(firstUrl, p,parser);
			pool.execute(controlpub);

		}
		pool.shutdown();

	}
}


text:
This is a javascript based tool to calculate simple model solutions. It plots a time series and a phase space trajectory for 3 variables after pushing
the blue button. Next developments should contain:
  - further examples for models of different problems and issues.
  - debugging of applicants.
  - review and improvements of plotly-code to decrease datastorage and to enable more calculation steps
Writer: Fabian Wachsmann
Built on Bootstrap, Jquery and Plotly packages


text:
'use babel';

const BottomPanel = require('./ui/bottom-panel');

class AtomXcode {
  bottomPanel = null;

  activate = (state) => {
    this.bottomPanel = BottomPanel.create(state);
  };

  consumeStatusBar = (statusBar) => {
    statusBar.addLeftTile({
      item: this.bottomPanel,
      priority: -1000,
    });
  };

};

module.exports = new AtomXcode();


text:
<?php

namespace backend\controllers;

use Yii;
use backend\models\Documento;
use backend\models\DocumentoSearch;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use yii\web\UploadedFile;
use yii\data\ActiveDataProvider;
use backend\models\Persona;
use backend\models\PersonaSearch;
use  \yii\helpers\Json;
/**
 * DocumentoController implements the CRUD actions for Documento model.
 */
class DocumentoController extends Controller
{
    public function behaviors()
    {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['post'],
                ],
            ],
        ];
    }

    /**
     * Lists all Documento models.
     * @return mixed
     */
    public function actionIndex($mensaje="")
    {
        $searchModel = new DocumentoSearch();
        $persona=new Persona();
        $personaSearch=new PersonaSearch();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
        return $this->render('index', [
            'searchModel' => $personaSearch,
            'dataProvider' => $dataProvider,
            'mensaje'=>$mensaje,
        ]);
    }

    /**
     * Displays a single Documento model.
     * @param integer $id
     * @return mixed
     */
    public function actionView($id, $mensaje="")
    {
        $documento=  Documento::findOne($id);
        $dataProvider=new ActiveDataProvider([
                'query' => Documento::find()
//                ->where(['id_persona'=>$id])
//                ->orderBy('id'),
            ]);

        return $this->render('view',
                [
                'documento'=>$documento,
                'mensaje' =>  $mensaje]);
    }

    /**
     * Creates a new Documento model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */

        public function actionDeleteAll(){
            $tiempo_de_inicio=  microtime(true);
            $model=  Documento::find()->all();
            foreach($model as $i =>$doc){
                $doc->delete();
            }
            $tiempo_fin=  microtime(true);
            $mensaje="Tiempo empleado para eliminar ". count($model)." tuplas: " .($tiempo_fin - $tiempo_de_inicio);
            $this->redirect(['index','mensaje'=>$mensaje]);
        }
        public function actionDeleteSelected(){
            $ids=Yii::$app->request->post('ids');
            $tiempo_inicio = microtime(true);
            foreach($ids as $id){
                Documento::findOne($id)->delete();
            }
            $tiempo_fin = microtime(true);
            $mensaje='Tiempo empleado para eliminar '.  count($ids).' tuplas: '
                    .($tiempo_fin-$tiempo_inicio);
            echo Json::encode($mensaje);
        }
    public function actionCreate(){
        $tiempo_de_inicio=  microtime(true);
        $model = new Documento();
        if ($model->load(Yii::$app->request->post())) {
            $model->docFile = UploadedFile::getInstance($model, 'docFile');
            $model->direccion_archivo = $model->docFile->baseName . '.' .
                        $model->docFile->extension;
            $path = Yii::$app->basePath . '/web/imagenes/' . $model->direccion_archivo;
            $model->fecha_creacion = date('Y-m-d H:i:s');
            $tiempo_de_inicio=  microtime(true);
            $model->save();
            $model->docFile->saveAs($path);
            $tiempo_fin=  microtime(true);
            $mensaje="Tiempo empleado para crear un dato nuevo: " .($tiempo_fin - $tiempo_de_inicio);
            $this->redirect(['view','id'=>$model->id,
                'mensaje'=>$mensaje]);
        }  else {
             return $this->render('create', [
                        'model' => $model,
            ]);
        }
    }
    public function actionCargar() {
       // set_time_limit(0);
        $tiempo_de_inicio=  microtime(true);
        $model = new Documento();
        if ($model->load(Yii::$app->request->post())) {
            $model->docFile = UploadedFile::getInstances($model, 'docFile');
            foreach ($model->docFile as $i => $file) {
                $documento = new Documento();
               // $documento->id_persona = $model->id_persona;
                $documento->direccion_archivo = $file->baseName . '.' .
                        $file->extension;
                $path = Yii::$app->basePath . '/web/imagenes/' . $documento->direccion_archivo;
               // $documento->nombre_documento = $file->baseName;
                $documento->fecha_creacion = date('Y-m-d H:i:s');
                $documento->save();
                $file->saveAs($path);
            }
            $tiempo_fin=  microtime(true);
            $mensaje="Tiempo empleado para cargar".count($model->docFile)." tuplas: " .($tiempo_fin - $tiempo_de_inicio);
        //return $this->render('Tiempo',['mensaje' =>$mensaje]);
            $this->redirect(['index',
                'mensaje' =>  $mensaje
                ]);

        } else {
            return $this->render('cargar', [
                        'model' => $model,

            ]);
        }

    }

    /**
     * Updates an existing Documento model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     */
    public function actionUpdate($id)
    {
        $model = $this->findModel($id);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('update', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Deletes an existing Documento model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     */
    public function actionDelete($id)
    {
        $tiempo_de_inicio=  microtime(true);
        $documento=Documento::find()->where(['id_persona'=>$id])->all();
        foreach($documento as $i=>$doc){
            $doc->delete();
        }
      //   Documento::deleteAll(['id_persona'=>$id]);//<----es mas rapido
        $tiempo_fin=  microtime(true);
        $mensaje="Tiempo empleado para eliminar: " .($tiempo_fin - $tiempo_de_inicio);

                //find()->where(['id_persona' =$id]);
        //$this->findModel($id)->delete();

        return $this->redirect(['index', 'mensaje' =>  $mensaje]);
    }

    /**
     * Finds the Documento model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $id
     * @return Documento the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id)
    {
        if (($model = Documento::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
}


text:
package org.consulo.compiler.server.fileSystem;

import com.intellij.openapi.Disposable;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.impl.VirtualFilePointerContainerImpl;
import com.intellij.openapi.vfs.pointers.VirtualFilePointer;
import com.intellij.openapi.vfs.pointers.VirtualFilePointerContainer;
import com.intellij.openapi.vfs.pointers.VirtualFilePointerListener;
import com.intellij.openapi.vfs.pointers.VirtualFilePointerManager;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
 * @author VISTALL
 * @since 19:54/19.08.13
 */
public class CompilerServerVirtualFilePointerManager extends VirtualFilePointerManager {
  @NotNull
  @Override
  public VirtualFilePointer create(@NotNull String url, @NotNull Disposable parent, @Nullable VirtualFilePointerListener listener) {
    return new CompilerServerVirtualFilePointer(url);
  }

  @NotNull
  @Override
  public VirtualFilePointer create(@NotNull VirtualFile file, @NotNull Disposable parent, @Nullable VirtualFilePointerListener listener) {
    return new CompilerServerVirtualFilePointer(file.getUrl());
  }

  @NotNull
  @Override
  public VirtualFilePointer duplicate(@NotNull VirtualFilePointer pointer,
                                      @NotNull Disposable parent,
                                      @Nullable VirtualFilePointerListener listener) {
    return new CompilerServerVirtualFilePointer(pointer.getUrl());
  }

  @NotNull
  @Override
  public VirtualFilePointerContainer createContainer(@NotNull Disposable parent) {
    return createContainer(parent, null);
  }

  @NotNull
  @Override
  public VirtualFilePointerContainer createContainer(@NotNull Disposable parent, @Nullable VirtualFilePointerListener listener) {
    return new VirtualFilePointerContainerImpl(this, parent, listener);
  }

  @Override
  public void dispose() {
  }

  @Override
  public long getModificationCount() {
    return 0;
  }
}


text:
<?php

namespace AppTests\Unit\Entities;

use AppTests\BaseEntityImpl;
use Nette\Utils\ArrayHash;
use Tester;
use Tester\Assert;

require __DIR__ . '/../bootstrap.php';

/**
 * @testCase
 */
class BaseEntityTest extends Tester\TestCase
{
    /**
     * @dataProvider getArgs
     */
    public function testSetValuesAsArray($a, $b, $c)
    {
        $values = [
            'a' => $a,
            'b' => $b,
            'c' => $c,
        ];

        $this->assert($values, $a, $b, $c);
    }

    /**
     * @dataProvider getArgs
     */
    public function testSetValuesAsTraversable($a, $b, $c)
    {
        $values    = new ArrayHash;
        $values->a = $a;
        $values->b = $b;
        $values->c = $c;

        $this->assert($values, $a, $b, $c);
    }

    /**
     * @return array
     */
    public function getArgs()
    {
        return [['A', 'B', 'C']];
    }

    /**
     * @param array|\Traversable $values
     * @param string             $a
     * @param string             $b
     * @param string             $c
     */
    private function assert($values, $a, $b, $c)
    {
        $ent = new BaseEntityImpl;
        $ent->setValues($values);

        Assert::same($a, $ent->a);
        Assert::same($b, $ent->b);
        Assert::same($c, $ent->c);
    }

    public function testSetValuesInvalidArgumentException()
    {
        $ent = new BaseEntityImpl;

        Assert::exception(function () use ($ent) {
            $ent->setValues('');
        }, 'Nette\InvalidArgumentException');
    }
}

$testCase = new BaseEntityTest;
$testCase->run();


text:
//
//  JLWeatherDetailVC.m
//  81 - 网易新闻
//
//  Created by dongshangxian on 15/9/20.
//  Copyright (c) 2015年 Junlin. All rights reserved.
//

#import "JLWeatherDetailVC.h"
#import "UIView+Extension.h"
#import "JLWeatherItemView.h"
#import "JLWeatherModel.h"
#import "UIImageView+WebCache.h"

#define W [UIScreen mainScreen].bounds.size.width

@interface JLWeatherDetailVC ()
@property(nonatomic,strong)UIView *bottomView;
@property (weak, nonatomic) IBOutlet UILabel *tempLbl;
@property (weak, nonatomic) IBOutlet UIImageView *weatherImg;
@property (weak, nonatomic) IBOutlet UILabel *dateWeekLbl;
@property (weak, nonatomic) IBOutlet UILabel *airPMLbl;
@property (weak, nonatomic) IBOutlet UILabel *climateLbl;
@property (weak, nonatomic) IBOutlet UILabel *windLbl;

@end

@implementation JLWeatherDetailVC

- (void)viewDidLoad {
    [super viewDidLoad];

    UIView *bottomView = [[UIView alloc]init];
    self.bottomView = bottomView;
    [self.view addSubview:bottomView];
    bottomView.height = 250;
    bottomView.width = W;
    bottomView.x = 0;
    bottomView.y = [UIScreen mainScreen].bounds.size.height - bottomView.height;
    bottomView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.2];

    [self addWeather];
    for (int i = 1 ; i < 4 ; i++) {
        JLWeatherDetailM *weatherDetail = self.weatherModel.detailArray[i];
        [self addItemWithTitle:weatherDetail.week weather:weatherDetail.climate wind:weatherDetail.wind T:weatherDetail.temperature index:i-1];
    }

}

- (void)addItemWithTitle:(NSString *)title weather:(NSString *)weather wind:(NSString *)wind T:(NSString *)T index:(int)index
{
    JLWeatherItemView *itemView = [JLWeatherItemView view];
    itemView.width = W/3;
    itemView.y = 0;
    itemView.height = 200;
    itemView.x = index * itemView.width;

    itemView.weather = weather;
    itemView.titleLbl.text = title;

    NSMutableString *temp = [T mutableCopy];
    [temp replaceOccurrencesOfString:@"C" withString:@"" options:NSCaseInsensitiveSearch range:NSMakeRange(0, temp.length)];

    itemView.tLbl.text = temp;
    itemView.windLbl.text = wind;
    [self.bottomView addSubview:itemView];
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.hidesBottomBarWhenPushed=YES;
    }
    return self;
}

- (void)addWeather
{

    JLWeatherDetailM *weatherDetail = self.weatherModel.detailArray[0];

    NSMutableString *temp = [weatherDetail.temperature mutableCopy];
    [temp replaceOccurrencesOfString:@"C" withString:@"" options:NSCaseInsensitiveSearch range:NSMakeRange(0, temp.length)];

    self.tempLbl.text = temp;

    self.dateWeekLbl.text = [NSString stringWithFormat:@"%@  %@",self.weatherModel.dt,weatherDetail.week];

    NSString *desc;
    int pm = self.weatherModel.pm2d5.pm2_5.intValue;
    if (pm < 50) {
        desc = @"优";
    }else if (pm < 100){
        desc = @"良";
    }else{
        desc = @"差";
    }

    self.airPMLbl.text = [NSString stringWithFormat:@"PM2.5 %d %@",pm,desc];
    //    self.localLbl.text = @"北京";
    self.climateLbl.text = weatherDetail.climate;
    self.windLbl.text = weatherDetail.wind;

    if ([weatherDetail.climate isEqualToString:@"雷阵雨"]) {
        self.weatherImg.image = [UIImage imageNamed:@"thunder"];
    }else if ([weatherDetail.climate isEqualToString:@"晴"]){
        self.weatherImg.image = [UIImage imageNamed:@"sun"];
    }else if ([weatherDetail.climate isEqualToString:@"多云"]){
        self.weatherImg.image = [UIImage imageNamed:@"sunandcloud"];
    }else if ([weatherDetail.climate isEqualToString:@"阴"]){
        self.weatherImg.image = [UIImage imageNamed:@"cloud"];
    }else if ([weatherDetail.climate hasSuffix:@"雨"]){
        self.weatherImg.image = [UIImage imageNamed:@"rain"];
    }else if ([weatherDetail.climate hasSuffix:@"雪"]){
        self.weatherImg.image = [UIImage imageNamed:@"snow"];
    }else{
        self.weatherImg.image = [UIImage imageNamed:@"sandfloat"];
    }
    [self.bgImg sd_setImageWithURL:[NSURL URLWithString:self.weatherModel.pm2d5.nbg2] placeholderImage:[UIImage imageNamed:@"QingTian"]];
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    [self.navigationController setNavigationBarHidden:YES animated:YES];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)back {
    [self.navigationController popViewControllerAnimated:YES];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end


text:
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.Logging;

namespace DbScriptDeploy.Console.Areas.Identity.Pages.Account
{
    [AllowAnonymous]
    public class LoginWith2faModel : PageModel
    {
        private readonly SignInManager<IdentityUser> _signInManager;
        private readonly ILogger<LoginWith2faModel> _logger;

        public LoginWith2faModel(SignInManager<IdentityUser> signInManager, ILogger<LoginWith2faModel> logger)
        {
            _signInManager = signInManager;
            _logger = logger;
        }

        [BindProperty]
        public InputModel Input { get; set; }

        public bool RememberMe { get; set; }

        public string ReturnUrl { get; set; }

        public class InputModel
        {
            [Required]
            [StringLength(7, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)]
            [DataType(DataType.Text)]
            [Display(Name = "Authenticator code")]
            public string TwoFactorCode { get; set; }

            [Display(Name = "Remember this machine")]
            public bool RememberMachine { get; set; }
        }

        public async Task<IActionResult> OnGetAsync(bool rememberMe, string returnUrl = null)
        {
            // Ensure the user has gone through the username & password screen first
            var user = await _signInManager.GetTwoFactorAuthenticationUserAsync();

            if (user == null)
            {
                throw new InvalidOperationException($"Unable to load two-factor authentication user.");
            }

            ReturnUrl = returnUrl;
            RememberMe = rememberMe;

            return Page();
        }

        public async Task<IActionResult> OnPostAsync(bool rememberMe, string returnUrl = null)
        {
            if (!ModelState.IsValid)
            {
                return Page();
            }

            returnUrl = returnUrl ?? Url.Content("~/");

            var user = await _signInManager.GetTwoFactorAuthenticationUserAsync();
            if (user == null)
            {
                throw new InvalidOperationException($"Unable to load two-factor authentication user.");
            }

            var authenticatorCode = Input.TwoFactorCode.Replace(" ", string.Empty).Replace("-", string.Empty);

            var result = await _signInManager.TwoFactorAuthenticatorSignInAsync(authenticatorCode, rememberMe, Input.RememberMachine);

            if (result.Succeeded)
            {
                _logger.LogInformation("User with ID '{UserId}' logged in with 2fa.", user.Id);
                return LocalRedirect(returnUrl);
            }
            else if (result.IsLockedOut)
            {
                _logger.LogWarning("User with ID '{UserId}' account locked out.", user.Id);
                return RedirectToPage("./Lockout");
            }
            else
            {
                _logger.LogWarning("Invalid authenticator code entered for user with ID '{UserId}'.", user.Id);
                ModelState.AddModelError(string.Empty, "Invalid authenticator code.");
                return Page();
            }
        }
    }
}


text:
ActiveRecord::Schema.define(version: 20140118155840) do

  create_table "answers", force: true do |t|
    t.integer  "question_id",                              null: false
    t.integer  "user_id",                                  null: false
    t.string   "content",     limit: 4000
    t.boolean  "accepted",                 default: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "answers", ["question_id"], name: "index_answers_on_question_id", using: :btree
  add_index "answers", ["user_id"], name: "index_answers_on_user_id", using: :btree

  create_table "comments", force: true do |t|
    t.integer  "commentable_id",                null: false
    t.string   "commentable_type",              null: false
    t.integer  "user_id",                       null: false
    t.string   "content",          limit: 1000
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "comments", ["commentable_id", "commentable_type"], name: "index_comments_on_commentable_id_and_commentable_type", using: :btree
  add_index "comments", ["user_id"], name: "index_comments_on_user_id", using: :btree

  create_table "questions", force: true do |t|
    t.string   "title",              limit: 500
    t.string   "content",            limit: 3000
    t.integer  "user_id",                         null: false
    t.integer  "accepted_answer_id"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "questions", ["accepted_answer_id"], name: "index_questions_on_accepted_answer_id", using: :btree
  add_index "questions", ["user_id"], name: "index_questions_on_user_id", using: :btree

  create_table "tags", force: true do |t|
    t.integer  "question_id",             null: false
    t.string   "content",     limit: 100, null: false
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "tags", ["question_id", "content"], name: "index_tags_on_question_id_and_content", unique: true, using: :btree

  create_table "users", force: true do |t|
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  create_table "votes", force: true do |t|
    t.integer  "votable_id",   null: false
    t.string   "votable_type", null: false
    t.integer  "user_id"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "votes", ["votable_id", "votable_type", "user_id"], name: "index_votes_on_votable_id_and_votable_type_and_user_id", unique: true, using: :btree

end


text:
/**
   Register a finalization function with Turbine
   Returns 1 on success, 0 if out of memory
*/
#ifdef __cplusplus
extern "C" {
#endif
int turbine_register_finalizer(void (*func)(void*),
                                        void* context);
#ifdef __cplusplus
}
#endif


text:
package com.toddfast.mutagen.cassandra.table;

import com.datastax.driver.mapping.annotations.ClusteringColumn;
import com.datastax.driver.mapping.annotations.PartitionKey;
import com.datastax.driver.mapping.annotations.Table;
import com.toddfast.mutagen.cassandra.dao.SchemaVersionDao;

import java.io.Serializable;
import java.nio.ByteBuffer;

@Table(name = SchemaVersionDao.TABLE_SCHEMA_VERSION)
public class SchemaVersion implements Serializable {

    @PartitionKey
    private String key;
    @ClusteringColumn
    private String column1;
    private ByteBuffer value;

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getColumn1() {
        return column1;
    }

    public void setColumn1(String column1) {
        this.column1 = column1;
    }

    public ByteBuffer getValue() {
        return value;
    }

    public void setValue(ByteBuffer value) {
        this.value = value;
    }
}