text:
<?php

namespace App\Qyweixin\Models\ExternalContact;

class MomentTaskUser extends \App\Common\Models\Qyweixin\ExternalContact\MomentTaskUser
{
    /**
     * 根据用户ID和朋友圈id获取信息
     *
     * @param string $userid
     * @param string $moment_id
     * @param string $agentid
     * @param string $authorizer_appid
     * @param string $provider_appid
     */
    public function getInfoByUserIdAndMomentId($userid, $moment_id, $agentid, $authorizer_appid, $provider_appid)
    {
        $query = array();
        $query['userid'] = $userid;
        $query['moment_id'] = $moment_id;
        $query['agentid'] = $agentid;
        $query['authorizer_appid'] = $authorizer_appid;
        $query['provider_appid'] = $provider_appid;
        $info = $this->findOne($query);
        return $info;
    }

    public function syncMomentTaskList($moment_id, $agentid, $authorizer_appid, $provider_appid, $res, $now)
    {
        // {
        //     "errcode":0,
        //     "errmsg":"ok",
        //     "next_cursor":"CURSOR",
        //     "task_list":[
        //         {
        //             "userid":"zhangsan",
        //             "publish_status":1
        //         }
        //     ]
        // }
        if (!empty($res['task_list'])) {
            foreach ($res['task_list'] as $task) {
                $userid = $task['userid'];
                $publish_status = $task['publish_status'];
                $info = $this->getInfoByUserIdAndMomentId($userid, $moment_id, $agentid, $authorizer_appid, $provider_appid);
                $data = array();
                $data['publish_status'] = $publish_status;
                $data['get_time'] = \App\Common\Utils\Helper::getCurrentTime($now);
                if (!empty($info)) {
                    $this->update(array('_id' => $info['_id']), array('$set' => $data));
                } else {
                    $data['provider_appid'] = $provider_appid;
                    $data['authorizer_appid'] = $authorizer_appid;
                    $data['agentid'] = $agentid;
                    $data['moment_id'] = $moment_id;
                    $data['userid'] = $userid;
                    $this->insert($data);
                }
            }
        }
    }
}


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kurtraschke.tfl.tools;

import org.onebusaway.gtfs.model.Agency;
import org.onebusaway.gtfs.model.AgencyAndId;
import org.onebusaway.gtfs.model.Route;
import org.onebusaway.gtfs.model.Stop;
import org.onebusaway.gtfs.model.StopTime;
import org.onebusaway.gtfs.model.Trip;
import org.onebusaway.gtfs.serialization.GtfsWriter;

import com.google.common.collect.ArrayListMultimap;

import org.osgeo.proj4j.ProjCoordinate;

import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.xml.datatype.Duration;
import javax.xml.datatype.XMLGregorianCalendar;

import uk.org.transxchange.AbstractVehicleJourneyStructure;
import uk.org.transxchange.JourneyPatternSectionStructure;
import uk.org.transxchange.JourneyPatternStopUsageStructure;
import uk.org.transxchange.JourneyPatternStructure;
import uk.org.transxchange.JourneyPatternTimingLinkStructure;
import uk.org.transxchange.OperatorStructure;
import uk.org.transxchange.ServiceStructure;
import uk.org.transxchange.StopPointStructure;
import uk.org.transxchange.TransXChange;
import uk.org.transxchange.VehicleJourneyStructure;
import uk.org.transxchange.VehicleModesEnumeration;

/**
 *
 * @author kurt
 */
public class Translator {

  private final Map<String, OperatorStructure> operatorsById = new HashMap<>();
  private final Map<String, StopPointStructure> stopPointsById = new HashMap<>();
  private final Map<String, ServiceStructure> servicesById = new HashMap<>();
  private final Map<String, VehicleJourneyStructure> vehicleJourneysById = new HashMap<>();
  private final Map<String, JourneyPatternStructure> journeyPatternsById = new HashMap<>();
  private final Map<String, JourneyPatternSectionStructure> journeyPatternSectionsById = new HashMap<>();

  private final AgencyExtraData aed;

  private final Map<String, Agency> agenciesById = new HashMap<>();
  private final Map<String, Stop> stopsById = new HashMap<>();
  private final Map<String, Route> routesById = new HashMap<>();
  private final Map<String, Trip> tripsById = new HashMap<>();

  private final Map<String, AgencyAndId> serviceIdByTrip = new HashMap<>();

  private GtfsWriter writer;

  public Translator(AgencyExtraData aed) {
    this.aed = aed;
  }

  public void status() {
    System.out.format("Operators: %d, Stop points: %d, Services: %d, Vehicle journeys: %d, Journey patterns: %d\n", operatorsById.size(), stopPointsById.size(), servicesById.size(), vehicleJourneysById.size(), journeyPatternSectionsById.size());
  }

  public void load(TransXChange txc) {
    loadOperators(txc.getOperators().getOperatorAndLicensedOperator());
    loadStopPoints(txc.getStopPoints().getStopPoint());
    loadServices(txc.getServices().getService());
    loadVehicleJourneys(txc.getVehicleJourneys().getVehicleJourneyAndFlexibleVehicleJourney());
    loadJourneyPatternSections(txc.getJourneyPatternSections().getJourneyPatternSection());
  }

  public void write(File gtfsPath) throws IOException {
    writer = new GtfsWriter();

    writer.setOutputLocation(gtfsPath);
    System.out.println("Writing agencies...");
    writeAgencies();
    System.out.println("Writing stops...");
    writeStops();
    System.out.println("Writing routes...");
    writeRoutes();
    System.out.println("Writing services...");
    configureAndWriteService();
    System.out.println("Writing trips...");
    writeTrips();
    System.out.println("Writing stoptimes...");
    writeStopTimes();
    writer.close();
  }

  private void loadOperators(Iterable<OperatorStructure> operators) {
    for (OperatorStructure op : operators) {
      String operatorId = op.getId();

      if (!operatorsById.containsKey(operatorId)) {
        operatorsById.put(operatorId, op);
      }
    }
  }

  private void loadStopPoints(Iterable<StopPointStructure> stopPoints) {
    for (StopPointStructure sp : stopPoints) {
      String atcoCode = sp.getAtcoCode();

      if (!stopPointsById.containsKey(atcoCode)) {
        stopPointsById.put(atcoCode, sp);
      }
    }
  }

  private void loadServices(Iterable<ServiceStructure> services) {
    for (ServiceStructure service : services) {
      String serviceCode = service.getServiceCode();

      if (!servicesById.containsKey(serviceCode)) {
        servicesById.put(serviceCode, service);
        for (JourneyPatternStructure jps : service.getStandardService().getJourneyPattern()) {
          journeyPatternsById.put(jps.getId(), jps);
        }
      }
    }
  }

  private void loadVehicleJourneys(Iterable<AbstractVehicleJourneyStructure> vehicleJourneys) {
    for (AbstractVehicleJourneyStructure avj : vehicleJourneys) {

      if (avj instanceof VehicleJourneyStructure) {
        VehicleJourneyStructure vj = (VehicleJourneyStructure) avj;
        String vehicleJourneyCode = vj.getVehicleJourneyCode();

        if (!vehicleJourneysById.containsKey(vehicleJourneyCode)) {
          vehicleJourneysById.put(vehicleJourneyCode, vj);
        }
      }
    }
  }

  private void loadJourneyPatternSections(Iterable<JourneyPatternSectionStructure> journeyPatternSections) {
    for (JourneyPatternSectionStructure jps : journeyPatternSections) {
      String journeyPatternSectionId = jps.getId();
      if (!journeyPatternSectionsById.containsKey(journeyPatternSectionId)) {
        journeyPatternSectionsById.put(journeyPatternSectionId, jps);
      }
    }
  }

  private void writeAgencies() {
    for (OperatorStructure op : operatorsById.values()) {
      Agency a = new Agency();

      a.setId(op.getId());
      a.setName(op.getTradingName());
      a.setUrl(aed.getUrl());
      a.setTimezone(aed.getTimezone());
      a.setLang(aed.getLang());
      a.setPhone(aed.getPhone());
      a.setFareUrl(aed.getFareUrl());

      agenciesById.put(op.getId(), a);

      writer.handleEntity(a);
    }
  }

  private void writeStops() {
    for (StopPointStructure sp : stopPointsById.values()) {
      Stop s = new Stop();

      s.setId(new AgencyAndId(null, sp.getAtcoCode()));
      s.setName(sp.getDescriptor().getCommonName().getValue());

      ProjCoordinate pc = CoordinateTransformer.transformCoordinates(sp.getPlace().getLocation().getEasting(),
              sp.getPlace().getLocation().getNorthing());

      s.setLon(pc.x);
      s.setLat(pc.y);

      //s.setCode(null); //get from bus stop CSV
      stopsById.put(sp.getAtcoCode(), s);
      writer.handleEntity(s);
    }
  }

  private static int mapMode(VehicleModesEnumeration vme) {
    switch (vme) {
      case BUS:
        return 3;
      case COACH:
        return 3;
      case FERRY:
        return 4;
      case METRO:
        return 1;
      case RAIL:
        return 2;
      case TRAM:
        return 0;
      case UNDERGROUND:
        return 1;
      default:
        throw new IllegalArgumentException(vme.name());
    }
  }

  private void writeRoutes() {
    for (ServiceStructure service : servicesById.values()) {
      Route r = new Route();

      r.setId(new AgencyAndId(service.getRegisteredOperatorRef().getValue(), service.getServiceCode()));
      r.setAgency(agenciesById.get(service.getRegisteredOperatorRef().getValue()));
      r.setShortName(service.getLines().getLine().get(0).getLineName().getValue());
      r.setLongName(service.getDescription().getValue());
      if (service.getMode() == null) {
        System.out.println("Null mode for " + service.getServiceCode());
        r.setType(3);
      } else {
        r.setType(mapMode(service.getMode()));
      }

      routesById.put(service.getServiceCode(), r);

      writer.handleEntity(r);
    }
  }

  private void configureAndWriteService() {
    ArrayListMultimap<ServiceData, String> serviceDataMap = ArrayListMultimap.create();

    for (VehicleJourneyStructure vj : vehicleJourneysById.values()) {
      ServiceStructure service = servicesById.get(vj.getServiceRef().getValue());

      ServiceData sd = new ServiceData();

      sd.setOperatingPeriod(service.getOperatingPeriod());
      sd.setOperatingProfile(vj.getOperatingProfile());
      sd.clampPeriodEnd();

      serviceDataMap.put(sd, vj.getVehicleJourneyCode());
    }

    int i = 1;

    for (Map.Entry<ServiceData, Collection<String>> e : serviceDataMap.asMap().entrySet()) {
      ServiceData sd = e.getKey();
      Collection<String> tripIds = e.getValue();
      AgencyAndId serviceId = new AgencyAndId(null, "S" + Integer.toString(i));

      writer.handleEntity(sd.writeServiceCalendar(serviceId));
      for (Object o : sd.writeServiceCalendarDates(serviceId)) {
        writer.handleEntity(o);
      }

      for (String tripId : tripIds) {
        serviceIdByTrip.put(tripId, serviceId);
      }

      i++;
    }
  }

  private void writeTrips() {
    for (VehicleJourneyStructure vj : vehicleJourneysById.values()) {
      Trip t = new Trip();

      ServiceStructure service = servicesById.get(vj.getServiceRef().getValue());

      t.setId(new AgencyAndId(service.getRegisteredOperatorRef().getValue(), vj.getVehicleJourneyCode()));
      t.setServiceId(serviceIdByTrip.get(vj.getVehicleJourneyCode()));
      t.setRoute(routesById.get(vj.getLineRef().getValue()));

      t.setTripHeadsign(vj.getDestinationDisplay().getValue());

      tripsById.put(vj.getVehicleJourneyCode(), t);

      writer.handleEntity(t);
    }
  }

  private void writeStopTimes() {
    for (VehicleJourneyStructure vj : vehicleJourneysById.values()) {
      Trip t = tripsById.get(vj.getVehicleJourneyCode());

      XMLGregorianCalendar departureTime = vj.getDepartureTime();

      List<JourneyPatternTimingLinkStructure> timingLinks = journeyPatternSectionsById.get(journeyPatternsById.get(vj.getJourneyPatternRef().getValue()).getJourneyPatternSectionRefs().get(0).getValue()).getJourneyPatternTimingLink();

      int stopSequence = 0;

      int time = (departureTime.getHour() * 60 + departureTime.getMinute()) * 60 + departureTime.getSecond();

      for (JourneyPatternTimingLinkStructure timingLink : timingLinks) {

        if (stopSequence == 0) {
          JourneyPatternStopUsageStructure from = timingLink.getFrom();

          StopTime st = new StopTime();
          st.setTrip(t);
          st.setStop(stopsById.get(from.getStopPointRef().getValue()));
          st.setStopSequence(++stopSequence);
          st.setDepartureTime(time);
          st.setArrivalTime(time);

          writer.handleEntity(st);

        }

        Duration runTime = timingLink.getRunTime();

        time += (runTime.getTimeInMillis(new Date()) / 1000L);

        JourneyPatternStopUsageStructure to = timingLink.getTo();

        StopTime st = new StopTime();
        st.setTrip(t);
        st.setStop(stopsById.get(to.getStopPointRef().getValue()));
        st.setStopSequence(++stopSequence);
        st.setDepartureTime(time);

        if (to.getWaitTime() != null) {
          time += (to.getWaitTime().getTimeInMillis(new Date()) / 1000L);
        }

        st.setArrivalTime(time);

        writer.handleEntity(st);
      }
    }
  }
}

redpajama_set_name: RedPajamaGithub


text:
package org.elasticsearch.common.xcontent.cbor;

import com.fasterxml.jackson.core.JsonParser;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.common.xcontent.json.JsonXContentParser;

/**
 *
 */
public class CborXContentParser extends JsonXContentParser {

    public CborXContentParser(JsonParser parser) {
        super(parser);
    }

    @Override
    public XContentType contentType() {
        return XContentType.CBOR;
    }
}


text:
var keyMirror = require('react/lib/keyMirror');

// Define action constants
module.exports = keyMirror({
  RECEIVE_NUMBER: null,       // Adds item to cart
  REMOVE_NUMBER: null,    // Remove item from cart
  SELECT_NUMBER: null,   // Selects a product option
  ADD_NUMBER: null    // Loads our mock data
});


text:
<?xml version='1.0' encoding='utf-8'?>
<plugin id="cordova-plugin-ios-launch-screen" version="1.0.0"
        xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
    <name>iOS Launch Screen Plugin</name>
    <description>This plugin adds the ability to render a launch screen at app start such that iPad Pro resolutions
                 are supported (instead of scaling the app). This also enables the use of multitasking features such
                 as split screen support.</description>
    <author>Kerri Shotts</author>
    <license>Apache 2.0 License</license>
    <keywords>ipad pro, ios, ipad, launch screen, launch storyboard</keywords>
    <engines>
        <engine name="cordova-ios" version=">=4.0.0" />
    </engines>
    <platform name="ios">
        <resource-file src="res/Default@3x~universal.png"
                       target="Default@3x~universal.png" />
        <resource-file src="res/Launch Screen.storyboard"
                       target="Launch Screen.storyboard" />
        <config-file target="*-Info.plist" parent="UILaunchStoryboardName">
            <string>Launch Screen</string>
        </config-file>
        <hook type="after_prepare" src="scripts/ios/afterPrepare.js" />
        <hook type="after_clean" src="scripts/ios/afterPrepare.js" />
    </platform>
</plugin>


text:
package us.kbase.referencedatamanager;

import java.util.HashMap;
import java.util.Map;
import javax.annotation.Generated;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;

/**
 *
Original spec-file type: ListSolrDocsParams

 *

 * Arguments for the list_solr_genomes and list_solr_taxa functions
 *

 *
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("com.googlecode.jsonschema2pojo")
@JsonPropertyOrder({
    "solr_core",
    "row_start",
    "row_count",
    "group_option",
    "create_report",
    "domain",
    "complete",
    "workspace_name"
})
public class ListSolrDocsParams {

    @JsonProperty("solr_core")
    private String solrCore;
    @JsonProperty("row_start")
    private Long rowStart;
    @JsonProperty("row_count")
    private Long rowCount;
    @JsonProperty("group_option")
    private String groupOption;
    @JsonProperty("create_report")
    private Long createReport;
    @JsonProperty("domain")
    private String domain;
    @JsonProperty("complete")
    private Long complete;
    @JsonProperty("workspace_name")
    private String workspaceName;
    private Map<String, Object> additionalProperties = new HashMap<String, Object>();

    @JsonProperty("solr_core")
    public String getSolrCore() {
        return solrCore;
    }

    @JsonProperty("solr_core")
    public void setSolrCore(String solrCore) {
        this.solrCore = solrCore;
    }

    public ListSolrDocsParams withSolrCore(String solrCore) {
        this.solrCore = solrCore;
        return this;
    }

    @JsonProperty("row_start")
    public Long getRowStart() {
        return rowStart;
    }

    @JsonProperty("row_start")
    public void setRowStart(Long rowStart) {
        this.rowStart = rowStart;
    }

    public ListSolrDocsParams withRowStart(Long rowStart) {
        this.rowStart = rowStart;
        return this;
    }

    @JsonProperty("row_count")
    public Long getRowCount() {
        return rowCount;
    }

    @JsonProperty("row_count")
    public void setRowCount(Long rowCount) {
        this.rowCount = rowCount;
    }

    public ListSolrDocsParams withRowCount(Long rowCount) {
        this.rowCount = rowCount;
        return this;
    }

    @JsonProperty("group_option")
    public String getGroupOption() {
        return groupOption;
    }

    @JsonProperty("group_option")
    public void setGroupOption(String groupOption) {
        this.groupOption = groupOption;
    }

    public ListSolrDocsParams withGroupOption(String groupOption) {
        this.groupOption = groupOption;
        return this;
    }

    @JsonProperty("create_report")
    public Long getCreateReport() {
        return createReport;
    }

    @JsonProperty("create_report")
    public void setCreateReport(Long createReport) {
        this.createReport = createReport;
    }

    public ListSolrDocsParams withCreateReport(Long createReport) {
        this.createReport = createReport;
        return this;
    }

    @JsonProperty("domain")
    public String getDomain() {
        return domain;
    }

    @JsonProperty("domain")
    public void setDomain(String domain) {
        this.domain = domain;
    }

    public ListSolrDocsParams withDomain(String domain) {
        this.domain = domain;
        return this;
    }

    @JsonProperty("complete")
    public Long getComplete() {
        return complete;
    }

    @JsonProperty("complete")
    public void setComplete(Long complete) {
        this.complete = complete;
    }

    public ListSolrDocsParams withComplete(Long complete) {
        this.complete = complete;
        return this;
    }

    @JsonProperty("workspace_name")
    public String getWorkspaceName() {
        return workspaceName;
    }

    @JsonProperty("workspace_name")
    public void setWorkspaceName(String workspaceName) {
        this.workspaceName = workspaceName;
    }

    public ListSolrDocsParams withWorkspaceName(String workspaceName) {
        this.workspaceName = workspaceName;
        return this;
    }

    @JsonAnyGetter
    public Map<String, Object> getAdditionalProperties() {
        return this.additionalProperties;
    }

    @JsonAnySetter
    public void setAdditionalProperties(String name, Object value) {
        this.additionalProperties.put(name, value);
    }

    @Override
    public String toString() {
        return ((((((((((((((((((("ListSolrDocsParams"+" [solrCore=")+ solrCore)+", rowStart=")+ rowStart)+", rowCount=")+ rowCount)+", groupOption=")+ groupOption)+", createReport=")+ createReport)+", domain=")+ domain)+", complete=")+ complete)+", workspaceName=")+ workspaceName)+", additionalProperties=")+ additionalProperties)+"]");
    }

}


text:
<?php

namespace Google\Cloud\tests;

use Google\Cloud\TestUtils\EventuallyConsistentTestTrait;
use GuzzleHttp\Client;
use GuzzleHttp\Cookie\CookieJar;
use PHPUnit\Framework\TestCase;

class EndToEndTest extends TestCase
{
    use EventuallyConsistentTestTrait;

    private $client;

    const PROJECT_ENV = 'E2E_PROJECT_ID';
    const VERSION_ENV = 'TAG';
    const SERVICE_ACCOUNT_ENV = 'SERVICE_ACCOUNT_JSON';

    public static function setUpBeforeClass(): void
    {
        $project_id = getenv(self::PROJECT_ENV);
        $e2e_test_version = getenv(self::VERSION_ENV);
        $service_account_json = getenv(SELF::SERVICE_ACCOUNT_ENV);
        if ($project_id == false) {
            self::fail('Please set ' . self::PROJECT_ENV . ' env var.');
        }
        if ($e2e_test_version == false) {
            self::fail('Please set ' . self::VERSION_ENV . ' env var.');
        }
        if ($service_account_json == false) {
            self::fail('Please set ' . self::SERVICE_ACCOUNT_ENV . ' env var.');
        }

        self::execWithError(
            sprintf(
                'gcloud config set project %s',
                $project_id
            ),
            'Failed to set project_id: '
        );
        self::deploy($project_id, $e2e_test_version);
    }

    public static function deploy($project_id, $e2e_test_version)
    {
        // Now it's appending a whole `beta_settings` section because the
        // app.yaml doesn't have it. Apparently it's cleaner if we read the
        // yaml file and add the config by yaml library.
        $testVmImage = getenv('TEST_VM_IMAGE');
        if (! empty($testVmImage)) {
            $betaSettings = "beta_settings:\n"
                . "  image: $testVmImage\n";
            file_put_contents(
                '../app.yaml',
                $betaSettings,
                FILE_APPEND | LOCK_EX
            );
        }
        echo 'Deploying with the following app.yaml' . PHP_EOL;
        echo file_get_contents('../app.yaml');
        $command = "gcloud -q app deploy --version $e2e_test_version"
            . " --project $project_id --no-promote"
            . ' ../app.yaml';
        printf("Executing command: '%s'\n", $command);
        for ($i = 0; $i <= 3; $i++) {
            exec(
                $command,
                $output,
                $ret
            );
            if ($ret === 0) {
                return;
            } else {
                echo 'Retrying deployment';
            }
        }
        self::fail('Deployment failed.');
    }

    public static function tearDownAfterClass(): void
    {
        // TODO: check the return value and maybe retry?
        $cmd = sprintf(
            'gcloud -q app versions delete --service default '
            . '--project %s %s',
            getenv(self::PROJECT_ENV),
            getenv(self::VERSION_ENV)
        );
        exec($cmd);
    }

    private static function execWithError($command, $errorPrefix)
    {
        printf("Executing command: '%s'\n", $command);
        exec(
            $command,
            $output,
            $ret
        );
        if ($ret !== 0) {
            self::fail(
                $errorPrefix
                . implode(PHP_EOL, $output)
            );
        }
    }

    public function setUp(): void
    {
        $this->eventuallyConsistentRetryCount = 10;
        $this->catchAllExceptions = true;

        $url = sprintf('https://%s-dot-%s.appspot.com/',
                       getenv(self::VERSION_ENV),
                       getenv(self::PROJECT_ENV));
        $this->client = new Client(['base_uri' => $url]);
    }

    public function testIndex()
    {
        $this->runEventuallyConsistentTest(function () {
            // Index serves succesfully with 'Hello World'.
            // This works because the custom DOCUMENT_ROOT is working.
            $resp = $this->client->get('index.php');
            $this->assertEquals('200', $resp->getStatusCode(),
                                'index.php status code');
            $this->assertStringContainsString('Hello World', $resp->getBody()->getContents());
        });
    }

    public function testHttpsEnv()
    {
        $this->runEventuallyConsistentTest(function () {
            // Check the HTTPS envvar on the server
            $resp = $this->client->get('https-env.php');
            $this->assertEquals('200', $resp->getStatusCode(),
                                'https-env.php status code');
            $this->assertStringContainsString('HTTPS: on', $resp->getBody()->getContents());
        });
    }

    public function testGoodbye()
    {
        $this->runEventuallyConsistentTest(function () {
            // The URL '/goodbye' works with 'Goodbye World'.
            // This works because the nginx-app.conf is effective.
            $resp = $this->client->get('/goodbye');
            $this->assertEquals('200', $resp->getStatusCode(),
                                '/goodbye status code');
            $this->assertStringContainsString('Goodbye World',
                                  $resp->getBody()->getContents());
        });
    }

    public function testPhpInfo()
    {
        $this->runEventuallyConsistentTest(function () {
            // Access to phpinfo.php, while phpinfo() should be enabled this time.
            $resp = $this->client->get('phpinfo.php');
            $this->assertEquals('200', $resp->getStatusCode(),
                                'phpinfo.php status code');
            $this->assertTrue(strlen($resp->getBody()->getContents()) > 1000,
                              'phpinfo() should be enabled.');
        });
    }

    public function testExec()
    {
        $this->runEventuallyConsistentTest(function () {
            // Access to exec.php; exec() should be enabled.
            $resp = $this->client->get('exec.php');
            $this->assertEquals(
                '200',
                $resp->getStatusCode(),
                'exec.php status code'
            );
            $this->assertStringContainsString(
                'exec succeeded.',
                $resp->getBody()->getContents()
            );
        });
    }

    public function testPdoSqlite()
    {
        $this->runEventuallyConsistentTest(function () {
            // Access to pdo_sqlite.php, which should work.
            $resp = $this->client->get('pdo_sqlite.php');
            $this->assertEquals('200', $resp->getStatusCode(),
                                'pdo_sqlite.php status code');
            $this->assertStringContainsString('Hello pdo_sqlite',
                                  $resp->getBody()->getContents());
        });
    }

    public function testSessionSaveHandler()
    {
        $this->markTestSkipped('Memcache is not available on env:flex.');
        $this->runEventuallyConsistentTest(function () {
            $resp = $this->client->get('session_save_handler.php');
            $this->assertEquals('200', $resp->getStatusCode(),
                                'session_save_handler status code');
            $this->assertStringContainsString('memcached',
                                  $resp->getBody()->getContents());
        });
    }

    public function testSession()
    {
        $this->markTestSkipped('Memcache is not available on env:flex.');
        $this->runEventuallyConsistentTest(function () {
            $jar = new CookieJar();
            $resp = $this->client->get('session.php', ['cookies' => $jar]);
            $this->assertEquals('200', $resp->getStatusCode(),
                                'session.php status code');
            $this->assertEquals('0', $body = $resp->getBody()->getContents());

            $resp = $this->client->get('session.php', ['cookies' => $jar]);
            $this->assertEquals('200', $resp->getStatusCode(),
                                'session.php status code');
            $this->assertEquals('1', $body = $resp->getBody()->getContents());
        });
    }

    public function testGrpcPubsub()
    {
        $this->runEventuallyConsistentTest(function () {
            $resp = $this->client->get('grpc_pubsub.php');
            $this->assertEquals('200', $resp->getStatusCode(),
                                'grpc_pubsub.php status code');
        });
    }
}


text:
NS_ASSUME_NONNULL_BEGIN

@interface SBBreakpointLocation()

- (void) setBreakpointLocation: (void *)p;

@end

@interface SBBreakpoint()

- (void) setBreakpoint: (void *)p;

@end

NS_ASSUME_NONNULL_END


text:
package com.hippo.util;

import androidx.annotation.Nullable;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

public final class JsoupUtils {

    @Nullable
    public static Element getElementByClass(Document doc, String className) {
        Elements elements = doc.getElementsByClass(className);
        if (elements != null && elements.size() > 0) {
            return elements.get(0);
        } else {
            return null;
        }
    }

    @Nullable
    public static Element getElementByClass(Element element, String className) {
        Elements elements = element.getElementsByClass(className);
        if (elements != null && elements.size() > 0) {
            return elements.get(0);
        } else {
            return null;
        }
    }

    @Nullable
    public static Element getElementByTag(Element element, String tagName) {
        Elements elements = element.getElementsByTag(tagName);
        if (elements != null && elements.size() > 0) {
            return elements.get(0);
        } else {
            return null;
        }
    }
}


text:
/*=============================================================
    Authour URI: www.binarycart.com
    License: Commons Attribution 3.0

    http://creativecommons.org/licenses/by/3.0/

    100% To use For Personal And Commercial Use.
    IN EXCHANGE JUST GIVE US CREDITS AND TELL YOUR FRIENDS ABOUT US

    ========================================================  */

(function ($) {
    "use strict";
    var mainApp = {

        main_fun: function () {
            /*====================================
            METIS MENU
            ======================================*/
            $('#main-menu').metisMenu();

            /*====================================
              LOAD APPROPRIATE MENU BAR
           ======================================*/
            $(window).bind("load resize", function () {
                if ($(this).width() < 768) {
                    $('div.sidebar-collapse').addClass('collapse')
                } else {
                    $('div.sidebar-collapse').removeClass('collapse')
                }
            });

        },

        initialization: function () {
            mainApp.main_fun();

        }

    }
    // Initializing ///

    $(document).ready(function () {
        mainApp.main_fun();
    });

}(jQuery));


text:
<?php

// No direct access
defined('_HZEXEC_') or die();

$this->css()
	 ->js();

$url = 'index.php?option=' . $this->option . '&alias=' . $this->project->get('alias') . '&active=notes';

// Com_wiki adds /projects - strip it out
$this->content = str_replace('projects/projects/', 'projects/', $this->content);

$this->content = str_replace('projects/pr-' . $this->project->get('alias'), 'projects/' . $this->project->get('alias'), $this->content);

// Get the page
$page = $this->page;

$showSidePanel = ($this->task == 'view' or $this->task == 'page' or $this->task == 'wiki') && $page->get('id') ? true : false;

// Get all project notes
$notes = $this->note->getNotes();

// Get page parent notes (for breadcrumbs)
$parentNotes = array(); //$this->note->getParentNotes($this->scope);
if (trim($page->path))
{
	$parentNotes = explode('/', trim($page->path));
}

// Get parent scope (to add subpages)
$parentScope = $this->scope . DS . $page->get('pagename');

// Build breadcrumbs
$bcrumb = '';
/*if ($parentNotes && count($parentNotes) > 0)
{
	foreach ($parentNotes as $parent)
	{
		$bcrumb .= ' » scope . '&pagename=' . $parent->pagename) . '">' . $parent->title . '';
	}
}*/
if ($this->task == 'new')
{
	$bcrumb .= ' » '.Lang::txt('COM_PROJECTS_NOTES_TASK_NEW').'';
}
elseif ($page->get('id'))
{
	$bcrumb .= ' » link()).'">'. $page->get('title') . '';

}

$tasks = array( 'edit', 'history', 'comments', 'delete', 'compare', 'addcomment', 'renamepage' );
if ($this->task != 'view' && in_array($this->task, $tasks))
{
	$bcrumb .= ' » ' . Lang::txt('COM_PROJECTS_NOTES_TASK_' . strtoupper($this->task)) . ' ';
}

// Is note public?
$publicStamp = $this->params->get('enable_publinks')
	? $this->note->getPublicStamp($page->get('id')) : null;

$listed = $publicStamp ? $publicStamp->listed : false;

?>

<?php if ($bcrumb) { ?><a href="<?php echo Route::url($url); ?>"><?php } ?><?php echo $this->title; ?><?php if ($bcrumb) { ?><?php } ?> <?php  echo $bcrumb; ?>

<?php if ($showSidePanel && $this->project->access('content')) { ?>

			<a class="icon-add add btn"  href="<?php echo Route::url($url . '&action=new'); ?>" title="<?php echo Lang::txt('COM_PROJECTS_NOTES_ADD_NOTE'); ?>">
				<?php echo Lang::txt('COM_PROJECTS_NOTES_ADD_NOTE'); ?>

			<?php if (count($parentNotes) < 2) { ?>
				<?php
				$base = $page->link();
				$chr  = strstr($base, '?') ? '&' : '?';
				?>
				<a href="<?php echo Route::url($base . $chr . 'action=new'); ?>" class="icon-add add btn" title="<?php echo Lang::txt('COM_PROJECTS_NOTES_ADD_SUBPAGE'); ?>"><?php echo Lang::txt('COM_PROJECTS_NOTES_ADD_SUBPAGE'); ?>
			<?php } ?>

<?php } ?>

	<div class="col <?php echo $showSidePanel ? 'span9' : 'span12 omega'; ?>">
		<div id="notes-content" class="notes-content <?php echo $listed ? 'listed-note' : 'unlisted-note'; ?>">
			<?php echo $this->content; ?>

<?php echo $this->scope; ?>

		<?php if ($this->params->get('enable_publinks') && $this->page->get('id') && $this->project->access('content')) {
			$this->view('sharelink')
			     ->set('option', $this->option)
			     ->set('page', $this->page)
			     ->set('task', $this->task)
			     ->set('project', $this->project)
			     ->set('publicStamp', $publicStamp)
			     ->display();
		} ?>

	<?php if ($showSidePanel) { ?>

				<?php $this->view('list')
				     ->set('option', $this->option)
				     ->set('page', $this->page)
					 ->set('scope', $this->scope)
				     ->set('task', $this->task)
					 ->set('note', $this->note)
				     ->set('project', $this->project)
				     ->display();
				?>

	<?php } ?>


text:
require File.expand_path('../../test_helper', __FILE__)

class ContactsControllerTest < ActionController::TestCase
  fixtures :projects,
           :users,
           :roles,
           :members,
           :member_roles,
           :issues,
           :issue_statuses,
           :versions,
           :trackers,
           :projects_trackers,
           :issue_categories,
           :enabled_modules,
           :enumerations,
           :attachments,
           :workflows,
           :custom_fields,
           :custom_values,
           :custom_fields_projects,
           :custom_fields_trackers,
           :time_entries,
           :journals,
           :journal_details,
           :queries

  RedmineContacts::TestCase.create_fixtures(Redmine::Plugin.find(:redmine_contacts).directory + '/test/fixtures/', [:contacts,
                                                                                :contacts_projects,
                                                                                :contacts_issues,
                                                                                :deals,
                                                                                :notes,
                                                                                :tags,
                                                                                :taggings,
                                                                                :queries,
                                                                                :addresses])

  def setup
    RedmineContacts::TestCase.prepare

    @controller = ContactsController.new
    @request    = ActionController::TestRequest.new
    @response   = ActionController::TestResponse.new
    User.current = nil
  end

  test "should get index" do
    # log_user('admin', 'admin')
    @request.session[:user_id] = 1
    assert_not_nil Contact.find(1)
    get :index
    assert_response :success
    assert_template :index
    assert_not_nil assigns(:contacts)
    assert_not_nil assigns(:tags)
    assert_nil assigns(:project)
    assert_select 'a', :html => /Domoway/
    assert_select 'a', :html => /Marat/
    assert_select 'h3', :html => /Tags/
    assert_select 'h3', :html => /Recently viewed/
    assert_select 'div#tags span#single_tags span.tag-label-color a', "test (3)"
    assert_select 'div#tags span#single_tags span.tag-label-color a', "main (2)"
    # assert_select 'div#tags span#single_tags span.tag-label-color a', { :count => 2, :text =>/(test (2)|main (2))/}
    #   assert_select 'a', "main (2)"
    #   assert_select 'a', "test (2)"
    # end

    # private projects hidden
    # assert_no_tag :tag => 'a', :content => /Issue of a private subproject/
    # assert_no_tag :tag => 'a', :content => /Issue on project 2/
    # project column
    # assert_tag :tag => 'th', :content => /Project/
  end

  test "should get index in project" do
    # log_user('admin', 'admin')
    @request.session[:user_id] = 1
    Setting.default_language = 'en'

    get :index, :project_id => 1
    assert_response :success
    assert_template :index
    assert_not_nil assigns(:contacts)
    assert_not_nil assigns(:project)
    assert_select 'a', :html => /Domoway/
    assert_select 'a', :html => /Marat/
    assert_select 'h3', :html => /Tags/
    assert_select 'h3', :html => /Recently viewed/
  end

  test "should not absolute links" do
    @request.session[:user_id] = 1
    get :index
    assert_response :success
    # assert_equal 'localhost', @response.body
    assert_no_match /localhost/, @response.body
  end

  test "should get index deny user in project" do
    # log_user('admin', 'admin')
    @request.session[:user_id] = 5

    get :index, :project_id => 1
    assert_response :redirect
    # assert_tag :tag => 'div', :attributes => { :id => "login-form"}
    # assert_select 'div#login-form'
  end

  test "should get index with filters" do
    @request.session[:user_id] = 1
    get :index, :is_company => ActiveRecord::Base.connection.quoted_true.gsub(/'/, '')
    assert_response :success
    assert_template :index
    assert_select 'div#content div#contact_list table.contacts td.name h1 a', 'Domoway'
  end

  def test_get_show
    # log_user('admin', 'admin')
    @request.session[:user_id] = 2
    Setting.default_language = 'en'

    get :show, :id => 3, :project_id => 1
    assert_response :success
    assert_template :show
    assert_not_nil assigns(:contact)
    assert_not_nil assigns(:project)
    assert_select 'h1', :html => /Domoway/
    assert_select 'div#tags_data span.tag-label-color a', 'main'
    assert_select 'div#tags_data span.tag-label-color a', 'test'
    assert_select 'div#tab-placeholder-contacts'
    assert_select 'div#comments div#notes table.note_data td.name h4', 4
    assert_select 'h3', "Recently viewed"
  end
  test "should get new" do
    @request.session[:user_id] = 2
    get :new, :project_id => 1
    assert_response :success
    assert_template 'new'
    assert_select 'input#contact_first_name'
  end

  test "should not get new by deny user" do
    @request.session[:user_id] = 4
    get :new, :project_id => 1
    assert_response :forbidden
  end

  test "should post create" do
    @request.session[:user_id] = 1
    assert_difference 'Contact.count' do
      post :create, :project_id => 1,
                    :contact => {
                                :company => "OOO \"GKR\"",
                                :is_company => 0,
                                :job_title => "CFO",
                                :assigned_to_id => 3,
                                :tag_list => "test,new",
                                :last_name => "New",
                                :middle_name => "Ivanovich",
                                :first_name => "Created"}

    end

    assert_redirected_to :controller => 'contacts', :action => 'show', :id => Contact.last.id, :project_id => Contact.last.project

    contact = Contact.where(:first_name => "Created", :last_name => "New", :middle_name => "Ivanovich").first
    assert_not_nil contact
    assert_equal "CFO", contact.job_title
    assert_equal ["new", "test"], contact.tag_list.sort
    assert_equal 3, contact.assigned_to_id
  end

  test "should not post create by deny user" do
    @request.session[:user_id] = 4
    post :create, :project_id => 1,
        :contact => {
                    :company => "OOO \"GKR\"",
                    :is_company => 0,
                    :job_title => "CFO",
                    :assigned_to_id => 3,
                    :tag_list => "test,new",
                    :last_name => "New",
                    :middle_name => "Ivanovich",
                    :first_name => "Created"}
    assert_response :forbidden
  end

  test "should get edit" do
    @request.session[:user_id] = 1
    get :edit, :id => 1
    assert_response :success
    assert_template 'edit'
    assert_not_nil assigns(:contact)
    assert_equal Contact.find(1), assigns(:contact)
  end

  test "should put update" do
    @request.session[:user_id] = 1

    contact = Contact.find(1)
    old_firstname = contact.first_name
    new_firstname = 'Fist name modified by ContactsControllerTest#test_put_update'

    put :update, :id => 1, :project_id => 1, :contact => {:first_name => new_firstname}
    assert_redirected_to :action => 'show', :id => '1', :project_id => 1
    contact.reload
    assert_equal new_firstname, contact.first_name

  end

  test "should post destroy" do
    @request.session[:user_id] = 1
    post :destroy, :id => 1, :project_id => 'ecookbook'
    assert_redirected_to :action => 'index', :project_id => 'ecookbook'
    assert_equal 0, Contact.where(:id => [1]).count
  end

  test "should bulk destroy contacts" do
    @request.session[:user_id] = 1

    post :bulk_destroy, :ids => [1, 2, 3]
    assert_redirected_to :controller => 'contacts', :action => 'index'

    assert_equal 0, Contact.where(:id => [1, 2, 3]).count
  end

  test "should not bulk destroy contacts by deny user" do
    @request.session[:user_id] = 4
    assert_raises ActiveRecord::RecordNotFound do
      post :bulk_destroy, :ids => [1, 2]
    end

  end
  test "should get contacts notes" do
    # log_user('admin', 'admin')
    @request.session[:user_id] = 2

    get :contacts_notes
    assert_response :success
    assert_template :contacts_notes
    assert_select 'h2', /All notes/
    assert_select 'div#contacts_notes table.note_data div.note.content.preview', /Note 1/
  end

  test "should get context menu" do
    @request.session[:user_id] = 1
    xhr :get, :context_menu, :back_url => "/projects/contacts-plugin/contacts", :project_id => 'ecookbook', :ids => ['1', '2']
    assert_response :success
    assert_template 'context_menu'
  end

  test "should post index live search" do
    @request.session[:user_id] = 1
    xhr :post, :index, :search => "Domoway"
    assert_response :success
    assert_template 'contacts/_list_excerpt'
    assert_select 'a', :html => /Domoway/
  end

  test "should post index live search in project" do
    @request.session[:user_id] = 1
    xhr :post, :index, :search => "Domoway", :project_id => 'ecookbook'
    assert_response :success
    assert_template 'contacts/_list_excerpt'
    assert_select 'a', :html => /Domoway/
  end

  test "should post contacts_notes live search" do
    @request.session[:user_id] = 1
    xhr :post, :contacts_notes, :search_note => "Note 1"
    assert_response :success
    assert_template '_notes_list'
    assert_select 'table.note_data div.note.content.preview', /Note 1/
    assert_select 'table.note_data div.note.content.preview', {:count => 0, :text => /Note 2/}
  end

  test "should post contacts_notes live search in project" do
    @request.session[:user_id] = 1
    xhr :post, :contacts_notes, :search_note => "Note 2", :project_id => 'ecookbook'
    assert_response :success
    assert_template '_notes_list'
    assert_select 'table.note_data div.note.content.preview', /Note 2/
  end

  private

  def crm_query_params
    {:set_filter => "1", :project_id => "ecookbook"}
  end
end


text:
/* global angular, ol, olcs, $, Cesium */

(function () {
    "use strict";

    var app = angular.module('geowebtoolkit.mapservices.map.ol3cesium', []);

    app.service('ol3CesiumMapService', [function () {
        var spaceEventHandler;
        var service = {
            registerMapClick: function (mapInstance, callback) {
                var scene = mapInstance.getCesiumScene();
                if (!spaceEventHandler) {
                    spaceEventHandler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
                }
                spaceEventHandler.setInputAction(callback, Cesium.ScreenSpaceEventType.LEFT_CLICK);
            },
            unRegisterMapClick: function (mapInstance, callback) {
                var scene = mapInstance.getCesiumScene();
                if (!spaceEventHandler) {
                    spaceEventHandler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
                }
                spaceEventHandler.removeInputAction(callback, Cesium.ScreenSpaceEventType.LEFT_CLICK);
            },
            registerMapEvent: function (mapInstance, eventName, callback) {
                var scene = mapInstance.getCesiumScene();
                if (!spaceEventHandler) {
                    spaceEventHandler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
                }
                spaceEventHandler.setInputAction(callback, Cesium.ScreenSpaceEventType.LEFT_CLICK);
            },
            unRegisterMapEvent: function (mapInstance, callback) {

            },
            getCoordinateFromPixel: function (mapInstance, pixel) {
                var scene = mapInstance.getCesiumScene();
                var ellipsoid = scene.globe.ellipsoid;
                var cartesian = scene.camera.pickEllipsoid(pixel, ellipsoid);
                if (cartesian) {
                    var cartographic = ellipsoid.cartesianToCartographic(cartesian);
                    var longitudeString = Cesium.Math.toDegrees(cartographic.longitude);
                    var latitudeString = Cesium.Math.toDegrees(cartographic.latitude);
                    var result = [parseFloat(longitudeString), parseFloat(latitudeString)];
                    return result;
                }
                return [0, 0];
            }
        };

        return service;
    }]);
})();


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Placographa varangarica Th. Fr.

### Remarks
null


text:
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Scanner;

import org.jnetpcap.Pcap;
import org.jnetpcap.PcapIf;
import org.jnetpcap.packet.PcapPacket;
import org.jnetpcap.packet.PcapPacketHandler;
import org.jnetpcap.protocol.network.Ip4;

public class Runner {

	public static void main(String[] args) throws InterruptedException {
		SynthManager s = new SynthManager();
		s.start();

		List<PcapIf> alldevs = new ArrayList<PcapIf>(); // Will be filled with NICs
        StringBuilder errbuf = new StringBuilder(); // For any error msgs

        int r = Pcap.findAllDevs(alldevs, errbuf);
        if (r == Pcap.NOT_OK || alldevs.isEmpty()) {
            System.err.printf("Can't read list of devices, error is %s", errbuf
                .toString());
            return;
        }

        System.out.println("Network devices found:");

        int i = 0;
        for (PcapIf device : alldevs) {
            String description =
                (device.getDescription() != null) ? device.getDescription()
                    : "No description available";
            System.out.printf("#%d: %s [%s]\n", i++, device.getName(), description);
        }

        System.out.print("\nPlease choose one of the above (only the number): ");
        Scanner scan = new Scanner(System.in);
        int deviceNum = scan.nextInt();

        PcapIf device = alldevs.get(deviceNum); // We know we have atleast 1 device
        System.out
            .printf("\nChoosing '%s':\n",
                (device.getDescription() != null) ? device.getDescription()
                    : device.getName());

        int snaplen = 64 * 1024;           // Capture all packets, no trucation
        int flags = Pcap.MODE_PROMISCUOUS; // capture all packets
        int timeout = 10 * 1000;           // 10 seconds in millis
        Pcap pcap =
            Pcap.openLive(device.getName(), snaplen, flags, timeout, errbuf);

        if (pcap == null) {
            System.err.printf("Error while opening device for capture: "
                + errbuf.toString());
            return;
        }

        PcapPacketHandler<String> jpacketHandler = new PcapPacketHandler<String>() {

            public void nextPacket(PcapPacket packet, String user) {

            	try
            	{
            		byte[] sourceIp = packet.getHeader(new Ip4()).source();
            		s.playSound(new int[] {sourceIp[0], sourceIp[1], sourceIp[2], sourceIp[3]});
            	} catch (NullPointerException e)
            	{

            	}
            }
        };

        pcap.loop(-1, jpacketHandler, "");

        pcap.close();

	}

}


text:
/* ###
 * IP: GHIDRA
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import java.io.File;
import java.io.PrintWriter;
import java.math.BigInteger;

import ghidra.app.script.GhidraScript;
import ghidra.program.disassemble.Disassembler;
import ghidra.program.model.address.*;
import ghidra.program.model.lang.*;
import ghidra.program.model.listing.*;
import ghidra.program.model.mem.*;
import ghidra.util.Msg;
import ghidra.util.StringUtilities;

public class RangeDisassemblerScript extends GhidraScript {

	/**
	 * Required properties:
	 *  min - minimum disassembly address or block name
	 *  max - maximum disassembly address (not used if block name used for min)
	 *  out - disassembly output file path
	 *
	 * Optional:
	 *  set.<context-reg-name>       - optional starting context value
	 *  set.range.<context-reg-name> - optional context value over range
	 *
	 */

	private AddressSetView region;
	private File outFile;

	@Override
	protected void run() throws Exception {

		if (!isRunningHeadless()) {
			printerr("Script intended for Headless use only");
			return;
		}

		if (currentProgram == null) {
			printerr("Requires open program");
			return;
		}

		currentProgram.setTemporary(true);

		if (!processParameters()) {
			return;
		}

		Msg.info(this, "Disassmbly Output File: " + outFile.getAbsolutePath());

		PrintWriter out = new PrintWriter(outFile);
		try {
			disassembleRegion(out);
		}
		finally {
			out.close();
		}

	}

	private void disassembleRegion(PrintWriter out) {

		int alignment = currentProgram.getLanguage().getInstructionAlignment();

		Disassembler disassembler =
			Disassembler.getDisassembler(currentProgram, false, false, false, monitor, null);

		DumbMemBufferImpl memBuffer =
			new DumbMemBufferImpl(currentProgram.getMemory(), region.getMinAddress());

		ParallelInstructionLanguageHelper helper =
			currentProgram.getLanguage().getParallelInstructionHelper();

		int cnt = 0;

		for (AddressRange range : region.getAddressRanges(true)) {

			Address nextAddr = range.getMinAddress();

			InstructionBlock lastPseudoInstructionBlock = null;

			while (nextAddr != null && nextAddr.compareTo(range.getMaxAddress()) <= 0) {

				if ((nextAddr.getOffset() % alignment) != 0) {
					nextAddr = nextAddr.next();
					continue;
				}

				Instruction pseudoInstruction = null;
				InstructionError error = null;

				if (lastPseudoInstructionBlock != null) {
					pseudoInstruction = lastPseudoInstructionBlock.getInstructionAt(nextAddr);
					if (pseudoInstruction == null) {
						error = lastPseudoInstructionBlock.getInstructionConflict();
						if (error != null && !nextAddr.equals(error.getInstructionAddress())) {
							error = null;
						}
					}
				}

				if (pseudoInstruction == null && error == null) {
					memBuffer.setPosition(nextAddr);
					lastPseudoInstructionBlock =
						disassembler.pseudoDisassembleBlock(memBuffer, null, 1);
					if (lastPseudoInstructionBlock != null) {
						pseudoInstruction = lastPseudoInstructionBlock.getInstructionAt(nextAddr);
						if (pseudoInstruction == null) {
							error = lastPseudoInstructionBlock.getInstructionConflict();
							if (error != null && !nextAddr.equals(error.getInstructionAddress())) {
								error = null;
							}
						}
					}
				}

				try {
					if (pseudoInstruction != null) {
						out.print(nextAddr.toString());
						out.print(" ");
						out.print(formatBytes(pseudoInstruction.getBytes()));
						out.print(" ");

						String prefix = null;
						if (helper != null) {
							prefix = helper.getMnemonicPrefix(pseudoInstruction);
						}
						if (prefix == null) {
							prefix = "    ";
						}
						else {
							prefix = StringUtilities.pad(prefix, ' ', -4);
						}
						out.println(prefix);

						out.println(pseudoInstruction.toString());

						nextAddr = pseudoInstruction.getMaxAddress().next();
					}
					else {
						out.print(nextAddr.toString());
						out.print(" ");
						out.print(formatBytes(new byte[] { memBuffer.getByte(0) }));
						out.print(" ERROR: ");
						out.println(error.getConflictMessage());

						nextAddr = nextAddr.add(alignment);
					}

					if ((++cnt % 20000) == 0) {
						Msg.info(this, "Disassembled: " + cnt);
					}
				}
				catch (AddressOutOfBoundsException e) {
					nextAddr = null; // next range
				}
				catch (MemoryAccessException e) {
					out.print(nextAddr.toString());
					out.println(" ERROR: " + e.getMessage());
					break;
				}
			}
		}
		Msg.info(this, "Disassembled: " + cnt + " instructions to " + outFile);
	}

	private static final int MAX_BYTES = 4;

	private String formatBytes(byte[] bytes) {

		int totalWidth = (3 * 4) + 2;
		StringBuilder buf = new StringBuilder();

		for (int i = 0; i < bytes.length && i < MAX_BYTES; i++) {
			if (i != 0) {
				buf.append(' ');
			}
			int v = bytes[i] & 0xff;
			if (v < 0x10) {
				buf.append('0');
			}
			buf.append(Integer.toHexString(v));
		}
		if (bytes.length > MAX_BYTES) {
			buf.append('.');
		}

		return StringUtilities.pad(buf.toString(), ' ', -totalWidth);
	}

	private boolean processParameters() {

		Address minAddr = null;
		Address maxAddr = null;

		AddressFactory addrFactory = currentProgram.getAddressFactory();

		boolean missingParam = false;

		String minAddrStr = propertiesFileParams.getValue("min");
		if (minAddrStr == null) {
			printerr("Missing required minimum address property: min");
			missingParam = true;
		}
		else {
			minAddr = addrFactory.getAddress(minAddrStr);
			if (minAddr == null) {

				// Try as block name
				MemoryBlock block = currentProgram.getMemory().getBlock(minAddrStr);
				if (block == null) {
					printerr("Failed to parse min address/block: " + minAddrStr);
					missingParam = true;
				}
				else {
					minAddr = block.getStart();
					maxAddr = block.getEnd();
				}
			}
		}

		if (maxAddr == null) {
			String maxAddrStr = propertiesFileParams.getValue("max");
			if (minAddrStr == null) {
				printerr("Missing required maximum address property: max");
				missingParam = true;
			}
			else {
				maxAddr = addrFactory.getAddress(maxAddrStr);
				if (maxAddr == null) {
					printerr("Failed to parse max address: " + maxAddrStr);
					missingParam = true;
				}
			}
		}

		String filepath = propertiesFileParams.getValue("out");
		if (minAddrStr == null) {
			printerr("Missing required output file path property: out");
			missingParam = true;
		}
		else {
			outFile = new File(filepath);
			File parentDir = outFile.getParentFile();
			if (!parentDir.exists()) {
				printerr("Output directory not found: " + parentDir.getAbsolutePath());
				missingParam = true;
			}
		}

		if (missingParam) {
			return false;
		}

		if (!minAddr.hasSameAddressSpace(maxAddr) || minAddr.compareTo(maxAddr) > 0) {
			printerr("Invalid address range: " + minAddr + " - " + maxAddr);
			return false;
		}

		region =
			currentProgram.getMemory().getLoadedAndInitializedAddressSet().intersectRange(minAddr, maxAddr);

		if (region.isEmpty()) {
			printerr("Address range does not intersect initiailized memory: " + minAddr + " - " +
				maxAddr);
			return false;
		}

		ProgramContext programContext = currentProgram.getProgramContext();

		boolean badReg;
		try {
			badReg = false;
			for (String key : propertiesFileParams.keySet()) {
				boolean setRange = false;
				int index;
				if (key.startsWith("set.range.")) {
					setRange = true;
					index = 10;
				}
				else if (key.startsWith("set.")) {
					index = 4;
				}
				else {
					continue;
				}
				String regName = key.substring(index);
				Register reg = currentProgram.getRegister(regName);
				if (reg == null || !reg.isProcessorContext()) {
					printerr("Processor context register field not found: " + regName);
					badReg = true;
					continue;
				}

				BigInteger value;
				String valueStr = propertiesFileParams.getValue(key);
				try {
					value = BigInteger.valueOf(Long.parseLong(valueStr));
				}
				catch (NumberFormatException e) {
					printerr("Invalid register set value: " + valueStr);
					badReg = true;
					continue;
				}

				if (setRange) {
					programContext.setValue(reg, minAddr, maxAddr, value);
				}
				else {
					programContext.setValue(reg, minAddr, minAddr, value);
				}

			}
		}
		catch (ContextChangeException e) {
			printerr("Program must be clear of all code units!");
			printerr(e.getMessage());
			return false;
		}

		if (badReg) {
			return false;
		}

		return true;
	}
}


text:
namespace remoting {

// "--elevate=<binary>" requests |binary| to be launched elevated (possibly
// causing a UAC prompt).
extern const char kElevateSwitchName[];

// "--help" prints the usage message.
extern const char kHelpSwitchName[];

// Used to specify the type of the process. kProcessType* constants specify
// possible values.
extern const char kProcessTypeSwitchName[];

// "--?" prints the usage message.
extern const char kQuestionSwitchName[];

// The command line switch used to get version of the daemon.
extern const char kVersionSwitchName[];

// Values for kProcessTypeSwitchName.
extern const char kProcessTypeController[];
extern const char kProcessTypeDaemon[];
extern const char kProcessTypeDesktop[];
extern const char kProcessTypeHost[];
extern const char kProcessTypeRdpDesktopSession[];
extern const char kProcessTypeEvaluateCapability[];
extern const char kProcessTypeFileChooser[];
extern const char kProcessTypeUrlForwarderConfigurator[];
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
extern const char kProcessTypeXSessionChooser[];
#endif  // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)

extern const char kEvaluateCapabilitySwitchName[];

#if BUILDFLAG(IS_LINUX)
// Used to record client sessions to utmp/wtmp.
extern const char kEnableUtempter[];
#endif

// Values for kEvaluateCapabilitySwitchName.
#if BUILDFLAG(IS_WIN)
// Executes EvaluateD3D() function.
extern const char kEvaluateD3D[];
// Executes Evaluate3dDisplayMode() function.
extern const char kEvaluate3dDisplayMode[];
// Used in combination with |kProcessTypeUrlForwarderConfigurator| to set up
// the URL forwarder on Windows.
extern const char kSetUpUrlForwarderSwitchName[];
#endif

// Used to pass the HWND for the parent process to a child process.
extern const char kParentWindowSwitchName[];

// Name of the pipe used to communicate from the parent to the child process.
extern const char kInputSwitchName[];

// Name of the pipe used to communicate from the child to the parent process.
extern const char kOutputSwitchName[];

// Token used to create a message pipe between a pair of child and parent
// processes.
extern const char kMojoPipeToken[];

#if BUILDFLAG(IS_APPLE)
// NativeMessagingHost switch to check for required OS permissions and request
// them if necessary.
extern const char kCheckPermissionSwitchName[];

// Command line switch to check for Accessibility permission.
extern const char kCheckAccessibilityPermissionSwitchName[];

// Command line switch to check for Screen Recording permission.
extern const char kCheckScreenRecordingPermissionSwitchName[];

// Command line switch to list all audio devices and their UID.
extern const char kListAudioDevicesSwitchName[];
#endif  // BUILDFLAG(IS_APPLE)

}  // namespace remoting

#endif  // REMOTING_HOST_BASE_SWITCHES_H_


text:
using System;
using UnityEngine;

/// <summary>
///         This will manage a generic attribute,
///         which is a value with its notifiers
///         and range.
/// </summary>
[Serializable]
public abstract class AttributeMechanic : MonoBehaviour
{
	#region Notifications

	/// <summary>
	///         Delegate model used when notifying
	///         the modification of the attribute.
	/// </summary>
	/// <param name="newValue">
	///         The new value of the attribute.
	/// </param>
	public delegate void SetNotification(float newValue);

	/// <summary>
	///         Event fired when
	/// </summary>
	public event SetNotification OnSet;

	/// <summary>
	///         Call to fire event.
	/// </summary>
	/// <param name="newvalue">
	///         The parameter of the event.
	/// </param>
	protected virtual void CallOnSet(float newvalue)
	{
		var handler = OnSet;
		if (handler != null)
		{
			handler(newvalue);
		}
	}

	#endregion Notifications

	/// <summary>
	///         The minimum value of the
	///         attribute.
	/// </summary>
	public float MinimumValue = 0;

	/// <summary>
	///         The maximum value of the
	///         attribute.
	/// </summary>
	public float MaximumValue = 100;

	/// <summary>
	///         The value of the attribute at the
	///         initialization of the object.
	/// </summary>
	public float DefaultValue = 100;

	/// <summary>
	///         The value of the attribute in
	///         itself.
	/// </summary>
	protected float AttributeValue;

	/// <summary>
	///         Gets the internal value, and sets
	///         it clamped to its minimal and
	///         maximal values.
	/// </summary>
	public virtual float Value
	{
		get
		{
			return AttributeValue;
		}
		set
		{
			AttributeValue = Mathf.Clamp(MinimumValue, MaximumValue, value);
			CallOnSet(AttributeValue);
		}
	}

	/// <summary>
	///         Gets and sets the internal value,
	///         with normalized (between 0 and
	///         1) representation.
	/// </summary>
	public virtual float NormalizedValue
	{
		get
		{
			return Mathf.InverseLerp(MinimumValue, MaximumValue, AttributeValue);
		}
		set
		{
			AttributeValue = Mathf.Lerp(MinimumValue, MaximumValue, Mathf.Clamp01(value));
			CallOnSet(AttributeValue);
		}
	}

	/// <summary>
	///         Initializes internal value.
	/// </summary>
	protected virtual void Start()
	{
		AttributeValue = Mathf.Clamp(MinimumValue, MaximumValue, DefaultValue);
	}
}


text:
Ext.define('GeoExt.tree.Util', {
    statics: {
        /**
         * Updates the visibility of the layer that is connected to given
         * node.
         *
         * @param {Ext.data.NodeInterface} node The node.
         * @param {boolean} checked the new checked state.
         */
        updateLayerVisibilityByNode: function(node, checked) {
            var layer = node.get('layer');
            if(layer && checked != layer.getVisibility()) {
                node._visibilityChanging = true;
                if(checked && layer.isBaseLayer && layer.map) {
                    layer.map.setBaseLayer(layer);
                } else if(!checked && layer.isBaseLayer && layer.map &&
                          layer.map.baseLayer && layer.id == layer.map.baseLayer.id) {
                    // Must prevent the unchecking of radio buttons
                    node.set('checked', layer.getVisibility());
                } else {
                    layer.setVisibility(checked);
                }
                delete node._visibilityChanging;
            }
            GeoExt.tree.Util.enforceOneLayerVisible(node);
        },

        /**
         * Enforces that one layer of the node is visible.
         *
         * @param {Ext.data.NodeInterface} node The node.
         */
        enforceOneLayerVisible: function(node) {
            var attributes = node.data;
            var group = attributes.checkedGroup;
            // If we are in the baselayer group, the map will take care of
            // enforcing visibility.
            if(group && group !== "gx_baselayer") {
                var layer = node.get('layer');
                var ownerTree = node.getOwnerTree();
                if (ownerTree === undefined) return;
                var checkedNodes = ownerTree.getChecked();
                var checkedCount = 0;
                // enforce "not more than one visible"
                Ext.each(checkedNodes, function(n){
                    var l = n.data.layer;
                    if(!n.data.hidden && n.data.checkedGroup === group) {
                        checkedCount++;
                        if(l != layer && attributes.checked) {
                            l.setVisibility(false);
                        }
                    }
                });
                // enforce "at least one visible"
                if(checkedCount === 0 && attributes.checked === false) {
                    layer.setVisibility(true);
                }
            }
        }
    }
});


text:
wow-taskbar-icon-fix
====================

Adds a button to the in game World of Warcraft menu to fix disappearing taskbar icon.

# Installation:

 1.	Locate World of Warcraft Addon directory (C:\Program Files (x86)\World of Warcraft\Interface\AddOns)
 2. Copy TaskbarIconFix folder to Addon directory


text:
import { Injectable } from '@angular/core';
import {
  Observable,
  of
} from 'rxjs';
import {
  map,
  catchError
} from 'rxjs/operators';
import {
  HttpClient,
  HttpErrorResponse
} from '@angular/common/http';

import { ApiService } from '../shared/api/api.service';
import { environment } from '../../environments/environment';
import { UserProfileService } from '../shared/user-profile/user-profile.service';

export interface ApiError {
  kind: 'error';
  code?: number;
  message: string;
}

export interface ApiSuccess {
  kind: 'success';
  status: string;
  data: any;
}

export interface ApiStatusUpdateSuccess extends ApiSuccess {
  comments: string;
  commenter: string;
  dateTime: string;
}

@Injectable()
export class ArchivalApiService extends ApiService {
  protected get baseApiUrl(): string { return environment.API.ARCHIVAL_SPECIMEN; }

  constructor(http: HttpClient, private profile: UserProfileService) {
    super(http);
  }

  getPendingArchivalVariantReports(): Observable<any[]> {
    // DEVELOPER
    if (this.profile.checkRoles(['DEVELOPER'])) {
      return this.http
        .get(this.url('/archival_specimens/dashboard/variant_reports'))
        .pipe(
          map(res => res as any[]),
          catchError(this.handleError)
        );
    } else {
      return this.http
        .get('assets/archival/empty.json')
        .pipe(
          map(res => res as any[]),
          catchError(this.handleError)
        );
    }
  }

  getArchivalBiopsies(psn: string): Observable<any[]> {
    // DEVELOPER
    if (this.profile.checkRoles(['DEVELOPER'])) {
      return this.http
        .get(this.url(`/archival_specimens/${psn}/biopsies`))
        .pipe(
          map(res => res as any[]),
          catchError(this.handleError)
        );
    } else {
      return this.http
        .get('assets/archival/empty.json')
        .pipe(
          map(res => res as any[]),
          catchError(this.handleError)
        );
    }
  }

  updateVariants(
    psn: string,
    bsn: string,
    analysisId: string,
    variants: any,
    commenterName: string): Observable<ApiStatusUpdateSuccess | ApiError> {
    return this.http
      .patch(
        `${environment.API.ARCHIVAL_SPECIMEN}/archival_specimens/${psn}/biopsy/${bsn}/variant_reports/${analysisId}/variants`,
        variants)
      .pipe(
        map((res: any) => {
          return { kind: 'success', commenter: commenterName, status: res.status, dateTime: res.dateTime } as ApiStatusUpdateSuccess;
        }),
        catchError(this.softHandleApiError)
      );
  }

  updateVariantReportStatus(
    psn: string,
    bsn: string,
    analysisId: string,
    confirmed: boolean,
    commenterName: string
  ): Observable<ApiStatusUpdateSuccess | ApiError> {
    const patch = {
      'status': confirmed ? 'CONFIRMED' : 'REJECTED'
    };

    return this.http
      .patch(`${environment.API.ARCHIVAL_SPECIMEN}/archival_specimens/${psn}/biopsy/${bsn}/variant_reports/${analysisId}`,
        patch)
      .pipe(
        map((res: any) => {
          return { kind: 'success', commenter: commenterName, status: res.status, dateTime: res.dateTime } as ApiStatusUpdateSuccess;
        }),
        catchError(this.softHandleApiError)
      );
  }

  updateVariant(
    psn: string,
    bsn: string,
    analysisId: string,
    variantId: string,
    confirmed: boolean,
    comment: string,
    commenterName: string
  ): Observable<ApiStatusUpdateSuccess | ApiError> {

    const patch = {
      'status': confirmed ? 'CONFIRMED' : 'REJECTED',
      'comment': comment
    };

    return this.http.patch(`${environment.API.ARCHIVAL_SPECIMEN}/archival_specimens/${psn}/biopsy/${bsn}/variant_reports/${analysisId}/variants/${variantId}`,
      patch)
      .pipe(
        map((res: any) => {
          return { kind: 'success', commenter: commenterName, status: res.status, dateTime: res.dateTime, comments: res.comment } as ApiStatusUpdateSuccess;
        }),
        catchError(this.softHandleApiError)
      );
  }

  getPatientVariantReportQc(psn: string, analysisId: string): Observable<any> {
    return this.http
      .get(this.url(`/archival_specimens/${psn}/variant_reports/${analysisId}/quality_control_report`))
      .pipe(
        map(x => x),
        catchError(this.handleError)
      );
  }

  getPatientVariantReportFileInfo(psn: string, analysisId: string): Observable<any> {
    return this.http
      .get(this.url(`/archival_specimens/${psn}/variant_reports/${analysisId}/variant_report_file_info`))
      .pipe(
        map(x => x),
        catchError(this.handleError)
      );
  }

  downloadPatientFile(psn: string, url: string): Observable<ApiSuccess | ApiError> {
    return this.http
      .post(this.baseApiUrl + `/archival_specimens/${psn}download_url`, { s3_url: url })
      .pipe(
        map((res: any) => ({ kind: 'success', data: res }) as ApiSuccess),
        catchError(this.softHandleApiError)
      );
  }

  getComparisons(psn: string): Observable<ApiSuccess | ApiError> {
    return this.http
      .get(this.url(`/archival_specimens/${psn}/comparison_reports`))
      .pipe(
        map((res: any) => ({ kind: 'success', data: res }) as ApiSuccess),
        catchError(this.softHandleApiError)
      );
  }

  dissociateForensicId(bsn: string): Observable<any> {
    return this.http
      .patch(
        this.url(`/archival_specimens/${bsn}`),
        {
          'patientSequenceNumber': ''
        }
      )
      .pipe(
        map(x => x),
        catchError(this.handleError)
      );
  }

  private softHandleApiError(err: HttpErrorResponse): Observable<ApiError> {
    return of({ kind: 'error', message: err.message } as ApiError);
  }
}


text:
<?php
    include_once('connection.php');
    include_once('niceFunctions.php');

    session_start();

    $name = $_POST['name'];

    $stmt = $db->prepare("SELECT events.* FROM events, events_types WHERE events.id_events_types = events_types.id_events_types and events_types.name=?");
	$stmt->execute(array($_POST['name']));
	$type_events = $stmt->fetchAll();

    $stmt2 = $db->prepare("SELECT id_event FROM participations WHERE participations.username=?");
	$stmt2->execute(array($_SESSION['login_user']));
	$user_participations = $stmt2->fetchAll();

    $information = "";

    foreach($type_events as $event) {
        $found = searchSubArray($user_participations, 'id_event', $event['id_event']);

        if($found == true)
            $going = "Not Going";
        else
            $going = "Going";

        $information .= "

" . $event['name'] . "

" . $event['description'] . "

                                        <form class=\"eventForm\" method=\"post\">

                                            <input type=\"button\" name=\"going\" value=\"" . $going . "\" class=\"going\" id=\"" . $event['id_event'] . "\">
                                        </form>

" . $event['event_date'] . "

";
    }

    echo json_encode($information);
?>


text:
let {identity, intersperse, map, merge, prop, sortBy, values} = require("ramda")
let {Observable: $} = require("rx")
let {view} = require("rx-utils")
let {a, div, h1, hr} = require("@cycle/dom")

let menu = require("../chunks/menu")
let userCard = require("../chunks/user.card")

module.exports = function (src) {
  // SINKS
  return {
    DOM: $.combineLatest(
      src.navi, src.state::view("users"),
      (navi, users) => {
        console.log("render user.index")
        users = sortBy(prop("username"), values(users))
        let cards = map((user) => userCard({navi, user}), users)
        return div([
          h1("User Index"),
          menu({navi}),
          div(intersperse(hr(), cards)) // no templates – no pain
        ])
      }
    )
  }
}


text:
package com.flipkart.lyrics.sets;

import com.flipkart.lyrics.creator.TypeCreator;

/**
 * Created by shrey.garg on 12/01/17.
 */
public abstract class CreatorSet {

    public abstract TypeCreator getClassCreator();

    public abstract TypeCreator getAnnotationCreator();

    public abstract TypeCreator getEnumCreator();

    public abstract TypeCreator getEnumWithFieldsCreator();

    public abstract TypeCreator getInterfaceCreator();
}


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

<TITLE>
Uses of Package org.hibernate.tuple.component (Hibernate JavaDocs)
</TITLE>

<META NAME="date" CONTENT="2013-10-23">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Package
org.hibernate.tuple.component

Packages that use org.hibernate.tuple.component

org.hibernate.tuple.component

org.hibernate.type

        A Hibernate <tt>Type</tt> is a strategy for mapping a
        Java property type to a JDBC type or types.

Classes in org.hibernate.tuple.component used by org.hibernate.tuple.component

AbstractComponentTuplizer

          Support for tuplizers relating to components.

ComponentTuplizer

          Defines further responsibilities regarding tuplization based on
 a mapped components.

Classes in org.hibernate.tuple.component used by org.hibernate.type

ComponentMetamodel

          Centralizes metamodel information about a component.

ComponentTuplizer

          Defines further responsibilities regarding tuplization based on
 a mapped components.

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2001-2013 Red Hat, Inc.  All Rights Reserved.


text:
_[www.codever.land/bookmarks/t/regex](https://www.codever.land/bookmarks/t/regex)_
---
#### [GitHub - epoberezkin/fast-deep-equal](https://github.com/epoberezkin/fast-deep-equal)
_https://github.com/epoberezkin/fast-deep-equal_

The fastest deep equality check with Date, RegExp and ES6 Map, Set and typed arrays support - epoberezkin/fast-deep-equal
* **tags**: [javascript](../tagged/javascript.md), [ecmascript-6](../tagged/ecmascript-6.md), [regex](../tagged/regex.md), [regexp](../tagged/regexp.md)
* :octocat: **[source code](https://github.com/epoberezkin/fast-deep-equal)**
---
#### [Regular Expressions - JavaScript | MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions)
_https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions_

Regular expressions are patterns used to match character combinations in strings. In JavaScript, regular expressions are also objects. These patterns are used with the exec and test methods of RegExp,...
* **tags**: [javascript](../tagged/javascript.md), [regex](../tagged/regex.md)
---
#### [JavaScript regular expressions cheatsheet and examples ](https://dev.to/learnbyexample/javascript-regular-expressions-cheatsheet-and-examples-4jg7)
_https://dev.to/learnbyexample/javascript-regular-expressions-cheatsheet-and-examples-4jg7_

Overview of JavaScript regular expression syntax and features
* :calendar: **published on**: 2019-12-06
* **tags**: [javascript](../tagged/javascript.md), [regex](../tagged/regex.md), [cheatsheet](../tagged/cheatsheet.md)
* :octocat: **[source code](https://github.com/learnbyexample/learn_js_regexp)**
---
#### [CppVerbalExpressions](https://github.com/VerbalExpressions/CppVerbalExpressions)
_https://github.com/VerbalExpressions/CppVerbalExpressions_

C++ regular expressions made easy. [MIT]
* **tags**: [cpp](../tagged/cpp.md), [regex](../tagged/regex.md)
* :octocat: **[source code](https://github.com/VerbalExpressions/CppVerbalExpressions)**
---
#### [CTRE](https://github.com/hanickadot/compile-time-regular-expressions)
_https://github.com/hanickadot/compile-time-regular-expressions_

A Compile time PCRE (almost) compatible regular expression matcher. [MIT]
* **tags**: [cpp](../tagged/cpp.md), [regex](../tagged/regex.md)
* :octocat: **[source code](https://github.com/hanickadot/compile-time-regular-expressions)**
---
#### [Hyperscan](https://github.com/intel/hyperscan)
_https://github.com/intel/hyperscan_

Hyperscan is a high-performance multiple regex matching library by Intel. Provides simultaneous matching of large numbers of regexps (up to tens of thousands). Typically used in a DPI library stack. [...
* **tags**: [cpp](../tagged/cpp.md), [regex](../tagged/regex.md)
* :octocat: **[source code](https://github.com/intel/hyperscan)**
---
#### [Oniguruma](https://github.com/kkos/oniguruma)
_https://github.com/kkos/oniguruma_

A modern and flexible regular expressions library that supports a variety of character encodings. [BSD]
* **tags**: [cpp](../tagged/cpp.md), [regex](../tagged/regex.md)
* :octocat: **[source code](https://github.com/kkos/oniguruma)**
---
#### [PCRE](http://pcre.org/)
_http://pcre.org/_

A regular expression C library inspired by the regular expression capabilities in Perl. [BSD]
* **tags**: [cpp](../tagged/cpp.md), [regex](../tagged/regex.md)
---
#### [PIRE](https://github.com/yandex/pire)
_https://github.com/yandex/pire_

Perl Incompatible Regular Expressions library by Yandex. Can be really fast (more than 400 MB/s). [LPGL v3.0]
* **tags**: [cpp](../tagged/cpp.md), [regex](../tagged/regex.md)
* :octocat: **[source code](https://github.com/yandex/pire)**
---
#### [RE2](https://github.com/google/re2)
_https://github.com/google/re2_

A software library for regular expressions via a finite-state machine using automata theory. [BSD-3-Clause]
* **tags**: [cpp](../tagged/cpp.md), [regex](../tagged/regex.md)
* :octocat: **[source code](https://github.com/google/re2)**
---
#### [SLRE](https://github.com/cesanta/slre)
_https://github.com/cesanta/slre_

Super Light Regexp engine for C/C++. [GPLv2/Commercial]
* **tags**: [cpp](../tagged/cpp.md), [regex](../tagged/regex.md)
* :octocat: **[source code](https://github.com/cesanta/slre)**
---
#### [sregex](https://github.com/openresty/sregex)
_https://github.com/openresty/sregex_

A non-backtracking NFA/DFA-based Perl-compatible regex engine library for matching on large data streams. [BSD]
* **tags**: [cpp](../tagged/cpp.md), [regex](../tagged/regex.md)
* :octocat: **[source code](https://github.com/openresty/sregex)**
---
#### [Regexper](https://regexper.com/)
_https://regexper.com/_

Regular expression visualizer using railroad diagrams
* **tags**: [regex](../tagged/regex.md), [javascript](../tagged/javascript.md), [dev-tools](../tagged/dev-tools.md)
* :octocat: **[source code](https://github.com/javallone/regexper-static)**
---
#### [The Problem With URLs](https://blog.codinghorror.com/the-problem-with-urls/)
_https://blog.codinghorror.com/the-problem-with-urls/_

URLs are simple things. Or so you'd think. Let's say you wanted to detect an URL in a block of text and convert it into a bona fide hyperlink. No problem, right?
* :calendar: **published on**: 2008-10-29
* **tags**: [url](../tagged/url.md), [regex](../tagged/regex.md)
---
#### [Expressões Regulares - Guia de Consulta Rápida](http://aurelio.net/regex/guia/)
_http://aurelio.net/regex/guia/_

* **tags**: [free-programming-books](../tagged/free-programming-books.md), [regex](../tagged/regex.md), [free-programming-books-pt_br](../tagged/free-programming-books-pt_br.md)
---
#### [Regular Expressions - JavaScript | MDN](https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions)
_https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions_

Regular expressions are patterns used to match character combinations in strings. In JavaScript, regular expressions are also objects. These patterns are used with the `exec` and `test` methods of `Re...
* **tags**: [javascript](../tagged/javascript.md), [regex](../tagged/regex.md)
---
#### [JavaScript test() Method](https://www.w3schools.com/jsref/jsref_regexp_test.asp)
_https://www.w3schools.com/jsref/jsref_regexp_test.asp_

Search a string for the character "e":

...
* **tags**: [javascript](../tagged/javascript.md), [regex](../tagged/regex.md)
---
#### [Debuggex - JavaScript Regex Cheatsheet](https://www.debuggex.com/cheatsheet/regex/javascript)
_https://www.debuggex.com/cheatsheet/regex/javascript_

* **tags**: [regex](../tagged/regex.md), [javascript](../tagged/javascript.md)
---
#### [Lesson: Regular Expressions (The Java™ Tutorials > Essential Classes)](http://docs.oracle.com/javase/tutorial/essential/regex/index.html)
_http://docs.oracle.com/javase/tutorial/essential/regex/index.html_

This lesson explains how to use the `java.util.regex API for pattern matching with regular expressions. Although the syntax accepted by this package is similar to the [Perl](http://www.perl.com/) prog...
* **tags**: [regex](../tagged/regex.md), [java](../tagged/java.md)
---
#### [Regular Expression Tutorial - Learn How to Use Regular Expressions](http://www.regular-expressions.info/tutorial.html)
_http://www.regular-expressions.info/tutorial.html_

This tutorial teaches you all you need to know to be able to craft powerful time-saving regular expressions. It starts with the most basic concepts, so that you can follow this tutorial even if you kn...
* **tags**: [regex](../tagged/regex.md)
---
#### [Java Regex - Tutorial](http://www.vogella.com/tutorials/JavaRegularExpressions/article.html)
_http://www.vogella.com/tutorials/JavaRegularExpressions/article.html_

This tutorial introduces the usage of regular expressions and describes their implementation in Java. It also provides several Java regular expression examples.
* **tags**: [java](../tagged/java.md), [regex](../tagged/regex.md)
---


text:
package org.apache.cassandra.cql3;

import java.util.List;
import java.util.Locale;
import java.nio.ByteBuffer;

import org.apache.cassandra.cache.IMeasurableMemory;
import org.apache.cassandra.config.CFMetaData;
import org.apache.cassandra.config.ColumnDefinition;
import org.apache.cassandra.cql3.selection.Selectable;
import org.apache.cassandra.cql3.selection.Selector;
import org.apache.cassandra.cql3.selection.SimpleSelector;
import org.apache.cassandra.db.marshal.AbstractType;
import org.apache.cassandra.exceptions.InvalidRequestException;
import org.apache.cassandra.db.marshal.CompositeType;
import org.apache.cassandra.db.marshal.UTF8Type;
import org.apache.cassandra.utils.ByteBufferUtil;
import org.apache.cassandra.utils.ObjectSizes;
import org.apache.cassandra.utils.memory.AbstractAllocator;

/**
 * Represents an identifer for a CQL column definition.
 * TODO : should support light-weight mode without text representation for when not interned
 */
//表示一个列名
public class ColumnIdentifier extends org.apache.cassandra.cql3.selection.Selectable implements IMeasurableMemory
{
    public final ByteBuffer bytes; //列名字节形式
    private final String text; //列名文本形式

    private static final long EMPTY_SIZE = ObjectSizes.measure(new ColumnIdentifier("", true));

    public ColumnIdentifier(String rawText, boolean keepCase) //keepCase为true时保留原始名称,否则全转成小写
    {
        this.text = keepCase ? rawText : rawText.toLowerCase(Locale.US);
        this.bytes = ByteBufferUtil.bytes(this.text); //按UTF_8编码
    }

    public ColumnIdentifier(ByteBuffer bytes, AbstractType<?> type)
    {
        this.bytes = bytes;
        this.text = type.getString(bytes);
    }

    public ColumnIdentifier(ByteBuffer bytes, String text)
    {
        this.bytes = bytes;
        this.text = text;
    }

    @Override
    public final int hashCode()
    {
        return bytes.hashCode();
    }

    @Override
    public final boolean equals(Object o)
    {
        // Note: it's worth checking for reference equality since we intern those
        // in SparseCellNameType
        if (this == o)
            return true;

        if(!(o instanceof ColumnIdentifier))
            return false;
        ColumnIdentifier that = (ColumnIdentifier)o;
        return bytes.equals(that.bytes);
    }

    @Override
    public String toString()
    {
        return text;
    }

    public long unsharedHeapSize()
    {
        return EMPTY_SIZE
             + ObjectSizes.sizeOnHeapOf(bytes)
             + ObjectSizes.sizeOf(text);
    }

    public long unsharedHeapSizeExcludingData()
    {
        return EMPTY_SIZE
             + ObjectSizes.sizeOnHeapExcludingData(bytes)
             + ObjectSizes.sizeOf(text);
    }

    public ColumnIdentifier clone(AbstractAllocator allocator)
    {
        return new ColumnIdentifier(allocator.clone(bytes), text);
    }

    public Selector.Factory newSelectorFactory(CFMetaData cfm, List<ColumnDefinition> defs) throws InvalidRequestException
    {
        ColumnDefinition def = cfm.getColumnDefinition(this);
        if (def == null)
            throw new InvalidRequestException(String.format("Undefined name %s in selection clause", this));

        return SimpleSelector.newFactory(def.name.toString(), addAndGetIndex(def, defs), def.type);
    }

    /**
     * Because Thrift-created tables may have a non-text comparator, we cannot determine the proper 'key' until
     * we know the comparator. ColumnIdentifier.Raw is a placeholder that can be converted to a real ColumnIdentifier
     * once the comparator is known with prepare(). This should only be used with identifiers that are actual
     * column names. See CASSANDRA-8178 for more background.
     */
    public static class Raw implements Selectable.Raw
    {
        private final String rawText;
        private final String text;

        public Raw(String rawText, boolean keepCase)
        {
            this.rawText = rawText;
            this.text =  keepCase ? rawText : rawText.toLowerCase(Locale.US);
        }

        public ColumnIdentifier prepare(CFMetaData cfm)
        {
            AbstractType<?> comparator = cfm.comparator.asAbstractType();
            if (cfm.getIsDense() || comparator instanceof CompositeType || comparator instanceof UTF8Type)
                return new ColumnIdentifier(text, true);

            // We have a Thrift-created table with a non-text comparator.  We need to parse column names with the comparator
            // to get the correct ByteBuffer representation.  However, this doesn't apply to key aliases, so we need to
            // make a special check for those and treat them normally.  See CASSANDRA-8178.
            ByteBuffer bufferName = ByteBufferUtil.bytes(text);
            for (ColumnDefinition def : cfm.partitionKeyColumns())
            {
                if (def.name.bytes.equals(bufferName))
                    return new ColumnIdentifier(text, true);
            }
            return new ColumnIdentifier(comparator.fromString(rawText), text);
        }

        public boolean processesSelection()
        {
            return false;
        }

        @Override
        public final int hashCode()
        {
            return text.hashCode();
        }

        @Override
        public final boolean equals(Object o)
        {
            if(!(o instanceof ColumnIdentifier.Raw))
                return false;
            ColumnIdentifier.Raw that = (ColumnIdentifier.Raw)o;
            return text.equals(that.text);
        }

        @Override
        public String toString()
        {
            return text;
        }
    }
}


text:
#include "interface.h"

//
//  MP Protocol Interface Table
//
EFI_MP_INTERFACE MpInterface = {
	InitMpProtocol,
	DeInitMpProtocol,
	GetEnabledProcessorsInfo,
	GetNumEnabledProcessors,
	StartProcessor,
	StopProcessor,
	StartProcessorAddress
} ;


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.maps.weather.implementation.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;

/**
 * A valid `GeoJSON MultiPolygon` object type. Please refer to [RFC
 * 7946](https://tools.ietf.org/html/rfc7946#section-3.1.7) for details.
 */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonTypeName("MultiPolygon")
@Fluent
public final class GeoJsonMultiPolygon extends GeoJsonGeometry {
    /*
     * Contains a list of valid `GeoJSON Polygon` objects. **Note** that coordinates in GeoJSON are in x, y order
     * (longitude, latitude).
     */
    @JsonProperty(value = "coordinates", required = true)
    private List<List<List<List<Double>>>> coordinates;

    /** Creates an instance of GeoJsonMultiPolygon class. */
    public GeoJsonMultiPolygon() {}

    /**
     * Get the coordinates property: Contains a list of valid `GeoJSON Polygon` objects. **Note** that coordinates in
     * GeoJSON are in x, y order (longitude, latitude).
     *
     * @return the coordinates value.
     */
    public List<List<List<List<Double>>>> getCoordinates() {
        return this.coordinates;
    }

    /**
     * Set the coordinates property: Contains a list of valid `GeoJSON Polygon` objects. **Note** that coordinates in
     * GeoJSON are in x, y order (longitude, latitude).
     *
     * @param coordinates the coordinates value to set.
     * @return the GeoJsonMultiPolygon object itself.
     */
    public GeoJsonMultiPolygon setCoordinates(List<List<List<List<Double>>>> coordinates) {
        this.coordinates = coordinates;
        return this;
    }
}


text:
package com.hierynomus.asn1;

public class ASN1ParseException extends RuntimeException {
    public ASN1ParseException(String message) {
        super(message);
    }

    public ASN1ParseException(Throwable cause, String messageFormat, Object... args) {
        super(String.format(messageFormat, args), cause);
    }

    public ASN1ParseException(String messageFormat, Object... args) {
        super(String.format(messageFormat, args));
    }
}


text:
<?php

$frontend = array(

    'frontend' => array(

        'header'   => array(

            array( 'type' => 'open' ),

            array(
                'name' => __( 'Frontend Settings', 'yith-woocommerce-ajax-navigation' ),
                'type' => 'title'
            ),

            array( 'type' => 'close' )
        ),

        'settings' => array(

            array( 'type' => 'open' ),

            array(
                'id'   => 'yith_wcan_frontend_description',
                'name' => _x( 'How To:', 'Admin panel: option description', 'yith-woocommerce-ajax-navigation' ),
                'type' => 'wcan_description',
                'desc' => _x( "If your theme use the WooCommerce standard templates, you don't need to change the following values.
                                Otherwise, add the classes used in the template of your theme.
                                If you don't know them, please contact the developer of your theme to receive the correct classes.", 'Admin: Panel section description', 'yith-woocommerce-ajax-navigation' ),
            ),

            array(
                'name' => __( 'Product Container', 'yith-woocommerce-ajax-navigation' ),
                'desc' => __( 'Put here the CSS class or id for the product container', 'yith-woocommerce-ajax-navigation' ) . ' (Default: .products)',
                'id'   => 'yith_wcan_ajax_shop_container',
                'type' => 'text',
                'std'  => '.products'
            ),

            array(
                'name' => __( 'Shop Pagination Container', 'yith-woocommerce-ajax-navigation' ),
                'desc' => __( 'Put here the CSS class or id for the shop pagination container', 'yith-woocommerce-ajax-navigation' ) . ' (Default: nav.woocommerce-pagination)',
                'id'   => 'yith_wcan_ajax_shop_pagination',
                'type' => 'text',
                'std'  => 'nav.woocommerce-pagination'
            ),

            array(
                'name' => __( 'Result Count Container', 'yith-woocommerce-ajax-navigation' ),
                'desc' => __( 'Put here the CSS class or id for the result count container', 'yith-woocommerce-ajax-navigation' ) . ' (Default: .woocommerce-result-count)',
                'id'   => 'yith_wcan_ajax_shop_result_container',
                'type' => 'text',
                'std'  => '.woocommerce-result-count'
            ),

            array(
                'name' => __( 'Scroll top anchor', 'yith-woocommerce-ajax-navigation' ),
                'desc' => __( 'Put here the HTML tag for the scroll top in mobile', 'yith-woocommerce-ajax-navigation' ) . ' (Default: .yit-wcan-container)',
                'id'   => 'yith_wcan_ajax_scroll_top_class',
                'type' => 'text',
                'std'  => '.yit-wcan-container'
            ),

            array( 'type' => 'close' ),
        ),
    )
);

return apply_filters( 'yith_wcan_panel_frontend_options', $frontend );


text:
<title>i960-Chars - Using as</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Using as">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Syntax-of-i960.html#Syntax-of-i960" title="Syntax of i960">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">

<meta http-equiv="Content-Style-Type" content="text/css">

Up: Syntax of i960

9.17.5.1 Special Characters

The presence of a ‘<samp>#</samp>’ on a line indicates the start of a comment
that extends to the end of the current line.

If a ‘<samp>#</samp>’ appears as the first character of a line, the whole line
is treated as a comment, but in this case the line can also be a
logical line number directive (see Comments) or a
preprocessor control command (see Preprocessing).

The ‘<samp>;</samp>’ character can be used to separate statements on the same
line.