text:
const ranksDataFile = DATA_DIR + 'superranks.json';

var fs = require('fs');

global.SuperRanks = {
	ranks: {},
	isHoster: function (userid) {
		if (userid === 'ecuacion') return true;
		if (this.ranks[userid] && this.ranks[userid] === "h") return true;
		return false;
	},
	isOwner: function (userid) {
		if (this.ranks[userid] && this.ranks[userid] === "o") return true;
		return false;
	},
	isAdmin: function (userid) {
		if (this.ranks[userid] && this.ranks[userid] === "a") return true;
		return false;
	}
};

if (!fs.existsSync(ranksDataFile))
	fs.writeFileSync(ranksDataFile, JSON.stringify(SuperRanks.ranks));

SuperRanks.ranks = JSON.parse(fs.readFileSync(ranksDataFile).toString());

function writeRankData() {
	try {
		fs.writeFileSync(ranksDataFile, JSON.stringify(SuperRanks.ranks));
	} catch (e) {}
}

exports.commands = {
	ga: 'giveaccess',
	giveaccess: function (target, room, user) {
		if (!SuperRanks.isHoster(user.userid) && !SuperRanks.isOwner(user.userid)) return this.sendReply('/giveaccess - access denied');
		if (!target) return this.sendReply('Usage: /giveaccess user, [hoster/owner/admin]');
		target = this.splitTarget(target, true);
		var targetUser = this.targetUser;
		var userid = toId(this.targetUsername);
		var name = targetUser ? targetUser.name : this.targetUsername;
		if (!userid) return this.sendReply('Usage: /giveaccess user, [hoster/owner/admin]');
		if (!SuperRanks.ranks[userid]) {
			if (!targetUser) {
				return this.sendReply("User '" + name + "' is offline and unauthed, and so can't be promoted.");
			}
			if (!targetUser.registered) {
				return this.sendReply("User '" + name + "' is unregistered, and so can't be promoted.");
			}
		}
		var currentRank = SuperRanks.ranks[userid] || ' ';
		var toRank = target.trim() ? target.trim().charAt(0) : 'none';
		if (!(toRank in {h: 1, o: 1, a: 1})) return this.sendReply('Usage: /giveaccess user, [hoster/owner/admin]');
		if ((toRank === 'h' || toRank === 'o' || currentRank === 'h' || currentRank === 'o') && !SuperRanks.isHoster(user.userid)) return this.sendReply('/giveaccess - access denied');
		SuperRanks.ranks[userid] = toRank;
		writeRankData();
		var nameTable = {
			h: "Hoster",
			o: "Owner",
			a: "Admin Director"
		};
		this.sendReply("User " + name + " is now " + nameTable[toRank]);
	},
	ra: 'removeaccess',
	removeaccess: function (target, room, user) {
		if (!SuperRanks.isHoster(user.userid) && !SuperRanks.isOwner(user.userid)) return this.sendReply('/removeaccess - access denied');
		if (!target) return this.sendReply('Usage: /removeaccess user');
		var userid = toId(target);
		if (!SuperRanks.ranks[userid]) return this.sendReply("User " + userid + " does not have access");
		var currentRank = SuperRanks.ranks[userid];
		if ((currentRank === 'h' || currentRank === 'o') && !SuperRanks.isHoster(user.userid)) return this.sendReply('/removeaccess - access denied');
		delete SuperRanks.ranks[userid];
		writeRankData();
		this.sendReply("User " + userid + " removed from excepted users");
	},
	hosters: function (target, room, user, connection) {
		var ranks = SuperRanks.ranks;
		var hosters = [], owners = [], admins = [];
		for (var i in ranks) {
			switch (ranks[i]) {
				case 'h':
					hosters.push(i);
					break;
				case 'o':
					owners.push(i);
					break;
				case 'a':
					admins.push(i);
					break;
			}
		}
		connection.popup("**Hosters:** " + (hosters.length ? hosters.join(", ") : "__(ninguno)__") + "\n\n" + "**Owners:** " + (owners.length ? owners.join(", ") : "__(ninguno)__") + "\n\n" + "**Admin Directors:** " + (admins.length ? admins.join(", ") : "__(ninguno)__"));
	}
};


text:
var io = require('socket.io').listen(8080);
io.set('log level', 1);
var AStar = require('./AAStar.js');
var size = {width:600,height:500};
var astar = new AStar.AStarGrid(size.width, size.height);

var currentPos = {x:0,y:0};
var currentEnd = {x:0,y:0};
var currentPath = [];
var loopRate = 0.1;
var currentIndex = 0;
var moveSpeed = 10; //nodes per second - for now a node can be considered a pixel
var moving = false;

var obstacles = [];
for(var x = 0; x < 400; x++){
    obstacles[x] = {x:x,y:200};
    astar.grid[x][200] = 1;
}

setInterval(update, loopRate);
io.sockets.on('connection', function(socket){
    socket.emit('size', size);
    sendObstacles();
    socket.on('newPos', function(point){
        currentEnd = {x:Math.floor(point.x),y:Math.floor(point.y)};
        currentPath = astar.findPath(currentPos.x, currentPos.y, currentEnd.x, currentEnd.y);
        newPath();
    });
    socket.on('newObstacle', function(point){
        point.x = Math.floor(point.x);
        point.y = Math.floor(point.y);
        astar.grid[point.x][point.y].val = 1;
        obstacles.push(point);
        if(currentPath !== null){
            currentPath = astar.findPath(currentPos.x, currentPos.y, currentEnd.x, currentEnd.y);
            newPath();
        }
        sendObstacles();
    });
});

function newPath(){
    currentIndex = 0;
    moving = true;
}

function update(){
    if(currentIndex + 1 >= currentPath.length){
        //done moving
        moving = false;
        sendPosition();
        return;
    }
    currentIndex += loopRate*moveSpeed;
    if(currentIndex >= currentPath.length && moving){
        moving = false;
        currentPos = currentPath[currentPath.length-1];
        currentPath = [];
        sendPosition();
        return;
    }
    if(moving)
        currentPos = currentPath[currentIndex];
    sendPosition();
}

function sendPosition(){
    var prunedPath = [];
    for(var x = 0; x < loopRate*moveSpeed; x++){
        if(currentIndex+x >= currentPath.length)
            break;
        prunedPath.push(currentPath[currentIndex+x]);
    }
    io.sockets.emit('update', {currentPosition:currentPos,moving:moving,currentIndex:0,currentPath:prunedPath,moveSpeed:moveSpeed});
}

function sendObstacles(){
    io.sockets.emit('obstacles', obstacles);
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>Lums: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

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

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

Lums

Main Page

Namespaces

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Class List

Class Index

Class Hierarchy

Class Members

lm

Core

lm::Core Member List

This is the complete list of members for lm::Core, including all inherited members.

clear()	lm::Core

instance()	lm::Singleton< Core >	inlinestatic

operator=(const Singleton< Core > &)=delete	lm::Singleton< Core >	protected

pop()	lm::Core

push(Args...args)	lm::Core	inline

remove(GameState *state)	lm::Core

setWindow(Window *win)	lm::Core	inline

Singleton()=default	lm::Singleton< Core >	protected

Singleton(const Singleton< Core > &)=delete	lm::Singleton< Core >	protected

Singleton< Core > (defined in lm::Core)	lm::Core	friend

start()	lm::Core

stateless() const 	lm::Core

stop()	lm::Core

transition(Args...args)	lm::Core	inline

window()	lm::Core	inline

~Core()	lm::Core

<address class="footer">
</address>


text:
[![Gem Version](https://badge.fury.io/rb/first_gem_yiyang_song.png)](http://badge.fury.io/rb/first_gem_yiyang_song)[![Code Climate](https://codeclimate.com/github/songyiyang/first_gem_yiyang_song.png)](https://codeclimate.com/github/songyiyang/first_gem_yiyang_song)[![Build Status](https://travis-ci.org/songyiyang/first_gem_yiyang_song.png?branch=v0.0.4)](https://travis-ci.org/songyiyang/first_gem_yiyang_song)

TODO: Write a gem description

## Installation

Add this line to your application's Gemfile:

    gem 'first_gem_yiyang_song'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install first_gem_yiyang_song

## Usage

TODO: Write usage instructions here

## Contributing

1. Fork it ( http://github.com/<my-github-username>/first_gem_yiyang_song/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


text:
<?php

namespace KoolKode\Async\Stream;

use KoolKode\Async\Context;
use KoolKode\Async\Channel\IterableChannel;
use KoolKode\Async\Test\AsyncTestCase;

/**
 * @covers \KoolKode\Async\Stream\ReadableChannelStream
 */
class ReadableChannelStreamTest extends AsyncTestCase
{
    public function testCanReadContents(Context $context)
    {
        $channel = new IterableChannel([
            'World',
            ' :)'
        ]);

        $stream = new ReadableChannelStream($channel, 'Hello ');

        try {
            $this->assertEquals('Hello World :)', yield $stream->readBuffer($context, 1000, false));
        } finally {
            $stream->close();
        }

        $this->assertNull(yield $channel->receive($context));
    }

    public function testCloseWithError(Context $context)
    {
        $channel = new IterableChannel((array) 'Hello!');
        $stream = new ReadableChannelStream($channel);
        $stream->close(new \LogicException('Fail!'));

        $this->expectException(\LogicException::class);

        yield $channel->receive($context);
    }
}


text:
'use strict';

var path = require('path');
var assert = require('yeoman-generator').assert;
var helpers = require('yeoman-generator').test;
var os = require('os');

describe('up-for-grabs:app', function () {
  before(function (done) {
    helpers.run(path.join(__dirname, '../generators/app'))
      .withOptions({ skipInstall: true })
      .withPrompts({ name: 'blarg' })
      .on('end', done);
  });

  it('creates files', function () {
    assert.file([
      'blarg.yml'
    ]);
  });
});


text:
<?php

namespace Examples;

use RestMachine\WebMachine;
use Silex\Application;

class SilexTodoApp {

    private $app;
    private $webmachine;
    private $db;

    function __construct($dbFile) {
        $this->db = new \PDO("sqlite:$dbFile");
        $this->db->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
        $this->app = new Application();
        $this->app['debug'] = true;
        $this->webmachine = new WebMachine();
    }

    function run() {
        Todo::setupDb($this->db);

        $this->app->match('/todos', function() {
            return $this->dispatch(TodoResource::collection($this->db));
        });

        $this->app->match('/todos/{id}', function($id) {
            return $this->dispatch(TodoResource::entity($this->db, intval($id)));
        });

        $this->app->run();
    }

    private function dispatch($resource) {
        return $this->webmachine->run($resource, $this->app['request']);
    }

}


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

namespace Server.Services.Utils
{
    internal static class IEnumerableExtensions
    {
        public static bool IsNullOrEmpty<T>(this IEnumerable<T> data)
        {
            return data == null || !data.Any();
        }

        public static bool IsNullOrEmptyOrAnyItemNull<T>(this IEnumerable<T> enumerable)
            where T : class
        {
            var list = enumerable.ToList();

            return list.IsNullOrEmpty() || list.Any(arg => arg == null);
        }

        public static bool IsNullOrEmptyOrAllItemNull<T>(this IEnumerable<T> enumerable)
            where T : class
        {
            var list = enumerable.ToList();

            return list.IsNullOrEmpty() || list.All(arg => arg == null);
        }
    }
}


text:
/**
 * Project Euler
 * Problem 2 - Even Fibonacci numbers
 */

#include <iostream>
#include <vector>

int even(int n) {
    return (n % 2 == 0);
}

int main(void) {
    /**
     * Quick fibonacci number generation using vectors.
     * Generating fibonacci numbers this way is efficient because
     * each number in the series only needs to be computed once.
     */

    std::vector<int> fib_series = {1, 1};
    /**
     * Iterator pointing to the "past-the-end" element  of the vector
     * (not the last element, which in this case would be 1)
     */

    std::vector<int>::iterator it = fib_series.end();

    int sum = 0;

    while (1) {
        /**
         * Because the iterator is pointing to an element which is past the end of the vector,
         * we need to move back one step to the real last element.
         */
        it--;
        // Element at the end of the vector
        int a = *it;
        it--;
        // Second to last element in the vector
        int b = *it;
        int c = a + b;
        fib_series.push_back(c);
        // Reset iterator to end of vector
        it = fib_series.end();

        if (c >= 4000000) {
            break;
        }

        if (even(c)) {
            sum += c;
        }
    }

    std::cout << sum << std::endl;

    return 0;
}


text:
<?php

defined('_JEXEC') or die('Restricted access');

class EasyBlogCommentDisqus
{
	public static function getHTML( $blog )
	{
		$config	= EasyBlogHelper::getConfig();
		$theme	= new CodeThemes();
		$code	= $config->get('comment_disqus_code');

		if( empty($code) )
		{
			return '';
		}

		$code	= JString::str_ireplace('Please enable JavaScript to view the comments powered by Disqus.','' , $code );
		$code	= JString::str_ireplace('blog comments powered by Disqus','',$code);

		$theme->set( 'code'	, $code );
		$theme->set( 'blog' , $blog );
		return $theme->fetch( 'comment.disqus.php' );
	}
}


text:
***********************************************************************
Cyclus Stub Model Input Examples
***********************************************************************
This directory includes working input files for running simulations with
the Cyclus nuclear fuel cycle simulator.

To see user and developer documentation for the cyclus code, please visit
the Cyclus Homepage at http://fuelcycle.org/.

------------------------------------------------------------------
How To Use These Input Files
------------------------------------------------------------------
Let's say you've decided to implement a new Facility model. Let's say it's a
one group burnup approximation of some kind. You want to call it OneGroupReactor.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Modifying the Inputs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If your model is based on a StubFacility, for example, you may want to search
and replace instances of StubFacility with OneGroupReactor. If you've altered
the StubFacility rng schema to initialize your module, you'll need to alter the
input xml. Else, you'll just need to search and replace. Try running these inputs
either with the run_inputs script in the bin directory or on their own with
cyclus <infile>.


text:
static const char* test_User = "User";
static const char* test_Domain = "Domain";
static const char* test_Password = "Password";

int TestAcquireCredentialsHandle(int argc, char* argv[])
{
	SECURITY_STATUS status;
	CredHandle credentials;
	TimeStamp expiration;
	SEC_WINNT_AUTH_IDENTITY identity;
	SecurityFunctionTable* table;
	SecPkgCredentials_Names credential_names;

	sspi_GlobalInit();

	table = InitSecurityInterface();

	identity.User = (UINT16*) _strdup(test_User);
	identity.Domain = (UINT16*) _strdup(test_Domain);
	identity.Password = (UINT16*) _strdup(test_Password);
	if (!identity.User || !identity.Domain || !identity.Password)
	{
		free(identity.User);
		free(identity.Domain);
		free(identity.Password);
		fprintf(stderr, "Memory allocation failed\n");
		return -1;
	}
	identity.UserLength = strlen(test_User);
	identity.DomainLength = strlen(test_Domain);
	identity.PasswordLength = strlen(test_Password);
	identity.Flags = SEC_WINNT_AUTH_IDENTITY_ANSI;

	status = table->AcquireCredentialsHandle(NULL, NTLMSP_NAME,
			SECPKG_CRED_OUTBOUND, NULL, &identity, NULL, NULL, &credentials, &expiration);

	if (status != SEC_E_OK)
	{
		sspi_GlobalFinish();
		return -1;
	}

	status = table->QueryCredentialsAttributes(&credentials, SECPKG_CRED_ATTR_NAMES, &credential_names);

	if (status != SEC_E_OK)
	{
		sspi_GlobalFinish();
		return -1;
	}

	sspi_GlobalFinish();

	return 0;
}


text:
module ActiveScaffold::Actions
  module BatchUpdate

    GenericOperators = [
      'NO_UPDATE',
      'REPLACE'
    ]
    NumericOperators = [
      'PLUS',
      'MINUS',
      'TIMES',
      'DIVISION'
    ]
    NumericOptions = [
      'ABSOLUTE',
      'PERCENT'
    ]

    DateOperators = [
      'PLUS',
      'MINUS'
    ]

    def self.included(base)
      base.send :include, ActiveScaffold::Actions::BatchBase unless base < ActiveScaffold::Actions::BatchBase
      base.before_action :batch_update_authorized_filter, :only => [:batch_edit, :batch_update]
      base.helper_method :batch_update_values
    end

    def batch_edit
      do_batch_edit
      respond_to_action(:batch_edit)
    end

    def batch_update
      batch_action
    end

    protected
    def batch_edit_respond_to_html
      if batch_successful?
        render(:action => 'batch_update')
      else
        return_to_main
      end
    end

    def batch_edit_respond_to_js
      render(:partial => 'batch_update_form')
    end

    def batch_update_values
      @batch_update_values || {}
    end

    def batch_update_respond_to_html
      if params[:iframe]=='true' # was this an iframe post ?
        flash[:info] = as_(:batch_processing_successful) if batch_successful?
        do_refresh_list
        responds_to_parent do
          render :action => 'on_batch_update.js', :layout => false
        end
      else # just a regular post
        if batch_successful?
          flash[:info] = as_(:updated_model, :model => @record.to_label)
          return_to_main
        else
          render(:action => 'batch_update')
        end
      end
    end

    def batch_update_respond_to_js
      flash[:info] = as_(:batch_processing_successful) if batch_successful?
      do_refresh_list
      render :action => 'on_batch_update'
    end

    def do_batch_edit
      self.successful = true
      do_new
    end

    def before_do_batch_update
      @batch_update_values = update_attribute_values_from_params(active_scaffold_config.batch_update.columns, params[:record])
    end

    def batch_update_listed
      case active_scaffold_config.batch_update.process_mode
      when :update then
        each_record_in_scope {|record| update_record_in_batch(record) if authorized_for_job?(record)}
      when :update_all then
        updates = updates_for_update_all
        unless updates.first.empty?
          do_search if respond_to? :do_search, true
          # all_conditions might fail cause joins are not working in update_all
          active_scaffold_config.model.update_all(updates, all_conditions)
        end
      else
        Rails.logger.error("Unknown process_mode: #{active_scaffold_config.batch_update.process_mode} for action batch_update")
      end

    end

    def batch_update_marked
      case active_scaffold_config.batch_update.process_mode
      when :update then
        each_marked_record {|record| update_record_in_batch(record) if authorized_for_job?(record)}
      when :update_all then
        updates = updates_for_update_all
        unless updates.first.empty?
          active_scaffold_config.model.where(active_scaffold_config.model.primary_key => marked_records.to_a).update_all(updates)
          do_demark_all
        end
      else
        Rails.logger.error("Unknown process_mode: #{active_scaffold_config.batch_update.process_mode} for action batch_update")
      end
    end

    def updates_for_update_all()
      update_all = [[]]
      batch_update_values.each do |attribute, value|
        sql_set, value = get_update_all_attribute(value[:column], attribute, value[:value])
        unless sql_set.nil?
          update_all.first << sql_set
          update_all << value if value.present?
        end
      end
      update_all[0] = update_all.first.join(',')
      update_all
    end

    def update_record_in_batch(record)
      @successful = nil
      @record = record

      batch_update_values.each do |attribute, value|
        set_record_attribute(value[:column], attribute, value[:value])
      end

      update_save(:no_record_param_update => true)
      if successful?
        @record.as_marked = false if batch_scope == 'MARKED'
      else
        error_records << @record
      end
    end

    def get_update_all_attribute(column, attribute, value)
      form_ui = column_form_ui(column)

      if form_ui && (method = override_batch_update_all_value(form_ui))
        update_value = send(method, column, value)
        if update_value.nil?
          sql_set = nil
        else
          sql_set = "#{attribute} = #{update_value}"
          update_value = nil
        end
      else
        sql_set = "#{attribute} = ?"
        update_value = value[:value]
      end

      return sql_set, update_value
    end

    # TODO: delete when ActiveScaffold 3.5 is released and required
    def params_hash?(value)
      value.is_a?(Hash) || (Rails.version >= '5.0' && value.is_a?(ActionController::Parameters))
    end

    def update_attribute_values_from_params(columns, attributes)
      values = {}
      return values unless params_hash? attributes
      columns.each_column(for: new_model, crud_type: :update, flatten: true) do |column|
        next unless params_hash?(attributes[column.name]) && attributes[column.name][:operator] != 'NO_UPDATE'
        value = attributes[column.name]
        value[:value] = value[:operator] == 'NULL' ? nil : column_value_from_param_value(nil, column, value[:value])
        values[column.name] = {:column => column, :value => value}
      end
      values
    end

    # The default security delegates to ActiveRecordPermissions.
    # You may override the method to customize.
    def batch_update_authorized?(record = nil)
      authorized_for?(:crud_type => :update)
    end

    def batch_update_ignore?(record = nil)
      false
    end

    def batch_update_value_for_numeric(column, record, calculation_info)
      current_value = record.send(column.name)
      if ActiveScaffold::Actions::BatchUpdate::GenericOperators.include?(calculation_info[:operator]) || ActiveScaffold::Actions::BatchUpdate::NumericOperators.include?(calculation_info[:operator])
        operand = self.class.condition_value_for_numeric(column, calculation_info[:value])
        operand = current_value / 100 * operand  if calculation_info[:opt] == 'PERCENT'
        case calculation_info[:operator]
        when 'REPLACE' then operand
        when 'NULL' then nil
        when 'PLUS' then current_value.present? ? current_value + operand : nil
        when 'MINUS' then current_value.present? ? current_value - operand : nil
        when 'TIMES' then current_value.present? ? current_value * operand : nil
        when 'DIVISION' then current_value.present? ? current_value / operand : nil
        else
          current_value
        end
      else
        current_value
      end
    end
    alias_method :batch_update_value_for_integer, :batch_update_value_for_numeric
    alias_method :batch_update_value_for_decimal, :batch_update_value_for_numeric
    alias_method :batch_update_value_for_float, :batch_update_value_for_numeric

    def batch_update_all_value_for_numeric(column, calculation_info)
      if ActiveScaffold::Actions::BatchUpdate::GenericOperators.include?(calculation_info[:operator]) || ActiveScaffold::Actions::BatchUpdate::NumericOperators.include?(calculation_info[:operator])
        operand = active_scaffold_config.model.quote_value(self.class.condition_value_for_numeric(column, calculation_info[:value]))
        if calculation_info[:opt] == 'PERCENT'
          operand = "#{active_scaffold_config.model.connection.quote_column_name(column.name)} / 100.0 * #{operand}"
        end
        case calculation_info[:operator]
        when 'REPLACE' then operand
        when 'NULL' then active_scaffold_config.model.quote_value(nil)
        when 'PLUS' then "#{active_scaffold_config.model.connection.quote_column_name(column.name)} + #{operand}"
        when 'MINUS' then "#{active_scaffold_config.model.connection.quote_column_name(column.name)} - #{operand}"
        when 'TIMES' then "#{active_scaffold_config.model.connection.quote_column_name(column.name)} * #{operand}"
        when 'DIVISION' then "#{active_scaffold_config.model.connection.quote_column_name(column.name)} / #{operand}"
        else
          nil
        end
      else
        nil
      end
    end
    alias_method :batch_update_all_value_for_integer, :batch_update_all_value_for_numeric
    alias_method :batch_update_all_value_for_decimal, :batch_update_all_value_for_numeric
    alias_method :batch_update_all_value_for_float, :batch_update_all_value_for_numeric

    def batch_update_value_for_date_picker(column, record, calculation_info)
      current_value = record.send(column.name)
      {"number"=>"", "unit"=>"DAYS", "value"=>"November 16, 2010", "operator"=>"REPLACE"}
      if ActiveScaffold::Actions::BatchUpdate::GenericOperators.include?(calculation_info[:operator]) || ActiveScaffold::Actions::BatchUpdate::DateOperators.include?(calculation_info[:operator])
        operand = self.class.condition_value_for_datetime(column, calculation_info[:value], column.column.type == :date ? :to_date : :to_time)
        case calculation_info[:operator]
        when 'REPLACE' then operand
        when 'NULL' then nil
        when 'PLUS' then
          trend_number = [calculation_info['number'].to_i,  1].max
          current_value.in((trend_number).send(calculation_info['unit'].downcase.singularize.to_sym))
        when 'MINUS' then
          trend_number = [calculation_info['number'].to_i,  1].max
          current_value.ago((trend_number).send(calculation_info['unit'].downcase.singularize.to_sym))
        else
          current_value
        end
      else
        current_value
      end
    end
    alias_method :batch_update_value_for_calendar_date_select, :batch_update_value_for_date_picker

    def override_batch_update_value(form_ui)
      method = "batch_update_value_for_#{form_ui}"
      method if respond_to? method, true
    end

    def override_batch_update_all_value(form_ui)
      method = "batch_update_all_value_for_#{form_ui}"
      method if respond_to? method, true
    end

    private

    def batch_update_authorized_filter
      link = active_scaffold_config.batch_update.link || active_scaffold_config.batch_update.class.link
      raise ActiveScaffold::ActionNotAllowed unless self.send(link.security_method)
    end
    def batch_edit_formats
      (default_formats + active_scaffold_config.formats).uniq
    end
  end
end


text:
<?php

/*
 * This file is part of the andreas-weber/php-config library.
 *
 * (c) Andreas Weber <code@andreas-weber.me>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace AndreasWeber\Config\Test\Core;

use AndreasWeber\Config\Core\Config;
use AndreasWeber\Config\Core\ConfigLoader;

class ConfigLoaderTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @var ConfigLoader Config loader instance
     */
    private $configLoader;

    public function setUp()
    {
        parent::setUp();

        $this->configLoader = new ConfigLoader();
    }

    public function testLoadConfigFile()
    {
        $config = $this->configLoader->load(
            array(
                __DIR__ . '/Fixtures/config1.yml'
            )
        );

        $this->assertEquals(
            array(
                'version' => 'dev',
                'user' => array(
                    'salt' => 'this_is_a_prett_cool_application_salt'
                )
            ),
            $config->toArray()
        );
    }

    public function testLoadConfigFileFromArray()
    {
        $options = array(
            'custom1' => array(
                'hello',
                'you'
            ),
            'custom2' => true
        );

        $config = $this->configLoader->loadArray($options);

        $this->assertEquals(
            $options,
            $config->toArray()
        );
    }

    public function testLoadConfigFileDoesReplacements()
    {
        $this->configLoader->setReplacements(
            array(
                'logPath' => '/some/path'
            )
        );

        $config = $this->configLoader->loadArray(
            array(
                'custom1' => array(
                    'logPath' => '%logPath%/logfile.txt'
                ),
                'custom2' => true
            )
        );

        $this->assertEquals(
            array(
                'custom1' => array(
                    'logPath' => '/some/path/logfile.txt'
                ),
                'custom2' => true
            ),
            $config->toArray()
        );
    }

    public function testLoadMultipleConfigFiles()
    {
        $config = $this->configLoader->load(
            array(
                __DIR__ . '/Fixtures/config1.yml',
                __DIR__ . '/Fixtures/config2.yml'
            )
        );

        $this->assertEquals(
            array(
                'version' => 'dev',
                'user' => array(
                    'salt' => 'this_is_a_prett_cool_application_salt'
                ),
                'logging' => array(
                    'logfile' => '/var/log/application.log'
                )
            ),
            $config->toArray()
        );
    }

    public function testLoadMultipleConfigFilesWithOverride()
    {
        $config = $this->configLoader->load(
            array(
                __DIR__ . '/Fixtures/config1.yml',
                __DIR__ . '/Fixtures/config3.yml'
            )
        );

        $this->assertEquals(
            array(
                'version' => 'prod',
                'user' => array(
                    'salt' => 'this_is_a_prett_cool_application_salt2'
                )
            ),
            $config->toArray()
        );
    }

    public function testLoadConfigFileWithReplacements()
    {
        $this->configLoader->setReplacements(
            array(
                'logPath' => '/some/path'
            )
        );

        $config = $this->configLoader->load(
            array(
                __DIR__ . '/Fixtures/config4.yml'
            )
        );

        $this->assertEquals(
            array(
                'version' => 'dev',
                'user' => array(
                    'salt' => 'this_is_a_prett_cool_application_salt'
                ),
                'logging' => array(
                    'logfile' => '/some/path/application.log'
                )
            ),
            $config->toArray()
        );
    }

    public function testMergeInPassedConfigInstance()
    {
        $config = new Config(
            array(
                'hello' => 'you'
            )
        );

        $config = $this->configLoader->load(
            array(
                __DIR__ . '/Fixtures/config1.yml'
            ),
            $config
        );

        $this->assertEquals(
            array(
                'version' => 'dev',
                'user' => array(
                    'salt' => 'this_is_a_prett_cool_application_salt'
                ),
                'hello' => 'you'
            ),
            $config->toArray()
        );
    }

    public function testLoadMultipleFilesWithAtLeastOneRealFilesIsSuccessful()
    {
        $config = $this->configLoader->load(
            array(
                __DIR__ . '/Fixtures/config1.yml',
                __DIR__ . '/some/path/config1.yml',
                __DIR__ . '/Fixtures/config2.yml',
                __DIR__ . '/some/path/config2.yml'
            )
        );

        $this->assertEquals(
            array(
                'version' => 'dev',
                'user' => array(
                    'salt' => 'this_is_a_prett_cool_application_salt'
                ),
                'logging' => array(
                    'logfile' => '/var/log/application.log'
                )
            ),
            $config->toArray()
        );
    }

    /**
     * @expectedException \RuntimeException
     * @expectedExceptionMessage Invalid config file list given. At least one config file must exist.
     */
    public function testLoadMultipleNotExistentFilesThrowsException()
    {
        $this->configLoader->load(
            array(
                __DIR__ . '/some/path/config1.yml',
                __DIR__ . '/some/path/config2.yml'
            )
        );
    }
}


text:
FROM 32bit/ubuntu:14.04

MAINTAINER Steven E. Pav, shabbychef@gmail.com

ENV DEBIAN_FRONTEND noninteractive

# Install dependencies
RUN (apt-get update ; \
	apt-get upgrade -y ; \
	apt-get install -y -q build-essential ruby1.9.3 python2.7 ruby-bundler libicu-dev libreadline-dev libssl-dev zlib1g-dev git-core ; \
	apt-get clean ; \
	rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/* ; \
	gem install gollum redcarpet github-markdown ; \
	mkdir -p /srv/gollum ; \
	git init /srv/gollum )

# Expose default gollum port 4567
EXPOSE 4567

# ENTRYPOINT and CMD are better together:
ENTRYPOINT ["/usr/local/bin/gollum"]
CMD ["--port","4567","--base-pat","wiki","--mathjax","--no-live-preview","--user-icons","gravatar","--h1-title","/srv/gollum"]

#for vim modeline: (do not edit)
# vim:nu:fdm=marker:fmr=FOLDUP,UNFOLD:cms=#%s:syn=Dockerfile:ft=Dockerfile:fo=croql


text:
require 'rubygems'
require 'lib/bandwidth'
require 'awesome_print'

bandwidth = Bandwidth.new(:developer_key   => 'your developer key', :use_lab_uris => true)

ap bandwidth.area_code_number_search :area_code => '720', :max_quantity => 1


text:
package it.unibz.inf.ontop.iq.transformer.impl;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Multiset;
import com.google.inject.assistedinject.Assisted;
import com.google.inject.assistedinject.AssistedInject;
import it.unibz.inf.ontop.exception.MinorOntopInternalBugException;
import it.unibz.inf.ontop.exception.OntopInternalBugException;
import it.unibz.inf.ontop.injection.IntermediateQueryFactory;
import it.unibz.inf.ontop.iq.IQTree;
import it.unibz.inf.ontop.iq.UnaryIQTree;
import it.unibz.inf.ontop.iq.node.*;
import it.unibz.inf.ontop.iq.transform.IQTreeTransformer;
import it.unibz.inf.ontop.iq.transform.impl.ChildTransformer;
import it.unibz.inf.ontop.iq.transform.impl.CompositeIQTreeTransformer;
import it.unibz.inf.ontop.iq.transform.impl.DefaultNonRecursiveIQTreeTransformer;
import it.unibz.inf.ontop.iq.transformer.ExplicitEqualityTransformer;
import it.unibz.inf.ontop.model.atom.AtomFactory;
import it.unibz.inf.ontop.model.atom.AtomPredicate;
import it.unibz.inf.ontop.model.atom.DataAtom;
import it.unibz.inf.ontop.model.term.*;
import it.unibz.inf.ontop.substitution.ImmutableSubstitution;
import it.unibz.inf.ontop.substitution.InjectiveVar2VarSubstitution;
import it.unibz.inf.ontop.substitution.SubstitutionFactory;
import it.unibz.inf.ontop.utils.ImmutableCollectors;
import it.unibz.inf.ontop.utils.VariableGenerator;

import java.util.*;
import java.util.stream.Stream;

public class ExplicitEqualityTransformerImpl implements ExplicitEqualityTransformer {

    private final IntermediateQueryFactory iqFactory;
    private final AtomFactory atomFactory;
    private final TermFactory termFactory;
    private final VariableGenerator variableGenerator;
    private final SubstitutionFactory substitutionFactory;
    private final CompositeIQTreeTransformer compositeTransformer;

    @AssistedInject
    public ExplicitEqualityTransformerImpl(@Assisted VariableGenerator variableGenerator,
                                           IntermediateQueryFactory iqFactory,
                                           AtomFactory atomFactory,
                                           TermFactory termFactory,
                                           SubstitutionFactory substitutionFactory) {
        this.iqFactory = iqFactory;
        this.atomFactory = atomFactory;
        this.termFactory = termFactory;
        this.variableGenerator = variableGenerator;
        this.substitutionFactory = substitutionFactory;
        ImmutableList<IQTreeTransformer> preTransformers = ImmutableList.of(new LocalExplicitEqualityEnforcer());
        ImmutableList<IQTreeTransformer> postTransformers = ImmutableList.of(new CnLifter(), new FilterChildNormalizer(iqFactory));
        this.compositeTransformer = new CompositeIQTreeTransformer(preTransformers, postTransformers, iqFactory);
    }

    @Override
    public IQTree transform(IQTree tree) {
          return compositeTransformer.transform(tree);
    }

    /**
     * Affects left joins, inner joins and data nodes.
     *
     * - left join: if the same variable is returned by both operands (implicit equality),
     * rename it (with a fresh variable) in the left branch, and make the corresponding equality explicit.
     *
     * - inner join: identical to left join, except that renaming is performed in each branch but the first where the variable appears.
     *
     * - data node or: if the data atom contains a ground term or a duplicate variable,
     * create a variable and make the equality explicit by creating a filter.
     *
     * If needed, create a root projection to ensure that the transformed query has the same signature as the input one.
     */
    class LocalExplicitEqualityEnforcer extends DefaultNonRecursiveIQTreeTransformer {

        @Override
        public IQTree transformIntensionalData(IntensionalDataNode dn) {
            return transformIntensionalDataNode(dn);
        }

        @Override
        public IQTree transformExtensionalData(ExtensionalDataNode dn) {
            return transformExtensionalDataNode(dn);
        }

        @Override
        public IQTree transformInnerJoin(IQTree tree, InnerJoinNode rootNode, ImmutableList<IQTree> children) {
            ImmutableList<InjectiveVar2VarSubstitution> substitutions = computeSubstitutions(children);
            if (substitutions.stream().allMatch(ImmutableSubstitution::isEmpty))
                return tree;

            ImmutableList<IQTree> updatedChildren = updateJoinChildren(substitutions, children);
            return iqFactory.createUnaryIQTree(
                    iqFactory.createConstructionNode(tree.getVariables()),
                    iqFactory.createNaryIQTree(
                            iqFactory.createInnerJoinNode(
                                    Optional.of(updateJoinCondition(
                                            rootNode.getOptionalFilterCondition(),
                                            substitutions ))),
                            updatedChildren
                    ));
        }

        @Override
        public IQTree transformLeftJoin(IQTree tree, LeftJoinNode rootNode, IQTree leftChild, IQTree rightChild) {
            ImmutableList<IQTree> children = ImmutableList.of(leftChild, rightChild);
            ImmutableList<InjectiveVar2VarSubstitution> substitutions = computeSubstitutions(children);
            if (substitutions.stream().allMatch(ImmutableSubstitution::isEmpty))
                return tree;

           ImmutableList<IQTree> updatedChildren = updateJoinChildren(substitutions, children);

           return iqFactory.createUnaryIQTree(
                   iqFactory.createConstructionNode(tree.getVariables()),
                   iqFactory.createBinaryNonCommutativeIQTree(
                           iqFactory.createLeftJoinNode(
                                   Optional.of(
                                           updateJoinCondition(
                                                   rootNode.getOptionalFilterCondition(),
                                                   substitutions
                                           ))),
                           updatedChildren.get(0),
                           updatedChildren.get(1)
                   ));
        }

        private ImmutableList<InjectiveVar2VarSubstitution> computeSubstitutions(ImmutableList<IQTree> children) {
            if (children.size() < 2) {
                throw new ExplicitEqualityTransformerInternalException("At least 2 children are expected");
            }
            ImmutableSet<Variable> repeatedVariables = children.stream()
                    .flatMap(t -> t.getVariables().stream())
                    .collect(ImmutableCollectors.toMultiset()).entrySet().stream()
                    .filter(e -> e.getCount() > 1)
                    .map(Multiset.Entry::getElement)
                    .collect(ImmutableCollectors.toSet());

            return children.stream().sequential()
                    .map(t -> substitutionFactory.getInjectiveVar2VarSubstitution(
                                        t.getVariables().stream()
                                                .filter(repeatedVariables::contains)
                                                .filter(v -> !isFirstOcc(v, children, t)),
                                        variableGenerator::generateNewVariableFromVar))
                    .collect(ImmutableCollectors.toList());
        }

        private ImmutableList<IQTree> updateJoinChildren(ImmutableList<InjectiveVar2VarSubstitution> substitutions, ImmutableList<IQTree> children) {
            Iterator<IQTree> it = children.iterator();
            return substitutions.stream().sequential()
                    .map(s -> it.next().applyDescendingSubstitutionWithoutOptimizing(s, variableGenerator))
                    .collect(ImmutableCollectors.toList());
        }

        private boolean isFirstOcc(Variable variable, ImmutableList<IQTree> children, IQTree tree) {
            return children.stream().sequential()
                    .filter(t -> t.getVariables().contains(variable))
                    .findFirst()
                    .orElseThrow(() -> new MinorOntopInternalBugException("Should be present"))
                    == tree;
        }

        private ImmutableExpression updateJoinCondition(Optional<ImmutableExpression> optionalFilterCondition, ImmutableList<InjectiveVar2VarSubstitution> substitutions) {
            Stream<ImmutableExpression> varEqualities = substitutions.stream()
                    .flatMap(s -> s.getImmutableMap().entrySet().stream())
                    .map(e -> termFactory.getStrictEquality(e.getKey(), e.getValue()));
            return termFactory.getConjunction(optionalFilterCondition, varEqualities).get();
        }

        private IQTree transformIntensionalDataNode(IntensionalDataNode dn) {
            ImmutableList<Optional<Variable>> replacementVars = getArgumentReplacement(dn.getProjectionAtom());

            if (allAbsent(replacementVars))
                return dn;

            FilterNode filter = createFilter(dn.getProjectionAtom(), replacementVars);
            DataAtom<AtomPredicate> atom = replaceVars(dn.getProjectionAtom(), replacementVars);
            return iqFactory.createUnaryIQTree(
                    iqFactory.createConstructionNode(dn.getVariables()),
                    iqFactory.createUnaryIQTree(
                            filter,
                            dn.newAtom(atom))
            );
        }

        private IQTree transformExtensionalDataNode(ExtensionalDataNode dn) {
            ImmutableMap<Integer, ? extends VariableOrGroundTerm> initialArgumentMap = dn.getArgumentMap();
            ImmutableMap<Integer, Variable> replacementVars = getArgumentReplacement(initialArgumentMap);

            if (replacementVars.isEmpty())
                return dn;

            FilterNode filter = createFilter(initialArgumentMap, replacementVars);
            ImmutableMap<Integer, ? extends VariableOrGroundTerm> newArgumentMap = replaceVars(initialArgumentMap, replacementVars);
            return iqFactory.createUnaryIQTree(
                    iqFactory.createConstructionNode(dn.getVariables()),
                    iqFactory.createUnaryIQTree(
                            filter,
                            iqFactory.createExtensionalDataNode(dn.getRelationDefinition(), newArgumentMap))
            );
        }

        private boolean allAbsent(ImmutableList<Optional<Variable>> replacementVars) {
            return replacementVars.stream()
                    .noneMatch(Optional::isPresent);
        }

        private <P extends AtomPredicate> DataAtom<P> replaceVars(DataAtom<P> projectionAtom, ImmutableList<Optional<Variable>> replacements) {
            Iterator<Optional<Variable>> it = replacements.iterator();
            return atomFactory.getDataAtom(
                    projectionAtom.getPredicate(),
                    projectionAtom.getArguments().stream()
                            .map(a -> {
                                Optional<Variable> r = it.next();
                                return r.isPresent() ?
                                        r.get() :
                                        a;
                            })
                            .collect(ImmutableCollectors.toList())
            );
        }

        private ImmutableMap<Integer, ? extends VariableOrGroundTerm> replaceVars(
                ImmutableMap<Integer, ? extends VariableOrGroundTerm> argumentMap,
                ImmutableMap<Integer, Variable> replacements) {
            return argumentMap.entrySet().stream()
                    .collect(ImmutableCollectors.toMap(
                            Map.Entry::getKey,
                            e -> Optional.ofNullable((VariableOrGroundTerm)replacements.get(e.getKey()))
                                    .orElseGet(e::getValue)));
        }

        private ImmutableList<Optional<Variable>> getArgumentReplacement(DataAtom<AtomPredicate> dataAtom) {
            Set<Variable> newVariables = new HashSet<>();
            List<Optional<Variable>> replacements = new ArrayList<>();
            for (VariableOrGroundTerm term: dataAtom.getArguments()) {
                if (term instanceof GroundTerm) {
                    replacements.add(Optional.of(variableGenerator.generateNewVariable()));
                } else if (term instanceof Variable) {
                    Variable var = (Variable) term;
                    if (newVariables.contains(var)) {
                        replacements.add(Optional.of(variableGenerator.generateNewVariableFromVar(var)));
                    } else {
                        replacements.add(Optional.empty());
                        newVariables.add(var);
                    }
                }
            }
            return ImmutableList.copyOf(replacements);
        }

        private ImmutableMap<Integer, Variable> getArgumentReplacement(
                ImmutableMap<Integer, ? extends VariableOrGroundTerm> argumentMap) {
            Set<Variable> vars = new HashSet<>();
            Map<Integer, Variable> replacementMap = new HashMap<>();
            for (Map.Entry<Integer, ? extends VariableOrGroundTerm> entry : argumentMap.entrySet()) {
                VariableOrGroundTerm term = entry.getValue();
                if (term instanceof GroundTerm) {
                    replacementMap.put(entry.getKey(), variableGenerator.generateNewVariable());
                } else if (term instanceof Variable) {
                    Variable var = (Variable) term;
                    if (vars.contains(var)) {
                        replacementMap.put(entry.getKey(), variableGenerator.generateNewVariableFromVar(var));
                    } else {
                        vars.add(var);
                    }
                }
            }
            return ImmutableMap.copyOf(replacementMap);
        }

        private FilterNode createFilter(DataAtom<AtomPredicate> da, ImmutableList<Optional<Variable>> replacementVars) {
            Iterator<Optional<Variable>> it = replacementVars.iterator();
            return iqFactory.createFilterNode(
                    termFactory.getConjunction(da.getArguments().stream()
                            .map(a -> getEquality(a, it.next()))
                            .filter(Optional::isPresent)
                            .map(Optional::get)
                            .collect(ImmutableCollectors.toList())));
        }

        private FilterNode createFilter(ImmutableMap<Integer, ? extends VariableOrGroundTerm> initialArgumentMap,
                                        ImmutableMap<Integer, Variable> replacementVars) {
            return iqFactory.createFilterNode(
                    termFactory.getConjunction(replacementVars.entrySet().stream()
                            .map(e -> termFactory.getStrictEquality(initialArgumentMap.get(e.getKey()), e.getValue()))
                            .collect(ImmutableCollectors.toList())));
        }

        private Optional<ImmutableExpression> getEquality(VariableOrGroundTerm t, Optional<Variable> replacement) {
            return replacement
                    .map(variable -> termFactory.getStrictEquality(t, variable));
        }
    }

    /**
     * Affects each outermost filter or (left) join n in the tree.
     * For each child of n, deletes its root if it is a filter node.
     * Then:
     * - if n is a join or filter: merge the boolean expressions
     * - if n is a left join: merge boolean expressions coming from the right, and lift the ones coming from the left.
     * This lift is only performed for optimization purposes: may save a subquery during SQL generation.
     */
    class FilterChildNormalizer extends DefaultNonRecursiveIQTreeTransformer {

        private final ChildTransformer childTransformer;

        public FilterChildNormalizer(IntermediateQueryFactory iqFactory) {
            this.childTransformer = new ChildTransformer(iqFactory, this);
        }

        @Override
        public IQTree transformLeftJoin(IQTree tree, LeftJoinNode rootNode, IQTree leftChild, IQTree rightChild) {

            Optional<ImmutableExpression> leftChildChildExpression = getOptionalChildExpression(leftChild);
            Optional<ImmutableExpression> rightChildExpression = getOptionalChildExpression(rightChild);

            if(leftChildChildExpression.isPresent() || rightChildExpression.isPresent()) {
                IQTree leftJoinTree = iqFactory.createBinaryNonCommutativeIQTree(
                        rightChildExpression.isPresent() ?
                                iqFactory.createLeftJoinNode(
                                        Optional.of(
                                                updateJoinCondition(
                                                        rootNode.getOptionalFilterCondition(),
                                                        ImmutableList.of(rightChildExpression.get())
                                                ))) :
                                rootNode,
                        trimRootFilter(leftChild),
                        trimRootFilter(rightChild)
                );
                return leftChildChildExpression.isPresent() ?
                        iqFactory.createUnaryIQTree(iqFactory.createFilterNode(leftChildChildExpression.get()), leftJoinTree) :
                        leftJoinTree;
            }
            return tree;
        }

        @Override
        public IQTree transformInnerJoin(IQTree tree, InnerJoinNode rootNode, ImmutableList<IQTree> children) {
            ImmutableList<ImmutableExpression> filterChildExpressions = getChildExpressions(children);
            if (filterChildExpressions.isEmpty())
                return tree;

            return iqFactory.createNaryIQTree(
                    iqFactory.createInnerJoinNode(
                            Optional.of(
                                    updateJoinCondition(
                                            rootNode.getOptionalFilterCondition(),
                                            filterChildExpressions
                                    ))),
                    children.stream()
                            .map(this::trimRootFilter)
                            .collect(ImmutableCollectors.toList())
            );
        }

        @Override
        public IQTree transformFilter(IQTree tree, FilterNode rootNode, IQTree child) {
            ImmutableList<ImmutableExpression> filterChildExpressions = getChildExpressions(ImmutableList.of(child));
            if (filterChildExpressions.isEmpty())
                return tree;
            return iqFactory.createUnaryIQTree(
                    iqFactory.createFilterNode(
                            updateJoinCondition(
                                    Optional.of(rootNode.getFilterCondition()),
                                    filterChildExpressions
                            )),
                    trimRootFilter(child)
            );
        }

//        private IQTree transformFlattenNode(IQTree tree, FlattenNode node, IQTree child) {
//
//            ImmutableList<Optional<Variable>> replacementVars = getArgumentReplacement(node.getDataAtom(), child.getVariables());
//
//            if (empt(replacementVars))
//                return tree;
//
//            FilterNode filter = createFilter(node.getDataAtom(), replacementVars);
//            DataAtom atom = replaceVars(node.getDataAtom(), replacementVars);
//            return iqFactory.createUnaryIQTree(
//                    iqFactory.createConstructionNode(node.getDataAtom().getVariables()),
//                    iqFactory.createUnaryIQTree(
//                            filter,
//                            iqFactory.createUnaryIQTree(
//                                    node.newNode(
//                                            node.getFlattenedVariable(),
//                                            node.getArrayIndexIndex(),
//                                            atom),
//                                    child
//                            )));
//        }
//    }

        private ImmutableList<ImmutableExpression> getChildExpressions(ImmutableList<IQTree> children) {
            return children.stream()
                    .filter(t -> t.getRootNode() instanceof FilterNode)
                    .map(t -> ((FilterNode) t.getRootNode()).getFilterCondition())
                    .collect(ImmutableCollectors.toList());
        }

        private Optional<ImmutableExpression> getOptionalChildExpression(IQTree child) {
            QueryNode root = child.getRootNode();
            return root instanceof FilterNode?
                    Optional.of(((FilterNode) root).getFilterCondition()):
                    Optional.empty();

        }

        private IQTree trimRootFilter(IQTree tree) {
            return tree.getRootNode() instanceof FilterNode ?
                    ((UnaryIQTree) tree).getChild() :
                    tree;
        }

        private ImmutableExpression updateJoinCondition(Optional<ImmutableExpression> joinCondition, ImmutableList<ImmutableExpression> additionalConditions) {
            if (additionalConditions.isEmpty())
                throw new ExplicitEqualityTransformerInternalException("Nonempty list of filters expected");
            return termFactory.getConjunction(joinCondition, additionalConditions.stream()).get();
        }

        protected IQTree transformUnaryNode(IQTree tree, UnaryOperatorNode rootNode, IQTree child) {
            return childTransformer.transform(tree);
        }

        protected IQTree transformNaryCommutativeNode(IQTree tree, NaryOperatorNode rootNode, ImmutableList<IQTree> children) {
            return childTransformer.transform(tree);
        }

        protected IQTree transformBinaryNonCommutativeNode(IQTree tree, BinaryNonCommutativeOperatorNode rootNode, IQTree leftChild, IQTree rightChild) {
            return childTransformer.transform(tree);
        }
    }

    /**
     * - Default behavior: for each child, deletes its root if it is a substitution-free construction node (i.e. a simple projection),
     * and lift the projection if needed
     * - Distinct or slice nodes: does not apply
     */
    class CnLifter extends DefaultNonRecursiveIQTreeTransformer {

        @Override
        public IQTree transformDistinct(IQTree tree, DistinctNode rootNode, IQTree child) {
            return tree;
        }

        @Override
        public IQTree transformSlice(IQTree tree, SliceNode rootNode, IQTree child) {
            return tree;
        }

        @Override
        public IQTree transformUnaryNode(IQTree tree, UnaryOperatorNode rootNode, IQTree child) {
            ImmutableList<ConstructionNode> idleCns = getIdleCns(Stream.of(child));
            return idleCns.isEmpty() ?
                    tree :
                    getProjection(
                            tree.getVariables(),
                            iqFactory.createUnaryIQTree(
                                    rootNode,
                                    trimIdleCn(child)
                    ));
        }

        @Override
        public IQTree transformInnerJoin(IQTree tree, InnerJoinNode rootNode, ImmutableList<IQTree> children) {
            ImmutableList<ConstructionNode> idleCns = getIdleCns(children.stream());
            return idleCns.isEmpty() ?
                    tree :
                    getProjection(
                            tree.getVariables(),
                            iqFactory.createNaryIQTree(
                                    rootNode,
                                    children.stream()
                                            .map(this::trimIdleCn)
                                            .collect(ImmutableCollectors.toList())
                            ));
        }

        @Override
        protected IQTree transformBinaryNonCommutativeNode(IQTree tree, BinaryNonCommutativeOperatorNode rootNode, IQTree leftChild, IQTree rightChild) {
            ImmutableList<ConstructionNode> idleCns = getIdleCns(Stream.of(leftChild, rightChild));
            return idleCns.isEmpty() ?
                    tree :
                    getProjection(
                            tree.getVariables(),
                            iqFactory.createBinaryNonCommutativeIQTree(
                                    rootNode,
                                    trimIdleCn(leftChild),
                                    trimIdleCn(rightChild)
                            ));
        }

        private ImmutableList<ConstructionNode> getIdleCns(Stream<IQTree> trees) {
            return trees
                    .map(this::getIdleCn)
                    .filter(Optional::isPresent)
                    .map(Optional::get)
                    .collect(ImmutableCollectors.toList());
        }

        private Optional<ConstructionNode> getIdleCn(IQTree tree) {
            QueryNode root = tree.getRootNode();
            if (root instanceof ConstructionNode) {
                ConstructionNode cn = ((ConstructionNode) root);
                if (cn.getSubstitution().isEmpty()) {
                    return Optional.of(cn);
                }
            }
            return Optional.empty();
        }

        private IQTree trimIdleCn(IQTree tree) {
            return getIdleCn(tree).isPresent() ?
                    ((UnaryIQTree) tree).getChild() :
                    tree;
        }

        private IQTree getProjection(ImmutableSet<Variable> signature, IQTree tree) {
            QueryNode root = tree.getRootNode();
            if (root instanceof ConstructionNode){
                return iqFactory.createUnaryIQTree(
                        iqFactory.createConstructionNode(signature, ((ConstructionNode)root).getSubstitution()),
                        ((UnaryIQTree)tree).getChild()
                );
            }
            return iqFactory.createUnaryIQTree(
                    iqFactory.createConstructionNode(signature),
                    tree
            );
        }
    }

    private static class ExplicitEqualityTransformerInternalException extends OntopInternalBugException {
        ExplicitEqualityTransformerInternalException(String message) {
            super(message);
        }
    }
}


text:
<?py include('admin_header.html') ?>

		Twitter Statue
		Associate with Twitter
		Associating Result

${msg}

<?py include('admin_footer.html') ?>


text:
<html>
<body>
This intention flattens use statements.
</body>
</html>


text:
import { Range, TextEditor, Uri, window } from 'vscode';
import { UriComparer } from '../comparers';
import { BranchSorting, TagSorting } from '../configuration';
import { Commands, GlyphChars } from '../constants';
import type { Container } from '../container';
import { GitUri } from '../git/gitUri';
import { GitBranch, GitRevision } from '../git/models';
import { RemoteResourceType } from '../git/remotes/provider';
import { Logger } from '../logger';
import { ReferencePicker } from '../quickpicks/referencePicker';
import { command, executeCommand } from '../system/command';
import { pad, splitSingle } from '../system/string';
import { StatusFileNode } from '../views/nodes';
import {
	ActiveEditorCommand,
	CommandContext,
	getCommandUri,
	isCommandContextViewNodeHasBranch,
	isCommandContextViewNodeHasCommit,
} from './base';
import { OpenOnRemoteCommandArgs } from './openOnRemote';

export interface OpenFileOnRemoteCommandArgs {
	branchOrTag?: string;
	clipboard?: boolean;
	range?: boolean;
	sha?: string;
	pickBranchOrTag?: boolean;
}

@command()
export class OpenFileOnRemoteCommand extends ActiveEditorCommand {
	constructor(private readonly container: Container) {
		super([
			Commands.OpenFileOnRemote,
			Commands.Deprecated_OpenFileInRemote,
			Commands.CopyRemoteFileUrl,
			Commands.CopyRemoteFileUrlWithoutRange,
			Commands.OpenFileOnRemoteFrom,
			Commands.CopyRemoteFileUrlFrom,
		]);
	}

	protected override async preExecute(context: CommandContext, args?: OpenFileOnRemoteCommandArgs) {
		let uri = context.uri;

		if (context.command === Commands.CopyRemoteFileUrlWithoutRange) {
			args = { ...args, range: false };
		}

		if (isCommandContextViewNodeHasCommit(context)) {
			args = { ...args, range: false };

			if (
				context.command === Commands.CopyRemoteFileUrl ||
				context.command === Commands.CopyRemoteFileUrlWithoutRange ||
				context.command === Commands.CopyRemoteFileUrlFrom
			) {
				// If it is a StatusFileNode then don't include the sha, since it hasn't been pushed yet
				args.sha = context.node instanceof StatusFileNode ? undefined : context.node.commit.sha;
			} else if (isCommandContextViewNodeHasBranch(context)) {
				args.branchOrTag = context.node.branch?.name;
			}

			uri = context.node.uri;
		} else if (context.type === 'viewItem') {
			args = { ...args, range: false };

			uri = context.node.uri ?? context.uri;
		}

		if (
			context.command === Commands.CopyRemoteFileUrl ||
			context.command === Commands.CopyRemoteFileUrlWithoutRange ||
			context.command === Commands.CopyRemoteFileUrlFrom
		) {
			args = { ...args, clipboard: true };
			if (args.sha == null) {
				const uri = getCommandUri(context.uri, context.editor);
				if (uri != null) {
					const gitUri = await GitUri.fromUri(uri);
					if (gitUri.repoPath) {
						if (gitUri.sha == null) {
							const commit = await this.container.git.getCommitForFile(gitUri.repoPath, gitUri, {
								firstIfNotFound: true,
							});

							if (commit != null) {
								args.sha = commit.sha;
							}
						} else {
							args.sha = gitUri.sha;
						}
					}
				}
			}
		}

		if (context.command === Commands.OpenFileOnRemoteFrom || context.command === Commands.CopyRemoteFileUrlFrom) {
			args = { ...args, pickBranchOrTag: true, range: false };
		}

		return this.execute(context.editor, uri, args);
	}

	async execute(editor?: TextEditor, uri?: Uri, args?: OpenFileOnRemoteCommandArgs) {
		uri = getCommandUri(uri, editor);
		if (uri == null) return;

		const gitUri = await GitUri.fromUri(uri);
		if (!gitUri.repoPath) return;

		args = { range: true, ...args };

		try {
			let remotes = await this.container.git.getRemotesWithProviders(gitUri.repoPath);
			const range =
				args.range && editor != null && UriComparer.equals(editor.document.uri, uri)
					? new Range(
							editor.selection.start.with({ line: editor.selection.start.line + 1 }),
							editor.selection.end.with({
								line: editor.selection.end.line + (editor.selection.end.character === 0 ? 0 : 1),
							}),
					  )
					: undefined;
			let sha = args.sha ?? gitUri.sha;

			if (args.branchOrTag == null && sha != null && !GitRevision.isSha(sha) && remotes.length !== 0) {
				const [remoteName, branchName] = splitSingle(sha, '/');
				if (branchName != null) {
					const remote = remotes.find(r => r.name === remoteName);
					if (remote != null) {
						args.branchOrTag = branchName;
						sha = undefined;

						remotes = [remote];
					}
				}
			}

			if ((args.sha == null && args.branchOrTag == null) || args.pickBranchOrTag) {
				let branch;
				if (!args.pickBranchOrTag) {
					branch = await this.container.git.getBranch(gitUri.repoPath);
				}

				if (branch?.upstream == null) {
					const pick = await ReferencePicker.show(
						gitUri.repoPath,
						args.clipboard
							? `Copy Remote File Url From${pad(GlyphChars.Dot, 2, 2)}${gitUri.relativePath}`
							: `Open File on Remote From${pad(GlyphChars.Dot, 2, 2)}${gitUri.relativePath}`,
						`Choose a branch or tag to ${args.clipboard ? 'copy' : 'open'} the file revision from`,
						{
							allowEnteringRefs: true,
							autoPick: true,
							// checkmarks: false,
							filter: { branches: b => b.remote || b.upstream != null },
							picked: args.branchOrTag,
							sort: {
								branches: { current: true, orderBy: BranchSorting.DateDesc },
								tags: { orderBy: TagSorting.DateDesc },
							},
						},
					);
					if (pick == null) return;

					if (pick.refType === 'branch') {
						if (pick.remote) {
							args.branchOrTag = GitBranch.getNameWithoutRemote(pick.name);

							const remoteName = GitBranch.getRemote(pick.name);
							const remote = remotes.find(r => r.name === remoteName);
							if (remote != null) {
								remotes = [remote];
							}
						} else {
							args.branchOrTag = pick.name;
						}
						sha = undefined;
					} else if (pick.refType === 'tag') {
						args.branchOrTag = pick.ref;
						sha = undefined;
					} else {
						args.branchOrTag = undefined;
						sha = pick.ref;
					}
				} else {
					args.branchOrTag = branch.name;
				}
			}

			void (await executeCommand<OpenOnRemoteCommandArgs>(Commands.OpenOnRemote, {
				resource: {
					type: sha == null ? RemoteResourceType.File : RemoteResourceType.Revision,
					branchOrTag: args.branchOrTag ?? 'HEAD',
					fileName: gitUri.relativePath,
					range: range,
					sha: sha ?? undefined,
				},
				repoPath: gitUri.repoPath,
				remotes: remotes,
				clipboard: args.clipboard,
			}));
		} catch (ex) {
			Logger.error(ex, 'OpenFileOnRemoteCommand');
			void window.showErrorMessage('Unable to open file on remote provider. See output channel for more details');
		}
	}
}


text:
"""
Diff directories LEFT and RIGHT with Vim, using diffable representation of
IPython notebooks.
"""

import argparse
import os
from os.path import join, splitext, relpath, isdir
import subprocess

from _version import __version__

def parse_command_line():
    parser = argparse.ArgumentParser(description=__doc__,
        formatter_class=argparse.RawDescriptionHelpFormatter)
    parser.add_argument('--version', action='version',
                        version='%(prog)s '+__version__)
    parser.add_argument('left', metavar='LEFT',
                       help='Left directory to compare')
    parser.add_argument('right', metavar='RIGHT',
                       help='Right directory to compare')
    return parser.parse_args()

def nbcatsrc(src_filepath, dst_filepath):
    cmd = 'nbcatsrc %s > %s' % (src_filepath, dst_filepath)
    subprocess.check_call(cmd, shell=True)

def mirror_path(left_or_right):
    return join(left_or_right, 'mirror')

def create_mirror(left_or_right):
    """
    Create mirror of left/right directory, with diffable notebook.

    Notebook cell sources are copied, but output at stripped.  Other files are
    hard linked.

    Because notebook are copied and other files are hard linked, changes in
    mirrors are reflected only for other files. So if this script is run by
    `git difftool -d` and left or right is working directory, only changes to
    other files are copied back. Original notebooks are not overriden with the
    diffable representation.
    """
    rootname = lambda filename: splitext(filename)[0]
    ext = lambda filename: splitext(filename)[1]

    mirror = mirror_path(left_or_right)

    for src_dirpath, ignored_dirs, src_filenames in os.walk(left_or_right):
        for src_filename in src_filenames:
            src_filepath = join(src_dirpath, src_filename)

            dst_dirpath = join(mirror, relpath(src_dirpath, left_or_right))
            if not isdir(dst_dirpath):
                os.makedirs(dst_dirpath)

            if ext(src_filename) == '.ipynb':
                dst_filename = rootname(src_filename) + '_diffable.ipynb'
                dst_filepath = join(dst_dirpath, dst_filename)
                nbcatsrc(src_filepath, dst_filepath)
            else:
                dst_filename = src_filename
                dst_filepath = join(dst_dirpath, dst_filename)
                os.link(src_filepath, dst_filepath)
    return mirror

def vim_dirdiff(left, right):
    cmd = '''vim -f '+next' '+execute "DirDiff" ''' \
          """argv(0) argv(1)' %s %s '+syntax off'""" \
          % (left, right)
    subprocess.check_call(cmd, shell=True)

def main():
    args = parse_command_line()
    mirror_left = create_mirror(args.left)
    mirror_right = create_mirror(args.right)
    vim_dirdiff(mirror_left, mirror_right)

if __name__ == '__main__':
    main()


text:
<?php
namespace ERP;

require_once __DIR__.'/CustomerOrdersArrayConverter.php';

/**
 * Generated from NGS DSL
 *
 * Converts an object of class ERP\CustomerOrders into a JSON string and backwards via an array converter.
 *
 * @package ERP
 * @version 0.9.9 beta
 */
abstract class CustomerOrdersJsonConverter
{/**
     * @param string Json representation of the object(s)
     *
     * @return array|\ERP\CustomerOrders An object or an array of objects of type "ERP\CustomerOrders"
     */
    public static function fromJson($item, $allowNullValues=false)
    {
        $obj = json_decode($item, true);

        return \NGS\Utils::isJsonArray($item)
            ? \ERP\CustomerOrdersArrayConverter::fromArrayList($obj, $allowNullValues)
            : \ERP\CustomerOrdersArrayConverter::fromArray($obj);
    }

    /**
     * @param array|\ERP\CustomerOrders An object or an array of objects of type "ERP\CustomerOrders"
     *
     * @return string Json representation of the object(s)
     */
    public static function toJson($item)
    {
        $arr = \ERP\CustomerOrdersArrayConverter::toArray($item);
        if(is_array($item))
            return json_encode($arr);
        if(empty($arr))
            return '{}';
        return json_encode($arr);
    }
}


text:
<!doctype html>

	<title>Circle 3 Points  - toxiclibs.js examples</title>
	<meta name="author" content="Kyle Phillips">
	<link href="css/style.css" rel="stylesheet" type="text/css">

		<hgroup>

Circle From 3 Points

w/ Processing.js

		</hgroup>

<canvas id="myCanvas" width="200" height="200">
	your browser doesnt support canvas
</canvas>

original example by Karsten Schmidt

	Toxiclibs ported to js by Kyle Phillips

Usage:

move mouse to move one of the 3 points

This example demonstrates the construction of a circle through 3 given points.
You can specify one of the points using your mouse, the other two are moved automatically.


text:
package com.intellij.tasks.integration;

import com.intellij.openapi.util.Couple;
import com.intellij.openapi.util.JDOMUtil;
import com.intellij.tasks.CustomTaskState;
import com.intellij.tasks.Task;
import com.intellij.tasks.TaskManagerTestCase;
import com.intellij.tasks.impl.LocalTaskImpl;
import com.intellij.tasks.youtrack.YouTrackRepository;
import com.intellij.tasks.youtrack.YouTrackRepositoryType;
import com.intellij.util.PathUtil;
import com.intellij.util.containers.ContainerUtil;
import org.apache.commons.httpclient.Header;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.PutMethod;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jetbrains.annotations.NotNull;

import java.io.IOException;
import java.util.Date;
import java.util.List;
import java.util.Set;

/**
 * @author Mikhail Golubev
 */
public class YouTrackIntegrationTest extends TaskManagerTestCase {
  private static final String YOUTRACK_4_TEST_SERVER_URL = "http://trackers-tests.labs.intellij.net:8067";

  private static final String REQUEST_WITH_CUSTOM_STATES_ID = "YT4CS-1";
  private static final CustomTaskState NORTH_STATE = new CustomTaskState("North", "North");
  private static final CustomTaskState SUBMITTED_STATE = new CustomTaskState("Submitted", "Submitted");

  private YouTrackRepository myRepository;

  public void testCustomTaskStates() throws Exception {
    final Task task = myRepository.findTask(REQUEST_WITH_CUSTOM_STATES_ID);
    assertNotNull(task);

    final Set<CustomTaskState> states = myRepository.getAvailableTaskStates(task);
    final List<String> stateNames = ContainerUtil.map(states, CustomTaskState::getPresentableName);
    assertContainsElements(stateNames, "North", "South");
    // IDEA-147006
    assertDoesntContain(stateNames, "Peru State College", "The Evergreen State College");

    // ? -> North
    myRepository.setTaskState(task, NORTH_STATE);
    Element element = myRepository.fetchRequestAsElement(REQUEST_WITH_CUSTOM_STATES_ID);
    assertEquals("North", element.getAttributeValue("state"));

    // North -> Submitted
    myRepository.setTaskState(task, SUBMITTED_STATE);
    element = myRepository.fetchRequestAsElement(REQUEST_WITH_CUSTOM_STATES_ID);
    assertEquals("Submitted", element.getAttributeValue("state"));
  }

  // IDEA-101238
  public void testTimeTracking() throws Exception {
    final HttpClient client = myRepository.getHttpClient();
    authenticate(client);
    final String issueId = createIssue(client);
    final Task task = myRepository.findTask(issueId);
    assertNotNull(task);
    final Couple<Integer> duration = generateWorkItemDuration();
    final String spentTime = formatDuration(duration.getFirst(), duration.getSecond());
    myRepository.updateTimeSpent(new LocalTaskImpl(task), spentTime, "Foo Bar");
    checkSpentTime(client, issueId, spentTime);
  }

  @NotNull
  private static String formatDuration(int hours, int minutes) {
    final String spentTime;
    if (hours == 0) {
      spentTime = minutes + "m";
    }
    else if (minutes == 0) {
      spentTime = hours + "h";
    }
    else {
      spentTime = String.format("%dh%dm", hours, minutes);
    }
    return spentTime;
  }

  private void authenticate(@NotNull HttpClient client) throws IOException {
    PostMethod method = new PostMethod(myRepository.getUrl() + "/rest/user/login");
    method.addParameter("login", myRepository.getUsername());
    method.addParameter("password", myRepository.getPassword());
    final int statusCode = client.executeMethod(method);
    assertEquals(HttpStatus.SC_OK, statusCode);
  }

  @NotNull
  private String createIssue(@NotNull HttpClient client) throws IOException {
    // http PUT "http://trackers-tests.labs.intellij.net:8067/rest/issue" project==BTYT4TT "summary==First issue created via REST API"
    final PutMethod method = new PutMethod(myRepository.getUrl() + "/rest/issue");
    method.setQueryString(new NameValuePair[] {
      new NameValuePair("project", "BTYT4TT"),
      new NameValuePair("summary", "Test issue for time tracking updates (" + SHORT_TIMESTAMP_FORMAT.format(new Date()) + ")")
    });
    final int statusCode = client.executeMethod(method);
    assertEquals(HttpStatus.SC_CREATED, statusCode);
    final Header locationHeader = method.getResponseHeader("Location");
    assertNotNull(locationHeader);
    // Otherwise there will be timeout on connection acquiring
    method.releaseConnection();
    return PathUtil.getFileName(locationHeader.getValue());
  }

  private void checkSpentTime(@NotNull HttpClient client, @NotNull String issueId, @NotNull String expectedTime) throws IOException, JDOMException {
    // Endpoint /rest/issue/BTYT4TT-8/timetracking/workitem/ doesn't work on this instance of YouTrack for some reason
    final GetMethod method = new GetMethod(myRepository.getUrl() + "/rest/issue/" + issueId);
    final int statusCode = client.executeMethod(method);
    assertEquals(HttpStatus.SC_OK, statusCode);
    final Element root = JDOMUtil.load(method.getResponseBodyAsStream());
    for (Element field : root.getChildren("field")) {
      if ("Spent time".equals(field.getAttributeValue("name"))) {
        final Element value = field.getChild("value");
        assertNotNull(value);
        assertEquals(expectedTime, value.getText().trim());
        return;
      }
    }
    fail("Field 'Spent time' not found in issue " + issueId);
  }

  @Override
  protected void setUp() throws Exception {
    super.setUp();
    myRepository = new YouTrackRepository(new YouTrackRepositoryType());
    myRepository.setUrl(YOUTRACK_4_TEST_SERVER_URL);
    myRepository.setUsername("buildtest");
    myRepository.setPassword("buildtest");
  }
}


text:
package org.springframework.boot.context.properties.bind;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Annotation that can be used to specify the default value when binding to an immutable
 * property. This annotation can also be used with nested properties to indicate that a
 * value should always be bound (rather than binding {@code null}).
 *
 * @author Madhura Bhave
 * @since 2.2.0
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.PARAMETER })
@Documented
public @interface DefaultValue {

	/**
	 * The default value of the property. Can be an array of values for collection or
	 * array-based properties.
	 * @return the default value of the property.
	 */
	String[] value() default {};

}


text:
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Struct template param_type</title>
<link rel="stylesheet" href="../../boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../../index.html" title="Boost.Test">
<link rel="up" href="../../header/boost/test/utils/named_params_hpp.html" title="Header <boost/test/utils/named_params.hpp>">
<link rel="prev" href="named_parameter.html" title="Struct template named_parameter">
<link rel="next" href="param_type_nam_idp44732176.html" title="Struct template param_type<named_parameter< T, unique_id, ReferenceType >, keyword< unique_id, required >, DefaultType>">

Home
Libraries
People
FAQ
More

Struct template param_type

boost::nfp::param_type

Synopsis

// In header: <boost/test/utils/named_params.hpp>

template<typename Params, typename KeywordType, typename DefaultType = void>
struct param_type {
  // types
  typedef DefaultType type;
};

Copyright © 2001-2015 Boost.Test team

        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)


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

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Uses of Class org.apache.http.impl.conn.tsccm.AbstractConnPool (HttpComponents Client 4.1.1 API)
</TITLE>

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

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
org.apache.http.impl.conn.tsccm.AbstractConnPool

Packages that use AbstractConnPool

org.apache.http.impl.conn.tsccm
The implementation of a thread-safe client connection manager.

Uses of AbstractConnPool in org.apache.http.impl.conn.tsccm

Subclasses of AbstractConnPool in org.apache.http.impl.conn.tsccm

 class
ConnPoolByRoute

          A connection pool that maintains connections by route.

Fields in org.apache.http.impl.conn.tsccm declared as AbstractConnPool

protected  AbstractConnPool
ThreadSafeClientConnManager.connectionPool

          Deprecated.

Methods in org.apache.http.impl.conn.tsccm that return AbstractConnPool

protected  AbstractConnPool
ThreadSafeClientConnManager.createConnectionPool(HttpParams params)

          Deprecated. use #createConnectionPool(long, TimeUnit))

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright © 1999-2011 The Apache Software Foundation. All Rights Reserved.


text:
package com.thoughtworks.go.server.ui;

import com.thoughtworks.go.config.MingleConfig;
import org.junit.Test;

import static org.junit.Assert.assertThat;
import static org.hamcrest.Matchers.is;

public class MingleCardTest {
    @Test
    public void shouldBeEqualToAnotherMingleCardWithSameConfigAndCardNumber(){
        MingleCard card1 = new MingleCard(new MingleConfig("mingle-url", "project-name", null), "#1234");
        MingleCard card2 = new MingleCard(new MingleConfig("mingle-url", "project-name", null), "#1234");
        assertThat(card1.equals(card2), is(true));
    }

    @Test
    public void shouldNotBeEqualToAnotherMingleCardWithSameConfigButDifferentCardNumber(){
        MingleCard card1 = new MingleCard(new MingleConfig("mingle-url", "project-name", null), "#1234");
        MingleCard card2 = new MingleCard(new MingleConfig("mingle-url", "project-name", null), "#5678");
        assertThat(card1.equals(card2), is(false));
    }

    @Test
    public void shouldNotBeEqualToAnotherMingleCardWithDifferentConfigButSameCardNumber(){
        MingleCard card1 = new MingleCard(new MingleConfig("mingle-url", "project-name", null), "#1234");
        MingleCard card2 = new MingleCard(new MingleConfig("mingle-url", "another-project-name", null), "#1234");
        assertThat(card1.equals(card2), is(false));
    }

    @Test
    public void shouldNotBeEqualToNull(){
        assertThat(new MingleCard(new MingleConfig("mingle-url", "project-name", null), "#1234").equals(null), is(false));
    }
}


text:
<?php

return array(

	/*
	|--------------------------------------------------------------------------
	| Documentation Title
	|--------------------------------------------------------------------------
	|
	| This title will appear at the top of the page.
	|
	| Default : 'Documentation'
	|
	*/

	'title' => 'Documentation',

	/*
	|--------------------------------------------------------------------------
	| Documentation Path
	|--------------------------------------------------------------------------
	|
	| This is the path used to access your documentation files relative to the
	| project's root folder.
	|
	| Default : '/docs'
	|
	*/

	'path' => '/docs',

	/*
	|--------------------------------------------------------------------------
	| Documentation Index
	|--------------------------------------------------------------------------
	|
	| This is the markdown file used to build the index location in the side
	| menu of your application. Please ommit the '.md'.
	|
	| Default : 'documentation'
	|
	*/

	'index' => 'documentation',

	/*
	|--------------------------------------------------------------------------
	| Documentation Home
	|--------------------------------------------------------------------------
	|
	| This is the page to display when no chapter is provided.
	|
	| Default : 'introduction'
	|
	*/

	'home' => 'introduction',

	/*
	|--------------------------------------------------------------------------
	| Documentation Base Href
	|--------------------------------------------------------------------------
	|
	| This the base href where the documentation is found via http
	|
	| Default : '/docs/'
	|
	*/

	'basehref' => '/docs/',

);