text:
blog

social

résumé

contact

links

redpajama_set_name: RedPajamaGithub


text:
<?php
/*!
* HybridAuth
* http://hybridauth.sourceforge.net | https://github.com/hybridauth/hybridauth
*  (c) 2009-2011 HybridAuth authors | hybridauth.sourceforge.net/licenses.html
*/

/**
 * HybridAuth storage manager
 */
class Hybrid_Storage
{
	function __construct()
	{
		if( ! session_id() ){
			throw new Exception( "Hybriauth require the use of 'session_start()' at the start of your script", 1 );
		}
	}

	public function get($key, $expiration = false)
	{
		$key = strtolower( $key );

		if( isset( $_SESSION["HA::STORE"][$key] ) ){
			return unserialize( $_SESSION["HA::STORE"][$key] );
		}

		return NULL;
	}

	public function set( $key, $value )
	{
		$key = strtolower( $key );

		$_SESSION["HA::STORE"][$key] = serialize( $value );
	}

	function clear()
	{
		$_SESSION["HA::STORE"] = ARRAY();
	}

	function delete($key)
	{
		$key = strtolower( $key );

		if( isset( $_SESSION["HA::STORE"][$key] ) ){
			unset( $_SESSION["HA::STORE"][$key] );
		}
	}

	function deleteMatch($key)
	{
		$key = strtolower( $key );

		if( isset( $_SESSION["HA::STORE"] ) && count( $_SESSION["HA::STORE"] ) ) {
			foreach( $_SESSION["HA::STORE"] as $k => $v ){
				if( strstr( $k, $key ) ){
					unset( $_SESSION["HA::STORE"][ $k ] );
				}
			}
		}
	}

	function getSessionData()
	{
		return serialize( isset($_SESSION["HA::STORE"]) ? $_SESSION["HA::STORE"] : null );
	}

	function restoreSessionData( $sessiondata = NULL )
	{
		$_SESSION["HA::STORE"] = unserialize( $sessiondata );
	}
}


text:
namespace safe_browsing {

namespace {

DownloadRequestMaker::TabUrls TabUrlsFromWebContents(
    content::WebContents* web_contents) {
  DownloadRequestMaker::TabUrls result;
  if (web_contents) {
    content::NavigationEntry* entry =
        web_contents->GetController().GetVisibleEntry();
    if (entry) {
      result.url = entry->GetURL();
      result.referrer = entry->GetReferrer().url;
    }
  }
  return result;
}

}  // namespace

// static
std::unique_ptr<DownloadRequestMaker>
DownloadRequestMaker::CreateFromDownloadItem(
    scoped_refptr<BinaryFeatureExtractor> binary_feature_extractor,
    download::DownloadItem* item) {
  std::vector<ClientDownloadRequest::Resource> resources;
  for (size_t i = 0; i < item->GetUrlChain().size(); ++i) {
    ClientDownloadRequest::Resource resource;
    resource.set_url(ShortURLForReporting(item->GetUrlChain()[i]));
    if (i == item->GetUrlChain().size() - 1) {
      // The last URL in the chain is the download URL.
      resource.set_type(ClientDownloadRequest::DOWNLOAD_URL);
      resource.set_referrer(ShortURLForReporting(item->GetReferrerUrl()));
      DVLOG(2) << "dl url " << resource.url();
      if (!item->GetRemoteAddress().empty()) {
        resource.set_remote_ip(item->GetRemoteAddress());
        DVLOG(2) << "  dl url remote addr: " << resource.remote_ip();
      }
      DVLOG(2) << "dl referrer " << resource.referrer();
    } else {
      DVLOG(2) << "dl redirect " << i << " " << resource.url();
      resource.set_type(ClientDownloadRequest::DOWNLOAD_REDIRECT);
    }

    resources.push_back(std::move(resource));
  }

  return std::make_unique<DownloadRequestMaker>(
      binary_feature_extractor,
      content::DownloadItemUtils::GetBrowserContext(item),
      TabUrls{item->GetTabUrl(), item->GetTabReferrerUrl()},
      item->GetTargetFilePath(), item->GetFullPath(), item->GetURL(),
      item->GetHash(), item->GetReceivedBytes(), resources,
      item->HasUserGesture(),
      static_cast<ReferrerChainData*>(
          item->GetUserData(ReferrerChainData::kDownloadReferrerChainDataKey)));
}

// static
std::unique_ptr<DownloadRequestMaker>
DownloadRequestMaker::CreateFromFileSystemAccess(
    scoped_refptr<BinaryFeatureExtractor> binary_feature_extractor,
    DownloadProtectionService* service,
    const content::FileSystemAccessWriteItem& item) {
  ClientDownloadRequest::Resource resource;
  resource.set_url(
      ShortURLForReporting(GetFileSystemAccessDownloadUrl(item.frame_url)));
  resource.set_type(ClientDownloadRequest::DOWNLOAD_URL);
  if (item.frame_url.is_valid())
    resource.set_referrer(ShortURLForReporting(item.frame_url));

  std::unique_ptr<ReferrerChainData> referrer_chain_data;
  if (service)
    service->IdentifyReferrerChain(item);

  return std::make_unique<DownloadRequestMaker>(
      binary_feature_extractor, item.browser_context,
      TabUrlsFromWebContents(item.web_contents), item.target_file_path,
      item.full_path, GetFileSystemAccessDownloadUrl(item.frame_url),
      item.sha256_hash, item.size,
      std::vector<ClientDownloadRequest::Resource>{resource},
      item.has_user_gesture, referrer_chain_data.get());
}

DownloadRequestMaker::DownloadRequestMaker(
    scoped_refptr<BinaryFeatureExtractor> binary_feature_extractor,
    content::BrowserContext* browser_context,
    TabUrls tab_urls,
    base::FilePath target_file_path,
    base::FilePath full_path,
    GURL source_url,
    std::string sha256_hash,
    int64_t length,
    const std::vector<ClientDownloadRequest::Resource>& resources,
    bool is_user_initiated,
    ReferrerChainData* referrer_chain_data)
    : browser_context_(browser_context),
      request_(std::make_unique<ClientDownloadRequest>()),
      binary_feature_extractor_(binary_feature_extractor),
      tab_urls_(tab_urls),
      target_file_path_(target_file_path),
      full_path_(full_path) {
  request_->set_url(ShortURLForReporting(source_url));
  request_->mutable_digests()->set_sha256(sha256_hash);
  request_->set_length(length);
  for (const ClientDownloadRequest::Resource& resource : resources) {
    *request_->add_resources() = resource;
  }

  request_->set_user_initiated(is_user_initiated);

  if (referrer_chain_data &&
      !referrer_chain_data->GetReferrerChain()->empty()) {
    request_->mutable_referrer_chain()->Swap(
        referrer_chain_data->GetReferrerChain());
    request_->mutable_referrer_chain_options()
        ->set_recent_navigations_to_collect(
            referrer_chain_data->recent_navigations_to_collect());
  }
}

DownloadRequestMaker::~DownloadRequestMaker() = default;

void DownloadRequestMaker::Start(DownloadRequestMaker::Callback callback) {
  callback_ = std::move(callback);

  Profile* profile = Profile::FromBrowserContext(browser_context_);
  bool is_under_advanced_protection =
      profile && AdvancedProtectionStatusManagerFactory::GetForProfile(profile)
                     ->IsUnderAdvancedProtection();

  *request_->mutable_population() = GetUserPopulationForProfile(profile);
  request_->set_request_ap_verdicts(is_under_advanced_protection);
  request_->set_locale(g_browser_process->GetApplicationLocale());
  request_->set_file_basename(target_file_path_.BaseName().AsUTF8Unsafe());

  file_analyzer_->Start(
      target_file_path_, full_path_,
      base::BindOnce(&DownloadRequestMaker::OnFileFeatureExtractionDone,
                     weakptr_factory_.GetWeakPtr()));
}

void DownloadRequestMaker::OnFileFeatureExtractionDone(
    FileAnalyzer::Results results) {
  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);

  request_->set_download_type(results.type);
  if (results.archive_is_valid != FileAnalyzer::ArchiveValid::UNSET)
    request_->set_archive_valid(results.archive_is_valid ==
                                FileAnalyzer::ArchiveValid::VALID);
  request_->mutable_archived_binary()->CopyFrom(results.archived_binaries);
  request_->mutable_signature()->CopyFrom(results.signature_info);
  request_->mutable_image_headers()->CopyFrom(results.image_headers);
  request_->set_archive_file_count(results.file_count);
  request_->set_archive_directory_count(results.directory_count);
  request_->mutable_document_summary()->CopyFrom(results.document_summary);

#if BUILDFLAG(IS_MAC)
  if (!results.disk_image_signature.empty()) {
    request_->set_udif_code_signature(results.disk_image_signature.data(),
                                      results.disk_image_signature.size());
  }
  if (!results.detached_code_signatures.empty()) {
    request_->mutable_detached_code_signature()->CopyFrom(
        results.detached_code_signatures);
  }
#endif

  GetTabRedirects();
}

void DownloadRequestMaker::GetTabRedirects() {
  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
  if (!tab_urls_.url.is_valid()) {
    OnGotTabRedirects({});
    return;
  }

  Profile* profile = Profile::FromBrowserContext(browser_context_);
  if (!profile) {
    OnGotTabRedirects({});
    return;
  }

  history::HistoryService* history = HistoryServiceFactory::GetForProfile(
      profile, ServiceAccessType::EXPLICIT_ACCESS);
  if (!history) {
    OnGotTabRedirects({});
    return;
  }

  history->QueryRedirectsTo(
      tab_urls_.url,
      base::BindOnce(&DownloadRequestMaker::OnGotTabRedirects,
                     weakptr_factory_.GetWeakPtr()),
      &request_tracker_);
}

void DownloadRequestMaker::OnGotTabRedirects(
    history::RedirectList redirect_list) {
  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);

  for (size_t i = 0; i < redirect_list.size(); ++i) {
    ClientDownloadRequest::Resource* resource = request_->add_resources();
    DVLOG(2) << "tab redirect " << i << " " << redirect_list[i].spec();
    resource->set_url(ShortURLForReporting(redirect_list[i]));
    resource->set_type(ClientDownloadRequest::TAB_REDIRECT);
  }
  if (tab_urls_.url.is_valid()) {
    ClientDownloadRequest::Resource* resource = request_->add_resources();
    resource->set_url(ShortURLForReporting(tab_urls_.url));
    DVLOG(2) << "tab url " << resource->url();
    resource->set_type(ClientDownloadRequest::TAB_URL);
    if (tab_urls_.referrer.is_valid()) {
      resource->set_referrer(ShortURLForReporting(tab_urls_.referrer));
      DVLOG(2) << "tab referrer " << resource->referrer();
    }
  }

  std::move(callback_).Run(std::move(request_));
}

}  // namespace safe_browsing


text:
psql basketball -f ncaa_sos/normalize_factors.sql
psql basketball -f ncaa_sos/schedule_factors.sql

psql basketball -f ncaa_sos/connectivity.sql > ncaa_sos/connectivity.txt
psql basketball -f ncaa_sos/current_ranking.sql > ncaa_sos/current_ranking.txt
psql basketball -f ncaa_sos/division_ranking.sql > ncaa_sos/division_ranking.txt

psql basketball -f ncaa_sos/test_predictions.sql > ncaa_sos/test_predictions.txt

psql basketball -f ncaa_sos/predict_daily.sql > ncaa_sos/predict_daily.txt


text:
package restclient

import (
	"github.com/diffeo/go-coordinate/coordinate"
	"github.com/diffeo/go-coordinate/restdata"
	"net/url"
	"time"
)

type attempt struct {
	resource
	Representation restdata.Attempt
	workUnit       *workUnit
	worker         *worker
}

func attemptFromURL(parent *resource, path string, workUnit *workUnit, worker *worker) (a *attempt, err error) {
	a = &attempt{}
	a.URL, err = parent.Template(path, map[string]interface{}{})
	if err == nil {
		err = a.Refresh()
	}
	if err == nil {
		err = a.fillReferences(workUnit, worker)
	}
	if err == nil {
		return a, nil
	}
	return nil, err
}

func (a *attempt) fillReferences(workUnit *workUnit, worker *worker) error {
	var err error
	var url *url.URL

	if err == nil {
		url, err = a.Template(a.Representation.WorkUnitURL, map[string]interface{}{})
	}
	if err == nil && workUnit != nil && workUnit.URL.String() == url.String() {
		a.workUnit = workUnit
	}
	if err == nil && a.workUnit == nil {
		a.workUnit, err = workUnitFromURL(&a.resource, a.Representation.WorkUnitURL, nil)
	}

	if err == nil {
		url, err = a.Template(a.Representation.WorkerURL, map[string]interface{}{})
	}
	if err == nil && worker != nil && worker.URL.String() == url.String() {
		a.worker = worker
	}
	if err == nil && a.worker == nil {
		a.worker, err = workerFromURL(&a.resource, a.Representation.WorkerURL)
	}

	return err
}

func (a *attempt) Refresh() error {
	a.Representation = restdata.Attempt{}
	return a.Get(&a.Representation)
}

func (a *attempt) WorkUnit() coordinate.WorkUnit {
	return a.workUnit
}

func (a *attempt) Worker() coordinate.Worker {
	return a.worker
}

func (a *attempt) Status() (coordinate.AttemptStatus, error) {
	err := a.Refresh()
	if err == nil {
		return a.Representation.Status, nil
	}
	return 0, err
}

func (a *attempt) Data() (map[string]interface{}, error) {
	err := a.Refresh()
	if err == nil {
		return a.Representation.Data, nil
	}
	return nil, err
}

func (a *attempt) StartTime() (time.Time, error) {
	return a.Representation.StartTime, nil
}

func (a *attempt) EndTime() (time.Time, error) {
	err := a.Refresh()
	if err == nil {
		return a.Representation.EndTime, nil
	}
	return time.Time{}, err
}

func (a *attempt) ExpirationTime() (time.Time, error) {
	err := a.Refresh()
	if err == nil {
		return a.Representation.ExpirationTime, nil
	}
	return time.Time{}, err
}

func (a *attempt) Renew(extendDuration time.Duration, data map[string]interface{}) error {
	repr := restdata.AttemptCompletion{
		ExtendDuration: extendDuration,
		Data:           data,
	}
	return a.PostTo(a.Representation.RenewURL, map[string]interface{}{}, repr, nil)
}

func (a *attempt) Expire(data map[string]interface{}) error {
	repr := restdata.AttemptCompletion{Data: data}
	return a.PostTo(a.Representation.ExpireURL, map[string]interface{}{}, repr, nil)
}

func (a *attempt) Finish(data map[string]interface{}) error {
	repr := restdata.AttemptCompletion{Data: data}
	return a.PostTo(a.Representation.FinishURL, map[string]interface{}{}, repr, nil)
}

func (a *attempt) Fail(data map[string]interface{}) error {
	repr := restdata.AttemptCompletion{Data: data}
	return a.PostTo(a.Representation.FailURL, map[string]interface{}{}, repr, nil)
}

func (a *attempt) Retry(data map[string]interface{}, delay time.Duration) error {
	repr := restdata.AttemptCompletion{Data: data, Delay: delay}
	return a.PostTo(a.Representation.RetryURL, map[string]interface{}{}, repr, nil)
}


text:
package org.elasticsearch.xpack.core.security.action.enrollment;

import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.xcontent.ParseField;
import org.elasticsearch.xcontent.ToXContent;
import org.elasticsearch.xcontent.ToXContentObject;
import org.elasticsearch.xcontent.XContentBuilder;

import java.io.IOException;
import java.util.List;
import java.util.Objects;

public final class NodeEnrollmentResponse extends ActionResponse implements ToXContentObject {

    private static final ParseField HTTP_CA_KEY = new ParseField("http_ca_key");
    private static final ParseField HTTP_CA_CERT = new ParseField("http_ca_cert");
    private static final ParseField TRANSPORT_KEY = new ParseField("transport_key");
    private static final ParseField TRANSPORT_CERT = new ParseField("transport_cert");
    private static final ParseField TRANSPORT_CA_CERT = new ParseField("transport_ca_cert");
    private static final ParseField NODES_ADDRESSES = new ParseField("nodes_addresses");

    private final String httpCaKey;
    private final String httpCaCert;
    private final String transportCaCert;
    private final String transportKey;
    private final String transportCert;
    private final List<String> nodesAddresses;

    public NodeEnrollmentResponse(StreamInput in) throws IOException {
        super(in);
        httpCaKey = in.readString();
        httpCaCert = in.readString();
        transportCaCert = in.readString();
        transportKey = in.readString();
        transportCert = in.readString();
        nodesAddresses = in.readStringList();
    }

    public NodeEnrollmentResponse(
        String httpCaKey,
        String httpCaCert,
        String transportCaCert,
        String transportKey,
        String transportCert,
        List<String> nodesAddresses
    ) {
        this.httpCaKey = httpCaKey;
        this.httpCaCert = httpCaCert;
        this.transportCaCert = transportCaCert;
        this.transportKey = transportKey;
        this.transportCert = transportCert;
        this.nodesAddresses = nodesAddresses;
    }

    public String getHttpCaKey() {
        return httpCaKey;
    }

    public String getHttpCaCert() {
        return httpCaCert;
    }

    public String getTransportCaCert() {
        return transportCaCert;
    }

    public String getTransportKey() {
        return transportKey;
    }

    public String getTransportCert() {
        return transportCert;
    }

    public List<String> getNodesAddresses() {
        return nodesAddresses;
    }

    @Override
    public void writeTo(StreamOutput out) throws IOException {
        out.writeString(httpCaKey);
        out.writeString(httpCaCert);
        out.writeString(transportCaCert);
        out.writeString(transportKey);
        out.writeString(transportCert);
        out.writeStringCollection(nodesAddresses);
    }

    @Override
    public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException {
        builder.startObject();
        builder.field(HTTP_CA_KEY.getPreferredName(), httpCaKey);
        builder.field(HTTP_CA_CERT.getPreferredName(), httpCaCert);
        builder.field(TRANSPORT_CA_CERT.getPreferredName(), transportCaCert);
        builder.field(TRANSPORT_KEY.getPreferredName(), transportKey);
        builder.field(TRANSPORT_CERT.getPreferredName(), transportCert);
        builder.field(NODES_ADDRESSES.getPreferredName(), nodesAddresses);
        return builder.endObject();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        NodeEnrollmentResponse that = (NodeEnrollmentResponse) o;
        return httpCaKey.equals(that.httpCaKey)
            && httpCaCert.equals(that.httpCaCert)
            && transportCaCert.equals(that.transportCaCert)
            && transportKey.equals(that.transportKey)
            && transportCert.equals(that.transportCert)
            && nodesAddresses.equals(that.nodesAddresses);
    }

    @Override
    public int hashCode() {
        return Objects.hash(httpCaKey, httpCaCert, transportCaCert, transportKey, transportCert, nodesAddresses);
    }
}


text: search_result['4103']=["topic_00000000000009D4_props--.html","LoginResponseDto Properties",""];


text:
These settings apply only when `--azureresourceschema` is specified on the command line.

### AzureResourceSchema multi-api

``` yaml $(azureresourceschema) && $(multiapi)
batch:
  - tag: schema-windowsesu-2019-09-16-preview

```

Please also specify `--azureresourceschema-folder=<path to the root directory of your azure-resource-manager-schemas clone>`.

### Tag: schema-windowsesu-2019-09-16-preview and azureresourceschema

``` yaml $(tag) == 'schema-windowsesu-2019-09-16-preview' && $(azureresourceschema)
output-folder: $(azureresourceschema-folder)/schemas

# all the input files in this apiVersion
input-file:
  - Microsoft.WindowsESU/preview/2019-09-16-preview/windowsesu.json

```


text:
define('utils/title-selector',['require','backbone','utils/common','utils/pubsub','utils/title-list'],function(require) {
  var Backbone = require('backbone'),
      Common = require('utils/common'),
      PubSub = require('utils/pubsub'),
      TitleList = require('utils/title-list')
      ;

  var TitleSelector = Backbone.View.extend({
    el: '#pageTitle',

    events: {},

    height: 0,

    initialize: function(opts) {
      this.listenTo(PubSub, 'windowsize:global:exit', this.setHeight);
      this.listenTo(PubSub, 'windowsize:global:enter', this.setHeight);

      var title_options = _.extend({}, opts, {el: this.$('#pageSelector')});
      this.multicol = new TitleList(title_options);

      this.listenTo(this.multicol, 'list:open', this.triggerOpen);
      this.listenTo(this.multicol, 'list:close', this.triggerClose);
    },

    render: function() {
      this.setHeight();
    },

    onDispose: function() {

    },

    setHeight: function() {
      this.height = this.$el.outerHeight();
    },

    setNav: function(nav) {
      this.multicol.setNav(nav);
    },

    triggerOpen: function() {
      this.trigger('list:open');
    },

    triggerClose: function() {
      this.trigger('list:close');
    }
  });

  return TitleSelector;
});


text:
<?xml version="1.0"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee"
	   xmlns:weld="http://jboss.org/schema/weld/beans"
	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://docs.jboss.org/cdi/beans_1_0.xsd http://jboss.org/schema/weld/beans http://jboss.org/schema/weld/beans_1_1.xsd">
	<weld:scan>
        <weld:exclude name="" />
	</weld:scan>
</beans>


text:
README
------------------------------------------------------------------------------------------------------------

X-Mem: A Cross-Platform and Extensible Memory Characterization Tool for the Cloud v2.4.2
------------------------------------------------------------------------------------------------------------

X-Mem is a flexible open-source research tool for characterizing memory hierarchy throughput, latency, power, and more. The tool was developed jointly by Microsoft and the UCLA NanoCAD Lab. This project was started by Mark Gottscho (Email: mgottscho@ucla.edu) as a Summer 2014 PhD intern at Microsoft Research. X-Mem is released freely and open-source under the MIT License. The project is under active development.

PROJECT REVISION DATE: April 29, 2016

------------------------------------------------------------------------------------------------------------
RESEARCH PAPER & ATTRIBUTION
------------------------------------------------------------------------------------------------------------

We have a research tool paper describing the motivation, design, and implementation of X-Mem, as well as three experimental case studies using tools to deliver insights useful to both cloud providers and subscribers. If you use our tool and publish or otherwise publicly report results, we ask that you please cite the following paper as well as provide a link to our tool homepage (<https://nanocad-lab.github.io/X-Mem>).

Download the pre-print of our paper here: <http://nanocad.ee.ucla.edu/pub/Main/Publications/C91_paper.pdf>.

Citation:

Mark Gottscho, Sriram Govindan, Bikash Sharma, Mohammed Shoaib, and Puneet Gupta. X-Mem: A Cross-Platform and Extensible Memory Characterization Tool for the Cloud. In Proceedings of the IEEE International Symposium on Performance Analysis of Systems and Software (ISPASS). Uppsala, Sweden, April 17-19, 2016.

BiBTeX:

@inproceedings{GottschoISPASS2016,
    author = {Gottscho, Mark and Govindan, Sriram and Sharma, Bikash and Shoaib, Mohammed and Gupta, Puneet},
    booktitle = {Proceedings of the IEEE International Symposium on Performance Analysis of Systems and Software (ISPASS)},
    title = {{X-Mem}: A Cross-Platform and Extensible Memory Characterization Tool for the Cloud},
    month = {April},
    year = {2016}
}

------------------------------------------------------------------------------------------------------------
VERSION CONTROL AND OBTAINING SOURCE CODE
------------------------------------------------------------------------------------------------------------

This project is under version control using git. Its master repository is hosted at <https://github.com/Microsoft/X-Mem.git>. There is also another mirrored fork at <https://github.com/nanocad-lab/X-Mem.git>.

------------------------------------------------------------------------------------------------------------
OBTAINING PRE-BUILT BINARIES
------------------------------------------------------------------------------------------------------------

If you don't want to build X-Mem from source, you can get regular releases of pre-built binaries for Windows and GNU/Linux from the project homepage, located at <https://nanocad-lab.github.io/X-Mem>.

------------------------------------------------------------------------------------------------------------
LICENSE
------------------------------------------------------------------------------------------------------------

The MIT License (MIT)

Copyright (c) 2014 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

------------------------------------------------------------------------------------------------------------
DESIGN PHILOSOPHY
------------------------------------------------------------------------------------------------------------

Previous memory benchmarking tools such as STREAM/STREAM2, lmbench3, and mlc all had various shortcomings that made them inadequate for emerging needs in the cloud. In particular, cloud systems present four key challenges that we addressed with X-Mem. Please refer to our ISPASS'16 paper above for more information.

------------------------------------------------------------------------------------------------------------
FEATURES
------------------------------------------------------------------------------------------------------------

This tool is provided as open source with the hope of being useful to the broader research and development community. Here is a non-exhaustive list of X-Mem's features.

Flexibility: Easy reconfiguration for different combinations of tests.
- Working sets in increments of 4KB, allowing cache up to main memory-level benchmarking.
- NUMA support.
- Multi-threading support.
- Large page support.

Extensibility: Modularity via C++11 object-oriented principles.
- Supports rapid addition of new benchmark kernel routines.
- Example: stream triad algorithm, impact of false sharing, etc. are possible with minor changes.

Cross-platform: Currently implemented for two OSes and architecture families.
- GNU/Linux: Intel x86 (32-bit), x86-64, and x86-64 with AVX extensions, ARM (32-bit), ARM (32-bit) with NEON, ARMv8 (64-bit), Xeon Phi (Intel mic, Knights Corner). Tested specifically with Ubuntu 12.04, 14.04, and CentOS 7.
- Windows: Intel x86 (32-bit), x86-64, and x86-64 with AVX extensions. Tested specifically with Windows 8.1 and Server 2012 R2.
- ARM on Windows can compile using VC++, but cannot link due to a lack of library support for desktop/command-line ARM apps. This may be resolved in the future.
- Designed to allow straightforward porting to other operating systems and ISAs.

Memory throughput:
- Accurate measurement of sustained memory throughput to all levels of cache and memory.
- Regular access patterns: forward & reverse sequential as well as strides of 2, 4, 8, and 16 words.
- Random access patterns.
- Read and write.
- 32, 64, 128, 256, 512-bit width memory instructions where applicable on each architecture.

Memory latency:
- Accurate measurement of round-trip memory latency to all levels of cache and memory.
- Loaded and unloaded latency via use of multithreaded load generation.

Memory power:
- Support custom power instrumentation through a simple interface that end-users can implement.
- Can collect DRAM power via custom driver exposed in Windows performance counter API.

Documentation:
- Extensive Doxygen source code comments, PDF manual, HTML.

INCLUDED EXTENSIONS (under src/include/ext and src/ext directories):
- Loaded latency benchmark variant with load delays inserted as nop instructions between memory instructions.
	- This is done for 32, 64, 128, 256, 512-bit load chunk sizes where applicable using the forward sequential read pattern.
- Other extensions may be released in the future. If you have a development request, or would like to mainstream your own extension, let us know!

Feel free to contact us for any other feature requests.

------------------------------------------------------------------------------------------------------------
RUNTIME PREREQUISITES
------------------------------------------------------------------------------------------------------------

There are a few runtime prerequisites in order for the software to run correctly.

HARDWARE:

- Intel x86, x86-64, x86-64+AVX, or MIC (Xeon Phi/Knights Corner) CPU. AMD CPUs that are compatible with Intel Architecture ISAs should also work fine.
- ARM Cortex-A series processors with VFP and NEON extensions. Specifically tested on ARM Cortex A9 (32-bit) which is ARMv7. 64-bit builds for ARMv8-A should also work but have not been tested. GNU/Linux builds only. ARM on Windows can compile using VC++, but cannot link due to a lack of library support for desktop/command-line ARM apps. This may be resolved in the future. If you can get this working, let us know!

WINDOWS:

- Microsoft Windows 8.1 64-bit or later, Server 2012 R2 or later.
- Microsoft Visual C++ 2013 Redistributables (32-bit) -- for x86 (32-bit) builds
- Microsoft Visual C++ 2013 Redistributables (64-bit) -- for x86-64 and x86-64 with AVX builds
- You MAY need Administrator privileges, in order to:
    - Use large pages, if the --large_pages option is selected (see USAGE, below)
    - The first time you use --large_pages on a given Windows machine, you may need to ensure that your Windows user account has the necessary rights to allow lockable memory pages. To do this on Windows 8, run gpedit.msc --> Local Computer Policy --> Computer Configuration --> Windows Settings --> Security Settings --> Local Policies --> User Rights Assignment --> Add your username to "Lock pages in memory". Then log out and then log back in.
    - Use the PowerReader interface, depending on end-user implementation
    - Elevate thread priority and pin threads to logical CPUs for improved performance and benchmarking consistency

GNU/LINUX:

- GNU utilities with support for C++11. Tested with gcc 4.8.2 on Ubuntu 14.04 LTS for x86 (32-bit), x86-64, x86-64+AVX, and MIC on Intel Sandy Bridge, Ivy Bridge, Haswell, and Knights Corner families.
- libhugetlbfs. You can obtain it at <https://github.com/libhugetlbfs/libhugetlbfs>. On Ubuntu systems, you can install using "sudo apt-get install libhugetlbfs0". If you don't have this or cannot install it, this should be fine but you will not be able to use large pages. Note that this package requires Linux kernel 2.6.16 or later. This should not be an issue on most modern Linux systems.
- Potentially, administrator privileges, if you plan to use the --large_pages option.
    - During runtime, if the --large_pages option is selected, you may need to first manually ensure that large pages are available from the OS. This can be done by running "hugeadm --pool-list". It is recommended to set minimum pool to 1GB (in order to measure DRAM effectively). If needed, this can be done by running "hugeadm --pool-pages-min 2MB:512". Alternatively, run the linux_setup_runtime_hugetlbfs.sh script that is provided with X-Mem.

------------------------------------------------------------------------------------------------------------
INSTALLATION
------------------------------------------------------------------------------------------------------------

The only file that is needed to run on Windows is the respective executable xmem-win-<ARCH>.exe on Windows, and xmem-linux-<ARCH> on GNU/Linux. It has no other dependencies aside from the pre-installed system prerequisites listed above.

------------------------------------------------------------------------------------------------------------
USAGE
------------------------------------------------------------------------------------------------------------

To get help using the tool, simply run it with the "-h" or "--help" option. It includes a list of all available options and provides usage examples.

------------------------------------------------------------------------------------------------------------
BUILDING FROM SOURCE
------------------------------------------------------------------------------------------------------------

After you have set the desired compile-time options, build the source. On Windows, running build-win.bat should suffice. On GNU/Linux, run build-linux.sh. Each takes a single argument specifying the target architecture.

If you customize your build, make sure you use the "Release" mode for your OS/compiler. Do not include debug capabilities as it can dramatically affect performance of the benchmarks, leading to pessimistic results.

------------------------------------------------------------------------------------------------------------
BUILD PREREQUISITES
------------------------------------------------------------------------------------------------------------

There are a few software build prerequisites, depending on your platform.

WINDOWS:

- Any version of Visual Studio 2013 64-bit (version 12.0) on Windows 8.1 or 2015 (version 14.0) on Windows 10.
- Python 2.7. You can obtain it at <http://www.python.org>.
- SCons build system. You can obtain it at <http://www.scons.org>. Build tested with SCons 2.3.4.

GNU/LINUX:

- bash shell. Other shells will probably work but are untested.
- gcc with support for the C++11 standard. Tested with gcc version 4.8.2 on Ubuntu 14.04 LTS for x86 (32-bit), x86-64, x86-64 with AVX builds. To compile for Intel Xeon Phi/MIC/Knights Corner, we recommend the use of Intel's compiler (icc) instead of gcc.
- gcc cross-compiler for ARM targets (assumed build on x86-64 Ubuntu host).
- Python 2.7. You can obtain it at <http://www.python.org>. On Ubuntu systems, you can install using "sudo apt-get install python2.7". You may need some other Python 2.7 packages as well.
- SCons build system. You can obtain it at <http://www.scons.org>. On Ubuntu systems, you can install using "sudo apt-get install scons". Build tested with SCons 2.3.4.
- Kernel support for large (huge) pages. This support can be verified on your Linux installation by running "grep hugetlbfs /proc/filesystems". If you do not have huge page support in your kernel, you can build a kernel with the appropriate options switched on: "CONFIG_HUGETLB_PAGE" and "CONFIG_HUGETLBFS".
- libhugetlbfs. This is used for allocating large (huge) pages if the --large_pages runtime option is selected. You can obtain it at <https://github.com/libhugetlbfs/libhugetlbfs>. On Ubuntu systems, you can install using "sudo apt-get install libhugetlbfs-dev".

------------------------------------------------------------------------------------------------------------
DOCUMENTATION BUILD PREREQUISITES
------------------------------------------------------------------------------------------------------------

The following tools are only needed for automatically regenerating source code documentation with HTML and PDF.

WINDOWS:

- doxygen tool. You can obtain it at <http://www.stack.nl/~dimitri/doxygen>.
- LaTeX distribution. You can get a Windows distribution at <http://www.miktex.org>.
- make for Windows. You can obtain it at <http://gnuwin32.sourceforge.net/packages/make.htm>. You will have to manually add it to your Windows path.

GNU/LINUX:

- doxygen tool. You can obtain it at <http://www.stack.nl/~dimitri/doxygen>. On Ubuntu systems, you can install with "sudo apt-get install doxygen".
- LaTeX distribution. On Ubuntu systems, LaTeX distributed with doxygen should actually be sufficient. You can install with "sudo apt-get install doxygen-latex".
- make. This should be included on any GNU/Linux system.

------------------------------------------------------------------------------------------------------------
SOURCE CODE DOCUMENTATION
------------------------------------------------------------------------------------------------------------

The tool comes with built-in Doxygen comments in the source code, which can be used to generate both HTML and LaTeX --> PDF documentation. Documentation is maintained under the doc/ subdirectory. To build documentation after modifying the source, run build-docs-win.bat on Windows, or build-docs-linux.sh on GNU/Linux systems. Note that Doxygen and a LaTeX distribution must be installed on the system.

------------------------------------------------------------------------------------------------------------
BUILDING AND RUNNING IN CONTAINERS USING DOCKER
------------------------------------------------------------------------------------------------------------

We have two Docker repositories to make it much easier to get started using X-Mem on any flavor of Linux.

If you wish to simply run pre-built X-Mem binaries, but cannot or don't want to install the pre-requisite libraries, you can use images from the following Docker repository:

<https://hub.docker.com/r/mgottscho/x-mem>

Once you have pulled the image, run as follows:

docker run -t x-mem:VERSION_NUMBER_HERE STANDARD_X-MEM_OPTIONS HERE

This image assumes you have an Intel x86-64 system with support for the AVX instruction set extensions. If you don't have AVX, it may crash if it executes an illegal instruction.

If you want to quickly get to modifying X-Mem and build your own custom binaries with minimal hassle, you can use images from the following Docker repository:

<https://hub.docker.com/r/mgottscho/x-mem-build-env>

Once you have pulled the image, run as follows:

docker run -i -t x-mem-build-env:VERSION_NUMBER_HERE

You will enter the container in the /X-Mem directory interactively using the bash shell. Everything in the X-Mem source tree will be inside the container, ready to compile and run. Of course, if you modify any files inside the container they will not necessarily stick or be visible outside without using volumes, etc. See Docker documentation for more information.

Perhaps the best way to quickly modify, build, and run X-Mem would be the following series of steps:

1) Clone the X-Mem git repository to your Linux machine that has Docker installed:

git clone github.com/Microsoft/X-Mem /PATH/TO/LOCAL/WORKING/DIRECTORY/X-Mem

2) Change into X-Mem directory:

cd X-Mem

3) Make your required source changes by directly editing files in the source tree.

4) If you have the required dependencies (described in this README), then you can build binaries using the build-linux.sh script. If you don't, but you do have Docker installed, build a Docker image for the X-Mem build environment:

docker build -t x-mem-build-env:VERSION_NUMBER_HERE .

5) Run the Docker image to enter the container:

docker run -i -t x-mem-build-env:VERSION_NUMBER_HERE

6) Once inside the container, you will be running bash at at the /X-Mem directory. Now build from within the container:

./build-linux.sh YOUR_TARGET_ARCHITECTURE NUMBER_OF_THREADS

7) If the build is successful, run your new X-Mem binary, still inside the container (or export it to your host through a volume):

bin/xmem-linux-YOUR_TARGET_ARCHITECTURE --help

That's it!

------------------------------------------------------------------------------------------------------------
CONTACT, FEEDBACK, AND BUG REPORTS
------------------------------------------------------------------------------------------------------------

For questions, comments, criticism, bug reports, and other feedback for this software, please contact Mark Gottscho via email at <mgottscho@ucla.edu> or via web at <http://seas.ucla.edu/~gottscho>.

------------------------------------------------------------------------------------------------------------
ACKNOWLEDGMENT
------------------------------------------------------------------------------------------------------------

Mark Gottscho would like to thank Dr. Mohammed Shoaib of Microsoft Research and Dr. Sriram Govindan of Microsoft for their mentorship in the creation of this software. Further thanks to Dr. Bikash Sharma, Mark Santaniello, Mike Andrewartha, and Laura Caulfield of Microsoft for their contributions, feedback, and assistance. Thank you as well to Dr. Jie Liu of Microsoft Research, Dr. Badriddine Khessib and Dr. Kushagra Vaid of Microsoft, and Prof. Puneet Gupta of UCLA for giving Mark the opportunity to create this work. Finally, Mark would like to thank Dr. Fedor Pikus of Mentor Graphics for teaching him some useful programming techniques.


text:
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.

package org.jetbrains.kotlin.tools.projectWizard.wizard;

import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.idea.test.JUnit3RunnerWithInners;
import org.jetbrains.kotlin.idea.test.KotlinTestUtils;
import org.jetbrains.kotlin.test.TestMetadata;
import org.jetbrains.kotlin.idea.base.test.TestRoot;
import org.junit.runner.RunWith;

/**
 * This class is generated by {@link org.jetbrains.kotlin.testGenerator.generator.TestGenerator}.
 * DO NOT MODIFY MANUALLY.
 */
@SuppressWarnings("all")
@TestRoot("project-wizard/tests")
@TestDataPath("$CONTENT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public abstract class ProjectTemplateNewWizardProjectImportTestGenerated extends AbstractProjectTemplateNewWizardProjectImportTest {
    @RunWith(JUnit3RunnerWithInners.class)
    @TestMetadata("../cli/testData/projectTemplatesBuildFileGeneration")
    public static class GradleKts extends AbstractProjectTemplateNewWizardProjectImportTest {
        private void runTest(String testDataFilePath) throws Exception {
            KotlinTestUtils.runTest(this::doTestGradleKts, this, testDataFilePath);
        }

        @TestMetadata("composeDesktopApplication")
        public void testComposeDesktopApplication() throws Exception {
            runTest("../cli/testData/projectTemplatesBuildFileGeneration/composeDesktopApplication/");
        }

        @TestMetadata("composeMultiplatformApplication")
        public void testComposeMultiplatformApplication() throws Exception {
            runTest("../cli/testData/projectTemplatesBuildFileGeneration/composeMultiplatformApplication/");
        }

        @TestMetadata("consoleApplication")
        public void testConsoleApplication() throws Exception {
            runTest("../cli/testData/projectTemplatesBuildFileGeneration/consoleApplication/");
        }

        @TestMetadata("frontendApplication")
        public void testFrontendApplication() throws Exception {
            runTest("../cli/testData/projectTemplatesBuildFileGeneration/frontendApplication/");
        }

        @TestMetadata("fullStackWebApplication")
        public void testFullStackWebApplication() throws Exception {
            runTest("../cli/testData/projectTemplatesBuildFileGeneration/fullStackWebApplication/");
        }

        @TestMetadata("multiplatformLibrary")
        public void testMultiplatformLibrary() throws Exception {
            runTest("../cli/testData/projectTemplatesBuildFileGeneration/multiplatformLibrary/");
        }

        @TestMetadata("nativeApplication")
        public void testNativeApplication() throws Exception {
            runTest("../cli/testData/projectTemplatesBuildFileGeneration/nativeApplication/");
        }
    }

    @RunWith(JUnit3RunnerWithInners.class)
    @TestMetadata("../cli/testData/projectTemplatesBuildFileGeneration")
    public static class GradleGroovy extends AbstractProjectTemplateNewWizardProjectImportTest {
        private void runTest(String testDataFilePath) throws Exception {
            KotlinTestUtils.runTest(this::doTestGradleGroovy, this, testDataFilePath);
        }

        @TestMetadata("composeDesktopApplication")
        public void testComposeDesktopApplication() throws Exception {
            runTest("../cli/testData/projectTemplatesBuildFileGeneration/composeDesktopApplication/");
        }

        @TestMetadata("composeMultiplatformApplication")
        public void testComposeMultiplatformApplication() throws Exception {
            runTest("../cli/testData/projectTemplatesBuildFileGeneration/composeMultiplatformApplication/");
        }

        @TestMetadata("consoleApplication")
        public void testConsoleApplication() throws Exception {
            runTest("../cli/testData/projectTemplatesBuildFileGeneration/consoleApplication/");
        }

        @TestMetadata("frontendApplication")
        public void testFrontendApplication() throws Exception {
            runTest("../cli/testData/projectTemplatesBuildFileGeneration/frontendApplication/");
        }

        @TestMetadata("fullStackWebApplication")
        public void testFullStackWebApplication() throws Exception {
            runTest("../cli/testData/projectTemplatesBuildFileGeneration/fullStackWebApplication/");
        }

        @TestMetadata("multiplatformLibrary")
        public void testMultiplatformLibrary() throws Exception {
            runTest("../cli/testData/projectTemplatesBuildFileGeneration/multiplatformLibrary/");
        }

        @TestMetadata("nativeApplication")
        public void testNativeApplication() throws Exception {
            runTest("../cli/testData/projectTemplatesBuildFileGeneration/nativeApplication/");
        }
    }

    @RunWith(JUnit3RunnerWithInners.class)
    @TestMetadata("../cli/testData/projectTemplatesBuildFileGeneration")
    public static class Maven extends AbstractProjectTemplateNewWizardProjectImportTest {
        private void runTest(String testDataFilePath) throws Exception {
            KotlinTestUtils.runTest(this::doTestMaven, this, testDataFilePath);
        }

        @TestMetadata("composeDesktopApplication")
        public void testComposeDesktopApplication() throws Exception {
            runTest("../cli/testData/projectTemplatesBuildFileGeneration/composeDesktopApplication/");
        }

        @TestMetadata("composeMultiplatformApplication")
        public void testComposeMultiplatformApplication() throws Exception {
            runTest("../cli/testData/projectTemplatesBuildFileGeneration/composeMultiplatformApplication/");
        }

        @TestMetadata("consoleApplication")
        public void testConsoleApplication() throws Exception {
            runTest("../cli/testData/projectTemplatesBuildFileGeneration/consoleApplication/");
        }

        @TestMetadata("frontendApplication")
        public void testFrontendApplication() throws Exception {
            runTest("../cli/testData/projectTemplatesBuildFileGeneration/frontendApplication/");
        }

        @TestMetadata("fullStackWebApplication")
        public void testFullStackWebApplication() throws Exception {
            runTest("../cli/testData/projectTemplatesBuildFileGeneration/fullStackWebApplication/");
        }

        @TestMetadata("multiplatformLibrary")
        public void testMultiplatformLibrary() throws Exception {
            runTest("../cli/testData/projectTemplatesBuildFileGeneration/multiplatformLibrary/");
        }

        @TestMetadata("nativeApplication")
        public void testNativeApplication() throws Exception {
            runTest("../cli/testData/projectTemplatesBuildFileGeneration/nativeApplication/");
        }
    }
}


text:
neoagent
====================================

==================
Introduction
==================

neoagent is a memcached protocol proxy server daemon.

==================
Features
==================

- connection pooling
- configuration with JSON
- fail over with backup server function
- support some memcached command(get, set, add, delete, incr, decr, quit)

==================
Index
==================

.. toctree::
   :maxdepth: 2

   install
   run
   jsonconf
   utility
   neoagent
   neoctl
   neostat


text:
layout: post
title: "Scala: Type System and Related"
data: 2017-01-08
tags: [reading notes, scala]
comments: true
share: false
---

### Type System

*  Scala type system: parameterized type and variance
*  Subtype polymorphism and allowed variance annotations


text:
/*
* generated by Xtext
*/
package cruise.umple.ui.contentassist;

import cruise.umple.ui.contentassist.AbstractUmpleProposalProvider;
/**
 * see http://www.eclipse.org/Xtext/documentation/latest/xtext.html#contentAssist on how to customize content assistant
 */
public class UmpleProposalProvider extends AbstractUmpleProposalProvider {

}


text:
'use babel';

export default class Input {
  constructor(osk) {

    let input = this;

    let node = osk.getElement();

    node.addEventListener('click', function insert(evnt) {
      let target = evnt.target,
          editor = atom.workspace.getActiveTextEditor();

      if (target.tagName === 'OSK-KEY') {
        editor.insertText(target.textContent)
      }
    });

  }  // constructor()
}  // Input


text:
<?php

namespace Magento\Backend\Helper\Dashboard;

/**
 * Adminhtml dashboard helper for orders
 */
class Order extends \Magento\Backend\Helper\Dashboard\AbstractDashboard
{
    /**
     * @var \Magento\Reports\Model\Resource\Order\Collection
     */
    protected $_orderCollection;

    /**
     * @param \Magento\Framework\App\Helper\Context $context
     * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
     * @param \Magento\Store\Model\StoreManagerInterface $storeManager
     * @param \Magento\Framework\App\State $appState
     * @param \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency
     * @param \Magento\Reports\Model\Resource\Order\Collection $orderCollection
     * @param bool $dbCompatibleMode
     */
    public function __construct(
        \Magento\Framework\App\Helper\Context $context,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Framework\App\State $appState,
        \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency,
        \Magento\Reports\Model\Resource\Order\Collection $orderCollection,
        $dbCompatibleMode = true
    ) {
        $this->_orderCollection = $orderCollection;
        parent::__construct(
            $context,
            $scopeConfig,
            $storeManager,
            $appState,
            $priceCurrency,
            $dbCompatibleMode
        );
    }

    /**
     * @return void
     */
    protected function _initCollection()
    {
        $isFilter = $this->getParam('store') || $this->getParam('website') || $this->getParam('group');

        $this->_collection = $this->_orderCollection->prepareSummary($this->getParam('period'), 0, 0, $isFilter);

        if ($this->getParam('store')) {
            $this->_collection->addFieldToFilter('store_id', $this->getParam('store'));
        } elseif ($this->getParam('website')) {
            $storeIds = $this->_storeManager->getWebsite($this->getParam('website'))->getStoreIds();
            $this->_collection->addFieldToFilter('store_id', ['in' => implode(',', $storeIds)]);
        } elseif ($this->getParam('group')) {
            $storeIds = $this->_storeManager->getGroup($this->getParam('group'))->getStoreIds();
            $this->_collection->addFieldToFilter('store_id', ['in' => implode(',', $storeIds)]);
        } elseif (!$this->_collection->isLive()) {
            $this->_collection->addFieldToFilter(
                'store_id',
                ['eq' => $this->_storeManager->getStore(\Magento\Store\Model\Store::ADMIN_CODE)->getId()]
            );
        }
        $this->_collection->load();
    }
}


text:
'use strict';

/**
 * Module dependencies.
 */
var mongoose = require('mongoose'),
	Schema = mongoose.Schema;

/**
 * Timehk Schema
 */
var TimehkSchema = new Schema({
	name: {
		type: String,
		default: '',
		required: 'Please fill Timehk name',
		trim: true
	},
	created: {
		type: Date,
		default: Date.now
	},
	user: {
		type: Schema.ObjectId,
		ref: 'User'
	}
});

mongoose.model('Timehk', TimehkSchema);


text:
@implementation GZSaveService
+ (void)setObject:(nullable id)value forKey:(NSString *)defaultName{
    [[NSUserDefaults standardUserDefaults] setObject:value forKey:defaultName];

}
+ (nullable id)objectForKey:(NSString *)defaultName{
    return [[NSUserDefaults standardUserDefaults] objectForKey:defaultName];
}

@end


text:
using Microsoft.Azure;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Xml.Linq;

namespace Azure.DataCenterMigration
{
    /// <summary>
    /// Model class for PublishSettings files.
    /// </summary>
    internal class PublishSetting
    {
        /// <summary>
        /// Read-Write property for Subscription ID
        /// </summary>
        public string Id { get; set; }

        /// <summary>
        /// Read-Write property for Subscription Name
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// Read-Write property for Subscription ServiceUrl
        /// </summary>
        public Uri ServiceUrl { get; set; }

        /// <summary>
        /// Read-Write property for cloud credentials for subscription
        /// </summary>
        public CertificateCloudCredentials Credentials { get; set; }
    }

    /// <summary>
    /// Class retrieves information from PublishSettingsFilePath and stores into <see cref="PublishSetting"/>
    /// </summary>
    internal class PublishSettings
    {
        /// <summary>
        /// Constructor class
        /// </summary>
        /// <param name="fileContents"> Content of Publish Settings file</param>
        public PublishSettings(string fileContents)
        {
            var document = XDocument.Parse(fileContents);

            var publishProfile = document.Descendants(Constants.PublishProfile).FirstOrDefault();

            Uri defaultServiceUrl = null;
            if (!string.IsNullOrEmpty(Get(publishProfile, Constants.StringUrl)))
            {
                defaultServiceUrl = GetUri(publishProfile, Constants.StringUrl);
            }

            X509Certificate2 defaultCertificate = null;
            if (!string.IsNullOrEmpty(Get(publishProfile, Constants.ManagementCertificate)))
            {
                defaultCertificate = GetCertificate(publishProfile, Constants.ManagementCertificate);
            }

            _subscriptions = document.Descendants(Constants.Subscription)
                .Select(subscription => ToPublishSetting(subscription, defaultServiceUrl, defaultCertificate)).ToList();
        }

        /// <summary>
        /// Retrieves publish settings file details
        /// </summary>
        /// <param name="element">Subscription element of publishSettings file</param>
        /// <param name="defaultServiceUrl">Default service URL of subscription</param>
        /// <param name="defaultCertificate">Default certificate of subscription</param>
        /// <returns></returns>
        private PublishSetting ToPublishSetting(XElement element, Uri defaultServiceUrl, X509Certificate2 defaultCertificate)
        {
            var settings = new PublishSetting();
            settings.Id = Get(element, Constants.Id);
            settings.Name = Get(element, Constants.StringName);
            settings.ServiceUrl = GetUri(element, Constants.ServiceManagementUrl) ?? defaultServiceUrl;
            settings.Credentials = new CertificateCloudCredentials(settings.Id, GetCertificate(element, Constants.ManagementCertificate) ?? defaultCertificate);
            return settings;
        }

        /// <summary>
        /// Gets value of element's attribute
        /// </summary>
        /// <param name="element">Element whose attribute value has to retrieve</param>
        /// <param name="name">Attribute name</param>
        /// <returns>Value of attribute</returns>
        private string Get(XElement element, string name)
        {
            return (string)element.Attribute(name);
        }

        /// <summary>
        /// Gets Uri value of attribute from Element
        /// </summary>
        /// <param name="element">Element whose URL value has to retrieve</param>
        /// <param name="name">Name of URL attribute</param>
        /// <returns>Uri value of attribute</returns>
        private Uri GetUri(XElement element, string name)
        {
            string value = Get(element, name);
            return string.IsNullOrEmpty(value) ? null : new Uri(value);
        }

        /// <summary>
        /// Gets certificate value of attribute from Element
        /// </summary>
        /// <param name="element">Element whose certificate value has to retrieve</param>
        /// <param name="name">Name of certificate attribute</param>
        /// <returns>Certificate value of attribute</returns>
        private X509Certificate2 GetCertificate(XElement element, string name)
        {
            var encodedData = Get(element, name);
            return string.IsNullOrEmpty(encodedData) ? null : new X509Certificate2(Convert.FromBase64String(encodedData));
        }

        /// <summary>
        /// Readonly property for getting subscription details from PublishSettings file
        /// </summary>
        public IEnumerable<PublishSetting> Subscriptions
        {
            get
            {
                return _subscriptions;
            }
        }

        private readonly IList<PublishSetting> _subscriptions;
    }
}


text:
<?php

declare(strict_types=1);

namespace Phoenix\Tests\Comparator;

use Phoenix\Comparator\StructureComparator;
use Phoenix\Database\Element\Column;
use Phoenix\Database\Element\ForeignKey;
use Phoenix\Database\Element\Index;
use Phoenix\Database\Element\IndexColumn;
use Phoenix\Database\Element\MigrationTable;
use Phoenix\Database\Element\Structure;
use Phoenix\Database\Element\Table;
use PHPUnit\Framework\TestCase;

final class StructureComparatorTest extends TestCase
{
    public function testAddColumn(): void
    {
        $sourceStructure = new Structure();
        $sourceStructure->add((new Table('comparator_test'))->addColumn(new Column('title', 'string')));

        $targetStructure = new Structure();
        $targetTable = (new Table('comparator_test'))
            ->addColumn(new Column('title', 'string'))
            ->addColumn(new Column('description', 'text'));
        $targetStructure->add($targetTable);

        $structureComparator = new StructureComparator();
        $expectedDiff = [(new MigrationTable('comparator_test'))->addColumn('description', 'text')];
        $this->assertEquals($expectedDiff, $structureComparator->diff($sourceStructure, $targetStructure));
    }

    public function testDropColumn(): void
    {
        $sourceStructure = new Structure();
        $sourceTable = (new Table('comparator_test'))
            ->addColumn(new Column('title', 'string'))
            ->addColumn(new Column('description', 'text'));
        $sourceStructure->add($sourceTable);

        $targetStructure = new Structure();
        $targetStructure->add((new Table('comparator_test'))->addColumn(new Column('title', 'string')));

        $structureComparator = new StructureComparator();
        $expectedDiff = [(new MigrationTable('comparator_test'))->dropColumn('description')];
        $this->assertEquals($expectedDiff, $structureComparator->diff($sourceStructure, $targetStructure));
    }

    public function testAddTable(): void
    {
        $sourceStructure = new Structure();
        $sourceTable = (new Table('table1'))
            ->addColumn(new Column('title', 'string'))
            ->addColumn(new Column('description', 'text'));
        $sourceStructure->add($sourceTable);

        $targetStructure = new Structure();
        $targetStructure->add($sourceTable);
        $targetStructure->add((new Table('table2'))->addColumn(new Column('title', 'string')));

        $structureComparator = new StructureComparator();
        $addTableMigration = (new MigrationTable('table2', []))->addColumn('title', 'string');
        $addTableMigration->create();
        $expectedDiff = [$addTableMigration];
        $this->assertEquals($expectedDiff, $structureComparator->diff($sourceStructure, $targetStructure));
    }

    public function testDropTable(): void
    {
        $sourceStructure = new Structure();
        $sourceTable = (new Table('table1'))
            ->addColumn(new Column('title', 'string'))
            ->addColumn(new Column('description', 'text'));
        $sourceStructure->add($sourceTable);
        $sourceStructure->add((new Table('table2'))->addColumn(new Column('title', 'string')));

        $targetStructure = new Structure();
        $targetStructure->add((new Table('table2'))->addColumn(new Column('title', 'string')));

        $structureComparator = new StructureComparator();
        $dropTableMigration = new MigrationTable('table1');
        $dropTableMigration->drop();
        $expectedDiff = [$dropTableMigration];
        $this->assertEquals($expectedDiff, $structureComparator->diff($sourceStructure, $targetStructure));
    }

    public function testChangeColumn(): void
    {
        $sourceStructure = new Structure();
        $sourceStructure->add((new Table('comparator_test'))->addColumn(new Column('title', 'string')));

        $targetStructure = new Structure();
        $targetTable = (new Table('comparator_test'))
            ->addColumn(new Column('title', 'string', ['null' => true, 'length' => 1000, 'comment' => 'We need longer text']));
        $targetStructure->add($targetTable);

        $structureComparator = new StructureComparator();
        $expectedDiff = [(new MigrationTable('comparator_test'))->changeColumn('title', 'title', 'string', ['null' => true, 'length' => 1000, 'comment' => 'We need longer text'])];
        $this->assertEquals($expectedDiff, $structureComparator->diff($sourceStructure, $targetStructure));
    }

    public function testAddIndex(): void
    {
        $sourceStructure = new Structure();
        $sourceStructure->add((new Table('comparator_test'))
            ->addColumn(new Column('title', 'string'))
            ->addColumn(new Column('sorting', 'integer')));

        $targetStructure = new Structure();
        $targetStructure->add((new Table('comparator_test'))
            ->addColumn(new Column('title', 'string'))
            ->addColumn(new Column('sorting', 'integer'))
            ->addIndex(new Index([new IndexColumn('sorting')], 'idx_comparator_test_sorting'))
        );

        $structureComparator = new StructureComparator();
        $expectedDiff = [(new MigrationTable('comparator_test'))->addIndex('sorting', Index::TYPE_NORMAL, Index::METHOD_DEFAULT)];
        $this->assertEquals($expectedDiff, $structureComparator->diff($sourceStructure, $targetStructure));
    }

    public function testDropIndex(): void
    {
        $sourceStructure = new Structure();
        $sourceStructure->add((new Table('comparator_test'))
            ->addColumn(new Column('title', 'string'))
            ->addColumn(new Column('sorting', 'integer'))
            ->addIndex(new Index([new IndexColumn('sorting')], 'idx_comparator_test_sorting'))
        );
        $targetStructure = new Structure();
        $targetStructure->add((new Table('comparator_test'))
            ->addColumn(new Column('title', 'string'))
            ->addColumn(new Column('sorting', 'integer'))
        );

        $structureComparator = new StructureComparator();
        $expectedDiff = [(new MigrationTable('comparator_test'))->dropIndexByName('idx_comparator_test_sorting')];
        $this->assertEquals($expectedDiff, $structureComparator->diff($sourceStructure, $targetStructure));
    }

    public function testAddForeignKey(): void
    {
        $sourceStructure = new Structure();
        $sourceStructure->add((new Table('table_1'))
            ->setPrimary(['id'])
            ->addColumn(new Column('id', 'integer', ['autoincrement' => true]))
            ->addColumn(new Column('title', 'string'))
            ->addColumn(new Column('sorting', 'integer')));

        $sourceStructure->add((new Table('table_2'))
            ->setPrimary(['id'])
            ->addColumn(new Column('id', 'integer', ['autoincrement' => true]))
            ->addColumn(new Column('title', 'string'))
            ->addColumn(new Column('fk_table_1', 'integer')));

        $targetStructure = new Structure();
        $targetStructure->add((new Table('table_1'))
            ->setPrimary(['id'])
            ->addColumn(new Column('id', 'integer', ['autoincrement' => true]))
            ->addColumn(new Column('title', 'string'))
            ->addColumn(new Column('sorting', 'integer')));
        $targetStructure->add((new Table('table_2'))
            ->setPrimary(['id'])
            ->addColumn(new Column('id', 'integer', ['autoincrement' => true]))
            ->addColumn(new Column('title', 'string'))
            ->addColumn(new Column('fk_table_1', 'integer'))
            ->addForeignKey(new ForeignKey(['fk_table_1'], 'table_1', ['id'], ForeignKey::CASCADE, ForeignKey::CASCADE))
        );

        $structureComparator = new StructureComparator();
        $expectedDiff = [(new MigrationTable('table_2'))->addForeignKey('fk_table_1', 'table_1', ['id'], ForeignKey::CASCADE, ForeignKey::CASCADE)];
        $this->assertEquals($expectedDiff, $structureComparator->diff($sourceStructure, $targetStructure));
    }

    public function testDropForeignKey(): void
    {
        $sourceStructure = new Structure();
        $sourceStructure->add((new Table('table_1'))
            ->setPrimary(['id'])
            ->addColumn(new Column('id', 'integer', ['autoincrement' => true]))
            ->addColumn(new Column('title', 'string'))
            ->addColumn(new Column('sorting', 'integer')));

        $sourceStructure->add((new Table('table_2'))
            ->setPrimary(['id'])
            ->addColumn(new Column('id', 'integer', ['autoincrement' => true]))
            ->addColumn(new Column('title', 'string'))
            ->addColumn(new Column('fk_table_1', 'integer'))
            ->addForeignKey(new ForeignKey(['fk_table_1'], 'table_1', ['id'], ForeignKey::CASCADE, ForeignKey::CASCADE))
        );

        $targetStructure = new Structure();
        $targetStructure->add((new Table('table_1'))
            ->setPrimary(['id'])
            ->addColumn(new Column('id', 'integer', ['autoincrement' => true]))
            ->addColumn(new Column('title', 'string'))
            ->addColumn(new Column('sorting', 'integer')));
        $targetStructure->add((new Table('table_2'))
            ->setPrimary(['id'])
            ->addColumn(new Column('id', 'integer', ['autoincrement' => true]))
            ->addColumn(new Column('title', 'string'))
            ->addColumn(new Column('fk_table_1', 'integer'))
        );

        $structureComparator = new StructureComparator();
        $expectedDiff = [(new MigrationTable('table_2'))->dropForeignKey('fk_table_1')];
        $this->assertEquals($expectedDiff, $structureComparator->diff($sourceStructure, $targetStructure));
    }

    public function testMoreComplexChanges(): void
    {
        $sourceStructure = new Structure();
        $sourceStructure->add(
            (new Table('table_1'))
                ->addColumn(new Column('title', 'string'))
                ->addColumn(new Column('alias', 'string'))
                ->addColumn(new Column('created_at', 'datetime'))
                ->addColumn(new Column('sorting', 'integer', ['signed' => false, 'default' => 0]))
        );

        $sourceStructure->add(
            (new Table('table_2'))
                ->setPrimary(['id'])
                ->addColumn(new Column('id', 'integer', ['autoincrement' => true]))
                ->addColumn(new Column('title', 'string'))
                ->addColumn(new Column('description', 'string'))
        );

        $targetStructure = new Structure();
        $targetStructure->add((new Table('table_1'))
            ->setPrimary(['id'])
            ->addColumn(new Column('id', 'integer', ['autoincrement' => true]))
            ->addColumn(new Column('title', 'string'))
            ->addColumn(new Column('alias', 'string'))
            ->addColumn(new Column('sorting', 'integer', ['default' => 100]))
            ->addColumn(new Column('description', 'text'))
            ->addIndex(new Index([new IndexColumn('alias')], 'idx_table_1_alias', Index::TYPE_UNIQUE, Index::METHOD_DEFAULT))
        );
        $targetStructure->add((new Table('table_2'))
            ->addColumn(new Column('title', 'string'))
            ->addColumn(new Column('description', 'text'))
            ->addColumn(new Column('table_1_fk', 'integer', ['null' => true]))
            ->addForeignKey(new ForeignKey(['table_1_fk'], 'table_1', ['id'], ForeignKey::SET_NULL, ForeignKey::CASCADE))
        );

        $structureComparator = new StructureComparator();
        $expectedDiff = [
            (new MigrationTable('table_1'))
                ->addPrimaryColumns([new Column('id', 'integer', ['autoincrement' => true])])
                ->dropColumn('created_at')
                ->changeColumn('sorting', 'sorting', 'integer', ['default' => 100])
                ->addColumn('description', 'text')
                ->addIndex('alias', Index::TYPE_UNIQUE),
            (new MigrationTable('table_2'))
                ->dropPrimaryKey()
                ->changeColumn('description', 'description', 'text')
                ->addColumn('table_1_fk', 'integer', ['null' => true])
                ->addForeignKey('table_1_fk', 'table_1', 'id', ForeignKey::SET_NULL, ForeignKey::CASCADE)
        ];
        $this->assertEquals($expectedDiff, $structureComparator->diff($sourceStructure, $targetStructure));
    }
}


text:
#import "NSURLProtocol.h"

@interface MCMessageURLProtocol : NSURLProtocol
{
}

+ (BOOL)requestIsCacheEquivalent:(id)arg1 toRequest:(id)arg2;
+ (id)canonicalRequestForRequest:(id)arg1;
+ (BOOL)canInitWithRequest:(id)arg1;
- (void)stopLoading;
- (void)startLoading;

@end


text:
__author__ = 'Julian Togelius and Tom Schaul, tom@idsia.ch'

from random import shuffle

from pybrain.optimization.optimizer import BlackBoxOptimizer

class ES(BlackBoxOptimizer):
    """ Standard evolution strategy, (mu +/, lambda). """

    mu = 50
    lambada = 50

    evaluatorIsNoisy = False

    storeHallOfFame = True

    mustMaximize = True

    elitism = False

    def _additionalInit(self):
        assert self.lambada % self.mu == 0, 'lambda ('+str(self.lambada)+\
                                            ') must be multiple of mu ('+str(self.mu)+').'
        self.hallOfFame = []
        # population is a list of (fitness, individual) tuples.
        self.population = [(self._oneEvaluation(self._initEvaluable), self._initEvaluable)] * self._popsize
        list(map(self._replaceByMutation, list(range(1, self._popsize))))
        self._sortPopulation()

    @property
    def _popsize(self):
        if self.elitism:
            return self.mu + self.lambada
        else:
            return self.lambada

    def _replaceByMutation(self, index):
        x = self.population[index][1].copy()
        x.mutate()
        self.population[index] = (self._oneEvaluation(x), x)

    def _learnStep(self):
        # re-evaluate the mu individuals if the fitness function is noisy
        if self.evaluatorIsNoisy:
            for i in range (self.mu):
                x = self.population[i][1]
                self.population[i] = (self._oneEvaluation(x), x)
            self._sortPopulation(noHallOfFame = True)

        # produce offspring from the the mu best ones
        self.population = self.population[:self.mu] * (self._popsize/self.mu)

        # mutate the offspring
        if self.elitism:
            list(map(self._replaceByMutation, list(range(self.mu, self._popsize))))
        else:
            list(map(self._replaceByMutation, list(range(self._popsize))))

        self._sortPopulation()

    def _sortPopulation(self, noHallOfFame = False):
        # shuffle-sort the population and fitnesses
        shuffle(self.population)
        self.population.sort(key = lambda x: -x[0])
        if self.storeHallOfFame and not noHallOfFame:
            # the best per generation stored here
            self.hallOfFame.append(self.population[0][1])

    @property
    def batchSize(self):
        if self.evaluatorIsNoisy:
            return self._popsize
        else:
            return self.lambada

    def __str__(self):
        if self.elitism:
            return 'ES('+str(self.mu)+'+'+str(self.lambada)+')'
        else:
            return 'ES('+str(self.mu)+','+str(self.lambada)+')'


text:
.icon-blank{
	background:url('icons/blank.gif') no-repeat center center;
}
.icon-add{
	background:url('icons/edit_add.png') no-repeat center center;
}
.icon-edit{
	background:url('icons/pencil.png') no-repeat center center;
}
.icon-remove{
	background:url('icons/edit_remove.png') no-repeat center center;
}
.icon-save{
	background:url('icons/save1.png') no-repeat center center;
}
.icon-cut{
	background:url('icons/cut.png') no-repeat center center;
}
.icon-ok{
	background:url('icons/ok.png') no-repeat center center;
}
.icon-no{
	background:url('icons/no.png') no-repeat center center;
}
.icon-cancel{
	background:url('icons/cancel.png') no-repeat center center;
}
.icon-reload{
	background:url('icons/reload.png') no-repeat center center;
}
.icon-search{
	background:url('icons/findnow.png') no-repeat center center;
}
.icon-print{
	background:url('icons/print1.png') no-repeat center center;
}
.icon-help{
	background:url('icons/help.png') no-repeat center center;
}
.icon-undo{
	background:url('icons/come.png') no-repeat center center;
}
.icon-redo{
	background:url('icons/redo.png') no-repeat center center;
}
.icon-back{
	background:url('icons/back1.png') no-repeat center center;
}
.icon-sum{
	background:url('icons/sum.png') no-repeat center center;
}
.icon-tip{
	background:url('icons/tip.png') no-repeat center center;
}

.icon-mini-add{
	background:url('icons/mini_add.png') no-repeat center center;
}
.icon-mini-edit{
	background:url('icons/mini_edit.png') no-repeat center center;
}
.icon-mini-refresh{
	background:url('icons/mini_refresh.png') no-repeat center center;
}

.icon-test{
	background:url('icons/test.png') no-repeat center center;
}

.icon-find{
	background:url('icons/test.png') no-repeat center center;
}

.icon-report{
	background:url('icons/report.png') no-repeat center center;
}

.icon-history{
	background:url('icons/history.png') no-repeat center center;
}
.icon-pdf{
	background:url('icons/export.png') no-repeat center center;
}
.icon-downloadreport{
	background:url('icons/large_chart.png') no-repeat center center;
}
.icon-addcar{
	background:url('icons/car.png') no-repeat center center;
}
.icon-usercenter{
	background:url('icons/usercenter.png') no-repeat center center;
}
.icon-alldata{
	background:url('icons/alldata.png') no-repeat center center;
}

*{
	font-size:12px;
}
body {
    font-family:helvetica,tahoma,verdana,sans-serif;
    padding:20px;
    font-size:13px;
    margin:0;
}
h2 {
    font-size:18px;
    font-weight:bold;
    margin:0;
    margin-bottom:15px;
}
.demo-info{
	background:#FFFEE6;
	color:#8F5700;
	padding:12px;
}
.demo-tip{
	width:16px;
	height:16px;
	margin-right:8px;
	float:left;
}


text: <video style="transform: translateZ(0); position: absolute; top: 0px; left: 0px; height: 100px; width: 100px; background: lightblue"></video>


text:
struct Config;
class  Map;

struct Colony
{
    unsigned    id;
    unsigned    startPeople = 50;

    sf::Color   colour;

    unsigned strLow;
    unsigned strHigh;
};

#endif // COLONY_H_INCLUDED


text:
package org.apache.kafka.streams.kstream.internals;

import org.apache.kafka.streams.processor.api.ProcessorContext;
import org.apache.kafka.streams.state.ValueAndTimestamp;

public interface KTableValueGetter<K, V> {

    void init(ProcessorContext<?, ?> context);

    ValueAndTimestamp<V> get(K key);

    default void close() {}
}


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W28999_text</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                «

    <p class="styleSans9.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Amount of Gas Applicant is Currentiy Flaring
1-. . n: . r n . A. ---. 1-1--4 _.

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">atatewwe percentage or gas flared: 11.58% (5/2014) Fieldwide percentage of gas flared: North Tobacco Garden, 0.76% (4/2014)

    <p class="styleSans8.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Alternatives to Flaring Purchaser capacity is expected to be sufficient for the volumes produced from these wells. in the

    <p class="styleSans10.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">event that electric power is required on-site, a natural gas powered generator will be evaluated. Purchase and installation of a liquid stripping plant to be utilized in the event of upset conditions would
not be economic. Such an installation will be re-evaluated as additional wells are completed and if conditions change.

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">


text:
/*!
    fileHtmltask -- html Template task
    Version 1.0.1
    https://khensolomon.github.io/let/filehtmltask
    (c) 2016
*/
(function(o) {
  'use strict';
  window[o] = function(io) {
    var os =(io?io:o), json={}, panelID = 'l1121', textareaID = 'l1122';
    window[os] = this;
    var visualTask={
      style:function(){
        var scriptObj = 'script[id=o]'.replace('o',o).byAttrName();
        if (scriptObj) {
          var scriptPath = scriptObj.src, scriptUrl = scriptPath.substr(0, scriptPath.lastIndexOf( '/' )+1 );
          var link = document.createElement('link');
          link.rel = 'stylesheet';
          link.href = 'linkstyle.css'.replace(/link/,scriptUrl).replace(/style/,o);
          document.head.appendChild(link);
        }
      },
      bar:function(){
        var div=panelID.byID();
        if(!div){
          this.style();
          div = document.createElement('div');
          div.id = panelID;
          var ul = document.createElement('ul');
          // ul.appendChild(this.clean());
          this.clean(ul);
          this.action(ul);
          this.result(ul);
          // ul.appendChild(this.result());
          div.appendChild(ul);
          document.body.appendChild(div);
        }
      },
      clean:function(container){
        var li = document.createElement('li');
        li.addEventListener("click", function(e) {
          window[os].clean();
          li.classList.toggle("active");
          // document.getElementById("myDropdown").classList.toggle("show");
        }, false);
        li.innerHTML = "Clean";
        li.setAttribute('class','clean');
        container.appendChild(li);
      },
      result:function(container){
        var li = document.createElement('li');
        li.addEventListener("click", function(e) {
          window[os].result();
        }, false);
        li.innerHTML = "Result";
        li.setAttribute('class','result');
        container.appendChild(li);
      },
      action:function(container){
        document.body.children.each(function(i,node){
          var nodeName = node.nodeName;
          if (nodeName && !node.hasAttribute('remove')) {
            var li = document.createElement('li');
            var strong = document.createElement('strong');
            strong.innerHTML = nodeName;
            li.appendChild(strong);
            ({'get':'get'}).each(function(x,y){
              var span = document.createElement('span');
              span.addEventListener("click", function(e) {
                window[os][x](node);
              }, false);
              span.innerHTML = y;
              span.title = y;
              li.appendChild(span);
            });
            container.appendChild(li);
          }
        });
      }
    };
    visualTask.bar();
    this.help = function(){
      var h={
          "help":'',
          "clean() remove all uncessary data [remove,empty,iframe,input_stat] get() then result()":"",
          "Clean":"os.clean();",
          "Get":"os.get();",
          "TagName[header,main,footer,div]":"os.get('header');",
          "Result":'os.result();',
      };
      window.help=Object.keys(h).join('; ').replace(/os/g,os);
      h.each(function(i,v){
        if (v){
          console.log(i.replace(/os/g,os),':',v.replace(/os/g,os));
        } else {
          console.log(i.replace(/os/g,os),'...');
        }
      });
      /*
      help.forEach(function(i){
          console.log(i);
      });
      */
      return help;
    };
    this.result=function(){
      var textarea=textareaID.byID();
      if(!textarea){
        textarea = document.createElement('textarea');
        textarea.id = textareaID;
        // textarea.style = "width:100%;";
        document.body.appendChild(textarea);
      }
      textarea.value=JSON.stringify(json);
      if (json.length > 0) {
        // textarea.value=JSON.stringify(json);
      } else {
        return 'need help?';
      }
      return 'data in Textarea';
    };
    this.clean=function(){
      var rm = '[remove],[input_stat]'.byAttrNameAll();
      for (var i=rm.length-1; i>=0;i-=1){
        if (rm[i]) rm[i].parentNode.removeChild(rm[i]);
        //if (rm[i]) ety[i].remove();
      }
      var ety = '[empty]'.byAttrNameAll();
      for (var i=ety.length-1; i>=0;i-=1){
        if (ety[i]){
          while(ety[i].hasChildNodes()) {
            ety[i].removeChild(ety[i].firstChild);
          }
          ety[i].removeAttribute("empty");
        }
      }
      var ifr ='iframe'.byTagName();
      for (var i=ifr.length-1; i>=0;i-=1){
        if (ifr[i]) ifr[i].remove();
      }
      return 'done';
      /*
      .removeAttribute("category");
      .removeAttributeNode(attnode);
      */
    };
    this.get=function(tag){
      if (tag){
        var element=(typeof tag === 'object')?tag:tag.byTagName()[0];
        // if (typeof yourVariable === 'object'){
        //   var element=tag;
        // } else {
        //   var element=tag.byTagName()[0];
        // }
        if(element){
          return json=this.dom(element);
        }
        return 'Element not exists!'.replace('Element',tag);
      } else {
        return 'Element not specified!';
      }
    };
    this.dom=function(element){
      var obj={}, parser, docNode;
      if (typeof element === "string") {
        if (window.DOMParser){
          parser=new DOMParser(); docNode=parser.parseFromString(element,"text/html");
        }else{
          docNode=new ActiveXObject("Microsoft.XMLDOM"); docNode.async=false; docNode.loadXML(element);
        }
        element=docNode.firstChild;
        //element=docNode.lastChild;
      }
      this.objTree(element, obj);
      return obj;
    };
    this.objTree=function(el, o){
      var tag=el.nodeName.toLowerCase();
      o[tag]={};
      var nodeList =el.childNodes;
      if (nodeList != null) {
        if (nodeList.length) {
          o[tag]["text"] = [];
          for (var i = 0; i < nodeList.length; i++) {
            if (nodeList[i].nodeType == 3) {
              if(nodeList[i].nodeValue.replace(/^\s+|\s+$/g, '').trim()){
                o[tag]["text"].push(nodeList[i].nodeValue);
              }
            } else {
              o[tag]["text"].push({});
              this.objTree(nodeList[i], o[tag]["text"][o[tag]["text"].length -1]);
            }
          }
        }
      }
      if (el.attributes != null) {
        if (el.attributes.length) {
          o[tag]["attr"] = {};
          for (var i = 0; i < el.attributes.length; i++) {
            o[tag]["attr"][el.attributes[i].nodeName] = el.attributes[i].nodeValue;
          }
        }
      }
    };
    return this;
  };
}('fileHtmltask'));
Object.defineProperties(Object.prototype,{
  each:{
    value:function(callback){
      for(var i in this) {
        callback(i, this[i]);
        /*
       if (object.hasOwnProperty(i)) {
         callback(i, this[i]);
       }*/
      }
    }
  },
  byID:{
    value:function(){
      return document.getElementById(this);
    }
  },
  byClass:{
    value:function(){
      return document.getElementsByClassName(this);
    }
  },
  byTagName:{
    value:function(){
      return document.getElementsByTagName(this);
    }
  },
  byAttrNameAll:{
    value:function(){
      return document.querySelectorAll(this);
      //document.querySelectorAll('[someAttr]')
      //document.querySelector('[someAttr]')
    }
  },
  byAttrName:{
    value:function(){
      return document.querySelector(this);
    }
  }
});
document.addEventListener('DOMContentLoaded', function () {
  new fileHtmltask('task');
  task.help();
  // textarea = document.createElement('textarea');
  // textarea.id = "t100";
  // // textarea.style = "width:100%;";
  // document.body.appendChild(textarea);
});
// htmlTemplatetask fileTagtask fileHtmltask


text:
// This program tests the LCD printing functions with an assortment of numbers.
// After verifying the output, advance to the next test by pressing the button.
// Patrick McCarty, 5-09-2009

#include "../XiphosLibrary/globals.h"

#define DELAY 10

int main()
{
	u08 i = 0;
	initialize();

	//Test 1
	clearScreen();
	printString("   Xiphos 1.0   ");
	lowerLine();
	printString(" RoboAddict.com");
	delayMs(1000);

	for(i = 0; i <= DELAY ;i++)
	{
	  clearScreen();
	  printString("T minus : ");

	  printPlain_u08(DELAY-i);
	  delayMs(1000);
	}
	clearScreen();
	printString("__(Sphere-bot)___");
	//softReset();
   /*motor0(200); // 0 at 127. full forward at 255
   delayMs(3000);
   brake0();*/
   while(1);
}


text:
<form name="positionForm">

    Company:
    <input id="company" name="company" class="form-control" ng-model="position.company"/>
    {{positionForm.company.$isValid}}

    Position:
    <input id="position" name="position" class="form-control" ng-required="true"
           ng-model="position.position" ng-max-length="255"/>
    {{positionForm.position.$isValid}}

    Agency:
    <input id="agency" name="agency" class="form-control"
           ng-model="position.agency" ng-max-legnth="255"/>
    {{positionForm.agency.$isValid}}

    Point of contact:
    <input id="pointOfContact" name="pointOfContact" class="form-control" ng-model="position.pointOfContact"/>
    {{positionForm.pointOfContact.$isValid}}

    Salary:

      <input type="number" id="salaryMin" name="salaryMin" ng-model="position.salaryMin" class="form-control"/>
      <input type="number" id="salaryMax" name="salaryMax" ng-model="position.salaryMax" class="form-control"/>

    Notes:
    <textarea id="notes" name="notes" class="form-control" ng-model="position.notes"></textarea>

    Closed?
    <input type="checkbox" id="closed" name="closed" ng-model="position.closed" />

  <input type="submit" ng-click="submit()" value="{{submitLabel}}"/>
  <input type="reset" value="Reset"/>
</form>


text:
    import "github.com/KyleBanks/go-kit/contains/"

Package contains adds a few small helper functions to see if a slice contains a
particular value.

## Usage

#### func  Int

```go
func Int(val int, arr []int) bool
```
Int returns true if the slice of ints contains the value provided.

#### func  Uint

```go
func Uint(val uint, arr []uint) bool
```
Uint returns true if the slice of uints contains the value provided.


text:
package edu.harvard.iq.dataverse.api;

import edu.harvard.iq.dataverse.Dataverse;
import edu.harvard.iq.dataverse.authorization.users.AuthenticatedUser;
import edu.harvard.iq.dataverse.engine.command.DataverseRequest;
import edu.harvard.iq.dataverse.engine.command.exception.CommandException;
import edu.harvard.iq.dataverse.search.SearchException;
import edu.harvard.iq.dataverse.search.savedsearch.SavedSearch;
import edu.harvard.iq.dataverse.search.savedsearch.SavedSearchFilterQuery;
import edu.harvard.iq.dataverse.search.savedsearch.SavedSearchServiceBean;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
import javax.ejb.EJBException;
import javax.json.Json;
import javax.json.JsonArray;
import javax.json.JsonArrayBuilder;
import javax.json.JsonObject;
import javax.json.JsonObjectBuilder;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Response;
import static javax.ws.rs.core.Response.Status.BAD_REQUEST;
import static javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR;
import static javax.ws.rs.core.Response.Status.NOT_FOUND;

@Path("admin/savedsearches")
public class SavedSearches extends AbstractApiBean {

    private static final Logger logger = Logger.getLogger(SavedSearches.class.getCanonicalName());

    @GET
    public Response meta() {
        JsonArrayBuilder endpoints = Json.createArrayBuilder();
        endpoints.add("GET");
        endpoints.add("GET /list");
        endpoints.add("GET /id");
        endpoints.add("POST");
        endpoints.add("DELETE /id");
        return okResponse(endpoints);
    }

    @GET
    @Path("list")
    public Response list() {
        JsonArrayBuilder savedSearchesBuilder = Json.createArrayBuilder();
        List<SavedSearch> savedSearches = savedSearchSvc.findAll();
        for (SavedSearch savedSearch : savedSearches) {
            JsonObjectBuilder thisSavedSearch = toJson(savedSearch);
            savedSearchesBuilder.add(thisSavedSearch);
        }
        JsonObjectBuilder response = Json.createObjectBuilder();
        response.add("saved searches", savedSearchesBuilder);
        return okResponse(response);
    }

    @GET
    @Path("{id}")
    public Response show(@PathParam("id") long id) {
        SavedSearch savedSearch = savedSearchSvc.find(id);
        if (savedSearch != null) {
            JsonObjectBuilder response = toJson(savedSearch);
            return okResponse(response);
        } else {
            return errorResponse(NOT_FOUND, "Could not find saved search id " + id);
        }
    }

    private JsonObjectBuilder toJson(SavedSearch savedSearch) {
        JsonObjectBuilder savedSearchJson = Json.createObjectBuilder();
        long savedSearchId = savedSearch.getId();
        Dataverse definitionPoint = savedSearch.getDefinitionPoint();
        JsonArrayBuilder fqBuilder = Json.createArrayBuilder();
        for (SavedSearchFilterQuery fq : savedSearch.getSavedSearchFilterQueries()) {
            fqBuilder.add(fq.getFilterQuery());
        }
        savedSearchJson.add("query", savedSearch.getQuery());
        savedSearchJson.add("filterQueries", fqBuilder);
        savedSearchJson.add("id", savedSearchId);
        savedSearchJson.add("definitionPointId", definitionPoint.getId());
        savedSearchJson.add("definitionPointAlias", definitionPoint.getAlias());
        savedSearchJson.add("creatorId", savedSearch.getCreator().getId());
        return savedSearchJson;
    }

    @POST
    public Response add(JsonObject body) {

        if (body == null) {
            return errorResponse(BAD_REQUEST, "JSON is expected.");
        }

        String keyForAuthenticatedUserId = "creatorId";
        long creatorIdToLookUp;
        try {
            creatorIdToLookUp = body.getInt(keyForAuthenticatedUserId);
        } catch (NullPointerException ex) {
            return errorResponse(BAD_REQUEST, "Required field missing: " + keyForAuthenticatedUserId);
        } catch (ClassCastException ex) {
            return errorResponse(BAD_REQUEST, "A number is required for " + keyForAuthenticatedUserId);
        } catch (Exception ex) {
            return errorResponse(BAD_REQUEST, "Problem with " + keyForAuthenticatedUserId + ": " + ex);
        }

        AuthenticatedUser creator = authSvc.findByID(creatorIdToLookUp);
        if (creator == null) {
            return errorResponse(Response.Status.NOT_FOUND, "Could not find user based on " + keyForAuthenticatedUserId + ": " + creatorIdToLookUp);
        }

        String keyForQuery = "query";
        String query;
        try {
            query = body.getString(keyForQuery);
        } catch (NullPointerException ex) {
            return errorResponse(BAD_REQUEST, "Required field missing: " + keyForQuery);
        }

        String keyForDefinitionPointId = "definitionPointId";
        long dataverseIdToLookup;
        try {
            dataverseIdToLookup = body.getInt(keyForDefinitionPointId);
        } catch (NullPointerException ex) {
            return errorResponse(BAD_REQUEST, "Required field missing: " + keyForDefinitionPointId);
        } catch (ClassCastException ex) {
            return errorResponse(BAD_REQUEST, "A number is required for " + keyForDefinitionPointId);
        } catch (Exception ex) {
            return errorResponse(BAD_REQUEST, "Problem with " + keyForDefinitionPointId + ": " + ex);
        }
        Dataverse definitionPoint = dataverseSvc.find(dataverseIdToLookup);
        if (definitionPoint == null) {
            return errorResponse(NOT_FOUND, "Could not find a dataverse based on id " + dataverseIdToLookup);
        }

        SavedSearch toPersist = new SavedSearch(query, definitionPoint, creator);

        String keyForFilterQueries = "filterQueries";
        List<SavedSearchFilterQuery> savedSearchFilterQuerys = new ArrayList<>();
        try {
            JsonArray filterQueries = body.getJsonArray(keyForFilterQueries);
            for (int i = 0; i < filterQueries.size(); i++) {
                String fq = filterQueries.getString(i);
                SavedSearchFilterQuery filterQuery = new SavedSearchFilterQuery(fq, toPersist);
                savedSearchFilterQuerys.add(filterQuery);
            }
        } catch (NullPointerException ex) {
            // filter queries are not required, keep going
        } catch (Exception ex) {
            return errorResponse(BAD_REQUEST, "Problem getting filter queries: " + ex);
        }

        if (!savedSearchFilterQuerys.isEmpty()) {
            toPersist.setSavedSearchFilterQueries(savedSearchFilterQuerys);
        }

        try {
            SavedSearch persistedSavedSearch = savedSearchSvc.add(toPersist);
            return okResponse("Added: " + persistedSavedSearch);
        } catch (EJBException ex) {
            StringBuilder errors = new StringBuilder();
            Throwable throwable = ex.getCause();
            while (throwable != null) {
                errors.append(throwable).append(" ");
                throwable = throwable.getCause();
            }
            return errorResponse(BAD_REQUEST, "Problem adding saved search: " + errors);
        }
    }

    @DELETE
    @Path("{id}")
    public Response delete(@PathParam("id") long doomedId) {
        boolean disabled = true;
        if (disabled) {
            return errorResponse(BAD_REQUEST, "Saved Searches can not safely be deleted because links can not safely be deleted. See https://github.com/IQSS/dataverse/issues/1364 for details.");
        }
        SavedSearch doomed = savedSearchSvc.find(doomedId);
        if (doomed == null) {
            return errorResponse(NOT_FOUND, "Could not find saved search id " + doomedId);
        }
        boolean wasDeleted = savedSearchSvc.delete(doomedId);
        if (wasDeleted) {
            return okResponse(Json.createObjectBuilder().add("Deleted", doomedId));
        } else {
            return errorResponse(INTERNAL_SERVER_ERROR, "Problem deleting id " + doomedId);
        }
    }

    @PUT
    @Path("makelinks/all")
    public Response makeLinksForAllSavedSearches(@QueryParam("debug") boolean debug) {
        JsonObjectBuilder makeLinksResponse;
        try {
            makeLinksResponse = savedSearchSvc.makeLinksForAllSavedSearches(debug);
            return okResponse(makeLinksResponse);
        } catch (CommandException ex) {
            return errorResponse(BAD_REQUEST, ex.getLocalizedMessage());
        } catch (SearchException ex) {
            return errorResponse(INTERNAL_SERVER_ERROR, ex.getLocalizedMessage());
        }
    }

    @PUT
    @Path("makelinks/{id}")
    public Response makeLinksForSingleSavedSearch(@PathParam("id") long savedSearchIdToLookUp, @QueryParam("debug") boolean debug) {
        SavedSearch savedSearchToMakeLinksFor = savedSearchSvc.find(savedSearchIdToLookUp);
        if (savedSearchToMakeLinksFor == null) {
            return errorResponse(BAD_REQUEST, "Count not find saved search id " + savedSearchIdToLookUp);
        }
        try {
            DataverseRequest dataverseRequest = new DataverseRequest(savedSearchToMakeLinksFor.getCreator(), SavedSearchServiceBean.getHttpServletRequest());
            JsonObjectBuilder response = savedSearchSvc.makeLinksForSingleSavedSearch(dataverseRequest, savedSearchToMakeLinksFor, debug);
            return okResponse(response);
        } catch (CommandException ex) {
            return errorResponse(BAD_REQUEST, ex.getLocalizedMessage());
        } catch (SearchException ex) {
            return errorResponse(INTERNAL_SERVER_ERROR, ex.getLocalizedMessage());
        }
    }

}