text:
package com.mentor.nucleus.bp.ui.canvas.test;
//=====================================================================
//
//File:      $RCSfile: ListenerTest.java,v $
//Version:   $Revision: 1.19 $
//Modified:  $Date: 2013/05/10 05:41:51 $
//
//(c) Copyright 2004-2014 by Mentor Graphics Corp. 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.
//=====================================================================
//
//This class is responsible for performing part of the automatic test
//of the Graphics Domain by testing dependencies between symbols
//on the canvas and client domain classes.
//
import com.mentor.nucleus.bp.core.Action_c;
import com.mentor.nucleus.bp.core.ActualParameter_c;
import com.mentor.nucleus.bp.core.Association_c;
import com.mentor.nucleus.bp.core.AttributeReferenceInClass_c;
import com.mentor.nucleus.bp.core.Attribute_c;
import com.mentor.nucleus.bp.core.BaseAttribute_c;
import com.mentor.nucleus.bp.core.Block_c;
import com.mentor.nucleus.bp.core.Body_c;
import com.mentor.nucleus.bp.core.ClassIdentifierAttribute_c;
import com.mentor.nucleus.bp.core.ClassIdentifier_c;
import com.mentor.nucleus.bp.core.ClassInAssociation_c;
import com.mentor.nucleus.bp.core.ClassStateMachine_c;
import com.mentor.nucleus.bp.core.DataType_c;
import com.mentor.nucleus.bp.core.DerivedBaseAttribute_c;
import com.mentor.nucleus.bp.core.EnumerationDataType_c;
import com.mentor.nucleus.bp.core.ExternalEntity_c;
import com.mentor.nucleus.bp.core.GenerateEventStatement_c;
import com.mentor.nucleus.bp.core.ImportedClass_c;
import com.mentor.nucleus.bp.core.InstanceStateMachine_c;
import com.mentor.nucleus.bp.core.LiteralInteger_c;
import com.mentor.nucleus.bp.core.ModelClass_c;
import com.mentor.nucleus.bp.core.NewBaseAttribute_c;
import com.mentor.nucleus.bp.core.OperationParameter_c;
import com.mentor.nucleus.bp.core.Operation_c;
import com.mentor.nucleus.bp.core.Package_c;
import com.mentor.nucleus.bp.core.ReferentialAttribute_c;
import com.mentor.nucleus.bp.core.ReferredToIdentifierAttribute_c;
import com.mentor.nucleus.bp.core.Select_c;
import com.mentor.nucleus.bp.core.StateMachineState_c;
import com.mentor.nucleus.bp.core.Statement_c;
import com.mentor.nucleus.bp.core.UserDataType_c;
import com.mentor.nucleus.bp.test.common.UITestingUtilities;
import com.mentor.nucleus.bp.ui.canvas.Model_c;
import com.mentor.nucleus.bp.ui.graphics.editor.GraphicalEditor;
import com.mentor.nucleus.bp.ui.graphics.listeners.GraphicsEditorListener;

public class ListenerTest extends CanvasTest {
  public ListenerTest(String arg0) {
    super("com.mentor.nucleus.bp.ui.canvas.test", arg0);
  }

  public void setUp() throws Exception {
    super.setUp();

    loadProject("odms");
  }
  protected String getResultName() {
    return super.getModelName();
  }

  public void testPackageListener() {
    Package_c pkg = Package_c.PackageInstance(modelRoot);
    assertNotNull(pkg);
    GraphicalEditor editor = UITestingUtilities.getGraphicalEditorFor(pkg, true);
    Model_c uut = editor.getModel();
    assertNotNull("Diagram not found", uut);

    // validSymbols: Subsystem, External Entity
    assertTrue ( GraphicsEditorListener.classInView(uut, new Package_c(modelRoot)) );
    assertTrue ( GraphicsEditorListener.classInView(uut, new ModelClass_c(modelRoot)) );

    assertTrue ( GraphicsEditorListener.classInView(uut, new UserDataType_c(modelRoot)) );
    assertTrue ( GraphicsEditorListener.classInView(uut, new EnumerationDataType_c(modelRoot)) );
    assertTrue ( GraphicsEditorListener.classInView(uut, new ExternalEntity_c(modelRoot)) );

    assertTrue ( GraphicsEditorListener.classInView(uut, new UserDataType_c(modelRoot)) );
    assertTrue ( GraphicsEditorListener.classInView(uut, new EnumerationDataType_c(modelRoot)) );

    assertTrue ( GraphicsEditorListener.classInView(uut, new ImportedClass_c(modelRoot)) );
    assertTrue ( GraphicsEditorListener.classInView(uut, new Association_c(modelRoot)) );
    assertTrue ( GraphicsEditorListener.classInView(uut, new ClassInAssociation_c(modelRoot)) );
    assertTrue ( GraphicsEditorListener.classInView(uut, new Operation_c(modelRoot)) );
    assertTrue ( GraphicsEditorListener.classInView(uut, new OperationParameter_c(modelRoot)) );
    assertTrue ( GraphicsEditorListener.classInView(uut, new Attribute_c(modelRoot)) );
    assertTrue ( GraphicsEditorListener.classInView(uut, new BaseAttribute_c(modelRoot)) );
    assertTrue ( GraphicsEditorListener.classInView(uut, new ReferentialAttribute_c(modelRoot)) );
    assertTrue ( GraphicsEditorListener.classInView(uut, new DerivedBaseAttribute_c(modelRoot)) );
    assertTrue ( GraphicsEditorListener.classInView(uut, new NewBaseAttribute_c(modelRoot)) );
    assertTrue ( GraphicsEditorListener.classInView(uut, new AttributeReferenceInClass_c(modelRoot)) );
    assertTrue ( GraphicsEditorListener.classInView(uut, new ClassIdentifier_c(modelRoot)) );
    assertTrue ( GraphicsEditorListener.classInView(uut, new ClassIdentifierAttribute_c(modelRoot)) );
    assertTrue ( GraphicsEditorListener.classInView(uut, new ReferredToIdentifierAttribute_c(modelRoot)) );
    assertTrue ( GraphicsEditorListener.classInView(uut, new ModelClass_c(modelRoot)) );

    validateIgnoreStateMachineChanges(uut);
    validateIgnoreActivityChanges(uut);
  }

  public void testISDListener() {
	InstanceStateMachine_c pkg = InstanceStateMachine_c.InstanceStateMachineInstance(modelRoot);
	assertNotNull(pkg);
	GraphicalEditor editor = UITestingUtilities.getGraphicalEditorFor(pkg, true);
	Model_c uut = editor.getModel();
    assertNotNull("Diagram not found", uut);

    // validSymbols: State
    assertTrue ( GraphicsEditorListener.classInView(uut, new StateMachineState_c(modelRoot)) );
    assertTrue ( GraphicsEditorListener.classInView(uut, new Action_c(modelRoot)) );

    validateIgnoreAllSubsystemChanges(uut);
    validateIgnoreActivityChanges(uut);
    validateIgnoreDataTypePackageChanges(uut);
    validateIgnoreExternalEntityPackageChanges(uut);
  }

  public void testCSDListener() {
	ClassStateMachine_c pkg = ClassStateMachine_c.ClassStateMachineInstance(modelRoot);
	assertNotNull(pkg);
	GraphicalEditor editor = UITestingUtilities.getGraphicalEditorFor(pkg, true);
	Model_c uut = editor.getModel();
    assertNotNull("Diagram not found", uut);

    // validSymbols: State
    assertTrue ( GraphicsEditorListener.classInView(uut, new StateMachineState_c(modelRoot)) );
    assertTrue ( GraphicsEditorListener.classInView(uut, new Action_c(modelRoot)) );

    validateIgnoreAllSubsystemChanges(uut);
    validateIgnoreActivityChanges(uut);
    validateIgnoreDataTypePackageChanges(uut);
    validateIgnoreExternalEntityPackageChanges(uut);

  }

  private void validateIgnoreDataTypePackageChanges( Model_c uut )
  {
    assertFalse ( GraphicsEditorListener.classInView(uut, new UserDataType_c(modelRoot)) );
    assertFalse ( GraphicsEditorListener.classInView(uut, new EnumerationDataType_c(modelRoot)) );
  }
  private void validateIgnoreExternalEntityPackageChanges( Model_c uut )
  {
    assertFalse ( GraphicsEditorListener.classInView(uut, new ExternalEntity_c(modelRoot)) );
  }

  private void validateIgnoreAllSubsystemChanges( Model_c uut )
  {
   assertFalse ( GraphicsEditorListener.classInView(uut, new ImportedClass_c(modelRoot)) );
   assertFalse ( GraphicsEditorListener.classInView(uut, new DataType_c(modelRoot)) );
   assertFalse ( GraphicsEditorListener.classInView(uut, new Association_c(modelRoot)) );
   assertFalse ( GraphicsEditorListener.classInView(uut, new ClassInAssociation_c(modelRoot)) );
   assertFalse ( GraphicsEditorListener.classInView(uut, new Operation_c(modelRoot)) );
   assertFalse ( GraphicsEditorListener.classInView(uut, new OperationParameter_c(modelRoot)) );
   assertFalse ( GraphicsEditorListener.classInView(uut, new Attribute_c(modelRoot)) );
   assertFalse ( GraphicsEditorListener.classInView(uut, new BaseAttribute_c(modelRoot)) );
   assertFalse ( GraphicsEditorListener.classInView(uut, new ReferentialAttribute_c(modelRoot)) );
   assertFalse ( GraphicsEditorListener.classInView(uut, new DerivedBaseAttribute_c(modelRoot)) );
   assertFalse ( GraphicsEditorListener.classInView(uut, new NewBaseAttribute_c(modelRoot)) );
   assertFalse ( GraphicsEditorListener.classInView(uut, new AttributeReferenceInClass_c(modelRoot)) );
   assertFalse ( GraphicsEditorListener.classInView(uut, new ClassIdentifier_c(modelRoot)) );
   assertFalse ( GraphicsEditorListener.classInView(uut, new ClassIdentifierAttribute_c(modelRoot)) );
   assertFalse ( GraphicsEditorListener.classInView(uut, new ReferredToIdentifierAttribute_c(modelRoot)) );
  }
  private void validateIgnoreStateMachineChanges( Model_c uut )
  {
    assertFalse ( GraphicsEditorListener.classInView(uut, new StateMachineState_c(modelRoot)) );
    assertFalse ( GraphicsEditorListener.classInView(uut, new Action_c(modelRoot)) );
  }
  private void validateIgnoreActivityChanges( Model_c uut )
  {
    // this is just a sampling of classes
    assertFalse ( GraphicsEditorListener.classInView(uut, new Body_c(modelRoot)) );
    assertFalse ( GraphicsEditorListener.classInView(uut, new Statement_c(modelRoot)) );
    assertFalse ( GraphicsEditorListener.classInView(uut, new Block_c(modelRoot)) );
    assertFalse ( GraphicsEditorListener.classInView(uut, new LiteralInteger_c(modelRoot)) );
    assertFalse ( GraphicsEditorListener.classInView(uut, new ActualParameter_c(modelRoot)) );
    assertFalse ( GraphicsEditorListener.classInView(uut, new GenerateEventStatement_c(modelRoot)) );
    assertFalse ( GraphicsEditorListener.classInView(uut, new Select_c(modelRoot)) );

  }
}


text:
/* global location */

var getUrlParameter = function (name) {
  name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]')
  var regex = new RegExp('[\\?&]' + name + '=([^&#]*)')
  var results = regex.exec(location.search)
  return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '))
}

var getHashBang = () => {
  var regex = new RegExp('#!([^&#]*)')
  var results = regex.exec(location.hash)
  return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '))
}

var buildHashbang = (hashbang) => {
  return '#!' + hashbang
}

module.exports = {
  parameter: getUrlParameter,
  hashbang: getHashBang,
  buildHashbang: buildHashbang
}

redpajama_set_name: RedPajamaGithub


text:
#import "ANReachability+ANTest.h"
#import "NSObject+Swizzling.h"
#import <objc/runtime.h>

static BOOL kANReachabilityNonReachableNetworkStatusSimulationEnabled = NO;

@implementation ANReachability (ANTest)

+ (void)toggleNonReachableNetworkStatusSimulationEnabled:(BOOL)simulationEnabled {
    kANReachabilityNonReachableNetworkStatusSimulationEnabled = simulationEnabled;
}

+ (void)load {
    NSBlockOperation *operation = [NSBlockOperation blockOperationWithBlock:^{
        [[self class] exchangeInstanceSelector:@selector(currentReachabilityStatus)
                                  withSelector:@selector(test_currentReachabilityStatus)];
    }];
    [operation start];
}

- (ANNetworkStatus)test_currentReachabilityStatus {
    if (kANReachabilityNonReachableNetworkStatusSimulationEnabled) {
        return ANNetworkStatusNotReachable;
    } else {
        return [self test_currentReachabilityStatus];
    }
}

@end


text:
[![Codefresh build status]( https://g.codefresh.io/api/badges/build?repoOwner=HopeUA&repoName=docker-base&branch=7&pipelineName=main&accountName=hopeua&type=cf-1)]( https://g.codefresh.io/repositories/HopeUA/docker-base/builds?filter=trigger:build;branch:7;service:598244aa0ae1710001ff1d58~main) [![Github](https://img.shields.io/github/stars/HopeUA/docker-base.svg?style=social&label=Star)](https://github.com/HopeUA/docker-base)

Base image to create other images. Based on latest stable **CentOS 7** release.

## Versions

Current version of CentOS are maintained. When new version appears you will have time to switch.

  * `latest` – latest version of CentOS. Use this if you want always be up to date
  * `7` – Latest CentOS release of 7.x branch

## Usage

Just run to get the bash prompt

    docker run -it --rm hope/centos

Use latest version as base image for your own images

    FROM hope/centos

Or use specific version as base image

    FROM hope/centos:7

## Timezone

[Available timezones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
Set timezone in container with environment variable `TZ` in command line

    docker run -it --rm -e TZ=America/Chicago hope/centos

Or in your Dockerfile

    ENV TZ=America/Chicago

## Packages

EPEL repo installed by default.


text:
require_relative "helper"

class TestRemoteServerControlCommands < Test::Unit::TestCase

  include Helper::Client

  def test_info
    keys = [
     "redis_version",
     "uptime_in_seconds",
     "uptime_in_days",
     "connected_clients",
     "used_memory",
     "total_connections_received",
     "total_commands_processed",
    ]

    info = r.info

    keys.each do |k|
      msg = "expected #info to include #{k}"
      assert info.keys.include?(k), msg
    end
  end

  def test_info_commandstats
    target_version "2.5.7" do
      r.config(:resetstat)
      r.ping

      result = r.info(:commandstats)
      assert_equal "1", result["ping"]["calls"]
    end
  end

  def test_monitor_redis_lt_2_5_0
    return unless version < "2.5.0"

    log = []

    wire = Wire.new do
      Redis.new(OPTIONS).monitor do |line|
        log << line
        break if log.size == 3
      end
    end

    Wire.pass while log.empty? # Faster than sleep

    r.set "foo", "s1"

    wire.join

    assert log[-1][%q{(db 15) "set" "foo" "s1"}]
  end

  def test_monitor_redis_gte_2_5_0
    return unless version >= "2.5.0"

    log = []

    wire = Wire.new do
      Redis.new(OPTIONS).monitor do |line|
        log << line
        break if line =~ /set/
      end
    end

    Wire.pass while log.empty? # Faster than sleep

    r.set "foo", "s1"

    wire.join

    assert log[-1] =~ /\b15\b.* "set" "foo" "s1"/
  end

  def test_monitor_returns_value_for_break
    result = r.monitor do |line|
      break line
    end

    assert_equal "OK", result
  end

  def test_echo
    assert_equal "foo bar baz\n", r.echo("foo bar baz\n")
  end

  def test_debug
    r.set "foo", "s1"

    assert r.debug(:object, "foo").kind_of?(String)
  end

  def test_object
    r.lpush "list", "value"

    assert_equal 1, r.object(:refcount, "list")
    encoding = r.object(:encoding, "list")
    assert "ziplist" == encoding || "quicklist" == encoding, "Wrong encoding for list"
    assert r.object(:idletime, "list").kind_of?(Integer)
  end

  def test_sync
    redis_mock(:sync => lambda { "+OK" }) do |redis|
      assert_equal "OK", redis.sync
    end
  end

  def test_slowlog
    r.slowlog(:reset)
    result = r.slowlog(:len)
    assert_equal 0, result
  end

  def test_client
    assert_equal r.instance_variable_get(:@client), r._client
  end

  def test_client_list
    return if version < "2.4.0"

    keys = [
     "addr",
     "fd",
     "name",
     "age",
     "idle",
     "flags",
     "db",
     "sub",
     "psub",
     "multi",
     "qbuf",
     "qbuf-free",
     "obl",
     "oll",
     "omem",
     "events",
     "cmd"
    ]

    clients = r.client(:list)
    clients.each do |client|
      keys.each do |k|
        msg = "expected #client(:list) to include #{k}"
        assert client.keys.include?(k), msg
      end
    end
  end

  def test_client_kill
    return if version < "2.6.9"

    r.client(:setname, 'redis-rb')
    clients = r.client(:list)
    i = clients.index {|client| client['name'] == 'redis-rb'}
    assert_equal "OK", r.client(:kill, clients[i]["addr"])

    clients = r.client(:list)
    i = clients.index {|client| client['name'] == 'redis-rb'}
    assert_equal nil, i
  end

  def test_client_getname_and_setname
    return if version < "2.6.9"

    assert_equal nil, r.client(:getname)

    r.client(:setname, 'redis-rb')
    name = r.client(:getname)
    assert_equal 'redis-rb', name
  end
end


text:
@class TYPagerController;
@protocol TYPagerControllerDataSource <NSObject>

// viewController count in pagerController
- (NSInteger)numberOfControllersInPagerController;

// viewController at index in pagerController
- (UIViewController *)pagerController:(TYPagerController *)pagerController controllerForIndex:(NSInteger)index;

@optional

// viewController title in pagerController
- (NSString *)pagerController:(TYPagerController *)pagerController titleForIndex:(NSInteger)index;

@end

@protocol TYPagerControllerDelegate <NSObject>

@optional

// transition from index to index with animated
- (void)pagerController:(TYPagerController *)pagerController transitionFromIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex animated:(BOOL)animated;

// transition from index to index with progress
- (void)pagerController:(TYPagerController *)pagerController transitionFromIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex progress:(CGFloat)progress;

@end

@interface TYPagerController : UIViewController

@property (nonatomic, weak, readonly) UIScrollView *contentView; // don't change the frame

@property (nonatomic, weak) id<TYPagerControllerDataSource> dataSource;
@property (nonatomic, weak) id<TYPagerControllerDelegate>   delegate;

@property (nonatomic, strong, readonly) NSCache *memoryCache;// cache pagerController, you can set countLimit

@property (nonatomic, assign, readonly) NSInteger countOfControllers;// after viewdidload or reload have value

@property (nonatomic, assign, readonly) NSInteger curIndex;

@property (nonatomic, assign, readonly) NSRange visibleRange; // visible index range

@property (nonatomic, assign) CGFloat contentTopEdging; // contentView top edge

@property (nonatomic, assign) BOOL adjustStatusBarHeight; // defaut NO,if YES and navBar is hide,statusBarHeight have value to adjust status

@property (nonatomic, assign) CGFloat changeIndexWhenScrollProgress; // default 1.0,when scroll progress percent will change index

// reload
- (void)reloadData;

// override must call super , update contentView subviews frame
- (void)updateContentView;

// move pager controller to index
- (void)moveToControllerAtIndex:(NSInteger)index animated:(BOOL)animated;

// visible pager controllers
- (NSArray *)visibleViewControllers;

// scroll is progressing
- (BOOL)isProgressScrollEnabel;

// see adjustStatusBarHeight ,only layout views ,it is valid.
- (NSInteger)statusBarHeight;

@end

@interface TYPagerController (TransitionOverride)

// subclass override
- (void)transitionFromIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex animated:(BOOL)animated;

- (void)transitionFromIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex progress:(CGFloat)progress;

@end


text:
<?php

use Tester\Assert;

require __DIR__ . '/../bootstrap.php';

/**
 * @testCase
 */
class AdapterTest extends Tester\TestCase
{

    /** @var \UniMapper\Flexibee\Adapter $adapter */
    private $adapter;

    public function setUp()
    {
        $this->adapter = new UniMapper\Flexibee\Adapter(["host" => "http://localhost:8000", "company" => "testCompany"]);
    }

    public function testCreateDelete()
    {
        $query = $this->adapter->createDelete("objednavka-prijata");
        Assert::same("objednavka-prijata.json?code-in-response=true", $query->getRaw());
    }

    public function testCreateInsert()
    {
        $query = $this->adapter->createInsert("objednavka-prijata", [[]]);
        Assert::same("objednavka-prijata.json?code-in-response=true", $query->getRaw());
        Assert::same(array('objednavka-prijata' => array(array('@update' => 'fail'))), $query->data);
    }

    public function testCreateInsertMultiple()
    {
        $query = $this->adapter->createInsert("objednavka-prijata", ["name" => "value"]);
        Assert::same("objednavka-prijata.json?code-in-response=true", $query->getRaw());
        Assert::same(array('objednavka-prijata' => array('name' => 'value', '@update' => 'fail')), $query->data);
    }

    public function testCreateUpdate()
    {
        $query = $this->adapter->createUpdate("objednavka-prijata", [[]]);
        Assert::same("objednavka-prijata.json?code-in-response=true", $query->getRaw());
        Assert::same(array('objednavka-prijata' => array(array('@create' => 'fail'))), $query->data);
    }

    public function testCreateUpdateMultiple()
    {
        $query = $this->adapter->createUpdate("objednavka-prijata", ["name" => "value"]);
        Assert::same("objednavka-prijata.json?code-in-response=true", $query->getRaw());
        Assert::same(array('objednavka-prijata' => array('name' => 'value', '@create' => 'fail')), $query->data);
    }

}

$testCase = new AdapterTest;
$testCase->run();


text:
package com.google.code.gossip;

import java.net.InetSocketAddress;

/**
 * A abstract class representing a gossip member.
 *
 * @author joshclemm, harmenw
 */
public abstract class GossipMember implements Comparable<GossipMember> {

  protected final String host;

  protected final int port;

  protected volatile long heartbeat;

  protected final String clusterName;

  /**
   * The purpose of the id field is to be able for nodes to identify themselves beyond there
   * host/port. For example an application might generate a persistent id so if they rejoin the
   * cluster at a different host and port we are aware it is the same node.
   */
  protected String id;

  /**
   * Constructor.
   *
   * @param host
   *          The hostname or IP address.
   * @param port
   *          The port number.
   * @param heartbeat
   *          The current heartbeat.
   * @param id
   *          an id that may be replaced after contact
   */
  public GossipMember(String clusterName, String host, int port, String id, long heartbeat) {
    this.clusterName = clusterName;
    this.host = host;
    this.port = port;
    this.id = id;
    this.heartbeat = heartbeat;
  }

  /**
   * Get the name of the cluster the member belongs to.
   *
   * @return The cluster name
   */
  public String getClusterName() {
    return clusterName;
  }

  /**
   * Get the hostname or IP address of the remote gossip member.
   *
   * @return The hostname or IP address.
   */
  public String getHost() {
    return host;
  }

  /**
   * Get the port number of the remote gossip member.
   *
   * @return The port number.
   */
  public int getPort() {
    return port;
  }

  /**
   * The member address in the form IP/host:port Similar to the toString in
   * {@link InetSocketAddress}
   */
  public String getAddress() {
    return host + ":" + port;
  }

  /**
   * Get the heartbeat of this gossip member.
   *
   * @return The current heartbeat.
   */
  public long getHeartbeat() {
    return heartbeat;
  }

  /**
   * Set the heartbeat of this gossip member.
   *
   * @param heartbeat
   *          The new heartbeat.
   */
  public void setHeartbeat(long heartbeat) {
    this.heartbeat = heartbeat;
  }

  public String getId() {
    return id;
  }

  public void setId(String _id) {
    this.id = _id;
  }

  public String toString() {
    return "Member [address=" + getAddress() + ", id=" + id + ", heartbeat=" + heartbeat + "]";
  }

  /**
   * @see java.lang.Object#hashCode()
   */
  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    String address = getAddress();
    result = prime * result + ((address == null) ? 0 : address.hashCode()) + clusterName == null ? 0
            : clusterName.hashCode();
    return result;
  }

  /**
   * @see java.lang.Object#equals(java.lang.Object)
   */
  @Override
  public boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }
    if (obj == null) {
      System.err.println("equals(): obj is null.");
      return false;
    }
    if (!(obj instanceof GossipMember)) {
      System.err.println("equals(): obj is not of type GossipMember.");
      return false;
    }
    // The object is the same of they both have the same address (hostname and port).
    return getAddress().equals(((LocalGossipMember) obj).getAddress())
            && getClusterName().equals(((LocalGossipMember) obj).getClusterName());
  }

  public int compareTo(GossipMember other) {
    return this.getAddress().compareTo(other.getAddress());
  }
}


text:
package com.database;

/**
 * 数据库模型,Back(资产归还)表,用作增删改查的Where模型
 * Created by li_rz on 2016/7/14.
 */

/**
 *
 * Modified by li_rz on 2016/7/14.
 */

import java.sql.Types;

/**
 * device_number => INT
 * admin => INT
 * date => DATE
 */
public class Back extends DataBase{

    /**
     * 初始化
     *
     * @param keys   - 键值
     * @param values - 值
     * @throws Exception - 键值与值不能一一对应或者传入不存在的行
     */
    public Back(String[] keys, String[] values) throws IllegalArgumentException {
        super(keys, values);
    }

    public Back() {
        super();
    }

    @Override
    protected void initKeyList() {
        keyList.clear();
        keyList.put("id", true);
        keyList.put("device_number", true);
        keyList.put("admin", true);
        keyList.put("date", true);
        need_key_num = 3;
        if_auto_increase_id = true;
    }

    @Override
    protected void initTypeList() {
        typeList.clear();
        typeList.put("id", Types.INTEGER);
        typeList.put("device_number", Types.INTEGER);
        typeList.put("admin", Types.INTEGER);
        typeList.put("date", Types.DATE);
    }

    @Override
    public String getDataBaseName() {
        return "Back";
    }
}


text:
find_path (QWT_INCLUDE_DIRS
	NAMES qwt_plot.h
	PATHS
	/usr/local/include/qwt-qt4
	/usr/local/include/qwt
	/usr/include/qwt-qt4
	/usr/include/qwt
)

find_library (QWT_LIBRARIES
	NAMES qwt-qt4 qwt
	PATHS /usr/local/lib /usr/lib
)

# handle the QUIETLY and REQUIRED arguments and set QWT_FOUND to TRUE if
# all listed variables are TRUE
include ( FindPackageHandleStandardArgs )
find_package_handle_standard_args( Qwt DEFAULT_MSG QWT_LIBRARIES QWT_INCLUDE_DIRS )
MARK_AS_ADVANCED(QWT_LIBRARIES QWT_INCLUDE_DIRS)


text:
<?php

namespace ventaquil\NBPCurrency;

use ventaquil\NBPCurrency\CurrencyBuilder;
use ventaquil\NBPCurrency\Interfaces\FunctionalityInterface;

abstract class NBPCurrency
{
    public static function currency($code)
    {
        return self::newCurrencyBuilder()->currency($code);
    }

    public static function date($date)
    {
        return self::newCurrencyBuilder()->date($date);
    }

    private static function newCurrencyBuilder()
    {
        return new CurrencyBuilder();
    }

    public static function read($read)
    {
        if (!is_array($read)) {
            $read = array($read);
        }

        return self::newCurrencyBuilder()->read($read);
    }
}


text:
using std::ifstream;
using std::string;
using std::vector;
using boost::shared_ptr;
using boost::make_shared;
using YAML::Node;

namespace industrial_extrinsic_cal {

  void parseCameras(ifstream &cameras_input_file,vector<shared_ptr<Camera> >& cameras)
  {
    Node camera_doc = YAML::LoadFile(cameras_input_file.c_str());

    // read in all static cameras
    cameras.clear();
    Node camera_parameters = camera_doc("static_cameras");
    ROS_INFO_STREAM("Found "<<camera_parameters.size()<<" static cameras ");
    for (unsigned int i = 0; i < camera_parameters.size(); i++){
      shared_ptr<Camera> temp_camera = parseSingleCamera(camera_parameters[i]);
      cameras.push_back(temp_camera);
    } // end if there are any cameras in file

    // read in all moving cameras
    camera_parameters = camera_doc("moving_cameras");
    ROS_INFO_STREAM("Found "<<camera_parameters.size()<<" moving cameras ");
    for (unsigned int i = 0; i < camera_parameters.size(); i++){
      shared_ptr<Camera> temp_camera = parseSingleCamera(camera_parameters[i]);
      temp_camera->is_moving_ = true;
      cameras.push_back(temp_camera);
    }
    ROS_INFO_STREAM("Successfully read in " << (int) cameras.size() << " cameras");
  }

  shared_ptr<Camera> parseSingleCamera(const Node &node)
  {
    shared_ptr<Camera> temp_camera;
    try{
      string temp_name, temp_topic, camera_optical_frame, camera_housing_frame, camera_mounting_frame, parent_frame;
      string trigger_name, transform_interface;
      CameraParameters temp_parameters;
      temp_name = node["camera_name"].as<std::string>();
      trigger_name = node["trigger"].as<std::string>();
      temp_topic = node["image_topic"].as<std::string>();
      camera_optical_frame                = node["camera_optical_frame"].as<std::string>();
      transform_interface                    = node["transform_interface"] .as<std::string()>();
      temp_parameters.angle_axis[0]  = node["angle_axis_ax"].as<double>();
      temp_parameters.angle_axis[1]  = node["angle_axis_ay"].as<double>();
      temp_parameters.angle_axis[2]  = node["angle_axis_az"].as<double>();
      temp_parameters.position[0]      = node["position_x"] .as<double>();
      temp_parameters.position[1]      = node["position_y"] .as<double>();
      temp_parameters.position[2]      = node["position_z"] .as<double>();
      temp_parameters.focal_length_x = node["focal_length_x"] .as<double>();
      temp_parameters.focal_length_y = node["focal_length_y"] .as<double>();
      temp_parameters.center_x          = node["center_x"] .as<double>();
      temp_parameters.center_y          = node["center_y"] .as<double>();
      temp_parameters.distortion_k1   = node["distortion_k1"] .as<double>();
      temp_parameters.distortion_k2  = node["distortion_k2"] .as<double>();
      temp_parameters.distortion_k3  = node["distortion_k3"] .as<double>();
      temp_parameters.distortion_p1  = node["distortion_p1"] .as<double>();
      temp_parameters.distortion_p2  = node["distortion_p2"] .as<double>();
      temp_parameters.height            = node["image_height"] .as<double>();
      temp_parameters.width             = node["image_width"] .as<double>();
      Pose6d pose(temp_parameters.position[0],temp_parameters.position[1],temp_parameters.position[2],
		  temp_parameters.angle_axis[0],temp_parameters.angle_axis[1],temp_parameters.angle_axis[2]);

      // create a shared camera and a shared transform interface
      temp_camera = make_shared<Camera>(temp_name, temp_parameters, false);
      temp_camera->trigger_ = parseTrigger(node, trigger_name);
      shared_ptr<TransformInterface>  temp_ti = parseTransformInterface(node, transform_interface, camera_optical_frame);
      temp_camera->setTransformInterface(temp_ti);// install the transform interface
      temp_camera->camera_observer_ = make_shared<ROSCameraObserver>(temp_topic);
    }
    catch (YAML::ParserException& e){
      ROS_INFO_STREAM("Failed to read in moving cameras from yaml file ");
      ROS_INFO_STREAM("camera name    = " << temp_camera->camera_name_.c_str());
      ROS_INFO_STREAM("angle_axis_ax  = " << temp_camera->camera_parameters_.angle_axis[0]);
      ROS_INFO_STREAM("angle_axis_ay  = " << temp_camera->camera_parameters_.angle_axis[1]);
      ROS_INFO_STREAM("angle_axis_az  = " << temp_camera->camera_parameters_.angle_axis[2]);
      ROS_INFO_STREAM("position_x     = " << temp_camera->camera_parameters_.position[0]);
      ROS_INFO_STREAM("position_y     = " << temp_camera->camera_parameters_.position[1]);
      ROS_INFO_STREAM("position_z     = " << temp_camera->camera_parameters_.position[2]);
      ROS_INFO_STREAM("focal_length_x = " << temp_camera->camera_parameters_.focal_length_x);
      ROS_INFO_STREAM("focal_length_y = " << temp_camera->camera_parameters_.focal_length_y);
      ROS_INFO_STREAM("center_x       = " << temp_camera->camera_parameters_.center_x);
      ROS_INFO_STREAM("center_y       = " << temp_camera->camera_parameters_.center_y);
    }
    return(temp_camera);
  }

  shared_ptr<Trigger> parseTrigger(const Node &node, string &name)
  {
    shared_ptr<Trigger> temp_trigger;
    std::string trig_param;
    std::string trig_action_server;
    std::string trig_action_msg;
    // handle all the different trigger cases
    if(name == string("NO_WAIT_TRIGGER")){
      temp_trigger = make_shared<NoWaitTrigger>();
    }
    else if(name == string("ROS_PARAM_TRIGGER")){
      trig_param = node["trig_param"].at<std::string>();
      temp_trigger = make_shared<ROSParamTrigger>(trig_param);
    }
    else if(name == string("ROS_ACTION_TRIGGER")){
      trig_action_server = node["trig_action_server"] .at<std::string>();
      trig_action_msg = node["trig_action_msg"] .at<std::string>();
      temp_trigger = make_shared<ROSActionServerTrigger>(trig_action_server, trig_action_msg);
    }
    else if(name == string("ROS_ROBOT_JOINT_VALUES_ACTION_TRIGGER")){
      trig_action_server = node["trig_action_server"] .at<std::string>();
      std::vector<double>joint_values;
      joint_values = node["joint_values"].at<double>();
      if(joint_values.size()<0){
	ROS_ERROR("Couldn't read joint_values for ROS_ROBOT_JOINT_VALUES_ACTION_TRIGGER");
      }
      temp_trigger = make_shared<ROSRobotJointValuesActionServerTrigger>(trig_action_server, joint_values);
    }
    else if(name == string("ROS_ROBOT_POSE_ACTION_TRIGGER")){
      trig_action_server = node["trig_action_server"] .at<std::string>();
      Pose6d pose = parsePose(node);
      temp_trigger = make_shared<ROSRobotPoseActionServerTrigger>(trig_action_server, pose);
    }
    else{
      ROS_ERROR("No scene trigger of type %s", name.c_str());
    }
    return(temp_trigger);
  }

  shared_ptr<TransformInterface> parseTransformInterface(const Node &node, std::string &name, std::string &frame)
  {
    shared_ptr<TransformInterface> temp_ti;
    std::string camera_housing_frame;
    std::string camera_mounting_frame;
    if(name == std::string("ros_lti")){ // this option makes no sense for a camera
      temp_ti = make_shared<ROSListenerTransInterface>(frame);
    }
    else if(name == std::string("ros_bti")){ // this option makes no sense for a camera
      Pose6d pose = parsePose(node);
      temp_ti = make_shared<ROSBroadcastTransInterface>(frame, pose);
    }
    else if(name == std::string("ros_camera_lti")){
      temp_ti = make_shared<ROSCameraListenerTransInterface>(frame);
    }
    else if(name == std::string("ros_camera_bti")){
      Pose6d pose = parsePose(node);
      temp_ti = make_shared<ROSCameraBroadcastTransInterface>(frame, pose);
    }
    else if(name == std::string("ros_camera_housing_lti")){
      camera_housing_frame = node["camera_housing_frame"] .at<std::string>();
      temp_ti = make_shared<ROSCameraHousingListenerTInterface>(frame,camera_housing_frame);
    }
    else if(name == std::string("ros_camera_housing_bti")){
      Pose6d pose = parsePose(node);
      camera_housing_frame; = node["camera_housing_frame"] .at<std::string>();
      temp_ti = make_shared<ROSCameraHousingBroadcastTInterface>(frame,  pose);
    }
    else if(name == std::string("ros_camera_housing_cti")){
      camera_housing_frame; = node["camera_housing_frame"] .at<std::string>();
      camera_mounting_frame; = node["camera_mounting_frame"] .at<std::string>();
      temp_ti = make_shared<ROSCameraHousingCalTInterface>(frame,
							   camera_housing_frame,
							   camera_mounting_frame);
    }
    else if(name == std::string("ros_scti")){
      camera_mounting_frame; = node["parent_frame"] .at<std::string>();
      temp_ti = make_shared<ROSSimpleCalTInterface>(frame,  camera_mounting_frame);
    }
    else if(name == std::string("ros_camera_scti")){
      camera_mounting_frame; = node["parent_frame"] .at<std::string>();
      temp_ti = make_shared<ROSSimpleCameraCalTInterface>(frame,  camera_mounting_frame);
    }
    else if(name == std::string("default_ti")){
      Pose6d pose = parsePose(node);
      temp_ti = make_shared<DefaultTransformInterface>(pose);
    }
    else{
      Pose6d pose;
      ROS_ERROR("Unimplemented Transform Interface: %s",name.c_str());
      temp_ti = make_shared<DefaultTransformInterface>(pose);
    }
    return(temp_ti);
  }

  Pose6d parsePose(const Node &node)
  {
    Pose6d pose;
    pose.x =ode["pose"][0].at<double>();
    pose.y =ode["pose"][1].at<double>();
    pose.z =ode["pose"][2].at<double>();
    double qx,qy,qz,qw;
    qx =ode["pose"][3].at<double>();
    qy =ode["pose"][4].at<double>();
    qz =ode["pose"][5].at<double>();
    qw =ode["pose"][6].at<double>();
    pose.setQuaternion(qx, qy, qz, qw);
    return(pose);
  }
}// end of industrial_extrinsic_cal namespace


text:
#include "Function.h"

#include <cstdio>
#include <string>
#include <vector>

#include "../../CoreForms/CoreForms.h"
#include "../../Function/Function.h"
#include "../../Node/Node.h"
#include "../../ParseResult/ParseResult.h"
#include "../../Units/Units.h"
#include "../../llvmUtils/llvmUtils.h"
#include "../../llvm_Function.h"
#include "../Function/Function.h"
#include "../Linkage/Linkage.h"
#include "../Parameter/Parameter.h"
#include "../ProcBody/ProcBody.h"
#include "../Type/Type.h"
#include "../Utils/Utils.h"
#include "Config.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"

using namespace dale::ErrorInst;

namespace dale {
bool parseFunctionAttributes(Context *ctx,
                             std::vector<Node *> *attr_list,
                             bool *always_inline, bool *cto) {
    for (std::vector<Node *>::iterator b = (attr_list->begin() + 1),
                                       e = attr_list->end();
         b != e; ++b) {
        if ((*b)->is_list) {
            Error *e = new Error(InvalidAttribute, (*b));
            ctx->er->addError(e);
            return false;
        }
        if (!((*b)->token->str_value.compare("inline"))) {
            *always_inline = true;
        } else if (!((*b)->token->str_value.compare("cto"))) {
            *cto = true;
        } else {
            Error *e = new Error(InvalidAttribute, (*b));
            ctx->er->addError(e);
            return false;
        }
    }
    return true;
}

bool parseParameters(Units *units, Node *args_node,
                     std::vector<Variable *> *fn_args_internal) {
    Context *ctx = units->top()->ctx;
    std::vector<Node *> *args = args_node->list;

    if (args->size() == 0) {
        Error *e = new Error(NoEmptyLists, args_node);
        ctx->er->addError(e);
        return false;
    }

    for (std::vector<Node *>::iterator b = args->begin(),
                                       e = args->end();
         b != e; ++b) {
        Variable *var = new Variable();
        var->type = NULL;

        FormParameterParse(units, var, (*b), false, false, true, false);
        if (var->type == NULL) {
            delete var;
            return false;
        }

        if (!var->type->is_reference && var->type->is_array) {
            delete var;
            Error *e =
                new Error(ArraysCannotBeFunctionParameters, (*b));
            ctx->er->addError(e);
            return false;
        }

        if (var->type->base_type == BaseType::Void) {
            delete var;
            if (args->size() != 1) {
                Error *e =
                    new Error(VoidMustBeTheOnlyParameter, args_node);
                ctx->er->addError(e);
                return false;
            }
            break;
        }

        if (var->type->base_type == BaseType::VarArgs) {
            if ((args->end() - b) != 1) {
                delete var;
                Error *e =
                    new Error(VarArgsMustBeLastParameter, args_node);
                ctx->er->addError(e);
                return false;
            }
            fn_args_internal->push_back(var);
            break;
        }

        if (var->type->is_function) {
            delete var;
            Error *e = new Error(NonPointerFunctionParameter, (*b));
            ctx->er->addError(e);
            return false;
        }

        fn_args_internal->push_back(var);
    }

    return true;
}

void addInitChannelsCall(Context *ctx, llvm::Function *llvm_fn) {
    std::vector<llvm::Value *> call_args;
    std::vector<Type *> params;
    Function *ic = ctx->getFunction("init-channels", &params, NULL, 0);
    assert(ic && ic->llvm_function &&
           "cannot find init-channels function");

    llvm::Function::iterator i = llvm_fn->begin();
    llvm::BasicBlock *b = &*i;

    if (b->empty()) {
        llvm::CallInst::Create(ic->llvm_function,
                               llvm::ArrayRef<llvm::Value *>(call_args),
                               "", b);
    } else {
        llvm::Instruction *fnp = b->getFirstNonPHI();
        if (fnp) {
            llvm::CallInst::Create(
                ic->llvm_function,
                llvm::ArrayRef<llvm::Value *>(call_args), "", fnp);
        } else {
            llvm::CallInst::Create(
                ic->llvm_function,
                llvm::ArrayRef<llvm::Value *>(call_args), "", b);
        }
    }
}

void parametersToTypes(std::vector<Variable *> *parameters,
                       std::vector<Type *> *types) {
    for (std::vector<Variable *>::iterator b = parameters->begin(),
                                           e = parameters->end();
         b != e; ++b) {
        Type *type = (*b)->type;
        types->push_back(type);
    }
}

bool parametersToLLVMTypes(Context *ctx,
                           std::vector<Variable *> *parameters,
                           std::vector<llvm::Type *> *types) {
    for (std::vector<Variable *>::iterator b = parameters->begin(),
                                           e = parameters->end();
         b != e; ++b) {
        Type *type = (*b)->type;
        if (type->is_reference || type->is_rvalue_reference) {
            type = ctx->tr->getPointerType(type);
        }
        if (type->base_type == BaseType::VarArgs) {
            break;
        }
        llvm::Type *llvm_type = ctx->toLLVMType(type, NULL, false);
        if (!llvm_type) {
            return false;
        }
        types->push_back(llvm_type);
    }

    return true;
}

Type *parseReturnType(Units *units, Context *ctx,
                      std::vector<Variable *> *parameters, Node *node) {
    /* For return type parsing, activate an anonymous namespace and
     * add all of the function parameters to it.  This is so that if
     * the return type uses a macro that depends on one of those
     * parameters, it will work properly. */

    ctx->activateAnonymousNamespace();
    std::string anon_name = ctx->ns()->name;

    for (std::vector<Variable *>::iterator b = parameters->begin(),
                                           e = parameters->end();
         b != e; ++b) {
        ctx->addVariable((*b)->name.c_str(), (*b));
    }

    Type *ret_type =
        FormTypeParse(units, node, false, false, false, true);

    ctx->deactivateNamespace(anon_name.c_str());

    if (!ret_type) {
        return NULL;
    }

    if (ret_type->is_array) {
        Error *e = new Error(ReturnTypesCannotBeArrays, node);
        ctx->er->addError(e);
        return NULL;
    }

    return ret_type;
}

bool isValidDeclaration(Context *ctx, Node *node, const char *name,
                        int linkage, Function *fn) {
    Namespace *current_ns = (*(ctx->used_ns_nodes.rbegin()))->ns;
    std::vector<Type *> types;
    parametersToTypes(&fn->parameters, &types);
    Function *closest_fn = NULL;
    std::vector<bool> lvalues;
    for (std::vector<Type *>::iterator b = types.begin(),
                                       e = types.end();
         b != e; ++b) {
        lvalues.push_back((*b)->is_reference);
    }
    Function *matching_fn =
        (linkage == Linkage::Extern_C)
            ? current_ns->getFunction(name, NULL, NULL, false)
            : current_ns->getFunction(name, &types, &closest_fn, false,
                                      true, &lvalues);
    if (matching_fn && !matching_fn->is_macro &&
        !matching_fn->isVarArgs()) {
        if (!matching_fn->isEqualTo(fn)) {
            Error *e =
                new Error(RedeclarationOfFunctionOrMacro, node, name);
            ctx->er->addError(e);
            return false;
        }
        if (matching_fn->llvm_function &&
            matching_fn->llvm_function->size()) {
            Error *e =
                new Error(RedeclarationOfFunctionOrMacro, node, name);
            ctx->er->addError(e);
            return false;
        }
        if (!matching_fn->attrsAreEqual(fn)) {
            Error *e = new Error(AttributesOfDeclAndDefAreDifferent,
                                 node, name);
            ctx->er->addError(e);
            return false;
        }
    }

    Variable *matching_var = current_ns->getVariable(name);
    if (matching_var) {
        Error *e = new Error(RedeclarationOfDifferentKind, node, name);
        ctx->er->addError(e);
        return false;
    }

    return true;
}

bool FormFunctionParse(Units *units, Node *node, const char *name,
                       Function **new_fn, int override_linkage,
                       bool is_anonymous) {
    Context *ctx = units->top()->ctx;

    if (!is_anonymous) {
        units->prefunction_ns = ctx->ns();
    }

    if (CoreForms::existsNoOverride(name)) {
        Error *e = new Error(ThisCoreFormCannotBeOverridden, node);
        ctx->er->addError(e);
        return false;
    }

    std::vector<Node *> *lst = node->list;

    if (lst->size() < 4) {
        Error *e = new Error(IncorrectMinimumNumberOfArgs, node, "fn",
                             "3", (lst->size() - 1));
        ctx->er->addError(e);
        return false;
    }

    int next_index = 1;
    bool always_inline = false;
    bool cto = units->cto;

    /* Whole modules, as well as specific functions, can be declared
     * compile-time-only.  If global CTO is enabled, that overrides
     * the absence of a CTO attribute here.  However, if a function
     * explicitly declares that it is CTO, that will override the
     * global setting. */

    Node *test = ((*lst)[next_index]);
    if (test->is_list && (*test->list)[0]->is_token &&
        !((*test->list)[0]->token->str_value.compare("attr"))) {
        bool res = parseFunctionAttributes(ctx, test->list,
                                           &always_inline, &cto);
        if (!res) {
            return false;
        }
        ++next_index;
    }

    int linkage = (override_linkage)
                      ? override_linkage
                      : FormLinkageParse(ctx, (*lst)[next_index]);
    if (!linkage) {
        return false;
    }
    if (!override_linkage) {
        ++next_index;
    }

    /* The return type is not parsed yet, because it may depend on the
     * types of the function parameters. */

    int return_type_index = next_index;

    Node *args_node = (*lst)[next_index + 1];
    if (!args_node->is_list) {
        Error *e = new Error(UnexpectedElement, args_node, "list",
                             "parameters", "symbol");
        ctx->er->addError(e);
        return false;
    }

    std::vector<Variable *> fn_args_internal;
    bool res = parseParameters(units, args_node, &fn_args_internal);
    if (!res) {
        return false;
    }

    if (linkage == Linkage::Extern_C) {
        for (std::vector<Variable *>::iterator
                 b = fn_args_internal.begin(),
                 e = fn_args_internal.end();
             b != e; ++b) {
            Type *type = (*b)->type;
            if (type->is_reference || type->is_rvalue_reference) {
                Error *e = new Error(NoRefsInExternC, args_node);
                ctx->er->addError(e);
                return false;
            }
        }
    }

    bool varargs = false;
    if (fn_args_internal.size() &&
        (fn_args_internal.back()->type->base_type ==
         BaseType::VarArgs)) {
        varargs = true;
    }

    std::vector<llvm::Type *> fn_args;
    res = parametersToLLVMTypes(ctx, &fn_args_internal, &fn_args);
    if (!res) {
        return false;
    }

    Type *ret_type = parseReturnType(units, ctx, &fn_args_internal,
                                     (*lst)[return_type_index]);
    if (ret_type == NULL) {
        return false;
    }

    llvm::Type *llvm_ret_type = ctx->toLLVMType(ret_type, NULL, true);
    if (!llvm_ret_type) {
        return false;
    }

    /* Create the LLVM function type.  If the retval attribute is
     * present, then the LLVM function type will have a return type of
     * void, and a pointer to a value of the return type will be the
     * final parameter. */

    if (ret_type->is_retval) {
        fn_args.push_back(ctx->toLLVMType(
            ctx->tr->getPointerType(ret_type), NULL, true));
        llvm_ret_type = ctx->toLLVMType(
            ctx->tr->getBasicType(BaseType::Void), NULL, true);
    }
    llvm::FunctionType *ft =
        getFunctionType(llvm_ret_type, fn_args, varargs);

    std::string symbol;
    ctx->ns()->functionNameToSymbol(name, &symbol, linkage,
                                    &fn_args_internal);

    Function *fn = new Function(ret_type, &fn_args_internal, NULL, 0,
                                &symbol, always_inline);
    fn->linkage = linkage;
    fn->cto = cto;
    if (units->top()->once_tag.length() > 0) {
        fn->once_tag = units->top()->once_tag;
    }
    if (!strcmp(name, "setf-copy-init") ||
        !strcmp(name, "setf-copy-assign") ||
        !strcmp(name, "setf-move-init") ||
        !strcmp(name, "setf-move-assign")) {
        fn->is_setf_fn = true;
    } else if (!strcmp(name, "destroy")) {
        fn->is_destructor = true;
    }

    if (fn->is_setf_fn) {
        if (!ret_type->isEqualTo(ctx->tr->type_bool)) {
            Error *e = new Error(SetfOverridesMustReturnBool,
                                 (*lst)[return_type_index]);
            ctx->er->addError(e);
            return false;
        }
    }

    res = isValidDeclaration(ctx, node, name, linkage, fn);
    if (!res) {
        return false;
    }

#if D_LLVM_VERSION_ORD <= 80
    llvm::Constant *fnc =
        units->top()->module->getOrInsertFunction(symbol.c_str(), ft);
    llvm::Function *llvm_fn = llvm::dyn_cast<llvm::Function>(fnc);
#else
    int fn_linkage =
        (lst->size() == (unsigned)(next_index + 2))
            ? ctx->toLLVMLinkage(override_linkage)
            : ctx->toLLVMLinkage(linkage);

    llvm::FunctionCallee llvm_fn_callee =
        units->top()->module->getOrInsertFunction(symbol.c_str(), ft);
    llvm::Function *llvm_fn =
        llvm::cast<llvm::Function>(llvm_fn_callee.getCallee());
    if (!llvm_fn) {
        llvm::Function *llvm_fn = llvm::Function::Create(
            ft, ctx->toLLVMLinkage(fn_linkage), symbol.c_str(),
            units->top()->module);
    }
#endif

    /* If llvm_fn is null, then the function already exists and the
     * extant function has a different prototype, so it's an invalid
     * redeclaration.  If llvm_fn is not null, but has content, then
     * it's an invalid redefinition.  These error conditions should be
     * caught by isValidDeclaration, but there's no harm in leaving
     * this check here as a stopgap. */
    if (!llvm_fn || llvm_fn->size()) {
        fprintf(stderr, "%s\n", symbol.c_str());
        assert(false && "uncaught invalid redeclaration");
        abort();
    }

    if (always_inline) {
        addInlineAttribute(llvm_fn);
    }

    llvm_fn->setCallingConv(llvm::CallingConv::C);
    linkVariablesToFunction(&fn_args_internal, llvm_fn);

    llvm::Value *llvm_return_value = NULL;
    if (ret_type->is_retval) {
        llvm::Function::arg_iterator llvm_arg_iter =
            llvm_fn->arg_begin();
        std::advance(llvm_arg_iter, fn->parameters.size());
        llvm_return_value = &*llvm_arg_iter;
        llvm_return_value->setName("retval");
    }

    fn->llvm_function = llvm_fn;
    if (!ctx->ns()->addFunction(name, fn, node)) {
        return false;
    }

    if (new_fn) {
        *new_fn = fn;
    }

    /* If the list has only four arguments, function is a
     * declaration and you can return straightaway. */

    if (lst->size() == (unsigned)(next_index + 2)) {
        return true;
    }

    units->top()->pushGlobalFunction(fn);
    FormProcBodyParse(units, node, fn, llvm_fn, (next_index + 2),
                      is_anonymous, llvm_return_value);
    units->top()->popGlobalFunction();

    if (!strcmp(name, "main") && (!strcmp(SYSTEM_NAME, "Darwin") ||
                                  !strcmp(SYSTEM_NAME, "FreeBSD")) &&
        ctx->getVariable("stdin") && ctx->getVariable("stdout") &&
        ctx->getVariable("stderr")) {
        addInitChannelsCall(ctx, llvm_fn);
    }

    if (units->debug) {
        moduleDebugPass(units->top()->module);
    }

    return true;
}
}


text:
package com.logzc.webzic.reflection.scanner;

import com.logzc.webzic.reflection.fs.ZicFile;

import java.util.List;

/**
 * abstract base Scanner class.
 * Created by lishuang on 2016/7/18.
 */
public abstract class Scanner {
    public abstract void accept(ZicFile zicFile);
    public abstract List<String> getClassNames();
}


text:
CKEDITOR.plugins.setLang( 'blockquote', 'fr-ca', {
	toolbar: 'Citation'
});


text:
package com.iblsoft.iwxxm.webservice.ws;

import com.googlecode.jsonrpc4j.JsonRpcParam;
import com.iblsoft.iwxxm.webservice.ws.messages.ValidationRequest;
import com.iblsoft.iwxxm.webservice.ws.messages.ValidationResponse;

/**
 * Interface of JSON RPC web service.
 */
public interface IwxxmWebService {
    /**
     * Validates IWXXM message in the request.
     * @param request Data to be validated.
     * @return Result of message validation.
     */
    ValidationResponse validate(@JsonRpcParam("request") ValidationRequest request);
}


text:
Bugs

        Posted on

        by

        Deleted User

    No Bugs yet, why don't you create one?


text:
namespace Device {
    class PhysicalMemory {
    public:
        static bool Init(void);

        static void *AllocateBlock(void);
        static void *AllocateBlock(uint64_t Size);
        static void DeallocateBlock(void *Address);
        static void DeallocateBlock(void *Address, uint64_t Size);

        static uint64_t GetTotalMemorySize(void);
        static uint64_t GetBlockSize(void);
        static uint64_t GetTotalBlocks(void);
        static uint64_t GetUsedBlocks(void);
        static uint64_t GetFreeBlocks(void);

    private:
        static void SetBlock(uint64_t Page);
        static void ClearBlock(uint64_t Page);
        static bool TestBlock(uint64_t Page);

        static uint64_t FirstAvailable(void);
        static uint64_t FirstAvailable(uint64_t Size);

        static void SetRegion(uint64_t Address, uint64_t Size);
        static void ClearRegion(uint64_t Address, uint64_t Size);

        static uint64_t TotalPhysicalMemory_;
        static uint64_t TotalBlocks_;
        static uint64_t UsedBlocks_;
        static uint64_t *MemoryMap_;
    };
}


text:
using STG.MachinePosition;
using STG.Parameters;
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace STG
{
    /// <summary>
    /// 機体を生成するファクトリクラス
    /// </summary>
    public class MachineFactory
    {
        #region コンストラクタ

        /// <summary>
        /// コンストラクタ
        /// </summary>]
        /// <param name="position"></param>
        public MachineFactory(Position position)
        {
            _Machines = new MachineManager(CreateOwnMachine(position));

            _Input = new InputManager(CoreTimer.GetInstance(), Machines.GetOwnMachine());
        }

        #endregion

        #region フィールド

        private readonly MachineManager _Machines;

        private readonly InputManager _Input;

        #endregion

        #region プロパティ

        /// <summary>
        /// <see cref="MachineManager"/>インスタンスを取得します。
        /// </summary>
        public MachineManager Machines
        {
            get
            {
                Contract.Ensures(Contract.Result<MachineManager>() != null);
                return _Machines;
            }
        }

        /// <summary>
        /// <see cref="InputManager"/>インスタンスを取得します。
        /// </summary>
        public InputManager Input
        {
            get
            {
                Contract.Ensures(Contract.Result<InputManager>() != null);
                return _Input;
            }
        }

        #endregion

        #region メソッド

        /// <summary>
        /// 自機を生成します。
        /// </summary>
        /// <param name="position"></param>
        /// <returns></returns>
        private OwnMachine CreateOwnMachine(Position position)
        {
            Contract.Ensures(Contract.Result<OwnMachine>() != null);

            return new OwnMachine(MachinePositionFactory.CreateMachinePositionInstance(position));
        }

        #endregion

        #region Invariant

        /// <summary>
        /// 不変契約を定義します。
        /// </summary>
        [ContractInvariantMethod]
        private void ObjectInvariant()
        {
            Contract.Invariant(_Machines != null);
            Contract.Invariant(_Input != null);
        }

        #endregion
    }
}


text:
<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Alex Ubago - Dame tu aire</title>
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="materialize.css" />
<link rel="stylesheet" type="text/css" href="font-awesome.css" />

            Alex Ubago - Dame tu aire

Intro:
C#m A C#m A

C#m     A
Hoy te perdi
         C#m          A
una vez mas al despertar
      G#           A
si soñara la realidad
      G#              A
y viviera lo que se fue
C#m         A
mi humor miralo
              C#m         A
pintando un cuadro sin color
       G#              A
puedo ver un paisaje gris
        G#          A
que refleja mi interior
   G#        F#m
y en el y en el

Coro:
A         E             B
Palomas blancas vuelan raso
            C#m            A
sobre el tejado brilla el sol
        E           B
y rien todos menos yo
           A              E
que ahora soy, un reo mas
             B           C#m
pidiendo a gritos la verdad
              A             E
mi vida eres tu y si te vas
             B      C#m
vendra la oscuridad
        A               E
dame tu aire un dia mas
           B          C#m
para que pueda respirar
                A
que un rayo de luz
                E
me haga brillar
           B    C#m
que muera soledad.

C#m      A
Hoy soñare
         C#m           A
que despierto junto a ti
      G#               A
y te canto canciones que
  G#            A
anoche te escribi
      E    A
llegare por ti
        E         A
adonde nadie pudo ir
       G#          A
puedo ver mejor lugar
    G#             A
de tantos que conoci
   G#          F#m
y en el, y en el...

Coro:
A         E             B
Palomas blancas vuelan raso
            C#m            A
sobre el tejado brilla el sol
        E           B
y rien todos menos yo
           A              E
que ahora soy, un reo mas
             B           C#m
pidiendo a gritos la verdad
              A             E
mi vida eres tu y si te vas
             B      C#m
vendra la oscuridad
        A               E
dame tu aire un dia mas
           B          C#m
para que pueda respirar
                A
que un rayo de luz
                E
me haga brillar
           B
que muera soledad.
A E B C#m
A E B C#m
           A              E
que ahora soy, un reo mas
             B           C#m
pidiendo a gritos la verdad
              A             E
mi vida eres tu y si te vas
        B           C#m
me cegará la oscuridad
        A               E
dame tu aire un dia mas
           B          C#m
para que pueda respirar
                A
que un rayo de luz
                E
me haga brillar
           B      C#m
que muera soledad.

    <form action="#">

            <input type="range" id="velocidad" min="150000" max="600000" />

    </form>

        aA


text:
namespace Theaters.Business
{
    using System;

    public class Performance : IComparable<Performance>
    {
        public Performance(
            string theaterName,
            string performanceTitle,
            DateTime startDateTime,
            TimeSpan duration,
            decimal price)
        {
            this.TheaterName = theaterName;
            this.PerformanceTitle = performanceTitle;
            this.StartDateTime = startDateTime;
            this.Duration = duration; this.Price = price;
        }

        public string TheaterName { get; }

        public string PerformanceTitle { get; }

        public DateTime StartDateTime { get; }

        public TimeSpan Duration { get; }

        public decimal Price { get; }

        int IComparable<Performance>.CompareTo(Performance otherPerformance)
        {
            int result = this.StartDateTime.CompareTo(otherPerformance.StartDateTime);

            return result;
        }

        public override string ToString()
        {
            string result =
                $"Performance(Tr32: {this.TheaterName};"
                + $" Tr23: {this.PerformanceTitle};"
                + $" startDateTime: {this.StartDateTime.ToString("dd.MM.yyyy HH:mm")},"
                + $" duration: {this.Duration.ToString("hh':'mm")},"
                + $" price: {this.Price.ToString("f2")})";

            return result;
        }
    }
}


text:
import hashlib
import json
import sys
import os
from SCons.Defaults import Delete
from SCons.Builder import Builder
from SCons.Scanner import Scanner

def exists(env):
    return True

def _expand_settings_flags(settings, env):
    return [
        ('-s%s=%s' % (KEY, json.dumps(VALUE).replace('"', '\\"')))
        for KEY, VALUE in settings.items() ]

emscripten_version_files = {}

def build_version_file(env):
    if not env.subst('$EMSCRIPTEN_VERSION_FILE'):
        raise AssertionError('Must set EMSCRIPTEN_VERSION_FILE in environment')
    if not env.subst('$EMSCRIPTEN_TEMP_DIR'):
        raise AssertionError('Must set EMSCRIPTEN_TEMP_DIR in environment')

    EMSCRIPTEN_DEPENDENCIES = [
        env.Glob('${EMSCRIPTEN_HOME}/src/*.js'),
        env.Glob('${EMSCRIPTEN_HOME}/tools/*.py'),
        '${EMSCRIPTEN_HOME}/emscripten.py',
    ]
    if env.subst('$EMSCRIPTEN_SHELL'):
        EMSCRIPTEN_DEPENDENCIES.append('$EMSCRIPTEN_SHELL')

    def touch_file(target, source, env):
        m = hashlib.md5()
        for s in source:
            m.update(file(s.abspath, 'rb').read())
        for t in target:
            file(t.abspath, 'wb').write(m.hexdigest())

    [emscripten_version_file] = env.Command(
        '$EMSCRIPTEN_VERSION_FILE',
        EMSCRIPTEN_DEPENDENCIES,
        touch_file)

    env.AddPostAction(
        emscripten_version_file,
        Delete(env.Dir('$EMSCRIPTEN_TEMP_DIR').abspath))

    return emscripten_version_file

def get_emscripten_version_file(env):
    EMSCRIPTEN_HOME = env.Dir('$EMSCRIPTEN_HOME').abspath
    try:
        version_file = emscripten_version_files[EMSCRIPTEN_HOME]
    except KeyError:
        version_file = build_version_file(env)
        emscripten_version_files[EMSCRIPTEN_HOME] = version_file
    return version_file

def depend_on_emscripten(node, env, path):
    return [get_emscripten_version_file(env)]

EmscriptenScanner = Scanner(
    name='emscripten',
    function=depend_on_emscripten)

def setExtension(filename, extension):
    return os.path.splitext(filename)[0] + '.' + extension

def emscripten(env, target_js, source_bc):
    env = env.Clone()
    def buildName(extension):
        return setExtension(target_js, extension)

    # for debugging and reading generated code.
    # not in critical path, uses spare cores.
    env.LLVMDis(buildName('ll'), source_bc)

    [opt_ll] = env.LLVMOpt(
        buildName('opt.ll'),
        source_bc,
        LLVM_OPT_FLAGS=['-S'])

    [raw_emscripten_js] = env.Emscripten(
        buildName('raw.js'),
        [opt_ll])

    [optimized_js] = env.JSOptimizer(
        buildName('opt.js'),
        raw_emscripten_js)

    prejs = [
        env['EMSCRIPTEN_PREJS'],
        '${EMSCRIPTEN_HOME}/src/embind/emval.js',
        '${EMSCRIPTEN_HOME}/src/embind/embind.js' ]

    [concatenated_js] = env.Concatenate(
        buildName('concat.js'),
        [ prejs,
          optimized_js,
          env['EMSCRIPTEN_POSTJS'] ])

    DISABLE_EMSCRIPTEN_WARNINGS = [
        '--jscomp_error', 'ambiguousFunctionDecl',
        '--jscomp_error', 'checkDebuggerStatement',
        '--jscomp_off', 'checkTypes',
        '--jscomp_off', 'checkVars',
        '--jscomp_error', 'deprecated',
        '--jscomp_off', 'duplicate',
        #'--jscomp_error', 'es5strict',
        '--jscomp_off', 'missingProperties', # TODO: fix emscripten and turn this one on
        '--jscomp_error', 'undefinedNames',
        '--jscomp_off', 'undefinedVars', # TODO: fix emscripten and turn this one on
        '--jscomp_off', 'uselessCode',
        '--jscomp_off', 'globalThis',
    ]

    [iter_global_emscripten_js] = env.Concatenate(
        buildName('iter.js'),
        [ prejs,
          raw_emscripten_js,
          env['EMSCRIPTEN_POSTJS'] ])

    [global_cc_emscripten_js] = env.ClosureCompiler(
        buildName('global.closure.js'),
        concatenated_js,
        CLOSURE_FLAGS=['--language_in', 'ECMASCRIPT5']+DISABLE_EMSCRIPTEN_WARNINGS+['--formatting', 'PRETTY_PRINT', '--compilation_level', 'SIMPLE_OPTIMIZATIONS'])

    #env.Append(
    #    NODEJSFLAGS=['--max-stack-size=1000000000'],
    #    UGLIFYJSFLAGS=['--stats', '-c', 'warnings=false', '-b'])
    #env.UglifyJS(
    #    buildName('global.uglify.js'),
    #    concatenated_js)

    [closure_js] = env.ClosureCompiler(
        buildName('closure.js'),
        concatenated_js,
        CLOSURE_FLAGS=['--language_in', 'ECMASCRIPT5']+DISABLE_EMSCRIPTEN_WARNINGS+['--formatting', 'PRETTY_PRINT', '--compilation_level', 'ADVANCED_OPTIMIZATIONS'])

    [global_emscripten_min_js] = env.JSOptimizer(
        buildName('global.min.js'),
        closure_js,
        JS_OPTIMIZER_PASSES=['simplifyExpressionsPost', 'compress', 'last'])

    [emscripten_iteration_js] = env.WrapInModule(
        buildName('iteration.js'),
        iter_global_emscripten_js)

    [emscripten_js] = env.WrapInModule(
        buildName('debug.js'),
        global_cc_emscripten_js)

    [emscripten_min_js] = env.WrapInModule(
        buildName('min.js'),
        global_emscripten_min_js)

    env.InstallAs(buildName('js'), emscripten_js)

    return [emscripten_iteration_js, emscripten_js, emscripten_min_js]

LIBC_SOURCES = [
    'system/lib/dlmalloc.c',
    'system/lib/libc/musl/src/string/wmemset.c',
    'system/lib/libc/musl/src/string/wmemcpy.c',
]

LIBCXX_SOURCES = [os.path.join('system/lib/libcxx', x) for x in [
    'algorithm.cpp',
    'bind.cpp',
    #'chrono.cpp',
    #'condition_variable.cpp',
    #'debug.cpp',
    #'exception.cpp',
    'future.cpp',
    'hash.cpp',
    #'ios.cpp',
    #'iostream.cpp',
    'memory.cpp',
    'mutex.cpp',
    'new.cpp',
    'random.cpp',
    'regex.cpp',
    'stdexcept.cpp',
    'string.cpp',
    'strstream.cpp',
    'system_error.cpp',
    #'thread.cpp',
    'typeinfo.cpp',
    'utility.cpp',
    'valarray.cpp',
]]

LIBCXXABI_SOURCES = [os.path.join('system/lib/libcxxabi/src', x) for x in [
    'private_typeinfo.cpp'
]]

# MAJOR HACK ALERT
# ugh, SCons imports tool .py files multiple times, meaning that global variables aren't really global
# store our "globals" "privately" on the SCons object :(
import SCons

def build_libembind(env):
    emscripten_temp_dir = env.Dir('$EMSCRIPTEN_TEMP_DIR').abspath
    try:
        libembind_cache = SCons.__emscripten_libembind_cache
    except AttributeError:
        libembind_cache = {}
        SCons.__emscripten_libembind_cache = libembind_cache
    try:
        return libembind_cache[emscripten_temp_dir]
    except KeyError:
        pass

    libembind = env.Object(
        '$EMSCRIPTEN_TEMP_DIR/internal_libs/bind',
        '$EMSCRIPTEN_HOME/system/lib/embind/bind.cpp')
    env.Depends(libembind, get_emscripten_version_file(env))
    libembind_cache[emscripten_temp_dir] = libembind
    return libembind

def build_libcxx(env):
    emscripten_temp_dir = env.Dir('$EMSCRIPTEN_TEMP_DIR').abspath
    try:
        libcxx_cache = SCons.__emscripten_libcxx_cache
    except AttributeError:
        libcxx_cache = {}
        SCons.__emscripten_libcxx_cache = libcxx_cache
    try:
        return libcxx_cache[emscripten_temp_dir]
    except KeyError:
        pass

    env = env.Clone()
    env['CXXFLAGS'] = filter(lambda e: e not in ('-Werror', '-Wall'), env['CXXFLAGS'])
    env['CCFLAGS'] = filter(lambda e: e not in ('-Werror', '-Wall'), env['CCFLAGS'])

    objs = [
        env.Object(
            '${EMSCRIPTEN_TEMP_DIR}/libcxx_objects/' + os.path.splitext(o)[0] + '.bc',
            '${EMSCRIPTEN_HOME}/' + o)
        for o in LIBC_SOURCES + LIBCXXABI_SOURCES + LIBCXX_SOURCES]
    env.Depends(objs, get_emscripten_version_file(env))

    libcxx = env.Library('${EMSCRIPTEN_TEMP_DIR}/internal_libs/libcxx', objs)
    libcxx_cache[emscripten_temp_dir] = libcxx
    return libcxx

def generate(env):
    env.SetDefault(
        PYTHON=sys.executable,
        NODEJS='node',
        JS_ENGINE='$NODEJS',
        EMSCRIPTEN_FLAGS=['-v', '-j', '--suppressUsageWarning'],
        EMSCRIPTEN_TEMP_DIR=env.Dir('#/emscripten.tmp'),
        _expand_settings_flags=_expand_settings_flags,
        EMSCRIPTEN_PREJS=[],
        EMSCRIPTEN_POSTJS=[],
        EMSCRIPTEN_SETTINGS={},
        _EMSCRIPTEN_SETTINGS_FLAGS='${_expand_settings_flags(EMSCRIPTEN_SETTINGS, __env__)}',
        JS_OPTIMIZER_PASSES=[],
        LLVM_OPT_PASSES=['-std-compile-opts', '-std-link-opts'],

        EMSCRIPTEN_HOME=env.Dir(os.path.join(os.path.dirname(__file__), '..')),
    )

    env.Replace(
        CC='${LLVM_ROOT}/${CLANG}',
        CXX='${LLVM_ROOT}/${CLANGXX}',
        AR='${LLVM_ROOT}/${LLVM_LINK}',
        ARCOM='$AR -o $TARGET $SOURCES',
        OBJSUFFIX='.bc',
        LIBPREFIX='',
        LIBSUFFIX='.bc',
        RANLIBCOM='',
        CCFLAGS=[
            '-U__STRICT_ANSI__',
            '-target', 'le32-unknown-nacl',
            '-nostdinc',
            '-Wno-#warnings',
            '-Wno-error=unused-variable',
            '-Werror',
            '-Os',
            '-fno-threadsafe-statics',
            '-fvisibility=hidden',
            '-fvisibility-inlines-hidden',
            '-Xclang', '-nostdinc++',
            '-Xclang', '-nobuiltininc',
            '-Xclang', '-nostdsysteminc',
            '-Xclang', '-isystem$EMSCRIPTEN_HOME/system/include',
            '-Xclang', '-isystem$EMSCRIPTEN_HOME/system/include/libc',
            '-Xclang', '-isystem$EMSCRIPTEN_HOME/system/include/libcxx',
            '-Xclang', '-isystem$EMSCRIPTEN_HOME/system/include/bsd',
            '-emit-llvm'],
        CXXFLAGS=['-std=c++11', '-fno-exceptions'],
    )
    env.Append(CPPDEFINES=[
        'EMSCRIPTEN',
        '__EMSCRIPTEN__',
        '__STDC__',
        '__IEEE_LITTLE_ENDIAN',
    ])

    env['BUILDERS']['Emscripten'] = Builder(
        action='$PYTHON ${EMSCRIPTEN_HOME}/emscripten.py $EMSCRIPTEN_FLAGS $_EMSCRIPTEN_SETTINGS_FLAGS --temp-dir=$EMSCRIPTEN_TEMP_DIR --compiler $JS_ENGINE --relooper=third-party/relooper.js $SOURCE > $TARGET',
        target_scanner=EmscriptenScanner)

    env['BUILDERS']['JSOptimizer'] = Builder(
        action='$JS_ENGINE ${EMSCRIPTEN_HOME}/tools/js-optimizer.js $SOURCE $JS_OPTIMIZER_PASSES > $TARGET',
        target_scanner=EmscriptenScanner)

    def depend_on_embedder(target, source, env):
        env.Depends(target, env['JS_EMBEDDER'])
        return target, source

    def embed_files_in_js(target, source, env, for_signature):
        return '$PYTHON $JS_EMBEDDER $SOURCE.srcpath > $TARGET'

    def get_files_in_tree(node, env, path):
        tree_paths = []
        for root, dirs, files in os.walk(str(node)):
            tree_paths += [os.path.join(root, f) for f in files]
        return [env.File(p) for p in tree_paths]

    env.SetDefault(
        JS_EMBEDDER=env.File('#/bin/embed_files_in_js.py'))

    FileTreeScanner = Scanner(
        function=get_files_in_tree,
        name='FileTreeScanner',
        recursive=False)

    env['BUILDERS']['EmbedFilesInJS'] = Builder(
        generator=embed_files_in_js,
        emitter=depend_on_embedder,
        source_scanner=FileTreeScanner)

    env.AddMethod(emscripten)

    def ConcatenateAction(target, source, env):
        [target] = target
        total = ''.join(file(str(s), 'rb').read() for s in source)
        file(str(target), 'wb').write(total)
    env['BUILDERS']['Concatenate'] = Builder(action=ConcatenateAction)

    libembind = build_libembind(env)
    libcxx = build_libcxx(env)

    # should embind be its own tool?
    env.Append(
        CPPPATH=[
            '${EMSCRIPTEN_HOME}/system/include' ],
        LIBPATH=['$EMSCRIPTEN_TEMP_DIR/internal_libs'],
        LIBS=[
            libembind,
            libcxx,
        ],
    )


text:
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package org.intellij.lang.regexp;

import com.intellij.codeInsight.TailType;
import com.intellij.codeInsight.completion.*;
import com.intellij.codeInsight.lookup.LookupElement;
import com.intellij.codeInsight.lookup.LookupElementBuilder;
import com.intellij.codeInsight.lookup.TailTypeDecorator;
import com.intellij.lang.ASTNode;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.progress.ProgressManager;
import com.intellij.openapi.util.TextRange;
import com.intellij.patterns.ElementPattern;
import com.intellij.patterns.PsiElementPattern;
import com.intellij.psi.PsiElement;
import com.intellij.util.ObjectUtils;
import com.intellij.util.PlatformIcons;
import com.intellij.util.ProcessingContext;
import com.intellij.util.ui.EmptyIcon;
import org.intellij.lang.regexp.psi.RegExpProperty;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;

import static com.intellij.patterns.PlatformPatterns.psiElement;
import static com.intellij.patterns.StandardPatterns.or;

/**
 * @author vnikolaenko
 */
public final class RegExpCompletionContributor extends CompletionContributor {
  private static final Icon emptyIcon = EmptyIcon.create(PlatformIcons.PROPERTY_ICON);

  public RegExpCompletionContributor() {
    {
      final PsiElementPattern.Capture<PsiElement> namedCharacterPattern = psiElement().withText("\\N");
      extend(CompletionType.BASIC, psiElement().afterLeaf(namedCharacterPattern),
             new NamedCharacterCompletionProvider(true));
      extend(CompletionType.BASIC, psiElement().afterLeaf(psiElement(RegExpTT.LBRACE).afterLeaf(namedCharacterPattern)),
             new NamedCharacterCompletionProvider(false));

      extend(CompletionType.BASIC, psiElement().withText("\\I"), new CharacterClassesNameCompletionProvider());

      final ElementPattern<PsiElement> propertyPattern = psiElement().withText("\\p");
      extend(CompletionType.BASIC, psiElement().afterLeaf(propertyPattern), new PropertyCompletionProvider());

      final ElementPattern<PsiElement> bracketExpressionPattern = psiElement().afterLeaf(
        or(psiElement(RegExpTT.BRACKET_EXPRESSION_BEGIN),
           psiElement(RegExpTT.CARET).afterLeaf(psiElement(RegExpTT.BRACKET_EXPRESSION_BEGIN))));
      extend(CompletionType.BASIC, bracketExpressionPattern, new BracketExpressionCompletionProvider());
    }

    {
      // TODO: backSlashPattern is needed for reg exp in injected context, remove when unescaping will be performed by Injecting framework
      final PsiElementPattern.Capture<PsiElement> namedCharacterPattern = psiElement().withText("\\\\N");
      extend(CompletionType.BASIC, psiElement().afterLeaf(namedCharacterPattern),
             new NamedCharacterCompletionProvider(true));
      extend(CompletionType.BASIC, psiElement().afterLeaf(psiElement(RegExpTT.LBRACE).afterLeaf(namedCharacterPattern)),
             new NamedCharacterCompletionProvider(false));

      final ElementPattern<PsiElement> backSlashPattern = psiElement().withText("\\\\I");
      extend(CompletionType.BASIC, backSlashPattern, new CharacterClassesNameCompletionProvider());

      final ElementPattern<PsiElement> propertyPattern = psiElement().withText("\\\\p");
      extend(CompletionType.BASIC, psiElement().afterLeaf(propertyPattern), new PropertyCompletionProvider());

      extend(CompletionType.BASIC, psiElement().inside(RegExpProperty.class).afterLeaf(psiElement(RegExpTT.EQ)),
             new PropertyValueCompletionProvider());
    }

    {
      // TODO: this seems to be needed only for tests!
      final ElementPattern<PsiElement> backSlashPattern = psiElement().withText("\\\\");
      extend(CompletionType.BASIC, psiElement().afterLeaf(backSlashPattern), new CharacterClassesNameCompletionProvider());

      final ElementPattern<PsiElement> propertyPattern
              = psiElement().withText("p").afterLeaf(backSlashPattern);
      extend(CompletionType.BASIC, psiElement().afterLeaf(propertyPattern), new PropertyCompletionProvider());

      final PsiElementPattern.Capture<PsiElement> namedCharacterPattern = psiElement().withText("N");
      extend(CompletionType.BASIC, psiElement().afterLeaf(namedCharacterPattern),
             new NamedCharacterCompletionProvider(true));
      extend(CompletionType.BASIC, psiElement().afterLeaf(psiElement(RegExpTT.LBRACE).afterLeaf(namedCharacterPattern)),
             new NamedCharacterCompletionProvider(false));
    }
  }

  private static void addLookupElement(final CompletionResultSet result, @NonNls final String name, String type, Icon icon) {
    result.addElement(createLookupElement(name, type, icon));
  }

  private static LookupElement createLookupElement(String name, String type, Icon icon) {
    return LookupElementBuilder.create(name).withTypeText(type).withIcon(icon);
  }

  private static class BracketExpressionCompletionProvider extends CompletionProvider<CompletionParameters> {

    @Override
    protected void addCompletions(@NotNull CompletionParameters parameters,
                                  @NotNull ProcessingContext context,
                                  @NotNull CompletionResultSet result) {

      for (String[] completion : RegExpLanguageHosts.getInstance().getPosixCharacterClasses(parameters.getPosition())) {
        result.addElement(
          LookupElementBuilder.create(completion[0]).withTypeText((completion.length > 1) ? completion[1] : null).withIcon(emptyIcon)
            .withInsertHandler(new InsertHandler<>() {
              @Override
              public void handleInsert(@NotNull InsertionContext context, @NotNull LookupElement item) {
                context.setAddCompletionChar(false);
                final Editor editor = context.getEditor();
                final Document document = editor.getDocument();
                final int tailOffset = context.getTailOffset();
                if (document.getTextLength() < tailOffset + 2 ||
                    !document.getText(new TextRange(tailOffset, tailOffset + 2)).equals(":]")) {
                  document.insertString(tailOffset, ":]");
                }
                editor.getCaretModel().moveCaretRelatively(2, 0, false, false, true);
              }
            }));
      }
    }
  }

  private static class PropertyCompletionProvider extends CompletionProvider<CompletionParameters> {

    @Override
    public void addCompletions(@NotNull final CompletionParameters parameters,
                               @NotNull final ProcessingContext context,
                               @NotNull final CompletionResultSet result) {
      for (String[] stringArray : RegExpLanguageHosts.getInstance().getAllKnownProperties(parameters.getPosition())) {
        addLookupElement(result, "{" + stringArray[0] + "}", stringArray.length > 1 ? stringArray[1]:null, PlatformIcons.PROPERTY_ICON);
      }
    }
  }

  private static class CharacterClassesNameCompletionProvider extends CompletionProvider<CompletionParameters> {

    @Override
    public void addCompletions(@NotNull final CompletionParameters parameters,
                               @NotNull final ProcessingContext context,
                               @NotNull final CompletionResultSet result)
    {
      for (final String[] completion : RegExpLanguageHosts.getInstance().getKnownCharacterClasses(parameters.getPosition())) {
        addLookupElement(result, completion[0], completion[1], emptyIcon);
      }

      for (String[] stringArray : RegExpLanguageHosts.getInstance().getAllKnownProperties(parameters.getPosition())) {
        addLookupElement(result, "p{" + stringArray[0] + "}", stringArray.length > 1? stringArray[1]:null, PlatformIcons.PROPERTY_ICON);
      }
    }
  }

  private static class NamedCharacterCompletionProvider extends CompletionProvider<CompletionParameters> {

    private final boolean myEmbrace;

    NamedCharacterCompletionProvider(boolean embrace) {
      myEmbrace = embrace;
    }

    @Override
    protected void addCompletions(@NotNull CompletionParameters parameters,
                                  @NotNull ProcessingContext context,
                                  @NotNull CompletionResultSet result) {
      UnicodeCharacterNames.iterate(name -> {
        if (result.getPrefixMatcher().prefixMatches(name)) {
          final String type = new String(new int[] {UnicodeCharacterNames.getCodePoint(name)}, 0, 1);
          if (myEmbrace) {
            result.addElement(createLookupElement("{" + name + "}", type, emptyIcon));
          }
          else {
            result.addElement(TailTypeDecorator.withTail(createLookupElement(name, type, emptyIcon), TailType.createSimpleTailType('}')));
          }
        }
        ProgressManager.checkCanceled();
      });
    }
  }

  private static class PropertyValueCompletionProvider extends CompletionProvider<CompletionParameters> {
    @Override
    protected void addCompletions(@NotNull CompletionParameters parameters,
                                  @NotNull ProcessingContext context,
                                  @NotNull CompletionResultSet result) {
      RegExpProperty property = ObjectUtils.tryCast(parameters.getPosition().getParent(), RegExpProperty.class);
      ASTNode propertyNameNode = property != null ? property.getCategoryNode() : null;
      if (propertyNameNode == null) {
        return;
      }
      for (String[] value : RegExpLanguageHosts.getInstance().getAllPropertyValues(property, propertyNameNode.getText())) {
        addLookupElement(result, value[0], value.length > 1 ? value[1] : null, null);
      }
    }
  }
}


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Phytologia 28(4): 337 (1974)

#### Original name
Parmelia caperata var. madagascariacea Hue

### Remarks
null


text:
package bdzimmer.pixeleditor.view;

import java.awt.image.BufferedImage                   // scalastyle:ignore illegal.imports
import java.awt.event.{ActionEvent, ActionListener}   // scalastyle:ignore illegal.imports
import java.io.File
import java.util.ArrayList
import javax.swing.JButton

import scala.collection.JavaConverters._
import scala.sys.process._

import bdzimmer.util.{Result, Pass, Fail}
import bdzimmer.util.StringUtils._

import bdzimmer.pixeleditor.model._
import bdzimmer.pixeleditor.controller.OldTilesetLoader

class ScriptLoadWindow(main: Main) extends LoadWidgetWindow(main, main.contentDir, "Load Script Files") {

  def populateObjects(inputDir: String): ArrayList[ImageWidget] = {
    val world = new World(main.contentDir)
    val widgets = world.getScriptFiles.asScala.map(scriptWidget(_))

    val widgetsArrayList = new java.util.ArrayList[ImageWidget]
    widgets.foreach(widgetsArrayList.add(_))
    widgetsArrayList
  }

  private def scriptWidget(scriptFile: ScriptFile): ImageWidget = {

    val mapImages = scriptFile.getMaps.asScala.map(x => {

      val image = for {
        mapFile <- Result.fromFilename(main.contentDir / ContentStructure.MapDir / x + ".map")
        map = new Map(mapFile)
        tilesFile <- Result.fromFilename(
            main.contentDir / ContentStructure.TileDir / map.tileFileName + ".til")
        tiles = new OldTilesetLoader(tilesFile.getPath, TileOptions.getOrQuit("Tiles")).load()
      } yield {
        map.image(tiles, tiles.palettes(0))
      }

      image match {
        case Pass(x) => Some(x)
        case Fail(x) => None
      }

    }).flatten

    val subsetImage = new BufferedImage(
        ImageWidget.DefaultWidth, ImageWidget.DefaultHeight, BufferedImage.TYPE_INT_RGB)

    mapImages.headOption.foreach(x => {
      subsetImage.getGraphics.drawImage(
          x,
          (ImageWidget.DefaultWidth - x.getWidth) / 2,
          (ImageWidget.DefaultHeight - x.getHeight) / 2,
          null)
    })

    val viewer = new JButton("View Maps")
    viewer.addActionListener(new ActionListener() {
      def actionPerformed(event: ActionEvent): Unit = {
        mapImages.foreach(new ImageWindow(_))
      }
    })

    val mapLoader = new JButton("Edit Maps")
    mapLoader.addActionListener(new ActionListener() {
      def actionPerformed(event: ActionEvent): Unit = {

        scriptFile.getMaps.asScala.map(x => {
          val mapFilename = (main.contentDir / ContentStructure.MapDir / x + ".map")
          val map = new Map(new File(mapFilename))
          val tileFilename = (main.contentDir / ContentStructure.TileDir / map.tileFileName + ".til")

          main.createLinkedTileAndMapWindows(tileFilename, mapFilename)

        })
      }
    })

    val scriptLoader = new JButton("Edit Script")
    scriptLoader.addActionListener(new ActionListener() {
      def actionPerformed(event: ActionEvent): Unit = {
        val command =  ("notepad.exe " + main.contentDir /
            ContentStructure.ScriptDir /
            scriptFile.getFileName())
        command.!
      }
    })

    val buttons = List(viewer, mapLoader, scriptLoader)

    new ImageWidget(scriptFile.getTitle, subsetImage, buttons)

  }

}


text:
package javax.swing.event;

// Imports
import java.util.EventListener;

/**
 * AncestorListener Interface
 * @author Andrew Selkirk
 * @author Ronald Veldema
 */
public interface AncestorListener extends EventListener {

	/**
	 * Ancestor Added
	 * @param event Ancestor Event
	 */
	void ancestorAdded(AncestorEvent event);

	/**
	 * Ancestor Removed
	 * @param event Ancestor Event
	 */
	void ancestorRemoved(AncestorEvent event);

	/**
	 * Ancestor Moved
	 * @param event Ancestor Event
	 */
	void ancestorMoved(AncestorEvent event);

} // AncestorListener


text:
package com.consol.citrus;

import com.consol.citrus.config.CitrusSpringConfig;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Context provider registered via resource path lookup. When module is on classpath this provider will be used to instantiate
 * Citrus.
 *
 * Provider creates a CitrusContext that is backed with a Spring application context. Provider caches the last application context
 * that has created a context. When very same application context creates another CitrusContext use the cached instance. This
 * caching should give us some performance improvements and less instance duplications.
 *
 * @author Christoph Deppisch
 */
public class CitrusSpringContextProvider implements CitrusContextProvider {

    private static CitrusSpringContext context;

    private final ApplicationContext applicationContext;

    public CitrusSpringContextProvider() {
        this.applicationContext = null;
    }

    public CitrusSpringContextProvider(Class<? extends CitrusSpringConfig> configClass) {
        this(new AnnotationConfigApplicationContext(configClass));
    }

    public CitrusSpringContextProvider(ApplicationContext applicationContext) {
        this.applicationContext = applicationContext;
    }

    @Override
    public CitrusContext create() {
        if (applicationContext == null) {
            context = CitrusSpringContext.create();
        } else if (context == null) {
            context = CitrusSpringContext.create(applicationContext);
        } else if (!context.getApplicationContext().equals(applicationContext)) {
            context = CitrusSpringContext.create(applicationContext);
        }

        return context;
    }
}