text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

	<title>Brio Web App - Bootstrap Admin Template + AngularJS</title>

	<meta name="description" content="">
	<meta name="author" content="Akshay Kumar">

	<link rel="stylesheet" href="assets/css/bootstrap/bootstrap.css" />

    <link href='http://fonts.googleapis.com/css?family=Raleway:400,500,600,700,300' rel='stylesheet' type='text/css'>

    <link rel="stylesheet" href="assets/css/app/app.v1.css" />

Akshay Kumar

                  <button class="btn btn-xs dropdown-toggle btn-rounded" type="button" data-toggle="dropdown" aria-expanded="true">
                     Available
                  </button>

 Busy

 Invisible

 Sign out

Dashboard

 Widgets & Apps

Email

Timeline

Calendar

Notes

File Browser

 UI Elements

General Elements

Buttons

Icons

Typography

Grid

Panels

 Forms

General Elements

Form Validation

Wysihtml

File Upload

Image Crop

 Table & Grid

Basic Tables

Data Table

 Charts

Chart Variants

Gauges

Vector Maps

Range Selector

 Plugins & More

404 Page

Invoice

File Manager

Google Maps

Signin

Signup

Search

Full Screen

Blank Page

            <button type="button" class="navbar-toggle pull-left">
                Toggle navigation

            </button>

            <form role="search" class="navbar-left app-search pull-left hidden-xs">
              <input type="text" placeholder="Enter keywords..." class="form-control form-control-circle">
         	</form>

Link

                  Dropdown

Action

Another action

Something else here

Separated link

One more separated link

 7

                      	Messages

Lorem ipsum dolor sit consect....

                                23 Sec ago

Nunc elementum, enim vitae

                                23 Sec ago

Praesent lacinia, arcu eget

                                23 Sec ago

In mollis blandit tempor.

                                23 Sec ago

                            View All Messages

3

                      	Notification

Installing App v1.2.145% Done

                                45% Complete

                            Fusce dapibus molestie tincidunt. Quisque facilisis libero eget justo iaculis

Server Status

                                35% Complete (success)

                                20% Complete (warning)

                                10% Complete (danger)

                              Danger

Lorem ipsum dolor sit consect..

Server Status

                                60% Complete (warning)

                        	More Apps

Messages

Events

Chatting

Folders

Task

Favorites

Typography Much more

Heading

h1. Bootstrap heading Secondary text

Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.

h2. Bootstrap heading Secondary text

Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.

h3. Bootstrap heading Secondary text

Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.

h4. Bootstrap heading Secondary text

Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.

h5. Bootstrap heading Secondary text

Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.

h6. Bootstrap heading Secondary text

Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.

Blockquote

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

                              Someone famous in Source Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

                              Someone famous in Source Title

Description

Description lists

A description list is perfect for defining terms.

Euismod

Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.

Donec id elit non mi porta gravida at eget metus.

Malesuada porta

Etiam porta sem malesuada magna mollis euismod.

Description lists

A description list is perfect for defining terms.

Euismod

Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.

Donec id elit non mi porta gravida at eget metus.

Malesuada porta

Etiam porta sem malesuada magna mollis euismod.

Felis euismod semper eget lacinia

Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.

Addresses

                        	<address>
                              Twitter, Inc.

                              795 Folsom Ave, Suite 600

                              San Francisco, CA 94107

                              P: (123) 456-7890
                            </address>

                            <address>
                              Full Name

                              first.last@example.com
                            </address>

Body copy

Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.

Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec ullamcorper nulla non metus auctor fringilla. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Donec ullamcorper nulla non metus auctor fringilla.

Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Duis mollis, est non commodo luctus.

Inline text elements

You can use the mark tag to highlight text..

This line of text is meant to be treated as deleted text.

This line of text is meant to be treated as an addition to the document.

This line of text is meant to be treated as fine print.

rendered as italicized text

Colors

Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.

Nullam id dolor id nibh ultricies vehicula ut id elit.

Duis mollis, est non commodo luctus, nisi erat porttitor ligula.

Maecenas sed diam eget risus varius blandit sit amet non magna.

Etiam porta sem malesuada magna mollis euismod.

Donec ullamcorper nulla non metus auctor fringilla.

Nullam id dolor id nibh ultricies vehicula ut id elit.

Duis mollis, est non commodo luctus, nisi erat porttitor ligula.

Maecenas sed diam eget risus varius blandit sit amet non magna.

Etiam porta sem malesuada magna mollis euismod.

Donec ullamcorper nulla non metus auctor fringilla.

List

Integer molestie lorem at massa

Facilisis in pretium nisl aliquet

Nulla volutpat aliquam velit

Phasellus iaculis neque

Purus sodales ultricies

Ac tristique libero volutpat at

Faucibus porta lacus fringilla vel

Aenean sit amet erat nunc

Eget porttitor lorem

Lorem ipsum dolor sit amet

Consectetur adipiscing elit

Integer molestie lorem at massa

Facilisis in pretium nisl aliquet

Facilisis in pretium nisl aliquet

Nulla volutpat aliquam velit

Phasellus iaculis neque

Purus sodales ultricies

Vestibulum laoreet porttitor sem

Faucibus porta lacus fringilla vel

        	Copyright © 2014 FreakPixels


text:
$UserName = "DOMAIN\USER"
$EncryptedPassword  = "..."

# HOWTO create encrypted password?
# $SecurePassword = $password | ConvertTo-SecureString -AsPlainText -Force
# $EncryptedPassword = ConvertFrom-SecureString -SecureString $SecurePassword

$SecurePassword = ConvertTo-SecureString -String $EncryptedPassword
$Credentials = New-Object System.Management.Automation.PSCredential -ArgumentList $UserName, $SecurePassword

$serv = New-PSSession -ComputerName vm-winsrv-test -Credential $Credentials

"### Connecting at $(Get-Date)"
Invoke-Command -Session $serv -ScriptBlock {
  "### Connected to $env:username@$env:computername"

  "### Copying latest release of ..."
  Copy-Item Y:\latest_release\* c:\tmp\

  "### Running scripts"
  # . Y:\scripts\script.ps1   # UNCOMMENT THIS

  # TODO Service actions
}

"### Done at $(Get-Date)"

redpajama_set_name: RedPajamaGithub


text:
use pact_matching::models::*;
use pact_matching::models::matchingrules::{MatchingRules, Category};
use std::collections::HashMap;

use prelude::*;
use util::GetDefaulting;

/// Builder for `Response` objects. Normally created via `PactBuilder`.
pub struct ResponseBuilder {
    response: Response,
}

impl ResponseBuilder {
    /// Set the status code for the response. Defaults to `200`.
    ///
    /// ```
    /// use pact_consumer::builders::ResponseBuilder;
    /// use pact_consumer::prelude::*;
    ///
    /// let response = ResponseBuilder::default().status(404).build();
    /// assert_eq!(response.status, 404);
    /// ```
    pub fn status(&mut self, status: u16) -> &mut Self {
        self.response.status = status;
        self
    }

    // This is a partial list of popular HTTP status codes. If you use any
    // others regularly, feel free to add them.

    /// Set the status code to `200 OK`. (This is default.)
    pub fn ok(&mut self) -> &mut Self {
        self.status(200)
    }

    /// Set the status code to `201 Created`.
    pub fn created(&mut self) -> &mut Self {
        self.status(201)
    }

    /// Set the status code to `204 No Content`.
    pub fn no_content(&mut self) -> &mut Self {
        self.status(204)
    }

    /// Set the status code to `401 Unauthorized`.
    pub fn unauthorized(&mut self) -> &mut Self {
        self.status(401)
    }

    /// Set the status code to `403 Forbidden`.
    pub fn forbidden(&mut self) -> &mut Self {
        self.status(403)
    }

    /// Set the status code to `404 Not Found`.
    pub fn not_found(&mut self) -> &mut Self {
        self.status(404)
    }

    /// Build the specified `Response` object.
    pub fn build(&self) -> Response {
        let mut result = self.response.clone();
        result
    }
}

impl Default for ResponseBuilder {
    fn default() -> Self {
        ResponseBuilder { response: Response::default_response() }
    }
}

impl HttpPartBuilder for ResponseBuilder {
    fn headers_and_matching_rules_mut(&mut self) -> (&mut HashMap<String, String>, &mut MatchingRules) {
        (
            self.response.headers.get_defaulting(),
            &mut self.response.matching_rules,
        )
    }

    fn body_and_matching_rules_mut(&mut self) -> (&mut OptionalBody, &mut MatchingRules) {
        (
            &mut self.response.body,
            &mut self.response.matching_rules,
        )

    }
}


text:
class PhotoGallery
  include Mongoid::Document
  include Mongoid::Timestamps
  include Mongoid::History::Trackable
  include RelatesObjectTags

  embeds_many :gallery_photos, as: :exhibitable

  track_history on: :fields, track_create: true, track_update: true, track_destroy: true

  field :title, type: String
  field :slug, type: String

  validates_presence_of :title, :slug
  validates_uniqueness_of :title, :slug

  scope :custom_search, -> query {
    begin
      if query.present?
        q = ::Regexp.new(query.to_s, ::Regexp::IGNORECASE)
        any_of({title: q})
      end
    rescue ::RegexpError
      PhotoGallery.none
    end
  }
end


text:
namespace LionFire.Events
{
    public interface ISenderValueChanged<out TSender, out TValue> : IValueChanged<TValue>
    {
        TSender Sender { get; }
    }
}


text:
<?php

/**
 * This file is part of the Nextras\Orm library.
 * @license    MIT
 * @link       https://github.com/nextras/orm
 */

namespace Nextras\Orm\Entity;

use Nextras\Orm\Collection\IEntityPreloadContainer;
use Nextras\Orm\NotSupportedException;

/**
 * @property int|NULL $id
 */
class Entity extends AbstractEntity implements IEntity
{
	/** @var IEntityPreloadContainer */
	private $preloadContainer;

	public function setPreloadContainer(IEntityPreloadContainer $overIterator = NULL)
	{
		$this->preloadContainer = $overIterator;
		return $this;
	}

	public function getPreloadContainer()
	{
		return $this->preloadContainer;
	}

	public function & __get($name)
	{
		$var = $this->getValue($name);
		return $var;
	}

	public function __set($name, $value)
	{
		$this->setValue($name, $value);
	}

	public function __isset($name)
	{
		return $this->hasValue($name);
	}

	public function __unset($name)
	{
		throw new NotSupportedException;
	}

	public function __clone()
	{
		parent::__clone();
		$this->preloadContainer = NULL;
	}

	public function serialize()
	{
		return serialize(parent::serialize());
	}

	public function unserialize($serialized)
	{
		parent::unserialize(unserialize($serialized));
	}

}


text:
import * as React from "react";
import { connect } from "react-redux";
import { Resizer, Size } from "../components/Resizer";
import { Editor, SyntaxError as EditorError } from "../components/Editor";
import { Nav, NavItem } from "../components/Nav";
import { SaveOrCancel, SaveOrCancelResult } from "../components/dialogs";
import { throttle } from "../../common/event";
import { tabAction, editorAction } from "../actions";
import { AppState, SyntaxError, PlayGround } from "../states";
import { getEditor, getMeta } from "../selectors/playGround";

export interface TabEditorValues {
    currentKey?: string;
    text?: string;
    baseName?: string;
    ground?: PlayGround;
}

export interface TabEditorActions {
    onTextChange?: (key: string, text: string) => void;
    onSyntaxError?: (key: string, errors?: SyntaxError[]) => void;
    onTabChange?: (key: string) => void;
    onTabClose?: (key: string) => void;
}

export type TabEditorProps = TabEditorValues & TabEditorActions;

interface LocalState {
    editorAreaSize: { width: number | string, height: string | number };
    showDialog: boolean;
}

export class TabEditor extends React.Component<TabEditorProps, LocalState> {

    constructor(props?: any, context?: any) {
        super();
        this.state = {
            editorAreaSize: { width: "100%", height: "100%" },
            showDialog: false,
        };
    }

    private openDialog() {
        this.setState((prevState) => ({
            editorAreaSize: prevState.editorAreaSize,
            showDialog: true,
        }));
    }

    private closeDialog() {
        this.setState((prevState) => ({
            editorAreaSize: prevState.editorAreaSize,
            showDialog: false,
        }));
    }

    private throttledTextChange: (index: string, newText: string, errors?: SyntaxError[]) => void;
    private onDialogSelect: (r: SaveOrCancelResult) => void;

    public componentWillMount() {
        this.throttledTextChange = throttle(this.props.onTextChange, 50);
        this.onDialogSelect = (r) => { return; };
    }

    public componentWillUnmount() {
        this.throttledTextChange = null;
        this.onDialogSelect = null;
    }

    private onChange(newText: string) {
        this.throttledTextChange(this.props.currentKey, newText);
    }

    private onError(errors: EditorError[]) {
        if (this.props.onSyntaxError) {
            this.props.onSyntaxError(this.props.currentKey, errors);
        }
    }

    private onResize(event: MouseEvent | TouchEvent, direction: string, refToElement: HTMLElement, delta: Size) {
        this.setState((prevState) => ({
            editorAreaSize: {
                width: refToElement.style.width,
                height: refToElement.style.height,
            },
            showDialog: prevState.showDialog,
        }));
    }

    private onSelect(item: NavItem) {
        if (this.props.onTabChange) {
            this.props.onTabChange(item.key);
        }
    }

    private onClose(item: NavItem) {
        if (item.isDirty) {
            this.onDialogSelect = (r: SaveOrCancelResult) => this.onDialogSelectWithItem(item, r);
            this.openDialog();
        } else {
            if (this.props.onTabClose) {
                this.props.onTabClose(item.key);
            }
        }
    }

    private onDialogSelectWithItem(item: NavItem, r: SaveOrCancelResult) {
        switch (r) {
            case SaveOrCancelResult.SAVE:
            case SaveOrCancelResult.DISCARD:
                if (this.props.onTabClose) {
                    this.props.onTabClose(item.key);
                }
            case SaveOrCancelResult.CANCEL:
            default:
        }
        this.closeDialog();
    }

    private getNavItems(): NavItem[] {
        const elements: NavItem[] = [];
        const { meta, editors } = this.props.ground;
        if (meta) {
            Object.getOwnPropertyNames(meta).map(x => {
                const text = meta[x].baseName;
                const e = editors[x];
                elements.push({
                    key: x,
                    text,
                    isClosable: true,
                    isDirty: e && e.isDirty,
                });
            });
        }
        return elements;
    }

    private renderEditor(show: boolean) {
        if (show) {
            const { text } = this.props;
            const { editorAreaSize } = this.state;
            return (
                <Editor
                    height={editorAreaSize.height}
                    width={"100%"}
                    text={text}
                    onChange={this.onChange.bind(this)}
                    onSyntaxError={this.onError.bind(this)} />);
        } else {
            return (

                    ...not open part

            );
        }
    }

    public render() {
        const { currentKey, baseName } = this.props;
        const { showDialog } = this.state;
        const items = this.getNavItems();
        return (

                <SaveOrCancel show={showDialog}
                    title={"save"}
                    message={`save ${baseName}?`}
                    onSelected={this.onDialogSelect.bind(this)} />

                <Resizer height={200} width={"auto"} minHeight={100} onResize={this.onResize.bind(this)} isResizable={{ bottom: true }} >
                    {this.renderEditor(items && items.length > 0)}
                </Resizer>

        );
    }
}

export default connect<TabEditorValues, TabEditorActions, TabEditorProps>(
    (state: AppState) => {
        const e = getEditor(state.ground);
        const m = getMeta(state.ground);
        return {
            currentKey: state.ground.currentKey,
            text: e.text || "",
            baseName: m.baseName || "",
            ground: state.ground,
        };
    },
    (dispatch) => ({
        onTextChange: (key: string, newText: string) => dispatch(editorAction.edit(key, newText)),
        onSyntaxError: (key: string, errors?: SyntaxError[]) => dispatch(editorAction.syntaxError(key, errors)),
        onTabChange: (key) => dispatch(tabAction.changeIfNeeded(key)),
        onTabClose: (key) => dispatch(tabAction.close(key)),
    }),
)(TabEditor);


text:
Requires Eyeglasses:

Yes

No

Experiment Completed:

Yes

No

        Conditions

         {{condition}}

        Participant Name
        Participant Email
        Participant Phone Number

         {{participant.name}}
         {{participant.email}}
         {{participant.phone_number}}

        Researcher Name
        Researcher Email
        Researcher Role

         {{user.displayName}}
         {{user.email}}
         {{user.roles.join(', ')}}

          Appointment Time
          Appointment Participant

          {{appointment.prettyDate}}
          {{appointment.participant.name}}

          Edit Experiment

          Delete Experiment


text:
#include <cstdint>
#include <binary_parsing/ByteStream.h>
#include <Module.h>
#include <binary_parsing/ModuleParser.h>
#include <cassert>
#include <types/Int32.h>
#include <sexpr_parsing/CharacterStream.h>
#include <sexpr_parsing/SExprParser.h>

using namespace wasm_module;
using namespace wasm_module::sexpr;

int main() {
    std::string str = ";This is a comment\n"
            " (; this is a silly comment in brackets ;)"
            "(module (memory \"langes wort\" 0 1))\n"
            ";This is another comment\n"
            "\t(module)"
            "\n(module)"
            "\n(module)";

    CharacterStream stream(str);

    SExprParser parser(stream);

    SExpr expr = parser.parse();

    assert(expr.children().size() == 4);

    assert(expr.children()[0].children().size() == 2);
    assert(expr.children()[0][0] == "module");
    assert(expr.children()[0][1].children().size() == 4);
    assert(expr.children()[0][1][0] == "memory");
    assert(expr.children()[0][1][1] == "langes wort");
    assert(expr.children()[0][1][2] == "0");
    assert(expr.children()[0][1][3] == "1");

    assert(expr.children()[1][0] == "module");
    assert(expr.children()[2][0] == "module");
    assert(expr.children()[3][0] == "module");

}


text:
using System;
using System.Text.Json;
using Azure.Core;

namespace Azure.AI.MetricsAdvisor.Models
{
    public partial class DataFeedIngestionStatus
    {
        internal static DataFeedIngestionStatus DeserializeDataFeedIngestionStatus(JsonElement element)
        {
            DateTimeOffset timestamp = default;
            IngestionStatusType status = default;
            string message = default;
            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("timestamp"))
                {
                    timestamp = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("status"))
                {
                    status = new IngestionStatusType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("message"))
                {
                    message = property.Value.GetString();
                    continue;
                }
            }
            return new DataFeedIngestionStatus(timestamp, status, message);
        }
    }
}


text:
package com.lsxiao.apollo.demo.fragment;

import android.os.Bundle;
import android.widget.TextView;

import com.lsxiao.apollo.core.annotations.Backpressure;
import com.lsxiao.apollo.core.annotations.Receive;
import com.lsxiao.apollo.core.annotations.Sticky;
import com.lsxiao.apollo.demo.R;
import com.lsxiao.apollo.demo.base.BaseDialogFragment;

import io.reactivex.BackpressureStrategy;

/**
 * author lsxiao
 * date 2016-08-23 21:01
 */
public class SubscriberDialogFragment extends BaseDialogFragment {
    public static final String TAG = "SubscriberDialogFragment";
    private TextView mTvSentStickyEvent;

    public static SubscriberDialogFragment newInstance() {

        Bundle args = new Bundle();

        SubscriberDialogFragment fragment = new SubscriberDialogFragment();
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    protected int getLayoutId() {
        return R.layout.dialog_subscriber;
    }

    @Sticky
    @Receive("sticky")
    public void onReceiveStickyEvent(String event) {
        mTvSentStickyEvent.setText(mTvSentStickyEvent.getText().toString() + event + ",");
    }

    @Override
    protected void afterCreate(Bundle savedInstanceState) {
        mTvSentStickyEvent = (TextView) mRootView.findViewById(R.id.tv_sent_sticky_event);
    }

    @Backpressure(BackpressureStrategy.DROP)
    @Receive("event")
    public void onReceiveEvent(String event) {
        mTvSentStickyEvent.setText(mTvSentStickyEvent.getText().toString() + event + ",");
    }
}


text:
"""Models relating to configuration properties and platform parameters."""

from __future__ import absolute_import  # pylint: disable=import-only-modules
from __future__ import unicode_literals  # pylint: disable=import-only-modules

import core.storage.base_model.gae_models as base_models

from google.appengine.ext import ndb

class ConfigPropertySnapshotMetadataModel(
        base_models.BaseSnapshotMetadataModel):
    """Storage model for the metadata for a config property snapshot."""

    pass

class ConfigPropertySnapshotContentModel(base_models.BaseSnapshotContentModel):
    """Storage model for the content for a config property snapshot."""

    pass

class ConfigPropertyModel(base_models.VersionedModel):
    """A class that represents a named configuration property.

    The id is the name of the property.
    """

    SNAPSHOT_METADATA_CLASS = ConfigPropertySnapshotMetadataModel
    SNAPSHOT_CONTENT_CLASS = ConfigPropertySnapshotContentModel

    # The property value.
    value = ndb.JsonProperty(indexed=False)

    @staticmethod
    def get_deletion_policy():
        """ConfigPropertyModel is not related to users."""
        return base_models.DELETION_POLICY.NOT_APPLICABLE

    @classmethod
    def get_export_policy(cls):
        """Model does not contain user data."""
        return dict(super(cls, cls).get_export_policy(), **{
            'value': base_models.EXPORT_POLICY.NOT_APPLICABLE
        })

    def commit(self, committer_id, commit_cmds):
        super(ConfigPropertyModel, self).commit(committer_id, '', commit_cmds)

class PlatformParameterSnapshotMetadataModel(
        base_models.BaseSnapshotMetadataModel):
    """Storage model for the metadata for a platform parameter snapshot."""

    pass

class PlatformParameterSnapshotContentModel(
        base_models.BaseSnapshotContentModel):
    """Storage model for the content for a platform parameter snapshot."""

    pass

class PlatformParameterModel(base_models.VersionedModel):
    """A class that represents a named dynamic platform parameter.
    This model only stores fields that can be updated in run time.

    The id is the name of the parameter.
    """

    SNAPSHOT_METADATA_CLASS = PlatformParameterSnapshotMetadataModel
    SNAPSHOT_CONTENT_CLASS = PlatformParameterSnapshotContentModel

    rules = ndb.JsonProperty(repeated=True)
    rule_schema_version = ndb.IntegerProperty(required=True, indexed=True)

    @staticmethod
    def get_deletion_policy():
        """PlatformParameterModel is not related to users."""
        return base_models.DELETION_POLICY.NOT_APPLICABLE

    @classmethod
    def get_export_policy(cls):
        """Model does not contain user data."""
        return dict(super(cls, cls).get_export_policy(), **{
            'rules': base_models.EXPORT_POLICY.NOT_APPLICABLE,
            'rule_schema_version': base_models.EXPORT_POLICY.NOT_APPLICABLE
        })

    @classmethod
    def create(cls, param_name, rule_dicts, rule_schema_version):
        """Creates a PlatformParameterModel instance.

        Args:
            param_name: str. The name of the parameter, which is immutable.
            rule_dicts: list(dict). List of dict representation of
                PlatformParameterRule objects, which have the following
                structure:
                    - value_when_matched: *. The result of the rule when it's
                        matched.
                    - filters: list(dict). List of dict representation of
                        PlatformParameterFilter objects, having the following
                        structure:
                            - type: str. The type of the filter.
                            - value: *. The value of the filter to match
                                against.
            rule_schema_version: int. The schema version for the rule dicts.

        Returns:
            PlatformParameterModel. The created PlatformParameterModel
            instance.
        """
        return cls(
            id=param_name,
            rules=rule_dicts,
            rule_schema_version=rule_schema_version)


text:
Imports System
Imports Microsoft.VisualBasic
Imports ChartDirector

Public Class rectangularmeter
    Implements DemoModule

    'Name of demo module
    Public Function getName() As String Implements DemoModule.getName
        Return "Rectangular Angular Meters"
    End Function

    'Number of charts produced in this demo module
    Public Function getNoOfCharts() As Integer Implements DemoModule.getNoOfCharts
        Return 6
    End Function

    'Main code for creating charts
    Public Sub createChart(viewer As WinChartViewer, chartIndex As Integer) _
        Implements DemoModule.createChart

        ' The value to display on the meter
        Dim value As Double = 72.55

        ' Create an AngularMeter object of size 240 x 170 pixels with very light grey (0xeeeeee)
        ' background, and a rounded 4-pixel thick light grey (0xcccccc) border
        Dim m As AngularMeter = New AngularMeter(240, 170, &Heeeeee, &Hcccccc)
        m.setRoundedFrame(Chart.Transparent)
        m.setThickFrame(4)

        ' Set the default text and line colors to dark grey (0x222222)
        m.setColor(Chart.TextColor, &H222222)
        m.setColor(Chart.LineColor, &H222222)

        ' Center at (120, 145), scale radius = 128 pixels, scale angle -60 to +60 degrees
        m.setMeter(120, 145, 128, -60, 60)

        ' Meter scale is 0 - 100, with major/minor/micro ticks every 20/10/5 units
        m.setScale(0, 100, 20, 10, 5)

        ' Set the scale label style to 14pt Arial Italic. Set the major/minor/micro tick lengths to
        ' 16/16/10 pixels pointing inwards, and their widths to 2/1/1 pixels.
        m.setLabelStyle("Arial Italic", 14)
        m.setTickLength(-16, -16, -10)
        m.setLineWidth(0, 2, 1, 1)

        ' Demostrate different types of color scales and putting them at different positions
        Dim smoothColorScale() As Double = {0, &H3333ff, 25, &H0088ff, 50, &H00ff00, 75, &Hdddd00, _
            100, &Hff0000}
        Dim stepColorScale() As Double = {0, &H00cc00, 60, &Hffdd00, 80, &Hee0000, 100}
        Dim highLowColorScale() As Double = {0, &H00ff00, 70, Chart.Transparent, 100, &Hff0000}

        If chartIndex = 0 Then
            ' Add the smooth color scale at the default position
            m.addColorScale(smoothColorScale)
        ElseIf chartIndex = 1 Then
            ' Add the smooth color scale starting at radius 128 with zero width and ending at radius
            ' 128 with 16 pixels inner width
            m.addColorScale(smoothColorScale, 128, 0, 128, -16)
        ElseIf chartIndex = 2 Then
            ' Add the smooth color scale starting at radius 70 with zero width and ending at radius
            ' 60 with 20 pixels outer width
            m.addColorScale(smoothColorScale, 70, 0, 60, 20)
        ElseIf chartIndex = 3 Then
            ' Add the high/low color scale at the default position
            m.addColorScale(highLowColorScale)
        ElseIf chartIndex = 4 Then
            ' Add the step color scale at the default position
            m.addColorScale(stepColorScale)
        Else
            ' Add the smooth color scale at radius 60 with 15 pixels outer width
            m.addColorScale(smoothColorScale, 60, 15)
        End If

        ' Add a text label centered at (120, 120) with 15pt Arial Italic font
        m.addText(120, 120, "CPU", "Arial Italic", 15, Chart.TextColor, Chart.BottomCenter)

        ' Add a red (0xff0000) pointer at the specified value
        m.addPointer2(value, &Hff0000)

        ' Add a semi-transparent light grey (0x3fcccccc) rectangle at (0, 120) and of size 240 x 60
        ' pixels to cover the bottom part of the meter for decoration
        Dim cover As ChartDirector.TextBox = m.addText(0, 120, "")
        cover.setSize(240, 60)
        cover.setBackground(&H3fcccccc)

        ' Output the chart
        viewer.Chart = m

    End Sub

End Class


text:
package org.elasticsearch.search.aggregations.metrics;

import org.elasticsearch.search.aggregations.Aggregator;
import org.elasticsearch.search.aggregations.support.AggregationContext;
import org.elasticsearch.search.aggregations.support.ValuesSourceConfig;

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

public interface ExtendedStatsAggregatorProvider {

    Aggregator build(
        String name,
        ValuesSourceConfig valuesSourceConfig,
        AggregationContext context,
        Aggregator parent,
        double sigma,
        Map<String, Object> metadata
    ) throws IOException;
}


text:
import Multiply from 'gl-mat4/multiply'

export default function updateModelView (camera, model) {
  Multiply(
    camera.modelView,
    camera.view,
    model
  )
}


text:
package com.nasageeks.upload;

/**
 * This class represent a boundary box of a layer or a map. It contains the minimum and maximum
 * values longitud and latitud of the layer or map
 * @author Olmo Zavala Romero
 */
public class BoundaryBox {

    private double minLong;//Minimum longitude
    private double maxLong;//Maximum longitude
    private double minLat;//Minimum latitude
    private double maxLat;//Maximum latitud

    /**
     * Constructor of the class. We indicate the values of each property.
     * @param {double} minLong double Minimum longitude
     * @param {double} maxLong double Maximum longitude
     * @param {double} minLat double Minimum Latitude
     * @param {double} maxLat doulbe Maximum latitude
     */
    public BoundaryBox(double minLong, double maxLong, double minLat, double maxLat) {
        this.minLong = minLong;
        this.maxLong = maxLong;
        this.minLat = minLat;
        this.maxLat = maxLat;
    }

    /**
     * This functions receives a string separated by commas with the boundary box in the following
     * order: "minLong,minLat,maxLong,maxLat"
     * @param {String} bboxstr String boundary box separated by commas
     */
    public BoundaryBox(String bboxstr) {
        this.updateByString(bboxstr);
    }

    public double getMaxLat () {
        return maxLat;
    }

    public void setMaxLat (double val) {
        this.maxLat = val;
    }

    public double getMaxLong () {
        return maxLong;
    }

    public void setMaxLong (double val) {
        this.maxLong = val;
    }

    public double getMinLat () {
        return minLat;
    }

    public void setMinLat (double val) {
        this.minLat = val;
    }

    public double getMinLong () {
        return minLong;
    }

    public void setMinLong (double val) {
        this.minLong = val;
    }

    /**
     * This function is used to convert the boundary box in a string separated by commas
     * in the format necesary for OpenLayers
     *@return String
     */
    public String toString() {
        String maxLongStr = String.valueOf(maxLong);
        String minLongStr = String.valueOf(minLong);
        String maxLatStr = String.valueOf(maxLat);
        String minLatStr = String.valueOf(minLat);
        return minLongStr+","+minLatStr+","+maxLongStr+","+maxLatStr;
    }

    /**
     * This functions receives a string separated by commas with the boundary box in the following
     * order: "minLong,minLat,maxLong,maxLat"
     * @param {String} bboxstr String boundary box separated by commas
     */
    public void updateByString(String bboxStr){
		String[] bboxTokens = bboxStr.split(",");
		this.minLong = Double.parseDouble(bboxTokens[0]);
		this.minLat = Double.parseDouble(bboxTokens[1]);
		this.maxLong = Double.parseDouble(bboxTokens[2]);
		this.maxLat = Double.parseDouble(bboxTokens[3]);
    }

}


text:
import { putResource, removeResource } from '../state/actions/resources'
import { addError } from '../state/actions/errors'
import { receiveEvents } from '../state/actions/events'

// these endpoints behave in a particularly chatty manner
const throttles = {
  'MODIFIED/Endpoints/kube-system/kube-controller-manager': 10000,
  'MODIFIED/Endpoints/kube-system/kube-scheduler': 10000,
}
const throttlePurgeInterval = 2 * 60 * 1000
const aggregationInterval = 1000

export default class MultiResourceWatcher {

  constructor(props) {

    this.props = props
    this.tries = 0
    this.dispatch = props.dispatch
    this.getState = props.getState
    this.initialize = this.initialize.bind(this)
    this.initialize()
  }

  initialize = async () => {
    let { props } = this
    let loc = window.location
    let scheme = (loc.protocol === 'https:' ? 'wss' : 'ws')
    this.onEvent = this.onEvent.bind(this)

    this.initSocket(`${scheme}://${loc.host}/proxy/_/multiwatch?resourceVersion=${this.props.maxResourceVersion}`)

    this.throttled = {}
    this.lastPurge = Date.now()
    this.events = []
    this.interval = window.setInterval(this.processEvents.bind(this), props.interval || aggregationInterval)
  }

  processEvents = () => {
    while (this.events.length) {
      let data = this.events.shift()
      if (data.object && data.object.kind === 'Event') {
        let resources = this.getState().resources.resources
        this.dispatch(receiveEvents(resources, data))
      } else {
        switch(data.type) {
          case 'ADDED':
            this.dispatch(putResource(data.object, true))
            break
          case 'MODIFIED':
            this.dispatch(putResource(data.object, false))
            break
          case 'DELETED':
            this.dispatch(removeResource(data.object))
            break
          default:
            return
        }
      }
    }
  }

  closed = () => {
    return !this.socket || this.socket.readyState === 3 || this.socket.readyState === 2
  }

  onEvent = (event) => {
    let data = this.applyThrottles(JSON.parse(event.data))
    if (!!data) {
      this.events.push(data)
    }
  }

  destroy = () => {
    this.interval && window.clearInterval(this.interval)
    this.socket && this.socket.close()
  }

  reset = () => {
    this.destroy()
    this.initialize()
  }

  reload = (url) => {
    let socket = this.socket
    if (socket) {
      socket.close()
    }
    this.initSocket(url)
  }

  initSocket = (url) => {
    let tries = (this.socket && this.socket.tries) || 0
    let socket = new WebSocket(url)
    socket.tries = tries
    let that = this
    socket.onerror = function (e) {
      if (socket.tries < 3) {
        ++socket.tries
        window.setTimeout(that.reload.bind(that, url), 3000)
      } else {
        that.dispatch(addError(e,'error',`Error occurred in watch for ${url}`))
      }
    }
    socket.onmessage = this.onEvent
    this.socket = socket
  }
  /**
   *
   */
  applyThrottles = (data) => {
    let resource = data.object
    let throttle = throttles[`${data.type}/${resource.kind}/${resource.metadata.name}/${resource.metadata.name}`] || throttles[`${data.type}/${resource.kind}`]
    if (!!throttle) {
      let key = `${resource.metadata.namespace}/${resource.kind}/${resource.metadata.name}/${data.type}`
      let lastSeen = this.throttled[key] || 0
      let now = Date.now()
      this.purgeThrottles(now)
      if ((now - lastSeen) > throttle) {
        this.throttled[key] = now
        return data
      }
      return null
    }
    return data
  }

  purgeThrottles = (now) => {
    if ((now - this.lastPurge) > throttlePurgeInterval) {
      for (let t in this.throttled) {
        let throttle = throttles[t]
        let lastSeen = this.throttled[t]
        if (now - lastSeen > throttle) {
          delete this.throttled[t]
        }
      }
      this.lastPurge = now
    }
  }
}


text:
using osu.Game.Rulesets.Edit;
using osu.Game.Rulesets.Mania.Edit.Blueprints;
using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Mania.Objects.Drawables;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Objects.Drawables;

namespace osu.Game.Rulesets.Mania.Tests
{
    public class TestSceneNotePlacementBlueprint : ManiaPlacementBlueprintTestScene
    {
        protected override DrawableHitObject CreateHitObject(HitObject hitObject) => new DrawableNote((Note)hitObject);
        protected override PlacementBlueprint CreateBlueprint() => new NotePlacementBlueprint();
    }
}


text:
<?php

namespace Slime;

use Illuminate\Database\Eloquent\Model;

class Cargo extends Model
{
    //
    protected $table = "Cargo";
    protected $fillable = ['nombre'];

}


text:
<!doctype html>

    <meta charset="utf-8">
    <title>Cloak Pong</title>

Cloak Pong

      <input class="name-field" type="text" placeholder="username">
      <button class="register-name" onclick="registerUsername()">Submit</button>

Users currently online:

Games currently online:

      <button class="toggle-create" onclick="openCreateUi()">Click here to create a game</button>

Create a game

      <input type="text" class="game-field" placeholder="room name">
      <button class="register-game" onclick="registerGame()">Create game</button>


text:
static __bit last_sent_is_resend;
static __bit last_sent_is_injected;
static __bit last_recv_is_resend;
static __bit force_resend;

static __xdata uint8_t last_received[MAX_PACKET_LENGTH];
static __xdata uint8_t last_sent[MAX_PACKET_LENGTH];
static __xdata uint8_t last_sent_len;
static __xdata uint8_t last_recv_len;

// serial speed in 16usecs/byte
static __pdata uint16_t serial_rate;

// the length of a pending MAVLink packet, or zero if no MAVLink
// packet is expected
static __pdata uint8_t mav_pkt_len;

// the timer2_tick time when the MAVLink header was seen
static __pdata uint16_t mav_pkt_start_time;

// the number of timer2 ticks this packet should take on the serial link
static __pdata uint16_t mav_pkt_max_time;

static __pdata uint8_t mav_max_xmit;

// true if we have a injected packet to send
static bool injected_packet;

// have we seen a mavlink packet?
bool seen_mavlink;

#define PACKET_RESEND_THRESHOLD 32

// check if a buffer looks like a MAVLink heartbeat packet - this
// is used to determine if we will inject RADIO status MAVLink
// messages into the serial stream for ground station and aircraft
// monitoring of link quality
static void check_heartbeat(__xdata uint8_t * __pdata buf)
{
        if ((buf[1] == 9 && buf[0] == MAVLINK10_STX && buf[5] == 0) ||
            (buf[1] <= 9 && buf[0] == MAVLINK20_STX && buf[7] == 0 && buf[8] == 0 && buf[9] == 0)) {
		// looks like a MAVLink heartbeat
		seen_mavlink = true;
	}
}

#define MSG_TYP_RC_OVERRIDE 70
#define MSG_LEN_RC_OVERRIDE (9 * 2)

#define MAVLINK_FRAMING_DISABLED 0
#define MAVLINK_FRAMING_SIMPLE 1
#define MAVLINK_FRAMING_HIGHPRI 2

// return a complete MAVLink frame, possibly expanding
// to include other complete frames that fit in the max_xmit limit
static
uint8_t mavlink_frame(uint8_t max_xmit, __xdata uint8_t * __pdata buf)
{
	__data uint16_t slen;

	last_sent_len = 0;
	mav_pkt_len = 0;

	slen = serial_read_available();

	// see if we have more complete MAVLink frames in the serial
	// buffer that we can fit in this packet
	while (slen >= 8) {
		register uint8_t c = serial_peekx(0);
                register uint8_t extra_len = 8;
		if (c != MAVLINK10_STX && c != MAVLINK20_STX) {
			// its not a MAVLink packet
			return last_sent_len;
		}
                if (c == MAVLINK20_STX) {
                        extra_len += 4;
                        if (serial_peekx(2) & 1) {
                                // signed packet
                                extra_len += 13;
                        }
                }
                // fetch the length byte
		c = serial_peekx(1);
		if (c >= 255 - extra_len ||
		    c+extra_len > max_xmit - last_sent_len) {
			// it won't fit
			break;
		}
		if (c+extra_len > slen) {
			// we don't have the full MAVLink packet in
			// the serial buffer
			break;
		}

                c += extra_len;

                // we can add another MAVLink frame to the packet
                serial_read_buf(&last_sent[last_sent_len], c);
                memcpy(&buf[last_sent_len], &last_sent[last_sent_len], c);

                check_heartbeat(buf+last_sent_len);

		last_sent_len += c;
		slen -= c;
	}

	return last_sent_len;
}

#ifdef INCLUDE_AES
__xdata uint8_t len_encrypted;
#endif // INCLUDE_AES

uint8_t encryptReturn(__xdata uint8_t *buf_out, __xdata uint8_t *buf_in, uint8_t buf_in_len)
{
#ifdef INCLUDE_AES
  if (aes_get_encryption_level() > 0) {
    if (aes_encrypt(buf_in, buf_in_len, buf_out, &len_encrypted) != 0)
    {
      panic("error while trying to encrypt data");
    }
    return len_encrypted;
  }
#endif // INCLUDE_AES

  // if no encryption or not supported fall back to copy
  memcpy(buf_out, buf_in, buf_in_len);
  return buf_in_len;
}

// return the next packet to be sent
uint8_t
packet_get_next(register uint8_t max_xmit, __xdata uint8_t *buf)
{
	register uint16_t slen;

#ifdef INCLUDE_AES
  // Encryption takes 1 byte and is in multiples of 16.
  // 16, 32, 48 etc, lets not send anything above 32 bytes back
  // If you change this increase the buffer in serial.c serial_write_buf()
  if (aes_get_encryption_level() > 0) {
    if(max_xmit <= 16) return 0;
    if(max_xmit <= 32) max_xmit = 15;
    if(max_xmit > 31 ) max_xmit = 31;
  }
#endif // INCLUDE_AES

	if (injected_packet) {
		// send a previously injected packet
		slen = last_sent_len;

		// sending these injected packets at full size doesn't
		// seem to work well ... though I don't really know why!
		if (max_xmit > 32) {
   		    max_xmit = 32;
		}

		if (max_xmit < slen) {
			// send as much as we can
 		        last_sent_len = slen - max_xmit;
   		        slen = encryptReturn(buf, last_sent, max_xmit);

			memcpy(last_sent, &last_sent[max_xmit], last_sent_len);
			last_sent_is_injected = true;
			return slen;
		}
		// send the rest
		injected_packet = false;
		last_sent_is_injected = true;
		return encryptReturn(buf, last_sent, last_sent_len);
	}

	last_sent_is_injected = false;

	slen = serial_read_available();
	if (force_resend) {
		if (max_xmit < last_sent_len) {
			return 0;
		}
		last_sent_is_resend = true;
		force_resend = false;
		return encryptReturn(buf, last_sent, last_sent_len);
	}

	last_sent_is_resend = false;

	// if we have received something via serial see how
	// much of it we could fit in the transmit FIFO
	if (slen > max_xmit) {
		slen = max_xmit;
	}

	last_sent_len = 0;

	if (slen == 0) {
		// nothing available to send
		return 0;
	}

	if (!feature_mavlink_framing) {
		// simple framing
		if (slen > 0 && serial_read_buf(buf, slen)) {
			last_sent_len = slen;
      return encryptReturn(last_sent, buf, slen);
		}
    return 0;
	}

	// try to align packet boundaries with MAVLink packets

	if (mav_pkt_len == 1) {
		// we're waiting for the MAVLink length byte
		if (slen == 1) {
			if ((uint16_t)(timer2_tick() - mav_pkt_start_time) > mav_pkt_max_time) {
				// we didn't get the length byte in time
				last_sent[last_sent_len++] = serial_read(); // Send the STX
				mav_pkt_len = 0;
				return encryptReturn(buf, last_sent, last_sent_len);
			}
			// still waiting ....
			return 0;
		}
		// we have more than one byte, use normal packet frame
		// detection below
		mav_pkt_len = 0;
	}

	if (mav_pkt_len != 0) {
		if (slen < mav_pkt_len) {
			if ((uint16_t)(timer2_tick() - mav_pkt_start_time) > mav_pkt_max_time) {
				// timeout waiting for the rest of
				// it. Send what we have now.
				serial_read_buf(last_sent, slen);
				last_sent_len = slen;
				mav_pkt_len = 0;
				return encryptReturn(buf, last_sent, last_sent_len);
			}
			// leave it in the serial buffer till we have the
			// whole MAVLink packet
			return 0;
		}

		// the whole of the MAVLink packet is available
		return mavlink_frame(max_xmit, buf);
	}

		// We are now looking for a new packet (mav_pkt_len == 0)
	while (slen > 0) {
		register uint8_t c = serial_peekx(0);
		if (c == MAVLINK10_STX || c == MAVLINK20_STX) {
			if (slen == 1) {
				// we got a bare MAVLink header byte
				if (last_sent_len == 0) {
					// wait for the next byte to
					// give us the length
					mav_pkt_len = 1;
					mav_pkt_start_time = timer2_tick();
					mav_pkt_max_time = serial_rate;
					return 0;
				}
				break;
			}
			mav_pkt_len = serial_peekx(1);
			if (mav_pkt_len >= 255-(8+4+13) ||
			    mav_pkt_len+(8+4+13) > mav_max_xmit) {
				// its too big for us to cope with
				mav_pkt_len = 0;
				last_sent[last_sent_len++] = serial_read(); // Send the STX and try again (we will lose framing)
				slen--;
				continue;
			}

			// the length byte doesn't include
			// the header or CRC
			mav_pkt_len += 8;
                        if (c == MAVLINK20_STX) {
                                mav_pkt_len += 4;
                                if (slen > 2 && (serial_peekx(2) & 1)) {
                                        // it is signed
                                        mav_pkt_len += 13;
                                }
                        }

			if (last_sent_len != 0) {
				// send what we've got so far,
				// and send the MAVLink payload
				// in the next packet
				mav_pkt_start_time = timer2_tick();
				mav_pkt_max_time = mav_pkt_len * serial_rate;
				return encryptReturn(buf, last_sent, last_sent_len);
			} else if (mav_pkt_len > slen) {
				// the whole MAVLink packet isn't in
				// the serial buffer yet.
				mav_pkt_start_time = timer2_tick();
				mav_pkt_max_time = mav_pkt_len * serial_rate;
				return 0;
			} else {
// TODO FIX THIS FOR ENCRYPT
				// the whole packet is there
				// and ready to be read
				return mavlink_frame(max_xmit, buf);
			}
		} else {
			last_sent[last_sent_len++] = serial_read();
			slen--;
		}
	}
	return encryptReturn(buf, last_sent, last_sent_len);
}

// return true if the packet currently being sent
// is a resend
bool
packet_is_resend(void)
{
	return last_sent_is_resend;
}

// return true if the packet currently being sent
// is an injected packet
bool
packet_is_injected(void)
{
	return last_sent_is_injected;
}

// force the last packet to be resent. Used when transmit fails
void
packet_force_resend(void)
{
	force_resend = true;
}

// set the maximum size of a packet
void
packet_set_max_xmit(uint8_t max)
{
	mav_max_xmit = max;
}

// set the serial speed in bytes/s
void
packet_set_serial_speed(uint16_t speed)
{
	// convert to 16usec/byte to match timer2_tick()
	serial_rate = (65536UL / speed) + 1;
}

// determine if a received packet is a duplicate
bool
packet_is_duplicate(uint8_t len, __xdata uint8_t *buf, bool is_resend)
{
	if (!is_resend) {
		memcpy(last_received, buf, len);
		last_recv_len = len;
		last_recv_is_resend = false;
		return false;
	}

	// We are now looking at a packet with the resend bit set
	if (last_recv_is_resend == false &&
			len == last_recv_len &&
			memcmp(last_received, buf, len) == 0) {
		last_recv_is_resend = false;  // FIXME - this has no effect
		return true;
	}
#if 0
	printf("RS(%u,%u)[", (unsigned)len, (unsigned)last_recv_len);
	serial_write_buf(last_received, last_recv_len);
	serial_write_buf(buf, len);
	printf("]\r\n");
#endif
	last_recv_is_resend = true;
	return false;
}

// inject a packet to send when possible
void
packet_inject(__xdata uint8_t *buf, __pdata uint8_t len)
{
	if (len > sizeof(last_sent)) {
		len = sizeof(last_sent);
	}
	memcpy(last_sent, buf, len);
	last_sent_len = len;
	last_sent_is_resend = false;
	injected_packet = true;
}


text:
//
//  MealDetailsViewController.m
//  The Better Me
//
//  Created by Dimitar Dzhurenov on 2/8/16.
//  Copyright © 2016 Dimitar Dzhurenov. All rights reserved.
//

#import "MealDetailsViewController.h"
#import "BackgroundGradient.h"

@interface MealDetailsViewController ()
@property (weak, nonatomic) IBOutlet UITableView *detailsTableView;

@end

@implementation MealDetailsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    BackgroundGradient *gradient = [[BackgroundGradient alloc] init];

    [gradient setBackgroundGradientWithFrame:self.view.bounds andLayer:self.view.layer];

    self.detailsTableView.dataSource = self;
    self.detailsTableView.delegate = self;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cellIdentifier"];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cellIdentifier"];
    }

    cell.backgroundColor = [UIColor clearColor];
    cell.textLabel.text = self.details[indexPath.row];

    return cell;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.details.count;
}

@end


text:
/*
 * $Id: Directory.java 8 2011-01-10 20:37:56Z jyeary $
 */
package collections.misc;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 *
 * @author John Yeary <jyeary@bluelotussoftware.com>
 * @version 1.0
 */
public class Directory<C, E> {

    private List<C> contacts;
    private List<E> entries;
    private HashMap<C, List<E>> listings;

    /**
     * Default Constructor
     */
    public Directory() {
        contacts = new ArrayList<C>();
        entries = new ArrayList<E>();
        listings = new HashMap<C, List<E>>();
    }

    public List<C> getContacts() {
        return contacts;
    }

    public List<E> getEntries() {
        return entries;
    }

    public void setContacts(List<C> contacts) {
        this.contacts = contacts;
        for (C c : contacts) {
            if (!listings.containsKey(c)) {
                listings.put(c, new ArrayList<E>());
            }
        }
    }

    public List<? extends E> getListingsByContact(final C contact) {
        return listings.get(contact);
    }

    public void addListingForContact(final C contact, final E entry) {
        contacts.add(contact);
        entries.add(entry);
        if (listings.containsKey(contact)) {
            listings.get(contact).add(entry);
        } else {
            List<E> e = new ArrayList<E>();
            e.add(entry);
            listings.put(contact, e);
        }
    }
}


text:
using System.Collections.Generic;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;

namespace Umbraco.Web.PropertyEditors
{
    [PropertyEditor(Constants.PropertyEditors.MultiNodeTreePicker2Alias, "Multinode Treepicker", PropertyEditorValueTypes.Text, "contentpicker", Group="pickers", Icon="icon-page-add")]
    public class MultiNodeTreePicker2PropertyEditor : PropertyEditor
    {
        public MultiNodeTreePicker2PropertyEditor()
        {
            InternalPreValues = new Dictionary<string, object>
            {
                {"multiPicker", "1"},
                {"showOpenButton", "0"},
                {"showEditButton", "0"},
                {"showPathOnHover", "0"},
                {"ignoreUserStartNodes", "0"},
                {"idType", "udi"}
            };
        }

        protected override PreValueEditor CreatePreValueEditor()
        {
            return new MultiNodePickerPreValueEditor();
        }

        internal IDictionary<string, object> InternalPreValues;
        public override IDictionary<string, object> DefaultPreValues
        {
            get { return InternalPreValues; }
            set { InternalPreValues = value; }
        }

        internal class MultiNodePickerPreValueEditor : PreValueEditor
        {
            public MultiNodePickerPreValueEditor()
            {
                //create the fields
                Fields.Add(new PreValueField()
                {
                    Key = "ignoreUserStartNodes",
                    View = "boolean",
                    Name = "Ignore user start nodes",
                    Description = "Selecting this option allows a user to choose nodes that they normally don't have access to."
                });
                Fields.Add(new PreValueField()
                {
                    Key = "startNode",
                    View = "treesource",
                    Name = "Node type",
                    Config = new Dictionary<string, object>
                    {
                        {"idType", "udi"}
                    }
                });
                Fields.Add(new PreValueField()
                {
                    Key = "filter",
                    View = "textstring",
                    Name = "Allow items of type",
                    Description = "Separate with comma"
                });
                Fields.Add(new PreValueField()
                {
                    Key = "minNumber",
                    View = "number",
                    Name = "Minimum number of items"
                });
                Fields.Add(new PreValueField()
                {
                    Key = "maxNumber",
                    View = "number",
                    Name = "Maximum number of items"
                });
                Fields.Add(new PreValueField()
                {
                    Key = "showOpenButton",
                    View = "boolean",
                    Name = "Show open button (this feature is in preview!)",
                    Description = "Opens the node in a dialog"
                });
            }

            /// <summary>
            /// This ensures the multiPicker pre-val is set based on the maxNumber of nodes set
            /// </summary>
            /// <param name="defaultPreVals"></param>
            /// <param name="persistedPreVals"></param>
            /// <returns></returns>
            /// <remarks>
            /// Due to compatibility with 7.0.0 the multiPicker pre-val might already exist in the db, but we've removed that setting in 7.0.1 so we need to detect it and if it is
            /// there, then we'll set the maxNumber to '1'
            /// </remarks>
            public override IDictionary<string, object> ConvertDbToEditor(IDictionary<string, object> defaultPreVals, PreValueCollection persistedPreVals)
            {
                var result = base.ConvertDbToEditor(defaultPreVals, persistedPreVals);

                //backwards compatibility check
                if (result.ContainsKey("multiPicker") && result["multiPicker"].ToString() == "0")
                {
                    result["maxNumber"] = "1";
                }

                //set the multiPicker val correctly depending on the maxNumber
                if (result.ContainsKey("maxNumber"))
                {
                    var asNumber = result["maxNumber"].TryConvertTo<int>();
                    if (asNumber.Success)
                    {
                        if (asNumber.Result <= 1)
                        {
                            result["multiPicker"] = "0";
                        }
                        else
                        {
                            result["multiPicker"] = "1";
                        }
                    }
                }

                return result;
            }

        }
    }
}


text:
namespace Miruken.Callback
{
    public class Batched<T>
    {
        public Batched(T callback, object rawCallback)
        {
            Callback    = callback;
            RawCallback = rawCallback;
        }

        public T      Callback   { get; }
        public object RawCallback { get; }
    }
}


text:
FROM alpine:edge

RUN apk add monit -U --no-cache --virtual .build-dependencies && \
    apk del .build-dependencies

CMD ["monit", "-I", "c", "/etc/monitrc"]


text:
package br.jus.trf2.balcaojus;

import java.io.ByteArrayInputStream;

import br.jus.trf2.balcaojus.IBalcaojus.IImprimirFilenamePost;
import br.jus.trf2.balcaojus.util.AcessoPublico;

@AcessoPublico
public class ImprimirFilenamePost implements IImprimirFilenamePost {

	@Override
	public void run(Request req, Response resp, BalcaojusContext ctx) throws Exception {
		byte[] ab = new Html2Pdf().converterJsoup(req.html, false);

		resp.contentdisposition = req.disposition + ";filename=" + req.filename;
		resp.contentlength = (long) ab.length;
		resp.contenttype = "application/pdf";
		resp.inputstream = new ByteArrayInputStream(ab);

		ImprimirFilenameGet.armazenarPdfEmCache(req.filename, null, req.html, req.disposition);
	}

	@Override
	public String getContext() {
		return "gerar PDF";
	}

}


text:
package org.nvonop.selenium.framework.controls.interfaces;

/**
 * This interface provides functionality for writing data into a control.
 *
 * @author nvonop
 */
public interface Writeable {

    /**
     * This method will write the supplied data into the control.
     *
     * @param value
     */
    void write(String value);
}


text:
package com.vaadin.tests.components.tree;

import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Component;
import com.vaadin.ui.CustomLayout;
import com.vaadin.v7.ui.Tree;

public class ItemStyleGenerator extends TestBase {

    private Component styles;
    private String css = "<style type=\"text/css\">"
            + ".v-tree-node-red {color: red;}"
            + ".v-tree-node-green {color: green;}"
            + ".v-tree-node-caption-blue {color:blue;}" //
            + "</style>";

    @Override
    protected String getDescription() {
        return "Item Style generator can be used to style items.";
    }

    @Override
    protected Integer getTicketNumber() {
        return 3070;
    }

    @Override
    protected void setup() {
        styles = new CustomLayout(css);
        addComponent(styles);

        Tree tree = new Tree();

        tree.setItemStyleGenerator(new Tree.ItemStyleGenerator() {
            @Override
            public String getStyle(Tree source, Object itemId) {
                // simple return itemId as css style name
                return itemId.toString();
            }
        });

        tree.addItem("red");
        tree.setChildrenAllowed("red", false);
        tree.addItem("green");
        tree.addItem("green children");
        tree.setParent("green children", "green");
        tree.addItem("blue");
        tree.addItem("non-blue-childnode");
        tree.setParent("non-blue-childnode", "blue");

        addComponent(tree);
    }
}


text:
(function () {
    'use strict';

    var controllerId = 'topnav';
    angular.module('app')
        .controller(controllerId, ['$rootScope', '$scope', '$location', 'common', 'config', 'authService', 'remiapi', 'localData', 'notifications', topnav]);

    function topnav($rootScope, $scope, $location, common, config, authService, remiapi, localData, notifications) {
        var logger = common.logger.getLogger(controllerId);

        var vm = this;

        vm.title = 'R.e.M.i.';

        vm.isLoggedIn = authService.isLoggedIn;
        vm.userDisplayName = authService.identity.fullname;
        vm.logOut = function() {
            authService.logout().then(function() { $location.path('/').search({}); });
        };
        vm.productChanged = function(bu, $package) {
            vm.package = $package;
            vm.businessUnit = bu;
            authService.selectProduct($package);
        };

        $rootScope.$on(config.events.loggedIn, loggedInHandler);

        $rootScope.$on(config.events.productsAddedForUser, productAddedForUserhandler);

        $rootScope.$on(config.events.loggedOut, loggedOutHandler);

        $rootScope.$on(config.events.productContextChanged, productContextChanged);

        notifications.subscribe('BusinessUnitsChangedEvent', {});
        common.handleEvent(config.events.notificationReceived, serverNotificationHandler, $scope);

        $scope.$on('$destroy', scopeDestroyHandler);

        activate();

        function activate() {
            common.activateController([
                populateBusinessUnits()
            ], controllerId);
        }

        function scopeDestroyHandler() {
            notifications.unsubscribe('BusinessUnitsChangedEvent');
        }

        function loggedInHandler(event, data) {
            vm.isLoggedIn = true;
            vm.userDisplayName = data.fullname;

            populateBusinessUnits();
        }

        function productAddedForUserhandler() {
            populateBusinessUnits();
        }

        function loggedOutHandler() {
            vm.isLoggedIn = false;
            vm.userDisplayName = '';

            vm.businessUnits = [];
            vm.package = null;
        }

        function productContextChanged(event, $package) {
            if (!vm.businessUnits) return;
            vm.package = $package;
            if ($package && vm.businessUnits && vm.businessUnits.length > 0) {
                vm.businessUnit = Enumerable.From(vm.businessUnits)
                    .First(function(x) {
                        return Enumerable.From(x.Packages).Any(function(p) {
                            return p.ExternalId == $package.ExternalId;
                        });
                    });
            }
        }

        function businessUnitsChangeHandler(businessUnits) {
            vm.businessUnits = businessUnits;
            localData.businessUnitsResolve(vm.businessUnits);
            vm.businessUnit = Enumerable.From(vm.businessUnits)
                .Where(function (x) { return Enumerable.From(x.Packages).Any(function (p) { return p.IsDefault; }); })
                .FirstOrDefault();
            vm.package = vm.businessUnit && vm.businessUnit.Packages
                ? Enumerable.From(vm.businessUnit.Packages).Where(function(p) { return p.IsDefault; }).FirstOrDefault()
                : undefined;
            common.$broadcast(config.events.businessUnitsLoaded, businessUnits);
        }

        function populateBusinessUnits() {
            return remiapi.get.businessUnits()
                .then(function(response) {
                    businessUnitsChangeHandler(response.BusinessUnits);
                }, function() {
                    logger.error('Cannot load business units');
                });
        }

        function serverNotificationHandler(notification) {
            if (notification.name == 'BusinessUnitsChangedEvent') {
                populateBusinessUnits();
            }
        }
    }
})();


text:
<resources>
    <string name="app_name">My Calculator</string>
</resources>


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>directory</title>
    <link rel="stylesheet" type="text/css" href="../static/Semantic-UI/semantic.min.css">

Flask learn

upload

login

read xlsx


text:
from collections import deque
from mrjob.job import MRJob

class TokenizeMRJob(MRJob):

    def mapper(self, _, line):
        indexes = deque((3*x, (3*x)+3) for x in range(len(line)/3))
        while indexes:
            index = indexes.popleft()
            yield line[index[0]:index[1]], 1

    def combiner(self, token, counts):
        yield token, sum(counts)

    def reducer(self, token, counts):
        yield token, sum(counts)

if __name__ == '__main__':
    TokenizeMRJob.run()


text:
namespace DAVA
{
UIStyleSheetYamlLoader::UIStyleSheetYamlLoader()
{
}

void UIStyleSheetYamlLoader::LoadFromYaml(const YamlNode* rootNode, Vector<UIStyleSheet*>* styleSheets)
{
    DVASSERT(styleSheets);

    const auto& styleSheetMap = rootNode->AsVector();
    const UIStyleSheetPropertyDataBase* propertyDB = UIStyleSheetPropertyDataBase::Instance();

    for (auto styleSheetIter = styleSheetMap.begin(); styleSheetIter != styleSheetMap.end(); ++styleSheetIter)
    {
        const auto& styleSheet = (*styleSheetIter)->AsMap();

        auto propertiesSectionIter = styleSheet.find("properties");

        if (propertiesSectionIter != styleSheet.end())
        {
            Vector<UIStyleSheetProperty> propertiesToSet;
            ScopedPtr<UIStyleSheetPropertyTable> propertyTable(new UIStyleSheetPropertyTable());

            for (const auto& propertyIter : propertiesSectionIter->second->AsMap())
            {
                uint32 index = propertyDB->GetStyleSheetPropertyIndex(FastName(propertyIter.first));
                const UIStyleSheetPropertyDescriptor& propertyDescr = propertyDB->GetStyleSheetPropertyByIndex(index);
                if (propertyDescr.field != nullptr)
                {
                    propertiesToSet.push_back(UIStyleSheetProperty{ index, propertyIter.second->AsAny(propertyDescr.field) });
                }
            }

            auto transitionSectionIter = styleSheet.find("transition");

            if (transitionSectionIter != styleSheet.end())
            {
                for (const auto& propertyTransitionIter : transitionSectionIter->second->AsMap())
                {
                    uint32 index = propertyDB->GetStyleSheetPropertyIndex(FastName(propertyTransitionIter.first));
                    for (UIStyleSheetProperty& prop : propertiesToSet)
                    {
                        if (prop.propertyIndex == index)
                        {
                            const auto& transitionProps = propertyTransitionIter.second->AsVector();
                            int32 transitionFunctionType = Interpolation::LINEAR;
                            if (transitionProps.size() > 1)
                                GlobalEnumMap<Interpolation::FuncType>::Instance()->ToValue(transitionProps[1]->AsString().c_str(), transitionFunctionType);

                            prop.transition = true;
                            prop.transitionFunction = static_cast<Interpolation::FuncType>(transitionFunctionType);
                            prop.transitionTime = transitionProps[0]->AsFloat();

                            break;
                        }
                    }
                }
            }
            propertyTable->SetProperties(propertiesToSet);

            Vector<String> selectorList;
            Split(styleSheet.find("selector")->second->AsString(), ",", selectorList);

            for (const String& selectorString : selectorList)
            {
                UIStyleSheet* styleSheet = new UIStyleSheet();

                styleSheet->SetSelectorChain(UIStyleSheetSelectorChain(selectorString));
                styleSheet->SetPropertyTable(propertyTable);

                styleSheets->push_back(styleSheet);
            }
        }
    }
}
}


text:
from __future__ import division

import sys

FREECADPATH = '/usr/lib/freecad/lib'
sys.path.append(FREECADPATH)

import FreeCAD
import Part
import Import

from get_faces_from_points import get_faces_from_points
from process_allowed_domains import process_allowed_domains
from process_nonchanging_domains import process_nonchanging_domains
from reorient_object import reorient_object

def export_step(nurbs_idx, nurbs_pts, input_file_name, output_file_name, nonchanging_file_name, allowed_domains_file_name):

	# generate and get faces
	faceHolder = get_faces_from_points(nurbs_idx, nurbs_pts)

	# create shell from face list, create solid from shell
	shellHolder = Part.makeShell(faceHolder)
	solidHolder = Part.makeSolid(shellHolder)
	Part.show(solidHolder)

	# here, the part is brought into the right coordinate system
	# (something somewhere messes it up, but its too late to get into that mess) Laavaa!
	reorient_object(input_file_name, output_file_name)

	# process allowed domains
	process_allowed_domains(allowed_domains_file_name, output_file_name)

	# process non-changing domains
	process_nonchanging_domains(nonchanging_file_name, output_file_name)

	print "Export done."


text:
package org.apache.hadoop.hive.ql.lib;

import java.util.Stack;

import org.apache.hadoop.hive.ql.metadata.HiveException;

/**
 * Base class for processing operators which is no-op. The specific processors
 * can register their own context with the dispatcher.
 */
public interface NodeProcessor {

  /**
   * Generic process for all ops that don't have specific implementations.
   *
   * @param nd
   *          operator to process
   * @param procCtx
   *          operator processor context
   * @param nodeOutputs
   *          A variable argument list of outputs from other nodes in the walk
   * @return Object to be returned by the process call
   * @throws HiveException
   */
  Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx,
                 Object... nodeOutputs) throws HiveException;
}


text:
using System.Configuration;

namespace WebApiDoc.Tests
{
    public class GlobalSection : ConfigurationSection
    {
        [ConfigurationProperty("serviceName", IsRequired = true)]
        public string ServiceName => (string)this["serviceName"];

        [ConfigurationProperty("displayName", IsRequired = true)]
        public string DisplayName => (string)this["displayName"];

        [ConfigurationProperty("description", IsRequired = true)]
        public string Description => (string)this["description"];
    }
}


text:
<?PHP

global $pgs_tbl,$url_nms_tbl, $dbh, $stes_tbl, $url_nms_tbl, $geo_data;

// check for search friendly name if search friendly page has not been selected
// if url name id is found 301 redirect to search friendly page
if ($pgs_tbl->url_name != '' && strstr($_SERVER["REQUEST_URI"],'pages.deal')) {
	$url_nms_tbl->get_db_vars($pgs_tbl->url_name);
	header( "HTTP/1.1 301 Moved Permanently" );
	header("Location: ".SITE_URL.$url_nms_tbl->url_name."/");
}

// check for set get var
if (!empty($_GET['pid'])) {

	// set page header -- only assign for static header data
	// set header title
	if ($pgs_tbl->header_title != '') {
		$page_header_title = $pgs_tbl->header_title;
	} else {
		$page_header_title = DEF_PAGE_HEADER_TITLE;
	}

	// set meta description
	if ($pgs_tbl->meta_description != '') {
		$page_meta_description = $pgs_tbl->meta_description;
	} else {
		$page_meta_description = DEF_PAGE_META_DESC;
	}

	// set meta keywords
	if ($pgs_tbl->meta_keywords != '') {
		$page_meta_keywords = $pgs_tbl->meta_keywords;
	} else {
		$page_meta_keywords = DEF_PAGE_META_KEYWORDS;
	}

	// page output
	$page_output = ($pgs_tbl->display_name != 1 ? ''.$pgs_tbl->name.'' : '');
	$page_output .= $pgs_tbl->header_content;
	if($_SERVER["REQUEST_URI"] == '/404-error-page/') {
       $page_output .= '

Your Random '.$geo_data->city.', '.$geo_data->region.' Local Deals

                    ';
	  require(CLASSES_DIR.'sections/random_advert.php');
	  $rand_lst_qry = new rand_lst_qry(2);
	  $page_output .= $rand_lst_qry->list_row[0];
      $page_output .= '

                    ';
	  $page_output .= $rand_lst_qry->list_row[1];
      $page_output .= '

';
    }
	$page_output .= $pgs_tbl->footer_content;

} else {

	// if page id value has not been set load header defaults and inform page has not been found
	$page_header_title = DEF_PAGE_HEADER_TITLE;
	$page_meta_description = DEF_PAGE_META_DESC;
	$page_meta_keywords = DEF_PAGE_META_KEYWORDS;

	$page_output = 'Page Not Found';
}

$content_arr = array();
$content_arr['$page_output$'] = $page_output;
$this->template_constants = $content_arr;

// set page header -- only assign for static header data
$this->page_header_title = $page_header_title;
$this->page_meta_description = $page_meta_description;
$this->page_meta_keywords = $page_meta_keywords;
$this->template_file = 'blank-new.php';

?>


text:
<?php

/**
 * @page samples
 * @section button Buttons
 */

/**
 * There are default css classes for buttons.
 *
 * .bx-btn - standard button
 * .bx-btn .bx-btn-small - small buttom
 *
 * To make button with font icon, add icon before text and wrap text in 'u' tag:
 * @code
 *   Button text
 * @endcode
 *
 * To make button with image, add 'img' tag before text and wrap text in 'u' tag:
 * @code
 *   Button text
 * @endcode
 */

$aPathInfo = pathinfo(__FILE__);
require_once ($aPathInfo['dirname'] . '/../inc/header.inc.php');
require_once(BX_DIRECTORY_PATH_INC . "design.inc.php");

$oTemplate = BxDolTemplate::getInstance();
$oTemplate->setPageNameIndex (BX_PAGE_DEFAULT);
$oTemplate->setPageHeader ("Buttons");
$oTemplate->setPageContent ('page_main_code', PageCompMainCode());
$oTemplate->getPageCode();

/**
 * page code function
 */
function PageCompMainCode()
{
    ob_start();
?>
    <button class="bx-btn bx-def-margin-right">Button text</button>
    <button class="bx-btn bx-btn-img bx-def-margin-right"></button>
    <button class="bx-btn bx-btn-img bx-def-margin-right">Button text</button>

    <button class="bx-btn bx-btn-small bx-def-margin-right">Button text</button>
    <button class="bx-btn bx-btn-small bx-btn-img bx-def-margin-right"></button>
    <button class="bx-btn bx-btn-small bx-btn-img bx-def-margin-right">Button text</button>

    <button class="bx-btn bx-def-margin-right"></button>
    <button class="bx-btn bx-def-margin-right"></button>
    <button class="bx-btn bx-def-margin-right"></button>
    <button class="bx-btn bx-def-margin-right">Button text</button>

    <button class="bx-btn bx-btn-small bx-def-margin-right"></button>
    <button class="bx-btn bx-btn-small bx-def-margin-right">Button text</button>

<?php

    return DesignBoxContent("Buttons", ob_get_clean(), BX_DB_PADDING_DEF);
}

/** @} */


text:
    {% include icon-twitter.svg %}

    {{ include.username }}


text:
package bpf

import (
	"io/ioutil"
	"reflect"
	"strconv"
	"strings"
	"testing"
)

// This is a direct translation of the program in
// testdata/all_instructions.txt.
var allInstructions = []Instruction{
	LoadConstant{Dst: RegA, Val: 42},
	LoadConstant{Dst: RegX, Val: 42},

	LoadScratch{Dst: RegA, N: 3},
	LoadScratch{Dst: RegX, N: 3},

	LoadAbsolute{Off: 42, Size: 1},
	LoadAbsolute{Off: 42, Size: 2},
	LoadAbsolute{Off: 42, Size: 4},

	LoadIndirect{Off: 42, Size: 1},
	LoadIndirect{Off: 42, Size: 2},
	LoadIndirect{Off: 42, Size: 4},

	LoadMemShift{Off: 42},

	LoadExtension{Num: ExtLen},
	LoadExtension{Num: ExtProto},
	LoadExtension{Num: ExtType},
	LoadExtension{Num: ExtRand},

	StoreScratch{Src: RegA, N: 3},
	StoreScratch{Src: RegX, N: 3},

	ALUOpConstant{Op: ALUOpAdd, Val: 42},
	ALUOpConstant{Op: ALUOpSub, Val: 42},
	ALUOpConstant{Op: ALUOpMul, Val: 42},
	ALUOpConstant{Op: ALUOpDiv, Val: 42},
	ALUOpConstant{Op: ALUOpOr, Val: 42},
	ALUOpConstant{Op: ALUOpAnd, Val: 42},
	ALUOpConstant{Op: ALUOpShiftLeft, Val: 42},
	ALUOpConstant{Op: ALUOpShiftRight, Val: 42},
	ALUOpConstant{Op: ALUOpMod, Val: 42},
	ALUOpConstant{Op: ALUOpXor, Val: 42},

	ALUOpX{Op: ALUOpAdd},
	ALUOpX{Op: ALUOpSub},
	ALUOpX{Op: ALUOpMul},
	ALUOpX{Op: ALUOpDiv},
	ALUOpX{Op: ALUOpOr},
	ALUOpX{Op: ALUOpAnd},
	ALUOpX{Op: ALUOpShiftLeft},
	ALUOpX{Op: ALUOpShiftRight},
	ALUOpX{Op: ALUOpMod},
	ALUOpX{Op: ALUOpXor},

	NegateA{},

	Jump{Skip: 10},
	JumpIf{Cond: JumpEqual, Val: 42, SkipTrue: 8, SkipFalse: 9},
	JumpIf{Cond: JumpNotEqual, Val: 42, SkipTrue: 8},
	JumpIf{Cond: JumpLessThan, Val: 42, SkipTrue: 7},
	JumpIf{Cond: JumpLessOrEqual, Val: 42, SkipTrue: 6},
	JumpIf{Cond: JumpGreaterThan, Val: 42, SkipTrue: 4, SkipFalse: 5},
	JumpIf{Cond: JumpGreaterOrEqual, Val: 42, SkipTrue: 3, SkipFalse: 4},
	JumpIf{Cond: JumpBitsSet, Val: 42, SkipTrue: 2, SkipFalse: 3},

	TAX{},
	TXA{},

	RetA{},
	RetConstant{Val: 42},
}
var allInstructionsExpected = "testdata/all_instructions.bpf"

// Check that we produce the same output as the canonical bpf_asm
// linux kernel tool.
func TestInterop(t *testing.T) {
	out, err := Assemble(allInstructions)
	if err != nil {
		t.Fatalf("assembly of allInstructions program failed: %s", err)
	}
	t.Logf("Assembled program is %d instructions long", len(out))

	bs, err := ioutil.ReadFile(allInstructionsExpected)
	if err != nil {
		t.Fatalf("reading %s: %s", allInstructionsExpected, err)
	}
	// First statement is the number of statements, last statement is
	// empty. We just ignore both and rely on slice length.
	stmts := strings.Split(string(bs), ",")
	if len(stmts)-2 != len(out) {
		t.Fatalf("test program lengths don't match: %s has %d, Go implementation has %d", allInstructionsExpected, len(stmts)-2, len(allInstructions))
	}

	for i, stmt := range stmts[1 : len(stmts)-2] {
		nums := strings.Split(stmt, " ")
		if len(nums) != 4 {
			t.Fatalf("malformed instruction %d in %s: %s", i+1, allInstructionsExpected, stmt)
		}

		actual := out[i]

		op, err := strconv.ParseUint(nums[0], 10, 16)
		if err != nil {
			t.Fatalf("malformed opcode %s in instruction %d of %s", nums[0], i+1, allInstructionsExpected)
		}
		if actual.Op != uint16(op) {
			t.Errorf("opcode mismatch on instruction %d (%#v): got 0x%02x, want 0x%02x", i+1, allInstructions[i], actual.Op, op)
		}

		jt, err := strconv.ParseUint(nums[1], 10, 8)
		if err != nil {
			t.Fatalf("malformed jt offset %s in instruction %d of %s", nums[1], i+1, allInstructionsExpected)
		}
		if actual.Jt != uint8(jt) {
			t.Errorf("jt mismatch on instruction %d (%#v): got %d, want %d", i+1, allInstructions[i], actual.Jt, jt)
		}

		jf, err := strconv.ParseUint(nums[2], 10, 8)
		if err != nil {
			t.Fatalf("malformed jf offset %s in instruction %d of %s", nums[2], i+1, allInstructionsExpected)
		}
		if actual.Jf != uint8(jf) {
			t.Errorf("jf mismatch on instruction %d (%#v): got %d, want %d", i+1, allInstructions[i], actual.Jf, jf)
		}

		k, err := strconv.ParseUint(nums[3], 10, 32)
		if err != nil {
			t.Fatalf("malformed constant %s in instruction %d of %s", nums[3], i+1, allInstructionsExpected)
		}
		if actual.K != uint32(k) {
			t.Errorf("constant mismatch on instruction %d (%#v): got %d, want %d", i+1, allInstructions[i], actual.K, k)
		}
	}
}

// Check that assembly and disassembly match each other.
func TestAsmDisasm(t *testing.T) {
	prog1, err := Assemble(allInstructions)
	if err != nil {
		t.Fatalf("assembly of allInstructions program failed: %s", err)
	}
	t.Logf("Assembled program is %d instructions long", len(prog1))

	got, allDecoded := Disassemble(prog1)
	if !allDecoded {
		t.Errorf("Disassemble(Assemble(allInstructions)) produced unrecognized instructions:")
		for i, inst := range got {
			if r, ok := inst.(RawInstruction); ok {
				t.Logf("  insn %d, %#v --> %#v", i+1, allInstructions[i], r)
			}
		}
	}

	if len(allInstructions) != len(got) {
		t.Fatalf("disassembly changed program size: %d insns before, %d insns after", len(allInstructions), len(got))
	}
	if !reflect.DeepEqual(allInstructions, got) {
		t.Errorf("program mutated by disassembly:")
		for i := range got {
			if !reflect.DeepEqual(allInstructions[i], got[i]) {
				t.Logf("  insn %d, s: %#v, p1: %#v, got: %#v", i+1, allInstructions[i], prog1[i], got[i])
			}
		}
	}
}


text:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="com.munger.passwordkeeper.MainActivity" >

    <item android:id="@+id/action_detail_copy"
          android:title="copy"
          android:icon="@drawable/ic_content_copy_black_24dp"
          app:showAsAction="always" />
    <item android:id="@+id/action_detail_paste"
          android:title="paste"
          android:icon="@drawable/ic_content_paste_black_24dp"
          app:showAsAction="always" />
    <item android:id="@+id/action_detail_random"
          android:title="random"
          android:icon="@drawable/ic_security_black_24dp"
          app:showAsAction="always" />
</menu>


text:
layout: post
date: '2017-02-04'
title: "One Shoulder Full Length Column Wedding Dress"
category: A-Line
tags: ["column","length","wedding","bride","dress"]
image: http://www.starbrideapparel.com/5055-thickbox_default/sa345.jpg
---
One Shoulder Full Length Column Wedding Dress

On Sales: **$233.394**
<amp-img layout="responsive" width="600" height="600" src="//www.starbrideapparel.com/5055-thickbox_default/sa345.jpg" alt="One Shoulder Full Length Column Wedding Dress 0" />

Buy it: [One Shoulder Full Length Column Wedding Dress](https://www.starbrideapparel.com/aline-wedding-dresses/2653-sa345-1463394404961.html "One Shoulder Full Length Column Wedding Dress")

View more: [A-Line](https://www.starbrideapparel.com/2-aline-wedding-dresses "A-Line")


text:
using System;

namespace ChainUtils.BouncyCastle.Asn1.Icao
{
	public class LdsVersionInfo
		: Asn1Encodable
	{
		private DerPrintableString ldsVersion;
		private DerPrintableString unicodeVersion;

		public LdsVersionInfo(string ldsVersion, string unicodeVersion)
		{
			this.ldsVersion = new DerPrintableString(ldsVersion);
			this.unicodeVersion = new DerPrintableString(unicodeVersion);
		}

		private LdsVersionInfo(Asn1Sequence seq)
		{
			if (seq.Count != 2)
				throw new ArgumentException("sequence wrong size for LDSVersionInfo", "seq");

			ldsVersion = DerPrintableString.GetInstance(seq[0]);
			unicodeVersion = DerPrintableString.GetInstance(seq[1]);
		}

		public static LdsVersionInfo GetInstance(object obj)
		{
			if (obj is LdsVersionInfo)
				return (LdsVersionInfo)obj;

			if (obj != null)
				return new LdsVersionInfo(Asn1Sequence.GetInstance(obj));

			return null;
		}

		public virtual string GetLdsVersion()
		{
			return ldsVersion.GetString();
		}

		public virtual string GetUnicodeVersion()
		{
			return unicodeVersion.GetString();
		}

		/**
		 * <pre>
		 * LDSVersionInfo ::= SEQUENCE {
		 *    ldsVersion PRINTABLE STRING
		 *    unicodeVersion PRINTABLE STRING
		 *  }
		 * </pre>
		 * @return
		 */
		public override Asn1Object ToAsn1Object()
		{
			return new DerSequence(ldsVersion, unicodeVersion);
		}
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>io.pivotal.cc.cacheserver</groupId>
	<artifactId>cc-demo-cacheserver</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>jar</packaging>

	<name>cc-demo-cacheserver</name>
	<description>Cluster Side Code for Credit Cards</description>

	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>1.2.5.RELEASE</version>
		<relativePath /> <!-- lookup parent from repository -->
	</parent>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<java.version>1.8</java.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>io.pivotal.cc.common</groupId>
			<artifactId>cc-demo-common</artifactId>
			<version>0.0.1-SNAPSHOT</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-gemfire</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>

<!-- 			<plugin>
				<groupId>io.pivotal.cc.common</groupId>
				<artifactId>cc-demo-common</artifactId>
				<version>0.0.1-SNAPSHOT</version>
				<configuration>
					<archive>
						<manifest>
							<mainClass>io.pivotal.cc.common.CcDemoCommonApplication</mainClass>
						</manifest>
					</archive>
					<descriptorRefs>
						<descriptorRef>jar-with-dependencies</descriptorRef>
					</descriptorRefs>
				</configuration>
			</plugin>
			-->

		</plugins>
	</build>

</project>


text:
{{:: 'client-templates' | translate}}

{{model.template.name}}

{{:: 'mappers' | translate}}

{{:: 'create-protocol-mappers' | translate}}

{{model.mapper.name}}

<kc-menu></kc-menu>


text:
PyObject *py_ue_data_table_add_row(ue_PyUObject * self, PyObject * args)
{

	ue_py_check(self);

	char *name;
	PyObject *py_row;

	if (!PyArg_ParseTuple(args, "sO:data_table_add_row", &name, &py_row))
	{
		return nullptr;
	}

	UDataTable *data_table = ue_py_check_type<UDataTable>(self);
	if (!data_table)
		return PyErr_Format(PyExc_Exception, "uobject is not a UDataTable");

	ue_PyUScriptStruct *u_struct = py_ue_is_uscriptstruct(py_row);
	if (!u_struct)
		return PyErr_Format(PyExc_Exception, "argument is not a UScriptStruct");

	if (data_table->RowStruct != u_struct->u_struct)
	{
		return PyErr_Format(PyExc_Exception, "argument is not a %s", TCHAR_TO_UTF8(*data_table->RowStruct->GetName()));
	}

	FName row_name = FName(UTF8_TO_TCHAR(name));

	uint8 *row = FDataTableEditorUtils::AddRow(data_table, row_name);
	if (!row)
		return PyErr_Format(PyExc_Exception, "unable to add row");
	data_table->RowStruct->InitializeStruct(row);
	data_table->RowStruct->CopyScriptStruct(row, u_struct->u_struct_ptr);

	Py_RETURN_NONE;

}

PyObject *py_ue_data_table_remove_row(ue_PyUObject * self, PyObject * args)
{

	ue_py_check(self);

	char *name;

	if (!PyArg_ParseTuple(args, "s:data_table_remove_row", &name))
	{
		return nullptr;
	}

	UDataTable *data_table = ue_py_check_type<UDataTable>(self);
	if (!data_table)
		return PyErr_Format(PyExc_Exception, "uobject is not a UDataTable");

	FName row_name = FName(UTF8_TO_TCHAR(name));

	if (FDataTableEditorUtils::RemoveRow(data_table, row_name))
	{
		Py_RETURN_TRUE;
	}
	Py_RETURN_FALSE;
}

PyObject *py_ue_data_table_rename_row(ue_PyUObject * self, PyObject * args)
{

	ue_py_check(self);

	char *name;
	char *new_name;

	if (!PyArg_ParseTuple(args, "ss:data_table_rename_row", &name, &new_name))
	{
		return nullptr;
	}

	UDataTable *data_table = ue_py_check_type<UDataTable>(self);
	if (!data_table)
		return PyErr_Format(PyExc_Exception, "uobject is not a UDataTable");

	FName row_name = FName(UTF8_TO_TCHAR(name));
	FName row_new_name = FName(UTF8_TO_TCHAR(new_name));

	if (FDataTableEditorUtils::RenameRow(data_table, row_name, row_new_name))
	{
		Py_RETURN_TRUE;
	}
	Py_RETURN_FALSE;
}

PyObject *py_ue_data_table_as_dict(ue_PyUObject * self, PyObject * args)
{

	ue_py_check(self);

	UDataTable *data_table = ue_py_check_type<UDataTable>(self);
	if (!data_table)
		return PyErr_Format(PyExc_Exception, "uobject is not a UDataTable");

	PyObject *py_dict = PyDict_New();

#if ENGINE_MINOR_VERSION > 20
	for (TMap<FName, uint8*>::TConstIterator RowMapIter(data_table->GetRowMap().CreateConstIterator()); RowMapIter; ++RowMapIter)
#else
	for (TMap<FName, uint8*>::TConstIterator RowMapIter(data_table->RowMap.CreateConstIterator()); RowMapIter; ++RowMapIter)
#endif
	{
		PyDict_SetItemString(py_dict, TCHAR_TO_UTF8(*RowMapIter->Key.ToString()), py_ue_new_owned_uscriptstruct(data_table->RowStruct, RowMapIter->Value));
	}

	return py_dict;
}

PyObject *py_ue_data_table_as_json(ue_PyUObject * self, PyObject * args)
{

	ue_py_check(self);

	int flags = 0;

	if (!PyArg_ParseTuple(args, "|i:data_table_as_json", &flags))
	{
		return nullptr;
	}

	UDataTable *data_table = ue_py_check_type<UDataTable>(self);
	if (!data_table)
		return PyErr_Format(PyExc_Exception, "uobject is not a UDataTable");

	return PyUnicode_FromString(TCHAR_TO_UTF8(*data_table->GetTableAsJSON((EDataTableExportFlags)flags)));
}

PyObject *py_ue_data_table_find_row(ue_PyUObject * self, PyObject * args)
{

	ue_py_check(self);

	char *name;

	if (!PyArg_ParseTuple(args, "s:data_table_find_row", &name))
	{
		return nullptr;
	}

	UDataTable *data_table = ue_py_check_type<UDataTable>(self);
	if (!data_table)
		return PyErr_Format(PyExc_Exception, "uobject is not a UDataTable");

	uint8 **data = nullptr;
#if ENGINE_MINOR_VERSION > 20
	data = (uint8 **)data_table->GetRowMap().Find(FName(UTF8_TO_TCHAR(name)));
#else
	data = data_table->RowMap.Find(FName(UTF8_TO_TCHAR(name)));
#endif
	if (!data)
	{
		return PyErr_Format(PyExc_Exception, "key not found in UDataTable");
	}

	return py_ue_new_owned_uscriptstruct(data_table->RowStruct, *data);
}

PyObject *py_ue_data_table_get_all_rows(ue_PyUObject * self, PyObject * args)
{

	ue_py_check(self);

	UDataTable *data_table = ue_py_check_type<UDataTable>(self);
	if (!data_table)
		return PyErr_Format(PyExc_Exception, "uobject is not a UDataTable");

	PyObject *py_list = PyList_New(0);

#if ENGINE_MINOR_VERSION > 20
	for (TMap<FName, uint8*>::TConstIterator RowMapIter(data_table->GetRowMap().CreateConstIterator()); RowMapIter; ++RowMapIter)
#else
	for (TMap<FName, uint8*>::TConstIterator RowMapIter(data_table->RowMap.CreateConstIterator()); RowMapIter; ++RowMapIter)
#endif
	{
		PyList_Append(py_list, py_ue_new_owned_uscriptstruct(data_table->RowStruct, RowMapIter->Value));
	}

	return py_list;
}

#endif


text:
package com.effektif.workflow.impl.data.types;

import java.lang.reflect.Field;

import com.effektif.workflow.impl.data.DataTypeImpl;

/**
 * @author Tom Baeyens
 */
public class JavaBeanFieldImpl extends ObjectFieldImpl {

  protected Field field;

  public JavaBeanFieldImpl(Field field, DataTypeImpl dataType) {
    super(field.getName(), dataType);
    this.field = field;
    this.field.setAccessible(true);
  }

  public JavaBeanFieldImpl(String key) {
    super(key);
  }

  @Override
  public Object getFieldValue(Object value) {
    if (value==null) {
      return null;
    }
    try {
      return field.get(value);
    } catch (IllegalArgumentException | IllegalAccessException e) {
      throw new RuntimeException("Couldn't dereference "+key+": "+e.getMessage(), e);
    }
  }
}


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

using Cake.Core.IO;

namespace Cake.Core.Scripting.Analysis
{
    /// <summary>
    /// Represents the context used by the <see cref="ScriptAnalyzer"/>.
    /// </summary>
    public interface IScriptAnalyzerContext
    {
        /// <summary>
        /// Gets the path to the initial script being executed.
        /// </summary>
        FilePath Root { get; }

        /// <summary>
        /// Gets the current script being processed.
        /// </summary>
        /// <value>The current script being processed.</value>
        IScriptInformation Current { get; }

        /// <summary>
        /// Processes the specified script path using the same context.
        /// </summary>
        /// <param name="scriptPath">The script path to process.</param>
        void Analyze(FilePath scriptPath);

        /// <summary>
        /// Adds a script line to the result.
        /// </summary>
        /// <param name="line">The script line to add.</param>
        void AddScriptLine(string line);

        /// <summary>
        /// Adds a script error to the result.
        /// </summary>
        /// <param name="error">The script error to add.</param>
        void AddScriptError(string error);
    }
}