text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using whatTheHack.App_Plugins.Dao;
using whatTheHack.App_Plugins.Service;
using whatTheHack2.Models.Database;

namespace whatTheHack2.App_Plugins.Service
{
    public class UserService : Service<AspNetUsers, UserDao>
    {
        public AspNetUsers findById(string userId)
        {
            return base.tDao.select().Where(a => a.Id == userId).Single();
        }

    }

}


text:
<!DOCTYPE html>
<html>
<head>
    <title>dex.js : ECharts Network</title>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.slim.min.js"></script>

</head>
<body>

<script>

</script>
</body>
</html>

redpajama_set_name: RedPajamaGithub


text:
Queries ({{ vm.patientQueries.length}})

Queried Patient Information

 0">No current queries

 0">

                  Name
                  Date of Birth
                  Gender
                  Last Updated
                  Status
                  Action

                  {{ vm.convertDobString(query.terms.dob) }}
                  {{ query.terms.gender }}
                  {{ query.lastRead | date : 'medium' }}

                    <uib-progress ng-click="vm.viewingDetails[query.id] = !vm.viewingDetails[query.id]" max="query.endpointStatuses.length" ng-if="query.status !== 'Complete'">
                      <uib-bar class="progress-striped active" value="vm.countComplete(query)" type="success">{{ vm.countComplete(query) }} organization 1">s complete</uib-bar>
                      <uib-bar class="progress-striped active" value="query.endpointStatuses.length - vm.countComplete(query)" type="info">{{ query.endpointStatuses.length - vm.countComplete(query) }} organization 1">s pending</uib-bar>
                    </uib-progress>
                    <uib-progressbar ng-click="vm.viewingDetails[query.id] = !vm.viewingDetails[query.id]" class="progress-striped-no" ng-if="query.status === 'Complete'" value="100" type="{{ query.recordCount > 0 ? 'success' : 'danger' }}">{{ query.recordCount }} records found</uib-progressbar>

                        <button ng-if="endpoint.status === 'Active'" class="btn btn-sm pull-right" ng-class="endpoint.isClearing ? 'btn-warning' : 'btn-danger'" ng-click="vm.cancelQueryEndpoint(endpoint)" ng-disabled="endpoint.isClearing">Cancel query for {{ endpoint.endpoint.locations[0].parentOrgName }}</button>
                        <button ng-if="endpoint.status !== 'Active'" class="btn btn-sm pull-right" ng-class="endpoint.isRequerying ? 'btn-warning' : 'btn-primary'" ng-click="vm.requeryEndpoint(endpoint)" ng-disabled="endpoint.isRequerying">Refresh query for {{ endpoint.endpoint.locations[0].parentOrgName }}</button>
                        {{ endpoint.endpoint.managingOrganization }}: {{ endpoint.status }}, {{ endpoint.results.length }} records found

{{ location.name }}

                    <button ng-if="query.status === 'Complete' && query.recordCount !== 0" class="btn btn-success btn-sm" ng-click="vm.stagePatient(query)">Stage {{ commonService.displayName(query.terms.name) }}</button>
                    <button ng-if="query.status !== 'Complete' || query.recordCount === 0" class="btn btn-danger btn-sm"
                            confirm="Are you sure you'd like to clear this Patient Query?"
                            confirm-title="Confirmation"
                            confirm-ok="Yes"
                            confirm-cancel="No"
                            confirm-settings="{animation: false, keyboard: false, backdrop: 'static'}"
                            ng-click="vm.clearQuery(query)">Clear query for {{ commonService.displayName(query.terms.name) }}</button>
                    <button ng-if="query.status === 'Complete'" class="btn btn-primary btn-sm" ng-click="vm.requery(query)">Redo query for {{ commonService.displayName(query.terms.name) }}</button>


text:
<?php

namespace HealthCareAbroad\FrontendBundle\Tests\Controller;

use HealthCareAbroad\FrontendBundle\Tests\FrontendBundleWebTestCase;

class InstitutionControllerTest extends FrontendBundleWebTestCase
{

    public function testProfile()
    {
        $uri = "/hospital/ahalia-eye-hospital";
        $client = static::createClient();
        $crawler = $client->request('GET', $uri);

        $this->assertGreaterThan(0,$crawler->filter('h1:contains("Hospital")')->count());
        $this->assertGreaterThan(0,$crawler->filter('img.featured-image')->count());
        $this->assertGreaterThan(0,$crawler->filter('img.hospital-logo')->count());

        //clinics section details
        $this->assertGreaterThan(0,$crawler->filter('h5:contains("Clinics")')->count());
        $this->assertGreaterThan(0,$crawler->filter('span:contains("Audiology Services")')->count());
        $this->assertGreaterThan(0,$crawler->filter('span:contains("Pre-Admission")')->count());

        //services section details
        $this->assertGreaterThan(0,$crawler->filter('h5:contains("Services")')->count());
        $this->assertGreaterThan(0,$crawler->filter('li:contains("Text Message Reminders")')->count());

        //awards section details
        $this->assertGreaterThan(0,$crawler->filter('h5:contains("Awards")')->count());
        $this->assertGreaterThan(0,$crawler->filter('li:contains("test")')->count());

        //doctors section details
        $this->assertGreaterThan(0,$crawler->filter('a:contains("DOCTORS")')->count());
        $this->assertGreaterThan(0,$crawler->filter('span.doctor-icon')->count());
        $this->assertGreaterThan(0,$crawler->filter('strong:contains("Dr. Pankaj  Chaturvedi")')->count());
        $this->assertGreaterThan(0,$crawler->filter('strong:contains("Dr. test  test")')->count());
        $this->assertGreaterThan(0,$crawler->filter('p:contains("Allergy and Immunology")')->count());

        //test invalid institutionSlug
        $uri = "/hospital/test-singlasde-hospital";
        $client = static::createClient();
        $crawler = $client->request('GET', $uri);
        $this->assertEquals(500,$client->getResponse()->getStatusCode());
    }

    public function testSingleInstitutionProfile()
    {

        $uri = "/hospital/test-single-hospital";
        $client = static::createClient();
        $crawler = $client->request('GET', $uri);
        $this->assertGreaterThan(0,$crawler->filter('h1:contains("Test Single Hospital")')->count());
        $this->assertGreaterThan(0,$crawler->filter('address:contains("Apollo Gleneagles Hospital, No. 58, Canal Circular Road 700054")')->count());
        $this->assertGreaterThan(0,$crawler->filter('span.clinic-default-logo')->count());

        //specializations section details
        $this->assertGreaterThan(0,$crawler->filter('h5:contains("Specializations")')->count());
        $this->assertGreaterThan(0,$crawler->filter('a:contains("test")')->count());

        //services section details
        $this->assertGreaterThan(0,$crawler->filter('h5:contains("Services")')->count());
        $this->assertGreaterThan(0,$crawler->filter('li:contains("Booking for Hotel Accommodation")')->count());

        //awards section details
        $this->assertGreaterThan(0,$crawler->filter('h5:contains("Awards")')->count());
        $this->assertGreaterThan(0,$crawler->filter('li:contains("testetest")')->count());

        //test invalid institutionSlug
        $uri = "/hospital/test-singlasde-hospital";
        $client = static::createClient();
        $crawler = $client->request('GET', $uri);
        $this->assertEquals(500,$client->getResponse()->getStatusCode());
    }

}


text:
package yaes.framework.simulation.parametersweep.actions;

import java.io.File;
import yaes.framework.simulation.Simulation;
import yaes.framework.simulation.SimulationInput;
import yaes.framework.simulation.SimulationOutput;
import yaes.framework.simulation.parametersweep.ExperimentPackage;
import yaes.ui.format.Formatter;
import yaes.ui.text.TextUi;
import yaes.ui.text.TextUiHelper;

/**
 *
 * yaes.framework.simulation.parametersweep.actions.dtaRun
 *
 * @todo describe
 *
 * @author Ladislau Boloni (lboloni@eecs.ucf.edu)
 */
public class dtaRun implements IDirectoryTraversalAction {

    private int countRunsExecuted    = 0;
    private int countRunsInExecution = 0;
    private int countRunsNotExecuted = 0;
    private int countRunsTotal       = 0;
    private String currentExecution = "none";

    /**
     * @return the countRunsExecuted
     */
    public int getCountRunsExecuted() {
        return countRunsExecuted;
    }

    /**
     * @return the countRunsInExecution
     */
    public int getCountRunsInExecution() {
        return countRunsInExecution;
    }

    /**
     * @return the countRunsNotExecuted
     */
    public int getCountRunsNotExecuted() {
        return countRunsNotExecuted;
    }

    /**
     * @param file
     *
     */
    @SuppressWarnings({ "rawtypes", "unchecked" })
    @Override
    public void action(File inputFile) {
        String inputfilepath = inputFile.getAbsolutePath();
        String root = inputfilepath.substring(0, inputfilepath.length() - 4);
        File outputFile = new File(root + ExperimentPackage.EXTENSION_OUTPUT);
        File lockFile = new File(root + ExperimentPackage.EXTENSION_LOCK);
        if (outputFile.exists()) {
            return;
        }
        try {
        	// if the lockfile cannot be created
            if (!lockFile.createNewFile()) {
                return;
            }
            printCurrentStatus();
            currentExecution = inputFile.toString();
            countRunsInExecution++;
            // lockFile.deleteOnExit();
            // create the lock file and keep it open
            SimulationInput sip = SimulationInput.restore(inputFile);
            String simulationClassName = sip.getSimulationClass();
            if (simulationClassName == null) {
            	TextUi.abort("dtaRun.action: the simulation class was not specified in the sip!");
            }
            Class simulationClass = Class.forName(simulationClassName);
            String contextClassName = sip.getContextClass();
            if (contextClassName == null) {
            	TextUi.abort("dtaRun.action: the context class was not specified in the sip!");
            }
            Class contextClass = Class.forName(contextClassName);
            SimulationOutput sop = Simulation.simulate(sip, simulationClass,
                    contextClass);
            sop.store(outputFile.toString());
        } catch (Exception e) {
        	TextUi.errorPrint("We are at dtaRun.action and found exception:");
            TextUi.errorPrint(e.toString());
            Thread.dumpStack();
            return;
        }
        countRunsInExecution--;
        countRunsExecuted++;
        countRunsNotExecuted--;
        lockFile.delete();
    }

    /**
     * @return the countRunsTotal
     */
    public int getCountRunsTotal() {
        return countRunsTotal;
    }

    /**
     * Prints the current status
     */
    public void printCurrentStatus() {
        Formatter fmt = new Formatter();
        fmt.add(TextUiHelper.createLabeledSeparator("-ExperimentPackage:"
                + countRunsExecuted + "/" + countRunsTotal));
        fmt.add("Currently executing:" + currentExecution);
        TextUi.println(fmt.toString());
    }

    /**
     * @param countRunsTotal
     *            the countRunsTotal to set
     */
    public void setCountRunsTotal(int countRunsTotal) {
        this.countRunsTotal = countRunsTotal;
    }
}


text:
pub enum Dimensions {
    Width,
    Height,
}


text:
using base::DictionaryValue;
using base::FundamentalValue;
using base::ListValue;
using base::StringValue;
using base::Value;
using base::WeakPtr;

namespace content {

namespace {

using GetRegistrationsCallback =
    base::Callback<void(const std::vector<ServiceWorkerRegistrationInfo>&,
                        const std::vector<ServiceWorkerVersionInfo>&,
                        const std::vector<ServiceWorkerRegistrationInfo>&)>;

void OperationCompleteCallback(WeakPtr<ServiceWorkerInternalsUI> internals,
                               int callback_id,
                               ServiceWorkerStatusCode status) {
  if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
    BrowserThread::PostTask(
        BrowserThread::UI,
        FROM_HERE,
        base::Bind(OperationCompleteCallback, internals, callback_id, status));
    return;
  }
  DCHECK_CURRENTLY_ON(BrowserThread::UI);
  if (internals) {
    internals->web_ui()->CallJavascriptFunction(
        "serviceworker.onOperationComplete",
        FundamentalValue(static_cast<int>(status)),
        FundamentalValue(callback_id));
  }
}

void CallServiceWorkerVersionMethodWithVersionID(
    ServiceWorkerInternalsUI::ServiceWorkerVersionMethod method,
    scoped_refptr<ServiceWorkerContextWrapper> context,
    int64_t version_id,
    const ServiceWorkerInternalsUI::StatusCallback& callback) {
  if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
    BrowserThread::PostTask(
        BrowserThread::IO,
        FROM_HERE,
        base::Bind(CallServiceWorkerVersionMethodWithVersionID,
                   method,
                   context,
                   version_id,
                   callback));
    return;
  }

  scoped_refptr<ServiceWorkerVersion> version =
      context->GetLiveVersion(version_id);
  if (!version.get()) {
    callback.Run(SERVICE_WORKER_ERROR_NOT_FOUND);
    return;
  }
  (*version.get().*method)(callback);
}

base::ProcessId GetRealProcessId(int process_host_id) {
  if (process_host_id == ChildProcessHost::kInvalidUniqueID)
    return base::kNullProcessId;

  RenderProcessHost* rph = RenderProcessHost::FromID(process_host_id);
  if (!rph)
    return base::kNullProcessId;

  base::ProcessHandle handle = rph->GetHandle();
  if (handle == base::kNullProcessHandle)
    return base::kNullProcessId;
  // TODO(nhiroki): On Windows, |rph->GetHandle()| does not duplicate ownership
  // of the process handle and the render host still retains it. Therefore, we
  // cannot create a base::Process object, which provides a proper way to get a
  // process id, from the handle. For a stopgap, we use this deprecated
  // function that does not require the ownership (http://crbug.com/417532).
  return base::GetProcId(handle);
}

void UpdateVersionInfo(const ServiceWorkerVersionInfo& version,
                       DictionaryValue* info) {
  switch (version.running_status) {
    case ServiceWorkerVersion::STOPPED:
      info->SetString("running_status", "STOPPED");
      break;
    case ServiceWorkerVersion::STARTING:
      info->SetString("running_status", "STARTING");
      break;
    case ServiceWorkerVersion::RUNNING:
      info->SetString("running_status", "RUNNING");
      break;
    case ServiceWorkerVersion::STOPPING:
      info->SetString("running_status", "STOPPING");
      break;
  }

  switch (version.status) {
    case ServiceWorkerVersion::NEW:
      info->SetString("status", "NEW");
      break;
    case ServiceWorkerVersion::INSTALLING:
      info->SetString("status", "INSTALLING");
      break;
    case ServiceWorkerVersion::INSTALLED:
      info->SetString("status", "INSTALLED");
      break;
    case ServiceWorkerVersion::ACTIVATING:
      info->SetString("status", "ACTIVATING");
      break;
    case ServiceWorkerVersion::ACTIVATED:
      info->SetString("status", "ACTIVATED");
      break;
    case ServiceWorkerVersion::REDUNDANT:
      info->SetString("status", "REDUNDANT");
      break;
  }
  info->SetString("script_url", version.script_url.spec());
  info->SetString("version_id", base::Int64ToString(version.version_id));
  info->SetInteger("process_id",
                   static_cast<int>(GetRealProcessId(version.process_id)));
  info->SetInteger("process_host_id", version.process_id);
  info->SetInteger("thread_id", version.thread_id);
  info->SetInteger("devtools_agent_route_id", version.devtools_agent_route_id);
}

ListValue* GetRegistrationListValue(
    const std::vector<ServiceWorkerRegistrationInfo>& registrations) {
  ListValue* result = new ListValue();
  for (std::vector<ServiceWorkerRegistrationInfo>::const_iterator it =
           registrations.begin();
       it != registrations.end();
       ++it) {
    const ServiceWorkerRegistrationInfo& registration = *it;
    DictionaryValue* registration_info = new DictionaryValue();
    registration_info->SetString("scope", registration.pattern.spec());
    registration_info->SetString(
        "registration_id", base::Int64ToString(registration.registration_id));

    if (registration.active_version.version_id !=
        kInvalidServiceWorkerVersionId) {
      DictionaryValue* active_info = new DictionaryValue();
      UpdateVersionInfo(registration.active_version, active_info);
      registration_info->Set("active", active_info);
    }

    if (registration.waiting_version.version_id !=
        kInvalidServiceWorkerVersionId) {
      DictionaryValue* waiting_info = new DictionaryValue();
      UpdateVersionInfo(registration.waiting_version, waiting_info);
      registration_info->Set("waiting", waiting_info);
    }

    result->Append(registration_info);
  }
  return result;
}

ListValue* GetVersionListValue(
    const std::vector<ServiceWorkerVersionInfo>& versions) {
  ListValue* result = new ListValue();
  for (std::vector<ServiceWorkerVersionInfo>::const_iterator it =
           versions.begin();
       it != versions.end();
       ++it) {
    DictionaryValue* info = new DictionaryValue();
    UpdateVersionInfo(*it, info);
    result->Append(info);
  }
  return result;
}

void DidGetStoredRegistrationsOnIOThread(
    scoped_refptr<ServiceWorkerContextWrapper> context,
    const GetRegistrationsCallback& callback,
    ServiceWorkerStatusCode status,
    const std::vector<ServiceWorkerRegistrationInfo>& stored_registrations) {
  DCHECK_CURRENTLY_ON(BrowserThread::IO);
  BrowserThread::PostTask(
      BrowserThread::UI, FROM_HERE,
      base::Bind(callback, context->GetAllLiveRegistrationInfo(),
                 context->GetAllLiveVersionInfo(), stored_registrations));
}

void GetRegistrationsOnIOThread(
    scoped_refptr<ServiceWorkerContextWrapper> context,
    const GetRegistrationsCallback& callback) {
  DCHECK_CURRENTLY_ON(BrowserThread::IO);
  context->GetAllRegistrations(
      base::Bind(DidGetStoredRegistrationsOnIOThread, context, callback));
}

void DidGetRegistrations(
    WeakPtr<ServiceWorkerInternalsUI> internals,
    int partition_id,
    const base::FilePath& context_path,
    const std::vector<ServiceWorkerRegistrationInfo>& live_registrations,
    const std::vector<ServiceWorkerVersionInfo>& live_versions,
    const std::vector<ServiceWorkerRegistrationInfo>& stored_registrations) {
  DCHECK_CURRENTLY_ON(BrowserThread::UI);
  if (!internals)
    return;

  ScopedVector<const Value> args;
  args.push_back(GetRegistrationListValue(live_registrations));
  args.push_back(GetVersionListValue(live_versions));
  args.push_back(GetRegistrationListValue(stored_registrations));
  args.push_back(new FundamentalValue(partition_id));
  args.push_back(new StringValue(context_path.value()));
  internals->web_ui()->CallJavascriptFunction("serviceworker.onPartitionData",
                                              args.get());
}

}  // namespace

class ServiceWorkerInternalsUI::PartitionObserver
    : public ServiceWorkerContextObserver {
 public:
  PartitionObserver(int partition_id, WebUI* web_ui)
      : partition_id_(partition_id), web_ui_(web_ui) {}
  ~PartitionObserver() override {}
  // ServiceWorkerContextObserver overrides:
  void OnRunningStateChanged(int64_t version_id,
                             ServiceWorkerVersion::RunningStatus) override {
    DCHECK_CURRENTLY_ON(BrowserThread::UI);
    web_ui_->CallJavascriptFunction(
        "serviceworker.onRunningStateChanged", FundamentalValue(partition_id_),
        StringValue(base::Int64ToString(version_id)));
  }
  void OnVersionStateChanged(int64_t version_id,
                             ServiceWorkerVersion::Status) override {
    DCHECK_CURRENTLY_ON(BrowserThread::UI);
    web_ui_->CallJavascriptFunction(
        "serviceworker.onVersionStateChanged",
        FundamentalValue(partition_id_),
        StringValue(base::Int64ToString(version_id)));
  }
  void OnErrorReported(int64_t version_id,
                       int process_id,
                       int thread_id,
                       const ErrorInfo& info) override {
    DCHECK_CURRENTLY_ON(BrowserThread::UI);
    ScopedVector<const Value> args;
    args.push_back(new FundamentalValue(partition_id_));
    args.push_back(new StringValue(base::Int64ToString(version_id)));
    args.push_back(new FundamentalValue(process_id));
    args.push_back(new FundamentalValue(thread_id));
    std::unique_ptr<DictionaryValue> value(new DictionaryValue());
    value->SetString("message", info.error_message);
    value->SetInteger("lineNumber", info.line_number);
    value->SetInteger("columnNumber", info.column_number);
    value->SetString("sourceURL", info.source_url.spec());
    args.push_back(value.release());
    web_ui_->CallJavascriptFunction("serviceworker.onErrorReported",
                                    args.get());
  }
  void OnReportConsoleMessage(int64_t version_id,
                              int process_id,
                              int thread_id,
                              const ConsoleMessage& message) override {
    DCHECK_CURRENTLY_ON(BrowserThread::UI);
    ScopedVector<const Value> args;
    args.push_back(new FundamentalValue(partition_id_));
    args.push_back(new StringValue(base::Int64ToString(version_id)));
    args.push_back(new FundamentalValue(process_id));
    args.push_back(new FundamentalValue(thread_id));
    std::unique_ptr<DictionaryValue> value(new DictionaryValue());
    value->SetInteger("sourceIdentifier", message.source_identifier);
    value->SetInteger("message_level", message.message_level);
    value->SetString("message", message.message);
    value->SetInteger("lineNumber", message.line_number);
    value->SetString("sourceURL", message.source_url.spec());
    args.push_back(value.release());
    web_ui_->CallJavascriptFunction("serviceworker.onConsoleMessageReported",
                                    args.get());
  }
  void OnRegistrationStored(int64_t registration_id,
                            const GURL& pattern) override {
    DCHECK_CURRENTLY_ON(BrowserThread::UI);
    web_ui_->CallJavascriptFunction("serviceworker.onRegistrationStored",
                                    StringValue(pattern.spec()));
  }
  void OnRegistrationDeleted(int64_t registration_id,
                             const GURL& pattern) override {
    web_ui_->CallJavascriptFunction("serviceworker.onRegistrationDeleted",
                                    StringValue(pattern.spec()));
  }
  int partition_id() const { return partition_id_; }

 private:
  const int partition_id_;
  WebUI* const web_ui_;
};

ServiceWorkerInternalsUI::ServiceWorkerInternalsUI(WebUI* web_ui)
    : WebUIController(web_ui), next_partition_id_(0) {
  WebUIDataSource* source =
      WebUIDataSource::Create(kChromeUIServiceWorkerInternalsHost);
  source->SetJsonPath("strings.js");
  source->AddResourcePath("serviceworker_internals.js",
                          IDR_SERVICE_WORKER_INTERNALS_JS);
  source->AddResourcePath("serviceworker_internals.css",
                          IDR_SERVICE_WORKER_INTERNALS_CSS);
  source->SetDefaultResource(IDR_SERVICE_WORKER_INTERNALS_HTML);
  source->DisableDenyXFrameOptions();

  BrowserContext* browser_context =
      web_ui->GetWebContents()->GetBrowserContext();
  WebUIDataSource::Add(browser_context, source);

  web_ui->RegisterMessageCallback(
      "GetOptions",
      base::Bind(&ServiceWorkerInternalsUI::GetOptions,
                 base::Unretained(this)));
  web_ui->RegisterMessageCallback(
      "SetOption",
      base::Bind(&ServiceWorkerInternalsUI::SetOption, base::Unretained(this)));
  web_ui->RegisterMessageCallback(
      "getAllRegistrations",
      base::Bind(&ServiceWorkerInternalsUI::GetAllRegistrations,
                 base::Unretained(this)));
  web_ui->RegisterMessageCallback(
      "stop",
      base::Bind(&ServiceWorkerInternalsUI::CallServiceWorkerVersionMethod,
                 base::Unretained(this),
                 &ServiceWorkerVersion::StopWorker));
  web_ui->RegisterMessageCallback(
      "inspect",
      base::Bind(&ServiceWorkerInternalsUI::InspectWorker,
                 base::Unretained(this)));
  web_ui->RegisterMessageCallback(
      "unregister",
      base::Bind(&ServiceWorkerInternalsUI::Unregister,
                 base::Unretained(this)));
  web_ui->RegisterMessageCallback(
      "start",
      base::Bind(&ServiceWorkerInternalsUI::StartWorker,
                 base::Unretained(this)));
}

ServiceWorkerInternalsUI::~ServiceWorkerInternalsUI() {
  BrowserContext* browser_context =
      web_ui()->GetWebContents()->GetBrowserContext();
  // Safe to use base::Unretained(this) because
  // ForEachStoragePartition is synchronous.
  BrowserContext::StoragePartitionCallback remove_observer_cb =
      base::Bind(&ServiceWorkerInternalsUI::RemoveObserverFromStoragePartition,
                 base::Unretained(this));
  BrowserContext::ForEachStoragePartition(browser_context, remove_observer_cb);
}

void ServiceWorkerInternalsUI::GetOptions(const ListValue* args) {
  DictionaryValue options;
  options.SetBoolean("debug_on_start",
                     ServiceWorkerDevToolsManager::GetInstance()
                         ->debug_service_worker_on_start());
  web_ui()->CallJavascriptFunction("serviceworker.onOptions", options);
}

void ServiceWorkerInternalsUI::SetOption(const ListValue* args) {
  std::string option_name;
  bool option_boolean;
  if (!args->GetString(0, &option_name) || option_name != "debug_on_start" ||
      !args->GetBoolean(1, &option_boolean)) {
    return;
  }
  ServiceWorkerDevToolsManager::GetInstance()
      ->set_debug_service_worker_on_start(option_boolean);
}

void ServiceWorkerInternalsUI::GetAllRegistrations(const ListValue* args) {
  DCHECK_CURRENTLY_ON(BrowserThread::UI);
  BrowserContext* browser_context =
      web_ui()->GetWebContents()->GetBrowserContext();
  // Safe to use base::Unretained(this) because
  // ForEachStoragePartition is synchronous.
  BrowserContext::StoragePartitionCallback add_context_cb =
      base::Bind(&ServiceWorkerInternalsUI::AddContextFromStoragePartition,
                 base::Unretained(this));
  BrowserContext::ForEachStoragePartition(browser_context, add_context_cb);
}

void ServiceWorkerInternalsUI::AddContextFromStoragePartition(
    StoragePartition* partition) {
  int partition_id = 0;
  scoped_refptr<ServiceWorkerContextWrapper> context =
      static_cast<ServiceWorkerContextWrapper*>(
          partition->GetServiceWorkerContext());
  if (PartitionObserver* observer =
          observers_.get(reinterpret_cast<uintptr_t>(partition))) {
    partition_id = observer->partition_id();
  } else {
    partition_id = next_partition_id_++;
    std::unique_ptr<PartitionObserver> new_observer(
        new PartitionObserver(partition_id, web_ui()));
    context->AddObserver(new_observer.get());
    observers_.set(reinterpret_cast<uintptr_t>(partition),
                   std::move(new_observer));
  }

  BrowserThread::PostTask(
      BrowserThread::IO, FROM_HERE,
      base::Bind(GetRegistrationsOnIOThread, context,
                 base::Bind(DidGetRegistrations, AsWeakPtr(), partition_id,
                            context->is_incognito() ? base::FilePath()
                                                    : partition->GetPath())));
}

void ServiceWorkerInternalsUI::RemoveObserverFromStoragePartition(
    StoragePartition* partition) {
  std::unique_ptr<PartitionObserver> observer(
      observers_.take_and_erase(reinterpret_cast<uintptr_t>(partition)));
  if (!observer.get())
    return;
  scoped_refptr<ServiceWorkerContextWrapper> context =
      static_cast<ServiceWorkerContextWrapper*>(
          partition->GetServiceWorkerContext());
  context->RemoveObserver(observer.get());
}

void ServiceWorkerInternalsUI::FindContext(
    int partition_id,
    StoragePartition** result_partition,
    StoragePartition* storage_partition) const {
  PartitionObserver* observer =
      observers_.get(reinterpret_cast<uintptr_t>(storage_partition));
  if (observer && partition_id == observer->partition_id()) {
    *result_partition = storage_partition;
  }
}

bool ServiceWorkerInternalsUI::GetServiceWorkerContext(
    int partition_id,
    scoped_refptr<ServiceWorkerContextWrapper>* context) const {
  BrowserContext* browser_context =
      web_ui()->GetWebContents()->GetBrowserContext();
  StoragePartition* result_partition(NULL);
  BrowserContext::StoragePartitionCallback find_context_cb =
      base::Bind(&ServiceWorkerInternalsUI::FindContext,
                 base::Unretained(this),
                 partition_id,
                 &result_partition);
  BrowserContext::ForEachStoragePartition(browser_context, find_context_cb);
  if (!result_partition)
    return false;
  *context = static_cast<ServiceWorkerContextWrapper*>(
      result_partition->GetServiceWorkerContext());
  return true;
}

void ServiceWorkerInternalsUI::CallServiceWorkerVersionMethod(
    ServiceWorkerVersionMethod method,
    const ListValue* args) {
  DCHECK_CURRENTLY_ON(BrowserThread::UI);
  int callback_id;
  const DictionaryValue* cmd_args = NULL;
  int partition_id;
  scoped_refptr<ServiceWorkerContextWrapper> context;
  std::string version_id_string;
  int64_t version_id = 0;
  if (!args->GetInteger(0, &callback_id) ||
      !args->GetDictionary(1, &cmd_args) ||
      !cmd_args->GetInteger("partition_id", &partition_id) ||
      !GetServiceWorkerContext(partition_id, &context) ||
      !cmd_args->GetString("version_id", &version_id_string) ||
      !base::StringToInt64(version_id_string, &version_id)) {
    return;
  }

  base::Callback<void(ServiceWorkerStatusCode)> callback =
      base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id);
  CallServiceWorkerVersionMethodWithVersionID(
      method, context, version_id, callback);
}

void ServiceWorkerInternalsUI::InspectWorker(const ListValue* args) {
  DCHECK_CURRENTLY_ON(BrowserThread::UI);
  int callback_id;
  const DictionaryValue* cmd_args = NULL;
  int process_host_id = 0;
  int devtools_agent_route_id = 0;
  if (!args->GetInteger(0, &callback_id) ||
      !args->GetDictionary(1, &cmd_args) ||
      !cmd_args->GetInteger("process_host_id", &process_host_id) ||
      !cmd_args->GetInteger("devtools_agent_route_id",
                            &devtools_agent_route_id)) {
    return;
  }
  base::Callback<void(ServiceWorkerStatusCode)> callback =
      base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id);
  scoped_refptr<DevToolsAgentHostImpl> agent_host(
      ServiceWorkerDevToolsManager::GetInstance()
          ->GetDevToolsAgentHostForWorker(process_host_id,
                                          devtools_agent_route_id));
  if (!agent_host.get()) {
    callback.Run(SERVICE_WORKER_ERROR_NOT_FOUND);
    return;
  }
  agent_host->Inspect(web_ui()->GetWebContents()->GetBrowserContext());
  callback.Run(SERVICE_WORKER_OK);
}

void ServiceWorkerInternalsUI::Unregister(const ListValue* args) {
  DCHECK_CURRENTLY_ON(BrowserThread::UI);
  int callback_id;
  int partition_id;
  std::string scope_string;
  const DictionaryValue* cmd_args = NULL;
  scoped_refptr<ServiceWorkerContextWrapper> context;
  if (!args->GetInteger(0, &callback_id) ||
      !args->GetDictionary(1, &cmd_args) ||
      !cmd_args->GetInteger("partition_id", &partition_id) ||
      !GetServiceWorkerContext(partition_id, &context) ||
      !cmd_args->GetString("scope", &scope_string)) {
    return;
  }

  base::Callback<void(ServiceWorkerStatusCode)> callback =
      base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id);
  UnregisterWithScope(context, GURL(scope_string), callback);
}

void ServiceWorkerInternalsUI::StartWorker(const ListValue* args) {
  DCHECK_CURRENTLY_ON(BrowserThread::UI);
  int callback_id;
  int partition_id;
  std::string scope_string;
  const DictionaryValue* cmd_args = NULL;
  scoped_refptr<ServiceWorkerContextWrapper> context;
  if (!args->GetInteger(0, &callback_id) ||
      !args->GetDictionary(1, &cmd_args) ||
      !cmd_args->GetInteger("partition_id", &partition_id) ||
      !GetServiceWorkerContext(partition_id, &context) ||
      !cmd_args->GetString("scope", &scope_string)) {
    return;
  }
  base::Callback<void(ServiceWorkerStatusCode)> callback =
      base::Bind(OperationCompleteCallback, AsWeakPtr(), callback_id);
  context->StartServiceWorker(GURL(scope_string), callback);
}

void ServiceWorkerInternalsUI::UnregisterWithScope(
    scoped_refptr<ServiceWorkerContextWrapper> context,
    const GURL& scope,
    const ServiceWorkerInternalsUI::StatusCallback& callback) const {
  if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
    BrowserThread::PostTask(
        BrowserThread::IO, FROM_HERE,
        base::Bind(&ServiceWorkerInternalsUI::UnregisterWithScope,
                   base::Unretained(this), context, scope, callback));
    return;
  }

  if (!context->context()) {
    callback.Run(SERVICE_WORKER_ERROR_ABORT);
    return;
  }

  // ServiceWorkerContextWrapper::UnregisterServiceWorker doesn't work here
  // because that reduces a status code to boolean.
  context->context()->UnregisterServiceWorker(scope, callback);
}

}  // namespace content


text:
package org.wso2.carbon.dataservices.core.test.excel;

import org.apache.axiom.om.OMElement;
import org.wso2.carbon.dataservices.core.test.DataServiceBaseTestCase;
import org.wso2.carbon.dataservices.core.test.util.TestUtils;

public class ExcelServiceTest extends DataServiceBaseTestCase {

private String epr = null;

	public ExcelServiceTest(String testName) {
		super(testName);
		this.epr = this.baseEpr + "ExcelService";
	}

	/**
	 * Test Excel 2000/XP file datasource
	 */
	public void testExcelOldFormatNoHeaderWithInts() {
		TestUtils.showMessage(this.epr + " - testExcelOldFormatNoHeaderWithInts");
		try {
            TestUtils.checkForService(this.epr);
			OMElement result = TestUtils.callOperation(this.epr,
					"excel_old_noheader_with_ints_op", null);
			assertTrue(TestUtils.validateResultStructure(result,
					TestUtils.CUSTOMER_XSD_PATH));
		} catch (Exception e) {
			e.printStackTrace();
			fail(e.getMessage());
		}
	}

	/**
	 * Test Excel 2007 file datasource
	 */
	public void testExcelNewFormatNoHeader() {
		TestUtils.showMessage(this.epr + " - testExcelNewFormatNoHeader");
		try {
            TestUtils.checkForService(this.epr);
			OMElement result = TestUtils.callOperation(this.epr,
					"excel_new_op", null);
			assertTrue(TestUtils.validateResultStructure(result,
					TestUtils.CUSTOMER_XSD_PATH));
		} catch (Exception e) {
			e.printStackTrace();
			fail(e.getMessage());
		}
	}

	public void testExcelOldNoInts() {
		TestUtils.showMessage(this.epr + " - testExcelOldNoInts");
		try {
            TestUtils.checkForService(this.epr);
			OMElement result = TestUtils.callOperation(this.epr,
					"customers_old_no_ints_op", null);
			assertTrue(TestUtils.validateResultStructure(result,
					TestUtils.OFFICES_XSD_PATH));
		} catch (Exception e) {
			e.printStackTrace();
			fail(e.getMessage());
		}
	}

}


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;

namespace DataBoss.Data
{
	public class DataReaderSchemaTable : IEnumerable<DataReaderSchemaRow>
	{
		readonly List<DataReaderSchemaRow> rows = new();

		public int Count => rows.Count;

		public DataReaderSchemaRow this[int index] => rows[index];

		public void Add(string name, int ordinal, Type dataType, bool allowDBNull, int? columnSize = null, string dataTypeName = null, Type providerSpecificDataType = null) {
			var o = rows.Count;
			rows.Add(new DataReaderSchemaRow {
				ColumnName = name,
				Ordinal = ordinal,
				DataType = dataType,
				ProviderSpecificDataType = providerSpecificDataType ?? dataType,
				AllowDBNull = allowDBNull,
				ColumnSize = columnSize,
				DataTypeName = dataTypeName,
			});
			if (o != ordinal)
				rows.Sort((a, b) => a.Ordinal.CompareTo(b.Ordinal));
		}

		public int GetOrdinal(string name) {
			var n = rows.FindIndex(x => x.ColumnName == name);
			return n != -1 ? n : throw new InvalidOperationException($"No column named '{name}' found");
		}

		public DataTable ToDataTable() {
			var schema = new DataTable();
			var columnName = schema.Columns.Add(DataReaderSchemaColumns.ColumnName);
			var columnOrdinal = schema.Columns.Add(DataReaderSchemaColumns.ColumnOrdinal);
			var columnSize = schema.Columns.Add(DataReaderSchemaColumns.ColumnSize);
			var allowDBNull = schema.Columns.Add(DataReaderSchemaColumns.AllowDBNull);
			var dataType = schema.Columns.Add(DataReaderSchemaColumns.DataType);
			var dataTypeName = schema.Columns.Add(DataReaderSchemaColumns.DataTypeName);
			var isKey = schema.Columns.Add(DataReaderSchemaColumns.IsKey);
			var providerSpecificDataType = schema.Columns.Add(DataReaderSchemaColumns.ProviderSpecificDataType);
			foreach (var item in rows) {
				var r = schema.NewRow();
				r[columnName] = item.ColumnName;
				r[columnOrdinal] = item.Ordinal;
				r[columnSize] = item.ColumnSize ?? (object)DBNull.Value;
				r[allowDBNull] = item.AllowDBNull;
				r[dataType] = item.DataType;
				r[providerSpecificDataType] = item.ProviderSpecificDataType;
				r[dataTypeName] = item.DataTypeName;
				r[isKey] = false;
				schema.Rows.Add(r);
			}

			return schema;
		}

		public IEnumerator<DataReaderSchemaRow> GetEnumerator() => rows.GetEnumerator();
		IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
	}
}


text:
package main

import Factory.FactorySemiProportionnel
import implementationVoteSimple._
import Gvote.Parti
import Gvote.Candidat
import Gvote.ScrutinCST
import GUI.GUI_IHMSwing

object ExampleSemiProportionnel {

  def main(args : Array[String]) : Unit = {

   /*
    * On doit obligatoirement définir le nombre de siège
    */

  var system : SystemeDeComptageSemiProportionel = FactorySemiProportionnel.createCountingSystem(2, ScrutinCST.prive);

  system.initElection;

  val parti : Parti = new Parti(0, "PARTI")

  val candidat1 = new Candidat(1 , "candidat1" ,"candidat1" ,parti)
  candidat1.sePresenter(system);
  val candidat2 = new Candidat(2 , "candidat2" ,"candidat2" ,parti)
  candidat2.sePresenter(system);
  val candidat3 = new Candidat(3 , "candidat3" ,"candidat3" ,parti)
  candidat3.sePresenter(system);

  system.cloturerCandidature;

  val elec1 = new  Electeur (1 , "login1","nom1","prenom1","password1");
  val elec2 = new  Electeur (2 , "login2","nom2","prenom2","password2");
  val elec3 = new  Electeur (3 , "login3","nom3","prenom3","password3");
  val elec4 = new  Electeur (4 , "login4","nom4","prenom4","password4");
  val elec5 = new  Electeur (5 , "login5","nom5","prenom5","password5");
  val elec6 = new  Electeur (6 , "login6","nom6","prenom6","password6");

  GUI_IHMSwing.runVote(List((elec1,system)))
  GUI_IHMSwing.runVote(List((elec2,system)))
  GUI_IHMSwing.runVote(List((elec3,system)))
  GUI_IHMSwing.runVote(List((elec4,system)))
  GUI_IHMSwing.runVote(List((elec5,system)))
  GUI_IHMSwing.runVote(List((elec6,system)))

  system.runTour;

  for (gagnants <- system.getGagnants)
    println(gagnants.nom +" a obtenu un siege ")

  }
}


text:
import arrayFind from "../../../../utils/array_find";
import log from "../log";
import {
  ICompatibleKeySystem,
  IDisplayConfiguration,
  IMediaConfiguration,
  IMediaKeySystemConfiguration,
  ProberStatus,
} from "../types";
import probeMediaConfiguration, { IBrowserAPIS } from "./probeMediaConfiguration";

/**
 * Probe configuration and get status from result.
 * @param {Object} config
 * @param {Array.<Object>} browserAPIS
 * @returns {Promise.<string>}
 */
function getStatusFromConfiguration(
  config: IMediaConfiguration,
  browserAPIS: IBrowserAPIS[]
): Promise<string> {
  return probeMediaConfiguration(config, browserAPIS)
    .then(({ globalStatus }) => {
      switch (globalStatus) {
        case ProberStatus.Unknown:
          return "Unknown";
        case ProberStatus.Supported:
          return "Supported";
      }
      return "NotSupported";
    });
}

/**
 * A set of API to probe media capabilites.
 * Each API allow to evalute a specific feature (HDCP support, decoding infos, etc)
 * and relies on different browser API to probe capabilites.
 */
const mediaCapabilitiesProber = {

  /**
   * Set logger level
   * @param {string} level
   */
  set LogLevel(level: string) {
    log.setLevel(level);
  },

  /**
   * Get logger level
   * @returns {string}
   */
  get LogLevel() : string {
    return log.getLevel();
  },

  /**
   * Get HDCP status. Evaluates if current equipement support given
   * HDCP revision.
   * @param {string}
   * @returns {Promise}
   */
  getStatusForHDCP(hdcp: string) : Promise<string> {
    if (hdcp === undefined || hdcp.length === 0) {
      return Promise.reject("MediaCapabilitiesProbers >>> Bad Arguments: " +
        "No HDCP Policy specified.");
    }
    const config = {
      hdcp,
    };
    const browserAPIS: IBrowserAPIS[] = [
      "isTypeSupportedWithFeatures",
      "getStatusForPolicy",
    ];
    return getStatusFromConfiguration (config, browserAPIS);
  },

  /**
   * Get decoding capabilities from a given video and/or audio
   * configuration.
   * @param {Object} mediaConfig
   * @returns {Promise}
   */
  getDecodingCapabilities(
    mediaConfig: IMediaConfiguration
  ) : Promise<string> {
    const config = {
      type: mediaConfig.type,
      video: mediaConfig.video,
      audio: mediaConfig.audio,
    };
    const browserAPIS: IBrowserAPIS[] = [
      "isTypeSupported",
      "isTypeSupportedWithFeatures",
      "decodingInfos",
    ];
    return getStatusFromConfiguration(config, browserAPIS);
  },

  /**
   * From an array of given configurations (type and key system configuration), return
   * supported ones.
   * @param {Array.<Object>} configurations
   * @returns {Promise}
   */
  getCompatibleDRMConfigurations(
    configurations: Array<{
      type: string;
      configuration: IMediaKeySystemConfiguration;
    }>
  ) : Promise<ICompatibleKeySystem[]> {
    const promises: Array<Promise<{ globalStatus: ProberStatus;
                                    result? : ICompatibleKeySystem | undefined; }>> = [];
    configurations.forEach((configuration) => {
      const globalConfig = {
        keySystem: configuration,
      };
      const browserAPIS: IBrowserAPIS[] = ["requestMediaKeySystemAccess"];
      promises.push(probeMediaConfiguration(globalConfig, browserAPIS)
        .then(({ globalStatus, resultsFromAPIS }) => {
          const requestMediaKeySystemAccessResults =
            arrayFind(resultsFromAPIS,
                      (result) => result.APIName === "requestMediaKeySystemAccess");

          return {
            // As only one API is called, global status is
            // requestMediaKeySystemAccess status.
            globalStatus,
            result: requestMediaKeySystemAccessResults === undefined ? undefined :
              requestMediaKeySystemAccessResults.result,
          };
        })
        .catch(() => { // API couln't be called.
          return { globalStatus: ProberStatus.NotSupported };
        })
      );
    });
    return Promise.all(promises)
      .then((configs) => {
        // TODO I added those lines to work-around a type issue but does it
        // really correspond to the original intent? I find it hard to
        // understand and shouldn't we also rely on things like `globalStatus`
        // here?
        return configs
          .filter((x) : x is { globalStatus : ProberStatus;
                               result : ICompatibleKeySystem; } =>
            x.result !== undefined)
          .map(({ result }: { result: ICompatibleKeySystem }) => result);
      });
  },

  /**
   * Get display capabilites. Tells if display can output
   * with specific video and/or audio constrains.
   * @param {Object} displayConfig
   * @returns {Promise}
   */
  getDisplayCapabilities(
    displayConfig: IDisplayConfiguration
  ) : Promise<string> {
    const config = { display: displayConfig };
    const browserAPIS: IBrowserAPIS[] = [
      "matchMedia",
      "isTypeSupportedWithFeatures",
    ];
    return getStatusFromConfiguration(config, browserAPIS);
  },
};

export default mediaCapabilitiesProber;


text:
package com.google.cloud.dns;

import com.google.cloud.TransportOptions;
import org.easymock.EasyMock;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;

public class DnsOptionsTest {

  @Rule public ExpectedException thrown = ExpectedException.none();

  @Test
  public void testInvalidTransport() {
    thrown.expect(IllegalArgumentException.class);
    DnsOptions.newBuilder()
        .setTransportOptions(EasyMock.<TransportOptions>createMock(TransportOptions.class));
  }
}


text:
namespace crashpad {
namespace test {

namespace {

std::string GetCurrentThreadName() {
  std::string result(ZX_MAX_NAME_LEN, '\0');
  const zx_status_t status = zx::thread::self()->get_property(
      ZX_PROP_NAME, result.data(), result.length());
  ZX_CHECK(status == ZX_OK, status) << "get_property(ZX_PROP_NAME)";
  const auto result_nul_idx = result.find('\0');
  CHECK_NE(result_nul_idx, std::string::npos)
      << "get_property() did not NUL terminate";
  result.resize(result_nul_idx);
  return result;
}

}  // namespace

ScopedSetThreadName::ScopedSetThreadName(const std::string& new_thread_name)
    : original_name_(GetCurrentThreadName()) {
  // Fuchsia silently truncates the thread name if it's too long.
  CHECK_LT(new_thread_name.length(), ZX_MAX_NAME_LEN);
  const zx_status_t status = zx::thread::self()->set_property(
      ZX_PROP_NAME, new_thread_name.c_str(), new_thread_name.length());
  ZX_CHECK(status == ZX_OK, status) << "set_property(ZX_PROP_NAME)";
}

ScopedSetThreadName::~ScopedSetThreadName() {
  const zx_status_t status = zx::thread::self()->set_property(
      ZX_PROP_NAME, original_name_.c_str(), original_name_.length());
  ZX_CHECK(status == ZX_OK, status) << "set_property(ZX_PROP_NAME)";
}

}  // namespace test
}  // namespace crashpad


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

  # These are extensions that must be enabled in order to support this database
  enable_extension "plpgsql"

  create_table "active_admin_comments", force: :cascade do |t|
    t.string   "namespace"
    t.text     "body"
    t.string   "resource_id",   null: false
    t.string   "resource_type", null: false
    t.integer  "author_id"
    t.string   "author_type"
    t.datetime "created_at"
    t.datetime "updated_at"
  end

  add_index "active_admin_comments", ["author_type", "author_id"], name: "index_active_admin_comments_on_author_type_and_author_id", using: :btree
  add_index "active_admin_comments", ["namespace"], name: "index_active_admin_comments_on_namespace", using: :btree
  add_index "active_admin_comments", ["resource_type", "resource_id"], name: "index_active_admin_comments_on_resource_type_and_resource_id", using: :btree

  create_table "admin_users", force: :cascade do |t|
    t.string   "email", default: "", null: false
    t.string   "encrypted_password", default: "", null: false
    t.string   "reset_password_token"
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
    t.integer  "sign_in_count", default: 0,  null: false
    t.datetime "current_sign_in_at"
    t.datetime "last_sign_in_at"
    t.inet     "current_sign_in_ip"
    t.inet     "last_sign_in_ip"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  add_index "admin_users", ["email"], name: "index_admin_users_on_email", unique: true, using: :btree
  add_index "admin_users", ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true, using: :btree

  create_table "categories", force: :cascade do |t|
    t.string   "name",       null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  create_table "categories_jobs", id: false, force: :cascade do |t|
    t.integer "job_id"
    t.integer "category_id"
  end

  add_index "categories_jobs", ["category_id"], name: "index_categories_jobs_on_category_id", using: :btree
  add_index "categories_jobs", ["job_id"], name: "index_categories_jobs_on_job_id", using: :btree

  create_table "cities", force: :cascade do |t|
    t.string   "name", null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

  add_index "cities", ["name"], name: "index_cities_on_name", unique: true, using: :btree

  create_table "cities_jobs", id: false, force: :cascade do |t|
    t.integer "city_id"
    t.integer "job_id"
  end

  add_index "cities_jobs", ["city_id"], name: "index_cities_jobs_on_city_id", using: :btree
  add_index "cities_jobs", ["job_id"], name: "index_cities_jobs_on_job_id", using: :btree

  create_table "employees", force: :cascade do |t|
    t.string   "email", default: "", null: false
    t.string   "encrypted_password", default: "", null: false
    t.string   "reset_password_token"
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
    t.integer  "sign_in_count", default: 0, null: false
    t.datetime "current_sign_in_at"
    t.datetime "last_sign_in_at"
    t.string   "current_sign_in_ip"
    t.string   "last_sign_in_ip"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.string   "first_name", default: "", null: false
    t.string   "last_name", default: "", null: false
    t.string   "address", default: ""
    t.integer  "city_id"
    t.string   "avatar"
    t.string   "resume"
  end

  add_index "employees", ["city_id"], name: "index_employees_on_city_id", using: :btree
  add_index "employees", ["email"], name: "index_employees_on_email", unique: true, using: :btree
  add_index "employees", ["reset_password_token"], name: "index_employees_on_reset_password_token", unique: true, using: :btree

  create_table "employers", force: :cascade do |t|
    t.string   "email", default: "", null: false
    t.string   "encrypted_password", default: "", null: false
    t.string   "reset_password_token"
    t.datetime "reset_password_sent_at"
    t.datetime "remember_created_at"
    t.integer  "sign_in_count", default: 0,  null: false
    t.datetime "current_sign_in_at"
    t.datetime "last_sign_in_at"
    t.string   "current_sign_in_ip"
    t.string   "last_sign_in_ip"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.string   "name", default: "", null: false
    t.text     "short_description",      default: "", null: false
    t.text     "full_description",       default: "", null: false
    t.text     "offer", default: "", null: false
    t.text     "address", default: "", null: false
    t.string   "logo"
  end

  add_index "employers", ["email"], name: "index_employers_on_email", unique: true, using: :btree
  add_index "employers", ["reset_password_token"], name: "index_employers_on_reset_password_token", unique: true, using: :btree

  create_table "images", force: :cascade do |t|
    t.string  "file", null: false
    t.integer "employer_id"
  end

  add_index "images", ["employer_id"], name: "index_images_on_employer_id", using: :btree

  create_table "job_applications", force: :cascade do |t|
    t.integer  "employee_id"
    t.integer  "job_id"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.text     "content", default: ""
  end

  add_index "job_applications", ["employee_id"], name: "index_job_applications_on_employee_id", using: :btree
  add_index "job_applications", ["job_id", "employee_id"], name: "index_job_applications_on_job_id_and_employee_id", unique: true, using: :btree
  add_index "job_applications", ["job_id"], name: "index_job_applications_on_job_id", using: :btree

  create_table "jobs", force: :cascade do |t|
    t.string   "name", default: "", null: false
    t.boolean  "negotiable", default: true
    t.integer  "min_salary", default: 0
    t.integer  "max_salary",  default: 0
    t.text     "detail",      default: "",   null: false
    t.text     "requirement", default: "",   null: false
    t.text     "offer",       default: "",   null: false
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
    t.integer  "employer_id"
  end

  add_index "jobs", ["employer_id"], name: "index_jobs_on_employer_id", using: :btree

  add_foreign_key "employees", "cities"
  add_foreign_key "images", "employers"
  add_foreign_key "jobs", "employers"
end


text:
Ext.define('StarterKit.model.Schema', {
    extend: 'Ext.data.schema.Schema',
    alias: 'schema.starterkit'
});


text:
package com.qileyuan.tatala.example.service;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.apache.log4j.Logger;

import com.qileyuan.tatala.example.service.model.Account;
import com.qileyuan.tatala.example.service.model.AllTypeBean;

/**
 * This class is a sample for the socket server provider.
 * It present real business logic.
 * @author JimT
 *
 */
public class ExampleManagerImpl implements ExampleManager{

	Logger log = Logger.getLogger(ExampleManagerImpl.class);

	public String sayHello(int Id, String name) {
		return "["+Id+"]"+"Hello "+name+" !";
	}

	public void doSomething(){
	}

	@Override
	public void exceptionCall(int Id) {
		if(Id < 0){
			throw new ExampleReturnException("Server error: id < 0");
		}
	}

	public Account getAccount(Account account){
		account.setAddress("Toronto");
		return account;
	}

	public List<Account> getAccountList(List<Account> accountList){
		List<Account> retAccountList = new ArrayList<Account>();
		for (Account account : accountList) {
			Account accountNew = new Account();
			accountNew.setId(account.getId());
			accountNew.setName("Jim");
			accountNew.setAddress("North York");
			retAccountList.add(accountNew);
		}
		return retAccountList;
	}

	public Map<String, Account> getAccountMap(Map<String, Account> accountMap){
		Map<String, Account> retAccountMap = new HashMap<String, Account>();
		for (String key : accountMap.keySet()) {
			Account accountNew = new Account();
			accountNew.setId(accountMap.get(key).getId());
			accountNew.setName("Jim");
			accountNew.setAddress("North York");
			retAccountMap.put("ret"+key, accountNew);
		}
		return retAccountMap;
	}

	public Set<Account> getAccountSet(Set<Account> accountSet){
		Set<Account> retAccountSet = new HashSet<Account>();
		for (Account account : accountSet) {
			Account accountNew = new Account();
			accountNew.setId(account.getId());
			accountNew.setName("Jim");
			accountNew.setAddress("Vaughan");
			retAccountSet.add(accountNew);
		}
		return retAccountSet;
	}

	public AllTypeBean getAllTypeBean(boolean aboolean, byte abyte,
			short ashort, char achar, int aint, long along, float afloat,
			double adouble, Date adate, String astring) {

		AllTypeBean allTypeBean = new AllTypeBean();
		allTypeBean.setAboolean(aboolean);
		allTypeBean.setAbyte(abyte);
		allTypeBean.setAshort(ashort);
		allTypeBean.setAchar(achar);
		allTypeBean.setAint(aint);
		allTypeBean.setAlong(along);
		allTypeBean.setAfloat(afloat);
		allTypeBean.setAdouble(adouble);
		allTypeBean.setAdate(adate);
		allTypeBean.setAstring(astring);

		return allTypeBean;
	}

	public String[] getArray(byte[] bytearr, String[] strarr) {
		if(bytearr == null){
			return null;
		}

		String[] rstrarr = new String[bytearr.length];

		for (int i = 0; i < rstrarr.length; i++) {
			rstrarr[i] = bytearr[i]+strarr[i];
		}

		return rstrarr;
	}
}


text:
module.exports = {
  fetchCategories: function () {
    return {
      dataType: 'json',
      contentType: 'application/json',
      url: '/api/v2/help_center/categories.json',
      type: 'GET'
    };
  },
  fetchSections: function (categoryId) {
    var GET_SECTIONS_END_POINT = '/api/v2/help_center/categories/{id}/sections.json';

    return {
      dataType: 'json',
      contentType: 'application/json',
      url: GET_SECTIONS_END_POINT.replace('{id}', categoryId.toString()),
      type: 'GET'
    };
  },
  /**
   * article should be in valid json format, following zendesk standard.
   * @param  {int} sectionId section id
   * @param  {object} article   article json object
   * @return {object}           a json object representing ajax options.
   */
  createArticle: function (sectionId, article) {
    var POST_ARTICLE_END_POINT = '/api/v2/help_center/sections/{id}/articles.json';

    return {
      dataType: 'json',
      contentType: 'application/json',
      url: POST_ARTICLE_END_POINT.replace('{id}', sectionId.toString()),
      type: 'POST',
      data: article
    };
  },
  /**
   * fetch all enabled "locales" as well as "default_locale"
   * @return {object} a json object representing ajax options.
   */
  fetchLocales: function () {
    return {
      dataType: 'json',
      contentType: 'application/json',
      url: '/api/v2/help_center/locales.json',
      type: 'GET'
    };
  }
};


text:
    #define echo256_opt_Init        echo256_opt_sse4_aes_Init
    #define echo256_opt_Update      echo256_opt_sse4_aes_Update
    #define echo256_opt_Final       echo256_opt_sse4_aes_Final
    #define echo256_opt_UpdateFinal echo256_opt_sse4_aes_UpdateFinal
    #define Compress                echo256_opt_sse4_aes_compress

    #define USE_HARDWARE_AES
    #define ECHO256_OPT_IMPL
    #include "../echo256_opt.cpp"
#endif


text:
package org.openecard.common.sal.util;

import iso.std.iso_iec._24727.tech.schema.ConnectionHandleType;
import iso.std.iso_iec._24727.tech.schema.ConnectionHandleType.RecognitionInfo;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.openecard.addon.sal.SalStateView;
import org.openecard.common.AppVersion;
import org.openecard.common.I18n;
import org.openecard.common.event.EventType;
import org.openecard.common.interfaces.EventCallback;
import org.openecard.common.interfaces.EventDispatcher;
import org.openecard.common.util.Promise;
import org.openecard.common.util.SysUtils;
import org.openecard.gui.ResultStatus;
import org.openecard.gui.UserConsent;
import org.openecard.gui.UserConsentNavigator;
import org.openecard.gui.definition.Step;
import org.openecard.gui.definition.Text;
import org.openecard.gui.definition.UserConsentDescription;
import org.openecard.gui.executor.ExecutionEngine;
import org.openecard.gui.executor.StepAction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Implements a insert card dialog.
 * This dialog requests the user to insert a card of a specific type.
 *
 * @author Dirk Petrautzki
 * @author Hans-Martin Haase
 */
public class InsertCardDialog {

    private static final Logger LOG = LoggerFactory.getLogger(InsertCardDialog.class);

    private static final String STEP_ID = "insert-card";

    private final I18n lang = I18n.getTranslation("tctoken");

    private final UserConsent gui;
    private final Map<String, String> cardNameAndType;
    private final EventDispatcher evDispatcher;
    private final SalStateView salStateView;

    /**
     * Creates a new InsertCardDialog.
     *
     * @param gui The user consent implementation.
     * @param cardNameAndType Map containing the mapping of localized card names to card type URIs of cards which may be
     * inserted.
     * @param manager EventManager to register the EventCallbacks.
     * @param salStateView
     */
    public InsertCardDialog(UserConsent gui,
	    Map<String, String> cardNameAndType,
	    EventDispatcher manager,
	    SalStateView salStateView) {
	this.gui = gui;
	this.cardNameAndType = cardNameAndType;
	this.evDispatcher = manager;
	this.salStateView = salStateView;
    }

    /**
     * Shows this InsertCardDialog dialog.
     *
     * @return The ConnectionHandle of the inserted card or null if no card was inserted.
     */
    public List<ConnectionHandleType> show() {
	List<ConnectionHandleType> availableCards = checkAlreadyAvailable();
	if (! availableCards.isEmpty()) {
	    LOG.debug("Required card already available");
	    return availableCards;
	} else {
	    Promise<ConnectionHandleType> promise = new Promise();
	    List<EventCallback> callbacks = new ArrayList<>(2);
	    InsertCardStepAction insertCardAction = new InsertCardStepAction(STEP_ID,
		    cardNameAndType.values(),
		    availableCards,
		    promise);
	    callbacks.add(insertCardAction);
	    evDispatcher.add(insertCardAction, EventType.CARD_RECOGNIZED);

	    if (SysUtils.isIOS()) {
		CancelOnCardRemovedFilter cancelCallback = new CancelOnCardRemovedFilter(promise);
		callbacks.add(cancelCallback);
		evDispatcher.add(cancelCallback, new CardRemovalFilter());
	    }

	    try {
		UserConsentNavigator ucr = gui.obtainNavigator(createInsertCardUserConsent(insertCardAction));
		ExecutionEngine exec = new ExecutionEngine(ucr);
		// run gui
		ResultStatus status = exec.process();

		if (status == ResultStatus.CANCEL) {
		    LOG.info("Waiting for cards dialog has been cancelled.");
		    return null;
		}
		return insertCardAction.getResponse();
	    } finally {
		for (EventCallback callback : callbacks) {
		    evDispatcher.del(callback);
		}
	    }
	}
    }

    /**
     * Check whether there are already cards with the required type(s) are available.
     *
     * @return A list containing {@link ConnectionHandleType} objects referencing the cards which fit the requirements or
     * an empty list if there are no cards which met the requirements are present.
     */
    private List<ConnectionHandleType> checkAlreadyAvailable() {
	List<ConnectionHandleType> handlesList = new ArrayList<>();

	Set<String> targetCardTypes = new HashSet<>(cardNameAndType.values());

	for (ConnectionHandleType currentHandle : this.salStateView.listCardHandles()) {
	    RecognitionInfo currentRecogInfo = currentHandle.getRecognitionInfo();

	    if (currentRecogInfo != null) {
		 String currentCardType = currentRecogInfo.getCardType();
		 if (currentCardType != null && targetCardTypes.contains(currentCardType)) {
		     handlesList.add(currentHandle);
		 }
	    }
	}

	return handlesList;
    }

    /**
     * Create the UI dialog.
     *
     * @param insertCardAction A action for this step.
     * @return A {@link UserConsentDescription} which may be executed by the {@link ExecutionEngine}.
     */
    private UserConsentDescription createInsertCardUserConsent(StepAction insertCardAction) {
	UserConsentDescription uc = new UserConsentDescription(lang.translationForKey("title", AppVersion.getName()), "insert_card_dialog");

	// create step
	Step s = new Step(STEP_ID, lang.translationForKey("step.title"));
	s.setInstantReturn(true);
	s.setAction(insertCardAction);

	// create and add text instructing user
	Text i1 = new Text();
	if (cardNameAndType.size() == 1) {
	    i1.setText(lang.translationForKey("step.message.singletype"));
	} else {
	    i1.setText(lang.translationForKey("step.message.multipletypes"));
	}

	s.getInputInfoUnits().add(i1);
	for (String key : cardNameAndType.keySet()) {
	    Text item = new Text(" - " + key);
	    s.getInputInfoUnits().add(item);
	}

	// add step
	uc.getSteps().add(s);

	return uc;
    }

}


text:
package org.assertj.db.type;

import org.assertj.db.common.AbstractTest;
import org.assertj.db.common.DefaultConnection;
import org.assertj.db.common.DefaultDataSource;
import org.assertj.db.common.DefaultStatement;
import org.assertj.db.exception.AssertJDBException;
import org.junit.Test;

import javax.sql.DataSource;
import java.sql.*;

/**
 * Tests on the exceptions of Changes
 *
 * @author Régis Pouiller
 *
 */
public class Changes_Exception_Test extends AbstractTest {

  /**
   * This method should fail because the connection throw an exception when getting an object.
   */
  @Test(expected = AssertJDBException.class)
  public void should_fail_because_connection_throws_exception_when_getting_an_object() {
    DataSource ds = new DefaultDataSource();
    Table table = new Table(ds, "movi");
    Changes changes = new Changes().setTables(table);
    changes.setStartPointNow();
  }

  /**
   * This method should fail because the connection throw an exception when getting the tables.
   */
  @Test(expected = AssertJDBException.class)
  public void should_fail_because_connection_throws_exception_when_getting_tables() {
    DataSource ds = new DefaultDataSource() {
      @Override
      public Connection getConnection() throws SQLException {
        return new DefaultConnection() {

          @Override
          public DatabaseMetaData getMetaData() throws SQLException {
            throw new SQLException();
          }
        };
      }
    };
    Table table = new Table(ds, "movi");
    Changes changes = new Changes().setTables(table);
    changes.setStartPointNow();
  }

  /**
   * This method should fail because the connection throw an exception when executing a query.
   */
  @Test(expected = AssertJDBException.class)
  public void should_fail_because_connection_throws_exception_when_executing_a_query() {
    DataSource ds = new DefaultDataSource() {
      @Override
      public Connection getConnection() throws SQLException {
        return new DefaultConnection() {

          @Override
          public Statement createStatement() throws SQLException {
            return new DefaultStatement() {

              @Override
              public ResultSet executeQuery(String sql) throws SQLException {
                throw new SQLException();
              }
            };
          }
        };
      }
    };
    Table table = new Table(ds, "movi");
    Changes changes = new Changes().setTables(table);
    changes.setStartPointNow();
  }

  /**
   * This method should fail because the connection throw an exception when creating a statement.
   */
  @Test(expected = AssertJDBException.class)
  public void should_fail_because_connection_throws_exception_when_creating_a_statement() {
    DataSource ds = new DefaultDataSource() {
      @Override
      public Connection getConnection() throws SQLException {
        return new DefaultConnection() {

          @Override
          public Statement createStatement() throws SQLException {
            throw new SQLException();
          }
        };
      }
    };
    Table table = new Table(ds, "movi");
    Changes changes = new Changes().setTables(table);
    changes.setStartPointNow();
  }

  /**
   * This method should fail because the connection throw an exception when getting a connection.
   */
  @Test(expected = AssertJDBException.class)
  public void should_fail_because_connection_throws_exception_when_getting_a_connection() {
    DataSource ds = new DefaultDataSource() {
      @Override
      public Connection getConnection() throws SQLException {
        throw new SQLException();
      }
    };
    Table table = new Table(ds, "movi");
    Changes changes = new Changes().setTables(table);
    changes.setStartPointNow();
  }

  /**
   * This method should fail because the table is null.
   */
  @Test(expected = NullPointerException.class)
  public void should_fail_because_table_is_null() {
    new Changes().setTables((Table) null);
  }

  /**
   * This method should fail because the request is null.
   */
  @Test(expected = NullPointerException.class)
  public void should_fail_because_request_is_null() {
    new Changes().setRequest(null);
  }

  /**
   * This method should fail because setting end point before start point.
   */
  @Test(expected = AssertJDBException.class)
  public void should_fail_because_end_before_start() {
    Table table = new Table(dataSource, "test");
    Changes changes = new Changes().setTables(table);
    changes.setEndPointNow();
  }

  /**
   * This method should fail because getting list of changes before setting end point.
   */
  @Test(expected = AssertJDBException.class)
  public void should_fail_because_getting_list_of_changes_before_end() {
    Table table = new Table(dataSource, "test");
    Changes changes = new Changes().setTables(table);
    changes.setStartPointNow();
    changes.getChangesList();
  }

  /**
   * This method should fail because the table name is null.
   */
  @Test(expected = NullPointerException.class)
  public void should_fail_because_tablename_is_null() {
    new Changes(source).getChangesOfTable(null);
  }

  /**
   * This method should fail because the type is null.
   */
  @Test(expected = NullPointerException.class)
  public void should_fail_because_type_is_null() {
    new Changes(source).getChangesOfType(null);
  }
}


text:
import express from 'express';
import helpers from '../helpers';
import controller from '../controllers/voteController';

const router = express.Router();

router.get('/', helpers.isAuth, controller.initialize, controller.canVoteUT100, (req, res) => {
  res.locals.moduleTitle = 'Votar';
  res.locals.module = () => 'vote';
  res.locals.active = {
    vote: true
  };
  res.render('index');
});

router.get('/ultratop100', controller.initialize, controller.verifyRewardUT100, controller.handleRewardUT100);

export default router;


text:
**** UNOFFICIAL **** dashradio-min-client
====================
v3.3.0

__** This project is mostly non-functional as it's based on the older Dash Radio base. It was created for research purposes and isn't affiliated with Dash Radio LLC or Skee. Commercial use is prohibited. **__

DR-MC is a basic web app based on Bootstrap and jPlayer which allows access to anyone on nearly any device (read: any browser that supports javascript) to listen to the high-quality, non-commerical streams provided by DJ Skee. This project also makes no money, and gives direct access to the music from every station owned by Dash, without their clunky and desktop-only flash component. This web app makes use of jQuery, HTML and AJAX.

Made by dylmye / teamdaylo
Released under MIT

Instructions
====================
Download as a ZIP or Clone to your Desktop, then open index.html. It's that simple.


text:
<?php

declare(strict_types=1);

namespace Biplane\Build\Wsdl2Php\Helper;

use Laminas\Code\Generator\DocBlock\Tag\ParamTag;
use Laminas\Code\Generator\DocBlock\Tag\ReturnTag;
use Laminas\Code\Generator\DocBlock\Tag\TagInterface;
use Laminas\Code\Generator\DocBlockGenerator;
use Laminas\Code\Generator\MethodGenerator;

trait TagTrait
{
    protected function addTag(MethodGenerator $generator, TagInterface $tag): void
    {
        $docBlock = $generator->getDocBlock();

        if (null === $docBlock) {
            $docBlock = new DocBlockGenerator();
            $generator->setDocBlock($docBlock);
        }

        $docBlock->setTag($tag);
    }

    protected function createReturnTag(string $type, bool $isArray = false, bool $isNullable = false): ReturnTag
    {
        return new ReturnTag($this->getTypeHint($type, $isArray, $isNullable));
    }

    protected function createParamTag(
        string $name,
        string $type,
        bool $isArray = false,
        bool $isNullable = false
    ): ParamTag {
        return new ParamTag($name, $this->getTypeHint($type, $isArray, $isNullable));
    }

    /**
     * @return array<string>
     */
    private function getTypeHint(string $type, bool $isArray, bool $nullable): array
    {
        if ($isArray && $type !== 'array' && substr($type, -2) !== '[]') {
            $type .= '[]';
        }

        $types = [$type];

        if ($nullable) {
            $types[] = 'null';
        }

        return $types;
    }
}


text:
<?php

namespace DynamicFormBundle\Entity\DynamicForm\FormField;

use DynamicFormBundle\Model\DynamicForm\FormField\OptionValue as BaseModel;
use DynamicFormBundle\Entity\DynamicForm\ConfigValue\BaseValue;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Entity
 * @ORM\Table(name="dynamic_form_field_option")
 *
 * @package DynamicFormBundle\Entity
 */
class OptionValue extends BaseModel
{
    /**
     * @var int
     *
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var BaseValue
     *
     * @Assert\Valid
     *
     * @ORM\OneToOne(
     *     targetEntity="DynamicFormBundle\Entity\DynamicForm\ConfigValue\BaseValue",
     *     mappedBy="option", cascade={"persist", "remove"}
     * )
     */
    private $value;

    /**
     * @var string
     *
     * @ORM\Column(type="string")
     */
    private $name;

    /**
     * @var string
     *
     * @ORM\Column(type="string", name="field_option")
     */
    private $option;

    /**
     * @param string    $name
     * @param string    $option
     * @param BaseValue $value
     */
    public function __construct($name = null, $option = null, BaseValue $value = null)
    {
        $this->name = $name;
        $this->option = $option;

        if ($value instanceof BaseValue) {
            $this->setValue($value);
        }
    }

    /**
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * @param string $name
     */
    public function setName($name)
    {
        $this->name = $name;
    }

    /**
     * @param BaseValue $value
     *
     * @return OptionValue
     */
    public function setValue(BaseValue $value)
    {
        $value->setOption($this);
        $this->value = $value;

        return $this;
    }

    /**
     * @return BaseValue
     */
    public function getValue()
    {
        return $this->value;
    }

    /**
     * @param string $option
     *
     * @return OptionValue
     */
    public function setOption($option)
    {
        $this->option = $option;

        return $this;
    }

    /**
     * @return string
     */
    public function getOption()
    {
        return $this->option;
    }

    public function __clone()
    {
        $this->value = clone $this->value;
        $this->value->setOption($this);
    }
}


text:
import { REST } from '../api/ApiService';
import type { IService } from '../domain';

export class ServicesReader {
  public static getServices(account: string, region: string): PromiseLike<IService[]> {
    return REST('/servicebroker')
      .path(account, 'services')
      .query({
        cloudProvider: 'cloudfoundry',
        region: region,
      })
      .get();
  }
}


text:
CREATE TABLE pbAaDistV (
  x float default NULL,
  y float default NULL
) TYPE=MyISAM;


text:
package org.apache.asterix.external.input.record.reader.stream;

import static org.apache.asterix.external.util.ExternalDataConstants.EMPTY_STRING;
import static org.apache.asterix.external.util.ExternalDataConstants.KEY_REDACT_WARNINGS;

import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.function.Supplier;

import org.apache.asterix.external.api.AsterixInputStream;
import org.apache.asterix.external.api.IRawRecord;
import org.apache.asterix.external.api.IRecordReader;
import org.apache.asterix.external.api.IStreamNotificationHandler;
import org.apache.asterix.external.dataflow.AbstractFeedDataFlowController;
import org.apache.asterix.external.input.record.CharArrayRecord;
import org.apache.asterix.external.input.stream.AsterixInputStreamReader;
import org.apache.asterix.external.util.ExternalDataConstants;
import org.apache.asterix.external.util.ExternalDataUtils;
import org.apache.asterix.external.util.FeedLogManager;
import org.apache.hyracks.api.context.IHyracksTaskContext;
import org.apache.hyracks.api.exceptions.HyracksDataException;

public abstract class StreamRecordReader implements IRecordReader<char[]>, IStreamNotificationHandler {
    protected AsterixInputStreamReader reader;
    protected CharArrayRecord record;
    protected char[] inputBuffer;
    protected int bufferLength = 0;
    protected int bufferPosn = 0;
    protected boolean done = false;
    protected FeedLogManager feedLogManager;
    private Supplier<String> dataSourceName = EMPTY_STRING;
    private Supplier<String> previousDataSourceName = EMPTY_STRING;

    public void configure(AsterixInputStream inputStream, Map<String, String> config) {
        this.reader = new AsterixInputStreamReader(inputStream);
        record = new CharArrayRecord();
        inputBuffer = new char[ExternalDataConstants.DEFAULT_BUFFER_SIZE];
        if (!ExternalDataUtils.isTrue(config, KEY_REDACT_WARNINGS)) {
            this.dataSourceName = reader::getStreamName;
            this.previousDataSourceName = reader::getPreviousStreamName;
        }
    }

    @Override
    public IRawRecord<char[]> next() throws IOException {
        return record;
    }

    @Override
    public void close() throws IOException {
        try {
            if (!done) {
                reader.close();
            }
        } finally {
            done = true;
        }
    }

    @Override
    public boolean stop() {
        try {
            reader.stop();
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }

    @Override
    public abstract boolean hasNext() throws IOException;

    @Override
    public void setFeedLogManager(FeedLogManager feedLogManager) throws HyracksDataException {
        this.feedLogManager = feedLogManager;
        reader.setFeedLogManager(feedLogManager);
    }

    @Override
    public void setController(AbstractFeedDataFlowController controller) {
        reader.setController(controller);
    }

    @Override
    public boolean handleException(Throwable th) {
        return reader.handleException(th);
    }

    @Override
    public void notifyNewSource() {
        throw new UnsupportedOperationException();
    }

    protected void resetForNewSource() {
        record.reset();
    }

    @Override
    public final Supplier<String> getDataSourceName() {
        return dataSourceName;
    }

    String getPreviousStreamName() {
        return previousDataSourceName.get();
    }

    public abstract List<String> getRecordReaderFormats();

    public abstract String getRequiredConfigs();

    public abstract void configure(IHyracksTaskContext ctx, AsterixInputStream inputStream, Map<String, String> config)
            throws HyracksDataException;
}


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

<title>engine Class Hierarchy</title>
<meta name="date" content="2012-11-25">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Hierarchy For Package engine

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

engine.Engine

engine.NetworkController (implements java.util.concurrent.Callable<V>)

engine.RequestHandler

engine.RequestInterpreter

engine.TimeoutController (implements java.lang.Runnable)

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
This is the emoncms as we intend to use it in CoSSMic.

It bases on the emoncms version from 01.10.2014.

See the [Wiki](https://bitbucket.org/cossmic/emoncms/wiki) for details!

### What is this repository for? ###

* This repository hosts the extended version of Emoncms that serves as mediator in the CoSSMic framework
* version 0.1

### How it extends Emoncms ###
* Its add a new Emoncms Module called Driver. This module allow to install, instantiate and use different drivers to control heterogeneous real and virtual devices supported by CoSSMic.

### How do I get set up? ###

* Install EmonCMS version 8.0
* Overwrite the current directory in /var/www/emoncms. As an alternative you can just add the driver Module, before to start the first time the web inteface.
* Database configuration  (still manually performed by importing driver.sql records)
* How to run tests
* Deployment instructions

### Contribution guidelines ###

* Writing tests
* Code review
* Other guidelines

### Who do I talk to? ###

* Salvatore Venticinque: salvatore.venticinque@gmail.com
* Matthias Noebels: matthias.noebels@isc-konstanz.de
* the CoSSMic team


text:
<?xml version="1.0" ?><para version="5.0" xml:lang="zh" xmlns="http://docbook.org/ns/docbook">

Description of Solaris SAN configuration options

    <col width="50%"/>
    <col width="50%"/>

        Configuration option = Default value
        描述

        [DEFAULT]

        <option>san_zfs_volume_base</option> = <replaceable>rpool/</replaceable>
        (StrOpt) The ZFS path under which to create zvols for volumes.

</para>


text:
We're glad you're here and are interested in being a part of hackUSU. While attending the
hackUSU events is always awesome, sometimes there's just not enough time to cover the basics
for new members of hackUSU. We've created this guide to help bridge this gap that can sometimes happen.

## hackUSU Basics
During hackUSU we use various software and tools to get stuff done. To get started, you'll want to have some
basic understanding of these types of tools. Let's go over some basic terminology.

1. **Laptop** - You'll need one of these. For most of the projects we work on at hackUSU, you won't need anything super fast, almost any laptop should work if it's been created within the last 5 years.
2. **Editor** - An editor or text-editor is used for typing up your code. You'll want a good editor you feel comfortable with. We like [Atom.io], [Sublime Text], or [Notepad ++]. There are many others but you'll have to find which works best for you.
3. **Shell** - The shell is usually a console window on whatever operating system you're using. The shell is used to type commands to the computer. This is also referred to as the **command line interface** or **CLI**. There are various types of "shells" you may use. The most common are BASH on Mac or Linux and Powershell is typically used on Windows.  On Windows you can also install Git Bash or Cygwin to have a similar experience to BASH on Mac and Linux.
4. **Version Control** - We use [version control] on all of our projects. Why? When you have many changes happening in a team, it's important to know who changed what and when they changed it. We use [Git] exclusively. Learn more about [Git] and version control by watching [these videos].
5. **Programming Languages** - Whether you know one or not, you'll want to familarize yourself with a couple. Starting out with something simple like [HTML], [Python], or [Ruby] is a great idea. If you don't know these, don't worry. We'll be providing great resources to get you up-to-speed in no time!

That's pretty much it, read over these basics and do some small research on what is available to you. We'll be updating this list as time goes on. Feel free to add more yourself.

<!-- Links -->
[Sublime Text]: http://www.sublimetext.com/
[Atom.io]: https://atom.io/
[Notepad ++]: http://notepad-plus-plus.org/
[version control]: http://git-scm.com/video/what-is-version-control
[Git]: http://git-scm.com
[these videos]: http://git-scm.com/videos
[HTML]: https://github.com/hackUSU/learn/blob/master/brainfood/html.md
[Python]: https://github.com/hackUSU/learn/blob/master/brainfood/python.md
[Ruby]: https://github.com/hackUSU/learn/blob/master/brainfood/ruby.md


text:
layout:     post
title:      portrait exercise 14
date:       2017-01-19 03:11:48
summary:
categories: drawing
---
![portrait exercise 14](/images/diary/portrait-exercise-14.png "zzz")


text:
package boofcv.abst.feature.detect.interest;

import boofcv.alg.InputSanityCheck;
import boofcv.alg.feature.detect.interest.FastHessianFeatureDetector;
import boofcv.alg.feature.detect.interest.SiftDetector;
import boofcv.alg.filter.binary.GThresholdImageOps;
import boofcv.alg.filter.binary.ThresholdImageOps;
import boofcv.alg.filter.blur.BlurImageOps;
import boofcv.alg.filter.blur.GBlurImageOps;
import boofcv.alg.filter.blur.impl.ImplMedianHistogramInner;
import boofcv.alg.filter.blur.impl.ImplMedianSortEdgeNaive;
import boofcv.alg.filter.blur.impl.ImplMedianSortNaive;
import boofcv.alg.filter.convolve.ConvolveImageMean;
import boofcv.alg.filter.convolve.ConvolveImageNoBorder;
import boofcv.alg.filter.convolve.ConvolveNormalized;
import boofcv.alg.filter.convolve.border.ConvolveJustBorder_General;
import boofcv.alg.filter.convolve.noborder.ImplConvolveMean;
import boofcv.alg.filter.convolve.normalized.ConvolveNormalizedNaive;
import boofcv.alg.filter.convolve.normalized.ConvolveNormalized_JustBorder;
import boofcv.alg.filter.derivative.DerivativeHelperFunctions;
import boofcv.alg.filter.derivative.impl.GradientSobel_Outer;
import boofcv.alg.filter.derivative.impl.GradientSobel_UnrolledOuter;
import boofcv.alg.misc.GImageMiscOps;
import boofcv.alg.misc.GImageStatistics;
import boofcv.alg.misc.ImageMiscOps;
import boofcv.alg.misc.ImageStatistics;
import boofcv.alg.transform.wavelet.UtilWavelet;
import boofcv.core.image.ConvertImage;
import boofcv.core.image.GConvertImage;
import boofcv.core.image.GeneralizedImageOps;
import boofcv.core.image.border.FactoryImageBorder;
import boofcv.core.image.border.FactoryImageBorderAlgs;
import boofcv.core.image.border.ImageBorderValue;
import boofcv.factory.distort.FactoryDistort;
import boofcv.factory.filter.blur.FactoryBlurFilter;
import boofcv.factory.filter.kernel.FactoryKernelGaussian;
import boofcv.factory.interpolate.FactoryInterpolation;
import boofcv.struct.image.FactoryImage;
import boofcv.struct.image.GrayF32;
import boofcv.struct.image.ImageBase;
import boofcv.struct.image.ImageType;
import georegression.struct.point.Point2D_F64;
import sapphire.compiler.FBFGenerator;

/**
 * Wrapper around {@link SiftDetector} for {@link InterestPointDetector}.
 *
 * @author Peter Abeles
 */
public class WrapSiftDetector<T extends ImageBase>
		implements InterestPointDetector<T>
{
	SiftDetector detector;

	GrayF32 imageFloat = new GrayF32(1,1);

	Class<T> inputType;

	public WrapSiftDetector(SiftDetector detector, Class<T> inputType ) {
		this.detector = detector;
		this.inputType = inputType;
	}

	@Override
	public void detect(T image, InputSanityCheck ISC, DerivativeHelperFunctions DHF, ConvolveImageNoBorder CINB, ConvolveJustBorder_General CJBG, GradientSobel_Outer GSO, GradientSobel_UnrolledOuter GSUO,
					   GImageMiscOps GIMO, ImageMiscOps IMO, ConvolveNormalizedNaive CNN, ConvolveNormalized_JustBorder CNJB, ConvolveNormalized CN,
					   GBlurImageOps GBIO, GeneralizedImageOps GIO, BlurImageOps BIO, ConvolveImageMean CIM, FactoryKernelGaussian FKG, ImplMedianHistogramInner IMHI,
					   ImplMedianSortEdgeNaive IMSEN, ImplMedianSortNaive IMSN, ImplConvolveMean ICM, GThresholdImageOps GTIO, GImageStatistics GIS, ImageStatistics IS,
					   ThresholdImageOps TIO, FactoryImageBorderAlgs FIBA, ImageBorderValue IBV, FastHessianFeatureDetector FHFD, FactoryImageBorder FIB, FactoryBlurFilter FBF,
					   ConvertImage CI, UtilWavelet UW, ImageType IT, FactoryInterpolation FI, FactoryDistort FDs) {

		GrayF32 input;
		if( image instanceof GrayF32) {
			input = (GrayF32)image;
		} else {
			imageFloat.reshape(image.width,image.height);
			GConvertImage.convert(image,imageFloat, ISC, GIO, GIMO, IMO, CI, IT);
			input = imageFloat;
		}

		detector.process(input, FHFD, FIB, ISC, CNN, CINB, CNJB, CN, DHF, CJBG, GSO, GSUO, FI);
	}

	@Override
	public int getNumberOfFeatures() {
		return detector.getDetections().size();
	}

	@Override
	public Point2D_F64 getLocation(int featureIndex) {
		return detector.getDetections().get(featureIndex);
	}

	@Override
	public double getRadius(int featureIndex) {
		return detector.getDetections().get(featureIndex).scale;
	}

	@Override
	public double getOrientation(int featureIndex, FactoryKernelGaussian FKG, FastHessianFeatureDetector FHFD) {
		return 0;
	}

	@Override
	public boolean hasScale() {
		return true;
	}

	@Override
	public boolean hasOrientation() {
		return false;
	}
}


text:
require 'spec_helper'

describe CourseOrderShippingAddress do
  subject(:shipping_address) { build(:shipping_address) }
  describe '#info' do
    its(:info) { should eql '广东省深圳市南山区 科技园南区 saberma 13928452888'}
  end
end


text:
<?php

namespace yiiunit\data\console\controllers;

use yii\console\Controller;

/**
 * @author Dmitry V. Alekseev <mail@alexeevdv.ru>
 * @since 2.0.16
 */
class FakeEmptyController extends Controller
{
}