text:
<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>Template Specs — Jasmine Spec Runner v2.0.0-rc3</title>

  <link rel="shortcut icon" type="image/png" href="lib/jasmine-2.0.0-rc3/jasmine_favicon.png">
  <link rel="stylesheet" type="text/css" href="lib/jasmine-2.0.0-rc3/jasmine.css">

  <script type="text/javascript" src="lib/jasmine-2.0.0-rc3/jasmine.js"></script>
  <script type="text/javascript" src="lib/jasmine-2.0.0-rc3/jasmine-html.js"></script>
  <script type="text/javascript" src="lib/jasmine-2.0.0-rc3/boot.js"></script>

  <!-- include source files here... -->
  <script type="text/javascript" src="../src/template.js"></script>

  <!-- include spec files here... -->
  <script type="text/javascript" src="./template_spec.js"></script>

</head>

<body>
</body>
</html>


text:
using MO.Common.Collection;

namespace MO.Core.Window.Context.Asm.Code {

   public class FAsmRep : FAsmOpCode {

      // <OpCode name="Rep" flag="11110011" regs="" mode="8086" text="Repeat Following String Operation" />
      public override bool Parse(FAsmCommand cmd, FBytes memory, int offset) {
         int code = memory[offset];
         if(code == 0xF3) {
            int code2 = memory[offset + 1];
            cmd.Size = 2;
         }
         return true;
      }

   }

}

redpajama_set_name: RedPajamaGithub


text:
pub use self::contact::{Contact, ContactId, ContactPrediction, TrackedContact};
pub use self::contact_kinematic::{
    ContactKinematic, LocalShapeApproximation, NeighborhoodGeometry,
};
pub use self::contact_manifold::{ContactManifold, ContactTrackingMode};
pub use self::contact_preprocessor::ContactPreprocessor;

pub use self::contact_ball_ball::contact_ball_ball;
pub use self::contact_ball_convex_polyhedron::{
    contact_ball_convex_polyhedron, contact_convex_polyhedron_ball,
};
pub use self::contact_composite_shape_shape::{
    contact_composite_shape_shape, contact_shape_composite_shape,
};
pub use self::contact_plane_support_map::{contact_plane_support_map, contact_support_map_plane};
pub use self::contact_shape_shape::contact;
pub use self::contact_support_map_support_map::contact_support_map_support_map;
pub use self::contact_support_map_support_map::contact_support_map_support_map_with_params;

mod contact;
mod contact_ball_ball;
mod contact_ball_convex_polyhedron;
mod contact_composite_shape_shape;
mod contact_kinematic;
mod contact_manifold;
mod contact_plane_support_map;
mod contact_preprocessor;
mod contact_shape_shape;
mod contact_support_map_support_map;


text:
interface FilePath {
  jsPath: string,
  tsPath: string,
  mdRootDir: string,
}

export default FilePath;


text:
// Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).

package com.twitter.intellij.pants.service.project.model;

import com.google.gson.GsonBuilder;
import com.google.gson.annotations.SerializedName;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.containers.ContainerUtil;
import com.twitter.intellij.pants.model.TargetAddressInfo;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.TestOnly;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ProjectInfo {
  public static ProjectInfo fromJson(@NotNull String data) {
    final GsonBuilder builder = new GsonBuilder();
    builder.registerTypeAdapter(TargetInfo.class, TargetInfoDeserializer.INSTANCE);
    builder.registerTypeAdapter(LibraryInfo.class, LibraryInfoDeserializer.INSTANCE);
    final ProjectInfo projectInfo = builder.create().fromJson(data, ProjectInfo.class);
    projectInfo.initTargetAddresses();

    return projectInfo;
  }

  @TestOnly
  public ProjectInfo() {
  }

  private final Logger LOG = Logger.getInstance(getClass());
  // id(org:name:version) to jars
  protected Map<String, LibraryInfo> libraries;
  // name to info
  protected Map<String, TargetInfo> targets;

  /* This might need to be expanded to show all properties that
   * a target type can contain like:
   *
   * {"java_library" : [{ "dependencies" : "list(str)" }]}
   */
  @SerializedName("available_target_types")
  protected String[] availableTargetTypes = {};

  protected String version;

  @NotNull
  public String getVersion() {
    return version;
  }

  @Nullable
  protected PythonSetup python_setup = null;

  private static <T> List<Map.Entry<String, T>> getSortedEntries(Map<String, T> map) {
    return ContainerUtil.sorted(
      map.entrySet(),
      new Comparator<Map.Entry<String, T>>() {
        @Override
        public int compare(Map.Entry<String, T> o1, Map.Entry<String, T> o2) {
          return StringUtil.naturalCompare(o1.getKey(), o2.getKey());
        }
      }
    );
  }

  public List<Map.Entry<String, LibraryInfo>> getSortedLibraries() {
    return getSortedEntries(getLibraries());
  }

  public Map<String, LibraryInfo> getLibraries() {
    return Collections.unmodifiableMap(libraries);
  }

  public void setLibraries(Map<String, LibraryInfo> libraries) {
    this.libraries = libraries;
  }

  public List<Map.Entry<String, TargetInfo>> getSortedTargets() {
    return getSortedEntries(getTargets());
  }

  public Map<String, TargetInfo> getTargets() {
    return Collections.unmodifiableMap(targets);
  }

  public void setTargets(Map<String, TargetInfo> targets) {
    this.targets = targets;
  }

  @NotNull
  public String[] getAvailableTargetTypes() {
    return availableTargetTypes;
  }

  @Nullable
  public PythonSetup getPythonSetup() {
    return python_setup;
  }

  @Nullable
  public LibraryInfo getLibraries(@NotNull String libraryId) {
    if (libraries.containsKey(libraryId) && libraries.get(libraryId).getDefault() != null) {
      return libraries.get(libraryId);
    }
    int versionIndex = libraryId.lastIndexOf(':');
    if (versionIndex == -1) {
      return null;
    }
    final String libraryName = libraryId.substring(0, versionIndex);
    for (Map.Entry<String, LibraryInfo> libIdAndJars : libraries.entrySet()) {
      final String currentLibraryId = libIdAndJars.getKey();
      if (!StringUtil.startsWith(currentLibraryId, libraryName + ":")) {
        continue;
      }
      final LibraryInfo currentInfo = libIdAndJars.getValue();
      if (currentInfo != null) {
        LOG.info("Using " + currentLibraryId + " instead of " + libraryId);
        return currentInfo;
      }
    }
    return null;
  }

  @Nullable
  public TargetInfo getTarget(String targetName) {
    return targets.get(targetName);
  }

  public void addTarget(String targetName, TargetInfo info) {
    targets.put(targetName, info);
  }

  public void removeTargets(Collection<String> targetNames) {
    for (String targetName : targetNames) {
      removeTarget(targetName);
    }
  }

  public void renameTarget(@NotNull String targetName, @NotNull String newTargetName) {
    addTarget(newTargetName, getTarget(targetName));
    replaceDependency(targetName, newTargetName);
    removeTarget(targetName);
  }

  public void removeTarget(String targetName) {
    targets.remove(targetName);
    for (TargetInfo targetInfo : targets.values()) {
      targetInfo.getTargets().remove(targetName);
    }
  }

  public void replaceDependency(String targetName, String newTargetName) {
    for (TargetInfo targetInfo : targets.values()) {
      targetInfo.replaceDependency(targetName, newTargetName);
    }
  }

  private void initTargetAddresses() {
    for (Map.Entry<String, TargetInfo> entry : targets.entrySet()) {
      final TargetInfo info = entry.getValue();
      final String address = entry.getKey();
      for (TargetAddressInfo addressInfo : info.getAddressInfos()) {
        addressInfo.setTargetAddress(address);
      }
    }
  }

  /**
   * Helper method to get a distribution by target type.
   */
  public Map<String, Integer> getTargetsDistribution() {
    final Map<String, Integer> result = new HashMap<>();
    for (TargetInfo targetInfo : targets.values()) {
      for (TargetAddressInfo addressInfo : targetInfo.getAddressInfos()) {
        final String type = addressInfo.getInternalPantsTargetType();
        final int currentValue = ContainerUtil.getOrCreate(result, type, 0);
        result.put(type, currentValue + 1);
      }
    }
    return result;
  }

  @Override
  public String toString() {
    return "ProjectInfo{" +
           "libraries=" + libraries +
           ", targets=" + targets +
           '}';
  }
}


text:
<?php
	// Time format
	$start_time = date("Y/m/d H:i:s",strtotime($contestItem['start_time']));
	$end_time = date("Y/m/d H:i:s",strtotime($contestItem['end_time']));

	// Check if user can taking part in this contest (private / password check)
	$contestAuthResult = false;
	$contestStarted = true; // auth failed because contest not started?
	$contestUsePassword = ($contestItem['password'] == '') ? false : true;

	// m{cid}: contest modifier, c{cid}: contest user.
	if (time()>strtotime($contestItem['end_time'])) $contestAuthResult = true;
	else {
		if (havePrivilege("CONTEST_EDITOR") || isset($_SESSION["m{$cid}"]) || isset($_SESSION["c{$cid}"])) $contestAuthResult = true;
	}

	if ($contestUsePassword == false && time()>strtotime($contestItem['start_time']) && !$contestItem['private']) $contestAuthResult = true;
	if (time()<strtotime($contestItem['start_time']) && $contestAuthResult == true) {
		$contestAuthResult = false;
		$contestStarted = false;
	}
?>

	<?php
		if (isset($pid) && $contestAuthResult) echo $ALPHABET_N_NUM[$pid]." : ".$problemItem['title'];
		else echo $contestItem['title'];
	?>

		<a type="button" href="contest.php?cid=<?php echo $cid;?>" class="btn btn-default"><?php echo L_OVERVIEW; ?>
		<a type="button" href="contest_problemset.php?cid=<?php echo $cid;?>" class="btn btn-default"><?php echo L_PROB_SET; ?>
		<a type="button" href="contest_status.php?cid=<?php echo $cid;?>" class="btn btn-default"><?php echo L_STATUS; ?>
		<a type="button" href="contest_ranklist.php?cid=<?php echo $cid;?>" class="btn btn-default"><?php echo L_RANKLIST; ?>
		<?php if (function_exists('havePrivilege') && havePrivilege("CONTEST_EDITOR")) { ?>
		<a type="button" href="./admin/contest_editor.php?cid=<?php echo $cid;?>" class="btn  btn-warning"><?php echo L_EDIT; ?>
		<?php } ?>

			Progress Bar

	<?php if (isset($pid) && $contestAuthResult) { ?>

		<?php echo L_TIME_LIMIT;?>:<?php echo $problemItem['time_limit']." Sec";?>
		<?php echo L_MEM_LIMIT;?>:<?php echo $problemItem['memory_limit']." MiB";?>

		<?php echo L_SUBMIT;?>:<?php echo $problemItem['submit'];?>
		<?php echo L_JUDGE_AC;?>:<?php echo $problemItem['accepted'];?>

		<a id="oj-p-submit" class="btn btn-primary" href="./problemsubmit.php?pid=<?php echo $pid."&cid=".$cid;?>" role="button"><?php echo L_SUBMIT;?>

		<?php if ($isProblemManager) { ?><a class="btn btn-primary" href="./admin/problem_editor.php?nid=<?php echo $problemItem['problem_id'];?>" role="button"><?php echo L_EDIT;?><?php } ?>

	<?php } ?>

	<?php
		if (!$contestAuthResult) require("./pages/components/contest_not_auth.php");
	?>


text:
namespace {

dependency_graph::InAttr<lightfields::Samples> a_samples;
dependency_graph::InAttr<Imath::Vec2<unsigned>> a_size;
dependency_graph::OutAttr<possumwood::opencv::Frame> a_out, a_norm, a_correspondence;

dependency_graph::State compute(dependency_graph::Values& data) {
	// integration
	auto tmp = lightfields::nearest::integrate(data.get(a_samples), data.get(a_size));

	data.set(a_out, possumwood::opencv::Frame(tmp.average));
	data.set(a_norm, possumwood::opencv::Frame(tmp.samples));

	// correspondence
	auto corresp = lightfields::nearest::correspondence(data.get(a_samples), tmp);

	data.set(a_correspondence, possumwood::opencv::Frame(corresp));

	return dependency_graph::State();
}

void init(possumwood::Metadata& meta) {
	meta.addAttribute(a_samples, "samples", lightfields::Samples(), possumwood::AttrFlags::kVertical);
	meta.addAttribute(a_size, "size", Imath::Vec2<unsigned>(300u, 300u));
	meta.addAttribute(a_out, "out_frame", possumwood::opencv::Frame(), possumwood::AttrFlags::kVertical);
	meta.addAttribute(a_norm, "sample_count", possumwood::opencv::Frame(), possumwood::AttrFlags::kVertical);
	meta.addAttribute(a_correspondence, "correspondence", possumwood::opencv::Frame(),
	                  possumwood::AttrFlags::kVertical);

	meta.addInfluence(a_samples, a_out);
	meta.addInfluence(a_size, a_out);

	meta.addInfluence(a_samples, a_norm);
	meta.addInfluence(a_size, a_norm);

	meta.addInfluence(a_samples, a_correspondence);
	meta.addInfluence(a_size, a_correspondence);

	meta.setCompute(compute);
}

possumwood::NodeImplementation s_impl("opencv/lightfields/integrate_nearest", init);

}  // namespace


text:
export default class EventEmitter {
    #events = [];

    constructor() {
        this.on = this.on.bind(this);
        this.off = this.off.bind(this);
        this.emit = this.emit.bind(this);
        this.once = this.once.bind(this);
        this.removeListener = this.removeListener.bind(this);
    }

    on(event, listener) {
        if (!this.#events[event]) {
            this.#events[event] = [];
        }

        this.#events[event].push(listener);

        return this;
    }

    off(event, listener) {
        this.removeListener(event, listener);

        return this;
    }

    removeListener(event, listener) {
        if (this.#events[event]) {
            const idx = this.#events[event].indexOf(listener);
            if (idx > -1) {
                this.#events[event].splice(idx, 1);
            }
        }
    }

    emit(event, ...args) {
        if (this.#events[event]) {
            this.#events[event].forEach((listener) => listener(...args));
        }
    }

    once(event, listener) {
        const listenerWrapper = (...args) => {
            this.removeListener(event, listenerWrapper);
            listener(...args);
        };

        this.on(event, listenerWrapper);
    }
}


text:
#ifndef ClientRect_h
#define ClientRect_h

#include "FloatRect.h"
#include "ScriptWrappable.h"
#include <wtf/Ref.h>
#include <wtf/RefCounted.h>

namespace WebCore {

    class IntRect;

    class ClientRect : public ScriptWrappable, public RefCounted<ClientRect> {
    public:
        static Ref<ClientRect> create() { return adoptRef(*new ClientRect); }
        static Ref<ClientRect> create(const IntRect& rect) { return adoptRef(*new ClientRect(rect)); }
        static Ref<ClientRect> create(const FloatRect& rect) { return adoptRef(*new ClientRect(rect)); }

        float top() const { return m_rect.y(); }
        float right() const { return m_rect.maxX(); }
        float bottom() const { return m_rect.maxY(); }
        float left() const { return m_rect.x(); }
        float width() const { return m_rect.width(); }
        float height() const { return m_rect.height(); }

    private:
        WEBCORE_EXPORT ClientRect();
        WEBCORE_EXPORT explicit ClientRect(const IntRect&);
        WEBCORE_EXPORT explicit ClientRect(const FloatRect&);

        FloatRect m_rect;
    };

} // namespace WebCore

#endif // ClientRect_h


text:
package objectDeregister;

public class ObjectDeregisterImpl {

    public static void task1(int n, Dummy d1) { // Writes
        d1.setDummyNumber(n);
    }

    public static void task2(int n, Dummy d2) { // Writes
        d2.setDummyNumber(n);
    }

    public static void task3(Dummy d3) { // Reads
        d3.getDummyNumber();
    }

    public static void task4() throws Exception { // Null
        System.gc();
        Thread.sleep(100);
        int k = ClassInstanceTest.countInstances(Dummy.class);
        if (k > 0) {
            throw new Exception(
                "[ERROR] At the end in the WORKER" + String.valueOf(k) + " instances of the Dummy object were found");
        }
    }

}