text:
	var game = new Phaser.Game(500, 300, Phaser.CANVAS);
var mainState = {
  preload: function(){
          game.load.image("bird", "assets/copter.png");
          game.load.image("pipe", "assets/pipe.png");
          game.load.audio('jump', 'https://res.cloudinary.com/jajoosam/video/upload/v1493550231/jump_kuyusj.wav', "http://res.cloudinary.com/jajoosam/video/upload/v1493620286/jump_bolljl.ogg");
      },
    create: function(){
        game.stage.backgroundColor = "#EEE";
        game.physics.startSystem(Phaser.Physics.ARCADE);
        this.bird = game.add.sprite(100,100, "bird");
        game.physics.arcade.enable(this.bird);
        this.bird.body.gravity.y = 500;
        var spaceKey = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR);
        spaceKey.onDown.add(this.jump, this);
        game.input.onDown.add(this.jump, this);
        this.pipes = game.add.group();
        this.timer = game.time.events.loop(500, this.addRowOfPipes, this);
        this.score = 0;
        this.labelScore = game.add.text(450, 20, "0", { font: "30px VT323", fill: "#3D3D3D" });
        this.jumpSound = game.add.audio('jump');
        this.bird.anchor.setTo(0,0);

    },
    update: function(){
    if (this.bird.y > 300 || this.bird.y<0)
        this.restartGame();
    game.physics.arcade.overlap(
    this.bird, this.pipes, this.hitPipe, null, this);
    if (this.bird.angle < 20)
        this.bird.angle += 1;
    this.score+=1;
    this.labelScore.text = this.score;
    },
    jump: function() {
        if (this.bird.alive == false)
            return;
    // Add a vertical velocity to the bird
        this.bird.body.velocity.y = -175;
        this.jumpSound.play();
        // Create an animation on the bird
        var animation = game.add.tween(this.bird);

        // Change the angle of the bird to -20° in 100 milliseconds
        animation.to({angle: -20}, 100);

        // And start the animation
        animation.start();
},
    hitPipe: function() {
        // If the bird has already hit a pipe, do nothing
        // It means the bird is already falling off the screen
        if (this.bird.alive == false)
            return;

        // Set the alive property of the bird to false
        this.bird.alive = false;

        // Prevent new pipes from appearing
        game.time.events.remove(this.timer);

        // Go through all the pipes, and stop their movement
        this.pipes.forEach(function(p){
            p.body.velocity.x = 0;
        }, this);
    },
// Restart the game
    restartGame: function() {
        // Start the 'main' state, which restarts the game
        game.state.start('main');
    },
    addOnePipe: function(x, y) {
        // Create a pipe at the position x and y
        var pipe = game.add.sprite(x, y, 'pipe');

        // Add the pipe to our previously created group
        this.pipes.add(pipe);

        // Enable physics on the pipe
        game.physics.arcade.enable(pipe);

        // Add velocity to the pipe to make it move left
        pipe.body.velocity.x = -200;

        // Automatically kill the pipe when it's no longer visible
        pipe.checkWorldBounds = true;
        pipe.outOfBoundsKill = true;
    },

    addRowOfPipes: function() {
        // Randomly pick a number between 1 and 5
        // This will be the hole position
        var pos = Math.floor(Math.random() * 9) + 1;

        // Add the 6 pipes
        // With one big hole at position 'hole' and 'hole + 1'
        this.addOnePipe(game.width, pos * 30);
    }

};

    game.state.add("main", mainState);
    game.state.start("main");


text:
package com.intel.analytics.bigdl.torch

import com.intel.analytics.bigdl.nn.Abs
import com.intel.analytics.bigdl.tensor.Tensor

@com.intel.analytics.bigdl.tags.Serial
class AbsSpec extends TorchSpec {
    "A Abs Module " should "generate correct output and grad" in {
    torchCheck()
    val module = new Abs[Double, Double]
    val input = Tensor[Double](2, 1, 2)
    input(Array(1, 1, 1)) = 21
    input(Array(1, 1, 2)) = -29
    input(Array(2, 1, 1)) = -13
    input(Array(2, 1, 2)) = 27

    val gradOutput = Tensor[Double](2, 1, 2)
    gradOutput(Array(1, 1, 1)) = 10
    gradOutput(Array(1, 1, 2)) = -23
    gradOutput(Array(2, 1, 1)) = -10
    gradOutput(Array(2, 1, 2)) = 23

    val start = System.nanoTime()
    val output = module.forward(input)
    val gradInput = module.backward(input, gradOutput)
    val end = System.nanoTime()
    val scalaTime = end - start

    val code = "module = nn.Abs()\n" +
      "output = module:forward(input)\n" +
      "gradInput = module:backward(input,gradOutput)"

    val (luaTime, torchResult) = TH.run(code, Map("input" -> input, "gradOutput" -> gradOutput),
      Array("output", "gradInput"))

    val luaOutput1 = torchResult("output").asInstanceOf[Tensor[Double]]
    val luaOutput2 = torchResult("gradInput").asInstanceOf[Tensor[Double]]

    luaOutput1.map(output, (v1, v2) => {
      assert(Math.abs(v1 - v2) == 0);
      v1
    })
    luaOutput2.map(gradInput, (v1, v2) => {
      assert(Math.abs(v1 - v2) == 0);
      v1
    })

    println("Test case : ReLU, Torch : " + luaTime + " s, Scala : " + scalaTime / 1e9 + " s")

  }
}

redpajama_set_name: RedPajamaGithub


text:
echo "know your build ID and board target
Connect your device to a PC and ensure that Developer mode is enabled. Once you have your
device connected correctly, issue a:
$ adb shell getprop ro.product.board
"
read readline

adb shell getprop ro.product.board

echo "This now provides you the value you need when you create your build
Now determine the version number of your build:
$ adb shell getprop ro.build.version.incremental
"
read readline

adb shell getprop ro.build.version.incremental

echo "Dragonboard APQ8060 Programming Guide
Page 5
BSQUARE Confidential
2.3.2 Building Open Sources
If the build number from your device is M8660AAABQNLYA3136-Dragon, then you can follow
these instructions on building. Otherwise, please contact MDPSupport@bsquare.com for build
instructions, giving them the values obtained in section 2.3.1.
"
read readline

wget https://www.codeaurora.org/patches/quic/la/PATCH_MSM8660_8230_Dragonboard_required_modifications_20110928.tar.gz
tar -xzvf PATCH_MSM8660_8230_Dragonboard_required_modifications_20110928.tar.gz
mkdir 8660_GB_2_3_5_2_AU50
cd 8660_GB_2_3_5_2_AU50
repo init --repo-url=git://codeaurora.org/tools/repo.git -u
git://codeaurora.org/platform/manifest.git -b gingerbread_house -m M8660AAABQNLYA3136.xml
repo sync -j4
source build/envsetup.sh
choosecombo 1 1 msm8660_surf eng
repo start work --all
cd bootable/bootloader/lk/
git am --ignore-whitespace
../../../../patches/local/bootable/bootloader/lk/*.patch
cd ../../../kernel
git am --ignore-whitespace ../../patches/local/kernel/*.patch
cd ..
make -j4 BUILD_NUMBER=M8660AAABQNLYA3136-Dragon


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

/**
 * @fileoverview Polymer element for displaying a bluetooth device in a list.
 */

import 'chrome://resources/cr_elements/cr_action_menu/cr_action_menu.js';
import 'chrome://resources/cr_elements/cr_icon_button/cr_icon_button.js';
import 'chrome://resources/cr_elements/icons.html.js';
import 'chrome://resources/polymer/v3_0/iron-icon/iron-icon.js';
import '../os_icons.js';
import '../../settings_shared.css.js';

import {FocusRowBehavior, FocusRowBehaviorInterface} from 'chrome://resources/js/cr/ui/focus_row_behavior.js';
import {I18nBehavior, I18nBehaviorInterface} from 'chrome://resources/cr_elements/i18n_behavior.js';
import {html, mixinBehaviors, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js';

import {BluetoothPageBrowserProxy, BluetoothPageBrowserProxyImpl} from './bluetooth_page_browser_proxy.js';

/**
 * @constructor
 * @extends {PolymerElement}
 * @implements {I18nBehaviorInterface}
 * @implements {FocusRowBehaviorInterface}
 */
const BluetoothDeviceListItemElementBase =
    mixinBehaviors([I18nBehavior, FocusRowBehavior], PolymerElement);

/** @polymer */
class BluetoothDeviceListItemElement extends
    BluetoothDeviceListItemElementBase {
  static get is() {
    return 'bluetooth-device-list-item';
  }

  static get template() {
    return html`{__html_template__}`;
  }

  static get properties() {
    return {
      /**
       * The bluetooth device.
       * @type {!chrome.bluetooth.Device}
       */
      device: {
        type: Object,
        observer: 'onDeviceChanged_',
      },

      /**
       * The aria-label attribute for the top-level bluetooth-device-list-item
       * element.
       */
      ariaLabel: {
        type: String,
        notify: true,
        computed: 'getAriaLabel_(device)',
      },

      // TODO(crbug.com/1208155) Add managed policy icon that is shown when this
      // flag is true.
      /** @private */
      shouldShowManagedIcon_: {
        type: Boolean,
        value: false,
      },
    };
  }

  /** @override */
  ready() {
    super.ready();

    /** @private {?BluetoothPageBrowserProxy} */
    this.browserProxy_ = BluetoothPageBrowserProxyImpl.getInstance();

    this.setAttribute('role', 'button');
  }

  /** @override */
  disconnectedCallback() {
    super.disconnectedCallback();

    // Fire an event in case the tooltip was previously showing for the managed
    // icon in this item and this item is being removed.
    this.fireTooltipStateChangeEvent_(/*showTooltip=*/ false);
  }

  /**
   * @param {!Event} event
   * @private
   */
  ignoreEnterKey_(event) {
    if (event.key === 'Enter') {
      event.stopPropagation();
    }
  }

  /** @private */
  tryConnect_() {
    if (!this.isDisconnected_(this.device)) {
      return;
    }

    const event = new CustomEvent('device-event', {
      bubbles: true,
      composed: true,
      detail: {
        action: 'connect',
        device: this.device,
      },
    });
    this.dispatchEvent(event);
  }

  /** @private */
  onClick_() {
    this.tryConnect_();
  }

  /**
   * @param {!KeyboardEvent} e
   * @private
   */
  onKeyDown_(e) {
    if (e.key === 'Enter' || e.key === ' ') {
      this.tryConnect_();
      e.preventDefault();
    }
  }

  /**
   * @param {!Event} event
   * @private
   */
  onMenuButtonTap_(event) {
    const button = /** @type {!HTMLElement} */ (event.target);
    const menu = /** @type {!CrActionMenuElement} */ (this.$.dotsMenu);
    menu.showAt(button);
    event.stopPropagation();
  }

  /** @private */
  onConnectActionTap_() {
    const action = this.isDisconnected_(this.device) ? 'connect' : 'disconnect';
    const event = new CustomEvent('device-event', {
      bubbles: true,
      composed: true,
      detail: {
        action: action,
        device: this.device,
      },
    });
    this.dispatchEvent(event);
    /** @type {!CrActionMenuElement} */ (this.$.dotsMenu).close();
  }

  /** @private */
  onRemoveTap_() {
    const event = new CustomEvent('device-event', {
      bubbles: true,
      composed: true,
      detail: {
        action: 'remove',
        device: this.device,
      },
    });
    this.dispatchEvent(event);
    /** @type {!CrActionMenuElement} */ (this.$.dotsMenu).close();
  }

  /**
   * @param {boolean} connected
   * @return {string} The text to display for the connect/disconnect menu item.
   * @private
   */
  getConnectActionText_(connected) {
    return this.i18n(connected ? 'bluetoothDisconnect' : 'bluetoothConnect');
  }

  /**
   * @param {!chrome.bluetooth.Device} device
   * @return {string} The text to display for |device| in the device list.
   * @private
   */
  getDeviceName_(device) {
    return device.name || device.address;
  }

  /**
   * @param {!chrome.bluetooth.Device} device
   * @return {string} The aria label to use for a |device| that will include the
   * device name and device type if known.
   * @private
   */
  getAriaLabel_(device) {
    // We need to turn the device name, connection status and type into a single
    // localized string.
    // The possible device type enum values can be seen here:
    // https://developer.chrome.com/apps/bluetooth#type-Device.
    // The localization id is computed dynamically to avoid maintaining a
    // mapping from the enum string value to the localization id.
    // if device.type is not defined, we fall back to an unknown device string.
    const deviceName = this.getDeviceName_(device);
    const deviceStatus = this.getConnectionStatusText_(device);

    const a11ydeviceNameAndType = (device.type) ?
        this.i18n('bluetoothDeviceType_' + device.type, deviceName) :
        this.i18n('bluetoothDeviceType_unknown', deviceName);
    return this.i18n(
        'bluetoothDeviceWithConnectionStatus', a11ydeviceNameAndType,
        deviceStatus);
  }

  /**
   * @param {!chrome.bluetooth.Device} device
   * @return {string} The text to display the connection status of |device|.
   * @private
   */
  getConnectionStatusText_(device) {
    if (!this.hasConnectionStatusText_(device)) {
      return '';
    }
    if (device.connecting) {
      return this.i18n('bluetoothConnecting');
    }
    if (!device.connected) {
      return this.i18n('bluetoothNotConnected');
    }
    return device.batteryPercentage !== undefined ?
        this.i18n('bluetoothConnectedWithBattery', device.batteryPercentage) :
        this.i18n('bluetoothConnected');
  }

  /**
   * @param {!chrome.bluetooth.Device} device
   * @return {boolean} True if connection status should be shown as the
   *     secondary text of the |device| in device list.
   * @private
   */
  hasConnectionStatusText_(device) {
    return !!(device.paired || device.connecting);
  }

  /**
   * @param {!chrome.bluetooth.Device} device
   * @return {boolean}
   * @private
   */
  isDisconnected_(device) {
    return !device.connected && !device.connecting;
  }

  /**
   * Returns device type icon's ID corresponding to the given device.
   * To be consistent with the Bluetooth device list in system menu, this
   * mapping needs to be synced with ash::tray::GetBluetoothDeviceIcon().
   *
   * @param {!chrome.bluetooth.Device} device
   * @return {string}
   * @private
   */
  getDeviceIcon_(device) {
    switch (device.type) {
      case 'computer':
        return 'cr:computer';
      case 'phone':
        return 'os-settings:smartphone';
      case 'audio':
      case 'carAudio':
        return 'os-settings:headset';
      case 'video':
        return 'cr:videocam';
      case 'joystick':
      case 'gamepad':
        return 'os-settings:gamepad';
      case 'keyboard':
      case 'keyboardMouseCombo':
        return 'os-settings:keyboard';
      case 'tablet':
        return 'os-settings:tablet';
      case 'mouse':
        return 'os-settings:mouse';
      default:
        return device.connected ? 'os-settings:bluetooth-connected' :
                                  'cr:bluetooth';
    }
  }

  /**
   * @param {?chrome.bluetooth.Device} newValue
   * @param {?chrome.bluetooth.Device} oldValue
   * @private
   */
  onDeviceChanged_(newValue, oldValue) {
    if (!newValue) {
      this.shouldShowManagedIcon_ = false;
      return;
    }

    this.browserProxy_.isDeviceBlockedByPolicy(newValue.address)
        .then((isBlocked) => {
          this.shouldShowManagedIcon_ = isBlocked;
          if (!this.shouldShowManagedIcon_) {
            // Fire an event in case the tooltip was previously showing for this
            // icon and this icon now is hidden.
            this.fireTooltipStateChangeEvent_(/*showTooltip=*/ false);
          }
        });
  }

  /** @private */
  onShowTooltip_() {
    this.fireTooltipStateChangeEvent_(/*showTooltip=*/ true);
  }

  /**
   * @param {boolean} showTooltip
   */
  fireTooltipStateChangeEvent_(showTooltip) {
    const event = new CustomEvent('blocked-tooltip-state-change', {
      bubbles: true,
      composed: true,
      detail: {
        address: this.device.address,
        show: showTooltip,
        element: showTooltip ? this.shadowRoot.querySelector('#managedIcon') :
                               undefined,
      },
    });
    this.dispatchEvent(event);
  }
}

customElements.define(
    BluetoothDeviceListItemElement.is, BluetoothDeviceListItemElement);


text:
insert into u_user (username, email, password, enabled, created_by)
values ('admin', 'admin@gmail.com', '$2a$10$Bd7hoFH.zQ7.h1wO5AZ/2OYmnDchOTYPlKcAW2MeHfXAQFc7PTCVK', true, 'admin');

insert into u_role (name, created_by)
values ('ROLE_ADMIN', 'admin');

insert into u_user_role(username, authority)
values ('admin', 'ROLE_ADMIN');

INSERT INTO oauth_client_details(client_id, resource_ids, client_secret, scope,
authorized_grant_types, web_server_redirect_uri, authorities,
access_token_validity, refresh_token_validity, additional_information, autoapprove, created_by)
VALUES ('blog', 'AUTH_SERVER', '$2a$10$Bd7hoFH.zQ7.h1wO5AZ/2OYmnDchOTYPlKcAW2MeHfXAQFc7PTCVK', 'read,write,trust',
'password,refresh_token,openid,implicit', null, 'ROLE_BLOG',
120, 120, null, true, 'admin');


text:
package org.apache.james.mailbox.store.transaction;

import org.apache.james.mailbox.exception.MailboxException;

/**
 * Mapper which execute units of work in a {@link Transaction}
 *
 */
public interface Mapper {

    /**
     * IMAP Request was complete. Cleanup all Request scoped stuff
     */
    public void endRequest();

    /**
     * Execute the given Transaction
     *
     * @param transaction
     * @throws MailboxException
     */
    public <T> T execute(Transaction<T> transaction) throws MailboxException;

    /**
     * Unit of work executed in a Transaction
     *
     */
    public interface Transaction<T> {

        /**
         * Run unit of work in a Transaction and return a value
         *
         * @throws MailboxException
         */
        public T run() throws MailboxException;
    }

    public abstract class VoidTransaction implements Transaction<Void> {

        public final Void run() throws MailboxException {
            runVoid();
            return null;
        }
        public abstract void runVoid() throws MailboxException;

    }
}


text:
int main(int argc, char* argv[]){

  // Set up MPI environment
  int ret = MPI_Init(&argc,&argv);
  if (ret != MPI_SUCCESS) {
    printf("error: could not initialize MPI\n");
    MPI_Abort(MPI_COMM_WORLD, ret);
  }

  // determine name, rank and total number of processes.
  int worldSize, rank;
  MPI_Status stat;
  MPI_Comm_size(MPI_COMM_WORLD, &worldSize);
  MPI_Comm_rank(MPI_COMM_WORLD, &rank);

  // Compute the integral
  const double x_lower_bound = 0.0;
  const double x_upper_bound = 1.0;
  const long nSteps = 100000000;
  const double dx = (x_upper_bound - x_lower_bound)/nSteps;

  double integral = 0.0;
  // Perform only a fraction of the work
  const long iMin = long((rank  ) * double(nSteps)/double(worldSize));
  const long iMax = long((rank+1) * double(nSteps)/double(worldSize));

  for(long i = iMin; i < iMax; i++) {
    //integral using the rectangle method
    const double x = x_lower_bound + dx*(double(i) + 0.5);
    integral += 1.0/sqrt(x) * dx;
  }

  const double analytical_result = (sqrt(x_upper_bound) - sqrt(x_lower_bound))*2;
  const double numerical_result = integral;

  // Report results
  printf("Partial result = %.8f (total result should be %.8f)\n", numerical_result, analytical_result);

  MPI_Finalize();
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;

namespace CRM_Cross_Platform
{
    public partial class KristiaanSin : ContentPage
    {
        public KristiaanSin()
        {
            InitializeComponent();
        }
    }
}


text:
package org.apache.solr.spelling;

import java.util.Collection;
import java.util.Map;

import org.apache.lucene.analysis.Token;
import org.apache.lucene.util.LuceneTestCase.SuppressTempFileChecks;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.params.SpellingParams;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.core.SolrCore;
import org.apache.solr.handler.component.SpellCheckComponent;
import org.apache.solr.search.SolrIndexSearcher;
import org.apache.solr.util.RefCounted;
import org.junit.BeforeClass;
import org.junit.Test;

/**
 * Simple tests for {@link DirectSolrSpellChecker}
 */
@SuppressTempFileChecks(bugUrl = "https://issues.apache.org/jira/browse/SOLR-1877 Spellcheck IndexReader leak bug?")
public class DirectSolrSpellCheckerTest extends SolrTestCaseJ4 {

  private static SpellingQueryConverter queryConverter;

  @BeforeClass
  public static void beforeClass() throws Exception {
    initCore("solrconfig-spellcheckcomponent.xml","schema.xml");
    //Index something with a title
    assertNull(h.validateUpdate(adoc("id", "0", "teststop", "This is a title")));
    assertNull(h.validateUpdate(adoc("id", "1", "teststop", "The quick reb fox jumped over the lazy brown dogs.")));
    assertNull(h.validateUpdate(adoc("id", "2", "teststop", "This is a Solr")));
    assertNull(h.validateUpdate(adoc("id", "3", "teststop", "solr foo")));
    assertNull(h.validateUpdate(adoc("id", "4", "teststop", "another foo")));
    assertNull(h.validateUpdate(commit()));
    queryConverter = new SimpleQueryConverter();
    queryConverter.init(new NamedList());
  }

  @Test
  public void test() throws Exception {
    DirectSolrSpellChecker checker = new DirectSolrSpellChecker();
    NamedList spellchecker = new NamedList();
    spellchecker.add("classname", DirectSolrSpellChecker.class.getName());
    spellchecker.add(SolrSpellChecker.FIELD, "teststop");
    spellchecker.add(DirectSolrSpellChecker.MINQUERYLENGTH, 2); // we will try "fob"

    SolrCore core = h.getCore();
    checker.init(spellchecker, core);

    RefCounted<SolrIndexSearcher> searcher = core.getSearcher();
    Collection<Token> tokens = queryConverter.convert("fob");
    SpellingOptions spellOpts = new SpellingOptions(tokens, searcher.get().getIndexReader());
    SpellingResult result = checker.getSuggestions(spellOpts);
    assertTrue("result is null and it shouldn't be", result != null);
    Map<String, Integer> suggestions = result.get(tokens.iterator().next());
    Map.Entry<String, Integer> entry = suggestions.entrySet().iterator().next();
    assertTrue(entry.getKey() + " is not equal to " + "foo", entry.getKey().equals("foo") == true);
    assertFalse(entry.getValue() + " equals: " + SpellingResult.NO_FREQUENCY_INFO, entry.getValue() == SpellingResult.NO_FREQUENCY_INFO);

    spellOpts.tokens = queryConverter.convert("super");
    result = checker.getSuggestions(spellOpts);
    assertTrue("result is null and it shouldn't be", result != null);
    suggestions = result.get(tokens.iterator().next());
    assertTrue("suggestions is not null and it should be", suggestions == null);
    searcher.decref();
  }

  @Test
  public void testOnlyMorePopularWithExtendedResults() throws Exception {
    assertQ(req("q", "teststop:fox", "qt", "spellCheckCompRH", SpellCheckComponent.COMPONENT_NAME, "true", SpellingParams.SPELLCHECK_DICT, "direct", SpellingParams.SPELLCHECK_EXTENDED_RESULTS, "true", SpellingParams.SPELLCHECK_ONLY_MORE_POPULAR, "true"),
        "//lst[@name='spellcheck']/lst[@name='suggestions']/lst[@name='fox']/int[@name='origFreq']=1",
        "//lst[@name='spellcheck']/lst[@name='suggestions']/lst[@name='fox']/arr[@name='suggestion']/lst/str[@name='word']='foo'",
        "//lst[@name='spellcheck']/lst[@name='suggestions']/lst[@name='fox']/arr[@name='suggestion']/lst/int[@name='freq']=2",
        "//lst[@name='spellcheck']/bool[@name='correctlySpelled']='true'"
    );
  }

}


text:
#ifndef _FILE_LIST_H
#define _FILE_LIST_H

#include "str-list.h"

#ifdef __cplusplus
extern "C" {
#endif

/* Read list of filenames from a file.
   One filename per line.  Lines starting with # and whitespace lines are
   ignored.  Trailing whitespace is removed.  */
extern string_list_ty *read_names_from_file (const char *file_name);

#ifdef __cplusplus
}
#endif

#endif /* _FILE_LIST_H */


text:
#ifndef _DEF_BF518_H
#define _DEF_BF518_H

/* BF518 is BF516 + IEEE-1588 */
#include "defBF516.h"

/* PTP TSYNC Registers */

#define EMAC_PTP_CTL                   0xFFC030A0 /* PTP Block Control */
#define EMAC_PTP_IE                    0xFFC030A4 /* PTP Block Interrupt Enable */
#define EMAC_PTP_ISTAT                 0xFFC030A8 /* PTP Block Interrupt Status */
#define EMAC_PTP_FOFF                  0xFFC030AC /* PTP Filter offset Register */
#define EMAC_PTP_FV1                   0xFFC030B0 /* PTP Filter Value Register 1 */
#define EMAC_PTP_FV2                   0xFFC030B4 /* PTP Filter Value Register 2 */
#define EMAC_PTP_FV3                   0xFFC030B8 /* PTP Filter Value Register 3 */
#define EMAC_PTP_ADDEND                0xFFC030BC /* PTP Addend for Frequency Compensation */
#define EMAC_PTP_ACCR                  0xFFC030C0 /* PTP Accumulator for Frequency Compensation */
#define EMAC_PTP_OFFSET                0xFFC030C4 /* PTP Time Offset Register */
#define EMAC_PTP_TIMELO                0xFFC030C8 /* PTP Precision Clock Time Low */
#define EMAC_PTP_TIMEHI                0xFFC030CC /* PTP Precision Clock Time High */
#define EMAC_PTP_RXSNAPLO              0xFFC030D0 /* PTP Receive Snapshot Register Low */
#define EMAC_PTP_RXSNAPHI              0xFFC030D4 /* PTP Receive Snapshot Register High */
#define EMAC_PTP_TXSNAPLO              0xFFC030D8 /* PTP Transmit Snapshot Register Low */
#define EMAC_PTP_TXSNAPHI              0xFFC030DC /* PTP Transmit Snapshot Register High */
#define EMAC_PTP_ALARMLO               0xFFC030E0 /* PTP Alarm time Low */
#define EMAC_PTP_ALARMHI               0xFFC030E4 /* PTP Alarm time High */
#define EMAC_PTP_ID_OFF                0xFFC030E8 /* PTP Capture ID offset register */
#define EMAC_PTP_ID_SNAP               0xFFC030EC /* PTP Capture ID register */
#define EMAC_PTP_PPS_STARTLO           0xFFC030F0 /* PPS Start Time Low */
#define EMAC_PTP_PPS_STARTHI           0xFFC030F4 /* PPS Start Time High */
#define EMAC_PTP_PPS_PERIOD            0xFFC030F8 /* PPS Count Register */

/* Bit masks for EMAC_PTP_CTL */

#define                    PTP_EN  0x1        /* Enable the PTP_TSYNC module */
#define                        TL  0x2        /* Timestamp lock control */
#define                      ASEN  0x10       /* Auxiliary snapshot control */
#define                     PPSEN  0x80       /* Pulse-per-second (PPS) control */
#define                     CKOEN  0x2000     /* Clock output control */

/* Bit masks for EMAC_PTP_IE */

#define                      ALIE  0x1        /* Alarm interrupt enable */
#define                     RXEIE  0x2        /* Receive event interrupt enable */
#define                     RXGIE  0x4        /* Receive general interrupt enable */
#define                      TXIE  0x8        /* Transmit interrupt enable */
#define                     RXOVE  0x10       /* Receive overrun error interrupt enable */
#define                     TXOVE  0x20       /* Transmit overrun error interrupt enable */
#define                      ASIE  0x40       /* Auxiliary snapshot interrupt enable */

/* Bit masks for EMAC_PTP_ISTAT */

#define                       ALS  0x1        /* Alarm status */
#define                      RXEL  0x2        /* Receive event interrupt status */
#define                      RXGL  0x4        /* Receive general interrupt status */
#define                      TXTL  0x8        /* Transmit snapshot status */
#define                      RXOV  0x10       /* Receive snapshot overrun status */
#define                      TXOV  0x20       /* Transmit snapshot overrun status */
#define                       ASL  0x40       /* Auxiliary snapshot interrupt status */

#endif /* _DEF_BF518_H */


text:
#include "ParseHelper.h"
#include <string>
#include <sstream>
const std::string ParseHelper::BracketParseState::OpeningBrackets = "[({";
const std::string ParseHelper::BracketParseState::ClosingBrackets = "])}";

bool ParseHelper::BracketParseState::HasOpenBrackets(const std::string& str)
{
    std::list<char> brackets;
    bool hasOpenBrackets = LoadBrackets(str, &brackets);
    return hasOpenBrackets;
}

bool ParseHelper::BracketParseState::LoadBrackets(const std::string& str,
    std::list<char>* stack)
{
    if ( !stack )
        return false;

    stack->clear();
    for (int i = 0; i < str.size(); ++i)
    {
        if (OpeningBrackets.find_first_of(str[i]) != std::string::npos)
        {
            stack->push_back(str[i]);
        }
        else
        {
            size_t t = ClosingBrackets.find_first_of(str[i]);
            if (t != std::string::npos)
            {
                if (t != OpeningBrackets.find_first_of(stack->back()))
                    return false;
                stack->pop_back();
            }
        }
    }
    return stack->size();
}

ParseHelper::BracketParseState::BracketParseState( ParseHelper& parent, const std::string& firstLine ):
    ParseState( parent )
{
    bool hasOpenBrackets = LoadBrackets( firstLine, &brackets );
    assert( hasOpenBrackets );
    m_buffer.push_back( firstLine );
}

bool ParseHelper::BracketParseState::process(const std::string& str)
{
#ifndef NDEBUG
    std::cout << "(BracketParseState) processing " << str << "\n";
#endif
    // update brackets stack
    for (int i = 0; i < str.size(); ++i)
    {
        if (OpeningBrackets.find_first_of(str[i]) != std::string::npos)
        {
#ifndef NDEBUG
            std::cout << "push " << str[i] << "\n";
#endif
            brackets.push_back(str[i]);
        }
        else
        {
            size_t t = ClosingBrackets.find_first_of(str[i]);
            if (t != std::string::npos)
            {
#ifndef NDEBUG
                std::cout << "pop " << str[i] << "\n";
#endif
                // reset state if unmatched brackets seen
                if (t != OpeningBrackets.find_first_of(brackets.back()))
                {
                    parent.reset( );
                    ParseMessage msg(1, "Invalid syntax");
                    parent.broadcast( msg );
                    return true;
                }
                brackets.pop_back();
            }
        }
    }

    // if we've cleared the stack, we've finished accepting input here
    if (!brackets.size())
    {
        // squash buffered lines and place it on parent::commandBuffer
        std::stringstream ss;
        for (std::list<std::string>::const_iterator it = m_buffer.begin();
            it != m_buffer.end(); ++it )
        {
            ss << *it << "\n";
        }
        ss << str;
        parent.commandBuffer.push_back(ss.str());
        parent.stateStack.pop_back( );
        return false;
    }
    else
    {
        // buffer and expect more lines
        m_buffer.push_back( str );
        return true;
    }
}


text:
identifier: MIR:00000041
name: UniParc
description: The UniProt Archive (UniParc) is a  database containing non-redundant protein sequence information from many sources. Each unique sequence is given a stable and unique identifier (UPI) making it possible to identify the same protein from different source databases.
prefix: uniparc
pattern: ^UPI[A-F0-9]{10}$
prefixed: 0
local_id: UPI000000000A
resources:
 - identifier: MIR:00100069
   accessurl: http://www.ebi.ac.uk/cgi-bin/dbfetch?db=uniparc&id=${lid}
   keyword: MAETKEFKTLYNLFIDSYLQKLAQHSIPTNVTCAIHIGEVIGQFKNCALRITNKCMSNSR
   description: UniProt Archive (UniParc)
   homepage: http://www.ebi.ac.uk/uniparc/
   institution: European Bioinformatics Institute, Hinxton, Cambridge
   location: UK
   official: false
   provider_code: ebi
 - identifier: MIR:00100476
   accessurl: http://www.uniprot.org/uniparc/${lid}
   keyword: MAETKEFKTLYNLFIDSYLQKLAQHSIPTNVTCAIHIGEVIGQFKNCALRI
   description: UniParc through UniProt
   homepage: http://www.uniprot.org/uniparc/
   institution: UniProt Consortium
   location: USA, UK and Switzerland
   official: false
---


text:
<?php
/**
 * @author blutze-media
 * @since 2021-09-23
 */

/**
 * @author blutze-media
 * @since 2021-09-22
 */

namespace Enhavo\Bundle\BlockBundle\Maker\Generator;

class DoctrineOrmRelation
{
    /** @var string */
    private $name;

    /** @var array */
    private $config;

    /**
     * @param string $name
     * @param array $config
     */
    public function __construct(string $name, array $config)
    {
        $this->name = $name;
        $this->config = $config;
    }

    public function getType(): ?string
    {
        return $this->config['type'] ?? null;
    }

    public function getInversedBy(): ?string
    {
        return $this->config['inversed_by'] ?? null;
    }

    public function getMappedBy(): ?string
    {
        return $this->config['mapped_by'] ?? null;
    }

    public function getOrderBy(): ?array
    {
        return $this->config['order_by'] ?? null;
    }

    public function getTargetEntity(): ?string
    {
        return $this->config['target_entity'] ?? null;
    }

    public function getName(): string
    {
        return $this->name;
    }

    public function getOrderByString(): string
    {
        return $this->arrayToString($this->getOrderBy(), 16);
    }

    private function arrayToString(?array $array, int $indentation = 8): string
    {
        if (null === $array) {
            return 'null';
        }

        $lines = [];
        $lines[] = '';

        foreach ($array as $key => $item) {
            if (is_array($item)) {
                $lines[] = $this->arrayToString($item, $indentation+4);
            } else {
                $lines[] = sprintf("%s%s: %s", str_repeat(' ', $indentation), $key, $item);
            }
        }

        return implode("\n", $lines);
    }
}


text:
require 'spec_helper'

describe API::API do
  include ApiHelpers

  let(:user)  { create(:user) }
  let(:admin) { create(:admin) }
  let(:key)   { create(:key, user: user) }

  describe "GET /users" do
    context "when unauthenticated" do
      it "should return authentication error" do
        get api("/users")
        response.status.should == 401
      end
    end

    context "when authenticated" do
      it "should return an array of users" do
        get api("/users", user)
        response.status.should == 200
        json_response.should be_an Array
        json_response.first['email'].should == user.email
      end
    end
  end

  describe "GET /users/:id" do
    it "should return a user by id" do
      get api("/users/#{user.id}", user)
      response.status.should == 200
      json_response['email'].should == user.email
    end

    it "should return a 401 if unauthenticated" do
      get api("/users/9998")
      response.status.should == 401
    end

    it "should return a 404 error if user id not found" do
      get api("/users/9999", user)
      response.status.should == 404
    end
  end

  describe "POST /users" do
    before{ admin }

    it "should create user" do
      expect {
        post api("/users", admin), attributes_for(:user, projects_limit: 3)
      }.to change { User.count }.by(1)
    end

    it "should return 201 Created on success" do
      post api("/users", admin), attributes_for(:user, projects_limit: 3)
      response.status.should == 201
    end

    it "should not create user with invalid email" do
      post api("/users", admin), { email: "invalid email", password: 'password' }
      response.status.should == 400
    end

    it "should return 400 error if password not given" do
      post api("/users", admin), { email: 'test@example.com' }
      response.status.should == 400
    end

    it "should return 400 error if email not given" do
      post api("/users", admin), { password: 'pass1234' }
      response.status.should == 400
    end

    it "shouldn't available for non admin users" do
      post api("/users", user), attributes_for(:user)
      response.status.should == 403
    end

    context "with existing user" do
      before { post api("/users", admin), { email: 'test@example.com', password: 'password', username: 'test' } }

      it "should not create user with same email" do
        expect {
          post api("/users", admin), { email: 'test@example.com', password: 'password' }
        }.to change { User.count }.by(0)
      end

      it "should return 409 conflict error if user with email exists" do
        post api("/users", admin), { email: 'test@example.com', password: 'password' }
      end

      it "should return 409 conflict error if same username exists" do
        post api("/users", admin), { email: 'foo@example.com', password: 'pass', username: 'test' }
      end
    end
  end

  describe "GET /users/sign_up" do
    context 'enabled' do
      before do
        Gitlab.config.gitlab.stub(:signup_enabled).and_return(true)
      end

      it "should return sign up page if signup is enabled" do
        get "/users/sign_up"
        response.status.should == 200
      end
    end

    context 'disabled' do
      before do
        Gitlab.config.gitlab.stub(:signup_enabled).and_return(false)
      end

      it "should redirect to sign in page if signup is disabled" do
        get "/users/sign_up"
        response.status.should == 302
        response.should redirect_to(new_user_session_path)
      end
    end
  end

  describe "PUT /users/:id" do
    before { admin }

    it "should update user with new bio" do
      put api("/users/#{user.id}", admin), {bio: 'new test bio'}
      response.status.should == 200
      json_response['bio'].should == 'new test bio'
      user.reload.bio.should == 'new test bio'
    end

    it "should not allow invalid update" do
      put api("/users/#{user.id}", admin), {email: 'invalid email'}
      response.status.should == 404
      user.reload.email.should_not == 'invalid email'
    end

    it "shouldn't available for non admin users" do
      put api("/users/#{user.id}", user), attributes_for(:user)
      response.status.should == 403
    end

    it "should return 404 for non-existing user" do
      put api("/users/999999", admin), {bio: 'update should fail'}
      response.status.should == 404
    end

    context "with existing user" do
      before {
        post api("/users", admin), { email: 'test@example.com', password: 'password', username: 'test', name: 'test' }
        post api("/users", admin), { email: 'foo@bar.com', password: 'password', username: 'john', name: 'john' }
        @user_id = User.all.last.id
      }

#      it "should return 409 conflict error if email address exists" do
#        put api("/users/#{@user_id}", admin), { email: 'test@example.com' }
#        response.status.should == 409
#      end
#
#      it "should return 409 conflict error if username taken" do
#        @user_id = User.all.last.id
#        put api("/users/#{@user_id}", admin), { username: 'test' }
#        response.status.should == 409
#      end
    end
  end

  describe "POST /users/:id/keys" do
    before { admin }

    it "should not create invalid ssh key" do
      post api("/users/#{user.id}/keys", admin), { title: "invalid key" }
      response.status.should == 404
    end

    it "should create ssh key" do
      key_attrs = attributes_for :key
      expect {
        post api("/users/#{user.id}/keys", admin), key_attrs
      }.to change{ user.keys.count }.by(1)
    end
  end

  describe "DELETE /users/:id" do
    before { admin }

    it "should delete user" do
      delete api("/users/#{user.id}", admin)
      response.status.should == 200
      expect { User.find(user.id) }.to raise_error ActiveRecord::RecordNotFound
      json_response['email'].should == user.email
    end

    it "should not delete for unauthenticated user" do
      delete api("/users/#{user.id}")
      response.status.should == 401
    end

    it "shouldn't available for non admin users" do
      delete api("/users/#{user.id}", user)
      response.status.should == 403
    end

    it "should return 404 for non-existing user" do
      delete api("/users/999999", admin)
      response.status.should == 404
    end
  end

  describe "GET /user" do
    it "should return current user" do
      get api("/user", user)
      response.status.should == 200
      json_response['email'].should == user.email
      json_response['is_admin'].should == user.is_admin?
      json_response['can_create_team'].should == user.can_create_team?
      json_response['can_create_project'].should == user.can_create_project?
      json_response['can_create_group'].should == user.can_create_group?
    end

    it "should return 401 error if user is unauthenticated" do
      get api("/user")
      response.status.should == 401
    end
  end

  describe "GET /user/keys" do
    context "when unauthenticated" do
      it "should return authentication error" do
        get api("/user/keys")
        response.status.should == 401
      end
    end

    context "when authenticated" do
      it "should return array of ssh keys" do
        user.keys << key
        user.save
        get api("/user/keys", user)
        response.status.should == 200
        json_response.should be_an Array
        json_response.first["title"].should == key.title
      end
    end
  end

  describe "GET /user/keys/:id" do
    it "should return single key" do
      user.keys << key
      user.save
      get api("/user/keys/#{key.id}", user)
      response.status.should == 200
      json_response["title"].should == key.title
    end

    it "should return 404 Not Found within invalid ID" do
      get api("/user/keys/42", user)
      response.status.should == 404
    end

    it "should return 404 error if admin accesses user's ssh key" do
      user.keys << key
      user.save
      admin
      get api("/user/keys/#{key.id}", admin)
      response.status.should == 404
    end
  end

  describe "POST /user/keys" do
    it "should create ssh key" do
      key_attrs = attributes_for :key
      expect {
        post api("/user/keys", user), key_attrs
      }.to change{ user.keys.count }.by(1)
      response.status.should == 201
    end

    it "should return a 401 error if unauthorized" do
      post api("/user/keys"), title: 'some title', key: 'some key'
      response.status.should == 401
    end

    it "should not create ssh key without key" do
      post api("/user/keys", user), title: 'title'
      response.status.should == 400
    end

    it "should not create ssh key without title" do
      post api("/user/keys", user), key: "somekey"
      response.status.should == 400
    end
  end

  describe "DELETE /user/keys/:id" do
    it "should delete existed key" do
      user.keys << key
      user.save
      expect {
        delete api("/user/keys/#{key.id}", user)
      }.to change{user.keys.count}.by(-1)
      response.status.should == 200
    end

    it "should return success if key ID not found" do
      delete api("/user/keys/42", user)
      response.status.should == 200
    end

    it "should return 401 error if unauthorized" do
      user.keys << key
      user.save
      delete api("/user/keys/#{key.id}")
      response.status.should == 401
    end
  end
end


text:
<!DOCTYPE html>

        <meta charset="utf-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>Help save the whales | Greenpeace International</title>
        <meta name="description" content="Write to international banks, BNP Paribas and HSBC, and demand they withdraw their funding from the Jaitpaur nuclear project." />
        <meta name="keywords" content="greenpeace, whales, nuclear, fukushima" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta name="robots" content="all" />
        <meta property="og:url" content="http://www.greenpeace.org/international/en/campaigns/nuclear/stop-radioactive-investment/Help-stop-the-next-Fukushima-disaster/" />
        <meta property="og:title" content="Help stop the next Fukushima disaster" />
        <meta property="og:type" content="article" />
        <meta property="og:description" content="Write to international banks, BNP Paribas and HSBC, and demand they withdraw their funding from the Jaitpaur nuclear project." />
        <meta property="og:country" content="us" />
        <meta property="og:image" content="//www.greenpeace.org/international/ReSizes/Teaser/Global/international/artwork/nuclear/2011/stop_fukushima.png" />
        <meta property="og:site_name" content="Greenpeace International" />
        <meta property="fb:app_id" content="206443473453" />
        <meta property="fb:admins" content="7297163299" />
        <meta property="twitter:card" content="summary" />
        <meta property="twitter:site" content="Greenpeace" />

        <link rel="stylesheet" type="text/css" href="css/article-template.min.css" />

                                        Home

                                        What we do

                                        Nuclear

                                        Stop radioactive investment!

                                    Help stop the next Fukushima disaster

Amchitka

The founding voyage

Background Story - May 15, 2007

                            In 1971, a small group of activists set sail to the Amchitka island off Alaska to try and stop a US nuclear weapons test. The money for the mission was raised with a concert, their old fishing boat was called "The Greenpeace". This is where our story
                            begins.

                            "Why not sail a boat up there and confront the bomb?"

                            It was a fancy, at first. Marie Bohlen casually expressed the idea over coffee one morning. But the people around her – a lose alliance of Quakers, pacifists, ecologists, journalists and hippies – weren't known for shrugging off the really big ideas.

                            A few weeks later, the Don't Make the Wave Committee – as the group was still called then – had a plan. "If the Americans want to go ahead with the test," Marie's husband Jim said, "they'll have to tow us out."

                            Leaving one of those heady first meetings, Irving Stowe flashed the peace sign – as was his custom – and said "Peace". On that occasion, the usually rather quiet Canadian ecologist Bill Darnell made the off-hand reply: "Make it a green peace."

                            When the words didn't fit onto buttons for the group's first fundraiser, they were simply merged: Green Peace became Greenpeace.

The concert

                            We had our name, but it was soon clear that selling 25-cent buttons wouldn't bring in the cash needed to buy a boat. Someone had the idea to put up a rock concert.

                            A few phone calls later, Joni Mitchell said she would be playing. Chilliwack and Phil Ochs confirmed, before Joni called again to say she would bring a special guest: James Taylor. None of them wanted any money for the night.

                            "The concert was a sell-out, the biggest counter-culture event of the year," Rex Weyler recalls in his Greenpeace biography. The sixteen thousand that filled Vancouver's Pacific Coliseum left the concert entranced.

                            Afterwards, attendance at the meeting swelled, the money started to pour in. By the end of October, the group had raised more than $23,000. Greenpeace was ready to go.

The voyage

                            Yet, the voyage was a disaster. The boat left the harbour at dusk on 15 September 1971, but internal tensions soon flared up.

                            "We never quite managed to go in the direction we wanted to go, or be in the place we wanted to be. And we fought bitterly among ourselves about it. Everything we did or said got sucked into an overwhelming power struggle."

                            "Here we were, supposedly saving the world through our moral example, emulating the Quakers, no less, when in reality we spent most of our time at each other's throats, egos clashing, the group fatally divided from start to finish."

                            Even worse, "The Greenpeace" was intercepted by the US navy, before it even got close to the Amchitka testing site.

                            Failure looks different, however. The Amchitka voyage sparked a flurry of public interest. The media went wild about the small group of activist who had sailed off in the face of great adversity – the first "media mindbomb", as Bob Hunter conceived of
                            those early Greenpeace actions, had been launched.

                            The beginning of a much bigger story "As it turned out, all my angst was unnecessary," he later wrote. "Time has proven my post-trip despair to be utterly mistaken. The trip was a success beyond anybody's wildest dreams."

                            The nuclear bomb the group had come to stop went off, but the tests planned for after that were cancelled. Five months after the group's mission, the US stopped the entire Amchitka nuclear test programme. The island was later declared a bird sanctuary.

                            "Whatever history decides about the big picture, the legacy of the voyage itself is not just a bunch of guys in a fishing boat, but the Greenpeace the entire world has come to love and hate."

                            Today, Greenpeace is the world's most visible environmental organisation, with offices in more than 40 countries and over 2.9 million members worldwide. Amchitka, it has turned out, was only the beginning of what would come to be a much bigger story.

Bob Hunter's account

                            Bob Hunter sailed aboard the first Greenpeace voyage in 1971 to Amchitka in the Aleutian Islands to try and stop a U.S. nuclear weapons test. When they were halfway to their destination, Richard Nixon announced a month's delay of the test. Most of the
                            crew were running out of money or vacation time, and an acrimonious debate broke out about whether to continue or turn back. This is Bob's story about what happened.

                            When I got back from the expedition to Amchitka and sat down to write a book about it, I was convinced we had lost, and I was angry. The best chance ever to actually interfere with nuclear testing, and we had blown it through sheer stupidity - and a failure
                            of nerve, to put it kindly. Cop-out on the Way to Amchitka was the title that loomed in my mind. And my personal failure of will was a big factor in that cop-out. Worse, I was afraid that I'd subconsciously thrown the fight
                            to carry on with the voyage. I'd have to live with that until I died or the world blew up, whichever happened first.

                            I was also facing the most serious writing dilemma of my life. Since childhood, when I had started writing science fiction in my school scribblers, I had been looking for "experience". Like all intense young writers, I had plenty to say, but rather little
                            context in which to present my thoughts. I'd read a bit, but there had been no plagues or crusades or recent wars on home ground. Even when the Great Red River Flood hit in 1950, my family was evacuated before the dikes broke.
                            Real-life adventure had been hard to come by in working-class south Winnipeg after the war, a period during which Canada was at its dullest, if you can imagine. Such adventures as I'd managed to experience when I was growing
                            up had been of the ordinary romantic or travel or childhood close-call variety. I had done some solo camping in the boreal forest and some hitchhiking in the western Canada and Europe, had got married and fathered two children,
                            had embarked on an interesting career in journalism and published three books, but until that fateful voyage in the fall of 1971, nothing had happened to me that leaped out as being absolutely essential to write about, if only
                            for my own understanding of life. And now that it had, I was obliged not to write about it - for the sake of the cause.

                            The problem was that I'd joined. What exactly I'd joined was not yet clear - it was still being defined - but I had definitely stopped being on the outside looking in and was instead on the inside looking out. I'd started out as a newspaper columnist,
                            the ultimate Ishmaelian outsider, accustomed to being responsible for nothing except the authenticity of my insights and words. "Tell it like it is" was the creed of the counterculture scribe, and my personal mantra. Suddenly
                            I found myself in the inner circle of a nascent political organization, with a bit of potential power in my hand, which at the time seemed like the power to change the course of history. All that had to happen was for the MV
                            Phyllis Cormack, aka Greenpeace, to make it to Amchitka Island and park there under the nose of a nuclear test bomb code-named Cannikin. How much simpler could it be?

                            Yet everything got fucked up. We never quite managed to go in the direction we wanted to go, or be in the place we wanted to be. And we fought bitterly among ourselves about it. Everything we did or said got sucked into an overwhelming power struggle.
                            Here we were, supposedly saving the world through our moral example, emulating the Quakers, no less, when in reality we spent most of our time at each other's throats, egos clashing, the group fatally divided from start to
                            finish. As every writer since Homer could tell you, this was the story: the conflict within. But having agreed, early in the game, to the Unity Rule - something like: I Pledge to Stay On-Side With the Group No Matter What,
                            which had seemed like a bold leap into solidarity with The Movement at the time - I had effectively gagged myself as a reporter and historian. It was a trade-off: but I bought into it, so I couldn't complain. I'd get to be
                            part of the consensus - my own skinny hand on the wheel of decision-making over the course of the Greenpeace, and therefore destiny - but like any other politician, I'd have to agree not to disagree in public. I disagreed,
                            as it turned out, with just about everything that was done, but had to keep my mouth shut. How, therefore, to write a book? An authorized book, which followed the party line yet still told the awful truth - that we had screwed
                            up.

                            Three decades later, his grey beard turned white, Jim Bohlen confided to me over a drink that he had been giving the sailing orders to our captain in secret throughout the voyage. As the guy signing the cheques and as the chairman of the Don't Make a
                            Wave Committee, which had chartered the boat, Bohlen had the legal authority to do that, but rather than say that he was the boss, and that the Greenpeace and the protest action were therefore being run as an old-fashioned
                            hierarchical power structure, he played games to keep us radical young crewmen under control. One of them was the promise that the ship would be run by consensus - each of us would have the power of veto. This was considered
                            the ultimate hip form of sharing power at the time, and I, for one, respected it.

                            But it was all a sham. Decisions were indeed made - Bohlen made them. And he made them after the rest of us had gone back to our bunks. At the time I wrote my manuscript, immediately after the voyage, I had no idea what Bohlen had been up to behind the
                            scenes. On any given day the actual movements of the boat, as opposed to the direction we'd agreed to at our meeting the night before, remained a mystery to me. Bohlen had us completely flummoxed. I salute him now for his cunning
                            and maturity and prudence. We probably would have died if he hadn't assumed control. But back then, I plotted and connived to overthrow him as leader because he was "chickening out". Ben Metcalfe, Bohlen's co-conspirator in
                            the plot to bring us home alive, the other mature war veteran on board, and the mastermind of the media campaign, saw no reason to put us at risk of committing mass suicide, and I sneered at him for having "lost it". But this
                            guy had fought in the Desert War against Rommel, had resisted raf orders to bomb Gandhi's followers, and was so far ahead of me in terms of that elusive stuff called experience that there was never any doubt that in matters
                            of life or death he would outmanoeuvre the mutinous but naïve youth faction. He was an old rogue survivor. A genius, I now realize. In the end, I studied at his feet.

                            The man who ultimately determined the fate of that first Greenpeace trip was John C. Cormack, the captain and owner, who had accepted the job of sailing his fishing boat into a nuclear test zone only out of economic desperation, a fact that never got
                            talked about much. In hindsight it is interesting to remember what Cormack did and did not do at the critical moment. He saved his boat and us along with it. And we all saved face, at least enough to go home.

                            The key moment of the trip came a day before we limped back into Vancouver. As we all sat slumped in the galley, burned out, Bohlen announced that he was going to shut down the Don't Make a Wave Committee as soon as he got the chance. It was an ad hoc
                            group and it had done its thing. Don't do that, I told him. Why waste all this hard-earned media capital? Fold the committee, sure, but reconstitute it as the Greenpeace Foundation. That was my main contribution, yet the moment
                            did not find its way into my manuscript. It was an element of hope for a future revolution, and I was not hopeful as I bobbed in the harbour at Steveston, heartsick and overmedicated, writing the story of our failure. In the
                            end I told the truth as I saw it, supposedly as it was, never mind loyalty to the cause.

                            As it turned out, all my angst was unnecessary. Time has proven my post-trip despair to be utterly mistaken. The trip was a success beyond anybody's wildest dreams. That bomb went off, but the bombs planned for after that did not. The nuclear test program
                            at Amchitka was cancelled five months after our mission, and some scholars argue that this was the beginning of the end of the Cold War. Whatever history decides about the big picture, the legacy of the voyage itself is not
                            just a bunch of guys in a fishing boat, but the Greenpeace the entire world has come to love and hate.

                            Excerpt from "The Greenpeace to Amchitka"

By Bob Hunter Published by Arsenal Pulp Press, Canada

ISBN Number: 1-55152-178-4

Reproduced with kind permission JUNE 2004

Greenpeace victories

                                    History and Successes

Victories timeline

The Founders

The founding voyage

The bombing of the Rainbow..

The Greenpeace Chronicles

Core values

Greenpeace and You

Our Ships

Organisation

Greenpeace worldwide

FAQs

Work for Greenpeace

                        Menu

                                Greenpeace

                                    Greenpeace International.

                                            Select a country

International (English)

Africa - Congo (Français)

Africa - Senegal (Français)

Africa - South Africa (English)

Argentina (Español)

Australia (English)

Austria (Deutsch)

Belgium (Nederlands/Français)

Brazil (Português)

Canada (English/Français)

Chile (Español)

China Mainland (简体中文)

Colombia (Español)

Czech Republic (Česky)

Denmark (Dansk)

East Asia (English)

European Union (English)

Fiji (English)

Finland (Suomea)

France (Français)

Germany (Deutsch)

Greece (Ελληνικά)

Hong Kong (繁體中文)

Hungary (Magyar)

India (English/Hindi)

Indonesia (Indonesia)

Israel (עברית)

Italy (Italiano)

Japan (日本語)

Korea (한국어)

Lebanon (العربية)

Luxembourg (Français)

Malta (English)

Mexico (Español)

Netherlands (Nederlands)

New Zealand (English)

Norway (Norsk)

Papua New Guinea (English)

Philippines (English)

Poland (Polska)

Portugal (Português)

Romania (Român)

Russia (Русский)

Slovakia (Slovenčina)

Slovenia (Slovenjia)

Southeast Asia (English)

Spain (Español)

Sweden (Svenska)

Switzerland (Deutsch)

Switzerland (Français)

Taiwan (正體中文)

Thailand (ไทย)

Turkey (Türk)

United Kingdom (English)

USA (English)

                                        Language:
                                        English

English

Nederlands

Press

Publications

                                    <form action="#" id="search" method="post" accept-charset="utf-8">

                                            Search
                                            <input name="data[Search][text]" class="required" maxlength="64" type="text" id="SearchText" placeholder="search" />

                                                <input type="submit" value="search" />

                                    </form>

                                    close

                                                Home

                                                About us

Greenpeace victories

                                                            History and Successes

Victories timeline

The Founders

The founding voyage

The bombing of the Rai...

                                                            Core values

Transparency and Accou...

Greenpeace and You

                                                            Our Ships

The    Rainbow Warrior

The    Esperanza

The    Arctic Sunrise

Our inflatables

Ship webcams

                                                            Organisation

Governance structure

Management structure

Financial structure

Legal structure

Annual reports

Greenpeace worldwide

FAQs

Work for Greenpeace

                                                What we do

                                                            Climate change

Arctic

Energy [R]evolution

Clean our Cloud

Cool IT

Oil

Quit Coal

Climate impacts

Solutions

Project work

                                                            Forests

Threats

Solutions

Political solutions

Indonesia

Amazon

Congo Basin

                                                            Oceans

Marine reserves

Polar Oceans

Overfishing

Pirate fishing

Tuna

Whales

Seafood

                                                            Agriculture

The Problem

The Solution

                                                            Toxic pollution

Detox Campaign

Water

Greener Electronics

                                                            Nuclear

Fukushima nuclear disa...

Safety

Nuclear waste

Proliferation

No more Chernobyls

                                                            Peace and disarmament

Abolish nuclear weapons

Disruptive diplomacy, ...

Solutions

                                                News

                                                            Blogs

Kumi Naidoo

Making Waves

Nuclear reaction

Cool IT

Feature Stories

                                                Multimedia

Photos

Videos

Slideshows

Photo Essays

Goodies

                                                            Ship webcams

Rainbow Warrior Webcam

Arctic Sunrise Webcam

Esperanza webcam

                                                Get involved

Stop Scientific Whaling

Donate

                                    Help get Facebook to unfriend coal

                                    Save whales & sharks - Marine reserves now!

                                    Help build the new Rainbow Warrior

                                    Monthly feature from Greepeace's unofficial historian, Rex Weyler

What we do

Climate change

Forests

Oceans

Agriculture

Toxic Pollution

Nuclear

About us

Press center

Introduction

Victories

Ships

Frequently Asked Questions

Work for Greenpeace

Multimedia

Photos

Videos

Desktop wallpapers

Photo essays

National and regional wbsite in English

Africa

Australia

Canada

China

India

Mediterranean

New Zealand

United Kingdom

United States

Greenpeace around the world

Take Actions

Ask Princes Tuna to Stop canning ocean destruction

Hel get facebook.com off coal

Stop nuclear investments

More ways to get inolved

Hot this month

Calling for Pacific marine reserves in Taiwan

Video: Give Earth a hand

Help get facebook.com off coal

About the floods in Queensland

Greenpeace Online

Facebook

Flickr

Twitter

Youtube

RSS

Facts & Figures

Founded in 1971

Three ships in the oceans

Offices in 40 countries

Millions of supporters world-wide

Become a supporter!

                                        Rainbow Warrior
                                        sailing vessel,
                                        active since 1989.

                                        Artic Sunrise
                                        ice breaker,
                                        active since 1997.

                                        Esperanza
                                        means "hope",
                                        active since 2002.

                                ©
                                GREENPEACE
                                2013

Privacy statement

Copyright

Home

About us

Contact us

Press centre


text:
#pragma once

#include "src/rules/semanticTransformationRule.h"

namespace generatorBase {
namespace semantics {

/// Performs initialization of the switch semantic construction when met it on diagram.
class SwitchInitializationRule : public SemanticTransformationRule
{
public:
	SwitchInitializationRule(SemanticTree *tree
			, const qReal::Id &id
			, const QList<LinkInfo> &branches
			, const qrRepo::RepoApi &repo);

	bool apply() override;

	void addBranch(const QVariant &value, const qReal::Id &id);

private:
	const QList<LinkInfo> mBranches;
	const qrRepo::RepoApi &mRepo;
};

}
}


text:
/**
 * This file is part of spy4js which is released under MIT license.
 *
 * The LICENSE file can be found in the root directory of this project.
 *
 */
import { Spy } from '../../src/spy';

const IRL = {
    saveTheWorld: () => 'feed some koalas',
    doWithTree: (action: string) => `${action} the tree`,
    giveBanana: (to: string) => `Give ${to} a banana`,
};

const Matrix = { tearDown: () => 1337, startup: () => 1 };

// you may and should initialize all mocks outside of your "describe"
// the reason is: Once a Mock was created it will be initialized by
// any other describe on calling "initMocks". This might lead to
// confusion when the mock was created within a certain describe block

// the next line does not modify the object IRL, but saves the reference
const IRL$Mock = Spy.mock(IRL, 'saveTheWorld', 'giveBanana');

const Matrix$Mock = Spy.mock(Matrix, 'startup');

describe('Spy - Global- Mocks', () => {
    it('IRL$Mock: did mock the methods and applied spies', () => {
        IRL$Mock.saveTheWorld.returns('saved it!');

        expect(IRL.saveTheWorld()).toBe('saved it!');
        expect(IRL.doWithTree('burn')).toBe('burn the tree');
        expect(IRL.giveBanana('Mike')).toBe(undefined);

        expect((IRL$Mock as any).doWithTree).toBe(undefined);
        IRL$Mock.saveTheWorld.wasCalled(1);
        IRL$Mock.giveBanana.hasCallHistory('Mike');
    });

    it('Matrix$Mock: did mock the methods and applied spies', () => {
        Matrix$Mock.startup.returns('done');

        expect(Matrix.startup()).toBe('done');
        expect(Matrix.tearDown()).toBe(1337);

        expect((Matrix$Mock as any).tearDown).toBe(undefined);
        Matrix$Mock.startup.wasCalled(1);
    });
});

const Guy = {
    swim: () => 'fish',
    goTo: (where: string) => 'go to --> ' + where,
};

describe('Spy - Scoped - Mocks - 1', () => {
    const Guy$Mock = Spy.mock(Guy, 'swim');

    it('Guy$Mock: mocks swim to return 42', () => {
        Guy$Mock.swim.returns(42);

        expect(Guy.swim()).toBe(42);
        expect(Guy.goTo('park')).toBe('go to --> park');

        expect((Guy$Mock as any).goTo).toBe(undefined);
        Guy$Mock.swim.wasCalled(1);
    });
});

describe('Spy - Scoped - Mocks - 2', () => {
    const Guy$Mock = Spy.mock(Guy, 'swim', 'goTo');

    it('Guy$Mock: mocks swim to return 12', () => {
        Guy$Mock.swim.returns(12);
        Guy$Mock.goTo.calls((s: any) => s);

        expect(Guy.swim()).toBe(12);
        expect(Guy.goTo('park')).toBe('park');

        Guy$Mock.swim.wasCalled(1);
        Guy$Mock.goTo.hasCallHistory('park');
    });
});


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
         http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
         http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">

    <!-- ============================== -->
    <!-- Camel routes -->
    <!-- ============================== -->
    <camelContext xmlns="http://camel.apache.org/schema/spring">
        <route>
            <from uri="spring-ws:rootqname:{http://www.stockquotes.edu/}SomeElement?endpointMapping=#endpointMapping"/>
            <to uri="mock:testRootQNameDummy"/>
        </route>
        <route>
            <from uri="spring-ws:rootqname:{http://www.stockquotes.edu/}GetQuote?endpointMapping=#endpointMapping"/>
            <to uri="mock:testRootQName"/>
        </route>
        <route>
            <from uri="spring-ws:soapaction:http://www.stockquotes.edu/GetQuote?endpointMapping=#endpointMapping"/>
            <to uri="mock:testSoapAction"/>
        </route>
        <route>
            <from uri="spring-ws:uri:http://localhost/stockquote2?endpointMapping=#endpointMapping"/>
            <to uri="mock:testUri"/>
        </route>
        <route>
            <from uri="spring-ws:xpathresult:GRABME?expression=//GetQuote&endpointMapping=#endpointMapping"/>
            <to uri="mock:testXPath"/>
        </route>
    </camelContext>

    <bean id="endpointMapping"
          class="org.apache.camel.component.spring.ws.bean.CamelEndpointMapping"/>

    <bean id="responseProcessor"
          class="org.apache.camel.component.spring.ws.StockQuoteResponseProcessor"/>

    <!-- ============================== -->
    <!-- Supporting Spring-WS beans -->
    <!-- ============================== -->
    <bean id="webServiceTemplate" class="org.springframework.ws.client.core.WebServiceTemplate">
        <property name="defaultUri" value="http://localhost"/>
        <property name="messageSender">
            <bean class="net.javacrumbs.springws.test.helper.InMemoryWebServiceMessageSender"/>
        </property>
    </bean>

</beans>


text:
module LensUtil where

import Prelude
import Control.Lens
import Language.Haskell.TH

makeLensesCustom :: Name -> DecsQ
makeLensesCustom = makeLensesWith $ lensRules
  & lensField .~ \_ _ name -> [TopName (mkName $ nameBase name ++ "L")]


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

package com.perforce.test;

import javax.annotation.Nonnull;
import java.io.File;

public class CaseSensitiveTestServer extends TestServer {
    public CaseSensitiveTestServer() {
        super();
        setCaseSensitive(true);
    }

    public CaseSensitiveTestServer(@Nonnull File file) {
        super(file);
        setCaseSensitive(true);
    }
}


text:
CKEDITOR.plugins.setLang( 'definitionlist', 'es',
{
	'definitionDesc' : 'Definition Description',
	'definitionList' : 'Definition List',
	'definitionTerm' : 'Definition Term'
});


text:
// Created on 01.11.2003 by RST.
// $Id: GameUtil.java,v 1.15 2005/12/27 21:02:31 salomo Exp $
package org.free.jake2.game;

import org.free.jake2.Defines;
import org.free.jake2.Globals;
import org.free.jake2.client.M;
import org.free.jake2.qcommon.Com;
import org.free.jake2.util.Lib;
import org.free.jake2.util.Math3D;

public class GameUtil {

  public static void checkClassname(edict_t ent) {

    if (ent.classname == null) {
      Com.Printf("edict with classname = null: " + ent.index);
    }
  }

  /**
   * Use the targets.
   *
   * The global "activator" should be set to the entity that initiated the
   * firing.
   *
   * If self.delay is set, a DelayedUse entity will be created that will
   * actually do the SUB_UseTargets after that many seconds have passed.
   *
   * Centerprints any self.message to the activator.
   *
   * Search for (string)targetname in all entities that match
   * (string)self.target and call their .use function
   */
  public static void G_UseTargets(edict_t ent, edict_t activator) {
    edict_t t;

    checkClassname(ent);

    // check for a delay
    if (ent.delay != 0) {
      // create a temp object to fire at a later time
      t = G_Spawn();
      t.classname = "DelayedUse";
      t.nextthink = GameBase.level.time + ent.delay;
      t.think = Think_Delay;
      t.activator = activator;
      if (activator == null) {
        GameBase.gi.dprintf("Think_Delay with no activator\n");
      }
      t.message = ent.message;
      t.target = ent.target;
      t.killtarget = ent.killtarget;
      return;
    }

    // print the message
    if ((ent.message != null)
            && (activator.svflags & Defines.SVF_MONSTER) == 0) {
      GameBase.gi.centerprintf(activator, "" + ent.message);
      if (ent.noise_index != 0) {
        GameBase.gi.sound(activator, Defines.CHAN_AUTO,
                ent.noise_index, 1, Defines.ATTN_NORM, 0);
      } else {
        GameBase.gi.sound(activator, Defines.CHAN_AUTO, GameBase.gi.soundindex("misc/talk1.wav"), 1, Defines.ATTN_NORM, 0);
      }
    }

    // kill killtargets
    EdictIterator edit = null;

    if (ent.killtarget != null) {
      while ((edit = GameBase.G_Find(edit, GameBase.findByTarget,
              ent.killtarget)) != null) {
        t = edit.o;
        G_FreeEdict(t);
        if (!ent.inuse) {
          GameBase.gi.dprintf("entity was removed while using killtargets\n");
          return;
        }
      }
    }

    // fire targets
    if (ent.target != null) {
      edit = null;
      while ((edit = GameBase.G_Find(edit, GameBase.findByTarget,
              ent.target)) != null) {
        t = edit.o;
        // doors fire area portals in a specific way
        if (Lib.Q_stricmp("func_areaportal", t.classname) == 0
                && (Lib.Q_stricmp("func_door", ent.classname) == 0 || Lib.Q_stricmp("func_door_rotating", ent.classname) == 0)) {
          continue;
        }

        if (t == ent) {
          GameBase.gi.dprintf("WARNING: Entity used itself.\n");
        } else {
          if (t.use != null) {
            t.use.use(t, ent, activator);
          }
        }
        if (!ent.inuse) {
          GameBase.gi.dprintf("entity was removed while using targets\n");
          return;
        }
      }
    }
  }

  public static void G_InitEdict(edict_t e, int i) {
    e.inuse = true;
    e.classname = "noclass";
    e.gravity = 1.0f;
    //e.s.number= e - g_edicts;
    e.s = new entity_state_t(e);
    e.s.number = i;
    e.index = i;
  }

  /**
   * Either finds a free edict, or allocates a new one. Try to avoid reusing
   * an entity that was recently freed, because it can cause the client to
   * think the entity morphed into something else instead of being removed and
   * recreated, which can cause interpolated angles and bad trails.
   */
  public static edict_t G_Spawn() {
    int i;
    edict_t e = null;

    for (i = (int) GameBase.maxclients.value + 1; i < GameBase.num_edicts; i++) {
      e = GameBase.g_edicts[i];
      // the first couple seconds of server time can involve a lot of
      // freeing and allocating, so relax the replacement policy
      if (!e.inuse
              && (e.freetime < 2 || GameBase.level.time - e.freetime > 0.5)) {
        e = GameBase.g_edicts[i] = new edict_t(i);
        G_InitEdict(e, i);
        return e;
      }
    }

    if (i == GameBase.game.maxentities) {
      GameBase.gi.error("ED_Alloc: no free edicts");
    }

    e = GameBase.g_edicts[i] = new edict_t(i);
    GameBase.num_edicts++;
    G_InitEdict(e, i);
    return e;
  }

  /**
   * Marks the edict as free
   */
  public static void G_FreeEdict(edict_t ed) {
    GameBase.gi.unlinkentity(ed); // unlink from world

    //if ((ed - g_edicts) <= (maxclients.value + BODY_QUEUE_SIZE))
    if (ed.index <= (GameBase.maxclients.value + Defines.BODY_QUEUE_SIZE)) {
      // gi.dprintf("tried to free special edict\n");
      return;
    }

    GameBase.g_edicts[ed.index] = new edict_t(ed.index);
    ed.classname = "freed";
    ed.freetime = GameBase.level.time;
    ed.inuse = false;
  }

  /**
   * Call after linking a new trigger in during gameplay to force all entities
   * it covers to immediately touch it.
   */
  public static void G_ClearEdict(edict_t ent) {
    int i = ent.index;
    GameBase.g_edicts[i] = new edict_t(i);
  }

  /**
   * Kills all entities that would touch the proposed new positioning of ent.
   * Ent should be unlinked before calling this!
   */
  public static boolean KillBox(edict_t ent) {
    trace_t tr;

    while (true) {
      tr = GameBase.gi.trace(ent.s.origin, ent.mins, ent.maxs,
              ent.s.origin, null, Defines.MASK_PLAYERSOLID);
      if (tr.ent == null || tr.ent == GameBase.g_edicts[0]) {
        break;
      }

      // nail it
      GameCombat.T_Damage(tr.ent, ent, ent, Globals.vec3_origin, ent.s.origin,
              Globals.vec3_origin, 100000, 0,
              Defines.DAMAGE_NO_PROTECTION, Defines.MOD_TELEFRAG);

      // if we didn't kill it, fail
      if (tr.ent.solid != 0) {
        return false;
      }
    }

    return true; // all clear
  }

  /**
   * Returns true, if two edicts are on the same team.
   */
  public static boolean OnSameTeam(edict_t ent1, edict_t ent2) {
    if (0 == ((int) (GameBase.dmflags.value) & (Defines.DF_MODELTEAMS | Defines.DF_SKINTEAMS))) {
      return false;
    }

    if (ClientTeam(ent1).equals(ClientTeam(ent2))) {
      return true;
    }
    return false;
  }

  /**
   * Returns the team string of an entity
   * with respect to rteam_by_model and team_by_skin.
   */
  static String ClientTeam(edict_t ent) {
    String value;

    if (ent.client == null) {
      return "";
    }

    value = Info.Info_ValueForKey(ent.client.pers.userinfo, "skin");

    int p = value.indexOf("/");

    if (p == -1) {
      return value;
    }

    if (((int) (GameBase.dmflags.value) & Defines.DF_MODELTEAMS) != 0) {
      return value.substring(0, p);
    }

    return value.substring(p + 1, value.length());
  }

  static void ValidateSelectedItem(edict_t ent) {
    gclient_t cl;

    cl = ent.client;

    if (cl.pers.inventory[cl.pers.selected_item] != 0) {
      return; // valid
    }
    GameItems.SelectNextItem(ent, -1);
  }

  /**
   * Returns the range catagorization of an entity reletive to self 0 melee
   * range, will become hostile even if back is turned 1 visibility and
   * infront, or visibility and show hostile 2 infront and show hostile 3 only
   * triggered by damage.
   */
  public static int range(edict_t self, edict_t other) {
    float[] v = {0, 0, 0};
    float len;

    Math3D.VectorSubtract(self.s.origin, other.s.origin, v);
    len = Math3D.VectorLength(v);
    if (len < Defines.MELEE_DISTANCE) {
      return Defines.RANGE_MELEE;
    }
    if (len < 500) {
      return Defines.RANGE_NEAR;
    }
    if (len < 1000) {
      return Defines.RANGE_MID;
    }
    return Defines.RANGE_FAR;
  }

  static void AttackFinished(edict_t self, float time) {
    self.monsterinfo.attack_finished = GameBase.level.time + time;
  }

  /**
   * Returns true if the entity is in front (in sight) of self
   */
  public static boolean infront(edict_t self, edict_t other) {
    float[] vec = {0, 0, 0};
    float dot;
    float[] forward = {0, 0, 0};

    Math3D.AngleVectors(self.s.angles, forward, null, null);
    Math3D.VectorSubtract(other.s.origin, self.s.origin, vec);
    Math3D.VectorNormalize(vec);
    dot = Math3D.DotProduct(vec, forward);

    if (dot > 0.3) {
      return true;
    }
    return false;
  }

  /**
   * Returns 1 if the entity is visible to self, even if not infront().
   */
  public static boolean visible(edict_t self, edict_t other) {
    float[] spot1 = {0, 0, 0};
    float[] spot2 = {0, 0, 0};
    trace_t trace;

    Math3D.VectorCopy(self.s.origin, spot1);
    spot1[2] += self.viewheight;
    Math3D.VectorCopy(other.s.origin, spot2);
    spot2[2] += other.viewheight;
    trace = GameBase.gi.trace(spot1, Globals.vec3_origin,
            Globals.vec3_origin, spot2, self, Defines.MASK_OPAQUE);

    if (trace.fraction == 1.0) {
      return true;
    }
    return false;
  }

  /**
   * Finds a target.
   *
   * Self is currently not attacking anything, so try to find a target
   *
   * Returns TRUE if an enemy was sighted
   *
   * When a player fires a missile, the point of impact becomes a fakeplayer
   * so that monsters that see the impact will respond as if they had seen the
   * player.
   *
   * To avoid spending too much time, only a single client (or fakeclient) is
   * checked each frame. This means multi player games will have slightly
   * slower noticing monsters.
   */
  static boolean FindTarget(edict_t self) {
    edict_t client;
    boolean heardit;
    int r;

    if ((self.monsterinfo.aiflags & Defines.AI_GOOD_GUY) != 0) {
      if (self.goalentity != null && self.goalentity.inuse
              && self.goalentity.classname != null) {
        if (self.goalentity.classname.equals("target_actor")) {
          return false;
        }
      }

      //FIXME look for monsters?
      return false;
    }

    // if we're going to a combat point, just proceed
    if ((self.monsterinfo.aiflags & Defines.AI_COMBAT_POINT) != 0) {
      return false;
    }

    // if the first spawnflag bit is set, the monster will only wake up on
    // really seeing the player, not another monster getting angry or
    // hearing something
    // revised behavior so they will wake up if they "see" a player make a
    // noise but not weapon impact/explosion noises

    heardit = false;
    if ((GameBase.level.sight_entity_framenum >= (GameBase.level.framenum - 1))
            && 0 == (self.spawnflags & 1)) {
      client = GameBase.level.sight_entity;
      if (client.enemy == self.enemy) {
        return false;
      }
    } else if (GameBase.level.sound_entity_framenum >= (GameBase.level.framenum - 1)) {
      client = GameBase.level.sound_entity;
      heardit = true;
    } else if (null != (self.enemy)
            && (GameBase.level.sound2_entity_framenum >= (GameBase.level.framenum - 1))
            && 0 != (self.spawnflags & 1)) {
      client = GameBase.level.sound2_entity;
      heardit = true;
    } else {
      client = GameBase.level.sight_client;
      if (client == null) {
        return false; // no clients to get mad at
      }
    }

    // if the entity went away, forget it
    if (!client.inuse) {
      return false;
    }

    if (client.client != null) {
      if ((client.flags & Defines.FL_NOTARGET) != 0) {
        return false;
      }
    } else if ((client.svflags & Defines.SVF_MONSTER) != 0) {
      if (client.enemy == null) {
        return false;
      }
      if ((client.enemy.flags & Defines.FL_NOTARGET) != 0) {
        return false;
      }
    } else if (heardit) {
      if ((client.owner.flags & Defines.FL_NOTARGET) != 0) {
        return false;
      }
    } else {
      return false;
    }

    if (!heardit) {
      r = range(self, client);

      if (r == Defines.RANGE_FAR) {
        return false;
      }

      // this is where we would check invisibility
      // is client in an spot too dark to be seen?

      if (client.light_level <= 5) {
        return false;
      }

      if (!visible(self, client)) {
        return false;
      }

      if (r == Defines.RANGE_NEAR) {
        if (client.show_hostile < GameBase.level.time
                && !infront(self, client)) {
          return false;
        }
      } else if (r == Defines.RANGE_MID) {
        if (!infront(self, client)) {
          return false;
        }
      }

      if (client == self.enemy) {
        return true; // JDC false;
      }
      self.enemy = client;

      if (!self.enemy.classname.equals("player_noise")) {
        self.monsterinfo.aiflags &= ~Defines.AI_SOUND_TARGET;

        if (self.enemy.client == null) {
          self.enemy = self.enemy.enemy;
          if (self.enemy.client == null) {
            self.enemy = null;
            return false;
          }
        }
      }
    } else {
      // heard it
      float[] temp = {0, 0, 0};

      if ((self.spawnflags & 1) != 0) {
        if (!visible(self, client)) {
          return false;
        }
      } else {
        if (!GameBase.gi.inPHS(self.s.origin, client.s.origin)) {
          return false;
        }
      }

      Math3D.VectorSubtract(client.s.origin, self.s.origin, temp);

      if (Math3D.VectorLength(temp) > 1000) // too far to hear
      {
        return false;
      }

      // check area portals - if they are different and not connected then
      // we can't hear it
      if (client.areanum != self.areanum) {
        if (!GameBase.gi.AreasConnected(self.areanum, client.areanum)) {
          return false;
        }
      }

      self.ideal_yaw = Math3D.vectoyaw(temp);
      M.M_ChangeYaw(self);

      // hunt the sound for a bit; hopefully find the real player
      self.monsterinfo.aiflags |= Defines.AI_SOUND_TARGET;

      if (client == self.enemy) {
        return true; // JDC false;
      }
      self.enemy = client;
    }

    // got one
    FoundTarget(self);

    if (0 == (self.monsterinfo.aiflags & Defines.AI_SOUND_TARGET)
            && (self.monsterinfo.sight != null)) {
      self.monsterinfo.sight.interact(self, self.enemy);
    }

    return true;
  }

  public static void FoundTarget(edict_t self) {
    // let other monsters see this monster for a while
    if (self.enemy.client != null) {
      GameBase.level.sight_entity = self;
      GameBase.level.sight_entity_framenum = GameBase.level.framenum;
      GameBase.level.sight_entity.light_level = 128;
    }

    self.show_hostile = (int) GameBase.level.time + 1; // wake up other
    // monsters

    Math3D.VectorCopy(self.enemy.s.origin, self.monsterinfo.last_sighting);
    self.monsterinfo.trail_time = GameBase.level.time;

    if (self.combattarget == null) {
      GameAI.HuntTarget(self);
      return;
    }

    self.goalentity = self.movetarget = GameBase.G_PickTarget(self.combattarget);
    if (self.movetarget == null) {
      self.goalentity = self.movetarget = self.enemy;
      GameAI.HuntTarget(self);
      GameBase.gi.dprintf("" + self.classname + "at "
              + Lib.vtos(self.s.origin) + ", combattarget "
              + self.combattarget + " not found\n");
      return;
    }

    // clear out our combattarget, these are a one shot deal
    self.combattarget = null;
    self.monsterinfo.aiflags |= Defines.AI_COMBAT_POINT;

    // clear the targetname, that point is ours!
    self.movetarget.targetname = null;
    self.monsterinfo.pausetime = 0;

    // run for it
    self.monsterinfo.run.think(self);
  }
  public static EntThinkAdapter Think_Delay = new EntThinkAdapter() {

    public String getID() {
      return "Think_Delay";
    }

    public boolean think(edict_t ent) {
      G_UseTargets(ent, ent.activator);
      G_FreeEdict(ent);
      return true;
    }
  };
  public static EntThinkAdapter G_FreeEdictA = new EntThinkAdapter() {

    public String getID() {
      return "G_FreeEdictA";
    }

    public boolean think(edict_t ent) {
      G_FreeEdict(ent);
      return false;
    }
  };
  static EntThinkAdapter MegaHealth_think = new EntThinkAdapter() {

    public String getID() {
      return "MegaHealth_think";
    }

    public boolean think(edict_t self) {
      if (self.owner.health > self.owner.max_health) {
        self.nextthink = GameBase.level.time + 1;
        self.owner.health -= 1;
        return false;
      }

      if (!((self.spawnflags & Defines.DROPPED_ITEM) != 0)
              && (GameBase.deathmatch.value != 0)) {
        GameItems.SetRespawn(self, 20);
      } else {
        G_FreeEdict(self);
      }

      return false;
    }
  };
  public static EntThinkAdapter M_CheckAttack = new EntThinkAdapter() {

    public String getID() {
      return "M_CheckAttack";
    }

    public boolean think(edict_t self) {
      float[] spot1 = {0, 0, 0};

      float[] spot2 = {0, 0, 0};
      float chance;
      trace_t tr;

      if (self.enemy.health > 0) {
        // see if any entities are in the way of the shot
        Math3D.VectorCopy(self.s.origin, spot1);
        spot1[2] += self.viewheight;
        Math3D.VectorCopy(self.enemy.s.origin, spot2);
        spot2[2] += self.enemy.viewheight;

        tr = GameBase.gi.trace(spot1, null, null, spot2, self,
                Defines.CONTENTS_SOLID | Defines.CONTENTS_MONSTER
                | Defines.CONTENTS_SLIME
                | Defines.CONTENTS_LAVA
                | Defines.CONTENTS_WINDOW);

        // do we have a clear shot?
        if (tr.ent != self.enemy) {
          return false;
        }
      }

      // melee attack
      if (GameAI.enemy_range == Defines.RANGE_MELEE) {
        // don't always melee in easy mode
        if (GameBase.skill.value == 0 && (Lib.rand() & 3) != 0) {
          return false;
        }
        if (self.monsterinfo.melee != null) {
          self.monsterinfo.attack_state = Defines.AS_MELEE;
        } else {
          self.monsterinfo.attack_state = Defines.AS_MISSILE;
        }
        return true;
      }

      // missile attack
      if (self.monsterinfo.attack == null) {
        return false;
      }

      if (GameBase.level.time < self.monsterinfo.attack_finished) {
        return false;
      }

      if (GameAI.enemy_range == Defines.RANGE_FAR) {
        return false;
      }

      if ((self.monsterinfo.aiflags & Defines.AI_STAND_GROUND) != 0) {
        chance = 0.4f;
      } else if (GameAI.enemy_range == Defines.RANGE_MELEE) {
        chance = 0.2f;
      } else if (GameAI.enemy_range == Defines.RANGE_NEAR) {
        chance = 0.1f;
      } else if (GameAI.enemy_range == Defines.RANGE_MID) {
        chance = 0.02f;
      } else {
        return false;
      }

      if (GameBase.skill.value == 0) {
        chance *= 0.5;
      } else if (GameBase.skill.value >= 2) {
        chance *= 2;
      }

      if (Lib.random() < chance) {
        self.monsterinfo.attack_state = Defines.AS_MISSILE;
        self.monsterinfo.attack_finished = GameBase.level.time + 2
                * Lib.random();
        return true;
      }

      if ((self.flags & Defines.FL_FLY) != 0) {
        if (Lib.random() < 0.3f) {
          self.monsterinfo.attack_state = Defines.AS_SLIDING;
        } else {
          self.monsterinfo.attack_state = Defines.AS_STRAIGHT;
        }
      }

      return false;

    }
  };
  static EntUseAdapter monster_use = new EntUseAdapter() {

    public String getID() {
      return "monster_use";
    }

    public void use(edict_t self, edict_t other, edict_t activator) {
      if (self.enemy != null) {
        return;
      }
      if (self.health <= 0) {
        return;
      }
      if ((activator.flags & Defines.FL_NOTARGET) != 0) {
        return;
      }
      if ((null == activator.client)
              && 0 == (activator.monsterinfo.aiflags & Defines.AI_GOOD_GUY)) {
        return;
      }

      // delay reaction so if the monster is teleported, its sound is
      // still heard
      self.enemy = activator;
      FoundTarget(self);
    }
  };
}


text:
namespace SimpleAuthentication.Core.Providers.Google
{
    public class Image
    {
        public string Url { get; set; }
        public bool IsDefault { get; set; }
    }
}


text:
@implementation SelectGalleryCommand

irobotlegs_requires(@"notification",@"galleriesModel");

//------------------------------------------------------------------------------
//  Getter / Setter
//------------------------------------------------------------------------------

@synthesize notification = notification_;
@synthesize galleriesModel = galleriesModel_;

//------------------------------------------------------------------------------
//  Lifecycle
//------------------------------------------------------------------------------

- (void)dealloc
{
    [self.notification release];
    [self.galleriesModel release];
    [super dealloc];
}

//------------------------------------------------------------------------------
//  Overridden
//------------------------------------------------------------------------------

-(void)execute
{
    NSString *galleryName = [self.notification.userInfo objectForKey:@"name"];
    [self.galleriesModel selectGalleryNamed:galleryName];
}

@end


text:
<?php

namespace Aco\CliApp;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Aco\Domain\Aco\ArticleRepo;
use AcoQuery\ListArticle;

class ListArticlesCliCommand extends Command
{
    private $repo;

    public function setRepo(ArticleRepo $repo)
    {
        $this->repo = $repo;
    }

    protected function configure()
    {
        $this
        ->setName('app:list-articles')
        ->setDescription('Articles list')
    ;
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln('Articles:');
        $xs = $this->repo->findArticles();

        /*
         * @var ListArticle $x
         */
        foreach ($xs as $x) {
            $txt = '- '.$x->uuid.' '.$x->title;
            $output->writeln($txt);
        }
    }
}


text:
<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

/**
 * App\RecipeStep
 *
 * @property int $id
 * @property int $recipe_id
 * @property string $name
 * @property string $body
 * @property \Carbon\Carbon $created_at
 * @property \Carbon\Carbon $updated_at
 * @property-read \App\Recipe $recipe
 * @method static \Illuminate\Database\Query\Builder|\App\RecipeStep whereBody($value)
 * @method static \Illuminate\Database\Query\Builder|\App\RecipeStep whereCreatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\RecipeStep whereId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\RecipeStep whereName($value)
 * @method static \Illuminate\Database\Query\Builder|\App\RecipeStep whereRecipeId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\RecipeStep whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class RecipeStep extends Model
{
    protected $fillable = [
        "title",
        "body",
    ];

    public function recipe() {
        return $this->belongsTo("App\\Recipe");
    }
}


text:
using Umbraco.Core.Models;
using Umbraco.Core.Models.Rdbms;

namespace Umbraco.Core.Persistence.Factories
{
    internal class ServerRegistrationFactory
    {
        #region Implementation of IEntityFactory<Language,LanguageDto>

        public ServerRegistration BuildEntity(ServerRegistrationDto dto)
        {
            var model = new ServerRegistration(dto.Id, dto.ServerAddress, dto.ServerIdentity, dto.DateRegistered, dto.DateAccessed, dto.IsActive);
            //on initial construction we don't want to have dirty properties tracked
            // http://issues.umbraco.org/issue/U4-1946
            model.ResetDirtyProperties(false);
            return model;
        }

        public ServerRegistrationDto BuildDto(ServerRegistration entity)
        {
            var dto = new ServerRegistrationDto
                {
                    ServerAddress = entity.ServerAddress,
                    DateRegistered = entity.CreateDate,
                    IsActive = entity.IsActive,
                    DateAccessed = entity.UpdateDate,
                    ServerIdentity = entity.ServerIdentity
                };

            if (entity.HasIdentity)
                dto.Id = entity.Id;

            return dto;
        }

        #endregion
    }
}