text:
package org.glob3.mobile.generated;
public class SingleBilElevationDataProvider extends ElevationDataProvider
{

  private long _currentRequestID;
  private java.util.HashMap<Long, SingleBilElevationDataProvider_Request> _requestsQueue = new java.util.HashMap<Long, SingleBilElevationDataProvider_Request>();

  private ElevationData _elevationData;
  private boolean _elevationDataResolved;
  private final URL _bilUrl;
  private final Sector _sector ;
  private final int _extentWidth;
  private final int _extentHeight;

  private final double _deltaHeight;

  private void drainQueue()
  {
    if (!_elevationDataResolved)
    {
      ILogger.instance().logError("Trying to drain queue of requests without data.");
      return;
    }

    for (final Long key : _requestsQueue.keySet()) {
      final SingleBilElevationDataProvider_Request r = _requestsQueue.get(key);
      requestElevationData(r._sector, r._extent, r._listener, r._autodeleteListener);
      if (r != null) {
        r.dispose();
      }
    }
    _requestsQueue.clear();
  }

  private long queueRequest(Sector sector, Vector2I extent, IElevationDataListener listener, boolean autodeleteListener)
  {
    _currentRequestID++;
    _requestsQueue.put(_currentRequestID, new SingleBilElevationDataProvider_Request(sector, extent, listener, autodeleteListener));
    return _currentRequestID;
  }

  private void removeQueueRequest(long requestId)
  {
    _requestsQueue.remove(requestId);
  }

  private IDownloader _downloader;
  private long _requestToDownloaderID;
  private SingleBilElevationDataProvider_BufferDownloadListener _listener;

  public SingleBilElevationDataProvider(URL bilUrl, Sector sector, Vector2I extent)
  {
     this(bilUrl, sector, extent, 0);
  }
  public SingleBilElevationDataProvider(URL bilUrl, Sector sector, Vector2I extent, double deltaHeight)
  {
     _bilUrl = bilUrl;
     _sector = new Sector(sector);
     _extentWidth = extent._x;
     _extentHeight = extent._y;
     _deltaHeight = deltaHeight;
     _elevationData = null;
     _elevationDataResolved = false;
     _currentRequestID = 0;
     _downloader = null;
     _requestToDownloaderID = -1;
     _listener = null;

  }

  public void dispose()
  {
    if (_elevationData != null)
       _elevationData.dispose();

    if (_downloader != null && _requestToDownloaderID > -1)
    {
      _downloader.cancelRequest(_requestToDownloaderID);
    }

    if (_listener != null)
    {
      _listener.notifyProviderHasBeenDeleted();
      _listener = null;
    }
  }

  public final boolean isReadyToRender(G3MRenderContext rc)
  {
    return (_elevationDataResolved);
  }

  public final void initialize(G3MContext context)
  {
    if (!_elevationDataResolved || _listener != null)
    {
      _downloader = context.getDownloader();

      _listener = new SingleBilElevationDataProvider_BufferDownloadListener(this, _sector, _extentWidth, _extentHeight, _deltaHeight);

      _requestToDownloaderID = _downloader.requestBuffer(_bilUrl, 2000000000, TimeInterval.fromDays(30), true, _listener, true);
    }
  }

  public final long requestElevationData(Sector sector, Vector2I extent, IElevationDataListener listener, boolean autodeleteListener)
  {
    if (!_elevationDataResolved)
    {
      return queueRequest(sector, extent, listener, autodeleteListener);
    }

    if (_elevationData == null)
    {
      listener.onError(sector, extent);
    }
    else
    {
      //int _DGD_working_on_terrain;
      ElevationData elevationData = new InterpolatedSubviewElevationData(_elevationData, sector, extent);
      listener.onData(sector, extent, elevationData);
    }

    if (autodeleteListener)
    {
      if (listener != null)
         listener.dispose();
    }

    return -1;
  }

  public final void cancelRequest(long requestId)
  {
    if (requestId >= 0)
    {
      removeQueueRequest(requestId);
    }
  }

  public final void onElevationData(ElevationData elevationData)
  {
    _elevationData = elevationData;
    _elevationDataResolved = true;
    if (_elevationData == null)
    {
      ILogger.instance().logError("Can't download Elevation-Data from %s", _bilUrl._path);
    }

    drainQueue();

    _listener = null; //The listener will be autodeleted
  }

  public final java.util.ArrayList<Sector> getSectors()
  {
    final java.util.ArrayList<Sector> sectors = new java.util.ArrayList<Sector>();
    sectors.add(_sector);
    return sectors;
  }

  public final Vector2I getMinResolution()
  {
    return new Vector2I(_extentWidth, _extentHeight);
  }

}


text:
require 'test_helper'

module SocialSignup
  class TwitterUsersHelperTest < ActionView::TestCase
  end
end

redpajama_set_name: RedPajamaGithub


text:
package com.sun.xml.internal.ws.encoding.fastinfoset;

import com.sun.xml.internal.ws.api.pipe.ContentType;
import com.sun.xml.internal.ws.api.pipe.Codec;
import com.sun.xml.internal.ws.api.SOAPVersion;
import com.sun.xml.internal.ws.api.pipe.StreamSOAPCodec;
import com.sun.xml.internal.ws.encoding.ContentTypeImpl;
import com.sun.xml.internal.ws.message.stream.StreamHeader;
import com.sun.xml.internal.ws.message.stream.StreamHeader12;
import com.sun.xml.internal.stream.buffer.XMLStreamBuffer;

import javax.xml.stream.XMLStreamReader;

/**
 * A codec that converts SOAP 1.2 messages infosets to fast infoset
 * documents.
 *
 * @author Paul.Sandoz@Sun.Com
 */
final class FastInfosetStreamSOAP12Codec extends FastInfosetStreamSOAPCodec {
    /*package*/ FastInfosetStreamSOAP12Codec(StreamSOAPCodec soapCodec, boolean retainState) {
        super(soapCodec, SOAPVersion.SOAP_12, retainState,
                (retainState) ? FastInfosetMIMETypes.STATEFUL_SOAP_12 : FastInfosetMIMETypes.SOAP_12);
    }

    private FastInfosetStreamSOAP12Codec(FastInfosetStreamSOAPCodec that) {
        super(that);
    }

    public Codec copy() {
        return new FastInfosetStreamSOAP12Codec(this);
    }

    protected final StreamHeader createHeader(XMLStreamReader reader, XMLStreamBuffer mark) {
        return new StreamHeader12(reader, mark);
    }

    protected ContentType getContentType(String soapAction) {
        if (soapAction == null) {
            return _defaultContentType;
        } else {
            return new ContentTypeImpl(
                    _defaultContentType.getContentType() + ";action=\""+soapAction+"\"");
        }
    }
}


text:
#pragma once

#include "il2cpp-config.h"

#ifndef _MSC_VER
# include <alloca.h>
#else
# include <malloc.h>
#endif

#include <stdint.h>

// Mono.Security.Cryptography.KeyPairPersistence
struct KeyPairPersistence_t165013882;
// Mono.Security.Cryptography.RSAManaged
struct RSAManaged_t3258726067;

#include "mscorlib_System_Security_Cryptography_RSA2466814310.h"

#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winvalid-offsetof"
#pragma clang diagnostic ignored "-Wunused-variable"
#endif

// System.Security.Cryptography.RSACryptoServiceProvider
struct  RSACryptoServiceProvider_t742318033  : public RSA_t2466814310
{
public:
	// Mono.Security.Cryptography.KeyPairPersistence System.Security.Cryptography.RSACryptoServiceProvider::store
	KeyPairPersistence_t165013882 * ___store_2;
	// System.Boolean System.Security.Cryptography.RSACryptoServiceProvider::persistKey
	bool ___persistKey_3;
	// System.Boolean System.Security.Cryptography.RSACryptoServiceProvider::persisted
	bool ___persisted_4;
	// System.Boolean System.Security.Cryptography.RSACryptoServiceProvider::privateKeyExportable
	bool ___privateKeyExportable_5;
	// System.Boolean System.Security.Cryptography.RSACryptoServiceProvider::m_disposed
	bool ___m_disposed_6;
	// Mono.Security.Cryptography.RSAManaged System.Security.Cryptography.RSACryptoServiceProvider::rsa
	RSAManaged_t3258726067 * ___rsa_7;

public:
	inline static int32_t get_offset_of_store_2() { return static_cast<int32_t>(offsetof(RSACryptoServiceProvider_t742318033, ___store_2)); }
	inline KeyPairPersistence_t165013882 * get_store_2() const { return ___store_2; }
	inline KeyPairPersistence_t165013882 ** get_address_of_store_2() { return &___store_2; }
	inline void set_store_2(KeyPairPersistence_t165013882 * value)
	{
		___store_2 = value;
		Il2CppCodeGenWriteBarrier(&___store_2, value);
	}

	inline static int32_t get_offset_of_persistKey_3() { return static_cast<int32_t>(offsetof(RSACryptoServiceProvider_t742318033, ___persistKey_3)); }
	inline bool get_persistKey_3() const { return ___persistKey_3; }
	inline bool* get_address_of_persistKey_3() { return &___persistKey_3; }
	inline void set_persistKey_3(bool value)
	{
		___persistKey_3 = value;
	}

	inline static int32_t get_offset_of_persisted_4() { return static_cast<int32_t>(offsetof(RSACryptoServiceProvider_t742318033, ___persisted_4)); }
	inline bool get_persisted_4() const { return ___persisted_4; }
	inline bool* get_address_of_persisted_4() { return &___persisted_4; }
	inline void set_persisted_4(bool value)
	{
		___persisted_4 = value;
	}

	inline static int32_t get_offset_of_privateKeyExportable_5() { return static_cast<int32_t>(offsetof(RSACryptoServiceProvider_t742318033, ___privateKeyExportable_5)); }
	inline bool get_privateKeyExportable_5() const { return ___privateKeyExportable_5; }
	inline bool* get_address_of_privateKeyExportable_5() { return &___privateKeyExportable_5; }
	inline void set_privateKeyExportable_5(bool value)
	{
		___privateKeyExportable_5 = value;
	}

	inline static int32_t get_offset_of_m_disposed_6() { return static_cast<int32_t>(offsetof(RSACryptoServiceProvider_t742318033, ___m_disposed_6)); }
	inline bool get_m_disposed_6() const { return ___m_disposed_6; }
	inline bool* get_address_of_m_disposed_6() { return &___m_disposed_6; }
	inline void set_m_disposed_6(bool value)
	{
		___m_disposed_6 = value;
	}

	inline static int32_t get_offset_of_rsa_7() { return static_cast<int32_t>(offsetof(RSACryptoServiceProvider_t742318033, ___rsa_7)); }
	inline RSAManaged_t3258726067 * get_rsa_7() const { return ___rsa_7; }
	inline RSAManaged_t3258726067 ** get_address_of_rsa_7() { return &___rsa_7; }
	inline void set_rsa_7(RSAManaged_t3258726067 * value)
	{
		___rsa_7 = value;
		Il2CppCodeGenWriteBarrier(&___rsa_7, value);
	}
};

struct RSACryptoServiceProvider_t742318033_StaticFields
{
public:
	// System.Boolean System.Security.Cryptography.RSACryptoServiceProvider::useMachineKeyStore
	bool ___useMachineKeyStore_8;

public:
	inline static int32_t get_offset_of_useMachineKeyStore_8() { return static_cast<int32_t>(offsetof(RSACryptoServiceProvider_t742318033_StaticFields, ___useMachineKeyStore_8)); }
	inline bool get_useMachineKeyStore_8() const { return ___useMachineKeyStore_8; }
	inline bool* get_address_of_useMachineKeyStore_8() { return &___useMachineKeyStore_8; }
	inline void set_useMachineKeyStore_8(bool value)
	{
		___useMachineKeyStore_8 = value;
	}
};

#ifdef __clang__
#pragma clang diagnostic pop
#endif


text:
export function normalizeDebugBindingName(name: string) {
  // Attribute names with `$` (eg `x-y$`) are valid per spec, but unsupported by some browsers
  name = camelCaseToDashCase(name.replace(/[$@]/g, '_'));
  return `ng-reflect-${name}`;
}

const CAMEL_CASE_REGEXP = /([A-Z])/g;

function camelCaseToDashCase(input: string): string {
  return input.replace(CAMEL_CASE_REGEXP, (...m: any[]) => '-' + m[1].toLowerCase());
}

export function normalizeDebugBindingValue(value: any): string {
  try {
    // Limit the size of the value as otherwise the DOM just gets polluted.
    return value != null ? value.toString().slice(0, 30) : value;
  } catch (e) {
    return '[ERROR] Exception while trying to serialize the value';
  }
}


text:
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

/**
 * Handler for scan related events of DirectoryModel.
 *
 * @param {!DirectoryModel} directoryModel
 * @param {!ListContainer} listContainer
 * @param {!SpinnerController} spinnerController
 * @param {!CommandHandler} commandHandler
 * @param {!FileSelectionHandler} selectionHandler
 * @constructor
 * @struct
 */
function ScanController(
    directoryModel,
    listContainer,
    spinnerController,
    commandHandler,
    selectionHandler) {
  /**
   * @type {!DirectoryModel}
   * @const
   * @private
   */
  this.directoryModel_ = directoryModel;

  /**
   * @type {!ListContainer}
   * @const
   * @private
   */
  this.listContainer_ = listContainer;

  /**
   * @type {!SpinnerController}
   * @const
   * @private
   */
  this.spinnerController_ = spinnerController;

  /**
   * @type {!CommandHandler}
   * @const
   * @private
   */
  this.commandHandler_ = commandHandler;

  /**
   * @type {!FileSelectionHandler}
   * @const
   * @private
   */
  this.selectionHandler_ = selectionHandler;

  /**
   * Whether a scan is in progress.
   * @type {boolean}
   * @private
   */
  this.scanInProgress_ = false;

  /**
   * Whether a scan is updated at least once. If true, spinner should disappear.
   * @type {boolean}
   * @private
   */
  this.scanUpdatedAtLeastOnceOrCompleted_ = false;

  /**
   * Timer ID to delay UI refresh after a scan is completed.
   * @type {number}
   * @private
   */
  this.scanCompletedTimer_ = 0;

  /**
   * Timer ID to delay UI refresh after a scan is updated.
   * @type {number}
   * @private
   */
  this.scanUpdatedTimer_ = 0;

  /**
   * Last value of hosted files disabled.
   * @type {?boolean}
   * @private
   */
  this.lastHostedFilesDisabled_ = null;

  this.directoryModel_.addEventListener(
      'scan-started', this.onScanStarted_.bind(this));
  this.directoryModel_.addEventListener(
      'scan-completed', this.onScanCompleted_.bind(this));
  this.directoryModel_.addEventListener(
      'scan-failed', this.onScanCancelled_.bind(this));
  this.directoryModel_.addEventListener(
      'scan-cancelled', this.onScanCancelled_.bind(this));
  this.directoryModel_.addEventListener(
      'scan-updated', this.onScanUpdated_.bind(this));
  this.directoryModel_.addEventListener(
      'rescan-completed', this.onRescanCompleted_.bind(this));
  chrome.fileManagerPrivate.onPreferencesChanged.addListener(
      this.onPreferencesChanged_.bind(this));
  this.onPreferencesChanged_();
}

/**
 * @private
 */
ScanController.prototype.onScanStarted_ = function() {
  if (this.scanInProgress_)
    this.listContainer_.endBatchUpdates();

  if (this.commandHandler_)
    this.commandHandler_.updateAvailability();

  this.listContainer_.startBatchUpdates();
  this.scanInProgress_ = true;

  this.scanUpdatedAtLeastOnceOrCompleted_ = false;
  if (this.scanCompletedTimer_) {
    clearTimeout(this.scanCompletedTimer_);
    this.scanCompletedTimer_ = 0;
  }

  if (this.scanUpdatedTimer_) {
    clearTimeout(this.scanUpdatedTimer_);
    this.scanUpdatedTimer_ = 0;
  }

  this.spinnerController_.showLater();
};

/**
 * @private
 */
ScanController.prototype.onScanCompleted_ = function() {
  if (!this.scanInProgress_) {
    console.error('Scan-completed event recieved. But scan is not started.');
    return;
  }

  if (this.commandHandler_)
    this.commandHandler_.updateAvailability();
  this.spinnerController_.hide();

  if (this.scanUpdatedTimer_) {
    clearTimeout(this.scanUpdatedTimer_);
    this.scanUpdatedTimer_ = 0;
  }

  // To avoid flickering postpone updating the ui by a small amount of time.
  // There is a high chance, that metadata will be received within 50 ms.
  this.scanCompletedTimer_ = setTimeout(function() {
    // Check if batch updates are already finished by onScanUpdated_().
    if (!this.scanUpdatedAtLeastOnceOrCompleted_) {
      this.scanUpdatedAtLeastOnceOrCompleted_ = true;
    }

    this.scanInProgress_ = false;
    this.listContainer_.endBatchUpdates();
    this.scanCompletedTimer_ = 0;
  }.bind(this), 50);
};

/**
 * @private
 */
ScanController.prototype.onScanUpdated_ = function() {
  if (!this.scanInProgress_) {
    console.error('Scan-updated event recieved. But scan is not started.');
    return;
  }

  if (this.scanUpdatedTimer_ || this.scanCompletedTimer_)
    return;

  // Show contents incrementally by finishing batch updated, but only after
  // 200ms elapsed, to avoid flickering when it is not necessary.
  this.scanUpdatedTimer_ = setTimeout(function() {
    // We need to hide the spinner only once.
    if (!this.scanUpdatedAtLeastOnceOrCompleted_) {
      this.scanUpdatedAtLeastOnceOrCompleted_ = true;
      this.spinnerController_.hide();
    }

    // Update the UI.
    if (this.scanInProgress_) {
      this.listContainer_.endBatchUpdates();
      this.listContainer_.startBatchUpdates();
    }
    this.scanUpdatedTimer_ = 0;
  }.bind(this), 200);
};

/**
 * @private
 */
ScanController.prototype.onScanCancelled_ = function() {
  if (!this.scanInProgress_) {
    console.error('Scan-cancelled event recieved. But scan is not started.');
    return;
  }

  if (this.commandHandler_)
    this.commandHandler_.updateAvailability();
  this.spinnerController_.hide();
  if (this.scanCompletedTimer_) {
    clearTimeout(this.scanCompletedTimer_);
    this.scanCompletedTimer_ = 0;
  }
  if (this.scanUpdatedTimer_) {
    clearTimeout(this.scanUpdatedTimer_);
    this.scanUpdatedTimer_ = 0;
  }
  // Finish unfinished batch updates.
  if (!this.scanUpdatedAtLeastOnceOrCompleted_) {
    this.scanUpdatedAtLeastOnceOrCompleted_ = true;
  }

  this.scanInProgress_ = false;
  this.listContainer_.endBatchUpdates();
};

/**
 * Handle the 'rescan-completed' from the DirectoryModel.
 * @private
 */
ScanController.prototype.onRescanCompleted_ = function() {
  this.selectionHandler_.onFileSelectionChanged();
};

/**
 * Handles preferences change and starts rescan if needed.
 * @private
 */
ScanController.prototype.onPreferencesChanged_ = function() {
  chrome.fileManagerPrivate.getPreferences(function(prefs) {
    if (chrome.runtime.lastError)
      return;
    if (this.lastHostedFilesDisabled_ !== null &&
        this.lastHostedFilesDisabled_ !== prefs.hostedFilesDisabled &&
        this.directoryModel_.isOnDrive()) {
      this.directoryModel_.rescan(false);
    }
    this.lastHostedFilesDisabled_ = prefs.hostedFilesDisabled;
  }.bind(this));
};


text:
DROP PUBLIC SYNONYM EVIDENCE
/

--
-- EVIDENCE  (Synonym)
--
--  Dependencies:
--   EVIDENCE (Column)
--
CREATE PUBLIC SYNONYM EVIDENCE FOR EVIDENCE
/


text:
SYNONYM

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

#### Published in
Mykologia (Prague) 6(2-3): 25 (1929)

#### Original name
Nolanea hirta Velen., 1929

### Remarks
null


text:
package org.openbel.editor.ui.editor;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.ui.editors.text.FileDocumentProvider;

public class BELDocumentProvider extends FileDocumentProvider {

    /**
     * {@inheritDoc}
     */
    @Override
    protected IDocument createDocument(Object element) throws CoreException {
        IDocument document = super.createDocument(element);
        /*
         * if (document != null) { IDocumentPartitioner partitioner = new
         * FastPartitioner(); partitioner.connect(document);
         * document.setDocumentPartitioner(partitioner); }
         */
        return document;
    }

}


text:
package com.wci.umls.server.test.jpa;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import java.util.Date;

import org.apache.log4j.Logger;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import com.wci.umls.server.ProcessExecution;
import com.wci.umls.server.Project;
import com.wci.umls.server.ValidationResult;
import com.wci.umls.server.helpers.ProjectList;
import com.wci.umls.server.jpa.ProcessExecutionJpa;
import com.wci.umls.server.jpa.algo.insert.PreInsertionAlgorithm;
import com.wci.umls.server.jpa.services.ContentServiceJpa;
import com.wci.umls.server.jpa.services.ProcessServiceJpa;
import com.wci.umls.server.services.ContentService;
import com.wci.umls.server.services.ProcessService;
import com.wci.umls.server.test.helpers.IntegrationUnitSupport;

/**
 * Sample test to get auto complete working.
 */
public class PreInsertionAlgorithmTest extends IntegrationUnitSupport {

  /** The algorithm. */
  PreInsertionAlgorithm algo = null;

  /** The process execution. */
  ProcessExecution processExecution = null;

  /** The process service. */
  ProcessService processService = null;

  /** The content service. */
  ContentService contentService = null;

  /** The project. */
  Project project = null;

  /**
   * Setup class.
   */
  @BeforeClass
  public static void setupClass() {
    // do nothing
  }

  /**
   * Setup.
   *
   * @throws Exception the exception
   */
  @Before
  public void setup() throws Exception {

    processService = new ProcessServiceJpa();
    processService.setLastModifiedBy("admin");
    contentService = new ContentServiceJpa();

    // load the project (should be only one)
    ProjectList projects = processService.getProjects();
    assertTrue(projects.size() > 0);
    project = projects.getObjects().get(0);

    // Create a dummy process execution, to store some information the algorithm
    // needs (specifically input Path)
    processExecution = new ProcessExecutionJpa();
    processExecution.setProject(project);
    processExecution.setTerminology(project.getTerminology());
    processExecution.setVersion(project.getVersion());
    processExecution.setDescription("TEST Description");
    processExecution.setName("TEST Name");
    processExecution.setProcessConfigId(1L);
    processExecution.setStartDate(new Date());
    processExecution.setType("Insertion");
    processExecution.setInputPath("terminologies/NCI_INSERT/src");

    //Persist the execution (teardown will remove it later)
    processExecution = processService.addProcessExecution(processExecution);

    // Create and configure the algorithm
    algo = new PreInsertionAlgorithm();

    // Configure the algorithm
    algo.setLastModifiedBy("admin");
    algo.setLastModifiedFlag(true);
    algo.setProcess(processExecution);
    algo.setProject(processExecution.getProject());
    algo.setTerminology("NCI");
    algo.setVersion("2016_05E");

  }

  /**
   * Test pre insertion normal use.
   *
   * @throws Exception the exception
   */
  @Test
  public void testPreInsertion() throws Exception {
    Logger.getLogger(getClass()).info("TEST " + name.getMethodName());

    // Run the PREINSERTION algorithm
    try {

      algo.setTransactionPerOperation(false);
      algo.beginTransaction();

      //
      // Check prerequisites
      //
      ValidationResult validationResult = algo.checkPreconditions();
      // if prerequisites fail, return validation result
      if (!validationResult.getErrors().isEmpty()
          || (!validationResult.getWarnings().isEmpty())) {
        // rollback -- unlocks the concept and closes transaction
        algo.rollback();
      }
      assertTrue(validationResult.getErrors().isEmpty());

      //
      // Perform the algorithm
      //
      algo.compute();

      algo.commit();

      processService.updateProcessExecution(algo.getProcess());

      // Confirm the max Id were stored in the process Execution
      assertNotNull(processExecution.getExecutionInfo());
      assertNotNull(processExecution.getExecutionInfo().get("maxAtomIdPreInsertion"));
      assertNotNull(processExecution.getExecutionInfo().get("maxStyIdPreInsertion"));

    } catch (Exception e) {
      e.printStackTrace();
      fail("Unexpected exception thrown - please review stack trace.");
    } finally {
      algo.close();
    }
  }

  /**
   * Teardown.
   *
   * @throws Exception the exception
   */
  @After
  public void teardown() throws Exception {

    processService = new ProcessServiceJpa();
    processService.setLastModifiedBy("admin");

    processExecution = processService.getProcessExecution(processExecution.getId());
    processService.removeProcessExecution(processExecution.getId());

    processService.close();
    contentService.close();
  }

  /**
   * Teardown class.
   */
  @AfterClass
  public static void teardownClass() {
    // do nothing
  }

}


text:
var CommandExecutorTest = jstestdriver.testCaseManager.TestCase('CommandExecutorTest');

CommandExecutorTest.prototype.testExtractIdFromUrl =  function() {
  assertEquals(1, jstestdriver.extractId("http://server:123/slave/id/1/page/RUNNER"));
};

CommandExecutorTest.prototype.setUp = function() {
  var posts = this.posts = [];
  this.streamingService = new jstestdriver.StreamingService("/Q1",
          function(){ return 1; },
          function (url, data, callback, type){
    posts.push({
      url : url,
      data : data,
      callback : callback,
      type : type
    });
  });
};

CommandExecutorTest.prototype.testFetchCommandNoLibsSendResponseLoop = function() {
  function getBrowserInfo() {
    return new jstestdriver.BrowserInfo(1);
  }

  var executor = new jstestdriver.CommandExecutor(this.streamingService,
          null, null, null, jstestdriver.now, getBrowserInfo);
  executor.registerCommand('execute', executor, executor.execute);

  executor.listen();
  var listenPost = this.posts.pop();
  assertNotNull(listenPost.callback);
  assertEquals("/Q1", listenPost.url);
  assertTrue(listenPost.data.response.start);

  listenPost.callback(JSON.stringify({ 'command': 'execute', 'parameters': [ '1' ] }));
  var executePostOne = this.posts.pop();
  assertEquals("\"1\"", executePostOne.data.response.response);
  assertEquals(listenPost.callback, executePostOne.callback);

  executePostOne.callback(JSON.stringify({ 'command': 'execute', 'parameters': [ '2' ] }));
  var executePostTwo = this.posts.pop();
  assertEquals("\"2\"", executePostTwo.data.response.response);
  assertEquals(listenPost.callback, executePostTwo.callback);
};

CommandExecutorTest.prototype.testConvertJsToJson = function() {
  var callback = {};
  var jquery =  function(_url, _data, _callback) {
    assertEquals("url", _url);
    assertEquals('{"b":"c"}', _data.a);
    assertSame(callback, _callback);
  };
  jstestdriver.convertToJson(jquery)("url", {a: {b:"c"}}, callback);
};

CommandExecutorTest.prototype.testHandleDisconnectionByServer = function() {
  function getBrowserInfo() {
    return new jstestdriver.BrowserInfo(1);
  }

  var url;
  var data;
  var callback;
  var called = 0;
  var executor = new jstestdriver.CommandExecutor(this.streamingService,
                                                  null,
                                                  null,
                                                  null,
                                                  jstestdriver.now,
                                                  getBrowserInfo);
  executor.registerCommand('noop', this.streamingService, this.streamingService.close);
  executor.listen();
  var listenPost = this.posts.pop();
  listenPost.callback('{"command": "noop"}');
  var noopPost = this.posts.pop();
  assertEquals("/Q1", noopPost.url);
  assertEquals({"done":true,"response":null}, noopPost.data);
  assertNotNull(noopPost.callback);
};

//CommandExecutorTest.prototype.testLoadLibsSendResponse = function() {
//  var data;
//  var callback;
//  var url;
//  var executor = new jstestdriver.CommandExecutor(1, "/Q1", function (_url, _data, _callback){
//    url = _url;
//    callback = _callback;
//    data = _data;
//  }, null);
//  var dom = new jstestdriver.MockDOM();
//
//  executor.listen();
//  assertNotNull(callback);
//  executor.loadLibraries(new Array('1.js', '2.js'), dom, function(_dom, _file, _callback) {
//    _callback();
//  });
//  assertNotNull(data);
//  assertEquals("Libraries loaded.", data.response.response);
//};

CommandExecutorTest.prototype.testEvaluateGoodAndBadCommand = function() {
  function getBrowserInfo() {
    return new jstestdriver.BrowserInfo(1);
  }

  var executor = new jstestdriver.CommandExecutor(this.streamingService,
                                                  null,
                                                  null,
                                                  null,
                                                  jstestdriver.now,
                                                  getBrowserInfo);
  var res = executor.evaluateCommand('1+2');

  assertEquals(res, 3);
  res = executor.evaluateCommand('"boom"');
  assertNotNull(res);
};

/*CommandExecutorTest.prototype.testRunAllTestsForTestCase = function() {
  var called = 0;
  var testCalled = false;
  var fakeDate = function() {};

  fakeDate.prototype.getTime = function() {
    return 0
  };
  var testCaseManager = new jstestdriver.TestCaseManager(new jstestdriver.TestRunner({}, fakeDate));
  var executor = new jstestdriver.CommandExecutor(1, "/Q1", function (_url, _data, _callback) {
    called++;
  }, testCaseManager);
  var arr = [];
  var testCase = testCaseManager.TestCase();

  testCase.prototype.testFoo = function() { testCalled = true; };
  arr.push({ 'name': 'testCase' });
  executor.listen();
  executor.runTests(arr);
  assertEquals(2, called);
  assertTrue(testCalled);
};*/

/*CommandExecutorTest.prototype.testRunOneTest = function() {
  var fakeDate = function() {};

  fakeDate.prototype.getTime = function() {
    return 0
  };
  var testCaseManager = new jstestdriver.TestCaseManager(new jstestdriver.TestRunner({}, fakeDate));
  var executor = new jstestdriver.CommandExecutor(1, "/Q1", function (_url, _data, _callback) {
  }, testCaseManager);
  var arr = [];
  var testCase = testCaseManager.TestCase();
  var testFooCalled = false;
  var testBarCalled = false;

  testCase.prototype.testFoo = function() { testFooCalled = true; };
  testCase.prototype.testBar = function() { testBarCalled = true; };
  arr.push({ 'name': 'testCase', 'tests': [ 'testFoo' ] });
  executor.listen();
  executor.runTests(arr);
  assertTrue(testFooCalled);
  assertFalse(testBarCalled);
};
*/

CommandExecutorTest.prototype.testParseJsonAndRunTheRightMethod = function() {
  function getBrowserInfo() {
    return new jstestdriver.BrowserInfo(1);
  }

  var executor = new jstestdriver.CommandExecutor(this.streamingService,
          null,
          null,
          null,
          jstestdriver.now,
          getBrowserInfo);

  var command = {
    fooRang : false,
    'foo' : function(params) {
    this.fooRang = params;
    }
  };
  executor.registerCommand("foo", command, command.foo);
  executor.executeCommand(JSON.stringify({ 'command': 'foo', 'parameters': ['bar'] }));
  assertEquals('bar', command.fooRang[0]);
};


text:
/**
 * Doubled sub-class, form #2.
 */
public class DoubledImplement implements ICommon {
    public DoubledImplement() {
        System.out.println("Ctor: doubled implement, type 2");
    }

    public DoubledImplement getDoubledInstance() {
        return new DoubledImplement();
    }

    public void two() {
        System.out.println("DoubledImplement two");
    }
}


text:
'use babel';
import Editor from './editor/editor';

/**
 * Módulo responsável por macros de comentário
 */
export default class Clipboard {

  activate(rechModule) {
    rechModule.addCommands({
      'rech:copiar-linha': () => this.copiarLinha(),
      'rech:colar-linha': () => this.colarLinha(),
      'rech:duplica-acima': () => this.duplicarAcima(),
      'rech:duplica-abaixo': () => this.duplicarAbaixo()
    });
  }

  /**
   * Copiar linha
   */
  copiarLinha() {
    var editor = new Editor();
    if (editor.getSelectionBuffer() != "") {
      this.setClipboardText(editor.getSelectionBuffer());
    } else {
      this.setClipboardText(editor.getCurrentLine() + "\n");
    }
  }

  /**
   * colar linha
   */
  colarLinha() {
    var editor = new Editor();
    if (this.getClipboardText().endsWith("\n")) {
      editor.gotoLineStart();
    }
    editor.paste();
  }

  /**
   * Define o texto do clipboard
   */
  setClipboardText(text) {
    clipboard = require('electron').clipboard;
    clipboard.writeText(text);
  }

  /**
   * Retorna o texto do clipboard
   */
  getClipboardText() {
    clipboard = require('electron').clipboard;
    return clipboard.readText();
  }

  /**
   * Duplica a linha acima
   */
  duplicarAcima() {
    let editor = new Editor();
    if (editor.getSelectionBuffer() == "") {
      let originalRange = editor.getCursor();
      editor.gotoLineStart();
      editor.insertText(editor.getCurrentLine() + '\n');
      editor.moveUp();
      editor.setCursor([editor.getCurrentRow(), originalRange.column]);
    } else {
      editor.selectWholeLines();
      let range = editor.getSelectionRange();
      let buffer = editor.getRangeBuffer(range);
      editor.setCursor(range.start);
      editor.insertText(buffer);
      editor.setSelectionRange([range.start, editor.getSelectionRange().end]);
    }
  }

  /**
   * Duplica a linha abaixo
   */
  duplicarAbaixo() {
    let editor = new Editor();
    if (editor.getSelectionBuffer() == "") {
      let originalRange = editor.getCursor();
      editor.gotoLineEnd();
      editor.insertText('\n' + editor.getCurrentLine());
      editor.setCursor([editor.getCurrentRow(), originalRange.column]);
    } else {
      editor.selectWholeLines();
      let range = editor.getSelectionRange();
      let buffer = editor.getRangeBuffer(range);
      editor.setCursor(range.end);
      editor.insertText(buffer);
      editor.setSelectionRange([range.end, editor.getSelectionRange().start]);
    }
  }

};


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

<title>F-Index</title>
<meta name="date" content="2017-03-06">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes

A B C D E F G H I K L M N O P Q R S T V W X

F

first() - Method in class com.github.jessemull.microflex.bigdecimalflex.plate.PlateBigDecimal

Returns the first well in the set.

first() - Method in class com.github.jessemull.microflex.bigdecimalflex.plate.StackBigDecimal

Returns the first plate in the set.

first() - Method in class com.github.jessemull.microflex.bigdecimalflex.plate.WellSetBigDecimal

Returns the first well in the set.

first() - Method in class com.github.jessemull.microflex.bigintegerflex.plate.PlateBigInteger

Returns the first well in the set.

first() - Method in class com.github.jessemull.microflex.bigintegerflex.plate.StackBigInteger

Returns the first plate in the set.

first() - Method in class com.github.jessemull.microflex.bigintegerflex.plate.WellSetBigInteger

Returns the first well in the set.

first() - Method in class com.github.jessemull.microflex.doubleflex.plate.PlateDouble

Returns the first well in the set.

first() - Method in class com.github.jessemull.microflex.doubleflex.plate.StackDouble

Returns the first plate in the set.

first() - Method in class com.github.jessemull.microflex.doubleflex.plate.WellSetDouble

Returns the first well in the set.

first() - Method in class com.github.jessemull.microflex.integerflex.plate.PlateInteger

Returns the first well in the set.

first() - Method in class com.github.jessemull.microflex.integerflex.plate.StackInteger

Returns the first plate in the set.

first() - Method in class com.github.jessemull.microflex.integerflex.plate.WellSetInteger

Returns the first well in the set.

floatOverflow(Double) - Static method in class com.github.jessemull.microflex.util.OverFlowUtil

Checks for overflow when converting a double to an float.

floatOverflow(BigDecimal) - Static method in class com.github.jessemull.microflex.util.OverFlowUtil

Checks for overflow when converting a BigDecimal to an float.

floatOverflow(BigInteger) - Static method in class com.github.jessemull.microflex.util.OverFlowUtil

Checks for overflow when converting a BigInteger to an float.

floor(WellBigDecimal) - Method in class com.github.jessemull.microflex.bigdecimalflex.plate.PlateBigDecimal

Returns the greatest well in this set less than or equal to the given
 well, or null if there is no such well.

floor(PlateBigDecimal) - Method in class com.github.jessemull.microflex.bigdecimalflex.plate.StackBigDecimal

Returns the greatest plate in this set less than or equal to the given
 plate, or null if there is no such plate.

floor(WellBigDecimal) - Method in class com.github.jessemull.microflex.bigdecimalflex.plate.WellSetBigDecimal

Returns the greatest well in this set less than or equal to the given
 well, or null if there is no such well.

floor(WellBigInteger) - Method in class com.github.jessemull.microflex.bigintegerflex.plate.PlateBigInteger

Returns the greatest well in this set less than or equal to the given
 well, or null if there is no such well.

floor(PlateBigInteger) - Method in class com.github.jessemull.microflex.bigintegerflex.plate.StackBigInteger

Returns the greatest plate in this set less than or equal to the given
 plate, or null if there is no such plate.

floor(WellBigInteger) - Method in class com.github.jessemull.microflex.bigintegerflex.plate.WellSetBigInteger

Returns the greatest well in this set less than or equal to the given
 well, or null if there is no such well.

floor(WellDouble) - Method in class com.github.jessemull.microflex.doubleflex.plate.PlateDouble

Returns the greatest well in this set less than or equal to the given
 well, or null if there is no such well.

floor(PlateDouble) - Method in class com.github.jessemull.microflex.doubleflex.plate.StackDouble

Returns the greatest plate in this set less than or equal to the given
 plate, or null if there is no such plate.

floor(WellDouble) - Method in class com.github.jessemull.microflex.doubleflex.plate.WellSetDouble

Returns the greatest well in this set less than or equal to the given
 well, or null if there is no such well.

floor(WellInteger) - Method in class com.github.jessemull.microflex.integerflex.plate.PlateInteger

Returns the greatest well in this set less than or equal to the given
 well, or null if there is no such well.

floor(PlateInteger) - Method in class com.github.jessemull.microflex.integerflex.plate.StackInteger

Returns the greatest plate in this set less than or equal to the given
 plate, or null if there is no such plate.

floor(WellInteger) - Method in class com.github.jessemull.microflex.integerflex.plate.WellSetInteger

Returns the greatest well in this set less than or equal to the given
 well, or null if there is no such well.

A B C D E F G H I K L M N O P Q R S T V W X

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Letter

Next Letter

Frames

No Frames

All Classes


text:
rm -rf ./package
dotnet pack ./src/GlobalExceptionHandler/GlobalExceptionHandler.csproj -o ./package/ -c release


text:
package boatcraft.compatibility

import java.util

import scala.collection.JavaConversions.asScalaBuffer

import boatcraft.api.boat.ItemCustomBoat
import boatcraft.api.modifiers.Block
import boatcraft.api.modifiers.Material
import boatcraft.compatibility.vanilla.VanillaGuiHandler
import boatcraft.compatibility.vanilla.modifiers.blocks.Chest
import boatcraft.compatibility.vanilla.modifiers.blocks.Furnace
import boatcraft.compatibility.vanilla.modifiers.blocks.TNT
import boatcraft.compatibility.vanilla.modifiers.blocks.Workbench
import boatcraft.compatibility.vanilla.modifiers.materials.crystal.Diamond
import boatcraft.compatibility.vanilla.modifiers.materials.crystal.Emerald
import boatcraft.compatibility.vanilla.modifiers.materials.crystal.Obsidian
import boatcraft.compatibility.vanilla.modifiers.materials.metal.Gold
import boatcraft.compatibility.vanilla.modifiers.materials.metal.Iron
import boatcraft.compatibility.vanilla.modifiers.materials.wood.Acacia
import boatcraft.compatibility.vanilla.modifiers.materials.wood.Birch
import boatcraft.compatibility.vanilla.modifiers.materials.wood.DarkOak
import boatcraft.compatibility.vanilla.modifiers.materials.wood.Jungle
import boatcraft.compatibility.vanilla.modifiers.materials.wood.Oak
import boatcraft.compatibility.vanilla.modifiers.materials.wood.OreDict_Wood
import boatcraft.compatibility.vanilla.modifiers.materials.wood.Spruce
import boatcraft.core.BoatCraft
import boatcraft.core.GUIHandler
import boatcraft.core.utilities.Helper
import cpw.mods.fml.common.Mod
import cpw.mods.fml.common.event.FMLPostInitializationEvent
import cpw.mods.fml.common.event.FMLPreInitializationEvent
import cpw.mods.fml.common.registry.GameRegistry
import net.minecraft.init.Items
import net.minecraft.item.ItemStack
import net.minecraft.item.crafting.CraftingManager
import net.minecraft.item.crafting.IRecipe
import net.minecraft.nbt.NBTTagCompound
import net.minecraftforge.oredict.ShapedOreRecipe

object Vanilla extends CompatModule {

	private var useOreDictWood = false

	var materials = Array[Material]()

	override def doPreInit(event: FMLPreInitializationEvent) {
		readConfig

		replaceBoatRecipe

		GUIHandler.handlerMap.put(code, VanillaGuiHandler)

		if (!useOreDictWood) {
			materials = materials ++ woodMaterials
		}
		else {
			materials = materials ++ List[Material](OreDict_Wood)
		}
		materials = materials ++ metalMaterials
		materials = materials ++ crystalMaterials
	}

	override def doPostInit(event: FMLPostInitializationEvent) {
		val toRemove = new util.ArrayList[IRecipe]

		for (recipe <- CraftingManager.getInstance.getRecipeList) {
			recipe match {
				case recipe: IRecipe if !recipe.isInstanceOf[ShapedOreRecipe] && recipe.getRecipeOutput != null && recipe.getRecipeOutput.stackTagCompound != null && recipe.getRecipeOutput.stackTagCompound.getString("material")
					!= null && recipe.getRecipeOutput.stackTagCompound.getString("material")
					.equals(OreDict_Wood toString) =>
					toRemove add recipe
					log info "Removed non-oredict ore-dict wood boat recipe: " + recipe
				case _ =>
			}
		}

		CraftingManager.getInstance.getRecipeList removeAll toRemove
	}

	override protected def getMaterials = materials

	private val woodMaterials: List[Material] = List[Material](
		Oak,
		Spruce,
		Birch,
		Jungle,
		Acacia,
		DarkOak
	)

	private val metalMaterials: List[Material] = List[Material](
		Iron,
		Gold
	)

	private val crystalMaterials: List[Material] = List[Material](
		Obsidian,
		Diamond,
		Emerald
	)

	override protected def getBlocks =
		Array[Block](
			Chest,
			Furnace,
			Workbench,
			TNT)

	private def replaceBoatRecipe {
		Helper.Recipe.removeRecipe(new ItemStack(Items.boat))

		val stack = new ItemStack(ItemCustomBoat)

		stack.stackTagCompound = new NBTTagCompound
		stack.stackTagCompound setString("material", Oak.toString)
		stack.stackTagCompound setString("block", Block.Empty.toString)

		GameRegistry addShapelessRecipe(stack, Items.boat)
	}

	private def readConfig {
		useOreDictWood = BoatCraft.config get("Vanilla.General", "useOreDictWoods", false,
			"If set to true, the different wood types will not be generated.\n" +
				"Instead, there will be only one \"wood\" Boat") getBoolean false

		if (BoatCraft.config.hasChanged)
			BoatCraft.config.save
	}
}


text:
/**
 * Created by Zack Boman on 1/31/14.
 * UI Router version by Jorick van Hees on 2/27/14.
 * http://www.zackboman.com or tennisgent@gmail.com
 */

(function(){

    var mod = angular.module('routeStyles', ['ui.router']);

    mod.directive('head', ['$rootScope','$compile',
		function($rootScope, $compile){
			return {
				restrict: 'E',
				link: function(scope, elem){
					var html = '<link rel="stylesheet" ng-repeat="(routeCtrl, cssUrl) in routeStyles" ng-href="{{cssUrl}}" >';
					elem.append($compile(html)(scope));
					scope.routeStyles = {};
					$rootScope.$on('$stateChangeStart', function (event, toState, toParams, fromState, fromParams) {

						// Remove old styles
						if(fromState && fromState.views){
							angular.forEach(fromState.views, function(view){
								if(view.css){
									if(!Array.isArray(view.css)){
										view.css = [view.css];
									}
									angular.forEach(view.css, function(sheet){
										delete scope.routeStyles[sheet];
									});
								}
							});
						}

						// Add new styles
						if(toState && toState.views){
							angular.forEach(toState.views, function(view){
								if(view.css){
									if(!Array.isArray(view.css)){
										view.css = [view.css];
									}
									angular.forEach(view.css, function(sheet){
										scope.routeStyles[sheet] = sheet;
									});

								}
							});
						}
					});
				}
			};
		}
	]);

})();


text: Link check program


text:
package com.devexmile.tunetz.radiomaria;

import android.app.Fragment;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.SeekBar;
import android.widget.Toast;

import com.devexmile.tunetz.R;

public class RadioMariaBannerFragment extends Fragment implements OnClickListener {

    boolean mBound = false;
    RadioMariaStreamService mService;
    private ImageView diskImage; // playPause button
    private ImageView playbtn;
    private ImageView pausebtn;
    private SeekBar seekbar;

    /* Defines callbacks for service binding, passed to bindService() */
    private ServiceConnection mConnection = new ServiceConnection() {

        @Override
        public void onServiceConnected(ComponentName className, IBinder service) {

            com.devexmile.tunetz.radiomaria.RadioMariaStreamService.StreamBinder binder = (RadioMariaStreamService.StreamBinder) service;
            mService = binder.getService();
            mBound = true;
        }

        @Override
        public void onServiceDisconnected(ComponentName arg0) {
            mBound = false;
        }

    };

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setRetainInstance(true);

        // Bind to RadioStreamService
        Intent intent = new Intent(getActivity(), RadioMariaStreamService.class)
                .setAction(RadioMariaStreamService.ACTION_PLAY);
        getActivity().getApplicationContext().bindService(intent, mConnection,
                Context.BIND_AUTO_CREATE);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        return inflater.inflate(R.layout.fragment_radiomaria_stream_banner, container,
                false);
    }

    @Override
    public void onViewCreated(View view, Bundle ofJoy) {

        // Initializing widget variables.
        diskImage = (ImageView) view.findViewById(R.id.maria_diskImage);
        diskImage.setOnClickListener(this);

        playbtn = (ImageView) view.findViewById(R.id.playbtn);
        playbtn.setOnClickListener(this);

        pausebtn = (ImageView) view.findViewById(R.id.pausebtn);
        pausebtn.setOnClickListener(this);

        seekbar = (SeekBar) view.findViewById(R.id.seekBar);
        seekbar.setClickable(false);

    }

    // If the stream is not paused, pause. Else, start.
    public void playPause(View V) {
        //Show a toast if the stream is still loading
        if (!mService.isLoaded()) {
            Toast.makeText(getActivity(), "Loading Stream ...",
                    Toast.LENGTH_LONG).show();
            //pause the stream and stop the animation if it is playing
        } else {
            if ((mService.isPlaying())) {
                mService.pauseStream();
                diskImage.clearAnimation();
                playbtn.setVisibility(View.VISIBLE);
                pausebtn.setVisibility(View.INVISIBLE);

                //otherwise play the stream
            } else {
                mService.playStream();
                diskImage.startAnimation(AnimationUtils.loadAnimation(
                        getActivity(), R.anim.spin));
                playbtn.setVisibility(View.INVISIBLE);
                pausebtn.setVisibility(View.VISIBLE);

            }
        }
    }

    // toggle play/pause when disk is tapped
    @Override
    public void onClick(View arg0) {
        if (arg0 == diskImage)
            playPause(diskImage);
        else if (arg0 == playbtn)
            playPause(playbtn);
        else if (arg0 == pausebtn)
            playPause(pausebtn);

    }

    // Make sure the stream stops when the fragment is destroyed
    @Override
    public void onDestroy() {
        super.onDestroy();
        if (mBound) {
            //unbind the RadioStreamService before ending
            getActivity().getApplicationContext().unbindService(mConnection);
            mBound = false;
        }
    }
}


text:
package org.pentaho.di.core.reflection;

import org.pentaho.di.core.Condition;
import org.pentaho.di.core.database.DatabaseInterface;
import org.pentaho.di.core.plugins.JobEntryPluginType;
import org.pentaho.di.core.plugins.PluginRegistry;
import org.pentaho.di.core.plugins.StepPluginType;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.List;
import java.util.Map;

public class StringSearcher {
  private static final String LOCAL_PACKAGE = "org.pentaho.di";

  private static final String[] JAVA_PACKAGES = new String[] { "java.util", };

  private static List<String> stepPluginPackages;
  private static List<String> jobEntryPluginPackages;

  static {
    PluginRegistry registry = PluginRegistry.getInstance();
    stepPluginPackages = registry.getPluginPackages( StepPluginType.class );
    jobEntryPluginPackages = registry.getPluginPackages( JobEntryPluginType.class );
  }

  public static final void findMetaData( Object object, int level, List<StringSearchResult> stringList,
    Object parentObject, Object grandParentObject ) {
    // System.out.println(Const.rightPad(" ", level)+"Finding strings in "+object.toString());

    if ( ( object == null ) || level > 5 ) {
      return;
    }

    PluginRegistry registry = PluginRegistry.getInstance();

    if ( stepPluginPackages == null ) {
      stepPluginPackages = registry.getPluginPackages( StepPluginType.class );
    }
    if ( jobEntryPluginPackages == null ) {
      jobEntryPluginPackages = registry.getPluginPackages( JobEntryPluginType.class );
    }

    Class<? extends Object> baseClass = object.getClass();
    Field[] fields = baseClass.getDeclaredFields();
    for ( int i = 0; i < fields.length; i++ ) {
      Field field = fields[i];

      boolean processThisOne = true;

      if ( ( field.getModifiers() & Modifier.FINAL ) > 0 ) {
        processThisOne = false;
      }
      if ( ( field.getModifiers() & Modifier.STATIC ) > 0 ) {
        processThisOne = false;
      }

      // Investigate only if we're dealing with a sanctioned package.
      // A sanctioned package is either the local package (org.pentaho.di) or
      // a package of one of the plugins.
      //
      boolean sanctionedPackage = false;
      String fieldToString = field.toString();
      if ( fieldToString.indexOf( LOCAL_PACKAGE ) >= 0 ) {
        sanctionedPackage = true;
      }
      for ( int x = 0; x < JAVA_PACKAGES.length && !sanctionedPackage; x++ ) {
        if ( fieldToString.indexOf( JAVA_PACKAGES[x] ) >= 0 ) {
          sanctionedPackage = true;
        }
      }
      for ( int x = 0; x < stepPluginPackages.size() && !sanctionedPackage; x++ ) {
        if ( fieldToString.indexOf( stepPluginPackages.get( x ) ) >= 0 ) {
          sanctionedPackage = true;
        }
      }
      for ( int x = 0; x < jobEntryPluginPackages.size() && !sanctionedPackage; x++ ) {
        if ( fieldToString.indexOf( jobEntryPluginPackages.get( x ) ) >= 0 ) {
          sanctionedPackage = true;
        }
      }
      if ( !sanctionedPackage ) {
        processThisOne = false; // Stay in the sanctioned code-base.
      }

      // Dig into the metadata from here...
      //
      if ( processThisOne ) {
        try {
          Object obj = field.get( object );
          if ( obj != null ) {
            stringSearchInObject( obj, level, stringList, parentObject, grandParentObject, field );
          }
        } catch ( IllegalAccessException e ) {
          // OK, it's private, let's see if we can go there later on using
          // getters and setters...
          // fileName becomes: getFileName();
          // OK, how do we get the value now?
          try {

            Method method = findMethod( baseClass, field.getName() );
            if ( method != null ) {
              // String fullMethod =
              // baseClass.getName()+"."+method.getName()+"()";

              Object string = method.invoke( object, (Object[]) null );
              if ( string != null ) {
                stringSearchInObject( string, level, stringList, parentObject, grandParentObject, field );
              }
            }
          } catch ( Throwable ex ) {
            // Ignore this error silently. If we can't access the method there
            // is nothing you can do about it.
          }
        }
      }
    }
  }

  private static void stringSearchInObject( Object obj, int level, List<StringSearchResult> stringList,
    Object parentObject, Object grandParentObject, Field field ) {
    String fieldName = field.getName();
    if ( obj instanceof String ) {
      // OK, let's add the String
      stringList.add( new StringSearchResult( (String) obj, parentObject, grandParentObject, fieldName ) );
    } else if ( obj instanceof String[] ) {
      String[] array = (String[]) obj;
      for ( int x = 0; x < array.length; x++ ) {
        if ( array[x] != null ) {
          stringList.add( new StringSearchResult( array[x], parentObject, grandParentObject, fieldName
            + " #" + ( x + 1 ) ) );
        }
      }
    } else if ( obj instanceof Boolean ) {
      // OK, let's add the String
      stringList.add( new StringSearchResult( ( (Boolean) obj ).toString(), parentObject, grandParentObject, fieldName
        + " (Boolean)" ) );
    } else if ( obj instanceof Condition ) {
      stringList.add( new StringSearchResult( ( (Condition) obj).toString(), parentObject, grandParentObject, fieldName + " (Condition)" ) );
    } else if ( obj instanceof DatabaseInterface ) {
      // Make sure we read the attributes. This is not picked up by default. (getDeclaredFields doesn't pick up
      // inherited fields)
      //
      DatabaseInterface databaseInterface = (DatabaseInterface) obj;
      findMapMetaData(
        databaseInterface.getAttributes(), level + 1, stringList, parentObject, grandParentObject, field );
      findMetaData( obj, level + 1, stringList, parentObject, grandParentObject );
    } else if ( obj instanceof Map ) {
      findMapMetaData( (Map<?, ?>) obj, level, stringList, parentObject, grandParentObject, field );
    } else if ( obj instanceof Object[] ) {
      for ( int j = 0; j < ( (Object[]) obj ).length; j++ ) {
        findMetaData( ( (Object[]) obj )[j], level + 1, stringList, parentObject, grandParentObject );
      }
    } else {
      findMetaData( obj, level + 1, stringList, parentObject, grandParentObject );
    }
  }

  private static void findMapMetaData( Map<?, ?> map, int level, List<StringSearchResult> stringList,
    Object parentObject, Object grandParentObject, Field field ) {

    String fieldName = field.getName();
    for ( Map.Entry entry : map.entrySet() ) {
      Object value = entry.getValue();
      Object key = entry.getKey();
      if ( key != null ) {
        stringList.add( new StringSearchResult( key.toString(), parentObject, grandParentObject, fieldName
          + " (Map key)" ) );
      }
      if ( value != null ) {
        stringList.add( new StringSearchResult( value.toString(), parentObject, grandParentObject, fieldName
          + " (Map value)" ) );
      }
    }
  }

  private static Method findMethod( Class<? extends Object> baseClass, String name ) {
    // baseClass.getMethod(methodName[m], null);
    Method[] methods = baseClass.getDeclaredMethods();
    Method method = null;

    // getName()
    if ( method == null ) {
      String getter = constructGetter( name );
      method = searchGetter( getter, baseClass, methods );
    }

    // isName()
    if ( method == null ) {
      String getter = constructIsGetter( name );
      method = searchGetter( getter, baseClass, methods );
    }

    // name()
    if ( method == null ) {
      String getter = name;
      method = searchGetter( getter, baseClass, methods );
    }

    return method;

  }

  private static Method searchGetter( String getter, Class<?> baseClass, Method[] methods ) {
    Method method = null;
    try {
      method = baseClass.getMethod( getter );

    } catch ( Exception e ) {
      // Nope try case insensitive.
      for ( int i = 0; i < methods.length; i++ ) {
        String methodName = methods[i].getName();
        if ( methodName.equalsIgnoreCase( getter ) ) {
          return methods[i];
        }
      }

    }

    return method;
  }

  public static final String constructGetter( String name ) {
    StringBuilder buf = new StringBuilder();
    buf.append( "get" );
    buf.append( name.substring( 0, 1 ).toUpperCase() );
    buf.append( name.substring( 1 ) );

    return buf.toString();
  }

  public static final String constructIsGetter( String name ) {
    StringBuilder buf = new StringBuilder();
    buf.append( "is" );
    buf.append( name.substring( 0, 1 ).toUpperCase() );
    buf.append( name.substring( 1 ) );

    return buf.toString();
  }

}


text:
<!doctype html>
<meta charset="utf-8">
<title>Using aliases</title>
<body>
<script src="../pixi.js"></script>
<script>

//Aliases
var Container = PIXI.Container,
    autoDetectRenderer = PIXI.autoDetectRenderer,
    loader = PIXI.loader,
    resources = PIXI.loader.resources,
    TextureCache = PIXI.utils.TextureCache,
    Sprite = PIXI.Sprite;

//Create a Pixi stage and renderer and add the
//renderer.view to the DOM
var stage = new Container(),
    renderer = autoDetectRenderer(256, 256);
document.body.appendChild(renderer.view);

//Use Pixi's built-in `loader` module to load an image
loader
  .add("images/cat.png")
  .load(setup);

//This `setup` function will run when the image has loaded
function setup() {

  //Create the `cat` sprite from the texture
  var cat = new Sprite(resources["images/cat.png"].texture);

  //Add the cat to the stage
  stage.addChild(cat);

  //Render the stage
  renderer.render(stage);
}
</script>
</body>


text:
from __future__ import print_function

with open('./VERSION') as version_file:
    version = version_file.read()

with open('./VERSION_CODE') as version_code_file:
    version_code = version_code_file.read()

print('{version}({version_code})'
    .format(version=version, version_code=version_code)
    .strip()
    .replace('\n', ''), end='')


text:
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Android.OS;
using Android.Views;
using Storm.Mvvm.Bindings;
using Storm.Mvvm.Services;
#if SUPPORT
using Android.Support.V4.App;
#else
using Android.App;
#endif

namespace Storm.Mvvm
{
	public abstract class FragmentBase : Fragment, INotifyPropertyChanged
	{
		private ViewModelBase _viewModel;
		protected ViewModelBase ViewModel
		{
			get { return _viewModel; }
			private set
			{
				if (!Equals(_viewModel, value))
				{
					_viewModel = value;

					if (_activityState == ActivityState.Running && value != null)
					{
						value.OnNavigatedTo(new NavigationArgs(NavigationArgs.NavigationMode.New), ParametersKey);
					}
				}
			}
		}

		protected View RootView { get; private set; }

		public string ParametersKey { get; set; }

		private ActivityState _activityState = ActivityState.Uninitialized;

		public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
		{
			if (RootView != null)
			{
				ViewGroup parent = (ViewGroup)RootView.Parent;
				parent.RemoveView(RootView);
			}
			else
			{
				RootView = CreateView(inflater, container);
			}

			return RootView;
		}

		protected abstract View CreateView(LayoutInflater inflater, ViewGroup container);

		protected abstract ViewModelBase CreateViewModel();

		protected void SetViewModel(ViewModelBase viewModel)
		{
			ViewModel = viewModel;
			BindingProcessor.ProcessBinding(ViewModel, this, GetBindingPaths());
		}

		protected virtual List<BindingObject> GetBindingPaths()
		{
			return new List<BindingObject>();
		}

		#region Lifecycle implementation

		public override void OnStart()
		{
			base.OnStart();
			SetViewModel(CreateViewModel());
			if (ViewModel != null && _activityState != ActivityState.Running)
			{
				ViewModel.OnNavigatedTo(new NavigationArgs(NavigationArgs.NavigationMode.New), ParametersKey);
			}
			_activityState = ActivityState.Running;
		}

		public override void OnResume()
		{
			base.OnResume();
			if (ViewModel != null && _activityState != ActivityState.Running)
			{
				ViewModel.OnNavigatedTo(new NavigationArgs(NavigationArgs.NavigationMode.Back), ParametersKey);
			}
			_activityState = ActivityState.Running;
		}

		public override void OnPause()
		{
			base.OnPause();
			if (ViewModel != null && _activityState != ActivityState.Stopped)
			{
				ViewModel.OnNavigatedFrom(new NavigationArgs(NavigationArgs.NavigationMode.Forward));
			}
			_activityState = ActivityState.Stopped;
		}

		public override void OnStop()
		{
			base.OnStop();
			if (ViewModel != null && _activityState != ActivityState.Stopped)
			{
				ViewModel.OnNavigatedFrom(new NavigationArgs(NavigationArgs.NavigationMode.Back));
			}
			_activityState = ActivityState.Stopped;
		}

		#endregion

		#region INotifyPropertyChanged implementation

		public event PropertyChangedEventHandler PropertyChanged;

		public void RaisePropertyChanged([CallerMemberName] string propertyName = "")
		{
			PropertyChangedEventHandler handler = PropertyChanged;
			if (handler != null)
			{
				handler(this, new PropertyChangedEventArgs(propertyName));
			}
		}

		public bool SetProperty<T>(ref T storage, T value, [CallerMemberName] string propertyName = "")
		{
			if (Equals(storage, value))
			{
				return false;
			}

			storage = value;
			// ReSharper disable once ExplicitCallerInfoArgument : need it here
			RaisePropertyChanged(propertyName);

			return true;
		}

		#endregion
	}
}


text:
package cz.metacentrum.perun.core.impl.modules.attributes;

import cz.metacentrum.perun.core.api.Attribute;
import cz.metacentrum.perun.core.api.AttributeDefinition;
import cz.metacentrum.perun.core.api.AttributesManager;
import cz.metacentrum.perun.core.api.ExtSource;
import cz.metacentrum.perun.core.api.User;
import cz.metacentrum.perun.core.api.UserExtSource;
import cz.metacentrum.perun.core.api.exceptions.ExtSourceNotExistsException;
import cz.metacentrum.perun.core.api.exceptions.InternalErrorException;
import cz.metacentrum.perun.core.api.exceptions.UserExtSourceExistsException;
import cz.metacentrum.perun.core.impl.PerunSessionImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Class for checking logins uniqueness in the namespace and filling fenix-persistent id.
 * It is only storage! Use module login fenix_persistent for access the value.
 *
 */
public class urn_perun_user_attribute_def_def_login_namespace_fenix_persistent_shadow extends urn_perun_user_attribute_def_def_login_namespace {

	private final static Logger log = LoggerFactory.getLogger(urn_perun_user_attribute_def_def_login_namespace_fenix_persistent_shadow.class);
	private final static String extSourceNameFenix = "https://proxy-fenix.pilot.eduteams.org/proxy";
	private final static String domainNameFenix = "@fenix.pilot.eduteams.org";
	private final static String attrNameFenix = "login-namespace:fenix-persistent-shadow";

	/**
	 * Filling implemented for login:namespace:fenix-persistent attribute
	 * Format is: "[hash]@fenix-europe.org" where [hash] represents sha1hash counted from user's id and perun instance id a login-namespace name
	 *
	 * @param perunSession PerunSession
	 * @param user User to fill attribute for
	 * @param attribute Attribute to fill value to
	 * @return Filled attribute
	 * @throws InternalErrorException
	 */
	@Override
	public Attribute fillAttribute(PerunSessionImpl perunSession, User user, AttributeDefinition attribute) throws InternalErrorException {

		Attribute filledAttribute = new Attribute(attribute);

		if (attribute.getFriendlyName().equals(attrNameFenix)) {
			filledAttribute.setValue(sha1HashCount(user, domainNameFenix).toString() + domainNameFenix);
			return filledAttribute;
		} else {
			// without value
			return filledAttribute;
		}
	}

	/**
	 * ChangedAttributeHook() sets UserExtSource with following properties:
	 *  - extSourceType is IdP
	 *  - extSourceName is https://engine.fenix-idp.ics.muni.cz/authentication/idp/metadata
	 *  - user's extSource login is the same as his fenix-persistent attribute
	 *
	 * @param session PerunSession
	 * @param user User to set UserExtSource for
	 * @param attribute Attribute containing fenixID
	 * @throws cz.metacentrum.perun.core.api.exceptions.InternalErrorException
	 */
	@Override
	public void changedAttributeHook(PerunSessionImpl session, User user, Attribute attribute) throws InternalErrorException {
		try {
			String userNamespace = attribute.getFriendlyNameParameter();

			if(userNamespace.equals("fenix-persistent-shadow") && attribute.getValue() != null){
				ExtSource extSource = session.getPerunBl().getExtSourcesManagerBl().getExtSourceByName(session, extSourceNameFenix);
				UserExtSource userExtSource = new UserExtSource(extSource, 0, attribute.getValue().toString());

				session.getPerunBl().getUsersManagerBl().addUserExtSource(session, user, userExtSource);
			}
		} catch (UserExtSourceExistsException ex) {
			log.warn("Fenix IdP external source already exists for the user.", ex);
		} catch (ExtSourceNotExistsException ex) {
			throw new InternalErrorException("IdP external source for fenix doesn't exist.", ex);
		}
	}

	public AttributeDefinition getAttributeDefinition() {
		AttributeDefinition attr = new AttributeDefinition();
		attr.setNamespace(AttributesManager.NS_USER_ATTR_DEF);
		attr.setFriendlyName("login-namespace:fenix-persistent-shadow");
		attr.setDisplayName("FENIX login");
		attr.setType(String.class.getName());
		attr.setDescription("Login for FENIX. Do not use it directly! " +
				"Use \"user:virt:login-namespace:fenix-persistent\" attribute instead.");
		return attr;
	}

}


text:
<?php

namespace Symfony\Component\Security\Core\User;

use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
use Symfony\Component\Security\Core\Exception\UserNotFoundException;

/**
 * Chain User Provider.
 *
 * This provider calls several leaf providers in a chain until one is able to
 * handle the request.
 *
 * @author Johannes M. Schmitt <schmittjoh@gmail.com>
 */
class ChainUserProvider implements UserProviderInterface, PasswordUpgraderInterface
{
    private iterable $providers;

    /**
     * @param iterable<array-key, UserProviderInterface> $providers
     */
    public function __construct(iterable $providers)
    {
        $this->providers = $providers;
    }

    /**
     * @return UserProviderInterface[]
     */
    public function getProviders(): array
    {
        if ($this->providers instanceof \Traversable) {
            return iterator_to_array($this->providers);
        }

        return $this->providers;
    }

    /**
     * @internal for compatibility with Symfony 5.4
     */
    public function loadUserByUsername(string $username): UserInterface
    {
        return $this->loadUserByIdentifier($username);
    }

    public function loadUserByIdentifier(string $identifier): UserInterface
    {
        foreach ($this->providers as $provider) {
            try {
                return $provider->loadUserByIdentifier($identifier);
            } catch (UserNotFoundException) {
                // try next one
            }
        }

        $ex = new UserNotFoundException(sprintf('There is no user with identifier "%s".', $identifier));
        $ex->setUserIdentifier($identifier);
        throw $ex;
    }

    public function refreshUser(UserInterface $user): UserInterface
    {
        $supportedUserFound = false;

        foreach ($this->providers as $provider) {
            try {
                if (!$provider->supportsClass(get_debug_type($user))) {
                    continue;
                }

                return $provider->refreshUser($user);
            } catch (UnsupportedUserException) {
                // try next one
            } catch (UserNotFoundException) {
                $supportedUserFound = true;
                // try next one
            }
        }

        if ($supportedUserFound) {
            $username = $user->getUserIdentifier();
            $e = new UserNotFoundException(sprintf('There is no user with name "%s".', $username));
            $e->setUserIdentifier($username);
            throw $e;
        } else {
            throw new UnsupportedUserException(sprintf('There is no user provider for user "%s". Shouldn\'t the "supportsClass()" method of your user provider return true for this classname?', get_debug_type($user)));
        }
    }

    public function supportsClass(string $class): bool
    {
        foreach ($this->providers as $provider) {
            if ($provider->supportsClass($class)) {
                return true;
            }
        }

        return false;
    }

    public function upgradePassword(PasswordAuthenticatedUserInterface $user, string $newHashedPassword): void
    {
        foreach ($this->providers as $provider) {
            if ($provider instanceof PasswordUpgraderInterface) {
                try {
                    $provider->upgradePassword($user, $newHashedPassword);
                } catch (UnsupportedUserException) {
                    // ignore: password upgrades are opportunistic
                }
            }
        }
    }
}


text:
package org.ocpsoft.rewrite.cdi.expressions;

import javax.enterprise.util.AnnotationLiteral;

public class ResolverLiteral extends AnnotationLiteral<Resolver> implements Resolver {
    private static final long serialVersionUID = -8137340248362361317L;

    public static final Resolver INSTANCE = new ResolverLiteral();
}


text:
define([
	'jquery',
	'underscore',
	'backbone',
	'scripts/models/events/event'
], function($, _, Backbone, Event) {
	return Backbone.Collection.extend({

		//
		// Backbone attributes
		//

		model: Event,

		//
		// overridden Backbone methods
		//

		comparator: function(model) {

			// reverse chronological order
			//
			if (model.has('date')) {
				return -model.get('date').getTime();
			}
		}
	});
});


text:
#include "itkGibbsTrackingFilter.h"

// MITK
#include <itkOrientationDistributionFunction.h>
#include <itkDiffusionQballGeneralizedFaImageFilter.h>
#include <mitkStandardFileLocations.h>
#include <mitkFiberBuilder.h>
#include <mitkMetropolisHastingsSampler.h>
//#include <mitkEnergyComputer.h>
#include <itkTensorImageToQBallImageFilter.h>
#include <mitkGibbsEnergyComputer.h>

// ITK
#include <itkImageDuplicator.h>
#include <itkResampleImageFilter.h>
#include <itkTimeProbe.h>

// MISC
#include <fstream>
// #include <QFile>
#include <tinyxml.h>
#include <math.h>
#include <boost/progress.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>

namespace itk{

template< class ItkQBallImageType >
GibbsTrackingFilter< ItkQBallImageType >::GibbsTrackingFilter():
  m_StartTemperature(0.1),
  m_EndTemperature(0.001),
  m_Iterations(1e9),
  m_CurrentIteration(0.0),
  m_CurrentStep(0),
  m_ParticleWeight(0),
  m_ParticleWidth(0),
  m_ParticleLength(0),
  m_ConnectionPotential(10),
  m_InexBalance(0),
  m_ParticlePotential(0.2),
  m_MinFiberLength(10),
  m_AbortTracking(false),
  m_NumAcceptedFibers(0),
  m_BuildFibers(false),
  m_ProposalAcceptance(0),
  m_CurvatureThreshold(0.7),
  m_DuplicateImage(true),
  m_NumParticles(0),
  m_NumConnections(0),
  m_RandomSeed(-1),
  m_LoadParameterFile(""),
  m_LutPath(""),
  m_IsInValidState(true)
{

}

template< class ItkQBallImageType >
GibbsTrackingFilter< ItkQBallImageType >::~GibbsTrackingFilter()
{

}

// fill output fiber bundle datastructure
template< class ItkQBallImageType >
typename GibbsTrackingFilter< ItkQBallImageType >::FiberPolyDataType GibbsTrackingFilter< ItkQBallImageType >::GetFiberBundle()
{
  if (!m_AbortTracking)
  {
    m_BuildFibers = true;
    while (m_BuildFibers){}
  }

  return m_FiberPolyData;
}

template< class ItkQBallImageType >
void
GibbsTrackingFilter< ItkQBallImageType >
::EstimateParticleWeight()
{
  MITK_INFO << "GibbsTrackingFilter: estimating particle weight";

  float minSpacing;
  if(m_QBallImage->GetSpacing()[0]<m_QBallImage->GetSpacing()[1] && m_QBallImage->GetSpacing()[0]<m_QBallImage->GetSpacing()[2])
    minSpacing = m_QBallImage->GetSpacing()[0];
  else if (m_QBallImage->GetSpacing()[1] < m_QBallImage->GetSpacing()[2])
    minSpacing = m_QBallImage->GetSpacing()[1];
  else
    minSpacing = m_QBallImage->GetSpacing()[2];
  float m_ParticleLength = 1.5*minSpacing;
  float m_ParticleWidth = 0.5*minSpacing;

  // seed random generators
  Statistics::MersenneTwisterRandomVariateGenerator::Pointer randGen = Statistics::MersenneTwisterRandomVariateGenerator::New();
  if (m_RandomSeed>-1)
    randGen->SetSeed(m_RandomSeed);
  else
    randGen->SetSeed();

  // instantiate all necessary components
  SphereInterpolator* interpolator = new SphereInterpolator(m_LutPath);
  // handle lookup table not found cases
  if( !interpolator->IsInValidState() )
  {
    m_IsInValidState = false;
    m_AbortTracking = true;
    m_BuildFibers = false;
    mitkThrow() << "Unable to load lookup tables.";
  }
  ParticleGrid* particleGrid = new ParticleGrid(m_MaskImage, m_ParticleLength, m_ParticleGridCellCapacity);
  GibbsEnergyComputer* encomp = new GibbsEnergyComputer(m_QBallImage, m_MaskImage, particleGrid, interpolator, randGen);

  //    EnergyComputer* encomp = new EnergyComputer(m_QBallImage, m_MaskImage, particleGrid, interpolator, randGen);
  MetropolisHastingsSampler* sampler = new MetropolisHastingsSampler(particleGrid, encomp, randGen, m_CurvatureThreshold);

  float alpha = log(m_EndTemperature/m_StartTemperature);
  m_ParticleWeight = 0.01;
  int ppv = 0;
  // main loop
  int neededParts = 3000;
  while (ppv<neededParts)
  {
    if (ppv<1000)
      m_ParticleWeight /= 2;
    else
      m_ParticleWeight = ppv*m_ParticleWeight/neededParts;

    encomp->SetParameters(m_ParticleWeight,m_ParticleWidth,m_ConnectionPotential*m_ParticleLength*m_ParticleLength,m_CurvatureThreshold,m_InexBalance,m_ParticlePotential);
    for( int step = 0; step < 10; step++ )
    {
      // update temperatur for simulated annealing process
      float temperature = m_StartTemperature * exp(alpha*(((1.0)*step)/((1.0)*10)));
      sampler->SetTemperature(temperature);

      for (unsigned long i=0; i<10000; i++)
        sampler->MakeProposal();
    }
    ppv = particleGrid->m_NumParticles;
    particleGrid->ResetGrid();
  }
  delete sampler;
  delete encomp;
  delete particleGrid;
  delete interpolator;

  MITK_INFO << "GibbsTrackingFilter: finished estimating particle weight";
}

// perform global tracking
template< class ItkQBallImageType >
void GibbsTrackingFilter< ItkQBallImageType >::GenerateData()
{
  TimeProbe preClock; preClock.Start();
  // check if input is qball or tensor image and generate qball if necessary
  if (m_QBallImage.IsNull() && m_TensorImage.IsNotNull())
  {
    TensorImageToQBallImageFilter<float,float>::Pointer filter = TensorImageToQBallImageFilter<float,float>::New();
    filter->SetInput( m_TensorImage );
    filter->Update();
    m_QBallImage = filter->GetOutput();
  }
  else if (m_DuplicateImage) // generate local working copy of QBall image (if not disabled)
  {
    typedef itk::ImageDuplicator< ItkQBallImageType > DuplicateFilterType;
    typename DuplicateFilterType::Pointer duplicator = DuplicateFilterType::New();
    duplicator->SetInputImage( m_QBallImage );
    duplicator->Update();
    m_QBallImage = duplicator->GetOutput();
  }

  // perform mean subtraction on odfs
  typedef ImageRegionIterator< ItkQBallImageType > InputIteratorType;
  InputIteratorType it(m_QBallImage, m_QBallImage->GetLargestPossibleRegion() );
  it.GoToBegin();
  while (!it.IsAtEnd())
  {
    itk::OrientationDistributionFunction<float, QBALL_ODFSIZE> odf(it.Get().GetDataPointer());
    float mean = odf.GetMeanValue();
    odf -= mean;
    it.Set(odf.GetDataPointer());
    ++it;
  }

  // check if mask image is given if it needs resampling
  PrepareMaskImage();

  // load parameter file
  LoadParameters();

  // prepare parameters
  float minSpacing;
  if(m_QBallImage->GetSpacing()[0]<m_QBallImage->GetSpacing()[1] && m_QBallImage->GetSpacing()[0]<m_QBallImage->GetSpacing()[2])
    minSpacing = m_QBallImage->GetSpacing()[0];
  else if (m_QBallImage->GetSpacing()[1] < m_QBallImage->GetSpacing()[2])
    minSpacing = m_QBallImage->GetSpacing()[1];
  else
    minSpacing = m_QBallImage->GetSpacing()[2];

  if(m_ParticleLength == 0)
    m_ParticleLength = 1.5*minSpacing;
  if(m_ParticleWidth == 0)
    m_ParticleWidth = 0.5*minSpacing;

  if(m_ParticleWeight == 0)
    EstimateParticleWeight();

  float alpha = log(m_EndTemperature/m_StartTemperature);

  if (m_CurvatureThreshold < mitk::eps)
    m_CurvatureThreshold = 0;

  // seed random generators
  Statistics::MersenneTwisterRandomVariateGenerator::Pointer randGen = Statistics::MersenneTwisterRandomVariateGenerator::New();
  if (m_RandomSeed>-1)
    randGen->SetSeed(m_RandomSeed);
  else
    randGen->SetSeed();

  // load sphere interpolator to evaluate the ODFs
  SphereInterpolator* interpolator = new SphereInterpolator(m_LutPath);

  // handle lookup table not found cases
  if( !interpolator->IsInValidState() )
  {
    m_IsInValidState = false;
    m_AbortTracking = true;
    m_BuildFibers = false;
    mitkThrow() << "Unable to load lookup tables.";
  }
  // initialize the actual tracking components (ParticleGrid, Metropolis Hastings Sampler and Energy Computer)
  ParticleGrid* particleGrid;
  GibbsEnergyComputer* encomp;
  MetropolisHastingsSampler* sampler;
  try{
    particleGrid = new ParticleGrid(m_MaskImage, m_ParticleLength, m_ParticleGridCellCapacity);
    encomp = new GibbsEnergyComputer(m_QBallImage, m_MaskImage, particleGrid, interpolator, randGen);
    encomp->SetParameters(m_ParticleWeight,m_ParticleWidth,m_ConnectionPotential*m_ParticleLength*m_ParticleLength,m_CurvatureThreshold,m_InexBalance,m_ParticlePotential);
    sampler = new MetropolisHastingsSampler(particleGrid, encomp, randGen, m_CurvatureThreshold);
  }
  catch(...)
  {
    MITK_ERROR  << "Particle grid allocation failed. Not enough memory? Try to increase the particle length.";
    m_IsInValidState = false;
    m_AbortTracking = true;
    m_BuildFibers = false;
    return;
  }

  MITK_INFO << "----------------------------------------";
  MITK_INFO << "Iterations: " << m_Iterations;
  MITK_INFO << "Particle length: " << m_ParticleLength;
  MITK_INFO << "Particle width: " << m_ParticleWidth;
  MITK_INFO << "Particle weight: " << m_ParticleWeight;
  MITK_INFO << "Start temperature: " << m_StartTemperature;
  MITK_INFO << "End temperature: " << m_EndTemperature;
  MITK_INFO << "In/Ex balance: " << m_InexBalance;
  MITK_INFO << "Min. fiber length: " << m_MinFiberLength;
  MITK_INFO << "Curvature threshold: " << m_CurvatureThreshold;
  MITK_INFO << "Random seed: " << m_RandomSeed;
  MITK_INFO << "----------------------------------------";

  // main loop
  preClock.Stop();
  TimeProbe clock; clock.Start();
  m_NumAcceptedFibers = 0;
  m_CurrentIteration = 0;
  bool just_built_fibers = false;
  boost::progress_display disp(m_Iterations);
  if (!m_AbortTracking)
    while (m_CurrentIteration<m_Iterations)
    {
      just_built_fibers = false;
      ++disp;
      m_CurrentIteration++;
      if (m_AbortTracking)
        break;

      // update temperatur for simulated annealing process
      float temperature = m_StartTemperature * exp(alpha*m_CurrentIteration/m_Iterations);
      sampler->SetTemperature(temperature);
      sampler->MakeProposal();

      m_ProposalAcceptance = (float)sampler->GetNumAcceptedProposals()/m_CurrentIteration;
      m_NumParticles = particleGrid->m_NumParticles;
      m_NumConnections = particleGrid->m_NumConnections;

      if (m_AbortTracking)
        break;

      if (m_BuildFibers)
      {
        FiberBuilder fiberBuilder(particleGrid, m_MaskImage);
        m_FiberPolyData = fiberBuilder.iterate(m_MinFiberLength);
        m_NumAcceptedFibers = m_FiberPolyData->GetNumberOfLines();
        m_BuildFibers = false;
        just_built_fibers = true;
      }
    }
  if (!just_built_fibers)
  {
    FiberBuilder fiberBuilder(particleGrid, m_MaskImage);
    m_FiberPolyData = fiberBuilder.iterate(m_MinFiberLength);
    m_NumAcceptedFibers = m_FiberPolyData->GetNumberOfLines();
  }
  clock.Stop();

  delete sampler;
  delete encomp;
  delete interpolator;
  delete particleGrid;
  m_AbortTracking = true;
  m_BuildFibers = false;

  int h = clock.GetTotal()/3600;
  int m = ((int)clock.GetTotal()%3600)/60;
  int s = (int)clock.GetTotal()%60;
  MITK_INFO << "GibbsTrackingFilter: finished gibbs tracking in " << h << "h, " << m << "m and " << s << "s";
  m = (int)preClock.GetTotal()/60;
  s = (int)preClock.GetTotal()%60;
  MITK_INFO << "GibbsTrackingFilter: preparation of the data took " << m << "m and " << s << "s";
  MITK_INFO << "GibbsTrackingFilter: " << m_NumAcceptedFibers << " fibers accepted";

  //    sampler->PrintProposalTimes();

  SaveParameters();
}

template< class ItkQBallImageType >
void GibbsTrackingFilter< ItkQBallImageType >::PrepareMaskImage()
{
  if(m_MaskImage.IsNull())
  {
    MITK_INFO << "GibbsTrackingFilter: generating default mask image";
    m_MaskImage = ItkFloatImageType::New();
    m_MaskImage->SetSpacing( m_QBallImage->GetSpacing() );
    m_MaskImage->SetOrigin( m_QBallImage->GetOrigin() );
    m_MaskImage->SetDirection( m_QBallImage->GetDirection() );
    m_MaskImage->SetRegions( m_QBallImage->GetLargestPossibleRegion() );
    m_MaskImage->Allocate();
    m_MaskImage->FillBuffer(1.0);
  }
  else if ( m_MaskImage->GetLargestPossibleRegion().GetSize()[0]!=m_QBallImage->GetLargestPossibleRegion().GetSize()[0] ||
            m_MaskImage->GetLargestPossibleRegion().GetSize()[1]!=m_QBallImage->GetLargestPossibleRegion().GetSize()[1] ||
            m_MaskImage->GetLargestPossibleRegion().GetSize()[2]!=m_QBallImage->GetLargestPossibleRegion().GetSize()[2] ||
            m_MaskImage->GetSpacing()[0]!=m_QBallImage->GetSpacing()[0] ||
            m_MaskImage->GetSpacing()[1]!=m_QBallImage->GetSpacing()[1] ||
            m_MaskImage->GetSpacing()[2]!=m_QBallImage->GetSpacing()[2] )
  {
    MITK_INFO << "GibbsTrackingFilter: resampling mask image";
    typedef itk::ResampleImageFilter< ItkFloatImageType, ItkFloatImageType, float > ResamplerType;
    ResamplerType::Pointer resampler = ResamplerType::New();
    resampler->SetOutputSpacing( m_QBallImage->GetSpacing() );
    resampler->SetOutputOrigin( m_QBallImage->GetOrigin() );
    resampler->SetOutputDirection( m_QBallImage->GetDirection() );
    resampler->SetSize( m_QBallImage->GetLargestPossibleRegion().GetSize() );

    resampler->SetInput( m_MaskImage );
    resampler->SetDefaultPixelValue(0.0);
    resampler->Update();
    m_MaskImage = resampler->GetOutput();
    MITK_INFO << "GibbsTrackingFilter: resampling finished";
  }
}

// load tracking paramters from xml file (.gtp)
template< class ItkQBallImageType >
bool GibbsTrackingFilter< ItkQBallImageType >::LoadParameters()
{
  m_AbortTracking = true;
  try
  {
    if( m_LoadParameterFile.length()==0 )
    {
      m_AbortTracking = false;
      return true;
    }

    MITK_INFO << "GibbsTrackingFilter: loading parameter file " << m_LoadParameterFile;

    TiXmlDocument doc( m_LoadParameterFile );
    doc.LoadFile();

    TiXmlHandle hDoc(&doc);
    TiXmlElement* pElem;
    TiXmlHandle hRoot(0);

    pElem = hDoc.FirstChildElement().Element();
    hRoot = TiXmlHandle(pElem);
    pElem = hRoot.FirstChildElement("parameter_set").Element();

    string iterations(pElem->Attribute("iterations"));
    m_Iterations = boost::lexical_cast<double>(iterations);

    string particleLength(pElem->Attribute("particle_length"));
    m_ParticleLength = boost::lexical_cast<float>(particleLength);

    string particleWidth(pElem->Attribute("particle_width"));
    m_ParticleWidth = boost::lexical_cast<float>(particleWidth);

    string partWeight(pElem->Attribute("particle_weight"));
    m_ParticleWeight = boost::lexical_cast<float>(partWeight);

    string startTemp(pElem->Attribute("temp_start"));
    m_StartTemperature = boost::lexical_cast<float>(startTemp);

    string endTemp(pElem->Attribute("temp_end"));
    m_EndTemperature = boost::lexical_cast<float>(endTemp);

    string inExBalance(pElem->Attribute("inexbalance"));
    m_InexBalance = boost::lexical_cast<float>(inExBalance);

    string fiberLength(pElem->Attribute("fiber_length"));
    m_MinFiberLength = boost::lexical_cast<float>(fiberLength);

    string curvThres(pElem->Attribute("curvature_threshold"));
    m_CurvatureThreshold = cos(boost::lexical_cast<float>(curvThres)*M_PI/180);
    m_AbortTracking = false;
    MITK_INFO << "GibbsTrackingFilter: parameter file loaded successfully";
    return true;
  }
  catch(...)
  {
    MITK_INFO << "GibbsTrackingFilter: could not load parameter file";
    return false;
  }
}

// save current tracking paramters to xml file (.gtp)
template< class ItkQBallImageType >
bool GibbsTrackingFilter< ItkQBallImageType >::SaveParameters()
{
  try
  {
    if( m_SaveParameterFile.length()==0 )
    {
      MITK_INFO << "GibbsTrackingFilter: no filename specified to save parameters";
      return true;
    }

    MITK_INFO << "GibbsTrackingFilter: saving parameter file " << m_SaveParameterFile;

    TiXmlDocument documentXML;
    TiXmlDeclaration* declXML = new TiXmlDeclaration( "1.0", "", "" );
    documentXML.LinkEndChild( declXML );

    TiXmlElement* mainXML = new TiXmlElement("global_tracking_parameter_file");
    mainXML->SetAttribute("file_version",  "0.1");
    documentXML.LinkEndChild(mainXML);

    TiXmlElement* paramXML = new TiXmlElement("parameter_set");
    paramXML->SetAttribute("iterations", boost::lexical_cast<string>(m_Iterations));
    paramXML->SetAttribute("particle_length", boost::lexical_cast<string>(m_ParticleLength));
    paramXML->SetAttribute("particle_width", boost::lexical_cast<string>(m_ParticleWidth));
    paramXML->SetAttribute("particle_weight", boost::lexical_cast<string>(m_ParticleWeight));
    paramXML->SetAttribute("temp_start", boost::lexical_cast<string>(m_StartTemperature));
    paramXML->SetAttribute("temp_end", boost::lexical_cast<string>(m_EndTemperature));
    paramXML->SetAttribute("inexbalance", boost::lexical_cast<string>(m_InexBalance));
    paramXML->SetAttribute("fiber_length", boost::lexical_cast<string>(m_MinFiberLength));
    paramXML->SetAttribute("curvature_threshold", boost::lexical_cast<string>(m_CurvatureThreshold));
    mainXML->LinkEndChild(paramXML);

    if(!boost::algorithm::ends_with(m_SaveParameterFile, ".gtp"))
      m_SaveParameterFile.append(".gtp");
    documentXML.SaveFile( m_SaveParameterFile );

    MITK_INFO << "GibbsTrackingFilter: parameter file saved successfully";
    return true;
  }
  catch(...)
  {
    MITK_INFO << "GibbsTrackingFilter: could not save parameter file";
    return false;
  }
}

}


text:
from __future__ import unicode_literals

from django.db import models, migrations

class Migration(migrations.Migration):

    dependencies = [
        ('huntserver', '0014_hunt_is_current_hunt'),
    ]

    operations = [
        migrations.AlterField(
            model_name='hunt',
            name='is_current_hunt',
            field=models.BooleanField(default=False),
        ),
    ]


text:
using System;
using System.Data;

namespace NHandlebars.Core
{
	//TODO: implement CachedDataRecord
	internal sealed class CachedDataRecord : IDataRecord
	{
		private readonly IDataRecord _dataRecord;

		public CachedDataRecord(IDataRecord dataRecord)
		{
			_dataRecord = dataRecord;
		}

		public string GetName(int i)
		{
			return _dataRecord.GetName(i);
		}

		public string GetDataTypeName(int i)
		{
			return _dataRecord.GetDataTypeName(i);
		}

		public Type GetFieldType(int i)
		{
			return _dataRecord.GetFieldType(i);
		}

		public object GetValue(int i)
		{
			return _dataRecord.GetValue(i);
		}

		public int GetValues(object[] values)
		{
			return _dataRecord.GetValues(values);
		}

		public int GetOrdinal(string name)
		{
			return _dataRecord.GetOrdinal(name);
		}

		public bool GetBoolean(int i)
		{
			return _dataRecord.GetBoolean(i);
		}

		public byte GetByte(int i)
		{
			return _dataRecord.GetByte(i);
		}

		public long GetBytes(int i, long fieldOffset, byte[] buffer, int bufferoffset, int length)
		{
			return _dataRecord.GetBytes(i, fieldOffset, buffer, bufferoffset, length);
		}

		public char GetChar(int i)
		{
			return _dataRecord.GetChar(i);
		}

		public long GetChars(int i, long fieldoffset, char[] buffer, int bufferoffset, int length)
		{
			return _dataRecord.GetChars(i, fieldoffset, buffer, bufferoffset, length);
		}

		public Guid GetGuid(int i)
		{
			return _dataRecord.GetGuid(i);
		}

		public short GetInt16(int i)
		{
			return _dataRecord.GetInt16(i);
		}

		public int GetInt32(int i)
		{
			return _dataRecord.GetInt32(i);
		}

		public long GetInt64(int i)
		{
			return _dataRecord.GetInt64(i);
		}

		public float GetFloat(int i)
		{
			return _dataRecord.GetFloat(i);
		}

		public double GetDouble(int i)
		{
			return _dataRecord.GetDouble(i);
		}

		public string GetString(int i)
		{
			return _dataRecord.GetString(i);
		}

		public decimal GetDecimal(int i)
		{
			return _dataRecord.GetDecimal(i);
		}

		public DateTime GetDateTime(int i)
		{
			return _dataRecord.GetDateTime(i);
		}

		public IDataReader GetData(int i)
		{
			return _dataRecord.GetData(i);
		}

		public bool IsDBNull(int i)
		{
			return _dataRecord.IsDBNull(i);
		}

		public int FieldCount
		{
			get { return _dataRecord.FieldCount; }
		}

		public object this[int i]
		{
			get { return _dataRecord[i]; }
		}

		public object this[string name]
		{
			get { return _dataRecord[name]; }
		}
	}
}


text:
class Spinach::Features::CreateQuestion < Spinach::FeatureSteps
  include SharedAuthentication
  include SharedPaths
  include SharedTagInterface

  step 'I submit the form with a valid question' do
    fill_in_form
    find(:xpath, '//input[@name="commit"]').click
  end

  step 'I should see the question' do
    assert_path question_path(Question.last)
    assert_text @data[:title]
    assert_text @data[:body] # etc
  end

  step 'I submit the form with question data but without any tags' do
    fill_in_form
    remove_tag
    find(:xpath, '//input[@name="commit"]').click
  end

  step 'I am on the new question page' do
    assert_text 'Ask Question'
  end

  step 'I should see that there is an error with the tags' do
    assert_text 'Question must be tagged'
  end

  private

  def fill_in_form
    @data = FactoryGirl.attributes_for(:question)
    fill_in 'question_title', with: @data[:title]
    fill_in 'question_body', with: @data[:body]
    input_and_add_tags(@data[:tag_list])
  end
end


text:
<?xml version="1.0" encoding="UTF-8"?>
<internode>
    <api>
        <service type='Personal_ADSL' request='usage'>2659798</service>
        <traffic name='total' rollover='2010-02-21' plan-interval='Monthly' quota='50000000000' unit='bytes'>38565393900</traffic>
    </api>
</internode>


text:
	# Powered by Python 2.7

# RUN THIS FROM THE SUPERGRAPH OF THE GRAPH YOU WANT TO STACK
# for the SOD16 hackathon we are interested in projects started in the first 28 months of FP7
# so we run from main

# To cancel the modifications performed by the script
# on the current graph, click on the undo button.

# Some useful keyboards shortcuts :
#   * Ctrl + D : comment selected lines.
#   * Ctrl + Shift + D  : uncomment selected lines.
#   * Ctrl + I : indent selected lines.
#   * Ctrl + Shift + I  : unindent selected lines.
#   * Ctrl + Return  : run script.
#   * Ctrl + F  : find selected text.
#   * Ctrl + R  : replace selected text.
#   * Ctrl + Space  : show auto-completion dialog.

import time
import datetime
from tulip import *

# the updateVisualization(centerViews = True) function can be called
# during script execution to update the opened views

# the pauseScript() function can be called to pause the script execution.
# To resume the script execution, you will have to click on the "Run script " button.

# the runGraphScript(scriptFile, graph) function can be called to launch another edited script on a tlp.Graph object.
# The scriptFile parameter defines the script name to call (in the form [a-zA-Z0-9_]+.py)

# the main(graph) function must be defined
# to run the script on the current graph

# run from the main

# start the clock
start_script = datetime.datetime.now()

def findEdge(node1, node2, graph1, directed = False, create = True):
	'''
   finds an edge connecting two given nodes if it exists,
   if not returns a newly created edge unless stated otherwise
   deals with either directed or undirected graphs
   '''
	e = graph1.existEdge(node1, node2)
	if e.isValid():
		return e
	else:
		if not directed:
			e = graph1.existEdge(node2, node1)
			if e.isValid():
				return e
			else:
				if create:
					e = graph1.addEdge(node1, node2)
					return e
		else:
			if create:
				e = graph1.addEdge(node1, node2)
				return e
			else:
				return None

def main(graph):
	projectsTogether =  graph.getDoubleProperty("projectsTogether")
	moneyTogether = graph.getDoubleProperty('moneyTogether')
	viewLayout =  graph.getLayoutProperty("viewLayout")
	ShortName =  graph.getStringProperty("ShortName")
	acronym =  graph.getStringProperty("acronym")
	call =  graph.getStringProperty("call")
	country =  graph.getStringProperty("country")
	ecMaxContribution =  graph.getDoubleProperty("ecMaxContribution")
	fundingScheme =  graph.getStringProperty("fundingScheme")
	name =  graph.getStringProperty("name")
	name_normal =  graph.getStringProperty("name_normal")
	new_org_id =  graph.getStringProperty("new_org_id")
	numProj =  graph.getDoubleProperty("numProj")
	programme =  graph.getStringProperty("programme")
	projectNode =  graph.getBooleanProperty("projectNode")
	projectReference =  graph.getStringProperty("projectReference")
	projectUrl =  graph.getStringProperty("projectUrl")
	rcn =  graph.getStringProperty("rcn")
	reference =  graph.getStringProperty("reference")
	startDate =  graph.getStringProperty("startDate")
	subprogramme =  graph.getStringProperty("subprogramme")
	topics =  graph.getStringProperty("topics")
	totContribution =  graph.getDoubleProperty("totContribution")
	totalCost =  graph.getDoubleProperty("totalCost")
	viewBorderColor =  graph.getColorProperty("viewBorderColor")
	viewBorderWidth =  graph.getDoubleProperty("viewBorderWidth")
	viewColor =  graph.getColorProperty("viewColor")
	viewFont =  graph.getStringProperty("viewFont")
	viewFontSize =  graph.getIntegerProperty("viewFontSize")
	viewLabel =  graph.getStringProperty("viewLabel")
	viewLabelBorderColor =  graph.getColorProperty("viewLabelBorderColor")
	viewLabelBorderWidth =  graph.getDoubleProperty("viewLabelBorderWidth")
	viewLabelColor =  graph.getColorProperty("viewLabelColor")
	viewLabelPosition =  graph.getIntegerProperty("viewLabelPosition")
	viewMetaGraph =  graph.getGraphProperty("viewMetaGraph")
	viewMetric =  graph.getDoubleProperty("viewMetric")
	viewRotation =  graph.getDoubleProperty("viewRotation")
	viewSelection =  graph.getBooleanProperty("viewSelection")
	viewShape =  graph.getIntegerProperty("viewShape")
	viewSize =  graph.getSizeProperty("viewSize")
	viewSrcAnchorShape =  graph.getIntegerProperty("viewSrcAnchorShape")
	viewSrcAnchorSize =  graph.getSizeProperty("viewSrcAnchorSize")
	viewTexture =  graph.getStringProperty("viewTexture")
	viewTgtAnchorShape =  graph.getIntegerProperty("viewTgtAnchorShape")
	viewTgtAnchorSize =  graph.getSizeProperty("viewTgtAnchorSize")

	# Add the new subgraph and grab the parallel edges graph
	stacked = graph.addSubGraph('stacked')
	nonStacked = graph.getSubGraph('orgsOnly')

	# add all nodes in graph1 to stacked
	for n in nonStacked.getNodes():
		stacked.addNode(n)

	# you go over all edges in nonStacked and add only one edge to stacked
	# also collect the data you are interested in
	for edge in nonStacked.getEdges():
		source = nonStacked.source(edge)
		target = nonStacked.target(edge)
		# source and target are nodes connect
		subEdge = findEdge(source, target, stacked, False, True)
		if subEdge == None: # stacked does not contain any edge between source and target
			subEdge = stacked.addEdge(source, target)
			projectsTogether[subEdge] = 1
			moneyTogether[subEdge] = totalCost[edge]
		# else: stacked already contains an edge - you do not need to include that case
			# since you will have it in subEdge as a result of the call to findEdge
		projectsTogether[subEdge] += 1
		moneyTogether[subEdge] += totalCost[edge]

	end_script = datetime.datetime.now()
	running_time = end_script - start_script
	print ('Executed in ' + str(running_time))


text:
#include <iostream>
#include <string>
#include <vector>

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

int main()
{
    string finalgrade;
    int grade;

    // version1
    /*
    cout << "Input the grade: " << endl;
    while(cin >> grade && grade >= 0 && grade <= 100) {
        finalgrade = (grade > 90) ? "high pass"
                            : (grade > 75) ? "pass"
                            : (grade > 60) ? "low pass" : "fail";
        cout << grade << " belongs to " << finalgrade << endl;
        cout << "Input the grade: " << endl;
    }
    */

    // version2
    cout << "Input the grade: " << endl;
    while(cin >> grade && grade >= 0 && grade <= 100) {
        if(grade > 90)
            finalgrade = "high pass";
        else if(grade > 75)
            finalgrade = "pass";
        else if(grade > 60)
            finalgrade = "low pass";
        else
            finalgrade = "fail";
        cout << grade << " belongs to " << finalgrade << endl;
        cout << "Input the grade: " << endl;
    }

    return 0;
}