text:
package ec2

import (
	"context"
	"time"

	"github.com/aws/aws-sdk-go-v2/aws"
	"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)

type DescribeFleetHistoryInput struct {
	_ struct{} `type:"structure"`

	// Checks whether you have the required permissions for the action, without
	// actually making the request, and provides an error response. If you have
	// the required permissions, the error response is DryRunOperation. Otherwise,
	// it is UnauthorizedOperation.
	DryRun *bool `type:"boolean"`

	// The type of events to describe. By default, all events are described.
	EventType FleetEventType `type:"string" enum:"true"`

	// The ID of the EC2 Fleet.
	//
	// FleetId is a required field
	FleetId *string `type:"string" required:"true"`

	// The maximum number of results to return in a single call. Specify a value
	// between 1 and 1000. The default value is 1000. To retrieve the remaining
	// results, make another call with the returned NextToken value.
	MaxResults *int64 `type:"integer"`

	// The token for the next set of results.
	NextToken *string `type:"string"`

	// The start date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
	//
	// StartTime is a required field
	StartTime *time.Time `type:"timestamp" required:"true"`
}

// String returns the string representation
func (s DescribeFleetHistoryInput) String() string {
	return awsutil.Prettify(s)
}

// Validate inspects the fields of the type to determine if they are valid.
func (s *DescribeFleetHistoryInput) Validate() error {
	invalidParams := aws.ErrInvalidParams{Context: "DescribeFleetHistoryInput"}

	if s.FleetId == nil {
		invalidParams.Add(aws.NewErrParamRequired("FleetId"))
	}

	if s.StartTime == nil {
		invalidParams.Add(aws.NewErrParamRequired("StartTime"))
	}

	if invalidParams.Len() > 0 {
		return invalidParams
	}
	return nil
}

type DescribeFleetHistoryOutput struct {
	_ struct{} `type:"structure"`

	// The ID of the EC Fleet.
	FleetId *string `locationName:"fleetId" type:"string"`

	// Information about the events in the history of the EC2 Fleet.
	HistoryRecords []HistoryRecordEntry `locationName:"historyRecordSet" locationNameList:"item" type:"list"`

	// The last date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
	// All records up to this time were retrieved.
	//
	// If nextToken indicates that there are more results, this value is not present.
	LastEvaluatedTime *time.Time `locationName:"lastEvaluatedTime" type:"timestamp"`

	// The token for the next set of results.
	NextToken *string `locationName:"nextToken" type:"string"`

	// The start date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
	StartTime *time.Time `locationName:"startTime" type:"timestamp"`
}

// String returns the string representation
func (s DescribeFleetHistoryOutput) String() string {
	return awsutil.Prettify(s)
}

const opDescribeFleetHistory = "DescribeFleetHistory"

// DescribeFleetHistoryRequest returns a request value for making API operation for
// Amazon Elastic Compute Cloud.
//
// Describes the events for the specified EC2 Fleet during the specified time.
//
// EC2 Fleet events are delayed by up to 30 seconds before they can be described.
// This ensures that you can query by the last evaluated time and not miss a
// recorded event. EC2 Fleet events are available for 48 hours.
//
//    // Example sending a request using DescribeFleetHistoryRequest.
//    req := client.DescribeFleetHistoryRequest(params)
//    resp, err := req.Send(context.TODO())
//    if err == nil {
//        fmt.Println(resp)
//    }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeFleetHistory
func (c *Client) DescribeFleetHistoryRequest(input *DescribeFleetHistoryInput) DescribeFleetHistoryRequest {
	op := &aws.Operation{
		Name:       opDescribeFleetHistory,
		HTTPMethod: "POST",
		HTTPPath:   "/",
	}

	if input == nil {
		input = &DescribeFleetHistoryInput{}
	}

	req := c.newRequest(op, input, &DescribeFleetHistoryOutput{})

	return DescribeFleetHistoryRequest{Request: req, Input: input, Copy: c.DescribeFleetHistoryRequest}
}

// DescribeFleetHistoryRequest is the request type for the
// DescribeFleetHistory API operation.
type DescribeFleetHistoryRequest struct {
	*aws.Request
	Input *DescribeFleetHistoryInput
	Copy  func(*DescribeFleetHistoryInput) DescribeFleetHistoryRequest
}

// Send marshals and sends the DescribeFleetHistory API request.
func (r DescribeFleetHistoryRequest) Send(ctx context.Context) (*DescribeFleetHistoryResponse, error) {
	r.Request.SetContext(ctx)
	err := r.Request.Send()
	if err != nil {
		return nil, err
	}

	resp := &DescribeFleetHistoryResponse{
		DescribeFleetHistoryOutput: r.Request.Data.(*DescribeFleetHistoryOutput),
		response:                   &aws.Response{Request: r.Request},
	}

	return resp, nil
}

// DescribeFleetHistoryResponse is the response type for the
// DescribeFleetHistory API operation.
type DescribeFleetHistoryResponse struct {
	*DescribeFleetHistoryOutput

	response *aws.Response
}

// SDKResponseMetdata returns the response metadata for the
// DescribeFleetHistory request.
func (r *DescribeFleetHistoryResponse) SDKResponseMetdata() *aws.Response {
	return r.response
}


text:
@extends('admin.layouts.main')

@section('title','Page Title')

@section('link')
    @parent

@endsection

@section('content')

Login

					@if (count($errors) > 0)

							Whoops! There were some problems with your input.

								@foreach ($errors->all() as $error)

{{ $error }}

								@endforeach

					@endif

					<form class="form-horizontal" role="form" method="POST" action="{{ url('/administrator/login/post') }}">
						<input type="hidden" name="_token" value="{{ csrf_token() }}">

								<input type="email" class="form-control" name="email" value="{{ old('email') }}" placeholder="Email Address">

								<input type="password" class="form-control" name="password">

								<button type="submit" class="btn btn-primary submit">Login</button>

								Forgot Your Password?

					</form>

@endsection

@section('script')
    @parent

@endsection

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

    <title>Chapter 18: Appendix | Philosophy and Fun of Algebra | Mary Everest Boole | Lit2Go ETC</title>
    <link rel="stylesheet" href="http://etc.usf.edu/lit2go/css/screenless.css" type="text/css" media="screen" title="no title" charset="utf-8">
    <link rel="stylesheet" href="http://etc.usf.edu/lit2go/css/printless.css" type="text/css" media="print" title="no title" charset="utf-8">

          Lit2Go

<form action="http://etc.usf.edu/lit2go/search/"><input type="text" name="q" placeholder="Search" value=""></form>

Authors

Books

Genres

Collections

Readability

      Philosophy and Fun of Algebra

      by Mary Everest Boole

      Chapter 18: Appendix

        Additional Information

            Year Published:
            1909

            Language:
            English

            Country of Origin:
            England

            Source:
            Boole, M. E. (1909). Philosophy and Fun of Algebra.London, England:.

            Readability:

                Flesch–Kincaid Level:
                6.0

            Word Count:
            260

            Genre:
            Informational

            Keywords:
            math history, mathematics

            ✎ Cite This

  Share
  |

Downloads

          Audio

          Passage PDF

Student Activity

            APA

            MLA

            Chicago

            Boole, M. (1909). Chapter 18: Appendix. Philosophy and Fun of Algebra (Lit2Go Edition). Retrieved February 15, 2016, from http://etc.usf.edu/lit2go/95/philosophy-and-fun-of-algebra/1661/chapter-18-appendix/

            Boole, Mary Everest. "Chapter 18: Appendix." Philosophy and Fun of Algebra. Lit2Go Edition. 1909. Web. <http://etc.usf.edu/lit2go/95/philosophy-and-fun-of-algebra/1661/chapter-18-appendix/>. February 15, 2016.

            Mary Everest Boole, "Chapter 18: Appendix," Philosophy and Fun of Algebra, Lit2Go Edition, (1909), accessed February 15, 2016, http://etc.usf.edu/lit2go/95/philosophy-and-fun-of-algebra/1661/chapter-18-appendix/.

Back

                  <audio controls style="width:99%;">
            <source src="http://etc.usf.edu/lit2go/audio/mp3/philosophy-and-fun-of-algebra-019-chapter-18-appendix.1661.mp3" type="audio/mpeg" />
                          <source src="http://etc.usf.edu/lit2go/audio/ogg/philosophy-and-fun-of-algebra-019-chapter-18-appendix.1661.ogg" type="audio/ogg" />
                        The embedded audio player requires a modern internet browser. You should visit Browse Happy and update your internet browser today!
          </audio>

	The essential element of Algebra:—the habitual registration of the exact limits of one’s knowledge, the incessant calling into consciousness of the fact of one’s own ignorance, is the element which Boole’s would-be interpreters have left out of his method. It is also the element which modern Theosophy omits in its interpretation of ancient Oriental Mind Science.

	Men who wish to exploit other men fear nothing in logic or science except this element. They fear nothing in earth, heaven, or hell, so much as a public accustomed to realise exactly how much has been proved, and where its own ignorance begins. Exploiters fear this about equally, whether they call themselves priests, schoolmasters, college dons, political leaders, or organisers of syndicates and trusts.

	As long as general readers can be kept from the habit of registering at every step the fact of their own ignorance and the limits of their own knowledge, a clever charlatan can deceive them about anything he pleases:—“from pitch-and-toss to manslaughter”; from Zero to Infinity; from the contents of a meat tin to the contents of an engineer’s report; from the interpretation of a bill before Parliament to the interpretation of Isaiah.

	Once get any fair proportion of the public into the steady habit of algebraising ignorance, and you will have done much towards reducing all kinds of parasitic creatures to the alternative of starvation, suicide, or earning their own living by rendering some kind of real service to the organism which supports them.

Back

            This collection of children's literature is a part of the Educational Technology Clearinghouse and is funded by various grants.

            Copyright © 2006—2016 by the Florida Center for Instructional Technology, College of Education, University of South Florida.

License

Credits

FAQ

Giving

This document was downloaded from Lit2Go, a free online collection of stories and poems in Mp3 (audiobook) format published by the Florida Center for Instructional Technology. For more information, including classroom activities, readability data, and original sources, please visit http://etc.usf.edu/lit2go/95/philosophy-and-fun-of-algebra/1661/chapter-18-appendix/.

Lit2Go: Philosophy and Fun of Algebra

Chapter 18: Appendix


text:
"""
Extracts are transformations that generate output lines from something that is not one of the input channel.
As it will yield all data for each input row, the input given is usually only one empty line.

"""

from rdc.etl.error import AbstractError
from rdc.etl.io import STDIN
from rdc.etl.transform import Transform

class Extract(Transform):
    """Base class for extract transforms.

    .. attribute:: extract

        Generator, iterable or iterable-typed callable that is used as the data source. Often used as a shortcut to
        make fast prototypes of ETL processes from a dictionary, before going further with real data sources.

        Each iterator value should be something Hash.copy() can take as an argument.

    Example using a dict::

        >>> from rdc.etl.transform.extract import Extract

        >>> data = ({'foo': 'bar'}, {'foo': 'baz'}, )
        >>> my_extract = Extract(extract=data)

        >>> list(my_extract({}))
        [H{'foo': 'bar'}, H{'foo': 'baz'}]

    Example using a callable::

        >>> from rdc.etl.transform.extract import Extract

        >>> @Extract
        ... def my_extract():
        ...     return (
        ...         {'bar': 'baz'},
        ...         {'bar': 'boo'},
        ...     )

        >>> list(my_extract({}))
        [H{'bar': 'baz'}, H{'bar': 'boo'}]

    Example using a generator::

        >>> from rdc.etl.transform.extract import Extract

        >>> @Extract
        ... def my_extract():
        ...     yield {'bar': 'baz'}
        ...     yield {'bar': 'boo'}

        >>> print list(my_extract({}))
        [H{'bar': 'baz'}, H{'bar': 'boo'}]

    .. note::

        Whenever you can, prefer the generator approach so you're not blocking anything while computing remaining
        elements.

    """

    extract = []

    def __init__(self, extract=None):
        super(Extract, self).__init__()

        self.extract = extract or self.extract

        if hasattr(extract, '__name__'):
            self.__name__ = self.extract.__name__

    def extract(self):
        raise AbstractError(self.extract)

    def transform(self, hash, channel=STDIN):
        extracted_data = self.extract() if callable(self.extract) else self.extract

        if extracted_data:
            for line in extracted_data:
                yield hash.copy(line)


text:
package UI;

import java.util.ArrayList;
import javafx.animation.FadeTransition;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.Timeline;
import javafx.geometry.HPos;
import javafx.geometry.Pos;
import javafx.geometry.VPos;
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.image.ImageView;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Pane;
import javafx.util.Duration;
import sudoku.Database;
import sudoku.sudoku;
import sudoku.timer;
import sudoku.SudokuGenerator;

/**
 * Class to initialize all global variables and methods
 */
public class global {

    // <editor-fold defaultstate="collapsed" desc="Main Panes">
    static BorderPane screenContainer;
    static BorderPane gamePlayContainer;
    static GridPane mainMenuContainer;
    static GridPane scorePageContainer;
    static GridPane shortcutHelpContainer;
    // </editor-fold>

    //<editor-fold defaultstate="collapsed" desc="Sudoku Arrays">
    static Integer[][] userSudoku = new Integer[9][9]; //Reads the Sudoku from the user
    static Integer[][] computerSolution = new Integer[9][9]; //Where computer returns the wrong cells
    static Boolean[][] markSolution = new Boolean[9][9]; //Where computer returns the wrong cells
    static Integer[][] loadedGameSudoku = new Integer[9][9];
    static String sudokuGame;
//</editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Global Static Vairables">
    public static final int READ_SUDOKU = 1;
    public static final int PRINT_SUDOKU = 2;
    public static final int CLEAR_SUDOKU = 3;
    public static final int CHECK_SUDOKU = 4;

    public static final int FADE_IN = 1;
    public static final int FADE_OUT = 2;

    public static final int TRANSPARENT_BG = 1;
    public static final int WHITE_BG = 2;

    public static final int Y_AXIS = 1;
    public static final int X_AXIS = 2;

    public static final int MESSAGE_SUCCESS = 1;
    public static final int MESSAGE_DANGER = 2;

    public static final int RIGHT_TO_LEFT = 2;
    public static final int LEFT_TO_RIGHT = 2;

    public static final int DISABLE = 1;
    public static final int ENABLE = 2;

    public static final int NEW_GAME_MODE = 1;
    public static final int LOAD_GAME_MODE = 2;
    public static final int CHECKING_MODE = 3;
    public static final int CHALLENGE_MODE = 4;
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Sudoku Info">
    static int playingMode;
    static String sudokuId = "0";
    static String sudokuIdOriginal;
    static String sudokuLevel;
    // </editor-fold>

    static ArrayList<Integer[]> history = new ArrayList<>();
    static int undoHistoryMoveNumber = -1;
    static int redoHistoryMoveNumber = 0;

    static timer gameTime = new timer();
    static Boolean saveGameState = true;

    //Creating objects
    static Database database = new Database();
    static sudoku Sudoku = new sudoku();
    static SudokuGenerator generator = new SudokuGenerator();

    /**
     * Switch between panes with slide animation
     * @param parent, parent pane
     * @param fromChild
     * @param toChild
     */
     public static void switchPanes(BorderPane parent, Pane fromChild, Pane toChild) {
        Timeline translateAnimation = new Timeline();

        //Creating all key values for the animation
        KeyValue fromChildOpacityStart = new KeyValue(fromChild.opacityProperty(), 1);
        KeyValue fromChildOpacityEnd = new KeyValue(fromChild.opacityProperty(), 0);

        KeyValue toChildOpacityStart = new KeyValue(fromChild.opacityProperty(), 0);
        KeyValue toChildOpacityEnd = new KeyValue(fromChild.opacityProperty(), 1);

        KeyValue fromChildtranslateStart = new KeyValue(fromChild.translateYProperty(), 0);
        KeyValue fromChildtranslateEnd = new KeyValue(fromChild.translateYProperty(), 10);

        KeyValue toChildtranslateStart = new KeyValue(toChild.translateYProperty(), 10);
        KeyValue toChildtranslateEnd = new KeyValue(toChild.translateYProperty(), 0);

        //Creating the timeline keyframes
        //Hiding and moving fromChild
        KeyFrame startMoveOut = new KeyFrame(Duration.ZERO, fromChildtranslateStart);
        KeyFrame startFadeOut = new KeyFrame(Duration.millis(50), fromChildOpacityStart);
        KeyFrame finishFadeOut = new KeyFrame(Duration.millis(150), fromChildOpacityEnd);
        KeyFrame fnishMoveOut = new KeyFrame(Duration.millis(150), fromChildtranslateEnd);

        //Clearing the setCenter
        KeyFrame clear = new KeyFrame(Duration.millis(151), e -> {
            parent.setCenter(null);
        });

        //Showing and moving toChild
        KeyFrame startFadeIn = new KeyFrame(Duration.millis(151), toChildOpacityStart);
        KeyFrame startMoveIn = new KeyFrame(Duration.millis(151), toChildtranslateStart);
        KeyFrame addingToCenter = new KeyFrame(Duration.millis(151), e -> {
            parent.setCenter(toChild);
        });
        KeyFrame finishFadeIn = new KeyFrame(Duration.millis(250), toChildOpacityEnd);
        KeyFrame finishMoveIn = new KeyFrame(Duration.millis(300), toChildtranslateEnd);

        translateAnimation.getKeyFrames().addAll(startFadeOut, startMoveOut, finishFadeOut, fnishMoveOut, clear, startFadeIn, startMoveIn, addingToCenter, finishFadeIn, finishMoveIn);
        translateAnimation.play();
    }

    /**
     * Fading animation
     *
     * @param node, object that will be animated
     * @param duration
     * @param delay
     * @param fadeType
     */
    public static void fade(Object node, int duration, int delay, int fadeType) {
        FadeTransition fadeAnimation = new FadeTransition(Duration.millis(duration), (Node) node);

        if (delay != 0) {
            fadeAnimation.setDelay(Duration.millis(delay));
        }

        fadeAnimation.setFromValue(fadeType == 1 ? 0 : 1);
        fadeAnimation.setToValue(fadeType == 1 ? 1 : 0);

        fadeAnimation.play();
    }

    /**
     * Initialize button styles, icons sizes Muhammad Tarek
     *
     * @param button
     * @param layout
     * @param position
     * @param icon
     */
    static void initButtonStyle(Button button, GridPane layout, int position, ImageView icon, int bgColor) {
        button.getStyleClass().add("icon-text-button");

        if (icon != null) {
            icon.setFitHeight(bgColor == 1 ? 20 : 24);
            icon.setFitWidth(bgColor == 1 ? 20 : 24);
        }

        button.getStyleClass().add("button-icon_text");
        button.setAlignment(Pos.CENTER_LEFT);

        if (bgColor == 1) {
            button.getStyleClass().add("button-icon_text--transparent");
        } else {
            button.getStyleClass().add("button-icon_text--white");
        }

        layout.setConstraints(button, 0, position);
        layout.setHalignment(button, HPos.CENTER);
        layout.setValignment(button, VPos.CENTER);
        layout.getChildren().add(button);
    }

    public static void changeButtonState(int type, Button... buttons) {
        for (Button button : buttons) {
            if (type == 1)
                button.setDisable(true);
            else
                button.setDisable(false);
        }
    }

    public static void changePlayingMode(int mode) {
        playingMode = mode;
    }
}


text:
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;
using LightBDD.Framework.Messaging.Implementation;

namespace LightBDD.Framework.Messaging
{
    ///
    /// MessageListener class allowing to listen for and record messages for further assertions.
    ///
    public class MessageListener : IDisposable
    {
        private readonly IMessageSource _source;
        private readonly ConcurrentStack<object> _messages = new ConcurrentStack<object>();
        private static readonly TimeSpan DefaultTimeout = TimeSpan.FromSeconds(10);
        private readonly CancellationTokenSource _listenerDisposedTokenSource = new CancellationTokenSource();
        internal event Action<object> OnMessage;

        private MessageListener(IMessageSource source)
        {
            _source = source;
            _source.OnMessage += OnHandle;
        }

        private void OnHandle(object msg)
        {
            _messages.Push(msg);
            OnMessage?.Invoke(msg);
        }

        ///
        /// Starts listening for messages coming from specified <paramref name="source"/>.
        ///

        /// Please note, the listener should be disposed after usage, in order to stop listening.
        ///
        /// <param name="source">Message source.</param>
        public static MessageListener Start(IMessageSource source) => new MessageListener(source);

        ///
        /// Returns all received messages of specified type, in order from latest to oldest.
        ///
        /// <typeparam name="TMessage">Message type.</typeparam>
        /// <returns>Collection of received messages.</returns>
        public IEnumerable<TMessage> GetMessages<TMessage>() => _messages.OfType<TMessage>();

        ///
        /// Disposes listener making it no longer listening for new messages.

        /// Upon dispose, the received messages are cleared and all pending receive method calls aborted.
        ///
        public void Dispose()
        {
            _source.OnMessage -= OnHandle;
            _messages.Clear();
            _listenerDisposedTokenSource.Cancel();
        }

        ///
        /// Ensures the message of type <typeparamref name="TMessage"/> and matching predicate <paramref name="predicate"/> is received.

        /// If one or more matching messages were already received by listener, the latest matching message is returned immediately.

        /// If no matching messages were received yet, the method listens for upcoming messages and returns when matching one arrives, timeout occurs or <paramref name="cancellationToken"/> is cancelled.

        ///
        /// <typeparam name="TMessage">Type of message to receive.</typeparam>
        /// <param name="predicate">Predicate that message have to match to be returned.</param>
        /// <param name="timeout">Timeout for how long the method should await for matching message to arrive. If <c>null</c>, a default value of 10s will be used.</param>
        /// <param name="cancellationToken">Cancellation token.</param>
        /// <returns>Latest matching message</returns>
        /// <exception cref="TimeoutException">Thrown when timeout occurs and no matching message was received.</exception>
        /// <exception cref="MessagePredicateEvaluationException">Thrown when provided predicate failed evaluation on received message.</exception>
        public async Task<TMessage> EnsureReceived<TMessage>(Func<TMessage, bool> predicate, TimeSpan? timeout = null, CancellationToken cancellationToken = default)
        {
            bool PredicateFn(TMessage m) => IsValidMessage(m, predicate);
            using var waiter = new MessageWaiter<TMessage>(this, PredicateFn);
            using var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, _listenerDisposedTokenSource.Token);
            return await waiter.WaitAsync(timeout ?? DefaultTimeout, cts.Token);
        }

        ///
        /// Ensures the <paramref name="count"/> number of messages of type <typeparamref name="TMessage"/> and matching predicate <paramref name="predicate"/> are received.

        /// If all required messages are already received by listener, the method returns immediately.

        /// If none or not all messages are received yet, the method listens for upcoming messages and returns when all are received, timeout occurs or <paramref name="cancellationToken"/> is cancelled.

        /// If more than <paramref name="count"/> messages matches the criteria, the latest <paramref name="count"/> messages will be returned.
        ///
        /// <typeparam name="TMessage">Type of message to receive.</typeparam>
        /// <param name="count">Number of messages that should be received</param>
        /// <param name="predicate">Predicate that message have to match to be returned.</param>
        /// <param name="timeout">Timeout for how long the method should await for matching messages to arrive. If <c>null</c>, a default value of 10s will be used.</param>
        /// <param name="cancellationToken">Cancellation token.</param>
        /// <returns>List of <paramref name="count"/> requested messages, ordered from latest to oldest.</returns>
        public async Task<IReadOnlyList<TMessage>> EnsureReceivedMany<TMessage>(int count, Func<TMessage, bool> predicate, TimeSpan? timeout = null, CancellationToken cancellationToken = default)
        {
            bool PredicateFn(TMessage m) => IsValidMessage(m, predicate);
            using var counter = new MessageCounter<TMessage>(this, count, PredicateFn);
            using var cts = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, _listenerDisposedTokenSource.Token);
            return await counter.WaitAsync(timeout ?? DefaultTimeout, cts.Token);
        }

        private static bool IsValidMessage<T>(T msg, Func<T, bool> predicate)
        {
            try
            {
                return predicate.Invoke(msg);
            }
            catch (Exception ex)
            {
                throw new MessagePredicateEvaluationException(ex, msg);
            }
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval">
    <solid android:color="@color/holo_blue_light" />
    <size
        android:width="20dp"
        android:height="20dp" />

    <stroke
        android:width="1dp"
        android:color="#ffbaff09" />
</shape>


text:
// Our base model is "post"
Post = Backbone.Model.extend({
	defaults: function() {
			return {
				nick: "empty line...",
				text: "empty line...",
				ts: null,
				lts: null,
				dest: "empty line...",
				cmnts:[]
			};
		}
});

// PostsCollection collection
PostsCollection = Backbone.Collection.extend({
	model: Post,
	comparator: function(a, b) {
        if ( a.get("lts") < b.get("lts") ) return 1;
        if ( a.get("lts") > b.get("lts") ) return -1;
        if ( a.get("lts") === b.get("lts") ) return 0;
    },

    initialize: function() {
        this.on('change', function() { this.sort() }, this);
    },
	add: function (item) {
		if (!( this.findWhere({ txt: item.txt }) && this.findWhere({ nick: item.nick}) )) {
		  Backbone.Collection.prototype.add.call(this, item);
		};
	  }
});

var Posts = new PostsCollection;

// Views are responsible for rendering stuff on the screen (well,
// into the DOM).
//
// Typically views are instantiated for a model or a collection,
// and they watch for change events in those in order to automatically
// update the data shown on the screen.

PostView = Backbone.View.extend({
	//... is a list tag.
	tagName:  "li",
	// Cache the template function for a single item.
	template: _.template($('#Post-template').html()),
	initialize: function(options) {
		// Ensure our methods keep the `this` reference to the view itself
		_.bindAll(this, 'render');
		// If the model changes we need to re-render
		this.model.bind('change', this.render);
	},
	render: function() {
		this.$el.html(this.template(this.model.toJSON()));
		return this;
	}
});

PostsCollectionView = Backbone.View.extend({
	// The collection will be kept here
	collection: null,
	//collection2: null,
	// The Posts list view is attached to the table body
	el: $("#AllPost-list"),

	initialize: function(options) {
		///////////////////////////////////////////////
		this.collection = new PostsCollection;
        this.collection.on('all', function() { this.render() }, this);
		//this.collection2 = new PostsCollection();
        //this.collection2.on('all', function() { this.render() }, this);
		///////////////////////////////////////////////
		this.collection = options.collection;
		//this.collection2 = MyPosts;
		//this.collection.add(MyPosts.toJSON(), {silent : true});
		//this.collection.add(this.collection2.toJSON(), {silent : true});
		//this.collection2 = options.collection2;
		// Ensure our methods keep the `this` reference to the view itself
		_.bindAll(this, 'render');

		// Bind collection changes to re-rendering
		this.collection.bind('reset', this.render);
		this.collection.bind('add', this.render);
		this.collection.bind('remove', this.render);

	},

	render: function() {
		var element = jQuery(this.el);
		// Clear potential old entries first

		element.empty();
		// Go through the collection items
		//this.collection.models.concat(this.collection2.models);
		//this.collection.models=_.uniq(this.collection.models);
		//

		this.collection.forEach(function(item) {
			// Instantiate a PostsCollectionItem view for each
			var itemView = new PostView({
				model: item
			});
			// Render the PostsCollectionView, and append its element
			// to the table
			element.append(itemView.render().el);
		});
		return this;
	}
});

var PostsList = new PostsCollectionView({
	collection: Posts
});
// And render it
PostsList.render();


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/html; charset=utf-8"/>
    <title>Statistics of csubj in UD_Buryat</title>
    <link rel="root" href=""/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/hint.css"/>

          home

          edit page
          issue tracker

          <gcse:search></gcse:search>

        This page pertains to UD version 2.

            It appears that you have Javascript disabled.
            Please consider enabling Javascript for this page to see the visualizations.

Treebank Statistics: UD_Buryat: Relations: csubj

This relation is universal.

8 nodes (0%) are attached to their parents as csubj.

8 instances of csubj (100%) are right-to-left (child precedes parent).
Average distance between parent and child is 1.875.

The following 5 pairs of parts of speech are connected with csubj: <tt>ADV</tt>-<tt>VERB</tt> (4; 50% instances), <tt>ADJ</tt>-<tt>VERB</tt> (1; 13% instances), <tt>NOUN</tt>-<tt>NOUN</tt> (1; 13% instances), <tt>NOUN</tt>-<tt>VERB</tt> (1; 13% instances), <tt>VERB</tt>-<tt>NOUN</tt> (1; 13% instances).

# visual-style 4	bgColor:blue
# visual-style 4	fgColor:white
# visual-style 6	bgColor:blue
# visual-style 6	fgColor:white
# visual-style 6 4 csubj	color:blue
1	Буряад	буряад	ADJ	_	_	2	amod	_	_
2	хэлэ	хэлэн	NOUN	_	Case=Nom	3	nmod	_	_
3	мэдэдэг	мэдэ	VERB	_	_	4	xcomp	_	_
4	байхада	бай	VERB	_	Case=Dat|VerbForm=Ger	6	csubj	_	SpaceAfter=No
5	,	,	PUNCT	_	_	4	punct	_	_
6	эшхэбтэр	эшхэбтэр	ADV	_	_	0	root	_	_
7	һэн	һэн	PART	_	_	6	discourse	_	_

# visual-style 17	bgColor:blue
# visual-style 17	fgColor:white
# visual-style 18	bgColor:blue
# visual-style 18	fgColor:white
# visual-style 18 17 csubj	color:blue
1	Хэды	хэды	ADV	_	PronType=Int	3	advmod	_	_
2	олон	олон	ADJ	_	_	3	amod	_	_
3	жэлэй	жэл	NOUN	_	Case=Gen	4	nmod	_	_
4	туршада	турша	NOUN	_	Case=Dat	7	nmod	_	_
5	буряад	буряад	ADJ	_	_	6	amod	_	_
6	хэлэеэ	хэлэн	NOUN	_	Case=Nom|Reflex=Yes	7	obj	_	_
7	шудалжал	шудал	VERB	_	VerbForm=Coverb	0	root	_	_
8	байһан	бай	AUX	_	Mood=Ind|Number=Sing|Person=3|Tense=Past|VerbForm=Fin	7	aux	_	_
9	аад	аад	CCONJ	_	_	7	advmod	_	SpaceAfter=No
10	,	,	PUNCT	_	_	7	punct	_	_
11	гэнтэ	гэнтэ	ADV	_	_	17	advmod	_	_
12	гүрэнэй	гүрэнэй	NOUN	_	Case=Nom	13	amod	_	_
13	хэлэн	хэлэн	NOUN	_	Case=Nom	15	nmod	_	_
14	гэжэ	гэ	VERB	_	VerbForm=Coverb	16	discourse	_	_
15	программа	программа	NOUN	_	Case=Nom	16	obj	_	_
16	шэлэн	шэлэ	VERB	_	_	17	xcomp	_	_
17	абалга	аба	VERB	_	VerbForm=Coverb	18	csubj	_	_
18	гайхалтай	гайхалтай	ADJ	_	_	7	parataxis	_	SpaceAfter=No
19	.	.	PUNCT	_	_	18	punct	_	_

# visual-style 4	bgColor:blue
# visual-style 4	fgColor:white
# visual-style 5	bgColor:blue
# visual-style 5	fgColor:white
# visual-style 5 4 csubj	color:blue
1	Түрэл	түрэл	ADJ	_	_	2	amod	_	_
2	хэлэеэ	хэлэн	NOUN	_	Case=Nom|Reflex=Yes	3	obj	_	_
3	алдаһан	алда	VERB	_	Mood=Ind|Number=Sing|Person=3|Tense=Past|VerbForm=Fin	4	acl	_	_
4	арад	арад	NOUN	_	Case=Nom	5	csubj	_	_
5	арад	арад	NOUN	_	Case=Nom	0	root	_	_
6	бэшэ	бэшэ	ADV	_	_	5	advmod:neg	_	_
7	гэжэ	гэ	VERB	_	VerbForm=Coverb	11	discourse	_	_
8	сэсэн	сэсэн	ADJ	_	_	9	amod	_	_
9	үгые	үгы	NOUN	_	Case=Nom|Reflex=Yes	11	obj	_	_
10	эндэ	эндэ	ADV	_	_	11	advmod	_	_
11	дабтамаар	дабта	VERB	_	_	5	parataxis	_	SpaceAfter=No
12	.	.	PUNCT	_	_	11	punct	_	_

© 2014–2021
            Universal Dependencies contributors.
            Site powered by Annodoc and brat
.


text:
`./solomagic.py input.text [rules..]`

# Examples:
Without any rules it should output the same input file as is.
```
./solomagic.py input.text
```

As soon as we need rules we'll append them to the command line:
```
./solomagic.py input.text QtoApostrophe createMa
```

The output will correspond to the resulting file, which can be redirected as desired:
```
./solomagic.py input.text QtoApostrophe createMa > myawesomenewfile.text
```

# Testing
[![Build Status](https://travis-ci.org/aleixpol/solomagic.svg?branch=master)](https://travis-ci.org/aleixpol/solomagic)
Tests are triggered by `tests/test.py`, can conveniently be called by `make check`.

`*.in` files are input files and `*.out` are resulting files. To request new features, feel free to add more tests.


text:
require 'converters/wp25/option'
require 'converters/wp25/post'
require 'converters/wp25/comment'
require 'converters/wp25/term'
require 'converters/wp25/term_relationship'
require 'converters/wp25/term_taxonomy'
require 'converters/wp25/user'

class Wp25Converter < BaseConverter
  def self.convert(options = {})
    converter = new(options)

    unless (options[:prefix].nil?)
      WP25::Option.prefix = options[:prefix]
      WP25::Post.prefix = options[:prefix]
      WP25::Comment.prefix = options[:prefix]
      WP25::User.prefix = options[:prefix]
      WP25::Term.prefix = options[:prefix]
      WP25::TermRelationship.prefix = options[:prefix]
      WP25::TermTaxonomy.prefix = options[:prefix]
    end

    Blog.default.update_attributes(
      :blog_name => WP25::Option.find_by_option_name('blogname').option_value,
      :blog_subtitle => WP25::Option.find_by_option_name('blogdescription').option_value
    )

    converter.import_users do |wp_user|
      ::User.new \
        :name => wp_user.display_name,
        :email => wp_user.user_email || "#{wp_user.user_login}@notfound.com",
        :login => wp_user.user_login,
        :password => new_user_password,
        :password_confirmation => new_user_password
    end

    converter.import_articles do |wp_article|
      unless wp_article.post_content.blank? || wp_article.post_title.blank?
        user = wp_article.post_author.nil? ? nil : converter.users[WP25::User.find(wp_article.post_author.to_i).user_login]

        excerpt, body = !wp_article.post_excerpt.blank? ?
          [wp_article.post_excerpt, wp_article.post_content] :
          [nil, wp_article.post_content]

        a = ::Article.new \
          :title        => CGI::unescapeHTML(wp_article.post_title),
          :body_and_extended => body,
          :created_at   => wp_article.post_date,
          :published_at => wp_article.post_date,
          :updated_at   => wp_article.post_modified,
          :user         => user,
          :author       => user.login,
          :tags         => converter.find_or_create_tags(wp_article.tags)
        [a, converter.find_or_create_categories(wp_article)]
      end
    end

    converter.import_pages do |wp_page|
      unless wp_page.post_content.blank? || wp_page.post_title.blank?
        user = wp_page.post_author.nil? ? nil : converter.users[WP25::User.find(wp_page.post_author.to_i).user_login]

        excerpt, body = !wp_page.post_excerpt.blank? ?
          [wp_page.post_excerpt, wp_page.post_content] :
          [nil, wp_page.post_content]

        ::Page.new \
          :title        => CGI::unescapeHTML(wp_page.post_title),
          :name         => wp_page.post_name,
          :body         => body,
          :created_at   => wp_page.post_date,
          :published_at => wp_page.post_date,
          :updated_at   => wp_page.post_modified,
          :user         => user,
          :author       => user.login
      end
    end

    converter.import_comments do |wp_comment|
      user = wp_comment.user.nil? ? nil : converter.users[wp_comment.user.user_login]

      ::Comment.new \
        :body         => wp_comment.comment_content,
        :created_at   => wp_comment.comment_date,
        :updated_at   => wp_comment.comment_date,
        :published_at => wp_comment.comment_date,
        :user         => user,
        :author       => wp_comment.comment_author,
        :url          => wp_comment.comment_author_url,
        :email        => wp_comment.comment_author_email,
        :state        => converter.comment_state(wp_comment.comment_approved),
        :ip           => wp_comment.comment_author_IP
    end
  end

  def old_articles
    if @options.has_key?(:categories)
      #TODO: understand the categories configuration
      @old_article ||= WP25::Post.find(:all,
                                           :include => :categorie,
                                           :conditions => ["post_pub = ? AND cat_libelle IN (?)", true, @options[:categories]])
    else
      @old_article ||= WP25::Post.find :all,
        :conditions => { :post_status => 'publish', :post_type => 'post' }
    end
    @old_article
  end

  def old_pages
    if @options.has_key?(:categories)
      #TODO: understand the categories configuration
      @old_page ||= WP25::Post.find(:all,
                                           :include => :categorie,
                                           :conditions => ["post_pub = ? AND cat_libelle IN (?)", true, @options[:categories]])
    else
      @old_page ||= WP25::Post.find :all,
        :conditions => { :post_status => 'publish', :post_type => 'page' }
    end
    @old_page
  end

  def old_users
    @old_users ||= WP25::User.find(:all).index_by &:ID
  end

  def get_login(wp_user)
    wp_user.user_login
  end

  def handle_bad_user_email(wp_user, email)
    wp_user.user_email = email
  end

  def handle_bad_comment_author_email(wp_comment, email)
    wp_comment.comment_author_email = email
  end

  def handle_bad_comment_author_url(wp_comment, url)
    wp_comment.comment_author_url = url
  end

  def handle_bad_comment_author(wp_comment, author)
    wp_comment.comment_author = author
  end

  def handle_bad_comment_content(wp_comment, content)
    wp_comment.comment_content = content
  end

  def create_sections(libelle)
    @sections[libelle] = site.sections.create!(:name => libelle, :path => libelle)
    @sections[libelle]
  end

  def find_or_create_categories(wp_article)
    wp_categories = wp_article.categories
    categories_post = []
    wp_categories.each { |wp_categorie|
      create_categories(wp_categorie) if categories[wp_categorie].nil?
      categories_post << categories[wp_categorie]
    }
    categories_post
  end

  # with the tags'libelle in params search or
  # create the Tag objet in Typo
  def find_or_create_tags(wp_tags)
    tags_post = []
    wp_tags.each { |tag|
      create_tag(tag) if tags[tag].nil?
      tags_post << tags[tag]
    }
    tags_post
  end

  def comment_state(wp_approved)
    case wp_approved
    when 'spam' then :spam
    when '1' then :ham
    else :unclassified
    end
  end
end


text:
import { Component, OnInit, Input } from '@angular/core';
import { Recipe } from '../recipe.model';
import { RecipeService } from '../recipe.service';

@Component({
  selector: 'app-recipe-detail',
  templateUrl: './recipe-detail.component.html',
  styleUrls: ['./recipe-detail.component.css']
})
export class RecipeDetailComponent implements OnInit {
  @Input() recipe: Recipe;

  constructor(private recipeService: RecipeService) { }

  ngOnInit() {
  }

  onAddToShoppingList () {
    this.recipeService.addIngredientsToShoppingList(this.recipe.ingredients);
  }
}


text:
package org.expresso.runtime;

import java.util.List;

import org.qommons.Named;

public interface Method<E extends ExpressoEnvironment<E>, R> extends Named {
	Result<R> invoke(E env, List<? extends Result<?>> parameters);
}


text:
package com.sudao.basemodule.common.viewpager;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;

/**
 * Created by Samuel on 16/3/28 14:21
 * Email:xuzhou40@gmail.com
 * desc:不能滑动的viewpager
 */
public class NoScrollViewPager extends ViewPager {
    private boolean isPagingEnabled = false;

    public NoScrollViewPager(Context context) {
        super(context);
    }

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

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        return this.isPagingEnabled && super.onTouchEvent(event);
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent event) {
        return this.isPagingEnabled && super.onInterceptTouchEvent(event);
    }

    public void setPagingEnabled(boolean b) {
        this.isPagingEnabled = b;
    }
}


text:
package org.apache.xml.security.test.dom.secure_val;

import java.io.File;

import org.apache.xml.security.signature.XMLSignature;
import org.apache.xml.security.signature.XMLSignatureException;
import org.apache.xml.security.test.dom.interop.InteropTestBase;
import org.apache.xml.security.utils.Constants;
import org.apache.xml.security.utils.XMLUtils;
import org.w3c.dom.Element;

/**
 * This is a test for a wrapping attack.
 */
public class WrappingAttackTest extends InteropTestBase {

    static org.slf4j.Logger log =
        org.slf4j.LoggerFactory.getLogger(WrappingAttackTest.class);

    static {
        org.apache.xml.security.Init.init();
    }

    public WrappingAttackTest() {
        super();
    }

    @org.junit.Test
    public void testWrappingAttack() throws Exception {
        boolean success =
            readAndVerifySignature(
                "src/test/resources/at/iaik/ixsil/coreFeatures/signatures",
                "manifestSignatureWrapping.xml"
            );

        assertTrue(success);
        try {
            readAndVerifySignatureAndSetManifest(
                "src/test/resources/at/iaik/ixsil/coreFeatures/signatures",
                "manifestSignatureWrapping.xml"
            );
            fail("Failure expected when secure validation is enabled");
        } catch (XMLSignatureException ex) {
            assertTrue(ex.getMessage().contains("no XMLSignatureInput"));
        }
    }

    private boolean readAndVerifySignature(
        String directory, String file
    ) throws Exception {
        String basedir = System.getProperty("basedir");
        if (basedir != null && !"".equals(basedir)) {
            directory = basedir + "/" + directory;
        }

        File f = new File(directory + "/" + file);

        javax.xml.parsers.DocumentBuilder db = XMLUtils.createDocumentBuilder(false, false);
        org.w3c.dom.Document doc = db.parse(f);

        Element sigElement =
            (Element) doc.getElementsByTagNameNS(Constants.SignatureSpecNS,
                                                 Constants._TAG_SIGNATURE).item(0);
        XMLSignature signature = new XMLSignature(sigElement, f.toURI().toURL().toString());
        return signature.checkSignatureValue(signature.getKeyInfo().getPublicKey());
    }

    private boolean readAndVerifySignatureAndSetManifest(
        String directory, String file
    ) throws Exception {
        String basedir = System.getProperty("basedir");
        if (basedir != null && !"".equals(basedir)) {
            directory = basedir + "/" + directory;
        }

        File f = new File(directory + "/" + file);

        javax.xml.parsers.DocumentBuilder db = XMLUtils.createDocumentBuilder(false, false);
        org.w3c.dom.Document doc = db.parse(f);

        Element sigElement =
            (Element) doc.getElementsByTagNameNS(Constants.SignatureSpecNS,
                                                 Constants._TAG_SIGNATURE).item(0);

        Element manifestElement =
            (Element) doc.getElementsByTagName("Manifest").item(0);
        manifestElement.setIdAttribute("Id", true);

        XMLSignature signature = new XMLSignature(sigElement, f.toURI().toURL().toString(), true);
        return signature.checkSignatureValue(signature.getKeyInfo().getPublicKey());
    }

}


text:
layout: portfolio
title: Thinking inside a box
subtitle: Behaviour change science for designers
status: Ongoing project
tags: Research Product
img: /images/change/change-4.jpg
thumb: /images/change/squarethumbs@0,5x.jpg
---

95% of our decisions happen without conscious awareness – split-second, impulsive and easily influenced.

*Thinking Inside a Box* puts scientific understanding of these influences into practice. It's an idea-generation tool; use it to change the behaviour of your customers, users, audience, friends, parents or children.

## An online libary of human influences

![The Ninety Five Percent library](/images/change/webshot.png)

To accompany the toolkit, there's an online library of the principles behind each card in Thinking Inside a Box.

See it (in progress) [**here.**](http://samstephenson.com/action-cards)


text:
/*==================================================
 *  Debug Utility Functions
 *==================================================
 */

Timegrid.Debug = new Object();

Timegrid.Debug.log = function(msg) {
};

Timegrid.Debug.exception = function(e) {
    e = $.getIsIE() ? e.message : e;
    $.debugException(e, "Caught exception");
};


text: export{default,styleFunction}from"./Box";


text:
var http = require('http');

http.createServer(function (request, response) {
  response.writeHead(200, {'Content-Type': 'text/plain'});

  response.write('Response Start\n');

  setTimeout(function() {
    response.end('Response end\n');
  }, 1000);
}).listen(3001).close();

console.log('Server running at http://127.0.0.1:3001/');


text:
'''
Created on 2013-8-12

@author: lan (www.9miao.com)
'''
import urllib,sys

def execute(*args):
    """
    """
    if not args:
        masterport =9998
    else:
        masterport = int(args[0])
    url = "http://localhost:%s/reloadmodule"%masterport
    try:
        response = urllib.urlopen(url)
    except:
        response = None
    if response:
        sys.stdout.write("reload module success \n")
    else:
        sys.stdout.write("reload module failed \n")


text:
  Allaire est
      une commune géographiquement positionnée dans le département de Morbihan en Bretagne. Elle totalisait 3 487 habitants en 2008.

À Allaire, le prix moyen à la vente d'un appartement s'évalue à 1 996 € du m² en vente. La valeur moyenne d'une maison à l'achat se situe à 1 333 € du m². À la location le prix moyen se situe à 6,82 € du m² par mois.

La commune dispose concernant l'enseignement de un collège.
S'agissant les très jeunes, la ville dispose de deux écoles primaires.
Allaire propose les équipements facilitant une bonne prise en charge des jeunes.
Si vous avez un projet de faire l'acquisition d'un bien immobilier à Allaire, il est important évaluer la valeur des équipements éducatifs

Le nombre d'habitations, à Allaire, était réparti en 2011 en 102 appartements et 1 598 maisons soit
 un marché plutôt équilibré.

À Allaire le salaire médian par mois par individu est situé à approximativement 1 910 €  net. Ceci est inférieur à la moyenne nationale.

La ville propose de nombreux  équipements, elle propose entre autres un bassin de natation, un terrain de tennis, deux terrains de sport et deux boucles de randonnée.

À coté de Allaire sont situées les communes de
Saint-Nicolas-de-Redon située à 7 km, 2 935 habitants,
Saint-Vincent-sur-Oust localisée à 7 km, 1 255 habitants,
Saint-Gorgon à 5 km, 334 habitants,
Redon à 6 km, 9 601 habitants,
Saint-Perreux située à 5 km, 1 120 habitants,
Théhillac située à 8 km, 523 habitants,
 entre autres. De plus, Allaire est située à seulement onze km de Sainte-Marie.


text:
var serializeFormBySchema = function ($el, schema) {
    return map(schema, function (item, name) {
        var getValue = function (pseudo) {
            return $el.find('[name="' + name + '"]' + (pseudo || '')).val();
        };

        switch(item.type) {
            case 'radio':
                return getValue(':checked');
            case 'select':
                return getValue(' option:selected');
            case 'checkbox':
                var checked = [];
                $el.find('[name="' + name + '"]:checked').each(function () {
                    checked.push($(this).val());
                });
                return checked;
            default:
                return getValue();
        }
    });
};

var createController = function (fig) {
    var that = mixinPubSub(),
        el = fig.el,
        render = function (isRenderError, data, errors, extra) {
            data = data || that.model.get();
            if(isRenderError) {
                errors = that.mapErrorData(union(that.model.validate(data), errors));
            }
            else {
                errors = {};
            }

            that.$().html(fig.render(that.template, union(
                that.mapModelToView(data), errors, (extra || {})
            )));
        };

    that.setEl = function (newEl) {
        el = newEl;
    };

    that.mapErrorData = function (errorData) {
        return map(errorData, identity, function (key) {
            return key + 'Help';
        });
    };

    that.mapSchema = function (schema) {
        return mapToObject(
            schema,
            function (item) {
                return filter(item, function (item, key) {
                    return key !== 'name';
                });
            },
            function (key, item) {
                return item.name;
            }
        );
    };

    that.schema = that.mapSchema(fig.schema);
    that.model = fig.model;
    that.template = fig.template;

    that.$ = function (selector) {
        return selector ? $(el).find(selector) : $(el);
    };

    that.mapModelToView = function (modelData, schema) {
        schema = schema || that.schema;
        var isSelected = function (choice, value, name) {
            var type = schema[name].type;

            // if(type === 'select') {
            //     console.log('choice: ', choice, 'value: ', value);
            // }

            // if(isArray(choice)) {
            //     console.log('array ', name);
            // }

            // console.log('type: ', type, ' choice: ', choice, ' value: ', value);
            if(isArray(value)) {
                return $.inArray(choice, value) !== -1;
            }
            else {
                return choice === value;
            }

        };

        return map(modelData, function (value, name) {

            // console.log(name + ': ', typeof value);

            if(schema[name]) {
                var type = schema[name].type;

                if(
                    type === 'checkbox' ||
                    type === 'select' ||
                    type === 'radio'
                ) {
                    var mappedValue = {};
                    foreach(schema[name].values, function (choiceObject) {

                        var choice = isObject(choiceObject) ?
                            choiceObject.value : choiceObject;

                        if(isSelected(choice, value, name)) {
                            mappedValue[choice] = true;
                        }
                    });
                    return mappedValue;
                }
                else {
                    return value;
                }
            }
            else {
                console.warn(
                    'warning: schema attribute of name: ' +
                    name + ' does not exist.'
                );
            }
        });
    };

    that.render = partial(render, true);
    that.renderNoError = partial(render, false);

    return that;
};


text:
.. CHANGELOG.rst
.. Copyright (c) 2013-2019 Pablo Acosta-Serafini
.. See LICENSE for details

Changelog
=========

* 1.0.8 [2019-03-22]: Documentation and dependency update

* 1.0.7 [2019-03-09]: Dropped support for Python 2.6, 3.3 and 3.4. Updates to
  support newest versions of dependencies. Adopted lightweight package
  management framework

* 1.0.6 [2017-09-10]: Fixed bug while filtering rows that have empty column
  specified in filter. Fixed broken multi-line links in documentation

* 1.0.5 [2017-02-10]: Package build enhancements and fixes

* 1.0.4 [2017-02-07]: Python 3.6 support

* 1.0.3 [2016-06-10]: Minor documentation build bug fix

* 1.0.2 [2016-05-12]: Minor documentation updates

* 1.0.1 [2016-05-12]: Minor documentation updates

* 1.0.0 [2016-05-12]: Final release of 1.0.0 branch

* 1.0.0rc1 [2016-05-11]: Initial commit, forked a subset from putil PyPI
  package


text:
A-2000

    <form class="form-horizontal" >
        <fieldset>

            Panel Size

                {{data.panelSize}}

            Device Label

                <input type="text" class="form-control" id="label" placeholder="Device Label" ng-model="data.label" ng-change="submitSingleValue()" >

            Location

                <input type="text" class="form-control" id="location" placeholder="Location" ng-model="data.location" ng-change="submitSingleValue()">

            Feeder CKT

                <input type="text" class="form-control" id="feederCKT" placeholder="Feeder CKT" ng-model="data.feederCKT" ng-change="submitSingleValue()" >

            Voltage

                <select class="form-control" id="voltage" ng-model="select_voltage" ng-change="submitAll(data.voltage,select_voltage)">
                    <option ng-repeat="v in data.voltage" ng-selected="v.selected" ng-show="v.valid" ng-value="v.displayName">
                        {{v.displayName}}
                    </option>
                </select>

            Mounting

                <select class="form-control" id="mounting" ng-model="select_mounting" ng-change="submitAll(data.mounting,select_mounting)">
                    <option ng-repeat="m in data.mounting" ng-selected="m.selected" ng-value="m.displayName">
                        {{m.displayName}}
                    </option>
                </select>

Panel Breaker Info

            Add Main Breaker?

                <input type="checkbox" id="mainBreaker" ng-model="data.mainBreaker" ng-change="submitSingleValue()">

            Breaker Size

                <select class="form-control" id="breakerSize" ng-model="select_breakerSize" ng-change="submitAll(data.breakerSize,select_breakerSize)">
                    <option ng-repeat="b in data.breakerSize" ng-selected="b.selected" ng-show="b.valid" ng-value="b.displayName">
                        {{b.displayName}}
                    </option>
                </select>

Relay Panel Info

            Relay Panel Required?

                <input type="checkbox" id="panelRequired" ng-model="data.panelRequired" ng-change="submitSingleValue()">

            Feeder Type

                        <select class="form-control" id="feederType" ng-model="select_feederType" ng-change="submitAll(data.feederType,select_feederType)">

                            <option ng-repeat="f in data.feederType" ng-show="f.valid" ng-selected="f.selected" ng-value="f.displayName">
                                {{f.displayName}}
                            </option>

                        </select>

            Relay Voltage

                        <select class="form-control" id="relayVoltage" ng-model="select_relayVoltage" ng-change="submitAll(data.relayVoltage,select_relayVoltage)">
                            <option ng-repeat="r in data.relayVoltage" ng-show="r.valid" ng-selected="r.selected" ng-value="r.displayName">
                                {{r.displayName}}
                            </option>
                        </select>

            Relay Qty

                        <select class="form-control" id="relayQuantity" ng-options="q for q in [0,2,4,6,8,12]" ng-model="data.relayQuantity"
                                ng-change="submitAddRelay(data.relayQuantity)"></select>

DMX Jacks

            DMX 512 Jacks

                <select class="form-control" id="dmxjacks" ng-options="d for d in [0,1,2]" ng-model="data.dmxjacks"
                        ng-change="submitSingleValue()"></select>

                    Part#
                    Image
                    Description
                    Quantity

                    {{d.invItem}}
                    N/A
                    {{d.displayName}}
                    <input type="number" id="a" min="0" max="99" ng-bind="">

</fieldset>
    </form>


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal">

    <ImageView
        android:id="@+id/product_iv"
        android:layout_width="40dp"
        android:layout_height="40dp"
        android:scaleType="fitXY"
        android:layout_gravity="center"
        android:layout_margin="5dp"
        android:src="@mipmap/ic_logo" />

    <TextView
        android:id="@+id/product_tv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center_vertical"
        android:layout_marginLeft="20dp"
        android:text="狮王暗疮膏"
        android:textColor="#000000"
        android:textSize="12sp" />
</LinearLayout>


text:
import unittest

from bluecanary.plugins import load_plugins, PluginBaseClass

class TestLoadPlugins(unittest.TestCase):
    def test_load_plugins(self):
        plugins = load_plugins()

        self.assertIn('DiskSpaceUtilization', plugins.keys())
        self.assertTrue(isinstance(plugins['DiskSpaceUtilization'], PluginBaseClass))

        self.assertIn('MemoryUtilization', plugins.keys())
        self.assertTrue(isinstance(plugins['MemoryUtilization'], PluginBaseClass))


text:
function(_gmock_append_debugs _endvar _library)
  if(${_library} AND ${_library}_DEBUG)
    set(_output optimized ${${_library}} debug ${${_library}_DEBUG})
  else()
    set(_output ${${_library}})
  endif()
  set(${_endvar} ${_output} PARENT_SCOPE)
endfunction()

function(_gmock_find_library _name)
  find_library(${_name}
    NAMES ${ARGN}
    HINTS
      $ENV{GMOCK_HOME}
      ${GMOCK_LIBRARIES_PATH}
  )
  mark_as_advanced(${_name})
endfunction()

if(NOT DEFINED GMOCK_MSVC_SEARCH)
  set(GMOCK_MSVC_SEARCH MD)
endif()

set(_gmock_libpath_suffixes lib)
if(MSVC)
  if(GMOCK_MSVC_SEARCH STREQUAL "MD")
    list(APPEND _gmock_libpath_suffixes
      msvc/googlemock/Debug
      msvc/googlemock/Release)
  elseif(GMOCK_MSVC_SEARCH STREQUAL "MT")
    list(APPEND _gmock_libpath_suffixes
      msvc/googlemock/Debug
      msvc/googlemock/Release)
  endif()
elseif(APPLE)
      list(APPEND _gmock_libpath_suffixes
        clang/googlemock)
endif()

find_path(GMOCK_INCLUDE_DIR gmock/gmock.h
  HINTS
    ${GMOCK_ROOT}/googlemock/include
)

find_path(GMOCK_GTEST_INCLUDE_DIR gtest/gtest.h
   HINTS
     ${GMOCK_ROOT}/googletest/include
)

mark_as_advanced(GMOCK_GTEST_INCLUDE_DIR)
mark_as_advanced(GMOCK_INCLUDE_DIR)

if(MSVC AND GMOCK_MSVC_SEARCH STREQUAL "MD")
  # The provided /MD project files for Google Mock add -md suffixes to the
  # library names.
  _gmock_find_library(GMOCK_LIBRARY            gmock-md  gmock)
  _gmock_find_library(GMOCK_LIBRARY_DEBUG      gmock-mdd gmockd)
  _gmock_find_library(GMOCK_MAIN_LIBRARY       gmock_main-md  gmock_main)
  _gmock_find_library(GMOCK_MAIN_LIBRARY_DEBUG gmock_main-mdd gmock_maind)
else()
  _gmock_find_library(GMOCK_LIBRARY            gmock)
  _gmock_find_library(GMOCK_LIBRARY_DEBUG      gmockd)
  _gmock_find_library(GMOCK_MAIN_LIBRARY       gmock_main)
  _gmock_find_library(GMOCK_MAIN_LIBRARY_DEBUG gmock_maind)
endif()

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GMock DEFAULT_MSG GMOCK_LIBRARY GMOCK_INCLUDE_DIR GMOCK_MAIN_LIBRARY)

if(GMOCK_FOUND)
  set(GMOCK_INCLUDE_DIRS ${GMOCK_INCLUDE_DIR})
  _gmock_append_debugs(GMOCK_LIBRARIES      GMOCK_LIBRARY)
  _gmock_append_debugs(GMOCK_MAIN_LIBRARIES GMOCK_MAIN_LIBRARY)
  set(GMOCK_BOTH_LIBRARIES ${GMOCK_LIBRARIES} ${GMOCK_MAIN_LIBRARIES})
endif()


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.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Cubium: RoutingTable< T > Class Template Reference</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" />

Cubium
    1.2.0

Minimalist software system for CubeSats and high-altitude balloon systems

Public Member Functions |
Protected Attributes |
List of all members

RoutingTable< T > Class Template Reference

#include <routing_table.hpp>

Public Member Functions

 	RoutingTable ()

 	RoutingTable (LogicalAddress log, T physAddr)

bool 	insert (LogicalAddress log, T physAddr)

bool 	exists (LogicalAddress log)

bool 	isEmpty ()

int 	size ()

virtual T 	getPhysicalAddress (LogicalAddress log)

std::map< LogicalAddress, T, LogicalAddressCompare > 	getTable ()

Protected Attributes

std::map< LogicalAddress, T, LogicalAddressCompare > 	routingTable

Constructor & Destructor Documentation

◆ RoutingTable() [1/2]

template<typename T >

          RoutingTable< T >::RoutingTable
          (
          	)

inline

◆ RoutingTable() [2/2]

template<typename T >

          RoutingTable< T >::RoutingTable
          (
          LogicalAddress
          log,

          T
          physAddr

          )

inline

Member Function Documentation

◆ exists()

template<typename T >

          bool RoutingTable< T >::exists
          (
          LogicalAddress
          log	)

inline

◆ getPhysicalAddress()

template<typename T >

          virtual T RoutingTable< T >::getPhysicalAddress
          (
          LogicalAddress
          log	)

inlinevirtual

◆ getTable()

template<typename T >

          std::map<LogicalAddress, T, LogicalAddressCompare> RoutingTable< T >::getTable
          (
          	)

inline

◆ insert()

template<typename T >

          bool RoutingTable< T >::insert
          (
          LogicalAddress
          log,

          T
          physAddr

          )

inline

◆ isEmpty()

template<typename T >

          bool RoutingTable< T >::isEmpty
          (
          	)

inline

◆ size()

template<typename T >

          int RoutingTable< T >::size
          (
          	)

inline

Member Data Documentation

◆ routingTable

template<typename T >

          std::map<LogicalAddress, T, LogicalAddressCompare> RoutingTable< T >::routingTable

protected

The documentation for this class was generated from the following file:

lib/routing_table.hpp

<address class="footer">
Generated by

 1.8.13
</address>


text:
package cas.analysis

import java.util.Date
import cas.analysis.estimation._
import cas.utils.StdImplicits.RightBiasedEither
import cas.analysis.subject.Subject
import cas.persistence.SubjectsGrader
import cas.web.pages.ControlPage
import cas.analysis.subject.components.{CreationDate, Likability, Virality}
import cas.utils.Files
import org.joda.time.{DateTime, Duration, Period}
import org.specs2.mutable.Specification

class SubjectsClassificatorSpec extends Specification {
  "SubjectsClassificator" should {
    val weights = Array(3.1642, -61.6405, -15.6417, -1.7404)
    val classifier = new SubjectsClassificator(weights,
      new StaticLoyaltyEstimator(StaticLoyaltyConfigs()),
      new ContinuousInvRelEstimator(ContinuousInvRelEstimatorConfigs(ControlPage.searcher)),
      new CorrectnessEstimator(CorrectnessConfigs()))
    val parser = new SubjectsGrader()
    val tryEstims = parser.convertDumpToEstimations(Files.resources + "/cas/data/marked/marked_testing.json")

    "assign right class mark" in {
      val a = for (estims <- tryEstims)
        yield {
          for { e <- estims } yield {
            val cl = (1 - SubjectClass.toInt(classifier.predictClass(e.subj).get)).toDouble
            cl == e.actuality
          }
        }
      a.get must not contain false
    }

  }
}


text:
package org.cloudfoundry.client.v2.userprovidedserviceinstances;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.cloudfoundry.Nullable;
import org.cloudfoundry.client.v2.serviceinstances.BaseServiceInstanceEntity;
import org.immutables.value.Value;

/**
 * The entity response payload for User Provided Service Instances
 */
@JsonDeserialize
@Value.Immutable
abstract class _UserProvidedServiceInstanceEntity extends BaseServiceInstanceEntity {

    /**
     * URL to which requests for bound routes will be forwarded
     */
    @JsonProperty("route_service_url")
    @Nullable
    abstract String getRouteServiceUrl();

    /**
     * The url for the syslog_drain to direct to
     */
    @JsonProperty("syslog_drain_url")
    @Nullable
    abstract String getSyslogDrainUrl();

}


text:
<!DOCTYPE html>

<meta charset=utf-8 />
<title>Weppy Parser</title>

Weppy Parser

        <video id="awesome"></video>


text:
#import "NSObject.h"

#import "NSCoding-Protocol.h"

@class NSError, NSString;

@interface IBAutolayoutArbitrationResultRepresentation : NSObject <NSCoding>
{
    id <IBCollection> _constraintRepresentationsToUpgrade;
    id <IBCollection> _constraintRepresentationsToRemove;
    id <IBCollection> _constraintRepresentationsToAdd;
    NSString *_engineDescription;
    NSError *_error;
}

@property(readonly, nonatomic) NSError *error; // @synthesize error=_error;
@property(readonly, nonatomic) NSString *engineDescription; // @synthesize engineDescription=_engineDescription;
@property(readonly, nonatomic) id <IBCollection> constraintRepresentationsToAdd; // @synthesize constraintRepresentationsToAdd=_constraintRepresentationsToAdd;
@property(readonly, nonatomic) id <IBCollection> constraintRepresentationsToRemove; // @synthesize constraintRepresentationsToRemove=_constraintRepresentationsToRemove;
@property(readonly, nonatomic) id <IBCollection> constraintRepresentationsToUpgrade; // @synthesize constraintRepresentationsToUpgrade=_constraintRepresentationsToUpgrade;
- (void).cxx_destruct;
- (void)encodeWithCoder:(id)arg1;
- (id)initWithCoder:(id)arg1;
@property(readonly, nonatomic, getter=isErrorResult) BOOL errorResult;
- (id)initWithError:(id)arg1 engineDescription:(id)arg2;
- (id)initWithConstraintRepresentationsToAdd:(id)arg1 constraintRepresentationsToRemove:(id)arg2 constraintRepresentationsToUpgrade:(id)arg3;

@end


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

namespace TimeSaver
{
    internal static class FontHelper
    {
        /// <summary>
        /// Initializes the <see cref="FontHelper"/> class.
        /// </summary>
        static FontHelper()
        {
            LoadEmbeddedFont(Properties.Resources.FontLight);
            LoadEmbeddedFont(Properties.Resources.FontBold);
        }

        public static FontFamily FontFamily
        {
            get { return s_fontCollection.Families[0]; }
        }

        public static Font GetFont(FontType type)
        {
            switch (type)
            {
                case FontType.Light:
                    return new Font(FontHelper.FontFamily, 30);

                case FontType.Bold:
                    return new Font(FontHelper.FontFamily, 30, FontStyle.Bold);

                case FontType.Custom:
                default:
                    throw new NotSupportedException("FontType 'Custom' is not supported!");
            }
        }

        /// <summary>
        /// Loads an embedded font from the specifed data.
        /// </summary>
        /// <param name="fontData">The font data to load the font from.</param>
        private static unsafe void LoadEmbeddedFont(byte[] fontData)
        {
            fixed (byte* pointer = fontData)
            {
                s_fontCollection.AddMemoryFont((IntPtr)pointer, fontData.Length);
            }
        }

        // private variables
        private static PrivateFontCollection s_fontCollection = new PrivateFontCollection();
    }
}


text:
<!DOCTYPE html>

There should be no repaint when the divs are moved vertically.

Left

Right


text:
.PHONY: test upload clean bootstrap

test:
	(. venv3/bin/activate; \
	tox; \
	)

build: clean
	(. venv3/bin/activate; \
	python3 setup.py sdist build; \
	)

release: _upload tag

_upload: test
	(. venv3/bin/activate; \
	python3 setup.py sdist upload ; \
	make clean; \
	)

tag:
	git tag v`cat bridgy/version.py | grep __version__ | awk -F"=" '{print $$2}' | sed -e 's/^[ \t]*//' | tr -d "'"` && \
	git push --tags

bootstrap3: venv3
	. venv3/bin/activate
	venv3/bin/pip install -e .
	venv3/bin/pip install --upgrade tox
	make clean

venv3:
	virtualenv -p python3 venv3
	venv3/bin/pip install --upgrade pip
	venv3/bin/pip install --upgrade setuptools

bootstrap2: venv2
	. venv2/bin/activate
	venv2/bin/pip install -e .
	venv2/bin/pip install --upgrade tox
	make clean

venv2:
	virtualenv -p python2 venv2
	venv2/bin/pip install --upgrade pip
	venv2/bin/pip install --upgrade setuptools

clean:
	rm -f MANIFEST
	rm -rf build dist


text:
<?php

namespace Brasa\InventarioBundle\Repository;

use Doctrine\ORM\EntityRepository;

/**
 * ItemRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class InvItemRepository extends EntityRepository {

    public function listaDql($strNombre = "", $strCodigo = "") {
        $dql   = "SELECT i FROM BrasaInventarioBundle:InvItem i WHERE i.codigoItemPk <> 0";
        if($strCodigo != "") {
            $dql .= " AND i.codigoItemPk = " . $strCodigo;
        }
        if($strNombre != "") {
            $dql .= " AND i.nombre like '%" . $strNombre. "%'";
        }
        $dql .= " ORDER BY i.nombre ASC";
        return $dql;
    }

}


text:
/*
 * File:   patBTMeasurementModel.cc
 * Author: jchen
 *
 * Created on May 4, 2011, 4:34 PM
 */

#include "patBTMeasurementModel.h"
#include <vector>
#include "patType.h"
#include "patTransportMode.h"
#include "patDisplay.h"
patBTMeasurementModel::patBTMeasurementModel(patMeasurement* measurement,
		const patArc* arc, TransportMode mode) :
		patMeasurementModel::patMeasurementModel(measurement, arc, mode) {
	initiate();
	double simple_value = measurement->getSimpleValue();
	m_const = arc->getLength();

	double low_proba;
	double high_proba;
	if (isPublicTransport(mode)) {
		//TODO
		low_proba = 0.18;// 0.18
		high_proba = 1.0 - low_proba;
	} else {

		low_proba = 0.60;// 0.60
		high_proba = 1.0 - low_proba;
	}

	if (simple_value < 0) {
		WARNING("WRONG BT VALUE"<<simple_value);
		m_proba = 0.0;
	}
	else if (simple_value < 1) {
		m_proba = low_proba;
	} else {
		m_proba = high_proba;
	}
}
double patBTMeasurementModel::integral(double ell) {
	return m_proba;
}
void patBTMeasurementModel::initiate() {

}


text:
HeightMap::HeightMap (const std::string& file, const glm::vec3& worldScale)
{
    if (!loadFromPNG (file, worldScale))
    {
        throw std::invalid_argument ("HeightMap::HeightMap(), unable to load from the given file location: \"" + file + "\"");
    }
}

HeightMap::HeightMap (HeightMap&& move)
{
    *this = std::move (move);
}

HeightMap& HeightMap::operator= (HeightMap&& move)
{
    if (this != &move)
    {
        m_width  = move.m_width;
        m_height = move.m_height;
        m_data   = std::move (move.m_data);
    }

    return *this;
}

///////////////
// Operators //
///////////////

const glm::vec3& HeightMap::operator[] (const size_t index) const
{
    return getPoint (index);
}

/////////////////////////
// Getters and setters //
/////////////////////////

const glm::vec3& HeightMap::getPoint (const size_t x, const size_t y) const
{
    // Ensure we are accessing valid data.
    assert (x + y * m_width < m_data.size());

    return m_data[x + y * m_width];
}

const glm::vec3& HeightMap::getPoint (const size_t index) const
{
    // Ensure we are accessing valid data.
    assert (index < m_data.size());

    return m_data[index];
}

bool HeightMap::loadFromPNG (const std::string& file, const glm::vec3& worldScale)
{
    // Ensure valid parameters!
    assert (worldScale.x != 0.f && worldScale.y != 0.f && worldScale.z != 0.f);

    // Load the height map, we only handle 8-bit per colour (256 possible values).
    const auto heightMap = tygra::imageFromPNG (file);

    if (heightMap.containsData() && heightMap.bytesPerComponent() == 1)
    {
        // Calculate the amount of data we need to create and update our member variables.
        m_width      = heightMap.width();
        m_height     = heightMap.height();
        m_worldScale = worldScale;

        m_data.reserve (m_width * m_height);

        // The width and height must be divisible by four for the height map to be valid.
        assert (m_width % 4 == 0 && m_height % 4 == 0);

        // Create the heightmap from the image data.
        auto       image    = (const uint8_t*) heightMap.pixels();

        const auto channels  = heightMap.componentsPerPixel();
        const auto maxValues = glm::vec3 (m_width - 1, 255.f * channels, m_height - 1);

        for (auto z = 0U; z < m_height; ++z)
        {
            for (auto x = 0U; x < m_width; ++x)
            {
                // Use all colour channels, this gives a potential 1021 steps instead of 256 steps of height.
                auto accumlator = 0U;

                for (auto i = 0U; i < channels; ++i)
                {
                    // Ideally this would use every channel in the image but unfortunately the ICA would have me place
                    // a silly if statement here so that we only obtain the red channel.
                    if (i == 0)
                    {
                        accumlator += *image;
                        accumlator *= channels;
                    }

                    // Ideal solution here:
                    // accumlator += *image;
                    ++image;
                }

                // Normalise the X, Y and Z values to get scaled co-ordinates.
                const auto coordinates = glm::vec3 (x          / maxValues.x,
                                                    accumlator / maxValues.y,
                                                    z          / maxValues.z);

                // Put it all together and you get the world position!
                const auto position = coordinates * m_worldScale;

                // Update the internal data and increment the pointer.
                m_data.push_back (position);
            }
        }

        return true;
    }

    return false;
}


text:
import React, { PropTypes, Component } from 'react';
import withStyles from '../../decorators/withStyles';
import styles from './ListDisplay.css';

@withStyles(styles)
class ProductRow extends Component {
  render() {
    var name = this.props.product.stocked ?
      this.props.product.name :

                {this.props.product.name}
            ;
    return (

        {name}
        {this.props.product.price}

    );
  }
}

export default ProductRow;


text:
{{-- closure function column type --}}
@php
    $column['escaped'] = $column['escaped'] ?? false;
    $column['text'] = $column['function']($entry);
    $column['prefix'] = $column['prefix'] ?? '';
    $column['suffix'] = $column['suffix'] ?? '';

    if(!empty($column['text'])) {
        $column['text'] = $column['prefix'].$column['text'].$column['suffix'];
    }
@endphp

<span>
    @includeWhen(!empty($column['wrapper']), 'crud::columns.inc.wrapper_start')
        @if($column['escaped'])
            {{ $column['text'] }}
        @else
            {!! $column['text'] !!}
        @endif
    @includeWhen(!empty($column['wrapper']), 'crud::columns.inc.wrapper_end')
</span>


text:
layout: post
title: "Baby Registry"
date: 2007-11-04 14:42:37
---
We have started a [Baby Registry for Baby T](http://www.toysrus.com/registry/index.jsp). We're registered at Babies-R-Us. We'll happy accept any presents you buy for Baby T.


text:
class ReportExceptionJob < Struct.new(:exception)
  def self.schedule(exception)
    Delayed::Job.enqueue ReportExceptionJob.new(exception)
  end

  def perform
    Rollbar.report_exception exception
  end
end


text:
package pusherclient.huvuddator.se.pusherclient;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;

import org.json.JSONArray;
import org.json.JSONObject;

import java.net.URL;
import java.util.Scanner;

/**
 * Created by Simon on 2015-08-22.
 */
public class Command {

	private final static String GOOGLE_DRIVE_COMMAND_FILE = "0B2JjHFhi0l1EczhkOVB3U2VWZUE";

	public interface CommandListener {
		public void onResult(JSONArray commands);
	}

	public static void get(final CommandListener commandListener) {
		new Thread(new Runnable() {
			@Override public void run() {
				try {
					Scanner sc = new Scanner(
							new URL("https://drive.google.com/uc?export=download&id=" + GOOGLE_DRIVE_COMMAND_FILE)
									.openConnection().getInputStream());
					String jsonString = "";
					while (sc.hasNext()) {
						jsonString += sc.nextLine();
					}
					final JSONArray jsonArray = new JSONArray(jsonString);
					commandListener.onResult(jsonArray);
				} catch (Exception e) {
				}
			}
		}).start();
	}

	public static View createCommandControlViews(JSONArray commands, final Context context) {
		ViewGroup contentHolder = (ViewGroup) LayoutInflater.from(context).inflate(R.layout.widget, null);
		LinearLayout buttonHolder = null;
		for(int i = 0; i < commands.length(); i++) {
			if(i%2 == 0) {
				buttonHolder = new LinearLayout(context);
			}

			Button button = new Button(context);
			final JSONObject command = commands.optJSONObject(i);
			String commandName = command.optString("name");
			button.setText(commandName);
			button.setTag(commandName);
			button.setOnClickListener(new View.OnClickListener() {
				@Override public void onClick(View v) {
					PusherService.send("android", command.toString(), context);
				}
			});
			buttonHolder.addView(button);

			if(i%2 == 1) {
				contentHolder.addView(buttonHolder);
			}
		}
		return contentHolder;
	}
}


text:
.form-main-search .input-group .form-control {
    float: none;
}

.form-main-search .input-group select.form-control {
    width: 96%;
}

.pagination-centered{
    text-align:center;

}


text:
package com.navercorp.pinpoint.profiler.modifier.db.dbcp;

/**
 * @author emeroad
 */
public class DBCPScope {
    public static final String SCOPE_NAME = "JDBCScope.dbcp";
}


text:
fanci
=====

[![Build Status](https://travis-ci.org/liip/fanci.svg?branch=master)](https://travis-ci.org/liip/fanci)
[![Dependency Status](https://david-dm.org/liip/fanci.svg)](https://david-dm.org/liip/fanci)
[![devDependency Status](https://david-dm.org/liip/fanci/dev-status.svg)](https://david-dm.org/liip/fanci#info=devDependencies)

[![NPM](https://nodei.co/npm/fanci.png)](https://nodei.co/npm/fanci/)

Fanci is a lightweight node module to extract a subsets (using `extract()`), rename keys (using `rename()`) or tranform the structure (using `transform()`) of a JSON based on a template.

The initial goal was to consume a large JSON from an external API, and extract a smaller JSON with only the relevant fields.
Unfortunately the available solutions did not really solve this problem (e.g.  [json-path][json-path], [jsont][jsont], [json2json][json2json], [JSONStream][jsonstream], ...), at least not up to this level that we needed.

* `extract()` does not change the original structure of the object, it extracts a subset of its keys
* `rename()` does not change the original structure of the object, it can rename keys. All not renamed keys remain the same.
* `transform()` changes the structure of the object, only the defined keys will be in the resulting object

All these methods take a source object as their first parameter and a template as their second. The template defines how the resulting JSON looks like.

## Usage

Using `fanci` is very easy. All you need is your original JSON and a template which defines whats to do.
You can find more examples in the example and test directory.

### `extract` keys from JSON

```javascript
var fanci = require('fanci');

var original = {
    "products": {
        "1234": {
            "id": 1234,
            "internal_id": "X04BEEF",
            "name": "The Beef",
            "status": {
                "available": true
            },
            "delivery": {
                "company": "My Transport",
                "rate": "business_hour",
                "time": "daily"
            }
        },
        "4567": {
            "id": 4567,
            "internal_id": "X08CAFE",
            "name": "El Coffee",
            "status": {
                "available": true
            },
            "delivery": {
                "company": "Ayayay",
                "rate": "weekend",
                "time": "weekend"
            }
        }
    }
};

var template = {
    'products': {
        '*': {
            'id': true,
            'name': true
        }
    }
}
var target = fanci.extract(original, template);
```

#### Result

`target` now contains the JSON with the fields from the template:

```javascript
{
    "products": {
        "1234": {
            "id": 1234,
            "name": "The Beef"
        },
        "4567": {
            "id": 4567,
            "name": "El Coffee"
        }
    }
}
```

#### Template

The given JSON is compared to the template JSON. The structure can not be changed, i.e. each level in the original has its equivalent in the template.
If the template does not specify deeper levels, the original JSON is transfered.

```javascript
{
    'pic': {
        'id': true,
        'date': true,
        'author': { // from the 'author' object only 'name' is extracted
            'name': true
        },
        'urls': true // if 'urls' is an object, the whole object is extracted
    }
}
```

When dealing with arrays you can specify single array positions as object keys.

```javascript
{
    'posts': { // here only the 3rd and 8th item from the posts array are extracted
        '2': true // the whole object is extracted
        '7': { // only the comments field containing the first comment is extracted
            'comments': {
                '0': true
            }
        }
    }
}
```

### `rename` keys from JSON

```javascript
var fanci = require('fanci');

var original = {
    "products": {
        "1234": {
            "name": "The Beef",
            "status": {
                "available": true
            },
            "delivery": {
                "company": "My Transport",
                "time": "daily"
            }
        },
        "4567": {
            "name": "El Coffee",
            "status": {
                "available": true
            },
            "delivery": {
                "company": "Ayayay",
                "time": "weekend"
            }
        }
    }
};

var template = {
    'stock': ['products', {
        '*': {
            'transport': 'delivery',
            'status': {
                'in_stock': 'available'
            }
        }
    }]
}
var target = fanci.rename(origial, template);
```

#### Result

`target` now contains the JSON with the renamed keys from the template:

```javascript
{
    "stock": {
        "1234": {
            "name": "The Beef",
            "status": {
                "in_stock": true
            },
            "transport": {
                "company": "My Transport",
                "time": "daily"
            }
        },
        "4567": {
            "name": "El Coffee",
            "status": {
                "in_stock": true
            },
            "transport": {
                "company": "Ayayay",
                "time": "weekend"
            }
        }
    }
}
```

#### Template

In the template the new names are defined. For each new name, the old key has to be given as its value. To be able to change parent keys for objects and array, the template supports arrays to define the new names of the keys. That way arbitrary structures can processed.

```javascript
{
    'books': {
        'id': 'identifier', //rename key 'identifier' to 'id'
        'writer': ['author', { //rename 'author' to 'writer' AND specify further rules for the next level
            'name': 'title' // rename the authors 'title' property to 'name'
        }]
    }
}
```

When dealing with arrays you can specify single array positions as object keys.

```javascript
{
    'posts': { // here only the 3rd and 8th item from the posts array are renamed
        '2': {
            'name': 'fullname'
        },
        '7': {
            'name': 'firstname'
        }
    }
}
```

### `transform` the structure of a JSON

```javascript
var fanci = require('fanci');

var original = {
    "products": {
        "1234": {
            "id": 1234,
            "internal_id": "X04BEEF",
            "name": "The Beef",
            "status": {
                "available": true
            },
            "delivery": {
                "company": "My Transport",
                "rate": "business_hour",
                "time": "daily"
            }
        },
        "4567": {
            "id": 4567,
            "internal_id": "X08CAFE",
            "name": "El Coffee",
            "status": {
                "available": true
            },
            "delivery": {
                "company": "Ayayay",
                "rate": "weekend",
                "time": "weekend"
            }
        }
    }
};

var template = {
    'id': 'products.1234.internal_id',
    'company': 'products.4567.delivery.company',
    'name': [
        'products.6789.name',
        function(value) {
            return value.toUpperCase();
        }
    ],
    'available': 'products.*.status.available'
}
var target = fanci.transform(origial, template);
```

#### Result

`target` now contains the JSON with the fields from the template:

```javascript
{
    "id": "X04BEEF",
    "company": "Ayayay",
    "name": "LIFE PRODUCT",
    "available": [
        true,
        true
    ]
}
```

#### Template

The template defines the new structure of the resulting object. The values are _paths_ in the original JSON. Like that, it is possible to select nested elements and to put them in a new strucutre. By using the asteriks all elements of a level are considered. The resulting array in flattend or even removed completly if it only contains one item.
It is possible to specify a format function to be applied to the object extracted from the path. This opens new possibilities to generate more complex structures. To do this, you have to specify an array instead of the path string, the first element is the path string, the second one is a function that takes the extracted object as an argument.
If the second element is not a function, it is assumed that you wanted to construct an array in the resulting object.

```javascript
{
    'pics': {
        'id': 'pics.id',
        'dates': [
            'pics.1.date',
            'pics.3.date',
            'pics.5.date',
        ],
        'authors': 'pics.*.author.name'
    },
    'date': [
        'Date',
        function(value) {
            return new Date(value);
        }
    ]
}
```

### Special meaning of the `*` character

The asterisk (`*`) has a special meaning in the template:

1. It means to use all keys from one level, this is useful when your JSON contains arbitrary keys

    ```javascript
    {
        'products': {
            '*': { // all keys below products are taken, but only with the 'name' key
                'name': true
            }
        }
    }
    ```
2. For arrays the asterisk represents all array elements

    ```javascript
    {
        'docs': {
            '*': { // if docs is an array, '*' ensures that all elements are extracted
                'author': true
            }
        }
    }
    ```

3. The same applies in the "path" that is used for `transform()`

    ```javascript
    {
        'authors': 'docs.*.author'
    }
    ```

4. In fact you can use * as a wildcard in the "path"

    ```javascript
    {
        // returns properties like 'name', 'my_name' or 'name_of_product' of products with ids starting with 4 and ending with 7 (e.g. 4567)
        'ids': 'products.4*7.*name*'
    }
    ```

## Tests

To run the tests simply use the following command:

```bash
npm test
```

## Release

To create a new release follow these steps:

1. Update the version number in `package.json`
1. Update the `CHANGELOG.md`
1. Create a [new release/tag on GitHub](https://github.com/liip/fanci/releases)
1. Publish the release with npm: `npm publish`

[json-path]: https://github.com/flitbit/json-path
[jsont]: https://github.com/CamShaft/jsont
[json2json]: https://github.com/joelvh/json2json
[jsonstream]: https://github.com/dominictarr/JSONStream


text:
package com.bagri.rest;

import org.junit.Test;

public class BagriRestServerTest {

	@Test
	public void testRestServer() throws Exception {
		//
    	BagriRestServer server = new BagriRestServer();
        try {
            server.start();
            // do something
            Thread.sleep(10000);
        } finally {
            server.stop();
        }
	}

}


text:
/**********************************************************************************************
 *
 *                       VALIDATION TEST METHOD : AURA
 *
 *  To launch test, please pass two arguments URL (BASE URL)  and TYPE_CC ( CB,VI,MC )
 *
/**********************************************************************************************/

var paymentType = "HiPay Enterprise Aura";

casper.test.begin('Test Checkout ' + paymentType + ' with ' + typeCC, function(test) {
    // phantom.clearCookies();

    casper.on('url.changed', function(url) {
        test.comment(url);
    });

    casper.start(baseURL + "admin/")
     .then(function() {
         this.logToBackend();
         method.proceed(test, paymentType, "aura");
     })
     .then(function() {
         this.setCurrencySetup('BRL');
     })
    .thenOpen(baseURL, function() {
        this.selectItemAndOptions();
    })
    .then(function() {
        this.addItemGoCheckout();
    })
    .then(function() {
        this.checkoutMethod();
    })
    .then(function() {
        this.billingInformation("BR");
    })
    .then(function() {
        this.shippingMethod();
    })
    .then(function() {
        this.choosingPaymentMethod('method_hipay_aura');
    })
    .then(function() {
        this.waitUntilVisible('div#payment-buttons-container>button', function success() {
            this.fillSelectors("form#co-payment-form", {
                'input[name="payment[national_identification_number]"]': generatedCPF
            }, false);
            this.click("div#payment-buttons-container>button");
            test.info("Done");
        }, function fail() {
            test.assertVisible("div#payment-buttons-container>button", "Button payment");
        }, 2000);
    })
    .then(function() {
        this.orderReview(paymentType);
    })
    .then(function() {
        this.echo("Filling payment page...", "INFO");
        this.waitForUrl(/payment$/, function success() {
             this.click('input[name="btnSubmit"]');
             this.waitUntilVisible(x('//h2[text()="Payment resume"]'), function success() {
                 this.click('input#optStatusAccepted');
                 this.click('input#btnConfirmPayment');
                 this.waitForSelector('input#new-sexy-button', function success() {
                     this.click('input#new-sexy-button');
                     test.info("Done");
                 }, function fail() {
                     test.assertVisible('input#new-sexy-button', "Transaction informations alert exists");
                 },20000);
             }, function fail() {
                 test.assertVisible(x('//h2[text()="Payment resume"]'), "Modal window 'Payment resume' exists");
             });
         }, function fail() {
             test.comment(this.currentUrl);
             this.thenOpen("https://sandbox.astropaycard.com/test_bank/payment", function() {
                 this.wait(2000, function() {
                     this.capture(pathErrors + 'ok.png');
                 });
             });
              test.assertUrlMatch(/payment$/, "AURA payment page exists");
         }, 15000);
    })
    .then(function() {
        this.echo("Checking order success...", "INFO");
        this.waitForUrl(/retorno/, function success() {
            test.assertHttpStatus(200, "Correct HTTP Status Code 200");
            this.setOrderId(false);
        }, function fail() {
            this.echo("Success payment page doesn't exists. Checking for pending payment page...", 'WARNING');
                test.assertUrlMatch(/retorno/, "Checkout result page exists");
        }, 10000);
    })
    .thenOpen(baseURL + 'admin/', function() {
        this.logToBackend();
    })
    .then(function() {
        this.setCurrencySetup('EUR');
    })
    .run(function() {
        test.done();
    });
});


text:
Title: Using docker as a self contained and portable development environment
Lead: Use docker to build and debug ASP.NET Core apps
Published: 2019-02-12
Tags:
- .NET Core
- ASP.NET
- C#
- HTTP
- docker
- microservices
---

### Why would I want to do this?
As a developer, when I want to try a new tech stack, the first thing to do is to setup a development environment including (but not limited to):
- Install the SDK and runtime
- An editor to write code
- setup code, compile, debug cycle

I would also want to set this up as quickly as possible without breaking anything already on my computer. This is where a containerised development environment trumps other options: all you need to do is to get the docker image and off you go!

### Instructions
- On github: https://github.com/dotnet/dotnet-docker/blob/master/samples/aspnetapp/aspnet-docker-dev-in-container.md
- [Stackoverflow answer](https://stackoverflow.com/a/54638389/190476) Setting up ports and other settings

### References
- [Microservices with .NET core](https://dotnet.microsoft.com/learn/web/microservices-architecture)


text:
require "shellwords"

class Masticate::Cook < Masticate::Base
  def initialize(filename)
    @filename = filename
  end

  def cook(opts)
    standard_options(opts)

    recipefile = opts[:recipe] or raise "missing recipe for cook"
    recipe = File.read(recipefile).lines
    standard_options(opts)

    # ignore blank lines in recipe file
    steps = recipe.grep(/\S/).map do |step|
      argv = Shellwords.split(step)
      masticator = Masticate::MyOptionParser.new
      command, options = masticator.parse(argv)
      masticator.prepare(command, options)
    end

    @output_count = 0
    headers = nil
    with_input do |input|
      while line = get
        row = CSV.parse_line(line, csv_options)

        steps.each do |step|
          if row
            if step.class == Masticate::Mender
              row = step.crunch(row, line, csv_options)
            else
              row = step.crunch(row)
            end
          end
        end

        emit(row) if row
      end
    end
    more_rows = []
    steps.each do |step|
      if more_rows.any?
        more_rows = more_rows.map {|row| step.crunch(row)}
      else
        step.crunch(nil) {|row| more_rows << row}
      end
    end
    more_rows.each {|row| emit(row)}

    @output.close if opts[:output]

    {
      :input_count => @input_count,
      :output_count => @output_count
    }
  end
end


text:
SVN_BASE_URL="http://svn.fr-wd.com";

case $1 in
    '--help')
        echo 'SVN Make Diff Tool version 0.1'
        echo "Usage: $0 RepositoryPath \"rev1 rev 2 revN\" OutputFolder"
        echo
        echo ' --help               This page'
        echo
        exit;;
esac

svnUrl="$SVN_BASE_URL/$1"
revisions=$2;
folder=$3;

rm -Rf $folder;
mkdir $folder;

for revision in $revisions;
do
    prevRevision=$revision;
    let prevRevision-=1;
    svn diff $svnUrl@$prevRevision $svnUrl@$revision > $folder/$revision.diff;
done


text:
package org.unidal.cat.message.storage;

import java.io.IOException;
import java.util.Map;

import com.dianping.cat.message.internal.MessageId;

public interface Index {

	public void close();

	public MessageId find(MessageId from) throws IOException;

	public void initialize(String domain, String ip, int hour) throws IOException;

	public void map(MessageId from, MessageId to) throws IOException;

	public void maps(Map<MessageId, MessageId> maps) throws IOException;
}