text:
using Newtonsoft.Json.Linq;
using System;
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text;

namespace level_machine {
    internal class ReplayReader {
        public static JObject Read(byte[] data) {
            var s1 = new BinaryReader(new MemoryStream(data));
            if (!s1.ReadBytes(6).SequenceEqual(new[]{'D', 'F', '_', 'R', 'P', 'L'}.Select(c => (byte) c)))
                throw new InvalidDataException();
            var unk1 = s1.ReadByte();
            var user = Encoding.ASCII.GetString(s1.ReadBytes(s1.ReadInt16()));
            if (!s1.ReadBytes(6).SequenceEqual(new[]{'D', 'F', '_', 'R', 'P', 'L'}.Select(c => (byte) c)))
                throw new InvalidDataException();
            var unk2 = s1.ReadByte();
            var unk3 = s1.ReadInt16();
            var uncompressedDataLen = s1.ReadInt32();
            var frames = s1.ReadInt32();
            var character = s1.ReadByte();
            var level = Encoding.ASCII.GetString(s1.ReadBytes(s1.ReadByte()));

            s1.ReadInt16();  // skip two-byte zlib header
            var deflate = new DeflateStream(s1.BaseStream, CompressionMode.Decompress);
            var innerData = new byte[uncompressedDataLen];
            deflate.Read(innerData, 0, uncompressedDataLen);

            var s2 = new BinaryReader(new MemoryStream(innerData));
            var inputsTotalLen = s2.ReadInt32();
            var inputs = JArray.FromObject(Enumerable.Range(0, 7).Select(i => {
                var raw = new BitStream(s2.ReadBytes(s2.ReadInt32()));
                var ret = new StringBuilder();
                var buf = new byte[1];
                var oldVal = 0;
                while (true) {
                    raw.Read(buf, 8);
                    var fs = buf[0];
                    Console.WriteLine(fs);
                    if (fs == 0xff)
                        break;
                    raw.Read(buf, i >= 5 ? 4 : 2);
                    var val = buf[0];
                    Console.WriteLine(val);

                    for (var z = 0; z <= fs; ++z)
                        ret.Append((char) (oldVal + (oldVal < 10 ? '0' : 'a' - 10)));
                    oldVal = val;
                }
                ret.Remove(0, 1);
                return ret.ToString();
            }));
            Debug.Assert(s2.BaseStream.Position == inputsTotalLen + 4);
            var sync = JArray.FromObject(Enumerable.Range(0, s2.ReadInt32()).Select(i => {
                var entityUid = s2.ReadInt32();
                var unkA = s2.ReadInt32();  // this looks like a 1-based index of the entity sync info in a scrambled order?
                var corrections = JArray.FromObject(Enumerable.Range(0, s2.ReadInt32()).Select(j => {
                    return Enumerable.Range(0, 5).Select(k => s2.ReadInt32());
                }));
                return new JObject {
                    {"entity_uid", entityUid},
//                    {"unkA", unkA},
                    {"corrections", corrections},
                };
            }));
            return new JObject {
                {"user", user},
                {"level", level},
//                {"unk1", unk1},
//                {"unk2", unk2},
//                {"unk3", unk3},
                {"frames", frames},
                {"character", character},
                {"inputs", inputs},
                {"sync", sync},
            };
        }
    }
}


text:
#pragma once

#include <cutils/list.h>

#include "log_portability.h"

__BEGIN_DECLS

extern struct listnode __android_log_transport_write;
extern struct listnode __android_log_persist_write;

#define write_transport_for_each(transp, transports)                           \
  for ((transp) = node_to_item((transports)->next,                             \
                               struct android_log_transport_write, node);      \
       ((transp) != node_to_item((transports),                                 \
                                 struct android_log_transport_write, node)) && \
       ((transp) != node_to_item((transp)->node.next,                          \
                                 struct android_log_transport_write, node));   \
       (transp) = node_to_item((transp)->node.next,                            \
                               struct android_log_transport_write, node))

#define write_transport_for_each_safe(transp, n, transports)                   \
  for ((transp) = node_to_item((transports)->next,                             \
                               struct android_log_transport_write, node),      \
      (n) = (transp)->node.next;                                               \
       ((transp) != node_to_item((transports),                                 \
                                 struct android_log_transport_write, node)) && \
       ((transp) !=                                                            \
        node_to_item((n), struct android_log_transport_write, node));          \
       (transp) = node_to_item((n), struct android_log_transport_write, node), \
      (n) = (transp)->node.next)

void __android_log_config_write();
void __android_log_config_write_close();

__END_DECLS

redpajama_set_name: RedPajamaGithub


text:
namespace drive {
namespace util {

namespace {

std::string ReadStringFromGDocFile(const base::FilePath& file_path,
                                   const std::string& key) {
  const int64_t kMaxGDocSize = 4096;
  int64_t file_size = 0;
  if (!base::GetFileSize(file_path, &file_size) || file_size > kMaxGDocSize) {
    LOG(WARNING) << "File too large to be a GDoc file " << file_path.value();
    return std::string();
  }

  JSONFileValueDeserializer reader(file_path);
  std::string error_message;
  std::unique_ptr<base::Value> root_value(
      reader.Deserialize(nullptr, &error_message));
  if (!root_value) {
    LOG(WARNING) << "Failed to parse " << file_path.value() << " as JSON."
                 << " error = " << error_message;
    return std::string();
  }

  base::DictionaryValue* dictionary_value = nullptr;
  std::string result;
  if (!root_value->GetAsDictionary(&dictionary_value) ||
      !dictionary_value->GetString(key, &result)) {
    LOG(WARNING) << "No value for the given key is stored in "
                 << file_path.value() << ". key = " << key;
    return std::string();
  }

  return result;
}

}  // namespace

const base::FilePath& GetDriveGrandRootPath() {
  static base::NoDestructor<base::FilePath> grand_root_path(
      base::FilePath::FromUTF8Unsafe(kDriveGrandRootDirName));
  return *grand_root_path;
}

std::string ConvertChangestampToStartPageToken(int64_t changestamp) {
  DCHECK_LE(0, changestamp);
  return base::NumberToString(changestamp + 1);
}

GURL ReadUrlFromGDocFile(const base::FilePath& file_path) {
  return GURL(ReadStringFromGDocFile(file_path, "url"));
}

std::string ReadResourceIdFromGDocFile(const base::FilePath& file_path) {
  return ReadStringFromGDocFile(file_path, "resource_id");
}

}  // namespace util
}  // namespace drive


text:
using System.Web.Mvc;
using TwitterBootstrapMVC.Infrastructure;

namespace TwitterBootstrapMVC.Controls
{
    public class AlertBuilder<TModel> : BuilderBase<TModel, Alert>
    {
        internal AlertBuilder(HtmlHelper<TModel> htmlHelper, Alert alert)
            : base(htmlHelper, alert)
        {
            if (this.element._closeable)
                base.textWriter.Write(@"<button type=""button"" class=""close"" data-dismiss=""alert"">×</button>");
        }
    }
}


text:
export type ConstantShape = <T>(val: T) => () => T

const Constant: ConstantShape = (value) => () => value

export default Constant


text: export { default } from 'ember-cli-dashboardable/services/dashboard-injector';


text:
package io.flow.build

import io.apibuilder.spec.v0.models.Service
import io.flow.{lint, oneapi, proxy, stream}

object Main extends App {

  import scala.concurrent.ExecutionContext.Implicits.global

  private[this] val globalErrors = scala.collection.mutable.ListBuffer[String]()

  private[this] def controllers(buildType: BuildType): Seq[Controller] = {
    val all = scala.collection.mutable.ListBuffer[Controller]()
    all.append(lint.Controller())
    all.append(stream.Controller())
    if (buildType.oneApi) {
      all.append(oneapi.Controller())
    }
    if (buildType.proxy) {
      all.append(proxy.Controller())
    }
    all.toSeq
  }

  ApibuilderConfig.load() match {
    case Left(error) => {
      println(s"** Error loading apibuilder config: $error")
      System.exit(1)
    }
    case Right(profile) => {
      implicit val buildTypeRead: scopt.Read[BuildType] =
        scopt.Read.reads(s => BuildType.fromString(s).getOrElse(sys.error(s"Unknown BuildType '$s'")))

      val parser = new scopt.OptionParser[Config]("api-build") {
        override def showUsageOnError = Some(true)

        arg[BuildType]("<build type>")
          .action((bt, c) => c.copy(buildType = bt))
          .text("One of: " + BuildType.all.map(_.toString).mkString(", "))
          .required()

        arg[String]("<build command>")
          .action((cmd, c) => c.copy(buildCommand = cmd))
          .text("One of: " + controllers(BuildType.Api).map(_.command).mkString("all, ", ", ", ""))
          .required()

        arg[String]("<flow/experience>...")
          .text("API specs from APIBuilder")
          .action((api, c) => c.copy(apis = c.apis :+ api))
          .unbounded()
          .optional()
          .validate(api => Application.parse(api) match {
            case Some(_) => success
            case None => failure(s"Could not parse application[$api]")
          })

        help("help")

        checkConfig(c => {
          val selected = if (c.buildCommand == "all") {
            controllers(c.buildType)
          } else {
            controllers(c.buildType).filter(_.command == c.buildCommand)
          }
          selected.toList match {
            case Nil => {
              failure(s"Invalid command[${c.buildCommand}] for build type[${c.buildType}]. " +
                s"Must be one of: all, " + controllers(c.buildType).map(_.command).mkString(", "))
            }
            case _ => {
              success
            }
          }
        })
      }

      parser.parse(args, Config()) match {
        case Some(config) =>
          val selected = if (config.buildCommand == "all") {
            controllers(config.buildType)
          } else {
            controllers(config.buildType).filter(_.command == config.buildCommand)
          }

          val allApplications: Seq[Application] = config.apis.flatMap { name =>
            Application.parse(name)
          }

          val dl = DownloadCache(Downloader(profile))
          dl.downloadServices(allApplications) match {
            case Left(errors) => {
              println(s"Errors downloading services:")
              errors.foreach { e => println(s" - $e")}
              System.exit(errors.length)
            }
            case Right(services) => run(config.buildType, dl, selected, services)
          }
        case None =>
          // error message already printed
      }
    }
  }

  private[this] def run(buildType: BuildType, downloadCache: DownloadCache, controllers: Seq[Controller], services: Seq[Service]): Unit = {
    val errors = scala.collection.mutable.Map[String, Seq[String]]()
    if (globalErrors.nonEmpty) {
      errors += ("config" -> globalErrors.toSeq)
    }

    controllers.foreach { controller =>
      println("==================================================")
      println(s"${controller.name} Starting")
      println("==================================================")

      controller.run(buildType, downloadCache, services)
      controller.errors().foreach {
        case (key, errs) => {
          errors.get(key) match {
            case None => {
              errors.put(key, errs)
            }
            case Some(existing) => {
              errors.put(key, existing ++ errs)
            }
          }
        }
      }
    }

    println("")
    errors.size match {
      case 0 => println(s"SUMMARY: NO ERRORS")
      case 1 => println(s"SUMMARY: 1 ERROR")
      case n => println(s"SUMMARY: $n ERRORS")
    }
    errors.keys.toSeq.sorted foreach { key =>
      println(key)
      errors(key).foreach { err =>
        println(s"  - $err")
      }
      println("")
    }
    println("")
    System.exit(errors.size)
  }

}


text:
package com.amazonaws.services.workspaces.model;

import java.io.Serializable;
import javax.annotation.Generated;

import com.amazonaws.AmazonWebServiceRequest;

/**
 *

 * Contains the inputs for the DescribeWorkspaces operation.
 *

 *
 * @see AWS API
 *      Documentation
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class DescribeWorkspacesRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {

    /**
     *

     * An array of strings that contain the identifiers of the WorkSpaces for which to retrieve information. This
     * parameter cannot be combined with any other filter parameter.
     *

     *

     * Because the CreateWorkspaces operation is asynchronous, the identifier it returns is not immediately
     * available. If you immediately call DescribeWorkspaces with this identifier, no information is returned.
     *

     */
    private com.amazonaws.internal.SdkInternalList<String> workspaceIds;
    /**
     *

     * Specifies the directory identifier to which to limit the WorkSpaces. Optionally, you can specify a specific
     * directory user with the UserName parameter. This parameter cannot be combined with any other filter
     * parameter.
     *

     */
    private String directoryId;
    /**
     *

     * Used with the DirectoryId parameter to specify the directory user for whom to obtain the WorkSpace.
     *

     */
    private String userName;
    /**
     *

     * The identifier of a bundle to obtain the WorkSpaces for. All WorkSpaces that are created from this bundle will be
     * retrieved. This parameter cannot be combined with any other filter parameter.
     *

     */
    private String bundleId;
    /**
     *

     * The maximum number of items to return.
     *

     */
    private Integer limit;
    /**
     *

     * The NextToken value from a previous call to this operation. Pass null if this is the first call.
     *

     */
    private String nextToken;

    /**
     *

     * An array of strings that contain the identifiers of the WorkSpaces for which to retrieve information. This
     * parameter cannot be combined with any other filter parameter.
     *

     *

     * Because the CreateWorkspaces operation is asynchronous, the identifier it returns is not immediately
     * available. If you immediately call DescribeWorkspaces with this identifier, no information is returned.
     *

     *
     * @return An array of strings that contain the identifiers of the WorkSpaces for which to retrieve information.
     *         This parameter cannot be combined with any other filter parameter.

     *

     *         Because the CreateWorkspaces operation is asynchronous, the identifier it returns is not
     *         immediately available. If you immediately call DescribeWorkspaces with this identifier, no
     *         information is returned.
     */

    public java.util.List<String> getWorkspaceIds() {
        if (workspaceIds == null) {
            workspaceIds = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return workspaceIds;
    }

    /**
     *

     * An array of strings that contain the identifiers of the WorkSpaces for which to retrieve information. This
     * parameter cannot be combined with any other filter parameter.
     *

     *

     * Because the CreateWorkspaces operation is asynchronous, the identifier it returns is not immediately
     * available. If you immediately call DescribeWorkspaces with this identifier, no information is returned.
     *

     *
     * @param workspaceIds
     *        An array of strings that contain the identifiers of the WorkSpaces for which to retrieve information. This
     *        parameter cannot be combined with any other filter parameter.

     *

     *        Because the CreateWorkspaces operation is asynchronous, the identifier it returns is not
     *        immediately available. If you immediately call DescribeWorkspaces with this identifier, no
     *        information is returned.
     */

    public void setWorkspaceIds(java.util.Collection<String> workspaceIds) {
        if (workspaceIds == null) {
            this.workspaceIds = null;
            return;
        }

        this.workspaceIds = new com.amazonaws.internal.SdkInternalList<String>(workspaceIds);
    }

    /**
     *

     * An array of strings that contain the identifiers of the WorkSpaces for which to retrieve information. This
     * parameter cannot be combined with any other filter parameter.
     *

     *

     * Because the CreateWorkspaces operation is asynchronous, the identifier it returns is not immediately
     * available. If you immediately call DescribeWorkspaces with this identifier, no information is returned.
     *

     *

     * NOTE: This method appends the values to the existing list (if any). Use
     * {@link #setWorkspaceIds(java.util.Collection)} or {@link #withWorkspaceIds(java.util.Collection)} if you want to
     * override the existing values.
     *

     *
     * @param workspaceIds
     *        An array of strings that contain the identifiers of the WorkSpaces for which to retrieve information. This
     *        parameter cannot be combined with any other filter parameter.

     *

     *        Because the CreateWorkspaces operation is asynchronous, the identifier it returns is not
     *        immediately available. If you immediately call DescribeWorkspaces with this identifier, no
     *        information is returned.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeWorkspacesRequest withWorkspaceIds(String... workspaceIds) {
        if (this.workspaceIds == null) {
            setWorkspaceIds(new com.amazonaws.internal.SdkInternalList<String>(workspaceIds.length));
        }
        for (String ele : workspaceIds) {
            this.workspaceIds.add(ele);
        }
        return this;
    }

    /**
     *

     * An array of strings that contain the identifiers of the WorkSpaces for which to retrieve information. This
     * parameter cannot be combined with any other filter parameter.
     *

     *

     * Because the CreateWorkspaces operation is asynchronous, the identifier it returns is not immediately
     * available. If you immediately call DescribeWorkspaces with this identifier, no information is returned.
     *

     *
     * @param workspaceIds
     *        An array of strings that contain the identifiers of the WorkSpaces for which to retrieve information. This
     *        parameter cannot be combined with any other filter parameter.

     *

     *        Because the CreateWorkspaces operation is asynchronous, the identifier it returns is not
     *        immediately available. If you immediately call DescribeWorkspaces with this identifier, no
     *        information is returned.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeWorkspacesRequest withWorkspaceIds(java.util.Collection<String> workspaceIds) {
        setWorkspaceIds(workspaceIds);
        return this;
    }

    /**
     *

     * Specifies the directory identifier to which to limit the WorkSpaces. Optionally, you can specify a specific
     * directory user with the UserName parameter. This parameter cannot be combined with any other filter
     * parameter.
     *

     *
     * @param directoryId
     *        Specifies the directory identifier to which to limit the WorkSpaces. Optionally, you can specify a
     *        specific directory user with the UserName parameter. This parameter cannot be combined with
     *        any other filter parameter.
     */

    public void setDirectoryId(String directoryId) {
        this.directoryId = directoryId;
    }

    /**
     *

     * Specifies the directory identifier to which to limit the WorkSpaces. Optionally, you can specify a specific
     * directory user with the UserName parameter. This parameter cannot be combined with any other filter
     * parameter.
     *

     *
     * @return Specifies the directory identifier to which to limit the WorkSpaces. Optionally, you can specify a
     *         specific directory user with the UserName parameter. This parameter cannot be combined with
     *         any other filter parameter.
     */

    public String getDirectoryId() {
        return this.directoryId;
    }

    /**
     *

     * Specifies the directory identifier to which to limit the WorkSpaces. Optionally, you can specify a specific
     * directory user with the UserName parameter. This parameter cannot be combined with any other filter
     * parameter.
     *

     *
     * @param directoryId
     *        Specifies the directory identifier to which to limit the WorkSpaces. Optionally, you can specify a
     *        specific directory user with the UserName parameter. This parameter cannot be combined with
     *        any other filter parameter.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeWorkspacesRequest withDirectoryId(String directoryId) {
        setDirectoryId(directoryId);
        return this;
    }

    /**
     *

     * Used with the DirectoryId parameter to specify the directory user for whom to obtain the WorkSpace.
     *

     *
     * @param userName
     *        Used with the DirectoryId parameter to specify the directory user for whom to obtain the
     *        WorkSpace.
     */

    public void setUserName(String userName) {
        this.userName = userName;
    }

    /**
     *

     * Used with the DirectoryId parameter to specify the directory user for whom to obtain the WorkSpace.
     *

     *
     * @return Used with the DirectoryId parameter to specify the directory user for whom to obtain the
     *         WorkSpace.
     */

    public String getUserName() {
        return this.userName;
    }

    /**
     *

     * Used with the DirectoryId parameter to specify the directory user for whom to obtain the WorkSpace.
     *

     *
     * @param userName
     *        Used with the DirectoryId parameter to specify the directory user for whom to obtain the
     *        WorkSpace.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeWorkspacesRequest withUserName(String userName) {
        setUserName(userName);
        return this;
    }

    /**
     *

     * The identifier of a bundle to obtain the WorkSpaces for. All WorkSpaces that are created from this bundle will be
     * retrieved. This parameter cannot be combined with any other filter parameter.
     *

     *
     * @param bundleId
     *        The identifier of a bundle to obtain the WorkSpaces for. All WorkSpaces that are created from this bundle
     *        will be retrieved. This parameter cannot be combined with any other filter parameter.
     */

    public void setBundleId(String bundleId) {
        this.bundleId = bundleId;
    }

    /**
     *

     * The identifier of a bundle to obtain the WorkSpaces for. All WorkSpaces that are created from this bundle will be
     * retrieved. This parameter cannot be combined with any other filter parameter.
     *

     *
     * @return The identifier of a bundle to obtain the WorkSpaces for. All WorkSpaces that are created from this bundle
     *         will be retrieved. This parameter cannot be combined with any other filter parameter.
     */

    public String getBundleId() {
        return this.bundleId;
    }

    /**
     *

     * The identifier of a bundle to obtain the WorkSpaces for. All WorkSpaces that are created from this bundle will be
     * retrieved. This parameter cannot be combined with any other filter parameter.
     *

     *
     * @param bundleId
     *        The identifier of a bundle to obtain the WorkSpaces for. All WorkSpaces that are created from this bundle
     *        will be retrieved. This parameter cannot be combined with any other filter parameter.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeWorkspacesRequest withBundleId(String bundleId) {
        setBundleId(bundleId);
        return this;
    }

    /**
     *

     * The maximum number of items to return.
     *

     *
     * @param limit
     *        The maximum number of items to return.
     */

    public void setLimit(Integer limit) {
        this.limit = limit;
    }

    /**
     *

     * The maximum number of items to return.
     *

     *
     * @return The maximum number of items to return.
     */

    public Integer getLimit() {
        return this.limit;
    }

    /**
     *

     * The maximum number of items to return.
     *

     *
     * @param limit
     *        The maximum number of items to return.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeWorkspacesRequest withLimit(Integer limit) {
        setLimit(limit);
        return this;
    }

    /**
     *

     * The NextToken value from a previous call to this operation. Pass null if this is the first call.
     *

     *
     * @param nextToken
     *        The NextToken value from a previous call to this operation. Pass null if this is the first
     *        call.
     */

    public void setNextToken(String nextToken) {
        this.nextToken = nextToken;
    }

    /**
     *

     * The NextToken value from a previous call to this operation. Pass null if this is the first call.
     *

     *
     * @return The NextToken value from a previous call to this operation. Pass null if this is the first
     *         call.
     */

    public String getNextToken() {
        return this.nextToken;
    }

    /**
     *

     * The NextToken value from a previous call to this operation. Pass null if this is the first call.
     *

     *
     * @param nextToken
     *        The NextToken value from a previous call to this operation. Pass null if this is the first
     *        call.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public DescribeWorkspacesRequest withNextToken(String nextToken) {
        setNextToken(nextToken);
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getWorkspaceIds() != null)
            sb.append("WorkspaceIds: ").append(getWorkspaceIds()).append(",");
        if (getDirectoryId() != null)
            sb.append("DirectoryId: ").append(getDirectoryId()).append(",");
        if (getUserName() != null)
            sb.append("UserName: ").append(getUserName()).append(",");
        if (getBundleId() != null)
            sb.append("BundleId: ").append(getBundleId()).append(",");
        if (getLimit() != null)
            sb.append("Limit: ").append(getLimit()).append(",");
        if (getNextToken() != null)
            sb.append("NextToken: ").append(getNextToken());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof DescribeWorkspacesRequest == false)
            return false;
        DescribeWorkspacesRequest other = (DescribeWorkspacesRequest) obj;
        if (other.getWorkspaceIds() == null ^ this.getWorkspaceIds() == null)
            return false;
        if (other.getWorkspaceIds() != null && other.getWorkspaceIds().equals(this.getWorkspaceIds()) == false)
            return false;
        if (other.getDirectoryId() == null ^ this.getDirectoryId() == null)
            return false;
        if (other.getDirectoryId() != null && other.getDirectoryId().equals(this.getDirectoryId()) == false)
            return false;
        if (other.getUserName() == null ^ this.getUserName() == null)
            return false;
        if (other.getUserName() != null && other.getUserName().equals(this.getUserName()) == false)
            return false;
        if (other.getBundleId() == null ^ this.getBundleId() == null)
            return false;
        if (other.getBundleId() != null && other.getBundleId().equals(this.getBundleId()) == false)
            return false;
        if (other.getLimit() == null ^ this.getLimit() == null)
            return false;
        if (other.getLimit() != null && other.getLimit().equals(this.getLimit()) == false)
            return false;
        if (other.getNextToken() == null ^ this.getNextToken() == null)
            return false;
        if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getWorkspaceIds() == null) ? 0 : getWorkspaceIds().hashCode());
        hashCode = prime * hashCode + ((getDirectoryId() == null) ? 0 : getDirectoryId().hashCode());
        hashCode = prime * hashCode + ((getUserName() == null) ? 0 : getUserName().hashCode());
        hashCode = prime * hashCode + ((getBundleId() == null) ? 0 : getBundleId().hashCode());
        hashCode = prime * hashCode + ((getLimit() == null) ? 0 : getLimit().hashCode());
        hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
        return hashCode;
    }

    @Override
    public DescribeWorkspacesRequest clone() {
        return (DescribeWorkspacesRequest) super.clone();
    }

}


text:
namespace v8 {
namespace internal {

// The Zone supports very fast allocation of small chunks of
// memory. The chunks cannot be deallocated individually, but instead
// the Zone supports deallocating all chunks in one fast
// operation. The Zone is used to hold temporary data structures like
// the abstract syntax tree, which is deallocated after compilation.
//
// Note: There is no need to initialize the Zone; the first time an
// allocation is attempted, a segment of memory will be requested
// through the allocator.
//
// Note: The implementation is inherently not thread safe. Do not use
// from multi-threaded code.

enum class SegmentSize { kLarge, kDefault };

class V8_EXPORT_PRIVATE Zone final {
 public:
  Zone(AccountingAllocator* allocator, const char* name,
       SegmentSize segment_size = SegmentSize::kDefault);
  ~Zone();

  // Allocate 'size' bytes of memory in the Zone; expands the Zone by
  // allocating new segments of memory on demand using malloc().
  void* New(size_t size) {
#ifdef V8_USE_ADDRESS_SANITIZER
    return AsanNew(size);
#else
    size = RoundUp(size, kAlignmentInBytes);
    Address result = position_;
    if (V8_UNLIKELY(size > limit_ - position_)) {
      result = NewExpand(size);
    } else {
      position_ += size;
    }
    return reinterpret_cast<void*>(result);
#endif
  }
  void* AsanNew(size_t size);

  template <typename T>
  T* NewArray(size_t length) {
    DCHECK_LT(length, std::numeric_limits<size_t>::max() / sizeof(T));
    return static_cast<T*>(New(length * sizeof(T)));
  }

  // Seals the zone to prevent any further allocation.
  void Seal() { sealed_ = true; }

  // Allows the zone to be safely reused. Releases the memory and fires zone
  // destruction and creation events for the accounting allocator.
  void ReleaseMemory();

  // Returns true if more memory has been allocated in zones than
  // the limit allows.
  bool excess_allocation() const {
    return segment_bytes_allocated_ > kExcessLimit;
  }

  const char* name() const { return name_; }

  size_t allocation_size() const {
    size_t extra = segment_head_ ? position_ - segment_head_->start() : 0;
    return allocation_size_ + extra;
  }

  AccountingAllocator* allocator() const { return allocator_; }

 private:
  // Deletes all objects and free all memory allocated in the Zone.
  void DeleteAll();

  // All pointers returned from New() are 8-byte aligned.
  static const size_t kAlignmentInBytes = 8;

  // Never allocate segments smaller than this size in bytes.
  static const size_t kMinimumSegmentSize = 8 * KB;

  // Never allocate segments larger than this size in bytes.
  static const size_t kMaximumSegmentSize = 1 * MB;

  // Report zone excess when allocation exceeds this limit.
  static const size_t kExcessLimit = 256 * MB;

  // The number of bytes allocated in this zone so far.
  size_t allocation_size_;

  // The number of bytes allocated in segments.  Note that this number
  // includes memory allocated from the OS but not yet allocated from
  // the zone.
  size_t segment_bytes_allocated_;

  // Expand the Zone to hold at least 'size' more bytes and allocate
  // the bytes. Returns the address of the newly allocated chunk of
  // memory in the Zone. Should only be called if there isn't enough
  // room in the Zone already.
  Address NewExpand(size_t size);

  // Creates a new segment, sets it size, and pushes it to the front
  // of the segment chain. Returns the new segment.
  inline Segment* NewSegment(size_t requested_size);

  // The free region in the current (front) segment is represented as
  // the half-open interval [position, limit). The 'position' variable
  // is guaranteed to be aligned as dictated by kAlignment.
  Address position_;
  Address limit_;

  AccountingAllocator* allocator_;

  Segment* segment_head_;
  const char* name_;
  bool sealed_;
  SegmentSize segment_size_;
};

// ZoneObject is an abstraction that helps define classes of objects
// allocated in the Zone. Use it as a base class; see ast.h.
class ZoneObject {
 public:
  // Allocate a new ZoneObject of 'size' bytes in the Zone.
  void* operator new(size_t size, Zone* zone) { return zone->New(size); }

  // Ideally, the delete operator should be private instead of
  // public, but unfortunately the compiler sometimes synthesizes
  // (unused) destructors for classes derived from ZoneObject, which
  // require the operator to be visible. MSVC requires the delete
  // operator to be public.

  // ZoneObjects should never be deleted individually; use
  // Zone::DeleteAll() to delete all zone objects in one go.
  void operator delete(void*, size_t) { UNREACHABLE(); }
  void operator delete(void* pointer, Zone* zone) { UNREACHABLE(); }
};

// The ZoneAllocationPolicy is used to specialize generic data
// structures to allocate themselves and their elements in the Zone.
class ZoneAllocationPolicy final {
 public:
  explicit ZoneAllocationPolicy(Zone* zone) : zone_(zone) {}
  void* New(size_t size) { return zone()->New(size); }
  static void Delete(void* pointer) {}
  Zone* zone() const { return zone_; }

 private:
  Zone* zone_;
};

template <typename T>
class Vector;

// ZoneLists are growable lists with constant-time access to the
// elements. The list itself and all its elements are allocated in the
// Zone. ZoneLists cannot be deleted individually; you can delete all
// objects in the Zone by calling Zone::DeleteAll().
template <typename T>
class ZoneList final {
 public:
  // Construct a new ZoneList with the given capacity; the length is
  // always zero. The capacity must be non-negative.
  ZoneList(int capacity, Zone* zone) { Initialize(capacity, zone); }
  // Construct a new ZoneList from a std::initializer_list
  ZoneList(std::initializer_list<T> list, Zone* zone) {
    Initialize(static_cast<int>(list.size()), zone);
    for (auto& i : list) Add(i, zone);
  }
  // Construct a new ZoneList by copying the elements of the given ZoneList.
  ZoneList(const ZoneList<T>& other, Zone* zone) {
    Initialize(other.length(), zone);
    AddAll(other, zone);
  }

  V8_INLINE ~ZoneList() { DeleteData(data_); }

  // Please the MSVC compiler.  We should never have to execute this.
  V8_INLINE void operator delete(void* p, ZoneAllocationPolicy allocator) {
    UNREACHABLE();
  }

  void* operator new(size_t size, Zone* zone) { return zone->New(size); }

  // Returns a reference to the element at index i. This reference is not safe
  // to use after operations that can change the list's backing store
  // (e.g. Add).
  inline T& operator[](int i) const {
    DCHECK_LE(0, i);
    DCHECK_GT(static_cast<unsigned>(length_), static_cast<unsigned>(i));
    return data_[i];
  }
  inline T& at(int i) const { return operator[](i); }
  inline T& last() const { return at(length_ - 1); }
  inline T& first() const { return at(0); }

  typedef T* iterator;
  inline iterator begin() const { return &data_[0]; }
  inline iterator end() const { return &data_[length_]; }

  V8_INLINE bool is_empty() const { return length_ == 0; }
  V8_INLINE int length() const { return length_; }
  V8_INLINE int capacity() const { return capacity_; }

  Vector<T> ToVector() const { return Vector<T>(data_, length_); }
  Vector<T> ToVector(int start, int length) const {
    return Vector<T>(data_ + start, std::min(length_ - start, length));
  }

  Vector<const T> ToConstVector() const {
    return Vector<const T>(data_, length_);
  }

  V8_INLINE void Initialize(int capacity, Zone* zone) {
    DCHECK_GE(capacity, 0);
    data_ = (capacity > 0) ? NewData(capacity, ZoneAllocationPolicy(zone))
                           : nullptr;
    capacity_ = capacity;
    length_ = 0;
  }

  // Adds a copy of the given 'element' to the end of the list,
  // expanding the list if necessary.
  void Add(const T& element, Zone* zone);
  // Add all the elements from the argument list to this list.
  void AddAll(const ZoneList<T>& other, Zone* zone);
  // Add all the elements from the vector to this list.
  void AddAll(const Vector<T>& other, Zone* zone);
  // Inserts the element at the specific index.
  void InsertAt(int index, const T& element, Zone* zone);

  // Added 'count' elements with the value 'value' and returns a
  // vector that allows access to the elements. The vector is valid
  // until the next change is made to this list.
  Vector<T> AddBlock(T value, int count, Zone* zone);

  // Overwrites the element at the specific index.
  void Set(int index, const T& element);

  // Removes the i'th element without deleting it even if T is a
  // pointer type; moves all elements above i "down". Returns the
  // removed element.  This function's complexity is linear in the
  // size of the list.
  T Remove(int i);

  // Removes the last element without deleting it even if T is a
  // pointer type. Returns the removed element.
  V8_INLINE T RemoveLast() { return Remove(length_ - 1); }

  // Clears the list by freeing the storage memory. If you want to keep the
  // memory, use Rewind(0) instead. Be aware, that even if T is a
  // pointer type, clearing the list doesn't delete the entries.
  V8_INLINE void Clear();

  // Drops all but the first 'pos' elements from the list.
  V8_INLINE void Rewind(int pos);

  inline bool Contains(const T& elm) const {
    for (int i = 0; i < length_; i++) {
      if (data_[i] == elm) return true;
    }
    return false;
  }

  // Iterate through all list entries, starting at index 0.
  template <class Visitor>
  void Iterate(Visitor* visitor);

  // Sort all list entries (using QuickSort)
  template <typename CompareFunction>
  void Sort(CompareFunction cmp);
  template <typename CompareFunction>
  void StableSort(CompareFunction cmp, size_t start, size_t length);

  void operator delete(void* pointer) { UNREACHABLE(); }
  void operator delete(void* pointer, Zone* zone) { UNREACHABLE(); }

 private:
  T* data_;
  int capacity_;
  int length_;

  V8_INLINE T* NewData(int n, ZoneAllocationPolicy allocator) {
    return static_cast<T*>(allocator.New(n * sizeof(T)));
  }
  V8_INLINE void DeleteData(T* data) { ZoneAllocationPolicy::Delete(data); }

  // Increase the capacity of a full list, and add an element.
  // List must be full already.
  void ResizeAdd(const T& element, ZoneAllocationPolicy allocator);

  // Inlined implementation of ResizeAdd, shared by inlined and
  // non-inlined versions of ResizeAdd.
  void ResizeAddInternal(const T& element, ZoneAllocationPolicy allocator);

  // Resize the list.
  void Resize(int new_capacity, ZoneAllocationPolicy allocator);

  DISALLOW_COPY_AND_ASSIGN(ZoneList);
};

// ZonePtrList is a ZoneList of pointers to ZoneObjects allocated in the same
// zone as the list object.
template <typename T>
using ZonePtrList = ZoneList<T*>;

template <typename T>
class ScopedPtrList final {
 public:
  explicit ScopedPtrList(std::vector<void*>* buffer)
      : buffer_(*buffer), start_(buffer->size()), end_(buffer->size()) {}

  ~ScopedPtrList() { Rewind(); }

  void Rewind() {
    DCHECK_EQ(buffer_.size(), end_);
    buffer_.resize(start_);
    end_ = start_;
  }

  void MergeInto(ScopedPtrList* parent) {
    DCHECK_EQ(parent->end_, start_);
    parent->end_ = end_;
    start_ = end_;
    DCHECK_EQ(0, length());
  }

  int length() const { return static_cast<int>(end_ - start_); }
  T* at(int i) const {
    size_t index = start_ + i;
    DCHECK_LE(start_, index);
    DCHECK_LT(index, buffer_.size());
    return reinterpret_cast<T*>(buffer_[index]);
  }

  void CopyTo(ZonePtrList<T>* target, Zone* zone) const {
    DCHECK_LE(end_, buffer_.size());
    // Make sure we don't reference absent elements below.
    if (length() == 0) return;
    target->Initialize(length(), zone);
    T** data = reinterpret_cast<T**>(&buffer_[start_]);
    target->AddAll(Vector<T*>(data, length()), zone);
  }

  Vector<T*> CopyTo(Zone* zone) {
    DCHECK_LE(end_, buffer_.size());
    T** data = zone->NewArray<T*>(length());
    if (length() != 0) {
      MemCopy(data, &buffer_[start_], length() * sizeof(T*));
    }
    return Vector<T*>(data, length());
  }

  void Add(T* value) {
    DCHECK_EQ(buffer_.size(), end_);
    buffer_.push_back(value);
    ++end_;
  }

  void AddAll(const ZonePtrList<T>& list) {
    DCHECK_EQ(buffer_.size(), end_);
    buffer_.reserve(buffer_.size() + list.length());
    for (int i = 0; i < list.length(); i++) {
      buffer_.push_back(list.at(i));
    }
    end_ += list.length();
  }

 private:
  std::vector<void*>& buffer_;
  size_t start_;
  size_t end_;
};

typedef base::PointerTemplateHashMapImpl<ZoneAllocationPolicy> ZoneHashMap;

typedef base::CustomMatcherTemplateHashMapImpl<ZoneAllocationPolicy>
    CustomMatcherZoneHashMap;

}  // namespace internal
}  // namespace v8

// The accidential pattern
//    new (zone) SomeObject()
// where SomeObject does not inherit from ZoneObject leads to nasty crashes.
// This triggers a compile-time error instead.
template <class T, typename = typename std::enable_if<std::is_convertible<
                       T, const v8::internal::Zone*>::value>::type>
void* operator new(size_t size, T zone) {
  static_assert(false && sizeof(T),
                "Placement new with a zone is only permitted for classes "
                "inheriting from ZoneObject");
  UNREACHABLE();
}

#endif  // V8_ZONE_ZONE_H_


text:
<?xml version='1.0' encoding='utf-8'?>
<resources>
    <string name="ministro_not_found_msg">Kan ikke finne tjenesten Ministro. Applikasjonen kan ikke starte.</string>
    <string name="ministro_needed_msg">Denne applikasjonen krever tjenesten Ministro. Vil du installere denne?</string>
    <string name="fatal_error_msg">Applikasjonen fikk en kritisk feil og kan ikke fortsette</string>
</resources>


text:
import os
import csv
import datetime

class Exporter(object):
    def __init__(self):
        self.writableDirPath = './results'
        if not os.path.isdir(self.writableDirPath):
            os.makedirs(self.writableDirPath)

    def export_to_csv(self, win_loss):
        filename = datetime.datetime.now().strftime('%Y%m%d%H%M%S') + '.csv'
        with open(os.path.join(self.writableDirPath, filename), 'wt') as csvfile:
            writer = csv.writer(csvfile, delimiter=',')
            for line in win_loss:
                writer.writerow(line)

        print('Exported as ' + filename)


text:
import xml.etree.ElementTree as ET

import numpy as np
from igibson.render.mesh_renderer.mesh_renderer_cpu import Material

from robosuite.renderers.base_parser import BaseParser
from robosuite.renderers.igibson.igibson_utils import MujocoCamera, MujocoRobot, get_texture_id, load_object
from robosuite.utils.mjcf_utils import string_to_array

class Parser(BaseParser):
    def __init__(self, renderer, env, segmentation_type):
        """
        Parse the mujoco xml and initialize iG renderer objects.

        Args:
            renderer: iGibson renderer
            env : Mujoco env
        """

        super().__init__(renderer, env)
        self.segmentation_type = segmentation_type
        self.create_class_mapping()

    def parse_textures(self):
        """
        Parse and load all textures and store them
        """

        self.texture_attributes = {}
        self.texture_id_mapping = {}

        for texture in self.xml_root.iter("texture"):
            texture_type = texture.get("type")
            texture_name = texture.get("name")
            texture_file = texture.get("file")
            texture_rgb = texture.get("rgb1")

            if texture_file is not None:
                self.texture_attributes[texture_name] = texture.attrib
                self.texture_id_mapping[texture_name] = (self.renderer.load_texture_file(texture_file, 1), texture_type)
            else:
                color = np.array(string_to_array(texture_rgb))
                self.texture_id_mapping[texture_name] = (color, texture_type)

    def parse_materials(self):
        """
        Parse all materials and use texture mapping to initialize materials
        """

        self.material_attributes = {}
        self.material_mapping = {}
        self.normal_id = get_texture_id(np.array([127, 127, 255]).reshape(1, 1, 3).astype(np.uint8), "normal", self)
        for material in self.xml_root.iter("material"):
            material_name = material.get("name")
            texture_name = material.get("texture")
            rgba = string_to_array(material.get("rgba", "0.5 0.5 0.5"))
            self.material_attributes[material_name] = material.attrib

            if texture_name is not None:
                texture_id, _ = self.texture_id_mapping[texture_name]
                specular = material.get("specular")
                shininess = material.get("shininess")
                roughness_id = -1 if specular is None else get_texture_id(1 - float(specular), "roughness", self)
                metallic_id = -1 if shininess is None else get_texture_id(float(shininess), "metallic", self)

                if isinstance(texture_id, int):
                    repeat = string_to_array(material.get("texrepeat", "1 1"))
                    self.material_mapping[material_name] = Material(
                        "texture",
                        texture_id=texture_id,
                        transform_param=[repeat[0], repeat[1], 0],
                        metallic_texture_id=metallic_id,
                        roughness_texture_id=roughness_id,
                        normal_texture_id=self.normal_id,
                    )
                else:
                    # texture id in this case will be a numpy array of rgb values
                    # If color are present both in material and texture, prioritize material color.
                    if material.get("rgba") is None:
                        self.material_mapping[material_name] = Material("color", kd=texture_id)
                    else:
                        self.material_mapping[material_name] = Material("color", kd=rgba[:3])

            else:
                # color can either come from texture, or could be defined in the material itself.
                self.material_mapping[material_name] = Material("color", kd=rgba[:3])

    def create_class_mapping(self):
        """
        Create class name to index mapping for both semantic and instance
        segmentation.
        """
        self.class2index = {}
        for i, c in enumerate(self.env.model._classes_to_ids.keys()):
            self.class2index[c] = i
        self.class2index[None] = i + 1
        self.max_classes = len(self.class2index)

        self.instance2index = {}
        for i, instance_class in enumerate(self.env.model._instances_to_ids.keys()):
            self.instance2index[instance_class] = i
        self.instance2index[None] = i + 1
        self.max_instances = len(self.instance2index)

    def get_class_id(self, geom_index, element_id):
        """
        Given index of the geom object get the class id based on
        self.segmentation type.
        """
        if self.segmentation_type == "class":
            class_id = self.class2index[self.env.model._geom_ids_to_classes.get(geom_index)]
        elif self.segmentation_type == "instance":
            class_id = self.instance2index[self.env.model._geom_ids_to_instances.get(geom_index)]
        else:
            class_id = element_id

        return class_id

    def parse_cameras(self):
        """
        Parse cameras and initialize the cameras.
        """

        robot = MujocoRobot()
        for cam in self.xml_root.iter("camera"):
            camera_name = cam.get("name")
            # get parent body name to find out where the camera is attached.
            parent_body_name = self.parent_map[cam].get("name", "worldbody")
            pos = string_to_array(cam.get("pos", "0 0 0"))
            quat = string_to_array(cam.get("quat", "1 0 0 0"))
            fov = float(cam.get("fovy", "45"))
            quat = np.array([quat[1], quat[2], quat[3], quat[0]])
            camera = MujocoCamera(
                parent_body_name, pos, quat, active=False, mujoco_env=self.env, camera_name=camera_name, fov=fov
            )
            robot.cameras.append(camera)

        self.renderer.add_instance_group([], ig_object=robot)

    def parse_meshes(self):
        """
        Create mapping of meshes.
        """
        self.meshes = {}
        for mesh in self.xml_root.iter("mesh"):
            self.meshes[mesh.get("name")] = mesh.attrib

    def parse_geometries(self):
        """
        Iterate through each goemetry and load it in the iGibson renderer.
        """
        self.parse_meshes()
        element_id = 0
        for geom_index, geom in enumerate(self.xml_root.iter("geom")):
            geom_name = geom.get("name", "NONAME")
            geom_type = geom.get("type", "sphere")

            if (geom.get("group") != "1" and geom_type != "plane") or ("collision" in geom_name):
                continue

            parent_body = self.parent_map.get(geom)
            # [1, 0, 0, 0] is wxyz, we convert it back to xyzw.
            geom_orn = string_to_array(geom.get("quat", "1 0 0 0"))
            geom_orn = [geom_orn[1], geom_orn[2], geom_orn[3], geom_orn[0]]
            geom_pos = string_to_array(geom.get("pos", "0 0 0"))
            if geom_type == "mesh":
                geom_scale = string_to_array(self.meshes[geom.get("mesh")].get("scale", "1 1 1"))
            else:
                geom_scale = [1, 1, 1]
            geom_size = string_to_array(geom.get("size", "1 1 1"))
            geom_rgba = string_to_array(geom.get("rgba", "1 1 1 1"))
            geom_material = self.material_mapping.get(geom.get("material"))
            if geom_material is None:
                color = geom_rgba[:3].reshape(1, 1, 3)
                # TODO: check converting the below texture to color material
                dummy_texture_id = get_texture_id(color, "texture", self)
                geom_material = Material(
                    "texture",
                    texture_id=dummy_texture_id,
                    metallic_texture_id=get_texture_id(1, "metallic", self),
                    roughness_texture_id=get_texture_id(1, "roughness", self),
                    normal_texture_id=self.normal_id,
                )
                # Flag to check if default material is used
                geom_material._is_set_by_parser = True
            else:
                geom_material._is_set_by_parser = False

            # saving original params because transform param will be overwritten
            if not hasattr(geom_material, "_orig_transform_param"):
                geom_material._orig_transform_param = geom_material.transform_param

            # setting material_ids so that randomized material works
            geom_material.material_ids = 0

            class_id = self.get_class_id(geom_index, element_id)

            load_object(
                renderer=self.renderer,
                geom=geom,
                geom_name=geom_name,
                geom_type=geom_type,
                geom_orn=geom_orn,
                geom_pos=geom_pos,
                geom_rgba=geom_rgba,
                geom_size=geom_size,
                geom_scale=geom_scale,
                geom_material=geom_material,
                parent_body=parent_body,
                class_id=class_id,
                visual_objects=self.visual_objects,
                meshes=self.meshes,
            )

            element_id += 1

        self.max_elements = element_id


text:
import { expect } from 'chai'
import { it, describe } from 'mocha'
import { setupTest } from 'ember-mocha'

describe('Unit | Route | day', function(hooks) {
  setupTest(hooks)

  it('exists', function() {
    let route = this.owner.lookup('route:day')
    expect(route).to.be.ok
  })
})


text:
<?php
namespace bunq\Model\Generated\Endpoint;

use bunq\Http\BunqResponse;

/**
 */
class BunqResponseNoteTextPaymentList extends BunqResponse
{
    /**
     * @return NoteTextPayment[]
     */
    public function getValue(): array
    {
        return parent::getValue();
    }
}


text:
<?php

namespace Redmine\Tests\Api;

use Redmine\Api\IssueRelation;

/**
 * IssueRelation API test
 *
 * @coversDefaultClass Redmine\Api\IssueRelation
 *
 * @author     Malte Gerth <mail@malte-gerth.de>
 * @copyright  2014 Malte Gerth
 * @license    MIT
 * @link       https://github.com/kbsali/php-redmine-api
 * @since      2014-06-01
 */
class IssueRelationTest extends \PHPUnit_Framework_TestCase
{

    /**
     * Test all()
     *
     * @covers ::all
     * @test
     *
     * @return void
     */
    public function testAllReturnsClientGetResponseWithProject()
    {
        // Test values
        $getResponse = 'API Response';

        // Create the used mock objects
        $client = $this->getMockBuilder('Redmine\Client')
            ->disableOriginalConstructor()
            ->getMock();
        $client->expects($this->once())
            ->method('get')
            ->with(
                $this->stringStartsWith('/issues/5/relations.json')
            )
            ->willReturn($getResponse);

        // Create the object under test
        $api = new IssueRelation($client);

        // Perform the tests
        $this->assertSame($getResponse, $api->all(5));
    }

    /**
     * Test all()
     *
     * @covers ::all
     * @test
     *
     * @return void
     */
    public function testAllReturnsClientGetResponseWithParametersAndProject()
    {
        // Test values
        $parameters = array('not-used');
        $getResponse = array('API Response');

        // Create the used mock objects
        $client = $this->getMockBuilder('Redmine\Client')
            ->disableOriginalConstructor()
            ->getMock();
        $client->expects($this->any())
            ->method('get')
            ->with(
                $this->logicalAnd(
                    $this->stringStartsWith('/issues/5/relations.json'),
                    $this->stringContains('not-used')
                )
            )
            ->willReturn($getResponse);

        // Create the object under test
        $api = new IssueRelation($client);

        // Perform the tests
        $this->assertSame($getResponse, $api->all(5, $parameters));
    }

    /**
     * Test show()
     *
     * @covers ::get
     * @covers ::show
     * @test
     *
     * @return void
     */
    public function testShowReturnsClientGetResponse()
    {
        // Test values
        $returnValue = array(
            'child' => array(5, 2, 3)
        );

        // Create the used mock objects
        $client = $this->getMockBuilder('Redmine\Client')
            ->disableOriginalConstructor()
            ->getMock();
        $client->expects($this->once())
            ->method('get')
            ->with($this->stringStartsWith('/relations/5.json'))
            ->willReturn(array('relation' => $returnValue));

        // Create the object under test
        $api = new IssueRelation($client);

        // Perform the tests
        $this->assertSame($returnValue, $api->show(5));
    }

    /**
     * Test show()
     *
     * @covers ::get
     * @covers ::show
     * @test
     *
     * @return void
     */
    public function testShowReturnsArrayIfNull()
    {
        // Create the used mock objects
        $client = $this->getMockBuilder('Redmine\Client')
            ->disableOriginalConstructor()
            ->getMock();
        $client->expects($this->once())
            ->method('get')
            ->with($this->stringStartsWith('/relations/5.json'))
            ->willReturn(null);

        // Create the object under test
        $api = new IssueRelation($client);

        // Perform the tests
        $this->assertSame(array(), $api->show(5));
    }

    /**
     * Test remove()
     *
     * @covers ::delete
     * @covers ::remove
     * @test
     *
     * @return void
     */
    public function testRemoveCallsDelete()
    {
        // Test values
        $getResponse = 'API Response';

        // Create the used mock objects
        $client = $this->getMockBuilder('Redmine\Client')
            ->disableOriginalConstructor()
            ->getMock();
        $client->expects($this->once())
            ->method('delete')
            ->with(
                $this->logicalAnd(
                    $this->stringStartsWith('/relations/5'),
                    $this->logicalXor(
                        $this->stringEndsWith('.json'),
                        $this->stringEndsWith('.xml')
                    )
                )
            )
            ->willReturn($getResponse);

        // Create the object under test
        $api = new IssueRelation($client);

        // Perform the tests
        $this->assertSame($getResponse, $api->remove(5));
    }
}


text:
#ifndef __itkRadialBasisFunctionBase_h
#define __itkRadialBasisFunctionBase_h

#include "itkFunctionBase.h"
#include "itkArray.h"

namespace itk
{
namespace Statistics
{
/** \class RadialBasisFunctionBase
 * \brief This is the itkRadialBasisFunctionBase class.
 *
 * \ingroup ITKNeuralNetworks
 */

template<class ScalarType>
class RadialBasisFunctionBase : public FunctionBase<ScalarType,ScalarType>
{
public:

  /** Standard class typedefs. */
  typedef RadialBasisFunctionBase             Self;
  typedef FunctionBase<ScalarType,ScalarType> Superclass;
  typedef SmartPointer<Self>                  Pointer;
  typedef SmartPointer<const Self>            ConstPointer;

  /** Run-time type information (and related methods). */
  itkTypeMacro(RadialBasisFunctionBase, FunctionBase);

  /** Input/Output types */
  typedef Array<ScalarType> ArrayType;

  ///** Evaluate at the specified input position */
  virtual ScalarType Evaluate(const ScalarType& input) const=0;

  /** Evaluate the derivative at the specified input position */
  virtual ScalarType EvaluateDerivative(const ScalarType& dist, const ArrayType& input,
                                                    char mode,int element_id=0) const=0;

  itkSetMacro(Radius,ScalarType);
  itkGetConstMacro(Radius, ScalarType );

  itkSetMacro(Center,ArrayType);
  itkGetConstMacro(Center, ArrayType );

protected:

  RadialBasisFunctionBase()
    {
    m_Radius = 0;
    }
  ~RadialBasisFunctionBase() {};

  /** Method to print the object. */
  virtual void PrintSelf( std::ostream& os, Indent indent ) const
    {
    os << indent << "RadialBasisFunctionBase(" << this << ")" << std::endl;
    Superclass::PrintSelf( os, indent );
    }

private:

  ArrayType  m_Center;
  ScalarType m_Radius;

  RadialBasisFunctionBase(const Self&); //purposely not implemented
  void operator=(const Self&); //purposely not implemented
};

} // end namespace Statistics
} // end namespace itk

#endif


text:
#import <SPTDataLoader/SPTDataLoaderExponentialTimer.h>

#import <math.h>
#import <stdlib.h>

#pragma mark - Default Values

static const double SPTDataLoaderExponentialTimerDefaultGrow = M_E;
const double SPTDataLoaderExponentialTimerDefaultJitter = 0.11304999836;

#pragma mark - SPTDataLoaderExponentialTimer Private Interface

@interface SPTDataLoaderExponentialTimer ()

@property (nonatomic, assign, readwrite) NSTimeInterval timeInterval;
@property (nonatomic, assign, readonly) NSTimeInterval maxTime;
@property (nonatomic, assign, readonly) NSTimeInterval initialTime;

@property (nonatomic, assign, readonly) double jitter;
@property (nonatomic, assign, readonly) double growFactor;

@end

#pragma mark - SPTDataLoaderExponentialTimer Implementation

@implementation SPTDataLoaderExponentialTimer

#pragma mark Creating an Exponential Timer Object

+ (instancetype)exponentialTimerWithInitialTime:(NSTimeInterval)initialTime
                                        maxTime:(NSTimeInterval)maxTime
{
    return [self exponentialTimerWithInitialTime:initialTime maxTime:maxTime jitter:SPTDataLoaderExponentialTimerDefaultJitter];
}

+ (instancetype)exponentialTimerWithInitialTime:(NSTimeInterval)initialTime
                                        maxTime:(NSTimeInterval)maxTime
                                         jitter:(double)jitter
{
    return [[self alloc] initWithInitialTime:initialTime
                                     maxTime:maxTime
                                  growFactor:SPTDataLoaderExponentialTimerDefaultGrow
                                      jitter:jitter];
}

- (instancetype)initWithInitialTime:(NSTimeInterval)initialTime
                            maxTime:(NSTimeInterval)maxTime
                         growFactor:(double)growFactor
                             jitter:(double)jitter
{
    self = [super init];
    if (self) {
        _initialTime = initialTime;
        _timeInterval = initialTime;
        _maxTime = maxTime;
        _growFactor = growFactor;
        _jitter = jitter;
    }
    return self;
}

#pragma mark Accessing and Updating the Delay Value

- (void)reset
{
    self.timeInterval = self.initialTime;
}

- (NSTimeInterval)calculateNext
{
    NSTimeInterval nextTime = self.timeInterval * self.growFactor;

    if (nextTime > self.maxTime) {
        nextTime = self.maxTime;
    }

    if (self.jitter < 0.0001) {
        self.timeInterval = nextTime;
    } else {
        const double sigma = self.jitter * nextTime;
        self.timeInterval = [self.class normalWithMu:nextTime sigma:sigma];
    }

    if (self.timeInterval > self.maxTime) {
        self.timeInterval = self.maxTime;
    }

    return self.timeInterval;
}

- (NSTimeInterval)timeIntervalAndCalculateNext
{
    const NSTimeInterval timeInterval = self.timeInterval;
    [self calculateNext];

    return timeInterval;
}

#pragma mark Calculating Exponential Backoff

#define EXPT_MODULO ((u_int32_t)RAND_MAX)
#define EXPT_MODULO_F64 ((double)(EXPT_MODULO))
NS_INLINE double SPTExptRandom()
{
    // We need [0, 1) interval
    return arc4random_uniform(EXPT_MODULO);
}

+ (NSTimeInterval)normalWithMu:(double)mu sigma:(double)sigma
{
    /**
     Uses Kinderman and Monahan method. Reference: Kinderman,
     A.J. and Monahan, J.F., "Computer generation of random
     variables using the ratio of uniform deviates", ACM Trans
     Math Software, 3, (1977), pp257-260.
    */

    const int attempts = 20;
    for (int i = 0; i < attempts; ++i) {
        const double a = SPTExptRandom() / EXPT_MODULO_F64;
        const double b = 1.0 - (SPTExptRandom() / EXPT_MODULO_F64);
        const double c = 1.7155277699214135 * (a - 0.5) / b;
        const double d = c * c / 4.0;

        if (d <= -1.0 * log(b)) {
            return mu + c * sigma;
        }
    }

    return mu + 2.0 * sigma * (SPTExptRandom() / EXPT_MODULO_F64);
}

@end


text:
[![Build Status](https://travis-ci.org/open-triq/triq.svg?branch=master)](https://travis-ci.org/open-triq/triq)

This is a fork of Triq that is being run under the ZeroMQ Collaberation rules, http://rfc.zeromq.org/spec:22 with the one exception being that it is under the apache licence

Triq (pronounced "Trick Check") is a free alternative to [QuviQ
eqc](http://www.quviq.com/). Triq's API is modelled closely after
`eqc`, so I recommend their tutorials and slides for an introduction
to QuickCheck.  Notice that QuviQ `eqc` has many features not found in
`triq`, but it is open source licensed under the Apache license.  For
instance, `eqc` has features for reporting, management, probably a
much better shrinking mechanism, cool C integration, and
professional support.

## Installation

To use `triq`, you download the latest version from
[here](http://github.com/open-triq/triq/), and untar it
into your erlang lib directory (typically
`/usr/local/lib/erlang/lib`):

```sh
prompt$ cd /usr/local/lib/erlang/lib
propmt$ tar xvzf triq-0.1.0.tgz
...
```

And you're all set.

Or, checkout the triq source code and soft link / copy into your Erlang lib directory:

```sh
prompt$ git clone git://github.com/open-triq/triq.git
prompt$ cd triq
prompt$ ln -s . /usr/local/lib/erlang/lib/triq-0.1.0
```

Next, to use `triq`, include the header file:

```erlang
-include_lib("triq/include/triq.hrl").
```

And you're ready to write property tests.  An example property could be:

```erlang
prop_append() ->
    ?FORALL({Xs,Ys},{list(int()),list(int())},
            lists:reverse(Xs++Ys)
            ==
            lists:reverse(Ys) ++ lists:reverse(Xs)).
```

To test this property, run `triq:check/1`, thus:

```erlang
1> triq:check(prop_append()).
......................................................................
..............................
Ran 100 tests
true
2>
```

If the test fails, it will try to shrink the result; here is an example:

```erlang
prop_delete() ->
    ?FORALL(L,list(int()),
        ?IMPLIES(L /= [],
            ?FORALL(I,elements(L),
                ?WHENFAIL(io:format("L=~p, I=~p~n", [L,I]),
                          not lists:member(I,lists:delete(I,L)))))).
```

Which runs like this:
```erlang
1> triq:check(triq_tests:prop_delete()).
x....Failed!
L=[4,5,5], I=5

Failed after 5 tests with false
Simplified:
        L = [0,0]
        I = 0
false
2>
```

You can get the values used for the failing test with `counterexample`,
and reuse the same test values with `check/2`:
```erlang
3> A = triq:counterexample(triq_tests:xprop_delete()).
x.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxFailed!
L=[3,2,1,1,1], I=1

Failed after 101 tests with false
Simplified:
	L = [0,0]
	I = 0
[[0,0],0]
4> A.
[[0,0],0]
5> triq:check(triq_tests:xprop_delete(), A).
Failed!
L=[0,0], I=0

Failed after 1 tests with false
Simplified:
	L = [0,0]
	I = 0
false
6>
```

Modules compiled with the `triq.hrl` header, auto-export all functions named `prop_*`,
and have a function added called `check/0` which runs `triq:check/1` on all the properties in the module.

```erlang
1> mymodule:check().
```

A handy addition that I use is to also add an `eunit` test, which tests it:

```erlang
property_test() -> true = check().
```
Which can then automatically be run using your favourite `eunit` runner.

Good luck!

This repository is copyright by Triq Contributors (as enumerated in
 AUTHORS).  It is licensed under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance with the
 License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0
       or in the file LICENSE

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.  See the License for the specific language governing
permissions and limitations under the License.

This repository also includes build scripts from Erlang Solutions,
Ltd. made available under the Apache License, Version 2.0.


text:
CONTAINER_ID=$(docker ps -q --filter ancestor=test_web_git_hub)
docker stop $CONTAINER_ID
docker build -t test_web_git_hub --rm .
docker run -d -p 80:80 test_web_git_hub


text:
"""
    this was an attempt to achieve motion blur
    hoping that fading out will do the job.
    this is not quite motion blur - to see what i mean, try moving the mouse
    around for a longer while - instead of motion blur what you get is motion
    tail, which is unwanted.
    still this example teaches something too.
"""

from gi.repository import Gtk as gtk
from lib import graphics

class Scene(graphics.Scene):
    def __init__(self):
        graphics.Scene.__init__(self)
        self.mouse_cursor = False

        self.coords = []
        self.x, self.y = 0, 0
        self.radius = 30
        self.connect("on-mouse-move", self.on_mouse_move)
        self.connect("on-enter-frame", self.on_enter_frame)
        self.fade_tick = 0

    def on_mouse_move(self, area, event):
        # oh i know this should not be performed using tweeners, but hey - a demo!
        self.coords.insert(0, (event.x, event.y))
        self.coords = self.coords[:10]  # limit trail length

    def on_enter_frame(self, scene, context):
        g = graphics.Graphics(context)

        for i, coords in enumerate(reversed(self.coords)):
            x, y = coords

            if i == len(self.coords) - 1:
                alpha = 1
            else:
                alpha = float(i+1) / len(self.coords) / 2

            g.rectangle(x - self.radius,
                            y - self.radius,
                            self.radius * 2,
                            self.radius * 2, 3)
            #print alpha
            g.fill("#999", alpha)

        self.fade_tick += 1
        if len(self.coords) > 1 and self.fade_tick > 2:
            self.fade_tick = 0
            self.coords.pop(-1)

        self.redraw() # constant redraw (maintaining the requested frame rate)

class BasicWindow:
    def __init__(self):
        window = gtk.Window()
        window.set_default_size(300, 300)
        window.connect("delete_event", lambda *args: gtk.main_quit())

        window.add(Scene())
        window.show_all()

if __name__ == "__main__":
    example = BasicWindow()
    import signal
    signal.signal(signal.SIGINT, signal.SIG_DFL) # gtk3 screws up ctrl+c
    gtk.main()


text:
#pragma once
#ifndef THRILL_DATA_CAT_BLOCK_SOURCE_HEADER
#define THRILL_DATA_CAT_BLOCK_SOURCE_HEADER

#include <thrill/data/block.hpp>

#include <utility>
#include <vector>

namespace thrill {
namespace data {

//! \addtogroup data_layer
//! \{

/*!
 * CatBlockSource is a BlockSource which concatenates all Blocks available from
 * a vector of BlockSources. They are concatenated in order: first all Blocks
 * from source zero, then from source one, etc.
 */
template <typename BlockSource>
class CatBlockSource
{
public:
    //! default constructor
    CatBlockSource() = default;

    //! Construct a BlockSource which catenates many other BlockSources.
    explicit CatBlockSource(std::vector<BlockSource>&& sources)
        : sources_(std::move(sources)) { }

    //! non-copyable: delete copy-constructor
    CatBlockSource(const CatBlockSource&) = delete;
    //! non-copyable: delete assignment operator
    CatBlockSource& operator = (const CatBlockSource&) = delete;
    //! move-constructor: default
    CatBlockSource(CatBlockSource&&) = default;
    //! move-assignment operator: default
    CatBlockSource& operator = (CatBlockSource&&) = default;

    //! Advance to next block of file, delivers current_ and end_ for
    //! BlockReader. Returns false if the source is empty.
    PinnedBlock NextBlock() {
        for ( ; current_ < sources_.size(); ++current_) {
            PinnedBlock b = sources_[current_].NextBlock();
            if (b.IsValid()) return b;
        }
        return PinnedBlock();
    }

private:
    //! vector containing block sources
    std::vector<BlockSource> sources_;

    //! current source, all sources < current_ are empty.
    size_t current_ = 0;
};

//! \}

} // namespace data
} // namespace thrill

#endif // !THRILL_DATA_CAT_BLOCK_SOURCE_HEADER

/******************************************************************************/


text:
<!DOCTYPE>

    <link rel="stylesheet" href="../static/styles/bootstrap.min.css">

 Restaurant {{restaurant.name}}

 Delete {{menu.name}}

    <form action="" method="POST">
      Are you fucking SURE you want to delete this Menu?

      <input type='submit' name='submit' value='Delete'>
      <input type='submit' name='submit' value='Cancel'>
    </form>


text:
<?xml version="1.0" encoding="UTF-8"?>
<config>
	<signalAmp>10000.0</signalAmp>
	<elasticKoeff>0.5</elasticKoeff>
	<resistanceKoeff>0.005</resistanceKoeff>
	<gateThreshold>0.1</gateThreshold>
  <maxSignalClampRate>0.997</maxSignalClampRate>
  <rangeClampRate>0.002</rangeClampRate>
</config>


text:
from django.conf.urls.defaults import *
from armstrong.apps.audio import views as audio_views

urlpatterns = patterns('',

    url(r'^$', audio_views.ListView.as_view(),
                name='audio_list'),

    url(r'^upload/$', audio_views.CreateView.as_view(),
                name='audio_upload'),

    url(r'^(?P<slug>[-\w]+)/$', audio_views.DetailView.as_view(),
                name='audio_detail'),
)


text:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Vishal S Vaidya on My BioBits</title>
    <link>http://lpantano.github.io/authors/vishal-s-vaidya/</link>
    <description>Recent content in Vishal S Vaidya on My BioBits</description>
    <generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator>
    <language>en-us</language>
    <lastBuildDate>Sat, 01 Jun 2019 00:00:00 +0000</lastBuildDate>

	    <atom:link href="http://lpantano.github.io/authors/vishal-s-vaidya/index.xml" rel="self" type="application/rss+xml" />

    <item>
      <title>Multi omics analysis of fibrotic kidneys in two mouse models.</title>
      <link>http://lpantano.github.io/publication/pavkovic-2019/</link>
      <pubDate>Sat, 01 Jun 2019 00:00:00 +0000</pubDate>

      <guid>http://lpantano.github.io/publication/pavkovic-2019/</guid>
      <description></description>
    </item>

  </channel>
</rss>


text:
struct utsname
{
	char  *sysname;
	char  *nodename;
	char  *release;
	char  *version;
	char  *machine;
};

#ifdef __cplusplus
extern "C" {
#endif

int uname(struct utsname *);

#ifdef __cplusplus
}
#endif

#endif


text:
package com.musketeer.ten.events;

/**
 * Created by Kevin on 2016/9/22.
 */
public class CriticEvent {

    public int id;
    public String image;

}


text:
package com.drillster.api2.general;

import java.util.List;

import com.drillster.api2.user.User;

public class Sessions implements Response {

	private User user;
	private Integer total;
	private List<Session> sessions;

	public Sessions setUser(User user) { this.user = user; return this; }
	public Sessions setTotal(Integer total) { this.total = total; return this; }
	public Sessions setSessions(List<Session> sessions) { this.sessions = sessions; return this; }

	public User getUser() { return this.user; }
	public Integer getTotal() { return this.total; }
	public List<Session> getSessions() { return this.sessions; }

}


text:
package eta.runtime.thunk;

import eta.runtime.stg.Closure;
import eta.runtime.stg.DataCon;
import eta.runtime.stg.StgContext;
import eta.runtime.stg.Value;
import eta.runtime.util.CompactReferenceSet;

import static eta.runtime.RuntimeLogging.*;

public class SelectorThunk extends UpdatableThunk {
    private int index;
    public volatile Closure x1;

    private SelectorThunk(final int i, final Closure x1) {
        super();
        this.index = i;
        this.x1 = x1;
    }

    public static SelectorThunk create(final StgContext context,
                                       final int i, final Closure x1) {
        SelectorThunk t = new SelectorThunk(i, x1);
        context.registerSelectorThunk(t);
        return t;
    }

    /* Constants returned by optimize */
    public static final int CLEARED = 1;
    public static final int PRODUCT_NOT_EVALUATED = 2;
    public static final int OPTIMIZED = 4;
    public static final int SELECTOR_ROOT = 8;

    /* The method is safe to run across threads.
       Returns CLEARED, PRODUCT_NOT_EVALUATED, OPTIMIZED, or SELECTOR_ROOT. */
    public int optimize() {

        Closure v = this.x1;

        /* Check if this thunk has been cleared */
        if (v != null) {

            /* Check if first optimization has yet to happen */
            if (this.index >= 0) {

                /* Check if the product type has been evaluated */
                if ((v = v.getEvaluated()) != null) {

                    /* Store the index to make sure it doesn't flip to -1 while we're
                       extracting the field. */
                    final int index = this.index;

                    if (index >= 0) {

                        /* Replace it with the appropriate field */
                        v = ((DataCon) v).get(index);
                        this.index = -1;
                        this.x1    = v;
                        if (v instanceof SelectorThunk) {
                            return SELECTOR_ROOT;
                        }
                    }
                    return OPTIMIZED;
                } else {
                    return PRODUCT_NOT_EVALUATED;
                }
            } else {
                /* Check if pointing to a selector thunk. */
                if (v instanceof SelectorThunk) {
                    return SELECTOR_ROOT;
                } else {
                    return OPTIMIZED;
                }
            }
        } else {
            return CLEARED;
        }
    }

    public void optimizeChain(CompactReferenceSet<SelectorThunk> thunkSet) {
        Closure v = this.x1;
        if (v != null) {
            while (v instanceof SelectorThunk) {
                final SelectorThunk t = (SelectorThunk) v;
                thunkSet.add(t);
                final int opt = t.optimize();
                switch (opt) {
                    case SELECTOR_ROOT:
                        v = t.x1;
                        break;
                    case PRODUCT_NOT_EVALUATED:
                    case OPTIMIZED:
                        this.x1 = v;
                        return;
                    case CLEARED:
                        this.x1 = t.indirectee;
                        return;
                    default:
                        barf("optimizeChain: unexpected result: " + opt);
                }
            }
        }
    }

    @Override
    public final Closure thunkEnter(final StgContext context) {
        final Closure x1 = this.x1;
        final Closure ind = this.indirectee;
        if (ind instanceof Value) return ind;
        else if (this.index >= 0) {
            return ((DataCon) x1.evaluate(context)).get(index).evaluateTail(context);
        } else {
            return x1.evaluateTail(context);
        }
    }

    @Override
    public final void clear() {
        this.x1 = null;
    }
}


text:
package com.saltedhashed.model;

public class AlgorithmDetails {

    private int iterations;
    private String hashFunction;
    private int keySize;
    public int getIterations() {
        return iterations;
    }
    public void setIterations(int iterations) {
        this.iterations = iterations;
    }
    public String getHashFunction() {
        return hashFunction;
    }
    public void setHashFunction(String hashFunction) {
        this.hashFunction = hashFunction;
    }
    public int getKeySize() {
        return keySize;
    }
    public void setKeySize(int keySize) {
        this.keySize = keySize;
    }
}


text:
set(CHEMFILES_VERSION 0.10.2)

vcpkg_from_github(
    OUT_SOURCE_PATH SOURCE_PATH
    REPO chemfiles/chemfiles
    REF ${CHEMFILES_VERSION}
    SHA512 f6b37a0ada169e67b8bd0ea795ff72f6c942d62f39e7259e478ce5a3af7d5ceddc4f044e0d17ecf286a0ababfc3664bf73c0903febd758e6bccb34fe61fa23da
)

vcpkg_cmake_configure(
    SOURCE_PATH "${SOURCE_PATH}"
)

vcpkg_cmake_install()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/chemfiles)

file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)


text:
using sf::core::bin::NodeStatusRequest;
using sf::core::bin::NodeStatusContext;
using sf::core::bin::NSClientContext;
using sf::core::bin::NSClientContextRef;

using sf::core::context::Client;
using sf::core::context::Static;

using sf::core::exception::SfException;
using sf::core::model::Event;
using sf::core::model::EventDrainRef;

using sf::core::protocol::public_api::Message;
using sf::core::protocol::public_api::NodeInfoRequest;
using sf::core::utility::MessageIO;

NSClientContext::NSClientContext() {
  this->callback_ref = -1;
}

NSClientContext::~NSClientContext() {
  if (this->callback_ref != -1) {
    Client::lua().registry()->freeReference(this->callback_ref);
  }
}

NodeStatusRequest::NodeStatusRequest(
    int callback_ref, bool details, EventDrainRef drain
) : Event("", drain) {
  this->callback_ref = callback_ref;
  this->details = details;
}

void NodeStatusRequest::handle() {
  // Store callback reference in NodeStatusContext.
  NSClientContextRef context(new NSClientContext());
  context->callback_ref = this->callback_ref;
  NodeStatusContext::store(this->correlation(), context);

  // Build status request.
  Message message;
  message.set_code(Message::NodeInfoRequest);
  message.set_correlation_id(this->correlation());

  NodeInfoRequest* info = message.MutableExtension(NodeInfoRequest::msg);
  info->set_details(this->details);

  // Send status request.
  MessageIO<Message>::send(this->drain(), message);
}


text:
var path = require('path');
var config = require('./config/config');
var logger = require('./config/log')(config);

// load express hbs templates
var app = require('./config/express-hbs');

// load routes
var routes = require('./config/routes').load(app);

// start the server
var server = require('http').Server(app);
logger.log("debug","Starting on port:"+config.get('http:port'));
server.listen(config.get('http:port'));

module.exports = app;


text:
package main

import (
	"os"

	"github.com/codegangsta/cli"
)

const (
	appName    = "hranoprovod-cli"
	appUsage   = "Lifestyle tracker"
	appVersion = "2.0.2"
	appAuthor  = "aquilax"
	appEmail   = "aquilax@gmail.com"

	defaultDbFilename       = "food.yaml"
	defaultLogFilename      = "log.yaml"
	defaultResolverMaxDepth = 10
)

func main() {
	app := cli.NewApp()
	app.Name = appName
	app.Usage = appUsage
	app.Version = appVersion
	app.Author = appAuthor
	app.Email = appEmail
	app.Flags = []cli.Flag{
		cli.StringFlag{
			Name:   "database, d",
			Value:  defaultDbFilename,
			Usage:  "database file name",
			EnvVar: "HR_DATABASE",
		},
		cli.StringFlag{
			Name:   "logfile, l",
			Value:  defaultLogFilename,
			Usage:  "log file name",
			EnvVar: "HR_LOGFILE",
		},
		cli.StringFlag{
			Name:   "config, c",
			Value:  GetDefaultFileName(),
			Usage:  "Configuration file",
			EnvVar: "HR_CONFIG",
		},
		cli.StringFlag{
			Name:   "date-format",
			Value:  "2006/01/02",
			Usage:  "Date format for parsing and printing dates",
			EnvVar: "HR_DATE_FORMAT",
		},
	}
	app.Commands = []cli.Command{
		{
			Name:      "register",
			ShortName: "reg",
			Usage:     "Shows the log register report",
			Flags: []cli.Flag{
				cli.StringFlag{
					Name:  "begin, b",
					Usage: "Beginning of period",
				},
				cli.StringFlag{
					Name:  "end, e",
					Usage: "End of period",
				},
				cli.StringFlag{
					Name:  "single-food, f",
					Usage: "Show only single element",
				},
				cli.StringFlag{
					Name:  "single-element, s",
					Usage: "Show only single element",
				},

				cli.BoolFlag{
					Name:  "csv",
					Usage: "Export as CSV",
				},
				cli.BoolFlag{
					Name:  "no-color",
					Usage: "Disable color output",
				},
				cli.BoolFlag{
					Name:  "no-totals",
					Usage: "Disable totals",
				},
				cli.BoolFlag{
					Name:  "totals-only",
					Usage: "Disable totals",
				},
				cli.BoolFlag{
					Name:  "unresolved",
					Usage: "Show unresolved elements only",
				},
				cli.IntFlag{
					Name:   "maxdepth",
					Value:  defaultResolverMaxDepth,
					Usage:  "resolve depth",
					EnvVar: "HR_MAXDEPTH",
				},
			},
			Action: func(c *cli.Context) {
				o := NewOptions()
				if err := o.Load(c); err != nil {
					handleExit(err)
				}
				handleExit(NewHranoprovod(o).Register())
			},
		},
		{
			Name:  "add",
			Usage: "Adds new item to the log",
			Action: func(c *cli.Context) {
				o := NewOptions()
				if err := o.Load(c); err != nil {
					handleExit(err)
				}
				handleExit(NewHranoprovod(o).Add(c.Args().First(), c.Args().Get(1)))
			},
		},
		{
			Name:  "api",
			Usage: "Service API commands",
			Subcommands: []cli.Command{
				{
					Name:  "search",
					Usage: "Search for food online",
					Action: func(c *cli.Context) {
						o := NewOptions()
						if err := o.Load(c); err != nil {
							handleExit(err)
						}
						handleExit(NewHranoprovod(o).Search(c.Args().First()))
					},
				},
			},
		},
		{
			Name:  "lint",
			Usage: "Lints file",
			Action: func(c *cli.Context) {
				o := NewOptions()
				if err := o.Load(c); err != nil {
					handleExit(err)
				}
				handleExit(NewHranoprovod(o).Lint(c.Args().First()))
			},
		},
	}
	app.Run(os.Args)
}

func handleExit(err error) {
	if err != nil {
		println(err.Error())
		os.Exit(1)
	}
}


text:
@extends('layouts.app')

@section('content')

ImageExtractor {{ $imageextractor->id }}
        id . '/edit') }}" class="btn btn-primary btn-xs" title="Edit ImageExtractor">
        {!! Form::open([
            'method'=>'DELETE',
            'url' => ['/RDFBrowser/imageextractor', $imageextractor->id],
            'style' => 'display:inline'
        ]) !!}
            {!! Form::button('', array(
                    'type' => 'submit',
                    'class' => 'btn btn-danger btn-xs',
                    'title' => 'Delete ImageExtractor',
                    'onclick'=>'return confirm("Confirm delete?")'
            ));!!}
        {!! Form::close() !!}

                    ID	{{ $imageextractor->id }}

 Property 	 {{ $imageextractor->property }}

 Priority 	 {{ $imageextractor->priority }}

 Enabled 	 {{ $imageextractor->enabled }}

@endsection