text:
<!--
  ~ Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
  ~
  ~ WSO2 Inc. licenses this file to you under the Apache License,
  ~ Version 2.0 (the "License"); you may not use this file except
  ~ in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~ http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing,
  ~ software distributed under the License is distributed on an
  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  ~ KIND, either express or implied. See the License for the
  ~ specific language governing permissions and limitations
  ~ under the License.
  -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.wso2.carbon.ei</groupId>
    <artifactId>org.wso2.carbon.ei.migration</artifactId>
    <packaging>bundle</packaging>
    <version>1.0.0</version>
    <name>org.wso2.carbon.ei.migration</name>
    <url>http://maven.apache.org</url>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.logging</artifactId>
            <version>${carbon.kernel.version}</version>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.utils</artifactId>
            <version>${carbon.kernel.version}</version>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.logging</groupId>
            <artifactId>pax-logging-api</artifactId>
            <version>${pax.logging.api.version}</version>
        </dependency>
        <dependency>
            <groupId>org.json.wso2</groupId>
            <artifactId>json</artifactId>
            <version>${json.version}</version>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.core</artifactId>
            <version>${carbon.kernel.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.scr.annotations</artifactId>
            <version>${felix.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.mediation</groupId>
            <artifactId>org.wso2.carbon.event.sink</artifactId>
            <version>${carbon.mediation.version}</version>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.mediation</groupId>
            <artifactId>org.wso2.carbon.event.sink.config</artifactId>
            <version>${carbon.mediation.version}</version>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.ndatasource.core</artifactId>
            <version>${carbon.ndatasource.version}</version>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon</groupId>
            <artifactId>org.wso2.carbon.tomcat.ext</artifactId>
            <version>${carbon.kernel.version}</version>
        </dependency>
        <dependency>
            <groupId>org.wso2.carbon.analytics-common</groupId>
            <artifactId>org.wso2.carbon.analytics.common.jmx.agent</artifactId>
            <version>${carbon.analytics.common.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>2.5.3</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                        <Bundle-Name>${project.artifactId}</Bundle-Name>
                        <Import-Package>
                            org.osgi.framework; version="${osgi.framework.imp.pkg.version.range}",
                            org.osgi.service.component; version="${osgi.service.component.imp.pkg.version.range}",
                            org.apache.commons.logging; version="${version.commons.logging}"
                        </Import-Package>
                        <DynamicImport-Package>*</DynamicImport-Package>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <!-- Before adding ANYTHING in here, please start a discussion on the dev list.
    Ideally the Axis2 build should only use Maven central (which is available
    by default) and nothing else. We had troubles with other repositories in
    the past. Therefore configuring additional repositories here should be
    considered very carefully. -->
        <repository>
            <id>wso2-nexus</id>
            <name>WSO2 internal Repository</name>
            <url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
                <checksumPolicy>ignore</checksumPolicy>
            </releases>
        </repository>
        <repository>
            <id>wso2.releases</id>
            <name>WSO2 internal Repository</name>
            <url>http://maven.wso2.org/nexus/content/repositories/releases/</url>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
                <checksumPolicy>ignore</checksumPolicy>
            </releases>
        </repository>
        <repository>
            <id>wso2.snapshots</id>
            <name>WSO2 Snapshot Repository</name>
            <url>http://maven.wso2.org/nexus/content/repositories/snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
    </repositories>

    <properties>
        <junit.version>3.8.1</junit.version>
        <carbon.mediation.version>4.6.60</carbon.mediation.version>
        <axiom.version>1.2.11-wso2v6</axiom.version>
        <axiom.impl.version>1.2.12</axiom.impl.version>
        <axiom.wso2.version>1.2.11.wso2v10</axiom.wso2.version>
        <carbon.registry.version>4.6.25</carbon.registry.version>
        <carbon.kernel.version>4.4.23</carbon.kernel.version>
        <version.commons.logging>1.1.1</version.commons.logging>
        <commons.codec.version>1.8</commons.codec.version>
        <json.version>3.0.0.wso2v1</json.version>
        <osgi.framework.imp.pkg.version.range>[1.7.0, 2.0.0)</osgi.framework.imp.pkg.version.range>
        <osgi.service.component.imp.pkg.version.range>[1.2.0, 2.0.0)</osgi.service.component.imp.pkg.version.range>
        <felix.version>1.12.0</felix.version>
        <carbon.ndatasource.version>4.4.11</carbon.ndatasource.version>
        <carbon.deployment.version>4.7.11</carbon.deployment.version>
        <carbon.analytics.common.version>5.1.52</carbon.analytics.common.version>
        <pax.logging.api.version>1.10.1</pax.logging.api.version>
    </properties>
</project>


text:
<?php

namespace App\Events\Cache;

use App\Events\Event;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;

class ClearUserPermissionCacheEvent extends Event
{
    use SerializesModels;

    /**
     * Create a new event instance.
     *
     * @return mixed
     */
    public function __construct()
    {
        //
    }

    /**
     * Get the channels the event should be broadcast on.
     *
     * @return array
     */
    public function broadcastOn()
    {
        return [];
    }
}

redpajama_set_name: RedPajamaGithub


text:
#import "TestCommon.h"
#import "FMDatabaseAdditions.h"

/**
 * For each execution of a test method, the store is recreated and a persistent root
 * is created in -init with a single commit, with the contents returned by -makeInitialItemTree.
 */
@interface TestSQLiteStore : SQLiteStoreTestCase <UKTest>
{
    COPersistentRootInfo *proot;
    ETUUID *prootUUID;
    int64_t prootChangeCount;

    ETUUID *initialBranchUUID;
    ETUUID *branchAUUID;
    ETUUID *branchBUUID;

    ETUUID *initialRevisionUUID;

    NSMutableArray *branchARevisionUUIDs;
    NSMutableArray *branchBRevisionUUIDs;
}

@end

@implementation TestSQLiteStore

static ETUUID *rootUUID;
static ETUUID *childUUID1;
static ETUUID *childUUID2;

+ (void)initialize
{
    if (self == [TestSQLiteStore class])
    {
        rootUUID = [[ETUUID alloc] init];
        childUUID1 = [[ETUUID alloc] init];
        childUUID2 = [[ETUUID alloc] init];
    }
}

// --- Example data setup
// FIXME: Factor out to ExampleStore class shared by the backing store test and this and others.
// FIXME: Test another isolated persistent root with its own backing store.
#define BRANCH_LENGTH 4
#define BRANCH_EARLY 1
#define BRANCH_LATER 2

- (ETUUID *)lateBranchA
{
    return branchARevisionUUIDs[BRANCH_LATER];
}

- (ETUUID *)lateBranchB
{
    return branchBRevisionUUIDs[BRANCH_LATER];
}

- (ETUUID *)earlyBranchA
{
    return branchARevisionUUIDs[BRANCH_EARLY];
}

- (ETUUID *)earlyBranchB
{
    return branchBRevisionUUIDs[BRANCH_EARLY];
}

/*
 * The sample store will look like this
 *
 *  Fist commit
 *
 *    x ---------[ BRANCH_LENGTH commits ]  ("branch A")
 *      \
 *       \
 *        ------------[ BRANCH_LENGTH commits ] ("branch B")
 *
 */

- (COItem *)initialRootItemForChildren: (NSArray *)children
{
    COMutableItem *rootItem = [[COMutableItem alloc] initWithUUID: rootUUID];
    [rootItem setValue: @"root" forAttribute: @"name" type: kCOTypeString];
    [rootItem setValue: children
          forAttribute: @"children"
                  type: kCOTypeCompositeReference | kCOTypeArray];
    return rootItem;
}

- (COItem *)initialChildItemForUUID: (ETUUID *)aUUID
                               name: (NSString *)name
{
    COMutableItem *child = [[COMutableItem alloc] initWithUUID: aUUID];
    [child setValue: name
       forAttribute: @"name"
               type: kCOTypeString];
    return child;
}

- (COItemGraph *)makeInitialItemTree
{
    return [COItemGraph itemGraphWithItemsRootFirst:
        @[[self initialRootItemForChildren: @[childUUID1]],
          [self initialChildItemForUUID: childUUID1 name: @"initial child"]]];
}

/**
 * Index is in [0..BRANCH_LENGTH]
 */
- (COItemGraph *)makeBranchAItemTreeAtIndex: (int)index
{
    NSString *name = [NSString stringWithFormat: @"branch A commit %d", index];
    return [COItemGraph itemGraphWithItemsRootFirst:
        @[[self initialRootItemForChildren: @[childUUID1]],
          [self initialChildItemForUUID: childUUID1 name: name]]];
}

/**
 * Index is in [0..BRANCH_LENGTH]
 */
- (COItemGraph *)makeBranchBItemTreeAtIndex: (int)index
{
    NSString *name = [NSString stringWithFormat: @"branch B commit %d", index];
    return [COItemGraph itemGraphWithItemsRootFirst:
        @[[self initialRootItemForChildren: @[childUUID2]],
          [self initialChildItemForUUID: childUUID2 name: name]]];
}

- (COItemGraph *)itemTreeWithChildNameChange: (NSString *)aName
{
    COItemGraph *it = [self makeInitialItemTree];
    COMutableItem *item = (COMutableItem *)[it itemForUUID: childUUID1];
    [item setValue: aName
      forAttribute: @"name"];
    return it;
}

- (NSDictionary *)initialMetadata
{
    return @{@"name": @"first commit"};
}

- (NSDictionary *)branchAMetadata
{
    return @{@"name": @"branch A"};
}

- (NSDictionary *)branchBMetadata
{
    return @{@"name": @"branch B"};
}

- (instancetype)init
{
    SUPERINIT;

    branchARevisionUUIDs = [[NSMutableArray alloc] init];
    branchBRevisionUUIDs = [[NSMutableArray alloc] init];

    // First commit

    COStoreTransaction *txn = [[COStoreTransaction alloc] init];
    proot = [txn createPersistentRootWithInitialItemGraph: [self makeInitialItemTree]
                                                     UUID: [ETUUID UUID]
                                               branchUUID: [ETUUID UUID]
                                         revisionMetadata: [self initialMetadata]];
    prootUUID = proot.UUID;
    initialBranchUUID = proot.currentBranchUUID;
    initialRevisionUUID = proot.currentRevisionUUID;

    branchAUUID = [ETUUID UUID];
    [txn createBranchWithUUID: branchAUUID
                 parentBranch: nil
              initialRevision: initialRevisionUUID
            forPersistentRoot: prootUUID];

    branchBUUID = [ETUUID UUID];
    [txn createBranchWithUUID: branchBUUID
                 parentBranch: nil
              initialRevision: initialRevisionUUID
            forPersistentRoot: prootUUID];

    // Branch A

    for (int i = 0; i < BRANCH_LENGTH; i++)
    {
        ETUUID *revid = [ETUUID UUID];

        [txn writeRevisionWithModifiedItems: [self makeBranchAItemTreeAtIndex: i]
                               revisionUUID: revid
                                   metadata: [self branchAMetadata]
                           parentRevisionID: (i == 0) ? initialRevisionUUID : branchARevisionUUIDs.lastObject
                      mergeParentRevisionID: nil
                         persistentRootUUID: prootUUID
                                 branchUUID: branchAUUID];

        [branchARevisionUUIDs addObject: revid];
    }

    // Branch B

    for (int i = 0; i < BRANCH_LENGTH; i++)
    {
        ETUUID *revid = [ETUUID UUID];

        [txn writeRevisionWithModifiedItems: [self makeBranchBItemTreeAtIndex: i]
                               revisionUUID: revid
                                   metadata: [self branchBMetadata]
                           parentRevisionID: (i == 0) ? initialRevisionUUID : branchBRevisionUUIDs.lastObject
                      mergeParentRevisionID: nil
                         persistentRootUUID: prootUUID
                                 branchUUID: branchBUUID];

        [branchBRevisionUUIDs addObject: revid];
    }

    [txn setCurrentRevision: branchARevisionUUIDs.lastObject
               headRevision: branchARevisionUUIDs.lastObject
                  forBranch: branchAUUID
           ofPersistentRoot: prootUUID];

    [txn setCurrentRevision: branchBRevisionUUIDs.lastObject
               headRevision: branchBRevisionUUIDs.lastObject
                  forBranch: branchBUUID
           ofPersistentRoot: prootUUID];

    [self updateChangeCountAndCommitTransaction: txn];

    return self;
}

// --- The tests themselves

- (void)updateChangeCountAndCommitTransaction: (COStoreTransaction *)txn
{
    prootChangeCount = [txn setOldTransactionID: prootChangeCount forPersistentRoot: prootUUID];
    UKTrue([store commitStoreTransaction: txn]);
}

- (void)testDeleteBranchA
{
    COBranchInfo *initialState = [[store persistentRootInfoForUUID: prootUUID] branchInfoForUUID: branchAUUID];

    UKObjectsEqual(S(branchAUUID, branchBUUID, initialBranchUUID),
                   [store persistentRootInfoForUUID: prootUUID].branchUUIDs);

    // Delete it
    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];
        [txn deleteBranch: branchAUUID ofPersistentRoot: prootUUID];
        [self updateChangeCountAndCommitTransaction: txn];
    }

    {
        COBranchInfo *branchObj = [[store persistentRootInfoForUUID: prootUUID] branchInfoForUUID: branchAUUID];
        UKTrue(branchObj.deleted);
    }

    // Ensure we can't switch to it, since it is deleted
//    COStoreTransaction *txn = [[COStoreTransaction alloc] init];
//    UKFalse([store setCurrentBranch: branchAUUID forPersistentRoot: prootUUID]);
//    [store commitStoreTransaction: txn];

    // Undelete it
    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];
        [txn undeleteBranch: branchAUUID ofPersistentRoot: prootUUID];
        [self updateChangeCountAndCommitTransaction: txn];
    }

    {
        COBranchInfo *branchObj = [[store persistentRootInfoForUUID: prootUUID] branchInfoForUUID: branchAUUID];
        UKFalse(branchObj.deleted);
        UKObjectsEqual(initialState.currentRevisionUUID, branchObj.currentRevisionUUID);
    }

    // Should have no effect
    UKTrue([store finalizeDeletionsForPersistentRoot: prootUUID error: NULL]);

    // Verify the branch is still there
    {
        COBranchInfo *branchObj = [[store persistentRootInfoForUUID: prootUUID] branchInfoForUUID: branchAUUID];
        UKObjectsEqual(initialState.currentRevisionUUID, branchObj.currentRevisionUUID);
    }

    // Really delete it
    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];
        [txn deleteBranch: branchAUUID ofPersistentRoot: prootUUID];
        [self updateChangeCountAndCommitTransaction: txn];
    }

    UKTrue([store finalizeDeletionsForPersistentRoot: prootUUID error: NULL]);
    UKNil([[store persistentRootInfoForUUID: prootUUID] branchInfoForUUID: branchAUUID]);
    UKObjectsEqual(S(branchBUUID, initialBranchUUID),
                   [store persistentRootInfoForUUID: prootUUID].branchUUIDs);
}

/**
 * Not a good idea but this is supported, at least right now
 */
- (void)testDeleteCurrentBranch
{
    COStoreTransaction *txn = [[COStoreTransaction alloc] init];
    [txn deleteBranch: initialBranchUUID ofPersistentRoot: prootUUID];
    [self updateChangeCountAndCommitTransaction: txn];

    UKTrue([store finalizeDeletionsForPersistentRoot: prootUUID error: NULL]);

    // FIXME: Failing
    //UKTrue([[[store persistentRootInfoForUUID: prootUUID] branches] isEmpty]);
}

- (void)testBranchMetadata
{
    // A plain call to -createPersistentRootWithInitialItemGraph: creates a default branch
    // with nil metadata; this is intentional.
    //
    // If you want to give the branch initial metadata you can call -setMetadata:forBranch:...
    // in a transaction with the -createPersistentRootWithInitialItemGraph: call.
    UKNil([store persistentRootInfoForUUID: prootUUID].currentBranchInfo.metadata);

    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];
        [txn setMetadata: @{@"msg": @"hello world"}
               forBranch: initialBranchUUID
        ofPersistentRoot: prootUUID];
        [self updateChangeCountAndCommitTransaction: txn];
    }

    UKObjectsEqual(D(@"hello world", @"msg"),
                   [store persistentRootInfoForUUID: prootUUID].currentBranchInfo.metadata);

    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];
        [txn setMetadata: nil
               forBranch: initialBranchUUID
        ofPersistentRoot: prootUUID];
        [self updateChangeCountAndCommitTransaction: txn];
    }
    UKNil([store persistentRootInfoForUUID: prootUUID].currentBranchInfo.metadata);
}

- (void)testPersistentRootMetadata
{
    // A plain call to -createPersistentRootWithInitialItemGraph: creates a persistent root
    // with nil metadata; this is intentional.
    UKNil([store persistentRootInfoForUUID: prootUUID].metadata);

    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];
        [txn setMetadata: @{@"msg": @"hello world"}
       forPersistentRoot: prootUUID];
        [self updateChangeCountAndCommitTransaction: txn];
    }

    UKObjectsEqual(D(@"hello world", @"msg"),
                   [store persistentRootInfoForUUID: prootUUID].metadata);

    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];
        [txn setMetadata: nil
       forPersistentRoot: prootUUID];
        [self updateChangeCountAndCommitTransaction: txn];
    }
    UKNil([store persistentRootInfoForUUID: prootUUID].metadata);
}

- (void)testSetCurrentBranch
{
    UKObjectsEqual(initialBranchUUID,
                   [store persistentRootInfoForUUID: prootUUID].currentBranchUUID);

    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];
        [txn setCurrentBranch: branchAUUID
            forPersistentRoot: prootUUID];
        [self updateChangeCountAndCommitTransaction: txn];
    }

    UKObjectsEqual(branchAUUID, [store persistentRootInfoForUUID: prootUUID].currentBranchUUID);

    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];
        [txn setCurrentBranch: branchBUUID
            forPersistentRoot: prootUUID];
        [self updateChangeCountAndCommitTransaction: txn];
    }

    UKObjectsEqual(branchBUUID, [store persistentRootInfoForUUID: prootUUID].currentBranchUUID);
}

- (void)testSetCurrentVersion
{
    [self checkBranch: branchAUUID
              current: branchARevisionUUIDs.lastObject
                 head: branchARevisionUUIDs.lastObject];

    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];
        [txn setCurrentRevision: [self lateBranchA]
                   headRevision: branchARevisionUUIDs.lastObject
                      forBranch: branchAUUID
               ofPersistentRoot: prootUUID];
        [self updateChangeCountAndCommitTransaction: txn];
    }

    [self checkBranch: branchAUUID
              current: [self lateBranchA]
                 head: branchARevisionUUIDs.lastObject];
    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];
        [txn setCurrentRevision: [self lateBranchA]
                   headRevision: [self lateBranchA]
                      forBranch: branchAUUID
               ofPersistentRoot: prootUUID];
        [self updateChangeCountAndCommitTransaction: txn];
    }

    [self checkBranch: branchAUUID
              current: [self lateBranchA]
                 head: [self lateBranchA]];

    // FIXME: Set initial revision and test it
}

- (void)testSetCurrentVersionChangeCount
{
    COBranchInfo *branchA = [[store persistentRootInfoForUUID: prootUUID] branchInfoForUUID: branchAUUID];

    [self checkBranch: branchAUUID
              current: branchARevisionUUIDs.lastObject
                 head: branchARevisionUUIDs.lastObject];

    // Open another store and change the current revision

    {
        COSQLiteStore *store2 = [[COSQLiteStore alloc] initWithURL: store.URL];

        COStoreTransaction *txn = [[COStoreTransaction alloc] init];
        [txn setCurrentRevision: [self lateBranchA]
                   headRevision: branchA.headRevisionUUID
                      forBranch: branchAUUID
               ofPersistentRoot: prootUUID];

        (void)[txn setOldTransactionID: prootChangeCount forPersistentRoot: prootUUID];
        UKTrue([store2 commitStoreTransaction: txn]);
    }

    // Try to change the revision again, pretending we didn't notice the
    // store2 change

    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];
        [txn setCurrentRevision: [self earlyBranchA]
                   headRevision: branchA.headRevisionUUID
                      forBranch: branchAUUID
               ofPersistentRoot: prootUUID];
        (void)[txn setOldTransactionID: prootChangeCount forPersistentRoot: prootUUID];
        UKFalse([store commitStoreTransaction: txn]);
    }

    // Reload our in-memory state, and the call should succeed

    proot = [store persistentRootInfoForUUID: prootUUID];
    prootChangeCount = proot.transactionID;

    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];
        [txn setCurrentRevision: [self earlyBranchA]
                   headRevision: branchA.headRevisionUUID
                      forBranch: branchAUUID
               ofPersistentRoot: prootUUID];
        [self updateChangeCountAndCommitTransaction: txn];
    }
}

- (void)testCrossPersistentRootReference
{

}

- (void)testAttachmentsBasic
{
    NSString *fakeAttachment1 = @"this is a large attachment";
    NSString *fakeAttachment2 = @"this is another large attachment";
    NSString *path1 = [[SQLiteStoreTestCase temporaryPathForTestStorage] stringByAppendingPathComponent: @"coreobject-test1.txt"];
    NSString *path2 = [[SQLiteStoreTestCase temporaryPathForTestStorage] stringByAppendingPathComponent: @"coreobject-test2.txt"];

    [fakeAttachment1 writeToFile: path1
                      atomically: YES
                        encoding: NSUTF8StringEncoding
                           error: NULL];

    [fakeAttachment2 writeToFile: path2
                      atomically: YES
                        encoding: NSUTF8StringEncoding
                           error: NULL];

    COAttachmentID *hash1 = [store importAttachmentFromURL: [NSURL fileURLWithPath: path1]];
    COAttachmentID *hash2 = [store importAttachmentFromURL: [NSURL fileURLWithPath: path2]];

    UKObjectsEqual(fakeAttachment1,
                   [NSString stringWithContentsOfURL: [store URLForAttachmentID: hash1]
                                            encoding: NSUTF8StringEncoding
                                               error: NULL]);

    UKObjectsEqual(fakeAttachment2,
                   [NSString stringWithContentsOfURL: [store URLForAttachmentID: hash2]
                                            encoding: NSUTF8StringEncoding
                                               error: NULL]);

    UKTrue([[NSFileManager defaultManager] fileExistsAtPath: [store URLForAttachmentID: hash1].path]);
    UKTrue([[NSFileManager defaultManager] fileExistsAtPath: [store URLForAttachmentID: hash2].path]);
}

- (void)testAttachmentFromData
{
    NSString *fakeAttachment = @"this is a large attachment";
    COAttachmentID *hash = [store importAttachmentFromData: [fakeAttachment dataUsingEncoding: NSUTF8StringEncoding]];

    UKObjectsEqual(fakeAttachment,
                   [NSString stringWithContentsOfURL: [store URLForAttachmentID: hash]
                                            encoding: NSUTF8StringEncoding
                                               error: NULL]);
    UKTrue([[NSFileManager defaultManager] fileExistsAtPath: [store URLForAttachmentID: hash].path]);
}

- (void)testAttachmentsGCDoesNotCollectReferenced
{
    NSString *fakeAttachment = @"this is a large attachment";
    NSString *path = [[SQLiteStoreTestCase temporaryPathForTestStorage] stringByAppendingPathComponent: @"cotest.txt"];

    UKTrue([fakeAttachment writeToFile: path
                            atomically: YES
                              encoding: NSUTF8StringEncoding
                                 error: NULL]);

    COAttachmentID *hash = [store importAttachmentFromURL: [NSURL fileURLWithPath: path]];
    UKNotNil(hash);

    NSString *internalPath = [store URLForAttachmentID: hash].path;

    UKObjectsNotEqual(path, internalPath);

    NSLog(@"external path: %@", path);
    NSLog(@"internal path: %@", internalPath);

    UKObjectsEqual(fakeAttachment,
                   [NSString stringWithContentsOfURL: [store URLForAttachmentID: hash]
                                            encoding: NSUTF8StringEncoding
                                               error: NULL]);

    // Test attachment GC

    COItemGraph *tree = [self makeInitialItemTree];
    [[tree itemForUUID: childUUID1] setValue: hash
                                forAttribute: @"attachment"
                                        type: kCOTypeAttachment];

    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];
        ETUUID *withAttachment = [ETUUID UUID];

        [txn writeRevisionWithModifiedItems: tree
                               revisionUUID: withAttachment
                                   metadata: nil
                           parentRevisionID: initialRevisionUUID
                      mergeParentRevisionID: nil
                         persistentRootUUID: prootUUID
                                 branchUUID: branchAUUID];

        [txn setCurrentRevision: withAttachment
                   headRevision: withAttachment
                      forBranch: initialBranchUUID
               ofPersistentRoot: prootUUID];

        [self updateChangeCountAndCommitTransaction: txn];
    }

    UKTrue([store finalizeDeletionsForPersistentRoot: prootUUID error: NULL]);

    UKObjectsEqual(fakeAttachment,
                   [NSString stringWithContentsOfURL: [store URLForAttachmentID: hash]
                                            encoding: NSUTF8StringEncoding
                                               error: NULL]);
}

- (void)testAttachmentsGCCollectsUnReferenced
{
    NSString *fakeAttachment = @"this is a large attachment";
    NSString *path = [[SQLiteStoreTestCase temporaryPathForTestStorage] stringByAppendingPathComponent: @"cotest.txt"];
    [fakeAttachment writeToFile: path
                     atomically: YES
                       encoding: NSUTF8StringEncoding
                          error: NULL];
    COAttachmentID *hash = [store importAttachmentFromURL: [NSURL fileURLWithPath: path]];

    UKObjectsEqual(fakeAttachment,
                   [NSString stringWithContentsOfURL: [store URLForAttachmentID: hash]
                                            encoding: NSUTF8StringEncoding
                                               error: NULL]);

    UKTrue([[NSFileManager defaultManager] fileExistsAtPath: [store URLForAttachmentID: hash].path]);
    UKTrue([store finalizeDeletionsForPersistentRoot: prootUUID error: NULL]);
    UKFalse([[NSFileManager defaultManager] fileExistsAtPath: [store URLForAttachmentID: hash].path]);
}

/**
 * See the conceptual model of the store in the COSQLiteStore comment. Revisions are not
 * first class citizes; we garbage-collect them when they are not referenced.
 */
- (void)testRevisionGCDoesNotCollectReferenced
{
    COItemGraph *tree = [self makeInitialItemTree];
    ETUUID *referencedRevision = [ETUUID UUID];
    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];

        [txn writeRevisionWithModifiedItems: tree
                               revisionUUID: referencedRevision
                                   metadata: nil
                           parentRevisionID: initialRevisionUUID
                      mergeParentRevisionID: nil
                         persistentRootUUID: prootUUID
                                 branchUUID: branchAUUID];

        [txn setCurrentRevision: referencedRevision
                   headRevision: referencedRevision
                      forBranch: initialBranchUUID
               ofPersistentRoot: prootUUID];

        [self updateChangeCountAndCommitTransaction: txn];
    }

    UKTrue([store finalizeDeletionsForPersistentRoot: prootUUID error: NULL]);

    UKObjectsEqual(tree,
                   [store itemGraphForRevisionUUID: referencedRevision persistentRoot: prootUUID]);
}

- (void)testRevisionGCCollectsUnReferenced
{
    COItemGraph *tree = [self makeInitialItemTree];

    ETUUID *unreferencedRevision = [ETUUID UUID];

    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];
        [txn writeRevisionWithModifiedItems: tree
                               revisionUUID: unreferencedRevision
                                   metadata: nil
                           parentRevisionID: initialRevisionUUID
                      mergeParentRevisionID: nil
                         persistentRootUUID: prootUUID
                                 branchUUID: branchAUUID];
        [self updateChangeCountAndCommitTransaction: txn];
    }

    UKObjectsEqual(tree,
                   [store itemGraphForRevisionUUID: unreferencedRevision
                                    persistentRoot: prootUUID]);

    UKTrue([store finalizeDeletionsForPersistentRoot: prootUUID error: NULL]);

    UKNil([store itemGraphForRevisionUUID: unreferencedRevision persistentRoot: prootUUID]);
    UKNil([store revisionInfoForRevisionUUID: unreferencedRevision persistentRootUUID: prootUUID]);

    // TODO: Expand, test using -setInitial...
}

- (void)testRevisionInfo
{
    CORevisionInfo *info = [store revisionInfoForRevisionUUID: initialRevisionUUID
                                           persistentRootUUID: prootUUID];
    UKNil(info.parentRevisionUUID);
    UKObjectsEqual(initialRevisionUUID, info.revisionUUID);
    UKObjectsEqual(proot.currentBranchUUID, info.branchUUID);
}

- (void)checkHasTables: (BOOL)flag forUUID: (ETUUID *)aUUID
{
#if BACKING_STORES_SHARE_SAME_SQLITE_DB == 1
    [store testingRunBlockInStoreQueue:
        ^()
        {
            const BOOL hasCommitsTable = [store.database tableExists: [NSString stringWithFormat: @"commits-%@", aUUID]];
            const BOOL hasMetadataTable = [store.database tableExists: [NSString stringWithFormat: @"metadata-%@", aUUID]];

            if (flag)
            {
                UKTrue(hasCommitsTable);
                UKTrue(hasMetadataTable);
            }
            else
            {
                UKFalse(hasCommitsTable);
                UKFalse(hasMetadataTable);
            }
        }];
#endif
}

- (void)testDeletePersistentRoot
{
    UKObjectsEqual(@[], store.deletedPersistentRootUUIDs);
    UKObjectsEqual(A(prootUUID), store.persistentRootUUIDs);
    UKFalse([store persistentRootInfoForUUID: prootUUID].deleted);

    [self checkHasTables: YES forUUID: prootUUID];

    // Delete it
    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];
        [txn deletePersistentRoot: prootUUID];
        [self updateChangeCountAndCommitTransaction: txn];
    }

    UKTrue([store persistentRootInfoForUUID: prootUUID].deleted);
    UKObjectsEqual(A(prootUUID), store.deletedPersistentRootUUIDs);
    UKObjectsEqual(@[], store.persistentRootUUIDs);
    UKNotNil([store persistentRootInfoForUUID: prootUUID]);
    UKFalse([store persistentRootInfoForUUID: prootUUID].currentBranchInfo.deleted); // Deleting proot does not mark branch as deleted.

    // Undelete it
    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];
        [txn undeletePersistentRoot: prootUUID];
        [self updateChangeCountAndCommitTransaction: txn];
    }

    UKFalse([store persistentRootInfoForUUID: prootUUID].deleted);
    UKObjectsEqual(@[], store.deletedPersistentRootUUIDs);
    UKObjectsEqual(A(prootUUID), store.persistentRootUUIDs);

    // Delete it, and finalize the deletion
    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];
        [txn deletePersistentRoot: prootUUID];
        [self updateChangeCountAndCommitTransaction: txn];

        UKTrue([store finalizeDeletionsForPersistentRoot: prootUUID error: NULL]);
    }

    UKObjectsEqual(@[], store.persistentRootUUIDs);
    UKObjectsEqual(@[], store.deletedPersistentRootUUIDs);
    UKNil([store persistentRootInfoForUUID: prootUUID]);
    UKNil([store revisionInfoForRevisionUUID: initialRevisionUUID persistentRootUUID: prootUUID]);
    UKNil([store itemGraphForRevisionUUID: initialRevisionUUID persistentRoot: prootUUID]);

    [self checkHasTables: NO forUUID: prootUUID];
}

// FIXME: Uncomment this test and verify that things work/do not work on deleted persistent root, as appropriate

//- (void) testAllOperationsFailOnDeletedPersistentRoot
//{
//    // Used later in test
//    COUUID *branch = [store createBranchWithInitialRevision: [[proot currentBranchState] currentState]
//                                                 setCurrent: NO
//                                          forPersistentRoot: prootUUID];
//
//    UKTrue([store deletePersistentRoot: prootUUID]);
//    // Persistent root returned since we have not called finalizeDeletions.
//    UKObjectsEqual(A(prootUUID), store.persistentRootUUIDs);
//
//    // Persistent root returned since we have not called finalizeDeletions.
//    UKNotNil([store persistentRootWithUUID: prootUUID]);
//
//    // All write operations on prootUUID should return NO.
//
//    UKFalse([store setCurrentBranch: branch forPersistentRoot: prootUUID]);
//    UKFalse([store setCurrentVersion: [[proot currentBranchState] currentState] forBranch: branch ofPersistentRoot: prootUUID updateHead: NO]);
//    UKFalse([store setInitialRevision: [[proot currentBranchState] currentState] forBranch: branch ofPersistentRoot:prootUUID]);
//    UKFalse([store deleteBranch: branch ofPersistentRoot: prootUUID]);
//    UKFalse([store undeleteBranch: branch ofPersistentRoot: prootUUID]);
//}

- (void)testPersistentRootBasic
{
    UKObjectsEqual(S(prootUUID), [NSSet setWithArray: store.persistentRootUUIDs]);

    [self checkPersistentRoot: prootUUID
                      current: initialRevisionUUID
                         head: initialRevisionUUID];

    UKObjectsEqual([self makeInitialItemTree], [self currentItemGraphForPersistentRoot: prootUUID]);
    UKFalse([store persistentRootInfoForUUID: prootUUID].deleted);
}

/**
 * Tests creating a persistent root, proot, making a copy of it, and then making a commit
 * to proot and a commit to the copy.
 */
- (void)testPersistentRootCopies
{
    int64_t copyChangeCount = 0;
    COPersistentRootInfo *copy = nil;

    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];
        copy = [txn createPersistentRootCopyWithUUID: [ETUUID UUID]
                            parentPersistentRootUUID: prootUUID
                                          branchUUID: [ETUUID UUID]
                                    parentBranchUUID: nil
                                 initialRevisionUUID: initialRevisionUUID];
        copyChangeCount = [txn setOldTransactionID: copyChangeCount forPersistentRoot: copy.UUID];
        UKTrue([store commitStoreTransaction: txn]);
    }

    UKObjectsEqual(S(prootUUID, copy.UUID), [NSSet setWithArray: store.persistentRootUUIDs]);

    // 1. check setup

    // Verify that the new branch metadata is nil
    UKNil(copy.currentBranchInfo.metadata);

    // Verify that new UUIDs were generated
    UKObjectsNotEqual(prootUUID, copy.UUID);
    UKObjectsNotEqual(proot.branchUUIDs, copy.branchUUIDs);
    UKIntsEqual(1, copy.branchUUIDs.count);

    // Check that the current branch is set correctly
    UKObjectsEqual([copy.branchUUIDs anyObject], copy.currentBranchUUID);

    // Check that the branch data is the same

    [self checkPersistentRoot: prootUUID
                      current: initialRevisionUUID
                         head: initialRevisionUUID];

    [self checkPersistentRoot: copy.UUID
                      current: initialRevisionUUID
                         head: initialRevisionUUID];

    // Make sure the persistent root state returned from createPersistentRoot matches what the store
    // gives us when we read it back.

    UKObjectsEqual(copy.branchUUIDs, [store persistentRootInfoForUUID: copy.UUID].branchUUIDs);
    UKObjectsEqual(copy.currentBranchInfo.currentRevisionUUID,
                   [store persistentRootInfoForUUID: copy.UUID].currentBranchInfo.currentRevisionUUID);

    // 2. try changing. Verify that proot and copy are totally independent

    ETUUID *rev1 = [self earlyBranchA];

    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];
        [txn setCurrentRevision: rev1
                   headRevision: rev1
                      forBranch: proot.currentBranchInfo.UUID
               ofPersistentRoot: prootUUID];
        [self updateChangeCountAndCommitTransaction: txn];
    }

    [self checkPersistentRoot: prootUUID
                      current: rev1
                         head: rev1];

    [self checkPersistentRoot: copy.UUID
                      current: initialRevisionUUID
                         head: initialRevisionUUID];

    // Commit to copy as well.

    ETUUID *rev2 = [self lateBranchA];

    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];
        [txn setCurrentRevision: rev2
                   headRevision: rev2
                      forBranch: copy.currentBranchInfo.UUID
               ofPersistentRoot: copy.UUID];
        copyChangeCount = [txn setOldTransactionID: copyChangeCount forPersistentRoot: copy.UUID];
        UKTrue([store commitStoreTransaction: txn]);
    }

    [self checkPersistentRoot: prootUUID
                      current: rev1
                         head: rev1];

    [self checkPersistentRoot: copy.UUID
                      current: rev2
                         head: rev2];
}

- (void)testStoreUUID
{
    ETUUID *uuid = store.UUID;
    UKNotNil(uuid);

    COSQLiteStore *store2 = [[COSQLiteStore alloc] initWithURL: store.URL];
    UKObjectsEqual(uuid, store2.UUID);

}

// The following are some tests ported from CoreObject's TestStore.m

- (void)testPersistentRootInsertion
{
    ETUUID *cheapCopyUUID = [ETUUID UUID];
    ETUUID *cheapCopyBranchUUID = [ETUUID UUID];

    COStoreTransaction *txn = [[COStoreTransaction alloc] init];
    COPersistentRootInfo *cheapCopy = [txn createPersistentRootCopyWithUUID: cheapCopyUUID
                                                   parentPersistentRootUUID: prootUUID
                                                                 branchUUID: cheapCopyBranchUUID
                                                           parentBranchUUID: nil
                                                        initialRevisionUUID: branchARevisionUUIDs.lastObject];
    UKTrue([store commitStoreTransaction: txn]);

    UKObjectsEqual(rootUUID, [store rootObjectUUIDForPersistentRoot: proot.UUID]);
    UKObjectsEqual(rootUUID, [store rootObjectUUIDForPersistentRoot: cheapCopy.UUID]);
    UKObjectsEqual(initialBranchUUID,
                   [store persistentRootInfoForUUID: prootUUID].currentBranchUUID);
    UKObjectsEqual(cheapCopyBranchUUID,
                   [store persistentRootInfoForUUID: cheapCopyUUID].currentBranchUUID);
}

- (void)testReopenStore
{
    COSQLiteStore *store2 = [[COSQLiteStore alloc] initWithURL: store.URL];

    ETUUID *currentRevisionUUID = [store2 persistentRootInfoForUUID: prootUUID].currentRevisionUUID;
    ETUUID *branchARevisionUUID = [[store2 persistentRootInfoForUUID: prootUUID]
        branchInfoForUUID: branchAUUID].currentRevisionUUID;
    ETUUID *branchBRevisionUUID = [[store2 persistentRootInfoForUUID: prootUUID]
        branchInfoForUUID: branchBUUID].currentRevisionUUID;

    UKObjectsEqual([self makeInitialItemTree],
                   [store2 itemGraphForRevisionUUID: currentRevisionUUID
                                     persistentRoot: prootUUID]);
    UKTrue(COItemGraphEqualToItemGraph([self makeBranchAItemTreeAtIndex: BRANCH_LENGTH - 1],
                                       [store2 itemGraphForRevisionUUID: branchARevisionUUID
                                                         persistentRoot: prootUUID]));
    UKTrue(COItemGraphEqualToItemGraph([self makeBranchBItemTreeAtIndex: BRANCH_LENGTH - 1],
                                       [store2 itemGraphForRevisionUUID: branchBRevisionUUID
                                                         persistentRoot: prootUUID]));
}

- (void)testEmptyCommitWithNoChanges
{
    COItemGraph *graph = [[COItemGraph alloc] initWithItemForUUID: @{}
                                                     rootItemUUID: rootUUID];
    UKNotNil(graph);

    COStoreTransaction *txn = [[COStoreTransaction alloc] init];
    ETUUID *revid = [ETUUID UUID];

    [txn writeRevisionWithModifiedItems: graph
                           revisionUUID: revid
                               metadata: nil
                       parentRevisionID: initialRevisionUUID
                  mergeParentRevisionID: nil
                     persistentRootUUID: prootUUID
                             branchUUID: branchAUUID];
    [self updateChangeCountAndCommitTransaction: txn];

    // This could be useful for committing markers/tags. The very first
    // ObjectMerging prototype used this approach for marking points when the
    // user pressed cmd+S

    UKObjectsEqual([self makeInitialItemTree],
                   [store itemGraphForRevisionUUID: revid persistentRoot: prootUUID]);
}

- (void)testInitialRevisionMetadata
{
    UKObjectsEqual([self initialMetadata], [[store revisionInfoForRevisionUUID: initialRevisionUUID
                                                            persistentRootUUID: prootUUID] metadata]);
}

- (void)testPersistentRootInfoForUUID
{
    UKNil([store persistentRootInfoForUUID: nil]);
}

- (void)testDuplicateBranchesDisallowed
{
    COStoreTransaction *txn = [[COStoreTransaction alloc] init];
    COPersistentRootInfo *otherPersistentRoot = [txn createPersistentRootWithInitialItemGraph: [self makeInitialItemTree]
                                                                                UUID: [ETUUID UUID]
                                                                                branchUUID: [ETUUID UUID]
                                                                             revisionMetadata: nil];
    [txn createBranchWithUUID: branchBUUID
                 parentBranch: nil
              initialRevision: otherPersistentRoot.currentRevisionUUID
            forPersistentRoot: otherPersistentRoot.UUID];

    UKFalse([store commitStoreTransaction: txn]);
}

/**
 * The precise constraint is: for every revision, the root object UUID of that
 * revision's object graph must equal the root object UUID of that revision's
 * parent's object graph
 */
- (void)testChangeRootObjectUUIDDisallowed
{
    // Make a "bad" item graph where the root item UUID is not rootUUID
    ETUUID *newRootUUID = [ETUUID UUID];
    COItem *newRootItem = [[COItem alloc] initWithUUID: newRootUUID
                                    typesForAttributes: @{}
                                   valuesForAttributes: @{}];
    COItemGraph *graph = [[COItemGraph alloc] initWithItems: @[newRootItem]
                                               rootItemUUID: newRootUUID];

    COStoreTransaction *txn = [[COStoreTransaction alloc] init];
    [txn writeRevisionWithModifiedItems: graph
                           revisionUUID: [ETUUID UUID]
                               metadata: nil
                       parentRevisionID: initialRevisionUUID
                  mergeParentRevisionID: nil
                     persistentRootUUID: prootUUID
                             branchUUID: branchAUUID];

    prootChangeCount = [txn setOldTransactionID: prootChangeCount forPersistentRoot: prootUUID];
    UKFalse([store commitStoreTransaction: txn]);
}

- (void)testInsertDuplicateRevisionUUID
{
    COStoreTransaction *txn = [[COStoreTransaction alloc] init];
    [txn writeRevisionWithModifiedItems: [self makeBranchAItemTreeAtIndex: BRANCH_LATER]
                           revisionUUID: [self lateBranchA]
                               metadata: nil
                       parentRevisionID: initialRevisionUUID
                  mergeParentRevisionID: nil
                     persistentRootUUID: prootUUID
                             branchUUID: branchAUUID];

    prootChangeCount = [txn setOldTransactionID: prootChangeCount forPersistentRoot: prootUUID];
    UKFalse([store commitStoreTransaction: txn]);
}

/**
 * Writing a new revision does not touch the mutable state of a persistent
 * root, so there is no need to provide a transaction ID for the persistent
 * root. This test ensures that the store allows this.
 */
- (void)testWriteRevisionDoesNotNeedValidTransactionID
{
    COStoreTransaction *txn = [[COStoreTransaction alloc] init];
    [txn writeRevisionWithModifiedItems: [self makeBranchAItemTreeAtIndex: BRANCH_LATER]
                           revisionUUID: [ETUUID UUID]
                               metadata: nil
                       parentRevisionID: initialRevisionUUID
                  mergeParentRevisionID: nil
                     persistentRootUUID: prootUUID
                             branchUUID: branchAUUID];
    UKTrue([store commitStoreTransaction: txn]);
}

- (void)testWriteRevisionWithNonExistentParent
{
    COStoreTransaction *txn = [[COStoreTransaction alloc] init];

    // N.B. If the parent revision is not in the store, you have to provide all items
    // in the revision (not just a delta against the parent)

    [txn writeRevisionWithModifiedItems: [self makeBranchAItemTreeAtIndex: BRANCH_LATER]
                           revisionUUID: [ETUUID UUID]
                               metadata: nil
                       parentRevisionID: [ETUUID UUID]
                  mergeParentRevisionID: nil
                     persistentRootUUID: prootUUID
                             branchUUID: branchAUUID];
    prootChangeCount = [txn setOldTransactionID: prootChangeCount forPersistentRoot: prootUUID];
    UKTrue([store commitStoreTransaction: txn]);
}

- (void)testWriteRevisionWithNonExistentMergeParent
{
    COStoreTransaction *txn = [[COStoreTransaction alloc] init];
    [txn writeRevisionWithModifiedItems: [self makeBranchAItemTreeAtIndex: BRANCH_LATER]
                           revisionUUID: [ETUUID UUID]
                               metadata: nil
                       parentRevisionID: initialRevisionUUID
                  mergeParentRevisionID: [ETUUID UUID]
                     persistentRootUUID: prootUUID
                             branchUUID: branchAUUID];
    prootChangeCount = [txn setOldTransactionID: prootChangeCount forPersistentRoot: prootUUID];
    UKTrue([store commitStoreTransaction: txn]);
}

/**
 * check that the store can retrieve the item graph for a (persistentRoot, revisionUUID) pair
 * even if persistentRoot has been permanently deleted, and persistentRoot != the backing store UUID.
 */
- (void)testAccessItemGraphAfterPersistentRootDeletion
{
    /**
     * Persistent root that will be created & deleted
     */
    ETUUID *cheapCopyUUID1 = [ETUUID UUID];
    ETUUID *cheapCopyBranchUUID1 = [ETUUID UUID];

    /**
     * Persistent root to prevent newRevisionUUID from being GC'ed
     */
    ETUUID *cheapCopyUUID2 = [ETUUID UUID];
    ETUUID *cheapCopyBranchUUID2 = [ETUUID UUID];

    /**
     * Revision to commit in cheapCopyUUID1
     */
    ETUUID *newRevisionUUID = [ETUUID UUID];

    int64_t cheapCopy1TransactionID = 0;
    int64_t cheapCopy2TransactionID = 0;

    // 1. Make a cheap copy and write a new revision in it.
    //    This is just to give a situation where we have a revision whose
    //    persistentRootUUID is not the same as the backing store's

    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];

        COPersistentRootInfo *cheapCopy1 = [txn createPersistentRootCopyWithUUID: cheapCopyUUID1
                                                        parentPersistentRootUUID: prootUUID
                                                                      branchUUID: cheapCopyBranchUUID1
                                                                parentBranchUUID: nil
                                                             initialRevisionUUID: newRevisionUUID];

        [txn writeRevisionWithModifiedItems: [self itemTreeWithChildNameChange: @"newRevisionUUID"]
                               revisionUUID: newRevisionUUID
                                   metadata: nil
                           parentRevisionID: initialRevisionUUID
                      mergeParentRevisionID: nil
                         persistentRootUUID: cheapCopyUUID1
                                 branchUUID: cheapCopyBranchUUID1];

        cheapCopy1TransactionID = [txn setOldTransactionID: cheapCopy1.transactionID
                                         forPersistentRoot: cheapCopyUUID1];

        UKTrue([store commitStoreTransaction: txn]);
    }

    UKTrue(COItemGraphEqualToItemGraph([self itemTreeWithChildNameChange: @"newRevisionUUID"],
                                       [store itemGraphForRevisionUUID: newRevisionUUID
                                                        persistentRoot: cheapCopyUUID1]));

    // 2. Make another cheap copy based on cheapCopyUUID1. Then delete cheapCopyUUID1

    {
        COStoreTransaction *txn = [[COStoreTransaction alloc] init];

        COPersistentRootInfo *cheapCopy2 = [txn createPersistentRootCopyWithUUID: cheapCopyUUID2
                                                        parentPersistentRootUUID: cheapCopyUUID1
                                                                      branchUUID: cheapCopyBranchUUID2
                                                                parentBranchUUID: nil
                                                             initialRevisionUUID: newRevisionUUID];

        [txn deletePersistentRoot: cheapCopyUUID1];

        cheapCopy1TransactionID = [txn setOldTransactionID: cheapCopy1TransactionID
                                         forPersistentRoot: cheapCopyUUID1];
        cheapCopy1TransactionID = [txn setOldTransactionID: cheapCopy2.transactionID
                                         forPersistentRoot: cheapCopyUUID2];

        UKTrue([store commitStoreTransaction: txn]);

        UKTrue([store finalizeDeletionsForPersistentRoot: cheapCopyUUID1 error: NULL]);
    }

    // 3. Ensure we can reopen the store, and still read back newRevisionUUID,
    // even though proot it was committed on is deleted.

    COSQLiteStore *store2 = [[COSQLiteStore alloc] initWithURL: store.URL];

    UKNil([store2 persistentRootInfoForUUID: cheapCopyUUID1]);
    UKNotNil([store2 persistentRootInfoForUUID: cheapCopyUUID2]);

    UKTrue(COItemGraphEqualToItemGraph([self itemTreeWithChildNameChange: @"newRevisionUUID"],
                                       [store2 itemGraphForRevisionUUID: newRevisionUUID
                                                         persistentRoot: cheapCopyUUID1]));
    UKTrue(COItemGraphEqualToItemGraph([self itemTreeWithChildNameChange: @"newRevisionUUID"],
                                       [store2 itemGraphForRevisionUUID: newRevisionUUID
                                                         persistentRoot: cheapCopyUUID2]));

}

@end


text:
In school, I found that I would need to create .cpp, .h and .java files really often, so I decided to build a template file creator to simplifiy the process for me.

Template builds template .cpp, .c, .h and .java files (will support more file types in the future) based on a file name and #include/import lines provided at the command line.  If the file type is not one of the supported file types, a new file with the name specified is created.  The file is opened after creation.

#Examples:

 .cpp Example:

     template awesome.cpp iostream vector string
 Output:

     #include <iostream>
     #include <vector>
     #include <string>

     using namespace std;

     int main(int argc, char * argv[])
     {

        return 0;
     }

 .c Example:

     template something.c stdio.h
 Output:

     #include <stdio.h>

     int main(int argc, char * argv[])
     {

        return 0;
     }

 .h Example:

     template awesome.h vector string

 Output:

     #ifndef TEST_H
     #def TEST_H

     #include <iostream>
     #include <string>

     #endif // TEST_H

 Java Example:

     template something.java util.* math.*

 Output:

     import java.util.*;
     import java.math.*;

     public class something {

        public static void main(String[] args) {

        }
     }


text:
#ifndef SVGAnimatedTypeAnimator_h
#define SVGAnimatedTypeAnimator_h

#include "core/svg/properties/SVGPropertyInfo.h"
#include "platform/heap/Handle.h"
#include "wtf/text/WTFString.h"

namespace blink {

class SVGAnimatedPropertyBase;
class SVGPropertyBase;
class SVGElement;
class SVGAnimationElement;

class SVGAnimatedTypeAnimator final {
  DISALLOW_NEW();

 public:
  SVGAnimatedTypeAnimator(SVGAnimationElement*);

  void clear();
  void reset(SVGElement* contextElement);

  SVGPropertyBase* createAnimatedValue() const;
  SVGPropertyBase* createPropertyForAnimation(const String&) const;

  void setContextElement(SVGElement* contextElement) {
    m_contextElement = contextElement;
  }
  AnimatedPropertyType type() const { return m_type; }

  bool isAnimatingSVGDom() const { return m_animatedProperty; }
  bool isAnimatingCSSProperty() const { return !m_animatedProperty; }

  DECLARE_TRACE();

 private:
  SVGPropertyBase* createPropertyForAttributeAnimation(const String&) const;
  SVGPropertyBase* createPropertyForCSSAnimation(const String&) const;

  Member<SVGAnimationElement> m_animationElement;
  Member<SVGElement> m_contextElement;
  Member<SVGAnimatedPropertyBase> m_animatedProperty;
  AnimatedPropertyType m_type;
};

}  // namespace blink

#endif  // SVGAnimatedTypeAnimator_h


text:
<!DOCTYPE html>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<link rel="stylesheet" href="../styles/main.css" style="text/css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.css" style="text/css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.css" style="text/css"/>

<title> My Web-Page</title>

New-Beginnings..

t6-js-language.html

              In the JavaScript language, describe all the use cases for each of:
              parentheses () - e.g. '1. Execute a function var result = doSomething()'
              also to surround conditional statements.
              e.g if() {

              };

              brackets []
              Are mostly used for accessing the properties of an object or the element of an Array.
              e.g var myFruits = ['Mango', 'Banana', 'Apple'];
              alert myFruits[2]; will get the the third element in the Array.

                braces {}
                Are used during the declaration of object literals. for eg.
                var myFruits = {
                  Banana: 'Yellow',
                  Apple: 'Red',
                }
                etc.
                it is also  used to enclose the block of code like in function definations,conditional blocks, and loops etc.
                for eg.
                function --() = {

                };
                then for the loop,
                for() {

                };
                and if statements
                if () {

                };

                single quotes ''
                we use single quotes when we are handling the strings in JavaScript.
                You'll want to use single quotes where you want double quotes to appear inside the string (e.g. for html attributes) without having to escape them, or vice versa.
                for eg. var myName = 'Mini';

                  double quotes ""
                  You'll want to use single quotes where you want double quotes to appear inside the string (e.g. for html attributes) without having to escape them, or vice versa.
                  var myCar = 'My car is "RED" '
                  console.log(myCar);
                  My car is "RED"

ABOUT-AUTHOR

Hi! I am a Mum who is going on this new Tech-Journey

Connect

              Facebook
             |

              Twitter
             |

              Pinterest

Thought of the day

            "Choose to look at the positives within challenging situations."


text:
import {expect} from 'chai';
import * as all from './index';

describe('jsx-render-engine/strategy/react-router/index', function () {

  it('check export count', function () {
    expect(Object.keys(all).length).to.equal(4);
  });

  it('exports v3', function () {
    expect(all.v4).to.be.a.function;
  });

  it('exports v4', function () {
    expect(all.v4).to.be.a.function;
  });

  it('exports getDefaultPropsWithLocation', function () {
    expect(all.getDefaultPropsWithLocation).to.be.function;
  })
});


text:
class RemoveReplyBelowPostNumberFromPosts < ActiveRecord::Migration
  def change
    remove_column :posts, :reply_below_post_number
  end
end


text:
import functools

from keystone.common import json_home
from keystone.common import wsgi
from keystone.contrib.user_registration import controllers

build_resource_relation = functools.partial(
    json_home.build_v3_extension_resource_relation,
    extension_name='OS-REGISTRATION', extension_version='1.0')

build_parameter_relation = functools.partial(
    json_home.build_v3_extension_parameter_relation,
    extension_name='OS-REGISTRATION', extension_version='1.0')

class Registration(wsgi.V3ExtensionRouter):
    """API Endpoints for the user registration extension.

    The API looks like::

      # user creation and activation endpoint
      POST /OS-REGISTRATION/users
      GET /OS-REGISTRATION/users/$user_id/activate # get a new activation key
      PATCH /OS-REGISTRATION/activate/$activation_key/users/$user_id
      GET /OS-REGISTRATION/users/$user_id/reset_password #gets a token
      PATCH /OS-REGISTRATION/reset_password/$token_id/users/$user_id

    """

    PATH_PREFIX = '/OS-REGISTRATION'

    def add_routes(self, mapper):
        user_controller = controllers.UserRegistrationV3()

        self._add_resource(
            mapper, user_controller,
            path=self.PATH_PREFIX + '/users',
            post_action='register_user',
            rel=build_resource_relation(resource_name='users'))

        self._add_resource(
            mapper, user_controller,
            path=self.PATH_PREFIX + '/users/{user_id}/activate',
            get_action='new_activation_key',
            rel=build_resource_relation(resource_name='activation_key'),
            path_vars={
                'user_id':
                build_parameter_relation(parameter_name='user_id'),
            })

        self._add_resource(
            mapper, user_controller,
            path=self.PATH_PREFIX + '/activate/{activation_key}/users/{user_id}',
            patch_action='activate_user',
            rel=build_resource_relation(resource_name='user'),
            path_vars={
                'user_id':
                build_parameter_relation(parameter_name='user_id'),
                'activation_key':
                build_parameter_relation(parameter_name='activation_key'),
            })

        self._add_resource(
            mapper, user_controller,
            path=self.PATH_PREFIX + '/users/{user_id}/reset_password',
            get_action='get_reset_token',
            rel=build_resource_relation(resource_name='reset_token'),
            path_vars={
                'user_id':
                build_parameter_relation(parameter_name='user_id'),
            })

        self._add_resource(
            mapper, user_controller,
            path=self.PATH_PREFIX + '/reset_password/{token_id}/users/{user_id}',
            patch_action='reset_password',
            rel=build_resource_relation(resource_name='user'),
            path_vars={
                'user_id':
                build_parameter_relation(parameter_name='user_id'),
                'token_id':
                build_parameter_relation(parameter_name='token_id'),
            })


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

using System.Collections.Immutable;
using System.Diagnostics;

namespace Microsoft.CodeAnalysis.CodeGen
{
    internal sealed class DynamicAnalysisMethodBodyData
    {
        public readonly ImmutableArray<SourceSpan> Spans;

        public DynamicAnalysisMethodBodyData(ImmutableArray<SourceSpan> spans)
        {
            Debug.Assert(!spans.IsDefault);
            Spans = spans;
        }
    }
}


text:
require 'chef/knife/profitbricks_base'

class Chef
  class Knife
    class ProfitbricksDatacenterDelete < Knife
      include Knife::ProfitbricksBase

      banner 'knife profitbricks datacenter delete DATACENTER_ID' \
             ' [DATACENTER_ID] (options)'

      option :purge,
             short: '-p',
             long: '--purge',
             boolean: true,
             default: false,
             description: 'Recursively delete the datacenter and all' \
                          ' corresponding resources under the datacenter.'

      def run
        connection
        @name_args.each do |datacenter_id|
          begin
            datacenter = ProfitBricks::Datacenter.get(datacenter_id)
          rescue Excon::Errors::NotFound
            ui.error("Data center ID #{datacenter_id} not found. Skipping.")
            next
          end

          msg_pair('ID', datacenter.id)
          msg_pair('Name', datacenter.properties['name'])
          msg_pair('Description', datacenter.properties['description'])
          msg_pair('Location', datacenter.properties['location'])
          msg_pair('Version', datacenter.properties['version'])

          puts "\n"
          confirm('Do you really want to delete this data center')

          datacenter.delete
          ui.warn("Deleted data center #{datacenter.id}")
        end
      end
    end
  end
end


text:
.PHONY: all clean nuke migration-test bindata
DEFAULT_POSTGRES_CONN	:=postgres://postgres@localhost/zedlist_test?sslmode=disable
STATIC_EMBED		:=bindata/static/static.go
TMPl_EMBED		:=bindata/template/templates.go
COMPONENTS		:=./middlewares/... ./modules/... ./routes/...

ifeq "$(origin CONFIG_DBCONN)" "undefined"
CONFIG_DBCONN=$(DEFAULT_POSTGRES_CONN)
endif
ifeq "$(origin APP_VER)" "undefined"
VERSION=0.1.0
endif
all:  bindata test build

clean:
	@rm -r bin

nuke:
	go clean -i

build:
	@go build -o bin/zedlist ./cmd/zedlist

test:migration-test
	@CONFIG_DBCONN=$(CONFIG_DBCONN) go test $(COMPONENTS)

bindata:
	@go-bindata  -pkg=static -o=$(STATIC_EMBED) static/...
	@go-bindata -pkg=template -o=$(TMPl_EMBED) -prefix=templates/ templates/...

cover:test
	@CONFIG_DBCONN=$(CONFIG_DBCONN) bash ./scripts/coverage.sh

watch:
	@sass --watch assets/sass:static/css

lint:
	@-go vet ./...
	@-golint ./... |grep -v bindata/template/* |grep -v bindata/static/*

migration-test:
	@CONFIG_DBCONN=$(CONFIG_DBCONN) go test ./migration

deps:
	@go get -u -v github.com/golang/lint/golint
	@go get -u -v github.com/jteeuwen/go-bindata/...
	@go get github.com/mitchellh/gox

dist:
	@gox -output="dist/{{.Dir}}v$(VERSION)_{{.OS}}_{{.Arch}}" ./cmd/zedlist

server:build
	./bin/zedlist server

migrate:build
	./bin/zedlist migrate -d

resume:resume-build
	cp ./ui/resume/dist/js/resume.min.js static/js/resume.min.js

resume-build:
	cd ./ui/resume/ && npm run build
ui-dev:
	cd ./ui/resume/ && npm run dev


text:
package com.example.kanalearner;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Spinner;

import java.util.List;

public class TrainingSettingsActivity extends OptionsActivity implements AdapterView.OnItemSelectedListener {
    Spinner typeSpinner;
    Spinner testSpinner;

    DbHelper dbHelper;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_trainingsettings);
        getActionBar().setDisplayHomeAsUpEnabled(true);

        typeSpinner = (Spinner) findViewById(R.id.spinner_type);
        testSpinner = (Spinner) findViewById(R.id.spinner_test);

        typeSpinner.setOnItemSelectedListener(this);
        testSpinner.setOnItemSelectedListener(this);

        dbHelper = new DbHelper(this);

        updateTypeList();
        updateTestList();
    }

    public void startClicked(View view) {
        Intent i = new Intent(this, TrainingActivity.class);

        i.putExtra("typeId", ((DbHelper.Type)typeSpinner.getSelectedItem()).getId());
        i.putExtra("testId", ((DbHelper.Test)testSpinner.getSelectedItem()).getId());

        startActivity(i);
    }

    @Override
    public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
        if (parent == typeSpinner) {
            updateTestList();
        }
    }

    @Override
    public void onNothingSelected(AdapterView<?> parent) {
    }

    private void updateTypeList() {
        ArrayAdapter<DbHelper.Type> adapter = new ArrayAdapter<DbHelper.Type>(this, android.R.layout.simple_spinner_item, dbHelper.getAllTypes());
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        typeSpinner.setAdapter(adapter);
    }

    private void updateTestList() {
        List<DbHelper.Test> items = dbHelper.getTestsForType(((DbHelper.Type) typeSpinner.getSelectedItem()).getId());
        ArrayAdapter<DbHelper.Test> adapter = new ArrayAdapter<DbHelper.Test>(this, android.R.layout.simple_spinner_item, items);
        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
        testSpinner.setAdapter(adapter);
    }
}


text:
<?php
namespace Icecave\Skew\Entities\Messages\Serialization;

use Icecave\Skew\Entities\Messages\Job\JobAcceptMessage;
use Icecave\Skew\Entities\Messages\Job\JobCompleteMessage;
use Icecave\Skew\Entities\Messages\Job\JobErrorMessage;
use Icecave\Skew\Entities\Messages\Job\JobLogMessage;
use Icecave\Skew\Entities\Messages\Job\JobProgressMessage;
use Icecave\Skew\Entities\Messages\Job\JobRejectMessage;
use Icecave\Skew\Entities\Messages\Job\JobRequestMessage;
use Icecave\Skew\Entities\Messages\Job\LogLevel;
use Icecave\Skew\Entities\Messages\Processor\ProcessorReadyMessage;
use Icecave\Skew\Entities\Messages\Processor\ProcessorShutdownMessage;
use Icecave\Skew\Entities\Messages\Processor\ProcessorStartMessage;
use Icecave\Skew\Entities\Messages\Processor\ProcessorStopMessage;
use Icecave\Skew\Entities\Priority;
use PHPUnit_Framework_TestCase;

/**
 * @covers Icecave\Skew\Entities\Messages\Serialization\Encoder
 * @covers Icecave\Skew\Entities\Messages\Serialization\EncoderVisitor
 */
class EncoderTest extends PHPUnit_Framework_TestCase
{
    public function setUp()
    {
        $this->encoder = new Encoder;
    }

    public function testInstance()
    {
        $encoder = Encoder::instance();

        $this->assertInstanceOf(__NAMESPACE__ . '\Encoder', $encoder);
        $this->assertSame($encoder, Encoder::instance());
    }

    public function testDecodeJobAwareMessageWithoutJob()
    {
        $expected = ['type' => 'job.accept', 'processor' => 'abc', 'retry' => true];

        $message = new JobAcceptMessage(true);
        $message->setProcessor('abc');

        $this->assertEquals((object) $expected, $this->encoder->encode($message));
    }

    public function testDecodeProcessorAwareMessageWithoutProcessor()
    {
        $expected = ['type' => 'job.accept', 'job' => '123', 'retry' => true];

        $message = new JobAcceptMessage(true);
        $message->setJobId('123');

        $this->assertEquals((object) $expected, $this->encoder->encode($message));
    }

    public function testDecodeJobAcceptMessage()
    {
        $expected = ['type' => 'job.accept', 'job' => '123', 'processor' => 'abc', 'retry' => true];

        $message = new JobAcceptMessage(true);
        $message->setJobId('123');
        $message->setProcessor('abc');

        $this->assertEquals((object) $expected, $this->encoder->encode($message));
    }

    public function testDecodeJobCompleteMessage()
    {
        $expected = ['type' => 'job.complete', 'job' => '123', 'processor' => 'abc'];

        $message = new JobCompleteMessage;
        $message->setJobId('123');
        $message->setProcessor('abc');

        $this->assertEquals((object) $expected, $this->encoder->encode($message));
    }

    public function testDecodeJobErrorMessage()
    {
        $expected = ['type' => 'job.error', 'job' => '123', 'processor' => 'abc', 'reason' => 'The reason!', 'retry' => true];

        $message = new JobErrorMessage('The reason!', true);
        $message->setJobId('123');
        $message->setProcessor('abc');

        $this->assertEquals((object) $expected, $this->encoder->encode($message));
    }

    public function testDecodeJobLogMessage()
    {
        $expected = ['type' => 'job.log', 'job' => '123', 'processor' => 'abc', 'level' => 'debug', 'message' => 'The message!'];

        $message = new JobLogMessage(LogLevel::DEBUG(), 'The message!');
        $message->setJobId('123');
        $message->setProcessor('abc');

        $this->assertEquals((object) $expected, $this->encoder->encode($message));
    }

    public function testDecodeJobProgressMessage()
    {
        $expected = ['type' => 'job.progress', 'job' => '123', 'processor' => 'abc', 'progress' => 0.5];

        $message = new JobProgressMessage(0.5);
        $message->setJobId('123');
        $message->setProcessor('abc');

        $this->assertEquals((object) $expected, $this->encoder->encode($message));
    }

    public function testDecodeJobProgressMessageWithStatus()
    {
        $expected = ['type' => 'job.progress', 'job' => '123', 'processor' => 'abc', 'progress' => 0.5, 'status' => 'The status!'];

        $message = new JobProgressMessage(0.5, 'The status!');
        $message->setJobId('123');
        $message->setProcessor('abc');

        $this->assertEquals((object) $expected, $this->encoder->encode($message));
    }

    public function testDecodeJobRejectMessage()
    {
        $expected = ['type' => 'job.reject', 'job' => '123', 'processor' => 'abc', 'reason' => 'The reason!'];

        $message = new JobRejectMessage('The reason!');
        $message->setJobId('123');
        $message->setProcessor('abc');

        $this->assertEquals((object) $expected, $this->encoder->encode($message));
    }

    public function testDecodeJobRequestMessage()
    {
        $expected = ['type' => 'job.request', 'job' => '123', 'priority' => 'high', 'task' => 'xyz', 'payload' => [ 'foo' => 'bar' ], 'tags' => [ 'a', 'b', 'c' ]];

        $message = new JobRequestMessage('123', 'xyz');
        $message->setPriority(Priority::HIGH());
        $message->setTags(['a', 'b', 'c']);
        $message->setPayload(['foo' => 'bar']);

        $this->assertEquals((object) $expected, $this->encoder->encode($message));
    }

    public function testDecodeProcessorReadyMessage()
    {
        $expected = ['type' => 'processor.ready', 'processor' => 'abc'];

        $message = new ProcessorReadyMessage;
        $message->setProcessor('abc');

        $this->assertEquals((object) $expected, $this->encoder->encode($message));
    }

    public function testDecodeProcessorShutdownMessage()
    {
        $expected = ['type' => 'processor.shutdown', 'processor' => 'abc'];

        $message = new ProcessorShutdownMessage;
        $message->setProcessor('abc');

        $this->assertEquals((object) $expected, $this->encoder->encode($message));
    }

    public function testDecodeProcessorStartMessage()
    {
        $expected = ['type' => 'processor.start', 'processor' => 'abc', 'capabilities' => [ 'a', 'b', 'c' ]];

        $message = new ProcessorStartMessage;
        $message->setProcessor('abc');
        $message->setCapabilities([ 'a', 'b', 'c' ]);

        $this->assertEquals((object) $expected, $this->encoder->encode($message));
    }

    public function testDecodeProcessorStopMessage()
    {
        $expected = ['type' => 'processor.stop', 'processor' => 'abc'];

        $message = new ProcessorStopMessage;
        $message->setProcessor('abc');

        $this->assertEquals((object) $expected, $this->encoder->encode($message));
    }
}


text:
Welcome to Binder
=================

Binder is a lightweight SQL mapper for Python that lets you perform SQL
operations using native Python data types and methods:

>>> conn.select(Trades, AND(Trades.q.symbol=='RHAT', Trades.q.trans=='BUY'))
[{'date': datetime.date(2006, 1, 5), 'symbol': u'RHAT', 'trans': u'BUY', 'price'
: 35.0, 'qty': 100}]

A database row is mapped to a Python dictionary containing native Python data
types.  Binder gives you control of what SQL query is executed, while taking
care of query generation, parameter passing and data conversion.

Currently, Binder supports the SQLite (via Python's built-in sqlite3 module)
PostgreSQL (via psycopg2) and MySQL (via the MySQLdb python module).

Contents
========

.. toctree::
   :maxdepth: 2

Indices and tables
==================

* :ref:`genindex`
* :ref:`search`

.. * :ref:`modindex`


text:
{{album.name}}

{{album.artist}}

{{album.year}} {{album.label}}

            {{$index + 1}}
            {{song.name}}
            {{song.length}}

{{songName}}

{{songName}} - {{artist}}

                <slider></slider>

{{artist}}

                <slider></slider>


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>org.apache.hadoop.hbase.ipc (HBase 0.98.6-hadoop2 API)</title>
<meta name="date" content="2014-09-03">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Package org.apache.hadoop.hbase.ipc

Tools to help define network clients and servers.

See: Description

Interface Summary

Interface
Description

Delayable

A call whose response can be delayed by the server.

HBaseRPCErrorHandler

An interface for calling out of RPC for error conditions.

MetricsHBaseServerSource

MetricsHBaseServerWrapper

PriorityFunction

Function to figure priority of incoming request.

RpcCallContext

RpcServerInterface

RpcServer Interface.

Class Summary

Class
Description

BalancedQueueRpcExecutor

An RpcExecutor that will balance requests evenly across all its queues, but still remains
 efficient with a single queue via an inlinable queue balancing mechanism.

BlockingRpcCallback<R>

Simple RpcCallback implementation providing a
 Future-like BlockingRpcCallback.get() method, which
 will block util the instance's BlockingRpcCallback.run(Object) method has been called.

CallRunner

The request processing logic, which is usually executed in thread pools provided by an
 RpcScheduler.

CoprocessorRpcChannel

Base class which provides clients with an RPC connection to
 call coprocessor endpoint Services.

DelegatingPayloadCarryingRpcController

Simple delegating controller for use with the RpcControllerFactory to help override
 standard behavior of a PayloadCarryingRpcController.

FifoRpcScheduler

A very simple RpcScheduler} that serves incoming requests in order.

MasterCoprocessorRpcChannel

Provides clients with an RPC connection to call coprocessor endpoint Services
 against the active master.

MetricsHBaseServer

MetricsHBaseServerSourceFactory

MetricsHBaseServerSourceFactoryImpl

MetricsHBaseServerSourceImpl

MetricsHBaseServerWrapperImpl

PayloadCarryingRpcController

Optionally carries Cells across the proxy/service interface down into ipc.

RegionCoprocessorRpcChannel

Provides clients with an RPC connection to call coprocessor endpoint Services
 against a given table region.

RequestContext

Represents client information (authenticated username, remote address, protocol)
 for the currently executing request.

RpcClient

Does RPC against a cluster.

RpcClient.BlockingRpcChannelImplementation

Blocking rpc channel that goes via hbase rpc.

RpcClient.ConnectionId

This class holds the address and the user ticket, etc.

RpcControllerFactory

Factory to create a PayloadCarryingRpcController

RpcExecutor

RpcScheduler

An interface for RPC request scheduling algorithm.

RpcServer

An RPC server that hosts protobuf described Services.

RpcServer.BlockingServiceAndInterface

Datastructure for passing a BlockingService and its associated class of
 protobuf service interface.

RWQueueRpcExecutor

RPC Executor that uses different queues for reads and writes.

ServerRpcController

Used for server-side protobuf RPC service invocations.

SimpleRpcScheduler

A scheduler that maintains isolated handler pools for general, high-priority and replication
 requests.

Exception Summary

Exception
Description

BadAuthException

CallerDisconnectedException

Exception indicating that the remote host making this IPC lost its
 IPC connection.

EmptyServiceNameException

FatalConnectionException

Thrown when server finds fatal issue w/ connection setup: e.g.

RemoteWithExtrasException

A RemoteException with some extra information.

RpcClient.CallTimeoutException

Client-side call timeout

RpcClient.FailedServerException

RpcServer.CallQueueTooBigException

ServerNotRunningYetException

StoppedRpcClientException

UnknownServiceException

UnsupportedCellCodecException

UnsupportedCompressionCodecException

WrongVersionException

Package org.apache.hadoop.hbase.ipc Description

Tools to help define network clients and servers.
This is the hadoop copied local so can fix bugs and make hbase-specific optimizations.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Copyright © 2014 The Apache Software Foundation. All rights reserved.


text:
namespace Adaptive.ReactiveTrader.Client.UI.SpotTiles
{
    public partial class SpotTileView
    {
        public SpotTileView()
        {
            InitializeComponent();
        }
    }
}


text:
namespace System.Management.Automation
{
    /// <summary>
    /// This class contains strings required for serialization
    /// </summary>
    internal static class SerializationStrings
    {
        #region element tags

        /// <summary>
        /// Element tag for root node
        /// </summary>
        internal const string RootElementTag = "Objs";

        #region PSObject

        /// <summary>
        /// Element tag for PSObject
        /// </summary>
        internal const string PSObjectTag = "Obj";

        /// <summary>
        /// Element tag for properties
        /// </summary>
        internal const string AdapterProperties = "Props";

        /// <summary>
        /// TypeNames tag
        /// </summary>
        internal const string TypeNamesTag = "TN";
        /// <summary>
        /// Tag for type item in typenames
        /// </summary>
        internal const string TypeNamesItemTag = "T";
        /// <summary>
        /// TypeName reference
        /// </summary>
        internal const string TypeNamesReferenceTag = "TNRef";

        /// <summary>
        /// Memberset
        /// </summary>
        internal const string MemberSet = "MS";

        /// <summary>
        /// Individual notes
        /// </summary>
        internal const string NoteProperty = "N";

        /// <summary>
        /// Tag for ToString value
        /// </summary>
        internal const string ToStringElementTag = "ToString";

        #endregion PSObject

        #region known container tags

        /// <summary>
        /// Element tag used for IEnumerables.
        /// </summary>
        internal const string CollectionTag = "IE";

        /// <summary>
        /// Element tag used for Dictionary
        /// </summary>
        internal const string DictionaryTag = "DCT";

        /// <summary>
        /// Element tag used for Dictionary entry
        /// </summary>
        internal const string DictionaryEntryTag = "En";

        /// <summary>
        /// Value of name attribute for dictionary key part in dictionary entry
        /// </summary>
        internal const string DictionaryKey = "Key";

        /// <summary>
        /// Value of name attribute for dictionary value part in dictionary entry
        /// </summary>
        internal const string DictionaryValue = "Value";

        /// <summary>
        /// Element tag used for Stack
        /// </summary>
        internal const string StackTag = "STK";

        /// <summary>
        /// Element tag used for Queue
        /// </summary>
        internal const string QueueTag = "QUE";

        /// <summary>
        /// Element tag used for List
        /// </summary>
        internal const string ListTag = "LST";

        #endregion known container tags

        #region primitive known type tags
        /// <summary>
        /// Element tag for char property.
        /// </summary>
        /// <remarks>This property is used for System.Char type</remarks>
        internal const string CharTag = "C";

        /// <summary>
        /// Element tag for guid property.
        /// </summary>
        /// <remarks>This property is used for System.Guid type</remarks>
        internal const string GuidTag = "G";

        /// <summary>
        /// Element tag for boolean property.
        /// </summary>
        /// <remarks>This property is used for System.Boolean type</remarks>
        internal const string BooleanTag = "B";

        /// <summary>
        /// Element tag for unsignedByte property.
        /// </summary>
        /// <remarks>This property is used for System.Byte type</remarks>
        internal const string UnsignedByteTag = "By";

        /// <summary>
        /// Element tag for dateTime property.
        /// </summary>
        /// <remarks>This property is used for System.DateTime type</remarks>
        internal const string DateTimeTag = "DT";

        /// <summary>
        /// Element tag for decimal property.
        /// </summary>
        /// <remarks>This property is used for System.Decimal type</remarks>
        internal const string DecimalTag = "D";

        /// <summary>
        /// Element tag for double property.
        /// </summary>
        /// <remarks>This property is used for System.Double type</remarks>
        internal const string DoubleTag = "Db";

        /// <summary>
        /// Element tag for duration property.
        /// </summary>
        /// <remarks>This property is used for System.TimeSpan type</remarks>
        internal const string DurationTag = "TS";

        /// <summary>
        /// Element tag for float property.
        /// </summary>
        /// <remarks>This property is used for System.Single type</remarks>
        internal const string FloatTag = "Sg";

        /// <summary>
        /// Element tag for int property.
        /// </summary>
        /// <remarks>This property is used for System.Int32 type</remarks>
        internal const string IntTag = "I32";

        /// <summary>
        /// Element tag for long property.
        /// </summary>
        /// <remarks>This property is used for System.Int64 type</remarks>
        internal const string LongTag = "I64";

        /// <summary>
        /// Element tag for byte property.
        /// </summary>
        /// <remarks>This property is used for System.SByte type</remarks>
        internal const string ByteTag = "SB";

        /// <summary>
        /// Element tag for short property.
        /// </summary>
        /// <remarks>This property is used for System.Int16 type</remarks>
        internal const string ShortTag = "I16";

        /// <summary>
        /// Element tag for base64Binary property.
        /// </summary>
        /// <remarks>This property is used for System.IO.Stream type</remarks>
        internal const string Base64BinaryTag = "BA";

        /// <summary>
        /// Element tag for scriptblock property.
        /// </summary>
        /// <remarks>This property is used for System.Management.Automation.ScriptBlock type</remarks>
        internal const string ScriptBlockTag = "SBK";

        /// <summary>
        /// Element tag for string property.
        /// </summary>
        /// <remarks>This property is used for System.String type</remarks>
        internal const string StringTag = "S";

        /// <summary>
        /// Element tag for secure string property
        /// </summary>
        /// <remarks>This property is used for System.Security.SecureString type</remarks>
        internal const string SecureStringTag = "SS";

        /// <summary>
        /// Element tag for unsignedShort property.
        /// </summary>
        /// <remarks>This property is used for System.UInt16 Stream type</remarks>
        internal const string UnsignedShortTag = "U16";

        /// <summary>
        /// Element tag for unsignedInt property.
        /// </summary>
        /// <remarks>This property is used for System.UInt32 type</remarks>
        internal const string UnsignedIntTag = "U32";

        /// <summary>
        /// Element tag for unsignedLong property.
        /// </summary>
        /// <remarks>This property is used for System.Long type</remarks>
        internal const string UnsignedLongTag = "U64";

        /// <summary>
        /// Element tag for anyUri property.
        /// </summary>
        /// <remarks>This property is used for System.Uri type</remarks>
        internal const string AnyUriTag = "URI";

        /// <summary>
        /// Element tag for Version property
        /// </summary>
        internal const string VersionTag = "Version";

        /// <summary>
        /// Element tag for SemanticVersion property
        /// </summary>
        internal const string SemanticVersionTag = "SemanticVersion";

        /// <summary>
        /// Element tag for XmlDocument
        /// </summary>
        internal const string XmlDocumentTag = "XD";

        /// <summary>
        /// Element tag for property whose value is null
        /// </summary>
        internal const string NilTag = "Nil";

        /// <summary>
        /// Element tag for PSObjectReference property.
        /// </summary>
        /// <remarks>This property is used for a reference to a property bag</remarks>
        internal const string ReferenceTag = "Ref";

        #region progress record

        internal const string ProgressRecord = "PR";
        internal const string ProgressRecordActivityId = "AI";
        internal const string ProgressRecordParentActivityId = "PI";
        internal const string ProgressRecordActivity = "AV";
        internal const string ProgressRecordStatusDescription = "SD";
        internal const string ProgressRecordCurrentOperation = "CO";
        internal const string ProgressRecordPercentComplete = "PC";
        internal const string ProgressRecordSecondsRemaining = "SR";
        internal const string ProgressRecordType = "T";

        #endregion progress record

        #endregion primitive known type tags

        #endregion element tags

        #region attribute tags
        /// <summary>
        /// String for reference id attribute
        /// </summary>
        internal const string ReferenceIdAttribute = "RefId";

        /// <summary>
        /// String for name attribute
        /// </summary>
        internal const string NameAttribute = "N";

        /// <summary>
        /// String for version attribute
        /// </summary>
        internal const string VersionAttribute = "Version";

        /// <summary>
        /// String for stream attribute
        /// </summary>
        internal const string StreamNameAttribute = "S";

        #endregion attribute tags

        #region namespace values

        /// <summary>
        /// Monad namespace
        /// </summary>
        internal const string MonadNamespace = "http://schemas.microsoft.com/powershell/2004/04";

        /// <summary>
        /// Prefix string for monad namespace
        /// </summary>
        internal const string MonadNamespacePrefix = "ps";

        #endregion namespace values
    };
}


text:
import {Component, View, Input, Output, EventEmitter} from 'angular2/core';
import {CORE_DIRECTIVES} from 'angular2/common';
import {Person} from '../../models/person';

@Component({
    selector: 'modal-dialog'
})

@View({
    templateUrl: 'app/components/modalDialog/modalDialogComponent.html',
    directives: [CORE_DIRECTIVES],
})

export class ModalDialog {
    @Input() show: boolean;
    @Input() width: number;
    @Input() height: number;
    @Input() cancelLabel: string;
    @Input() applyLabel: string;
    @Input() validate: Function;

    @Output('onCloseDialog') onCloseEvents = new EventEmitter();

    cancelCloseModal() {
        if (this.cancelLabel) {
            this.show = false;
            this.onCloseEvents.next(false);
        }
        return false;
    }

    applyCloseModal() {
        if (this.validate()) {
            this.show = false;
            this.onCloseEvents.next(true);
        }
    }
}