text:
import { VNode } from 'snabbdom/vnode';
import { PartialObserver, Subscription, Observable, Subject } from 'rxjs';
import { CompleteOn } from 'rx-decorators/completeOn';

import {
  Type,
  Injector,
  ProviderArg,
  PostConstruct,
  Inject
} from '../di';
import {
  EventBus,
  BusEvent
} from '../events';
import { clamp, negate, uid, isNumber, get } from '../utils';
import { ContainerRef, RenderableArg, ConfigurationRef, ContextType } from '../common';
import { RenderableArea } from './RenderableArea';
import { Renderer } from './Renderer';
import { RenderableInjector } from './RenderableInjector';
import { ConfiguredRenderable } from './ConfiguredRenderable';
import { RenderableConfig } from './common';
import { BaseSerializerArg } from '../serialization';
import { startWith, takeUntil, map, distinctUntilChanged } from 'rxjs/operators';

export interface BaseModificationArgs {
  /**
   * Whether to invoke the render cycle. This is useful for
   * delaying the render cycle to a later time.
   * @type {boolean}
   */
  render?: boolean;
}

/**
 * Args used when removing a child renderable.
 * @export
 * @interface RemoveChildArgs
 * @extends {BaseModificationArgs}
 */
export interface RemoveChildArgs extends BaseModificationArgs {
  /**
   * Whether to destroy the child being removed.
   * @type {boolean}
   */
  destroy?: boolean;
  /**
   * The context the child is being destroyed.
   * @type {ContextType}
   */
  context?: ContextType;
}

/**
 * Args used when adding a child renderable.
 * @export
 * @interface AddChildArgs
 * @extends {BaseModificationArgs}
 */
export interface AddChildArgs extends BaseModificationArgs {
  /**
   * What index to add the child renderable to. If not provided then
   * it will be pushed.
   * @type {number}
   */
  index?: number;
  /**
   * Whether to invoke a resize of this renderable.
   * @type {boolean}
   */
  resize?: boolean;
}

/**
 * Contains data about the destruction of a view.
 * @export
 * @interface RenderableDestroyContext
 */
export interface RenderableDestroyContext {
  type: ContextType;
}

/**
 * Contains data about the destruction of a renderable.
 * @export
 * @interface RenderableDestroyedContext
 * @template T
 */
export interface RenderableDestroyedContext<T extends Renderable> {
  context: ContextType;
  renderable: T;
}

/**
 * The base renderable that all other renderables extend from.
 * @export
 * @abstract
 * @class Renderable
 */
export abstract class Renderable<C extends RenderableConfig = RenderableConfig> {
  /**
   * Notifies when this renderable is destroyed.
   * @type {Observable<this>}
   */
  destroyed: Observable<RenderableDestroyedContext<this>>;
  /**
   * Notifies when the container of this renderable changes.
   * @type {(Observable<Renderable|null>)}
   */
  containerChange: Observable<Renderable|null>;

  tags: Set<string> = new Set<string>();

  protected _eventBus = new EventBus();
  protected _width: number;
  protected _height: number;
  protected _isDestroyed: boolean = false;
  protected _uid: number = uid();
  protected _container: Renderable|null;

  @CompleteOn('destroy')
  protected _destroyed: Subject<RenderableDestroyedContext<this>> = new Subject();

  @CompleteOn('destroy')
  protected _containerChange: Subject<Renderable|null> = new Subject<Renderable|null>();
  protected _contentItems: Renderable[] = [];

  @Inject(Renderer) protected _renderer: Renderer;
  @Inject(Injector) protected _injector: Injector;
  @Inject(ConfigurationRef) protected _config: C | null;

  constructor() {
    this.destroyed = this._destroyed.asObservable();
    this.containerChange = this._containerChange.asObservable();
  }

  /**
   * This renderables container or null if none.
   * @readonly
   * @type {(Renderable|null)}
   */
  get container(): Renderable|null {
    return this._container || null;
  }

  /**
   * This renderables width in pixels.
   * @readonly
   * @type {number}
   */
  get width(): number {
    return this._width;
  }

  /**
   * This renderables height in pixels.
   * @readonly
   * @type {number}
   */
  get height(): number {
    return this._height;
  }

  /**
   * This renderables page offset x.
   * @readonly
   * @type {number}
   */
  get offsetX(): number {
    return get(this._container, 'offsetX', 0, negate(isNumber));
  }

  /**
   * This renderables page offset y.
   * @readonly
   * @type {number}
   */
  get offsetY(): number {
    return get(this._container, 'offsetY', 0, negate(isNumber));
  }

  /**
   * Whether this renderable is destroyed.
   * @readonly
   * @type {boolean}
   */
  get isDestroyed(): boolean {
    return this._isDestroyed;
  }

  /**
   * A unique identifier for this renderable.
   * @readonly
   * @type {number}
   */
  get uid(): number {
    return this._uid;
  }

  /**
   * The amount of content items belonging to this renderable.
   * @readonly
   * @type {number}
   */
  get length(): number {
    return this._contentItems.length;
  }

  /**
   * The injector used to create this renderable.
   * @readonly
   * @type {Injector}
   */
  get injector(): Injector {
    if (!this._injector) {
      throw new Error('Trying to access injector before it is set. Did you create his renderable through a RenderableInjector?');
    }

    return this._injector;
  }

  /**
   * Creates this renderables VNode for diffing against the previous VNode state.
   * @abstract
   * @returns {VNode}
   */
  abstract render(): VNode;

  /**
   * Invoked when the Injector has been assigned and ready for use.
   */
  @PostConstruct()
  initialize(): void {
    this.setContainer(this.injector.get<Renderable|null>(ContainerRef, null));

    const config = this.injector.get(ConfigurationRef, null) as C | null;

    if (config && Array.isArray(config.tags)) {
      config.tags.forEach(tag => this.tags.add(tag));
    }
  }

  /**
   * Sets this components size and triggers it's childrens sizing.
   */
  resize(): void {
    for (const child of this.getChildren()) {
      child.resize();
    }
  }

  /**
   * Returns this renderables children renderables. This differs
   * from content items as children should contain all renderables
   * we want as part of the render cycle.
   * @returns {Renderable[]}
   */
  getChildren(): Renderable[] {
    return this._contentItems;
  }

  /**
   * Determines whether this renderable is visible.
   * @returns {boolean}
   */
  isVisible(): boolean {
    return Boolean(this._container && this._container.isVisible());
  }

  /**
   * Destroys this renderable and all it's children.
   * @returns {void}
   */
  destroy(context: RenderableDestroyContext): void {
    if (this._isDestroyed) {
      return;
    }

    for (const item of this._contentItems) {
      item.destroy(context);
    }

    this._isDestroyed = true;
    this._destroyed.next({ context: context.type, renderable: this });
    this._destroyed.complete();
  }

  /**
   * Gets this renderables parent or any parent that is
   * an instance of the passed in constructor. If non is found
   * then null is returned.
   * @template T The constructor type.
   * @param {Type<T>} [Ctor]
   * @returns {(T|null)}
   */
  getParent<T extends Renderable>(Ctor?: Type<T>|Type<T>[]): T|null {
    if (this._container) {
      if (!Ctor) {
        return this._container as T;
      }

      if (this._matchesRenderable(this._container, Ctor)) {
        return this._container as T;
      }

      return this._container.getParent(Ctor);
    }

    return null;
  }

  /**
   * Creates an Observable that emits when the parent matching renderable changes.
   * @template T
   * @param {Type<T>} Ctor
   * @returns {(Observable<T | null>)}
   */
  queryParent<T extends Renderable>(Ctor: Type<T> | Type<T>[]): Observable<T | null> {
    return this._renderer.rendered.pipe(
      startWith(null!),
      takeUntil(this.destroyed),
      map(() => this.getParent(Ctor)),
      distinctUntilChanged());
  }

  /**
   * Gets this renderables parents or any parents that are
   * an instance of the passed in constructor.
   * @template T The constructor type.
   * @param {Type<T>} [Ctor]
   * @returns {(T|null)}
   */
  getParents<T extends Renderable>(Ctor?: Type<T>|Type<T>[]): T[] {
    let parent: Renderable|null = this;
    let result: T[] = [];

    while (parent = parent.getParent(Ctor)) {
      result.push(parent as T);
    }

    return result;
  }

  /**
   * Sets the container of this renderable.
   * @param {(Renderable|null)} container
   */
  setContainer(container: Renderable|null): void {
    this._container = container;

    if (this._container) {
      this.injector.setParent(this._container.injector);
    }

    this._containerChange.next(container);
  }

  /**
   * Subscribes to a BusEvent.
   * @template T The event type.
   * @param {Type<T>} Event
   * @param {PartialObserver<T>|function(event: T)} observer
   * @returns {Subscription}
   */
  subscribe<T extends BusEvent<any>>(Event: Type<T>, observer: PartialObserver<T>|((event: T) => void)): Subscription {
    return this._eventBus.subscribe(Event, observer);
  }

  /**
   * Emits a BusEvent on this renderable.
   * @template T The event type.
   * @param {T} event
   */
  emit<T extends BusEvent<any>>(event: T): void {
    this._eventBus.next(event);
  }

  /**
   * Emits a BusEvent down to all descendants recursively.
   * Propagation can be stopped by any descending renderable.
   * @template T The event type.
   * @param {T} event
   */
  emitDown<T extends BusEvent<any>>(event: T): void {
    for (const child of this.getDescendants()) {
      if (event.isPropagationStopped) {
        break;
      }

      child.emit(event);
    }
  }

  /**
   * Emits a BusEvent up to all parents recursively.
   * Propagation can be stopped by any parent renderable.
   * @template T The event type.
   * @param {T} event
   */
  emitUp<T extends BusEvent<any>>(event: T): void {
    for (const parent of this.getParents()) {
      if (event.isPropagationStopped) {
        break;
      }

      parent.emit(event);
    }
  }

  /**
   * Gets all descendants of this renderable recursively.
   * @returns {Renderable[]}
   */
  getDescendants(): Renderable[] {
    const children = this.getChildren();

    return children.reduce((result, child) => {
      return [ ...result, ...child.getDescendants() ]
    }, children);
  }

  /**
   * Replaces a content item on this renderable with another content item.
   * @param {Renderable} item
   * @param {Renderable} withItem
   * @param {RemoveChildArgs} [options={}]
   */
  replaceChild(item: Renderable, withItem: Renderable, options: RemoveChildArgs = {}): void {
    const {
      destroy = false,
      render = true,
      context = ContextType.NONE
    } = options;
    const index = this._contentItems.indexOf(item);

    if (index !== -1) {
      if (destroy) {
        item.destroy({ type: context });
      }

      this._contentItems.splice(index, 1, withItem);
      withItem.setContainer(this);
      this.resize();

      if (render) {
        this._renderer.render();
      }
    }
  }

  /**
   * Adds a child item to this renderable.
   * @param {Renderable} item
   * @param {AddChildArgs} [options={}]
   */
  addChild(item: Renderable, options: AddChildArgs = {}): void {
    const { index = -1, render = true, resize = true } = options;

    if (index === -1) {
      this._contentItems.push(item);
    } else {
      this._contentItems.splice(clamp(index, 0, this._contentItems.length), 0, item);
    }

    item.setContainer(this);

    if (resize) {
      this.resize();
    }

    if (render) {
      this._renderer.render();
    }
  }

  /**
   * Removes a content item from this renderable.
   * @param {Renderable} item
   * @param {RemoveChildArgs} [options={}]
   */
  removeChild(item: Renderable, options: RemoveChildArgs = {}): void {
    const {
      destroy = true,
      render = true,
      context = ContextType.NONE
    } = options;
    const index = this._contentItems.indexOf(item);

    if (index === -1) {
      return;
    }

    if (destroy) {
      item.destroy({ type: context });
    }

    this._contentItems.splice(index, 1);

    if (this._contentItems.length) {
      this.resize();
    } else {
      // If there are no more content items remove this item from the parent.
      this.remove(context);
    }

    if (render) {
      this._renderer.render();
    }
  }

  /**
   * Removes this item from it's parent. If there is no
   * parent then this renderable will just be destroyed.
   */
  remove(context: ContextType = ContextType.NONE): void {
    if (this._container) {
      this._container.removeChild(this);
    } else {
      this.destroy({ type: context });
    }
  }

  /**
   * Gets the index of a content renderable.
   * @param {Renderable} item
   * @returns {number}
   */
  getIndexOf(item: Renderable): number {
    return this._contentItems.indexOf(item);
  }

  /**
   * Gets a content renderable at an index.
   * @param {number} index
   * @returns {(Renderable|null)}
   */
  getAtIndex(index: number): Renderable|null {
    return this._contentItems[index] || null;
  }

  /**
   * Creates an Observable scoped to a specific event type.
   * @template T The event type.
   * @param {Type<T>} Event
   * @returns {Observable<T>}
   */
  scope<T extends BusEvent<any>>(Event: Type<T>): Observable<T> {
    return this._eventBus.scope(Event);
  }

  /**
   * Whether a renderable is a descendant of this renderable.
   * @param {Renderable} item
   * @returns {boolean}
   */
  contains(item: Renderable): boolean {
    return this.getDescendants().indexOf(item) !== -1;
  }

  /**
   * Whether this renderable is a descendant of another renderable.
   * @param {Renderable} item
   * @returns {boolean}
   */
  isContainedWithin(item: Renderable): boolean {
    return item.contains(this);
  }

  /**
   * Gets the renderable area of this renderable.
   * @returns {RenderableArea}
   */
  getArea(): RenderableArea {
    const { height, width, offsetX, offsetY } = this;

    return new RenderableArea(offsetX, offsetX + width, offsetY, offsetY + height);
  }

  /**
   * Creates a child renderable using this renderable as it's container.
   * @template T
   * @param {RenderableArg<T>} renderable
   * @param {ProviderArg[]} [providers=[]]
   * @returns {T}
   */
  createChild<T extends Renderable>(renderable: RenderableArg<T>, providers: ProviderArg[] = []): T {
    return RenderableInjector.fromRenderable(
      renderable,
      [
        { provide: ContainerRef, useValue: this },
        ...providers
      ],
      this.injector
    )
      .get<T>(ConfiguredRenderable as any);
  }

  /**
   * Handles any cleanup from a drop.
   */
  handleDropCleanup(): void {}

  getMinimizedSize(): number {
    return 0;
  }

  getRenderableChildren(): Renderable[] {
    return this.getChildren().filter(item => item.isRenderable());
  }

  /**
   * Returns the active leaf nodes of the render tree from this node. Basically
   * the node at the end of the tree.
   * @returns {Renderable}
   */
  getLeafNodes(): Renderable[] {
    const children = this.getChildren();

    if (children.length) {
      return children.reduce<Renderable[]>((result, child) => {
        return result.concat(child.getLeafNodes());
      }, []);
    }

    return [ this ];
  }

  /**
   * Returns a serializer, serializer class or a configured serializer specifically for this renderable.
   * @returns {(BaseSerializerArg | null)}
   */
  getSerializer(): BaseSerializerArg | null {
    return this._config && this._config.serializer ? this._config.serializer : null;
  }

  /**
   * Whether this renderable can be dropped on.
   * @param {Renderable} target
   * @returns {boolean}
   */
  isDroppable(target: Renderable): boolean {
    return false;
  }

  getHeightForChild(): number {
    return this.height;
  }

  getWidthForChild(): number {
    return this.width;
  }

  isRenderable(): boolean {
    return true;
  }

  getActiveWindow(): Window | null {
    return this._container ? this._container.getActiveWindow() : null;
  }

  protected _matchesRenderable<T extends Renderable>(instance: T, query: Type<T>|Type<T>[]): boolean {
    const matches = q => instance instanceof q;

    return Array.isArray(query) ? query.some(matches) : matches(query);
  }
}


text:
import sys
import os
import string
import argparse
import logging

from math import ceil
from getpass import getpass

from PyQt5.QtWidgets import (
    QWidget,
    QToolTip,
    QPushButton,
    QApplication,
    QLineEdit, QFileDialog, QMessageBox, QLabel)

log = logging.getLogger(__name__)

logging.basicConfig(
    format='%(levelname)s: %(name)s:%(lineno)s: %(message)s',
    stream=sys.stdout,
    level=logging.ERROR,
)

class Encryption(object):
    alphabet = "".join(chr(x) for x in range(128))
    data = None
    key = ''
    extra_chars = ''

    def __init__(self, file_path, password):
        self.file_path = file_path
        self.password = password

    def read(self):
        log.info("Reading file: %r", self.file_path)
        with open(self.file_path, 'r') as file:
            self.data = file.read()
        log.debug("Data: %s", self.data)

    def save(self, postfix=""):
        log.info("Saving file: %r", self.file_path + postfix)
        with open(self.file_path + postfix, 'w+') as file:
            file.seek(0)
            file.write(self.data)
        log.debug("Data: %s", self.data)

    def get_blocks(self, blocks_amount, block_size):
        log.info("Preparing blocks.")
        log.debug(
            "Splitting data to %d blocks with size of %d characters",
            blocks_amount, block_size
        )

        blocks = []
        for i in range(blocks_amount):
            chunk = self.data[i*block_size:(i+1)*block_size]

            # Last block will be filled in with  first letters
            if len(chunk) < block_size:
                missing_chars = '.' * (block_size - len(chunk))
                log.debug(
                    "Filling in last block with characters: %s",
                    missing_chars
                )
                chunk += missing_chars

            blocks.append(chunk)

        log.debug("Blocks: \n%s", '\n'.join(blocks))
        return blocks

    def make_permutation(self):
        log.info("Making permutation.")

        data_length, blocks_amount = len(self.data), len(self.password)
        block_size = int(ceil(data_length / blocks_amount))
        blocks = self.get_blocks(blocks_amount, block_size)
        new_data = ''

        for idx in range(block_size):
            for block in blocks:
                new_data += block[idx]

        self.data = new_data
        log.debug("New data: %s", self.data)

    def revert_permutation(self):
        log.info("Reverting permutation.")

        block_size = len(self.password)
        blocks_amount = int(ceil(len(self.data) / block_size))
        blocks = self.get_blocks(blocks_amount, block_size)
        new_data = ''

        for idx in range(block_size):
            for block in blocks:
                if block[idx] != '.':
                    new_data += block[idx]

        self.data = new_data
        log.debug("New data: %s", self.data)

    def generate_key(self):
        log.info("Generating key.")

        data_length = len(self.data)
        repeat_times = int(ceil(data_length / len(self.password)))

        log.debug("Data length: %s", data_length)

        for idx in range(0, repeat_times + 1):
            for letter in self.password:
                new_letter_idx = self.alphabet.index(letter) + idx**2
                new_letter_idx %= len(self.alphabet)
                self.key += self.alphabet[new_letter_idx]

        self.key = self.key[:data_length]
        log.debug("Key length: %r", len(self.key))
        log.debug("Using key: %r", self.key)

    def make_polymorphism(self):
        log.info("Polymorphism.")

        data_indexes = [
            self.alphabet.index(letter)
            for letter in self.data
        ]
        log.debug("Data indexes: %s", data_indexes)

        key_indexes = [
            self.alphabet.index(letter)
            for letter in self.key
        ]
        log.debug("Key indexes: %s", key_indexes)

        sum_indexes = [
            data_indexes[i] + key_indexes[i]
            for i in range(len(self.data))
        ]
        log.debug("New data indexes: %s", sum_indexes)

        alphabet_length = len(self.alphabet)
        self.data = ''.join(
            self.alphabet[idx % alphabet_length]
            for idx in sum_indexes
        )
        log.debug("New data: %s", self.data)

    def revert_polymorphism(self):
        log.info("Polymorphism. Data: %r", self.data)

        data_indexes = [
            self.alphabet.index(letter)
            for letter in self.data
        ]
        log.debug("Data indexes: %s", data_indexes)

        key_indexes = [
            self.alphabet.index(letter)
            for letter in self.key
        ]
        log.debug("Key indexes: %s", key_indexes)

        sum_indexes = [
            data_indexes[i] - key_indexes[i]
            for i in range(len(self.data))
        ]
        log.debug("New data indexes: %s", sum_indexes)

        alphabet_length = len(self.alphabet)
        self.data = ''.join(
            self.alphabet[idx if idx < alphabet_length else alphabet_length - idx]
            for idx in sum_indexes
        )

        log.debug("New data: %s", self.data)

    def encode(self):
        self.read()
        self.make_permutation()
        self.generate_key()
        self.make_polymorphism()
        os.remove(self.file_path)
        self.save()

    def decode(self):
        self.read()
        self.generate_key()
        self.revert_polymorphism()
        self.revert_permutation()
        self.save(postfix='-decrypted')

class Example(QWidget):

    def __init__(self):
        super(Example, self).__init__()

        self.initUI()

    def initUI(self):

        input_label = QLabel("Select file path", self)
        input_label.move(50, 25)

        self.input_filepath = QLineEdit(self)
        self.input_filepath.move(50, 50)
        self.input_filepath.setReadOnly(True)
        self.input_filepath.resize(225, 20)

        btn_upload = QPushButton('Select', self)
        btn_upload.move(285, 45)
        btn_upload.clicked.connect(self.handle_upload)

        input_label = QLabel("Insert your password", self)
        input_label.move(50, 80)

        self.input_pwd = QLineEdit(self)
        self.input_pwd.setEchoMode(QLineEdit.Password)
        self.input_pwd.move(50, 105)
        self.input_pwd.resize(225, 20)

        btn = QPushButton('Encryption', self)
        btn.move(175, 150)
        btn.clicked.connect(self.handle_encode)

        btn = QPushButton('Decryption', self)
        btn.clicked.connect(self.handle_decode)
        btn.move(50, 150)

        btn = QPushButton('Info', self)
        btn.clicked.connect(self.handle_info)
        btn.move(300, 150)

        self.setGeometry(500, 500, 400, 220)
        self.setWindowTitle('Code')
        self.show()

    def validate_inputs(self):
        if not self.input_filepath.text() or not self.input_pwd.text():
            msg = QMessageBox(self)
            msg.setIcon(QMessageBox.Warning)
            msg.setText("You should provide file path and password.")
            msg.setWindowTitle("Validation")
            msg.exec_()
            return False
        return True

    def handle_encode(self):
        if self.validate_inputs():
            enc = Encryption(
                self.input_filepath.text(),
                self.input_pwd.text()
            )
            enc.encode()

            self.input_pwd.setText("")
            self.input_filepath.setText("")

            msg = QMessageBox(self)
            msg.setIcon(QMessageBox.Information)
            msg.setText("File encrypted")
            msg.setWindowTitle("Encryption")
            msg.exec_()

    def handle_decode(self):
        if self.validate_inputs():
            enc = Encryption(
                self.input_filepath.text(),
                self.input_pwd.text()
            )
            enc.decode()

            self.input_pwd.setText("")
            self.input_filepath.setText("")

            msg = QMessageBox(self)
            msg.setIcon(QMessageBox.Information)
            msg.setText("File decrypted")
            msg.setWindowTitle("Decryption")
            msg.exec_()

    def handle_info(self):
        msg = QMessageBox(self)
        msg.setIcon(QMessageBox.Information)
        msg.setText(
            "1. Decoded or Encoded file is saved in the same directory as you select file.\n"
            "2. Newly created file has '-decoded' or '-encoded' prefix.\n"
            "3. Key should be non empty ascii value.\n"
        )
        msg.setWindowTitle("Info")
        msg.exec_()

    def handle_upload(self):
        filename = QFileDialog.getOpenFileName(
            self, "File", "."
        )
        if filename[0]:
            self.input_filepath.setText(filename[0])
            log.debug('Path file :', filename)
        self.show()

if __name__ == '__main__':
    app = QApplication(sys.argv)
    ex = Example()
    app.exec_()

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 * widget: bookmarks
 *
 * @author Javis <javismay@gmail.com>
 * @license MIT
 */

add_action( 'widgets_init', create_function('', 'return register_widget("lo_bookmarks");'));

class lo_bookmarks extends WP_Widget {
	function lo_bookmarks() {
		$widget_ops = array( 'classname' => 'lo_bookmarks', 'description' => '友情链接' );
		$this->__construct( 'lo_bookmarks', '友情链接', $widget_ops );
	}

	function widget( $args, $instance ) {
		extract( $args );
		$title = apply_filters('widget_name', $instance['title']);
		$cate = $instance['cate'];
		$limit = $instance['limit'];

		echo $before_widget;
		echo $before_title.$title.$after_title;
		echo '
';
		echo lo_bookmarks($cate, $limit);
		echo '
';
		echo $after_widget;
	}
	function form($instance) {

?>

				标题:
				<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $instance['title']; ?>" />

				分类:
				<select class="widefat" id="<?php echo $this->get_field_id('cate'); ?>" name="<?php echo $this->get_field_name('cate'); ?>" style="width:100%;">
					<?php
					$cates = bookmarks_cate();
					foreach($cates as $key=>$value){
						echo '<option value="'.$key.'" ';
						selected($key, $instance['cate']);
						echo '>'.$value.'</option>';
					}
					?>
				</select>

				显示数目:
				<input class="widefat" id="<?php echo $this->get_field_id('limit'); ?>" name="<?php echo $this->get_field_name('limit'); ?>" type="number" value="<?php echo $instance['limit']; ?>" />

<?php
	}
}

function lo_bookmarks($id,$limits){
		if(! $limits) $limits = -1;
		$bookmarks = get_bookmarks('orderby=date&category=' .$id .'&limit='.$limits);
	    $output = '';
	    if ( !empty($bookmarks) ) {
	        foreach ($bookmarks as $bookmark) {
	            $output .=  '
link_url . '">link_url . '" title="' . $bookmark->link_description . '" target="_blank" >'.  $bookmark->link_name .'
';
	        }
	    }
	    return $output;
}

?>


text:
package se.claremont.autotest.common;

import org.junit.Assert;
import org.junit.Test;

/**
 *
 * Tests for the TestCase class
 *
 * Created by jordam on 2016-08-30.
 */
public class TestCase_Tests {

    @Test
    public void matchOfSeveralStringsInitial(){
        TestCase testCase = new TestCase(new KnownErrorsList(), "TestCase_Tests");
        String[] patterns = {"Pattern1", "Pattern2"};
        testCase.addKnownError("Description", patterns);
        Assert.assertTrue("Test case status expected to be '" + TestCase.ResultStatus.UNEVALUATED.toString() + "', but was '" + testCase.resultStatus.toString() + "'.", testCase.resultStatus.equals(TestCase.ResultStatus.UNEVALUATED));
    }

    @Test
    public void matchOfSeveralStringsNoError(){
        TestCase testCase = new TestCase(new KnownErrorsList(), "TestCase_Tests");
        String[] patterns = {"Pattern1", "Pattern2"};
        testCase.addKnownError("Description", patterns);
        testCase.testCaseLog.log(LogLevel.EXECUTED, "Pattern0");
        testCase.evaluateResultStatus();
        Assert.assertTrue("Test case status expected to be '" + TestCase.ResultStatus.PASSED.toString() + "', but was '" + testCase.resultStatus.toString() + "'.", testCase.resultStatus.equals(TestCase.ResultStatus.PASSED));
    }

    @Test
    public void matchOfSeveralStringsMatch(){
        TestCase testCase = new TestCase(new KnownErrorsList(), "TestCase_Tests");
        String[] patterns = {"Pattern1", "Pattern2"};
        testCase.addKnownError("Description", patterns);
        testCase.testCaseLog.log(LogLevel.VERIFICATION_PROBLEM, "Pattern1");
        testCase.testCaseLog.log(LogLevel.VERIFICATION_PROBLEM, "Pattern2");
        testCase.evaluateResultStatus();
        Assert.assertTrue("Test case status expected to be '" + TestCase.ResultStatus.FAILED_WITH_ONLY_KNOWN_ERRORS.toString() + "', but was '" + testCase.resultStatus.toString() + "'.", testCase.resultStatus.equals(TestCase.ResultStatus.FAILED_WITH_ONLY_KNOWN_ERRORS));
    }

    @Test
    public void matchOfSeveralStringsBothMatchAndOtherErrors(){
        TestCase testCase = new TestCase(new KnownErrorsList(), "TestCase_Tests");
        String[] patterns = {"Pattern1", "Pattern2"};
        testCase.addKnownError("Description", patterns);
        testCase.testCaseLog.log(LogLevel.VERIFICATION_PROBLEM, "Pattern1");
        testCase.testCaseLog.log(LogLevel.VERIFICATION_PROBLEM, "Pattern2");
        testCase.testCaseLog.log(LogLevel.VERIFICATION_PROBLEM, "Pattern3");
        testCase.evaluateResultStatus();
        Assert.assertTrue("Test case status expected to be '" + TestCase.ResultStatus.FAILED_WITH_BOTH_NEW_AND_KNOWN_ERRORS.toString() + "', but was '" + testCase.resultStatus.toString() + "'.", testCase.resultStatus.equals(TestCase.ResultStatus.FAILED_WITH_BOTH_NEW_AND_KNOWN_ERRORS));
    }

    @Test
    public void matchOfSeveralStringsOnlyNewErrors(){
        TestCase testCase = new TestCase(new KnownErrorsList(), "TestCase_Tests");
        String[] patterns = {"Pattern1", "Pattern2"};
        testCase.addKnownError("Description", patterns);
        testCase.testCaseLog.log(LogLevel.EXECUTED, "Pattern0");
        testCase.testCaseLog.log(LogLevel.VERIFICATION_PROBLEM, "Pattern2");
        testCase.testCaseLog.log(LogLevel.VERIFICATION_PROBLEM, "Pattern3");
        testCase.evaluateResultStatus();
        Assert.assertTrue("Test case status expected to be '" + TestCase.ResultStatus.FAILED_WITH_ONLY_NEW_ERRORS.toString() + "', but was '" + testCase.resultStatus.toString() + "'.", testCase.resultStatus.equals(TestCase.ResultStatus.FAILED_WITH_ONLY_NEW_ERRORS));
    }

    @Test
    public void testCaseDataAddingAndReading(){
        TestCase testCase = new TestCase(new KnownErrorsList(), "TestCase_Tests");
        testCase.addTestCaseData("Parameter name", "Parameter data");
        Assert.assertTrue("Test case data was expected to be 'Parameter data' but was '"  + testCase.valueForFirstMatchForTestCaseDataParameter("Parameter name"), testCase.valueForFirstMatchForTestCaseDataParameter("Parameter name").equals("Parameter data"));
    }

    @Test
    public void testCaseDataNoMatchIsEmptyString(){
        TestCase testCase = new TestCase(new KnownErrorsList(), "TestCase_Tests");
        testCase.addTestCaseData("Parameter name", "Parameter data");
        Assert.assertTrue(testCase.valueForFirstMatchForTestCaseDataParameter("Wrong Parameter name").equals(""));
    }

    @Test
    public void testCaseDataMultipleMatches(){
        TestCase testCase = new TestCase(new KnownErrorsList(), "TestCase_Tests");
        testCase.addTestCaseData("Parameter name", "Parameter data");
        testCase.addTestCaseData("Parameter name", "Parameter data 2");
        Assert.assertTrue(testCase.valueForFirstMatchForTestCaseDataParameter("Parameter name").equals("Parameter data"));
    }

    @Test
    public void isSameAsTest(){
        TestCase testCase = new TestCase(new KnownErrorsList(), "isSameAsTest");
        TestCase testCase2 = new TestCase(new KnownErrorsList(), "isSameAsTest");
        Assert.assertTrue(testCase.isSameAs(testCase));
        Assert.assertFalse(testCase.isSameAs(testCase2));
    }

}


text:
package com.AleXander;

/**
 * Created by alexcory on 7/23/14.
 */
public class RegularStop {
}


text:
package com.amazonaws.services.codecommit.model;

import javax.annotation.Generated;

/**
 * <p>
 * The number of branches for the trigger was exceeded.
 * </p>
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class MaximumBranchesExceededException extends com.amazonaws.services.codecommit.model.AWSCodeCommitException {
    private static final long serialVersionUID = 1L;

    /**
     * Constructs a new MaximumBranchesExceededException with the specified error message.
     *
     * @param message
     *        Describes the error encountered.
     */
    public MaximumBranchesExceededException(String message) {
        super(message);
    }

}


text:
package subscription

import (
	"errors"
	"fmt"

	"knative.dev/client/pkg/config"
	messagingv1 "knative.dev/eventing/pkg/apis/messaging/v1"

	"github.com/spf13/cobra"

	knerrors "knative.dev/client/pkg/errors"
	"knative.dev/client/pkg/kn/commands"
	"knative.dev/client/pkg/kn/commands/flags"
	knmessagingv1 "knative.dev/client/pkg/messaging/v1"
)

// NewSubscriptionUpdateCommand to update event subscriptions
func NewSubscriptionUpdateCommand(p *commands.KnParams) *cobra.Command {
	var subscriberFlag, replyFlag, dlsFlag flags.SinkFlags
	cmd := &cobra.Command{
		Use:   "update NAME",
		Short: "Update an event subscription",
		Example: `
  # Update a subscription 'sub0' with a subscriber ksvc 'receiver'
  kn subscription update sub0 --sink ksvc:receiver

  # Update a subscription 'sub1' with subscriber ksvc 'mirror', reply to a broker 'nest' and DeadLetterSink to a ksvc 'bucket'
  kn subscription update sub1 --sink mirror --sink-reply broker:nest --sink-dead-letter bucket`,
		ValidArgsFunction: commands.ResourceNameCompletionFunc(p),
		RunE: func(cmd *cobra.Command, args []string) (err error) {
			if len(args) != 1 {
				return errors.New("'kn subscription update' requires the subscription name given as single argument")
			}
			name := args[0]

			namespace, err := p.GetNamespace(cmd)
			if err != nil {
				return err
			}

			dynamicClient, err := p.NewDynamicClient(namespace)
			if err != nil {
				return err
			}

			client, err := newSubscriptionClient(p, cmd)
			if err != nil {
				return err
			}

			updateFunc := func(origSub *messagingv1.Subscription) (*messagingv1.Subscription, error) {
				sb := knmessagingv1.NewSubscriptionBuilderFromExisting(origSub)

				sub, err := subscriberFlag.ResolveSink(cmd.Context(), dynamicClient, namespace)
				if err != nil {
					return nil, err
				}
				sb.Subscriber(sub)

				rep, err := replyFlag.ResolveSink(cmd.Context(), dynamicClient, namespace)
				if err != nil {
					return nil, err
				}
				sb.Reply(rep)

				ds, err := dlsFlag.ResolveSink(cmd.Context(), dynamicClient, namespace)
				if err != nil {
					return nil, err
				}
				sb.DeadLetterSink(ds)
				return sb.Build(), nil
			}
			err = client.UpdateSubscriptionWithRetry(cmd.Context(), name, updateFunc, config.DefaultRetry.Steps)
			if err != nil {
				return knerrors.GetError(err)
			}

			fmt.Fprintf(cmd.OutOrStdout(), "Subscription '%s' updated in namespace '%s'.\n", name, namespace)
			return nil
		},
	}
	commands.AddNamespaceFlags(cmd.Flags(), false)
	// add subscriber flag as `--sink`
	subscriberFlag.Add(cmd)
	replyFlag.AddWithFlagName(cmd, "sink-reply", "")
	dlsFlag.AddWithFlagName(cmd, "sink-dead-letter", "")
	return cmd
}


text:
from django.core.urlresolvers import reverse

from .base import TestBase
from ..models import ProfileUpdateRequest, Person, KnowledgeDomain, Lesson

class TestProfileUpdateRequest(TestBase):
    def setUp(self):
        self._setUpAirports()
        self._setUpLessons()
        self._setUpBadges()
        self._setUpInstructors()
        self._setUpUsersAndLogin()

    def test_request_added(self):
        """Test if ProfileUpdateRequest is successfully added."""
        data = {
            'recaptcha_response_field': 'PASSED',  # to auto-pass RECAPTCHA
            'personal': 'Harry', 'family': 'Potter',
            'email': 'harry@potter.com', 'airport_iata': 'LON',
            'affiliation': 'Auror at Ministry of Magic',
            'occupation': '', 'occupation_other': 'Auror',
            'github': 'hpotter', 'twitter': 'hpotter',
            'orcid': '', 'website': '', 'gender': 'M',
            'domains': [1, 2],  # IDs
            'lessons': [1, 2],  # IDs
        }
        rv = self.client.post(reverse('profileupdate_request'), data)
        assert rv.status_code == 200
        content = rv.content.decode('utf-8')
        assert 'Fix errors below' not in content
        assert \
            'Thank you for updating your instructor profile' in content
        assert ProfileUpdateRequest.objects.all().count() == 1
        assert ProfileUpdateRequest.objects.all()[0].active is True

        # Not testing if emails are sent because we don't send them out for
        # profile updates for now.

    def test_request_discarded(self):
        """Ensure the request is discarded properly."""
        # add a minimal request
        pr = ProfileUpdateRequest.objects.create(
            personal='Harry', family='Potter', email='harry@potter.com',
            airport_iata='LON', affiliation='Hogwarts',
        )
        rv = self.client.get(reverse('profileupdaterequest_discard',
                                     args=[pr.pk]))
        assert rv.status_code == 302
        pr.refresh_from_db()
        assert not pr.active

    def test_request_match_person(self):
        "Check the details of ProfileUpdateRequest when it matches a Person."
        pr = ProfileUpdateRequest.objects.create(
            personal='Harry', family='Potter', email='harry@potter.com',
            airport_iata='LON', affiliation='Hogwarts', active=True,
        )
        rv = self.client.get(reverse('profileupdaterequest_details',
                                     args=[pr.pk]))
        content = rv.content.decode('utf-8')

        msg = ('No-one matches this email (harry@potter.com) '
               'or name (Harry Potter).')
        assert msg not in content
        assert rv.context['old']  # 'old' contains person from the DB

    def test_request_not_match(self):
        """Check the details of ProfileUpdateRequest when it doesn't match any
        Person."""
        pr = ProfileUpdateRequest.objects.create(
            personal='Warry', family='Trotter', email='warry@trotter.com',
            airport_iata='LON', affiliation='Hogwarts', active=True,
        )
        rv = self.client.get(reverse('profileupdaterequest_details',
                                     args=[pr.pk]))
        content = rv.content.decode('utf-8')

        msg = ('No-one matches this email (warry@trotter.com) '
               'or name (Warry Trotter).')
        assert msg in content
        assert not rv.context['old']  # 'old' contains person from the DB

    def test_request_accepted(self):
        """Ensure ProfileUpdateRequest gets rewritten correctly to the selected
        Person."""
        person = Person.objects.get(personal='Harry', family='Potter')
        pr = ProfileUpdateRequest.objects.create(
            active=True,
            personal='Warry', family='Trotter', email='warry@trotter.com',
            affiliation='Auror at Ministry of Magic', airport_iata='AAA',
            occupation='', occupation_other='Auror',
            github='hpotter', twitter='hpotter',
            orcid='', website='http://warry.trotter.com/', gender='M',
        )
        pr.domains.add(*KnowledgeDomain.objects.all()[0:2]),
        pr.lessons.add(*Lesson.objects.all()[0:2]),
        rv = self.client.get(reverse('profileupdaterequest_accept',
                                     args=[pr.pk, person.pk]))
        assert rv.status_code == 302, rv.status_code

        person.refresh_from_db()
        assert person.personal == 'Warry'
        assert person.family == 'Trotter'
        assert person.email == 'warry@trotter.com'
        assert person.affiliation == 'Auror at Ministry of Magic'
        assert person.airport.iata == 'AAA'
        assert person.github == person.twitter == 'hpotter'
        assert person.url == 'http://warry.trotter.com/'
        assert person.gender == 'M'
        assert set(person.domains.all()) == \
            set(KnowledgeDomain.objects.all()[0:2])
        assert set(person.lessons.all()) == set(Lesson.objects.all()[0:2])

class TestProfileUpdateRequestsViews(TestBase):
    def setUp(self):
        self._setUpAirports()
        self._setUpLessons()
        self._setUpBadges()
        self._setUpInstructors()
        self._setUpUsersAndLogin()

        self.pur1 = ProfileUpdateRequest.objects.create(
            active=True, personal="Harry", family="Potter",
            email="harry@potter.com", airport_iata='AAA',
            affiliation='Hogwarts',
        )
        self.pur2 = ProfileUpdateRequest.objects.create(
            active=False, personal="Harry", family="Potter",
            email="harry@potter.com", airport_iata='AAA',
            affiliation='Hogwarts',
        )

    def test_active_requests_list(self):
        rv = self.client.get(reverse('all_profileupdaterequests'))
        assert self.pur1 in rv.context['object_list']
        assert self.pur2 not in rv.context['object_list']

    def test_inactive_requests_list(self):
        rv = self.client.get(reverse('all_closed_profileupdaterequests'))
        assert self.pur1 not in rv.context['object_list']
        assert self.pur2 in rv.context['object_list']

    def test_active_request_view(self):
        rv = self.client.get(reverse('profileupdaterequest_details',
                                     args=[self.pur1.pk]))
        assert rv.status_code == 200

    def test_inactive_request_view(self):
        rv = self.client.get(reverse('profileupdaterequest_details',
                                     args=[self.pur2.pk]))
        assert rv.status_code == 200

    def test_active_request_accept(self):
        rv = self.client.get(reverse('profileupdaterequest_accept',
                                     args=[self.pur1.pk, self.harry.pk]),
                             follow=True)
        assert rv.status_code == 200

    def test_inactive_request_accept(self):
        rv = self.client.get(reverse('profileupdaterequest_accept',
                                     args=[self.pur2.pk, self.harry.pk]),
                             follow=True)
        assert rv.status_code != 200

    def test_active_request_discard(self):
        rv = self.client.get(reverse('profileupdaterequest_discard',
                                     args=[self.pur1.pk]), follow=True)
        assert rv.status_code == 200

    def test_inactive_request_discard(self):
        rv = self.client.get(reverse('profileupdaterequest_discard',
                                     args=[self.pur2.pk]), follow=True)
        assert rv.status_code != 200


text:
#ifndef GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURITY_HANDSHAKER_H
#define GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURITY_HANDSHAKER_H

#include "src/core/lib/channel/handshaker.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/security/transport/security_connector.h"

/// Creates a security handshaker using \a handshaker.
grpc_handshaker *grpc_security_handshaker_create(
    grpc_exec_ctx *exec_ctx, tsi_handshaker *handshaker,
    grpc_security_connector *connector);

#endif /* GRPC_CORE_LIB_SECURITY_TRANSPORT_SECURITY_HANDSHAKER_H */


text:
#ifndef _COLLECTOR_DAEMON_H_
#define _COLLECTOR_DAEMON_H_

#include <vector>

#include "condor_classad.h"
#include "condor_commands.h"
#include "totals.h"
#include "forkwork.h"

#include "collector_engine.h"
#include "collector_stats.h"
#include "dc_collector.h"
#include "offline_plugin.h"

//----------------------------------------------------------------
// Simple job universe stats
//----------------------------------------------------------------
class CollectorUniverseStats {
  public:
	CollectorUniverseStats( void );
	CollectorUniverseStats( CollectorUniverseStats & );
	~CollectorUniverseStats( void );
	void Reset( void );
	void accumulate( int univ );
	int getValue( int univ );
	int getCount( void );
	int setMax( CollectorUniverseStats & );
	const char *getName( int univ );
	int publish( const char *label, ClassAd *cad );

  private:
	int perUniverse[CONDOR_UNIVERSE_MAX];
	int count;

};

/**----------------------------------------------------------------
 *Collector daemon class declaration
 *
 * TODO: Eval notes and refactor when time permits.
 *
 * REVIEW NOTES per TSTCLAIR
 * DESIGN (General):
 * 1.) It seems rather odd to have such a large static interface then
 * a few virtual functions.  This basically violates all rules of
 * practical design and should likely be cleaned up.  Either is is
 * a static singleton (something which is omni-present), or it is not.
 * There are templated header only constructs namely boost::bind &&
 * boost::function which get around the idea of generic function
 * pointers and should likely be used.  This will likely reduce the
 * public interface to just a few functions.
 *
 * 2.) I think that each daemon detailed knowledge of *any* communications
 * protocol is a bad thing.  It makes the daemon tightly bound to any
 * mode of transport & protocol, and very difficult to adapt over time.
 *
 * 3.) doxygen comments with real comments to explain why something
 * was done.
 *
 * 4.) consider a new object which performs the scanning functionality so all
 * scans within the collector access that object.  It seems sloppy to have it parseled
 * throughout the collector, on different calls to "CollectorEngine::walkHasTable"  You could
 * also consolidate the stats under that umbrella b/c the data is there.
 *
 *----------------------------------------------------------------*/
class CollectorDaemon {

public:

	CollectorDaemon() {};
	virtual ~CollectorDaemon() {};

	virtual void Init();             // main_init
	virtual void Config();           // main_config
	virtual void Exit();             // main__shutdown_fast
	virtual void Shutdown();         // main_shutdown_graceful
	// command handlers
	static int receive_query_cedar(Service*, int, Stream*);
	static AdTypes receive_query_public( int );
	static int receive_invalidation(Service*, int, Stream*);
	static int receive_update(Service*, int, Stream*);
    static int receive_update_expect_ack(Service*, int, Stream*);

	static void process_query_public(AdTypes, ClassAd*, List<ClassAd>*);
	static ClassAd * process_global_query( const char *constraint, void *arg );
	static int select_by_match( ClassAd *cad );
	static void process_invalidation(AdTypes, ClassAd&, Stream*);

	static int query_scanFunc(ClassAd*);
	static int invalidation_scanFunc(ClassAd*);
	static int expiration_scanFunc(ClassAd*);

	static int reportStartdScanFunc(ClassAd*);
	static int reportSubmittorScanFunc(ClassAd*);
	static int reportMiniStartdScanFunc(ClassAd *cad);

	static void reportToDevelopers();

	static int sigint_handler(Service*, int);
	static void unixsigint_handler();

	static void init_classad(int interval);
	static void sendCollectorAd();

	static void forward_classad_to_view_collector(int cmd, const char *filterAttr, ClassAd *ad);
	static void send_classad_to_sock(int cmd, ClassAd* theAd);

	// A get method to support SOAP
	static CollectorEngine & getCollector( void ) { return collector; };

    // data pertaining to each view collector entry
    struct vc_entry {
        std::string name;
        DCCollector* collector;
        Sock* sock;
    };

    static OfflineCollectorPlugin offline_plugin_;

protected:
	static CollectorStats collectorStats;
	static CollectorEngine collector;
	static Timeslice view_sock_timeslice;
    static std::vector<vc_entry> vc_list;

	static int ClientTimeout;
	static int QueryTimeout;
	static char* CollectorName;

	static ClassAd query_any_request;
	static ClassAd *query_any_result;

	static ClassAd* __query__;
	static List<ClassAd>* __ClassAdResultList__;
	static int __numAds__;
	static int __failed__;
	static std::string __adType__;
	static ExprTree *__filter__;

	static TrackTotals* normalTotals;
	static int submittorRunningJobs;
	static int submittorIdleJobs;
	static int submittorNumAds;

	static int machinesTotal,machinesUnclaimed,machinesClaimed,machinesOwner;
	static int startdNumAds;

	static CollectorUniverseStats ustatsAccum;
	static CollectorUniverseStats ustatsMonthly;

	static ClassAd *ad;
	static CollectorList* collectorsToUpdate;
	static DCCollector* worldCollector;
	static int UpdateTimerId;

	static ForkWork forkQuery;

	static int stashSocket( ReliSock* sock );

	static class CCBServer *m_ccb_server;

	static bool filterAbsentAds;

private:

	static int setAttrLastHeardFrom( ClassAd* cad, unsigned long time );

};

#endif


text:
<!DOCTYPE html>

  <title>Git diary test</title>

    <input type="button" style="font-size:2.5em;font-weight:bold;" value="Add diary entry" onClick="user_prompt();">

To test, create credentials.js:

var token = ""
var login = ""
var user  = ""
var repo  = ""
var testing = false


text:
package reflectx

import (
	"encoding/json"
	"reflect"

	"github.com/apache/beam/sdks/go/pkg/beam/internal/errors"
)

// UnmarshalJSON decodes a json string as then given type. It is suitable
// for when the type is not statically known.
func UnmarshalJSON(t reflect.Type, str string) (interface{}, error) {
	data := reflect.New(t).Interface()
	if err := json.Unmarshal([]byte(str), data); err != nil {
		return nil, errors.Wrap(err, "failed to decode data")
	}
	return reflect.ValueOf(data).Elem().Interface(), nil
}


text:
require 'spec_helper'

describe Acfs::Configuration do
  let(:cfg) { Acfs::Configuration.new }
  before { @configuration = Acfs::Configuration.current.dup }
  after { Acfs::Configuration.set @configuration }

  describe 'Acfs.configure' do
    it 'should invoke configure on current configuration' do
      expect(Acfs::Configuration.current).to receive(:configure).once.and_call_original

      Acfs.configure do |c|
        expect(c).to be_a Acfs::Configuration
      end
    end
  end

  describe '.load' do
    it 'should be able to load YAML' do
      cfg.configure do
        load 'spec/fixtures/config.yml'
      end

      expect(cfg.locate(UserService).to_s).to be == 'http://localhost:3001/'
      expect(cfg.locate(CommentService).to_s).to be == 'http://localhost:3002/'
    end

    context 'with RACK_ENV' do
      before { @env = ENV['RACK_ENV']; ENV['RACK_ENV'] = 'production' }
      after  { ENV['RACK_ENV'] = @env }

      it 'should load ENV block' do
        cfg.configure do
          load 'spec/fixtures/config.yml'
        end

        expect(cfg.locate(UserService).to_s).to be == 'http://user.example.org/'
        expect(cfg.locate(CommentService).to_s).to be == 'http://comment.example.org/'
      end
    end
  end
end


text:
@interface UIImage (ZPMLib)

+ (UIImage *)pbba_errorImage;
+ (UIImage *)pbba_pbbaTitleImage;
+ (UIImage *)pbba_zappCodeImage;

+ (UIImage *)pbba_imageNamed:(NSString *)imageName;
+ (UIImage *)pbba_templateImageNamed:(NSString *)imageName;

- (UIImage *)pbba_templateImage;
- (UIImage *)pbba_tintedWithColor:(UIColor *)color;

@end


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">
    <meta name="google-site-verification" content="Q5QXm1F3WD23DUjJtYwOYUK1PUDXQkyVXEq3rxZ3IY8" />

    <title>Games</title>
    <meta name="description" content="                Simblocity      Fast frantic match 3 action!              more info      ">

    <link rel="stylesheet" href="/css/main.css">
    <link rel="stylesheet" href="/css/font-awesome.min.css">

    <link rel="stylesheet" href="/css/owl.carousel.css">
    <link rel="stylesheet" href="/css/owl.theme.css">

    <link rel="stylesheet" href="/css/nivo-lightbox/nivo-lightbox.css">
    <link rel="stylesheet" href="/css/animate.css">

    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
    <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
    <link rel="manifest" href="/manifest.json">
    <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
    <meta name="theme-color" content="#ffffff">

    <link rel="shortcut icon" href="/favicon.ico?1">

<title>Games | eligendi games</title>
<meta property="og:title" content="Games" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="Simblocity Fast frantic match 3 action! more info" />
<meta property="og:description" content="Simblocity Fast frantic match 3 action! more info" />
<link rel="canonical" href="http://localhost:4000/games/" />
<meta property="og:url" content="http://localhost:4000/games/" />
<meta property="og:site_name" content="eligendi games" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2019-11-09T21:18:45+00:00" />

    <link rel="canonical" href="http://localhost:4000/games/">
    <link rel="alternate" type="application/rss+xml" title="eligendi games" href="http://localhost:4000/feed.xml" />

            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
        Toggle navigation

      </button>

                 eligendi games

Games

Contact Us

Simblocity

Fast frantic match 3 action!

      more info

            eligendi games 2019 |
            Powered by Jekyll


text:
The Python client to the [LedisDB](https://github.com/siddontang/ledisdb) key-value store.

##Installation

ledis-py requires a running ledisdb server. See [ledisdb guide](https://github.com/siddontang/ledisdb#build-and-install) for installation instructions.

To install ledis-py, simply using `pip`(recommended):

```
$ sudo pip install ledis
```

or alternatively, using `easy_install`:

```
$ sudo easy_install ledis
```

or install from the source:

```
$ sudo python setup.py install
```

##Getting Started

```
>>> import ledis
>>> l = ledis.Ledis(host='localhost', port=6380, db=0)
>>> l.set('foo', 'bar')
True
>>> l.get('foo')
'bar'
>>>
```

## API Reference

For full API reference, please visit [rtfd](http://ledis-py.readthedocs.org/).

## Connection

### Connection Pools

Behind the scenes, ledis-py uses a connection pool to manage connections to a Ledis server. By default, each Ledis instance you create will in turn create its own connection pool. You can override this behavior and use an existing connection pool by passing an already created connection pool instance to the connection_pool argument of the Ledis class. You may choose to do this in order to implement client side sharding or have finer grain control of how connections are managed.

```
>>> pool = ledis.ConnectionPool(host='localhost', port=6380, db=0)
>>> l = ledis.Ledis(connection_pool=pool)
```

### Connections

ConnectionPools manage a set of Connection instances. ledis-py ships with two types of Connections. The default, Connection, is a normal TCP socket based connection. The UnixDomainSocketConnection allows for clients running on the same device as the server to connect via a unix domain socket. To use a UnixDomainSocketConnection connection, simply pass the unix_socket_path argument, which is a string to the unix domain socket file. Additionally, make sure the unixsocket parameter is defined in your `ledis.json` file. e.g.:

```
{
    "addr": "/tmp/ledis.sock",
    ...
}
```

```
>>> l = ledis.Ledis(unix_socket_path='/tmp/ledis.sock')
```

You can create your own Connection subclasses as well. This may be useful if you want to control the socket behavior within an async framework. To instantiate a client class using your own connection, you need to create a connection pool, passing your class to the connection_class argument. Other keyword parameters your pass to the pool will be passed to the class specified during initialization.

```
>>> pool = ledis.ConnectionPool(connection_class=YourConnectionClass,
                                your_arg='...', ...)
```

e.g.:

```
>>> from ledis import UnixDomainSocketConnection
>>> pool = ledis.ConnectionPool(connection_class=UnixDomainSocketConnection, path='/tmp/ledis.sock')
```

## Response Callbacks

The client class uses a set of callbacks to cast Ledis responses to the appropriate Python type. There are a number of these callbacks defined on the Ledis client class in a dictionary called RESPONSE_CALLBACKS.

Custom callbacks can be added on a per-instance basis using the `set_response_callback` method. This method accepts two arguments: a command name and the callback. Callbacks added in this manner are only valid on the instance the callback is added to. If you want to define or override a callback globally, you should make a subclass of the Ledis client and add your callback to its RESPONSE_CALLBACKS class dictionary.

Response callbacks take at least one parameter: the response from the Ledis server. Keyword arguments may also be accepted in order to further control how to interpret the response. These keyword arguments are specified during the command's call to execute_command. The ZRANGE implementation demonstrates the use of response callback keyword arguments with its "withscores" argument.


text:
FHL.STR.eachFitDo = (function () {
  function eachFitDo(regPattern, strTest, fnDoEach) {
    /// <summary> matchResult = exec(strTest), 回傳值會作為 callback whenExec 的第1個參數, 通常取 matchResult[0] 是字串 </summary>
    /// <param type="function()" name="fnDoEach" parameterArray="false"> while( match = regex.match(strTest)) fnDoEach(match) </param>
    var exp1 = new RegExp(regPattern, 'g');
    var match = null;
    while ((match = exp1.exec(strTest)) !== null) {
      fnDoEach(match);
    }
  }
  return eachFitDo
})()


text:
package com.vsked;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan({"com.vsked.config","com.vsked.service","com.vsked.controller"})
@SpringBootApplication
public class Application {

	public static void main(String[] args) {
		SpringApplication.run(Application.class, args);
	}

}


text:
from __future__ import unicode_literals
from copy import deepcopy
from lxml import etree
from docutil.str_util import normalize, find_list, find_sentence,\
        smart_decode, clean_breaks

XTEXT = etree.XPath("string()")
XSCRIPTS = etree.XPath(".//script")
PARAGRAPHS = {'div', 'p'}

def texttail(text, tail):
    if text is None:
        text = ''
    else:
        text = text + ' '

    if tail is None:
        tail = ''

    return '{0}{1}'.format(text, tail).strip()

def get_recursive_text(element, text_parts):
    # Terminal
    if element.tag == 'pre':
        text_parts.append('')
        text_parts.append(XTEXT(element))
        text_parts.append('')
    # Terminal
    elif element.tag == 'br':
        tail = element.tail
        # This is a lone <br>
        if tail is None:
            text_parts.append('')
        else:
            text_parts.append(clean_breaks(smart_decode(tail).strip()))
    else:
        if element.tag in PARAGRAPHS:
            text_parts.append('')

        text = element.text
        if text is None:
            text = ''

        # If it is a paragraph, separate the content.
        # Otherwise, inline the content with previous line.
        if element.tag in PARAGRAPHS or len(text_parts) == 0:
            text_parts.append(clean_breaks(smart_decode(text).strip()))
        else:
            text_parts[-1] = '{0} {1}'.format(
                    text_parts[-1], clean_breaks(smart_decode(text).strip()))

        for child in element:
            get_recursive_text(child, text_parts)

        if element.tag in PARAGRAPHS:
            text_parts.append('')

        tail = element.tail
        if tail is None:
            tail = ''

        # If it is a paragraph, separate the content.
        # Otherwise, inline the content with previous line.
        if element.tag in PARAGRAPHS or len(text_parts) == 0:
            text_parts.append(clean_breaks(smart_decode(tail).strip()))
        else:
            text_parts[-1] = '{0} {1}'.format(
                    text_parts[-1], clean_breaks(smart_decode(tail).strip()))

def get_html_tree(ucontent, encoding=None):
    if encoding is not None:
        parser = etree.HTMLParser(remove_comments=True, encoding=encoding)
    else:
        parser = etree.HTMLParser(remove_comments=True)

    tree = etree.fromstring(ucontent, parser)
    tree = tree.getroottree()
    clean_tree(tree)
    return tree

def clean_tree(tree):
    etree.strip_elements(tree, 'script', with_tail=False)

def get_word_count(elements):
    word_count = 0
    for element in elements:
        word_count += len(XTEXT(element).split())

    return word_count

def get_word_count_text(text):
    return len(text.split())

def get_text(element, xtext=XTEXT):
    return normalize(xtext(element))

def get_text_context(element, xtext=XTEXT):
    text = ''
    parent = element.getparent()
    if parent is not None:
        text = get_text(parent, xtext)
    return text.strip()

def get_sentence(element, element_text, text_context, xtext=XTEXT):
    indexes = find_list(text_context, element_text)
    size = len(indexes)
    if size == 0:
        return ''
    elif size == 1:
        return find_sentence(text_context, indexes[0],
                indexes[0] + len(element_text))
    else:
        parent = element.getparent()
        child_index_in_parent = 0
        for child in parent:
            if child == element:
                break
            else:
                temp_text = normalize(xtext(child))
                # We have encountered a child that has the same text,
                # so the first index is not the good one.
                if temp_text.find(element_text) != -1:
                    child_index_in_parent += 1

        if child_index_in_parent < size:
            return find_sentence(text_context, indexes[child_index_in_parent],
                    indexes[child_index_in_parent] + len(element_text))
        else:
            # Something went wrong.
            return find_sentence(element_text, indexes[0],
                    indexes[0] + len(element_text))

def get_complex_text(element):
    text_parts = []
    get_recursive_text(element, text_parts)
    text = '\n'.join(text_parts)
    return text

class XPathList(object):
    def __init__(self, xpath_strs, xtext=XTEXT):
        xpaths = []
        for xpath_str in xpath_strs:
            xpaths.append(etree.XPath(xpath_str))
        self.xpaths = xpaths
        self.xtext = xtext

    def get_element(self, parent, index=0):
        elem = None
        elems = self.get_elements(parent)
        if len(elems) > 0:
            elem = elems[index]
        return elem

    def get_element_as_list(self, element):
        return [element]

    def get_elements(self, parent):
        elems = []
        for xpath in self.xpaths:
            temp = xpath(parent)
            if len(temp) > 0:
                elems = temp
                break
        return elems

    def get_text_from_parent(self, parent, index=0, complex_text=False):
        text = ''
        elem = self.get_element(parent, index)
        if elem is not None:
            text = self.get_text(elem, complex_text)
        return normalize(text)

    def get_text(self, element, complex_text=False):
        if complex_text:
            text = get_complex_text(element)
        else:
            text = self.xtext(element)
        return normalize(text)

class SingleXPath(object):
    def __init__(self, xpath_str, xtext=XTEXT):
        self.xpath = etree.XPath(xpath_str)
        self.xtext = xtext

    def get_element(self, parent, index=0):
        elems = self.xpath(parent)
        if len(elems) > 0:
            return elems[index]
        else:
            return None

    def get_element_as_list(self, element):
        return [element]

    def get_elements(self, parent):
        elems = self.xpath(parent)
        if len(elems) > 0:
            return elems
        else:
            return []

    def get_text_from_parent(self, parent, index=0, complex_text=False):
        text = ''
        elem = self.get_element(parent, index)
        if elem is not None:
            text = self.get_text(elem, complex_text)
        return normalize(text)

    def get_text(self, element, complex_text=False):
        if complex_text:
            text = get_complex_text(element)
        else:
            text = self.xtext(element)
        return normalize(text)

class HierarchyXPath(SingleXPath):
    def __init__(self, xpath_str, xpath_str_filter):
        super(HierarchyXPath, self).__init__(xpath_str, None)
        self.first_filter = etree.XPath(xpath_str_filter)

    def get_element_as_list(self, element):
        elements = []

        stop = self.first_filter(element)

        for child in element:
            if child not in stop:
                elements.append(child)
        return elements

    def get_text_from_parent(self, parent, index=0, complex_text=False):
        text = ''
        elem = self.get_element(parent, index)
        if elem is not None:
            text = self.get_text(elem, complex_text)
        return normalize(text)

    def get_text(self, element, complex_text=False):
        '''Computes the text of this element by creating a deepcopy of the
           element, removing the bad children, getting the text
           representation.

           This is quite inefficient, but it's the best way to get a good
           representation of the text in a hierarchical section.'''
        new_element = deepcopy(element)
        bad_elements = self.first_filter(new_element)
        for bad_element in bad_elements:
            if bad_element in new_element:
                new_element.remove(bad_element)
        if complex_text:
            text_parts = []
            get_recursive_text(new_element, text_parts)
        else:
            text_parts = new_element.xpath('.//text()')
        text = '\n'.join(text_parts)
        return normalize(text)

class FlatXPath(object):
    def __init__(self, xpath_str, xpath_str_filter=None, xtext=XTEXT):
        self.xpath = etree.XPath(xpath_str)
        self.xtext = xtext
        if xpath_str_filter is not None:
            self.first_filter = etree.XPath(xpath_str_filter)
        else:
            self.first_filter = None

    def get_element(self, parent, index=0):
        elems = self.xpath(parent)
        if len(elems) > 0:
            return elems[index]
        else:
            return None

    def get_element_as_list(self, element):
        return [element]

    def get_elements(self, parent):
        elems = self.xpath(parent)
        if len(elems) > 0:
            return elems
        else:
            return []

    def get_text_from_parent(self, parent, index=0, complex_text=False):
        text = ''
        elem = self.get_element(parent, index)
        if elem is not None:
            text = self.get_text(elem, complex_text)
        return normalize(text)

    def get_text(self, element, complex_text=False):
        parent = element.getparent()
        if self.first_filter is not None:
            bad_elements = self.first_filter(parent)
        else:
            bad_elements = set()
        index = parent.index(element)
        majors = self.get_elements(parent)
        potentials = parent[index + 1:]
        reals = [element]
        for potential in potentials:
            if potential in majors:
                break
            elif potential not in bad_elements:
                reals.append(potential)
        text_parts = []
        for real in reals:
            get_recursive_text(real, text_parts)
            text_parts.append('')

        text = '\n'.join(text_parts)
        return normalize(text)


text:
This is the guide on how to use the major pieces of the CLEAN platform. Continue to the appropriate section fom the left menu.

Based on [daux.io](https://github.com/justinwalsh/daux.io)


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

	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<title>OiL: Additional Features</title>

An Object Request Broker in Lua

Home

Install

Manual

Basics

CORBA

Config

IDL

Mapping

Features

Intercept

LuDO

Arch

Papers

Contact

LuaForge

Additional Features

CORBA brokers make use of typing information to provide additional features, which facilitate some aspects of distributed programming using ORBs.
Basically, these features help to reduce the interference of the broker in the application.
Additionally, CORBA brokers also provide an additional API for manipulation of typing information, as described further in this section.

Implicit Servants

CORBA brokers allow that plain objects be used whenever an object reference is required.
For example, suppose the server below that create file objects, which are used to access files locally stored in the host the server is running.

local oo = require "loop.base"
local oil = require "oil"

oil.main(function()
  local broker = oil.init()
  broker:loadidl[[
    interface File {
      typedef sequence<octet> Contents;
      enum AccessMode { read, write };
      exception AccessError { string error; };

      Contents read(in long size) raises (AccessError);
      void write(in Contents data) raises (AccessError);
      void close();
    };
    interface FileSystem {
      File open(in string path, in File::AccessMode mode)
        raises (File::AccessError);
    };
  ]]

  File = oo.class()
  function File:read(size)
    local data, err = self.handler:read(size)
    if data==nil then error{"IDL:File/AccessError:1.0",error=err} end
    return data
  end
  function File:write(data)
    local ok, err = self.handler:write(data)
    if ok==nil then error{"IDL:File/AccessError:1.0",error=err} end
  end
  function File:close()
    self.handler:close()
  end

  system = {} -- singleton object, no need for a class
  function system:open(path, mode)
    local file, err = io.open(self.path, mode:sub(1, 1))
    if file then error{"IDL:File/AccessError:1.0",error=err} end
    file = File{ handler = file }
    return file -- implicitly created servant
  end

  oil.writeto("fs.ior",
    broker:tostring(
      broker:newservant(system, "FileSystem")))
  broker:run()
end)

Note that IDL operation FileSystem::open returns an object reference that implements interface File.
However, its implementation returns a simple object instead of a servant (i.e., an object reference).
In this case, the CORBA broker implicitly registers the returned object as a servant with interface File, which is the interface of the returned value.

Implicitly created servants reduce the need for additional code related to CORBA issues.
However, there are some drawback that must be observed.
First, implicitly created servants are registered with automatic keys and the interface they implement is the type of the formal parameter they are being coerced to.
In the example above, this means that the object returned by method open will be registered with interface File regardless whether the object implements a more specific interface.

To solve this problem, each object that may be used in the implicit creation of a servant may provide either field __objkey or __type to informs the object key and the interface name or ID of the servant, respectively.
Alternatively, the field may also be provided by the object's metatable.
The example below, illustrates this.

local oo = require "loop.base"
local oil = require "oil"

oil.main(function()
  local broker = oil.init()
  broker:loadidl[[
    interface Element { readonly attribute path; };

    interface File : Element {
      typedef sequence<octet> Contents;
      enum AccessMode { read, write };
      exception AccessError { string error; };
      interface Handler {
        Contents read(in long size) raises (AccessError);
        void write(in Contents data) raises (AccessError);
        void close();
      };
      Handler open(in AccessMode size) raises (AccessError);
    };
    sequence<File> FileSeq;

    interface Directory : Element {
      FileSeq contents();
    }

    interface FileSystem {
      Element search(in string path);
    };
  ]]

  File = oo.class{
    -- implementation of interface 'File'
  }
  Directory = oo.class{
    -- implementation of interface 'Directory'
  }

  system = {} -- singleton object, no need for a class
  function system:search(path)
    local kind, errmsg = lfs.attributes(path, "mode")
    if kind == "file" then
      return File{ -- implicitly created servant
        path = path,
        __type = "File",
      }
    elseif kind == "directory" then
      return Directory{ -- implicitly created servant
        path = path,
        __type = "Directory",
      }
    end
  end

  oil.writeto("fs.ior",
    broker:tostring(
      broker:newservant(system, "FileSystem")))
  broker:run()
end)

In the example above, method FileSystem::search return an object reference of "abstract" interface Element.
However, the actual objects referenced supports either interface File or Directory.
Therefore, they define field __type to tell OiL which interface they should be registered with.

A second observation with implicitly created servants is that if the same object is used twice implicitly create a servant, only one servant is created.
This is because, whenever the same object is registered with the same key (automatic or nor) and interface, OiL reuses the previous servant.

Reference Resolution

A complementary feature for implicit servant creation is local reference resolution, which means that any object reference received by a broker that actually refers to a local servant currently registered is automatically resolved to the servant's implementation object.
This means that the application receives the object originally registered as servant instead of the servant or proxy.
To illustrate this feature consider a server like the one below.

require "oil"

oil.main(function()
  local broker = oil.init()
  broker:loadidl[[
    interface MyObject {};
    interface RefHolder {
      attribute MyObject reference;
    };
    interface RefHolderFactory {
      RefHolder create();
    };
  ]]

  Factory = {}
  function Factory:create()
    return {} -- implicitly created servant
  end

  oil.writeto("factory.ior",
    broker:tostring(
      broker:newservant(Factory, "RefHolderFactory")))
  broker:run()
end)

The server above is used to create objects that can hold an object reference.
Now, the following application creates a RefHolder object to store a reference to a local object.
When the reference is retrieved the original object is restored.

require "oil"

oil.main(function()
  local broker = oil.init()

  local factory = broker:newproxy(oil.readfrom("factory.ior"))
  local holder = factory:create()

  local original = {}

  holder:_set_reference(original)          -- implicitly created servant
  local restored = holder:_get_reference() -- automatically resolved reference

  assert(rawequal(original, restored))
end)

Interface Discovery and Narrowing

Each CORBA proxy is associated to an IDL interface.
Only operations declared in this interface can be invoked using the proxy.
CORBA brokers provide method narrow(proxy [, interface]) to create another proxy to the same object represented by proxy, but with interface defined as parameter interface.
For an example, see the code below that access the file server described in a previous example.

require "oil"

oil.main(function()
  local broker = oil.init()
  local filesys = broker:newproxy(oil.readfrom("fs.ior"))

  local file = filesys:search("/usr/bin/lua") -- returns a 'Element'
  file = broker:narrow(file, "File")          -- narrow to a 'File'
  file:open("read")
  ...
end)

If narrow is used without a second parameter, then OiL uses operation _interface of CORBA object references to figure out its most specific interface and uses it.
Additionally, if this interface is not known, then the broker automatically imports the interface from the remote servant.
The same is true for when method newproxy is called without the second parameter, as illustrated in the examples above.
If you look back the previous examples, you will notice that only servers load IDL specifications, while client applications just call newproxy without specifying an interface, which causes the broker to import the interface definition using basic operation _interface of CORBA object references.

Unfortunately, operation _interface is optional and therefore it is not supported by every servant.
Additionally, the process of importing the entire IDL definition can be quite slow for some applications.
In these cases, the alternative is to load the IDL in the client and use the second parameter of methods newproxy and narrow.

Exception Support

CORBA brokers provide two additional operations that helps the use of exceptions.
First, you can create exceptions using exception's absolute name instead of repository ID using method newexcept, as illustrated in the example below.

File = oo.class()
function File:read(size)
  local data, err = self.handler:read(size)
  if data==nil then
    error(broker:newexcept{ "File::AccessError",
      error = err,
    })
  end
  return data
end
function File:write(data)
  local ok, err = self.handler:write(data)
  if ok==nil then
    error(broker:newexcept{ "File::AccessError",
      error = err
    })
  end
end
function File:close()
  self.handler:close()
end

Other feature is that exception handlers can be defined for proxies of a specific interface with method setexcatch(handler [, interface]).
To do so, just inform the interface's absolute name or repository ID.

Internal Interface Repository

Finally, CORBA brokers provide field types containing an object that implements the CORBA Interface Repository and provides access to all the IDL descriptions currently loaded in the broker.

Copyright (C) 2004-2008 Tecgraf, PUC-Rio

This project is currently being maintained by Tecgraf at PUC-Rio with grants from CAPES and CNPq.


text:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent" tools:context="com.jlmarting.calculadora.opsPad">

    <!-- TODO: Update blank fragment layout -->
    <GridLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentEnd="true"
        android:layout_alignBottom="@+id/gridLayout"
        android:layout_toEndOf="@+id/gridLayout"
        android:rowCount="6"
        android:columnCount="3"
        android:layout_alignTop="@+id/gridLayout">

        <Button
            android:layout_width="fill_parent"
            android:layout_height="75dp"
            android:text="+"
            android:id="@+id/btnAdd"
            android:layout_centerVertical="true"
            android:layout_alignEnd="@+id/btnSub"
            android:layout_row="0"
            android:layout_column="1" />

        <Button
            android:layout_width="fill_parent"
            android:layout_height="75dp"
            android:text="-"
            android:id="@+id/btnSub"
            android:layout_below="@+id/btnAdd"
            android:layout_alignStart="@+id/btnMul"
            android:layout_row="1"
            android:layout_column="1" />

        <Button
            android:layout_width="match_parent"
            android:layout_height="75dp"
            android:text="/"
            android:id="@+id/btnDiv"
            android:layout_alignParentBottom="true"
            android:layout_alignStart="@+id/btnMul"
            android:layout_row="3"
            android:layout_column="1" />

        <Button
            android:layout_width="fill_parent"
            android:layout_height="75dp"
            android:text="*"
            android:id="@+id/btnMul"
            android:layout_below="@+id/btnSub"
            android:layout_alignEnd="@+id/textView"
            android:layout_row="2"
            android:layout_column="1" />

    </GridLayout>

</FrameLayout>


text:
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model nineinchnick\usr\models\SearchForm */
/* @var $form yii\widgets\ActiveForm */

$booleanData = [
    Yii::t('manager', 'No'),
    Yii::t('manager', 'Yes'),
];
$booleanOptions = [
    'empty' => Yii::t('manager', 'Any'),
    'separator' => '',
];
$booleanLabel = [
    'style' => 'display: inline; float: none;',
];
?>

    <?php $form = ActiveForm::begin([
        'method' => 'get',
    ]); ?>

    <?= $form->field($model, 'id') ?>
    <?= $form->field($model, 'username') ?>
    <?= $form->field($model, 'email') ?>
    <?= $form->field($model, 'firstName') ?>
    <?= $form->field($model, 'lastName') ?>
    <?= $form->field($model, 'createdOn') ?>
    <?= $form->field($model, 'updatedOn') ?>
    <?= $form->field($model, 'lastVisitOn') ?>
    <?= $form->field($model, 'emailVerified')->checkboxList($booleanData, $booleanOptions)->label(null, $booleanLabel) ?>
    <?= $form->field($model, 'isActive')->checkboxList($booleanData, $booleanOptions)->label(null, $booleanLabel) ?>
    <?= $form->field($model, 'isDisabled')->checkboxList($booleanData, $booleanOptions)->label(null, $booleanLabel) ?>

            <?= Html::submitButton(Yii::t('manager', 'Search'), ['class' => 'btn btn-primary']) ?>

    <?php ActiveForm::end(); ?>


text:
{%extends 'wiki/_base.html' %}
{% load staticfiles %}

{% block content %}
    {{ block.super }}
{#    ## Insert HTML Fragment Starting Here###}

Contacts

      Prior to creating an event, it is important to  create at least one contact.  This  contact person will be the point of contact for shipping information for the  event.

 Adding a new Contact

      To add a new contact to the system:

Click Tables and then click Contacts.

Click Add Contact button in the left  corner.

Fill  out Basic Information page, which includes: First Name, Last Name, phone  number, email, and company they work for.   NOTE: fields marked with asterisk cannot be left blank.

Click  on Shipping Address tab and enter the shipping information for this contact.

Click Save

{#     ## Insert HTML Fragment ending Here###}

{% endblock %}