text:
<?php  defined('C5_EXECUTE') or die("Access Denied."); ?>
<?php
if ($_REQUEST['searchDialog'] == 1) {
	$searchDialog = true;
}
if (!isset($sitemap_select_mode)) {
	if (isset($_REQUEST['sitemap_select_mode'])) {
		$sitemap_select_mode = $_REQUEST['sitemap_select_mode'];
	}
}

if (!isset($sitemap_select_callback)) {
	if (isset($_REQUEST['sitemap_select_callback'])) {
		$sitemap_select_callback = $_REQUEST['sitemap_select_callback'];
	}
}
if (isset($_REQUEST['searchInstance'])) {
	$searchInstance = $_REQUEST['searchInstance'];
}
?>

<a name="ccm-<?php echo $searchInstance?>-list-wrapper-anchor">

<?php  if (!$searchDialog) { ?>

<?php echo $pageList->displaySummary();?>
	<?php echo t('With Selected: ')?>

	<select id="ccm-<?php echo $searchInstance?>-list-multiple-operations" disabled="disabled">
		<option value="">**</option>
		<option value="properties"><?php echo t('Edit Properties')?></option>
	</select>

<?php  } ?>
<?php
	$txt = Loader::helper('text');
	$keywords = $searchRequest['keywords'];
	$soargs = array();
	$soargs['searchInstance'] = $searchInstance;
	$soargs['sitemap_select_mode'] = $sitemap_select_mode;
	$soargs['sitemap_select_callback'] = $sitemap_select_callback;
	$soargs['searchDialog'] = $searchDialog;
	$bu = REL_DIR_FILES_TOOLS_REQUIRED . '/pages/search_results';

	if (count($pages) > 0) { ?>
		<table border="0" cellspacing="0" cellpadding="0" id="ccm-<?php echo $searchInstance?>-list" class="ccm-results-list">

			<?php  if (!$searchDialog) { ?><input id="ccm-<?php echo $searchInstance?>-list-cb-all" type="checkbox" />	<?php  } ?>
			<?php echo t('Type')?>

			<th class="ccm-page-list-name <?php echo $pageList->getSearchResultsClass('cvName')?>"><a href="<?php echo $pageList->getSortByURL('cvName', 'asc', $bu, $soargs)?>"><?php echo t('Name')?>
			<th class="<?php echo $pageList->getSearchResultsClass('cvDatePublic')?>"><a href="<?php echo $pageList->getSortByURL('cvDatePublic', 'asc', $bu, $soargs)?>"><?php echo t('Public Date')?>
			<th class="<?php echo $pageList->getSearchResultsClass('cDateModified')?>"><a href="<?php echo $pageList->getSortByURL('cDateModified', 'asc', $bu, $soargs)?>"><?php echo t('Date Modified')?>
			<?php echo t('Owner')?>
			<?php  if ($pageList->isIndexedSearch()) { ?>
				<th class="<?php echo $pageList->getSearchResultsClass('cIndexScore')?>"><a href="<?php echo $pageList->getSortByURL('cIndexScore', 'desc', $bu, $soargs)?>"><?php echo t('Score')?>
			<?php  } ?>

			<?php
			$slist = CollectionAttributeKey::getColumnHeaderList();
			foreach($slist as $ak) { ?>
				<th class="<?php echo $pageList->getSearchResultsClass($ak)?>"><a href="<?php echo $pageList->getSortByURL($ak, 'asc', $bu, $soargs)?>"><?php echo $ak->getAttributeKeyDisplayHandle()?>
			<?php  } ?>
			<a href="<?php echo REL_DIR_FILES_TOOLS_REQUIRED?>/pages/customize_search_columns?searchInstance=<?php echo $searchInstance?>" id="ccm-search-add-column"><img src="<?php echo ASSETS_URL_IMAGES?>/icons/add.png" width="16" height="16" alt="<?php  echo t('Add')?>"/>

	<?php
		foreach($pages as $cobj) {
			$cpobj = new Permissions($cobj);
			if (!isset($striped) || $striped == 'ccm-list-record-alt') {
				$striped = '';
			} else if ($striped == '') {
				$striped = 'ccm-list-record-alt';
			}

			?>
			<tr class="ccm-list-record <?php echo $striped?>" cName="<?php echo htmlentities($cobj->getCollectionName(), ENT_QUOTES, APP_CHARSET)?>" cID="<?php echo $cobj->getCollectionID()?>" sitemap-select-callback="<?php echo $sitemap_select_callback?>" sitemap-select-mode="<?php echo $sitemap_select_mode?>" sitemap-display-mode="search" canWrite="<?php echo $cpobj->canWrite()?>" cNumChildren="<?php echo $cobj->getNumChildren()?>" cAlias="false">
			<?php  if (!$searchDialog) { ?><td class="ccm-<?php echo $searchInstance?>-list-cb" style="vertical-align: middle !important"><input type="checkbox" value="<?php echo $cobj->getCollectionID()?>" />	<?php  } ?>
			<?php echo $cobj->getCollectionTypeName()?>

<?php echo $txt->highlightSearch($cobj->getCollectionName(), $keywords)?>

			<?php echo date(DATE_APP_DASHBOARD_SEARCH_RESULTS_PAGES, strtotime($cobj->getCollectionDatePublic()))?>
			<?php echo date(DATE_APP_DASHBOARD_SEARCH_RESULTS_PAGES, strtotime($cobj->getCollectionDateLastModified()))?>
			<?php
				$ui = UserInfo::getByID($cobj->getCollectionUserID());
				if (is_object($ui)) {
					print $ui->getUserName();
				}
			?>
			<?php  if ($pageList->isIndexedSearch()) { ?>
				<?php echo $cobj->getPageIndexScore()?>
			<?php  } ?>

			<?php
			$slist = CollectionAttributeKey::getColumnHeaderList();
			foreach($slist as $ak) { ?>
				<?php
				$vo = $cobj->getAttributeValueObject($ak);
				if (is_object($vo)) {
					print $vo->getValue('display');
				}
				?>
			<?php  } ?>

			<?php
		}

	?>

	<?php  } else { ?>

<?php echo t('No pages found.')?>

	<?php  }
	$pageList->displayPaging($bu, false, $soargs); ?>


text:
<?php
/**
 * Piwik - free/libre analytics platform
 *
 * @link http://piwik.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 *
 */
namespace Piwik\Plugins\DBStats;

use Piwik\Date;
use Piwik\Option;

class Tasks extends \Piwik\Plugin\Tasks
{
    public function schedule()
    {
        $this->weekly('cacheDataByArchiveNameReports', null, self::LOWEST_PRIORITY);
    }

    /**
     * Caches the intermediate DataTables used in the getIndividualReportsSummary and
     * getIndividualMetricsSummary reports in the option table.
     */
    public function cacheDataByArchiveNameReports()
    {
        $api = API::getInstance();
        $api->getIndividualReportsSummary(true);
        $api->getIndividualMetricsSummary(true);

        $now = Date::now()->getLocalized(Date::DATE_FORMAT_SHORT);
        Option::set(DBStats::TIME_OF_LAST_TASK_RUN_OPTION, $now);
    }
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NUnit.Framework;
using Assert = NUnit.Framework.Assert;
using CollectionAssert = NUnit.Framework.CollectionAssert;
using StringAssert = NUnit.Framework.StringAssert;
using TestContext = Microsoft.VisualStudio.TestTools.UnitTesting.TestContext;
using CsQuery;
using CsQuery.Utility;
using CsQuery.ExtensionMethods;
using CsQuery.ExtensionMethods.Internal;
using CsQuery.StringScanner;

namespace CsQuery.Tests.Utility
{
    [TestClass,TestFixture]
    public class FastActivator_
    {

        [Test,TestMethod]
        public void CreateInstance_Object()
        {
            var test = FastActivator.CreateInstance<TestClass>();

            Assert.AreEqual(1, test.integer);

        }

        [TestMethod,Test]
        public void CreateInstance_Type() {
            var integer = FastActivator.CreateInstance(typeof(int));
            Assert.AreEqual(integer, 0);

        }

        class TestClass
        {
            public TestClass()
            {
                integer = 1;
            }
            public int integer;

        }

    }
}


text:
require_relative "../resource"

class Chef
  class Resource
    class OpensslDhparam < Chef::Resource
      require_relative "../mixin/openssl_helper"
      include Chef::Mixin::OpenSSLHelper

      unified_mode true

      provides(:openssl_dhparam) { true }

      description "Use the **openssl_dhparam** resource to generate `dhparam.pem` files. If a valid `dhparam.pem` file is found at the specified location, no new file will be created. If a file is found at the specified location but it is not a valid `dhparam.pem` file, it will be overwritten."
      introduced "14.0"
      examples <<~DOC
        **Create a dhparam file**

        ```ruby
        openssl_dhparam '/etc/httpd/ssl/dhparam.pem'
        ```

        **Create a dhparam file with a specific key length**

        ```ruby
        openssl_dhparam '/etc/httpd/ssl/dhparam.pem' do
          key_length 4096
        end
        ```

        **Create a dhparam file with specific user/group ownership**

        ```ruby
        openssl_dhparam '/etc/httpd/ssl/dhparam.pem' do
          owner 'www-data'
          group 'www-data'
        end
        ```

        **Manually specify the dhparam file path**

        ```ruby
        openssl_dhparam 'httpd_dhparam' do
          path '/etc/httpd/ssl/dhparam.pem'
        end
        ```
      DOC

      property :path, String,
        description: "An optional property for specifying the path to write the file to if it differs from the resource block's name.",
        name_property: true

      property :key_length, Integer,
        equal_to: [1024, 2048, 4096, 8192],
        validation_message: "key_length must be 1024, 2048, 4096, or 8192.",
        description: "The desired bit length of the generated key.",
        default: 2048

      property :generator, Integer,
        equal_to: [2, 5],
        validation_message: "generator must be either 2 or 5.",
        description: "The desired Diffie-Hellmann generator.",
        default: 2

      property :owner, [String, Integer],
        description: "The owner applied to all files created by the resource."

      property :group, [String, Integer],
        description: "The group ownership applied to all files created by the resource."

      property :mode, [Integer, String],
        description: "The permission mode applied to all files created by the resource.",
        default: "0640"

      action :create, description: "Create the `dhparam.pem` file." do
        dhparam_content = nil
        unless dhparam_pem_valid?(new_resource.path)
          dhparam_content = gen_dhparam(new_resource.key_length, new_resource.generator).to_pem
          Chef::Log.debug("Valid dhparam content not found at #{new_resource.path}, creating new")
        end

        file new_resource.path do
          action :create
          owner new_resource.owner
          group new_resource.group
          mode new_resource.mode
          sensitive true
          content dhparam_content
        end
      end
    end
  end
end


text:
from __future__ import unicode_literals
from django.db import models

from core.apps.accounts.models import User as Student
from core.apps.accounts.models import User as Teacher
from student.apps.courses.models import Course

from datetime import datetime
QUIZ_DISPLAY_TYPES = (
                  (0, 'list'),
                  (1, 'slide'),
             )
""" #TODO """
#add title quiz
class Quiz(models.Model):
    course = models.ForeignKey(Course, db_column="course_id", related_name="quizzes")
    author =  models.ForeignKey(Teacher, db_column="author_id")
    released = models.BooleanField(default=False)
    about = models.TextField()
    created_at = models.DateTimeField(default=datetime.now, db_column='created')
    in_grade = models.BooleanField(default=True)
    is_timed = models.BooleanField(default=False)
    duration = models.IntegerField(max_length=3)
    last_updated = models.DateTimeField(default=datetime.now)
    note = models.IntegerField(max_length=3)
    max_attempts = models.IntegerField(max_length=2, default=3)
    display_type = models.IntegerField(default=0, choices=QUIZ_DISPLAY_TYPES)
    due_at = models.DateTimeField(default=datetime.now)
    end_at = models.DateTimeField(default=datetime.now)

    class Meta:
        db_table = 'course_quiz'
#
class QuizQuestion(models.Model):
    QUIZ_TYPES = (
                  (0, 'multiple'),
                  (1, 'unique'),
                  (2, 'input_choice'),
                  (3, 'other'),
             )
    quiz = models.ForeignKey(Quiz, db_column="quiz_id", related_name="questions")
    author =  models.ForeignKey(Teacher, db_column="author_id", related_name="created_quizzes")
    question = models.CharField(max_length=255L)
    respnse_explanation = models.CharField(max_length=255L)
    created_at = models.DateTimeField(default=datetime.now, db_column='created')
    last_updated = models.DateTimeField(default=datetime.now)
    order = models.IntegerField(default=3, max_length=2)
    note = models.IntegerField(max_length=2)
    max_attempts = models.IntegerField(max_length=2, default=3)
    question_type = models.IntegerField(default=0, choices=QUIZ_TYPES)
    class Meta:
        db_table = 'course_quiz_question'

#
class QuizQuestionResponse(models.Model):
    question = models.ForeignKey(QuizQuestion, db_column="question_id", related_name="responses")
    author =  models.ForeignKey(Teacher, db_column="author_id", related_name="created_responses")
    response = models.CharField(max_length=255L)
    is_true = models.BooleanField (default=False)
    order = models.IntegerField()
    class Meta:
        db_table = 'course_quiz_question_response'
        order_with_respect_to = 'question'
#
class QuizStudentResponse(models.Model):
    quiz_question = models.ForeignKey(Quiz, db_column="quiz_question_id")
    student =  models.ForeignKey(Student, db_column="student_id", related_name="quizzes_responses")
    score = models.IntegerField(default=0)
    class Meta:
        db_table = 'course_quiz_student_response'

#
class QuizStudentResponseDetails(models.Model):
    response = models.ForeignKey(QuizStudentResponse, db_column="quiz_response_id")
    details = models.TextField()
    class Meta:
        db_table = 'course_quiz_student_response_details'
# this file is black to handle circular dependencies


text:
using Newtonsoft.Json;
using PublishR.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PublishR.Social.Twitter
{
    public class TwitterTweet
    {
        [JsonProperty("text")]
        public string Text { get; set; }

        public Listing ToListing()
        {
            return new Listing()
            {
                Cards = new Dictionary<string, Card>()
                {
                    {
                        Known.Card.Medium,
                        new Card()
                        {
                            Description = Text
                        }
                    }
                }
            };
        }
    }
}


text:
#include <sys/types.h>
#include <stddef.h>
#include <pthread.h>
#include <rtld.h>

#include "thr_private.h"

/* A collection of symbols needed by debugger */

/* int _libthr_debug */
int _thread_off_tcb = offsetof(struct pthread, tcb);
int _thread_off_tid = offsetof(struct pthread, tid);
int _thread_off_next = offsetof(struct pthread, tle.tqe_next);
int _thread_off_attr_flags = offsetof(struct pthread, attr.flags);
int _thread_off_linkmap = offsetof(Obj_Entry, linkmap);
int _thread_off_tlsindex = offsetof(Obj_Entry, tlsindex);
int _thread_off_report_events = offsetof(struct pthread, report_events);
int _thread_off_event_mask = offsetof(struct pthread, event_mask);
int _thread_off_event_buf = offsetof(struct pthread, event_buf);
int _thread_size_key = sizeof(struct pthread_key);
int _thread_off_key_allocated = offsetof(struct pthread_key, allocated);
int _thread_off_key_destructor = offsetof(struct pthread_key, destructor);
int _thread_max_keys = PTHREAD_KEYS_MAX;
int _thread_off_dtv = DTV_OFFSET;
int _thread_off_state = offsetof(struct pthread, state);
int _thread_state_running = PS_RUNNING;
int _thread_state_zoombie = PS_DEAD;


text:
<?php

class Twig_Tests_Node_SandboxedPrintTest extends Twig_Test_NodeTestCase
{
    public function testConstructor()
    {
        $node = new Twig_Node_SandboxedPrint($expr = new Twig_Node_Expression_Constant('foo', 1), 1);

        $this->assertEquals($expr, $node->getNode('expr'));
    }

    public function getTests()
    {
        $tests = [];

        $tests[] = [new Twig_Node_SandboxedPrint(new Twig_Node_Expression_Constant('foo', 1), 1), <<<EOF
// line 1
echo \$this->extensions['Twig_Extension_Sandbox']->ensureToStringAllowed("foo");
EOF
        ];

        return $tests;
    }
}


text:
package com.communote.server.web.fe.admin;

/**
 * Encapsulates the details of a menu entry
 *
 * @author Communote GmbH - http://www.communote.com/
 *
 */
public class AdministrationMenuEntryDetails {

    private final BasicMenuEntry category;
    private final AdministrationPageMenuEntry menuEntry;

    /**
     * Create a new wrapper for the menu entry details
     *
     * @param category
     *            the category the menu entry belongs to
     * @param menuEntry
     *            the menu entry
     */
    public AdministrationMenuEntryDetails(BasicMenuEntry category,
            AdministrationPageMenuEntry menuEntry) {
        this.category = category;
        this.menuEntry = menuEntry;
    }

    /**
     * @return the category the menu entry belongs to
     */
    public BasicMenuEntry getCategory() {
        return category;
    }

    /**
     * @return the menu entry
     */
    public AdministrationPageMenuEntry getEntry() {
        return menuEntry;
    }
}


text:
jest.dontMock("../BreadcrumbSegmentLink");

/* eslint-disable no-unused-vars */
const React = require("react");
/* eslint-enable no-unused-vars */
const TestUtils = require("react-addons-test-utils");

const BreadcrumbSegmentLink = require("../BreadcrumbSegmentLink");

describe("BreadcrumbSegmentLink", function() {
  it("renders the label", function() {
    const instance = TestUtils.renderIntoDocument(
      <BreadcrumbSegmentLink label="foo" />
    );

    const node = TestUtils.findRenderedDOMComponentWithTag(instance, "span");

    expect(node.textContent).toEqual("foo");
  });
});


text:
namespace ESISharp.Web
{
    internal enum EsiWebMethod
    {
        Get,
        Post,
        AuthGet,
        AuthPost,
        AuthPut,
        AuthDelete
    }
}


text:
import 'rxjs/add/observable/merge';
import 'rxjs/add/operator/filter';
import 'rxjs/add/operator/first';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/mergeMap';

import { Component, OnInit } from '@angular/core';
import { Router, NavigationEnd, ActivatedRoute } from '@angular/router';
import { Title } from '@angular/platform-browser';
import { TranslateService } from '@ngx-translate/core';
import { Observable } from 'rxjs/Observable';

import { environment } from '../environments/environment';
import { Logger } from './core/logger.service';
import { I18nService } from './core/i18n.service';

const log = new Logger('App');

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {

  constructor(private router: Router,
              private activatedRoute: ActivatedRoute,
              private titleService: Title,
              private translateService: TranslateService,
              private i18nService: I18nService) { }

  ngOnInit() {
    // Setup logger
    if (environment.production) {
      Logger.enableProductionMode();
    }

    log.debug('init');

    // Setup translations
    this.i18nService.init(environment.defaultLanguage, environment.supportedLanguages);

    const onNavigationEnd = this.router.events.filter(event => event instanceof NavigationEnd);

    // Change page title on navigation or language change, based on route data
    Observable.merge(this.translateService.onLangChange, onNavigationEnd)
      .map(() => {
        let route = this.activatedRoute;
        while (route.firstChild) {
          route = route.firstChild;
        }
        return route;
      })
      .filter(route => route.outlet === 'primary')
      .mergeMap(route => route.data)
      .subscribe(event => {
        const title = event['title'];
        if (title) {
          this.titleService.setTitle(this.translateService.instant(title));
        }
      });
  }

}


text:
using namespace std;

class Config {
public:
    Config(string fileName);
    ~Config();

    int GetInt(string key, int defaultVal);
    bool GetBool(string key, bool defaultVal);
    string GetString(string key, string defaultVal);
    double GetDouble(string key, double defaultVal);
private:
    string getValue(string key);
    string fileName_;
    map<string,string> cfgData_;
};

#endif //SSC_CONFIG_H


text:
'use strict';

angular.module('app', ['ngRoute'])
.factory('vindexInfo', vindexInfo)
.factory('curSchema', curSchema)
.controller('KeyspaceController', KeyspaceController)
.controller('SidebarController', SidebarController)
.controller('ClassController', ClassController)
.controller('LoadController', LoadController)
.controller('SubmitController', SubmitController)
.controller('SchemaManagerController', SchemaManagerController)
.config(['$routeProvider', function($routeProvider) {
  $routeProvider
  .when('/editor',{
    templateUrl: "/content/editor/keyspace.html",
    controller: "KeyspaceController"
  })
  .when('/editor/:keyspaceName',{
    templateUrl: "/content/editor/keyspace.html",
    controller: "KeyspaceController"
  })
  .when('/editor/:keyspaceName/class/:className',{
    templateUrl: "/content/editor/class/class.html",
    controller: "ClassController"
  })
  .when('/load',{
    templateUrl: "/content/load/load.html",
    controller: "LoadController"
  })
  .when('/submit',{
    templateUrl: "/content/submit/submit.html",
    controller: "SubmitController"
  })
  .when('/schema-manager',{
    templateUrl: "/content/schema_manager/index.html",
    controller: "SchemaManagerController"
  })
  .otherwise({redirectTo: '/'});
}]);


text:
import { Button, Checkbox, FormControlLabel, InputAdornment, TextField } from '@material-ui/core';
import * as React from 'react';
import { useEffect, useState } from 'react';
import { PipelineSpecRuntimeConfig } from 'src/apis/run';
import { ExternalLink } from 'src/atoms/ExternalLink';
import { ParameterType_ParameterTypeEnum } from 'src/generated/pipeline_spec/pipeline_spec';
import { RuntimeParameters, SpecParameters } from 'src/pages/NewRunV2';
import { classes, stylesheet } from 'typestyle';
import { color, commonCss, spacing, padding } from '../Css';
import Editor from './Editor';

const css = stylesheet({
  button: {
    margin: 0,
    padding: '3px 5px',
  },
  key: {
    color: color.strong,
    flex: '0 0 50%',
    fontWeight: 'bold',
    maxWidth: 300,
  },
  nonEditableInput: {
    color: color.secondaryText,
  },
  row: {
    borderBottom: `1px solid ${color.divider}`,
    display: 'flex',
    padding: `${spacing.units(-5)}px ${spacing.units(-6)}px`,
  },
  textfield: {
    maxWidth: 600,
  },
});

interface NewRunParametersProps {
  titleMessage: string;
  pipelineRoot?: string;
  // ComponentInputsSpec_ParameterSpec
  specParameters: SpecParameters;
  clonedRuntimeConfig: PipelineSpecRuntimeConfig;
  handlePipelineRootChange?: (pipelineRoot: string) => void;
  handleParameterChange?: (parameters: RuntimeParameters) => void;
  setIsValidInput?: (isValid: boolean) => void;
}

function convertInput(paramStr: string, paramType: ParameterType_ParameterTypeEnum): any {
  // TBD (jlyaoyuli): Currently, empty string is not allowed.
  if (paramStr === '') {
    return undefined;
  }
  switch (paramType) {
    case ParameterType_ParameterTypeEnum.BOOLEAN:
      if (paramStr === 'true' || paramStr === 'false') {
        return paramStr === 'true';
      }
      return null;
    case ParameterType_ParameterTypeEnum.STRING:
      return paramStr;
    case ParameterType_ParameterTypeEnum.NUMBER_INTEGER:
      if (Number.isInteger(Number(paramStr))) {
        return Number(paramStr);
      }
      return null;
    case ParameterType_ParameterTypeEnum.NUMBER_DOUBLE:
      if (!Number.isNaN(Number(paramStr))) {
        return Number(paramStr);
      }
      return null;
    case ParameterType_ParameterTypeEnum.LIST:
      if (!paramStr.trim().startsWith('[')) {
        return null;
      }
      try {
        return JSON.parse(paramStr);
      } catch (err) {
        return null;
      }
    case ParameterType_ParameterTypeEnum.STRUCT:
      if (!paramStr.trim().startsWith('{')) {
        return null;
      }
      try {
        return JSON.parse(paramStr);
      } catch (err) {
        return null;
      }
    default:
      // TODO: (jlyaoyuli) Validate if the type of parameters matches the value
      // If it doesn't throw an error message next to the TextField.
      console.log('Unknown paramter type: ' + paramType);
      return null;
  }
}

function generateInputValidationErrMsg(
  parametersInRealType: any,
  paramType: ParameterType_ParameterTypeEnum,
) {
  let errorMessage;
  switch (parametersInRealType) {
    case undefined:
      errorMessage = 'Missing parameter.';
      break;
    // TODO(jlyaoyuli): tell the error difference between mismatch type or invalid JSON form.
    case null:
      errorMessage =
        'Invalid input. This parameter should be in ' +
        ParameterType_ParameterTypeEnum[paramType] +
        ' type';
      break;
    default:
      errorMessage = null;
  }
  return errorMessage;
}

function convertNonUserInputParamToString(
  specParameters: SpecParameters,
  key: string,
  value: any,
): string {
  let paramStr;
  if (!specParameters[key]) {
    return '';
  }
  switch (specParameters[key].parameterType) {
    case ParameterType_ParameterTypeEnum.STRUCT:
    case ParameterType_ParameterTypeEnum.LIST:
      paramStr = JSON.stringify(value);
      break;
    case ParameterType_ParameterTypeEnum.BOOLEAN:
    case ParameterType_ParameterTypeEnum.NUMBER_INTEGER:
    case ParameterType_ParameterTypeEnum.NUMBER_DOUBLE:
      paramStr = value.toString();
      break;
    default:
      paramStr = value;
  }
  return paramStr;
}

function NewRunParametersV2(props: NewRunParametersProps) {
  const { specParameters, clonedRuntimeConfig, handleParameterChange, setIsValidInput } = props;
  const [customPipelineRootChecked, setCustomPipelineRootChecked] = useState(false);
  const [customPipelineRoot, setCustomPipelineRoot] = useState(props.pipelineRoot);
  const [errorMessages, setErrorMessages] = useState<string[]>([]);

  const [updatedParameters, setUpdatedParameters] = useState({});
  useEffect(() => {
    if (clonedRuntimeConfig.parameters) {
      const clonedRuntimeParametersStr: RuntimeParameters = {};
      // Convert cloned parameter to string type first to avoid error from convertInput
      Object.entries(clonedRuntimeConfig.parameters).forEach(entry => {
        clonedRuntimeParametersStr[entry[0]] = convertNonUserInputParamToString(
          specParameters,
          entry[0],
          entry[1],
        );
      });
      setUpdatedParameters(clonedRuntimeParametersStr);
      // Directly using cloned paramters guarantees input is valid and no error message
      setErrorMessages([]);
      if (setIsValidInput) {
        setIsValidInput(true);
      }

      if (handleParameterChange) {
        handleParameterChange(clonedRuntimeConfig.parameters);
      }
      return;
    }
    // TODO(jlyaoyuli): If we have parameters from run, put original default value next to the paramKey
    const runtimeParametersWithDefault: RuntimeParameters = {};
    let allParamtersWithDefault = true;
    let errMsg: string[] = [];
    Object.keys(specParameters).forEach(key => {
      if (specParameters[key].defaultValue) {
        // TODO(zijianjoy): Make sure to consider all types of parameters.
        // Convert default value to string type first to avoid error from convertInput
        runtimeParametersWithDefault[key] = convertNonUserInputParamToString(
          specParameters,
          key,
          specParameters[key].defaultValue,
        );
      } else {
        allParamtersWithDefault = false;
        errMsg[key] = 'Missing parameter.';
      }
    });
    setUpdatedParameters(runtimeParametersWithDefault);
    setErrorMessages(errMsg);
    if (setIsValidInput) {
      setIsValidInput(allParamtersWithDefault);
    }
  }, [clonedRuntimeConfig, specParameters, handleParameterChange, setIsValidInput]);

  return (

Pipeline Root

        Pipeline Root represents an artifact repository, refer to{' '}
        <ExternalLink href='https://www.kubeflow.org/docs/components/pipelines/overview/pipeline-root/'>
          Pipeline Root Documentation
        </ExternalLink>
        .

        <FormControlLabel
          label='Custom Pipeline Root'
          control={
            <Checkbox
              color='primary'
              checked={customPipelineRootChecked}
              onChange={(event, checked) => {
                setCustomPipelineRootChecked(checked);
                if (!checked) {
                  setCustomPipelineRoot(undefined);
                }
              }}
              inputProps={{ 'aria-label': 'Set custom pipeline root.' }}
            />
          }
        />

      {customPipelineRootChecked && (
        <TextField
          id={'[pipeline-root]'}
          variant='outlined'
          label={'pipeline-root'}
          value={customPipelineRoot || ''}
          onChange={ev => {
            setCustomPipelineRoot(ev.target.value);
          }}
          className={classes(commonCss.textField, css.textfield)}
        />
      )}

Run parameters

{props.titleMessage}

      {!!Object.keys(specParameters).length && (

          {Object.entries(specParameters).map(([k, v]) => {
            const param = {
              key: `${k} - ${ParameterType_ParameterTypeEnum[v.parameterType]}`,
              value: updatedParameters[k],
              type: v.parameterType,
              errorMsg: errorMessages[k],
            };

            return (

                <ParamEditor
                  key={k}
                  id={k}
                  onChange={value => {
                    let allInputsValid: boolean = true;
                    let parametersInRealType: RuntimeParameters = {};
                    const nextUpdatedParameters: RuntimeParameters = {};

                    Object.assign(nextUpdatedParameters, updatedParameters);
                    nextUpdatedParameters[k] = value;
                    setUpdatedParameters(nextUpdatedParameters);
                    Object.entries(nextUpdatedParameters).forEach(([k1, paramStr]) => {
                      parametersInRealType[k1] = convertInput(
                        paramStr,
                        specParameters[k1].parameterType,
                      );
                    });
                    if (handleParameterChange) {
                      handleParameterChange(parametersInRealType);
                    }

                    errorMessages[k] = generateInputValidationErrMsg(
                      parametersInRealType[k],
                      specParameters[k].parameterType,
                    );
                    setErrorMessages(errorMessages);

                    Object.values(errorMessages).forEach(errorMessage => {
                      allInputsValid = allInputsValid && errorMessage === null;
                    });

                    if (setIsValidInput) {
                      setIsValidInput(allInputsValid);
                    }
                  }}
                  param={param}
                />

                  {param.errorMsg}

            );
          })}

      )}

  );
}

export default NewRunParametersV2;

interface Param {
  key: string;
  value: any;
  type: ParameterType_ParameterTypeEnum;
  errorMsg: string;
}

interface ParamEditorProps {
  id: string;
  onChange: (value: string) => void;
  param: Param;
}

interface ParamEditorState {
  isEditorOpen: boolean;
  isInJsonForm: boolean;
  isJsonField: boolean;
}

class ParamEditor extends React.Component<ParamEditorProps, ParamEditorState> {
  public static getDerivedStateFromProps(
    nextProps: ParamEditorProps,
    prevState: ParamEditorState,
  ): { isInJsonForm: boolean; isJsonField: boolean } {
    let isJson = true;
    let paramType = nextProps.param.type;

    switch (paramType) {
      case ParameterType_ParameterTypeEnum.LIST:
      case ParameterType_ParameterTypeEnum.STRUCT:
        isJson = true;
        break;
      case ParameterType_ParameterTypeEnum.STRING:
      case ParameterType_ParameterTypeEnum.BOOLEAN:
      case ParameterType_ParameterTypeEnum.NUMBER_INTEGER:
      case ParameterType_ParameterTypeEnum.NUMBER_DOUBLE:
        isJson = false;
        break;
      default:
        isJson = false;
    }

    return {
      isInJsonForm: isJson,
      isJsonField: prevState.isJsonField || isJson,
    };
  }

  public state = {
    isEditorOpen: false,
    isInJsonForm: false,
    isJsonField: false,
  };

  public render(): JSX.Element | null {
    const { id, onChange, param } = this.props;

    const onClick = () => {
      if (this.state.isInJsonForm) {
        let paramType = param.type;
        let displayValue;
        switch (paramType) {
          case ParameterType_ParameterTypeEnum.LIST:
            displayValue = JSON.parse(param.value || '[]');
            break;
          case ParameterType_ParameterTypeEnum.STRUCT:
            displayValue = JSON.parse(param.value || '{}');
            break;
          default:
            // TODO(jlyaoyuli): If the type from PipelineSpec is either LIST or STURCT,
            // but the user-input or default value is invalid JSON form, show error message.
            displayValue = JSON.parse('');
        }

        // TODO(zijianjoy): JSON format needs to be struct or list type.
        if (this.state.isEditorOpen) {
          onChange(JSON.stringify(displayValue) || '');
        } else {
          onChange(JSON.stringify(displayValue, null, 2) || '');
        }
      }
      this.setState({
        isEditorOpen: !this.state.isEditorOpen,
      });
    };

    return (
      <>
        {this.state.isJsonField ? (
          <TextField
            id={id}
            disabled={this.state.isEditorOpen}
            variant='outlined'
            label={param.key}
            value={param.value || ''}
            onChange={ev => onChange(ev.target.value || '')}
            className={classes(commonCss.textField, css.textfield)}
            InputProps={{
              classes: { disabled: css.nonEditableInput },
              endAdornment: (
                <InputAdornment position='end'>
                  <Button className={css.button} color='secondary' onClick={onClick}>
                    {this.state.isEditorOpen ? 'Close Json Editor' : 'Open Json Editor'}
                  </Button>
                </InputAdornment>
              ),
              readOnly: false,
            }}
          />
        ) : (
          <TextField
            id={id}
            variant='outlined'
            label={param.key}
            //TODO(zijianjoy): Convert defaultValue to correct type.
            value={param.value || ''}
            onChange={ev => onChange(ev.target.value || '')}
            className={classes(commonCss.textField, css.textfield)}
          />
        )}
        {this.state.isJsonField && this.state.isEditorOpen && (

            <Editor
              width='100%'
              minLines={3}
              maxLines={20}
              mode='json'
              theme='github'
              highlightActiveLine={true}
              showGutter={true}
              readOnly={false}
              onChange={text => onChange(text || '')}
              value={param.value || ''}
            />

        )}
      </>
    );
  }
}


text:
module Cryptoexchange::Exchanges
  module Mandala
    module Services
      class Pairs < Cryptoexchange::Services::Pairs
        PAIRS_URL = "#{Cryptoexchange::Exchanges::Mandala::Market::API_URL}/market/get-market-summary"

        def fetch
          output = super
          adapt(output)
        end

        def adapt(output)
          data = output['data'].map
          data.each do |k, v|
            target, base = k.split("_")
            Cryptoexchange::Models::MarketPair.new(
                base:   base,
                target: target,
                market: Mandala::Market::NAME
            )
          end
        end
      end
    end
  end
end


text:
package kieker.common.record.flow;

/**
 * @author Jan Waller
 *
 * @since 1.6
 */
public interface IObjectRecord extends IFlowRecord, IClassSignature {
	public int getObjectId() ;

}


text:
IoP version 0.6.3 is now available for download at:
  http://sourceforge.net/projects/iop/files/IoP/iop-0.6.3/

This is a bug-fix release, with no new features.

Please report bugs using the issue tracker at github:
  https://github.com/bitcoin/bitcoin/issues

CHANGE SUMMARY

Fixed a serious denial-of-service attack that could cause the
iop process to become unresponsive. Thanks to Sergio Lerner
for finding and responsibly reporting the problem. (CVE-2012-3789)

Optimized the process of checking transaction signatures, to
speed up processing of new block messages and make propagating
blocks across the network faster.

Fixed an obscure bug that could cause the iop process to get
stuck on an invalid block-chain, if the invalid chain was
hundreds of blocks long.

IoP-Qt no longer automatically selects the first address
in the address book (Issue #1384).

Fixed minimize-to-dock behavior of IoP-Qt on the Mac.

Added a block checkpoint at block 185,333 to speed up initial
blockchain download.


text:
<resources>
    //strings
    <string name="app_name">aperto</string>
    <string name="action_settings">Settings</string>
    <string name="google_maps_key">AIzaSyDW8rIdBNAkID0f7i470vAcZihh3vn8oeI</string>
    <string name="user_name">John Nielsen</string>
    <string name="add_new_spot_choose_category">Choose category</string>
    <string name="add_new_spot_description_title">Description (optional)</string>
    <string name="add_new_spot_add_photo_title">Add photo</string>
    <string name="add_new_spot_rating_title">Rating</string>
    <string name="add_new_spot_title">Title</string>
    <string name="add_new_spot_title_prompt">E.g. Fælledparken</string>
    <string name="add_new_spot_submit_btn">Add spot</string>
    <string name="filter_button">Filter</string>
    <string name="icon8_title">Icons8</string>
    <string name="google_title">Google Material icons</string>
    <string name="icon8_link">https://icons8.com/</string>
    <string name="google_link">https://design.google.com/icons/</string>
    <string name="developers_title">Developers</string>
    <string name="credits_title">Credits</string>
    <string name="favourite_title">Favourites</string>
    <string name="detail_desc_short">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
    eiusmod tempor incididunt ut labore et dolore magna aliqua.</string>
</resources>


text:
using Graphite.Authentication;

namespace TestHarness
{
    public class AuthenticationTestsHandler
    {
        public void Post_Secure() { }
        public void Post_BasicSecure() { }
    }

    public class TestBasicAuthenticator : BasicAuthenticatorBase
    {
        public override bool Authenticate(string username, string password)
        {
            return username == "fark" && password == "farker";
        }
    }

    public class TestBearerTokenAuthenticator : BearerTokenAuthenticatorBase
    {
        public override bool Authenticate(string credentials)
        {
            return credentials == "fark";
        }
    }
}