text:
import datetime

import testtools
from mock import Mock
from mock import patch

from trove.cluster.models import ClusterTasks as ClusterTaskStatus
from trove.cluster.models import DBCluster
from trove.common.strategies.cluster.experimental.vertica.taskmanager import \
    VerticaClusterTasks as ClusterTasks
from trove.datastore import models as datastore_models
from trove.instance.models import BaseInstance
from trove.instance.models import DBInstance
from trove.instance.models import Instance
from trove.instance.models import InstanceServiceStatus
from trove.instance.models import InstanceTasks
from trove.taskmanager.models import ServiceStatuses

class VerticaClusterTasksTest(testtools.TestCase):
    def setUp(self):
        super(VerticaClusterTasksTest, self).setUp()
        self.cluster_id = "1232"
        self.cluster_name = "Cluster-1234"
        self.tenant_id = "6789"
        self.db_cluster = DBCluster(ClusterTaskStatus.NONE,
                                    id=self.cluster_id,
                                    created=str(datetime.date),
                                    updated=str(datetime.date),
                                    name=self.cluster_name,
                                    task_id=ClusterTaskStatus.NONE._code,
                                    tenant_id=self.tenant_id,
                                    datastore_version_id="1",
                                    deleted=False)
        self.dbinst1 = DBInstance(InstanceTasks.NONE, id="1", name="member1",
                                  compute_instance_id="compute-1",
                                  task_id=InstanceTasks.NONE._code,
                                  task_description=
                                  InstanceTasks.NONE._db_text,
                                  volume_id="volume-1",
                                  datastore_version_id="1",
                                  cluster_id=self.cluster_id,
                                  type="member")
        self.dbinst2 = DBInstance(InstanceTasks.NONE, id="2", name="member2",
                                  compute_instance_id="compute-2",
                                  task_id=InstanceTasks.NONE._code,
                                  task_description=
                                  InstanceTasks.NONE._db_text,
                                  volume_id="volume-2",
                                  datastore_version_id="1",
                                  cluster_id=self.cluster_id,
                                  type="member")
        self.dbinst3 = DBInstance(InstanceTasks.NONE, id="3", name="member3",
                                  compute_instance_id="compute-3",
                                  task_id=InstanceTasks.NONE._code,
                                  task_description=
                                  InstanceTasks.NONE._db_text,
                                  volume_id="volume-3",
                                  datastore_version_id="1",
                                  cluster_id=self.cluster_id,
                                  type="member")
        mock_ds1 = Mock()
        mock_ds1.name = 'vertica'
        mock_dv1 = Mock()
        mock_dv1.name = '7.1'
        self.clustertasks = ClusterTasks(Mock(),
                                         self.db_cluster,
                                         datastore=mock_ds1,
                                         datastore_version=mock_dv1)

    @patch.object(ClusterTasks, 'update_statuses_on_failure')
    @patch.object(InstanceServiceStatus, 'find_by')
    def test_all_instances_ready_bad_status(self,
                                            mock_find, mock_update):
        (mock_find.return_value.
         get_status.return_value) = ServiceStatuses.FAILED
        ret_val = self.clustertasks._all_instances_ready(["1", "2", "3", "4"],
                                                         self.cluster_id)
        mock_update.assert_called_with(self.cluster_id)
        self.assertEqual(False, ret_val)

    @patch.object(InstanceServiceStatus, 'find_by')
    def test_all_instances_ready(self, mock_find):
        (mock_find.return_value.
         get_status.return_value) = ServiceStatuses.RUNNING
        ret_val = self.clustertasks._all_instances_ready(["1", "2", "3", "4"],
                                                         self.cluster_id)
        self.assertEqual(True, ret_val)

    @patch.object(ClusterTasks, 'reset_task')
    @patch.object(ClusterTasks, 'get_guest')
    @patch.object(ClusterTasks, 'get_ip')
    @patch.object(ClusterTasks, '_all_instances_ready')
    @patch.object(Instance, 'load')
    @patch.object(DBInstance, 'find_all')
    @patch.object(datastore_models.Datastore, 'load')
    @patch.object(datastore_models.DatastoreVersion, 'load_by_uuid')
    def test_create_cluster(self, mock_dv, mock_ds, mock_find_all, mock_load,
                            mock_ready, mock_ip, mock_guest, mock_reset_task):
        mock_find_all.return_value.all.return_value = [self.dbinst1]
        mock_load.return_value = BaseInstance(Mock(),
                                              self.dbinst1, Mock(),
                                              InstanceServiceStatus(
                                                  ServiceStatuses.NEW))
        mock_ip.return_value = "10.0.0.2"
        self.clustertasks.create_cluster(Mock(), self.cluster_id)
        mock_guest.return_value.install_cluster.assert_called_with(['10.0.0.2']
                                                                   )
        mock_reset_task.assert_called()
        mock_guest.return_value.cluster_complete.assert_called()


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

import java.util.List;
import javax.annotation.Generated;

import com.amazonaws.SdkClientException;
import com.amazonaws.services.codecommit.model.*;

import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;

/**
 * CreateCommitRequestMarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class CreateCommitRequestMarshaller {

    private static final MarshallingInfo<String> REPOSITORYNAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("repositoryName").build();
    private static final MarshallingInfo<String> BRANCHNAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("branchName").build();
    private static final MarshallingInfo<String> PARENTCOMMITID_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("parentCommitId").build();
    private static final MarshallingInfo<String> AUTHORNAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("authorName").build();
    private static final MarshallingInfo<String> EMAIL_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("email").build();
    private static final MarshallingInfo<String> COMMITMESSAGE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("commitMessage").build();
    private static final MarshallingInfo<Boolean> KEEPEMPTYFOLDERS_BINDING = MarshallingInfo.builder(MarshallingType.BOOLEAN)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("keepEmptyFolders").build();
    private static final MarshallingInfo<List> PUTFILES_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("putFiles").build();
    private static final MarshallingInfo<List> DELETEFILES_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("deleteFiles").build();
    private static final MarshallingInfo<List> SETFILEMODES_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD)
            .marshallLocationName("setFileModes").build();

    private static final CreateCommitRequestMarshaller instance = new CreateCommitRequestMarshaller();

    public static CreateCommitRequestMarshaller getInstance() {
        return instance;
    }

    /**
     * Marshall the given parameter object.
     */
    public void marshall(CreateCommitRequest createCommitRequest, ProtocolMarshaller protocolMarshaller) {

        if (createCommitRequest == null) {
            throw new SdkClientException("Invalid argument passed to marshall(...)");
        }

        try {
            protocolMarshaller.marshall(createCommitRequest.getRepositoryName(), REPOSITORYNAME_BINDING);
            protocolMarshaller.marshall(createCommitRequest.getBranchName(), BRANCHNAME_BINDING);
            protocolMarshaller.marshall(createCommitRequest.getParentCommitId(), PARENTCOMMITID_BINDING);
            protocolMarshaller.marshall(createCommitRequest.getAuthorName(), AUTHORNAME_BINDING);
            protocolMarshaller.marshall(createCommitRequest.getEmail(), EMAIL_BINDING);
            protocolMarshaller.marshall(createCommitRequest.getCommitMessage(), COMMITMESSAGE_BINDING);
            protocolMarshaller.marshall(createCommitRequest.getKeepEmptyFolders(), KEEPEMPTYFOLDERS_BINDING);
            protocolMarshaller.marshall(createCommitRequest.getPutFiles(), PUTFILES_BINDING);
            protocolMarshaller.marshall(createCommitRequest.getDeleteFiles(), DELETEFILES_BINDING);
            protocolMarshaller.marshall(createCommitRequest.getSetFileModes(), SETFILEMODES_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}

redpajama_set_name: RedPajamaGithub


text:
package org.oscm.domobjects;

import static org.junit.Assert.assertNotNull;

import java.util.List;
import java.util.concurrent.Callable;

import javax.ejb.EJBException;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.oscm.internal.types.enumtypes.OrganizationRoleType;
import org.oscm.internal.types.exception.NonUniqueBusinessKeyException;
import org.oscm.internal.types.exception.ObjectNotFoundException;
import org.oscm.test.data.Organizations;
import org.oscm.test.data.Products;

/**
 * Tests for the domain object relationship user group to product
 *
 * @author Fang
 *
 */
public class UserGroupToInvisibleProductIT extends DomainObjectTestBase {

    /**
     * Test case: Add user group to product

     * ExpectedResult:
     *

     *
The dependent object can be retrieved from DB via userGroup and via
     * product

     *
Cascading delete works for deletion of userGroup

     *
Cascading delete works for deletion of product

     *

     *
     * @throws Exception
     */

    private Organization org;
    private UserGroup userGroup;
    private Product p;
    private Product oldproduct;
    private UserGroupToInvisibleProduct oldUserGroupToInvisibleProduct;

    @Before
    public void setupData() throws Exception {
        runTX(new Callable<Void>() {
            @Override
            public Void call() throws Exception {
                setupUserGroup();
                setupProduct();
                return null;
            }
        });
    }

    @Test
    public void testAdd() throws Exception {
        runTX(new Callable<Void>() {
            @Override
            public Void call() throws Exception {
                doTestAdd();
                return null;
            }
        });
        runTX(new Callable<Void>() {
            @Override
            public Void call() throws Exception {
                doTestAddCheck();
                return null;
            }
        });
    }

    private void setupUserGroup() throws NonUniqueBusinessKeyException,
            ObjectNotFoundException {

        org = Organizations.createOrganization(mgr,
                OrganizationRoleType.PLATFORM_OPERATOR);
        assertNotNull("organization expected", org);

        userGroup = new UserGroup();
        userGroup.setName("group1");
        userGroup.setDescription("group1 description");
        userGroup.setReferenceId("group1 reference Id");
        userGroup.setIsDefault(true);
        userGroup.setOrganization(org);

        mgr.persist(userGroup);
    }

    private void setupProduct() throws NonUniqueBusinessKeyException,
            ObjectNotFoundException {
        p = Products.createProduct("organizationId", "productId",
                "techProductId", mgr);
        assertNotNull("product expected", p);

        mgr.persist(p);
    }

    private void doTestAdd() throws Exception {
        userGroup = mgr.find(UserGroup.class, userGroup.getKey());
        p = mgr.find(Product.class, p.getKey());

        UserGroupToInvisibleProduct uip = new UserGroupToInvisibleProduct();
        uip.setUserGroup(userGroup);
        uip.setProduct(p);
        uip.setForallusers(true);
        mgr.persist(uip);
    }

    private void doTestAddCheck() {
        Product product = mgr.find(Product.class, p.getKey());
        assertNotNull("Product expected", product);

        assertNotNull(product.getUserGroupToInvisibleProducts());
        List<UserGroupToInvisibleProduct> uguList = product
                .getUserGroupToInvisibleProducts();
        Assert.assertEquals(1, uguList.size());

        UserGroupToInvisibleProduct ugu = uguList.get(0);
        Assert.assertEquals(userGroup, ugu.getUserGroup());
        Assert.assertEquals(p, ugu.getProduct());
    }

    @Test
    public void testDeleteByProduct() throws Throwable {
        try {
            runTX(new Callable<Void>() {
                @Override
                public Void call() throws Exception {
                    doTestAdd();
                    return null;
                }
            });
            runTX(new Callable<Void>() {
                @Override
                public Void call() throws Exception {
                    doTestDeleteByProduct();
                    return null;
                }
            });
            runTX(new Callable<Void>() {
                @Override
                public Void call() throws Exception {
                    doTestDeleteCheckByProduct();
                    return null;
                }
            });
        } catch (EJBException e) {
            throw e.getCause();
        }
    }

    private void doTestDeleteByProduct() {
        oldproduct = mgr.find(Product.class, p.getKey());
        assertNotNull("Old Product expected", oldproduct);

        List<UserGroupToInvisibleProduct> list = oldproduct
                .getUserGroupToInvisibleProducts();
        assertNotNull(list);
        Assert.assertEquals(1, list.size());

        oldUserGroupToInvisibleProduct = mgr.find(
                UserGroupToInvisibleProduct.class, list.get(0).getKey());
        assertNotNull(oldUserGroupToInvisibleProduct);

        mgr.remove(oldproduct);
    }

    private void doTestDeleteCheckByProduct() {
        // Product must be deleted
        Product pu = mgr.find(Product.class, oldproduct.getKey());
        Assert.assertNull("Product still available", pu);

        // UserGroupToInvisibleProduct must be deleted
        UserGroupToInvisibleProduct userGroupToInvisibleProduct = mgr.find(
                UserGroupToInvisibleProduct.class,
                oldUserGroupToInvisibleProduct.getKey());
        Assert.assertNull("UserGroupToInvisibleProduct still available",
                userGroupToInvisibleProduct);
    }

    @Test
    public void testDeleteByUserGroup() throws Throwable {
        try {
            runTX(new Callable<Void>() {
                @Override
                public Void call() throws Exception {
                    doTestAdd();
                    return null;
                }
            });
            runTX(new Callable<Void>() {
                @Override
                public Void call() throws Exception {
                    doTestDeleteByUserGroup();
                    return null;
                }
            });
            runTX(new Callable<Void>() {
                @Override
                public Void call() throws Exception {
                    doTestDeleteCheckByUserGroup();
                    return null;
                }
            });
        } catch (EJBException e) {
            throw e.getCause();
        }
    }

    private void doTestDeleteByUserGroup() {
        userGroup = mgr.find(UserGroup.class, userGroup.getKey());
        assertNotNull("UserGroup expected", userGroup);

        List<UserGroupToInvisibleProduct> list = userGroup
                .getUserGroupToInvisibleProducts();
        assertNotNull(list);
        Assert.assertEquals(1, list.size());

        oldUserGroupToInvisibleProduct = mgr.find(
                UserGroupToInvisibleProduct.class, list.get(0).getKey());
        assertNotNull(oldUserGroupToInvisibleProduct);

        mgr.remove(userGroup);
    }

    private void doTestDeleteCheckByUserGroup() {
        // UserGroup must be deleted
        UserGroup ug = mgr.find(UserGroup.class, userGroup.getKey());
        Assert.assertNull("UserGroup still available", ug);

        // UserGroupToInvisibleProduct must be deleted
        UserGroupToInvisibleProduct userGroupToInvisibleProduct = mgr.find(
                UserGroupToInvisibleProduct.class,
                oldUserGroupToInvisibleProduct.getKey());
        Assert.assertNull("UserGroupToInvisibleProduct still available",
                userGroupToInvisibleProduct);
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:background="?attr/colorPrimary">
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="20sp"
            android:textColor="#fff"
            android:text="中国"
            android:layout_centerInParent="true"
            android:id="@+id/title_text"/>
        <Button
            android:id="@+id/back_button"
            android:layout_width="45dp"
            android:layout_height="45dp"
            android:layout_marginLeft="10dp"
            android:layout_alignParentLeft="true"
            android:layout_centerVertical="true"
            android:background="@mipmap/ic_back"/>
    </RelativeLayout>
    <ListView
        android:background="#fff"
        android:id="@+id/lvi"
        android:layout_width="match_parent"
        android:layout_height="match_parent"></ListView>
</LinearLayout>


text:
export class foo { };   // expected-error {{expected template}}
template  x;            // expected-error {{C++ requires a type specifier for all declarations}} \
                        // expected-error {{does not refer}}
export template x;      // expected-error {{expected '<' after 'template'}}
export template<class T> class x0; // expected-warning {{exported templates are unsupported}}
template < ;            // expected-error {{expected template parameter}} \
// expected-error{{expected ',' or '>' in template-parameter-list}} \
// expected-warning {{declaration does not declare anything}}
template <int +> struct x1; // expected-error {{expected ',' or '>' in template-parameter-list}}

// verifies that we only walk to the ',' & still produce errors on the rest of the template parameters
template <int +, T> struct x2; // expected-error {{expected ',' or '>' in template-parameter-list}} \
                                expected-error {{expected unqualified-id}}
template<template<int+>> struct x3; // expected-error {{expected ',' or '>' in template-parameter-list}} \
                                         expected-error {{template template parameter requires 'class' after the parameter list}}
template <template X> struct Err1; // expected-error {{expected '<' after 'template'}} \
// expected-error{{extraneous}}
template <template <typename> > struct Err2;       // expected-error {{template template parameter requires 'class' after the parameter list}}
template <template <typename> Foo> struct Err3;    // expected-error {{template template parameter requires 'class' after the parameter list}}

template <template <typename> typename Foo> struct Cxx1z;
#if __cplusplus <= 201402L
// expected-warning@-2 {{extension}}
#endif

// Template function declarations
template <typename T> void foo();
template <typename T, typename U> void foo();

// Template function definitions.
template <typename T> void foo() { }

// Template class (forward) declarations
template <typename T> struct A;
template <typename T, typename U> struct b;
template <typename> struct C;
template <typename, typename> struct D;

// Forward declarations with default parameters?
template <typename T = int> class X1;
template <typename = int> class X2;

// Forward declarations w/template template parameters
template <template <typename> class T> class TTP1;
template <template <typename> class> class TTP2;
template <template <typename> class T = foo> class TTP3; // expected-error{{must be a class template}}
template <template <typename> class = foo> class TTP3; // expected-error{{must be a class template}}
template <template <typename X, typename Y> class T> class TTP5;

// Forward declarations with non-type params
template <int> class NTP0;
template <int N> class NTP1;
template <int N = 5> class NTP2;
template <int = 10> class NTP3;
template <unsigned int N = 12u> class NTP4;
template <unsigned int = 12u> class NTP5;
template <unsigned = 15u> class NTP6;
template <typename T, T Obj> class NTP7;

// Template class declarations
template <typename T> struct A { };
template <typename T, typename U> struct B { };

// Template parameter shadowing
template<typename T, // expected-note{{template parameter is declared here}}
         typename T> // expected-error{{declaration of 'T' shadows template parameter}}
  void shadow1();

template<typename T> // expected-note{{template parameter is declared here}}
void shadow2(int T); // expected-error{{declaration of 'T' shadows template parameter}}

template<typename T> // expected-note{{template parameter is declared here}}
class T { // expected-error{{declaration of 'T' shadows template parameter}}
};

template<int Size> // expected-note{{template parameter is declared here}}
void shadow3(int Size); // expected-error{{declaration of 'Size' shadows template parameter}}

// <rdar://problem/6952203>
template<typename T> // expected-note{{here}}
struct shadow4 {
  int T; // expected-error{{shadows}}
};

template<typename T> // expected-note{{here}}
struct shadow5 {
  int T(int, float); // expected-error{{shadows}}
};

template<typename T, // expected-note{{template parameter is declared here}}
         T T> // expected-error{{declaration of 'T' shadows template parameter}}
void shadow6();

template<typename T, // expected-note{{template parameter is declared here}}
         template<typename> class T> // expected-error{{declaration of 'T' shadows template parameter}}
void shadow7();

// PR8302
template<template<typename> class T> struct shadow8 { // expected-note{{template parameter is declared here}}
  template<template<typename> class T> struct inner; // expected-error{{declaration of 'T' shadows template parameter}}
};

// Non-type template parameters in scope
template<int Size>
void f(int& i) {
  i = Size;
 #ifdef DELAYED_TEMPLATE_PARSING
  Size = i;
 #else
  Size = i; // expected-error{{expression is not assignable}}
 #endif
}

template<typename T>
const T& min(const T&, const T&);

void f2() {
  int x;
  A< typeof(x>1) > a;
}

// PR3844
template <> struct S<int> { }; // expected-error{{explicit specialization of non-template struct 'S'}}
template <> union U<int> { }; // expected-error{{explicit specialization of non-template union 'U'}}

namespace PR6184 {
  namespace N {
    template <typename T>
    void bar(typename T::x);
  }

  template <typename T>
  void N::bar(typename T::x) { }
}

// This PR occurred only in template parsing mode.
namespace PR17637 {
template <int>
struct L {
  template <typename T>
  struct O {
    template <typename U>
    static void Fun(U);
  };
};

template <int k>
template <typename T>
template <typename U>
void L<k>::O<T>::Fun(U) {}

void Instantiate() { L<0>::O<int>::Fun(0); }

}

namespace explicit_partial_specializations {
typedef char (&oneT)[1];
typedef char (&twoT)[2];
typedef char (&threeT)[3];
typedef char (&fourT)[4];
typedef char (&fiveT)[5];
typedef char (&sixT)[6];

char one[1];
char two[2];
char three[3];
char four[4];
char five[5];
char six[6];

template<bool b> struct bool_ { typedef int type; };
template<> struct bool_<false> {  };

#define XCAT(x,y) x ## y
#define CAT(x,y) XCAT(x,y)
#define sassert(_b_) bool_<(_b_)>::type CAT(var, __LINE__);

template <int>
struct L {
  template <typename T>
  struct O {
    template <typename U>
    static oneT Fun(U);

  };
};
template <int k>
template <typename T>
template <typename U>
oneT L<k>::O<T>::Fun(U) { return one; }

template<>
template<>
template<typename U>
oneT L<0>::O<char>::Fun(U) { return one; }

void Instantiate() {
  sassert(sizeof(L<0>::O<int>::Fun(0)) == sizeof(one));
  sassert(sizeof(L<0>::O<char>::Fun(0)) == sizeof(one));
}

}


text:
// ***********************************************************************
// Assembly         : OptimizationToolbox
// Author           : campmatt
// Created          : 01-28-2021
//
// Last Modified By : campmatt
// Last Modified On : 01-28-2021
// ***********************************************************************
// <copyright file="VariableDescriptorEnum.cs" company="OptimizationToolbox">
//     Copyright (c) . All rights reserved.
// </copyright>
// <summary></summary>
// ***********************************************************************

using System;
using System.Collections;
using System.Collections.Generic;

namespace OptimizationToolbox
{
    /// <summary>
    /// Class VariableDescriptorEnum.
    /// Implements the <see cref="System.Collections.Generic.IEnumerator{OptimizationToolbox.VariableDescriptor}" />
    /// </summary>
    /// <seealso cref="System.Collections.Generic.IEnumerator{OptimizationToolbox.VariableDescriptor}" />
    class VariableDescriptorEnum : IEnumerator<VariableDescriptor>
    {
        /// <summary>
        /// The variable descriptors
        /// </summary>
        private readonly VariableDescriptor[] _variableDescriptors;

        // Enumerators are positioned before the first element
        // until the first MoveNext() call.
        /// <summary>
        /// The position
        /// </summary>
        int position = -1;

        /// <summary>
        /// Initializes a new instance of the <see cref="VariableDescriptorEnum"/> class.
        /// </summary>
        /// <param name="list">The list.</param>
        public VariableDescriptorEnum(VariableDescriptor[] list)
        {
            _variableDescriptors = list;
        }

        /// <summary>
        /// Advances the enumerator to the next element of the collection.
        /// </summary>
        /// <returns><see langword="true" /> if the enumerator was successfully advanced to the next element; <see langword="false" /> if the enumerator has passed the end of the collection.</returns>
        public bool MoveNext()
        {
            position++;
            return (position < _variableDescriptors.Length);
        }

        /// <summary>
        /// Sets the enumerator to its initial position, which is before the first element in the collection.
        /// </summary>
        public void Reset()
        {
            position = -1;
        }

        /// <summary>
        /// Gets the element in the collection at the current position of the enumerator.
        /// </summary>
        /// <value>The current.</value>
        object IEnumerator.Current
        {
            get
            {
                return Current;
            }
        }

        /// <summary>
        /// Gets the element in the collection at the current position of the enumerator.
        /// </summary>
        /// <value>The current.</value>
        /// <exception cref="InvalidOperationException"></exception>
        public VariableDescriptor Current
        {
            get
            {
                try
                {
                    return _variableDescriptors[position];
                }
                catch (IndexOutOfRangeException)
                {
                    throw new InvalidOperationException();
                }
            }
        }

        #region Implementation of IDisposable

        /// <summary>
        /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
        /// </summary>
        public void Dispose()
        {
           // throw new NotImplementedException();
        }

        #endregion
    }

}


text:
module.exports = function(app, options){

	app.get('/', function(req, res){
		var routePaths = {};
		app._router.stack.forEach(function(details){
			var route = details.route;
			if(route && route.path !== '/'){
				routePaths[route.path] = route.methods;
			}
		});
		res.json(routePaths);
	});

};


text:
package com.alibaba.nacos.api.remote.request;

import java.util.HashMap;
import java.util.Map;

/**
 * RequestMeta info.
 *
 * @author liuzunfei
 * @version $Id: RequestMeta.java, v 0.1 2020年07月14日 10:32 AM liuzunfei Exp $
 */
public class RequestMeta {

    private String connectionId = "";

    private String clientIp = "";

    private String clientVersion = "";

    private Map<String, String> labels = new HashMap<>();

    /**
     * Getter method for property <tt>clientVersion</tt>.
     *
     * @return property value of clientVersion
     */
    public String getClientVersion() {
        return clientVersion;
    }

    /**
     * Setter method for property <tt>clientVersion</tt>.
     *
     * @param clientVersion value to be assigned to property clientVersion
     */
    public void setClientVersion(String clientVersion) {
        this.clientVersion = clientVersion;
    }

    /**
     * Getter method for property <tt>labels</tt>.
     *
     * @return property value of labels
     */
    public Map<String, String> getLabels() {
        return labels;
    }

    /**
     * Setter method for property <tt>labels</tt>.
     *
     * @param labels value to be assigned to property labels
     */
    public void setLabels(Map<String, String> labels) {
        this.labels = labels;
    }

    /**
     * Getter method for property <tt>connectionId</tt>.
     *
     * @return property value of connectionId
     */
    public String getConnectionId() {
        return connectionId;
    }

    /**
     * Setter method for property <tt>connectionId</tt>.
     *
     * @param connectionId value to be assigned to property connectionId
     */
    public void setConnectionId(String connectionId) {
        this.connectionId = connectionId;
    }

    /**
     * Getter method for property <tt>clientIp</tt>.
     *
     * @return property value of clientIp
     */
    public String getClientIp() {
        return clientIp;
    }

    /**
     * Setter method for property <tt>clientIp</tt>.
     *
     * @param clientIp value to be assigned to property clientIp
     */
    public void setClientIp(String clientIp) {
        this.clientIp = clientIp;
    }

    @Override
    public String toString() {
        return "RequestMeta{" + "connectionId='" + connectionId + '\'' + ", clientIp='" + clientIp + '\''
                + ", clientVersion='" + clientVersion + '\'' + ", labels=" + labels + '}';
    }
}


text:
/**
 * Created by tscheinecker on 01.08.2014.
 */

'use strict';

window.cat.util = window.cat.util || {};

window.cat.models = window.cat.models || {};

/**
 * This helper function is used to acquire the constructor function which is used as a 'model' for the api endpoint.
 * @param name the name of the 'entity' for which the constructor has to be returned
 * @returns {Constructor}
 */
window.cat.util.defaultModelResolver = function (name) {
    return window.cat.models[name];
};


text:
package com.centzy.badger.validation.impl;

import com.centzy.badger.DateTime;
import com.centzy.badger.TagType;
import com.centzy.badger.common.service.BaseBadgerHandler;
import com.centzy.badger.core.*;
import com.centzy.badger.persistence.BadgerTransaction;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.common.collect.*;
import com.google.protobuf.Message;
import com.groupon.uuid.UUID;

import javax.annotation.Nullable;
import java.util.*;
import java.util.stream.Collectors;

/**
 * @author Peter Edge (peter@locality.com).
 */
class BadgerTransactionImpl extends BaseBadgerHandler implements BadgerTransaction {

  private final Map<String, String> temporaryIdToId = new HashMap<>();

  private final Multimap<BadgerEntityDescriptor<? extends Message>, String> createdEntityTypeToEntityId = HashMultimap.create();
  private final Multimap<BadgerEntityDescriptor<? extends Message>, String> mutatedEntityTypeToEntityId = HashMultimap.create();
  private final Multimap<BadgerEntityDescriptor<? extends Message>, String> archivedEntityTypeToEntityId = HashMultimap.create();

  private final BadgerDatabaseImpl badgerDatabase;
  private final BadgerTransaction delegate;

  BadgerTransactionImpl(BadgerCore badgerCore, BadgerDatabaseImpl badgerDatabase, BadgerTransaction delegate) {
    super(badgerCore);
    this.badgerDatabase = Preconditions.checkNotNull(badgerDatabase);
    this.delegate = Preconditions.checkNotNull(delegate);
  }

  @Override
  public String getId() {
    return delegate.getId();
  }

  @Override
  public <M extends Message> List<BadgerEntity<M>> get(
      BadgerEntityDescriptor<M> badgerEntityDescriptor,
      List<String> entityIds
  ) {
    return delegate.get(badgerEntityDescriptor, entityIds);
  }

  @Override
  public <M extends Message> List<BadgerEntity<M>> getForValues(
      BadgerEntityDescriptor<M> badgerEntityDescriptor,
      BadgerTagDescriptor badgerTagDescriptor,
      Set<?> values
  ) {
    return delegate.getForValues(badgerEntityDescriptor, badgerTagDescriptor, values);
  }

  @Override
  public <M extends Message, V> List<BadgerEntity<M>> getForBounds(
      BadgerEntityDescriptor<M> badgerEntityDescriptor,
      BadgerTagDescriptor badgerTagDescriptor,
      V lowerBound,
      V upperBound
  ) {
    return delegate.getForBounds(badgerEntityDescriptor, badgerTagDescriptor, lowerBound, upperBound);
  }

  @Override
  public <M extends Message> List<String> getIdsForValues(
      BadgerEntityDescriptor<M> badgerEntityDescriptor, BadgerTagDescriptor badgerTagDescriptor, Set<?> values) {
    return delegate.getIdsForValues(badgerEntityDescriptor, badgerTagDescriptor, values);
  }

  @Override
  public <M extends Message, V> List<String> getIdsForBounds(
      BadgerEntityDescriptor<M> badgerEntityDescriptor, BadgerTagDescriptor badgerTagDescriptor, V lowerBound, V upperBound) {
    return delegate.getIdsForBounds(badgerEntityDescriptor, badgerTagDescriptor, lowerBound, upperBound);
  }

  @Override
  public <M extends Message> List<String> create(List<BadgerEntity<M>> badgerEntities) {
    return badgerEntities.stream().map(this::create).collect(Collectors.toList());
  }

  private <M extends Message> String create(BadgerEntity<M> badgerEntity) {
    BadgerEntityDescriptor<M> badgerEntityDescriptor = badgerEntity.getBadgerMessageDescriptor();
    // will be null if no temporary id
    String temporaryId = badgerEntity.getId();
    if (temporaryId != null) {
      badgerEntity = badgerEntity.clear(ImmutableSet.of(badgerEntityDescriptor.getIdTag()));
    }

    Map<BadgerTag, Object> mergeMap = new HashMap<>();
    handleTemporaryIds(badgerEntity, mergeMap, temporaryId);

    Preconditions.checkArgument(badgerEntity.getId() == null, "create: entity id should not be set.");
    Preconditions.checkArgument(badgerEntity.getUpdatedAt() == null, "create: update_at should not be set.");
    Preconditions.checkArgument(badgerEntity.getArchived() == null, "create: archived should not be set.");

    mergeMap.put(badgerEntityDescriptor.getIdTag(), createUUID());
    mergeMap.put(badgerEntityDescriptor.getUpdatedAtTag(), DateTime.newBuilder().setUnixTimeUsec(getUnixTimeUsec()).build());
    mergeMap.put(badgerEntityDescriptor.getArchivedTag(), false);

    badgerEntity = badgerEntity.merge(mergeMap);

    String entityId = Iterables.getOnlyElement(delegate.create(ImmutableList.of(badgerEntity)));
    if (temporaryId != null) {
      registerTemporaryId(temporaryId, entityId);
    }
    registerCreatedEntityId(badgerEntityDescriptor, entityId);
    return entityId;
  }

  @Override
  public <M extends Message> void mutate(List<BadgerEntity<M>> badgerEntities, Set<BadgerMutateTag> tagsToUpdate) {
    List<BadgerEntity<M>> setBadgerEntities = badgerEntities.stream().map(badgerEntity -> {
          BadgerEntityDescriptor<M> badgerEntityDescriptor = badgerEntity.getBadgerMessageDescriptor();

          Preconditions.checkArgument(!Strings.isNullOrEmpty(badgerEntity.getId()), "mutate: entity id was not set.");
          Preconditions.checkArgument(badgerEntity.getUpdatedAt() == null, "mutate: updated_at should not be set.");
          Preconditions.checkArgument(badgerEntity.getArchived() == null, "mutate: archived should not be set.");

          Set<BadgerMergeOperation> badgerMergeOperations = handleTemporaryIds(badgerEntity, null);
          badgerMergeOperations.add(
              new BadgerMergeOperation(
                  BadgerMutateTag.optional(
                      badgerEntityDescriptor.getIdTag().getBadgerTagDescriptor().getBadgerPartialTagDescriptor()
                  ),
                  badgerEntity.getId()
              )
          );
          badgerMergeOperations.add(
              new BadgerMergeOperation(
                  BadgerMutateTag.optional(
                      badgerEntityDescriptor.getUpdatedAtTag().getBadgerTagDescriptor().getBadgerPartialTagDescriptor()
                  ),
                  DateTime.newBuilder().setUnixTimeUsec(getUnixTimeUsec()).build()
              )
          );
          badgerMergeOperations.add(
              new BadgerMergeOperation(
                  BadgerMutateTag.optional(
                      badgerEntityDescriptor.getArchivedTag().getBadgerTagDescriptor().getBadgerPartialTagDescriptor()
                  ),
                  false
              )
          );
          for (BadgerMutateTag badgerMutateTag : tagsToUpdate) {
            BadgerMutateTag mergeBadgerMutateTag = badgerMutateTag.isRepeated()
                ? BadgerMutateTag.repeated(badgerMutateTag.getBadgerPartialTagDescriptor(), BadgerMutateTag.RepeatedTagOperation.OVERWRITE)
                : badgerMutateTag;
            badgerMergeOperations.add(
                new BadgerMergeOperation(mergeBadgerMutateTag, badgerMutateTag.getValue(badgerEntity.getMessage()))
            );
          }
          return Iterables.getOnlyElement(delegate.get(badgerEntityDescriptor, ImmutableList.of(badgerEntity.getId())))
              .mergePartial(badgerMergeOperations);
        }
    ).collect(Collectors.toList());

    delegate.mutate(setBadgerEntities, tagsToUpdate);
    setBadgerEntities.forEach(badgerEntity -> registerMutatedEntityId(badgerEntity.getBadgerMessageDescriptor(), badgerEntity.getId()));
  }

  @Override
  public <M extends Message> void remove(BadgerEntityDescriptor<M> badgerEntityDescriptor, Set<String> entityIds) {
    delegate.remove(badgerEntityDescriptor, entityIds);
    entityIds.forEach(entityId -> registerArchivedEntityId(badgerEntityDescriptor, entityId));
  }

  @Override
  public <M extends Message> long getUpdatedAtUnixTimeUsec(BadgerEntityDescriptor<M> badgerEntityDescriptor, String entityId) {
    return delegate.getUpdatedAtUnixTimeUsec(badgerEntityDescriptor, entityId);
  }

  @Override
  public <M extends Message> List<Boolean> getExists(BadgerEntityDescriptor<M> badgerEntityDescriptor, List<String> entityIds) {
    return delegate.getExists(badgerEntityDescriptor, entityIds);
  }

  @Override
  public void invalidateCacheAdds() {
    delegate.invalidateCacheAdds();
  }

  @Override
  public void commit() {
    try {
      ImmutableList<BadgerValidateError> badgerValidateErrors = validateIncludingForeignIds();
      if (!badgerValidateErrors.isEmpty()) {
        throw new BadgerValidateException(badgerValidateErrors);
      }
      delegate.commit();
      badgerDatabase.removeTransaction(this);
    } catch (RuntimeException e) {
      invalidateCacheAdds();
      throw e;
    }
  }

  @Override
  public void cancel() {
    /*
    try {
      delegate.cancel();
      badgerDatabase.removeTransaction(this);
    } finally {
      invalidateCacheAdds();
    }
    */
  }

  private void registerTemporaryId(String temporaryId, String id) {
    synchronized (temporaryIdToId) {
      Preconditions.checkArgument(!temporaryIdToId.containsKey(temporaryId));
      temporaryIdToId.put(temporaryId, id);
    }
  }

  @Nullable
  private String getIdForTemporaryId(String temporaryId) {
    synchronized (temporaryIdToId) {
      return temporaryIdToId.get(temporaryId);
    }
  }

  private synchronized void registerCreatedEntityId(BadgerEntityDescriptor<? extends Message> entityType, String entityId) {
    createdEntityTypeToEntityId.put(entityType, entityId);
  }

  private synchronized void registerMutatedEntityId(BadgerEntityDescriptor<? extends Message> entityType, String entityId) {
    mutatedEntityTypeToEntityId.put(entityType, entityId);
  }

  private synchronized void registerArchivedEntityId(BadgerEntityDescriptor<? extends Message> entityType, String entityId) {
    archivedEntityTypeToEntityId.put(entityType, entityId);
  }

  private synchronized ImmutableList<BadgerValidateError> validateIncludingForeignIds() {
    ImmutableList.Builder<BadgerValidateError> builder = ImmutableList.builder();
    validateIncludingForeignIds(builder, getById(createdEntityTypeToEntityId));
    validateIncludingForeignIds(builder, getById(mutatedEntityTypeToEntityId));
    for (BadgerEntityDescriptor<? extends Message> entityType : archivedEntityTypeToEntityId.keySet()) {
      validateNoEntitiesHaveForeignEntityIds(builder, entityType, archivedEntityTypeToEntityId.get(entityType));
    }
    return builder.build();
  }

  private void validateIncludingForeignIds(
      ImmutableList.Builder<BadgerValidateError> builder, List<BadgerEntity<? extends Message>> badgerEntities) {
    validateWithoutForeignIds(builder, badgerEntities);
    validateForeignIdsExist(builder, badgerEntities);
    validateUniqueFields(builder, badgerEntities);
  }

  private List<BadgerEntity<? extends Message>> getById(Multimap<BadgerEntityDescriptor<? extends Message>, String> entityTypeToEntityId) {
    ImmutableList.Builder<BadgerEntity<? extends Message>> builder = ImmutableList.builder();
    entityTypeToEntityId.keySet().forEach(entityType ->
      get(entityType, entityTypeToEntityId.get(entityType).stream().collect(Collectors.toList())).forEach(builder::add)
    );
    return builder.build();
  }

  private void validateWithoutForeignIds(ImmutableList.Builder<BadgerValidateError> builder,
                                         List<BadgerEntity<? extends Message>> badgerEntities) {
    badgerEntities.stream().map(BadgerEntity::validate).forEach(builder::addAll);
  }

  private void validateForeignIdsExist(ImmutableList.Builder<BadgerValidateError> builder,
                                       List<BadgerEntity<? extends Message>> badgerEntities) {
    Multimap<BadgerEntityDescriptor<? extends Message>, String> entityTypeToEntityIds = HashMultimap.create();
    badgerEntities.stream().map(badgerEntity -> badgerEntity.getBadgerTagToValue()).forEach(map ->
            map.forEach((key, value) -> {
                  BadgerTagDescriptor badgerTagDescriptor = key.getBadgerTagDescriptor();
                  if (badgerTagDescriptor.getTagType() == TagType.STRING) {
                    BadgerEntityDescriptor<? extends Message> foreignIdBadgerEntityDescriptor
                        = badgerTagDescriptor.getForeignIdBadgerEntityDescriptor();
                    if (foreignIdBadgerEntityDescriptor != null) {
                      entityTypeToEntityIds.put(foreignIdBadgerEntityDescriptor, (String) value);
                    }
                  }
                }
            )
    );

    for (BadgerEntityDescriptor<?> entityType : entityTypeToEntityIds.keySet()) {
      List<String> entityIds = ImmutableList.copyOf(entityTypeToEntityIds.get(entityType));
      List<Boolean> exists = getExists(entityType, entityIds);
      Preconditions.checkArgument(entityIds.size() == exists.size());
      for (int i = 0; i < exists.size(); i++) {
        if (!exists.get(i)) {
          builder.add(new BadgerValidateError(entityType, BadgerValidateError.Reason.ENTITY_ID_DOES_NOT_EXIST, entityIds.get(i)));
        }
      }
    }
  }

  private void validateUniqueFields(ImmutableList.Builder<BadgerValidateError> builder,
                                    List<BadgerEntity<? extends Message>> badgerEntities) {
    badgerEntities.forEach(badgerEntity -> {
      badgerEntity.getBadgerMessageDescriptor().getUniqueTags().forEach(badgerTag -> {
            Object value = badgerEntity.getValue(badgerTag);
            if (value != null) {
              List<String> entityIds = getIdsForValues(
                  badgerEntity.getBadgerMessageDescriptor(), badgerTag.getBadgerTagDescriptor(), ImmutableSet.of(value));
              if (entityIds.size() > 1) {
                builder.add(new BadgerValidateError(
                    badgerEntity.getBadgerMessageDescriptor(), BadgerValidateError.Reason.NON_UNIQUE_FIELD,
                    badgerEntity.getId(), badgerTag.getBadgerTagDescriptor().getBadgerPartialTagDescriptor(), value));
              }
            }
          }
      );
    });
  }

  private void validateNoEntitiesHaveForeignEntityIds(ImmutableList.Builder<BadgerValidateError> builder,
                                                      BadgerEntityDescriptor<? extends Message> foreignIdEntityType,
                                                      Collection<String> entityIds) {
    ImmutableMultimap<BadgerEntityDescriptor<? extends Message>, BadgerTagDescriptor> badgerEntityDescriptorToBadgerTagDescriptors
        = badgerCore.getBadgerEntityDescriptorToBadgerTagDescriptors(foreignIdEntityType);
    if (badgerEntityDescriptorToBadgerTagDescriptors != null) {
      for (BadgerEntityDescriptor<? extends Message> badgerEntityDescriptor : badgerEntityDescriptorToBadgerTagDescriptors.keySet()) {
        for (BadgerTagDescriptor badgerTagDescriptor : badgerEntityDescriptorToBadgerTagDescriptors.get(badgerEntityDescriptor)) {
          List<BadgerEntity<Message>> referencedEntities = getForValues(
              (BadgerEntityDescriptor<Message>) badgerEntityDescriptor,
              badgerTagDescriptor,
              ImmutableSet.copyOf(entityIds)
          );
          if (!referencedEntities.isEmpty()) {
            // TODO(pedge): we want to find the specific entity id that is not referenced so we do this,
            // but there should be a way to do this without more database calls (NOT NEEDED FOR RELEASE)
            entityIds.forEach(entityId -> {
              List<BadgerEntity<Message>> iReferencedEntities = getForValues(
                  (BadgerEntityDescriptor<Message>) badgerEntityDescriptor,
                  badgerTagDescriptor,
                  ImmutableSet.of(entityId)
              );
              if (!iReferencedEntities.isEmpty()) {
                // TODO(pedge): with the referencing entity (NOT NEEDED FOR RELEASE)
                builder.add(new BadgerValidateError(
                    badgerEntityDescriptor, BadgerValidateError.Reason.ARCHIVED_ENTITY_ID_STILL_REFERENCED, entityId));
              }
            });
          }
        }
      }
    }
  }

  private void handleTemporaryIds(
      BadgerEntity<? extends Message> badgerEntity,
      Map<BadgerTag, Object> mergeMap,
      @Nullable String temporaryId
  ) {
    badgerEntity.getBadgerTagToValue().forEach((badgerTag, value) -> {
          BadgerTagDescriptor badgerTagDescriptor = badgerTag.getBadgerTagDescriptor();
          if (badgerTagDescriptor.getTagType() == TagType.STRING) {
            BadgerEntityDescriptor<? extends Message> foreignIdBadgerEntityDescriptor
                = badgerTagDescriptor.getForeignIdBadgerEntityDescriptor();
            if (foreignIdBadgerEntityDescriptor != null) {
              String foreignId = (String) value;
              if (temporaryId != null && foreignId.equals(temporaryId)) {
                throw new IllegalArgumentException("Cannot use a temporary id on the same object");
              }
              String unmappedForeignId = getIdForTemporaryId(foreignId);
              if (unmappedForeignId != null) {
                mergeMap.put(badgerTag, unmappedForeignId);
              }
            }
          }
        }
    );
  }

  private Set<BadgerMergeOperation> handleTemporaryIds(
      BadgerEntity<? extends Message> badgerEntity,
      @Nullable String temporaryId
  ) {
    Set<BadgerMergeOperation> set = new HashSet<>();
    badgerEntity.getBadgerTagToValue().forEach((badgerTag, value) -> {
      BadgerTagDescriptor badgerTagDescriptor = badgerTag.getBadgerTagDescriptor();
      if (badgerTagDescriptor.getTagType() == TagType.STRING) {
        BadgerEntityDescriptor<? extends Message> foreignIdBadgerEntityDescriptor
            = badgerTagDescriptor.getForeignIdBadgerEntityDescriptor();
        if (foreignIdBadgerEntityDescriptor != null) {
          String foreignId = (String) value;
          if (temporaryId != null && foreignId.equals(temporaryId)) {
            throw new IllegalArgumentException("Cannot use a temporary id on the same object");
          }
          String unmappedForeignId = getIdForTemporaryId(foreignId);
          if (unmappedForeignId != null) {
            if (badgerTagDescriptor.isRepeated()) {
              set.add(
                  new BadgerMergeOperation(
                      BadgerMutateTag.repeated(
                          badgerTagDescriptor.getBadgerPartialTagDescriptor(),
                          BadgerMutateTag.RepeatedTagOperation.REMOVE
                      ),
                      foreignId
                  )
              );
              set.add(
                  new BadgerMergeOperation(
                      BadgerMutateTag.repeated(
                          badgerTagDescriptor.getBadgerPartialTagDescriptor(),
                          BadgerMutateTag.RepeatedTagOperation.ADD
                      ),
                      unmappedForeignId
                  )
              );
            } else {
              set.add(
                  new BadgerMergeOperation(
                      BadgerMutateTag.optional(
                          badgerTagDescriptor.getBadgerPartialTagDescriptor()
                      ),
                      unmappedForeignId
                  )
              );
            }
          }
        }
      }
    });
    return set;
  }

  private static String createUUID() {
    return new UUID().toString();
  }

  private static long getUnixTimeUsec() {
    return System.currentTimeMillis() * 1000L;
  }
}


text:
package com.zheng.shop.dao.mapper;

import com.zheng.shop.dao.model.ShopProductAttributeMapStore;
import com.zheng.shop.dao.model.ShopProductAttributeMapStoreExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface ShopProductAttributeMapStoreMapper {
    long countByExample(ShopProductAttributeMapStoreExample example);

    int deleteByExample(ShopProductAttributeMapStoreExample example);

    int deleteByPrimaryKey(@Param("productId") String productId, @Param("mapkeyId") String mapkeyId);

    int insert(ShopProductAttributeMapStore record);

    int insertSelective(ShopProductAttributeMapStore record);

    List<ShopProductAttributeMapStore> selectByExample(ShopProductAttributeMapStoreExample example);

    ShopProductAttributeMapStore selectByPrimaryKey(@Param("productId") String productId, @Param("mapkeyId") String mapkeyId);

    int updateByExampleSelective(@Param("record") ShopProductAttributeMapStore record, @Param("example") ShopProductAttributeMapStoreExample example);

    int updateByExample(@Param("record") ShopProductAttributeMapStore record, @Param("example") ShopProductAttributeMapStoreExample example);

    int updateByPrimaryKeySelective(ShopProductAttributeMapStore record);

    int updateByPrimaryKey(ShopProductAttributeMapStore record);
}


text:
// Code generated by protoc-gen-go.
// source: coco_interference_scores.proto
// DO NOT EDIT!

/*
Package firmament is a generated protocol buffer package.

It is generated from these files:
	coco_interference_scores.proto
	firmament_scheduler.proto
	job_desc.proto
	label.proto
	label_selector.proto
	machine_perf_statistics_sample.proto
	reference_desc.proto
	resource_desc.proto
	resource_topology_node_desc.proto
	resource_vector.proto
	scheduling_delta.proto
	task_desc.proto
	task_final_report.proto
	task_perf_statistics_sample.proto
	task_stats.proto
	whare_map_stats.proto

It has these top-level messages:
	CoCoInterferenceScores
	ScheduleRequest
	SchedulingDeltas
	TaskCompletedResponse
	TaskDescription
	TaskSubmittedResponse
	TaskRemovedResponse
	TaskFailedResponse
	TaskUpdatedResponse
	NodeAddedResponse
	NodeRemovedResponse
	NodeFailedResponse
	NodeUpdatedResponse
	TaskStatsResponse
	ResourceStatsResponse
	TaskUID
	ResourceUID
	ResourceStats
	JobDescriptor
	Label
	LabelSelector
	MachinePerfStatisticsSample
	CpuUsage
	ReferenceDescriptor
	ResourceDescriptor
	ResourceTopologyNodeDescriptor
	ResourceVector
	SchedulingDelta
	TaskDescriptor
	TaskFinalReport
	TaskPerfStatisticsSample
	TaskStats
	WhareMapStats
*/
package firmament

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package

type CoCoInterferenceScores struct {
	DevilPenalty  uint32 `protobuf:"varint,1,opt,name=devil_penalty,json=devilPenalty" json:"devil_penalty,omitempty"`
	RabbitPenalty uint32 `protobuf:"varint,2,opt,name=rabbit_penalty,json=rabbitPenalty" json:"rabbit_penalty,omitempty"`
	SheepPenalty  uint32 `protobuf:"varint,3,opt,name=sheep_penalty,json=sheepPenalty" json:"sheep_penalty,omitempty"`
	TurtlePenalty uint32 `protobuf:"varint,4,opt,name=turtle_penalty,json=turtlePenalty" json:"turtle_penalty,omitempty"`
}

func (m *CoCoInterferenceScores) Reset()                    { *m = CoCoInterferenceScores{} }
func (m *CoCoInterferenceScores) String() string            { return proto.CompactTextString(m) }
func (*CoCoInterferenceScores) ProtoMessage()               {}
func (*CoCoInterferenceScores) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }

func (m *CoCoInterferenceScores) GetDevilPenalty() uint32 {
	if m != nil {
		return m.DevilPenalty
	}
	return 0
}

func (m *CoCoInterferenceScores) GetRabbitPenalty() uint32 {
	if m != nil {
		return m.RabbitPenalty
	}
	return 0
}

func (m *CoCoInterferenceScores) GetSheepPenalty() uint32 {
	if m != nil {
		return m.SheepPenalty
	}
	return 0
}

func (m *CoCoInterferenceScores) GetTurtlePenalty() uint32 {
	if m != nil {
		return m.TurtlePenalty
	}
	return 0
}

func init() {
	proto.RegisterType((*CoCoInterferenceScores)(nil), "firmament.CoCoInterferenceScores")
}

func init() { proto.RegisterFile("coco_interference_scores.proto", fileDescriptor0) }

var fileDescriptor0 = []byte{
	// 169 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0x92, 0x4b, 0xce, 0x4f, 0xce,
	0x8f, 0xcf, 0xcc, 0x2b, 0x49, 0x2d, 0x4a, 0x4b, 0x2d, 0x4a, 0xcd, 0x4b, 0x4e, 0x8d, 0x2f, 0x4e,
	0xce, 0x2f, 0x4a, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x4c, 0xcb, 0x2c, 0xca,
	0x4d, 0xcc, 0x4d, 0xcd, 0x2b, 0x51, 0xda, 0xc0, 0xc8, 0x25, 0xe6, 0x9c, 0xef, 0x9c, 0xef, 0x89,
	0xa4, 0x38, 0x18, 0xac, 0x56, 0x48, 0x99, 0x8b, 0x37, 0x25, 0xb5, 0x2c, 0x33, 0x27, 0xbe, 0x20,
	0x35, 0x2f, 0x31, 0xa7, 0xa4, 0x52, 0x82, 0x51, 0x81, 0x51, 0x83, 0x37, 0x88, 0x07, 0x2c, 0x18,
	0x00, 0x11, 0x13, 0x52, 0xe5, 0xe2, 0x2b, 0x4a, 0x4c, 0x4a, 0xca, 0x2c, 0x81, 0xab, 0x62, 0x02,
	0xab, 0xe2, 0x85, 0x88, 0xc2, 0x94, 0x29, 0x73, 0xf1, 0x16, 0x67, 0xa4, 0xa6, 0x16, 0xc0, 0x55,
	0x31, 0x43, 0xcc, 0x02, 0x0b, 0x22, 0x99, 0x55, 0x52, 0x5a, 0x54, 0x92, 0x93, 0x0a, 0x57, 0xc5,
	0x02, 0x31, 0x0b, 0x22, 0x0a, 0x55, 0x96, 0xc4, 0x06, 0xf6, 0x84, 0x31, 0x20, 0x00, 0x00, 0xff,
	0xff, 0xce, 0x84, 0x0e, 0x21, 0xe6, 0x00, 0x00, 0x00,
}


text:
layout: post
title: You're up and running!
---

![_config.yml]({{ site.baseurl }}/images/config.png)

The easiest way to make your first post is to edit this one. Go into /_posts/ and update the Hello World markdown file. For more instructions head over to the [Jekyll Now repository](https://github.com/barryclark/jekyll-now) on GitHub.

Does editing the file in the Hello-World.md file work?
This is the 2nd post


text:
/*
* XUI
* ===
*
* A simple javascript framework for building mobile web applications.
* ---
*
* ### WHY?!
*
* We hear your words. _Why another JavaScript framework?!_ When development of PhoneGap was under way we noticed slow
* load times for modern JavaScript frameworks (such as Prototype, MooTools, YUI, Ext and (yes) even jQuery.
* A big reason why these libraries are so big is because  is mostly they contain a great deal of cross browser
* compatability code. The mobile space has less browser implementations (so far) and different needs. Thus XUI.
*
* XUI strives to be a framework for first class mobile device browsers such as WebKit, Fennec and Opera with future
* support under consideration for IE Mobile and BlackBerry.
*
* ### Authors
*
* - Rob Ellis
* - Brock Whitten
* - Brian LeRoux
*
* ### Download
*
* Minified code is less than 6k! _official builds coming soonish - Brian Jan 6, 2009_
*
* ### Contribute
*
* Clone the source from GitHub:
*
* 	git clone git://github.com/brianleroux/xui.git
*
* To build xui: run _rake_ in the shell of your choice from the root of the project directory. (This requires Ruby.)
* There are other tasks for code minification, running the specs and generating docs. Run `rake -T` to see them all.
*
* Check out the _example_ directory for a comprehensive example application. Specs are in the _spec_ directory.
*
* API Documentation
* ===
*
* Welcome the XUI documentation. This is generated from inline documentation in the xui javascript source.
*
*
*
* Basics
* ---
*
* XUI is available to the entire document as x$. It is a function, that accepts a query selector. The syntax is
* mostly chainable and should be familiar to anyone who has worked with jQuery.
*
* 	x$('a.navigation').css({ background:'blue' });
*
* The query selection engine is based on the browser implementation of querySelectorAll so its fast. Real fast.
* XUI allows for a single expression, an element or an array of elements to be passed
*
* 	x$(window);
*
*
*/
(function() {
	var _$ = function(els) {
		return this.find(els);
	};

	_$.prototype = {

		elements:[],

		find: function(q) {
			this.elements = []; // should it behave like this?

			var qlen = q.length;
			for(var i = 0; i < qlen; i++ ) {
				if( typeof q[i] == 'string' ) {
					var list = document.querySelectorAll(q[i]);
					var size = list.length;

					for(var j = 0; j < size; j++ ) {
						this.elements.push(list[j]);
					}
				} else {
					this.elements.push(q[i]);
				}

			};
			return this;
		},

		first: function() {
			return this.elements[0];
		},

	  	each: function(fn) {
			for( var i = 0, len = this.elements.length; i<len; ++i ) {
				fn.call(this,this.elements[i]);
			}
			return this;
		},

		// merges sub lib objects
		extend: function( libObj ) {
			for(var x in libObj) {
				this[x] = libObj[x];
			}
		}
	};

	// adds the xui system as x$ to the current window
	var xui = window.x$ = function() {

		/**
		*
		* Dom
		* ---
		*
		* Manipulating the document object model (DOM).
		*
		*/
		var Dom = {

			/**
			*
			* ### html
			*
			* Adds elements or changes the content of an element on a page.
			*
			* syntax:
			*
			* 	x$(window).html( location, htmlFragment );
			*
			* or..
			*
			* 	x$(window).html( htmlFragment );
			*
			* arguments:
			*
			* - location:string can be one of inner, outer, top, bottom
			* - htmlFragment:string any string of html markup
			*
			* example:
			*
			*  	x$('#foo').html( 'inner',  htmlFragment );
			*  	x$('#foo').html( 'outer',  htmlFragment );
			* 	x$('#foo').html( 'top',    htmlFragment );
			*  	x$('#foo').html( 'bottom', htmlFragment );
			*  	x$('#foo').html( 'remove' );
			*
			* or
			*
			* 	x$('#foo').html('
sweet as honey
');
			*
			*/

		    html:function(location, html) {

				// private method for finding a dom element
				var getTag = function(el) {

					if (el.firstChild == null) {
						switch(el.tagName) {
							case 'UL': return 'LI'; break;
							case 'DL': return 'DT'; break;
							case 'TR': return 'TD'; break;
							default: return el.tagName;
						}
					}
					return el.firstChild.tagName;
				};

				// private method
			    // Wraps the HTML in a TAG, Tag is optional
			    // If the html starts with a Tag, it will wrap the context in that tag.
			    var wrap = function(xhtml,tag) {
			        var attributes = {};
			        var re = /^<([A-Z][A-Z0-9]*)(.*)[^>]*>(.*?)<\/\1>/i;
			        if(re.test(xhtml)) {
			            result = re.exec(xhtml);

			            tag = result[1];

			            // if the node has any attributes, convert to object
			            if (result[2] != "") {

							var attre = /([a-zA-Z]*\s*=\s*['|"][a-zA-Z0-9:;#\s]*['|"])/;
			                var attrList = result[2].split(attre);

			                for(var i=0;i<attrList.length;i++){
			                    if (attrList[i] != "" && attrList[i] != " ") {
			                        var node = attrList[i].split('=');
			                        attributes[node[0]];
			                        attributes[node[0]] = node[1].replace(/(["']?)/g,'');
			                    }
			                }
			            }
			            xhtml = result[3];
			        }

			        var element = document.createElement(tag);
			        element.innerHTML = xhtml;
			        for (var i in attributes) {
			            var a = document.createAttribute(i);
			            a.nodeValue = attributes[i];
			            element.setAttributeNode(a);
			        }

			        return element;
			    };

				this.clean();

				if (arguments.length == 1 && arguments[0] != 'remove') {
					html = location;
					location = 'inner';
				}

		        this.each(function(el) {
		            switch(location) {
		                case "inner":
							if (typeof html == 'string') {
								el.innerHTML = html;
							} else {
								el.innerHTML = '';
								el.appendChild(html);
							}
							break;
		                case "outer":
		                    if (typeof html == 'string') html = wrap(html, getTag(el));
		                    el.parentNode.replaceChild(html,el);
		                break;
		                case "top":
		                    if (typeof html == 'string') html = wrap(html, getTag(el));
		                    el.insertBefore(html,el.firstChild);
		                break;
		                case "bottom":
		                    if (typeof html == 'string') html = wrap(html, getTag(el));
		                    el.insertBefore(html,null);
		                break;
						case "remove":
							var parent = el.parentNode;
							parent.removeChild(el);
						break;
		            }
		      	});
		        return this;
		    },

			// This is needed el.node will return something useless without it.
			clean:  function() {
		  		var ns = /\S/;
		 		this.each(function(el) {
					var d = el, n = d.firstChild, ni = -1;
					while(n) {
			 	  		var nx = n.nextSibling;
				 	    if (n.nodeType == 3 && !ns.test(n.nodeValue)) {
				 	    	d.removeChild(n);
				 	    } else {
				 	    	n.nodeIndex = ++ni;
				 	    }
				 	    n = nx;
				 	}
				});
		 	  return this;
		 	}
		};

		/**
		*
		* Event
		* ---
		*
		* A good old fashioned event handling system.
		*
		*/
		var Event = {

			eventfunctions : [],

			click: 		   		function(fn) { return this.on('click',fn); },
			load: 		   		function(fn) { return this.on('load',fn); },
			touchstart:    		function(fn) { return this.on('touchstart',fn); },
			touchmove: 	   		function(fn) { return this.on('touchmove',fn); },
			touchend: 	   		function(fn) { return this.on('touchend',fn); },
			touchcancel:   		function(fn) { return this.on('touchcancel',fn); },
			gesturestart:  		function(fn) { return this.on('gesturestart',fn); },
		  	gesturechange: 		function(fn) { return this.on('gesturechange',fn); },
		  	gestureend:    		function(fn) { return this.on('gestureend',fn); },
			orientationchange: 	function(fn) { return this.on('orientationchange',fn); },
			/**
			*
			* ### on
			*
			* Registers a callback function to a DOM event on the element collection.
			*
			* This method has shortcut aliases for:
			*
			* - click
			* - load
			* - touchstart
			* - touchmove
			* - touchend
			* - touchcancel
			* - gesturestart
			* - gesturechange
			* - gestureend
			* - orientationchange
			*
			* For more information see:
			*
			* - http://developer.apple.com/webapps/docs/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/chapter_7_section_1.html#//apple_ref/doc/uid/TP40006511-SW1
			*
			* syntax:
			*
			* 	x$('button').on( 'click', function(){ alert('hey that tickles!') });
			*
			* arguments:
			*
			* - type:string the event to subscribe to click|load|etc
			* - fn:function a callback function to execute when the event is fired
			*
			* example:
			*
			* 	x$(window).load(function(e){
			* 		x$('.save').touchstart( function(evt){ alert('tee hee!') });
			*  	});
			*
			*/
			on: function(type, fn) {
			    var listen = function(el) {
			        if (window.addEventListener) {
			            el.addEventListener(type, fn, false);
			        }
			    };
			    this.each(function(el) {
			        listen(el);
			    });
			    return this;
			}
		};

		/**
		*
		* Style
		* ---
		*
		* Anything related to how things look. Usually, this is CSS.
		*
		*/
		var Style = {

			/**
			*
			* ### setStyle
			*
			* syntax:
			*
			* 	x$(selector).setStyle(property, value);
			*
			* arguments:
			*
			* - property:string the property to modify
			* - value:string the property value to set
			*
			* example:
			*
			* 	x$('.txt').setStyle('color', '#000');
			*
			*/
			setStyle: function(prop, val) {
		      this.each(function(el) {
		        el.style[prop] = val;
		      });
			  return this;
			},

			/**
			*
			* ### getStyle
			*
			* syntax:
			*
			* 	x$(selector).getStyle(property, callback);
			*
			* arguments:
			*
			* - property:string a css key (for example, border-color NOT borderColor)
			* - callback:function (optional) a method to call on each element in the collection
			*
			* example:
			*
			*	x$('ul#nav li.trunk').getStyle('font-size');
			*
			* 	x$('a.globalnav').getStyle( 'background', function(prop){ prop == 'blue' ? 'green' : 'blue' });
			*
			*/
			getStyle: function(prop, callback) {

				var gs = function (el,p) {
					return document.defaultView.getComputedStyle(el , "").getPropertyValue(p);
				}

				if(callback == undefined)
					return gs(this.first(),prop);

		   		this.each( function(el) {
					callback(gs(el,prop));
		   		});
			  	return this;
			},

			/**
			*
			* ### addClass
			*
			* syntax:
			*
			* 	$(selector).addClass(className);
			*
			* arguments:
			*
			* - className:string the name of the CSS class to apply
			*
			* example:
			*
			* 	$('.foo').addClass('awesome');
			*
			*/
			addClass: function(className) {
				var that = this;
				var hasClass = function(el,className) { var re = that.getClassRegEx(className); return re.test(el.className); }

				this.each(function(el) {
					if (hasClass(el,className)==false)
						el.className += ' '+className;
				});
				return this;
			},

			/**
			*
			* ### removeClass
			*
			* syntax:
			*
			* 	x$(selector).removeClass(className);
			*
			* arguments:
			*
			* - className:string the name of the CSS class to remove.
			*
			* example:
			*
			* 	x$('.awesome').removeClass('awesome');
			*
			*/
			removeClass:function(className) {
			    var re = this.getClassRegEx(className);
			    this.each(function(el) {
			        el.className = el.className.replace(re, ' ');
			    });
			    return this;
			},

			/**
			*
			* ### css
			*
			* syntax:
			*
			* 	x$(selector).css(object);
			*
			* arguments:
			*
			* - an object literal of css key/value pairs to set/modify style on.
			*
			* example:
			*
			* 	x$('#box5').css({ backgroundColor:'blue', width:'100px', border:'2px solid red' });
			*
			*/
			css: function(o) {
				var that = this;
				this.each(function(el) {
					for (var prop in o) {
						that.setStyle(prop, o[prop]);
					}
				});
				return this || that;
			},

			// -- private methods -- //

			reClassNameCache: {},

			getClassRegEx: function(className) {
			    var re = this.reClassNameCache[className];
			    if (!re) {
			        re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');
			        this.reClassNameCache[className] = re;
			    }
			    return re;
			}

			//toggleClass:function(className) {
			//    var that = this;
			//    this.each(function(el) {
			//        (this.hasClass(el,className)==true)? this.removeClass(className) : this.addClass(className);
			//      });
			//    return this;
			//},
			//
			//position: function () {
			//	this.each(function(el){
			//    	var topValue= 0,leftValue= 0;
			//        var obj = el;
			//        while(obj) {
			//            leftValue += obj.offsetLeft;
			//            topValue  += obj.offsetTop;
			//            obj 	  =  obj.offsetParent;
			//        }
			//        el.leftPos = leftValue;
			//        el.topPos = topValue;
			// 	});
			//   	return this;
			//}

		};

		/**
		*
		* Fx
		* ---
		*
		* Animations mostly but we're not excluding any ideas.
		*
		*/
		var Fx = {

			/**
			*
			* ### tween
			*
			* syntax:
			*
			* 	x$('#box').tween({ left:100px, backgroundColor:'blue' });
			*
			* 	x$('#box').tween([{ left:100px, backgroundColor:'green', duration:.2 }, { right:100px }]);
			*
			* 	x$('#box').tween({ left:100px}).tween({ left:100px });
			*
			* arguments:
			*
			* properties:object an object literal of element properties to tween.
			*
			* _or_
			*
			* queue:array an array literal of objects which contain properties to tween sequentially.
			*
			* example:
			*
			*/
			tween: function( options ) {
			    if (options instanceof Array) {
			        for(var i=0;i<options.length;i++) {
			            this.animationStack.push(options[i]);
			        }
			    } else if (options instanceof Object) {
			        this.animationStack.push(options);
			    }

			    this.start();
			    return this;
			},

			// -- private -- //

			// TODO should this be private __animationStack?
			animationStack: [],

			start:function() {
			    var t = 0;
			    for (var i = 0; i< this.animationStack.length;i++) {
			        var options = this.animationStack[i];
			        var duration     = options.duration == undefined ? .5    : options.duration;
			        setTimeout(function(s,o){s.animate(o);},t*1000*duration,this,options);
			        t += duration;
			    }

			    return this;
			},

			animate: function(options) {
			    var that = this;

			    var opt_after = options.after;

			    var easing = (options.easing == undefined) ? 'ease-in' : options.easing;
			    var before = (options.before == undefined) ? function(){} : options.before;
			    var after = (opt_after == undefined) ? function(){} : function() {  opt_after.apply(that); };
			    var duration = (options.duration == undefined) ? .5 : options.duration;

					var translate = options.by;
					var rotate = options.rotate;

			    options.easing = options.rotate = options.by = options.before = options.after = options.duration = undefined;
			    before.apply(before.arguments);

			    // this sets duration and easing equation on a style property change
			    this.setStyle( '-webkit-transition', 'all ' + duration + 's ' + easing );

			    // sets the starting point and ending point for each css property tween
			    this.each( function(el) {
			        for( var prop in options ) {
			            that.setStyle( prop, options[prop] )
			        }
			 				if (translate) {
								that.setStyle('-webkit-transform', that.translateOp(translate[0],translate[1]));
							}

							// if (rotate) {
							// 	for(var x in rotate) {
							// 		that.setStyle('-webkit-transform', that.rotateOp(x,rotate[x]));
							// 	}
							// }

			    });

			    setTimeout(function(){ that.setStyle('-webkit-transition','none');},duration*1000)
			    setTimeout(function(){ that.setStyle('-webkit-transform','none');},duration*1000)
			    setTimeout(after,duration*1000);

			    return this || that; // haha
			},

			translateOp: function(xPixels, yPixels) {
			    return 'translate(' + xPixels + 'px, ' + yPixels + 'px)';
			},

			rotateOp: function(axis, degree){
			    return 'rotate' + axis + '(' + degree + 'deg)';
			}

		};

		/**
		*
		* Xhr
		* ---
		*
		* Remoting methods and ultilites.
		*
		*/
		var Xhr = {

			/**
			* ### xhr
			*
			* syntax:
			*
			* `xhr('path/to/file.html', {});`
			*
			* arguments:
			*
			* url:string the url for request
			*
			* options:object
			*
			* - method:string get|put|delete|post default get
			* - async:boolen default false
			* - data:string url encoded string of parameters to send
			* - callback:function to call on 200 status
			*
			* - Returns responseText back
			* example:
			*
			*/
		    xhr:function(url,options) {

		        if (options == undefined) var options = {};

		    	var that   = this;
		    	var req    = new XMLHttpRequest();
		        var method = options.method || 'GET';
		        var async  = options.async || false ;
		        var params = options.data || null;
		        req.open(method,url,async);
		        req.onload = (options.callback != null) ? options.callback : function() { that.html(this.responseText); }
		        req.send(params);

		      	return this;
		    },

			xhrmap: function(url,opt) {
				var that = this;
				var options = {

					callback:function(){
						var self = that;
						var js = eval('(' + this.responseText + ')');

						that.xhr(opt.partial,{
							callback:function() {

								var part = this.responseText;

								var createDefaultsElement = function(html) {
									var extn = html.split('.').pop();
									var valid = ['jpg','jpeg','png','gif'];
									for( var i = 0; i < valid.length; i++ ) {
										if( valid[i] == extn ) {
											var img = new Image();
											img.src = html;
											return img;
										}
									}
									return html;
								}

								// xui-app-tmp
								x$('BODY').html('top','
HERE
');
								x$('#xui-app-tmp').html(part);

								var len = js.length;
								// first we loop thru the json array
								for( var i = 0; i < len; i++ ) {

									// then we loop thru our partial map
									for (var j in opt.partialMap) {
										var nodeKey = j;
										var selector = opt.partialMap[j];
										var val = jsonPath(js[i],'$.'+nodeKey)[0];
										x$('#template ' + selector).html(createDefaultsElement(val));
									}
									// clone partial here....
									var temp = x$('#'+ class +' .tweet').first();
									var dup = temp.cloneNode(true);
									x$("#tweets").html('bottom',dup);

								}

							}
						});

					}
				 }

		        this.xhr(url,options);

				return this;
			},
			/**
			* ### xhrjson
			*
			* syntax:
			*
			* `xhr('path/to/file.html', {});`
			*
			* arguments:
			*
			* url:string the url for request
			*
			* options:object (Options is the same as XHR with map:object and new callback:function)
			*
			* - method:string get|put|delete|post default get
			* - async:boolen default false
			* - data:string url encoded string of parameters to send
			* - map:object {'dom selector':'json key'}
			* - callback:function - this function is applied to each json value
			*
			*/
		    xhrjson:function(url,options) {
		        if (options == undefined) return this;
		        var that = this;

		        var cb = options.callback;
		        if (typeof cb != 'function') { var cb = function(x) {return x; }}

		        var callback = function() {
		            var o = eval('(' + this.responseText + ')');
		            for (var prop in o) { x$(options.map[prop]).html( cb(o[prop]) ); }
		        }
		        options.callback = callback;
		        this.xhr(url,options);
		        return this;
		    },

		    xhrForm: function() {
		        var that = this;
		      // ideally I would like to return the first form staring at this element selector
		      this.each(function(e) {
		            if (e.tagName == "FORM") {
		                var options = {};
		                options.method = e.method;
		                options.data = "one=two";

		                that.xhr(e.action,options);
		            }
		        });
		        return this;
		    }
		};

		var libs = [Dom,Event,Style,Fx,Xhr];
		var size = libs.length;
		var that = new _$(arguments);

		for( var i = 0; i < size; i++ ) {
			that.extend( libs[i] );
		}

		return that;
	}

})();

/*
* TODO
* ---
*
* - look into lib loading / extend method buggyness
* - more tests!!!
* - get jslint passing
* - better docs (generate side by side code like ubiquity)
* - inspect and generate example from markdown
* - generators
* - canvas progressive enhancement
* - prop should be JS property, not CSS property
*
* Changelog
* ---
*
* _jab 21, 2009_
*
* - fixed DOM
* - added remove
*
* _Jan 18, 2009_
*
* - more documentation for core, etc
* - after cat getting out of the bag on ajaxian we're working furiously to get this production ready
*
* _Jan 13, 2009_
*
* - merged robs fixes and cleanup
*
* _Jan 11, 2009_
*
* - added mobile safari events (these will need testing in android, etc)
* - cleaned up Dom.html and documented
* - documented event a little
*
* _Jan 10, 2009_
*
* - removed Dom.clean for now
* - made Dom.getTag and Dom.wrap private
* - documented Dom
* - more Dom tests
*
* _Jan 9, 2009_
*
* - more docs for xui core, xhr, style and fx
*
* _Jan 7, 2009_
*
* - style spec passing
* - xui app phase one
* - testing approch resolved
* - hasClass now private
*
* _Jan 6, 2009_
*
* - rock out with renewed authority
* - better docs we promise
* - create doc/index.html from markdown
*
* LICENSE
* ---
*
* _Copyright (c) 2008 Brian LeRoux, Brock Whitten, Rob Ellis_
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/


text:
var AngularJSHomePage = (function () {

    function AngularJSHomePage() {

        this.yourNameIn = element(by.model('yourName'));
        this.yourNameOut = element(by.binding('yourName'));
    }

    AngularJSHomePage.prototype.setYourName = function (Name) {
        this.yourNameIn.clear();
        this.yourNameIn.sendKeys(Name);
    };

    AngularJSHomePage.prototype.getYourName = function () {
        return this.yourNameOut.getText();
    };

    return AngularJSHomePage;

})();

module.exports = AngularJSHomePage;


text:
import keras
from keras.applications import VGG16
from keras.models import Model
from ReadCOCOUtil import *
from os import path, mkdir
import shutil

def getModel(nb_remove_layers=1):
    '''
    Function creates vgg16 model without final classification layer

    Arguments
    =================
    nb_remove_layers - number of layers to remove from vgg16

    Returns
    =================
    model - vgg16 model with 'nb_remove_layers' layers removed.
    '''
    # Read in vgg16 model
    vgg_model = VGG16( weights='imagenet', include_top=True )
    out_layer = vgg_model.layers[-(nb_remove_layers + 1)]
    vgg_out = out_layer.output #Last FC layer's output
    #Freeze all layers of vgg model
    for layer in vgg_model.layers:
        layer.trainable = False

    #Add a flatten layer if not fc layer to get correct dimensionality
    if 'Dense' not in type(out_layer).__name__:
        vgg_out = Flatten()(vgg_out)

    #Create new model that only goes up to penultimate layer of vgg16
    model = Model( input=vgg_model.input, output=vgg_out )

    return model

def fwdprop_save(cocoutil, train_val, output_dir):
    if train_val is 'train':
        nbImgs = cocoutil.nbTrain
    elif train_val is 'val':
        nbImgs = cocoutil.nbVal
    # Iterate through training
    n = 0
    batchsz = 1000
    print(train_val + ' Output Dir = ' + output_dir)
    while n < nbImgs:
        print(train_val + ':\t' + str(n) + '/' + str(nbImgs))
        # Read in data
        if train_val is 'train':
            data = cocoutil.getTrainBatchImgs(batch_size = batchsz)
        elif train_val is 'val':
            data = cocoutil.getValidationBatchImgs(batch_size = batchsz)
        # Forward propogate
        output = model.predict(data[0])
        # Save output
        for t, img in enumerate(output):
            filename = path.join(output_dir, str(data[2][t]))
            np.save(filename, img)
        n = n + batchsz

# Define directory where propogated images will be saved
output_dir = './fwd_prop'
if not path.isdir(output_dir): mkdir(output_dir)

# Replace output directories if not already created
train_dir = path.join(output_dir, 'train')
val_dir = path.join(output_dir, 'validation')
if path.isdir(train_dir): shutil.rmtree(train_dir)
if path.isdir(val_dir): shutil.rmtree(val_dir)
mkdir(train_dir)
mkdir(val_dir)

# Generate model
model = getModel(nb_remove_layers = 1)

# Create ReadCOCOUtil object
cocoutil = ReadCOCOUtil()

# Forward propogate Training and Validation
fwdprop_save(cocoutil, 'train', train_dir)
fwdprop_save(cocoutil, 'val', val_dir)


text:
shc-manager
===========

Software to run and manage the Summer Hiatus Challenge at jboard.tv


text:
namespace Azure.ResourceManager.Batch.Models
{
    /// <summary> Specify either the userName or autoUser property, but not both. </summary>
    public partial class BatchUserIdentity
    {
        /// <summary> Initializes a new instance of BatchUserIdentity. </summary>
        public BatchUserIdentity()
        {
        }

        /// <summary> Initializes a new instance of BatchUserIdentity. </summary>
        /// <param name="userName"> The userName and autoUser properties are mutually exclusive; you must specify one but not both. </param>
        /// <param name="autoUser"> The userName and autoUser properties are mutually exclusive; you must specify one but not both. </param>
        internal BatchUserIdentity(string userName, BatchAutoUserSpecification autoUser)
        {
            UserName = userName;
            AutoUser = autoUser;
        }

        /// <summary> The userName and autoUser properties are mutually exclusive; you must specify one but not both. </summary>
        public string UserName { get; set; }
        /// <summary> The userName and autoUser properties are mutually exclusive; you must specify one but not both. </summary>
        public BatchAutoUserSpecification AutoUser { get; set; }
    }
}


text:
import json
from indra.statements import *
from indra.preassembler import Preassembler
from indra.ontology.world import world_ontology
from indra.preassembler.custom_preassembly import *
import indra.tools.assemble_corpus as ac

def test_event_assemble_location():
    rainfall = Concept('rainfall')
    loc1 = RefContext(name='x', db_refs={'GEOID': '1'})
    loc2 = RefContext(name='x', db_refs={'GEOID': '2'})
    ev1 = Event(rainfall, context=WorldContext(geo_location=loc1))
    ev2 = Event(rainfall, context=WorldContext(geo_location=loc2))

    pa = Preassembler(ontology=world_ontology, stmts=[ev1, ev2],
                      matches_fun=None)
    unique_stmts = pa.combine_duplicates()

    assert len(unique_stmts) == 1
    pa = Preassembler(ontology=world_ontology, stmts=[ev1, ev2],
                      matches_fun=location_matches)
    unique_stmts = pa.combine_duplicates()
    assert len(unique_stmts) == 2

def test_influence_event_hash_reference():
    rainfall = Concept('rainfall')
    loc1 = RefContext(name='x', db_refs={'GEOID': '1'})
    loc2 = RefContext(name='x', db_refs={'GEOID': '2'})
    ev1 = Event(rainfall, context=WorldContext(geo_location=loc1))
    ev2 = Event(rainfall, context=WorldContext(geo_location=loc2))
    infl = Influence(ev1, ev2)

    h1 = ev1.get_hash(refresh=True)
    h2 = ev2.get_hash(refresh=True)
    hl1 = ev1.get_hash(refresh=True, matches_fun=location_matches)
    hl2 = ev2.get_hash(refresh=True, matches_fun=location_matches)

    assert h1 == h2, (h1, h2)
    assert hl1 != hl2, (hl1, hl2)

    ij = infl.to_json(matches_fun=location_matches)
    ev1j = ev1.to_json(matches_fun=location_matches)
    assert ev1j['matches_hash'] == ij['subj']['matches_hash'],\
        (print(json.dumps(ev1j, indent=1)),
         print(json.dumps(ij, indent=1)))

def test_agent_name_custom_preassembly():
    e1 = Event(Concept('price oil'))
    e2 = Event(Concept('oil price'))
    stmts = [e1, e2]
    stmts_out = ac.run_preassembly(stmts,
                                   matches_fun=agent_name_stmt_type_matches)
    assert len(stmts_out) == 1


text:
package de.qaware.chronix.timeseries;

import de.qaware.chronix.dts.Pair;
import org.junit.Test;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import static de.qaware.chronix.iterators.Iterators.empty;
import static de.qaware.chronix.iterators.Iterators.takeAll;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;

/**
 * Basic unit test for the TimeSeriesRegression.
 */
public class TimeSeriesRegressionTest {

    @Test
    public void testNoValue() {

        double epsilon = 0.1;

        // call linearize
        Iterator<Pair<Double, Pair<Double, Double>>> result = TimeSeriesUtil.linearize(empty(), epsilon);

        // unpack result
        List<Pair<Double, Pair<Double, Double>>> resultAsList = takeAll(result);
        assertThat(resultAsList.size(), is(0));
    }

    @Test
    public void testSingleValue() {

        List<Pair<Double, Double>> ts = new ArrayList<>();
        ts.add(Pair.pairOf(0.0, 100.0));

        double epsilon = 0.1;

        // call linearize
        Iterator<Pair<Double, Pair<Double, Double>>> result = TimeSeriesUtil.linearize(ts.iterator(), epsilon);

        // unpack result
        List<Pair<Double, Pair<Double, Double>>> resultAsList = takeAll(result);

        assertThat(resultAsList.size(), is(1));
        Pair<Double, Pair<Double, Double>> p = resultAsList.get(0);
        assertThat(p.getFirst(), is(0.0));
        assertThat(p.getSecond(), is(Pair.pairOf(100.0, 0.0)));
    }

    @Test
    public void testSingleHorizontalSegment() {

        List<Pair<Double, Double>> ts = new ArrayList<>();
        ts.add(Pair.pairOf(0.0, 100.0));
        ts.add(Pair.pairOf(1.0, 100.0));
        ts.add(Pair.pairOf(3.0, 100.0));
        ts.add(Pair.pairOf(7.0, 100.0));
        ts.add(Pair.pairOf(9.0, 100.0));
        ts.add(Pair.pairOf(15.0, 100.0));
        ts.add(Pair.pairOf(30.0, 100.0));
        double epsilon = 0.1;

        // call linearize
        Iterator<Pair<Double, Pair<Double, Double>>> result = TimeSeriesUtil.linearize(ts.iterator(), epsilon);

        // unpack result
        List<Pair<Double, Pair<Double, Double>>> resultAsList = takeAll(result);

        assertThat(resultAsList.size(), is(1));
        Pair<Double, Pair<Double, Double>> p = resultAsList.get(0);
        assertThat(p.getFirst(), is(0.0));
        assertThat(p.getSecond(), is(Pair.pairOf(100.0, 0.0)));
    }

    @Test
    public void testManyHorizontalSegments() {
        List<Pair<Double, Double>> ts = new ArrayList<>();
        ts.add(Pair.pairOf(0.0, 100.0));
        ts.add(Pair.pairOf(1.0, 100.0));
        ts.add(Pair.pairOf(3.0, 100.0));
        ts.add(Pair.pairOf(7.0, 100.0));
        ts.add(Pair.pairOf(9.0, 100.0));
        ts.add(Pair.pairOf(15.0, 100.0));
        ts.add(Pair.pairOf(30.0, 100.0));

        ts.add(Pair.pairOf(40.0, 200.0));
        ts.add(Pair.pairOf(43.0, 200.0));
        ts.add(Pair.pairOf(45.0, 200.0));
        ts.add(Pair.pairOf(48.0, 200.0));
        ts.add(Pair.pairOf(51.0, 200.0));
        ts.add(Pair.pairOf(55.0, 200.0));
        ts.add(Pair.pairOf(59.0, 200.0));

        ts.add(Pair.pairOf(70.0, 300.0));
        ts.add(Pair.pairOf(71.0, 300.0));
        ts.add(Pair.pairOf(73.0, 300.0));
        ts.add(Pair.pairOf(77.0, 300.0));
        ts.add(Pair.pairOf(91.0, 300.0));
        ts.add(Pair.pairOf(95.0, 300.0));
        ts.add(Pair.pairOf(96.0, 300.0));

        double epsilon = 0.1;

        // call linearize
        Iterator<Pair<Double, Pair<Double, Double>>> result = TimeSeriesUtil.linearize(ts.iterator(), epsilon);

        // unpack result
        List<Pair<Double, Pair<Double, Double>>> resultAsList = takeAll(result);

        assertThat(resultAsList.size(), is(3));
        Pair<Double, Pair<Double, Double>> p = resultAsList.get(0);
        assertThat(p.getFirst(), is(0.0));
        assertThat(p.getSecond(), is(Pair.pairOf(100.0, 0.0)));

        p = resultAsList.get(1);
        assertThat(p.getFirst(), is(40.0));
        assertThat(p.getSecond(), is(Pair.pairOf(200.0, 0.0)));

        p = resultAsList.get(2);
        assertThat(p.getFirst(), is(70.0));
        assertThat(p.getSecond(), is(Pair.pairOf(300.0, 0.0)));
    }

    @Test
    public void testSingleInclinedSegment() {

        List<Pair<Double, Double>> ts = new ArrayList<>();

        ts.add(Pair.pairOf(1.0, 5.0));
        ts.add(Pair.pairOf(2.0, 10.0));
        ts.add(Pair.pairOf(3.0, 15.0));

        double epsilon = 0.1;

        // call linearize
        Iterator<Pair<Double, Pair<Double, Double>>> result = TimeSeriesUtil.linearize(ts.iterator(), epsilon);

        // unpack result
        List<Pair<Double, Pair<Double, Double>>> resultAsList = takeAll(result);

        assertThat(resultAsList.size(), is(1));
        Pair<Double, Pair<Double, Double>> p = resultAsList.get(0);
        assertThat(p.getFirst(), is(1.0));
        assertThat(p.getSecond(), is(Pair.pairOf(5.0, 5.0)));
    }

    @Test
    public void testManyInclinedSegments() {

        List<Pair<Double, Double>> ts = new ArrayList<>();

        ts.add(Pair.pairOf(0.0, 20.0));    // first segment, slope = 2.0
        ts.add(Pair.pairOf(1.0, 22.0));
        ts.add(Pair.pairOf(2.0, 24.0));
        ts.add(Pair.pairOf(3.0, 26.0));

        ts.add(Pair.pairOf(4.0, 23.0));    // second segment, slope = -3.0
        ts.add(Pair.pairOf(5.0, 20.0));
        ts.add(Pair.pairOf(6.0, 17.0));
        ts.add(Pair.pairOf(7.0, 14.0));

        ts.add(Pair.pairOf(8.0, 18.0));    // third segment, slope = 4.0
        ts.add(Pair.pairOf(9.0, 22.0));
        ts.add(Pair.pairOf(10.0, 26.0));
        ts.add(Pair.pairOf(11.0, 30.0));

        double epsilon = 0.1;

        // call linearize
        Iterator<Pair<Double, Pair<Double, Double>>> result = TimeSeriesUtil.linearize(ts.iterator(), epsilon);

        // unpack result
        List<Pair<Double, Pair<Double, Double>>> resultAsList = takeAll(result);

        assertThat(resultAsList.size(), is(3));
        Pair<Double, Pair<Double, Double>> p = resultAsList.get(0);
        assertThat(p.getFirst(), is(0.0));
        assertThat(p.getSecond(), is(Pair.pairOf(20.0, 2.0)));

        p = resultAsList.get(1);
        assertThat(p.getFirst(), is(4.0));
        assertThat(p.getSecond(), is(Pair.pairOf(23.0, -3.0)));

        p = resultAsList.get(2);
        assertThat(p.getFirst(), is(8.0));
        assertThat(p.getSecond(), is(Pair.pairOf(18.0, 4.0)));
    }

    @Test
    public void testTwoSimilarSegments() {

        List<Pair<Double, Double>> ts = new ArrayList<>();

        double epsilon = 1e-3;
        double slope = 1.10;

        ts.add(Pair.pairOf(0.0, 0.0));              // first segment, slope = 1.0
        ts.add(Pair.pairOf(1.0, 1.0));
        ts.add(Pair.pairOf(2.0, 2.0));
        ts.add(Pair.pairOf(3.0, 3.0));

        ts.add(Pair.pairOf(4.0, 3.0 + 1 * slope));    // second segment, slope = slope
        ts.add(Pair.pairOf(5.0, 3.0 + 2 * slope));
        ts.add(Pair.pairOf(6.0, 3.0 + 3 * slope));
        ts.add(Pair.pairOf(7.0, 3.0 + 4 * slope));

        // call linearize
        Iterator<Pair<Double, Pair<Double, Double>>> result = TimeSeriesUtil.linearize(ts.iterator(), epsilon);

        // unpack result
        List<Pair<Double, Pair<Double, Double>>> resultAsList = takeAll(result);

        assertThat(resultAsList.size(), is(2));
        Pair<Double, Pair<Double, Double>> p = resultAsList.get(0);
        assertThat(p.getFirst(), is(0.0));
        assertThat(p.getSecond(), is(Pair.pairOf(0.0, 1.0)));

        p = resultAsList.get(1);
        assertThat(p.getFirst(), is(4.0));
        assertThat(p.getSecond(), is(Pair.pairOf(3.0 + slope, slope)));
    }

    @Test
    public void testPerformance() {

        double epsilon = 1e-3;
        double m = 1e3;
        double delta = 1e-3;  // generates m/delta timestamps

        List<Pair<Double, Double>> ts = new ArrayList<>();

        for (int cnt = 0; cnt < m; cnt++) {                // for all segments
            double slope = Math.random();
            for (double x = 0.0; x < 1.0; x += delta) {    // proceed by delta
                ts.add(Pair.pairOf(cnt + x, cnt + x * slope));
            }
        }

        // call linearize
        Iterator<Pair<Double, Pair<Double, Double>>> result = TimeSeriesUtil.linearize(ts.iterator(), epsilon);

        // unpack result
        List<Pair<Double, Pair<Double, Double>>> resultAsList = takeAll(result);
        assertThat(resultAsList.size() > 0, is(true));
    }
}


text:
"""
EFILTER special syntaxes.

Syntaxs in this module don't really implement a language - they're special
cases for just passing through literals and stuff.
"""

__author__ = "Adam Sindelar <adamsh@google.com>"

from efilter import ast
from efilter import syntax

class LiteralSyntax(syntax.Syntax):
    """This is basically and identity function for literals."""

    @property
    def root(self):
        return ast.Literal(self.original)

syntax.Syntax.register_parser(LiteralSyntax, shorthand="literal")

class PassthroughSyntax(syntax.Syntax):
    """This is basically and identity function for expressions."""

    @property
    def root(self):
        return self.original

syntax.Syntax.register_parser(LiteralSyntax, shorthand="expression")


text:
import * as gulp from 'gulp';
import { join } from 'path';

import Config from '../../config';

// TODO There should be more elegant to prevent empty directories from copying
var onlyDirs = function (es: any) {
  return es.map(function (file: any, cb: any) {
    if (file.stat.isFile()) {
      return cb(null, file);
    } else {
      return cb();
    }
  });
};

/**
 * Executes the build process, copying the assets located in `src/client` over to the appropriate
 * `dist/prod` directory.
 */
export = () => {
  let es: any = require('event-stream');
  return gulp.src([
    join(Config.APP_SRC, '**'),
    '!' + join(Config.APP_SRC, 'tsconfig.json'),
    '!' + join(Config.APP_SRC, '**', '*.ts'),
    '!' + join(Config.APP_SRC, '**', '*.css'),
    '!' + join(Config.APP_SRC, '**', '*.html'),
    '!' + join(Config.ASSETS_SRC, '**', '*.js')
  ].concat(Config.TEMP_FILES.map((p) => { return '!' + p; })))
    .pipe(onlyDirs(es))
    .pipe(gulp.dest(Config.APP_DEST));
};


text:
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context=".MainActivity" >

    <item
        android:id="@+id/action_legend"
        android:orderInCategory="1"
        android:showAsAction="ifRoom"
        android:icon="@android:drawable/ic_menu_info_details"
        android:title="@string/legend"/>
</menu>