text:
  /////////////////////类:GCD///////////////////////
@implementation GCD

#pragma mark  执行同步任务
+ (void)executeSyncTask:(dispatch_block_t)task inQueue:(GCDQueue*)queue{
    NSParameterAssert(task);
    dispatch_sync(queue.dispatchQueue, task);
}

#pragma mark  执行异步任务
+ (void)executeAsyncTask:(dispatch_block_t)task inQueue:(GCDQueue*)queue{
    NSParameterAssert(task);
    dispatch_async(queue.dispatchQueue, task);
}

#pragma mark 和组相关
+ (void)executeTask:(dispatch_block_t)task inQueue:(GCDQueue*)queue
                                           inGroup:(GCDGroup*)group{
    NSParameterAssert(task);
    dispatch_group_async(group.dispatchGroup, queue.dispatchQueue, task);
}

+ (void)notifyTask:(dispatch_block_t)task inQueue:(GCDQueue*)queue
            inGroup:(GCDGroup*)group{
    NSParameterAssert(task);
    dispatch_group_notify(group.dispatchGroup, queue.dispatchQueue, task);
}

#pragma mark  一次性函数
//+ (void)executeOnceTask:(dispatch_block_t)task{
//    NSParameterAssert(task);
//    GCDExecOnce(task);
//}

@end

  /////////////////////类:MainQueue///////////////////////

@implementation MainQueue

#pragma mark  执行同步任务
+ (void)executeSyncTask:(dispatch_block_t)task{
    NSParameterAssert(task);
    // 如果当前队列是主队列,要提示奔溃处理
    dispatch_sync(mainQueue, task);
}
#pragma mark  执行异步任务
+ (void)executeAsyncTask:(dispatch_block_t)task{
    NSParameterAssert(task);
    dispatch_async(mainQueue, task);
}
#pragma mark  在五个系统提供的队列上,执行延迟任务
+ (void)executeDelayTask:(dispatch_block_t)task
          afterDelaySecs:(NSTimeInterval)sec{
    NSParameterAssert(task);
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC * sec), mainQueue, task);
}
#pragma mark  和组相关
/// execute
+ (void)executeTask:(dispatch_block_t)task
            inGroup:(GCDGroup*)group{
    NSParameterAssert(task);
    dispatch_group_async(group.dispatchGroup, mainQueue, task);
}
///notify
+ (void)notifyTask:(dispatch_block_t)task
           inGroup:(GCDGroup*)group{
    NSParameterAssert(task);
    dispatch_group_notify(group.dispatchGroup, mainQueue, task);
}
#pragma mark  暂停恢复函数,暂停和恢复对应的系统提供的主队列
+ (void)suspend{
    dispatch_suspend(mainQueue);
}
+ (void)resume{
    dispatch_resume(mainQueue);
}
#pragma mark  迭代函数
+ (void)applyExecuteTask:(TaskBlock)task count:(float)count{
    NSParameterAssert(task);
    dispatch_apply(count, mainQueue, task);
}
@end

  ////////////////////类:GlobalQueue////////////////////////

@implementation GlobalQueue

#pragma mark  执行同步任务
+ (void)executeSyncTask:(dispatch_block_t)task{
    NSParameterAssert(task);
    // 如果当前队列是主队列,要提示奔溃处理
    dispatch_sync(globalQueue, task);
}
#pragma mark  执行异步任务
+ (void)executeAsyncTask:(dispatch_block_t)task{
    NSParameterAssert(task);
    dispatch_async(globalQueue, task);
}
#pragma mark  在五个系统提供的队列上,执行延迟任务
+ (void)executeDelayTask:(dispatch_block_t)task
          afterDelaySecs:(NSTimeInterval)sec{
    NSParameterAssert(task);
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC * sec), globalQueue, task);
}
#pragma mark  和组相关
/// execute
+ (void)executeTask:(dispatch_block_t)task
            inGroup:(GCDGroup*)group{
    NSParameterAssert(task);
    dispatch_group_async(group.dispatchGroup, globalQueue, task);
}
///notify
+ (void)notifyTask:(dispatch_block_t)task
           inGroup:(GCDGroup*)group{
    NSParameterAssert(task);
    dispatch_group_notify(group.dispatchGroup, globalQueue, task);
}
#pragma mark  暂停恢复函数,暂停和恢复对应的系统提供的主队列
+ (void)suspend{
    dispatch_suspend(globalQueue);
}
+ (void)resume{
    dispatch_resume(globalQueue);
}
#pragma mark  迭代函数
+ (void)applyExecuteTask:(TaskBlock)task count:(float)count{
    NSParameterAssert(task);
    dispatch_apply(count, globalQueue, task);
}
@end

  ////////////////////类:GlobalLowPriorityQueue////////////////////////

@implementation GlobalLowPriorityQueue

#pragma mark  执行同步任务
+ (void)executeSyncTask:(dispatch_block_t)task{
    NSParameterAssert(task);
    // 如果当前队列是主队列,要提示奔溃处理
    dispatch_sync(globalLowPriorityQueue, task);
}
#pragma mark  执行异步任务
+ (void)executeAsyncTask:(dispatch_block_t)task{
    NSParameterAssert(task);
    dispatch_async(globalLowPriorityQueue, task);
}
#pragma mark  在五个系统提供的队列上,执行延迟任务
+ (void)executeDelayTask:(dispatch_block_t)task
          afterDelaySecs:(NSTimeInterval)sec{
    NSParameterAssert(task);
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC * sec), globalLowPriorityQueue, task);
}
#pragma mark  和组相关
/// execute
+ (void)executeTask:(dispatch_block_t)task
            inGroup:(GCDGroup*)group{
    NSParameterAssert(task);
    dispatch_group_async(group.dispatchGroup, globalLowPriorityQueue, task);
}
///notify
+ (void)notifyTask:(dispatch_block_t)task
           inGroup:(GCDGroup*)group{
    NSParameterAssert(task);
    dispatch_group_notify(group.dispatchGroup, globalLowPriorityQueue, task);
}
#pragma mark  暂停恢复函数,暂停和恢复对应的系统提供的主队列
+ (void)suspend{
    dispatch_suspend(globalLowPriorityQueue);
}
+ (void)resume{
    dispatch_resume(globalLowPriorityQueue);
}
#pragma mark  迭代函数
+ (void)applyExecuteTask:(TaskBlock)task count:(float)count{
    NSParameterAssert(task);
    dispatch_apply(count, globalLowPriorityQueue, task);
}
@end

  ////////////////////类:GlobalHighPriorityQueue////////////////////////

@implementation GlobalHighPriorityQueue

#pragma mark  执行同步任务
+ (void)executeSyncTask:(dispatch_block_t)task{
    NSParameterAssert(task);
    // 如果当前队列是主队列,要提示奔溃处理
    dispatch_sync(globalHighPriorityQueue, task);
}
#pragma mark  执行异步任务
+ (void)executeAsyncTask:(dispatch_block_t)task{
    NSParameterAssert(task);
    dispatch_async(globalHighPriorityQueue, task);
}
#pragma mark  在五个系统提供的队列上,执行延迟任务
+ (void)executeDelayTask:(dispatch_block_t)task
          afterDelaySecs:(NSTimeInterval)sec{
    NSParameterAssert(task);
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC * sec), globalHighPriorityQueue, task);
}
#pragma mark  和组相关
/// execute
+ (void)executeTask:(dispatch_block_t)task
            inGroup:(GCDGroup*)group{
    NSParameterAssert(task);
    dispatch_group_async(group.dispatchGroup, globalHighPriorityQueue, task);
}
///notify
+ (void)notifyTask:(dispatch_block_t)task
           inGroup:(GCDGroup*)group{
    NSParameterAssert(task);
    dispatch_group_notify(group.dispatchGroup, globalHighPriorityQueue, task);
}
#pragma mark  暂停恢复函数,暂停和恢复对应的系统提供的主队列
+ (void)suspend{
    dispatch_suspend(globalHighPriorityQueue);
}
+ (void)resume{
    dispatch_resume(globalHighPriorityQueue);
}
#pragma mark  迭代函数
+ (void)applyExecuteTask:(TaskBlock)task count:(float)count{
    NSParameterAssert(task);
    dispatch_apply(count, globalHighPriorityQueue, task);
}
@end

  ////////////////////类:GlobalBackgroundPriorityQueue////////////////////////

@implementation GlobalBackgroundPriorityQueue

#pragma mark  执行同步任务
+ (void)executeSyncTask:(dispatch_block_t)task{
    NSParameterAssert(task);
    // 如果当前队列是主队列,要提示奔溃处理
    dispatch_sync(globalBackgroundPriorityQueue, task);
}
#pragma mark  执行异步任务
+ (void)executeAsyncTask:(dispatch_block_t)task{
    NSParameterAssert(task);
    dispatch_async(globalBackgroundPriorityQueue, task);
}
#pragma mark  在五个系统提供的队列上,执行延迟任务
+ (void)executeDelayTask:(dispatch_block_t)task
          afterDelaySecs:(NSTimeInterval)sec{
    NSParameterAssert(task);
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, NSEC_PER_SEC * sec), globalBackgroundPriorityQueue, task);
}

#pragma mark  和组相关
/// execute
+ (void)executeTask:(dispatch_block_t)task
            inGroup:(GCDGroup*)group{
    NSParameterAssert(task);
    dispatch_group_async(group.dispatchGroup, globalBackgroundPriorityQueue, task);
}
///notify
+ (void)notifyTask:(dispatch_block_t)task
           inGroup:(GCDGroup*)group{
    NSParameterAssert(task);
    dispatch_group_notify(group.dispatchGroup, globalBackgroundPriorityQueue, task);
}
#pragma mark  暂停恢复函数,暂停和恢复对应的系统提供的主队列
+ (void)suspend{
    dispatch_suspend(globalBackgroundPriorityQueue);
}
+ (void)resume{
    dispatch_resume(globalBackgroundPriorityQueue);
}
#pragma mark  迭代函数
+ (void)applyExecuteTask:(TaskBlock)task count:(float)count{
    NSParameterAssert(task);
    dispatch_apply(count, globalBackgroundPriorityQueue, task);
}
@end


text:
Edit Ingredients

		<a class="add" href='<?php echo site_url(); ?>ingredients'>Back to List

	<form onSubmit='return validate()' action="<?php echo site_url(); ?>ingredients/doEdit/<?php echo $id; ?>" method="post" accept-charset="utf-8" enctype="multipart/form-data">

				Name
				<input type='text' value='<?php echo htmlspecialchars($ingredients['name'], ENT_QUOTES); ?>' id='name' name='name' />

			<input class="submit" type="submit" name="" value="Submit" />
			<input type='hidden' id='id' name='id' value='<?php echo htmlspecialchars($id, ENT_QUOTES); ?>' />

	</form>

redpajama_set_name: RedPajamaGithub


text:
package org.b3log.symphony.model;

/**
 * This class defines ext of user model relevant keys.
 *
 * @author Liang Ding
 * @version 2.14.1.9, Sep 9, 2015
 * @since 0.2.0
 * @see org.b3log.latke.model.User
 */
public final class UserExt {

    /**
     * Key of sync to client.
     */
    public static final String SYNC_TO_CLIENT = "syncWithSymphonyClient";

    /**
     * Key of user geo status.
     */
    public static final String USER_GEO_STATUS = "userGeoStatus";

    /**
     * Key of user update time.
     */
    public static final String USER_UPDATE_TIME = "userUpdateTime";

    /**
     * Key of user city.
     */
    public static final String USER_CITY = "userCity";

    /**
     * Key of user country.
     */
    public static final String USER_COUNTRY = "userCountry";

    /**
     * Key of user province.
     */
    public static final String USER_PROVINCE = "userProvince";

    /**
     * Key of user skin.
     */
    public static final String USER_SKIN = "userSkin";

    /**
     * Key of user longest checkin streak start.
     */
    public static final String USER_LONGEST_CHECKIN_STREAK_START = "userLongestCheckinStreakStart";

    /**
     * Key of user longest checkin streak end.
     */
    public static final String USER_LONGEST_CHECKIN_STREAK_END = "userLongestCheckinStreakEnd";

    /**
     * Key of user current checkin streak start.
     */
    public static final String USER_CURRENT_CHECKIN_STREAK_START = "userCurrentCheckinStreakStart";

    /**
     * Key of user current checkin streak start end.
     */
    public static final String USER_CURRENT_CHECKIN_STREAK_END = "userCurrentCheckinStreakEnd";

    /**
     * Key of user longest checkin streak.
     */
    public static final String USER_LONGEST_CHECKIN_STREAK = "userLongestCheckinStreak";

    /**
     * Key of user current checkin streak.
     */
    public static final String USER_CURRENT_CHECKIN_STREAK = "userCurrentCheckinStreak";

    /**
     * Key of user article count.
     */
    public static final String USER_ARTICLE_COUNT = "userArticleCount";

    /**
     * Key of user comment count.
     */
    public static final String USER_COMMENT_COUNT = "userCommentCount";

    /**
     * Key of new tag count.
     */
    public static final String USER_TAG_COUNT = "userTagCount";

    /**
     * Key of user status.
     */
    public static final String USER_STATUS = "userStatus";

    /**
     * Key of user point.
     */
    public static final String USER_POINT = "userPoint";

    /**
     * Key of user tags.
     */
    public static final String USER_TAGS = "userTags";

    /**
     * Key of user QQ.
     */
    public static final String USER_QQ = "userQQ";

    /**
     * Key of user number.
     */
    public static final String USER_NO = "userNo";

    /**
     * Key of user intro.
     */
    public static final String USER_INTRO = "userIntro";

    /**
     * Key of user avatar type.
     */
    public static final String USER_AVATAR_TYPE = "userAvatarType";

    /**
     * Key of user avatar URL.
     */
    public static final String USER_AVATAR_URL = "userAvatarURL";

    /**
     * Key of user B3log key.
     */
    public static final String USER_B3_KEY = "userB3Key";

    /**
     * Key of user B3log client add article URL.
     */
    public static final String USER_B3_CLIENT_ADD_ARTICLE_URL = "userB3ClientAddArticleURL";

    /**
     * Key of user B3log client update article URL.
     */
    public static final String USER_B3_CLIENT_UPDATE_ARTICLE_URL = "userB3ClientUpdateArticleURL";

    /**
     * Key of user B3log client add comment URL.
     */
    public static final String USER_B3_CLIENT_ADD_COMMENT_URL = "userB3ClientAddCommentURL";

    /**
     * Key of online flag.
     */
    public static final String USER_ONLINE_FLAG = "userOnlineFlag";

    /**
     * Key of latest post article time.
     */
    public static final String USER_LATEST_ARTICLE_TIME = "userLatestArticleTime";

    /**
     * Key of latest comment time.
     */
    public static final String USER_LATEST_CMT_TIME = "userLatestCmtTime";

    /**
     * Key of latest login time.
     */
    public static final String USER_LATEST_LOGIN_TIME = "userLatestLoginTime";

    /**
     * Key of latest login IP.
     */
    public static final String USER_LATEST_LOGIN_IP = "userLatestLoginIP";

    /**
     * Key of app role.
     */
    public static final String USER_APP_ROLE = "userAppRole";

    //// Transient ////
    /**
     * Key of user create time.
     */
    public static final String USER_T_CREATE_TIME = "userCreateTime";

    /**
     * Key of user point in Hex.
     */
    public static final String USER_T_POINT_HEX = "userPointHex";

    /**
     * Key of user point in Color Code.
     */
    public static final String USER_T_POINT_CC = "userPointCC";

    //// Default Commenter constants
    /**
     * Default commenter name.
     */
    public static final String DEFAULT_CMTER_NAME = "Default Commenter";

    /**
     * Default commenter email.
     */
    public static final String DEFAULT_CMTER_EMAIL = "default_commenter@b3log.org";

    /**
     * Default commenter role.
     */
    public static final String DEFAULT_CMTER_ROLE = "defaultCommenterRole";

    //// Null user
    /**
     * Null user name.
     */
    public static final String NULL_USER_NAME = "_";

    //// Status constants
    /**
     * User status - valid.
     */
    public static final int USER_STATUS_C_VALID = 0;

    /**
     * User status - invalid.
     */
    public static final int USER_STATUS_C_INVALID = 1;

    /**
     * User status - registered but not verified.
     */
    public static final int USER_STATUS_C_NOT_VERIFIED = 2;

    //// Geo Status constants
    /**
     * User geo status - public.
     */
    public static final int USER_GEO_STATUS_C_PUBLIC = 0;

    /**
     * User geo status - private.
     */
    public static final int USER_GEO_STATUS_C_PRIVATE = 1;

    //// Avatar type constants
    /**
     * User avatar type - Gravatar.
     *
     * @deprecated only upload allowed since 1.3.0
     */
    public static final int USER_AVATAR_TYPE_C_GRAVATAR = 0;

    /**
     * User avatar type - External Link.
     *
     * @deprecated only upload allowed since 1.3.0
     */
    public static final int USER_AVATAR_TYPE_C_EXTERNAL_LINK = 1;

    /**
     * User avatar type - Upload.
     */
    public static final int USER_AVATAR_TYPE_C_UPLOAD = 2;

    //// App role constants
    /**
     * User app role - Hacker.
     */
    public static final int USER_APP_ROLE_C_HACKER = 0;

    /**
     * User app role - Painter.
     */
    public static final int USER_APP_ROLE_C_PAINTER = 1;

    /**
     * Gets color code of the specified point.
     *
     * @param point the specified point
     * @return color code
     */
    public static String toCCString(final int point) {
        final String hex = Integer.toHexString(point);

        if (1 == hex.length()) {
            return hex + hex + hex + hex + hex + hex;
        }

        if (2 == hex.length()) {
            final String a1 = hex.substring(0, 1);
            final String a2 = hex.substring(1);

            return a1 + a1 + a1 + a2 + a2 + a2;
        }

        if (3 == hex.length()) {
            final String a1 = hex.substring(0, 1);
            final String a2 = hex.substring(1, 2);
            final String a3 = hex.substring(2);

            return a1 + a1 + a2 + a2 + a3 + a3;
        }

        if (4 == hex.length()) {
            final String a1 = hex.substring(0, 1);
            final String a2 = hex.substring(1, 2);
            final String a3 = hex.substring(2, 3);
            final String a4 = hex.substring(3);

            return a1 + a2 + a3 + a4 + a3 + a4;
        }

        if (5 == hex.length()) {
            final String a1 = hex.substring(0, 1);
            final String a2 = hex.substring(1, 2);
            final String a3 = hex.substring(2, 3);
            final String a4 = hex.substring(3, 4);
            final String a5 = hex.substring(4);

            return a1 + a2 + a3 + a4 + a5 + a5;
        }

        if (6 == hex.length()) {
            return hex;
        }

        return hex.substring(0, 6);
    }

    /**
     * Private constructor.
     */
    private UserExt() {
    }
}


text:
package types

// DataframeAnalyticsFieldSelection type.
//
// https://github.com/elastic/elasticsearch-specification/blob/4ca0cc05d3ae3fa06c2cd7be91905b656a474334/specification/ml/_types/DataframeAnalytics.ts#L55-L68
type DataframeAnalyticsFieldSelection struct {
	// FeatureType The feature type of this field for the analysis. May be categorical or
	// numerical.
	FeatureType *string `json:"feature_type,omitempty"`
	// IsIncluded Whether the field is selected to be included in the analysis.
	IsIncluded bool `json:"is_included"`
	// IsRequired Whether the field is required.
	IsRequired bool `json:"is_required"`
	// MappingTypes The mapping types of the field.
	MappingTypes []string `json:"mapping_types"`
	// Name The field name.
	Name string `json:"name"`
	// Reason The reason a field is not selected to be included in the analysis.
	Reason *string `json:"reason,omitempty"`
}

// NewDataframeAnalyticsFieldSelection returns a DataframeAnalyticsFieldSelection.
func NewDataframeAnalyticsFieldSelection() *DataframeAnalyticsFieldSelection {
	r := &DataframeAnalyticsFieldSelection{}

	return r
}


text:
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;

class Atomics {
  private volatile String str;
  private static final AtomicReferenceFieldUpdater<Atomics, String> updater =
    AtomicReferenceFieldUpdater.newUpdater(Atomics.class, String.class, "str");

  public void init(String s) {
    updater.compareAndSet(this, null, s);
  }
}


text:
    <umb-editor-view data-element="editor-data-type-picker">

        <form novalidate name="DataTypePickerForm" val-form-manager>

        <umb-editor-header
            name="model.title"
            name-locked="true"
            hide-alias="true"
            hide-icon="true"
            hide-description="true">
        </umb-editor-header>

        <umb-editor-container>
            <umb-box>
                <umb-box-content>

                            <input type="text"
                                    style="width: 100%"
                                    ng-change="vm.searchTermChanged()"
                                    ng-model="vm.searchTerm"
                                    class="umb-search-field search-query search-input input-block-level"
                                    localize="placeholder"
                                    placeholder="@placeholders_search"
                                    umb-auto-focus
                                    no-dirty-check />

                    <umb-load-indicator ng-if="vm.loading === true"></umb-load-indicator>

{{key | umbCmsTitleCase}}

                                    <button
                                        type="button"
                                        class="btn-reset umb-card-grid-item"
                                        ng-click="vm.viewOptionsForEditor(dataType)"
                                        title="{{ dataType.name }}">

                                            {{ dataType.name }}

                                    </button>

                            <localize key="contentTypeEditor_searchResultSettings">Available configurations</localize>

 0">

{{result.group | umbCmsTitleCase}}

                                        <button
                                            type="button"
                                            class="btn-reset umb-card-grid-item"
                                            ng-click="vm.pickDataType(dataType)"
                                            title="{{ dataType.name }}">

                                                {{ dataType.name }}

                                        </button>

                            <localize key="contentTypeEditor_searchResultEditors">Create a new configuration</localize>

 0">

{{result.group | umbCmsTitleCase}}

                                        <button
                                            type="button"
                                            class="btn-reset umb-card-grid-item"
                                            ng-click="vm.pickEditor(dataType)"
                                            title="{{ dataType.name }}">

                                                {{ dataType.name }}

                                        </button>

                </umb-box-content>
            </umb-box>
        </umb-editor-container>

        <umb-editor-footer>
            <umb-editor-footer-content-right>
                <umb-button
                    type="button"
                    button-style="link"
                    label-key="general_close"
                    shortcut="esc"
                    action="vm.close()">
                </umb-button>
            </umb-editor-footer-content-right>
        </umb-editor-footer>

        </form>

    </umb-editor-view>


text:
package txscript

import (
	"crypto/rand"
	"testing"

	"github.com/btcsuite/btcd/btcec"
	"github.com/btcsuite/btcd/chaincfg/chainhash"
)

// genRandomSig returns a random message, a signature of the message under the
// public key and the public key. This function is used to generate randomized
// test data.
func genRandomSig() (*chainhash.Hash, *btcec.Signature, *btcec.PublicKey, error) {
	privKey, err := btcec.NewPrivateKey(btcec.S256())
	if err != nil {
		return nil, nil, nil, err
	}

	var msgHash chainhash.Hash
	if _, err := rand.Read(msgHash[:]); err != nil {
		return nil, nil, nil, err
	}

	sig, err := privKey.Sign(msgHash[:])
	if err != nil {
		return nil, nil, nil, err
	}

	return &msgHash, sig, privKey.PubKey(), nil
}

// TestSigCacheAddExists tests the ability to add, and later check the
// existence of a signature triplet in the signature cache.
func TestSigCacheAddExists(t *testing.T) {
	sigCache := NewSigCache(200)

	// Generate a random sigCache entry triplet.
	msg1, sig1, key1, err := genRandomSig()
	if err != nil {
		t.Errorf("unable to generate random signature test data")
	}

	// Add the triplet to the signature cache.
	sigCache.Add(*msg1, sig1, key1)

	// The previously added triplet should now be found within the sigcache.
	sig1Copy, _ := btcec.ParseSignature(sig1.Serialize(), btcec.S256())
	key1Copy, _ := btcec.ParsePubKey(key1.SerializeCompressed(), btcec.S256())
	if !sigCache.Exists(*msg1, sig1Copy, key1Copy) {
		t.Errorf("previously added item not found in signature cache")
	}
}

// TestSigCacheAddEvictEntry tests the eviction case where a new signature
// triplet is added to a full signature cache which should trigger randomized
// eviction, followed by adding the new element to the cache.
func TestSigCacheAddEvictEntry(t *testing.T) {
	// Create a sigcache that can hold up to 100 entries.
	sigCacheSize := uint(100)
	sigCache := NewSigCache(sigCacheSize)

	// Fill the sigcache up with some random sig triplets.
	for i := uint(0); i < sigCacheSize; i++ {
		msg, sig, key, err := genRandomSig()
		if err != nil {
			t.Fatalf("unable to generate random signature test data")
		}

		sigCache.Add(*msg, sig, key)

		sigCopy, _ := btcec.ParseSignature(sig.Serialize(), btcec.S256())
		keyCopy, _ := btcec.ParsePubKey(key.SerializeCompressed(), btcec.S256())
		if !sigCache.Exists(*msg, sigCopy, keyCopy) {
			t.Errorf("previously added item not found in signature" +
				"cache")
		}
	}

	// The sigcache should now have sigCacheSize entries within it.
	if uint(len(sigCache.validSigs)) != sigCacheSize {
		t.Fatalf("sigcache should now have %v entries, instead it has %v",
			sigCacheSize, len(sigCache.validSigs))
	}

	// Add a new entry, this should cause eviction of a randomly chosen
	// previous entry.
	msgNew, sigNew, keyNew, err := genRandomSig()
	if err != nil {
		t.Fatalf("unable to generate random signature test data")
	}
	sigCache.Add(*msgNew, sigNew, keyNew)

	// The sigcache should still have sigCache entries.
	if uint(len(sigCache.validSigs)) != sigCacheSize {
		t.Fatalf("sigcache should now have %v entries, instead it has %v",
			sigCacheSize, len(sigCache.validSigs))
	}

	// The entry added above should be found within the sigcache.
	sigNewCopy, _ := btcec.ParseSignature(sigNew.Serialize(), btcec.S256())
	keyNewCopy, _ := btcec.ParsePubKey(keyNew.SerializeCompressed(), btcec.S256())
	if !sigCache.Exists(*msgNew, sigNewCopy, keyNewCopy) {
		t.Fatalf("previously added item not found in signature cache")
	}
}

// TestSigCacheAddMaxEntriesZeroOrNegative tests that if a sigCache is created
// with a max size <= 0, then no entries are added to the sigcache at all.
func TestSigCacheAddMaxEntriesZeroOrNegative(t *testing.T) {
	// Create a sigcache that can hold up to 0 entries.
	sigCache := NewSigCache(0)

	// Generate a random sigCache entry triplet.
	msg1, sig1, key1, err := genRandomSig()
	if err != nil {
		t.Errorf("unable to generate random signature test data")
	}

	// Add the triplet to the signature cache.
	sigCache.Add(*msg1, sig1, key1)

	// The generated triplet should not be found.
	sig1Copy, _ := btcec.ParseSignature(sig1.Serialize(), btcec.S256())
	key1Copy, _ := btcec.ParsePubKey(key1.SerializeCompressed(), btcec.S256())
	if sigCache.Exists(*msg1, sig1Copy, key1Copy) {
		t.Errorf("previously added signature found in sigcache, but" +
			"shouldn't have been")
	}

	// There shouldn't be any entries in the sigCache.
	if len(sigCache.validSigs) != 0 {
		t.Errorf("%v items found in sigcache, no items should have"+
			"been added", len(sigCache.validSigs))
	}
}


text:
<?php

namespace DreamCommerce\App\GoogleAdwordsRemarketing\Entity;

/**
 * DreamCommerce\App\GoogleAdwordsRemarketing\Entity\MetafieldValueBlob
 *
 * @Entity(repositoryClass="\DreamCommerce\App\GoogleAdwordsRemarketing\Repository\Metafield")
 * @Table(name="metafields_values_blob")
 */
class MetafieldValueBlob extends MetafieldValue
{
    /**
     * @var string $value
     *
     * @Column(name="value", type="blob", nullable=true)
     */
    protected $value;

    /* ---------------------------------------------------------------------- */

    /**
     * @param string $value
     * @param Metafield $metafield
     * @param int $type
     * @param int $externalValueId
     * @param null|int $externalObjectId
     */
    public function __construct($value, Metafield $metafield, $type, $externalValueId, $externalObjectId = null)
    {
        parent::__construct($metafield, $type, $externalValueId, $externalObjectId);
        $this->value = $value;
    }

    /* ---------------------------------------------------------------------- */

    /**
     * @return string
     */
    public function getValue()
    {
        return $this->value;
    }

    /**
     * @param string $value
     */
    public function setValue($value)
    {
        $this->value = $value;
    }

    /* ---------------------------------------------------------------------- */

    public function toArray($metafield = false) {
        parent::toArray($metafield);
        $result['value'] = $this->value;

        return $result;
    }
}


text:
package org.java8api;

public class MenuItem {
	String label;
	String url;

	public MenuItem(String label, String url) {
		this.label = label;
		this.url = url;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("{ label : '").append(label).append("' }");
		return builder.toString();
	}

}


text:
namespace binder {

namespace {

class DummyTransactionHandler : public LocalObject::TransactionHandler {
 public:
  DummyTransactionHandler() {}
  ~DummyTransactionHandler() override {}

  std::unique_ptr<TransactionData> OnTransact(
      CommandBroker* command_broker,
      const TransactionData& data) override {
    return std::unique_ptr<TransactionData>();
  }

 private:
  DISALLOW_COPY_AND_ASSIGN(DummyTransactionHandler);
};

}  // namespace

class BinderServiceManagerProxyTest : public ::testing::Test {
 public:
  BinderServiceManagerProxyTest() : command_broker_(&driver_) {}
  ~BinderServiceManagerProxyTest() override {}

  void SetUp() override { ASSERT_TRUE(driver_.Initialize()); }

 protected:
  base::MessageLoop message_loop_;
  Driver driver_;
  CommandBroker command_broker_;
};

TEST_F(BinderServiceManagerProxyTest, AddAndCheck) {
  const base::string16 kServiceName =
      base::ASCIIToUTF16("org.chromium.TestService-" + base::GenerateGUID());

  // Service not available yet.
  EXPECT_FALSE(
      ServiceManagerProxy::CheckService(&command_broker_, kServiceName));

  // Add service.
  scoped_refptr<Object> object(
      new LocalObject(base::WrapUnique(new DummyTransactionHandler())));
  EXPECT_TRUE(ServiceManagerProxy::AddService(&command_broker_, kServiceName,
                                              object, 0));

  // Service is available.
  scoped_refptr<Object> result =
      ServiceManagerProxy::CheckService(&command_broker_, kServiceName);
  ASSERT_TRUE(result);
  ASSERT_EQ(LocalObject::TYPE_LOCAL, result->GetType());
  EXPECT_EQ(object.get(), result.get());
}

}  // namespace binder


text:
//////////////////////////////////////////////////////////////////////////////////////////////////
//
// file: CSV_Reader.h
//
//	Author Sergey Solokhin (Neill3d)
//
//
//	GitHub page - https://github.com/Neill3d/MoPlugs_Framework
//	Licensed under BSD 3-Clause - https://github.com/Neill3d/MoPlugs_Framework/blob/master/LICENSE
//
///////////////////////////////////////////////////////////////////////////////////////////////////

#pragma once

//--- SDK include
#include <fbsdk/fbsdk.h>
#include <math.h>
//#include "Utils\TextUtils.h"

//////////////////////////////////////////////
//! naturalpoint tracking tools format reader
class csv_data
{
public:
	//! number of samples
	int  framecount;
	//!	while tracked time range
	double	length;
	//! number of trackable bodies
	int	 rigidbodycount;
	//! number of markers
	int  markercount;

	/////////////////////////
	//! marker information for each frame
	struct marker_data
	{
		//! frame
		int  frame;
		//! timestamp of this frame (real frame time)
		double timestamp;
		//! position in this frame
		FBVector3d	pos;
		//! is marker visible
		bool occulusion;

		//! a constructor
		marker_data() {
			frame = 0;
			timestamp = 0.0;
			occulusion = false;
		}
		//! a constructor with parameters
		/*!
			\param _frame - marker data frame
			\param _pos - setting this frame pos
		*/
		marker_data(int &_frame, double &_timestamp, FBVector3d &_pos)
			: frame(_frame)
			, timestamp(_timestamp)
			, pos(_pos)
		{ occulusion = false; }
		//! output frame info on console
		void print() {
			printf( "marker data - %f; %f; %f\n", pos[0], pos[1], pos[2] );
		}
	};

	/////////////////////////
	//! each marker struct
	struct marker
	{
		//! first active frame
		int firstframe;
		double firsttime;	// timestamp of a first frame
		int observepos;	// last time when we get a frame (check for increasing)
		//! array of data for this marker
		FBArrayTemplate<marker_data>	data;

		//! a constructor
		marker() {
			firstframe=0;
			firsttime = 0.0;
			observepos = 0;
		}
		//! a constructor with parameters
		/*!
			\param _frame - setting first marker frame
		*/
		marker(int &_frame, double &timestamp)
			: firstframe(_frame)
			, firsttime(timestamp)
		{
			observepos = 0;
		}
		//! GetFramePos
		/*!
			\param frame - frame index
			\param pos - instance to pos vector class
			\return - is marker occoluded in this frame
		*/
		bool GetFramePos(int frame, FBVector3d &pos)
		{
			for (int i=observepos; i<data.GetCount(); i++)
				if (frame == data[i].frame)
				{
					observepos = i;
					pos = data[i].pos;
					return true;
				}
			for (int i=0; i<observepos; i++)
				if (frame == data[i].frame)
				{
					observepos = i;
					pos = data[i].pos;
					return true;
				}
			observepos = 0;
			return false;
		}
		bool near1(double v1, double v2, double f)
		{
			double v = v1-v2;
			return ( (v >= 0.0) && (v < f) );
		}
		bool GetFramePos(double time, FBVector3d &pos)
		{
			for (int i=observepos; i<data.GetCount(); i++)
				if ( near1(data[i].timestamp, time, 0.1) )
				{
					observepos = i;
					pos = data[i].pos;
					//assert( time >= firsttime );
					return true;
				}
			for (int i=0; i<observepos; i++)
			{
				if ( near1(data[i].timestamp, time, 0.1) )
				{
					observepos = i;
					pos = data[i].pos;
					//assert( time >= firsttime );
					return true;
				}
			}
			observepos = 0;
			return false;
		}
	};

	struct marker_filtered : public marker {
		bool  active;
		int activeFrame;

		marker_filtered()
		{
			firstframe = 0;
			active = false;
			activeFrame = 0;
		}
		bool test(int frame, double timestamp, FBVector3d pos)
		{
			bool result = false;
			if (firstframe > frame) return result;

			for(int i=0; i<data.GetCount(); i++)
				if (frame==data[i].frame)
				{
					double dist = sqrt( (data[i].pos[0] + pos[0]) * (data[i].pos[0] + pos[0]) +
										(data[i].pos[1] + pos[1]) * (data[i].pos[1] + pos[1]) +
										(data[i].pos[2] + pos[2]) * (data[i].pos[2] + pos[2]) );
					if (dist < 1.0) {
						result = true;
	/*
						if (!active) {
							active = true;
							activeFrame = frame;

							csv_data::marker_data	framedata(frame, pos);
							data.Add(framedata);
						}
						*/
						active = true;
						activeFrame = frame;
						csv_data::marker_data	framedata(frame, timestamp, pos);
						data.Add(framedata);
					}
				}
			return result;
		}
		void insert(int frame, double timestamp, FBVector3d pos)
		{
			firstframe = frame;
			csv_data::marker_data	framedata(frame, timestamp, pos);
			data.Add(framedata);
			active=true;
			activeFrame = frame;
		}
		void insertOcculuded(int frame, double timestamp)
		{
			if (!active) {
				FBVector3d pos;
				memset( &pos[0], 0, sizeof(double)*3);
				csv_data::marker_data	framedata(frame, timestamp, pos);
				framedata.occulusion = true;
				data.Add(framedata);
			}
		}
	};

	//! markers array
	FBArrayTemplate<marker*>  markers;
	//! filtered markers array
	FBArrayTemplate<marker_filtered>	 markers_filtered;

	/////////////////////////////////
	//! rigidbody data for each frame
	struct rigidbody_data {
		//! frame index
		int frame;
		//! position
		FBVector3d	pos;
		//! orientation in quat
		FBVector4d	quat;
		//! euler angles
		FBVector3d	rot;

		//! a constructor
		rigidbody_data() {
			frame = 0;
		}
		rigidbody_data(int &_frame, FBVector3d &_pos, FBVector4d &_quat, FBVector3d &_rot)
			: frame(_frame)
			, pos(_pos)
			, quat(_quat)
			, rot(_rot)
		{}
	};
	struct rigidbody {
		char	name[80];

		int markercount;
		FBArrayTemplate<marker_data>	marker_setup;

		int firstframe;
		FBArrayTemplate<rigidbody_data>		data;
		rigidbody() {
			firstframe = 0;
			markercount = 0;
		}
		rigidbody(int &_frame, int &_markercount)
			: firstframe(_frame)
			, markercount(_markercount)
		{}
		void print_marker_setup()
		{
			if (marker_setup.GetCount() != markercount)
				printf("!! > error: marker_setup count is not equal to variable!\n" );
			for(int i=0; i<markercount; i++)
				marker_setup[i].print();
		}
	};

	//! rigid bodies
	FBArrayTemplate<rigidbody*>	rigidbodies;

	//! a constructor
	csv_data() {
		framecount = 0;
		length = 0.0;
		rigidbodycount = 0;
		markercount = 0;
	}
	//! free all reader allocated data
	void FreeData()
	{
	}

	//! a destructor
	~csv_data() {
		FreeData();
	}

	//! read information from *.csv text file
	bool Read(const char *pFileName)
	{
		return false;
	}

private:
	//! import frame data from text line
	// TODO:
	//void ImportFrameData( CEUtils::StringTokens	&tokens );
	//! filter frame data (markers numerations)
	void FilterFrameData();
	//! create new optical rigid body form text line parsing
	void CreateOpticalRigidBody( char* line );
};


text: export default function createLogger(): any;


text:
<?PHP
echo "
<HTML>
<HEAD>
</HEAD>
<BODY>
Leave this window open for audio commands to play.
<audio controls autoplay>
  <source src=\"audio-cache\\notify.wav\" type=\"audio/wav\">
Your browser does not support the audio element.
</audio>
<IFRAME SRC=\"tools\\audio-executor.php\" SEAMLESS style=\"width: 100%; height: 100%;\"></IFRAME>
</BODY>
</HTML>
";
?>


text:
\section{Wymagania stawiane różnicowemu rozwiązaniu zagadnienia początkowego}
%%%%%%%%%%%%%%%%
\begin{frame}{Wymagania}
\textbf{Stawiane wymagania:}
	\begin{itemize}
      \item zgodność
      \item dokładność
      \item stabilność
      \item efektywność
	\end{itemize}

	\begin{flushleft}
	Operator \textbf{T} - sprzęga poziomy czasowe, zależy od wyboru schematu 	całkowania i przestrzennego schematu różnicowego
	\end{flushleft}
\end{frame}
%%%%%%%%%%%%%%%%
\begin{frame}{Wymagania dotyczące operatora T}
  Operator T powinien zapewniać:
  \begin{enumerate}
    \item zgodność aproksymacji różnicowej
    \item dokładność aproksymacji różnicowej
    \item stabilność schematu różnicowego
    \item efektywność schematu różnicowego
  \end{enumerate}
\end{frame}
%%%%%%%%%%%%%%%%
\begin{frame}{Zgodność aproksymacji różnicowej}
  \begin{block}{Wymóg podstawowy}
  	w granicy - układ różnicowy indentyczny z różniczkowym
  \end{block}
\end{frame}
%%%%%%%%%%%%%%%%
\begin{frame}{Dokładność aproksymacji różnicowej}
  \begin{itemize}
    \item Błędy obcięcia\par
    - ciągła zmienna niezależna \par
		\begin{itemize}
			\item zbiór punktów (wybór schematu różnicowego)
			\item od $\Delta$, $\Delta t$
		\end{itemize}
    \item Błędy \par
    \quad - ograniczona dokładność reprezentacji \textit{(fl. - arithmetic)}
  \end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%
\begin{frame}{Stabilność schematu różnicowego}
  \begin{block}{Stabilność metody numerycznej}
    Metoda numeryczna jest stabilna, gdy mały błąd na dowolnym etapie przenosi się z minimalną amplitudą
    $$\varepsilon^{n+1} = g \cdot \varepsilon^{n}$$
    gdzie: \par
    \quad $\varepsilon$ - amplituda błędu \par
    \quad $g$ - współczynnik wzmocnienia $\sim$ (T)
  \end{block}
  Stabilność: \[\abs{g} < 1\]
  \textit{Układ równań:} $\varepsilon^{n}$, G  - macierz wzmocnienia
\end{frame}
%%%%%%%%%%%%%%%%


text:
<?php include 'includes/db.php'
// @author 'Victor Alagwu';
// @project 'Simple Content Management System';
// @date    '0ctober 2016';
;?>
<?php ob_start();?>
<!DOCTYPE html>

	<meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
	<title>Registration Page-Victor CMS</title>

	<link rel="icon" type="image/png" href="img/vimeo.png">
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
	<link rel="stylesheet" type="text/css" href="css/cms-home.css">
	<link rel="stylesheet" type="text/css" href="css/material-icons.css">
	<link href="admin/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

 		<?php
if (isset($_POST['register'])) {

	$user_name = $_POST['user_name'];
	$user_firstname = $_POST['user_firstname'];
	$user_lastname = $_POST['user_lastname'];
	$user_email = $_POST['user_email'];
	$user_password = $_POST['user_password'];

	mysqli_real_escape_string($con, $user_name);
	mysqli_real_escape_string($con, $user_lastname);
	mysqli_real_escape_string($con, $user_firstname);
	mysqli_real_escape_string($con, $user_password);

	mysqli_real_escape_string($con, $user_email);
	$u_password = password_hash($user_password, PASSWORD_DEFAULT);
	$user_image = "Image";
	$user_role = "User";
	$randsalt = "dgas";

	$user_query = "INSERT INTO users(user_name,";
	$user_query .= "user_firstname,user_lastname,user_password,";
	$user_query .= "user_email,user_image,user_role,";
	$user_query .= "randsalt)";
	$user_query .= " VALUES ('{$user_name}','{$user_firstname}','{$user_lastname}','{$u_password}','{$user_email}','{$user_image}','{$user_role}','{$randsalt}')";
	$run_query_user = mysqli_query($con, $user_query);
	if (!$run_query_user) {
		die("Error" . mysqli_error($run_query_user));
	} else {
		echo "Registered";
		header('Location:index.php');

	}

}

?>
 			<form method="POST" action="">

					Username
					<input type="text" name="user_name" class="form-control">

					FirstName
					<input type="text" name="user_firstname" class="form-control">

					LastName
					<input type="text" name="user_lastname" class="form-control">

					Email
					<input type="email" name="user_email" class="form-control">

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

<button type="submit" class="btn btn-primary" name="register">Register</button>
 			</form>


text:
package com.twitter.chill

import scala.reflect.ClassTag

class ClassTagSerializer[T] extends KSerializer[ClassTag[T]] {
  def write(kser: Kryo, out: Output, obj: ClassTag[T]): Unit =
    kser.writeObject(out, obj.runtimeClass)

  def read(kser: Kryo, in: Input, cls: Class[ClassTag[T]]): ClassTag[T] = {
    val clazz = kser.readObject(in, classOf[Class[T]])
    ClassTag(clazz)
  }
}


text:
require "./spec/test_helper.rb"

describe MarkdownFilter do
  it "should filter markdown" do
    MarkdownFilter.new.call("# Foo").must_equal (<<-eos
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<!DOCTYPE html PUBLIC
    \"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN\"
    \"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd\">

<meta http-equiv=\"Content-type\" content=\"application/xhtml+xml;charset=utf-8\" /><title>Foo</title>

Foo

eos
).chomp
  end

  it "should filter markdown partial" do
    MarkdownFilter.new.call("# Foo", :partial => true).must_equal (<<-eos

Foo

eos
)
  end
end


text:
require 'spec_helper'

describe Zipmark::Client do
  let(:app_id) { "my-app-id" }
  let(:app_secret) { "my-app-secret" }
  let(:default_adapter) { Zipmark::Adapters::HTTPClientAdapter }
  let(:client) { Zipmark::Client.new(:application_id => app_id, :application_secret => app_secret) }

  subject { client }

  before do
    Zipmark::Client.any_instance.stub(:load_resources).and_return({})
  end

  it { should respond_to(:adapter) }

  it "should have default http adapter class" do
    client.adapter.should be_a(default_adapter)
  end

  it "should send get requests to the adapter" do
    client.adapter.should_receive(:get).with("/")
    client.get("/")
  end

  describe "#display" do
    it 'it returns a DisplayProxy' do
      client.display.should be_a(DisplayProxy)
    end

    it 'sets itself to the client on the DisplayProxy' do
      proxy = client.display
      proxy.client.should eql(client)
    end
  end

  describe "#workflow" do
    it 'it returns a WorkflowProxy' do
      client.workflow.class.should eql(WorkflowProxy)
    end

    it 'sets itself to the client on the WorkflowProxy' do
      proxy = client.workflow
      proxy.client.should eql(client)
    end
  end
end


text:
using MGR.CommandLineParser.Extensibility.Converters;
using Xunit;

namespace MGR.CommandLineParser.UnitTests.Extensibility.Converters
{
    public class StringConverterTests
    {
        [Fact]
        public void TargetType()
        {
            // Arrange
            IConverter converter = new StringConverter();
            var expectedType = typeof (string);

            // Act
            var actualType = converter.TargetType;

            // Assert
            Assert.Equal(expectedType, actualType);
        }

        [Fact]
        public void Conversion()
        {
            // Arrange
            IConverter converter = new StringConverter();
            var expectedValue = "value";

            // Act
            var actualValue = converter.Convert(expectedValue, converter.TargetType);

            // Assert
            Assert.NotNull(actualValue);
            Assert.IsType<string>(actualValue);
            Assert.Equal(expectedValue, (string) actualValue);
        }
    }
}


text:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="org.deviceconnect.android.srt_player_app.MainActivity">

    <item
        android:id="@+id/action_settings"
        android:icon="@drawable/ic_settings_black_24dp"
        android:orderInCategory="100"
        android:title="@string/action_settings"
        app:showAsAction="always" />

</menu>


text:
using System;
using System.Windows.Forms;

namespace DigitalRune.Windows.TextEditor.Completion
{
  /// <summary>
  /// Provides completion data for simple texts.
  /// </summary>
  /// <remarks>
  /// This <see cref="ICompletionDataProvider"/> provides completion data for
  /// one type: Simple texts (<see cref="String"/>s). The text in the completion
  /// window is copied directly into the document.
  /// </remarks>
  public class TextCompletionDataProvider : AbstractCompletionDataProvider
  {
    private readonly string[] _texts;
    private readonly ImageList _imageList;
    private readonly int _imageIndex;

    /// <summary>
    /// Gets the image list that holds the image for completion data.
    /// </summary>
    /// <value>The image list that holds the image for completion data.</value>
    public override ImageList ImageList
    {
      get { return _imageList; }
    }

    /// <summary>
    /// Initializes a new instance of the <see cref="TextCompletionDataProvider"/> class.
    /// </summary>
    /// <param name="texts">The completion texts.</param>
    /// <param name="imageList">The image list.</param>
    /// <param name="imageIndex">Index of the image in the <paramref name="imageList"/>.</param>
    public TextCompletionDataProvider(string[] texts, ImageList imageList, int imageIndex)
    {
      if (texts == null)
        throw new ArgumentNullException("texts");

      _texts = texts;
      _imageList = imageList;
      _imageIndex = imageIndex;
    }

    /// <summary>
    /// Generates the completion data. This method is called by the text editor control.
    /// </summary>
    /// <param name="fileName">the name of the file.</param>
    /// <param name="textArea">The text area.</param>
    /// <param name="charTyped">The character typed.</param>
    /// <returns>The completion data.</returns>
    public override ICompletionData[] GenerateCompletionData(string fileName, TextArea textArea, char charTyped)
    {
      ICompletionData[] completionData = new ICompletionData[_texts.Length];
      for (int i = 0; i < completionData.Length; i++)
        completionData[i] = new DefaultCompletionData(_texts[i], null, _imageIndex);
      return completionData;
    }
  }
}


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

namespace TwaijaComposite.Modules.Common.DataInterfaces
{
    public class MentionEntity
    {
        string ScreenName { get; set; }
        decimal Id { get; set; }
        public MentionEntity(string name, decimal id)
        {
            ScreenName = name;
            Id = id;
        }
    }
}


text:
<?php

namespace csabike2\alert\tests\data;

/**
 * Class Session
 *
 * @package csabike2\alert\tests\data
 */
class Session extends \yii\web\Session
{
    /**
     * @inheritdoc
     */
    public function init()
    {
        // blank, override, preventing shutdown function registration
    }

    public function open()
    {
        // blank, override, preventing session start
    }
}


text:
<!DOCTYPE html>

  <meta charset="utf-8">

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>Overview: module code — BartPy 0.0.1 documentation</title>

    <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />

             BartPy

                0.0.1

  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>

Contents:

Node

Split

Tree

Model

Samplers

          BartPy

Docs »

Overview: module code

All modules for which code is available

bartpy.mutation

bartpy.node

bartpy.samplers.leafnode

bartpy.samplers.proposer

bartpy.samplers.schedule

bartpy.samplers.sigma

bartpy.samplers.treemutation.proposer

bartpy.sklearnmodel

bartpy.split

bartpy.tree

        © Copyright 2018, Jake Coltman.

  Built with Sphinx using a theme provided by Read the Docs.


text:
package org.jkiss.dbeaver.model.impl;

import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.model.meta.PropertyLength;
import org.jkiss.dbeaver.model.preferences.DBPPropertyDescriptor;

/**
 * ProxyPropertyDescriptor
*/
public class ProxyPropertyDescriptor implements DBPPropertyDescriptor
{

    protected final DBPPropertyDescriptor original;

    public ProxyPropertyDescriptor(DBPPropertyDescriptor original)
    {
        this.original = original;
    }

    @NotNull
    @Override
    public String getId()
    {
        return this.original.getId();
    }

    @Override
    public String getCategory()
    {
        return this.original.getCategory();
    }

    @Override
    public String getDescription()
    {
        return this.original.getDescription();
    }

    @Override
    public Class<?> getDataType() {
        return original.getDataType();
    }

    @Override
    public boolean isRequired() {
        return original.isRequired();
    }

    @Override
    public Object getDefaultValue() {
        return original.getDefaultValue();
    }

    @Override
    public boolean isEditable(Object object) {
        return original.isEditable(object);
    }

    @NotNull
    @Override
    public PropertyLength getLength() {
        return original.getLength();
    }

    @Nullable
    @Override
    public String[] getFeatures() {
        return original.getFeatures();
    }

    @Override
    public boolean hasFeature(@NotNull String feature) {
        return original.hasFeature(feature);
    }

    @NotNull
    @Override
    public String getDisplayName()
    {
        return this.original.getDisplayName();
    }

}


text:
// Implementation of a Trie with insert, search, startsWith, wordsStartingWith, and delete

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

public class Trie {

  public static TrieNode root;

  public Trie() {
    root = new TrieNode();
  }

  // Inserts a word into the trie.
  // Complexity: O(n) runtime and O(1) space, where n is length of the input word,
  public static void insert(String word) {
    TrieNode current = root;
    int n = word.length();
    for (int i = 0; i < n; i++) {
      char c = word.charAt(i);
      if (!current.children.containsKey(c)) {
        current.children.put(c, new TrieNode());
      }
      current = current.children.get(c);
    }
    current.isEnd = true;
  }

  /* search: returns true if the input word is in the trie, and false otherwise.
    Complexity: O(n) runtime and O(1) space, where n is length of input word. */
  public static boolean search(String word) {
    TrieNode node = searchPrefix(word);
    return node != null && node.isEnd;
  }

  /* startsWith: Returns true if there is any word in the trie that starts with the given prefix, false otherwise
    Complexity: O(n) runtime and O(1) space, where n is length of input prefix. */
  public static boolean startsWith(String prefix) {
    TrieNode node = searchPrefix(prefix);
    return node != null;
  }

  // wordsStartingWith: returns a list of all words that starts with input prefix
  public static List<String> wordsStartingWith(String prefix) {
    List<String> result = new ArrayList<>();
    TrieNode node = searchPrefix(prefix);
    wordsStartingWithHelper(prefix, result, node);
    return result;
  }

  private static void wordsStartingWithHelper(String prefix, List<String> result, TrieNode node) {
    if (node == null) {
      return;
    }
    if (node.isEnd) {
      result.add(prefix);
      return;
    }

    for (char c : node.children.keySet()) {
      TrieNode newNode = node.children.get(c);
      wordsStartingWithHelper(prefix + c, result, newNode);
    }
  }

  // searchPrefix: Searches a prefix or a whole key in trie and returns the node where the search ends
  // Complexity: O(n) runtime and O(1) space, where n is  the length of input prefix
  private static TrieNode searchPrefix(String prefix) {
    TrieNode current = root;
    int n = prefix.length();
    for (int i = 0; i < n; i++) {
      char c = prefix.charAt(i);
      if (!current.children.containsKey(c)) {
        return null;
      }
      current = current.children.get(c);
    }
    return current;
  }

  private static class TrieNode {
    Map<Character, TrieNode> children;
    boolean isEnd;

    public TrieNode() {
      children = new HashMap<>();
      isEnd = false;
    }
  }

  public static void main(String[] args) {
    Trie trie = new Trie();
    System.out.println("Inserting \"abc\" in trie");
    trie.insert("abc");
    System.out.println("Inserting \"abd\" in trie");
    trie.insert("abd");
    System.out.println("Inserting \"cdef\" in trie");
    trie.insert("cdef");

    System.out.println("wordsStartingWith(\"ab\") = " + wordsStartingWith("ab"));
  }
}


text:
<TITLE>Review for Return to Me (2000)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Return to Me (2000)

reviewed by
Susan Granger

http://www.speakers-podium.com/susangranger.

Susan Granger's review of "RETURN TO ME" (MGM release)

 Tinged with traces of "Love Story," "Ghost" and "Moonstruck,"
this romantic comedy has its moments - but, unfortunately, most of
them turn out to be sappy. David Duchovny doffs his "X-Files" Fox
Mulder persona to play a successful Chicago architectural engineer
whose wife (Joely Richardson), an ardent zoologist who works with
primates, dies in an automobile accident in one of the early scenes of
the picture. While he's still blood-stained and grief-stricken, his
wife's heart is transplanted into Minnie Driver, who's a shy, naive
waitress working in her family's Irish-Italian restaurant. Despite the
bizarre circumstances, you know that these two are eventually gonna
meet and fall in love. Predictability and foreshadowing weigh heavily
on the script written by Bonnie Hunt and Don Lake. Perhaps a more
experienced director could have quickened the pace, trimmed some
scenes, and meshed the elements better - but inexperienced Bonnie Hunt
helms her own material. In addition, she co-stars, as Driver's
confidante and wife of Jim Belushi, and she's cast at least four
relatives named Hunt in supporting parts. It's like a congenial family
movie under a big studio banner. Despite its lack of focus, it is
amusing to watch it unfold, particularly when senior pros like Robert
Loggia and Carroll O'Connor are bantering about old singers, old
songs, etc., since the title song comes from a vintage Dean Martin
ballad. David Duchovny and Minnie Driver are charming to watch; one
just wishes they had wittier, more sophisticated material to work
with. On the Granger Movie Gauge of 1 to 10, "Return to Me" is a sweet
but stumbling 5. Ah, the fickle finger of fate!

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
<button (click)="addProductToFavourite(product)" *ngIf="!isFavourite"></button>
<button (click)="removeProductToFavourite(product)" *ngIf="isFavourite"></button>


text:
package com.google.cloud.tools.gradle.appengine;

import java.io.BufferedReader;
import java.io.StringReader;
import java.util.List;
import java.util.stream.Collectors;
import org.gradle.testkit.runner.BuildResult;

/** ToolsExtension to filter gradle test kit runner results. */
public class BuildResultFilter {

  /** Extract task as a list of path strings. */
  public static List<String> extractTasks(BuildResult buildResult) {

    // we can't use buildResult.getTasks() because it ignores skipped tasks
    return new BufferedReader(new StringReader(buildResult.getOutput()))
        .lines()
        .filter(str -> str.startsWith(":"))
        .map(str -> str.split(" ")[0])
        .collect(Collectors.toList());
  }
}


text:
(function($) {

    var defaults = {
    	duration: 3000,
    	colors: ["#ff0000", "#00ff00", "#0000ff"]
    };

    $.fn.colorShuffle = function(settings) {
        var $this = $(this)

        var opts = $.extend({}, defaults, settings);

		var colors = opts.colors.slice();
		var color = colors.shift();
		$this.css("background", color);
		$this = fadeBox($this, colors, opts.duration);

		colors.unshift(color);
		loopFade($this, colors, opts.duration);

        return $this;
    };

	function shuffle(array) {
	    var i = array.length,
	    	array = array.slice();
	    while (i) {
	        var j = Math.floor(Math.random() * i);
	        var t = array[--i];
	        array[i] = array[j];
	        array[j] = t;
	    }
	    return array;
	}

	function changeColor($el, color, duration, callback) {
		return $el.animate({
			backgroundColor: color
		}, duration, callback);
	}

	function fadeBox($el, colors, duration, callback) {
		// console.log("fadeBox", colors);
		var len = colors.length;
		$.each(colors, function(i, color){
			$el = changeColor($el, color, duration, i === (len-1) ? callback : undefined);
		});
		return $el;
	}

	function loopFade($el, colors, duration) {
		colors = shuffle(colors);
		fadeBox($el, colors, duration, function(){
			loopFade($el, colors, duration);
		});
	}

})(jQuery);


text:
package com.example.cities.client;

import com.example.cities.client.model.PagedCities;
import feign.RequestLine;
import org.springframework.stereotype.Repository;

import javax.inject.Named;

@Repository
public interface CityRepository {
    @RequestLine("GET /cities?page={page}&size={size}")
    public PagedCities findAll(@Named("page") Integer page, @Named("size") Integer size);

    @RequestLine("GET /cities/search/nameContains?q={name}&page={page}&size={size}")
    public PagedCities findByNameContains(@Named("name") String name, @Named("page") Integer page, @Named("size") Integer size);
}


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

namespace NServiceKit.Razor.Compilation
{
    /// Interface for razor code transformer.
    public interface IRazorCodeTransformer
    {
        /// Initializes this object.
        ///
        /// <param name="razorHost"> The razor host.</param>
        /// <param name="directives">The directives.</param>
        void Initialize(IRazorHost razorHost, IDictionary<string, string> directives);

        /// Process the generated code.
        ///
        /// <param name="codeCompileUnit">   The code compile unit.</param>
        /// <param name="generatedNamespace">The generated namespace.</param>
        /// <param name="generatedClass">    The generated class.</param>
        /// <param name="executeMethod">     The execute method.</param>
        void ProcessGeneratedCode(CodeCompileUnit codeCompileUnit, CodeNamespace generatedNamespace, CodeTypeDeclaration generatedClass, CodeMemberMethod executeMethod);

        /// Process the output described by codeContent.
        ///
        /// <param name="codeContent">The code content.</param>
        ///
        /// <returns>A string.</returns>
        string ProcessOutput(string codeContent);
    }
}


text:
import { RouterModule } from '@angular/router';
import { HomeComponent } from './home.component';

const HomeRoute = RouterModule.forChild([
    {
        path     : 'home',
        component: HomeComponent
    }
]);

export { HomeRoute };


text:
<!DOCTYPE HTML>

        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>SlickGrid Scrolling Benchmark</title>
        <link rel="stylesheet" href="../css/smoothness/jquery-ui.custom.css" type="text/css" media="screen" charset="utf-8" />
        <link rel="stylesheet" href="../slick.grid.css" type="text/css" media="screen" charset="utf-8" />
        <link rel="stylesheet" href="../slick-editors.css" type="text/css" media="screen" charset="utf-8" />
        <link rel="stylesheet" href="../examples/examples.css" type="text/css" media="screen" charset="utf-8" />

        <button id="grid_debug">Debug info </button>
        <button id="startBench_100">Run (+= 100px) </button>
        <button id="startBench_300">Run (+= 300px) </button>
        <button id="startBench_550">Run (+= 550px; simulate paging) </button>
        <button id="startBench_1000">Run (+= 1'000px) </button>
        <button id="startBench_5000">Run (+= 5'000px) </button>


text:
package net.sf.jasperreports.engine.base;

import net.sf.jasperreports.engine.JRLineBox;
import net.sf.jasperreports.engine.JRConstants;
import net.sf.jasperreports.engine.JRPen;

/**
 * @author Teodor Danciu (teodord@users.sourceforge.net)
 * @version $Id: JRBaseBoxBottomPen.java 7199 2014-08-27 13:58:10Z teodord $
 */
public class JRBaseBoxBottomPen extends JRBaseBoxPen
{
	/**
	 *
	 */
	private static final long serialVersionUID = JRConstants.SERIAL_VERSION_UID;

	/**
	 *
	 */
	public JRBaseBoxBottomPen(JRLineBox box)
	{
		super(box);
	}

	/**
	 *
	 */
	public JRPen getPen(JRLineBox box)
	{
		return box.getBottomPen();
	}
}


text:
<?php

/**
 * PHP class file.
 * @auhtor trashtoy
 * @since  2.0.0
 */
namespace Peach\Markup;
use Peach\Util\Strings;

/**
 * 与えられたノードを HTML や XML などの文字列に変換するクラスです.
 */
class DefaultContext extends Context
{
    /**
     * マークアップ時の改行やインデント処理を担当します.
     * @var Indent
     */
    private $indent;

    /**
     * タグの出力方式 (空要素や boolean 属性などの扱い) を制御します.
     * @var Renderer
     */
    private $renderer;

    /**
     * 開始タグの直後に改行するかどうかの判定を行います.
     * @var BreakControl
     */
    private $breakControl;

    /**
     * TRUE の場合はノードの前後にインデントと改行を付加します.
     * @var bool
     */
    private $isIndentMode;

    /**
     * TRUE の場合はコメントの内部を処理している状態とみなします.
     * コメントの内部にあるコメントは無視するようになります.
     * @var bool
     */
    private $isCommentMode;

    /**
     * handle() メソッド実行時の処理結果が格納されます.
     * @var string
     */
    private $result;

    /**
     * 指定された Renderer, Indent, BreakControl オブジェクトを使って
     * マークアップを行う DefaultContext オブジェクトを構築します.
     *
     * @param Renderer     $renderer
     * @param Indent       $indent
     * @param BreakControl $breakControl
     */
    public function __construct(Renderer $renderer, Indent $indent = null, BreakControl $breakControl = null)
    {
        if (!isset($indent)) {
            $indent = new Indent();
        }
        if (!isset($breakControl)) {
            $breakControl = DefaultBreakControl::getInstance();
        }
        $this->renderer      = $renderer;
        $this->indent        = $indent;
        $this->breakControl  = $breakControl;
        $this->isIndentMode  = true;
        $this->isCommentMode = false;
        $this->result        = "";
    }

    /**
     * コメントノードを読み込みます.
     * @param Comment $comment
     */
    public function handleComment(Comment $comment)
    {
        if ($this->isCommentMode) {
            $this->formatChildNodes($comment);
            return;
        }

        $this->isCommentMode = true;
        $prefix = $this->escapeEndComment($comment->getPrefix());
        $suffix = $this->escapeEndComment($comment->getSuffix());
        $this->result .= $this->indent() . "<!--{$prefix}";
        if ($this->isIndentMode) {
            if ($this->checkBreakModeInComment($comment)) {
                $breakCode = $this->breakCode();
                $this->result .= $breakCode;
                $this->formatChildNodes($comment);
                $this->result .= $breakCode;
                $this->result .= $this->indent();
            } else {
                $this->isIndentMode = false;
                $this->formatChildNodes($comment);
                $this->isIndentMode = true;
            }
        } else {
            $this->formatChildNodes($comment);
        }
        $this->result .= "{$suffix}-->";
        $this->isCommentMode = false;
    }

    /**
     * コメントノードを 1 行 ("<--foobar-->") で記述するか改行するかの判定を行います.
     *
     * @param  Comment $comment
     * @return bool
     */
    private function checkBreakModeInComment(Comment $comment)
    {
        $nodes = $comment->getChildNodes();
        switch (count($nodes)) {
            case 0:
                return false;
            case 1:
                $node = $nodes[0];
                if ($node instanceof Comment) {
                    return $this->checkBreakModeInComment($node);
                }

                return ($node instanceof Element);
            default:
                return true;
        }
    }

    /**
     * Text ノードを読み込みます.
     * @param Text $text
     */
    public function handleText(Text $text) {
        $this->result .= $this->indent() . $this->escape($text->getText());
    }

    /**
     * Code を読み込みます.
     * @param Code $code
     */
    public function handleCode(Code $code)
    {
        $text   = $code->getText();
        if (!strlen($text)) {
            return;
        }

        $lines  = Strings::getLines($text);
        $indent = $this->indent();
        $this->result .= $indent;
        $this->result .= implode($this->breakCode() . $indent, $lines);
    }

    /**
     * EmptyElement を読み込みます.
     * @param EmptyElement $element
     * @see Context::handleEmptyElement()
     */
    public function handleEmptyElement(EmptyElement $element) {
        $this->result .= $this->indent() . $this->renderer->formatEmptyTag($element);
    }

    /**
     * ContainerElement を読み込みます.
     * @param ContainerElement $element
     * @see Context::handleContainerElement()
     */
    public function handleContainerElement(ContainerElement $element)
    {
        $this->result .= $this->indent() . $this->renderer->formatStartTag($element);
        if ($this->isIndentMode) {
            if ($this->breakControl->breaks($element)) {
                $this->result .= $this->indent->stepUp();
                $this->result .= $this->formatChildNodes($element);
                $this->result .= $this->breakCode();
                $this->result .= $this->indent->stepDown();
            } else {
                $this->isIndentMode = false;
                $this->formatChildNodes($element);
                $this->isIndentMode = true;
            }
        } else {
           $this->formatChildNodes($element);
        }
        $this->result .= $this->renderer->formatEndTag($element);
    }

    /**
     * NodeList を変換します.
     * @param NodeList $node
     */
    public function handleNodeList(NodeList $node)
    {
        $this->formatChildNodes($node);
    }

    /**
     * マークアップされたコードを返します.
     * @return string
     */
    public function getResult()
    {
        return $this->result;
    }

    /**
     * 指定されたコンテナの子ノードを書式化します.
     * 各子ノードの出力結果の末尾には, 改行コードで連結されます. (インデントモードが ON の場合)
     * 末尾の子ノードの出力結果の後ろに改行コードは付きません.
     *
     * @param Container $container
     */
    private function formatChildNodes(Container $container)
    {
        $nextBreak  = "";
        $breakCode  = $this->breakCode();
        $childNodes = $container->getChildNodes();
        foreach ($childNodes as $child) {
            $this->result .= $nextBreak;
            $this->handle($child);
            $nextBreak = $breakCode;
        }
    }

    /**
     * None を処理します. 何もせずに終了します.
     *
     * @param None $none
     */
    public function handleNone(None $none)
    {
    }

    /**
     * インデントモードが ON の場合は空白文字, OFF の場合は空文字列を返します.
     * @return string
     */
    private function indent()
    {
        return $this->isIndentMode ? $this->indent->indent() : "";
    }

    /**
     * インデントモードが ON の場合は改行コード, OFF の場合は空文字列を返します.
     * @return string
     */
    private function breakCode()
    {
        return $this->isIndentMode ? $this->indent->breakCode() : "";
    }

    /**
     * 予期しないインデントを回避するため, 改行コードを文字参照に置き換えます.
     * @param  string $text
     * @return string
     */
    private function escape($text)
    {
        return preg_replace("/\\r\\n|\\r|\\n/", "
", htmlspecialchars($text));
    }

    /**
     * 意図しないタイミングでコメントノードが終了するのを防ぐため, "-->" を文字参照に置き換えます.
     * @param  string $text
     * @return string
     */
    private function escapeEndComment($text)
    {
        return str_replace("-->", "-->", $text);
    }
}


text:
<?php

namespace backend\controllers;

use Yii;
use common\models\TblClassroom;
use common\models\SearchTblClassroom;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;

/**
 * TblClassroomController implements the CRUD actions for TblClassroom model.
 */
class TblClassroomController extends Controller
{
    public function behaviors()
    {
        return [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['post'],
                ],
            ],
        ];
    }

    /**
     * Lists all TblClassroom models.
     * @return mixed
     */
    public function actionIndex()
    {
        $searchModel = new SearchTblClassroom();
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }

    /**
     * Displays a single TblClassroom model.
     * @param integer $id
     * @return mixed
     */
    public function actionView($id)
    {
        return $this->render('view', [
            'model' => $this->findModel($id),
        ]);
    }

    /**
     * Creates a new TblClassroom model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
    public function actionCreate()
    {
        $model = new TblClassroom();

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
             $model->user_id=Yii ::$app->user->id;
            $model->start_date = date ('Y-m-d h:m:s');
            $model->end_date = date ('Y-m-d h:m:s');
            $model->update_date = date('Y-m-d h:m:s');
            $model->setup_time= date('Y-m-d h:m:s');
            $model->pickuptime =date ('Y-m-d h:m:s');
            $model->schedule_start_time = date ('Y-m-d h:m:s');
            $model->schedule_end_time = date ('Y-m-d h:m:s');
            $model->status = 3;

            $model->save();
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('create', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Updates an existing TblClassroom model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     */
    public function actionUpdate($id)
    {
        $model = $this->findModel($id);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            return $this->render('update', [
                'model' => $model,
            ]);
        }
    }

    /**
     * Deletes an existing TblClassroom model.
     * If deletion is successful, the browser will be redirected to the 'index' page.
     * @param integer $id
     * @return mixed
     */
    public function actionDelete($id)
    {
        $this->findModel($id)->delete();

        return $this->redirect(['index']);
    }

    /**
     * Finds the TblClassroom model based on its primary key value.
     * If the model is not found, a 404 HTTP exception will be thrown.
     * @param integer $id
     * @return TblClassroom the loaded model
     * @throws NotFoundHttpException if the model cannot be found
     */
    protected function findModel($id)
    {
        if (($model = TblClassroom::findOne($id)) !== null) {
            return $model;
        } else {
            throw new NotFoundHttpException('The requested page does not exist.');
        }
    }
}


text:
// dvt

/* 4. Напишете програма, която
 * чете от конзолата две цели числа (integer)
 * и отпечатва, колко числа има между тях,
 * такива, че остатъкът им от деленето на 5 да е 0. */

package java1;

import java.util.Scanner;

public class MyJava {

	public static void main(String[] args) {
		Scanner read = new Scanner(System.in);

		int lowEnd, highEnd, i, numbers = 0;

		System.out.print("Low end: "); lowEnd = read.nextInt();
		System.out.print("High end: "); highEnd = read.nextInt();
		if (lowEnd > highEnd) return;

		for (i = lowEnd; i <= highEnd; ++i){
			if (i % 5 == 0) numbers += 1;
		}

		System.out.println(numbers + " numbers can be divided by 5.");

	}

}


text:
package com.github.zawadz88.animation.showcase;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.LayoutTransition;
import android.animation.ObjectAnimator;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.view.ViewCompat;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * #####
 * #####
 * See: https://developer.android.com/guide/topics/graphics/prop-animation.html#layout
 * #####
 * #####
 */
public class CustomLayoutAnimationsActivity extends AbstractActivity {

    private int numButtons = 1;

    @BindView(R.id.buttonContainer)
    ViewGroup gridContainer;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_custom_layout_animations);

        LayoutTransition layoutTransition = new LayoutTransition();

        ObjectAnimator appearingAnim = ObjectAnimator.ofFloat(null, "rotationY", 0f, 90f, 180f, 270f, 359.9999f);
        appearingAnim.addListener(new AnimatorListenerAdapter() {
            public void onAnimationEnd(Animator anim) {
                View view = (View) ((ObjectAnimator) anim).getTarget();
                view.setRotationY(0f);
            }
        });

        layoutTransition.setAnimator(LayoutTransition.APPEARING, appearingAnim);
        layoutTransition.setDuration(LayoutTransition.APPEARING, 2000L);
        layoutTransition.setStartDelay(LayoutTransition.APPEARING, 0);

        gridContainer.setLayoutTransition(layoutTransition);
    }

    @OnClick(R.id.addNewButton)
    public void addButton() {
        Button newButton = new Button(this);
        ViewCompat.setElevation(newButton, 0);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
            newButton.setStateListAnimator(null);
        }
        newButton.setText(String.valueOf(numButtons++));
        newButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                gridContainer.removeView(v);
            }
        });
        gridContainer.addView(newButton, Math.min(1, gridContainer.getChildCount()));
    }

}


text:
using System;
using System.Diagnostics;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
using Newtonsoft.Json;
using Redmine.Net.Api.Internals;
using Redmine.Net.Api.Serialization;

namespace Redmine.Net.Api.Types
{
    /// <summary>
    ///
    /// </summary>
    [DebuggerDisplay("{" + nameof(DebuggerDisplay) + ",nq}")]
    [XmlRoot(RedmineKeys.DETAIL)]
    public sealed class Detail : IXmlSerializable, IJsonSerializable, IEquatable<Detail>
    {
        /// <summary>
        ///
        /// </summary>
        public Detail() { }

        internal Detail(string name = null, string property = null, string oldValue = null, string newValue = null)
        {
            Name = name;
            Property = property;
            OldValue = oldValue;
            NewValue = newValue;
        }

        #region Properties
        /// <summary>
        /// Gets the property.
        /// </summary>
        /// <value>
        /// The property.
        /// </value>
        public string Property { get; internal set; }

        /// <summary>
        /// Gets the name.
        /// </summary>
        /// <value>
        /// The name.
        /// </value>
        public string Name { get; internal set; }

        /// <summary>
        /// Gets the old value.
        /// </summary>
        /// <value>
        /// The old value.
        /// </value>
        public string OldValue { get; internal set; }

        /// <summary>
        /// Gets the new value.
        /// </summary>
        /// <value>
        /// The new value.
        /// </value>
        public string NewValue { get; internal set; }
        #endregion

        #region Implementation of IXmlSerialization
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public XmlSchema GetSchema() { return null; }

        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        public void ReadXml(XmlReader reader)
        {
            Name = reader.GetAttribute(RedmineKeys.NAME);
            Property = reader.GetAttribute(RedmineKeys.PROPERTY);

            reader.Read();

            while (!reader.EOF)
            {
                if (reader.IsEmptyElement && !reader.HasAttributes)
                {
                    reader.Read();
                    continue;
                }

                switch (reader.Name)
                {
                    case RedmineKeys.NEW_VALUE: NewValue = reader.ReadElementContentAsString(); break;

                    case RedmineKeys.OLD_VALUE: OldValue = reader.ReadElementContentAsString(); break;

                    default: reader.Read(); break;
                }
            }
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="writer"></param>
        public void WriteXml(XmlWriter writer) { }
        #endregion

        #region Implementation of IJsonSerialization
        /// <summary>
        ///
        /// </summary>
        /// <param name="writer"></param>
        public void WriteJson(JsonWriter writer) { }

        /// <summary>
        ///
        /// </summary>
        /// <param name="reader"></param>
        public void ReadJson(JsonReader reader)
        {
            while (reader.Read())
            {
                if (reader.TokenType == JsonToken.EndObject)
                {
                    return;
                }

                if (reader.TokenType != JsonToken.PropertyName)
                {
                    continue;
                }

                switch (reader.Value)
                {
                    case RedmineKeys.NAME: Name = reader.ReadAsString(); break;

                    case RedmineKeys.PROPERTY: Property = reader.ReadAsString(); break;

                    case RedmineKeys.NEW_VALUE: NewValue = reader.ReadAsString(); break;

                    case RedmineKeys.OLD_VALUE: OldValue = reader.ReadAsString(); break;

                    default: reader.Read(); break;
                }
            }
        }
        #endregion

        #region Implementation of IEquatable<Detail>
        /// <summary>
        ///
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        public bool Equals(Detail other)
        {
            if (other == null) return false;
            return string.Equals(Property, other.Property, StringComparison.InvariantCultureIgnoreCase)
                && string.Equals(Name, other.Name, StringComparison.InvariantCultureIgnoreCase)
                && string.Equals(OldValue, other.OldValue, StringComparison.InvariantCultureIgnoreCase)
                && string.Equals(NewValue, other.NewValue, StringComparison.InvariantCultureIgnoreCase);
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != GetType()) return false;
            return Equals(obj as Detail);
        }

        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = 13;
                hashCode = HashCodeHelper.GetHashCode(Property, hashCode);
                hashCode = HashCodeHelper.GetHashCode(Name, hashCode);
                hashCode = HashCodeHelper.GetHashCode(OldValue, hashCode);
                hashCode = HashCodeHelper.GetHashCode(NewValue, hashCode);

                return hashCode;
            }
        }
        #endregion

        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        private string DebuggerDisplay => $"[{nameof(Detail)}: Property={Property}, Name={Name}, OldValue={OldValue}, NewValue={NewValue}]";

    }
}


text:
from django.contrib.sites.shortcuts import get_current_site

from ..default.views import ResendActivationView as BaseResendActivationView
from ..default.views import ActivationView as BaseActivationView
from ..default.views import RegistrationView as BaseRegistrationView

from ... import signals
from ...models import SupervisedRegistrationProfile
from ...views import ApprovalView as BaseApprovalView

class RegistrationView(BaseRegistrationView):

    """
    Follows the exact logic of
    ``registration.backends.default.views.RegistrationView`` but uses
    ``SupervisedRegistrationProfile`` instead of ``RegistrationProfile``

    """

    registration_profile = SupervisedRegistrationProfile

class ActivationView(BaseActivationView):

    """
    Follows the exact logic of
    ``registration.backends.default.views.ActivationView`` but uses
    ``SupervisedRegistrationProfile`` instead of ``RegistrationProfile``

    """

    registration_profile = SupervisedRegistrationProfile

class ResendActivationView(BaseResendActivationView):

    """
    Follows the exact logic of
    ``registration.backends.default.views.ResendActivationView`` but uses
    ``SupervisedRegistrationProfile`` instead of ``RegistrationProfile``

    """

    registration_profile = SupervisedRegistrationProfile

class ApprovalView(BaseApprovalView):
    def approve(self, *args, **kwargs):
        """
        Given a user id, look up and approve the user account
        corresponding to that key (if possible).

        After successful approval, the signal
        ``registration.signals.user_approved`` will be sent, with the
        newly approved ``User`` as the keyword argument ``user`` and
        the class of this backend as the sender.

        """
        user_id = kwargs.get('profile_id', '')
        approved_user = (
            SupervisedRegistrationProfile.objects.admin_approve_user(
                user_id, get_current_site(self.request)))
        if approved_user:
            signals.user_approved.send(
                sender=self.__class__,
                user=approved_user,
                request=self.request
            )
        return approved_user

    def get_success_url(self, user):
        return ('registration_approve_complete', (), {})


text:
class CreateSubscribes < ActiveRecord::Migration
  def change
    create_table :spree_subscribes do |t|
      t.integer :user_id
      t.integer :variant_id

      t.timestamps
    end
  end
end


text:
import { Schema, arrayOf } from 'normalizr'

import { ContentTypes, ContentTypesPlural } from '../constants'

const schemasManager = { __flush__, getAll, createSchema, init }

export default schemasManager

/** Schema object cache, populated in `makeSchemas`. */
let schemas

/** Individual schema definitions, defined like this so we can reference one from another. */
let categorySchema, mediaSchema, pageSchema, postSchema, revisionSchema, tagSchema, userSchema,
  commentSchema, postTypeSchema, postStatusSchema, taxonomySchema

/** Invalidate the schema object cache. */
function __flush__ () {
  schemas = null
}

/** Get the schema object cache. */
function getAll () {
  return schemas
}

/** Create a custom schema definition (for custom content types). */
function createSchema (name, idAttribute) {
  if (!schemas) {
    throw new Error('createSchema called before schema cache populated, call makeSchemas first.')
  } else if (typeof name !== 'string') {
    throw new Error(`Expecting name to be a string, got "${typeof name}".`)
  } else if (typeof idAttribute !== 'string') {
    throw new Error(`Expecting idAttribute to be a string, got "${typeof idAttribute}".`)
  }

  const contentTypeSchema = new Schema(name, { idAttribute })

  contentTypeSchema.define({
    author: userSchema,
    post: postSchema,
    featuredMedia: mediaSchema
  })

  return contentTypeSchema
}

/** Populate the cache of schemas for built-in content types. */
function init (idAttribute) {
  if (typeof idAttribute !== 'string') {
    throw new Error(`Expecting idAttribute to be a string, got "${typeof idAttribute}".`)
  }

  if (schemas) return schemas

  // Content types with `id` properties
  categorySchema = new Schema(ContentTypesPlural[ContentTypes.Category], { idAttribute })
  commentSchema = new Schema(ContentTypesPlural[ContentTypes.Comment], { idAttribute })
  mediaSchema = new Schema(ContentTypesPlural[ContentTypes.Media], { idAttribute })
  pageSchema = new Schema(ContentTypesPlural[ContentTypes.Page], { idAttribute })
  postSchema = new Schema(ContentTypesPlural[ContentTypes.Post], { idAttribute })
  revisionSchema = new Schema(ContentTypesPlural[ContentTypes.PostRevision], { idAttribute })
  tagSchema = new Schema(ContentTypesPlural[ContentTypes.Tag], { idAttribute })
  userSchema = new Schema(ContentTypesPlural[ContentTypes.User], { idAttribute })

  // Content types without `id` properties
  postTypeSchema = new Schema(ContentTypesPlural[ContentTypes.PostType], { idAttribute: 'slug' })
  postStatusSchema = new Schema(ContentTypesPlural[ContentTypes.PostStatus], { idAttribute: 'slug' })
  taxonomySchema = new Schema(ContentTypesPlural[ContentTypes.Taxonomy], { idAttribute: 'slug' })

  mediaSchema.define({
    author: userSchema,
    post: postSchema
  })

  pageSchema.define({
    author: userSchema,
    featuredMedia: mediaSchema
  })

  postSchema.define({
    author: userSchema,
    featuredMedia: mediaSchema,
    categories: arrayOf(categorySchema),
    tags: arrayOf(tagSchema)
  })

  schemas = {
    [ContentTypes.Category]: categorySchema,
    [ContentTypes.Comment]: commentSchema,
    [ContentTypes.Media]: mediaSchema,
    [ContentTypes.Page]: pageSchema,
    [ContentTypes.Post]: postSchema,
    [ContentTypes.PostStatus]: postStatusSchema,
    [ContentTypes.PostType]: postTypeSchema,
    [ContentTypes.PostRevision]: revisionSchema,
    [ContentTypes.Tag]: tagSchema,
    [ContentTypes.Taxonomy]: taxonomySchema,
    [ContentTypes.User]: userSchema
  }

  return schemas
}


text:
package com.microsoft.z3;

/**
 * FloatingPoint Expressions
 */
public class FPExpr extends Expr
{
    /**
     * The number of exponent bits.
     * @throws Z3Exception
     */
    public int getEBits() { return ((FPSort)getSort()).getEBits(); }

    /**
     * The number of significand bits.
     * @throws Z3Exception
     */
    public int getSBits() { return ((FPSort)getSort()).getSBits(); }

    public FPExpr(Context ctx, long obj)
    {
        super(ctx, obj);
    }

}


text:
import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';

import RoundCard from 'common/RoundCard';
import Button from 'common/button/Button';
import Heading from 'common/base/Heading';
import P from 'common/base/P';
import { subscriptionType } from 'constants/subscription';

import styles from './PlanCard.module.css';
import { getActionTitle } from './helpers';

const getButtonType = type => {
  if (type === subscriptionType.submitData) {
    return 'yellow';
  }
  return 'hollowRed';
};

const PlanCard = ({ title, description, amount, actionUrl, type }) => {
  const actionTitle = getActionTitle(type);
  return (
    <RoundCard>

        <Heading Tag="h3" size="sm" className={styles.title} bold>
          {title}
        </Heading>

{description}

            {amount}

            元

        <Link to={actionUrl}>
          <Button
            className={styles.actionButton}
            btnStyle={getButtonType(type)}
          >
            {actionTitle}
          </Button>
        </Link>

    </RoundCard>
  );
};

PlanCard.propTypes = {
  title: PropTypes.string,
  description: PropTypes.string,
  type: PropTypes.string,
  actionUrl: PropTypes.string,
  amount: PropTypes.number,
};

PlanCard.defaultProps = {
  title: '',
  description: '',
  actionUrl: '',
  amount: 0,
};

export default PlanCard;


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="abc_action_bar_home_description">Navigasi ke beranda</string>
    <string name="abc_action_bar_home_description_format">%1$s, %2$s</string>
    <string name="abc_action_bar_home_subtitle_description_format">%1$s, %2$s, %3$s</string>
    <string name="abc_action_bar_up_description">Navigasi naik</string>
    <string name="abc_action_menu_overflow_description">Opsi lain</string>
    <string name="abc_action_mode_done">Selesai</string>
    <string name="abc_activity_chooser_view_see_all">Lihat semua</string>
    <string name="abc_activitychooserview_choose_application">Pilih aplikasi</string>
    <string name="abc_capital_off">NONAKTIF</string>
    <string name="abc_capital_on">AKTIF</string>
    <string name="abc_search_hint">Telusuri...</string>
    <string name="abc_searchview_description_clear">Hapus kueri</string>
    <string name="abc_searchview_description_query">Kueri penelusuran</string>
    <string name="abc_searchview_description_search">Telusuri</string>
    <string name="abc_searchview_description_submit">Kirim kueri</string>
    <string name="abc_searchview_description_voice">Penelusuran suara</string>
    <string name="abc_shareactionprovider_share_with">Bagikan dengan</string>
    <string name="abc_shareactionprovider_share_with_application">Bagikan dengan %s</string>
    <string name="abc_toolbar_collapse_description">Ciutkan</string>
    <string name="status_bar_notification_info_overflow">999+</string>
</resources>


text:
using System.Globalization;
using System.Web;
using System.Web.Mvc;

namespace Signatory.Framework
{
    // http://www.dotnetguy.co.uk/post/2010/03/07/aspnet-mvc-working-smart-with-cookies-custom-valueprovider/
    public class CookieValueProvider : IValueProvider
    {
        public CookieValueProvider(HttpCookieCollection cookies)
        {
            Cookies = cookies;
        }

        public HttpCookieCollection Cookies { get; set; }

        public bool ContainsPrefix(string prefix)
        {
            return Cookies[prefix] != null;
        }

        public ValueProviderResult GetValue(string key)
        {
            HttpCookie cookie = Cookies[key];
            return cookie != null ? new ValueProviderResult(cookie.Value, cookie.Value, CultureInfo.CurrentUICulture) : null;
        }
    }
}


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

    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Warlpiri UD</title>
    <link rel="root" href=""/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="../css/jquery-ui-redmond.css"/>
    <link rel="stylesheet" type="text/css" href="../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../css/style-vis.css"/>
    <link rel="stylesheet" type="text/css" href="../css/hint.css"/>

          home

          edit page
          issue tracker

          <gcse:search></gcse:search>

        This page pertains to UD version 2.

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

UD for Warlpiri

Tokenization and Word Segmentation

In general, words are delimited by whitespace characters. Description of exceptions follows.

According to typographical rules, many punctuation marks are attached to a neighboring word. We always tokenize them as separate tokens (words).

Morphology

Tags

The small data sample that is currently available in UD contains only a subset of the universal POS categories.
It does not necessarily mean that the other categories do not exist in the language.

The only auxiliary verb is ka. It indicates the tense and sometimes it has a suffix that cross-references a core argument's person and number.

Finite verbs are morphologically distinguished from infinitives.

Nominal Features

Nominal categories (NOUN, PROPN, PRON) inflect for Number. Besides singular (Sing) and plural (Plur),
there is also dual (Dual) and paucal (Pauc).

Case has 3 syntactic and a number of possible semantic values.
The syntactic cases are ergative (Erg), dative (Dat), and absolutive (Abs).
Nine semantic cases are currently attested in the treebank:
locative (Loc), allative (All), elative (Ela), perlative (Per), comitative (Com),
instrumental (Ins), causative (Cau), considerative (Cns), genitive/possessive (Gen).

Verbal Features

Tense has three values: Past, Pres, Fut. It can be marked on the main verb or on the auxiliary ka.

Pronouns, Determiners, Quantifiers

Person is a lexical feature of personal pronouns (PRON) and has three values, 1, 2 and 3.
Person is not marked on other types of pronouns and on nouns, although they can be almost always interpreted as the 3rd person.

As a cross-reference to subject, person is also marked on finite verbs (VERB, AUX).

Verbs can also cross-reference arguments other than the subject.
In order to distinguish features of different cross-referenced arguments, layered features
have been introduced:
Person[obj] and Number[obj] are features of the absolutive object.
Person[dat] and Person[sdat] refer to a dative argument.

Other Features

Besides the layered features listed above, there is one other language-specific feature:

Clitic

Core Arguments, Oblique Arguments and Adjuncts

Nominal subject (nsubj) is a noun phrase in the ergative case (for two-argument predicates)
or in the absolutive (for intransitive predicates).

The object of a transitive (two-argument) predicate is in the absolutive case.

Relations Overview

The following relation subtypes are used in Warlpiri:

nmod:poss for genitive/possessive modifiers of nominals

obl:tmod for nominals acting as temporal adjuncts in clauses

There is one Warlpiri UD treebank:

Warlpiri-UFAL

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


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class org.apache.taverna.workflowmodel.processor.activity.DisabledActivity (Apache Taverna Engine and Platform 3.1.0-incubating API)</title>
<meta name="date" content="2016-06-30">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
org.apache.taverna.workflowmodel.processor.activity.DisabledActivity

Packages that use DisabledActivity

Package
Description

org.apache.taverna.workflowmodel.health

A package that contains a set of classes to be used in testing a Dataflow prior to invocation.

These can carry our various tests such as a service endpoint being accessible.

org.apache.taverna.workflowmodel.utils

Uses of DisabledActivity in org.apache.taverna.workflowmodel.health

Methods in org.apache.taverna.workflowmodel.health with parameters of type DisabledActivity

Modifier and Type
Method and Description

VisitReport
DisabledActivityHealthChecker.visit(DisabledActivity o,
     List<Object> ancestry)

The result of the visit is simply a VisitReport to state that the service
 is not available.

Uses of DisabledActivity in org.apache.taverna.workflowmodel.utils

Methods in org.apache.taverna.workflowmodel.utils with parameters of type DisabledActivity

Modifier and Type
Method and Description

static Edit<?>
Tools.getEnableDisabledActivityEdit(Processor processor,
                             DisabledActivity disabledActivity,
                             Edits edits)

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2015–2016 The Apache Software Foundation. All rights reserved.