text:
namespace v8 {
namespace internal {
namespace wasm {
namespace gdb_server {

class Packet;
class TransportBase;

// Represents a gdb-remote debugging session.
class V8_EXPORT_PRIVATE Session {
 public:
  explicit Session(TransportBase* transport);

  // Attempt to send a packet and optionally wait for an ACK from the receiver.
  bool SendPacket(Packet* packet, bool expect_ack = true);

  // Attempt to receive a packet.
  bool GetPacket(Packet* packet);

  // Return true if there is data to read.
  bool IsDataAvailable() const;

  // Return true if the connection is still valid.
  bool IsConnected() const;

  // Shutdown the connection.
  void Disconnect();

  // When a debugging session is active, the GDB-remote thread can block waiting
  // for events and it will resume execution when one of these two events arise:
  // - A network event (a new packet arrives, or the connection is dropped)
  // - A thread event (the execution stopped because of a trap or breakpoint).
  void WaitForDebugStubEvent();

  // Signal that the debuggee execution stopped because of a trap or breakpoint.
  bool SignalThreadEvent();

  // By default, when either the debugger or the GDB-stub sends a packet,
  // the first response expected is an acknowledgment: either '+' (to indicate
  // the packet was received correctly) or '-' (to request retransmission).
  // When a transport is reliable, the debugger may request that acknowledgement
  // be disabled by means of the 'QStartNoAckMode' packet.
  void EnableAck(bool ack_enabled) { ack_enabled_ = ack_enabled; }

 private:
  // Read a single character from the transport.
  bool GetChar(char* ch);

  // Read the content of a packet, from a leading '$' to a trailing '#'.
  bool GetPayload(Packet* pkt, uint8_t* checksum);

  TransportBase* io_;  // Transport object not owned by the Session.
  bool connected_;     // Is the connection still valid.
  bool ack_enabled_;   // If true, emit or wait for '+' from RSP stream.

  DISALLOW_COPY_AND_ASSIGN(Session);
};

}  // namespace gdb_server
}  // namespace wasm
}  // namespace internal
}  // namespace v8

#endif  // V8_DEBUG_WASM_GDB_SERVER_SESSION_H_

redpajama_set_name: RedPajamaGithub


text:
export const RoomSettingsEnum = {
	NAME: 'roomName',
	TOPIC: 'roomTopic',
	ANNOUNCEMENT: 'roomAnnouncement',
	DESCRIPTION: 'roomDescription',
	READ_ONLY: 'readOnly',
	REACT_WHEN_READ_ONLY: 'reactWhenReadOnly',
	ARCHIVE_OR_UNARCHIVE: 'archiveOrUnarchive',
	JOIN_CODE: 'joinCode'
};

export const UiTextContext = {
	CLOSE_WARNING: 'closeWarning',
	HIDE_WARNING: 'hideWarning',
	LEAVE_WARNING: 'leaveWarning',
	NO_ROOMS_SUBSCRIBED: 'noRoomsSubscribed'
};

export class RoomTypeRouteConfig {
	constructor({ name, path }) {
		if (typeof name !== 'undefined' && (typeof name !== 'string' || name.length === 0)) {
			throw new Error('The name must be a string.');
		}

		if (typeof path !== 'undefined' && (typeof path !== 'string' || path.length === 0)) {
			throw new Error('The path must be a string.');
		}

		this._name = name;
		this._path = path;
	}

	get name() {
		return this._name;
	}

	get path() {
		return this._path;
	}
}

export class RoomTypeConfig {
	constructor({
		identifier = Random.id(),
		order,
		icon,
		header,
		label,
		route
	}) {
		if (typeof identifier !== 'string' || identifier.length === 0) {
			throw new Error('The identifier must be a string.');
		}

		if (typeof order !== 'number') {
			throw new Error('The order must be a number.');
		}

		if (typeof icon !== 'undefined' && (typeof icon !== 'string' || icon.length === 0)) {
			throw new Error('The icon must be a string.');
		}

		if (typeof header !== 'undefined' && (typeof header !== 'string' || header.length === 0)) {
			throw new Error('The header must be a string.');
		}

		if (typeof label !== 'undefined' && (typeof label !== 'string' || label.length === 0)) {
			throw new Error('The label must be a string.');
		}

		if (typeof route !== 'undefined' && !(route instanceof RoomTypeRouteConfig)) {
			throw new Error('Room\'s route is not a valid route configuration. Must be an instance of "RoomTypeRouteConfig".');
		}

		this._identifier = identifier;
		this._order = order;
		this._icon = icon;
		this._header = header;
		this._label = label;
		this._route = route;
	}

	/**
	 * The room type's internal identifier.
	 */
	get identifier() {
		return this._identifier;
	}

	/**
	 * The order of this room type for the display.
	 */
	get order() {
		return this._order;
	}

	/**
	 * Sets the order of this room type for the display.
	 *
	 * @param {number} order the number value for the order
	 */
	set order(order) {
		if (typeof order !== 'number') {
			throw new Error('The order must be a number.');
		}

		this._order = order;
	}

	/**
	 * The icon class, css, to use as the visual aid.
	 */
	get icon() {
		return this._icon;
	}

	/**
	 * The header name of this type.
	 */
	get header() {
		return this._header;
	}

	/**
	 * The i18n label for this room type.
	 */
	get label() {
		return this._label;
	}

	/**
	 * The route config for this room type.
	 */
	get route() {
		return this._route;
	}

	/**
	 * Gets the room's name to display in the UI.
	 *
	 * @param {object} room
	 */
	getDisplayName(room) {
		return room.name;
	}

	allowRoomSettingChange(/* room, setting */) {
		return true;
	}

	canBeCreated() {
		return Meteor.isServer ?
			RocketChat.authz.hasAtLeastOnePermission(Meteor.userId(), [`create-${ this._identifier }`]) :
			RocketChat.authz.hasAtLeastOnePermission([`create-${ this._identifier }`]);
	}

	canBeDeleted(room) {
		return Meteor.isServer ?
			RocketChat.authz.hasAtLeastOnePermission(Meteor.userId(), [`delete-${ room.t }`], room._id) :
			RocketChat.authz.hasAtLeastOnePermission([`delete-${ room.t }`], room._id);
	}

	supportMembersList(/* room */) {
		return true;
	}

	isGroupChat() {
		return false;
	}

	canAddUser(/* userId, room */) {
		return false;
	}

	userDetailShowAll(/* room */) {
		return true;
	}

	userDetailShowAdmin(/* room */) {
		return true;
	}

	preventRenaming(/* room */) {
		return false;
	}

	includeInRoomSearch() {
		return false;
	}

	enableMembersListProfile() {
		return false;
	}

	/**
	 * Returns a text which can be used in generic UIs.
	 * @param context The role of the text in the UI-Element
	 * @return {string} A text or a translation key - the consumers of this method will pass the
	 * returned value to an internationalization library
	 */
	getUiText(/* context */) {
		return '';
	}
}


text:
/*global console */

import ModalDialog from 'ghost/components/gh-modal-dialog';

var UploadModal = ModalDialog.extend({
    layoutName: 'components/gh-modal-dialog',

    didInsertElement: function () {
        this._super();

        // @TODO: get this real
        console.log('UploadController:afterRender');
        // var filestorage = $('#' + this.options.model.id).data('filestorage');
        // this.$('.js-drop-zone').upload({fileStorage: filestorage});
    },

    actions: {
        closeModal: function () {
            this.sendAction();
        },
        confirm: function (type) {
            var func = this.get('confirm.' + type + '.func');
            if (typeof func === 'function') {
                func();
            }
            this.sendAction();
        }
    },

});

export default UploadModal;


text:
<?php
/**
 *
 * @author pysche
 * @version
 */

class Zend_View_Helper_Successmsg extends Bc_View_Helper_Weshop {

}


text:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace freelancehunt
{
    class clsConfig
    {
        public static bool AutoRun;     //Запускать вместе с Windows?
        public static bool AutoLogin;   //Оставлять логин при выходе?
        public static bool StartHidden; //Запускать свернутым?
        public static bool NotifyInterestProjOnly; //Уведомлять только о проектах из выбранных категорий
        public static bool ShowUpdateWindow;     //Показывать всплывающее окно?
        public static bool AutoHideUpdateWindow; //убирать или оставлять всплывающее окно?

        public static bool ShowInterestProjOnly; //Показывать только проекты из выбранных категорий

        //public static bool SoundNotification; //Звуковое уведомление

        public static int HideUpdateWindowTime;  //Время отображения frmUpdateInfo
        public static int UpdateFreq; // частота обновления

        public static void loadConfig()
        {
            string exMes = null;
            StreamReader sr = null;
            try
            {
                sr = new StreamReader(Directory.GetCurrentDirectory() + "\\Config.conf");

                string AtRn = sr.ReadLine().Trim();  //Запускать вместе с Windows?
                if (AtRn == "True") { clsConfig.AutoRun = true; } //Да
                else { clsConfig.AutoRun = false; } //нет

                string AtLgn = sr.ReadLine().Trim();  //Оставлять логин при выходе?
                if (AtLgn == "True") { clsConfig.AutoLogin = true; } //Да
                else { clsConfig.AutoLogin = false; } //нет

                string StrtHdn = sr.ReadLine().Trim();  //Запускать свернутым?
                if (StrtHdn == "True") { clsConfig.StartHidden = true; } //Да
                else { clsConfig.StartHidden = false; } //нет

                string NtfIntrstPrj = sr.ReadLine().Trim();  //Уведомлять только о проектах из выбранных категорий
                if (NtfIntrstPrj == "True") { clsConfig.NotifyInterestProjOnly = true; } //Да
                else { clsConfig.NotifyInterestProjOnly = false; } //Уведомлять о всех проектах

                string ShwUpdWindow = sr.ReadLine().Trim();  //показывать всплывающее окно?
                if (ShwUpdWindow == "True") { clsConfig.ShowUpdateWindow = true; } //Да
                else { clsConfig.ShowUpdateWindow = false; } //нет

                string AutoHideUpdWindow = sr.ReadLine().Trim();  //убирать или оставлять всплывающее окно?
                if (AutoHideUpdWindow == "True") { clsConfig.AutoHideUpdateWindow = true; } //Да
                else { clsConfig.AutoHideUpdateWindow = false; } //нет

                string ShwIntrstPrj = sr.ReadLine().Trim();  //Показывать только проекты из выбранных категорий
                if (ShwIntrstPrj == "True") { clsConfig.ShowInterestProjOnly = true; } //Да
                else { clsConfig.ShowInterestProjOnly = false; } //Показывать все проекты

                //string SndNtf = sr.ReadLine().Trim();  //Звуковое уведомление
                //if (SndNtf == "True") { clsConfig.SoundNotification = true; } //Да
                //else { clsConfig.SoundNotification = false; } //нет

                clsConfig.HideUpdateWindowTime = Convert.ToInt16(sr.ReadLine().Trim()); //Время отображения frmUpdateInfo

                clsConfig.UpdateFreq = Convert.ToInt16(sr.ReadLine().Trim());           // частота обновления

                sr.Close();

            }
            catch (Exception ex) { exMes = ex.Message; }
            if (exMes != null)
            {
                if (sr != null) { sr.Close(); }
                CreateDefaultConfig();
            }
        }

        public static void saveConfig() {
            StreamWriter sr = new StreamWriter(Directory.GetCurrentDirectory() + "\\Config.conf");

            //Запускать вместе с Windows?
            if (AutoRun) { sr.WriteLine("True"); } //Да
            else { sr.WriteLine("False"); } //нет

            //Оставлять логин при выходе?
            if (AutoLogin) { sr.WriteLine("True"); } //Да
            else { sr.WriteLine("False"); } //нет

            //Запускать свернутым?
            if (StartHidden) { sr.WriteLine("True"); } //Да
            else { sr.WriteLine("False"); } //нет

            //Уведомлять только о проектах из выбранных категорий
            if (NotifyInterestProjOnly) { sr.WriteLine("True"); } //Да
            else { sr.WriteLine("False"); } //нет

            //Показывать всплывающее окно?
            if (ShowUpdateWindow) { sr.WriteLine("True"); } //Да
            else { sr.WriteLine("False"); } //нет

            //убирать или оставлять всплывающее окно?
            if (AutoHideUpdateWindow) { sr.WriteLine("True"); } //Да
            else { sr.WriteLine("False"); } //нет

            //Показывать только проекты из выбранных категорий
            if (ShowInterestProjOnly) { sr.WriteLine("True"); } //Да
            else { sr.WriteLine("False"); } //нет

            //Звуковое уведомление
            //if (SoundNotification) { sr.WriteLine("True"); } //Да
            //else { sr.WriteLine("False"); } //нет

            sr.WriteLine(clsConfig.HideUpdateWindowTime.ToString());   //Время скрытия frmUpdateInfo (сек)
            sr.WriteLine(clsConfig.UpdateFreq.ToString());    // частота обновления (мин)

            sr.Close();
        }

        private static void CreateDefaultConfig() //создание нового файла конфигурации с параметрами по умолчанию
        {
            StreamWriter sr = new StreamWriter(Directory.GetCurrentDirectory() + "\\Config.conf");

            sr.WriteLine("False"); //Запускать вместе с Windows?
            sr.WriteLine("True");  //Оставлять логин при выходе?
            sr.WriteLine("True");  //Запускать свернутым?
            sr.WriteLine("True"); //Уведомлять только о проектах из выбранных категорий
            sr.WriteLine("True");  //Показывать всплывающее окно?
            sr.WriteLine("True");  //Убирать всплывающее окно?
            sr.WriteLine("True"); //Показывать только проекты из выбранных категорий
            //sr.WriteLine("False"); //Звуковое уведомление
            sr.WriteLine("10");    //Время скрытия frmUpdateInfo (сек)
            sr.WriteLine("1");     //Частота обновления (мин)

            sr.Close();

            loadConfig();
        }

    }
}


text:
class ApiController < ApplicationController
  protect_from_forgery with: :null_session
end


text:
<?php
namespace Phi\MVCWP\Controller;

/**
 * The BaseController class contains the common methods to all controller classes.
 * This is implemented by controllers such as {@link AdminController} and {@link PageController}.
 */
abstract class BaseController {
	private $title;
	private $slug;
	private $viewPath;

	/**
	 * Sets the default slug and title for the page;
	 */
	public function __construct() {
		$this->slug = strtolower( get_class() ); //default slug
		$this->title = get_class(); //default title

		//use some reflection to magically get the view path
		$rc = new \ReflectionClass( get_class( $this ) );
		$this->setViewPath( realpath( dirname( $rc->getFileName() ) . '/../View/' . $rc->getShortName() ) );
	}

	/**
	 * Determines the correct method to call and passes in the params.
	 */
	public function dispatch() {
		$action = isset( $_GET['action'] ) ? $_GET['action'] . 'Action' : 'indexAction';
		$param = isset( $_GET['param'] ) ? $_GET['param'] : null;

		$this->$action( $param );
	}

	/**
	 * Sets the URL slug of the page.
	 * @param $slug the slug
	 */
	public function setSlug( $slug ) {
		$this->slug = $slug;
	}

	/**
	 * Returns the slug of the page.
	 * @return the slug
	 */
	public function getSlug() {
		return $this->slug;
	}

	/**
	 * Sets the title of the page.
	 * @param $title the title
	 */
	public function setTitle( $title ) {
		$this->title = $title;
	}

	/**
	 * Returns the title of the page.
	 * @return the title
	 */
	public function getTitle() {
		return $this->title;
	}

	protected function getURL() {
		return admin_url() . 'admin.php?page=' . $this->getSlug();
	}

	protected function isPost() {
		return !empty( $_POST );
	}

	protected function getPost() {
		return (object)$_POST;
	}

	protected function getDatabase() {
			global $wpdb;
			return $wpdb;
	}

	/**
	 * The index is implemented by all children.
	 */
	abstract public function indexAction();

	/**
	 * Sets the path for the view.
	 * @param $path the path of the view
	 */
	public function setViewPath( $path ) {
		$this->viewPath = $path;
	}

	/**
	 * Gets the view path.
	 * @return the view path
	 */
	public function getViewPath() {
		return $this->viewPath;
	}

	/**
	 * Includes the view into the page and passes $data to the view.
	 */
	public function view( $data=array() ) {
		$function = debug_backtrace()[1]['function']; //get calling function
		$action = substr( $function, 0, strlen( $function ) - 6 );

		//make the variables
		foreach( $data as $key=>$value )
			$$key = $value;

		echo '

';
		require $this->getViewPath() . DIRECTORY_SEPARATOR . $action . '.phtml';
		echo '

';
	}
}


text:
SimpleDropDownEffects
=========

A jQuery plugin for transforming select inputs into drop-down lists with some simple expanding effects.

[article on Codrops](http://tympanus.net/codrops/?p=12452)

[demo](http://tympanus.net/Development/SimpleDropDownEffects)

Licensed under the MIT License


text:
package pack.pack1;

public class A {
	private int x;
	int y;
	protected int z;

}


text:
/*
 *  @author  Anthony Chan
 */

package viewer.zoomable;

import java.awt.Dialog;

import base.drawable.TimeBoundingBox;

/*
   Define the interface to be implemented by the view object, ScrollableView,
   so that time averaged quantity can be returned.
*/

public interface SummarizableView
{
    public InitializableDialog createSummary( final Dialog          dialog,
                                              final TimeBoundingBox timebox );
}


text:
'use strict'

var buddyQuery = require('./buddyQuery')
var config = require('../config')

function getContactGroups (options, callback) {
  if (!options) {
    return callback(new Error('Missing required input: options'), null)
  }
  if (!options.results) {
    return callback(new Error('Missing required input: options.results'), null)
  }
  if (!options.query) {
    return callback(new Error('Missing required input: options.query'), null)
  }
  if (!options.search) {
    return callback(new Error('Missing required input: options.search'), null)
  }
  if (!options.username) {
    return callback(new Error('Missing required input: options.username'), null)
  }

  if (!options.results['contactGroups']) {
    return callback(null, options)
  }
  var results = options.results
  var contactGroups = results['contactGroups']
  var i = 0
  var list = []
  contactGroups.forEach(function (item) {
    var search = item
    var qry = options.query.contactTeacherGroups.replace('@contactGroups', search)
    qry = qry.replace('@atferdGroup', config.extens.atferd_group)
    qry = qry.replace('@ordenGroup', config.extens.orden_group)
    qry = qry.replace('@proveGroup', config.extens.prove_group)
    buddyQuery(qry, function (err, groups) {
      if (err) {
        return callback(err)
      }
      Array.prototype.push.apply(list, groups[0])
      i++
      if (i === contactGroups.length) {
        options.results['contactGroups'] = list
        return callback(null, options)
      }
    })
  })
}

module.exports = getContactGroups


text:
import {State} from './data';
import {ProjectionsPanel} from './vz-projector-projections-panel';

const assert = chai.assert;

describe('restoreUIFromBookmark', () => {
  let projectionsPanel: ProjectionsPanel;
  beforeEach(() => {
    projectionsPanel = document.createElement(ProjectionsPanel.prototype.is) as
        ProjectionsPanel;

    // Set up some of the UI so the elements are found in the production code.
    const tsnePerplexityContainer = document.createElement('div');
    tsnePerplexityContainer.className = 'tsne-perplexity';
    const tsnePerplexity = document.createElement('span');
    tsnePerplexityContainer.appendChild(tsnePerplexity);
    projectionsPanel.appendChild(tsnePerplexityContainer);

    const tsneLearningRateContainer = document.createElement('div');
    tsneLearningRateContainer.className = 'tsne-learning-rate';
    const tsneLearningRate = document.createElement('span');
    tsneLearningRateContainer.appendChild(tsneLearningRate);
    projectionsPanel.appendChild(tsneLearningRateContainer);
  });

  it('sets the pcaX/Y properties when setting 2D component values', () => {
    spyOn(projectionsPanel, 'setZDropdownEnabled');

    const s = new State();
    s.pcaComponentDimensions = [0, 1];
    projectionsPanel.restoreUIFromBookmark(s);

    assert.equal(0, projectionsPanel.pcaX);
    assert.equal(1, projectionsPanel.pcaY);

    expect(projectionsPanel.setZDropdownEnabled).toHaveBeenCalledWith(false);
  });

  it('sets the pcaX/Y properties when setting 3D component values', () => {
    spyOn(projectionsPanel, 'setZDropdownEnabled');

    const s = new State();
    s.pcaComponentDimensions = [0, 1, 2];
    projectionsPanel.restoreUIFromBookmark(s);

    assert.equal(0, projectionsPanel.pcaX);
    assert.equal(1, projectionsPanel.pcaY);
    assert.equal(2, projectionsPanel.pcaZ);

    expect(projectionsPanel.setZDropdownEnabled).toHaveBeenCalledWith(true);
  });
});

describe('populateBookmarkFromUI', () => {
  let projectionsPanel: ProjectionsPanel;

  beforeEach(() => {
    projectionsPanel = document.createElement(ProjectionsPanel.prototype.is) as
        ProjectionsPanel;

    // Set up some of the UI so the elements are found in the production code.
    const tsnePerplexityContainer = document.createElement('div');
    tsnePerplexityContainer.className = 'tsne-perplexity';
    const tsnePerplexity = document.createElement('span');
    tsnePerplexityContainer.appendChild(tsnePerplexity);
    projectionsPanel.appendChild(tsnePerplexityContainer);

    const tsneLearningRateContainer = document.createElement('div');
    tsneLearningRateContainer.className = 'tsne-learning-rate';
    const tsneLearningRate = document.createElement('span');
    tsneLearningRateContainer.appendChild(tsneLearningRate);
    projectionsPanel.appendChild(tsneLearningRateContainer);
  });

  it('gets the PCA component UI values from a 2D PCA projection', () => {
    projectionsPanel.pcaX = 0;
    projectionsPanel.pcaY = 1;
    projectionsPanel.pcaIs3d = false;

    const s = new State();
    projectionsPanel.populateBookmarkFromUI(s);
    assert.deepEqual([0, 1], s.pcaComponentDimensions);
  });

  it('gets the PCA component UI values from a 3D PCA projection', () => {
    projectionsPanel.pcaX = 0;
    projectionsPanel.pcaY = 1;
    projectionsPanel.pcaZ = 2;
    projectionsPanel.pcaIs3d = true;

    const s = new State();
    projectionsPanel.populateBookmarkFromUI(s);
    assert.deepEqual([0, 1, 2], s.pcaComponentDimensions);
  });
});


text:
export default class Hook {
  constructor() {
    this.hookList = new Map();
  }

  on(typeEvent, listener) {
    if (!this.hookList) {
      this.hookList = new Map();
    }

    if (!this.hookList.has(typeEvent)) {
      this.hookList.set(typeEvent, [listener]);
    } else {
      this.hookList.get(typeEvent).push(listener);
    }
  }

  emit(typeEvent, ...rest) {
    if (!this.hookList) {
      this.hookList = new Map();
    }

    if (!this.hookList.has(typeEvent)) {
      throw new Error(`There is no ${typeEvent} event setted!`);
    }

    this.hookList.get(typeEvent).forEach(listener => listener(...rest));
  }
}


text:
[Full Changelog](https://github.com/cvent/octopus-deploy-cookbook/compare/v0.13.2...v0.13.3)

**Implemented enhancements:**

- Support the force registration of tentacles [\#153](https://github.com/cvent/octopus-deploy-cookbook/pull/153) ([JamieH89](https://github.com/JamieH89))

**Fixed bugs:**

- Fix tentacle registration for newer tentacles by generating cert after instance creation [\#173](https://github.com/cvent/octopus-deploy-cookbook/pull/173) ([NamanKumarCvent](https://github.com/NamanKumarCvent))

## [v0.13.2](https://github.com/cvent/octopus-deploy-cookbook/tree/v0.13.2) (2019-04-09)

[Full Changelog](https://github.com/cvent/octopus-deploy-cookbook/compare/v0.13.1...v0.13.2)

**Implemented enhancements:**

- Disable tentacle proxy [\#140](https://github.com/cvent/octopus-deploy-cookbook/pull/140) ([gdavison](https://github.com/gdavison))
- Move the server scripts into a library generated by ERB [\#126](https://github.com/cvent/octopus-deploy-cookbook/pull/126) ([brentm5](https://github.com/brentm5))

**Fixed bugs:**

- Escape spaces in certificate file [\#142](https://github.com/cvent/octopus-deploy-cookbook/pull/142) ([FireEater64](https://github.com/FireEater64))

**Merged pull requests:**

- Add contributing documentation for supermarket [\#138](https://github.com/cvent/octopus-deploy-cookbook/pull/138) ([brentm5](https://github.com/brentm5))
- Add testing documentation for supermarket [\#137](https://github.com/cvent/octopus-deploy-cookbook/pull/137) ([brentm5](https://github.com/brentm5))

## [v0.13.1](https://github.com/cvent/octopus-deploy-cookbook/tree/v0.13.1) (2018-03-06)

[Full Changelog](https://github.com/cvent/octopus-deploy-cookbook/compare/v0.13.0...v0.13.1)

**Fixed bugs:**

- Fix an issue with registering tentacles with tenated\_deployment\_participation not specified [\#136](https://github.com/cvent/octopus-deploy-cookbook/pull/136) ([brentm5](https://github.com/brentm5))

**Merged pull requests:**

- Correct readme database instructions [\#133](https://github.com/cvent/octopus-deploy-cookbook/pull/133) ([spuder](https://github.com/spuder))

## [v0.13.0](https://github.com/cvent/octopus-deploy-cookbook/tree/v0.13.0) (2018-03-05)

[Full Changelog](https://github.com/cvent/octopus-deploy-cookbook/compare/v0.12.0...v0.13.0)

**Implemented enhancements:**

- Allow tentacle to run as untenanted [\#130](https://github.com/cvent/octopus-deploy-cookbook/pull/130) ([spuder](https://github.com/spuder))
- Make cookbook works for chef 13+ [\#125](https://github.com/cvent/octopus-deploy-cookbook/pull/125) ([brentm5](https://github.com/brentm5))
- Bump chef\_version in metadata to 12.6.0 [\#116](https://github.com/cvent/octopus-deploy-cookbook/pull/116) ([spuder](https://github.com/spuder))
- Adds chef\_version requirement to metadata.rb [\#106](https://github.com/cvent/octopus-deploy-cookbook/pull/106) ([spuder](https://github.com/spuder))

**Fixed bugs:**

- Adds default node name for server resource [\#108](https://github.com/cvent/octopus-deploy-cookbook/pull/108) ([spuder](https://github.com/spuder))
- Validate connection\_string in configure service resource [\#103](https://github.com/cvent/octopus-deploy-cookbook/pull/103) ([spuder](https://github.com/spuder))

## [v0.12.0](https://github.com/cvent/octopus-deploy-cookbook/tree/v0.12.0) (2017-05-25)

[Full Changelog](https://github.com/cvent/octopus-deploy-cookbook/compare/v0.11.0...v0.12.0)

**Implemented enhancements:**

- Update the server resource to use the new style in resources [\#96](https://github.com/cvent/octopus-deploy-cookbook/pull/96) ([brentm5](https://github.com/brentm5))
- Update tentacle resource to work with new resource declarations [\#94](https://github.com/cvent/octopus-deploy-cookbook/pull/94) ([brentm5](https://github.com/brentm5))
- Update tools resource to work with new resource declarations [\#93](https://github.com/cvent/octopus-deploy-cookbook/pull/93) ([brentm5](https://github.com/brentm5))

## [v0.11.0](https://github.com/cvent/octopus-deploy-cookbook/tree/v0.11.0) (2017-05-08)

[Full Changelog](https://github.com/cvent/octopus-deploy-cookbook/compare/v0.10.1...v0.11.0)

**Implemented enhancements:**

- Use sensitive attribute for server resource instead of debug [\#89](https://github.com/cvent/octopus-deploy-cookbook/pull/89) ([brentm5](https://github.com/brentm5))

**Fixed bugs:**

- Removes the Server resources delayed restart [\#83](https://github.com/cvent/octopus-deploy-cookbook/pull/83) ([brentm5](https://github.com/brentm5))

## [v0.10.1](https://github.com/cvent/octopus-deploy-cookbook/tree/v0.10.1) (2017-04-13)

[Full Changelog](https://github.com/cvent/octopus-deploy-cookbook/compare/v0.10.0...v0.10.1)

**Implemented enhancements:**

- This adds a debug parameter to the server resource [\#81](https://github.com/cvent/octopus-deploy-cookbook/pull/81) ([brentm5](https://github.com/brentm5))

## [v0.10.0](https://github.com/cvent/octopus-deploy-cookbook/tree/v0.10.0) (2017-01-05)

[Full Changelog](https://github.com/cvent/octopus-deploy-cookbook/compare/v0.9.0...v0.10.0)

**Implemented enhancements:**

- Add tools resource to allow installing of octopus deploy tools [\#77](https://github.com/cvent/octopus-deploy-cookbook/pull/77) ([brentm5](https://github.com/brentm5))

## [v0.9.0](https://github.com/cvent/octopus-deploy-cookbook/tree/v0.9.0) (2016-11-10)

[Full Changelog](https://github.com/cvent/octopus-deploy-cookbook/compare/v0.8.0...v0.9.0)

**Implemented enhancements:**

- Add attribute to allow public hostname to be specified on tentacle register [\#74](https://github.com/cvent/octopus-deploy-cookbook/pull/74) ([Draftkings](https://github.com/Draftkings))
- Update README with correct capitalization of Tentacle [\#73](https://github.com/cvent/octopus-deploy-cookbook/pull/73) ([vanessalove](https://github.com/vanessalove))

## [v0.8.0](https://github.com/cvent/octopus-deploy-cookbook/tree/v0.8.0) (2016-11-01)

[Full Changelog](https://github.com/cvent/octopus-deploy-cookbook/compare/v0.7.0...v0.8.0)

**Implemented enhancements:**

- Add ability to run tentacle as a specific AD user [\#71](https://github.com/cvent/octopus-deploy-cookbook/pull/71) ([gdavison](https://github.com/gdavison))
- Add attribute to allow tentacle name to be changed on register  [\#70](https://github.com/cvent/octopus-deploy-cookbook/pull/70) ([gdavison](https://github.com/gdavison))

## [v0.7.0](https://github.com/cvent/octopus-deploy-cookbook/tree/v0.7.0) (2016-10-04)

[Full Changelog](https://github.com/cvent/octopus-deploy-cookbook/compare/v0.6.5...v0.7.0)

**Implemented enhancements:**

- Loosen up dependency version locking [\#68](https://github.com/cvent/octopus-deploy-cookbook/pull/68) ([blairham](https://github.com/blairham))
- Updates readme to clarify tenant tag grouping [\#67](https://github.com/cvent/octopus-deploy-cookbook/pull/67) ([spuder](https://github.com/spuder))

## [v0.6.5](https://github.com/cvent/octopus-deploy-cookbook/tree/v0.6.5) (2016-09-21)

[Full Changelog](https://github.com/cvent/octopus-deploy-cookbook/compare/v0.6.4...v0.6.5)

**Implemented enhancements:**

- Allow multiple environments when registering tentacles [\#65](https://github.com/cvent/octopus-deploy-cookbook/pull/65) ([gdavison](https://github.com/gdavison))

## [v0.6.4](https://github.com/cvent/octopus-deploy-cookbook/tree/v0.6.4) (2016-09-07)

[Full Changelog](https://github.com/cvent/octopus-deploy-cookbook/compare/v0.6.3...v0.6.4)

**Implemented enhancements:**

- Adds tenant and tentanttag support [\#61](https://github.com/cvent/octopus-deploy-cookbook/pull/61) ([spuder](https://github.com/spuder))

**Fixed bugs:**

- Fix option\_list methods handling of nils [\#60](https://github.com/cvent/octopus-deploy-cookbook/pull/60) ([spuder](https://github.com/spuder))

## [v0.6.3](https://github.com/cvent/octopus-deploy-cookbook/tree/v0.6.3) (2016-08-18)

[Full Changelog](https://github.com/cvent/octopus-deploy-cookbook/compare/v0.6.2...v0.6.3)

**Fixed bugs:**

- Fix issue in notifying tentacle service restart on tentacle register [\#57](https://github.com/cvent/octopus-deploy-cookbook/pull/57) ([spuder](https://github.com/spuder))
- Restarts tentacle service when registering [\#56](https://github.com/cvent/octopus-deploy-cookbook/pull/56) ([spuder](https://github.com/spuder))

## [v0.6.2](https://github.com/cvent/octopus-deploy-cookbook/tree/v0.6.2) (2016-08-16)

[Full Changelog](https://github.com/cvent/octopus-deploy-cookbook/compare/v0.6.1...v0.6.2)

**Fixed bugs:**

- Change tentacle install parameters to be more quiet [\#52](https://github.com/cvent/octopus-deploy-cookbook/pull/52) ([brentm5](https://github.com/brentm5))

## [v0.6.1](https://github.com/cvent/octopus-deploy-cookbook/tree/v0.6.1) (2016-08-15)

[Full Changelog](https://github.com/cvent/octopus-deploy-cookbook/compare/v0.6.0...v0.6.1)

**Implemented enhancements:**

- Add unit test to validate library assumptions [\#49](https://github.com/cvent/octopus-deploy-cookbook/pull/49) ([brentm5](https://github.com/brentm5))
- Refactor registering tentacle resource [\#47](https://github.com/cvent/octopus-deploy-cookbook/pull/47) ([brentm5](https://github.com/brentm5))

## [v0.6.0](https://github.com/cvent/octopus-deploy-cookbook/tree/v0.6.0) (2016-08-08)

[Full Changelog](https://github.com/cvent/octopus-deploy-cookbook/compare/v0.5.1...v0.6.0)

**Implemented enhancements:**

- Set tentacle register environment default to be the chef environment [\#45](https://github.com/cvent/octopus-deploy-cookbook/pull/45) ([spuder](https://github.com/spuder))
- Add ability for the tentacle resource to setup firewall rule for listening tentacles [\#43](https://github.com/cvent/octopus-deploy-cookbook/pull/43) ([spuder](https://github.com/spuder))
- Add changelog generator and first changelog file [\#39](https://github.com/cvent/octopus-deploy-cookbook/pull/39) ([brentm5](https://github.com/brentm5))
- Add ability to register tentacle with server through tentacle resource  [\#33](https://github.com/cvent/octopus-deploy-cookbook/pull/33) ([spuder](https://github.com/spuder))
- Include optional master key attribute for configuring a server instance [\#25](https://github.com/cvent/octopus-deploy-cookbook/pull/25) ([brentm5](https://github.com/brentm5))

## [v0.5.1](https://github.com/cvent/octopus-deploy-cookbook/tree/v0.5.1) (2016-04-04)

[Full Changelog](https://github.com/cvent/octopus-deploy-cookbook/compare/v0.5.0...v0.5.1)

**Fixed bugs:**

- Fix issue with notifying service to restart when its disabled! [\#22](https://github.com/cvent/octopus-deploy-cookbook/pull/22) ([brentm5](https://github.com/brentm5))

\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*


text:
package org.apereo.portal.portlets;

import static org.junit.Assert.*;

import java.util.Arrays;
import org.junit.Test;

public class StringListAttributeTest {

    @Test
    public void testIsBlank_true() {

        final String[][] blankScenarios =
                new String[][] {
                    // Zero entries
                    new String[] {},
                    // Null entry
                    new String[] {null},
                    // Zero-length entry
                    new String[] {""},
                    // Whitespace entry
                    new String[] {" "},
                    // All of the above
                    new String[] {null, "", " "}
                };

        for (String[] blank : blankScenarios) {
            StringListAttribute sla = new StringListAttribute(blank);
            assertTrue(
                    "StringListAttribute should be blank for values:  " + Arrays.toString(blank),
                    sla.isBlank());
        }
    }

    @Test
    public void testIsBlank_false() {

        final String[][] nonBlankScenarios =
                new String[][] {
                    // One good entry
                    new String[] {"foobar"},
                    // Multiple good entries
                    new String[] {"Wynken", "Blynken", "Nod"}
                };

        for (String[] nonBlank : nonBlankScenarios) {
            StringListAttribute sla = new StringListAttribute(nonBlank);
            assertFalse(
                    "StringListAttribute should NOT be blank for values:  "
                            + Arrays.toString(nonBlank),
                    sla.isBlank());
        }
    }
}


text:
@class KWContextNode;
@class KWCallSite;

@interface KWPendingNode : NSObject<KWExampleNode>

@property (nonatomic, readonly, strong) KWContextNode *context;

#pragma mark - Initializing

- (id)initWithCallSite:(KWCallSite *)aCallSite context:(KWContextNode *)context description:(NSString *)aDescription;

+ (id)pendingNodeWithCallSite:(KWCallSite *)aCallSite context:(KWContextNode *)context description:(NSString *)aDescription;

#pragma mark - Getting Call Sites

@property (nonatomic, readonly) KWCallSite *callSite;

#pragma mark - Getting Descriptions

@property (nonatomic, readonly) NSString *description;

@end


text:
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;

/**
 * Created by jose.perdomo on 22/08/2014.
 */
public class CustomView extends View {
    public CustomView(Context context) {
        super(context);
    }

    public CustomView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public CustomView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    }
}


text:
class Hash

  attr_accessor :fallback

  # Define a fallback object for #fetch and #[].
  #
  #   f = Hash[:b=>2]
  #   h = Hash[:a=>1].having_aquisition(f)
  #   h[:b] => 2

  def having_aquisition(fallback)

    @fallback = fallback

    unless @fallsback

      def self.[](key)
        begin
          return @fallback[key] if @fallback and not key?(key)
        rescue
        end
        val = super
p val
        val.fallback(self) if Hash == val
        val
      end

      def self.fetch(key, *args, &blk)
        begin
          return @fallback.fetch(key, *args, &blk) if @fallback and not key?(key)
        rescue
        end
        val = super
        val.fallback(self) if Hash == val
        val
      end

      @fallsback = true
    end

    self
  end

  # Define a fallback object for #fetch and #[].
  #
  #   f = Hash[:b=>2]
  #   h = Hash[:a=>1].having_fallback(f)
  #   h[:b] => 2

  def having_fallback(parent=nil)
    @fallback = parent
    unless @fallsback
      def self.[](key)
        return @fallback[key] if @fallback and not key?(key) rescue super
        super
      end

      def self.fetch(key, *args, &blk)
        return @fallback.fetch(key, *args, &blk) if @fallback and not key?(key) rescue super
        super
      end
      @fallsback = true
    end
    self
  end

end


text:
package io.fabric8.maven.docker.service;

import io.fabric8.maven.docker.access.DockerAccess;
import io.fabric8.maven.docker.access.DockerAccessException;
import io.fabric8.maven.docker.access.VolumeCreateConfig;
import io.fabric8.maven.docker.config.VolumeConfiguration;

import java.lang.String;
import java.util.Map;

/**
 *  Service Class for helping control Volumes
 *
 *  @author Tom Burton
 *  @version Dec 15, 2016
 */
public class VolumeService {
   // DAO for accessing the docker daemon
   private DockerAccess docker;

   VolumeService(DockerAccess dockerAccess) {
      this.docker = dockerAccess;
   }

   public String createVolume(VolumeConfiguration vc) throws DockerAccessException {
      VolumeCreateConfig config =
          new VolumeCreateConfig(vc.getName())
              .driver(vc.getDriver())
              .opts(vc.getOpts())
              .labels(vc.getLabels());

      return docker.createVolume(config);
   }

   public void removeVolume(String volumeName) throws DockerAccessException {
      docker.removeVolume(volumeName);
   }
}


text:
<?php

namespace Wedeto\Util\DI;

use ReflectionClass;
use ReflectionMethod;
use Wedeto\Util\DocComment;

/**
 * DefaultFactory is a DI injecting factory that uses the injector to
 * obtain arguments for all parameters in the constructor.
 */
class DefaultFactory implements Factory
{
    /**
     * The Factory interface: call the provided function to
     * do the factory job.
     */
    public function produce(string $class, array $args, string $selector = Injector::DEFAULT_SELECTOR, Injector $injector)
    {
        $const_name = $class . '::WDI_NO_AUTO';
        if (defined($const_name) && constant($const_name) === true)
        {
            throw new DIException("Cannot instantiate $class because $class::WDI_NO_AUTO is true");
        }

        try
        {
            $reflect = new ReflectionClass($class);

            $instance = null;
            $dc = $reflect->getDocComment();
            if (!empty($dc))
            {
                $dc = new DocComment($dc);
                $gen = $dc->getAnnotationTokens("generator");
                if (!empty($gen))
                {
                    $instance = $this->attemptGeneratorMethod($gen, $class, $args, $selector, $injector);
                }
            }

            if (null === $instance)
            {
                $constructor = $reflect->getConstructor();
                if (null === $constructor)
                    return $reflect->newInstance();

                if (!$constructor->isPublic())
                    throw new DIException("Class $class does not have a public constructor");

                $constructor_args = $this->determineArgumentsFor($constructor, $class, "constructor", $args, $selector, $injector);
                $instance = $reflect->newInstanceArgs($constructor_args);
            }
        }
        catch (DIException $e)
        {
            throw new DIException("Could not instantiate class $class", 0, $e);
        }

        return $instance;
    }

    /**
     * Attempt to create an instance using a generator method supplied by a
     * annotation in the class' DocComment:
     *
     * @generator MyFactoryMethodName
     *
     * This method will be attempted to invoke, the arguments should therefore be
     * instantiatable by the injector.
     */
    protected function attemptGeneratorMethod(array $tokens, string $class, array $args, string $selector, Injector $injector)
    {
        $fn_name = $tokens[0] ?? "";

        if (!method_exists($class, $fn_name))
            throw new DIException("Annotated generator method $class::$fn_name does not exist");

        $method = new ReflectionMethod($class, $fn_name);
        if (!$method->isStatic() || !$method->isPublic())
            throw new DIException("Generator method $class::$fn_name must be public and static");

        $method_args = $this->determineArgumentsFor($method, $class, $fn_name, $args, $selector, $injector);
        $instance = $method->invokeArgs(null, $method_args);
        return $instance;
    }

    /**
     * Find arguments for a method
     */
    protected function determineArgumentsFor(
        ReflectionMethod $method,
        string $class,
        string $method_name,
        array $args,
        string $selector,
        Injector $injector
    )
    {
        $params = $method->getParameters();
        $method_args = [];

        // Determine values for each parameter
        $used_optional = false;
        foreach ($params as $param)
        {
            $name = $param->getName();

            if (array_key_exists($name, $args))
            {
                $method_args[] = $args[$name];
                continue;
            }

            $pclass = $param->getClass();
            if (null !== $pclass)
            {
                $instance = $injector->getInstance($pclass->getName(), $selector);
                $method_args[] = $instance;
                continue;
            }

            if ($param->isDefaultValueAvailable())
            {
                $default = $param->getDefaultValue();
                $method_args[] = $default;
                continue;
            }

            if ($param->isOptional())
            {
                // This and all remaining parameters have a default value
                break;
            }

            throw new DIException("Unable to determine value for parameter $name for $method_name of '$class'");
        }

        // There should be a argument for every parameter
        return $method_args;
    }
}


text:
import createWrapper from './_createWrapper';
import getPlaceholder from './_getPlaceholder';
import replaceHolders from './_replaceHolders';
import rest from './rest';

/** Used to compose bitmasks for wrapper metadata. */
var PARTIAL_RIGHT_FLAG = 64;

/**
 * This method is like `_.partial` except that partially applied arguments
 * are appended to those provided to the new function.
 *
 * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
 * builds, may be used as a placeholder for partially applied arguments.
 *
 * **Note:** This method doesn't set the "length" property of partially
 * applied functions.
 *
 * @static
 * @memberOf _
 * @category Function
 * @param {Function} func The function to partially apply arguments to.
 * @param {...*} [partials] The arguments to be partially applied.
 * @returns {Function} Returns the new partially applied function.
 * @example
 *
 * var greet = function(greeting, name) {
 *   return greeting + ' ' + name;
 * };
 *
 * var greetFred = _.partialRight(greet, 'fred');
 * greetFred('hi');
 * // => 'hi fred'
 *
 * // Partially applied with placeholders.
 * var sayHelloTo = _.partialRight(greet, 'hello', _);
 * sayHelloTo('fred');
 * // => 'hello fred'
 */
var partialRight = rest(function(func, partials) {
  var holders = replaceHolders(partials, getPlaceholder(partialRight));
  return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders);
});

// Assign default placeholders.
partialRight.placeholder = {};

export default partialRight;


text:
@implementation DevLibDelegate

- (id)init
{
	if ((self = [super init])) {
		center = [CPDistributedMessagingCenter centerNamed:@"com.imokhles.ifilevelox"];
		rocketbootstrap_distributedmessagingcenter_apply(center);
		[center runServerOnCurrentThread];

		[center registerForMessageName:@"com.imokhles.ifilevelox.move" target:self selector:@selector(DevLib_handleMessageNamed:DevLib_userInfo:)];
		[center registerForMessageName:@"com.imokhles.ifilevelox.copy" target:self selector:@selector(DevLib_handleMessageNamed:DevLib_userInfo:)];
		[center registerForMessageName:@"com.imokhles.ifilevelox.symlink" target:self selector:@selector(DevLib_handleMessageNamed:DevLib_userInfo:)];
		[center registerForMessageName:@"com.imokhles.ifilevelox.delete" target:self selector:@selector(DevLib_handleMessageNamed:DevLib_userInfo:)];
		[center registerForMessageName:@"com.imokhles.ifilevelox.attributes" target:self selector:@selector(DevLib_handleMessageNamed:DevLib_userInfo:)];
		[center registerForMessageName:@"com.imokhles.ifilevelox.dircontents" target:self selector:@selector(DevLib_handleMessageNamed:DevLib_userInfo:)];
		[center registerForMessageName:@"com.imokhles.ifilevelox.chmod" target:self selector:@selector(DevLib_handleMessageNamed:DevLib_userInfo:)];
		[center registerForMessageName:@"com.imokhles.ifilevelox.exists" target:self selector:@selector(DevLib_handleMessageNamed:DevLib_userInfo:)];
		[center registerForMessageName:@"com.imokhles.ifilevelox.isdir" target:self selector:@selector(DevLib_handleMessageNamed:DevLib_userInfo:)];
		[center registerForMessageName:@"com.imokhles.ifilevelox.mkdir" target:self selector:@selector(DevLib_handleMessageNamed:DevLib_userInfo:)];

		fileManager = [[NSFileManager alloc] init];
	}
	return self;
}

- (void)dealloc
{
	[fileManager release];
	[super dealloc];
}

- (NSDictionary *)DevLib_handleMessageNamed:(NSString *)name DevLib_userInfo:(NSDictionary *)info
{
	NSString *sourceFile = [info objectForKey:@"DevLibSourceFile"];
	NSString *targetFile = [info objectForKey:@"DevLibTargetFile"];
	NSNumber *modeNumber = [info objectForKey:@"DevLibFileMode"];
	const char *source = [sourceFile UTF8String];
	const char *target = [targetFile UTF8String];
	mode_t mode = [modeNumber intValue];
	NSMutableDictionary *result = [NSMutableDictionary dictionary];

	if ([name isEqualToString:@"com.imokhles.ifilevelox.move"]) {
		[fileManager moveItemAtPath:sourceFile toPath:targetFile error:NULL];
	} else if ([name isEqualToString:@"com.imokhles.ifilevelox.copy"]) {
		[fileManager copyItemAtPath:sourceFile toPath:targetFile error:NULL];
	} else if ([name isEqualToString:@"com.imokhles.ifilevelox.symlink"]) {
		symlink(source, target);
	} else if ([name isEqualToString:@"com.imokhles.ifilevelox.delete"]) {
		[fileManager removeItemAtPath:targetFile error:NULL];
	} else if ([name isEqualToString:@"com.imokhles.ifilevelox.attributes"]) {
		[result setDictionary:[fileManager attributesOfItemAtPath:targetFile error:NULL]];
	} else if ([name isEqualToString:@"com.imokhles.ifilevelox.dircontents"]) {
		NSArray *contents = [fileManager contentsOfDirectoryAtPath:targetFile error:NULL];
		if (contents) {
			[result setObject:contents forKey:@"DevLibDirContents"];
		}
	} else if ([name isEqualToString:@"com.imokhles.ifilevelox.chmod"]) {
		chmod(target, mode);
	} else if ([name isEqualToString:@"com.imokhles.ifilevelox.exists"]) {
		BOOL exists = access(target, F_OK);
		NSNumber *num = [[NSNumber alloc] initWithBool:exists];
		[result setObject:num forKey:@"DevLibFileExists"];
		[num release];
	} else if ([name isEqualToString:@"com.imokhles.ifilevelox.isdir"]) {
		struct stat buf;
		stat(target, &buf);
		BOOL isDir = S_ISDIR(buf.st_mode);
		NSNumber *num = [[NSNumber alloc] initWithBool:isDir];
		[result setObject:num forKey:@"DevLibIsDirectory"];
		[num release];
	} else if ([name isEqualToString:@"com.imokhles.ifilevelox.mkdir"]) {
		[fileManager createDirectoryAtPath:targetFile withIntermediateDirectories:YES attributes:nil error:NULL];
	}

	return result;
}

- (void)DevLib_dummy {
	// Keep the timer alive ;)
	NSLog(@"DevLibFB Keeping server alive");
}

@end


text:
package sdjournal

import (
	"bytes"
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"strings"
	"testing"
	"time"

	"github.com/coreos/go-systemd/journal"
)

func TestJournalFollow(t *testing.T) {
	r, err := NewJournalReader(JournalReaderConfig{
		Since: time.Duration(-15) * time.Second,
		Matches: []Match{
			{
				Field: SD_JOURNAL_FIELD_SYSTEMD_UNIT,
				Value: "NetworkManager.service",
			},
		},
	})

	if err != nil {
		t.Fatalf("Error opening journal: %s", err)
	}

	if r == nil {
		t.Fatal("Got a nil reader")
	}

	defer r.Close()

	// start writing some test entries
	done := make(chan struct{}, 1)
	defer close(done)
	go func() {
		for {
			select {
			case <-done:
				return
			default:
				if err = journal.Print(journal.PriInfo, "test message %s", time.Now()); err != nil {
					t.Fatalf("Error writing to journal: %s", err)
				}

				time.Sleep(time.Second)
			}
		}
	}()

	// and follow the reader synchronously
	timeout := time.Duration(5) * time.Second
	if err = r.Follow(time.After(timeout), os.Stdout); err != ErrExpired {
		t.Fatalf("Error during follow: %s", err)
	}
}

func TestJournalGetUsage(t *testing.T) {
	j, err := NewJournal()

	if err != nil {
		t.Fatalf("Error opening journal: %s", err)
	}

	if j == nil {
		t.Fatal("Got a nil journal")
	}

	defer j.Close()

	_, err = j.GetUsage()

	if err != nil {
		t.Fatalf("Error getting journal size: %s", err)
	}
}

func TestJournalCursorGetSeekAndTest(t *testing.T) {
	j, err := NewJournal()
	if err != nil {
		t.Fatalf("Error opening journal: %s", err)
	}

	if j == nil {
		t.Fatal("Got a nil journal")
	}

	defer j.Close()

	waitAndNext := func(j *Journal) error {
		r := j.Wait(time.Duration(1) * time.Second)
		if r < 0 {
			return errors.New("Error waiting to journal")
		}

		n, err := j.Next()
		if err != nil {
			return fmt.Errorf("Error reading to journal: %s", err)
		}

		if n == 0 {
			return fmt.Errorf("Error reading to journal: %s", io.EOF)
		}

		return nil
	}

	err = journal.Print(journal.PriInfo, "test message for cursor %s", time.Now())
	if err != nil {
		t.Fatalf("Error writing to journal: %s", err)
	}

	if err = waitAndNext(j); err != nil {
		t.Fatalf(err.Error())
	}

	c, err := j.GetCursor()
	if err != nil {
		t.Fatalf("Error getting cursor from journal: %s", err)
	}

	err = j.SeekCursor(c)
	if err != nil {
		t.Fatalf("Error seeking cursor to journal: %s", err)
	}

	if err = waitAndNext(j); err != nil {
		t.Fatalf(err.Error())
	}

	err = j.TestCursor(c)
	if err != nil {
		t.Fatalf("Error testing cursor to journal: %s", err)
	}
}

func TestNewJournalFromDir(t *testing.T) {
	// test for error handling
	dir := "/ClearlyNonExistingPath/"
	j, err := NewJournalFromDir(dir)
	if err == nil {
		defer j.Close()
		t.Fatalf("Error expected when opening dummy path (%s)", dir)
	}
	// test for main code path
	dir, err = ioutil.TempDir("", "go-systemd-test")
	if err != nil {
		t.Fatalf("Error creating tempdir: %s", err)
	}
	defer os.RemoveAll(dir)
	j, err = NewJournalFromDir(dir)
	if err != nil {
		t.Fatalf("Error opening journal: %s", err)
	}
	if j == nil {
		t.Fatal("Got a nil journal")
	}
	j.Close()
}

func TestJournalGetEntry(t *testing.T) {
	j, err := NewJournal()
	if err != nil {
		t.Fatalf("Error opening journal: %s", err)
	}

	if j == nil {
		t.Fatal("Got a nil journal")
	}

	defer j.Close()

	j.FlushMatches()

	matchField := "TESTJOURNALGETENTRY"
	matchValue := fmt.Sprintf("%d", time.Now().UnixNano())
	m := Match{Field: matchField, Value: matchValue}
	err = j.AddMatch(m.String())
	if err != nil {
		t.Fatalf("Error adding matches to journal: %s", err)
	}

	want := fmt.Sprintf("test journal get entry message %s", time.Now())
	err = journal.Send(want, journal.PriInfo, map[string]string{matchField: matchValue})
	if err != nil {
		t.Fatalf("Error writing to journal: %s", err)
	}

	r := j.Wait(time.Duration(1) * time.Second)
	if r < 0 {
		t.Fatalf("Error waiting to journal")
	}

	n, err := j.Next()
	if err != nil {
		t.Fatalf("Error reading to journal: %s", err)
	}

	if n == 0 {
		t.Fatalf("Error reading to journal: %s", io.EOF)
	}

	entry, err := j.GetEntry()
	if err != nil {
		t.Fatalf("Error getting the entry to journal: %s", err)
	}

	got := entry.Fields["MESSAGE"]
	if got != want {
		t.Fatalf("Bad result for entry.Fields[\"MESSAGE\"]: got %s, want %s", got, want)
	}
}

// Check for incorrect read into small buffers,
// see https://github.com/coreos/go-systemd/issues/172
func TestJournalReaderSmallReadBuffer(t *testing.T) {
	// Write a long entry ...
	delim := "%%%%%%"
	longEntry := strings.Repeat("a", 256)
	matchField := "TESTJOURNALREADERSMALLBUF"
	matchValue := fmt.Sprintf("%d", time.Now().UnixNano())
	r, err := NewJournalReader(JournalReaderConfig{
		Since: time.Duration(-15) * time.Second,
		Matches: []Match{
			{
				Field: matchField,
				Value: matchValue,
			},
		},
	})
	if err != nil {
		t.Fatalf("Error opening journal: %s", err)
	}
	if r == nil {
		t.Fatal("Got a nil reader")
	}
	defer r.Close()

	want := fmt.Sprintf("%slongentry %s%s", delim, longEntry, delim)
	err = journal.Send(want, journal.PriInfo, map[string]string{matchField: matchValue})
	if err != nil {
		t.Fatal("Error writing to journal", err)
	}
	time.Sleep(time.Second)

	// ... and try to read it back piece by piece via a small buffer
	finalBuff := new(bytes.Buffer)
	var e error
	for c := -1; c != 0 && e == nil; {
		smallBuf := make([]byte, 5)
		c, e = r.Read(smallBuf)
		if c > len(smallBuf) {
			t.Fatalf("Got unexpected read length: %d vs %d", c, len(smallBuf))
		}
		_, _ = finalBuff.Write(smallBuf)
	}
	b := finalBuff.String()
	got := strings.Split(b, delim)
	if len(got) != 3 {
		t.Fatalf("Got unexpected entry %s", b)
	}
	if got[1] != strings.Trim(want, delim) {
		t.Fatalf("Got unexpected message %s", got[1])
	}
}


text:
using namespace _ELENA_;

static x86ELENAVMMachine* _Machine = nullptr;
static Path rootPath;
static void* _SystemEnv = nullptr;

constexpr size_t cnNameOffset = sizeof(VMTHeader) + sizeof(uintptr_t);
constexpr size_t cnPackageOffset = cnNameOffset + sizeof(uintptr_t);

// --- getAppPath ---

void loadDLLPath(HMODULE hModule)
{
   TCHAR path[MAX_PATH + 1];

   ::GetModuleFileName(hModule, path, MAX_PATH);

   rootPath.copySubPath(path);
   rootPath.lower();
}

// ==== DLL entries ====

EXTERN_DLL_EXPORT void PrepareEM(void* args)
{

}

EXTERN_DLL_EXPORT void InitializeVMSTA(void* sehTable, void* systemEnv, void* exceptionHandler, void* criticalHandler, void* vmTape,
   ProgramHeader* header)
{
   _SystemEnv = systemEnv;

   header->root_exception_struct.core_catch_addr = (uintptr_t)exceptionHandler;

   // initialize the critical exception handler
   if (criticalHandler != nullptr)
      __routineProvider.InitCriticalStruct((uintptr_t)criticalHandler);

   //// initialize system env variable
   //_SystemEnv = systemEnv;

   // start the system
   _Machine->startSTA(header, (SystemEnv*)systemEnv, sehTable, vmTape);
}

EXTERN_DLL_EXPORT void OpenFrame(void* systemEnv, void* frameHeader)
{
   SystemRoutineProvider::OpenFrame((SystemEnv*)systemEnv, (FrameHeader*)frameHeader);
}

EXTERN_DLL_EXPORT void CloseFrame(void* systemEnv, void* frameHeader)
{
   SystemRoutineProvider::CloseFrame((SystemEnv*)systemEnv, (FrameHeader*)frameHeader);
}

EXTERN_DLL_EXPORT void Exit(int exitCode)
{
   _Machine->Exit(exitCode);
}

// !! temporally

//EXTERN_DLL_EXPORT int ReadCallStack(void* instance, size_t framePosition, size_t currentAddress, size_t startLevel, int* buffer, size_t maxLength)
//{
//   return 0; // !! temporally
//}

EXTERN_DLL_EXPORT int LoadAddressInfo(void* retPoint, char* buffer, size_t maxLength)
{
   Instance* instance = _Machine->getInstance();
   if (instance == NULL)
      return 0;

   try {
      if (instance->loadAddressInfo(retPoint, buffer, maxLength)) {
         return maxLength;
      }
      else return 0;
   }
   catch (JITUnresolvedException& e)
   {
      instance->setStatus("Cannot load ", e.referenceInfo);

      return 0;
   }
   catch (InternalError& e)
   {
      instance->setStatus(e.message);

      return 0;
   }
   catch (EAbortException&)
   {
      return 0;
   }
}

EXTERN_DLL_EXPORT int LoadClassName(void* vmtAddress, char* buffer, int maxLength)
{
   Instance* instance = _Machine->getInstance();
   if (instance == NULL)
      return 0;

   try {
      size_t length = maxLength;

      uintptr_t packagePtr = *(uintptr_t*)((lvaddr_t)vmtAddress - cnPackageOffset);
      uintptr_t namePtr = *(uintptr_t*)((lvaddr_t)vmtAddress - cnNameOffset);

      char* name = (char*)namePtr;
      char* ns = ((char**)packagePtr)[0];

      size_t ns_len = length;
      if (!ident_t(ns).copyTo(buffer, ns_len))
         return 0;

      maxLength -= ns_len;
      if (!ident_t(name).copyTo(buffer + ns_len, length))
         return 0;

      return length + ns_len;

      //ident_t className = instance->getClassName(vmtAddress);
      //size_t length = getlength(className);
      //if (length > 0) {
      //   if (maxLength >= (int)length) {
      //      Convertor::copy(buffer, className, length, length);
      //   }
      //   else buffer[0] = 0;
      //}

      //return length;
   }
   catch (JITUnresolvedException& e)
   {
      instance->setStatus("Cannot load ", e.referenceInfo);

      return 0;
   }
   catch (InternalError& e)
   {
      instance->setStatus(e.message);

      return 0;
   }
   catch (EAbortException&)
   {
      return 0;
   }
}

EXTERN_DLL_EXPORT int LoadSubjectName(void* subjectRef, char* buffer, int maxLength)
{
   Instance* instance = _Machine->getInstance();
   if (instance == NULL)
      return 0;

   try {
      size_t subj_id = (size_t)subjectRef;

      ident_t subjectName = instance->getSubject(subj_id);
      size_t length = getlength(subjectName);
      if (length > 0) {
         if (maxLength >= (int)length) {
            Convertor::copy(buffer, subjectName, length, length);
         }
         else buffer[0] = 0;
      }

      return length;
   }
   catch (JITUnresolvedException& e)
   {
      instance->setStatus("Cannot load ", e.referenceInfo);

      return 0;
   }
   catch (InternalError& e)
   {
      instance->setStatus(e.message);

      return 0;
   }
   catch (EAbortException&)
   {
      return 0;
   }
}

EXTERN_DLL_EXPORT void* LoadSubject(void* subjectName)
{
   Instance* instance = _Machine->getInstance();
   if (instance == NULL)
      return 0;

   try {
      ref_t subj_id = instance->getSubjectRef((SystemEnv*)_SystemEnv, (const char*)subjectName);

      return (void*)subj_id;
   }
   catch (JITUnresolvedException& e)
   {
      instance->setStatus("Cannot load ", e.referenceInfo);

      return 0;
   }
   catch (InternalError& e)
   {
      instance->setStatus(e.message);

      return 0;
   }
   catch (EAbortException&)
   {
      return 0;
   }
}

EXTERN_DLL_EXPORT int LoadMessageName(void* message, char* buffer, int maxLength)
{
   Instance* instance = _Machine->getInstance();
   if (instance == NULL)
      return 0;

   try {
      return instance->loadMessageName((mssg_t)message, buffer, maxLength);
   }
   catch (JITUnresolvedException& e)
   {
      instance->setStatus("Cannot load ", e.referenceInfo);

      return 0;
   }
   catch (InternalError& e)
   {
      instance->setStatus(e.message);

      return 0;
   }
   catch (EAbortException&)
   {
      return 0;
   }
}

EXTERN_DLL_EXPORT void* LoadMessage(void* messageName)
{
   Instance* instance = _Machine->getInstance();
   if (instance == NULL)
      return 0;

   try {
      return (void*)(instance->getMessageRef((SystemEnv*)_SystemEnv, (const char*)messageName));
   }
   catch (JITUnresolvedException& e)
   {
      instance->setStatus("Cannot load ", e.referenceInfo);

      return 0;
   }
   catch (InternalError& e)
   {
      instance->setStatus(e.message);

      return 0;
   }
   catch (EAbortException&)
   {
      return 0;
   }
}

EXTERN_DLL_EXPORT void* LoadSymbolByString(void* systemEnv, void* referenceName)
{
   Instance* instance = _Machine->getInstance();
   if (instance == NULL)
      return 0;

   try {
      return (void*)instance->getSymbolRef((SystemEnv*)systemEnv, (const char*)referenceName, false);
   }
   catch (JITUnresolvedException& e)
   {
      instance->setStatus("Cannot load ", e.referenceInfo);

      return 0;
   }
   catch (InternalError& e)
   {
      instance->setStatus(e.message);

      return 0;
   }
   catch (EAbortException&)
   {
      return 0;
   }
}

EXTERN_DLL_EXPORT void* LoadSymbolByString2(void* systemEnv, void* ns, void* referenceName)
{
   ReferenceNs str((const char*)ns, (const char*)referenceName);

   return LoadSymbolByString(systemEnv, (void*)str.c_str());
}

EXTERN_DLL_EXPORT void* LoadSymbolByBuffer(void* systemEnv, void* referenceName, size_t index, size_t length)
{
   if (length < 0x100) {
      IdentifierString str((const char*)referenceName, index, length);

      return LoadSymbolByString(systemEnv, (void*)str.c_str());
   }
   else {
      DynamicString<char> str((const char*)referenceName, index, length);

      return LoadSymbolByString(systemEnv, (void*)str.str());
   }
}

EXTERN_DLL_EXPORT void* LoadClassByString(void* systemEnv, void* referenceName)
{
   Instance* instance = _Machine->getInstance();
   if (instance == NULL)
      return 0;

   try {
      return (void*)instance->getClassVMTRef((SystemEnv*)systemEnv, (const char*)referenceName, false);
   }
   catch (JITUnresolvedException& e)
   {
      instance->setStatus("Cannot load ", e.referenceInfo);

      return 0;
   }
   catch (InternalError& e)
   {
      instance->setStatus(e.message);

      return 0;
   }
   catch (EAbortException&)
   {
      return 0;
   }
}

EXTERN_DLL_EXPORT void* LoadClassByBuffer(void* systemEnv, void* referenceName, size_t index, size_t length)
{
   if (length < 0x100) {
      IdentifierString str((const char*)referenceName, index, length);

      return LoadClassByString(systemEnv, (void*)str.c_str());
   }
   else {
      DynamicString<char> str((const char*)referenceName, index, length);

      return LoadClassByString(systemEnv, (void*)str.str());
   }
}

EXTERN_DLL_EXPORT int EvaluateTape(void* systemEnv, void* sehTable, void* tape)
{
   Instance* instance = _Machine->getInstance();
   if (instance == NULL)
      return 0;

   try {
      int retVal = instance->interprete((SystemEnv*)systemEnv, sehTable, tape, false);

      return retVal;
   }
   catch (JITUnresolvedException& e)
   {
      instance->setStatus("Cannot load ", e.referenceInfo);

      return 0;
   }
   catch(InternalError& e)
   {
      instance->setStatus(e.message);

      return 0;
   }
   catch (EAbortException&)
   {
      return 0;
   }
}

//EXTERN_DLL_EXPORT size_t SetDebugMode()
//{
//   Instance* instance = getCurrentInstance();
//   if (instance == NULL)
//      return 0;
//
//   instance->setDebugMode();
//
//   return (size_t)instance->loadDebugSection();
//}

EXTERN_DLL_EXPORT const char* GetVMLastError()
{
   Instance* instance = _Machine->getInstance();

   return  instance ? instance->getStatus() : "Not initialized";
}

/// <summary>
/// Fills the passed dispatch list with references to extension message overload list
/// </summary>
/// <param name="moduleList">List of imported modules separated by semicolon</param>
/// <param name="message">Extension message</param>
/// <param name="output">Dispatch list</param>
/// <returns></returns>
EXTERN_DLL_EXPORT int LoadExtensionDispatcher(const char* moduleList, void* message, void* output)
{
   Instance* instance = _Machine->getInstance();
   if (instance == NULL)
      return 0;

   return instance->loadExtensionDispatcher((SystemEnv*)_SystemEnv, moduleList, (mssg_t)message, output);
}

EXTERN_DLL_EXPORT void* GCCollect(void* roots, size_t size)
{
   return SystemRoutineProvider::GCRoutine(((SystemEnv*)_SystemEnv)->Table, (GCRoot*)roots, size);
}

EXTERN_DLL_EXPORT void* GCCollectPerm(size_t size)
{
   return SystemRoutineProvider::GCRoutinePerm(((SystemEnv*)_SystemEnv)->Table, size, ((SystemEnv*)_SystemEnv)->GCPERMSize);
}

/// <summary>
/// Creates a dynamic class inheriting the given VMT
/// </summary>
/// <returns>a reference to dynamically created VMT</returns>
EXTERN_DLL_EXPORT void* Inherit(const char* name, void* classPtr, void* handler)
{
   return nullptr; // !! currently is not implemented

   //void* basePtr = (void*)SystemRoutineProvider::GetParent(classPtr);
   //size_t classLen = SystemRoutineProvider::GetLength(classPtr);
   //size_t baseLen = SystemRoutineProvider::GetLength(basePtr);
   //int flags = SystemRoutineProvider::GetFlags(classPtr);

   //return (void*)_Instance->inherit((SystemEnv*)_SystemEnv, name, (VMTEntry*)classPtr, (VMTEntry*)basePtr,
   //   classLen, baseLen, (pos_t*)&handler, 1, flags);
}

/// <summary>
/// Returns the signature member type at the specified position
/// </summary>
/// <param name="message">A strong-typed message</param>
/// <param name="index">A signature member index</param>
/// <param name="output">Signature tyoe</param>
/// <returns></returns>
EXTERN_DLL_EXPORT void* LoadSignatureMember(void* message, int index)
{
   return nullptr; // !! currently is not implemented

//   return (void*)_Instance->loadSignatureMember((mssg_t)message, index);
}

// --- initmachine ---

void initMachine(path_t rootPath)
{
   _Machine = new x86ELENAVMMachine(rootPath);

   if (::IsDebuggerPresent()) {
      _Machine->getInstance()->setDebugMode();
   }
}

// --- freeMachine ---

void freeMachine()
{
   freeobj(_Machine);
   _Machine = nullptr;
}

// --- dllmain ---

extern "C"
BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
               )
{
   switch (ul_reason_for_call)
   {
      case DLL_PROCESS_ATTACH:
      {
         loadDLLPath(hModule);
         initMachine(rootPath.c_str());
         return TRUE;
      }
      case DLL_THREAD_ATTACH:
      case DLL_THREAD_DETACH:
         return TRUE;
      case DLL_PROCESS_DETACH:
         freeMachine();
         break;
   }
   return TRUE;
}


text:
var rule = require('../rule');

// input フォーム部品
module.exports = {
  type: {
    flow       : true,
    phrasing   : true,
    interactive: rule.hasNotAttribute('type', 'hidden'),
    palpable   : rule.hasNotAttribute('type', 'hidden')
  },
  empty: true,
  attributes: 'accept,alt,autocomplete,autofocus,checked,disabled,' +
              'form,formaction,formenctype,formmethod,formnovalidate,' +
              'formtarget,height,list,max,maxlength,min,multiple,name,' +
              'pattern,placeholder,readonly,required,size,src,step,type,' +
              'value,width'
};


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>Server_App.js</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="shortcut icon" type="image/png" href="../assets/favicon.png">

            API Docs for:

APIs

Classes

Modules

            <input type="search" id="api-filter" placeholder="Type to filter APIs">

Client_Core_Core.Ajax.js

Client_Core_Core.DomManipulation.js

Client_Core_Core.js

Client_Core_Core.Mediator.js

Client_Core_Core.Socket.js

Client_Core_Core.Templates.js

Client_Core_Core.Utils.js

Client_Main.js

Client_Modules_chat.js

Client_Modules_corkboard.js

Client_Modules_friend-request.js

Client_Modules_notification.js

Client_Modules_registration.js

Client_Sandbox.js

Server_App_database.js

Server_App_Gruntfile.js

Server_App_middleware.js

Server_App_Socket.js

Server_App_Utils.js

Server_Controller_chatController.js

Server_Controller_profileController.js

Server_Controller_registrationController.js

Server_Controller_userController.js

Server_Model_userModel.js

App.js

Client_Core.js

Client_Modules.js

Client_Sandbox.js

Server_App.js

Server_Controller.js

Server_Model.js

        Show:

            <input type="checkbox" id="api-show-inherited" checked>
            Inherited

            <input type="checkbox" id="api-show-protected">
            Protected

            <input type="checkbox" id="api-show-private">
            Private

            <input type="checkbox" id="api-show-deprecated">
            Deprecated

Server_App.js Module

            Defined in: socket.js:1

The Gruntfile.js enables minification and concatenation of JavaScript files.

This module provides the following classes:

                        Server_App_database.js

                        Server_App_Gruntfile.js

                        Server_App_middleware.js

                        Server_App_Socket.js

                        Server_App_Utils.js


text:
ToolStack.MQ = (function(ts){

	var util = ts.Utility,
		ds = ts.Structures,
		q = {},
		dq = ts.DelayQueue = function(ms,parrallel){

			var q = {
				queue: ds.Queue(),
				parrallel: parrallel || false,
				paused: false,
				flushed: false,
				timer: null,
				delay:ms,
				active: true,
				maxpool: 200,
			};

			q.isPending = function(){ return !!this.pending; };

			q.maxOut = function(){
				if(!this.pending && this.queue.length) return false;
				return true;
			};

			q.resume = function(){
				if(this.paused()) return;
				this.paused = false;
			};

			q.pause = function(){
				if(!this.paused) this.paused = true;
			};

			q.isPaused = function(){ return !!this.paused; };

			q.disable = function(){
				if(this.active) this.active = false;
			};

			q.isDisabled = function(){ return !this.active; };

			q.process = function(){
				if(!this.flushed && !this.pending) return;

				var self = this,
					delay = util.isNumber(this.delay) && !util.isInfinit(this.delay) ? this.delay : 0,
					curr = this.queue.shift();

				return (this.timer = util.delay(function(){
					self.process();
				},delay));
			};

			return q;
		}

	q.deliver = function(){};
	q.flush = function(){};
	q.notify = function(){};
	q.pause = function(){};
	q.resume = function(){};
	q.disable = function(){};
	q.disabled = function(){};

	return function(timeout){
	};

})(ToolStack);

//to ensure backward compatibility with calls to MessageAPI instead of MQ
ToolStack.MessageAPI = ToolStack.MQ;


text:
jQuery(document).ready(function() {
    jQuery('.add-translation form').on('submit', function(e) {
        e.preventDefault();
        var $form = jQuery(this);
        $ajaxLoader = jQuery('.add-translation form .submit-button .ajax-ready');
        $ajaxLoader.toggleClass('ajax-loader');
        jQuery.ajax({
           url: $form.attr('action'),
           type: $form.attr('method'),
           data: $form.serialize()
        }).success(function(data) {
            if (data.indexOf("<div class=\"error\">") > -1) {
                jQuery('.add-translation form .error').replaceWith(data);
            } else {
                jQuery('table tbody').prepend(data);
                jQuery('table tbody tr:last-child').remove();
                resetForm('.add-translation form');
            }
            $ajaxLoader.toggleClass('ajax-loader');
        }).error(function(jqXHR, textStatus, errorThrown) {
            console.log("error here!");
            $ajaxLoader.toggleClass('ajax-loader');
            console.log(jqXHR);
            console.log(textStatus);
            console.log(errorThrown);
        });
    });
});

/**
 * Reset all fields of a from
 */
function resetForm(formSlector)
{
    jQuery('input', formSlector).val('');
}


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

namespace Zergatul.Math
{
    public class ArithmeticException : Exception
    {
        public ArithmeticException(string message) : base(message)
        {

        }
    }
}


text:
#include "renderer/impl/importer/atlas_importer_tiles.h"

#include "core/base/bean_factory.h"
#include "core/util/math.h"
#include "core/util/documents.h"

#include "renderer/base/atlas.h"
#include "renderer/base/texture.h"

namespace ark {

AtlasImporterTiles::AtlasImporterTiles(document manifest, int32_t type, uint32_t tileWidth, uint32_t tileHeight, float pivotX, float pivotY)
    : _manifest(std::move(manifest)), _type(type), _tile_width(tileWidth), _tile_height(tileHeight), _pivot(pivotX, pivotY)
{
}

void AtlasImporterTiles::import(Atlas& atlas, const sp<Readable>& /*readable*/)
{
    const uint32_t marginX = Documents::getAttribute<uint32_t>(_manifest, "margin-x", 0);
    const uint32_t marginY = Documents::getAttribute<uint32_t>(_manifest, "margin-y", 0);
    const bool override = Documents::getAttribute<bool>(_manifest, "override", false);
    const uint32_t flowx = marginX + _tile_width;
    const uint32_t flowy = marginY + _tile_height;
    const Rect bounds = _type != -1 ? atlas.getOriginalPosition(_type) : Rect::parse(_manifest);
    const uint32_t xCount = static_cast<uint32_t>(Math::round(bounds.width() / flowx));
    const uint32_t yCount = static_cast<uint32_t>(Math::round(bounds.height() / flowy));
    const uint32_t bl = static_cast<uint32_t>(bounds.left());
    const uint32_t bt = static_cast<uint32_t>(bounds.top());

    int32_t typeBase = Documents::getAttribute<int32_t>(_manifest, "begin", _type + 1) - 1;
    const V2 tileSize(static_cast<float>(_tile_width), static_cast<float>(_tile_height));
    for(uint32_t i = 0; i < yCount; i++)
        for(uint32_t j = 0; j < xCount; j++)
        {
            ++typeBase;
            if(!atlas.has(typeBase) || override)
            {
                uint32_t left = bl + j * flowx;
                uint32_t top = bt + i * flowy;
                atlas.add(typeBase, left, top, left + _tile_width, top + _tile_height, Rect(0, 0, 1.0f, 1.0f), tileSize, _pivot);
            }
        }
}

AtlasImporterTiles::BUILDER::BUILDER(BeanFactory& factory, const document& manifest)
    : _manifest(manifest), _type(factory.getBuilder<Integer>(_manifest, Constants::Attributes::TYPE)), _tile_width(factory.ensureBuilder<Integer>(_manifest, "tile-width")),
      _tile_height(factory.ensureBuilder<Integer>(_manifest, "tile-height")), _pivot_x(factory.getBuilder<Numeric>(_manifest, "pivot-x")), _pivot_y(factory.getBuilder<Numeric>(_manifest, "pivot-y"))
{
}

sp<AtlasImporter> AtlasImporterTiles::BUILDER::build(const Scope& args)
{
    return sp<AtlasImporterTiles>::make(_manifest, _type ? _type->build(args)->val() : -1, _tile_width->build(args)->val(), _tile_height->build(args)->val(),
                                        _pivot_x ? _pivot_x->build(args)->val() : 0, _pivot_y ? _pivot_y->build(args)->val() : 0);
}

}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Internal.TypeSystem;
using System.Diagnostics;

namespace ILCompiler.DependencyAnalysis
{
    public sealed class ImportedMethodGenericDictionaryNode : ExternSymbolNode
    {
        private MethodDesc _owningMethod;

        public ImportedMethodGenericDictionaryNode(NodeFactory factory, MethodDesc owningMethod)
            : base("__imp_" + factory.NameMangler.NodeMangler.MethodGenericDictionary(owningMethod))
        {
            _owningMethod = owningMethod;
        }

        public override bool RepresentsIndirectionCell => true;
    }

    public sealed class ImportedTypeGenericDictionaryNode : ExternSymbolNode
    {
        private TypeDesc _owningType;

        public ImportedTypeGenericDictionaryNode(NodeFactory factory, TypeDesc owningType)
            : base("__imp_" + factory.NameMangler.NodeMangler.TypeGenericDictionary(owningType))
        {
            Debug.Assert(!factory.LazyGenericsPolicy.UsesLazyGenerics(owningType));
            _owningType = owningType;
        }

        public override bool RepresentsIndirectionCell => true;
    }
}


text:
const userReducer=(state={},{type,payload})=>{
	let newState ={...state}
	switch (type){
		case "SET_STATE":
		return payload
		break;
		default:
		return newState;

	}
}

export default userReducer;


text:
using UnityEngine;
using System.Collections;

public class PlantSection : MonoBehaviour {

	public GameObject Scaleable;
}


text:
/*

  Navigation action types

  NAV.SET_LEVEL
    "TOP" // home, sections, discover, profile
    "CONTENT" // back, like, share
    "MODAL" // down, like, share

  NAV.SET_LINKS
    // experimental

  NAV.SET_ACTION
    props: {
      id: id of link
      action: function
    }

  NAV.SET_VISIBILITY
    hide or show the nav from the page

  NAV.SET_ACTIVE
    set the active link

*/
import reducer from "./reducer";
import { addReducer } from "../utilities";

addReducer({
  nav: reducer,
});

export default {
  reducer,

  setLevel: level => ({ type: "NAV.SET_LEVEL", level }),
  reset: () => ({ type: "NAV.SET_LEVEL", level: "TOP" }),

  setColor: (bgColor, fgColor) => ({ type: "NAV.SET_COLOR", bgColor, fgColor }),

  setLinks: links => ({ type: "NAV.SET_LINKS", links }),
  setAction: (level, props) => ({ type: "NAV.SET_ACTION", level, props }),

  hide: () => ({ type: "NAV.SET_VISIBILITY", visible: false }),
  show: () => ({ type: "NAV.SET_VISIBILITY", visible: true }),
};


text:
package com.tianjunwei.factorybean;

import java.util.Date;

import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.FactoryBean;

/**
 * @author tianjunwei
 * @time 2017 下午3:02:01
 */
public class MyFactoryBean implements FactoryBean<Date>,BeanNameAware {
    private String name;

    @Override
    public Date getObject() throws Exception {
        return new Date();
    }

    @Override
    public Class<?> getObjectType() {
        return Date.class;
    }

    @Override
    public boolean isSingleton() {
        return false;
    }

    public void sayName() {
        System.out.println("My name is " + this.name);
    }

    @Override
    public void setBeanName(String name) {
        this.name = name;
    }
}


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

namespace TomasHorvath.BlogEngine.DAL.Interfaces
{
	public interface IBlogPostRepository : IRepository<Domain.BlogPost, Guid>
	{
		IPagedList<Domain.DTO.BlogPost.BlogPostPreviewDto> GetByPage(int pageNumber, int pageSize, out int totalRowCount);
		Domain.DTO.BlogPost.BlogPostDetailDTO GetDtoById(Guid id);
	}
}


text:
using System;
using Hyena.Widgets;

namespace Hyena.Widgets
{
    public enum Blocking
    {
        Upstage,
        Downstage
    }
}

namespace Hyena.Gui.Theatrics
{
    public enum Easing
    {
        Linear,
        QuadraticIn,
        QuadraticOut,
        QuadraticInOut,
        ExponentialIn,
        ExponentialOut,
        ExponentialInOut,
        Sine,
    }

    public static class Choreographer
    {
        public static int PixelCompose (double percent, int size, Easing easing)
        {
            return (int)Math.Round (Compose (percent, size, easing));
        }

        public static double Compose (double percent, double scale, Easing easing)
        {
            return scale * Compose (percent, easing);
        }

        public static double Compose (double percent, Easing easing)
        {
            if (percent < 0.0 || percent > 1.0) {
                throw new ArgumentOutOfRangeException (nameof (percent), "must be between 0 and 1 inclusive");
            }

            switch (easing) {
                case Easing.QuadraticIn:
                    return percent * percent;

                case Easing.QuadraticOut:
                    return -1.0 * percent * (percent - 2.0);

                case Easing.QuadraticInOut:
                    percent *= 2.0;
                    return percent < 1.0
                        ? percent * percent * 0.5
                        : -0.5 * (--percent * (percent - 2.0) - 1.0);

                case Easing.ExponentialIn:
                    return Math.Pow (2.0, 10.0 * (percent - 1.0));

                case Easing.ExponentialOut:
                    return -Math.Pow (2.0, -10.0 * percent) + 1.0;

                case Easing.ExponentialInOut:
                    percent *= 2.0;
                    return percent < 1.0
                        ? 0.5 * Math.Pow (2.0, 10.0 * (percent - 1.0))
                        : 0.5 * (-Math.Pow (2.0, -10.0 * --percent) + 2.0);

                case Easing.Sine:
                    return Math.Sin (percent * Math.PI);

                case Easing.Linear:
                default:
                    return percent;
            }
        }
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable

    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.
-->
<!DOCTYPE Test SYSTEM "test.dtd">
<!--
Author: Ilia A. Leviev
Version: $Revision: 1.3 $
-->
<Test
  ID="fconst_20401"
  date-of-creation="2005-04-27"
  timeout="1"
  >
  <Author value="Ilia A. Leviev"/>
  <Description>
    The test is against the fconst_2 java virtual machine instruction.
    It performs the following check on the instruction.
    The stack state after the instruction execution.

    Covered assertions assert_instr24a099
  </Description>
  <Source name="fconst_20401p.j"/>
  <Runner ID="Runtime">
    <Param name="toRun" value="org.apache.harmony.vts.test.vm.jvms.instructions.loadStore.fconst_2.fconst_204.fconst_20401.fconst_20401p"/>
  </Runner>
</Test>


text:
require_relative '../test_helper'

describe Spinach::Runner do
   let(:filenames) { %w{features/cool_feature.feature features/great_feature.feature} }
   let(:runner) { Spinach::Runner.new(filenames) }

  describe '#initialize' do
    it 'sets the filenames' do
      runner.filenames.must_equal filenames
    end

    describe 'step_definitions_path' do
      it 'sets a default' do
        runner.step_definitions_path.must_be_kind_of String
      end

      it 'can be overriden' do
        runner = Spinach::Runner.new(
          @filename, step_definitions_path: 'spinach/step_definitions'
        )
        runner.step_definitions_path.must_equal 'spinach/step_definitions'
      end
    end

    describe 'support_path' do
      it 'sets a default' do
        runner.support_path.must_be_kind_of String
      end

      it 'can be overriden' do
        runner = Spinach::Runner.new(
          @filename, support_path: 'spinach/environment'
        )
        runner.support_path.must_equal 'spinach/environment'
      end
    end
  end

  describe '#init_reporter' do
    describe "when no reporter_class option is passed in" do
      it 'inits the default reporter' do
        reporter = stub
        reporter.expects(:bind)
        Spinach::Reporter::Stdout.stubs(new: reporter)
        runner.init_reporter
      end
    end

    describe "when reporter_class option is passed in" do
      it "inits the reporter class" do
        config = Spinach::Config.new
        Spinach.stubs(:config).returns(config)
        config.reporter_class = "String"
        reporter = stub
        reporter.expects(:bind)
        String.stubs(new: reporter)
        runner.init_reporter
      end
    end

    describe "when backtrace is passed in" do
      it "inits with backtrace" do
        config = Spinach::Config.new
        Spinach.stubs(:config).returns(config)
        config.reporter_options = {backtrace: true}
        reporter = stub
        reporter.stubs(:bind)
        Spinach::Reporter::Stdout.expects(new: reporter).with(backtrace: true)
        runner.init_reporter
      end
    end
  end

  describe '#run' do
    before(:each) do
      @feature_runner = stub
      filenames.each do |filename|
        Spinach::Parser.stubs(:open_file).with(filename).returns parser = stub
        parser.stubs(:parse).returns feature = Spinach::Feature.new
        Spinach::Runner::FeatureRunner.stubs(:new).
          with(feature, anything).
          returns(@feature_runner)
      end

      @feature_runner.stubs(:run).returns(true)
      runner.stubs(required_files: [])
    end

    it "inits reporter" do
      runner.expects(:init_reporter)
      runner.run
    end

    it 'instantiates a new Feature and runs it with every file' do
      @feature_runner.stubs(:run).returns(true)
      runner.run.must_equal true
    end

    it 'returns false if it fails' do
      @feature_runner.stubs(:run).returns(false)
      runner.run.must_equal false
    end

    describe 'when line set' do
      let(:filename) { 'features/cool_feature.feature' }
      let(:line) { 12 }
      let(:filenames) { ["#{filename}:#{line}"] }
      let(:runner) { Spinach::Runner.new(filenames) }

      it 'sets filename and line on the feature' do
        @feature_runner = stub
        Spinach::Parser.stubs(:open_file).with(filename).returns parser = stub
        parser.stubs(:parse).returns feature = Spinach::Feature.new
        Spinach::Runner::FeatureRunner.stubs(:new).
          with(feature, anything).
          returns(@feature_runner)
        runner.stubs(required_files: [])
        @feature_runner.stubs(:run).returns(true)

        runner.run.must_equal true
        feature.filename.must_equal filename
        feature.lines.must_equal [line]
      end
    end

    describe "when lines set" do
      let(:filename) { "features/cool_feature.feature" }
      let(:line) { "12:24" }
      let(:filenames) { ["#{filename}:#{line}"] }
      let(:runner) { Spinach::Runner.new(filenames) }

      before(:each) do
        @feature_runner = stub
        Spinach::Parser.stubs(:open_file).with(filename).returns parser = stub
        parser.stubs(:parse).returns @feature = Spinach::Feature.new
        Spinach::Runner::FeatureRunner.stubs(:new).
          with(@feature, anything).
          returns(@feature_runner)
        runner.stubs(required_files: [])
      end

      it "sets filename and lines on the feature" do
        @feature_runner.stubs(:run).returns(true)
        runner.run.must_equal true
        @feature.filename.must_equal filename
        @feature.lines.must_equal line.split(":").map(&:to_i)
      end

      it "returns false if it fails" do
        @feature_runner.stubs(:run).returns(false)
        runner.run.must_equal false
      end

      it "breaks with a failure when fail fast set" do
        Spinach.config.stubs(:fail_fast).returns true
        @feature_runner.stubs(:run).returns(false)
        @feature_runner.expects(:run).never
        runner.run.must_equal false
      end

      it "does not break when success when fail fast set" do
        Spinach.config.stubs(:fail_fast).returns true
        @feature_runner.stubs(:run).returns(true)
        @feature_runner.expects(:run).returns true
        runner.run.must_equal true
      end
    end

    describe "when fail_fast set" do
      let(:feature_runners) { [ stub, stub ] }

      before(:each) do
        filenames.each_with_index do |filename, i|
          Spinach::Parser.stubs(:open_file).with(filename).returns parser = stub
          parser.stubs(:parse).returns feature = Spinach::Feature.new
          Spinach::Runner::FeatureRunner.stubs(:new).
            with(feature, anything).
            returns(feature_runners[i])
        end

        feature_runners[0].stubs(:run).returns(false)
        runner.stubs(required_files: [])
        Spinach.config.stubs(:fail_fast).returns true
      end

      it "breaks with a failure" do
        feature_runners[1].expects(:run).never
        runner.run.must_equal false
      end

      it "doesn't break when success" do
        feature_runners[0].stubs(:run).returns(true)
        feature_runners[1].expects(:run).returns true
        runner.run.must_equal true
      end
    end
  end

  describe '#require_dependencies' do
    it 'requires support files and step definitions' do
      runner.stubs(
        required_files: ['a', 'b']
      )
      %w{a b}.each do |file|
        runner.expects(:require).with(file)
      end
      runner.require_dependencies
    end
  end

  describe '#required_files' do
    it 'requires the most deeply nested files first, then alphabetically' do
      FakeFS do
        FileUtils.mkdir_p('features/steps/a')
        FileUtils.mkdir_p('features/steps/z')
        ['features/steps/a.rb', 'features/steps/a/a.rb', 'features/steps/z.rb', 'features/steps/z/z.rb'].each do |f|
          FileUtils.touch(f)
        end
        runner.required_files.must_equal(['/features/steps/a/a.rb', '/features/steps/z/z.rb', '/features/steps/a.rb', '/features/steps/z.rb'])
      end
    end

    it 'requires environment files first' do
      runner.stubs(:step_definition_path).returns('steps')
      runner.stubs(:support_path).returns('support')
      Dir.stubs(:glob).returns(['/support/bar.rb', '/support/env.rb', '/support/quz.rb'])
      runner.stubs(:step_definition_files).returns(['/steps/bar.rb'])
      runner.required_files.must_equal(['/support/env.rb', '/support/bar.rb', '/support/quz.rb', '/steps/bar.rb'])
    end
  end

end


text:
<!DOCTYPE html>

  <meta charset="UTF-8" />
  <title>SiteBase | Examples</title>
  <meta name="description"
    content="Documentation for SiteBase: a minimalistic HTML + CSS + JS base front-end framework for simple web site projects." />

  <meta name="viewport" content="width=device-width, initial-scale=1" />

  <meta http-equiv="X-UA-Compatible" content="ie=edge" />

  <link href="css/style.css" rel="stylesheet" type="text/css" />

SiteBase / Examples

        <button class="menu-button navicon">Menu</button>

Home

Get Started

Documentation

Examples

SiteBase Examples

          The following are examples of how SiteBase can be used in applied
          contexts.

Product Site

              A no-frills, small static product site suitable for small
              businesses and personal portfolios.

              Demo
              Download

Single Page Site

              A simple base for a small single page site suitable for small
              businesses and personal sites.

              Demo
              Download

              Single Page Portfolio

              A simple one page portfolio site suitable for individuals and
              small businesses.

              Demo
              Download

              Designer Single Page Portfolio

A simple one page portfolio site with some custom styling.

              Demo
              Download

SiteBase Home

Get Started

Documentation

Examples


text: export { WatsonHealthWindowOverlay24 as default } from "../../../";


text:
require File.expand_path 'test_helper', File.dirname(__FILE__)

class TestEmWebSocketIOClient < MiniTest::Test

  def test_simple
    post_data = {:time => Time.now.to_s, :msg => 'hello!!'}
    res = nil

    EM::run do
      client = EM::WebSocketIO::Client.new(App.websocketio_url).connect
      client.on :broadcast do |data|
        res = data
        client.close
        EM::add_timer 1 do
          EM::stop
        end
      end

      client.on :connect do |session|
        push :broadcast, post_data
      end

      client.on :error do |err|
        EM::add_timer 1 do
          EM::stop
        end
      end
    end

    assert res != nil, 'server not respond'
    assert res["time"] == post_data[:time]
    assert res["msg"] == post_data[:msg]
  end

  def test_client_to_client2
    ## client --> server --> client2
    post_data = {:time => Time.now.to_s, :msg => 'hello!!', :to => nil}
    res = nil
    res2 = nil
    EM::run do
      client = EM::WebSocketIO::Client.new(App.websocketio_url).connect
      client.on :message do |data|
        res = data
      end

      client.on :error do |err|
        EM::add_timer 1 do
          EM::stop
        end
      end

      client.on :connect do |session|
        client2 = EM::WebSocketIO::Client.new(App.websocketio_url).connect
        client2.on :error do |err|
          EM::add_timer 1 do
            EM::stop
          end
        end
        client2.on :connect do |session2|
          post_data['to'] = session2
          client.push :message, post_data
        end
        client2.on :message do |data|
          res2 = data
          client2.close
          client.close
          EM::add_timer 1 do
            EM::stop
          end
        end
      end

    end

    assert res2 != nil, 'server not respond'
    assert res2["time"] == post_data[:time]
    assert res2["msg"] == post_data[:msg]
    assert res == nil
  end

  def test_broadcast
    ## client --> server --> client&client2
    post_data = {:time => Time.now.to_s, :msg => 'hello!!'}
    res = nil
    res2 = nil
    EM::run do
      client = EM::WebSocketIO::Client.new(App.websocketio_url).connect
      client.on :broadcast do |data|
        res = data
        client.close
      end

      client.on :error do |err|
        EM::add_timer 1 do
          EM::stop
        end
      end

      client.on :connect do |session|
        client2 = EM::WebSocketIO::Client.new(App.websocketio_url).connect
        client2.on :error do |err|
          EM::add_timer 1 do
            EM::stop
          end
        end
        client2.on :connect do |session2|
          client.push :broadcast, post_data
        end
        client2.on :broadcast do |data|
          res2 = data
          client2.close
          EM::add_timer 1 do
            EM::stop
          end
        end
      end

    end
    assert res != nil, 'server not respond'
    assert res["time"] == post_data[:time]
    assert res["msg"] == post_data[:msg]
    assert res2 != nil
    assert res2["time"] == post_data[:time]
    assert res2["msg"] == post_data[:msg]
  end

end


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

<TITLE>
Fft1d
</TITLE>

<META NAME="date" CONTENT="2008-08-04">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

jjil.algorithm

Class Fft1d

java.lang.Object
  jjil.algorithm.Fft1d

public class Fft1d
extends java.lang.Object

Computes 1-dimensional FFT of a complex array.

Constructor Summary

Fft1d(int nMaxWidth)

          Creates a new Fft1d object capable of computing FFTs up to a given maximum
 width.

Method Summary

 Complex[]
fft(Complex[] x)

          Computes forward FFT of the complex array.

 Complex[]
ifft(Complex[] x)

          Computes inverse FFT of the input complex array.

 void
setMaxWidth(int N)

          Sets a new maximum width.

 java.lang.String
toString()

          String describing current FFT instance.

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

Fft1d

public Fft1d(int nMaxWidth)
      throws Error

Creates a new Fft1d object capable of computing FFTs up to a given maximum
 width.

Parameters:
nMaxWidth - The maximum width to compute FFTs for. This is used to precompute the complex
 roots of unity used in the FFT calculation. Must be a power of 2.

Throws:

Error - if width parameter is not a power of two.

Method Detail

fft

public Complex[] fft(Complex[] x)
              throws Error

Computes forward FFT of the complex array.

Parameters:
x - The complex array to compute the FFT of.

Returns:
The FFT of the input.

Throws:

Error - if image size is not a power of two or is larger than maximum width set in
 the constructor.

ifft

public Complex[] ifft(Complex[] x)
               throws Error

Computes inverse FFT of the input complex array.

Parameters:
x - The input complex array.

Returns:
The FFT of the input.

Throws:

Error - if the input size is not a power of two or is larger than the maximum
 set in the constructor.

setMaxWidth

public void setMaxWidth(int N)
                 throws Error

Sets a new maximum width. If smaller than what has been specified before, no
 effect. Otherwise computes some more complex roots of unity.

Parameters:
N - The new maximum width.

Throws:

Error - If N is not a power of 2.

toString

public java.lang.String toString()

String describing current FFT instance.

Overrides:
toString in class java.lang.Object

Returns:
The name and maximum width of this instance.

      Overview
      Package
    Class
      Use
      Tree
      Deprecated
      Index
      Help

 PREV CLASS
 NEXT CLASS

  FRAMES
 NO FRAMES

  All Classes

  SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD