text:
import 'whatwg-fetch';
import React from 'react';
import ReactDOM from 'react-dom';
import deepForceUpdate from 'react-deep-force-update';
import queryString from 'query-string';
import { createPath } from 'history/PathUtils';
import { addLocaleData } from 'react-intl';
// This is so bad: requiring all locale if they are not needed?
/* @intl-code-template import ${lang} from 'react-intl/locale-data/${lang}'; */
import en from 'react-intl/locale-data/en';
import cs from 'react-intl/locale-data/cs';
/* @intl-code-template-end */
import App from './components/App';
import createFetch from './createFetch';
import configureStore from './store/configureStore';
import { updateMeta } from './DOMUtils';
import history from './history';
import createApolloClient from './core/createApolloClient';
import router from './router';
import { getIntl } from './actions/intl';

/* @intl-code-template addLocaleData(${lang}); */
addLocaleData(en);
addLocaleData(cs);
/* @intl-code-template-end */

// Universal HTTP client
const fetch = createFetch(window.fetch, {
  baseUrl: window.App.apiUrl,
});

const apolloClient = createApolloClient();

// Initialize a new Redux store
// http://redux.js.org/docs/basics/UsageWithReact.html
const store = configureStore(window.App.state, {
  apolloClient,
  fetch,
  history,
});

// Global (context) variables that can be easily accessed from any React component
// https://facebook.github.io/react/docs/context.html
const context = {
  // Enables critical path CSS rendering
  // https://github.com/kriasoft/isomorphic-style-loader
  insertCss: (...styles) => {
    // eslint-disable-next-line no-underscore-dangle
    const removeCss = styles.map(x => x._insertCss());
    return () => {
      removeCss.forEach(f => f());
    };
  },
  // For react-apollo
  client: apolloClient,
  store,
  storeSubscription: null,
  // Universal HTTP client
  fetch,
  // intl instance as it can be get with injectIntl
  intl: store.dispatch(getIntl()),
};

const container = document.getElementById('app');
let currentLocation = history.location;
let appInstance;

// Switch off the native scroll restoration behavior and handle it manually
// https://developers.google.com/web/updates/2015/09/history-api-scroll-restoration
const scrollPositionsHistory = {};
if (window.history && 'scrollRestoration' in window.history) {
  window.history.scrollRestoration = 'manual';
}

// Re-render the app when window.location changes
async function onLocationChange(location, action) {
  // Remember the latest scroll position for the previous location
  scrollPositionsHistory[currentLocation.key] = {
    scrollX: window.pageXOffset,
    scrollY: window.pageYOffset,
  };
  // Delete stored scroll position for next page if any
  if (action === 'PUSH') {
    delete scrollPositionsHistory[location.key];
  }
  currentLocation = location;

  context.intl = store.dispatch(getIntl());

  const isInitialRender = !action;
  try {
    // Traverses the list of routes in the order they are defined until
    // it finds the first route that matches provided URL path string
    // and whose action method returns anything other than `undefined`.
    const route = await router.resolve({
      ...context,
      pathname: location.pathname,
      query: queryString.parse(location.search),
      locale: store.getState().intl.locale,
    });

    // Prevent multiple page renders during the routing process
    if (currentLocation.key !== location.key) {
      return;
    }

    if (route.redirect) {
      history.replace(route.redirect);
      return;
    }

    const renderReactApp = isInitialRender ? ReactDOM.hydrate : ReactDOM.render;
    appInstance = renderReactApp(
      <App context={context}>{route.component}</App>,
      container,
      () => {
        if (isInitialRender) {
          const elem = document.getElementById('css');
          if (elem) elem.parentNode.removeChild(elem);
          return;
        }

        document.title = route.title;

        updateMeta('description', route.description);
        // Update necessary tags in <head> at runtime here, ie:
        // updateMeta('keywords', route.keywords);
        // updateCustomMeta('og:url', route.canonicalUrl);
        // updateCustomMeta('og:image', route.imageUrl);
        // updateLink('canonical', route.canonicalUrl);
        // etc.

        let scrollX = 0;
        let scrollY = 0;
        const pos = scrollPositionsHistory[location.key];
        if (pos) {
          scrollX = pos.scrollX;
          scrollY = pos.scrollY;
        } else {
          const targetHash = location.hash.substr(1);
          if (targetHash) {
            const target = document.getElementById(targetHash);
            if (target) {
              scrollY = window.pageYOffset + target.getBoundingClientRect().top;
            }
          }
        }

        // Restore the scroll position if it was saved into the state
        // or scroll to the given #hash anchor
        // or scroll to top of the page
        window.scrollTo(scrollX, scrollY);

        // Google Analytics tracking. Don't send 'pageview' event after
        // the initial rendering, as it was already sent
        if (window.ga) {
          window.ga('send', 'pageview', createPath(location));
        }
      },
    );
  } catch (error) {
    if (__DEV__) {
      throw error;
    }

    console.error(error);

    // Do a full page reload if error occurs during client-side navigation
    if (!isInitialRender && currentLocation.key === location.key) {
      window.location.reload();
    }
  }
}

let isHistoryObserved = false;
export default function main() {
  // Handle client-side navigation by using HTML5 History API
  // For more information visit https://github.com/mjackson/history#readme
  currentLocation = history.location;
  if (!isHistoryObserved) {
    isHistoryObserved = true;
    history.listen(onLocationChange);
  }
  onLocationChange(currentLocation);
}

// globally accesible entry point
window.RSK_ENTRY = main;

// Enable Hot Module Replacement (HMR)
if (module.hot) {
  module.hot.accept('./router', () => {
    if (appInstance && appInstance.updater.isMounted(appInstance)) {
      // Force-update the whole tree, including components that refuse to update
      deepForceUpdate(appInstance);
    }
  });
}


text:
#include "XMBullet/BulletCollision/CollisionShapes/btCompoundShape.h"
#include "XMBullet/BulletCollision/CollisionShapes/btCollisionShape.h"
#include "XMBullet/BulletCollision/BroadphaseCollision/btDbvt.h"
#include "XMBullet/LinearMath/btSerializer.h"

btCompoundShape::btCompoundShape(bool enableDynamicAabbTree)
: m_localAabbMin(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT)),
m_localAabbMax(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT)),
m_dynamicAabbTree(0),
m_updateRevision(1),
m_collisionMargin(btScalar(0.)),
m_localScaling(btScalar(1.),btScalar(1.),btScalar(1.))
{
	m_shapeType = COMPOUND_SHAPE_PROXYTYPE;

	if (enableDynamicAabbTree)
	{
		void* mem = btAlignedAlloc(sizeof(btDbvt),16);
		m_dynamicAabbTree = new(mem) btDbvt();
		btAssert(mem==m_dynamicAabbTree);
	}
}

btCompoundShape::~btCompoundShape()
{
	if (m_dynamicAabbTree)
	{
		m_dynamicAabbTree->~btDbvt();
		btAlignedFree(m_dynamicAabbTree);
	}
}

void	btCompoundShape::addChildShape(const btTransform& localTransform,btCollisionShape* shape)
{
	m_updateRevision++;
	//m_childTransforms.push_back(localTransform);
	//m_childShapes.push_back(shape);
	btCompoundShapeChild child;
	child.m_node = 0;
	child.m_transform = localTransform;
	child.m_childShape = shape;
	child.m_childShapeType = shape->getShapeType();
	child.m_childMargin = shape->getMargin();

	//extend the local aabbMin/aabbMax
	btVector3 localAabbMin,localAabbMax;
	shape->getAabb(localTransform,localAabbMin,localAabbMax);
	for (int i=0;i<3;i++)
	{
		if (m_localAabbMin[i] > localAabbMin[i])
		{
			m_localAabbMin[i] = localAabbMin[i];
		}
		if (m_localAabbMax[i] < localAabbMax[i])
		{
			m_localAabbMax[i] = localAabbMax[i];
		}

	}
	if (m_dynamicAabbTree)
	{
		const btDbvtVolume	bounds=btDbvtVolume::FromMM(localAabbMin,localAabbMax);
		int index = m_children.size();
		child.m_node = m_dynamicAabbTree->insert(bounds,(void*)index);
	}

	m_children.push_back(child);

}

void	btCompoundShape::updateChildTransform(int childIndex, const btTransform& newChildTransform,bool shouldRecalculateLocalAabb)
{
	m_children[childIndex].m_transform = newChildTransform;

	if (m_dynamicAabbTree)
	{
		///update the dynamic aabb tree
		btVector3 localAabbMin,localAabbMax;
		m_children[childIndex].m_childShape->getAabb(newChildTransform,localAabbMin,localAabbMax);
		ATTRIBUTE_ALIGNED16(btDbvtVolume)	bounds=btDbvtVolume::FromMM(localAabbMin,localAabbMax);
		//int index = m_children.size()-1;
		m_dynamicAabbTree->update(m_children[childIndex].m_node,bounds);
	}

	if (shouldRecalculateLocalAabb)
	{
		recalculateLocalAabb();
	}
}

void btCompoundShape::removeChildShapeByIndex(int childShapeIndex)
{
	m_updateRevision++;
	btAssert(childShapeIndex >=0 && childShapeIndex < m_children.size());
	if (m_dynamicAabbTree)
	{
		m_dynamicAabbTree->remove(m_children[childShapeIndex].m_node);
	}
	m_children.swap(childShapeIndex,m_children.size()-1);
    if (m_dynamicAabbTree)
		m_children[childShapeIndex].m_node->dataAsInt = childShapeIndex;
	m_children.pop_back();

}

void btCompoundShape::removeChildShape(btCollisionShape* shape)
{
	m_updateRevision++;
	// Find the children containing the shape specified, and remove those children.
	//note: there might be multiple children using the same shape!
	for(int i = m_children.size()-1; i >= 0 ; i--)
	{
		if(m_children[i].m_childShape == shape)
		{
			removeChildShapeByIndex(i);
		}
	}

	recalculateLocalAabb();
}

void btCompoundShape::recalculateLocalAabb()
{
	// Recalculate the local aabb
	// Brute force, it iterates over all the shapes left.

	m_localAabbMin = btVector3(btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT),btScalar(BT_LARGE_FLOAT));
	m_localAabbMax = btVector3(btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT),btScalar(-BT_LARGE_FLOAT));

	//extend the local aabbMin/aabbMax
	for (int j = 0; j < m_children.size(); j++)
	{
		btVector3 localAabbMin,localAabbMax;
		m_children[j].m_childShape->getAabb(m_children[j].m_transform, localAabbMin, localAabbMax);
		for (int i=0;i<3;i++)
		{
			if (m_localAabbMin[i] > localAabbMin[i])
				m_localAabbMin[i] = localAabbMin[i];
			if (m_localAabbMax[i] < localAabbMax[i])
				m_localAabbMax[i] = localAabbMax[i];
		}
	}
}

///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version
void btCompoundShape::getAabb(const btTransform& trans,btVector3& aabbMin,btVector3& aabbMax) const
{
	btVector3 localHalfExtents = btScalar(0.5)*(m_localAabbMax-m_localAabbMin);
	btVector3 localCenter = btScalar(0.5)*(m_localAabbMax+m_localAabbMin);

	//avoid an illegal AABB when there are no children
	if (!m_children.size())
	{
		localHalfExtents.setValue(0,0,0);
		localCenter.setValue(0,0,0);
	}
	localHalfExtents += btVector3(getMargin(),getMargin(),getMargin());

	btMatrix3x3 abs_b = trans.getBasis().absolute();

	btVector3 center = trans(localCenter);

	btVector3 extent = btVector3(abs_b[0].dot(localHalfExtents),
		abs_b[1].dot(localHalfExtents),
		abs_b[2].dot(localHalfExtents));
	aabbMin = center-extent;
	aabbMax = center+extent;

}

void	btCompoundShape::calculateLocalInertia(btScalar mass,btVector3& inertia) const
{
	//approximation: take the inertia from the aabb for now
	btTransform ident;
	ident.setIdentity();
	btVector3 aabbMin,aabbMax;
	getAabb(ident,aabbMin,aabbMax);

	btVector3 halfExtents = (aabbMax-aabbMin)*btScalar(0.5);

	btScalar lx=btScalar(2.)*(halfExtents.x());
	btScalar ly=btScalar(2.)*(halfExtents.y());
	btScalar lz=btScalar(2.)*(halfExtents.z());

	inertia[0] = mass/(btScalar(12.0)) * (ly*ly + lz*lz);
	inertia[1] = mass/(btScalar(12.0)) * (lx*lx + lz*lz);
	inertia[2] = mass/(btScalar(12.0)) * (lx*lx + ly*ly);

}

void btCompoundShape::calculatePrincipalAxisTransform(btScalar* masses, btTransform& principal, btVector3& inertia) const
{
	int n = m_children.size();

	btScalar totalMass = 0;
	btVector3 center(0, 0, 0);
	int k;

	for (k = 0; k < n; k++)
	{
		btAssert(masses[k]>0);
		center += m_children[k].m_transform.getOrigin() * masses[k];
		totalMass += masses[k];
	}

	btAssert(totalMass>0);

	center /= totalMass;
	principal.setOrigin(center);

	btMatrix3x3 tensor(0, 0, 0, 0, 0, 0, 0, 0, 0);
	for ( k = 0; k < n; k++)
	{
		btVector3 i;
		m_children[k].m_childShape->calculateLocalInertia(masses[k], i);

		const btTransform& t = m_children[k].m_transform;
		btVector3 o = t.getOrigin() - center;

		//compute inertia tensor in coordinate system of compound shape
		btMatrix3x3 j = t.getBasis().transpose();
		j[0] *= i[0];
		j[1] *= i[1];
		j[2] *= i[2];
		j = t.getBasis() * j;

		//add inertia tensor
		tensor[0] += j[0];
		tensor[1] += j[1];
		tensor[2] += j[2];

		//compute inertia tensor of pointmass at o
		btScalar o2 = o.length2();
		j[0].setValue(o2, 0, 0);
		j[1].setValue(0, o2, 0);
		j[2].setValue(0, 0, o2);
		j[0] += o * -o.x();
		j[1] += o * -o.y();
		j[2] += o * -o.z();

		//add inertia tensor of pointmass
		tensor[0] += masses[k] * j[0];
		tensor[1] += masses[k] * j[1];
		tensor[2] += masses[k] * j[2];
	}

	tensor.diagonalize(principal.getBasis(), btScalar(0.00001), 20);
	inertia.setValue(tensor[0][0], tensor[1][1], tensor[2][2]);
}

void btCompoundShape::setLocalScaling(const btVector3& scaling)
{

	for(int i = 0; i < m_children.size(); i++)
	{
		btTransform childTrans = getChildTransform(i);
		btVector3 childScale = m_children[i].m_childShape->getLocalScaling();
//		childScale = childScale * (childTrans.getBasis() * scaling);
		childScale = childScale * scaling / m_localScaling;
		m_children[i].m_childShape->setLocalScaling(childScale);
		childTrans.setOrigin((childTrans.getOrigin())*scaling);
		updateChildTransform(i, childTrans,false);
	}

	m_localScaling = scaling;
	recalculateLocalAabb();

}

void btCompoundShape::createAabbTreeFromChildren()
{
    if ( !m_dynamicAabbTree )
    {
        void* mem = btAlignedAlloc(sizeof(btDbvt),16);
        m_dynamicAabbTree = new(mem) btDbvt();
        btAssert(mem==m_dynamicAabbTree);

        for ( int index = 0; index < m_children.size(); index++ )
        {
            btCompoundShapeChild &child = m_children[index];

            //extend the local aabbMin/aabbMax
            btVector3 localAabbMin,localAabbMax;
            child.m_childShape->getAabb(child.m_transform,localAabbMin,localAabbMax);

            const btDbvtVolume  bounds=btDbvtVolume::FromMM(localAabbMin,localAabbMax);
            child.m_node = m_dynamicAabbTree->insert(bounds,(void*)index);
        }
    }
}

///fills the dataBuffer and returns the struct name (and 0 on failure)
const char*	btCompoundShape::serialize(void* dataBuffer, btSerializer* serializer) const
{

	btCompoundShapeData* shapeData = (btCompoundShapeData*) dataBuffer;
	btCollisionShape::serialize(&shapeData->m_collisionShapeData, serializer);

	shapeData->m_collisionMargin = float(m_collisionMargin);
	shapeData->m_numChildShapes = m_children.size();
	shapeData->m_childShapePtr = 0;
	if (shapeData->m_numChildShapes)
	{
		btChunk* chunk = serializer->allocate(sizeof(btCompoundShapeChildData),shapeData->m_numChildShapes);
		btCompoundShapeChildData* memPtr = (btCompoundShapeChildData*)chunk->m_oldPtr;
		shapeData->m_childShapePtr = (btCompoundShapeChildData*)serializer->getUniquePointer(memPtr);

		for (int i=0;i<shapeData->m_numChildShapes;i++,memPtr++)
		{
			memPtr->m_childMargin = float(m_children[i].m_childMargin);
			memPtr->m_childShape = (btCollisionShapeData*)serializer->getUniquePointer(m_children[i].m_childShape);
			//don't serialize shapes that already have been serialized
			if (!serializer->findPointer(m_children[i].m_childShape))
			{
				btChunk* chunk = serializer->allocate(m_children[i].m_childShape->calculateSerializeBufferSize(),1);
				const char* structType = m_children[i].m_childShape->serialize(chunk->m_oldPtr,serializer);
				serializer->finalizeChunk(chunk,structType,BT_SHAPE_CODE,m_children[i].m_childShape);
			}

			memPtr->m_childShapeType = m_children[i].m_childShapeType;
			m_children[i].m_transform.serializeFloat(memPtr->m_transform);
		}
		serializer->finalizeChunk(chunk,"btCompoundShapeChildData",BT_ARRAY_CODE,chunk->m_oldPtr);
	}
	return "btCompoundShapeData";
}

redpajama_set_name: RedPajamaGithub


text:
<!DOCTYPE html>

	<meta charset="UTF-8">
	<title>Basic LinkButton - jQuery EasyUI Demo</title>
	<link rel="stylesheet" type="text/css" href="../../../../../../src/template/js/easyui_qdp/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="../../themes/icon.css">
	<link rel="stylesheet" type="text/css" href="../demo.css">

Basic LinkButton

Buttons can be created from <a/> link.

		Add
		Remove
		Save
		Cut
		Text Button


text:
/*-----------------------------------------------------------------------------------------------
        NAME: FindWhatIsBlocking.sql
 MODIFIED BY: Sal Young
       EMAIL: saleyoun@yahoo.com
 DESCRIPTION:
-------------------------------------------------------------------------------------------------
         DATE MODIFIED      DESCRIPTION
-------------------------------------------------------------------------------------------------
   02.12.2012 SYoung        Initial creation.
-------------------------------------------------------------------------------------------------
  DISCLAIMER: The AUTHOR  ASSUMES NO RESPONSIBILITY  FOR ANYTHING, including  the destruction of
              personal property, creating singularities, making deep fried chicken, causing your
              toilet to  explode, making  your animals spin  around like mad, causing hair loss,
			        killing your buzz or ANYTHING else that can be thought up.
-----------------------------------------------------------------------------------------------*/
:CONNECT <server_name, sysname, SQL_Server_Instance>

SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

SELECT B.session_id [BlockingSessionID]
     , S.login_name [BlockingUser]
     , BSQL.[text] [BlockingSQL]
     , W.wait_type [WhyBlocked]
     , BL.session_id [BlockedSessionID]
     , USER_NAME(BL.[user_id]) [BlockedUSer]
     , BLSQL.[text] [BlockedSQL]
     , DB_NAME(BL.database_id) [DatabaseName]
  FROM sys.dm_exec_connections B
 INNER JOIN sys.dm_exec_requests BL ON B.session_id = BL.blocking_session_ID
 INNER JOIN sys.dm_os_waiting_tasks W ON BL.session_id = W.session_ID
 RIGHT JOIN sys.dm_exec_sessions S ON BL.session_ID = S.session_ID
 CROSS APPLY sys.dm_exec_sql_text(B.most_recent_sql_handle) BSQL
 CROSS APPLY sys.dm_exec_sql_text(BL.sql_handle) BLSQL
 ORDER BY BlockingSessionID, BlockedSessionID;
GO


text:
import collections

import mock
from oslo_vmware import vim_util

from nova import test
from nova.tests.unit.virt.vmwareapi import fake
from nova.tests.unit.virt.vmwareapi import stubs
from nova.virt.vmwareapi import driver
from nova.virt.vmwareapi import network_util

ResultSet = collections.namedtuple('ResultSet', ['objects'])
ObjectContent = collections.namedtuple('ObjectContent', ['obj', 'propSet'])
DynamicProperty = collections.namedtuple('DynamicProperty', ['name', 'val'])

class VMwareNetworkUtilTestCase(test.NoDBTestCase):

    def setUp(self):
        super(VMwareNetworkUtilTestCase, self).setUp()
        fake.reset()
        self.stubs.Set(driver.VMwareAPISession, "vim", stubs.fake_vim_prop)
        self.stubs.Set(driver.VMwareAPISession, "_is_vim_object",
                       stubs.fake_is_vim_object)
        self._session = driver.VMwareAPISession()

    def _build_cluster_networks(self, networks):
        """Returns a set of results for a cluster network lookup.

        This is an example:
        (ObjectContent){
           obj =
              (obj){
                 value = "domain-c7"
                 _type = "ClusterComputeResource"
              }
           propSet[] =
              (DynamicProperty){
                 name = "network"
                 val =
                    (ArrayOfManagedObjectReference){
                       ManagedObjectReference[] =
                          (ManagedObjectReference){
                             value = "network-54"
                             _type = "Network"
                          },
                          (ManagedObjectReference){
                             value = "dvportgroup-14"
                             _type = "DistributedVirtualPortgroup"
                          },
                    }
              },
        }]
        """

        objects = []
        obj = ObjectContent(obj=vim_util.get_moref("domain-c7",
                                                   "ClusterComputeResource"),
                            propSet=[])
        value = fake.DataObject()
        value.ManagedObjectReference = []
        for network in networks:
            value.ManagedObjectReference.append(network)

        obj.propSet.append(
                    DynamicProperty(name='network',
                                    val=value))
        objects.append(obj)
        return ResultSet(objects=objects)

    def test_get_network_no_match(self):
        net_morefs = [vim_util.get_moref("dvportgroup-135",
                                         "DistributedVirtualPortgroup"),
                      vim_util.get_moref("dvportgroup-136",
                                         "DistributedVirtualPortgroup")]
        networks = self._build_cluster_networks(net_morefs)
        self._continue_retrieval_called = False

        def mock_call_method(module, method, *args, **kwargs):
            if method == 'get_object_properties':
                return networks
            if method == 'get_dynamic_property':
                result = fake.DataObject()
                result.name = 'no-match'
                return result
            if method == 'continue_retrieval':
                self._continue_retrieval_called = True

        with mock.patch.object(self._session, '_call_method',
                               mock_call_method):
            res = network_util.get_network_with_the_name(self._session,
                                                        'fake_net',
                                                        'fake_cluster')
            self.assertTrue(self._continue_retrieval_called)
            self.assertIsNone(res)

    def _get_network_dvs_match(self, name, token=False):
        net_morefs = [vim_util.get_moref("dvportgroup-135",
                                         "DistributedVirtualPortgroup")]
        networks = self._build_cluster_networks(net_morefs)

        def mock_call_method(module, method, *args, **kwargs):
            if method == 'get_object_properties':
                return networks
            if method == 'get_dynamic_property':
                result = fake.DataObject()
                if not token or self._continue_retrieval_called:
                    result.name = name
                else:
                    result.name = 'fake_name'
                result.key = 'fake_key'
                result.distributedVirtualSwitch = 'fake_dvs'
                return result
            if method == 'continue_retrieval':
                if token:
                    self._continue_retrieval_called = True
                    return networks
            if method == 'cancel_retrieval':
                self._cancel_retrieval_called = True

        with mock.patch.object(self._session, '_call_method',
                               mock_call_method):
            res = network_util.get_network_with_the_name(self._session,
                                                        'fake_net',
                                                        'fake_cluster')
            self.assertIsNotNone(res)

    def test_get_network_dvs_exact_match(self):
        self._cancel_retrieval_called = False
        self._get_network_dvs_match('fake_net')
        self.assertTrue(self._cancel_retrieval_called)

    def test_get_network_dvs_match(self):
        self._cancel_retrieval_called = False
        self._get_network_dvs_match('dvs_7-virtualwire-7-fake_net')
        self.assertTrue(self._cancel_retrieval_called)

    def test_get_network_dvs_match_with_token(self):
        self._continue_retrieval_called = False
        self._cancel_retrieval_called = False
        self._get_network_dvs_match('dvs_7-virtualwire-7-fake_net',
                                    token=True)
        self.assertTrue(self._continue_retrieval_called)
        self.assertTrue(self._cancel_retrieval_called)

    def test_get_network_network_match(self):
        net_morefs = [vim_util.get_moref("network-54", "Network")]
        networks = self._build_cluster_networks(net_morefs)

        def mock_call_method(module, method, *args, **kwargs):
            if method == 'get_object_properties':
                return networks
            if method == 'get_dynamic_property':
                return 'fake_net'

        with mock.patch.object(self._session, '_call_method',
                               mock_call_method):
            res = network_util.get_network_with_the_name(self._session,
                                                        'fake_net',
                                                        'fake_cluster')
            self.assertIsNotNone(res)


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Serialized Form (Jsign - Code signing for Windows executables, Microsoft Installers and scripts (Core) 3.0 API)</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Index

Help

Prev

Next

Frames

No Frames

All Classes

Serialized Form

Package net.jsign.timestamp

Class net.jsign.timestamp.TimestampingException extends RuntimeException implements Serializable

Skip navigation links

Overview

Package

Class

Use

Tree

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2012–2020. All rights reserved.


text:
require_relative 'boot'

require "action_mailer/railtie"
require "sprockets/railtie"

Bundler.require(:default, Rails.env)
require 'jscrollpane-rails'

module Dummy
  class Application < Rails::Application
    config.secret_key_base = '5e6b6d2bd7bf26d02679ac958b520adf41b211eb0b8f33742abc5437711d0ad314baf13efc0d35d7568d2e469668a7021cf5e945c667bd16507777aedb770f83'
    #config.eager_load = false # You get yelled at if you don't set this
    config.active_support.test_order = :random
  end
end


text:
import Rate from '..';
import focusTest from '../../../tests/shared/focusTest';
import mountTest from '../../../tests/shared/mountTest';
import rtlTest from '../../../tests/shared/rtlTest';

describe('Rate', () => {
  focusTest(Rate, { refFocus: true });
  mountTest(Rate);
  rtlTest(Rate);
});


text:
package org.gnucash.android.ui.util;

/**
 * Interface for implemented by activities which wish to be notified when
 * an action on account has been requested
 * This is typically used for Fragment-to-Activity communication
 *
 * @author Ngewi Fet <ngewif@gmail.com>
 */
public interface OnAccountClickedListener {

	/**
	 * Callback when an account is selected (clicked) from in a list of accounts
	 * @param accountUID GUID of the selected account
	 */
	public void accountSelected(String accountUID);

}


text:
//  Copyright (c) 2015 Hugo Amiard hugo.amiard@laposte.net
//  This software is provided 'as-is' under the zlib License, see the LICENSE.txt file.
//  This notice and the license may not be removed or altered from any source distribution.

#ifndef MK_SCROLLBAR_H_INCLUDED
#define MK_SCROLLBAR_H_INCLUDED

/* mk */
#include <Object/mkId.h>
#include <Object/String/mkString.h>
#include <Object/Util/mkUpdatable.h>
#include <Ui/mkUiForward.h>
#include <Ui/Widget/mkWidget.h>
#include <Ui/Widget/mkButton.h>
#include <Ui/Widget/mkSlider.h>
#include <Ui/Frame/mkStripe.h>

#include <memory>

namespace mk
{
	class MK_UI_EXPORT Scroller : public Slider
	{
	public:
		Scroller(Dimension dim);

		void sliderStep(float offset, bool ended);

		static StyleType& cls() { static StyleType ty("Scroller", Slider::cls()); return ty; }
	};

	class MK_UI_EXPORT ScrollerX : public Scroller
	{
	public:
		ScrollerX();
	};

	class MK_UI_EXPORT ScrollerY : public Scroller
	{
	public:
		ScrollerY();
	};

	class MK_UI_EXPORT ScrollerKnob : public SliderKnob
	{
	public:
		ScrollerKnob(Dimension dim);

		static StyleType& cls() { static StyleType ty("ScrollerKnob", SliderKnob::cls()); return ty; }
	};

	class MK_UI_EXPORT ScrollerKnobX : public ScrollerKnob
	{
	public:
		ScrollerKnobX();

		static StyleType& cls() { static StyleType ty("ScrollerKnobX", ScrollerKnob::cls()); return ty; }
	};

	class MK_UI_EXPORT ScrollerKnobY : public ScrollerKnob
	{
	public:
		ScrollerKnobY();

		static StyleType& cls() { static StyleType ty("ScrollerKnobY", ScrollerKnob::cls()); return ty; }
	};

	class MK_UI_EXPORT ScrollUp : public Button
	{
	public:
		ScrollUp(const Trigger& trigger);

		static StyleType& cls() { static StyleType ty("ScrollUp", Button::cls()); return ty; }
	};

	class MK_UI_EXPORT ScrollDown : public Button
	{
	public:
		ScrollDown(const Trigger& trigger);

		static StyleType& cls() { static StyleType ty("ScrollDown", Button::cls()); return ty; }
	};

	class MK_UI_EXPORT _I_ Scrollbar : public Sheet
	{
	public:
		Scrollbar(Sheet& sheet);
		~Scrollbar();

		void show();
		void hide();

		void scrollup();
		void scrolldown();
		void scroll(float offset);
		void nextFrame(size_t tick, size_t delta);

		static StyleType& cls() { static StyleType ty("Scrollbar", Sheet::cls()); return ty; }

	protected:
		Sheet& mSheet;
		Button& mUp;
		Scroller& mScroller;
		Button& mDown;
	};

	class MK_UI_EXPORT ScrollArea : public Sheet
	{
	public:
		ScrollArea(Sheet& sheet);

		Scrollbar& scrollbar() { return mScrollbar; }

		static StyleType& cls() { static StyleType ty("ScrollArea", Sheet::cls()); return ty; }

	protected:
		Scrollbar& mScrollbar;
	};
}

#endif // MK_SCROLLBAR_H_INCLUDED


text:
__author__ = 'olga'

import pandas as pd

def max_csv(x):
    '''
    Of integers separated by commas, take the max
    e.g. 75112684,75112684 would return 75112684
    or 75112684,75112689 would return 75112689
    '''
    return max(map(int, x.split(',')))

def min_csv(x):
    '''
    Of integers separated by commas, take the minimum
    e.g. 75112684,75112684 would return 75112684
    or 75112684,75112689 would return 75112684
    '''
    return min(map(int, x.split(',')))

def read_miso_summary(filename):
    '''
    Reads a MISO summary file as a pandas dataframe, and adds these columns:
    1. a copy-paste-able genome location at the end, based on the minimum
       mRNA_starts and maximum mRNA_ends. (df.genome_location)
    2. The difference between df.ci_high and df.ci_low (df.ci_diff)
    3. The left and right halves of the confidence interval, e.g. the right
       half is df.ci_high - df.miso_posterior_mean. (df.ci_left_half and
       df.ci_right_half)
    4. The max of the two left and right confidence interval halves
       (df.ci_halves_max)
    '''
    df = pd.read_table(filename, index_col=0)
    genome_location = pd.DataFrame(
        ['%s:%d-%d' % (chrom, min_csv(starts), max_csv(stops))
         for chrom, starts, stops in zip(df.chrom,
                                         df.mRNA_starts,
                                         df.mRNA_ends)],
        columns=['genome_location'], index=df.index)
    ci_diff = pd.DataFrame(df.ci_high - df.ci_low, columns=['ci_diff'],
                           index=df.index)
    ci_halves = pd.DataFrame(
        {'ci_left_half': (df.ci_high - df.miso_posterior_mean),
         'ci_right_half': (df.miso_posterior_mean - df.ci_low)},
        index=df.index)
    ci_halves_max = pd.DataFrame(ci_halves.max(axis=1),
                                 columns=['ci_halves_max'])
    return pd.concat([df, genome_location, ci_diff, ci_halves,
                      ci_halves_max], axis=1)


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

/**
 * @fileoverview Unit tests for the OppiaAngularRootComponent.
 */

import { ComponentFixture, TestBed, async} from
  '@angular/core/testing';
import { HttpClientTestingModule } from '@angular/common/http/testing';

import { OppiaAngularRootComponent } from './oppia-angular-root.component';

let component: OppiaAngularRootComponent;
let fixture: ComponentFixture<OppiaAngularRootComponent>;

describe('OppiaAngularRootComponent', function() {
  let emitSpy: jasmine.Spy;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      imports: [HttpClientTestingModule],
      declarations: [OppiaAngularRootComponent],
    }).compileComponents();

    fixture = TestBed.createComponent(OppiaAngularRootComponent);
    component = fixture.componentInstance;

    emitSpy = spyOn(component.initialized, 'emit');
  }));

  describe('.initialized', () => {
    it('should emit once ngAfterViewInit is called', () => {
      component.ngAfterViewInit();

      expect(emitSpy).toHaveBeenCalled();
    });
  });
});


text:
module Scruffy::Layers
  # ==Scruffy::Layers::Bar
  #
  # Author:: Brasten Sager
  # Date:: August 6th, 2006
  #
  # Standard bar graph.
  class Bar < Base

    # Draw bar graph.
    # Now handles positive and negative values gracefully.
    def draw(svg, coords, options = {})
      coords.each_with_index do |coord,idx|
        next if coord.nil?
        x, y, bar_height = (coord.first), coord.last, 1#(height - coord.last)

          valh = max_value + min_value * -1 #value_height
          maxh = max_value * height / valh #positive area height
          minh = min_value * height / valh #negative area height
          #puts "height = #{height} and max_value = #{max_value} and min_value = #{min_value} and y = #{y} and point = #{points[idx]}"
          if points[idx] > 0
            bar_height = points[idx]*maxh/max_value
          else
            bar_height = points[idx]*minh/min_value
          end

        #puts " y = #{y} and point = #{points[idx]}"
        unless options[:border] == false
          svg.g(:transform => "translate(-#{relative(0.5)}, -#{relative(0.5)})") {
            svg.rect( :x => x, :y => y, :width => @bar_width + relative(1), :height => bar_height + relative(1),
                      :style => "fill: black; fill-opacity: 0.15; stroke: none;" )
            svg.rect( :x => x+relative(0.5), :y => y+relative(2), :width => @bar_width + relative(1), :height => bar_height - relative(0.5),
                      :style => "fill: black; fill-opacity: 0.15; stroke: none;" )
          }
        end

        current_colour = color.is_a?(Array) ? color[idx % color.size] : color

        svg.rect( :x => x, :y => y, :width => @bar_width, :height => bar_height,
          :fill => current_colour.to_s, 'style' => "opacity: #{opacity}; stroke: none;" )
      end
    end

    protected

      # Due to the size of the bar graph, X-axis coords must
      # be squeezed so that the bars do not hang off the ends
      # of the graph.
      #
      # Unfortunately this just mean that bar-graphs and most other graphs
      # end up on different points.  Maybe adding a padding to the coordinates
      # should be a graph-wide thing?
      #
      # Update : x-axis coords for lines and area charts should now line
      # up with the center of bar charts.

      def generate_coordinates(options = {})
        @bar_width = (width / points.size) * 0.95
        options[:point_distance] = (width - (width / points.size)) / (points.size - 1).to_f

        #TODO more array work with index, try to rework to be accepting of hashes
        coords = (0...points.size).map do |idx|
          next if points[idx].nil?
          x_coord = (options[:point_distance] * idx) + (width / points.size * 0.5) - (@bar_width * 0.5)

          relative_percent = ((points[idx] == min_value) ? 0 : ((points[idx] - min_value) / (max_value - min_value).to_f))
          y_coord = (height - (height * relative_percent))
          [x_coord, y_coord]
        end
        coords
      end
  end
end


text:
package com.headstartech.beansgraph;

/**
 * A filter used to determine whether or not a bean should be reported.
 *
 * @author Per Johansson
 * @since 1.1
 */
public interface BeanFilter {

    /**
     * Returns {@code true} if the metric matches the filter; {@code false} otherwise.
     *
     * @param bean the bean
     * @return {@code true} if the bean matches the filter
     */
    boolean matches(Bean bean);
}


text:
$:.push File.join(File.dirname(__FILE__), '../lib')

require 'concurrent/atomics'
require 'benchmark'
require 'rbconfig'

def atomic_test(clazz, opts = {})
  threads = opts.fetch(:threads, 5)
  tests = opts.fetch(:tests, 100)

  num = clazz.new
  latch = Concurrent::CountDownLatch.new(threads)

  print "Testing with #{clazz}...\n"
  stats = Benchmark.measure do
    threads.times do |i|
      Thread.new do
        tests.times{ num.up }
        latch.count_down
      end
    end
    latch.wait
  end
  print stats
end

puts "Testing with #{RbConfig::CONFIG['ruby_install_name']} #{RUBY_VERSION}"

atomic_test(Concurrent::MutexAtomicFixnum, threads: 10, tests: 1_000_000)

if defined? Concurrent::CAtomicFixnum
  atomic_test(Concurrent::CAtomicFixnum, threads: 10, tests: 1_000_000)
elsif RUBY_PLATFORM == 'java'
  atomic_test(Concurrent::JavaAtomicFixnum, threads: 10, tests: 1_000_000)
end


text: drop table post;


text:
Lower::Lower() {
	Requires(elevator);
}

// Called just before this Command runs the first time
void Lower::Initialize() {
	elevator->Move(0);
}

// Called repeatedly when this Command is scheduled to run
void Lower::Execute() {
	elevator->Move(-1);
}

// Make this return true when this Command no longer needs to run execute()
bool Lower::IsFinished() {
	return elevator->GetDownSwitch()
			&& SmartDashboard::GetBoolean("DownAlternate");
}

// Called once after isFinished returns true
void Lower::End() {
	elevator->Move(0);
}

// Called when another command which requires one or more of the same
// subsystems is scheduled to run
void Lower::Interrupted() {
	End();
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Cats.Areas.Procurement.Models;
using Cats.Helpers;
using Cats.Models;

namespace Cats.ViewModelBinder
{
    public class TransportOrderViewModelBinder
    {
        public static List<TransportOrderViewModel> BindListTransportOrderViewModel(List<TransportOrder> transportOrders, string datePref, List<WorkflowStatus> statuses)
        {
            return transportOrders.Select(transportOrder => BindTransportOrderViewModel(transportOrder, datePref, statuses)).ToList();
        }

        public static TransportOrderViewModel BindTransportOrderViewModel(TransportOrder transportOrder, string datePref,List<WorkflowStatus> statuses )
        {
            TransportOrderViewModel transportOrderViewModel = null;
            if (transportOrder != null)
            {
                transportOrderViewModel = new TransportOrderViewModel();
                transportOrderViewModel.BidDocumentNo = transportOrder.BidDocumentNo;
                transportOrderViewModel.OrderDate = transportOrder.OrderDate;
                transportOrderViewModel.OrderDateET =
                   transportOrder.OrderDate.ToCTSPreferedDateFormat(datePref);
                transportOrderViewModel.ContractNumber = transportOrder.ContractNumber;
                transportOrderViewModel.PerformanceBondReceiptNo = transportOrder.PerformanceBondReceiptNo;
                transportOrderViewModel.OrderExpiryDate = transportOrder.OrderExpiryDate;
                transportOrderViewModel.OrderExpiryDateET = transportOrder.OrderExpiryDate.ToCTSPreferedDateFormat(datePref);
                transportOrderViewModel.Transporter = transportOrder.Transporter.Name;
                transportOrderViewModel.RequestedDispatchDate = transportOrder.RequestedDispatchDate;
                transportOrderViewModel.RequestedDispatchDateET = transportOrder.RequestedDispatchDate.ToCTSPreferedDateFormat(datePref);
                transportOrderViewModel.TransporterID = transportOrder.TransporterID;
                transportOrderViewModel.TransportOrderNo = transportOrder.TransportOrderNo;
                transportOrderViewModel.TransportOrderID = transportOrder.TransportOrderID;
                transportOrderViewModel.StatusID = transportOrder.StatusID;
                transportOrderViewModel.StartDate = transportOrder.StartDate.ToCTSPreferedDateFormat(datePref);
                transportOrderViewModel.EndDate = transportOrder.EndDate.ToCTSPreferedDateFormat(datePref);
                transportOrderViewModel.Status =transportOrder.StatusID.HasValue?
                statuses.Find(t => t.StatusID == transportOrder.StatusID.Value).Description:string.Empty;
            }
            return transportOrderViewModel;
        }
    }
}


text:
package org.eclipse.jnosql.diana.query;

import jakarta.nosql.query.PutQuery;
import jakarta.nosql.query.PutQuery.PutQueryProvider;
import jakarta.nosql.query.QueryValue;
import org.antlr.v4.runtime.tree.ParseTree;

import java.time.Duration;
import java.util.function.Function;

/**
 * The {@link PutQueryProvider} implementation that uses Antlr4
 */
public final class AntlrPutQueryProvider extends AbstractSupplier implements PutQueryProvider {

    private QueryValue<?> key;

    private QueryValue<?> value;

    private Duration ttl;

    @Override
    public void exitKey(QueryParser.KeyContext ctx) {
        this.key = ValueConverter.get(ctx.value());
    }

    @Override
    public void exitValue(QueryParser.ValueContext ctx) {
        this.value = ValueConverter.get(ctx);
    }

    @Override
    public void exitTtl(QueryParser.TtlContext ctx) {
        this.ttl = Durations.get(ctx);
    }

    @Override
    Function<QueryParser, ParseTree> getParserTree() {
        return QueryParser::put;
    }

    @Override
    public PutQuery apply(String query) {
        runQuery(query);
        return new DefaultPutQuery(key, value, ttl);
    }

}


text:
"""bootcamp URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views

    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf import settings
from django.conf.urls import include
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.urls import path
from django.views.decorators.csrf import csrf_exempt
from graphene_django.views import GraphQLView

from .authentication import views as authentication_views
from .core import views as core_views
from .search import views as search_views

urlpatterns = [
    path('admin/', admin.site.urls),

    path('', core_views.home, name='home'),
    path('login', auth_views.LoginView.as_view(template_name='core/cover.html'), name='login'),
    path('logout', auth_views.LogoutView.as_view(next_page='/'), name='logout'),
    path('signup/', authentication_views.signup, name='signup'),

    path('feeds/', include('bootcamp.feeds.urls')),
    path('settings/', include('bootcamp.core.urls')),
    path('articles/', include('bootcamp.articles.urls')),
    path('messages/', include('bootcamp.messenger.urls')),
    path('questions/', include('bootcamp.questions.urls')),
    path('notifications/', include('bootcamp.activities.urls')),

    path('search/', search_views.search, name='search'),
    path('network/', core_views.network, name='network'),

    path('graphql', csrf_exempt(GraphQLView.as_view(graphiql=True))),

    path('<str:username>/', core_views.profile, name='profile'),
]

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)


text:
wget http://msvocds.blob.core.windows.net/annotations-1-0-3/captions_train-val2014.zip -P data/
wget http://www.vlfeat.org/matconvnet/models/imagenet-vgg-verydeep-19.mat -P data/
wget http://msvocds.blob.core.windows.net/coco2014/train2014.zip -P image/
wget http://msvocds.blob.core.windows.net/coco2014/val2014.zip -P image/

unzip data/captions_train-val2014.zip -d data/
unzip image/train2014.zip -d image/
rm image/train2014.zip
unzip image/val2014.zip -d image/
rm image/val2014.zip


text:
/*global spyOn*/
var _ = require('underscore');
var Backbone = require('../dist/resolve');

beforeEach(function() {
  this.proxy = Backbone.Model.extend();
  this.doc = undefined;
});

describe('The Model Module', function() {

  beforeEach(function() {
    this.doc = new this.proxy({
      id: '1-the-tempest',
      title: 'The Tempest',
      author: 'Bill Shakespeare',
      length: 123
    });
  });

  it("initializes", function() {
    var Model = Backbone.Model.extend({
      initialize: function() {
        this.one = 1;
        this.set('two', 2);
        expect(this.collection).toBeTruthy();
      }
    });

    var model = new Model({}, {collection: new Backbone.Collection});
    expect(model.one).toBe(1);
    expect(model.get('two')).toBe(2);
  });

  it("initializes with attributes and options", function() {
    var Model = Backbone.Model.extend({
      initialize: function(attributes, options) {
        this.one = options.one;
      }
    });

    var model = new Model({}, {one: 1});
    expect(model.one).toBe(1);
  });

  it("initializes with parsed attributes", function() {
    var Model = Backbone.Model.extend({
      parse: function(attrs) {
        attrs.value += 1;
        return attrs;
      }
    });

    var model = new Model({value: 1}, {parse: true});
    expect(model.get('value')).toBe(2);
  });

  it("initializes with defaults", function() {
    var Model = Backbone.Model.extend({
      defaults: {
        first_name: 'Unknown',
        last_name: 'Unknown'
      }
    });

    var model = new Model({'first_name': 'John'});
    expect(model.get('first_name')).toBe('John');
    expect(model.get('last_name')).toBe('Unknown');
  });

  it("shows parse can return null", function() {
    var Model = Backbone.Model.extend({
      parse: function(attrs) {
        attrs.value += 1;
        return null;
      }
    });
    var model = new Model({value: 1}, {parse: true});
    expect(JSON.stringify(model.toJSON())).toEqual("{}");
  });

  it("implements url", function() {
    this.doc.urlRoot = '/collection';
    expect(this.doc.url()).toBe('/collection/1-the-tempest');
    // doc.collection.url = '/collection/';
    // equal(doc.url(), '/collection/1-the-tempest');
    // doc.collection = null;
    this.doc.urlRoot = null;
    expect(function() { return this.doc.url(); }).toThrow();
    // doc.collection = collection;
  });

  it("has a url when using urlRoot, and uri encoding", function() {
    var Model = Backbone.Model.extend({
      urlRoot: '/collection'
    });
    var model = new Model();
    expect(model.url()).toBe('/collection');
    model.set({id: '+1+'});
    expect(model.url()).toBe('/collection/%2B1%2B');
  });

  it("has a url when using urlRoot as a function to determine urlRoot at runtime", function() {
    var Model = Backbone.Model.extend({
      urlRoot: function() {
        return '/nested/' + this.get('parent_id') + '/collection';
      }
    });

    var model = new Model({parent_id: 1});
    expect(model.url()).toBe('/nested/1/collection');
    model.set({id: 2});
    expect(model.url()).toBe('/nested/1/collection/2');
  });

  it("clones", function() {
    var a = new Backbone.Model({ 'foo': 1, 'bar': 2, 'baz': 3});
    var b = a.clone();
    expect(a.get('foo')).toBe(1);
    expect(a.get('bar')).toBe(2);
    expect(a.get('baz')).toBe(3);
    expect(b.get('foo')).toBe(a.get('foo'));
    expect(b.get('bar')).toBe(a.get('bar'));
    expect(b.get('baz')).toBe(a.get('baz'));

    a.set({foo : 100});

    expect(a.get('foo')).toBe(100);
    expect(b.get('foo')).toBe(1);

    var foo = new Backbone.Model({p: 1});
    var bar = new Backbone.Model({p: 2});
    bar.set(foo.clone().attributes, {unset: true});

    expect(foo.get('p')).toBe(1);
    expect(bar.get('p')).toBe(undefined);
  });

  it("isNew", function() {
    var a = new Backbone.Model({ 'foo': 1, 'bar': 2, 'baz': 3});
    expect(a.isNew()).toBeTruthy();
    a = new Backbone.Model({ 'foo': 1, 'bar': 2, 'baz': 3, 'id': -5 });
    expect(a.isNew()).toBeFalsy();
    a = new Backbone.Model({ 'foo': 1, 'bar': 2, 'baz': 3, 'id': 0 });
    expect(a.isNew()).toBeFalsy();
    expect( new Backbone.Model({          }).isNew()).toBeTruthy();
    expect(new Backbone.Model({ 'id': 2  }).isNew()).toBeFalsy();
    expect(new Backbone.Model({ 'id': -5 }).isNew()).toBeFalsy();
  });

  it("gets", function() {
    expect(this.doc.get('title')).toBe('The Tempest');
    expect(this.doc.get('author')).toBe('Bill Shakespeare');
  });

  it("escapes", function() {
    expect(this.doc.escape('title')).toBe('The Tempest');
    this.doc.set({audience: 'Bill & Bob'});
    expect(this.doc.escape('audience')).toBe('Bill & Bob');
    this.doc.set({audience: 'Tim > Joan'});
    expect(this.doc.escape('audience')).toBe('Tim > Joan');
    this.doc.set({audience: 10101});
    expect(this.doc.escape('audience')).toBe('10101');
    this.doc.unset('audience');
    expect(this.doc.escape('audience')).toBe('');
  });

  it("has", function() {
    var model = new Backbone.Model();

    expect(model.has('name')).toEqual(false);

    model.set({
      '0': 0,
      '1': 1,
      'true': true,
      'false': false,
      'empty': '',
      'name': 'name',
      'null': null,
      'undefined': undefined
    });

    expect(model.has('0')).toEqual(true);
    expect(model.has('1')).toEqual(true);
    expect(model.has('true')).toEqual(true);
    expect(model.has('false')).toEqual(true);
    expect(model.has('empty')).toEqual(true);
    expect(model.has('name')).toEqual(true);

    model.unset('name');

    expect(model.has('name')).toEqual(false);
    expect(model.has('null')).toEqual(false);
    expect(model.has('undefined')).toEqual(false);
  });

  it("can set and unset", function() {
    var a = new Backbone.Model({id: 'id', foo: 1, bar: 2, baz: 3});
    var changeCount = 0;
    a.on("change:foo", function() { changeCount += 1; });
    a.set({'foo': 2});
    expect(a.get('foo')).toBe(2);
    expect(changeCount).toBe(1);
    a.set({'foo': 2}); // set with value that is not new shouldn't fire change event
    expect(a.get('foo')).toBe(2);
    expect(changeCount).toBe(1);

    a.validate = function(attrs) {
      expect(attrs.foo).toBeFalsy();
    };

    a.unset('foo', {validate: true});
    expect(a.get('foo')).toBeFalsy();
    delete a.validate;
    expect(changeCount).toBe(2);

    a.unset('id');
    expect(a.id).toBe(undefined);
  });

  it("#2030 - set with failed validate, followed by another set triggers change", function () {
    var attr = 0, main = 0, error = 0;
    var Model = Backbone.Model.extend({
      validate: function (attr) {
        if (attr.x > 1) {
          error++;
          return "this is an error";
        }
      }
    });
    var model = new Model({x:0});
      model.on('change:x', function () { attr++; });
      model.on('change', function () { main++; });
      model.set({x:2}, {validate:true});
      model.set({x:1}, {validate:true});

      expect([attr, main, error]).toEqual([1, 1, 1]);
  });

  it("triggers changes in the correct order when set", function() {
    var value = null;
    var model = new Backbone.Model;
    model.on('last', function(){ value = 'last'; });
    model.on('first', function(){ value = 'first'; });
    model.trigger('first');
    model.trigger('last');
    expect(value).toBe('last');
  });

  it("sets falsy values in the correct order", function() {
    var model = new Backbone.Model({result: 'result'});
    model.on('change', function() {
      expect(model.changed.result).toBe(undefined);
      expect(model.previous('result')).toBe(false);
    });
    model.set({result: void 0}, {silent: true});
    model.set({result: null}, {silent: true});
    model.set({result: false}, {silent: true});
    model.set({result: void 0});
  });

  it("shows nested set triggers with the correct options", function() {
      var model = new Backbone.Model();
      var o1 = {};
      var o2 = {};
      var o3 = {};
      model.on('change', function(__, options) {
        switch (model.get('a')) {
        case 1:
          expect(options).toEqual(o1);
          return model.set('a', 2, o2);
        case 2:
          expect(options).toEqual(o2);
          return model.set('a', 3, o3);
        case 3:
          expect(options).toEqual(o3);
        }
      });
    model.set('a', 1, o1);
  });

  it("multiple unsets", function() {
    var i = 0;
    var counter = function(){ i++; };
    var model = new Backbone.Model({a: 1});
    model.on("change:a", counter);
    model.set({a: 2});
    model.unset('a');
    model.unset('a');
    expect(i).toBe(2);
  });

  it("unsets and reflects in changedAttributes", function() {
    var model = new Backbone.Model({a: 1});
    model.on('change', function() {
      expect('a' in model.changedAttributes()).toBeTruthy();
    });
    model.unset('a');
  });

  it("uses a non-default id attribute.", function() {
    var MongoModel = Backbone.Model.extend({idAttribute : '_id'});
    var model = new MongoModel({id: 'eye-dee', _id: 25, title: 'Model'});
    expect(model.get('id')).toBe('eye-dee');
    expect(model.id).toBe(25);
    expect(model.isNew()).toBeFalsy();
    model.unset('_id');
    expect(model.id).toBeFalsy();
    expect(model.isNew()).toBe(true);
  });

  it("sets an empty string", function() {
    var model = new Backbone.Model({name : "Model"});
    model.set({name : ''});
    expect(model.get('name')).toBe('');
  });

  it("sets an object", function() {
    this.cb = function() {};
    var spy = spyOn(this, 'cb');

    var model = new Backbone.Model({
      custom: { foo: 1 }
    });

    model.on('change', this.cb);
    model.set({
      custom: { foo: 1 } // no change should be fired
    });
    model.set({
      custom: { foo: 2 } // change event should be fired
    });

    expect(spy.calls.count()).toBe(1);
  });

  it("clears", function() {
    var changed;
    var model = new Backbone.Model({id: 1, name : "Model"});
    model.on("change:name", function(){ changed = true; });
    model.on("change", function() {
      var changedAttrs = model.changedAttributes();
      expect('name' in changedAttrs).toBe(true);
    });
    model.clear();
    expect(changed).toBe(true);
    expect(model.get('name')).toBe(undefined);
  });

  it("uses defaults", function() {
    var Defaulted = Backbone.Model.extend({
      defaults: {
        "one": 1,
        "two": 2
      }
    });
    var model = new Defaulted({two: undefined});
    expect(model.get('one')).toBe(1);
    expect(model.get('two')).toBe(2);
    Defaulted = Backbone.Model.extend({
      defaults: function() {
        return {
          "one": 3,
          "two": 4
        };
      }
    });
    model = new Defaulted({two: undefined});
    expect(model.get('one')).toBe(3);
    expect(model.get('two')).toBe(4);
  });

  it("has change, hasChanged, changedAttributes, previous, previousAttributes", function() {
    var model = new Backbone.Model({name: "Tim", age: 10});
    expect(model.changedAttributes()).toBe(false);
    model.on('change', function() {
      expect(model.hasChanged('name')).toBeTruthy();
      expect(model.hasChanged('age')).toBeFalsy();
      expect(_.isEqual(model.changedAttributes(), {name : 'Rob'})).toBe(true);
      expect(model.previous('name')).toBe('Tim');
      expect(_.isEqual(model.previousAttributes(), {name : "Tim", age : 10})).toBe(true);
    });
    expect(model.hasChanged()).toBe(false);
    expect(model.hasChanged(undefined)).toBe(false);
    model.set({name : 'Rob'});
    expect(model.get('name')).toBe('Rob');
  });

  it("has changedAttributes", function() {
    var model = new Backbone.Model({a: 'a', b: 'b'});
    expect(model.changedAttributes()).toBe(false);
    expect(model.changedAttributes({a: 'a'})).toBe(false);
    expect(model.changedAttributes({a: 'b'}).a).toBe('b');
  });

  it("changed with options", function() {
    var value;
    var model = new Backbone.Model({name: 'Rob'});
    model.on('change', function(model, options) {
      value = options.prefix + model.get('name');
    });
    model.set({name: 'Bob'}, {prefix: 'Mr. '});
    expect(value).toBe('Mr. Bob');
    model.set({name: 'Sue'}, {prefix: 'Ms. '});
    expect(value).toBe('Ms. Sue');
  });

  it("changed after initialize", function () {
    var changed = 0;
    var attrs = {id: 1, label: 'c'};
    var obj = new Backbone.Model(attrs);
    obj.on('change', function() { changed += 1; });
    obj.set(attrs);
    expect(changed).toBe(0);
  });

  it("validates", function() {
    var lastError;
    var model = new Backbone.Model();
    model.validate = function(attrs) {
      if (attrs.admin !== this.get('admin')) return "Can't change admin status.";
    };
    model.on('invalid', function(model, error) {
      lastError = error;
    });
    var result = model.set({a: 100});
    expect(result).toEqual(model);
    expect(model.get('a')).toBe(100);
    expect(lastError).toBe(undefined);
    result = model.set({admin: true});
    expect(model.get('admin')).toBe(true);
    result = model.set({a: 200, admin: false}, {validate:true});
    expect(lastError).toBe("Can't change admin status.");
    expect(result).toBe(false);
    expect(model.get('a')).toBe(100);
  });

  it("validate on unset and clear", function() {
    var error;
    var model = new Backbone.Model({name: "One"});
    model.validate = function(attrs) {
      if (!attrs.name) {
        error = true;
        return "No thanks.";
      }
    };
    model.set({name: "Two"});
    expect(model.get('name')).toBe('Two');
    expect(error).toBe(undefined);
    model.unset('name', {validate: true});
    expect(error).toBe(true);
    expect(model.get('name')).toBe('Two');
    model.clear({validate:true});
    expect(model.get('name')).toBe('Two');
    delete model.validate;
    model.clear();
    expect(model.get('name')).toBe(undefined);
  });

  it("validates with error callback", function() {
    var lastError, boundError;
    var model = new Backbone.Model();
    model.validate = function(attrs) {
      if (attrs.admin) return "Can't change admin status.";
    };
    model.on('invalid', function(model, error) {
      boundError = true;
    });
    var result = model.set({a: 100}, {validate:true});
    expect(result).toEqual(model);
    expect(model.get('a')).toBe(100);
    expect(model.validationError).toBe(null);
    expect(boundError).toBe(undefined);
    result = model.set({a: 200, admin: true}, {validate:true});
    expect(result).toBe(false);
    expect(model.get('a')).toBe(100);
    expect(model.validationError).toBe("Can't change admin status.");
    expect(boundError).toBe(true);
  });

  it("shows defaults always extend attrs (#459)", function() {
    var Defaulted = Backbone.Model.extend({
      defaults: {one: 1},
      initialize : function(attrs, opts) {
        expect(this.attributes.one).toBe(1);
      }
    });
    var providedattrs = new Defaulted({});
    var emptyattrs = new Defaulted();
  });

  it("Inherits class properties", function() {
    var Parent = Backbone.Model.extend({
      instancePropSame: function() {},
      instancePropDiff: function() {}
    }, {
      classProp: function() {}
    });
    var Child = Parent.extend({
      instancePropDiff: function() {}
    });

    var adult = new Parent;
    var kid   = new Child;

    expect(Child.classProp).toEqual(Parent.classProp);
    expect(Child.classProp).toBeTruthy();

    expect(kid.instancePropSame).toEqual(adult.instancePropSame);
    expect(kid.instancePropSame).toBeTruthy();

    expect(Child.prototype.instancePropDiff).not.toEqual(Parent.prototype.instancePropDiff);
    expect(Child.prototype.instancePropDiff).toBeTruthy();
  });

  it("shows nested change events don't clobber previous attributes", function() {
    new Backbone.Model()
    .on('change:state', function(model, newState) {
      expect(model.previous('state')).toBeFalsy();
      expect(newState).toBe('hello');
      // Fire a nested change event.
      model.set({other: 'whatever'});
    })
    .on('change:state', function(model, newState) {
      expect(model.previous('state')).toBeFalsy();
      expect(newState).toBe('hello');
    })
    .set({state: 'hello'});
  });

  it("hasChanged/set should use same comparison", function() {
    var changed = 0, model = new Backbone.Model({a: null});
    model.on('change', function() {
      expect(this.hasChanged('a')).toBeTruthy();
    })
    .on('change:a', function() {
      changed++;
    })
    .set({a: undefined});
    expect(changed).toBe(1);
  });

  it("#582, #425, change:attribute callbacks should fire after all changes have occurred", function() {
    var model = new Backbone.Model;

    var assertion = function() {
      expect(model.get('a')).toBe('a');
      expect(model.get('b')).toBe('b');
      expect(model.get('c')).toBe('c');
    };

    model.on('change:a', assertion);
    model.on('change:b', assertion);
    model.on('change:c', assertion);

    model.set({a: 'a', b: 'b', c: 'c'});
  });

  it("#871, sets with attributes property", function() {
    var model = new Backbone.Model();
    model.set({attributes: true});
    expect(model.has('attributes')).toBeTruthy();
  });

  it("sets value regardless of equality/change", function() {
    var model = new Backbone.Model({x: []});
    var a = [];
    model.set({x: a});
    expect(model.get('x')).toEqual(a);
  });

  it("does not trigger change when setting the same value", function() {
    this.cb = function() {};
    var spy = spyOn(this, 'cb');

    var model = new Backbone.Model({x: 1});
    model.on('change change:x', this.cb);
    model.set({x: 1});
    model.set({x: 1});

    expect(spy).not.toHaveBeenCalled();
  });

  it("does not fire a change for undefined attributes", function() {
    this.cb = function() {};
    var spy = spyOn(this, 'cb');

    var model = new Backbone.Model({x: undefined});
    model.on('change:x', this.cb);
    model.unset('x');

    expect(spy).not.toHaveBeenCalled();
  });

  it("sets undefined values", function() {
    var model = new Backbone.Model({x: undefined});
    expect('x' in model.attributes).toBe(true);
  });

  it("shows hasChanged works outside of change events, and true within", function() {
    var model = new Backbone.Model({x: 1});
    model.on('change:x', function() {
      expect(model.hasChanged('x')).toBe(true);
      expect(model.get('x')).toBe(1);
    });
    model.set({x: 2}, {silent: true});
    expect(model.hasChanged()).toBe(true);
    expect(model.hasChanged('x')).toBe(true);
    model.set({x: 1});
    expect(model.hasChanged()).toBe(true);
    expect(model.hasChanged('x')).toBe(true);
  });

  it("shows hasChanged gets cleared on the following set", function() {
    var model = new Backbone.Model;
    model.set({x: 1});
    expect(model.hasChanged()).toBe(true);
    model.set({x: 1});
    expect(model.hasChanged()).toBe(false);
    model.set({x: 2});
    expect(model.hasChanged()).toBe(true);
    model.set({});
    expect(model.hasChanged()).toBe(false);
  });

  it("`hasChanged` for falsey keys", function() {
    var model = new Backbone.Model();
    model.set({x: true}, {silent: true});
    expect(model.hasChanged(0)).toBe(false);
    expect(model.hasChanged('')).toBe(false);
  });

  it("honors `previous` for falsey keys", function() {
    var model = new Backbone.Model({0: true, '': true});
    model.set({0: false, '': false}, {silent: true});
    expect(model.previous(0)).toBe(true);
    expect(model.previous('')).toBe(true);
  });

  it("honors nested `set` during `'change:attr'`", function() {
    var events = [];
    var model = new Backbone.Model();
    model.on('all', function(event) { events.push(event); });
    model.on('change', function() {
      model.set({z: true}, {silent:true});
    });
    model.on('change:x', function() {
      model.set({y: true});
    });
    model.set({x: true});
    expect(events).toEqual(['change:y', 'change:x', 'change']);
    events = [];
    model.set({z: true});
    expect(events).toEqual([]);
  });

  it("shows nested `change` only fires once", function() {
    var model = new Backbone.Model();
    this.cb = function() {model.set({x: true});};
    var spy = spyOn(this, 'cb');

    model.on('change', this.cb);
    model.set({x: true});

    expect(spy.calls.count()).toBe(1);
  });

  it("allows nested `set` during `'change'`", function() {
    this.cb = function() {};
    var spy = spyOn(this, 'cb');

    var count = 0;
    var model = new Backbone.Model();
    model.on('change', function() {
      switch(count++) {
        case 0:
          expect(this.changedAttributes()).toEqual({x: true});
          expect(model.previous('x')).toBe(undefined);
          model.set({y: true});
          break;
        case 1:
          expect(this.changedAttributes()).toEqual({x: true, y: true});
          expect(model.previous('x')).toBe(undefined);
          model.set({z: true});
          break;
        case 2:
          expect(this.changedAttributes()).toEqual({x: true, y: true, z: true});
          expect(model.previous('y')).toBe(undefined);
          break;
        default:
          this.cb();
      }
    });
    model.set({x: true});
    expect(spy).not.toHaveBeenCalled();
  });

  it("honors nested `change` with silent", function() {
    this.cb = function() {};
    var spy = spyOn(this, 'cb');

    var count = 0;
    var model = new Backbone.Model();
    model.on('change:y', this.cb);
    model.on('change', function() {
      switch(count++) {
        case 0:
          expect(this.changedAttributes()).toEqual({x: true});
          model.set({y: true}, {silent: true});
          model.set({z: true});
          break;
        case 1:
          expect(this.changedAttributes()).toEqual({x: true, y: true, z: true});
          break;
        case 2:
          expect(this.changedAttributes()).toEqual({z: false});
          break;
        default:
          this.cb();
      }
    });
    model.set({x: true});
    model.set({z: false});

    expect(spy).not.toHaveBeenCalled();
  });

  it("honors nested `change:attr` with silent", function() {
    this.cb = function() {};
    var spy = spyOn(this, 'cb');

    var model = new Backbone.Model();
    model.on('change:y', this.cb);
    model.on('change', function() {
      model.set({y: true}, {silent: true});
      model.set({z: true});
    });
    model.set({x: true});

    expect(spy).not.toHaveBeenCalled();
  });

  it("honors multiple nested changes with silent", function() {
    var model = new Backbone.Model();
    model.on('change:x', function() {
      model.set({y: 1}, {silent: true});
      model.set({y: 2});
    });
    model.on('change:y', function(model, val) {
      expect(val).toBe(2);
    });

    model.set({x: true});
  });

  it("honors multiple nested changes with silent", function() {
    var changes = [];
    var model = new Backbone.Model();
    model.on('change:b', function(model, val) { changes.push(val); });
    model.on('change', function() {
      model.set({b: 1});
    });
    model.set({b: 0});

    expect(changes).toEqual([0, 1]);
  });

  it("has basic silent change semantics", function() {
    this.cb = function() {};
    var spy = spyOn(this, 'cb');

    var model = new Backbone.Model;
    model.set({x: 1});
    model.on('change', this.cb);
    model.set({x: 2}, {silent: true});
    model.set({x: 1});

    expect(spy.calls.count()).toBe(1);
  });

  it("honors nested set multiple times", function() {
    this.cb = function() {};
    var spy = spyOn(this, 'cb');

    var model = new Backbone.Model();
    model.on('change:b', this.cb);
    model.on('change:a', function() {
      model.set({b: true});
      model.set({b: true});
    });
    model.set({a: true});

    expect(spy.calls.count()).toBe(1);
  });

  it("#1122 - clear does not alter options.", function() {
    var model = new Backbone.Model();
    var options = {};
    model.clear(options);
    expect(options.unset).toBeFalsy();
  });

  it("#1122 - unset does not alter options.", function() {
    var model = new Backbone.Model();
    var options = {};
    model.unset('x', options);
    expect(options.unset).toBeFalsy();
  });

  it("#1545 - `undefined` can be passed to a model constructor without coersion", function() {
    var Model = Backbone.Model.extend({
      defaults: { one: 1 },
      initialize : function(attrs, opts) {
        expect(attrs).toBe(undefined);
      }
    });
    var emptyattrs = new Model();
    var undefinedattrs = new Model(undefined);
  });

  it("#1664 - Changing from one value, silently to another, back to original triggers a change.", function() {
    this.cb = function() {};
    var spy = spyOn(this, 'cb');

    var model = new Backbone.Model({x:1});
    model.on('change:x', this.cb);
    model.set({x:2},{silent:true});
    model.set({x:3},{silent:true});
    model.set({x:1});

    expect(spy.calls.count()).toBe(1);
  });

  it("#1664 - multiple silent changes nested inside a change event", function() {
    var changes = [];
    var model = new Backbone.Model();
    model.on('change', function() {
      model.set({a:'c'}, {silent:true});
      model.set({b:2}, {silent:true});
      model.unset('c', {silent:true});
    });
    model.on('change:a change:b change:c', function(model, val) { changes.push(val); });
    model.set({a:'a', b:1, c:'item'});

    expect(changes).toEqual(['a',1,'item']);
    expect(model.attributes).toEqual({a: 'c', b: 2});
  });

  it("#1791 - `attributes` is available for `parse`", function() {
    var Model = Backbone.Model.extend({
      parse: function() {
        var self = this;
        expect(function() { self.has('a'); }).not.toThrow();
      } // shouldn't throw an error
    });
    var model = new Model(null, {parse: true});
  });

  it("silent changes in last `change` event back to original triggers change", function() {
    var changes = [];
    var model = new Backbone.Model();
    model.on('change:a change:b change:c', function(model, val) { changes.push(val); });
    model.on('change', function() {
      model.set({a:'c'}, {silent:true});
    });
    model.set({a:'a'});
    expect(changes).toEqual(['a']);
    model.set({a:'a'});
    expect(changes).toEqual(['a', 'a']);
  });

  it("#1943 change calculations should use _.isEqual", function() {
    var model = new Backbone.Model({a: {key: 'value'}});
    model.set('a', {key:'value'}, {silent:true});
    expect(model.changedAttributes()).toBe(false);
  });

  it("#1964 - final `change` event is always fired, regardless of interim changes", function () {
    this.cb = function() {};
    var spy = spyOn(this, 'cb');

    var model = new Backbone.Model();
    model.on('change:property', function() {
      model.set('property', 'bar');
    });
    model.on('change', this.cb);
    model.set('property', 'foo');

    expect(spy).toHaveBeenCalled();
  });

  it("isValid", function() {
    var model = new Backbone.Model({valid: true});
    model.validate = function(attrs) {
      if (!attrs.valid) return "invalid";
    };
    expect(model.isValid()).toBe(true);
    expect(model.set({valid: false}, {validate:true})).toBe(false);
    expect(model.isValid()).toBe(true);
    model.set({valid:false});
    expect(model.isValid()).toBe(false);
    expect(model.set('valid', false, {validate: true})).toBe(false);
  });

  it("#1179 - isValid returns true in the absence of validate.", function() {
    var model = new Backbone.Model();
    model.validate = null;
    expect(model.isValid()).toBe(true);
  });

  it("#1961 - Creating a model with {validate:true} will call validate and use the error callback", function () {
    var Model = Backbone.Model.extend({
      validate: function (attrs) {
        if (attrs.id === 1) return "This shouldn't happen";
      }
    });
    var model = new Model({id: 1}, {validate: true});
    expect(model.validationError).toBe("This shouldn't happen");
  });

  it("#2034 - nested set with silent only triggers one change", function() {
    var model = new Backbone.Model();
    this.cb = function() {model.set({b: true}, {silent: true});};
    var spy = spyOn(this, 'cb');

    model.on('change', this.cb);
    model.set({a: true});

    expect(spy.calls.count()).toBe(1);
  });
});


text:
@interface EditVC ()<UITableViewDataSource,UITableViewDelegate>
@property (weak, nonatomic) IBOutlet UITableView *tableview;
@property (strong, nonatomic) IBOutlet UIView *headview;
@property (weak, nonatomic) IBOutlet UILabel *ylabn;

@end

@implementation EditVC

{
    NSMutableArray *list;
}
#pragma mark ViewLife cyle

- (void)viewDidLoad {
    [super viewDidLoad];
    self.ylabn.text = NSLocalizedString(@"You can replace DR P3 radio preset by navigating to the category", nil);
    [self.tableview setTableHeaderView:self.headview];
    list = [@[@"Tuneln"]mutableCopy];
}

#pragma mark Action

#pragma mark Service

#pragma mark UITableViewDataSource

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{

    return [list count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"mycell"];
    if (!cell) {

        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"mycell"];
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        cell.backgroundColor = [UIColor clearColor];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    cell.textLabel.text = list[indexPath.row];

    return cell;
}

#pragma mark UITableViewDelegate
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 60;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

    TuneinVC *vc = [[TuneinVC alloc]init];
    vc.title = list[indexPath.row];
    [self.navigationController pushViewController:vc animated:YES];
}

@end


text:
/* Auto-generated config file peripheral_clk_config.h */
#ifndef PERIPHERAL_CLK_CONFIG_H
#define PERIPHERAL_CLK_CONFIG_H

// <<< Use Configuration Wizard in Context Menu >>>

/**
 * \def CONF_HCLK_FREQUENCY
 * \brief HCLK's Clock frequency
 */
#ifndef CONF_HCLK_FREQUENCY
#define CONF_HCLK_FREQUENCY 300000000
#endif

/**
 * \def CONF_FCLK_FREQUENCY
 * \brief FCLK's Clock frequency
 */
#ifndef CONF_FCLK_FREQUENCY
#define CONF_FCLK_FREQUENCY 300000000
#endif

/**
 * \def CONF_CPU_FREQUENCY
 * \brief CPU's Clock frequency
 */
#ifndef CONF_CPU_FREQUENCY
#define CONF_CPU_FREQUENCY 300000000
#endif

/**
 * \def CONF_SLCK_FREQUENCY
 * \brief Slow Clock frequency
 */
#define CONF_SLCK_FREQUENCY 0

/**
 * \def CONF_MCK_FREQUENCY
 * \brief Master Clock frequency
 */
#define CONF_MCK_FREQUENCY 150000000

/**
 * \def CONF_PCK6_FREQUENCY
 * \brief Programmable Clock Controller 6 frequency
 */
#define CONF_PCK6_FREQUENCY 1714285

// <h> USART Clock Settings
// <o> USART Clock source

// <0=> Master Clock (MCK)
// <1=> MCK / 8 for USART
// <2=> Programmable Clock Controller 4 (PMC_PCK4)
// <3=> External Clock
// <i> This defines the clock source for the USART
// <id> usart_clock_source
#ifndef CONF_USART1_CK_SRC
#define CONF_USART1_CK_SRC 0
#endif

// <o> USART External Clock Input on SCK <1-4294967295>
// <i> Inputs the external clock frequency on SCK
// <id> usart_clock_freq
#ifndef CONF_USART1_SCK_FREQ
#define CONF_USART1_SCK_FREQ 10000000
#endif

// </h>

/**
 * \def USART FREQUENCY
 * \brief USART's Clock frequency
 */
#ifndef CONF_USART1_FREQUENCY
#define CONF_USART1_FREQUENCY 150000000
#endif

#ifndef CONF_SRC_USB_480M
#define CONF_SRC_USB_480M 0
#endif

#ifndef CONF_SRC_USB_48M
#define CONF_SRC_USB_48M 1
#endif

// <y> USB Full/Low Speed Clock
// <CONF_SRC_USB_48M"> USB Clock Controller (USB_48M)
// <id> usb_fsls_clock_source
// <i> 48MHz clock source for low speed and full speed.
// <i> It must be available when low speed is supported by host driver.
// <i> It must be available when low power mode is selected.
#ifndef CONF_USBHS_FSLS_SRC
#define CONF_USBHS_FSLS_SRC CONF_SRC_USB_48M
#endif

// <y> USB Clock Source(Normal/Low-power Mode Selection)
// <CONF_SRC_USB_480M"> USB High Speed Clock (USB_480M)
// <CONF_SRC_USB_48M"> USB Clock Controller (USB_48M)
// <id> usb_clock_source
// <i> Select the clock source for USB.
// <i> In normal mode, use "USB High Speed Clock (USB_480M)".
// <i> In low-power mode, use "USB Clock Controller (USB_48M)".
#ifndef CONF_USBHS_SRC
#define CONF_USBHS_SRC CONF_SRC_USB_480M
#endif

/**
 * \def CONF_USBHS_FSLS_FREQUENCY
 * \brief USBHS's Full/Low Speed Clock Source frequency
 */
#ifndef CONF_USBHS_FSLS_FREQUENCY
#define CONF_USBHS_FSLS_FREQUENCY 48000000
#endif

/**
 * \def CONF_USBHS_FREQUENCY
 * \brief USBHS's Selected Clock Source frequency
 */
#ifndef CONF_USBHS_FREQUENCY
#define CONF_USBHS_FREQUENCY 480000000
#endif

// <<< end of configuration section >>>

#endif // PERIPHERAL_CLK_CONFIG_H


text:
//
//  PFMixButton.h
//  PFRadioButton
//
//  Created by PFei_He on 14-10-23.
//  Copyright (c) 2014年 PF-Lib. All rights reserved.
//
//  https://github.com/PFei-He/PFRadioButton
//
//  vesion: 0.1.0
//
//  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.
//

#import <UIKit/UIKit.h>

typedef enum {
    PFMixButtonStateNormal,    //普通状态
    PFMixButtonStateSelected,  //选中状态
}PFMixButtonState;

@class PFMixButton;

@protocol PFMixButtonDelegate <NSObject>

/**
 *  @brief 点击事件
 */
- (void)didSelect:(PFMixButton *)button;

@end

@interface PFMixButton : UIView

///按钮文字
@property (nonatomic, copy)     NSString                *text;

///按钮是否被选中
@property (nonatomic, assign)   BOOL                    selected;

///按钮状态
@property (nonatomic, assign)   PFMixButtonState        state;

///代理
@property (nonatomic, weak)     id<PFMixButtonDelegate> delegate;

/**
 *  @brief 设置按钮的尺寸
 *  @param imageFrame: 图片尺寸
 *  @param textFrame: 文字尺寸
 */
- (id)initWithFrame:(CGRect)frame imageFrame:(CGRect)imageFrame textFrame:(CGRect)textFrame;

/**
 * @brief 点击事件
 */
- (void)didSelect:(void (^)(PFMixButton *button))block;

@end


text:
package testutil

import (
	"github.com/hyperledger/fabric-protos-go/peer"
	"github.com/hyperledger/fabric/core/ledger/pvtdatapolicy"
	"github.com/hyperledger/fabric/core/ledger/pvtdatapolicy/mock"
)

// SampleBTLPolicy helps tests create a sample BTLPolicy
// The example input entry is [2]string{ns, coll}:btl
func SampleBTLPolicy(m map[[2]string]uint64) pvtdatapolicy.BTLPolicy {
	ccInfoRetriever := &mock.CollectionInfoProvider{}
	ccInfoRetriever.CollectionInfoStub = func(ccName, collName string) (*peer.StaticCollectionConfig, error) {
		btl := m[[2]string{ccName, collName}]
		return &peer.StaticCollectionConfig{BlockToLive: btl}, nil
	}
	return pvtdatapolicy.ConstructBTLPolicy(ccInfoRetriever)
}

type ErrorCausingBTLPolicy struct {
	Err error
}

func (p *ErrorCausingBTLPolicy) GetBTL(namespace string, collection string) (uint64, error) {
	return 0, p.Err
}

func (p *ErrorCausingBTLPolicy) GetExpiringBlock(namespace string, collection string, committingBlock uint64) (uint64, error) {
	return 0, p.Err
}


text:
package org.codehaus.groovy.binding;

import org.codehaus.groovy.runtime.InvokerHelper;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeEvent;

public class PropertyChangeProxyTargetBinding implements TargetBinding {
    Object proxyObject;
    String propertyName;
    PropertyChangeListener listener;

    public PropertyChangeProxyTargetBinding(Object proxyObject, String propertyName, PropertyChangeListener listener) {
        this.proxyObject = proxyObject;
        this.propertyName = propertyName;
        this.listener = listener;
    }

    public void updateTargetValue(Object value) {
        listener.propertyChange(new PropertyChangeEvent(proxyObject, propertyName,
                InvokerHelper.getProperty(proxyObject, propertyName), value));
    }
}


text:
* Fix yet another problem with loading spring which seems to affect
  some/all rbenv users. Issue #390.

## 1.3.2

* Fix another problem with gems bundled from git repositories. This
  affected chruby and RVM users, and possibly others. See #383.

## 1.3.1

* Fix a problem with gems bundled from a git repository, where the
  `bin/spring` was generated before 1.3.0.

## 1.3.0

* Automatically restart spring after new commands are added. This means
  that you can add spring-commands-rspec to your Gemfile and then
  immediately start using it, without having to run `spring stop`.
  (Spring will effectively run `spring stop` for you.)
* Make app reloading work in apps which spew out lots of output on
  startup (previously a buffer would fill up and cause the process to
  hang). Issue #332.
* Make sure running `bin/spring` does not add an empty string to `Gem.path`.
  Issues #297, #310.
* Fixed problem with `$0` including the command line args, which could
  confuse commands which try to parse `$0`. This caused the
  spring-commands-rspec to not work properly in some cases. Issue #369.
* Add OpenBSD compatibility for `spring status`. Issue #299.
* Rails 3.2 no longer officially supported (but it may continue to work)

## 1.2.0

* Accept -e and --environment options for `rails console`.
* Watch `config/secrets.yml` by default. #289 - @morgoth
* Change monkey-patched `Kernel.raise` from public to private (to match default Ruby behavior) #351 - @mattbrictson
* Let application_id also respect RUBY_VERSION for the use case of switching between Ruby versions for a given Rails app - @methodmissing
* Extract the 'listen' watcher to a separate `spring-watcher-listen`
  gem. This allows it to be developed/maintained separately.

## 1.1.3

* The `rails runner` command no longer passes environment switches to
  files which it runs. Issue #272.
* Various issues solved to do with termination / processes hanging around
  longer than they should. Issue #290.

## 1.1.2

* Detect old binstubs generated with Spring 1.0 and exit with an error.
  This prevents a situation where you can get stuck in an infinite loop
  of spring invocations.
* Avoid `warning: already initialized constant APP_PATH` when running
  rails commands that do not use spring (e.g. `bin/rails server` would
  emit this when you ^C to exit)
* Fix `reload!` in rails console
* Don't connect/disconnect the database if there are no connections
  configured. Issue #256.

## 1.1.1

* Fix `$0` so that it is no longer prefixed with "spring ", as doing
  this cause issues with rspec when running just `rspec` with no
  arguments.
* Ensure we're always connected to a tty when preloading the
  application in the background, in order to avoid loading issues
  with readline + libedit which affected pry-rails.

## 1.1.0

* A `bin/spring` binstub is now generated. This allows us to load spring
  correctly if you have it installed locally with a `BUNDLE_PATH`, so
  it's no longer necessary to install spring system-wide. We also
  activate the correct version from your Gemfile.lock. Note that you
  still can't have spring in your Gemfile as a git repository or local
  path; it must be a proper gem.
* Various changes to how springified binstubs are implemented. Existing
  binstubs will continue to work, but it's recommended to run `spring binstub`
  again to upgrade them to the new format.
* `spring binstub --remove` option added for removing spring from
  binstubs. This won't work unless you have upgraded your binstubs to
  the new format.
* `config/database.yml` is watched
* Better application restarts - if you introduce an error, for example
  by editing `config/application.rb`, spring will now continue to watch
  your files and will immediately try to restart the application when
  you edit `config/application.rb` again (hopefully to correct the error).
  This means that by the time you come to run a command the application
  may well already be running.
* Gemfile changes are now gracefully handled. Previously they would
  cause spring to simply quit, meaning that you'd incur the full startup
  penalty on the next run. Now spring doesn't quit, and will try to load
  up your new bundle in the background.
* Fix support for using spring with Rails engines/plugins

## 1.0.0

* Enterprise ready secret sauce added

## 0.9.2

* Bugfix: environment variables set by bundler (`BUNDLE_GEMFILE`,
  `RUBYOPT`, etc...) were being removed from the environment.
* Ensure we only run the code reloader when files have actually changed.
  This issue became more prominent with Rails 4, since Rails 4 will now
  reload routes whenever the code is reloaded (see
  https://github.com/rails/rails/commit/b9b06daa915fdc4d11e8cfe11a7175e5cd8f104f).
* Allow spring to be used in a descendant directory of the application
  root
* Use the system tmpdir for our temporary files. Previously we used
  `APP_ROOT/tmp/spring`, which caused problems on filesystems which did
  not support sockets, and also caused problems if `APP_ROOT` was
  sufficiently deep in the filesystem to exhaust the operating system's
  socket name limit. Hence we had a `SPRING_TMP_PATH` environment
  variable for configuration. We now use `/tmp/spring/[md5(APP_ROOT)]`
  for the socket and `/tmp/spring/[md5(APP_ROOT)].pid` for the pid file.
  Thanks @Kriechi for the suggestion. Setting `SPRING_TMP_PATH` no longer
  has any effect.

## 0.9.1

* Environment variables which were created during application startup are no
  longer overwritten.
* Support for generating multiple binstubs at once. Use --all to
  generate all, otherwise you can pass multiple command names to the
  binstub command.
* The `testunit` command has been extracted to the
  `spring-commands-testunit` gem, because it's not necessary in Rails 4,
  where you can just run `rake test path/to/test`.
* The `~/.spring.rb` config file is loaded before bundler, so it's a good
  place to require extra commands which you want to use in all projects,
  without having to add those commands to the Gemfile of each individual
  project.
* Any gems in the bundle with names which start with "spring-commands-"
  are now autoloaded. This makes it less faffy to add additional
  commands.

## 0.9.0

* Display spring version in the help message
* Remove workaround for Rubygems performance issue. This issue is solved
  with Rubygems 2.1, so we no longer need to generate a "spring" binstub
  file. We warn users if they are not taking advantage of the Rubygems
  perf fix (e.g. if they are not on 2.1, or haven't run `gem pristine
  --all`). To upgrade, delete your `bin/spring` and re-run `spring
  binstub` for each of your binstubs.
* Binstubs now fall back to non-spring execution of a command if the
  spring gem is not present. This might be useful for production
  environments.
* The ENV will be replaced on each run to match the ENV which exists
  when the spring command is actually run (rather than the ENV which
  exists when spring first starts).
* Specifying the rails env after the rake command (e.g. `rake
  RAILS_ENV=test db:migrate`) now works as expected.
* Provide an explicit way to set the environment to use when running
  `rake` on its own.
* The `rspec` and `cucumber` commands are no longer shipped by default.
  They've been moved to the `spring-commands-rspec` and
  `spring-commands-cucumber` gems.

## 0.0.11

* Added the `rails destroy` command.
* Global config file in `~/.spring.rb`
* Added logging for debugging. Specify a log file with the
  `SPRING_LOG` environment variable.
* Fix hang on "Run `bundle install` to install missing gems"
* Added hack to make backtraces generated when running a command
  quieter (by stripping out all of the lines relating to spring)
* Rails 4 is officially supported

## 0.0.10

* Added `Spring.watch_method=` configuration option to switch between
  polling and the `listen` gem. Previously, we used the `listen` gem if
  it was available, but this makes the option explicit. Set
  `Spring.watch_method = :listen` to use the listen gem.
* Fallback when Process.fork is not available. In such cases, the user
  will not receive the speedup that Spring provides, but won't receive
  an error either.
* Don't preload `test_helper` or `spec_helper` by default. This was
  causing people subtle problems (for example see #113) and is perhaps
  surprising behaviour. It may be desirable but it depends on the
  application, therefore we suggest it to people in the README but no
  longer do it by default.
* Don't stay connected to database in the application processes. There's
  no need to keep a connection open.
* Avoid using the database in the application processes. Previously,
  reloading the autoloaded constants would inadvertantly cause a
  connection to the database, which would then prevent tasks like
  db:create from running (because at that point the database doesn't
  exist)
* Removed ability to specify list of files for a command to preload. We
  weren't using this any more internally, and this is easy to do by
  placing requires in suitable locations in the Rails boot process
  (which is not explained in the README).
* Seed the random number generator on each run.

## 0.0.9

* Added `Spring::Commands::Rake.environment_matchers` for matching
  rake tasks to specific environments.
* Kill the spring server when the `Gemfile` or `Gemfile.lock` is
  changed. This forces a new server to boot up on the next run, which
  ensures that you get the correct gems (or the correct error message from
  bundler if you have forgotten to `bundle install`.)
* Fixed error when `Spring.watch` is used in `config/spring.rb`

## 0.0.8

* Renamed `spring test` to `spring testunit`.
* Implemented `spring rails` to replace `spring
  [console|runner|generate]`.
* `config/spring.rb` is only loaded in the server process, so you can
  require stuff from other gems there without performance implications.
* File watcher no longer pays attention to files outside of your
  application root directory.
* You can use the `listen` gem for less CPU intensive file watching. See
  README.


text:
namespace ExCSS
{
    internal sealed class BorderImageSourceProperty : Property
    {
        private static readonly IValueConverter StyleConverter = Converters.OptionalImageSourceConverter.OrDefault();

        internal BorderImageSourceProperty()
            : base(PropertyNames.BorderImageSource)
        {
        }

        internal override IValueConverter Converter => StyleConverter;
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Delts at Stanford University. See what our brothers are up to">
    <meta name="author" content="">

    <link rel="shortcut icon" type="image" href="./img/icon.png" />

    <title>Stanford Delt</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/agency.css" rel="stylesheet">

    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
    <link href='https://fonts.googleapis.com/css?family=Kaushan+Script' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700' rel='stylesheet' type='text/css'>

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                Stanford  ΔΤΔ

                        Home

                        Our Chapter

                        Social

                        Rush

                        Involvement

                        Alumni

Social

 It's no secret that Stanford's academics are pretty tough. The goal of our social programming is not meant to be a distraction from the importance of academics, but instead a method to balance a healthy social life that complements a great student. While we will perhaps never again in our lives be surrounded by greater academic resources, we will also perhaps never again in our lives be surrounded by such interesting, diverse, and passionate students - we place a great deal of importance on soaking up as much of that side of Stanford as possible as well!

 Delta Tau Delta hosts tailgates, all-campus parties, mixers, formals, and more. As the school year starts winding up, be sure to check below to see what we've got coming for you soon!

                Previous

                Next

Delta Tau Delta at Stanford University

                    Copyright © Stanford Delta Tau Delta 2016