text:
// Copyright 2014 The Bazel Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.devtools.build.lib.cmdline;

import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.CharMatcher;
import java.util.Objects;
import javax.annotation.Nullable;

/**
 * The canonical place to parse and validate Blaze labels.
 */
public final class LabelValidator {

  /** Matches punctuation in target names which requires quoting in a blaze query. */
  private static final CharMatcher PUNCTUATION_REQUIRING_QUOTING = CharMatcher.anyOf("+,=~#");

  /**
   * Matches punctuation in target names which doesn't require quoting in a blaze query.
   *
   * Note that . is also allowed in target names, and doesn't require quoting, but has restrictions
   * on its surrounding characters; see {@link #validateTargetName(String)}.
   */
  private static final CharMatcher PUNCTUATION_NOT_REQUIRING_QUOTING = CharMatcher.anyOf("_@-");

  /**
   * Matches characters allowed in target names regardless of context.
   *
   * Note that the only other characters allowed in target names are / and . but they have
   * restrictions around surrounding characters; see {@link #validateTargetName(String)}.
   */
  private static final CharMatcher ALWAYS_ALLOWED_TARGET_CHARACTERS =
      CharMatcher.javaLetterOrDigit()
          .or(PUNCTUATION_REQUIRING_QUOTING)
          .or(PUNCTUATION_NOT_REQUIRING_QUOTING)
          .precomputed();

  @VisibleForTesting
  static final String PACKAGE_NAME_ERROR =
      "package names may contain only A-Z, a-z, 0-9, '/', '-', '.' and '_'";

  @VisibleForTesting
  static final String PACKAGE_NAME_DOT_ERROR =
      "package name component contains only '.' characters";

  /**
   * Performs validity checking of the specified package name. Returns null on success or an error
   * message otherwise.
   *
   * @param packageName the name of the package
   * @return null if {@code name} is valid or an error string if any part
   *   of the package name is invalid
   */
  @Nullable
  public static String validatePackageName(String packageName) {
    int len = packageName.length();
    if (len == 0) {
      // Empty package name (//:foo).
      return null;
    }

    if (packageName.charAt(0) == '/') {
      return "package names may not start with '/'";
    }

    // Check for any character outside of [/0-9.A-Za-z_-]. Try to evaluate the
    // conditional quickly (by looking in decreasing order of character class
    // likelihood). To deal with . and .. pretend that the name is surrounded by '/'
    // on both sides.
    boolean nonDot = false;
    int lastSlash = len;
    for (int i = len - 1; i >= -1; --i) {
      char c = (i >= 0) ? packageName.charAt(i) : '/';
      if ((c < 'a' || c > 'z')
          && c != '/'
          && c != '_'
          && c != '-'
          && c != '.'
          && (c < '0' || c > '9')
          && (c < 'A' || c > 'Z')) {
        return PACKAGE_NAME_ERROR;
      }

      if (c == '/') {
        if (lastSlash == i + 1) {
          return lastSlash == len
              ? "package names may not end with '/'"
              : "package names may not contain '//' path separators";
        }

        if (!nonDot) {
          return PACKAGE_NAME_DOT_ERROR;
        }
        nonDot = false;
        lastSlash = i;
      } else {
        if (c != '.') {
          nonDot = true;
        }
      }
    }

    return null; // ok
  }

  /**
   * Performs validity checking of the specified target name. Returns null on success or an error
   * message otherwise.
   */
  @Nullable
  public static String validateTargetName(String targetName) {
    // TODO(bazel-team): (2011) allow labels equaling '.' or ending in '/.' for now. If we ever
    // actually configure the target we will report an error, but they will be permitted for
    // data directories.

    // TODO(bazel-team): (2011) Get rid of this code once we have reached critical mass and can
    // pressure developers to clean up their BUILD files.

    // Code optimized for the common case: success.
    int len = targetName.length();
    if (len == 0) {
      return "empty target name";
    }
    // Forbidden start chars:
    char c = targetName.charAt(0);
    if (c == '/') {
      return "target names may not start with '/'";
    } else if (c == '.') {
      if (targetName.startsWith("../") || targetName.equals("..")) {
        return "target names may not contain up-level references '..'";
      } else if (targetName.equals(".")) {
        return null; // See comment above; ideally should be an error.
      } else if (targetName.startsWith("./")) {
        return "target names may not contain '.' as a path segment";
      }
    }

    // Give a friendly error message on CRs in target names
    if (targetName.endsWith("\r")) {
      return "target names may not end with carriage returns " +
             "(perhaps the input source is CRLF-terminated)";
    }

    for (int ii = 0; ii < len; ++ii) {
      c = targetName.charAt(ii);
      if (ALWAYS_ALLOWED_TARGET_CHARACTERS.matches(c)) {
        continue;
      }
      if (c == '.') {
        continue;
      }
      if (c == '/') {
        if (stringRegionMatch(targetName, "/../", ii)) {
          return "target names may not contain up-level references '..'";
        } else if (stringRegionMatch(targetName, "/./", ii)) {
          return "target names may not contain '.' as a path segment";
        } else if (stringRegionMatch(targetName, "//", ii)) {
          return "target names may not contain '//' path separators";
        }
        continue;
      }
      if (CharMatcher.javaIsoControl().matches(c)) {
        return "target names may not contain non-printable characters: '" +
               String.format("\\x%02X", (int) c) + "'";
      }
      return "target names may not contain '" + c + "'";
    }
    // Forbidden end chars:
    if (c == '.') {
      if (targetName.endsWith("/..")) {
        return "target names may not contain up-level references '..'";
      } else if (targetName.endsWith("/.")) {
        return null; // See comment above; ideally should be an error.
      }
    }
    if (c == '/') {
      return "target names may not end with '/'";
    }
    return null; // ok
  }

  // Prefer this implementation over calls to String#subString(), as the latter implies copying
  // the subregion.
  private static boolean stringRegionMatch(String fullString, String possibleMatch, int offset) {
    return fullString.regionMatches(offset, possibleMatch, 0, possibleMatch.length());
  }

  /**
   * Validate the label and parse it into a pair of package name and target name. If the label is
   * not valid, it throws an {@link BadLabelException}.
   *
   *
It accepts these forms of labels:
   *

   * //foo/bar
   * //foo/bar:quux
   * //foo/bar:      (undocumented, but accepted)
   *

   */
  public static PackageAndTarget validateAbsoluteLabel(String absName) throws BadLabelException {
    PackageAndTarget result = parseAbsoluteLabel(absName);
    String packageName = result.getPackageName();
    String targetName = result.getTargetName();
    String error = validatePackageName(packageName);
    if (error != null) {
      error = "invalid package name '" + packageName + "': " + error;
      // This check is just for a more helpful error message,
      // i.e. valid target name, invalid package name, colon-free label form
      // used => probably they meant "//foo:bar.c" not "//foo/bar.c".
      if (packageName.endsWith("/" + targetName)) {
        error += " (perhaps you meant \":" + targetName + "\"?)";
      }
      throw new BadLabelException(error);
    }
    error = validateTargetName(targetName);
    if (error != null) {
      error = "invalid target name '" + targetName + "': " + error;
      throw new BadLabelException(error);
    }
    return result;
  }

  /**
   * Returns if the label starts with a repository (@whatever) or a package (//whatever).
   */
  public static boolean isAbsolute(String label) {
    return label.startsWith("//") || label.startsWith("@");
  }

  /**
   * Parses the given absolute label by verifying that it starts with "//". If it contains a ':',
   * then the part after that is the target name within the package, and the part before that (but
   * without the leading "//") is the package name. However, it performs no validation on these two
   * pieces.
   *
   *
Use of this method is generally not recommended.
   *
   * @throws NullPointerException if {@code absName} is {@code null}
   * @throws BadLabelException if {@code absName} starts with "//"
   */
  public static PackageAndTarget parseAbsoluteLabel(String absName) throws BadLabelException {
    if (!isAbsolute(absName)) {
      throw new BadLabelException("invalid label: " + absName);
    }
    if (absName.startsWith("@")) {
      int endOfRepo = absName.indexOf("//");
      if (endOfRepo < 0) {
        throw new BadLabelException("invalid fully-qualified label: " + absName);
      }
      absName = absName.substring(endOfRepo);
    }
    // Find the package/suffix separation:
    int colonIndex = absName.indexOf(':');
    int splitAt = colonIndex >= 0 ? colonIndex : absName.length();
    String packageName = absName.substring("//".length(), splitAt);
    String suffix = absName.substring(splitAt);
    // ('suffix' is empty, or starts with a colon.)

    // "If packagename and version are elided, the colon is not necessary."
    String targetName = suffix.isEmpty()
        // Target name is last package segment: (works in slash-free case too.)
        ? packageName.substring(packageName.lastIndexOf('/') + 1)
        // Target name is what's after colon:
        : suffix.substring(1);

    return new PackageAndTarget(packageName, targetName);
  }

  /**
   * A pair of package and target names. Note that having an instance of this does not imply that
   * the package or target names are actually valid.
   */
  public static class PackageAndTarget {
    private final String packageName;
    private final String targetName;

    public PackageAndTarget(String packageName, String targetName) {
      this.packageName = packageName;
      this.targetName = targetName;
    }

    public String getPackageName() {
      return packageName;
    }

    public String getTargetName() {
      return targetName;
    }

    @Override
    public String toString() {
      return "//" + packageName + ":" + targetName;
    }

    @Override
    public int hashCode() {
      return Objects.hash(packageName, targetName);
    }

    @Override
    public boolean equals(Object o) {
      if (o == null || o.getClass() != getClass()) {
        return false;
      }
      PackageAndTarget otherTarget = (PackageAndTarget) o;
      return Objects.equals(otherTarget.targetName, targetName)
          && Objects.equals(otherTarget.packageName, packageName);
    }
  }

  /**
   * An exception to notify the caller that a label could not be parsed.
   */
  public static class BadLabelException extends Exception {
    public BadLabelException(String msg) {
      super(msg);
    }
  }
}


text:
import {ReflectiveInjector} from '@angular/core';
import {isPresent, isBlank} from '@angular/facade';
import {PromiseWrapper} from '@angular/facade';

import {Sampler, SampleState} from './sampler';
import {ConsoleReporter} from './reporter/console_reporter';
import {MultiReporter} from './reporter/multi_reporter';
import {RegressionSlopeValidator} from './validator/regression_slope_validator';
import {SizeValidator} from './validator/size_validator';
import {Validator} from './validator';
import {PerflogMetric} from './metric/perflog_metric';
import {MultiMetric} from './metric/multi_metric';
import {ChromeDriverExtension} from './webdriver/chrome_driver_extension';
import {FirefoxDriverExtension} from './webdriver/firefox_driver_extension';
import {IOsDriverExtension} from './webdriver/ios_driver_extension';
import {WebDriverExtension} from './web_driver_extension';
import {SampleDescription} from './sample_description';
import {WebDriverAdapter} from './web_driver_adapter';
import {Reporter} from './reporter';
import {Metric} from './metric';
import {Options} from './common_options';

/**
 * The Runner is the main entry point for executing a sample run.
 * It provides defaults, creates the injector and calls the sampler.
 */
export class Runner {
  private _defaultProviders: any[];
  constructor(defaultProviders: any[] = null) {
    if (isBlank(defaultProviders)) {
      defaultProviders = [];
    }
    this._defaultProviders = defaultProviders;
  }

  sample({id, execute, prepare, microMetrics, providers}:
             {id: string, execute?: any, prepare?: any, microMetrics?: any, providers?: any}):
      Promise<SampleState> {
    var sampleProviders = [
      _DEFAULT_PROVIDERS,
      this._defaultProviders,
      {provide: Options.SAMPLE_ID, useValue: id},
      {provide: Options.EXECUTE, useValue: execute}
    ];
    if (isPresent(prepare)) {
      sampleProviders.push({provide: Options.PREPARE, useValue: prepare});
    }
    if (isPresent(microMetrics)) {
      sampleProviders.push({provide: Options.MICRO_METRICS, useValue: microMetrics});
    }
    if (isPresent(providers)) {
      sampleProviders.push(providers);
    }

    var inj = ReflectiveInjector.resolveAndCreate(sampleProviders);
    var adapter = inj.get(WebDriverAdapter);

    return PromiseWrapper
        .all([adapter.capabilities(), adapter.executeScript('return window.navigator.userAgent;')])
        .then((args) => {
          var capabilities = args[0];
          var userAgent = args[1];

          // This might still create instances twice. We are creating a new injector with all the
          // providers.
          // Only WebDriverAdapter is reused.
          // TODO vsavkin consider changing it when toAsyncFactory is added back or when child
          // injectors are handled better.
          var injector = ReflectiveInjector.resolveAndCreate([
            sampleProviders,
            {provide: Options.CAPABILITIES, useValue: capabilities},
            {provide: Options.USER_AGENT, useValue: userAgent},
            {provide: WebDriverAdapter, useValue: adapter}
          ]);

          var sampler = injector.get(Sampler);
          return sampler.sample();
        });
  }
}

var _DEFAULT_PROVIDERS = [
  Options.DEFAULT_PROVIDERS,
  Sampler.PROVIDERS,
  ConsoleReporter.PROVIDERS,
  RegressionSlopeValidator.PROVIDERS,
  SizeValidator.PROVIDERS,
  ChromeDriverExtension.PROVIDERS,
  FirefoxDriverExtension.PROVIDERS,
  IOsDriverExtension.PROVIDERS,
  PerflogMetric.PROVIDERS,
  SampleDescription.PROVIDERS,
  MultiReporter.createBindings([ConsoleReporter]),
  MultiMetric.createBindings([PerflogMetric]),

  Reporter.bindTo(MultiReporter),
  Validator.bindTo(RegressionSlopeValidator),
  WebDriverExtension.bindTo([ChromeDriverExtension, FirefoxDriverExtension, IOsDriverExtension]),
  Metric.bindTo(MultiMetric),
];

redpajama_set_name: RedPajamaGithub


text:
<?php
namespace Hooloovoo\ORM\Exception;

use Throwable;

/**
 * Interface HttpExceptionInterface
 */
interface HttpExceptionInterface extends Throwable
{
    /**
     * @return int
     */
    public function getStatusCode() : int ;
}


text:
package org.oscm.vo;

import java.io.Serializable;

/**
 * Represents a report.
 *
 */
public class VOReport implements Serializable {

    private static final long serialVersionUID = -5412324206918451338L;

    /**
     * Retrieves the name of the report.
     *
     * @return the report name
     */
    public String getReportName() {
        return reportName;
    }

    /**
     * Sets the name of the report.
     *
     * @param reportName
     *            the report name
     */
    public void setReportName(String reportName) {
        this.reportName = reportName;
    }

    /**
     * Retrieves the URL template that points to the report in the reporting
     * engine. The template contains a placeholder, ${sessionid},
     * which has to be replaced by the platform session ID of the user who is
     * logged in.
     *
     * @return the URL template
     */
    public String getReportUrlTemplate() {
        return reportUrlTemplate;
    }

    /**
     * Sets the URL template that points to the report in the reporting engine.
     * The template contains a placeholder, ${sessionid}, which has
     * to be replaced by the platform session ID of the user who is logged in.
     *
     * @param reportURLTemplate
     *            the URL template
     */
    public void setReportURLTemplate(String reportURLTemplate) {
        this.reportUrlTemplate = reportURLTemplate;
    }

    /**
     * The name of the report.
     */
    private String reportName;

    /**
     * The localized name of the report.
     */
    private String localizedReportName;

    /**
     * Retrieves the name of the report in the language set for the calling
     * user.
     *
     * @return the localized report name
     */
    public String getLocalizedReportName() {
        return localizedReportName;
    }

    /**
     * Specifies the name of the report in the language set for the calling
     * user.
     *
     * @param localizedReportName
     *            the localized report name
     */
    public void setLocalizedReportName(String localizedReportName) {
        this.localizedReportName = localizedReportName;
    }

    /**
     * The URL template pointing to the report in the reporting engine.
     */
    private String reportUrlTemplate;

}


text:
package com.omricat.yacc.ui;

import android.support.v7.app.ActionBarActivity;

import com.omricat.yacc.BuildConfig;
import com.omricat.yacc.debug.DebugUtils;

public class YaccActivity extends ActionBarActivity {

    @Override protected void onStart() {
        super.onStart();
        if (BuildConfig.DEBUG) {
            DebugUtils.riseAndShine(this);
        }
    }

}


text:
package org.apache.ranger.common;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

/**
 *
 *
 */
@Component
public class RangerConfigUtil {
	private static final Logger logger = Logger.getLogger(RangerConfigUtil.class);

	String webappRootURL;
	int defaultMaxRows = 250;
	String[] roles;
	boolean accessFilterEnabled = true;
	boolean isModerationEnabled = false;
	boolean isUserPrefEnabled = false;

	public RangerConfigUtil() {

		webappRootURL = PropertiesUtil.getProperty("ranger.externalurl");
		if (webappRootURL == null || webappRootURL.trim().length() == 0) {
			logger.error("webapp URL is not set. Please ranger.externalurl property");
		}

		defaultMaxRows = PropertiesUtil.getIntProperty(
				"ranger.db.maxrows.default", defaultMaxRows);
		roles = PropertiesUtil.getPropertyStringList("ranger.users.roles.list");

		accessFilterEnabled = PropertiesUtil.getBooleanProperty("ranger.db.access.filter.enable", true);
		isModerationEnabled = PropertiesUtil.getBooleanProperty("ranger.moderation.enabled", isModerationEnabled);
		isUserPrefEnabled = PropertiesUtil.getBooleanProperty("ranger.userpref.enabled", isUserPrefEnabled);
	}

	/**
	 * @return the defaultMaxRows
	 */
	public int getDefaultMaxRows() {
		return defaultMaxRows;
	}

	/**
	 * @return the roles
	 */
	public String[] getRoles() {
		return roles;
	}

	/**
	 * @return the accessFilterEnabled
	 */
	public boolean isAccessFilterEnabled() {
		return accessFilterEnabled;
	}

	/**
	 * @return the webAppRootURL
	 */
	public String getWebAppRootURL() {
		return webappRootURL;
	}

}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>High-level D-Bus Support: GIO Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="GIO Reference Manual">
<link rel="up" href="pt02.html" title="Part II. API Reference">
<link rel="prev" href="GDBusAuthObserver.html" title="GDBusAuthObserver">
<link rel="next" href="gio-Owning-Bus-Names.html" title="Owning Bus Names">
<meta name="generator" content="GTK-Doc V1.24 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">

High-level D-Bus Support

Owning Bus Names — Simple API for owning bus names

Watching Bus Names — Simple API for watching bus names

GDBusInterface — Base type for D-Bus interfaces

GDBusInterfaceSkeleton — Service-side D-Bus interface

GDBusProxy — Client-side D-Bus interface proxy

GDBusObject — Base type for D-Bus objects

GDBusObjectSkeleton — Service-side D-Bus object

GDBusObjectProxy — Client-side D-Bus object

GDBusObjectManager — Base type for D-Bus object managers

GDBusObjectManagerServer — Service-side object manager

GDBusObjectManagerClient — Client-side object manager

Generated by GTK-Doc V1.24


text:
package commands

import (
	"errors"

	"github.com/layeh/gumble/gumble"
	"github.com/layeh/gumble/gumbleffmpeg"
	"github.com/spf13/viper"
)

// JoinMeCommand is a command that moves the bot to the channel of the user
// who issued the command.
type JoinMeCommand struct{}

// Aliases returns the current aliases for the command.
func (c *JoinMeCommand) Aliases() []string {
	return viper.GetStringSlice("commands.joinme.aliases")
}

// Description returns the description for the command.
func (c *JoinMeCommand) Description() string {
	return viper.GetString("commands.joinme.description")
}

// IsAdminCommand returns true if the command is only for admin use, and
// returns false otherwise.
func (c *JoinMeCommand) IsAdminCommand() bool {
	return viper.GetBool("commands.joinme.is_admin")
}

// Execute executes the command with the given user and arguments.
// Return value descriptions:
//    string: A message to be returned to the user upon successful execution.
//    bool:   Whether the message should be private or not. true = private,
//            false = public (sent to whole channel).
//    error:  An error message to be returned upon unsuccessful execution.
//            If no error has occurred, pass nil instead.
// Example return statement:
//    return "This is a private message!", true, nil
func (c *JoinMeCommand) Execute(user *gumble.User, args ...string) (string, bool, error) {
	if DJ.AudioStream != nil && DJ.AudioStream.State() == gumbleffmpeg.StatePlaying &&
		len(DJ.Client.Self.Channel.Users) > 1 {
		return "", true, errors.New(viper.GetString("commands.joinme.messages.others_are_listening_error"))
	}

	DJ.Client.Do(func() {
		DJ.Client.Self.Move(user.Channel)
	})

	return viper.GetString("commands.joinme.messages.in_your_channel"), true, nil
}


text:
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Markup;

[assembly: AssemblyCopyright("Copyright © MahApps.Metro 2011-2015")]
[assembly: ComVisible(false)]

[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]

[assembly: XmlnsDefinition("http://metro.mahapps.com/winfx/xaml/shared", "MahApps.Metro.Behaviours")]
[assembly: XmlnsDefinition("http://metro.mahapps.com/winfx/xaml/shared", "MahApps.Metro.Converters")]
[assembly: XmlnsDefinition("http://metro.mahapps.com/winfx/xaml/controls", "MahApps.Metro.Controls")]

[assembly: AssemblyVersion("1.1.3.0")]
[assembly: AssemblyFileVersion("1.1.3.0")]
[assembly: AssemblyTitleAttribute("MahApps.Metro")]
[assembly: AssemblyDescriptionAttribute("Toolkit for creating Metro styled WPF apps")]
[assembly: AssemblyProductAttribute("MahApps.Metro 1.1.3-ALPHA")]
[assembly: AssemblyCompany("MahApps")]
[assembly: InternalsVisibleTo("Mahapps.Metro.Tests")]


text:
package suadb.parse;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import suadb.query.Plan;
import suadb.query.Scan;
import suadb.record.Schema;
/**
 * A predicate is a Boolean combination of terms.
 * @author Edward Sciore
 *
 */
public class Predicate {
	private List<Term> terms = new ArrayList<Term>();

	/**
	 * Creates an empty predicate, corresponding to "true".
	 */
	public Predicate() {}

	/**
	 * Creates a predicate containing a single term.
	 * @param t the term
	 */
	public Predicate(Term t) {
		terms.add(t);
	}

	/**
	 * Modifies the predicate to be the conjunction of
	 * itself and the specified predicate.
	 * @param pred the other predicate
	 */
	public void conjoinWith(Predicate pred) {
		terms.addAll(pred.terms);
	}

	public List<Term> getTerms()
	{
		return terms;
	}

	public String toString() {
		Iterator<Term> iter = terms.iterator();
		if (!iter.hasNext())
			return "";
		String result = iter.next().toString();
		while (iter.hasNext())
			result += " and " + iter.next().toString();
		return result;
	}
}


text:
package org.axonframework.eventsourcing.eventstore;

import org.axonframework.eventhandling.EventMessage;
import org.axonframework.eventhandling.TrackedEventMessage;
import org.axonframework.eventsourcing.DomainEventMessage;

import java.util.List;
import java.util.Optional;
import java.util.stream.Stream;

/**
 * @author Rene de Waele
 */
public class SequenceEventStorageEngine implements EventStorageEngine {

    private final EventStorageEngine historicStorage, activeStorage;

    public SequenceEventStorageEngine(EventStorageEngine historicStorage, EventStorageEngine activeStorage) {
        this.historicStorage = historicStorage;
        this.activeStorage = activeStorage;
    }

    @Override
    public void appendEvents(List<? extends EventMessage<?>> events) {
        activeStorage.appendEvents(events);
    }

    @Override
    public void storeSnapshot(DomainEventMessage<?> snapshot) {
        activeStorage.storeSnapshot(snapshot);
    }

    @Override
    public Stream<? extends TrackedEventMessage<?>> readEvents(TrackingToken trackingToken, boolean mayBlock) {
        return Stream.concat(historicStorage.readEvents(trackingToken, mayBlock),
                             activeStorage.readEvents(trackingToken, mayBlock));
    }

    @Override
    public DomainEventStream readEvents(String aggregateIdentifier, long firstSequenceNumber) {
        return DomainEventStream.concat(historicStorage.readEvents(aggregateIdentifier, firstSequenceNumber),
                                        activeStorage.readEvents(aggregateIdentifier, firstSequenceNumber));
    }

    @Override
    public Optional<DomainEventMessage<?>> readSnapshot(String aggregateIdentifier) {
        return Optional.ofNullable(activeStorage.readSnapshot(aggregateIdentifier).orElseGet(
                () -> historicStorage.readSnapshot(aggregateIdentifier).orElse(null)));
    }
}


text:
package ucar.nc2.ft.point.standard.plug;

import ucar.ma2.DataType;
import ucar.nc2.constants.CDM;
import ucar.nc2.constants.FeatureType;
import ucar.nc2.constants.CF;
import ucar.nc2.constants.AxisType;
import ucar.nc2.dataset.NetcdfDataset;
import ucar.nc2.ft.point.standard.*;
import ucar.nc2.*;
import java.util.*;

/**
 * CDM direct, used when we are implementing the IOSP.
 *
 * @author caron
 * @since Dec 30, 2010
 */
public class CdmDirect extends TableConfigurerImpl {

  private static final String Convention = "CDM";

  public boolean isMine(FeatureType wantFeatureType, NetcdfDataset ds) {
    boolean ok = false;
    String conv = ds.getRootGroup().findAttributeString(CDM.CONVENTIONS, null);
    if (conv == null)
      return false;
    if (conv.equals(Convention))
      ok = true;

    StringTokenizer stoke = new StringTokenizer(conv, ",");
    while (stoke.hasMoreTokens()) {
      String toke = stoke.nextToken().trim();
      if (toke.equals(Convention))
        ok = true;
    }
    if (!ok)
      return false;

    CF.FeatureType ftype = CF.FeatureType.getFeatureTypeFromGlobalAttribute(ds);
    if (ftype == null)
      ftype = CF.FeatureType.point;

    return (ftype == CF.FeatureType.timeSeries) || (ftype == CF.FeatureType.timeSeriesProfile);
  }

  public TableConfig getConfig(FeatureType wantFeatureType, NetcdfDataset ds, Formatter errlog) {

    CF.FeatureType ftype = CF.FeatureType.getFeatureTypeFromGlobalAttribute(ds);
    if (ftype == null)
      ftype = CF.FeatureType.point;

    switch (ftype) {
      case point:
        return null; // use default handler
      case timeSeries:
        /*
         * if (wantFeatureType == FeatureType.POINT)
         * return getStationAsPointConfig(ds, errlog);
         * else
         */
        return getStationConfig(ds, errlog);
      case timeSeriesProfile:
        return getStationProfileConfig(ds, errlog);
      default:
        throw new IllegalStateException("unimplemented feature ftype= " + ftype);
    }
  }

  protected TableConfig getStationConfig(NetcdfDataset ds, Formatter errlog) {
    // find lat coord
    Variable lat = CoordSysEvaluator.findCoordByType(ds, AxisType.Lat);
    if (lat == null) {
      errlog.format("CdmDirect: Must have a Latitude coordinate%n");
      return null;
    }

    // find lon coord
    Variable lon = CoordSysEvaluator.findCoordByType(ds, AxisType.Lon);
    if (lon == null) {
      errlog.format("CdmDirect: Must have a Longitude coordinate%n");
      return null;
    }

    if (lat.getRank() != lon.getRank()) {
      errlog.format("CdmDirect: Lat and Lon coordinate must have same rank");
      return null;
    }

    // should be a top level struct or sequence
    TableConfig stnTable = new TableConfig(Table.Type.Structure, "station");
    stnTable.featureType = FeatureType.STATION;
    stnTable.structureType = TableConfig.StructureType.Structure;

    stnTable.lat = lat.getShortName();
    stnTable.lon = lon.getShortName();

    // optional alt coord
    Variable alt = CoordSysEvaluator.findCoordByType(ds, AxisType.Height);
    if (alt != null)
      stnTable.stnAlt = alt.getShortName();

    // station id
    stnTable.stnId = Evaluator.findNameOfVariableWithAttributeValue(ds, CF.CF_ROLE, CF.STATION_ID);
    if (stnTable.stnId == null)
      stnTable.stnId = Evaluator.findNameOfVariableWithAttributeValue(ds, CF.STANDARD_NAME, CF.STATION_ID); // old way
    if (stnTable.stnId == null) {
      errlog.format("Must have a Station id variable with standard name station_id%n");
      return null;
    }

    // other station
    stnTable.stnDesc = Evaluator.findNameOfVariableWithAttributeValue(ds, CF.STANDARD_NAME, CF.PLATFORM_NAME);
    if (stnTable.stnDesc == null)
      stnTable.stnDesc = Evaluator.findNameOfVariableWithAttributeValue(ds, CF.STANDARD_NAME, CF.STATION_DESC);
    stnTable.stnWmoId = Evaluator.findNameOfVariableWithAttributeValue(ds, CF.STANDARD_NAME, CF.STATION_WMOID);

    // obs table
    Structure stnv = (Structure) ds.findVariable("station");
    Structure obsv = null;
    for (Variable v : stnv.getVariables()) {
      if (v.getDataType() == DataType.SEQUENCE)
        obsv = (Structure) v;
    }
    if (obsv == null) {
      errlog.format("Must have a SEQUENCE variable%n");
      return null;
    }
    TableConfig obs = new TableConfig(Table.Type.NestedStructure, obsv.getFullName());
    obs.nestedTableName = obsv.getShortName();
    obs.time = CoordSysEvaluator.findCoordShortNameByType(ds, AxisType.Time);
    if (obs.time == null) {
      errlog.format("Must have a time coordinate%n");
      return null;
    }
    stnTable.addChild(obs);

    return stnTable;
  }

  protected TableConfig getStationProfileConfig(NetcdfDataset ds, Formatter errlog) {
    TableConfig stnTable = getStationConfig(ds, errlog);
    if (stnTable == null)
      return null;

    stnTable.featureType = FeatureType.STATION_PROFILE;
    TableConfig timeSeries = stnTable.children.get(0);
    Structure obsv = (Structure) ds.findVariable(timeSeries.name);
    Structure profile = null;
    for (Variable v : obsv.getVariables()) {
      if (v.getDataType() == DataType.SEQUENCE)
        profile = (Structure) v;
    }
    if (profile == null) {
      errlog.format("getStationProfileConfig: must have Sequence varibale for profile%n");
      return null;
    }
    TableConfig profileTc = new TableConfig(Table.Type.NestedStructure, profile.getFullName());
    profileTc.nestedTableName = profile.getShortName();
    Variable elev = findZAxisNotStationAlt(ds);
    if (elev == null) {
      errlog.format("getStationProfileConfig: must have ZAxis that is not the StationAlt%n");
      return null;
    }

    profileTc.elev = elev.getShortName();
    if (profileTc.elev == null) {
      errlog.format("Must have a level coordinate%n");
      return null;
    }
    timeSeries.addChild(profileTc);

    return stnTable;
  }

  /*
   * protected TableConfig getStationAsPointConfig(NetcdfDataset ds, Formatter errlog) throws IOException {
   * boolean needFinish = false;
   *
   * // find lat coord
   * Variable lat = CoordSysEvaluator.findCoordByType(ds, AxisType.Lat);
   * if (lat == null) {
   * errlog.format("CdmDirect: Must have a Latitude coordinate");
   * return null;
   * }
   *
   * // find lon coord
   * Variable lon = CoordSysEvaluator.findCoordByType(ds, AxisType.Lon);
   * if (lon == null) {
   * errlog.format("CdmDirect: Must have a Longitude coordinate");
   * return null;
   * }
   *
   * if (lat.getRank() != lon.getRank()) {
   * errlog.format("CdmDirect: Lat and Lon coordinate must have same rank");
   * return null;
   * }
   *
   * Table.Type obsTableType = Table.Type.Structure;
   * TableConfig obs = new TableConfig(obsTableType, "all_data");
   * obs.dimName = "all_data";
   * obs.structName = "all_data";
   * obs.structureType = TableConfig.StructureType.Structure;
   * obs.featureType = FeatureType.POINT;
   *
   * obs.lat= lat.getName();
   * obs.lon= lon.getName();
   * obs.time= "time";
   *
   * // optional alt coord
   * Variable alt = CoordSysEvaluator.findCoordByType(ds, AxisType.Height);
   * if (alt != null)
   * obs.elev = alt.getName();
   *
   * List<String> vars = new ArrayList<String>(30);
   * for (Variable v : ds.getVariables()) {
   * if ((v.getDimension(0) == stationDim) &&
   * ((v.getRank() == 1) || ((v.getRank() == 2) && (v.getDataType() == DataType.CHAR))))
   * vars.add(v.getShortName());
   * }
   *
   * StructureDS s = new StructurePseudoDS(ds, null, "stnStruct", vars, stationDim);
   * obs.addJoin(new JoinMuiltdimStructure(s, obsDim.getLength()));
   * obs.addJoin(new JoinArray( time, JoinArray.Type.modulo, obsDim.getLength()));
   *
   * if (needFinish) ds.finish();
   * return obs;
   * }
   *
   *
   * protected TableConfig makeStationTable(NetcdfDataset ds, Formatter errlog) throws IOException {
   * // find lat coord
   * Variable lat = CoordSysEvaluator.findCoordByType(ds, AxisType.Lat);
   * if (lat == null) {
   * errlog.format("CdmDirect: Must have a Latitude coordinate");
   * return null;
   * }
   *
   * // find lon coord
   * Variable lon = CoordSysEvaluator.findCoordByType(ds, AxisType.Lon);
   * if (lon == null) {
   * errlog.format("CdmDirect: Must have a Longitude coordinate");
   * return null;
   * }
   *
   * if (lat.getRank() != lon.getRank()) {
   * errlog.format("CdmDirect: Lat and Lon coordinate must have same rank");
   * return null;
   * }
   *
   * // check dimensions
   * Dimension stationDim = null;
   *
   * if (lat.getDimension(0) != lon.getDimension(0)) {
   * errlog.format("CdmDirect: Lat and Lon coordinate must have same size");
   * return null;
   * }
   * stationDim = lat.getDimension(0);
   *
   * Table.Type stationTableType = Table.Type.Structure;
   * TableConfig stnTable = new TableConfig(stationTableType, "station");
   * stnTable.structureType = TableConfig.StructureType.PsuedoStructure;
   * stnTable.dimName = stationDim.getName();
   *
   * stnTable.lat= lat.getName();
   * stnTable.lon= lon.getName();
   *
   * stnTable.stnId = findNameVariableWithStandardNameAndDimension(ds, CF.STATION_ID, stationDim, errlog);
   * stnTable.stnDesc = findNameVariableWithStandardNameAndDimension(ds, CF.STATION_DESC, stationDim, errlog);
   * stnTable.stnWmoId = findNameVariableWithStandardNameAndDimension(ds, CF.STATION_WMOID, stationDim, errlog);
   * stnTable.stnAlt = findNameVariableWithStandardNameAndDimension(ds, CF.STATION_ALTITUDE, stationDim, errlog);
   *
   * if (stnTable.stnId == null) {
   * errlog.format("Must have a Station id variable with standard name station_id");
   * return null;
   * }
   * Variable stnId = ds.findVariable(stnTable.stnId);
   * if (!stnId.getDimension(0).equals(stationDim)) {
   * errlog.format("CdmDirect: Station id (%s) outer dimension must match latitude/longitude dimension (%s)",
   * stnTable.stnId, stationDim);
   * return null;
   * }
   * return stnTable;
   * }
   */
}


text:
#ifndef VICE_UIMENU_RESET_H
#define VICE_UIMENU_RESET_H

#include "vice.h"

#include "uimenu.h"

extern const ui_menu_entry_t reset_menu[];

#endif


text:
package com.tle.web.bulk.metadata.model;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

public class Modification implements Serializable {
  public static enum ModificationKeys {
    ACTION,
    SET_TEXT,
    SET_TEXT_OPTION,
    REPLACE_FIND,
    REPLACE_WITH,
    ADD_XML
  }

  private String info;
  private List<String> nodes;
  private String nodeDisplay;
  private Map<ModificationKeys, String> parmas;

  public Modification(
      List<String> nodes, String info, String nodeDisplay, Map<ModificationKeys, String> parmas) {
    this.nodes = nodes;
    this.info = info;
    this.nodeDisplay = nodeDisplay;
    this.parmas = parmas;
  }

  public Modification() {
    // prevent 400 error
  }

  public List<String> getNodes() {
    return nodes;
  }

  public String getNodeDisplay() {
    return nodeDisplay;
  }

  public void setNodes(List<String> nodes) {
    this.nodes = nodes;
  }

  public void setNodeDisplay(String nodeDisplay) {
    this.nodeDisplay = nodeDisplay;
  }

  public String getInfo() {
    return info;
  }

  public void setInfo(String info) {
    this.info = info;
  }

  public Map<ModificationKeys, String> getParmas() {
    return parmas;
  }

  public void setParmas(Map<ModificationKeys, String> parmas) {
    this.parmas = parmas;
  }
}


text:
// ============================================================================
// declarations
// ============================================================================

// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------

// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"

#ifdef __BORLANDC__
    #pragma hdrstop
#endif

#if wxUSE_SNGLINST_CHECKER

#ifndef WX_PRECOMP
    #include "wx/string.h"
    #include "wx/log.h"
    #include "wx/intl.h"
    #include "wx/utils.h"           // wxGetHomeDir()
#endif //WX_PRECOMP

#include "wx/file.h"

#include "wx/snglinst.h"

#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>           // for S_I[RW]USR
#include <signal.h>             // for kill()
#include <errno.h>

#ifdef HAVE_FCNTL
    #include <fcntl.h>
#elif defined(HAVE_FLOCK)
    #include <sys/file.h>
#else
    // normally, wxUSE_SNGLINST_CHECKER must have been reset by configure
    #error "wxSingleInstanceChecker can't be compiled on this platform"
#endif // fcntl()/flock()

// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------

// argument of wxLockFile()
enum LockOperation
{
    LOCK,
    UNLOCK
};

// return value of CreateLockFile()
enum LockResult
{
    LOCK_ERROR = -1,
    LOCK_EXISTS,
    LOCK_CREATED
};

// ----------------------------------------------------------------------------
// private functions: (exclusively) lock/unlock the file
// ----------------------------------------------------------------------------

#ifdef HAVE_FCNTL

static int wxLockFile(int fd, LockOperation lock)
{
    // init the flock parameter struct
    struct flock fl;
    fl.l_type = lock == LOCK ? F_WRLCK : F_UNLCK;

    // lock the entire file
    fl.l_start =
    fl.l_len =
    fl.l_whence = 0;

    // is this needed?
    fl.l_pid = getpid();

    return fcntl(fd, F_SETLK, &fl);
}

#else // HAVE_FLOCK

static int wxLockFile(int fd, LockOperation lock)
{
    return flock(fd, lock == LOCK ? LOCK_EX | LOCK_NB : LOCK_UN);
}

#endif // fcntl()/flock()

// ----------------------------------------------------------------------------
// wxSingleInstanceCheckerImpl: the real implementation class
// ----------------------------------------------------------------------------

class wxSingleInstanceCheckerImpl
{
public:
    wxSingleInstanceCheckerImpl()
    {
        m_fdLock = -1;
        m_pidLocker = 0;
    }

    bool Create(const wxString& name);

    pid_t GetLockerPID() const { return m_pidLocker; }

    ~wxSingleInstanceCheckerImpl() { Unlock(); }

private:
    // try to create and lock the file
    LockResult CreateLockFile();

    // unlock and remove the lock file
    void Unlock();

    // the descriptor of our lock file, -1 if none
    int m_fdLock;

    // pid of the process owning the lock file
    pid_t m_pidLocker;

    // the name of the lock file
    wxString m_nameLock;
};

// ============================================================================
// wxSingleInstanceCheckerImpl implementation
// ============================================================================

LockResult wxSingleInstanceCheckerImpl::CreateLockFile()
{
    // try to open the file
    m_fdLock = open(m_nameLock.fn_str(),
                    O_WRONLY | O_CREAT | O_EXCL,
                    S_IRUSR | S_IWUSR);

    if ( m_fdLock != -1 )
    {
        // try to lock it
        if ( wxLockFile(m_fdLock, LOCK) == 0 )
        {
            // fine, we have the exclusive lock to the file, write our PID
            // into it
            m_pidLocker = getpid();

            // use char here, not wxChar!
            char buf[256]; // enough for any PID size
            int len = sprintf(buf, "%d", (int)m_pidLocker) + 1;

            if ( write(m_fdLock, buf, len) != len )
            {
                wxLogSysError(_("Failed to write to lock file '%s'"),
                              m_nameLock.c_str());

                Unlock();

                return LOCK_ERROR;
            }

            fsync(m_fdLock);

            // change file's permission so that only this user can access it:
            if ( chmod(m_nameLock.fn_str(), S_IRUSR | S_IWUSR) != 0 )
            {
                wxLogSysError(_("Failed to set permissions on lock file '%s'"),
                              m_nameLock.c_str());

                Unlock();

                return LOCK_ERROR;
            }

            return LOCK_CREATED;
        }
        else // failure: see what exactly happened
        {
            close(m_fdLock);
            m_fdLock = -1;

            if ( errno != EACCES && errno != EAGAIN )
            {
                wxLogSysError(_("Failed to lock the lock file '%s'"),
                              m_nameLock.c_str());

                unlink(m_nameLock.fn_str());

                return LOCK_ERROR;
            }
            //else: couldn't lock because the lock is held by another process:
            //      this might have happened because of a race condition:
            //      maybe another instance opened and locked the file between
            //      our calls to open() and flock(), so don't give an error
        }
    }

    // we didn't create and lock the file
    return LOCK_EXISTS;
}

bool wxSingleInstanceCheckerImpl::Create(const wxString& name)
{
    m_nameLock = name;

    switch ( CreateLockFile() )
    {
        case LOCK_EXISTS:
            // there is a lock file, check below if it is still valid
            break;

        case LOCK_CREATED:
            // nothing more to do
            return true;

        case LOCK_ERROR:
            // oops...
            return false;
    }

    // Check if the file is owned by current user and has 0600 permissions.
    // If it doesn't, it's a fake file, possibly meant as a DoS attack, and
    // so we refuse to touch it:
    wxStructStat stats;
    if ( wxStat(name, &stats) != 0 )
    {
        wxLogSysError(_("Failed to inspect the lock file '%s'"), name.c_str());
        return false;
    }
    if ( stats.st_uid != getuid() )
    {
        wxLogError(_("Lock file '%s' has incorrect owner."), name.c_str());
        return false;
    }
    if ( stats.st_mode != (S_IFREG | S_IRUSR | S_IWUSR) )
    {
        wxLogError(_("Lock file '%s' has incorrect permissions."), name.c_str());
        return false;
    }

    // try to open the file for reading and get the PID of the process
    // which has it
    wxFile file(name, wxFile::read);
    if ( !file.IsOpened() )
    {
        // well, this is really weird - file doesn't exist and we can't
        // create it
        //
        // normally, this just means that we don't have write access to
        // the directory where we try to create it, so return failure,
        // even it might also be a rare case of a race condition when
        // another process managed to open and lock the file and terminate
        // (erasing it) before we got here, but this should happen so
        // rarely in practice that we don't care
        wxLogError(_("Failed to access lock file."));

        return false;
    }

    char buf[256];
    ssize_t count = file.Read(buf, WXSIZEOF(buf));
    if ( count == wxInvalidOffset )
    {
        wxLogError(_("Failed to read PID from lock file."));
    }
    else
    {
        if ( sscanf(buf, "%d", (int *)&m_pidLocker) == 1 )
        {
            if ( kill(m_pidLocker, 0) != 0 )
            {
                if ( unlink(name.fn_str()) != 0 )
                {
                    wxLogError(_("Failed to remove stale lock file '%s'."),
                               name.c_str());

                    // return true in this case for now...
                }
                else
                {
                    wxLogMessage(_("Deleted stale lock file '%s'."),
                                 name.c_str());

                    // retry now
                    (void)CreateLockFile();
                }
            }
            //else: the other process is running
        }
        else
        {
            wxLogWarning(_("Invalid lock file '%s'."), name.c_str());
        }
    }

    // return true if we could get the PID of the process owning the lock file
    // (whether it is still running or not), FALSE otherwise as it is
    // unexpected
    return m_pidLocker != 0;
}

void wxSingleInstanceCheckerImpl::Unlock()
{
    if ( m_fdLock != -1 )
    {
        if ( unlink(m_nameLock.fn_str()) != 0 )
        {
            wxLogSysError(_("Failed to remove lock file '%s'"),
                          m_nameLock.c_str());
        }

        if ( wxLockFile(m_fdLock, UNLOCK) != 0 )
        {
            wxLogSysError(_("Failed to unlock lock file '%s'"),
                          m_nameLock.c_str());
        }

        if ( close(m_fdLock) != 0 )
        {
            wxLogSysError(_("Failed to close lock file '%s'"),
                          m_nameLock.c_str());
        }
    }

    m_pidLocker = 0;
}

// ============================================================================
// wxSingleInstanceChecker implementation
// ============================================================================

bool wxSingleInstanceChecker::Create(const wxString& name,
                                     const wxString& path)
{
    wxASSERT_MSG( !m_impl,
                  wxT("calling wxSingleInstanceChecker::Create() twice?") );

    // must have the file name to create a lock file
    wxASSERT_MSG( !name.empty(), wxT("lock file name can't be empty") );

    m_impl = new wxSingleInstanceCheckerImpl;

    wxString fullname = path;
    if ( fullname.empty() )
    {
        fullname = wxGetHomeDir();
    }

    if ( fullname.Last() != wxT('/') )
    {
        fullname += wxT('/');
    }

    fullname << name;

    return m_impl->Create(fullname);
}

bool wxSingleInstanceChecker::DoIsAnotherRunning() const
{
    wxCHECK_MSG( m_impl, false, wxT("must call Create() first") );

    const pid_t lockerPid = m_impl->GetLockerPID();

    if ( !lockerPid )
    {
        // we failed to open the lock file, return false as we're definitely
        // not sure that another our process is running and so it's better not
        // to prevent this one from starting up
        return false;
    }

    // if another instance is running, it must own the lock file - otherwise
    // we have it and the locker PID is ours one
    return lockerPid != getpid();
}

wxSingleInstanceChecker::~wxSingleInstanceChecker()
{
    delete m_impl;
}

#endif // wxUSE_SNGLINST_CHECKER


text:
package in.ac.iitm.students.complaint_box.adapters;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;

import in.ac.iitm.students.R;
import in.ac.iitm.students.complaint_box.objects.ChatObject;
import in.ac.iitm.students.complaint_box.objects.ThreadObject;
import in.ac.iitm.students.others.UtilStrings;
import in.ac.iitm.students.others.Utils;

/**
 * Created by sai_praneeth7777 on 29-Jun-16.
 */

public class ChatAdapter extends ArrayAdapter {
    List list = new ArrayList<ThreadObject>();

    public ChatAdapter(Context context, int resource) {
        super(context, resource);
    }

    public void add(ChatObject object) {
        super.add(object);
        list.add(object);
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return list.get(position);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View row;
        row = convertView;
        contentHolder contentHolder;
        final ChatObject content = (ChatObject) this.getItem(position);
        if (row == null) {
            LayoutInflater layoutInflater = (LayoutInflater) this.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
            final String roll_no = Utils.getprefString(UtilStrings.ROLLNO, this.getContext());
            //Toast.makeText(this.getContext(),"1:"+content.getUser()+"::2:"+roll_no,Toast.LENGTH_LONG).show();
            if (content.getUser().equals(roll_no)) {
                row = layoutInflater.inflate(R.layout.m_message_item_right, parent, false);
                contentHolder = new contentHolder();
                contentHolder.txbody = (TextView) row.findViewById(R.id.txtMsg);
                contentHolder.txuser = (TextView) row.findViewById(R.id.lblMsgYou);
                contentHolder.txtime = (TextView) row.findViewById(R.id.lblMsgDateright);
                row.setTag(contentHolder);
            } else {
                row = layoutInflater.inflate(R.layout.m_message_item_left, parent, false);
                contentHolder = new contentHolder();
                contentHolder.txbody = (TextView) row.findViewById(R.id.txtMsg);
                contentHolder.txuser = (TextView) row.findViewById(R.id.lblMsgFrom);
                contentHolder.txtime = (TextView) row.findViewById(R.id.lblMsgDateleft);
                row.setTag(contentHolder);
            }
        } else {
            contentHolder = (contentHolder) row.getTag();
        }

        contentHolder.txbody.setText(content.getBody());
        contentHolder.txtime.setText(content.getDate() + ", " + content.getTime());
        contentHolder.txuser.setText(content.getUser());

        return row;
    }

    static class contentHolder {
        TextView txbody;
        TextView txuser;
        TextView txtime;
    }
}


text:
struct GLFWwindow;

class Window{
private:
    GLFWwindow* window;
    static void error_callback(int error, const char* description);
public:
    Window(int width, int height, int major_ver, int minor_ver, const char* title);
    ~Window();
    inline GLFWwindow* getWindow(){ return window; };
    bool open();
    void swap();

};
#endif


text:
function MultiPeers(connection) {
    var self = this;

    var skipPeers = ['getAllParticipants', 'getLength', 'selectFirst', 'streams', 'send', 'forEach'];
    connection.peers = {
        getLength: function() {
            var numberOfPeers = 0;
            for (var peer in this) {
                if (skipPeers.indexOf(peer) == -1) {
                    numberOfPeers++;
                }
            }
            return numberOfPeers;
        },
        selectFirst: function() {
            var firstPeer;
            for (var peer in this) {
                if (skipPeers.indexOf(peer) == -1) {
                    firstPeer = this[peer];
                }
            }
            return firstPeer;
        },
        getAllParticipants: function(sender) {
            var allPeers = [];
            for (var peer in this) {
                if (skipPeers.indexOf(peer) == -1 && peer != sender) {
                    allPeers.push(peer);
                }
            }
            return allPeers;
        },
        forEach: function(callbcak) {
            this.getAllParticipants().forEach(function(participant) {
                callbcak(connection.peers[participant]);
            });
        },
        send: function(data, remoteUserId) {
            var that = this;

            if (!isNull(data.size) && !isNull(data.type)) {
                self.shareFile(data, remoteUserId);
                return;
            }

            if (data.type !== 'text' && !(data instanceof ArrayBuffer) && !(data instanceof DataView)) {
                TextSender.send({
                    text: data,
                    channel: this,
                    connection: connection,
                    remoteUserId: remoteUserId
                });
                return;
            }

            if (data.type === 'text') {
                data = JSON.stringify(data);
            }

            if (remoteUserId) {
                var remoteUser = connection.peers[remoteUserId];
                if (remoteUser) {
                    if (!remoteUser.channels.length) {
                        connection.peers[remoteUserId].createDataChannel();
                        connection.renegotiate(remoteUserId);
                        setTimeout(function() {
                            that.send(data, remoteUserId);
                        }, 3000);
                        return;
                    }

                    remoteUser.channels.forEach(function(channel) {
                        channel.send(data);
                    });
                    return;
                }
            }

            this.getAllParticipants().forEach(function(participant) {
                if (!that[participant].channels.length) {
                    connection.peers[participant].createDataChannel();
                    connection.renegotiate(participant);
                    setTimeout(function() {
                        that[participant].channels.forEach(function(channel) {
                            channel.send(data);
                        });
                    }, 3000);
                    return;
                }

                that[participant].channels.forEach(function(channel) {
                    channel.send(data);
                });
            });
        }
    };

    this.uuid = connection.userid;

    this.getLocalConfig = function(remoteSdp, remoteUserId, userPreferences) {
        if (!userPreferences) {
            userPreferences = {};
        }

        return {
            streamsToShare: userPreferences.streamsToShare || {},
            rtcMultiConnection: connection,
            connectionDescription: userPreferences.connectionDescription,
            userid: remoteUserId,
            localPeerSdpConstraints: userPreferences.localPeerSdpConstraints,
            remotePeerSdpConstraints: userPreferences.remotePeerSdpConstraints,
            dontGetRemoteStream: !!userPreferences.dontGetRemoteStream,
            dontAttachLocalStream: !!userPreferences.dontAttachLocalStream,
            renegotiatingPeer: !!userPreferences.renegotiatingPeer,
            peerRef: userPreferences.peerRef,
            channels: userPreferences.channels || [],
            onLocalSdp: function(localSdp) {
                self.onNegotiationNeeded(localSdp, remoteUserId);
            },
            onLocalCandidate: function(localCandidate) {
                localCandidate = OnIceCandidateHandler.processCandidates(connection, localCandidate)
                if (localCandidate) {
                    self.onNegotiationNeeded(localCandidate, remoteUserId);
                }
            },
            remoteSdp: remoteSdp,
            onDataChannelMessage: function(message) {
                if (!connection.fbr && connection.enableFileSharing) initFileBufferReader();

                if (typeof message == 'string' || !connection.enableFileSharing) {
                    self.onDataChannelMessage(message, remoteUserId);
                    return;
                }

                var that = this;

                if (message instanceof ArrayBuffer || message instanceof DataView) {
                    connection.fbr.convertToObject(message, function(object) {
                        that.onDataChannelMessage(object);
                    });
                    return;
                }

                if (message.readyForNextChunk) {
                    connection.fbr.getNextChunk(message.uuid, function(nextChunk, isLastChunk) {
                        connection.peers[remoteUserId].channels.forEach(function(channel) {
                            channel.send(nextChunk);
                        });
                    }, remoteUserId);
                    return;
                }

                connection.fbr.addChunk(message, function(promptNextChunk) {
                    connection.peers[remoteUserId].peer.channel.send(promptNextChunk);
                });
            },
            onDataChannelError: function(error) {
                self.onDataChannelError(error, remoteUserId);
            },
            onDataChannelOpened: function(channel) {
                self.onDataChannelOpened(channel, remoteUserId);
            },
            onDataChannelClosed: function(event) {
                self.onDataChannelClosed(event, remoteUserId);
            },
            onRemoteStream: function(stream) {
                connection.peers[remoteUserId].streams.push(stream);

                if (isPluginRTC && window.PluginRTC) {
                    var mediaElement = document.createElement('video');
                    var body = connection.videosContainer;
                    body.insertBefore(mediaElement, body.firstChild);
                    setTimeout(function() {
                        window.PluginRTC.attachMediaStream(mediaElement, stream);
                    }, 3000);
                    return;
                }

                self.onGettingRemoteMedia(stream, remoteUserId);
            },
            onRemoteStreamRemoved: function(stream) {
                self.onRemovingRemoteMedia(stream, remoteUserId);
            },
            onPeerStateChanged: function(states) {
                self.onPeerStateChanged(states);

                if (states.iceConnectionState === 'new') {
                    self.onNegotiationStarted(remoteUserId, states);
                }

                if (states.iceConnectionState === 'connected') {
                    self.onNegotiationCompleted(remoteUserId, states);
                }

                if (states.iceConnectionState.search(/closed|failed/gi) !== -1) {
                    self.onUserLeft(remoteUserId);
                    self.disconnectWith(remoteUserId);
                }
            }
        };
    };

    this.createNewPeer = function(remoteUserId, userPreferences) {
        if (connection.maxParticipantsAllowed <= connection.getAllParticipants().length) {
            return;
        }

        userPreferences = userPreferences || {};

        if (connection.isInitiator && !!connection.session.audio && connection.session.audio === 'two-way' && !userPreferences.streamsToShare) {
            userPreferences.isOneWay = false;
            userPreferences.isDataOnly = false;
            userPreferences.session = connection.session;
        }

        if (!userPreferences.isOneWay && !userPreferences.isDataOnly) {
            userPreferences.isOneWay = true;
            this.onNegotiationNeeded({
                enableMedia: true,
                userPreferences: userPreferences
            }, remoteUserId);
            return;
        }

        userPreferences = connection.setUserPreferences(userPreferences, remoteUserId);

        var localConfig = this.getLocalConfig(null, remoteUserId, userPreferences);
        connection.peers[remoteUserId] = new PeerInitiator(localConfig);
    };

    this.createAnsweringPeer = function(remoteSdp, remoteUserId, userPreferences) {
        userPreferences = connection.setUserPreferences(userPreferences || {}, remoteUserId);

        var localConfig = this.getLocalConfig(remoteSdp, remoteUserId, userPreferences);
        connection.peers[remoteUserId] = new PeerInitiator(localConfig);
    };

    this.renegotiatePeer = function(remoteUserId, userPreferences, remoteSdp) {
        if (!connection.peers[remoteUserId]) {
            if (connection.enableLogs) {
                console.error('This peer (' + remoteUserId + ') does not exists. Renegotiation skipped.');
            }
            return;
        }

        if (!userPreferences) {
            userPreferences = {};
        }

        userPreferences.renegotiatingPeer = true;
        userPreferences.peerRef = connection.peers[remoteUserId].peer;
        userPreferences.channels = connection.peers[remoteUserId].channels;

        var localConfig = this.getLocalConfig(remoteSdp, remoteUserId, userPreferences);

        connection.peers[remoteUserId] = new PeerInitiator(localConfig);
    };

    this.replaceTrack = function(track, remoteUserId, isVideoTrack) {
        if (!connection.peers[remoteUserId]) {
            throw 'This peer (' + remoteUserId + ') does not exists.';
        }

        var peer = connection.peers[remoteUserId].peer;

        if (!!peer.getSenders && typeof peer.getSenders === 'function' && peer.getSenders().length) {
            peer.getSenders().forEach(function(rtpSender) {
                if (isVideoTrack && rtpSender.track instanceof VideoStreamTrack) {
                    connection.peers[remoteUserId].peer.lastVideoTrack = rtpSender.track;
                    rtpSender.replaceTrack(track);
                }

                if (!isVideoTrack && rtpSender.track instanceof AudioStreamTrack) {
                    connection.peers[remoteUserId].peer.lastAudioTrack = rtpSender.track;
                    rtpSender.replaceTrack(track);
                }
            });
            return;
        }

        console.warn('RTPSender.replaceTrack is NOT supported.');
        this.renegotiatePeer(remoteUserId);
    };

    this.onNegotiationNeeded = function(message, remoteUserId) {};
    this.addNegotiatedMessage = function(message, remoteUserId) {
        if (message.type && message.sdp) {
            if (message.type == 'answer') {
                if (connection.peers[remoteUserId]) {
                    connection.peers[remoteUserId].addRemoteSdp(message);
                }
            }

            if (message.type == 'offer') {
                if (message.renegotiatingPeer) {
                    this.renegotiatePeer(remoteUserId, null, message);
                } else {
                    this.createAnsweringPeer(message, remoteUserId);
                }
            }

            if (connection.enableLogs) {
                console.log('Remote peer\'s sdp:', message.sdp);
            }
            return;
        }

        if (message.candidate) {
            if (connection.peers[remoteUserId]) {
                connection.peers[remoteUserId].addRemoteCandidate(message);
            }

            if (connection.enableLogs) {
                console.log('Remote peer\'s candidate pairs:', message.candidate);
            }
            return;
        }

        if (message.enableMedia) {
            if (connection.attachStreams.length || connection.dontCaptureUserMedia) {
                var streamsToShare = {};
                connection.attachStreams.forEach(function(stream) {
                    streamsToShare[stream.streamid] = {
                        isAudio: !!stream.isAudio,
                        isVideo: !!stream.isVideo,
                        isScreen: !!stream.isScreen
                    };
                });
                message.userPreferences.streamsToShare = streamsToShare;

                self.onNegotiationNeeded({
                    readyForOffer: true,
                    userPreferences: message.userPreferences
                }, remoteUserId);
                return;
            }

            var localMediaConstraints = {};
            var userPreferences = message.userPreferences;
            if (userPreferences.localPeerSdpConstraints.OfferToReceiveAudio) {
                localMediaConstraints.audio = connection.mediaConstraints.audio;
            }

            if (userPreferences.localPeerSdpConstraints.OfferToReceiveVideo) {
                localMediaConstraints.video = connection.mediaConstraints.video;
            }

            var session = userPreferences.session || connection.session;

            if (session.oneway && session.audio && session.audio === 'two-way') {
                session = {
                    audio: true
                };
            }

            if (session.audio || session.video || session.screen) {
                if (session.screen) {
                    connection.getScreenConstraints(function(error, screen_constraints) {
                        connection.invokeGetUserMedia({
                            audio: isAudioPlusTab(connection) ? getAudioScreenConstraints(screen_constraints) : false,
                            video: screen_constraints,
                            isScreen: true
                        }, (session.audio || session.video) && !isAudioPlusTab(connection) ? connection.invokeGetUserMedia(null, cb) : cb);
                    });
                } else if (session.audio || session.video) {
                    connection.invokeGetUserMedia(null, cb, session);
                }
            }
        }

        if (message.readyForOffer) {
            connection.onReadyForOffer(remoteUserId, message.userPreferences);
        }

        function cb(stream) {
            gumCallback(stream, message, remoteUserId);
        }
    };

    function gumCallback(stream, message, remoteUserId) {
        var streamsToShare = {};
        connection.attachStreams.forEach(function(stream) {
            streamsToShare[stream.streamid] = {
                isAudio: !!stream.isAudio,
                isVideo: !!stream.isVideo,
                isScreen: !!stream.isScreen
            };
        });
        message.userPreferences.streamsToShare = streamsToShare;

        self.onNegotiationNeeded({
            readyForOffer: true,
            userPreferences: message.userPreferences
        }, remoteUserId);
    }

    this.connectNewParticipantWithAllBroadcasters = function(newParticipantId, userPreferences, broadcastersList) {
        broadcastersList = broadcastersList.split('|-,-|');
        if (!broadcastersList.length) {
            return;
        }

        var firstBroadcaster = broadcastersList[0];

        self.onNegotiationNeeded({
            newParticipant: newParticipantId,
            userPreferences: userPreferences || false
        }, firstBroadcaster);

        delete broadcastersList[0];

        var array = [];
        broadcastersList.forEach(function(broadcaster) {
            if (broadcaster) {
                array.push(broadcaster);
            }
        });

        setTimeout(function() {
            self.connectNewParticipantWithAllBroadcasters(newParticipantId, userPreferences, array.join('|-,-|'));
        }, 10 * 1000);
    };

    this.onGettingRemoteMedia = function(stream, remoteUserId) {};
    this.onRemovingRemoteMedia = function(stream, remoteUserId) {};
    this.onGettingLocalMedia = function(localStream) {};
    this.onLocalMediaError = function(error, constraints) {
        connection.onMediaError(error, constraints);
    };

    function initFileBufferReader() {
        connection.fbr = new FileBufferReader();
        connection.fbr.onProgress = function(chunk) {
            connection.onFileProgress(chunk);
        };
        connection.fbr.onBegin = function(file) {
            connection.onFileStart(file);
        };
        connection.fbr.onEnd = function(file) {
            connection.onFileEnd(file);
        };
    }

    this.shareFile = function(file, remoteUserId) {
        if (!connection.enableFileSharing) {
            throw '"connection.enableFileSharing" is false.';
        }

        initFileBufferReader();

        connection.fbr.readAsArrayBuffer(file, function(uuid) {
            var arrayOfUsers = connection.getAllParticipants();

            if (remoteUserId) {
                arrayOfUsers = [remoteUserId];
            }

            arrayOfUsers.forEach(function(participant) {
                connection.fbr.getNextChunk(uuid, function(nextChunk) {
                    connection.peers[participant].channels.forEach(function(channel) {
                        channel.send(nextChunk);
                    });
                }, participant);
            });
        }, {
            userid: connection.userid,
            // extra: connection.extra,
            chunkSize: isFirefox ? 15 * 1000 : connection.chunkSize || 0
        });
    };

    if (typeof 'TextReceiver' !== 'undefined') {
        var textReceiver = new TextReceiver(connection);
    }

    this.onDataChannelMessage = function(message, remoteUserId) {
        textReceiver.receive(JSON.parse(message), remoteUserId, connection.peers[remoteUserId] ? connection.peers[remoteUserId].extra : {});
    };

    this.onDataChannelClosed = function(event, remoteUserId) {
        event.userid = remoteUserId;
        event.extra = connection.peers[remoteUserId] ? connection.peers[remoteUserId].extra : {};
        connection.onclose(event);
    };

    this.onDataChannelError = function(error, remoteUserId) {
        error.userid = remoteUserId;
        event.extra = connection.peers[remoteUserId] ? connection.peers[remoteUserId].extra : {};
        connection.onerror(error);
    };

    this.onDataChannelOpened = function(channel, remoteUserId) {
        // keep last channel only; we are not expecting parallel/channels channels
        if (connection.peers[remoteUserId].channels.length) {
            connection.peers[remoteUserId].channels = [channel];
            return;
        }

        connection.peers[remoteUserId].channels.push(channel);
        connection.onopen({
            userid: remoteUserId,
            extra: connection.peers[remoteUserId] ? connection.peers[remoteUserId].extra : {},
            channel: channel
        });
    };

    this.onPeerStateChanged = function(state) {
        connection.onPeerStateChanged(state);
    };

    this.onNegotiationStarted = function(remoteUserId, states) {};
    this.onNegotiationCompleted = function(remoteUserId, states) {};

    this.getRemoteStreams = function(remoteUserId) {
        remoteUserId = remoteUserId || connection.peers.getAllParticipants()[0];
        return connection.peers[remoteUserId] ? connection.peers[remoteUserId].streams : [];
    };

    this.isPluginRTC = connection.isPluginRTC = isPluginRTC;
}


text:
<?php
namespace elnebuloso\Flex\Converter;

use stdClass;

/**
 * Class ArrayToObject
 *
 * @author Jeff Tunessen <jeff.tunessen@gmail.com>
 */
class ArrayToObject
{
    /**
     * convert array to object
     *
     * @param array $data
     * @return stdClass
     */
    public function convert($data)
    {
        if (is_array($data)) {
            if (!is_numeric(key($data))) {
                return (object) array_map(__METHOD__, $data);
            }

            /** @var stdClass $data */
            return $data;
        } else {
            /** @var stdClass $data */
            return $data;
        }
    }
}