text:
/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
    Copyright Adrien Grand (based on Yann Collet's BSD licensed LZ4 implementation)
    changes copyright Goldman Sachs, licensed under Apache 2.0 license
*/
package com.gs.fw.common.mithra.util.lz4;

import java.nio.ByteOrder;
import java.util.Arrays;

import static com.gs.fw.common.mithra.util.lz4.LZ4Utils.*;

/**
 * High compression compressor written in pure Java without using the unofficial
 * sun.misc.Unsafe API.
 */
public class LZ4HCJavaSafeCompressor
{
    private static final ByteOrder NATIVE_BYTE_ORDER = ByteOrder.nativeOrder();
    private static final int OPTIMAL_ML = ML_MASK - 1 + MIN_MATCH;

    private final HashTable ht = new HashTable(0);
    private final Match match0 = new Match();
    private final Match match1 = new Match();
    private final Match match2 = new Match();
    private final Match match3 = new Match();

    public final int maxCompressedLength(int length)
    {
        if (length < 0)
        {
            throw new IllegalArgumentException("length must be >= 0, got " + length);
        }
        return length + length / 255 + 16;
    }

    public final int compress(byte[] src, int srcOff, int srcLen, byte[] dest, int destOff)
    {
        return compress(src, srcOff, srcLen, dest, destOff, dest.length - destOff);
    }

    static void copyTo(Match m1, Match m2)
    {
        m2.len = m1.len;
        m2.start = m1.start;
        m2.ref = m1.ref;
    }

    public int compress(byte[] src, int srcOff, int srcLen, byte[] dest,
            int destOff, int maxDestLen)
    {

        final int srcEnd = srcOff + srcLen;
        final int destEnd = destOff + maxDestLen;
        final int mfLimit = srcEnd - MF_LIMIT;
        final int matchLimit = srcEnd - LAST_LITERALS;

        int sOff = srcOff;
        int dOff = destOff;
        int anchor = sOff++;

        ht.reset(srcOff);
        match0.reset();
        match1.reset();
        match2.reset();
        match3.reset();

        main:
        while (sOff < mfLimit)
        {
            if (!ht.insertAndFindBestMatch(src, sOff, matchLimit, match1))
            {
                ++sOff;
                continue;
            }

            // saved, in case we would skip too much
            copyTo(match1, match0);

            search2:
            while (true)
            {
                assert match1.start >= anchor;
                if (match1.end() >= mfLimit
                        || !ht.insertAndFindWiderMatch(src, match1.end() - 2, match1.start + 1, matchLimit, match1.len, match2))
                {
                    // no better match
                    dOff = encodeSequence(src, anchor, match1.start, match1.ref, match1.len, dest, dOff, destEnd);
                    anchor = sOff = match1.end();
                    continue main;
                }

                if (match0.start < match1.start)
                {
                    if (match2.start < match1.start + match0.len)
                    { // empirical
                        copyTo(match0, match1);
                    }
                }
                assert match2.start > match1.start;

                if (match2.start - match1.start < 3)
                { // First Match too small : removed
                    copyTo(match2, match1);
                    continue search2;
                }

                search3:
                while (true)
                {
                    if (match2.start - match1.start < OPTIMAL_ML)
                    {
                        int newMatchLen = match1.len;
                        if (newMatchLen > OPTIMAL_ML)
                        {
                            newMatchLen = OPTIMAL_ML;
                        }
                        if (match1.start + newMatchLen > match2.end() - MIN_MATCH)
                        {
                            newMatchLen = match2.start - match1.start + match2.len - MIN_MATCH;
                        }
                        final int correction = newMatchLen - (match2.start - match1.start);
                        if (correction > 0)
                        {
                            match2.fix(correction);
                        }
                    }

                    if (match2.start + match2.len >= mfLimit
                            || !ht.insertAndFindWiderMatch(src, match2.end() - 3, match2.start, matchLimit, match2.len, match3))
                    {
                        // no better match -> 2 sequences to encode
                        if (match2.start < match1.end())
                        {
                            match1.len = match2.start - match1.start;
                        }
                        // encode seq 1
                        dOff = encodeSequence(src, anchor, match1.start, match1.ref, match1.len, dest, dOff, destEnd);
                        anchor = sOff = match1.end();
                        // encode seq 2
                        dOff = encodeSequence(src, anchor, match2.start, match2.ref, match2.len, dest, dOff, destEnd);
                        anchor = sOff = match2.end();
                        continue main;
                    }

                    if (match3.start < match1.end() + 3)
                    { // Not enough space for match 2 : remove it
                        if (match3.start >= match1.end())
                        { // // can write Seq1 immediately ==> Seq2 is removed, so Seq3 becomes Seq1
                            if (match2.start < match1.end())
                            {
                                final int correction = match1.end() - match2.start;
                                match2.fix(correction);
                                if (match2.len < MIN_MATCH)
                                {
                                    copyTo(match3, match2);
                                }
                            }

                            dOff = encodeSequence(src, anchor, match1.start, match1.ref, match1.len, dest, dOff, destEnd);
                            anchor = sOff = match1.end();

                            copyTo(match3, match1);
                            copyTo(match2, match0);

                            continue search2;
                        }

                        copyTo(match3, match2);
                        continue search3;
                    }

                    // OK, now we have 3 ascending matches; let's write at least the first one
                    if (match2.start < match1.end())
                    {
                        if (match2.start - match1.start < ML_MASK)
                        {
                            if (match1.len > OPTIMAL_ML)
                            {
                                match1.len = OPTIMAL_ML;
                            }
                            if (match1.end() > match2.end() - MIN_MATCH)
                            {
                                match1.len = match2.end() - match1.start - MIN_MATCH;
                            }
                            final int correction = match1.end() - match2.start;
                            match2.fix(correction);
                        }
                        else
                        {
                            match1.len = match2.start - match1.start;
                        }
                    }

                    dOff = encodeSequence(src, anchor, match1.start, match1.ref, match1.len, dest, dOff, destEnd);
                    anchor = sOff = match1.end();

                    copyTo(match2, match1);
                    copyTo(match3, match2);

                    continue search3;
                }

            }

        }

        dOff = lastLiterals(src, anchor, srcEnd - anchor, dest, dOff, destEnd);
        return dOff - destOff;
    }

    static int encodeSequence(byte[] src, int anchor, int matchOff, int matchRef, int matchLen, byte[] dest, int dOff, int destEnd)
    {
        final int runLen = matchOff - anchor;
        final int tokenOff = dOff++;

        if (dOff + runLen + (2 + 1 + LAST_LITERALS) + (runLen >>> 8) > destEnd)
        {
            throw new RuntimeException("maxDestLen is too small");
        }

        int token;
        if (runLen >= RUN_MASK)
        {
            token = (byte) (RUN_MASK << ML_BITS);
            dOff = writeLen(runLen - RUN_MASK, dest, dOff);
        }
        else
        {
            token = runLen << ML_BITS;
        }

        // copy literals
        wildArraycopy(src, anchor, dest, dOff, runLen);
        dOff += runLen;

        // encode offset
        final int matchDec = matchOff - matchRef;
        dest[dOff++] = (byte) matchDec;
        dest[dOff++] = (byte) (matchDec >>> 8);

        // encode match len
        matchLen -= 4;
        if (dOff + (1 + LAST_LITERALS) + (matchLen >>> 8) > destEnd)
        {
            throw new RuntimeException("maxDestLen is too small");
        }
        if (matchLen >= ML_MASK)
        {
            token |= ML_MASK;
            dOff = writeLen(matchLen - RUN_MASK, dest, dOff);
        }
        else
        {
            token |= matchLen;
        }

        dest[tokenOff] = (byte) token;

        return dOff;
    }

    static int lastLiterals(byte[] src, int sOff, int srcLen, byte[] dest, int dOff, int destEnd)
    {
        final int runLen = srcLen;

        if (dOff + runLen + 1 + (runLen + 255 - RUN_MASK) / 255 > destEnd)
        {
            throw new RuntimeException("maxDestLen is too small");
        }

        if (runLen >= RUN_MASK)
        {
            dest[dOff++] = (byte) (RUN_MASK << ML_BITS);
            dOff = writeLen(runLen - RUN_MASK, dest, dOff);
        }
        else
        {
            dest[dOff++] = (byte) (runLen << ML_BITS);
        }
        // copy literals
        System.arraycopy(src, sOff, dest, dOff, runLen);
        dOff += runLen;

        return dOff;
    }

    static int writeLen(int len, byte[] dest, int dOff)
    {
        while (len >= 0xFF)
        {
            dest[dOff++] = (byte) 0xFF;
            len -= 0xFF;
        }
        dest[dOff++] = (byte) len;
        return dOff;
    }

    static boolean readIntEquals(byte[] buf, int i, int j)
    {
        return buf[i] == buf[j] && buf[i + 1] == buf[j + 1] && buf[i + 2] == buf[j + 2] && buf[i + 3] == buf[j + 3];
    }

    public static int readInt(byte[] buf, int i)
    {
        if (NATIVE_BYTE_ORDER == ByteOrder.BIG_ENDIAN)
        {
            return readIntBE(buf, i);
        }
        else
        {
            return readIntLE(buf, i);
        }
    }

    class HashTable
    {
        static final int HASH_LOG_HC = 15;
        static final int HASH_TABLE_SIZE_HC = 1 << HASH_LOG_HC;
        static final int MAX_DISTANCE = 1 << 16;

//        static final int MAX_ATTEMPTS = 256;
        static final int MAX_ATTEMPTS = 64;
        static final int MASK = MAX_DISTANCE - 1;
        int nextToUpdate;
        private int base;
        private final int[] hashTable;
        private final short[] chainTable;

        HashTable(int base)
        {
            this.base = base;
            nextToUpdate = base;
            hashTable = new int[HASH_TABLE_SIZE_HC];
            Arrays.fill(hashTable, -1);
            chainTable = new short[MAX_DISTANCE];
        }

        private int hashHC(int i)
        {
            return (i * -1640531535) >>> ((MIN_MATCH * 8) - HASH_LOG_HC);
        }

        public void reset(int base)
        {
            this.base = base;
            this.nextToUpdate = base;
            Arrays.fill(hashTable, -1);
            Arrays.fill(chainTable, (short) 0);
        }

        private int hashPointer(byte[] bytes, int off)
        {
            final int v = readInt(bytes, off);
            final int h = hashHC(v);
            return base + hashTable[h];
        }

        private int next(int off)
        {
            return base + off - (chainTable[off & MASK] & 0xFFFF);
        }

        private void addHash(byte[] bytes, int off)
        {
            final int v = readInt(bytes, off);
            final int h = hashHC(v);
            int delta = off - hashTable[h];
            if (delta >= MAX_DISTANCE)
            {
                delta = MAX_DISTANCE - 1;
            }
            chainTable[off & MASK] = (short) delta;
            hashTable[h] = off - base;
        }

        void insert(int off, byte[] bytes)
        {
            for (; nextToUpdate < off; ++nextToUpdate)
            {
                addHash(bytes, nextToUpdate);
            }
        }

        boolean insertAndFindBestMatch(byte[] buf, int off, int matchLimit, Match match)
        {
            match.start = off;
            match.len = 0;

            insert(off, buf);

            int ref = hashPointer(buf, off);

            if (ref >= off - 4 && ref >= base)
            { // potential repetition
                if (readIntEquals(buf, ref, off))
                { // confirmed
                    final int delta = off - ref;
                    int ptr = off;
                    match.len = MIN_MATCH + commonBytes(buf, ref + MIN_MATCH, off + MIN_MATCH, matchLimit);
                    final int end = off + match.len - (MIN_MATCH - 1);
                    while (ptr < end - delta)
                    {
                        chainTable[ptr & MASK] = (short) delta; // pre load
                        ++ptr;
                    }
                    do
                    {
                        chainTable[ptr & MASK] = (short) delta;
                        hashTable[hashHC(readInt(buf, ptr))] = ptr - base; // head of table
                        ++ptr;
                    } while (ptr < end);
                    nextToUpdate = end;
                    match.ref = ref;
                }
                ref = next(ref);
            }

            for (int i = 0; i < MAX_ATTEMPTS; ++i)
            {
                if (ref < Math.max(base, off - MAX_DISTANCE + 1))
                {
                    break;
                }
                if (buf[ref + match.len] == buf[off + match.len] && readIntEquals(buf, ref, off))
                {
                    final int matchLen = MIN_MATCH + commonBytes(buf, ref + MIN_MATCH, off + MIN_MATCH, matchLimit);
                    if (matchLen > match.len)
                    {
                        match.ref = ref;
                        match.len = matchLen;
                    }
                }
                ref = next(ref);
            }

            return match.len != 0;
        }

        boolean insertAndFindWiderMatch(byte[] buf, int off, int startLimit, int matchLimit, int minLen, Match match)
        {
            match.len = minLen;

            insert(off, buf);

            final int delta = off - startLimit;
            int ref = hashPointer(buf, off);
            for (int i = 0; i < MAX_ATTEMPTS; ++i)
            {
                if (ref < Math.max(base, off - MAX_DISTANCE + 1))
                {
                    break;
                }
                if (buf[ref - delta + match.len] == buf[startLimit + match.len]
                        && readIntEquals(buf, ref, off))
                {
                    final int matchLenForward = MIN_MATCH + commonBytes(buf, ref + MIN_MATCH, off + MIN_MATCH, matchLimit);
                    final int matchLenBackward = commonBytesBackward(buf, ref, off, base, startLimit);
                    final int matchLen = matchLenBackward + matchLenForward;
                    if (matchLen > match.len)
                    {
                        match.len = matchLen;
                        match.ref = ref - matchLenBackward;
                        match.start = off - matchLenBackward;
                    }
                }
                ref = next(ref);
            }

            return match.len > minLen;
        }

    }

    static class Match
    {
        int start, ref, len;

        void fix(int correction)
        {
            start += correction;
            ref += correction;
            len -= correction;
        }

        int end()
        {
            return start + len;
        }

        public void reset()
        {
            this.start = ref = len = 0;
        }
    }
}


text:
package com.euclidean;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.TextureDict;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Vector2;
import com.euclidean.enums.State;

public class MainMenu extends BaseObject {
	private static final int START_GAME = 0;
	private static final int HIGH_SCORES = 1;
	private static final int CREDITS = 2;

	private Texture selectLine;
	private Texture menuText;
	private Vector2 linePosition;
	private int currentSelection;
	private float lastInput;

	public MainMenu() {
		//background = TextureDict.loadTexture("images/background.png").get();
		selectLine = TextureDict.loadTexture("images/selectline.png").get();
		menuText = TextureDict.loadTexture("images/menutext.png").get();
		linePosition = new Vector2(697, 352);

		currentSelection = 0;
		lastInput = 0;
	}

	@Override
	public void update(BaseObject parent)
	{
		if (sys.currentTime - lastInput > .15f)
		{
			if (Gdx.input.isKeyPressed(Input.Keys.UP))
			{
				currentSelection = MathUtils.clamp(currentSelection - 1, 0, 2);
				lastInput = sys.currentTime;
			}
			else if (Gdx.input.isKeyPressed(Input.Keys.DOWN))
			{
				currentSelection = MathUtils.clamp(currentSelection + 1, 0, 2);
				lastInput = sys.currentTime;
			}
			else if (Gdx.input.isKeyPressed(Input.Keys.ENTER))
			{
				selectItem();
				lastInput = sys.currentTime;
			}
		}

		switch(currentSelection)
		{
		case START_GAME: linePosition.set(697, sys.screenHeight - 352); break;
		case HIGH_SCORES: linePosition.set(697, sys.screenHeight - 405); break;
		case CREDITS: linePosition.set(697, sys.screenHeight - 459); break;
		}

		sys.spriteBatch.draw(selectLine, linePosition.x, linePosition.y);
		sys.spriteBatch.draw(menuText, 0, 0);
	}

	private void selectItem() {
		switch(currentSelection)
		{
		case START_GAME:
			sys.gameState.addState(State.GAME);
			break;
		case HIGH_SCORES:
			sys.gameState.addState(State.SCORES);
			break;
		}
	}

	@Override
	public void reset() {
		// TODO Auto-generated method stub

	}

}

redpajama_set_name: RedPajamaGithub


text:
This is the image used by the build agent. It is built and bundled via a
separate packaging mechanism in order to provide local caching and to ensure
that there is better build provenance. Note that continuous integration system
will generally deploy new agents from the primary branch, and will only deploy
as instances are recycled. Updates to this image should be made carefully.


text:
require "spec_helper"
require "saxxy/node_action"
require "saxxy/node_rule"
require "saxxy/event"

describe Saxxy::Event do

  def event(action = Saxxy::NodeAction.new(Saxxy::NodeRule.new("div")))
    Saxxy::Event.new(action)
  end

  it "should include activatable" do
    Saxxy::Event.ancestors.should include(Saxxy::Activatable)
  end

  describe "#initialize" do
    it "should set the action to the argument" do
      action = Saxxy::NodeAction.new(Saxxy::NodeRule.new("div"))
      event(action).action.should == action
    end

    it "should call initialize_activatable with the activation rule that action has" do
      rule = Saxxy::NodeRule.new("div")
      Saxxy::Event.any_instance.should_receive(:initialize_activatable).with(rule)
      event(Saxxy::NodeAction.new(rule))
    end

    it "should set the text instance variable to an empty string" do
      event().text.should == ""
    end
  end

  describe "#append_text" do
    it "appends the text provided as an argument to the @text instance variable" do
      e = event()
      expect { e.append_text("foo") }.to change { e.text }.from("").to("foo")
    end
  end

  describe "#fire" do
    it "should delegate the call to the action with the text as the argument" do
      e = event()
      e.action.should_receive(:call).with(e.text, nil, {})
      e.fire
    end
  end

end


text:
package io.github.benwhitehead.gw2.api.model

import com.fasterxml.jackson.annotation.JsonProperty
import java.util.UUID

/**
 * @author Ben Whitehead
 */
case class GuildDetails(
  @JsonProperty("guild_id") id: UUID,
  @JsonProperty("guild_name") name: String,
  @JsonProperty("tag") tag: String,
  @JsonProperty("emblem") emblem: Emblem
)
case class Emblem(
  @JsonProperty("background_id") backgroundId: Int,
  @JsonProperty("foreground_id") foregroundId: Int,
  @JsonProperty("flags") flags: List[Int],
  @JsonProperty("background_color_id") backgroundColorId: Int,
  @JsonProperty("foreground_primary_color_id") foregroundPrimaryColorId: Int,
  @JsonProperty("foreground_secondary_color_id") foregroundSecondaryColorId: Int
)


text:
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Schema;

class AddMatchRoundColumn extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('matches', function (Blueprint $table) {
            $table->tinyInteger('round');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('matches', function (Blueprint $table) {
            $table->dropColumn('round');
        });
    }
}


text:
package com.github.orangegangsters.lollipin.lib.views;

import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ListView;
import android.widget.ScrollView;

/**
 * Helper class for determining the current scroll positions for scrollable views. Currently works
 * for ListView, ScrollView and RecyclerView, but the library users can override it to add support
 * for other views.
 */
public class ScrollableViewHelper {
    /**
     * Returns the current scroll position of the scrollable view. If this method returns zero or
     * less, it means at the scrollable view is in a position such as the panel should handle
     * scrolling. If the method returns anything above zero, then the panel will let the scrollable
     * view handle the scrolling
     *
     * @param scrollableView the scrollable view
     * @param isSlidingUp whether or not the panel is sliding up or down
     * @return the scroll position
     */
    public int getScrollableViewScrollPosition(View scrollableView, boolean isSlidingUp) {
        if (scrollableView == null) return 0;
        if (scrollableView instanceof ScrollView) {
            if (isSlidingUp) {
                return scrollableView.getScrollY();
            } else {
                ScrollView sv = ((ScrollView) scrollableView);
                View child = sv.getChildAt(0);
                return (child.getBottom() - (sv.getHeight() + sv.getScrollY()));
            }
        } else if (scrollableView instanceof ListView && ((ListView) scrollableView).getChildCount() > 0) {
            ListView lv = ((ListView) scrollableView);
            if (lv.getAdapter() == null) return 0;
            if (isSlidingUp) {
                View firstChild = lv.getChildAt(0);
                // Approximate the scroll position based on the top child and the first visible item
                return lv.getFirstVisiblePosition() * firstChild.getHeight() - firstChild.getTop();
            } else {
                View lastChild = lv.getChildAt(lv.getChildCount() - 1);
                // Approximate the scroll position based on the bottom child and the last visible item
                return (lv.getAdapter().getCount() - lv.getLastVisiblePosition() - 1) * lastChild.getHeight() + lastChild.getBottom() - lv.getBottom();
            }
        } else if (scrollableView instanceof RecyclerView && ((RecyclerView) scrollableView).getChildCount() > 0) {
            RecyclerView rv = ((RecyclerView) scrollableView);
            RecyclerView.LayoutManager lm = rv.getLayoutManager();
            if (rv.getAdapter() == null) return 0;
            if (isSlidingUp) {
                View firstChild = rv.getChildAt(0);
                // Approximate the scroll position based on the top child and the first visible item
                return rv.getChildLayoutPosition(firstChild) * lm.getDecoratedMeasuredHeight(firstChild) - lm.getDecoratedTop(firstChild);
            } else {
                View lastChild = rv.getChildAt(rv.getChildCount() - 1);
                // Approximate the scroll position based on the bottom child and the last visible item
                return (rv.getAdapter().getItemCount() - 1) * lm.getDecoratedMeasuredHeight(lastChild) + lm.getDecoratedBottom(lastChild) - rv.getBottom();
            }
        } else {
            return 0;
        }
    }
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Lichen retiger Bory

### Remarks
null


text:
package org.literacyapp.model;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.NotNull;
import org.greenrobot.greendao.annotation.Unique;
import org.greenrobot.greendao.annotation.Generated;

/**
 * Based on {@link org.literacyapp.model.gson.DeviceGson}
 */
@Entity
public class Device {

    @Id(autoincrement = true)
    private Long id;

    @NotNull
    @Unique
    private String deviceId;

    @Generated(hash = 840504470)
    public Device(Long id, @NotNull String deviceId) {
        this.id = id;
        this.deviceId = deviceId;
    }

    @Generated(hash = 1469582394)
    public Device() {
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }
}


text:
salt.engines.fluent
===================

.. automodule:: salt.engines.fluent
    :members:


text:
- Fix a bug in the template preventing toggling the state of the node in some cases.
- Make it possible to select more than one node while in filtered mode (#101)

### v7.4.5
- Minor tweaks to package.json

### v7.4.4
- Release in Bower

### v7.4.3
- Fix preselect not working properly with quoted numbers.

### v7.4.2
- Add Bower support.

### v7.4.1
- Assign new output model only if something actually changed.
- Add a signal in the API for opening/closing a particular/all instance/s of AMS.

### v7.4.0
- Stop emitting the output model in the 'ams_output_model_change' event as we already have access to that data.
- Add an event for when the input model has been changed.

### v7.3.2
- Better handle empty output in outputModelIterator filter.

### v7.3.1
- Emit 'ams_output_model_change' after the model has been changed.

### v7.3.0
- Add an event for when the output model has been changed.

### v7.2.1
- Output model isn't required anymore. This will allow the output model to be assigned 'undefined'.

### v7.2.0
- Now it's possible to assign a default value that will be shown if nothing is checked (outputModelIterator filter).

### v7.1.2
- Do not crash if 'preselect' property is an empty string.

### v7.1.1
- Make it possible to controll all AMS instances with the API via the '\*' selector.

### v7.1.0
- Add a signals/events based API.

### v7.0.4
- Items container should be re-positioned after queries that modify the number of visible items.

### v7.0.3
- More fixes related to items container positioning in corner cases.

### v7.0.2
- Fix wrong positioning of the items container in certain cases.

### v7.0.1
- Fix a bad typo in the code preventing items to repaint after a check.

### v7.0.0
- Better support for Angular <1.4
- Dropdown label syntax has been changed to allow further customization.
- Now AMS will broadcast events on un/checking and opening/closing items.

### v6.3.3
##### Added / Updated
- More performance improvements.

### v6.3.2
##### Added / Updated
- Performance improvements by as much as 80%.
- Fixed a deadlock that would happen in certain cases when processing big data.

### v6.3.1
##### Added / Updated
- Fixed a bug in 'to_internal' that would cause bad '$ams_parents_id' generation in certain cases.
- Make items text non-selectable.
- Added 'toggle-open-state-nodes-checked-state-leafs-on-label-click' mod.

### v6.3.0
##### Added / Updated
- Added 'mods'.
- Added 'toggle-checked-state-on-label-click' mod.
- Added 'toggle-open-state-on-label-click' mod.

### v6.2.1
##### Added / Updated
- Fixed i18n-ES minification protection.

### v6.2.0
##### Added / Updated
- Now it is possible to make multiple preselections with 'preselect' attribute.

### v6.1.0
##### Added / Updated
- Now it is possible to create the dropdown label with values from the items in the output model.

### v6.0.7
##### Added / Updated
- Fix a bug related to keyboard handling.

### v6.0.6
##### Added / Updated
- Improvements in the keyboard handler.

### v6.0.5
##### Added / Updated
- Fix buggy global CSS styles generation.

### v6.0.4
##### Added / Updated
- CSS fixes.
- Code cleanup.

### v6.0.3
##### Added / Updated
- CSS fixes and improvements.

### v6.0.2
##### Added / Updated
- Fixed a bug causing AMS to crash in some cases.
- Make sure to run specs with min files.

### v6.0.1
##### Added / Updated
- Reworked how .map files are generated.

### v6.0.0
##### Added / Updated
- Major rewrite. Directive attributes have been changed. Please read docs.
- Angular Multi Select has been split into several parts.
- LokiJS is used to manage the data.
- Upgraded all the code to ES6.
- Reworked Grunt tasks.
- Reworked entirely the specs.
- Reworked CSS. Upgraded to CSS3 with heavy dependency on Flex.
- Improved minification process.
- Massive speed improvements (tests are done with up to 50k elements).
- Bower support has been removed.

### v5.5.8
##### Added / Updated
- Make output models optional for better Angular (1.4.9+) compatibility.

### v5.5.7
##### Added / Updated
- Unit tests fixes.

### v5.5.6
##### Added / Updated
- Bower fixes.

### v5.5.5
##### Added / Updated
- Fix malformed bower.json

### v5.5.5
##### Added / Updated
- Revert PR 44. NPM and Bower should stay separated.

### v5.5.4
##### Added / Updated
- Possibility to turn off automatic toggling of children/parents.
- CSS cleanup.
- Possibility to use non-default interpolation symbols.
- New API method that allows selection of various items at the same time.

### v5.5.3
##### Added / Updated
- Wrong tag.

### v5.5.2
##### Added / Updated
- Wrong tag.

### v5.5.1
##### Added / Updated
- Wrong tag.

### v5.5.0
##### Added / Updated
- Changed dist directory.

### v5.4.1
##### Added / Updated
- Disable outline on the directive. (CSS)

### v5.4.0
##### Added / Updated
- Major performance improvement by removing the scan/merge parent scopes.
- The item label and button label syntax has changed. Please check docs before upgrading.

### v5.3.21
##### Added / Updated
- Empty selection should trigger an empty string single-output-model.

### v5.3.20
##### Added / Updated
- Wrap API calls inside a 0 $timeout.

### v5.3.19
##### Added / Updated
- Do not uncheck items if they are already checked when using the 'select' API method.

### v5.3.18
##### Added / Updated
- Avoid out of time outputModel replacement.

### v5.3.17
##### Added / Updated
- Wait for DOM ops to finish before starting the directive. (delay-start)
- Better handle wrong values for 'preselect-value'.

### v5.3.16
##### Added / Updated
- Fix a bug when filtering/searching.

### v5.3.15
##### Added / Updated
- Make the single output model mode return a leaf.

### v5.3.14
##### Added / Updated
- Avoid nesting changes inside a $digest.
- Allow to preselect multiple values

### v5.3.13
##### Added / Updated
- Fix a bug with single output model mode.

### v5.3.12
##### Added / Updated
- Make it possible to configure the output model data.

### v5.3.11
##### Added / Updated
- Allow setting a limit to the number of selected items.

### v5.3.10
##### Added / Updated
- Improve performance.

### v5.3.9
##### Added / Updated
- Make it possible to map a single object/value to an output model.

### v5.3.8
##### Added / Updated
- Make it possible to pre-select items via properties.

### v5.3.7
##### Added / Updated
- Scan all $parents when creating labels for the button or for the items.
- Don't copy AngularJS internal values when creating labels.

### v5.3.6
##### Added / Updated
- Don't force the height of the items layer.

### v5.3.5
##### Added / Updated
- Small performance improvements.

### v5.3.4
##### Added / Updated
- Show that none is selected in btn-data.htm template when nothing is selected.

### v5.3.3
##### Added / Updated
- Fix a bug causing the 'setFocus' directive not receiving '$timeout' when minified.
- Now the button label can be styled with any variable from the item itself or from the parent scope.

### v5.3.2
##### Added / Updated
- The directive now exports a simple API that can be used for control purpose.

### v5.3.1
##### Added / Updated
- Fix smart positioning not working quite as expected.

### v5.3.0
##### Added / Updated
- Button icons are part of the CSS now.
- Removed the icons config.

### v5.2.1
##### Added / Updated
- Bring back button customization.
- Now the container layer will be placed on top or on the right of the button if there is no enough space.

### v5.2.0
##### Added / Updated
- Trigger callbacks after applying all the changes (on next tick).
- Show the layer on the left/top of the button if there is no enough space.

### v5.1.5
##### Added / Updated
- Handle destroy event (prevent possible memory leak).

### v5.1.4
##### Added / Updated
- Output model wasn't updated when everything was deselected.

### v5.1.3
##### Added / Updated
- jQuery is still needed for development and testing.

### v5.1.2
##### Added / Updated
- Remove jQuery from the dependencies in package.json.

### v5.1.1
##### Added / Updated
- Performance optimizations (stop $interpolating on each rendered item).

### v5.1.0
##### Added / Updated
- Simplify interpolation process and start using curly braces for it.

### v5.0.9
##### Added / Updated
- jQuery is not required anymore.

### v5.0.8
##### Added / Updated
- Close all other instances of the widget before opening it.

### v5.0.7
##### Added / Updated
- The dropdown is closed after selecting an item if in single mode.

### v5.0.6
##### Added / Updated
- Now it's possible to use vars from the parent scope in the item's label text.

### v5.0.5
##### Added / Updated
- Require grunt-contrib-jasmine >=v0.7.0
- Require jasmine-jquery >= 2.0.0

### v5.0.4
##### Added / Updated
- Require grunt-contrib-uglify >=v0.5.0

### v5.0.3
##### Added / Updated
- Require grunt-contrib-cssmin >=v0.10.0

### v5.0.2
##### Added / Updated
- Fixed a bug with 'Select All' selecting everything while in single mode.
- Implementing support for hidden elements.
- Implement unit tests using Jasmine.

### v5.0.1
##### Added / Updated
- Callbacks have been restored.
- Support dynamic data change of the input data.

### v5.0.0
##### Added / Updated
- Major rewrite of the project.
- The input data format has changed, please read docs.

### v4.0.6
##### Added / Updated
- Ignore more files in the NPM package.

### v4.0.5
##### Added / Updated
- Fixed minified version of JS file.

### v4.0.4
##### Added / Updated
- Add min version of the CSS and the JS files.

### v4.0.3
##### Added / Updated
- Apply some of the PRs from the original project.

### v4.0.2
##### Added / Updated
- Convert spaces to tabs.
- Clean indent style.

### v4.0.1
##### Added / Updated
- I'm forking this project as original project doesn't seem to have any activity.
- Renaming files to something more general.
- Moving from Bower to NPM

### v4.0.0
##### Added / Updated
- You can now customize output-model properties that you need, instead of having all data.
- #201 (and other related issues) DOM bug is now fixed.
- #205 (and other related issues) CSS bug is now fixed.
- #207 (and other related issues) You can now update the directive by modifying the input-model as usual.

##### Deprecated / Breaking Changes
- input-model behaviour is now back like v2.x.x. If you don't re-use your input-model, you should be safe.

### v3.0.0
##### Added / Updated
- Support for AngularJs version 1.3.x (v3.0.0 also supports AngularJs 1.2.x, but beware of the breaking changes).
- Customized text on helper elements.
- 5 new callbacks.
- You can now set minimum characters required to trigger the search functionality.
- You can now define which input-model properties to search from (previously, all input-model properties are searched).
- On close, parent button will now receive focus.
- Using proper semantics (well at least better than previous version).
- Limited support on promise objects.
- Various small optimizations.

##### Deprecated / Breaking Changes
- File name and the directive name have been changed. I am really sorry for this, but this is the only workaround to prevent wrong language statistic in Github (they don''t count files whose name starts with "angular"). The repository name stays the same.
- output-model is now required.
- input-model is now static (not dynamically updated), hence why we need output-model. On the plus side, you now can re-use the input model where necessary.
- default-label is deprecated. Custom text and translations can be done using the translation attribute.

### v2.0.2
##### Added / Updated
- Bring back CSS into bower.json.

### v2.0.1
##### Added / Updated
- #52 Form tag is now properly closed.

### v2.0.0
##### Added / Updated
- Unlimited nested grouping. Group headers are clickable to select / deselect all items under the group. Group headers are filter aware, means it will only affect filtered result.
- Helper buttons are now filter aware as well (For example, if you filter something and click 'Select All', the directive will tick all of the filtered result only. Same goes with 'Select None' and 'Reset' ).
- Supports arrow key navigation (up, down, left, right, and spacebar).
- New CSS styling.
- default-label attribute. You can define your default text on the button when nothing is selected.
- on-item-click attribute. This is a callback which will be triggered when a user click an item. Will pass the clicked item to the callback function.
- on-open and on-close callbacks will now pass the multi-select element (HTML) to the callback function.
- max-height attribute. You can define the height of the selection items container.

##### Deprecated / Breaking Changes
- on-focus attribute is deprecated.
- on-blur attribute is deprecated. Use on-close instead, as it will be triggered when user close a directive by clicking outside the directive.
- IE8 will no longer be supported.

### v1.2.0
##### Added / Updated:
- #19 Default label on the dropdown button is now configurable using attribute "default-label"="...".
- #16 Attribute "max-labels" can now be 0. If set to 0, the dropdown button will only display "(Total: X)".

### v1.1.0
##### Added / Updated:
- Added event callbacks.
- #5 Helper elements are now configurable.

### v1.0.0
- First release.


text:
/** @file mempool.h
  * @brief A simple memory pool API.  Since space occupied by things in the
  * pool cannot be reclaimed, this is mostly useful for situations where
  * objects in the pool have the same lifetime as the pool itself.
  *
  * To avoid problems when allocating very large amounts of contiguous memory,
  * the pool consists of "pages" of memory blocks.  No item larger than
  * the page size can be stored in the pool.  But ideally the page size will be
  * enough to hold several items.  And optimally, the page size should be a
  * multiple of the size of the things to be stored.
  */
#include <stdlib.h>

#ifndef MEMPOOL_H
#define MEMPOOL_H

/** @brief for internal use only */
struct _mempool_page {
  size_t next; /* the next unreserved location in the buffer */
  void *buffer; /* a block of of memory */
};

/** @brief the memory pool data type.  Members of this struct should not be
 *  accessed by user code. */
typedef struct _mempool {
  size_t page_size;  /**< @brief the capacity of each "page" of memory. */
  size_t n_pages;    /**< @brief the number of pages currently allocated. */
  size_t next_unfull;/**< @brief the index of the first page with free space. */
  struct _mempool_page *pages; /**< @brief list of pages */
} mempool_t;

/** @brief tells how much memory is being used by a mempool's buffers.
  * Does not account for overhead. */
#define mempool_size( p ) \
	((p)->capacity * (p)->n_buffers)

/** @brief creates a new memory pool.
  *
  * @param page_size how many bytes each buffer in the memory pool should be
  * able to hold.  This also represents the largest amount of memory which can
  * be allocated.
  *
  * @return a newly-allocated memory pool
  */
mempool_t *mempool_create(size_t page_size);

/** @brief adds something to the memory pool.
  *
  * @param pool the pool to which the thing should be added
  * @param thing the thing to add to the pool
  * @param thing_size the size of the thing to add
  *
  * @return the address in the memory pool where the thing was stored, or NULL
  * if the thing is larger than the pool's page size, or if there was an error
  * allocating a new page.
  */
void *mempool_add(mempool_t * pool, const void *thing, size_t thing_size);

/** @brief reserves space within a memory pool
  *
  * @param pool in which the space should be reserved
  * @param n_bytes the number of bytes to reserve
  *
  * @return the address in the memory pool where the thing was stored,
  * or NULL if n_bytes was zero, if n_bytes is larger than the pool's
  * capacity, or allocating a new page failed.
  */
void *mempool_alloc(mempool_t * pool, size_t n_bytes);

/** @brief frees resources associated with a memory pool.
  *
  * @param pool
  */
void mempool_destroy(mempool_t * pool);

#endif /* MEMPOOL_H */


text:
<?php

/**
 * @file
 * Contains \Drupal\user\Tests\UserEditedOwnAccountTest.
 */

namespace Drupal\user\Tests;

use Drupal\simpletest\WebTestBase;

/**
 * Tests user edited own account can still log in.
 *
 * @group user
 */
class UserEditedOwnAccountTest extends WebTestBase {

  function testUserEditedOwnAccount() {
    // Change account setting 'Who can register accounts?' to Administrators
    // only.
    $this->config('user.settings')->set('register', USER_REGISTER_ADMINISTRATORS_ONLY)->save();

    // Create a new user account and log in.
    $account = $this->drupalCreateUser(array('change own username'));
    $this->drupalLogin($account);

    // Change own username.
    $edit = array();
    $edit['name'] = $this->randomMachineName();
    $this->drupalPostForm('user/' . $account->id() . '/edit', $edit, t('Save'));

    // Log out.
    $this->drupalLogout();

    // Set the new name on the user account and attempt to log back in.
    $account->name = $edit['name'];
    $this->drupalLogin($account);
  }
}


text:
package exceptions;

public class SexoInvalidoException extends Exception {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

}


text:
The GDC Data Transfer Tool comes with built-in help menus. These menus are displayed when the GDC Data Transfer Tool is run with flags -h or --help for any of the main arguments to the tool. Running the GDC Data Transfer Tool without argument or flag will present a list of available command options.

```Shell
gdc-client --help
```
``` Output
usage: gdc-client [-h] [--version] {download,upload,interactive} ...

The Genomic Data Commons Command Line Client

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit

commands:
  {download,upload,interactive}
                        for more information, specify -h after a command
    download            download data from the GDC
    upload              upload data to the GDC
    interactive         run in interactive mode
```

 The available menus are provided below.

### Root menu

The GDC Data Transfer Tool displays the following output when executed without any arguments.

```Shell
gdc-client
```
```Output
usage: gdc-client [-h] [--version] {download,upload,interactive} ...
gdc-client: error: too few arguments
```

### Download help menu

The GDC Data Transfer Tool displays the following help menu for its download functionality.

```Shell
gdc-client download --help
```
```Output
usage: gdc-client download [-h] [--debug] [--log-file LOG_FILE]
                                  [-t TOKEN_FILE] [-d DIR] [-s server]
                                  [--no-segment-md5sums] [--no-file-md5sum]
                                  [-n N_PROCESSES]
                                  [--http-chunk-size HTTP_CHUNK_SIZE]
                                  [--save-interval SAVE_INTERVAL]
                                  [--no-verify] [--no-related-files]
                                  [--no-annotations] [--no-auto-retry]
                                  [--retry-amount RETRY_AMOUNT]
                                  [--wait-time WAIT_TIME] [-u] [-m MANIFEST]
                                  [file_id [file_id ...]]

positional arguments:
  file_id               The GDC UUID of the file(s) to download

optional arguments:
  -h, --help            show this help message and exit
  --debug               Enable debug logging. If a failure occurs, the program
                                                          will stop.
  --log-file LOG_FILE   Save logs to file. Amount logged affected by --debug
  -t TOKEN_FILE, --token-file TOKEN_FILE
                        GDC API auth token file
  -d DIR, --dir DIR     Directory to download files to. Defaults to current dir
  -s server, --server server
                      The TCP server address server[:port]
  --no-segment-md5sums  Do not calculate inbound segment md5sumsand/or do not
                      verify md5sums on restart
  --no-file-md5sum      Do not verify file md5sum after download
  -n N_PROCESSES, --n-processes N_PROCESSES
                        Number of client connections.
  --http-chunk-size HTTP_CHUNK_SIZE
                        Size in bytes of standard HTTP block size.
  --save-interval SAVE_INTERVAL
                        The number of chunks after which to flush state file.
                        A lower save interval will result in more frequent
                        printout but lower performance.
  --no-verify           Perform insecure SSL connection and transfer
  --no-related-files    Do not download related files.
  --no-annotations      Do not download annotations.
  --no-auto-retry       Ask before retrying to download a file
  --retry-amount RETRY_AMOUNT
                        Number of times to retry a download
  --wait-time WAIT_TIME
                        Amount of seconds to wait before retrying
  -u, --udt             Use the UDT protocol.
  -m MANIFEST, --manifest MANIFEST
                        GDC download manifest file
```

### Upload help menu

The GDC Data Transfer Tool displays the following help menu for its upload functionality.

```Shell
gdc-client upload --help
```
```Output
usage: gdc-client upload [-h] [--debug] [-v] [--log-file LOG_FILE]
                         [-T TOKEN | -t TOKEN] [-H HOST] [-P PORT]
                         [--project-id PROJECT_ID] [--identifier IDENTIFIER]
                         [--path path] [--upload-id UPLOAD_ID] [--insecure]
                         [--server SERVER] [--part-size PART_SIZE]
                         [-n N_PROCESSES] [--disable-multipart] [--abort]
                         [--resume] [--delete] [--manifest MANIFEST]

optional arguments:
  -h, --help            show this help message and exit
  --debug               Enable debug logging.  If a failure occurs, the program
                        will stop.
  --log-file LOG_FILE   Save logs to file. Amount logged affected by --debug
  -t TOKEN_FILE, --token-file TOKEN_FILE
                        GDC API auth token file
  --project-id PROJECT_ID, -p PROJECT_ID
                        The project ID that owns the file
  --path path, -f path  directory path to find file
  --upload-id UPLOAD_ID, -u UPLOAD_ID
                        Multipart upload id
  --insecure, -k        Allow connections to server without certs
  --server SERVER, -s SERVER
                        GDC API server address
  --part-size PART_SIZE, -ps PART_SIZE
                        Part size for multipart upload
  -n N_PROCESSES, --n-processes N_PROCESSES
                        Number of client connections
  --disable-multipart   Disable multipart upload
  --abort               Abort previous multipart upload
  --resume, -r          Resume previous multipart upload
  --delete              Delete an uploaded file
  --manifest MANIFEST, -m MANIFEST
                        Manifest which describes files to be uploaded
--identifier, -i      DEPRECATED
```


text:
var composer = require('./index');

composer(function (err, pack) {

    if (err) {
        throw err;
    }

    pack.start(function () {

        console.log('Started the plot device.');
    });
});


text:
from binascii import hexlify, unhexlify
import traceback
import sys

from electrum.util import bfh, bh2u, UserCancelled
from electrum.bitcoin import (b58_address_to_hash160, xpub_from_pubkey,
                              TYPE_ADDRESS, TYPE_SCRIPT,
                              is_segwit_address)
from electrum import constants
from electrum.i18n import _
from electrum.plugins import BasePlugin
from electrum.transaction import deserialize, Transaction
from electrum.keystore import Hardware_KeyStore, is_xpubkey, parse_xpubkey
from electrum.wallet import Standard_Wallet
from electrum.base_wizard import ScriptTypeNotSupported

from ..hw_wallet import HW_PluginBase

# TREZOR initialization methods
TIM_NEW, TIM_RECOVER, TIM_MNEMONIC, TIM_PRIVKEY = range(0, 4)

class KeepKey_KeyStore(Hardware_KeyStore):
    hw_type = 'keepkey'
    device = 'KeepKey'

    def get_derivation(self):
        return self.derivation

    def is_segwit(self):
        return self.derivation.startswith("m/49'/")

    def get_client(self, force_pair=True):
        return self.plugin.get_client(self, force_pair)

    def decrypt_message(self, sequence, message, password):
        raise RuntimeError(_('Encryption and decryption are not implemented by {}').format(self.device))

    def sign_message(self, sequence, message, password):
        client = self.get_client()
        address_path = self.get_derivation() + "/%d/%d"%sequence
        address_n = client.expand_path(address_path)
        msg_sig = client.sign_message(self.plugin.get_coin_name(), address_n, message)
        return msg_sig.signature

    def sign_transaction(self, tx, password):
        if tx.is_complete():
            return
        # previous transactions used as inputs
        prev_tx = {}
        # path of the xpubs that are involved
        xpub_path = {}
        for txin in tx.inputs():
            pubkeys, x_pubkeys = tx.get_sorted_pubkeys(txin)
            tx_hash = txin['prevout_hash']
            if txin.get('prev_tx') is None and not Transaction.is_segwit_input(txin):
                raise Exception(_('Offline signing with {} is not supported for legacy inputs.').format(self.device))
            prev_tx[tx_hash] = txin['prev_tx']
            for x_pubkey in x_pubkeys:
                if not is_xpubkey(x_pubkey):
                    continue
                xpub, s = parse_xpubkey(x_pubkey)
                if xpub == self.get_master_public_key():
                    xpub_path[xpub] = self.get_derivation()

        self.plugin.sign_transaction(self, tx, prev_tx, xpub_path)

class KeepKeyPlugin(HW_PluginBase):
    # Derived classes provide:
    #
    #  class-static variables: client_class, firmware_URL, handler_class,
    #     libraries_available, libraries_URL, minimum_firmware,
    #     wallet_class, ckd_public, types, HidTransport

    firmware_URL = 'https://www.keepkey.com'
    libraries_URL = 'https://github.com/keepkey/python-keepkey'
    minimum_firmware = (1, 0, 0)
    keystore_class = KeepKey_KeyStore
    SUPPORTED_XTYPES = ('standard', )

    MAX_LABEL_LEN = 32

    def __init__(self, parent, config, name):
        HW_PluginBase.__init__(self, parent, config, name)

        try:
            from . import client
            import keepkeylib
            import keepkeylib.ckd_public
            import keepkeylib.transport_hid
            self.client_class = client.KeepKeyClient
            self.ckd_public = keepkeylib.ckd_public
            self.types = keepkeylib.client.types
            self.DEVICE_IDS = keepkeylib.transport_hid.DEVICE_IDS
            self.device_manager().register_devices(self.DEVICE_IDS)
            self.libraries_available = True
        except ImportError:
            self.libraries_available = False

    def hid_transport(self, pair):
        from keepkeylib.transport_hid import HidTransport
        return HidTransport(pair)

    def _try_hid(self, device):
        self.print_error("Trying to connect over USB...")
        if device.interface_number == 1:
            pair = [None, device.path]
        else:
            pair = [device.path, None]

        try:
            return self.hid_transport(pair)
        except BaseException as e:
            # see fdb810ba622dc7dbe1259cbafb5b28e19d2ab114
            # raise
            self.print_error("cannot connect at", device.path, str(e))
            return None

    def create_client(self, device, handler):
        transport = self._try_hid(device)
        if not transport:
            self.print_error("cannot connect to device")
            return

        self.print_error("connected to device at", device.path)

        client = self.client_class(transport, handler, self)

        # Try a ping for device sanity
        try:
            client.ping('t')
        except BaseException as e:
            self.print_error("ping failed", str(e))
            return None

        if not client.atleast_version(*self.minimum_firmware):
            msg = (_('Outdated {} firmware for device labelled {}. Please '
                     'download the updated firmware from {}')
                   .format(self.device, client.label(), self.firmware_URL))
            self.print_error(msg)
            handler.show_error(msg)
            return None

        return client

    def get_client(self, keystore, force_pair=True):
        devmgr = self.device_manager()
        handler = keystore.handler
        with devmgr.hid_lock:
            client = devmgr.client_for_keystore(self, handler, keystore, force_pair)
        # returns the client for a given keystore. can use xpub
        if client:
            client.used()
        return client

    def get_coin_name(self):
        return "Testnet" if constants.net.TESTNET else "Bitcoin"

    def initialize_device(self, device_id, wizard, handler):
        # Initialization method
        msg = _("Choose how you want to initialize your {}.\n\n"
                "The first two methods are secure as no secret information "
                "is entered into your computer.\n\n"
                "For the last two methods you input secrets on your keyboard "
                "and upload them to your {}, and so you should "
                "only do those on a computer you know to be trustworthy "
                "and free of malware."
        ).format(self.device, self.device)
        choices = [
            # Must be short as QT doesn't word-wrap radio button text
            (TIM_NEW, _("Let the device generate a completely new seed randomly")),
            (TIM_RECOVER, _("Recover from a seed you have previously written down")),
            (TIM_MNEMONIC, _("Upload a BIP39 mnemonic to generate the seed")),
            (TIM_PRIVKEY, _("Upload a master private key"))
        ]
        def f(method):
            import threading
            settings = self.request_trezor_init_settings(wizard, method, self.device)
            t = threading.Thread(target=self._initialize_device_safe, args=(settings, method, device_id, wizard, handler))
            t.setDaemon(True)
            t.start()
            exit_code = wizard.loop.exec_()
            if exit_code != 0:
                # this method (initialize_device) was called with the expectation
                # of leaving the device in an initialized state when finishing.
                # signal that this is not the case:
                raise UserCancelled()
        wizard.choice_dialog(title=_('Initialize Device'), message=msg, choices=choices, run_next=f)

    def _initialize_device_safe(self, settings, method, device_id, wizard, handler):
        exit_code = 0
        try:
            self._initialize_device(settings, method, device_id, wizard, handler)
        except UserCancelled:
            exit_code = 1
        except BaseException as e:
            traceback.print_exc(file=sys.stderr)
            handler.show_error(str(e))
            exit_code = 1
        finally:
            wizard.loop.exit(exit_code)

    def _initialize_device(self, settings, method, device_id, wizard, handler):
        item, label, pin_protection, passphrase_protection = settings

        language = 'english'
        devmgr = self.device_manager()
        client = devmgr.client_by_id(device_id)

        if method == TIM_NEW:
            strength = 64 * (item + 2)  # 128, 192 or 256
            client.reset_device(True, strength, passphrase_protection,
                                pin_protection, label, language)
        elif method == TIM_RECOVER:
            word_count = 6 * (item + 2)  # 12, 18 or 24
            client.step = 0
            client.recovery_device(word_count, passphrase_protection,
                                       pin_protection, label, language)
        elif method == TIM_MNEMONIC:
            pin = pin_protection  # It's the pin, not a boolean
            client.load_device_by_mnemonic(str(item), pin,
                                           passphrase_protection,
                                           label, language)
        else:
            pin = pin_protection  # It's the pin, not a boolean
            client.load_device_by_xprv(item, pin, passphrase_protection,
                                       label, language)

    def setup_device(self, device_info, wizard, purpose):
        devmgr = self.device_manager()
        device_id = device_info.device.id_
        client = devmgr.client_by_id(device_id)
        if client is None:
            raise Exception(_('Failed to create a client for this device.') + '\n' +
                            _('Make sure it is in the correct state.'))
        # fixme: we should use: client.handler = wizard
        client.handler = self.create_handler(wizard)
        if not device_info.initialized:
            self.initialize_device(device_id, wizard, client.handler)
        client.get_xpub('m', 'standard')
        client.used()

    def get_xpub(self, device_id, derivation, xtype, wizard):
        if xtype not in self.SUPPORTED_XTYPES:
            raise ScriptTypeNotSupported(_('This type of script is not supported with {}.').format(self.device))
        devmgr = self.device_manager()
        client = devmgr.client_by_id(device_id)
        client.handler = wizard
        xpub = client.get_xpub(derivation, xtype)
        client.used()
        return xpub

    def sign_transaction(self, keystore, tx, prev_tx, xpub_path):
        self.prev_tx = prev_tx
        self.xpub_path = xpub_path
        client = self.get_client(keystore)
        inputs = self.tx_inputs(tx, True, keystore.is_segwit())
        outputs = self.tx_outputs(keystore.get_derivation(), tx, keystore.is_segwit())
        signed_tx = client.sign_tx(self.get_coin_name(), inputs, outputs, lock_time=tx.locktime)[1]
        raw = bh2u(signed_tx)
        tx.update_signatures(raw)

    def show_address(self, wallet, address, keystore=None):
        if keystore is None:
            keystore = wallet.get_keystore()
        if not self.show_address_helper(wallet, address, keystore):
            return
        if type(wallet) is not Standard_Wallet:
            keystore.handler.show_error(_('This function is only available for standard wallets when using {}.').format(self.device))
            return
        client = self.get_client(wallet.keystore)
        if not client.atleast_version(1, 3):
            wallet.keystore.handler.show_error(_("Your device firmware is too old"))
            return
        change, index = wallet.get_address_index(address)
        derivation = wallet.keystore.derivation
        address_path = "%s/%d/%d"%(derivation, change, index)
        address_n = client.expand_path(address_path)
        segwit = wallet.keystore.is_segwit()
        script_type = self.types.SPENDP2SHWITNESS if segwit else self.types.SPENDADDRESS
        client.get_address(self.get_coin_name(), address_n, True, script_type=script_type)

    def tx_inputs(self, tx, for_sig=False, segwit=False):
        inputs = []
        for txin in tx.inputs():
            txinputtype = self.types.TxInputType()
            if txin['type'] == 'coinbase':
                prev_hash = "\0"*32
                prev_index = 0xffffffff  # signed int -1
            else:
                if for_sig:
                    x_pubkeys = txin['x_pubkeys']
                    if len(x_pubkeys) == 1:
                        x_pubkey = x_pubkeys[0]
                        xpub, s = parse_xpubkey(x_pubkey)
                        xpub_n = self.client_class.expand_path(self.xpub_path[xpub])
                        txinputtype.address_n.extend(xpub_n + s)
                        txinputtype.script_type = self.types.SPENDP2SHWITNESS if segwit else self.types.SPENDADDRESS
                    else:
                        def f(x_pubkey):
                            if is_xpubkey(x_pubkey):
                                xpub, s = parse_xpubkey(x_pubkey)
                            else:
                                xpub = xpub_from_pubkey(0, bfh(x_pubkey))
                                s = []
                            node = self.ckd_public.deserialize(xpub)
                            return self.types.HDNodePathType(node=node, address_n=s)
                        pubkeys = map(f, x_pubkeys)
                        multisig = self.types.MultisigRedeemScriptType(
                            pubkeys=pubkeys,
                            signatures=map(lambda x: bfh(x)[:-1] if x else b'', txin.get('signatures')),
                            m=txin.get('num_sig'),
                        )
                        script_type = self.types.SPENDP2SHWITNESS if segwit else self.types.SPENDMULTISIG
                        txinputtype = self.types.TxInputType(
                            script_type=script_type,
                            multisig=multisig
                        )
                        # find which key is mine
                        for x_pubkey in x_pubkeys:
                            if is_xpubkey(x_pubkey):
                                xpub, s = parse_xpubkey(x_pubkey)
                                if xpub in self.xpub_path:
                                    xpub_n = self.client_class.expand_path(self.xpub_path[xpub])
                                    txinputtype.address_n.extend(xpub_n + s)
                                    break

                prev_hash = unhexlify(txin['prevout_hash'])
                prev_index = txin['prevout_n']

            if 'value' in txin:
                txinputtype.amount = txin['value']
            txinputtype.prev_hash = prev_hash
            txinputtype.prev_index = prev_index

            if txin.get('scriptSig') is not None:
                script_sig = bfh(txin['scriptSig'])
                txinputtype.script_sig = script_sig

            txinputtype.sequence = txin.get('sequence', 0xffffffff - 1)

            inputs.append(txinputtype)

        return inputs

    def tx_outputs(self, derivation, tx, segwit=False):

        def create_output_by_derivation(info):
            index, xpubs, m = info
            if len(xpubs) == 1:
                script_type = self.types.PAYTOP2SHWITNESS if segwit else self.types.PAYTOADDRESS
                address_n = self.client_class.expand_path(derivation + "/%d/%d" % index)
                txoutputtype = self.types.TxOutputType(
                    amount=amount,
                    script_type=script_type,
                    address_n=address_n,
                )
            else:
                script_type = self.types.PAYTOP2SHWITNESS if segwit else self.types.PAYTOMULTISIG
                address_n = self.client_class.expand_path("/%d/%d" % index)
                nodes = map(self.ckd_public.deserialize, xpubs)
                pubkeys = [self.types.HDNodePathType(node=node, address_n=address_n) for node in nodes]
                multisig = self.types.MultisigRedeemScriptType(
                    pubkeys=pubkeys,
                    signatures=[b''] * len(pubkeys),
                    m=m)
                txoutputtype = self.types.TxOutputType(
                    multisig=multisig,
                    amount=amount,
                    address_n=self.client_class.expand_path(derivation + "/%d/%d" % index),
                    script_type=script_type)
            return txoutputtype

        def create_output_by_address():
            txoutputtype = self.types.TxOutputType()
            txoutputtype.amount = amount
            if _type == TYPE_SCRIPT:
                txoutputtype.script_type = self.types.PAYTOOPRETURN
                txoutputtype.op_return_data = address[2:]
            elif _type == TYPE_ADDRESS:
                if is_segwit_address(address):
                    txoutputtype.script_type = self.types.PAYTOWITNESS
                else:
                    addrtype, hash_160 = b58_address_to_hash160(address)
                    if addrtype == constants.net.ADDRTYPE_P2PKH:
                        txoutputtype.script_type = self.types.PAYTOADDRESS
                    elif addrtype == constants.net.ADDRTYPE_P2SH:
                        txoutputtype.script_type = self.types.PAYTOSCRIPTHASH
                    else:
                        raise Exception('addrtype: ' + str(addrtype))
                txoutputtype.address = address
            return txoutputtype

        def is_any_output_on_change_branch():
            for _type, address, amount in tx.outputs():
                info = tx.output_info.get(address)
                if info is not None:
                    index, xpubs, m = info
                    if index[0] == 1:
                        return True
            return False

        outputs = []
        has_change = False
        any_output_on_change_branch = is_any_output_on_change_branch()

        for _type, address, amount in tx.outputs():
            use_create_by_derivation = False

            info = tx.output_info.get(address)
            if info is not None and not has_change:
                index, xpubs, m = info
                on_change_branch = index[0] == 1
                # prioritise hiding outputs on the 'change' branch from user
                # because no more than one change address allowed
                if on_change_branch == any_output_on_change_branch:
                    use_create_by_derivation = True
                    has_change = True

            if use_create_by_derivation:
                txoutputtype = create_output_by_derivation(info)
            else:
                txoutputtype = create_output_by_address()
            outputs.append(txoutputtype)

        return outputs

    def electrum_tx_to_txtype(self, tx):
        t = self.types.TransactionType()
        d = deserialize(tx.raw)
        t.version = d['version']
        t.lock_time = d['lockTime']
        inputs = self.tx_inputs(tx)
        t.inputs.extend(inputs)
        for vout in d['outputs']:
            o = t.bin_outputs.add()
            o.amount = vout['value']
            o.script_pubkey = bfh(vout['scriptPubKey'])
        return t

    # This function is called from the TREZOR libraries (via tx_api)
    def get_tx(self, tx_hash):
        tx = self.prev_tx[tx_hash]
        return self.electrum_tx_to_txtype(tx)


text:
#include <xboot.h>
#include <init.h>

static void init_task(struct task_t * task, void * data)
{
	/* Do initial vfs */
	do_init_vfs();

	/* Do initial calls */
	do_initcalls();

	/* Do initial setting */
	do_init_setting();

	/* Do show logo */
	do_show_logo();

	/* Do play audio */
	do_play_audio();

	/* Do auto mount */
	do_auto_mount();

	/* Do idle task */
	do_idle_task();

	/* Do shell task */
	do_shell_task();

	/* Do auto boot */
	do_auto_boot();
}

void xboot_main(void)
{
	/* Do initial memory */
	do_init_mem();

	/* Do initial scheduler */
	do_init_sched();

	/* Create init task */
	task_create(scheduler_self(), "init", NULL, NULL, init_task, NULL, 0, 0);

	/* Scheduler loop */
	scheduler_loop();
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"
	default-autowire="byName" default-lazy-init="false">

	<!-- baseDAO -->
	<bean id="baseDAO" class="com.abbcc.dao.impl.BaseDAOImpl">
		<property name="sqlMapClient">
			<ref bean="sqlMapClient" />
		</property>
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!-- adminDAO -->
	<bean id="adminDAO" class="com.abbcc.dao.impl.AdminDAOImpl">
		<property name="sqlMapClient">
			<ref bean="sqlMapClient" />
		</property>
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>

	<!--userDAO-->
	<bean id="userDAO" class="com.abbcc.dao.impl.UserDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--enterpriseDAO-->
	<bean id="enterpriseDAO" class="com.abbcc.dao.impl.EnterpriseDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--adminprivilegeDAO-->
	<bean id="adminprivilegeDAO" class="com.abbcc.dao.impl.AdminprivilegeDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--AdminuserprivDAO-->
	<bean id="adminuserprivDAO" class="com.abbcc.dao.impl.AdminuserprivDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--albumDAO-->
	<bean id="albumDAO" class="com.abbcc.dao.impl.AlbumDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--attachmentDAO-->
	<bean id="attachmentDAO" class="com.abbcc.dao.impl.AttachmentDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--brandDAO-->
	<bean id="brandDAO" class="com.abbcc.dao.impl.BrandDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--categoryDAO-->
	<bean id="categoryDAO" class="com.abbcc.dao.impl.CategoryDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--cellbindDAO-->
	<bean id="cellbindDAO" class="com.abbcc.dao.impl.CellbindDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--cellserverDAO-->
	<bean id="cellserverDAO" class="com.abbcc.dao.impl.CellserverDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--certificateDAO-->
	<bean id="certificateDAO" class="com.abbcc.dao.impl.CertificateDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--commentDAO-->
	<bean id="commentDAO" class="com.abbcc.dao.impl.CommentDAOImpl"/>
	<!--domainbindDAO-->
	<bean id="domainbindDAO" class="com.abbcc.dao.impl.DomainbindDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--domainregDAO-->
	<bean id="domainregDAO" class="com.abbcc.dao.impl.DomainregDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--enterpcontactDAO-->
	<bean id="enterpcontactDAO" class="com.abbcc.dao.impl.EnterpcontactDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--favouriteDAO-->
	<bean id="favouriteDAO" class="com.abbcc.dao.impl.FavouriteDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--jobDAO-->
	<bean id="jobDAO" class="com.abbcc.dao.impl.JobDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--layoutDAO-->
	<bean id="layoutDAO" class="com.abbcc.dao.impl.LayoutDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--layoutmoduleDAO-->
	<bean id="layoutmoduleDAO" class="com.abbcc.dao.impl.LayoutmoduleDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--linkDAO-->
	<bean id="linkDAO" class="com.abbcc.dao.impl.LinkDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--logDAO-->
	<bean id="logDAO" class="com.abbcc.dao.impl.LogDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--mailDAO-->
	<bean id="mailDAO" class="com.abbcc.dao.impl.MailDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--mailsendDAO-->
	<bean id="mailsendDAO" class="com.abbcc.dao.impl.MailsendDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--mailtemplateDAO-->
	<bean id="mailtemplateDAO" class="com.abbcc.dao.impl.MailtemplateDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--layoutmoduleDAO-->
	<bean id="messageDAO" class="com.abbcc.dao.impl.MessageDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--moduleDAO-->
	<bean id="moduleDAO" class="com.abbcc.dao.impl.ModuleDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--newsDAO-->
	<bean id="newsDAO" class="com.abbcc.dao.impl.NewsDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--paylogDAO-->
	<bean id="paylogDAO" class="com.abbcc.dao.impl.PaylogDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--payuserDAO-->
	<bean id="payuserDAO" class="com.abbcc.dao.impl.PayuserDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--productDAO-->
	<bean id="productDAO" class="com.abbcc.dao.impl.ProductDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--recycleDAO-->
	<bean id="recycleDAO" class="com.abbcc.dao.impl.RecycleDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--supplyDAO-->
	<bean id="supplyDAO" class="com.abbcc.dao.impl.SupplyDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--syscodeDAO-->
	<bean id="syscodeDAO" class="com.abbcc.dao.impl.SyscodeDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--upgradelogDAO-->
	<bean id="upgradelogDAO" class="com.abbcc.dao.impl.UpgradelogDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--usergroupDAO-->
	<bean id="usergroupDAO" class="com.abbcc.dao.impl.UsergroupDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--viewlogDAO-->
	<bean id="viewlogDAO" class="com.abbcc.dao.impl.ViewlogDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--userprivilegeDAO-->
	<bean id="userprivilegeDAO" class="com.abbcc.dao.impl.UserprivilegeDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--UserprivDAO-->
	<bean id="userprivDAO" class="com.abbcc.dao.impl.UserprivDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<bean id="orderDAO" class="com.abbcc.dao.impl.OrderDAOImpl">
		<property name="sessionFactory" ref="sessionFactory" />
	</bean>
	<bean id="statDAO" class="com.abbcc.dao.impl.StatDAOImpl">
		<property name="sessionFactory" ref="sessionFactory" />
	</bean>
	<!--GroupmemberDAO-->
	<bean id="groupmemberDAO" class="com.abbcc.dao.impl.GroupmemberDAOImpl">
		<property name="sessionFactory" ref="sessionFactory" />
	</bean>
	<!--menuDAO-->
	<bean id="menuDAO" class="com.abbcc.dao.impl.MenuDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<!--customDAO-->
	<bean id="customDAO" class="com.abbcc.dao.impl.CustomDAOImpl">
		<property name="sessionFactory">
			<ref bean="sessionFactory" />
		</property>
	</bean>
	<bean id="themeDAO" class="com.abbcc.dao.impl.ThemeDAOImpl"/>
	<bean id="laythemeDAO" class="com.abbcc.dao.impl.LaythemeDAOImpl"/>
	<bean id="bindDAO" class="com.abbcc.dao.impl.BindDAOImpl"/>
	<bean id="PopularizeDAO" class="com.abbcc.dao.impl.PopularizeDAOImpl"/>
	<bean id="soaWebserverDAO" class="com.abbcc.dao.impl.SoaWebserverDAOImpl">
		<property name="sessionFactory" ref="sessionFactory" />
	</bean>
	<bean id="soaUserDAO" class="com.abbcc.dao.impl.SoaUserDAOImpl">
		<property name="sessionFactory" ref="sessionFactory" />
	</bean>
	<bean id="soaTemplateDAO" class="com.abbcc.dao.impl.SoaTemplateDAOImpl">
		<property name="sessionFactory" ref="sessionFactory" />
	</bean>
	<bean id="soaTemplateCriteriaDAO" class="com.abbcc.dao.impl.SoaTemplateCriteriaDAOImpl">
		<property name="sessionFactory" ref="sessionFactory" />
	</bean>
	<bean id="soaLogDAO" class="com.abbcc.dao.impl.SoaLogDAOImpl">
		<property name="sessionFactory" ref="sessionFactory" />
	</bean>

	<bean id="newsClassDAO" class="com.abbcc.news.dao.impl.NewsClassDAOImpl"/>
	<bean id="newsGenusDAO" class="com.abbcc.news.dao.impl.NewsGenusDAOImpl"/>
	<bean id="newsNewsDAO" class="com.abbcc.news.dao.impl.NewsNewsDAOImpl"/>
	<bean id="merchantsDAO" class="com.abbcc.merchants.dao.impl.MerchantsDAOImpl"/>
	<bean id="ChannelsClassDAO" class="com.abbcc.merchants.dao.impl.ChannelsClassDAOImpl"/>
	<bean id="ChannelsInfoDAO" class="com.abbcc.merchants.dao.impl.ChannelsInfoDAOImpl"/>
	<bean id="DoorVipDAO" class="com.abbcc.merchants.dao.impl.DoorVipDAOImpl"/>
</beans>


text:
                            Search Here

                        <form action="<?php echo site_url('users/search') ?>" method="POST" class='form-vertical'>

                                         Name

                                            <input type="text" name="users_fname" id="mission_name" placeholder="User name" class="input-block-level">

                                        Middle Name

                                            <input type="text" name="users_mname" id="mission_name" placeholder="User Middle name" class="input-block-level">

                                        Last Name

                                            <input type="text" name="users_lname" id="mission_name" placeholder="User last name" class="input-block-level">

                                        Mobile Number

                                            <input type="text" name="users_mobno1" id="mission_name" placeholder="Mobile Number" class="input-block-level">

                                        Address

                                            <input type="text" name="users_adress" id="mission_name" placeholder="Users Address" class="input-block-level">

				Shibir

				<select name="shibir" id="shibir" multiple="multiple" class="chosen-select input-xxlarge">
				<option value="1">shibir1</option>
				<option value="2">shibir2</option>
				<option value="3">borivali</option>
				<option value="4">kancivali</option>
				<option value="5">Option-5</option>
				<option value="6">Option-6</option>
				<option value="7">Option-7</option>
				</select>

                                            <input type="submit" class="btn btn-primary" value="Submit">
                                            <button type="button" class="btn">Cancel</button>

                    </form>

<?php echo $this->session->flashdata('responseMessage'); ?>

                        User List

                                #
                                Name
                                Middle Name
                                Last Name
                                Gender
                                Mobilen Number
                                Email_id
                                Area
                                Adress
                                Eduction
                                Options

                            <?php
                            if (count($users) > 0) {

                                foreach ($users as $value) {
                                    ?>

                                        <?php echo $value['users_id'] ?>
                                        <?php echo $value['users_fname'] ?>
                                        <?php echo $value['users_mname'] ?>
                                        <?php echo $value['users_lname'] ?>
                                        <?php echo $value['users_gender'] ?>
                                        <?php echo $value['users_mobno1'] ?>
                                        <?php echo $value['users_email_id'] ?>
                                        <?php echo $value['users_adress'] ?>
                                        <?php echo $value['users_area'] ?>
                                        <?php echo $value['users_education'] ?>

                                    <?php
                                }
                            }
                            ?>


text:
class BScreen;
class ButtonTheme;
class TrayWindow;
class AtomHandler;

namespace FbTk {
template <class T> class ThemeProxy;
class Observer;
}

class SystemTray: public ToolbarItem, public FbTk::EventHandler {
public:

    explicit SystemTray(const FbTk::FbWindow &parent,
                        FbTk::ThemeProxy<ToolTheme> &theme, BScreen& screen);
    virtual ~SystemTray();

    void move(int x, int y);
    void resize(unsigned int width, unsigned int height);
    void moveResize(int x, int y,
                    unsigned int width, unsigned int height);
    void show();
    void hide();

    bool active() { return !m_clients.empty(); }

    bool clientMessage(const XClientMessageEvent &event);
    void exposeEvent(XExposeEvent &event);
    void handleEvent(XEvent &event);

    void addClient(Window win, bool using_xembed);
    void removeClient(Window win, bool destroyed);

    unsigned int width() const;
    unsigned int height() const;
    unsigned int borderWidth() const;

    int numClients() const { return m_clients.size(); }
    const FbTk::FbWindow &window() const { return m_window; }

    void renderTheme(unsigned char alpha) {
        m_window.setBorderWidth(m_theme->border().width());
        m_window.setBorderColor(m_theme->border().color());
        m_window.setAlpha(alpha);
        update();
    }
    void updateSizing() { m_window.setBorderWidth(m_theme->border().width()); }

    void parentMoved() { m_window.parentMoved(); }

    static Atom getXEmbedInfoAtom();

private:

    void update();

    typedef std::list<TrayWindow *> ClientList;
    ClientList::iterator findClient(Window win);

    void rearrangeClients();
    void removeAllClients();
    void hideClient(TrayWindow *traywin, bool destroyed = false);
    void showClient(TrayWindow *traywin);

    FbTk::FbWindow m_window;
    FbTk::ThemeProxy<ToolTheme> &m_theme;
    BScreen& m_screen;
    Pixmap m_pixmap;

    std::auto_ptr<AtomHandler> m_handler;

    ClientList m_clients;
    size_t m_num_visible_clients;

    // gaim/pidgin seems to barf if the selection is not an independent window.
    // I suspect it's an interacton with parent relationship and gdk window caching.
    FbTk::FbWindow m_selection_owner;
    std::auto_ptr<FbTk::Observer> m_observer;
};

#endif // SYSTEMTRAY_HH


text:
# Written for Python 2.x
# Tested on
# Windows 7 x64 - Python 2.7.6

import urllib
import json

if __name__ == "__main__":
  # get the arrest data
  roster = urllib.urlopen("http://api.canyonco.org/Sheriff/JailRosterByLetter/A").read()
  # parse the JSON
  jsonData = json.loads(roster)

  # If the first element's Error is not empty it will be the error message
  # not exactly restful, but it was easy
  error = jsonData[0]["Error"]

  if error == '':
    # loop through the inmates
    for inmate in jsonData:
      print "%s, %s" % (inmate["LastName"].title(), inmate["FirstName"].title())

      # loop through the arrests
      for arrest in inmate["Arrests"]:
        print "  Arrest Date: %s" % arrest["ArrestDate"]

      # loop through the charges
      for charge in inmate["Charges"]:
        print "  Charge: %s: %s" % (charge["StatuteCode"], charge["StatuteDesc"])

  else:
    print "Error getting data", error


text:
title:  Wise Knowledge
date:  07/05/2022
---

#### inTro

**Read This Week's Passage: James 3:13–18**

**Wise Knowledge**

One way to define gaining knowledge is the acquiring of facts or information. Wisdom, though, is the ability to use that knowledge in the right way: with sound judgment, a wholistic perspective, and in lessons learned through personal experience. There are different kinds of wisdom, James is quick to point out, and, like other attributes he has explored so far, the kind of wisdom that he is talking about can be seen in the life.

Though other characteristics of wisdom are explored in subsequent verses, James first focuses on the meekness of wisdom. Knowledge, when not tempered with wisdom, can easily lead to arrogance, a completely disproportionate view of one's own self-importance. Perhaps it's due to humanity's natural bent toward selfishness or the inaccurate metric of accomplishment to determine self-worth; in whatever case, nearly everyone can think of someone who comes across as arrogant because of how they wield "how much they know" about this or that. Wisdom, when it's the right kind, allows the knowledgeable one to see their knowledge in its context, and see themselves in the proper context too. This "proper context" can also be called reality, and it results in meekness.

This week's lesson will explore how not all wisdom is created equal, but the Christian doesn't have to be confused about the good and the bad—just like everything else, the evidence is in the fruit.

#### inScribe

Write out James 3:13–18 from the translation of your choice. If you're pressed for time, write out James 3:17. You may also rewrite the passage in your own words, or outline or mind-map it.

` `


text:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="CoreNLP-to-HTML.xsl" type="text/xsl"?>
<root>
  <document>
    <sentences>
      <sentence id="1">
        <tokens>
          <token id="1">
            <word>a</word>
            <lemma>a</lemma>
            <CharacterOffsetBegin>0</CharacterOffsetBegin>
            <CharacterOffsetEnd>1</CharacterOffsetEnd>
            <POS>DT</POS>
          </token>
          <token id="2">
            <word>military</word>
            <lemma>military</lemma>
            <CharacterOffsetBegin>2</CharacterOffsetBegin>
            <CharacterOffsetEnd>10</CharacterOffsetEnd>
            <POS>JJ</POS>
          </token>
          <token id="3">
            <word>aircraft</word>
            <lemma>aircraft</lemma>
            <CharacterOffsetBegin>11</CharacterOffsetBegin>
            <CharacterOffsetEnd>19</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="4">
            <word>designed</word>
            <lemma>design</lemma>
            <CharacterOffsetBegin>20</CharacterOffsetBegin>
            <CharacterOffsetEnd>28</CharacterOffsetEnd>
            <POS>VBN</POS>
          </token>
          <token id="5">
            <word>to</word>
            <lemma>to</lemma>
            <CharacterOffsetBegin>29</CharacterOffsetBegin>
            <CharacterOffsetEnd>31</CharacterOffsetEnd>
            <POS>TO</POS>
          </token>
          <token id="6">
            <word>attack</word>
            <lemma>attack</lemma>
            <CharacterOffsetBegin>32</CharacterOffsetBegin>
            <CharacterOffsetEnd>38</CharacterOffsetEnd>
            <POS>VB</POS>
          </token>
          <token id="7">
            <word>ground</word>
            <lemma>ground</lemma>
            <CharacterOffsetBegin>39</CharacterOffsetBegin>
            <CharacterOffsetEnd>45</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
          <token id="8">
            <word>targets</word>
            <lemma>target</lemma>
            <CharacterOffsetBegin>46</CharacterOffsetBegin>
            <CharacterOffsetEnd>53</CharacterOffsetEnd>
            <POS>NNS</POS>
          </token>
          <token id="9">
            <word>bomber</word>
            <lemma>bomber</lemma>
            <CharacterOffsetBegin>54</CharacterOffsetBegin>
            <CharacterOffsetEnd>60</CharacterOffsetEnd>
            <POS>NN</POS>
          </token>
        </tokens>
        <parse>(ROOT (S (NP (DT a) (JJ military) (NN aircraft)) (VP (VBN designed) (S (VP (TO to) (VP (VB attack) (NP (NN ground) (NNS targets) (NN bomber)))))))) </parse>
        <dependencies type="basic-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="4">designed</dependent>
          </dep>
          <dep type="det">
            <governor idx="3">aircraft</governor>
            <dependent idx="1">a</dependent>
          </dep>
          <dep type="amod">
            <governor idx="3">aircraft</governor>
            <dependent idx="2">military</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="4">designed</governor>
            <dependent idx="3">aircraft</dependent>
          </dep>
          <dep type="aux">
            <governor idx="6">attack</governor>
            <dependent idx="5">to</dependent>
          </dep>
          <dep type="xcomp">
            <governor idx="4">designed</governor>
            <dependent idx="6">attack</dependent>
          </dep>
          <dep type="nn">
            <governor idx="9">bomber</governor>
            <dependent idx="7">ground</dependent>
          </dep>
          <dep type="nn">
            <governor idx="9">bomber</governor>
            <dependent idx="8">targets</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="6">attack</governor>
            <dependent idx="9">bomber</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="4">designed</dependent>
          </dep>
          <dep type="det">
            <governor idx="3">aircraft</governor>
            <dependent idx="1">a</dependent>
          </dep>
          <dep type="amod">
            <governor idx="3">aircraft</governor>
            <dependent idx="2">military</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="4">designed</governor>
            <dependent idx="3">aircraft</dependent>
          </dep>
          <dep type="aux">
            <governor idx="6">attack</governor>
            <dependent idx="5">to</dependent>
          </dep>
          <dep type="xcomp">
            <governor idx="4">designed</governor>
            <dependent idx="6">attack</dependent>
          </dep>
          <dep type="nn">
            <governor idx="9">bomber</governor>
            <dependent idx="7">ground</dependent>
          </dep>
          <dep type="nn">
            <governor idx="9">bomber</governor>
            <dependent idx="8">targets</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="6">attack</governor>
            <dependent idx="9">bomber</dependent>
          </dep>
        </dependencies>
        <dependencies type="collapsed-ccprocessed-dependencies">
          <dep type="root">
            <governor idx="0">ROOT</governor>
            <dependent idx="4">designed</dependent>
          </dep>
          <dep type="det">
            <governor idx="3">aircraft</governor>
            <dependent idx="1">a</dependent>
          </dep>
          <dep type="amod">
            <governor idx="3">aircraft</governor>
            <dependent idx="2">military</dependent>
          </dep>
          <dep type="nsubj">
            <governor idx="4">designed</governor>
            <dependent idx="3">aircraft</dependent>
          </dep>
          <dep type="aux">
            <governor idx="6">attack</governor>
            <dependent idx="5">to</dependent>
          </dep>
          <dep type="xcomp">
            <governor idx="4">designed</governor>
            <dependent idx="6">attack</dependent>
          </dep>
          <dep type="nn">
            <governor idx="9">bomber</governor>
            <dependent idx="7">ground</dependent>
          </dep>
          <dep type="nn">
            <governor idx="9">bomber</governor>
            <dependent idx="8">targets</dependent>
          </dep>
          <dep type="dobj">
            <governor idx="6">attack</governor>
            <dependent idx="9">bomber</dependent>
          </dep>
        </dependencies>
      </sentence>
    </sentences>
  </document>
</root>


text:
package models;

import javax.persistence.Entity;
import javax.persistence.Id;
import play.db.ebean.Model;

@Entity
public class PageRetrieval extends Model {

  private static final long serialVersionUID = 1L;

  @Id
  private Long id;
  private Long timestamp = System.currentTimeMillis();

  /**
   * The EBean ORM finder method for database queries on LastTimeStamp.
   * @return The finder method for products.
   */
  public static Finder<Long, PageRetrieval> find() {
    return new Finder<Long, PageRetrieval>(Long.class, PageRetrieval.class);
  }

  /**
   * @return the timestamp associated with the page retrieval.
   */
  public Long getTimestamp() {
    return timestamp;
  }

  /**
   * @param timestamp the timestamp to set
   */
  public void setTimestamp(Long timestamp) {
    this.timestamp = timestamp;
  }

}


text:
package com.devsh.recyclerview_image_gallery;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;

public class SquareViewItem extends ImageView {

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

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

    public SquareViewItem(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

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


text:
using System;
using System.Threading.Tasks;
using Orleans;
using Orleans.Concurrency;

namespace UnitTests.GrainInterfaces
{
    public interface IReentrantGrain : IGrainWithIntegerKey
    {
        Task<string> One();

        Task<string> Two();

        Task SetSelf(IReentrantGrain self);
    }

    public interface INonReentrantGrain : IGrainWithIntegerKey
    {
        Task<string> One();

        Task<string> Two();

        Task SetSelf(INonReentrantGrain self);

        Task<int> GetCounter();

        Task IncrementCounter();

        Task<int> GetCounterAndScheduleIncrement();

        Task<int> Ping(int t);

        Task<int> PingOther(INonReentrantGrain target, int t);

        [AlwaysInterleave]
        Task<int> PingSelfThroughOtherInterleaving(INonReentrantGrain target, int t);

        Task ScheduleDelayedIncrement(INonReentrantGrain target, TimeSpan delay);

        Task DoAsyncWork(TimeSpan waitTime, GrainCancellationToken gct);
    }

    public interface IMayInterleavePredicateGrain : IGrainWithIntegerKey
    {
        Task<string> One(string arg); // this interleaves only when arg == "reentrant"

        Task<string> Two();
        Task<string> TwoReentrant();

        Task Exceptional();

        Task SubscribeToStream();
        Task PushToStream(string item);

        Task SetSelf(IMayInterleavePredicateGrain self);
    }

    [Unordered]
    public interface IUnorderedNonReentrantGrain : IGrainWithIntegerKey
    {
        Task<string> One();

        Task<string> Two();

        Task SetSelf(IUnorderedNonReentrantGrain self);
    }

    public interface IReentrantSelfManagedGrain : IGrainWithIntegerKey
    {
        Task<int> GetCounter();

        Task Ping(int seconds);

        Task SetDestination(long id);
    }

    public interface INonReentrantSelfManagedGrain : IGrainWithIntegerKey
    {
        Task<int> GetCounter();

        Task Ping(int seconds);

        Task SetDestination(long id);
    }

    public interface IReentrantTaskGrain : IGrainWithIntegerKey
    {
        Task SetDestination(long id);
        Task Ping(TimeSpan wait);
        Task<int> GetCounter();
    }

    public interface INonReentrantTaskGrain : IGrainWithIntegerKey
    {
        Task SetDestination(long id);
        Task Ping(TimeSpan wait);
        Task<int> GetCounter();
    }

    public interface IFanOutGrain : IGrainWithIntegerKey
    {
        Task FanOutReentrant(int offset, int num);
        Task FanOutNonReentrant(int offset, int num);
        Task FanOutReentrant_Chain(int offset, int num);
        Task FanOutNonReentrant_Chain(int offset, int num);
    }

    public interface IFanOutACGrain : IGrainWithIntegerKey
    {
        Task FanOutACReentrant(int offset, int num);
        Task FanOutACNonReentrant(int offset, int num);
        Task FanOutACReentrant_Chain(int offset, int num);
        Task FanOutACNonReentrant_Chain(int offset, int num);
    }

    public interface IReentrantTestSupportGrain : IGrainWithIntegerKey
    {
        Task<bool> IsReentrant(string fullTypeName);
    }
}