text:
package org.xtuml.bp.xtext.oal.xoal.impl;

import java.util.Collection;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

import org.xtuml.bp.xtext.oal.xoal.XoalPackage;
import org.xtuml.bp.xtext.oal.xoal.block;
import org.xtuml.bp.xtext.oal.xoal.expr;
import org.xtuml.bp.xtext.oal.xoal.if_statement;

/**
 *
 * An implementation of the model object 'if statement'.
 *
 *

 * The following features are implemented:
 *

 *
{@link org.xtuml.bp.xtext.oal.xoal.impl.if_statementImpl#getA1 A1}

 *
{@link org.xtuml.bp.xtext.oal.xoal.impl.if_statementImpl#getA2 A2}

 *
{@link org.xtuml.bp.xtext.oal.xoal.impl.if_statementImpl#getA3 A3}

 *
{@link org.xtuml.bp.xtext.oal.xoal.impl.if_statementImpl#getA4 A4}

 *
{@link org.xtuml.bp.xtext.oal.xoal.impl.if_statementImpl#getA5 A5}

 *

 *

 *
 * @generated
 */
public class if_statementImpl extends statementImpl implements if_statement
{
  /**
   * The cached value of the '{@link #getA1() A1}' containment reference.
   *
   *
   * @see #getA1()
   * @generated
   * @ordered
   */
  protected expr a1;

  /**
   * The cached value of the '{@link #getA2() A2}' containment reference.
   *
   *
   * @see #getA2()
   * @generated
   * @ordered
   */
  protected block a2;

  /**
   * The cached value of the '{@link #getA3() A3}' containment reference list.
   *
   *
   * @see #getA3()
   * @generated
   * @ordered
   */
  protected EList<expr> a3;

  /**
   * The cached value of the '{@link #getA4() A4}' containment reference list.
   *
   *
   * @see #getA4()
   * @generated
   * @ordered
   */
  protected EList<block> a4;

  /**
   * The cached value of the '{@link #getA5() A5}' containment reference.
   *
   *
   * @see #getA5()
   * @generated
   * @ordered
   */
  protected block a5;

  /**
   *
   *
   * @generated
   */
  protected if_statementImpl()
  {
    super();
  }

  /**
   *
   *
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return XoalPackage.Literals.IF_STATEMENT;
  }

  /**
   *
   *
   * @generated
   */
  public expr getA1()
  {
    return a1;
  }

  /**
   *
   *
   * @generated
   */
  public NotificationChain basicSetA1(expr newA1, NotificationChain msgs)
  {
    expr oldA1 = a1;
    a1 = newA1;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, XoalPackage.IF_STATEMENT__A1, oldA1, newA1);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   *
   *
   * @generated
   */
  public void setA1(expr newA1)
  {
    if (newA1 != a1)
    {
      NotificationChain msgs = null;
      if (a1 != null)
        msgs = ((InternalEObject)a1).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XoalPackage.IF_STATEMENT__A1, null, msgs);
      if (newA1 != null)
        msgs = ((InternalEObject)newA1).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XoalPackage.IF_STATEMENT__A1, null, msgs);
      msgs = basicSetA1(newA1, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, XoalPackage.IF_STATEMENT__A1, newA1, newA1));
  }

  /**
   *
   *
   * @generated
   */
  public block getA2()
  {
    return a2;
  }

  /**
   *
   *
   * @generated
   */
  public NotificationChain basicSetA2(block newA2, NotificationChain msgs)
  {
    block oldA2 = a2;
    a2 = newA2;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, XoalPackage.IF_STATEMENT__A2, oldA2, newA2);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   *
   *
   * @generated
   */
  public void setA2(block newA2)
  {
    if (newA2 != a2)
    {
      NotificationChain msgs = null;
      if (a2 != null)
        msgs = ((InternalEObject)a2).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XoalPackage.IF_STATEMENT__A2, null, msgs);
      if (newA2 != null)
        msgs = ((InternalEObject)newA2).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XoalPackage.IF_STATEMENT__A2, null, msgs);
      msgs = basicSetA2(newA2, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, XoalPackage.IF_STATEMENT__A2, newA2, newA2));
  }

  /**
   *
   *
   * @generated
   */
  public EList<expr> getA3()
  {
    if (a3 == null)
    {
      a3 = new EObjectContainmentEList<expr>(expr.class, this, XoalPackage.IF_STATEMENT__A3);
    }
    return a3;
  }

  /**
   *
   *
   * @generated
   */
  public EList<block> getA4()
  {
    if (a4 == null)
    {
      a4 = new EObjectContainmentEList<block>(block.class, this, XoalPackage.IF_STATEMENT__A4);
    }
    return a4;
  }

  /**
   *
   *
   * @generated
   */
  public block getA5()
  {
    return a5;
  }

  /**
   *
   *
   * @generated
   */
  public NotificationChain basicSetA5(block newA5, NotificationChain msgs)
  {
    block oldA5 = a5;
    a5 = newA5;
    if (eNotificationRequired())
    {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, XoalPackage.IF_STATEMENT__A5, oldA5, newA5);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
    return msgs;
  }

  /**
   *
   *
   * @generated
   */
  public void setA5(block newA5)
  {
    if (newA5 != a5)
    {
      NotificationChain msgs = null;
      if (a5 != null)
        msgs = ((InternalEObject)a5).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - XoalPackage.IF_STATEMENT__A5, null, msgs);
      if (newA5 != null)
        msgs = ((InternalEObject)newA5).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - XoalPackage.IF_STATEMENT__A5, null, msgs);
      msgs = basicSetA5(newA5, msgs);
      if (msgs != null) msgs.dispatch();
    }
    else if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, XoalPackage.IF_STATEMENT__A5, newA5, newA5));
  }

  /**
   *
   *
   * @generated
   */
  @Override
  public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
  {
    switch (featureID)
    {
      case XoalPackage.IF_STATEMENT__A1:
        return basicSetA1(null, msgs);
      case XoalPackage.IF_STATEMENT__A2:
        return basicSetA2(null, msgs);
      case XoalPackage.IF_STATEMENT__A3:
        return ((InternalEList<?>)getA3()).basicRemove(otherEnd, msgs);
      case XoalPackage.IF_STATEMENT__A4:
        return ((InternalEList<?>)getA4()).basicRemove(otherEnd, msgs);
      case XoalPackage.IF_STATEMENT__A5:
        return basicSetA5(null, msgs);
    }
    return super.eInverseRemove(otherEnd, featureID, msgs);
  }

  /**
   *
   *
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case XoalPackage.IF_STATEMENT__A1:
        return getA1();
      case XoalPackage.IF_STATEMENT__A2:
        return getA2();
      case XoalPackage.IF_STATEMENT__A3:
        return getA3();
      case XoalPackage.IF_STATEMENT__A4:
        return getA4();
      case XoalPackage.IF_STATEMENT__A5:
        return getA5();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   *
   *
   * @generated
   */
  @SuppressWarnings("unchecked")
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case XoalPackage.IF_STATEMENT__A1:
        setA1((expr)newValue);
        return;
      case XoalPackage.IF_STATEMENT__A2:
        setA2((block)newValue);
        return;
      case XoalPackage.IF_STATEMENT__A3:
        getA3().clear();
        getA3().addAll((Collection<? extends expr>)newValue);
        return;
      case XoalPackage.IF_STATEMENT__A4:
        getA4().clear();
        getA4().addAll((Collection<? extends block>)newValue);
        return;
      case XoalPackage.IF_STATEMENT__A5:
        setA5((block)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   *
   *
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case XoalPackage.IF_STATEMENT__A1:
        setA1((expr)null);
        return;
      case XoalPackage.IF_STATEMENT__A2:
        setA2((block)null);
        return;
      case XoalPackage.IF_STATEMENT__A3:
        getA3().clear();
        return;
      case XoalPackage.IF_STATEMENT__A4:
        getA4().clear();
        return;
      case XoalPackage.IF_STATEMENT__A5:
        setA5((block)null);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   *
   *
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case XoalPackage.IF_STATEMENT__A1:
        return a1 != null;
      case XoalPackage.IF_STATEMENT__A2:
        return a2 != null;
      case XoalPackage.IF_STATEMENT__A3:
        return a3 != null && !a3.isEmpty();
      case XoalPackage.IF_STATEMENT__A4:
        return a4 != null && !a4.isEmpty();
      case XoalPackage.IF_STATEMENT__A5:
        return a5 != null;
    }
    return super.eIsSet(featureID);
  }

} //if_statementImpl


text:
'use strict';

function isString(obj) {
  return Object.prototype.toString.call(obj) == '[object String]';
}

function hasProp(obj, key) {
  return Object.prototype.hasOwnProperty.call(obj, key);
}

function defaultInitFunc(message, props) {
  for (var key in props) {
    if (hasProp(props, key)) {
      this[key] = props[key]; // jshint ignore:line
    }
  }
}

module.exports = function(name, initFunc) {
  if (!(isString(name) && /^[A-Z][A-Za-z0-9_]*$/.test(name))) {
    throw new Error('invalid `name` argument');
  }

  var definition =
    'return function ' + name + '() {' +
    '  var err = Error.apply(this, arguments);' +
    '  err.name  = this.name = "' + name + '";' +
    '  this.stack    = err.stack;' +
    '  this.message  = err.message;' +
    '  this.initialize.apply(this, arguments);' +
    '  return this;' +
    '}';

  var error = new Function(definition)(); // jshint ignore:line

  function ErrorPrototype() {
    this.constructor = error;
  }

  ErrorPrototype.prototype = Error.prototype;
  error.prototype = new ErrorPrototype();
  error.prototype.initialize = initFunc || defaultInitFunc;

  error.prototype.inspect = function() {
    return '[' + this.constructor.name + (this.message ? ': ' + this.message : '') + ']';
  };

  return error;
};

redpajama_set_name: RedPajamaGithub


text:
package org.jabref.logic.importer.fetcher.transformers;

import org.jabref.model.strings.StringUtil;

public class ResearchGateQueryTransformer extends AbstractQueryTransformer {

    @Override
    protected String getLogicalAndOperator() {
        return " AND ";
    }

    @Override
    protected String getLogicalOrOperator() {
        return " OR ";
    }

    @Override
    protected String getLogicalNotOperator() {
        return "NOT ";
    }

    @Override
    protected String handleAuthor(String author) {
        return StringUtil.quoteStringIfSpaceIsContained(author);
    }

    @Override
    protected String handleTitle(String title) {
        return StringUtil.quoteStringIfSpaceIsContained(title);
    }

    @Override
    protected String handleJournal(String journalTitle) {
        return StringUtil.quoteStringIfSpaceIsContained(journalTitle);
    }

    @Override
    protected String handleYear(String year) {
        return StringUtil.quoteStringIfSpaceIsContained(year);
    }
}


text:
#include <tinyara/config.h>
#include <string.h>
#include <stdint.h>
#include <sys/types.h>
#include <araui/ui_commons.h>
#include <araui/ui_asset.h>
#include "ui_core_internal.h"
#include "ui_asset_internal.h"
#include "ui_request_callback.h"
#include "ui_debug.h"

#define STB_IMAGE_IMPLEMENTATION
#include <stb/stb_image.h>

static void              _ui_image_asset_destroy_func(void *userdata);
static ui_pixel_format_t _ui_get_pixel_format_from_channels(int channels);
static size_t            _ui_get_bpp_from_pf(ui_pixel_format_t type);

ui_asset_t ui_image_asset_create_from_buffer(const uint8_t *buf)
{
	ui_image_asset_body_t *body;
	ui_bitmap_data_t *bitmap;

	if (!ui_is_running()) {
		UI_LOGE("error: UI framework is not running!\n");
		return UI_NULL;
	}

	if (!buf) {
		UI_LOGE("error: invalid parameter!\n");
		return UI_NULL;
	}

	body = (ui_image_asset_body_t *)UI_ALLOC(sizeof(ui_image_asset_body_t));
	if (!body) {
		UI_LOGE("error: out of memory!\n");
		return UI_NULL;
	}

	memset(body, 0, sizeof(ui_image_asset_body_t));
	((ui_asset_body_t *)body)->type = UI_IMAGE_ASSET;

	bitmap = (ui_bitmap_data_t *)buf;

	body->width = bitmap->width;
	body->height = bitmap->height;
	body->buf = (uint8_t *)(buf + bitmap->header_size);

	body->pixel_format = bitmap->pf;
	body->bits_per_pixel = _ui_get_bpp_from_pf(body->pixel_format);
	body->bytes_per_line = body->width * body->bits_per_pixel / 8;
	body->from_buf = true;

	return (ui_asset_t)body;
}

ui_error_t ui_image_asset_destroy(ui_asset_t image)
{
	if (!ui_is_running()) {
		return UI_NOT_RUNNING;
	}

	if (!image) {
		return UI_INVALID_PARAM;
	}

	if (ui_request_callback(_ui_image_asset_destroy_func, (void *)image) != UI_OK) {
		return UI_OPERATION_FAIL;
	}

	return UI_OK;
}

static void _ui_image_asset_destroy_func(void *userdata)
{
	ui_image_asset_body_t *body;

	body = (ui_image_asset_body_t *)userdata;

	if (!body->from_buf) {
		stbi_image_free(body->buf);
	}
	UI_FREE(body);
}

ui_asset_t ui_image_asset_create_from_file(const char *filename)
{
	ui_image_asset_body_t *body;
	int32_t channels = 0;

	if (!ui_is_running()) {
		UI_LOGE("error: UI framework is not running!\n");
		return UI_NULL;
	}

	if (!filename) {
		UI_LOGE("error: invalid parameter!\n");
		return UI_NULL;
	}

	body = (ui_image_asset_body_t *)UI_ALLOC(sizeof(ui_image_asset_body_t));
	if (!body) {
		UI_LOGE("error: out of memory!\n");
		return UI_NULL;
	}

	memset(body, 0, sizeof(ui_image_asset_body_t));
	((ui_asset_body_t *)body)->type = UI_IMAGE_ASSET;

	body->buf = stbi_load(filename, &body->width, &body->height, &channels, 0);
	if (body->buf == NULL) {
		UI_LOGE("error: failed to read png file!\n");
		return UI_NULL;
	}

	body->pixel_format = _ui_get_pixel_format_from_channels(channels);
	if (body->pixel_format == UI_PIXEL_FORMAT_UNKNOWN) {
		UI_LOGE("error: Not supported pixel format for channel %d\n", channels);
		stbi_image_free(body->buf);
		UI_FREE(body);
		return UI_NULL;
	}

	body->bits_per_pixel = (channels << 3);
	body->bytes_per_line = (body->width * body->bits_per_pixel) >> 3;

	return (ui_asset_t)body;
}

static ui_pixel_format_t _ui_get_pixel_format_from_channels(int channels)
{
	// todo: Support 4bit ~ 16bit pixel format
	switch (channels) {
	case 3:
		return UI_PIXEL_FORMAT_RGB888;
	case 4:
		return UI_PIXEL_FORMAT_RGBA8888;
	default:
		return UI_PIXEL_FORMAT_UNKNOWN;
	}
}

static size_t _ui_get_bpp_from_pf(ui_pixel_format_t type)
{
	switch (type) {
	case UI_PIXEL_FORMAT_GRAY4:
		return 4;
	case UI_PIXEL_FORMAT_GRAYA44:
		return 8;
	case UI_PIXEL_FORMAT_RGB565:
		return 16;
	case UI_PIXEL_FORMAT_ARGB8565:
		return 24;
	case UI_PIXEL_FORMAT_RGBA5658:
		return 24;
	case UI_PIXEL_FORMAT_ARGB4444:
		return 16;
	case UI_PIXEL_FORMAT_RGBA4444:
		return 16;
	case UI_PIXEL_FORMAT_RGB888:
		return 24;
	case UI_PIXEL_FORMAT_ARGB8888:
		return 32;
	case UI_PIXEL_FORMAT_RGBA8888:
		return 32;
	default:
		return 0;
	}
}

size_t ui_image_asset_get_width(ui_asset_t image)
{
	size_t ret = 0;

	if (!ui_is_running()) {
		UI_LOGE("error: UI framework is not running!\n");
		return ret;
	}

	if (!image) {
		UI_LOGE("error: invalid parameter!\n");
		return ret;
	}

	ret = ((ui_image_asset_body_t *)image)->width;

	return ret;
}

size_t ui_image_asset_get_height(ui_asset_t image)
{
	size_t ret = 0;

	if (!ui_is_running()) {
		UI_LOGE("error: UI framework is not running!\n");
		return ret;
	}

	if (!image) {
		UI_LOGE("error: invalid parameter!\n");
		return ret;
	}

	ret = ((ui_image_asset_body_t *)image)->height;

	return ret;
}


text:
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
 *  (C) 2001 by Argonne National Laboratory.
 *      See COPYRIGHT in top-level directory.
 */
#include "mpi.h"
#include <stdlib.h>
#include <string.h>
#include <stdio.h>

/* tests various miscellaneous functions. */
#define VERBOSE 0

void handle_error(int errcode, char *str);

void handle_error(int errcode, char *str)
{
	char msg[MPI_MAX_ERROR_STRING];
	int resultlen;
	MPI_Error_string(errcode, msg, &resultlen);
	fprintf(stderr, "%s: %s\n", str, msg);
}

int main(int argc, char **argv)
{
    int buf[1024], amode, flag, mynod, len, i;
    int errs = 0, toterrs;
    MPI_File fh;
    MPI_Status status;
    MPI_Datatype newtype;
    MPI_Offset disp, offset;
    MPI_Group group;
    MPI_Datatype etype, filetype;
    char datarep[25], *filename;
    int errcode=0;

    MPI_Init(&argc,&argv);
    MPI_Comm_rank(MPI_COMM_WORLD, &mynod);

/* process 0 takes the file name as a command-line argument and
   broadcasts it to other processes */
    if (!mynod) {
	i = 1;
	while ((i < argc) && strcmp("-fname", *argv)) {
	    i++;
	    argv++;
	}
	if (i >= argc) {
	    fprintf(stderr, "\n*#  Usage: misc -fname filename\n\n");
	    MPI_Abort(MPI_COMM_WORLD, 1);
	}
	argv++;
	len = strlen(*argv);
	filename = (char *) malloc(len+1);
	strcpy(filename, *argv);
	MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD);
	MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD);
    }
    else {
	MPI_Bcast(&len, 1, MPI_INT, 0, MPI_COMM_WORLD);
	filename = (char *) malloc(len+1);
	MPI_Bcast(filename, len+1, MPI_CHAR, 0, MPI_COMM_WORLD);
    }

    errcode = MPI_File_open(MPI_COMM_WORLD, filename,
		    MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh);
    if (errcode != MPI_SUCCESS) {
	    handle_error(errcode, "MPI_File_open");
    }

    errcode = MPI_File_write(fh, buf, 1024, MPI_INT, &status);
    if (errcode != MPI_SUCCESS) {
	    handle_error(errcode, "MPI_File_write");
    }

    errcode = MPI_File_sync(fh);
    if (errcode != MPI_SUCCESS) {
	    handle_error(errcode, "MPI_File_sync");
    }

    errcode = MPI_File_get_amode(fh, &amode);
    if (errcode != MPI_SUCCESS) {
	    handle_error(errcode, "MPI_File_get_amode");
    }
#if VERBOSE
    if (!mynod) fprintf(stderr, "testing MPI_File_get_amode\n");
#endif
    if (amode != (MPI_MODE_CREATE | MPI_MODE_RDWR)) {
	errs++;
	fprintf(stderr, "amode is %d, should be %d\n\n",
		amode, MPI_MODE_CREATE | MPI_MODE_RDWR);
    }

    errcode = MPI_File_get_atomicity(fh, &flag);
    if (errcode != MPI_SUCCESS) {
	    handle_error(errcode, "MPI_File_get_atomicity");
    }
    if (flag) {
	errs++;
	fprintf(stderr, "atomicity is %d, should be 0\n", flag);
    }
#if VERBOSE
    if (!mynod) fprintf(stderr, "setting atomic mode\n");
#endif
    errcode = MPI_File_set_atomicity(fh, 1);
    if (errcode != MPI_SUCCESS) {
	    handle_error(errcode, "MPI_File_set_atomicity");
    }
    errcode = MPI_File_get_atomicity(fh, &flag);
    if (errcode != MPI_SUCCESS) {
	    handle_error(errcode, "MPI_File_get_atomicity");
    }
    if (!flag) {
	errs++;
	fprintf(stderr, "atomicity is %d, should be 1\n", flag);
    }
    errcode = MPI_File_set_atomicity(fh, 0);
    if (errcode != MPI_SUCCESS) {
	    handle_error(errcode, "MPI_File_set_atomicity");
    }
#if VERBOSE
    if (!mynod) fprintf(stderr, "reverting back to nonatomic mode\n");
#endif

    MPI_Type_vector(10, 10, 20, MPI_INT, &newtype);
    MPI_Type_commit(&newtype);

    errcode = MPI_File_set_view(fh, 1000, MPI_INT, newtype, "native", MPI_INFO_NULL);
    if (errcode != MPI_SUCCESS) {
	    handle_error(errcode, "MPI_File_set_view");
    }
#if VERBOSE
    if (!mynod) fprintf(stderr, "testing MPI_File_get_view\n");
#endif
    errcode = MPI_File_get_view(fh, &disp, &etype, &filetype, datarep);
    if (errcode != MPI_SUCCESS) {
	    handle_error(errcode, "MPI_File_get_view");
    }
    if ((disp != 1000) || strcmp(datarep, "native")) {
	errs++;
	fprintf(stderr, "disp = %lld, datarep = %s, should be 1000, native\n\n", disp, datarep);
    }
#if VERBOSE
    if (!mynod) fprintf(stderr, "testing MPI_File_get_byte_offset\n");
#endif
    errcode = MPI_File_get_byte_offset(fh, 10, &disp);
    if (errcode != MPI_SUCCESS) {
	    handle_error(errcode, "MPI_File_get_byte_offset");
    }
    if (disp != (1000+20*sizeof(int))) {
	errs++;
	fprintf(stderr, "byte offset = %lld, should be %d\n\n",
		disp, (int) (1000+20*sizeof(int)));
    }

    errcode = MPI_File_get_group(fh, &group);
    if (errcode != MPI_SUCCESS) {
	    handle_error(errcode, "MPI_File_get_group");
    }

#if VERBOSE
    if (!mynod) fprintf(stderr, "testing MPI_File_set_size\n");
#endif
    errcode = MPI_File_set_size(fh, 1000+15*sizeof(int));
    if (errcode != MPI_SUCCESS) {
	    handle_error(errcode, "MPI_File_set_size");
    }
    MPI_Barrier(MPI_COMM_WORLD);
    errcode = MPI_File_sync(fh);
    if (errcode != MPI_SUCCESS) {
	    handle_error(errcode, "MPI_File_sync");
    }
    errcode = MPI_File_get_size(fh, &disp);
    if (errcode != MPI_SUCCESS) {
	    handle_error(errcode, "MPI_File_get_size");
    }
    if (disp != 1000+15*sizeof(int)) {
	errs++;
	fprintf(stderr, "file size = %lld, should be %d\n\n",
		disp, (int) (1000+15*sizeof(int)));
    }

#if VERBOSE
    if (!mynod) fprintf(stderr, "seeking to eof and testing MPI_File_get_position\n");
#endif
    errcode = MPI_File_seek(fh, 0, MPI_SEEK_END);
    if (errcode != MPI_SUCCESS) {
	    handle_error(errcode, "MPI_File_seek");
    }
    errcode = MPI_File_get_position(fh, &disp);
    if (errcode != MPI_SUCCESS) {
	    handle_error(errcode, "MPI_File_get_position");
    }
    if (disp != 10) {
	errs++;
	fprintf(stderr, "file pointer posn = %lld, should be 10\n\n", disp);
    }

#if VERBOSE
    if (!mynod) fprintf(stderr, "testing MPI_File_get_byte_offset\n");
#endif
    errcode = MPI_File_get_byte_offset(fh, disp, &offset);
    if (errcode != MPI_SUCCESS) {
	    handle_error(errcode, "MPI_File_get_byte_offset");
    }
    if (offset != (1000+20*sizeof(int))) {
	errs++;
	fprintf(stderr, "byte offset = %lld, should be %d\n\n",
		offset, (int) (1000+20*sizeof(int)));
    }
    MPI_Barrier(MPI_COMM_WORLD);

#if VERBOSE
    if (!mynod) fprintf(stderr, "testing MPI_File_seek with MPI_SEEK_CUR\n");
#endif
    errcode = MPI_File_seek(fh, -10, MPI_SEEK_CUR);
    if (errcode != MPI_SUCCESS) {
	    handle_error(errcode, "MPI_File_seek");
    }
    errcode = MPI_File_get_position(fh, &disp);
    if (errcode != MPI_SUCCESS) {
	    handle_error(errcode, "MPI_File_get_position");
    }
    errcode = MPI_File_get_byte_offset(fh, disp, &offset);
    if (errcode != MPI_SUCCESS) {
	    handle_error(errcode, "MPI_File_get_byte_offset");
    }
    if (offset != 1000) {
	errs++;
	fprintf(stderr, "file pointer posn in bytes = %lld, should be 1000\n\n", offset);
    }

#if VERBOSE
    if (!mynod) fprintf(stderr, "preallocating disk space up to 8192 bytes\n");
#endif
    errcode = MPI_File_preallocate(fh, 8192);
    if (errcode != MPI_SUCCESS) {
	    handle_error(errcode, "MPI_File_Preallocate");
    }

#if VERBOSE
    if (!mynod) fprintf(stderr, "closing the file and deleting it\n");
#endif
    MPI_File_close(&fh);

    MPI_Barrier(MPI_COMM_WORLD);
    if (!mynod) MPI_File_delete(filename, MPI_INFO_NULL);

    MPI_Allreduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
    if (mynod == 0) {
	if( toterrs > 0) {
	    fprintf( stderr, "Found %d errors\n", toterrs );
	}
	else {
	    fprintf( stdout, " No Errors\n" );
	}
    }
    MPI_Type_free(&newtype);
    MPI_Type_free(&filetype);
    MPI_Group_free(&group);
    free(filename);
    MPI_Finalize();
    return 0;
}


text:
//  Copyright (c) 2014 Readium Foundation and/or its licensees. All rights reserved.
//
//  Redistribution and use in source and binary forms, with or without modification,
//  are permitted provided that the following conditions are met:
//  1. Redistributions of source code must retain the above copyright notice, this
//  list of conditions and the following disclaimer.
//  2. Redistributions in binary form must reproduce the above copyright notice,
//  this list of conditions and the following disclaimer in the documentation and/or
//  other materials provided with the distribution.
//  3. Neither the name of the organization nor the names of its contributors may be
//  used to endorse or promote products derived from this software without specific
//  prior written permission.

'use strict';

module.exports = function(grunt) {

    return {
        readiumjs: {
            files: ['readium-js/**/*.js', '!readium-js/out/Readium.js', '!readium-js/**/node_modules/**'],
            tasks: ['update-readium']
        }
    };
};


text:
{% extends "reviews/reviewable_base.html" %}
{% load difftags djblets_deco djblets_js djblets_utils i18n rb_extensions reviewtags %}
{% load staticfiles tz %}

{% block title %}{{review_request_details.summary}} | {% trans "Diff Viewer" %}{% endblock %}

{% block css %}
{{block.super}}

{%  if siteconfig_settings.diffviewer_show_trailing_whitespace %}

{%  endif %}
{% endblock css %}

{% block content %}
{%  if error %}
{%   errorbox %}

{{error}}

{%    if trace %}
{{trace|escape}}
{% endif %}
{%   enderrorbox %}
{%  else %}{# !error #}

{% display_review_request_trophies review_request %}
{%   include "reviews/review_header.html" %}

{%   box "review-request" %}

{%    star review_request %}

{%    include "reviews/review_request_actions_secondary.html" %}
{%    diffviewer_action_hooks %}

{% trans "Download Diff" %}

{%    include "reviews/review_request_actions_primary.html" %}

{% trans "View Reviews" %}

{%    include "reviews/review_request_box.html" %}

{%    if collapseall %}

 {% trans "Expand changes" %}

{%    else %}

 {% trans "Collapse changes" %}

{%    endif %}
{%    if siteconfig_settings.diffviewer_show_trailing_whitespace %}

 {% trans "Hide Extra Whitespace" %}

 {% trans "Show Extra Whitespace" %}

{%    endif %}

 {% trans "Hide Whitespace changes" %}

 {% trans "Show Whitespace changes" %}

{%   endbox %}

{%  endif %}{# !error #}
{% endblock content %}

{% block scripts-post %}
{{block.super}}

{% endblock scripts-post %}


text:
<!DOCTYPE html>

	<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
	<meta name="apple-mobile-web-app-capable" content="yes"/>
	<title>TabBar</title>

	<link href="../../themes/common/domButtons/DomButtonYellowStar.css" rel="stylesheet"/>
	<link href="../../themes/common/domButtons/DomButtonGrayStar.css" rel="stylesheet"/>

tabBar

Image

Sprite

DOM Button

segmentedControl

New

Dramatic

Insight

(in a Heading)

Catalog

Share

Download

		MMMM

standardTab

Dashboard

Plan

Today's Main Event

Dashboard

Plan

Today's Main Event

Image

Sprite

DOM Button

slimTab

Dashboard

Plan

Event

Dashboard

Plan

Today's Main Event

Image

Sprite

DOM Button

flatTab

Dashboard

Plan

Event

Dashboard

Plan

Today's Main Event

Image

Sprite

DOM Button

tallTab

Image

Sprite

DOM Button


text:
/**
 * @file   TmxProperty.cpp
 * @brief  TmxProperty class implementation.
 * @author zer0
 * @date   2019-06-10
 */

#include <libtbag/tiled/details/TmxProperty.hpp>
#include <libtbag/string/StringUtils.hpp>

#include <cstring>
#include <cassert>

// -------------------
NAMESPACE_LIBTBAG_OPEN
// -------------------

namespace tiled   {
namespace details {

TmxProperty::TmxProperty() : name(), value(), type(Type::NONE)
{
    // EMPTY.
}

TmxProperty::TmxProperty(std::string const & n, std::string const & v, Type t)
        : name(n), value(v), type(t)
{
    // EMPTY.
}

TmxProperty::TmxProperty(std::string const & n, std::string const & v)
        : name(n), value(v), type(Type::STRING)
{
    // EMPTY.
}

TmxProperty::TmxProperty(std::string const & n, int v)
        : name(n), value(std::to_string(v)), type(Type::INT)
{
    // EMPTY.
}

TmxProperty::TmxProperty(std::string const & n, float v)
        : name(n), value(std::to_string(v)), type(Type::FLOAT)
{
    // EMPTY.
}

TmxProperty::TmxProperty(std::string const & n, bool v)
        : name(n), value(v ? VAL_TRUE : VAL_FALSE), type(Type::BOOL)
{
    // EMPTY.
}

TmxProperty::TmxProperty(std::string const & n, Rgb24 const & c)
        : TmxProperty(n, libtbag::graphic::convertRgb24ToRgb32(c))
{
    // EMPTY.
}

TmxProperty::TmxProperty(std::string const & n, Rgb32 const & c)
        : name(n), value(c.toArgbString()), type(Type::COLOR)
{
    // EMPTY.
}

TmxProperty::TmxProperty(std::string const & n, Path const & p)
        : name(n), value(p.toString()), type(Type::FILE)
{
    // EMPTY.
}

TmxProperty::~TmxProperty()
{
    // EMPTY.
}

TmxProperty::Type TmxProperty::getType(std::string const & text) TBAG_NOEXCEPT
{
    if (text == VAL_STRING) {
        return Type::STRING;
    } else if (text == VAL_INT) {
        return Type::INT;
    } else if (text == VAL_FLOAT) {
        return Type::FLOAT;
    } else if (text == VAL_BOOL) {
        return Type::BOOL;
    } else if (text == VAL_COLOR) {
        return Type::COLOR;
    } else if (text == VAL_FILE) {
        return Type::FILE;
    } else {
        return Type::NONE;
    }
}

char const * const TmxProperty::getTypeName(Type t) TBAG_NOEXCEPT
{
    // clang-format off
    switch (t) {
    case Type::STRING:  return VAL_STRING;
    case Type::INT:     return VAL_INT;
    case Type::FLOAT:   return VAL_FLOAT;
    case Type::BOOL:    return VAL_BOOL;
    case Type::COLOR:   return VAL_COLOR;
    case Type::FILE:    return VAL_FILE;
    case Type::NONE:
        TBAG_FALLTHROUGH
    default:
        return "";
    }
    // clang-format on
}

int TmxProperty::toInt(int def) const
{
    return libtbag::string::toValue<int>(value, def);
}

float TmxProperty::toFloat(float def) const
{
    return libtbag::string::toValue<float>(value, def);
}

bool TmxProperty::toBool(bool def) const
{
    return libtbag::string::toValue<bool>(value, def);
}

TmxProperty::Rgb32 TmxProperty::toColor(Rgb32 const & def) const
{
    Rgb32 result;
    if (isSuccess(libtbag::graphic::convertArgbHexStringToRgb32(value, result))) {
        return result;
    }
    return def;
}

TmxProperty::Path TmxProperty::toFile() const
{
    return Path(value);
}

void TmxProperty::clear()
{
    name.clear();
    value.clear();
    type = Type::STRING; // (default)
}

Err TmxProperty::read(Element const & elem)
{
    if (strncmp(elem.Name(), TAG_NAME, libtbag::string::string_length(TAG_NAME)) != 0) {
        return E_ILLARGS;
    }

    Err code = optAttr(elem, ATT_NAME, name); // #REQUIRED
    if (isFailure(code)) {
        return code;
    }

    code = optAttr(elem, ATT_VALUE, value); // #REQUIRED
    if (isFailure(code)) {
        return code;
    }

    std::string type_text;
    optAttr(elem, ATT_TYPE, type_text, VAL_STRING);
    type = getType(type_text);
    if (type == Type::NONE) {
        // Unknown Type value.
    }

    return E_SUCCESS;
}

Err TmxProperty::read(std::string const & xml)
{
    Document doc;
    auto const CODE = readFromXmlText(doc, xml);
    if (isFailure(CODE)) {
        return CODE;
    }
    auto const * elem = doc.FirstChildElement(TAG_NAME);
    assert(elem != nullptr);
    return read(*elem);
}

Err TmxProperty::write(Element & elem) const
{
    if (strncmp(elem.Name(), TAG_NAME, libtbag::string::string_length(TAG_NAME)) != 0) {
        return E_ILLARGS;
    }
    setAttr(elem, ATT_NAME, name);
    setAttr(elem, ATT_VALUE, value);
    setAttr(elem, ATT_TYPE, getTypeName(type));
    return E_SUCCESS;
}

Err TmxProperty::write(std::string & xml) const
{
    Document doc;
    auto * new_elem = newElement(doc, TAG_NAME);
    assert(new_elem != nullptr);
    auto const CODE = write(*new_elem);
    if (isFailure(CODE)) {
        return CODE;
    }
    insertElement(doc, new_elem);
    return writeDocumentToXmlText(doc, xml);
}

bool TmxProperty::validate(Version const & version) const
{
    if (type == Type::NONE) {
        return false;
    }

    Version const V017(0, 17);
    if (version >= V017) {
        return true;
    }
    assert(version < V017);
    assert(type != Type::NONE);
    if (type == Type::COLOR || type == Type::FILE) {
        return false;
    }

    Version const V016(0, 16);
    if (version >= V016) {
        return true;
    }
    assert(version < V016);
    assert(type != Type::NONE);
    assert(type != Type::COLOR);
    assert(type != Type::FILE);
    return (type == Type::STRING);
}

bool TmxProperty::validate(std::string const & version) const
{
    return validate(Version(version));
}

bool TmxProperty::validate(int major_version, int minor_version) const
{
    return validate(Version(major_version, minor_version));
}

} // namespace details
} // namespace tiled

// --------------------
NAMESPACE_LIBTBAG_CLOSE
// --------------------


text:
package com.vlkan.hrrs.servlet;

import org.junit.Test;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;

public class HrrsHelperTest {

    @Test
    public void test_isBlank() {
        test_isBlank(true, null, "", " ", "  ", "\t", " \t", "\n\t", "\r\n", " \t \r\n");
        test_isBlank(false, " x", "\t x", "\t x \t", "  x  ");
    }

    private void test_isBlank(boolean expectedBlank, String... texts) {
        for (String text : texts) {
            boolean actualBlank = HrrsHelper.isBlank(text);
            assertThat(actualBlank, is(expectedBlank));
        }
    }

}


text:
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using UnityEngine;

#if !UNITY_2019_3_OR_NEWER
using UnityEngine.UI;
#endif // !UNITY_2019_3_OR_NEWER

namespace Microsoft.MixedReality.Toolkit.Experimental.UI
{
    /// <summary>
    /// A component that can be added to InputField to make it work with Windows Mixed Reality's system keyboard.
    /// Only used in Unity 2018.4.
    /// No longer used in Unity 2019.3 and later versions (becomes an empty MonoBehaviour and is only around for compatibility) and you can safely remove it if you wish
    /// </summary>
    /// <remarks>
    /// <para>If using Unity 2019 or 2020, make sure the version >= 2019.4.25 or 2020.3.2 to ensure the latest fixes for Unity keyboard bugs are present.</para>
    /// <para>There is a known Unity/TMP issue preventing the caret from showing up. Please see https://github.com/microsoft/MixedRealityToolkit-Unity/issues/9056 for updates.</para>
    /// </remarks>
#if !UNITY_2019_3_OR_NEWER
    [RequireComponent(typeof(MRTKTMPInputField))]
    [AddComponentMenu("Scripts/MRTK/Experimental/Keyboard/TMP_KeyboardInputField")]
#endif
    public class TMP_KeyboardInputField :
#if UNITY_2019_3_OR_NEWER
        MonoBehaviour
#else
        KeyboardInputFieldBase<MRTKTMPInputField>
#endif
    {
#if !UNITY_2019_3_OR_NEWER
        public override string Text { get => inputField.text; protected set => inputField.text = value; }
        protected override Graphic TextGraphic(MRTKTMPInputField inputField) => inputField.textComponent;
        protected override Graphic PlaceHolderGraphic(MRTKTMPInputField inputField) => inputField.placeholder;
        protected override void SyncCaret()
        {
            inputField.caretPosition = CaretIndex;
            inputField.SelectionPosition = CaretIndex;
        }
#endif
    }
}


text:
<?php

// @codingStandardsIgnoreFile

namespace Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemPlugin;

class ValidPlugin
{
    /**
     * @param \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments $subject
     * @param string $result
     * @return string
     *
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function afterGetItem(
        \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments $subject, $result
    ) {
        return $result . '!';
    }

    /**
     * @param \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments $subject
     * @param $name
     * @return string
     *
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function beforeGetItem(
        \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments $subject, $name
    ) {
        return '|' . $name;
    }

    /**
     * @param \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments $subject
     * @param Closure $proceed
     * @param string $name
     * @return string
     *
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     */
    public function aroundGetItem(
        \Magento\Framework\Interception\Test\Unit\Custom\Module\Model\InterfaceValidator\ItemWithArguments $subject,
        \Closure $proceed,
        $name
    ) {
        $proceed('&' . $name . '&');
    }
}


text:
title: Number.prototype.toLocaleString
localeTitle: Number.prototype.toLocaleString
---
## Number.prototype.toLocaleString

这是一个存根。 [帮助我们的社区扩展它](https://github.com/freecodecamp/guides/tree/master/src/pages/javascript/standard-objects/number/number-prototype-tolocalestring/index.md) 。

[这种快速风格指南有助于确保您的拉取请求被接受](https://github.com/freecodecamp/guides/blob/master/README.md) 。

#### 更多信息:


text:
	<title>Options for Facebook Usage Limit</title>
	<link type="text/css" rel="stylesheet" href="ios7.css" />
	<link rel="stylesheet" type="text/css" href="define.css">

		Set Usage Limit to:
		<input type="number" min="0" max="1440" id="time_limit" size="5" placeholder="0" autofocus="true" align="middle"> mins

		<button id="saveOption" class="button">&#61723Save</button>
	    <button id="eraseOption" class="button">&#61714Restore default</button>

Reading data..


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>io.ebean.config.dbplatform.oracle (ebean 11.35.3 API)</title>
<meta name="date" content="2019-03-05">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

io.ebean.config.dbplatform.oracle

Classes

OracleDbEncrypt

OracleDbHistorySupport

OraclePlatform

OracleSequenceIdGenerator


text:
namespace chatterino {

QualityPopup::QualityPopup(const QString &channelURL, QStringList options)
    : BasePopup({},
                static_cast<QWidget *>(&(getApp()->windows->getMainWindow())))
    , channelURL_(channelURL)
{
    this->ui_.selector = new QComboBox(this);
    this->ui_.vbox = new QVBoxLayout(this);
    this->ui_.buttonBox = new QDialogButtonBox(
        QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);

    QObject::connect(this->ui_.buttonBox, &QDialogButtonBox::accepted, this,
                     &QualityPopup::okButtonClicked);
    QObject::connect(this->ui_.buttonBox, &QDialogButtonBox::rejected, this,
                     &QualityPopup::cancelButtonClicked);

    this->ui_.selector->addItems(options);

    this->ui_.vbox->addWidget(this->ui_.selector);
    this->ui_.vbox->addWidget(this->ui_.buttonBox);

    this->setLayout(this->ui_.vbox);
}

void QualityPopup::showDialog(const QString &channelURL, QStringList options)
{
    QualityPopup *instance = new QualityPopup(channelURL, options);

    instance->window()->setWindowTitle("Chatterino - select stream quality");
    instance->setAttribute(Qt::WA_DeleteOnClose, true);

    instance->show();
    instance->activateWindow();
    instance->raise();
}

void QualityPopup::keyPressEvent(QKeyEvent *e)
{
    if (this->handleEscape(e, this->ui_.buttonBox))
    {
        return;
    }
    if (this->handleEnter(e, this->ui_.buttonBox))
    {
        return;
    }

    BasePopup::keyPressEvent(e);
}

void QualityPopup::okButtonClicked()
{
    try
    {
        openStreamlink(this->channelURL_, this->ui_.selector->currentText());
    }
    catch (const Exception &ex)
    {
        qCWarning(chatterinoWidget)
            << "Exception caught trying to open streamlink:" << ex.what();
    }

    this->close();
}

void QualityPopup::cancelButtonClicked()
{
    this->close();
}

}  // namespace chatterino


text:
package org.orgama.shared.unique;

import com.googlecode.objectify.annotation.OnSave;
import org.orgama.shared.IHasId;

/**
 * base class for an entity that has unique fields.
 * @author kguthrie
 */
public abstract class HasIdAndUniqueFields<T> implements IHasId<T> {

	private static final transient Object syncLock = new Object();
	private static transient IUniqueFieldHandler uniqueFieldHandler = null;

	/**
	 * @param uniqueFieldHandler the uniqueFieldHandler to set
	 */
	public static void setUniqueFieldHandler(
			IUniqueFieldHandler uniqueFieldHandler) {
		if (HasIdAndUniqueFields.uniqueFieldHandler == null) {
			synchronized(syncLock) {
				if (HasIdAndUniqueFields.uniqueFieldHandler == null) {
					HasIdAndUniqueFields.uniqueFieldHandler =
							uniqueFieldHandler;
				}
			}
		}

	}

	/**
	 * use the unique field handler to ensure the uniqueness of all the
	 * unique fields in this entity.  This is done just before saving the object
	 */
	@OnSave
	public synchronized void handleUniqueFields() {
		uniqueFieldHandler.handleUniqueFields(this);
	}
}


text:
8cc C Compiler
==============

8cc is a compiler for the C programming language.
It's intended to support all C11 language features
while keeping the code as small and simple as possible.

The compiler is able to compile itself.
You can see its code both as an implementation of the C language
and as an example of what this compiler is able to compile.

8cc's source code is carefully written to be as concise and easy-to-read
as possible, so that the source code becomes good study material
to learn about various techniques used in compilers.
You may find the lexer, the preprocessor and the parser are
already useful to learn how C source code is processed at each stage.

It's not an optimizing compiler.
Generated code is usually 2x or more slower than GCC.
I plan to implement a reasonable level of optimization in the future.

8cc supports x86-64 Linux only. I have no plan to make it portable until
I fix all known miscompilations and implement an optimization pass.
As of 2015, I'm using Ubuntu 14 as my development platform.
It should work on other x86-64 Linux distributions though.

Note: Do not have high expectations on this compiler.
If you try to compile a program other than the compiler itself,
there's a good chance to see compile errors or miscompilations.
This is basically a one-man project, and I have spent only a few
months of my spare time so far.

Build
-----

Run make to build:

    make

8cc comes with unit tests. To run the tests, give "test" as an argument:

    make test

The following target builds 8cc three times to verify that
stage1 compiler can build stage2, and stage2 can build stage3.
It then compares stage2 and stage3 binaries byte-by-byte to verify
that we reach a fixed point.

    make fulltest

Author
------

Rui Ueyama <rui314@gmail.com>

Links for C compiler development
--------------------------------

Besides popular books about compiler, such as the Dragon Book,
I found the following books/documents are very useful
to develop a C compiler.
Note that the standard draft versions are very close to the ratified versions.
You can practically use them as the standard documents.

-   LCC: A Retargetable C Compiler: Design and Implementation
    http://www.amazon.com/dp/0805316701,
    https://github.com/drh/lcc

-   TCC: Tiny C Compiler
    http://bellard.org/tcc/,
    http://repo.or.cz/w/tinycc.git/tree

-   C99 standard final draft
    http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf

-   C11 standard final draft
    http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf

-   Dave Prosser's C Preprocessing Algorithm
    http://www.spinellis.gr/blog/20060626/

-   The x86-64 ABI
    http://www.x86-64.org/documentation/abi.pdf


text:
namespace Google.Cloud.AIPlatform.V1.Snippets
{
    // [START aiplatform_v1_generated_TensorboardService_BatchCreateTensorboardRuns_sync_flattened_resourceNames]
    using Google.Cloud.AIPlatform.V1;
    using System.Collections.Generic;

    public sealed partial class GeneratedTensorboardServiceClientSnippets
    {
        /// <summary>Snippet for BatchCreateTensorboardRuns</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public void BatchCreateTensorboardRunsResourceNames()
        {
            // Create client
            TensorboardServiceClient tensorboardServiceClient = TensorboardServiceClient.Create();
            // Initialize request argument(s)
            TensorboardExperimentName parent = TensorboardExperimentName.FromProjectLocationTensorboardExperiment("[PROJECT]", "[LOCATION]", "[TENSORBOARD]", "[EXPERIMENT]");
            IEnumerable<CreateTensorboardRunRequest> requests = new CreateTensorboardRunRequest[]
            {
                new CreateTensorboardRunRequest(),
            };
            // Make the request
            BatchCreateTensorboardRunsResponse response = tensorboardServiceClient.BatchCreateTensorboardRuns(parent, requests);
        }
    }
    // [END aiplatform_v1_generated_TensorboardService_BatchCreateTensorboardRuns_sync_flattened_resourceNames]
}


text:
<?php

/**
 * @group formatting
 */
class Tests_Formatting_WPSpecialchars extends WP_UnitTestCase {
	function test_wp_specialchars_basics() {
		$html =  "&<hello world>";
		$this->assertEquals( $html, _wp_specialchars( $html ) );

		$double = "&amp;&lt;hello world&gt;";
		$this->assertEquals( $double, _wp_specialchars( $html, ENT_NOQUOTES, false, true ) );
	}

	function test_allowed_entity_names() {
		global $allowedentitynames;

		// Allowed entities should be unchanged
		foreach ( $allowedentitynames as $ent ) {
			$ent = '&' . $ent . ';';
			$this->assertEquals( $ent, _wp_specialchars( $ent ) );
		}
	}

	function test_not_allowed_entity_names() {
		$ents = array( 'iacut', 'aposs', 'pos', 'apo', 'apo?', 'apo.*', '.*apo.*', 'apos ', ' apos', ' apos ' );

		foreach ( $ents as $ent ) {
			$escaped = '&' . $ent . ';';
			$ent = '&' . $ent . ';';
			$this->assertEquals( $escaped, _wp_specialchars( $ent ) );
		}
	}

	function test_optionally_escapes_quotes() {
		$source = "\"'hello!'\"";
		$this->assertEquals( '"'hello!'"', _wp_specialchars($source, 'single') );
		$this->assertEquals( ""'hello!'"", _wp_specialchars($source, 'double') );
		$this->assertEquals( '"'hello!'"', _wp_specialchars($source, true) );
		$this->assertEquals( $source, _wp_specialchars($source) );
	}
}


text:
./compare/*
====

`config.json` is generated by `$ gulp test`.

`index.html` is opened by `$gulp test` after screenshots are generated and the local http server is started.

The HTTP server will auto-shutdown after a 15 minute timeout to save you the trouble of cleaning it up yourself. You can configure this in `./server.js`


text:
=====================
Network Configuration
=====================

Now it's time to setup the network for your virtual machine.

Windows Settings
================

Before configuring the underlying networking of the virtual machine, you might
want to tweak some settings inside Windows itself.

One of the most important things to do is **disabling** *Windows Firewall* and the
*Automatic Updates*. The reason behind this is that they can affect the behavior
of the malware under normal circumstances and that they can pollute the network
analysis performed by Cuckoo, by dropping connections or including irrelevant
requests.

You can do so from Windows' Control Panel as shown in the picture:

    .. image:: ../../_images/screenshots/windows_security.png
        :align: center

Virtual Networking
==================

Now you need to decide how to make your virtual machine able to access
Internet or your local network.

While in previous releases Cuckoo used shared folders to exchange data between
the Host and Guests, from release 0.4 it adopts a custom agent that works
over the network using a simple XMLRPC protocol.

In order to make it work properly you'll have to configure your machine's
network so that the Host and the Guest can communicate. Testing the network
access by pinging a guest is a good practice, to make sure the virtual network
was set up correctly. Use only static IP addresses for your guest, as Cuckoo
doesn't support DHCP and using it will break your setup.

This stage is very much up to your own requirements and to the
characteristics of your virtualization software.

.. warning:: Virtual networking errors!
    Virtual networking is a vital component for Cuckoo, you must be really
    sure to get connectivity between host and guest. Most of the issues
    reported by users are related to a wrong setup of their networking.
    If you aren't sure about that check your virtualization software
    documentation and test connectivity with ping and telnet.

The recommended setup is using a **Host-Only networking layout** with proper
forwarding. More on such network routing can be found in
:doc:`../host/routing`, which is part of the host machine setup.


text:
package io.spring.initializr.generator.test.buildsystem.gradle;

import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;

import org.assertj.core.api.AssertProvider;
import org.junit.jupiter.api.Test;

import org.springframework.core.io.ClassPathResource;
import org.springframework.util.StreamUtils;

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;

/**
 * Test for {@link GroovyDslGradleSettingsAssert}.
 *
 * @author Stephane Nicoll
 */
class GroovyDslGradleSettingsAssertTests {

	@Test
	void hasProjectName() {
		assertThat(forSampleGradleSettings()).hasProjectName("demo");
	}

	@Test
	void hasProjectNameWithWrongValue() {
		assertThatExceptionOfType(AssertionError.class)
				.isThrownBy(() -> assertThat(forSampleGradleSettings()).hasProjectName("another-project"));
	}

	private AssertProvider<GroovyDslGradleSettingsAssert> forSampleGradleSettings() {
		String path = "project/build/gradle/sample-settings.gradle";
		try (InputStream in = new ClassPathResource(path).getInputStream()) {
			String content = StreamUtils.copyToString(in, StandardCharsets.UTF_8);
			return () -> new GroovyDslGradleSettingsAssert(content);
		}
		catch (IOException ex) {
			throw new IllegalStateException("No content found at " + path, ex);
		}
	}

}


text:
package freemarker.core;

import java.io.IOException;

import freemarker.template.TemplateException;

final class RecoveryBlock extends TemplateElement {

    RecoveryBlock(TemplateElement block) {
        this.nestedBlock = block;
    }

    void accept(Environment env) throws TemplateException, IOException
    {
        if (nestedBlock != null) {
            env.visitByHiddingParent(nestedBlock);
        }
    }

    protected String dump(boolean canonical) {
        if (canonical) {
            StringBuffer buf = new StringBuffer();
            buf.append('<').append(getNodeTypeSymbol()).append('>');
            if (nestedBlock != null) {
                buf.append(nestedBlock.getCanonicalForm());
            }
            buf.append("</").append(getNodeTypeSymbol()).append('>');
            return buf.toString();
        } else {
            return getNodeTypeSymbol();
        }
    }

    String getNodeTypeSymbol() {
        return "#recover";
    }

    int getParameterCount() {
        return 0;
    }

    Object getParameterValue(int idx) {
        throw new IndexOutOfBoundsException();
    }

    ParameterRole getParameterRole(int idx) {
        throw new IndexOutOfBoundsException();
    }

    boolean isNestedBlockRepeater() {
        return false;
    }

}


text:
exports.create = function(req, res){
				res.render('create', {title: 'HashOut'});
			};


text:
$(function() {
	function refresh(obj) {
        obj.src = "imageServlet?"+Math.random();
    }
	function subLogin() {
		alert("denglu");
	}
    var imgOffsetX, imgOffsetY, loginImgWidth, loginImgHeight, scale;
    //报错蒙板
    var $mask = $('<div class="fs-login-errmask"/>');
    //用户名
    var user_ctrl=$('input.fs-login-username').attr("placeholder", "用户名").attr('title',"用户名");
    //密码
    var psw_ctrl=$('input.fs-login-password').attr("placeholder", "用户密码").attr('title',"用户密码");
    //校验码
    var checkCode_ctrl=$('input.fs-login-checkCode').attr("placeholder", "校验码").attr('title',"校验码");

    $('input').focus(function(){
        $(this).parent().addClass('fs-login-input-focus');
        $mask.hide();
    }).blur(function(){
            $(this).parent().removeClass('fs-login-input-focus');
        });
    //是否保持登录状态
//    var $keep = $('span.fs-login-remember').text(FR.i18nText("FS-Generic-Privilege_Keep_Login_State")).click(
//        function(){
//            $(this).toggleClass('fs-login-remember-selected');
//        }
//    );
    //登录按钮
    $('a').text("登录").click(
        function(){
            signIN();
        }
    );
    //绑定回车
    $(document).keydown(function(e){
        if(e.keyCode===13){
            signIN();
        }
    });
    /**
     * 初始化FS的登录背景图片
     */
    var initBackgroundImage = function () {
        var self = this;
        var ran = new Date().getTime() + "" + (Math.random() * 1000);
        loginImgWidth = 1920;
        loginImgHeight = 1080;
        calcBackgroundScale();
        if ($('body').length > 0) {
            var loginImg = $('img.fs-login-img');
//            loginImg.attr("src", url);
            loginImg.css({
                "margin-left": "-" + imgOffsetX + "px",
                "margin-top": "-" + imgOffsetY + "px",
                width: loginImgWidth * scale + "px",
                height: loginImgHeight * scale + "px"
            });

            var offset = $('#fs-login-scalebg').offset();
            var loginScaleBgImg = $('img.fs-login-scalebg-img');
//            loginScaleBgImg.attr("src", url);
            loginScaleBgImg.css({
                "margin-left": "-" + (imgOffsetX + offset.left) + "px",
                "margin-top": "-" + (imgOffsetY + offset.top) + "px",
                width: loginImgWidth * scale + "px",
                height: loginImgHeight * scale + "px"
            });
        }
    };

    var calcBackgroundScale = function () {
        var windowWidth = document.body.clientWidth;
        var windowHeight = document.body.clientHeight;

        if (windowWidth / windowHeight >= loginImgWidth / loginImgHeight) {
            scale = windowWidth / loginImgWidth;
            imgOffsetX = 0;
            imgOffsetY = (loginImgHeight * scale - windowHeight) / 2;
        } else {
            scale = windowHeight / loginImgHeight;
            imgOffsetX = (loginImgWidth * scale - windowWidth) / 2;
            imgOffsetY = 0;
        }
    };

    var showErrorMsg = function($pos, msg){
        $mask.hide().insertAfter($pos).text(msg);
        $mask.click(function(){
            $(this).fadeOut();
            $pos.select();
        }).fadeIn();
    };

    var signIN = function(){
        $mask.hide();
        var user = $('input.fs-login-username').val();
        var pw =  $('input.fs-login-password').val();
        var checkCode= $('input.fs-login-checkCode').val();
        //用户名为空
        if(user==null||user==''){
            showErrorMsg(user_ctrl,"用户名不能为空!");
            return;
        }
        //密码为空
        if(pw==null||pw==''){
            showErrorMsg(psw_ctrl,"密码不能为空!");
            return;
        }
        if(checkCode==null||checkCode==''){
            showErrorMsg(checkCode_ctrl,"校验码不能为空!");
            return;
        }
    	var form = document.getElementsByTagName("form");
        //form[0].userPwd.value=$.md5(form[0].userPwd.value).toUpperCase();
//		form[0].method.value = "login";
		form[0].submit();
    };
    initBackgroundImage();

    $(window).resize(function(){
        calcBackgroundScale();
        $('img.fs-login-img').css({
            "margin-left": "-" + imgOffsetX +"px",
            "margin-top": "-" + imgOffsetY +"px",
            width: loginImgWidth * scale + "px",
            height: loginImgHeight * scale + "px"
        });
        var offset = $('#fs-login-scalebg').offset();
        $('img.fs-login-scalebg-img').css({
            "margin-left": "-" + (imgOffsetX + offset.left) + "px",
            "margin-top": "-" + (imgOffsetY + offset.top) + "px",
            width: loginImgWidth * scale + "px",
            height: loginImgHeight * scale + "px"
        });
    });
});


text:
layout: post97
title:  Hector Client
categories: XAP97
parent: cassandra-space-persistency.html
weight: 300
---

A wrapper around the [Hector Library](http://hector-client.github.com/hector/build/html/index.html) used for communicating with Cassandra.

This component is used by both the [Cassandra Space Synchronization Endpoint](./cassandra-space-synchronization-endpoint.html) and the [Cassandra Space Data Source](./cassandra-space-data-source.html). The main usage is related to metadata operations (such as creating column families, adding secondary indexes, reading column families metadata, etc...).

# Configuration

## Library Dependencies

See [Hector library dependencies](./cassandra-space-synchronization-endpoint.html#Library dependencies) for required dependencies.

## Setup

{% inittab Configuration Examples %}
{% tabcontent Spring %}

{% highlight xml %}
<bean id="hectorClient"
    class="org.openspaces.persistency.cassandra.HectorCassandraClientFactoryBean">

    <!-- comma separated seed list -->
    <property name="hosts" value="${cassandra.host}" />

    <!-- cassandra rpc communication port -->
    <property name="port" value="${cassandra.port}" />

    <!-- keyspace name to work with -->
    <property name="keyspaceName" value="${cassandra.keyspace}" />

</bean>
{% endhighlight %}

{% endtabcontent %}
{% tabcontent Code %}

{% highlight java %}
HectorCassandraClient hectorClient = new HectorCassandraClientConfigurer()
    .hosts(cassandraHosts)
    .port(cassandraPort)
    .keyspaceName(cassandraKeyspaceName)
    .create();
{% endhighlight %}

{% endtabcontent %}
{% endinittab %}

## `HectorCassandraClient` Properties

{: .table .table-bordered}
|Property|Description|Default|
|:-------|:----------|:------|
|hosts|A comma separated list of seeds in the Cassandra cluster| |
|port|The rpc port for Cassandra client communication|9160|
|keyspaceName|The name of the keyspace to work with| |
|clusterName|If there is need to connect to more than one Cassandra cluster within the same JVM, each cluster should be references by a different name.|cluster|
|readConsistencyLevel|The [CassandraConsistencyLevel](http://www.gigaspaces.com/docs/JavaDoc{% currentversion %}/index.html?org/openspaces/persistency/cassandra/CassandraConsistencyLevel.html) in which read operations should be performed|QUORUM|
|writeConsistencyLevel|The [CassandraConsistencyLevel](http://www.gigaspaces.com/docs/JavaDoc{% currentversion %}/index.html?org/openspaces/persistency/cassandra/CassandraConsistencyLevel.html) in which write operations should be performed|QUORUM|
|columnFamilyGcGraceSeconds|See [Distributed deletes](http://wiki.apache.org/cassandra/DistributedDeletes) |10 Days (Derived from Cassandra's default value)|


text:
The dataflow diagram defines VisFlow works to transmit, process, and visualize the data.
A dataflow diagram consists of nodes and directed edges.
It is topologically a directed acyclic graph (DAG).
The dataflow diagram in VisFlow follows the [subset flow](/dataflow/subsetflow.md) model.

Below shows a sample diagram that presents a set of visualizations of the car dataset.
![diagram](./diagram.png)

## Node
A node is a primitive component in VisFlow that performs one type of tasks.
For example, a <node-type type="data-source"/> loads a tabular dataset and a <node-type type="scatterplot"/> charts the data using 2D scatterplot.
A node has input and output data that are transmitted via [ports](#port).

## Port
A node has ports located on its two sides.
The <port-type type="input" text="Input Ports"/> of a node are located on the left.
The <port-type type="output" text="Output Ports"/> of a node are located on the right.
Ports are connected by [edges](#edge).

The connectivity of a port is either `single` <port-type type="input" text=""/> or `multile` <port-type type="multi-input" text=""/>.
A `single` port may be connected with at most one edge.
A `multiple` port may have unlimited number of connections.
All output ports are `multiple` ports.

If an output port produces interactive selection from a [visualization](/dataflow/visualization.md),
it is a <port-type type="selection"/>.

## Edge
An edge defines how data are transmitted between nodes in VisFlow.
Each edge connects two ports, and goes from an output port of the source node to an input port of the target node.

## Subset
The majority of data transmitted between VisFlow nodes are _subsets_ of the input tabular data.
Each row of the input table is considered to be a _data item_.
The group of data items that is transmitted is therefore a _subset_ of the input table.

VisFlow employs a [subset flow](/dataflow/subsetflow.md) model for its dataflow diagrams.
The attribute values and table columns of a data item cannot be changed within the flow, except that [visual properties](#visual-property) can be associated with a data item.
For any data item from a subset, it always corresponds to one row from an input table.

## Constant
A _constant_ in VisFlow is defined to be one constant value that can be a number, a string, or a date.
A list of constants can be transmitted between VisFlow nodes via edges connecting a pair of <port-type type="constants" text="Constants Ports"/>.
Constants can either by manually specified by a user, or extracted from input tables.

Constants can be used to perform attribute filtering.
For example, an <node-type type="attribute-filter"/> may perform range filtering by accepting two constants that define the filtering range.

Constants may also be used as keys to relate heterogeneous tables.
See [linking](/dataflow/linking.md) for more details.

## Visual Property
Visual properties may be assigned to data items in the dataflow using a <node-type type="visual-editor"/> so as to identify and trace data subsets.
Visualizations in VisFlow respect the visual properties of data items and renders the data according to their visual properties.
Each visualization may have its own way of showing the visual properties.
See [node types documentation](/dataflow/visualization.html#visualization-types) for how each type of visualization renders the visual properties.

Each data item carries its own visual properties.
These properties can be updated and modified by nodes in the dataflow.
When two tables are merged by a <node-type type="set-operator"/>, the visual properties of each data item are also merged.

Currently VisFlow supports five types of visual properties: <ui-value text="color"/>, <ui-value text="border"/>, <ui-value text="width"/>, <ui-value text="size"/>, and <ui-value text="opacity"/>.


text:
(function() {
    "use strict";

    var Store = function() {
        this.data = {};
    };

    Object.assign(Store.prototype, require("./Emitter"), {
        has: function(key) {
            return this.data.hasOwnProperty(key);
        },

        get: function(key) {
            return this.data[key];
        },

        set: function(key, value) {
            var changeset = {};
            var data = key;

            if (value !== undefined) {
                data = {};
                data[key] = value;
            }

            Object.keys(data).forEach(function(key) {
                var oldValue = this.get(key);
                var value = data[key];

                changeset[key] = oldValue;
                this.data[key] = value;

                this.emit("change:" + key, value, oldValue);
            }, this);

            this.emit("change", changeset);
        },

        unset: function(key) {
            if (this.has(key)) {
                var oldValue = this.get(key);
                delete this.data[key];

                this.emit("change:" + key, undefined, oldValue);
            }
        },

        clear: function() {
            var changeset = {};

            Object.keys(this.data).forEach(function(key) {
                changeset[key] = this.get(key);
                this.unset(key);
            }, this);

            this.emit("change", changeset);
        }
    });

    module.exports = Store;
}).call(this);


text:
module TripSpark
  module Connection
    extend self

    # Return the connection adapter instance
    def connection
      @connection ||= adapter.new(TripSpark.configuration)
    end

    # Return the class of the adapter to use for the connection
    def adapter
      @@adapters[TripSpark.configuration.adapter]
    end

    # Register a new class that can be used as a connection adapter
    def register_adapter name, klass
      (@@adapters ||= {})[name] = klass
    end
  end
end

# Include the adapters that come packaged with the gem
require_relative 'connection_adapters/httparty_adapter.rb'


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

using OpenSim.Framework;
using OpenSim.Framework.Client;
using OpenSim.Region.Framework.Scenes;

using OpenMetaverse;
using Nini.Config;
using log4net;

namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
{
    public class InventoryCache
    {
        private static readonly ILog m_log =
            LogManager.GetLogger(
            MethodBase.GetCurrentMethod().DeclaringType);

        protected BaseInventoryConnector m_Connector;
        protected List<Scene> m_Scenes;

        // The cache proper
        protected Dictionary<UUID, Dictionary<AssetType, InventoryFolderBase>> m_InventoryCache;

        public virtual void Init(IConfigSource source, BaseInventoryConnector connector)
        {
            m_Scenes = new List<Scene>();
            m_InventoryCache = new Dictionary<UUID, Dictionary<AssetType, InventoryFolderBase>>();
            m_Connector = connector;
        }

        public virtual void AddRegion(Scene scene)
        {
            m_Scenes.Add(scene);
            scene.EventManager.OnMakeRootAgent += OnMakeRootAgent;
            scene.EventManager.OnClientClosed += OnClientClosed;
        }

        public virtual void RemoveRegion(Scene scene)
        {
            if ((m_Scenes != null) && m_Scenes.Contains(scene))
            {
                m_Scenes.Remove(scene);
            }
        }

        void OnMakeRootAgent(ScenePresence presence)
        {
            // Get system folders

            // First check if they're here already
            lock (m_InventoryCache)
            {
                if (m_InventoryCache.ContainsKey(presence.UUID))
                {
                    m_log.DebugFormat("[INVENTORY CACHE]: OnMakeRootAgent, system folders for {0} {1} already in cache", presence.Firstname, presence.Lastname);
                    return;
                }
            }

            // If not, go get them and place them in the cache
            Dictionary<AssetType, InventoryFolderBase> folders = m_Connector.GetSystemFolders(presence.UUID);
            m_log.DebugFormat("[INVENTORY CACHE]: OnMakeRootAgent in {0}, fetched system folders for {1} {2}: count {3}",
                presence.Scene.RegionInfo.RegionName, presence.Firstname, presence.Lastname, folders.Count);

            if (folders.Count > 0)
                lock (m_InventoryCache)
                    m_InventoryCache.Add(presence.UUID, folders);
        }

        void OnClientClosed(UUID clientID, Scene scene)
        {
            if (m_InventoryCache.ContainsKey(clientID)) // if it's still in cache
            {
                ScenePresence sp = null;
                foreach (Scene s in m_Scenes)
                {
                    s.TryGetAvatar(clientID, out sp);
                    if ((sp != null) && !sp.IsChildAgent && (s != scene))
                    {
                        m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, but user {1} still in sim. Keeping system folders in cache",
                            scene.RegionInfo.RegionName, clientID);
                        return;
                    }
                }

                // Drop system folders
                lock (m_InventoryCache)
                    if (m_InventoryCache.ContainsKey(clientID))
                    {
                        m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, user {1} out of sim. Dropping system folders",
                            scene.RegionInfo.RegionName, clientID);

                        m_InventoryCache.Remove(clientID);
                    }
            }
        }

        public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
        {
            Dictionary<AssetType, InventoryFolderBase> folders = null;
            lock (m_InventoryCache)
            {
                m_InventoryCache.TryGetValue(userID, out folders);
            }
            if ((folders != null) && folders.ContainsKey(type))
            {
                return folders[type];
            }

            return null;
        }
    }
}


text:
package org.gradle.api.internal.artifacts.dsl.dependencies;

import org.gradle.api.artifacts.DependencyArtifact;
import org.gradle.api.artifacts.ExternalDependency;
import org.gradle.api.internal.artifacts.dependencies.DefaultDependencyArtifact;

public class ModuleFactoryHelper {
    public static void addExplicitArtifactsIfDefined(ExternalDependency moduleDependency, String artifactType, String classifier) {
        String actualArtifactType = artifactType;
        if (actualArtifactType == null) {
            if (classifier != null) {
                actualArtifactType = DependencyArtifact.DEFAULT_TYPE;
            }
        } else {
            moduleDependency.setTransitive(false);
        }
        if (actualArtifactType != null) {
            moduleDependency.addArtifact(new DefaultDependencyArtifact(moduleDependency.getName(),
                    actualArtifactType, actualArtifactType, classifier, null));
        }
    }
}


text:
module Foundation
  VERSION = "3.2.5"
end


text:
CryptoZoologicalAuthentication
==============================

Use animals for passwords when you really can't be bothered to do proper authentication.

## install
```
npm install cryptozoologicalauthentication
```

## usage

``` javascript
var cza = require('cryptozoologicalauthentication');
if (cza("ike", "iguanakoalaelephant") === true ) {
    // authenticated!
}
```

## origin
Extrated from [node-ignition](https://github.com/B2MSolutions/node-ignition)


text:
#include <config.h>

#include "roken.h"

#include <stdlib.h>
#include <string.h>

/*
 * This is the easy way out, use putenv to implement setenv. We might
 * leak some memory but that is ok since we are usally about to exec
 * anyway.
 */

ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL
setenv(const char *var, const char *val, int rewrite)
{
#ifndef _WIN32
    char *t = NULL;

    if (!rewrite && getenv(var) != 0)
	return 0;

    if (asprintf (&t, "%s=%s", var, val) < 0 || t == NULL)
	return -1;

    if (putenv(t) == 0)
	return 0;
    else
	return -1;
#else  /* Win32 */
    char dummy[8];

    if (!rewrite && GetEnvironmentVariable(var, dummy, sizeof(dummy)/sizeof(char)) != 0)
	return 0;

    if (SetEnvironmentVariable(var, val) == 0)
	return -1;
    else
	return 0;
#endif
}


text:
package com.github.sadikovi.spark.util

import java.io.{ObjectInputStream, ObjectOutputStream}

import org.apache.hadoop.conf.Configuration

/**
 * Serializable hadoop configuration. Clone of `org.apache.spark.util.SerializableConfiguration`,
 * since it cannot be reused outside `spark` package.
 */
private[spark] class SerializableConfiguration(
    @transient var value: Configuration) extends Serializable {

  private def writeObject(out: ObjectOutputStream): Unit = {
    out.defaultWriteObject()
    value.write(out)
  }

  private def readObject(in: ObjectInputStream): Unit = {
    value = new Configuration(false)
    value.readFields(in)
  }
}


text:
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */

/**
 * LinkPoint processor
 *
 * PHP versions 4 and 5
 *
 * LICENSE:
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the documentation
 *    and/or other materials provided with the distribution.
 *
 * 3. The name of the authors may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
 * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 * @category  Payment
 * @package   Payment_Process
 * @author    Joe Stump <joe@joestump.net>
 * @copyright 1997-2005 The PHP Group
 * @license   http://www.opensource.org/licenses/bsd-license.php BSD License
 * @version   CVS: $Revision$
 * @link      http://pear.php.net/package/Payment_Process
 * @link      http://www.linkpoint.net/
 */

require_once('Payment/Process.php');
require_once('Payment/Process/Common.php');
require_once('Net/Curl.php');
require_once('XML/Parser.php');

$GLOBALS['_Payment_Process_LinkPoint'] = array(
    PAYMENT_PROCESS_ACTION_NORMAL   => 'SALE',
    PAYMENT_PROCESS_ACTION_AUTHONLY => 'PREAUTH',
    PAYMENT_PROCESS_ACTION_POSTAUTH => 'POSTAUTH'
);

/**
 * Payment_Process_LinkPoint
 *
 * This is a processor for LinkPoint's merchant payment gateway.
 * (http://www.linkpoint.net/)
 *
 * *** WARNING ***
 * This is BETA code, and has not been fully tested. It is not recommended
 * that you use it in a production envorinment without further testing.
 *
 * @package Payment_Process
 * @author Joe Stump <joe@joestump.net>
 * @version @version@
 */
class Payment_Process_LinkPoint extends Payment_Process_Common
{
    /**
     * Front-end -> back-end field map.
     *
     * This array contains the mapping from front-end fields (defined in
     * the Payment_Process class) to the field names DPILink requires.
     *
     * @see _prepare()
     * @access private
     */
    var $_fieldMap = array(
        // Required
        'login'         => 'configfile',
        'action'        => 'ordertype',
        'invoiceNumber' => 'oid',
        'customerId'    => 'x_cust_id',
        'amount'        => 'chargetotal',
        'name'          => '',
        'zip'           => 'zip',
        // Optional
        'company'       => 'company',
        'address'       => 'address1',
        'city'          => 'city',
        'state'         => 'state',
        'country'       => 'country',
        'phone'         => 'phone',
        'email'         => 'email',
        'ip'            => 'ip',
    );

    /**
    * $_typeFieldMap
    *
    * @author Joe Stump <joe@joestump.net>
    * @access protected
    */
    var $_typeFieldMap = array(

           'CreditCard' => array(

                    'cardNumber' => 'cardnumber',
                    'cvv'        => 'cvm',
                    'expDate'    => 'expDate'

           ),

           'eCheck' => array(

                    'routingCode'   => 'routing',
                    'accountNumber' => 'account',
                    'type'          => 'type',
                    'bankName'      => 'bank',
                    'name'          => 'name',
                    'driversLicense'      => 'dl',
                    'driversLicenseState' => 'dlstate'

           )
    );

    /**
     * Default options for this processor.
     *
     * @see Payment_Process::setOptions()
     * @access private
     */
    var $_defaultOptions = array(
         'host'   => 'secure.linkpt.net',
         'port'   => '1129',
         'result' => 'LIVE'
    );

    /**
     * Has the transaction been processed?
     *
     * @type boolean
     * @access private
     */
    var $_processed = false;

    /**
     * The response body sent back from the gateway.
     *
     * @access private
     */
    var $_responseBody = '';

    /**
     * Constructor.
     *
     * @param  array  $options  Class options to set.
     * @see Payment_Process::setOptions()
     * @return void
     */
    function __construct($options = false)
    {
        parent::__construct($options);
        $this->_driver = 'LinkPoint';
    }

    /**
     * Payment_Process_LinkPoint
     *
     * @author Joe Stump <joe@joestump.net>
     * @access public
     * @param array $options
     * @return void
     */
    function Payment_Process_LinkPoint($options = false)
    {
        $this->__construct($options);
    }

    /**
     * Process the transaction.
     *
     * @author Joe Stump <joe@joestump.net>
     * @access public
     * @return mixed Payment_Process_Result on success, PEAR_Error on failure
     */
    function &process()
    {
        if (!strlen($this->_options['keyfile']) ||
            !file_exists($this->_options['keyfile'])) {
            return PEAR::raiseError('Invalid key file');
        }

        // Sanity check
        $result = $this->validate();
        if (PEAR::isError($result)) {
            return $result;
        }

        // Prepare the data
        $result = $this->_prepare();
        if (PEAR::isError($result)) {
            return $result;
        }

        // Don't die partway through
        PEAR::pushErrorHandling(PEAR_ERROR_RETURN);

        $xml = $this->_prepareQueryString();
        if (PEAR::isError($xml)) {
            return $xml;
        }

        $url = 'https://'.$this->_options['host'].':'.$this->_options['port'].
               '/LSGSXML';

        $curl = & new Net_Curl($url);
        $result = $curl->create();
        if (PEAR::isError($result)) {
            return $result;
        }

        $curl->type = 'POST';
        $curl->fields = $xml;
        $curl->sslCert = $this->_options['keyfile'];

        // LinkPoint's staging server has a boned certificate. If they are
        // testing against staging we need to turn off SSL host verification.
        if ($this->_options['host'] == 'staging.linkpt.net') {
            $curl->verifyPeer = false;
            $curl->verifyHost = 0;
        }

        $curl->userAgent = 'PEAR Payment_Process_LinkPoint 0.1';

        $result = &$curl->execute();
        if (PEAR::isError($result)) {
            return PEAR::raiseError('cURL error: '.$result->getMessage());
        } else {
            $curl->close();
        }

        $this->_responseBody = trim($result);
        $this->_processed = true;

        // Restore error handling
        PEAR::popErrorHandling();

        $response = &Payment_Process_Result::factory($this->_driver,
                                                     $this->_responseBody,
                                                     &$this);

        if (!PEAR::isError($response)) {
            $response->parse();
        }

        return $response;
    }

    /**
     * Prepare the POST query string.
     *
     * @access private
     * @return string The query string
     */
    function _prepareQueryString()
    {

        $data = array_merge($this->_options,$this->_data);

        $xml  = '<!-- Payment_Process order -->'."\n";
        $xml .= '<order>'."\n";
        $xml .= '<merchantinfo>'."\n";
        $xml .= '  <configfile>'.$data['configfile'].'</configfile>'."\n";
        $xml .= '  <keyfile>'.$data['keyfile'].'</keyfile>'."\n";
        $xml .= '  <host>'.$data['authorizeUri'].'</host>'."\n";
        $xml .= '  <appname>PEAR Payment_Process</appname>'."\n";
        $xml .= '</merchantinfo>'."\n";
        $xml .= '<orderoptions>'."\n";
        $xml .= '  <ordertype>'.$data['ordertype'].'</ordertype>'."\n";
        $xml .= '  <result>'.$data['result'].'</result>'."\n";
        $xml .= '</orderoptions>'."\n";
        $xml .= '<payment>'."\n";
        $xml .= '  <subtotal>'.$data['chargetotal'].'</subtotal>'."\n";
        $xml .= '  <tax>0.00</tax>'."\n";
        $xml .= '  <shipping>0.00</shipping>'."\n";
        $xml .= '  <chargetotal>'.$data['chargetotal'].'</chargetotal>'."\n";
        $xml .= '</payment>'."\n";

        // Set payment method to eCheck if our payment type is eCheck.
        // Default is Credit Card.
        $data['x_method'] = 'CC';
        switch ($this->_payment->getType())
        {
            case 'eCheck':
                return PEAR::raiseError('eCheck not currently supported',
                                        PAYMENT_PROCESS_ERROR_NOTIMPLEMENTED);

                $xml .= '<telecheck>'."\n";
                $xml .= '  <routing></routing>'."\n";
                $xml .= '  <account></account>'."\n";
                $xml .= '  <checknumber></checknumber>'."\n";
                $xml .= '  <bankname></bankname>'."\n";
                $xml .= '  <bankstate></bankstate>'."\n";
                $xml .= '  <dl></dl>'."\n";
                $xml .= '  <dlstate></dlstate>'."\n";
                $xml .= '  <accounttype>pc|ps|bc|bs</accounttype>'."\n";
                $xml .= '<telecheck>'."\n";
                break;
            case 'CreditCard':
                $xml .= '<creditcard>'."\n";
                $xml .= '  <cardnumber>'.$data['cardnumber'].'</cardnumber>'."\n";
                list($month,$year) = explode('/',$data['expDate']);
                if (strlen($year) == 4) {
                    $year = substr($year,2);
                }

                $month = sprintf('%02d',$month);

                $xml .= '  <cardexpmonth>'.$month.'</cardexpmonth>'."\n";
                $xml .= '  <cardexpyear>'.$year.'</cardexpyear>'."\n";
                if (strlen($data['cvm'])) {
                    $xml .= '  <cvmvalue>'.$data['cvm'].'</cvmvalue>'."\n";
                    $xml .= '  <cvmindicator>provided</cvmindicator>'."\n";
                }
                $xml .= '</creditcard>'."\n";
        }

        if (isset($this->_payment->firstName) &&
            isset($this->_payment->lastName)) {
            $xml .= '<billing>'."\n";
            $xml .= '  <userid>'.$this->_payment->customerId.'</userid>'."\n";
            $xml .= '  <name>'.$this->_payment->firstName.' '.$this->_payment->lastName.'</name>'."\n";
            $xml .= '  <company>'.$this->_payment->company.'</company>'."\n";
            $xml .= '  <address1>'.$this->_payment->address.'</address1>'."\n";
            $xml .= '  <city>'.$this->_payment->city.'</city>'."\n";
            $xml .= '  <state>'.$this->_payment->state.'</state>'."\n";
            $xml .= '  <zip>'.$this->_payment->zip.'</zip>'."\n";
            $xml .= '  <country>'.$this->_payment->country.'</country>'."\n";
            $xml .= '  <phone>'.$this->_payment->phone.'</phone>'."\n";
            $xml .= '  <email>'.$this->_payment->email.'</email>'."\n";
            $xml .= '  <addrnum>'.$this->_payment->address.'</addrnum>'."\n";
            $xml .= '</billing>'."\n";
        }

        $xml .= '</order>'."\n";

        return $xml;
    }
}

/**
 * Payment_Process_Result_LinkPoint
 *
 * LinkPoint result class
 *
 * @author Joe Stump <joe@joestump.net>
 * @package Payment_Process
 */
class Payment_Process_Result_LinkPoint extends Payment_Process_Result
{

    var $_statusCodeMap = array('APPROVED' => PAYMENT_PROCESS_RESULT_APPROVED,
                                'DECLINED' => PAYMENT_PROCESS_RESULT_DECLINED,
                                'FRAUD' => PAYMENT_PROCESS_RESULT_FRAUD);

    /**
     * LinkPoint status codes
     *
     * This array holds many of the common response codes. There are over 200
     * response codes - so check the LinkPoint manual if you get a status
     * code that does not match (see "Response Reason Codes & Response
     * Reason Text" in the AIM manual).
     *
     * @see getStatusText()
     * @access private
     */
    var $_statusCodeMessages = array(
        'APPROVED' => 'This transaction has been approved.',
        'DECLINED' => 'This transaction has been declined.',
        'FRAUD' => 'This transaction has been determined to be fraud.');

    var $_avsCodeMap = array(
        'YY' => PAYMENT_PROCESS_AVS_MATCH,
        'YN' => PAYMENT_PROCESS_AVS_MISMATCH,
        'YX' => PAYMENT_PROCESS_AVS_ERROR,
        'NY' => PAYMENT_PROCESS_AVS_MISMATCH,
        'XY' => PAYMENT_PROCESS_AVS_MISMATCH,
        'NN' => PAYMENT_PROCESS_AVS_MISMATCH,
        'NX' => PAYMENT_PROCESS_AVS_MISMATCH,
        'XN' => PAYMENT_PROCESS_AVS_MISMATCH,
        'XX' => PAYMENT_PROCESS_AVS_ERROR
    );

    var $_avsCodeMessages = array(
        'YY' => 'Address matches, zip code matches',
        'YN' => 'Address matches, zip code does not match',
        'YX' => 'Address matches, zip code comparison not available',
        'NY' => 'Address does not match, zip code matches',
        'XY' => 'Address comparison not available, zip code matches',
        'NN' => 'Address comparison does not match, zip code does not match',
        'NX' => 'Address does not match, zip code comparison not available',
        'XN' => 'Address comparison not available, zip code does not match',
        'XX' => 'Address comparison not available, zip code comparison not available'
    );

    var $_cvvCodeMap = array('M' => PAYMENT_PROCESS_CVV_MATCH,
                             'N' => PAYMENT_PROCESS_CVV_MISMATCH,
                             'P' => PAYMENT_PROCESS_CVV_ERROR,
                             'S' => PAYMENT_PROCESS_CVV_ERROR,
                             'U' => PAYMENT_PROCESS_CVV_ERROR,
                             'X' => PAYMENT_PROCESS_CVV_ERROR
    );

    var $_cvvCodeMessages = array(
        'M' => 'Card Code Match',
        'N' => 'Card code does not match',
        'P' => 'Not processed',
        'S' => 'Merchant has indicated that the card code is not present on the card',
        'U' => 'Issuer is not certified and/or has not proivded encryption keys',
        'X' => 'No response from the credit card association was received'
    );

    var $_fieldMap = array('r_approved'  => 'code',
                           'r_error'  => 'message',
                           'r_code'  => 'approvalCode',
                           'r_ordernum'  => 'transactionId'
    );

    function Payment_Process_Response_LinkPoint($rawResponse)
    {
        $this->Payment_Process_Response($rawResponse);
    }

    /**
    * parse
    *
    * @author Joe Stump <joe@joestump.net>
    * @access public
    * @return void
    */
    function parse()
    {
        $xml = & new Payment_Processor_LinkPoint_XML_Parser();
        $xml->parseString('<response>'.$this->_rawResponse.'</response>');
        if (is_array($xml->response) && count($xml->response)) {
            $this->avsCode = substr($xml->response['r_avs'],0,2);
            $this->cvvCode = substr($xml->response['r_avs'],2,1);
            $this->customerId = $this->_request->customerId;
            $this->invoiceNumber = $this->_request->invoiceNumber;
            $this->_mapFields($xml->response);

            // switch to DECLINED since a duplicate isn't *really* fraud
            if (preg_match('/duplicate/i', $this->message)) {
                $this->messageCode = 'DECLINED';
            }
        }
    }
}

/**
 * Payment_Processor_LinkPoint_XML_Parser
 *
 * XML Parser for the LinkPoint response
 *
 * @author Joe Stump <joe@joestump.net>
 * @package Payment_Process
 */
class Payment_Processor_LinkPoint_XML_Parser extends XML_Parser
{
    /**
     * $response
     *
     * @var array $response Raw response as an array
     * @access public
     */
    var $response = array();

    /**
     * $log
     *
     * @var string $tag Current tag
     * @access private
     */
    var $tag = null;

    /**
     * Payment_Processor_LinkPoint_XML_Parser
     *
     * @author Joe Stump <joe@joestump.net>
     * @access public
     * @return void
     * @see XML_Parser
     */
    function Payment_Processor_LinkPoint_XML_Parser()
    {
        $this->XML_Parser();
    }

    /**
     * startHandler
     *
     * @author Joe Stump <joe@joestump.net>
     * @access public
     * @param resource $xp XML processor handler
     * @param string $elem Name of XML entity
     * @return void
     */
    function startHandler($xp, $elem, &$attribs)
    {
        $this->tag = $elem;
    }

    /**
     * endHandler
     *
     * @author Joe Stump <joe@joestump.net>
     * @access public
     * @param resource $xp XML processor handler
     * @param string $elem Name of XML entity
     * @return void
     */
    function endHandler($xp, $elem)
    {

    }

    /**
     * defaultHandler
     *
     * @author Joe Stump <joe@joestump.net>
     * @access public
     * @param resource $xp XML processor handler
     * @param string $data
     * @return void
     */
    function defaultHandler($xp,$data)
    {
        $this->response[strtolower($this->tag)] = $data;
    }
}

?>


text:
`git-resolve-conflict <strategy> <filename>`
===========================================================

> Resolve merge conflict in just one file, using given strategy (--ours, --theirs, --union)
>
>     git resolve-conflict --ours package.json
>     git resolve-conflict --theirs package.json
>     git resolve-conflict --union package.json
>
>     git resolve-ours package.json
>     git resolve-theirs package.json
>     git resolve-union package.json

Why would you need it
--------------------

To be able to resolve certain well-defined types of merge conflicts, without opening mergetool.

This is particularly useful in automated merge scripts (for example, Jenkins jobs), or if you have large number of well-defined merges to resolve.

Things to be aware of
------------

Note though, this is just a dumb text-based merge resolution script; if you're unlucky, the merged file might be syntactically incorrect.

For example: when using `--ours` strategy on `package.json` where both sides added an entry at the end of `dependencies` or `scripts` array,
the result will be two blocks added without trailing comma between them (hence invalid JSON).

Installation
------------

  - copy [`/lib/git-resolve-conflict.sh`](https://github.com/jakub-g/git-resolve-conflict/blob/base/lib/git-resolve-conflict.sh) to your `.bashrc` (this adds just `git resolve-conflict`)
  - or `npm install -g git-resolve-conflict` (this also adds 3 other helpers)

 [![Get it on npm](https://nodei.co/npm/git-resolve-conflict.png?compact=true)](https://www.npmjs.org/package/git-resolve-conflict)

npm installation is the recommended way, so that you can easily get updates in the future.

FAQ
---

- *Q: Why no updates in 3 years?*
- A: Because _it works™_. It's feature-complete.

- *Q: Does it work on Windows?*
- A: Yep, but it'a shell script, so you need a unix-y shell. I'm using it with git bash and it works well.

- *Q: Why you distribute through npm?*
- A: Just to make it easier to install if you happen to have node. The script itself is shell.

TL;DR
=====

It's just a tiny wrapper around [git-merge-file](https://git-scm.com/docs/git-merge-file) to simplify the API. See `./lib/git-resolve-conflict.sh`.
(I used temp files instead of process substitution to make it msys/mingw-friendly).

It's better than `git merge -Xours` because that would resolve conflicts for all files. Here we can resolve conflict for just one file.

It's better than `git checkout --ours package.json` because that would lose changes from `theirs` even if they are not conflicted.
Here we can resolve conflict using a three-way merge and keep the non-conflicted changes from both sides.

See also http://stackoverflow.com/q/39126509/245966

Description
===========

Say you have multiple git branches and you want to merge
between them, and always resolve conflicts **in a particular file** with a **fixed strategy**
(say `ours`).

For instance, you have `master` (stable) and `develop` (unstable) branches.
When code is stable you freeze the `master`, and development continues in `develop`,
which is merged to `master` every few weeks.

But then you find our bugs at regression testing stage, you fix them in `master`, and you build.
In the meantime, you also build `develop` separately. Each build bumps `version` field in `package.json`.

Since those branches can be built separately, a file like `package.json`
will be modified in both branches, and there'll be a merge conflict due to `version` field
being changed in both branches.

How to easily **resolve the merge conflict** in an **automated manner** (script) in such a situation?

git built-ins that do not solve the problem
==================

- `git merge -Xours`: that would resolve *ALL conflicts* in *ALL files* using the same strategy. This might be too much.
(For instance, you might want to have an automatic merging script, which can do a successful conflict resolution
only if `foobar.json` is *the only file that was modified*; on any other files modified, the merge should fail)

- `git checkout --ours filename.txt`: that would ***discard** ALL the changes* from `theirs` version, which is brutal.
There might be some valid, non-conflicting changes that would be discarded this way.

- What we need is something like `git-resolve-conflict --ours filename.txt`

**This is what `./lib/git-resolve-conflict.sh` from this repo provides.**

Details
=======

See `README-extended.md`