text:
<?php

namespace Flarum\Api\Controller;

use Flarum\Event\ConfigurePostsQuery;
use Flarum\Post\PostRepository;
use Illuminate\Database\Eloquent\Builder;
use Psr\Http\Message\ServerRequestInterface;
use Tobscure\JsonApi\Document;
use Tobscure\JsonApi\Exception\InvalidParameterException;

class ListPostsController extends AbstractListController
{
    /**
     * {@inheritdoc}
     */
    public $serializer = 'Flarum\Api\Serializer\PostSerializer';

    /**
     * {@inheritdoc}
     */
    public $include = [
        'user',
        'user.groups',
        'editUser',
        'hideUser',
        'discussion'
    ];

    /**
     * {@inheritdoc}
     */
    public $sortFields = ['time'];

    /**
     * @var \Flarum\Post\PostRepository
     */
    protected $posts;

    /**
     * @param \Flarum\Post\PostRepository $posts
     */
    public function __construct(PostRepository $posts)
    {
        $this->posts = $posts;
    }

    /**
     * {@inheritdoc}
     */
    protected function data(ServerRequestInterface $request, Document $document)
    {
        $actor = $request->getAttribute('actor');
        $filter = $this->extractFilter($request);
        $include = $this->extractInclude($request);

        if ($postIds = array_get($filter, 'id')) {
            $postIds = explode(',', $postIds);
        } else {
            $postIds = $this->getPostIds($request);
        }

        $posts = $this->posts->findByIds($postIds, $actor);

        return $posts->load($include);
    }

    /**
     * {@inheritdoc}
     */
    protected function extractOffset(ServerRequestInterface $request)
    {
        $actor = $request->getAttribute('actor');
        $queryParams = $request->getQueryParams();
        $sort = $this->extractSort($request);
        $limit = $this->extractLimit($request);
        $filter = $this->extractFilter($request);

        if (($near = array_get($queryParams, 'page.near')) > 1) {
            if (count($filter) > 1 || ! isset($filter['discussion']) || $sort) {
                throw new InvalidParameterException(
                    'You can only use page[near] with filter[discussion] and the default sort order'
                );
            }

            $offset = $this->posts->getIndexForNumber($filter['discussion'], $near, $actor);

            return max(0, $offset - $limit / 2);
        }

        return parent::extractOffset($request);
    }

    /**
     * @param ServerRequestInterface $request
     * @return array
     * @throws InvalidParameterException
     */
    private function getPostIds(ServerRequestInterface $request)
    {
        $filter = $this->extractFilter($request);
        $sort = $this->extractSort($request);
        $limit = $this->extractLimit($request);
        $offset = $this->extractOffset($request);

        $query = $this->posts->query();

        $this->applyFilters($query, $filter);

        $query->skip($offset)->take($limit);

        foreach ((array) $sort as $field => $order) {
            $query->orderBy($field, $order);
        }

        return $query->pluck('id')->all();
    }

    /**
     * @param Builder $query
     * @param array $filter
     */
    private function applyFilters(Builder $query, array $filter)
    {
        if ($discussionId = array_get($filter, 'discussion')) {
            $query->where('discussion_id', $discussionId);
        }

        if ($number = array_get($filter, 'number')) {
            $query->where('number', $number);
        }

        if ($userId = array_get($filter, 'user')) {
            $query->where('user_id', $userId);
        }

        if ($type = array_get($filter, 'type')) {
            $query->where('type', $type);
        }

        event(new ConfigurePostsQuery($query, $filter));
    }
}


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

<title>RangeFinder</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="date" content="2018-04-23">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../jquery/jquery-ui.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

SEARCH:
<input type="text" id="search" value=" " disabled="disabled">
<input type="reset" id="reset" value=" " disabled="disabled">

JavaScript is disabled on your browser.

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

Package lejos.robotics

Interface RangeFinder

<map id="G" name="G">
<area shape="rect" id="node1_0" href="./RangeFinder.html" title="lejos.robotics.RangeFinder" alt="" coords="89,11,221,108"/>
<area shape="rect" id="node1" href="./RangeFinder.html" title="<TABLE>" alt="" coords="78,5,231,113"/>
<area shape="rect" id="node2_1" href="./RangeFinderAdapter.html" title="lejos.robotics.RangeFinderAdapter" alt="" coords="16,167,293,264"/>
<area shape="rect" id="node2" href="./RangeFinderAdapter.html" title="<TABLE>" alt="" coords="5,161,304,269"/>
</map>

All Known Implementing Classes:

RangeFinderAdapter

public interface RangeFinder

Abstraction for a range finder sensor that returns the distance to the nearest object

See Also:

RangeScanner

Method Summary

All Methods Instance Methods Abstract Methods

Modifier and Type
Method and Description

float
getRange()

Get the range to the nearest object

float[]
getRanges()

If the sensor is capable, this method returns multiple range values from a single scan.

Method Detail

getRange

float getRange()

Get the range to the nearest object

Returns:

the distance to the nearest object

getRanges

float[] getRanges()

If the sensor is capable, this method returns multiple range values from a single scan. Sensors that can only
 return a single value should return an array containing a single value.

Returns:

an array of ranges, ordered from closest to farthest.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

JavaScript is disabled on your browser.

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

redpajama_set_name: RedPajamaGithub


text:
package edu.ucla.wise.emailscheduler;

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

import org.apache.log4j.Logger;

import edu.ucla.wise.commons.StudySpace;
import edu.ucla.wise.commons.StudySpaceMap;
import edu.ucla.wise.initializer.WiseProperties;

public class StudySpaceFetcher {

    private static final Logger LOGGER = Logger.getLogger(StudySpaceFetcher.class);

    public static List<StudySpace> getStudySpaces(String appName, WiseProperties properties) {

        LOGGER.info("Fetching study spaces for application " + appName);

        ArrayList<StudySpace> startConfigList = new ArrayList<StudySpace>();

        // start the email sending procedure
        java.util.Date today = new java.util.Date();

        LOGGER.info("Launching Email Manager on " + today.toString() + " for studies assigned to " + appName
                + " on this server.");

        StudySpace[] allSpaces;

        try {
            allSpaces = StudySpaceMap.getInstance().getAll();

            LOGGER.info("Found " + allSpaces.length + " study spaces");

            for (StudySpace studySpace : allSpaces) {

                startConfigList.add(studySpace);
            }

        } catch (RuntimeException e) {
            LOGGER.error(" --> Emailer err - Can't get study_spaces: ", e);
        }

        return startConfigList;
    }
}


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

import javax.annotation.Generated;

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

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

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

    private static final MarshallingInfo<StructuredPojo> PATCH_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("Patch").build();
    private static final MarshallingInfo<StructuredPojo> PATCHSTATUS_BINDING = MarshallingInfo.builder(MarshallingType.STRUCTURED)
            .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("PatchStatus").build();

    private static final EffectivePatchMarshaller instance = new EffectivePatchMarshaller();

    public static EffectivePatchMarshaller getInstance() {
        return instance;
    }

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

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

        try {
            protocolMarshaller.marshall(effectivePatch.getPatch(), PATCH_BINDING);
            protocolMarshaller.marshall(effectivePatch.getPatchStatus(), PATCHSTATUS_BINDING);
        } catch (Exception e) {
            throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
        }
    }

}


text:
.class Lcom/quizup/core/activities/EndGameActivity$6;
.super Ljava/lang/Object;
.source ""

# interfaces
.implements Ljava/lang/Runnable;

# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/quizup/core/activities/EndGameActivity;->setMatchDetails(Lo/ⅹ;Lo/ⅹ;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Lcom/quizup/core/activities/EndGameActivity;

.field final synthetic val$opponentChartData:Lo/ナ;

.field final synthetic val$playerChartData:Lo/ナ;

# direct methods
.method constructor <init>(Lcom/quizup/core/activities/EndGameActivity;Lo/ナ;Lo/ナ;)V
    .locals 0

    .line 1200
    iput-object p1, p0, Lcom/quizup/core/activities/EndGameActivity$6;->this$0:Lcom/quizup/core/activities/EndGameActivity;

    iput-object p2, p0, Lcom/quizup/core/activities/EndGameActivity$6;->val$playerChartData:Lo/ナ;

    iput-object p3, p0, Lcom/quizup/core/activities/EndGameActivity$6;->val$opponentChartData:Lo/ナ;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public run()V
    .locals 5

    .line 1204
    iget-object v0, p0, Lcom/quizup/core/activities/EndGameActivity$6;->this$0:Lcom/quizup/core/activities/EndGameActivity;

    const v1, 0x7f090053

    invoke-virtual {v0, v1}, Lcom/quizup/core/activities/EndGameActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/quizup/lib/widgets/chart/Chart;

    .line 1205
    move-object v4, v0

    iget-object v1, p0, Lcom/quizup/core/activities/EndGameActivity$6;->val$playerChartData:Lo/ナ;

    iget-object v2, p0, Lcom/quizup/core/activities/EndGameActivity$6;->val$opponentChartData:Lo/ナ;

    invoke-virtual {v4}, Lcom/quizup/lib/widgets/chart/Chart;->getWidth()I

    move-result v3

    invoke-virtual {v0, v1, v2, v3}, Lcom/quizup/lib/widgets/chart/Chart;->setData(Lo/ナ;Lo/ナ;I)V

    .line 1206
    return-void
.end method


text:
/**
 *
 */
package com.google.code.morphia.mapping;

import java.io.Serializable;
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.google.code.morphia.EntityInterceptor;
import com.google.code.morphia.annotations.Embedded;
import com.google.code.morphia.annotations.Entity;
import com.google.code.morphia.annotations.EntityListeners;
import com.google.code.morphia.annotations.Id;
import com.google.code.morphia.annotations.Polymorphic;
import com.google.code.morphia.annotations.PostLoad;
import com.google.code.morphia.annotations.PostPersist;
import com.google.code.morphia.annotations.PreLoad;
import com.google.code.morphia.annotations.PrePersist;
import com.google.code.morphia.annotations.PreSave;
import com.google.code.morphia.annotations.Property;
import com.google.code.morphia.annotations.Reference;
import com.google.code.morphia.annotations.Transient;
import com.google.code.morphia.annotations.Version;
import com.google.code.morphia.logging.MorphiaLogger;
import com.google.code.morphia.logging.MorphiaLoggerFactory;
import com.google.code.morphia.mapping.validation.MappingValidator;
import com.google.code.morphia.utils.ReflectionUtils;
import com.mongodb.DBObject;

/**
 * Represents a mapped class between the MongoDB DBObject and the java POJO.
 *
 * This class will validate classes to make sure they meet the requirement for persistence.
 *
 * @author Scott Hernandez
 */
@SuppressWarnings("unchecked")
public class MappedClass {
	private static final MorphiaLogger log = MorphiaLoggerFactory.get(MappedClass.class);

	private static class ClassMethodPair {
		Class<?> clazz;
		Method method;

		public ClassMethodPair(Class<?> c, Method m) { clazz = c; method =m ; }
	}

	/** special fields representing the Key of the object */
	private Field idField;

	/** special annotations representing the type the object */
	private Entity entityAn;
	private Embedded embeddedAn;
	//    private Polymorphic polymorphicAn;

	/** Annotations we are interested in looking for. */
	public static List<Class<? extends Annotation>> interestingAnnotations = new ArrayList<Class<? extends Annotation>>(
			Arrays.asList(Embedded.class, Entity.class, Polymorphic.class, EntityListeners.class, Version.class));
	/** Annotations we were interested in, and found. */
	private Map<Class<? extends Annotation>, Annotation> releventAnnotations = new HashMap<Class<? extends Annotation>, Annotation>();

	/** Methods which are lifecycle events */
	private Map<Class<? extends Annotation>, List<ClassMethodPair>> lifecycleMethods = new HashMap<Class<? extends Annotation>, List<ClassMethodPair>>();

	/** the collectionName based on the type and @Entity value(); this can be overriden by the @CollectionName field on the instance*/
	private String collName;

	/** a list of the fields to map */
	private List<MappedField> persistenceFields = new ArrayList<MappedField>();

	/** the type we are mapping to/from */
	private Class clazz;
	private Constructor ctor;
	Mapper mapr;

	/** constructor */
	public MappedClass(Class clazz, Mapper mapr) {
		this.mapr = mapr;
		this.clazz = clazz;
		discover();
	}

	/** Discovers interesting (that we care about) things about the class. */
	protected void discover() {
		for (Class<? extends Annotation> c : interestingAnnotations) {
			addAnnotation(c);
		}

		Class type = clazz;

		//allows private/protected constructors
		try {
			ctor = type.getDeclaredConstructor();
			ctor.setAccessible(true);
		} catch (NoSuchMethodException e) {
			throw new MappingException("" + type.getName() + " cannot be used; It does not have a no-args constructor.", e);
		}
		List<Class<?>> lifecycleClasses = new ArrayList<Class<?>>();
		lifecycleClasses.add(clazz);

		EntityListeners entityLisAnn = (EntityListeners) releventAnnotations.get(EntityListeners.class);
		if (entityLisAnn != null && entityLisAnn.value() != null && entityLisAnn.value().length != 0)
			for (Class<?> c : entityLisAnn.value())
				lifecycleClasses.add(c);

		Class<? extends Annotation>[] lifecycleAnnotations = new Class[] {PrePersist.class, PreSave.class, PostPersist.class, PreLoad.class, PostLoad.class};
		for (Class<?> cls : lifecycleClasses) {
			for (Method m : ReflectionUtils.getDeclaredAndInheritedMethods(cls)) {
				for(Class<? extends Annotation> c : lifecycleAnnotations) {
					if (m.isAnnotationPresent(c)) {
						addLifecycleEventMethod(c, m, cls.equals(clazz) ? null : cls);
					}
				}

			}
		}

		embeddedAn = (Embedded)releventAnnotations.get(Embedded.class);
		entityAn = (Entity)releventAnnotations.get(Entity.class);
		//        polymorphicAn = (Polymorphic) releventAnnotations.get(Polymorphic.class);
		collName = (entityAn == null || entityAn.value().equals(Mapper.IGNORED_FIELDNAME)) ? clazz.getSimpleName() : entityAn.value();

		for (Field field : ReflectionUtils.getDeclaredAndInheritedFields(clazz, true)) {
			field.setAccessible(true);
			int fieldMods = field.getModifiers();
			if (field.isAnnotationPresent(Transient.class))
				continue;
			else if ( field.isSynthetic() && (fieldMods & Modifier.TRANSIENT) == Modifier.TRANSIENT )
				continue;
			else if (mapr.getOptions().actLikeSerializer && ((fieldMods & Modifier.TRANSIENT) == Modifier.TRANSIENT))
				continue;
			else if (mapr.getOptions().ignoreFinals && ((fieldMods & Modifier.FINAL) == Modifier.FINAL))
				continue;
			else if (field.isAnnotationPresent(Id.class)) {
					idField = field;
					MappedField mf = new MappedField(idField);
					persistenceFields.add(mf);
			} else if (	field.isAnnotationPresent(Property.class) ||
						field.isAnnotationPresent(Reference.class) ||
						field.isAnnotationPresent(Embedded.class) ||
						isSupportedType(field.getType()) ||
						ReflectionUtils.implementsInterface(field.getType(), Serializable.class)) {
				persistenceFields.add(new MappedField(field));
			} else {
				if(mapr.getOptions().defaultFieldAnnotation != null)
					persistenceFields.add(new MappedField(field));
				else
					log.warning("Ignoring (will not persist) field: " + clazz.getName() + "." + field.getName() + " [type:" + field.getType().getName() + "]");
			}
		}
	}

	private void addLifecycleEventMethod(Class<? extends Annotation> lceClazz, Method m, Class<?> clazz) {
		ClassMethodPair cm = new ClassMethodPair(clazz, m);
		if (lifecycleMethods.containsKey(lceClazz))
			lifecycleMethods.get(lceClazz).add(cm);
		else {
			ArrayList<ClassMethodPair> methods = new ArrayList<ClassMethodPair>();
			methods.add(cm);
			lifecycleMethods.put(lceClazz, methods);
		}
	}

	public List<ClassMethodPair> getLifecycleMethods(Class<Annotation> clazz) {
		return lifecycleMethods.get(clazz);
	}

	/**
	 * Adds the annotation, if it exists on the field.
	 * @param clazz
	 */
	private void addAnnotation(Class<? extends Annotation> c) {
		Annotation ann = ReflectionUtils.getAnnotation(getClazz(), c);
		if (ann != null)
			releventAnnotations.put(c, ann);
	}

	@Override
	public String toString() {
		return "MappedClass - kind:" + this.getCollectionName() + " for " + this.getClazz().getName() + " fields:" + persistenceFields;
	}

	/** Returns fields annotated with the clazz */
	public List<MappedField> getFieldsAnnotatedWith(Class<? extends Annotation> clazz){
		List<MappedField> results = new ArrayList<MappedField>();
		for(MappedField mf : persistenceFields){
			if(mf.mappingAnnotations.containsKey(clazz))
				results.add(mf);
		}
		return results;
	}

	/** Returns the MappedField by the name that it will stored in mongodb as*/
	public MappedField getMappedField(String storedName) {
		for(MappedField mf : persistenceFields)
			for(String n : mf.getLoadNames())
				if (storedName.equals(n))
					return mf;

		return null;
	}

	/** Check java field name that will stored in mongodb */
	public boolean containsJavaFieldName(String name) {
		return getMappedField(name)!=null;
	}
	/** Returns MappedField for a given java field name on the this MappedClass */
	public MappedField getMappedFieldByJavaField(String name) {
		for(MappedField mf : persistenceFields)
			if (name.equals(mf.getJavaFieldName())) return mf;

		return null;
	}

	/** Checks to see if it a Map/Set/List or a property supported by the MangoDB java driver*/
	public static boolean isSupportedType(Class clazz) {
		if (ReflectionUtils.isPropertyType(clazz)) return true;
		if (clazz.isArray() || ReflectionUtils.implementsAnyInterface(clazz,
				Iterable.class,
				Collection.class,
				List.class,
				Set.class,
				Map.class)){
			Class subType = null;
			if (clazz.isArray()) subType = clazz.getComponentType();
			else subType = ReflectionUtils.getParameterizedClass(clazz);

			//get component type, String.class from List<String>
			if (subType != null && subType != Object.class && !ReflectionUtils.isPropertyType(subType))
				return false;

			//either no componentType or it is an allowed type
			return true;
		}
		return false;
	}

	@SuppressWarnings("deprecation")
	public void validate() {
		new MappingValidator().validate(this);
	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof Class) return equals((Class)obj);
		else if (obj instanceof MappedClass) return equals((MappedClass)obj);
		else return false;
	}

	public boolean equals(MappedClass clazz) {
		return this.getClazz().equals(clazz);
	}

	public boolean equals(Class clazz) {
		return this.getClazz().equals(clazz);
	}

	/** Call the lifcycle methods */
	public DBObject callLifecycleMethods(Class<? extends Annotation> event, Object entity, DBObject dbObj, Mapper mapr) {
		List<ClassMethodPair> methodPairs = getLifecycleMethods((Class<Annotation>)event);
		DBObject retDbObj = dbObj;
		try
		{
			Object tempObj = null;
			if (methodPairs != null) {
				HashMap<Class<?>, Object> toCall = new HashMap<Class<?>, Object>((int) (methodPairs.size()*1.3));
				for (ClassMethodPair cm : methodPairs)
					toCall.put(cm.clazz, null);
				for (Class<?> c : toCall.keySet())
					if (c != null)
						toCall.put(c, ReflectionUtils.createInstance(c));

				for (ClassMethodPair cm: methodPairs) {
					Method method = cm.method;
					Class<?> type = cm.clazz;

					Object inst = toCall.get(type);
					method.setAccessible(true);
					log.debug("Calling lifecycle method(@" + event.getSimpleName() + " " + method + ") on " + inst + "");
					if (inst == null)
						if (method.getParameterTypes().length == 0)
							tempObj = method.invoke(entity);
						else
							tempObj = method.invoke(entity, retDbObj);
					else
						if (method.getParameterTypes().length == 0)
							tempObj = method.invoke(inst);
						else if (method.getParameterTypes().length == 1)
							tempObj = method.invoke(inst, entity);
						else
							tempObj = method.invoke(inst, entity, retDbObj);

					if (tempObj != null)
						retDbObj = (DBObject) tempObj;
				}
			}

			callGlobalInterceptors(event, entity, dbObj, mapr, mapr.getInterceptors());
		}
		catch (IllegalAccessException e) { throw new RuntimeException(e); }
		catch (InvocationTargetException e) { throw new RuntimeException(e); }

		return retDbObj;
	}

	private void callGlobalInterceptors(Class<? extends Annotation> event, Object entity, DBObject dbObj, Mapper mapr,
			Collection<EntityInterceptor> interceptors) {
		for (EntityInterceptor ei : interceptors) {
			log.debug("Calling interceptor method " + event.getSimpleName() + " on " + ei);

			if 		(event.equals(PreLoad.class)) 		ei.preLoad(entity, dbObj, mapr);
			else if (event.equals(PostLoad.class)) 		ei.postLoad(entity, dbObj, mapr);
			else if	(event.equals(PrePersist.class)) 	ei.prePersist(entity, dbObj, mapr);
			else if	(event.equals(PreSave.class)) 		ei.preSave(entity, dbObj, mapr);
			else if (event.equals(PostPersist.class))	ei.postPersist(entity, dbObj, mapr);
		}
	}

	/** @return the idField */
	public Field getIdField() {
		return idField;
	}

	/**
	 * @return the entityAn
	 */
	public Entity getEntityAnnotation() {
		return entityAn;
	}

	/**
	 * @return the embeddedAn
	 */
	public Embedded getEmbeddedAnnotation() {
		return embeddedAn;
	}

	//    public Polymorphic getPolymorphicAnnotation() {
	//        return polymorphicAn;
	//    }

	/**
	 * @return the releventAnnotations
	 */
	public Map<Class<? extends Annotation>, Annotation> getReleventAnnotations() {
		return releventAnnotations;
	}

	/**
	 * @return the persistenceFields
	 */
	public List<MappedField> getPersistenceFields() {
		return persistenceFields;
	}

	/**
	 * @return the collName
	 */
	public String getCollectionName() {
		return collName;
	}

	/**
	 * @return the clazz
	 */
	public Class getClazz() {
		return clazz;
	}

	/** @return the constructor for this mapped class */
	public Constructor getCTor() {
		return ctor;
	}

	/** @return the Mapper this class is bound to */
	public Mapper getMapper(){
		return mapr;
	}

	public MappedField getMappedIdField() {
		return getFieldsAnnotatedWith(Id.class).get(0);
	}

}


text:
Uint32 Stopwatch::stop()
{
    if(running)
    {
        elapsed += SDL_GetTicks() - startTime;
        running = false;
    }
    return elapsed;
}

Uint32 Stopwatch::read()
{
    if(running)
    {
        Uint32 now = SDL_GetTicks();
        elapsed += now - startTime;
        startTime = now;
    }
    return elapsed;
}


text:
hoverctl start
hoverctl mode simulate
hoverctl import simulationimport.json
curl --proxy http://localhost:8500 http://echo.jsontest.com/foo/QUX/bar/spam
hoverctl stop


text:
/**
 * Created by Moyu on 16/10/20.
 */
import React from 'react';
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import {Link} from 'react-router'
import {Map} from 'immutable'

import Item from '../Item'

class ItemsBox extends React.Component {
    constructor(props) {
        super(props);
    }
    shouldComponentUpdate(nextProps, nextState, nextContext) {
        return !Map(this.props).equals(Map(nextProps));
    }
    componentWillUpdate(nextProps, nextState, nextContext) {

    }
    componentWillReceiveProps(nextProps) {}
    componentDidMount() {
        document.body.scrollTop = 0;
        const {scroll} = this.props;
        if(scroll) {
            // document.body.scrollTop = 0;
        } else {
            // let text = sessionStorage['@@History/'+this.context.location.key]
            // if(!!text) {
            //     // document.body.scrollTop = JSON.parse(text).top
            // }
        }
        if(this.refs.ul) {
            // this.refs.ul.style.visibility = 'hidden';
            setTimeout(()=> {
                if (this && this.refs && this.refs.ul) {
                    this.refs.ul.classList.remove('active')
                    // this.refs.ul.classList.add('fadeIn')
                    this.refs.ul.style.visibility = '';
                }
            }, 1200)

        }
    }
    componentDidUpdate(prevProps, prevState) {}
    componentWillUnmount() {

    }
    static defaultProps = {
        scroll: true
    }

    static contextTypes = {
        router: React.PropTypes.object.isRequired,
    }
    render() {
        const {items, btnText, hoverHandler, big} = this.props;
        if(!big) {
            return (

                    {
                        items.map((item, i)=>
                            <Item key={i} {...item} btnText={btnText} hoverHandler={hoverHandler}/>
                        )
                    }

            )
        } else {
            const {author_name, author_img, logo, publisher, author_url} = this.props;
            return (

                    {
                        items && items.map((item, i)=>

                            <Link onClick={e=>{
                                {/*this.context.router.setState({top: document.body.scrollTop});*/}
                            }} className="card__link" to={{pathname: item.href}} itemProp="url">

                                    {author_name}
                                    {author_url}

                                        {author_img}

                                    500500

                                <meta itemProp="mainEntityOfPage" content={item.href}/>

                                    {publisher}

                                        <meta itemProp="url" content={logo} />
                                        {/*<meta itemProp="width" content="50" />*/}
                                        {/*<meta itemProp="height" content="50" />*/}

                                <meta itemProp="description" content={item.summary+'...'}/>

{item.title}

{item.text}

                                    {btnText}

                            </Link>

                        )
                    }

            )
        }
    }

}

export default ItemsBox;


text:
<?xml version="1.0" encoding="UTF-8"?>
<article id="1011">
	<title>Information Network Prospects in the United States	</title>
	<author>Becker, J.	</author>
	<text>
		                Unmistakable signs are pointing the way toward
		the creation sometime soon of a national information network
		in the United States.  The concept of a national network implies
		the interconnection of existing information systems and libraries
		through communications.  Certainly one of the great strengths of this
		nation is the great array of intellectual, scholarly, and research
		resources to be found in its libraries and information centers.
		Without integration and close cooperation, however, these resources
		will remain a series of separate, insulated institutions.  But if
		maximum communication can be established among them, this array can
		be converted into a national resource of immense value to citizens
		throughout the country.
	</text>
</article>


text:
package org.terasology.logic.common;

import com.google.common.collect.Sets;
import org.terasology.entitySystem.Component;
import org.terasology.network.Replicate;

import java.util.Set;

/**
 * This component is intended to list component classes that are supposed to be retained when converting between blocks
 * and block items.
 * <p>
 * If a block (item) entity has a component that is not part of its prefab, retaining this component results in the block
 * entity still having this component afterwards. If not retained, it is likely to be removed instead.
 */
public class RetainComponentsComponent implements Component {
    @Replicate
    public Set<Class<? extends Component>> components = Sets.newHashSet();
}


text:
/*****************************************************************************/
/*!
 * \file expr_value.h
 *
 * Author: Sergey Berezin
 *
 * Created: Fri Feb  7 15:07:18 2003
 *
 *

 *
 * License to use, copy, modify, sell and/or distribute this software
 * and its documentation for any purpose is hereby granted without
 * royalty, subject to the terms and conditions defined in the \ref
 * LICENSE file provided with this distribution.
 *
 *

 *
 * Class ExprValue: the value holding class of Expr.  No one should
 * use it directly; use Expr API instead.  To enforce that, the
 * constructors are made protected, and only Expr, ExprManager, and
 * subclasses can use them.
 */
/*****************************************************************************/

// *** HACK ATTACK *** (trick from Aaron Stump's code)

// In order to inline the Expr constructors (for efficiency), this
// file (expr_value.h) must be included in expr.h.  However, we also
// need to include expr.h here, hence, circular dependency.  A way to
// break it is to include expr_value.h in the middle of expr.h after
// the definition of class Expr, but before the definition of its
// inlined methods.  So, expr.h included below will also suck in
// expr_value.h recursively, meaning that we then should skip the rest
// of the file (since it's already been included).

// That's why expr.h is outside of #ifndef.  The same is true for
// type.h and theorem.h.

#ifndef _cvc3__expr_h_
#include "expr.h"
#endif

#ifndef _cvc3__expr_value_h_
#define _cvc3__expr_value_h_

#include "theorem.h"
#include "type.h"

// The prime number used in the hash function for a vector of elements
#define PRIME 131

namespace CVC3 {

/*****************************************************************************/
/*!
 *\class ExprValue
 *\brief The base class for holding the actual data in expressions
 *
 *
 * Author: Sergey Berezin
 *
 * Created: long time ago
 *
 * \anchor ExprValue The base class just holds the operator.
 * All the additional data resides in subclasses.
 *
 */
/*****************************************************************************/
class CVC_DLL ExprValue {
  friend class Expr;
  friend class Expr::iterator;
  friend class ExprManager;
  friend class ::CInterface;
  friend class ExprApply;
  friend class Theorem;
  friend class ExprClosure;

  //! Unique expression id
  ExprIndex d_index;

  //! Reference counter for garbage collection
  unsigned d_refcount;

  //! Cached hash value (initially 0)
  size_t d_hash;

  //! The find attribute (may be NULL)
  CDO<Theorem>* d_find;

  //! Equality between this term and next term in ring of all terms in the equivalence class
  CDO<Theorem>* d_eqNext;

  //! The cached type of the expression (may be Null)
  Type d_type;

  //! The cached TCC of the expression (may be Null)
  //  Expr d_tcc;

  //! Subtyping predicate for the expression and all subexpressions
  //  Theorem d_subtypePred;

  //! Notify list may be NULL (== no such attribute)
  NotifyList* d_notifyList;

  //! For caching calls to Simplify
  Theorem d_simpCache;

  //! For checking whether simplify cache is valid
  unsigned d_simpCacheTag;

  //! context-dependent bit-vector for flags that are context-dependent
  CDFlags d_dynamicFlags;

  //! Size of dag rooted at this expression
  Unsigned d_size;

  //! Which child has the largest height
  //  int d_highestKid;

  //! Most distant expression we were simplified *from*
  //  Expr d_simpFrom;

  //! Generic flag for marking expressions (e.g. in DAG traversal)
  unsigned d_flag;

protected:
  /*! @brief The kind of the expression.  In particular, it determines which
   * subclass of ExprValue is used to store the expression. */
  int d_kind;

  //! Our expr. manager
  ExprManager* d_em;

  // End of data members

private:

  //! Set the ExprIndex
  void setIndex(ExprIndex idx) { d_index = idx; }

  //! Increment reference counter
  void incRefcount() { ++d_refcount; }

  //! Decrement reference counter
  void decRefcount() {
    // Cannot be DebugAssert, since we are called in a destructor
    // and should not throw an exception
    IF_DEBUG(FatalAssert(d_refcount > 0, "Mis-handled the ref. counting");)
    if((--d_refcount) == 0) d_em->gc(this);
  }

  //! Caching hash function
  /*! Do NOT implement it in subclasses! Implement computeHash() instead.
   */
  size_t hash() const {
    if (d_hash == 0)
      const_cast<ExprValue*>(this)->d_hash = computeHash();
    return d_hash;
  }

  //! Return DAG-size of Expr
  Unsigned getSize() const {
    if (d_flag == d_em->getFlag()) return 0;
    const_cast<ExprValue*>(this)->d_flag = d_em->getFlag();
    return computeSize();
  }

  //! Return child with greatest height
  //  int getHighestKid() const { return d_highestKid; }

  //! Get Expr simplified to obtain this expr
  //  const Expr& getSimpFrom() const { return d_simpFrom; }

  //! Set Expr simplified to obtain this expr
  //  void setSimpFrom(const Expr& simpFrom) { d_simpFrom = simpFrom; }

protected:

  // Static hash functions.  They don't depend on the context
  // (ExprManager and such), so it is still thread-safe to have them
  // static.
  static std::hash<char*> s_charHash;
  static std::hash<long int> s_intHash;

  static size_t pointerHash(void* p) { return s_intHash((long int)p); }
  // Hash function for subclasses with children
  static size_t hash(const int kind, const std::vector<Expr>& kids);
  // Hash function for kinds
  static size_t hash(const int n) { return s_intHash((long int)n); }

  // Size function for subclasses with children
  static Unsigned sizeWithChildren(const std::vector<Expr>& kids);

  //! Return the memory manager (for the benefit of subclasses)
  MemoryManager* getMM(size_t MMIndex) {
    DebugAssert(d_em!=NULL, "ExprValue::getMM()");
    return d_em->getMM(MMIndex);
  }

  //! Make a clean copy of itself using the given ExprManager
  ExprValue* rebuild(ExprManager* em) const
    { return copy(em, 0); }

  //! Make a clean copy of the expr using the given ExprManager
  Expr rebuild(Expr e, ExprManager* em) const
    { return em->rebuildRec(e); }

  // Protected API

  //! Non-caching hash function which actually computes the hash.
  /*! This is the method that all subclasses should implement */
  virtual size_t computeHash() const { return hash(d_kind); }

  //! Non-caching size function which actually computes the size.
  /*! This is the method that all subclasses should implement */
  virtual Unsigned computeSize() const { return 1; }

  //! Make a clean copy of itself using the given ExprManager
  virtual ExprValue* copy(ExprManager* em, ExprIndex idx) const;

public:
  //! Constructor
  ExprValue(ExprManager* em, int kind, ExprIndex idx = 0)
    : d_index(idx), d_refcount(0),
      d_hash(0), d_find(NULL), d_eqNext(NULL), d_notifyList(NULL),
      d_simpCacheTag(0),
      d_dynamicFlags(em->getCurrentContext()),
      d_size(0),
      //      d_height(0), d_highestKid(-1),
      d_flag(0), d_kind(kind), d_em(em)
  {
    DebugAssert(em != NULL, "NULL ExprManager is given to ExprValue()");
    DebugAssert(em->isKindRegistered(kind),
                ("ExprValue(kind = " + int2string(kind)
                 + ")): kind is not registered").c_str());
    DebugAssert(kind != APPLY, "Only ExprApply should have APPLY kind");
// #ifdef _CVC3_DEBUG_MODE //added by yeting, just hold a place to put my breakpoints in gdb
//     if(idx != 0){
//       TRACE("expr", "expr created ", idx, "");//the line added by yeting
//       //      char * a;
//       //      a="a";
//       //      a[999999]=255;
//     }
// #endif
  }
  //! Destructor
  virtual ~ExprValue();

  //! Get the kind of the expression
  int getKind() const { return d_kind; }

  //! Overload operator new
  void* operator new(size_t size, MemoryManager* mm)
    { return mm->newData(size); }
  void operator delete(void* pMem, MemoryManager* mm) {
    mm->deleteData(pMem);
  }

  //! Overload operator delete
  void operator delete(void*) { }

  //! Get unique memory manager ID
  virtual size_t getMMIndex() const { return EXPR_VALUE; }

  //! Equality between any two ExprValue objects (including subclasses)
  virtual bool operator==(const ExprValue& ev2) const;

  // Testers

  //! Test whether the expression is a generic subclass
  /*!
   * \return 0 for the core classes, and getMMIndex() value for
   * generic subclasses (those defined in DPs)
   */
  virtual const ExprValue* getExprValue() const
    { throw Exception("Illegal call to getExprValue()"); }
  //! String expression tester
  virtual bool isString() const { return false; }
  //! Rational number expression tester
  virtual bool isRational() const { return false; }
  //! Uninterpreted constants
  virtual bool isVar() const { return false; }
  //! Application of another expression
  virtual bool isApply() const { return false; }
  //! Special named symbol
  virtual bool isSymbol() const { return false; }
  //! A LAMBDA-expression or a quantifier
  virtual bool isClosure() const { return false; }
  //! Special Expr holding a theorem
  virtual bool isTheorem() const { return false; }

  //! Get kids: by default, returns a ref to an empty vector
  virtual const std::vector<Expr>& getKids() const
    { return d_em->getEmptyVector(); }

  // Methods to access leaf data in subclasses

  //! Default arity = 0
  virtual unsigned arity() const { return 0; }

  //! Special attributes for uninterpreted functions
  virtual CDO<Theorem>* getSig() const {
    DebugAssert(false, "getSig() is called on ExprValue");
    return NULL;
  }

  virtual CDO<Theorem>* getRep() const {
    DebugAssert(false, "getRep() is called on ExprValue");
    return NULL;
  }

  virtual void setSig(CDO<Theorem>* sig) {
    DebugAssert(false, "setSig() is called on ExprValue");
  }

  virtual void setRep(CDO<Theorem>* rep) {
    DebugAssert(false, "setRep() is called on ExprValue");
  }

  virtual const std::string& getUid() const {
    static std::string null;
    DebugAssert(false, "ExprValue::getUid() called in base class");
    return null;
  }

  virtual const std::string& getString() const {
    DebugAssert(false, "getString() is called on ExprValue");
    static std::string s("");
    return s;
  }

  virtual const Rational& getRational() const {
    DebugAssert(false, "getRational() is called on ExprValue");
    static Rational r(0);
    return r;
  }

  //! Returns the string name of UCONST and BOUND_VAR expr's.
  virtual const std::string& getName() const {
    static std::string ret = "";
    DebugAssert(false, "getName() is called on ExprValue");
    return ret;
  }

  //! Returns the original Boolean variable (for BoolVarExprValue)
  virtual const Expr& getVar() const {
    DebugAssert(false, "getVar() is called on ExprValue");
    static Expr null;
    return null;
  }

  //! Get the Op from an Apply Expr
  virtual Op getOp() const {
    DebugAssert(false, "getOp() is called on ExprValue");
    return Op(NULL_KIND);
  }

  virtual const std::vector<Expr>& getVars() const  {
    DebugAssert(false, "getVars() is called on ExprValue");
    static std::vector<Expr> null;
    return null;
  }

  virtual const Expr& getBody() const {
    DebugAssert(false, "getBody() is called on ExprValue");
    static Expr null;
    return null;
  }

  virtual void setTriggers(const std::vector<std::vector<Expr> >& triggers) {
    DebugAssert(false, "setTriggers() is called on ExprValue");
  }

  virtual const std::vector<std::vector<Expr> >& getTriggers() const { //by yeting
    DebugAssert(false, "getTrigs() is called on ExprValue");
    static std::vector<std::vector<Expr> > null;
    return null;
  }

  virtual const Expr& getExistential() const {
    DebugAssert(false, "getExistential() is called on ExprValue");
    static Expr null;
    return null;
  }
  virtual int getBoundIndex() const {
    DebugAssert(false, "getIndex() is called on ExprValue");
    return 0;
  }

  virtual const std::vector<std::string>& getFields() const {
    DebugAssert(false, "getFields() is called on ExprValue");
    static std::vector<std::string> null;
    return null;
  }
  virtual const std::string& getField() const {
    DebugAssert(false, "getField() is called on ExprValue");
    static std::string null;
    return null;
  }
  virtual int getTupleIndex() const {
    DebugAssert(false, "getTupleIndex() is called on ExprValue");
    return 0;
  }
  virtual const Theorem& getTheorem() const {
    static Theorem null;
    DebugAssert(false, "getTheorem() is called on ExprValue");
    return null;
  }

}; // end of class ExprValue

// Class ExprNode; it's an expression with children
class CVC_DLL ExprNode: public ExprValue {
  friend class Expr;
  friend class ExprManager;

protected:
  //! Vector of children
  std::vector<Expr> d_children;

  // Special attributes for helping with congruence closure
  CDO<Theorem>* d_sig;
  CDO<Theorem>* d_rep;

private:

  //! Tell ExprManager who we are
  size_t getMMIndex() const { return EXPR_NODE; }

protected:
  //! Return number of children
  unsigned arity() const { return d_children.size(); }

  //! Return reference to children
  std::vector<Expr>& getKids1() { return d_children; }

  //! Return reference to children
  const std::vector<Expr>& getKids() const { return d_children; }

  //! Use our static hash() for the member method
  size_t computeHash() const {
    return ExprValue::hash(d_kind, d_children);
  }

  //! Use our static sizeWithChildren() for the member method
  Unsigned computeSize() const {
    return ExprValue::sizeWithChildren(d_children);
  }

  //! Make a clean copy of itself using the given memory manager
  virtual ExprValue* copy(ExprManager* em, ExprIndex idx = 0) const;

public:
  //! Constructor
  ExprNode(ExprManager* em, int kind, ExprIndex idx = 0)
    : ExprValue(em, kind, idx), d_sig(NULL), d_rep(NULL) { }
  //! Constructor
  ExprNode(ExprManager* em, int kind, const std::vector<Expr>& kids,
           ExprIndex idx = 0)
    : ExprValue(em, kind, idx), d_children(kids), d_sig(NULL), d_rep(NULL) { }
  //! Destructor
  virtual ~ExprNode();

  //! Overload operator new
  void* operator new(size_t size, MemoryManager* mm)
    { return mm->newData(size); }
  void operator delete(void* pMem, MemoryManager* mm) {
    mm->deleteData(pMem);
  }

  //! Overload operator delete
  void operator delete(void*) { }

  //! Compare with another ExprValue
  virtual bool operator==(const ExprValue& ev2) const;

  virtual CDO<Theorem>* getSig() const { return d_sig; }
  virtual CDO<Theorem>* getRep() const { return d_rep; }

  virtual void setRep(CDO<Theorem>* rep) { d_rep = rep; }
  virtual void setSig(CDO<Theorem>* sig) { d_sig = sig; }

}; // end of class ExprNode

// Class ExprNodeTmp; special version of ExprNode for Expr constructor
class ExprNodeTmp: public ExprValue {
  friend class Expr;
  friend class ExprManager;

protected:
  //! Vector of children
  const std::vector<Expr>& d_children;

private:

  //! Tell ExprManager who we are
  size_t getMMIndex() const { return EXPR_NODE; }

protected:
  //! Return number of children
  unsigned arity() const { return d_children.size(); }

  //! Return reference to children
  const std::vector<Expr>& getKids() const { return d_children; }

  //! Use our static hash() for the member method
  size_t computeHash() const {
    return ExprValue::hash(d_kind, d_children);
  }

  //! Use our static sizeWithChildren() for the member method
  Unsigned computeSize() const {
    return ExprValue::sizeWithChildren(d_children);
  }

  //! Make a clean copy of itself using the given memory manager
  virtual ExprValue* copy(ExprManager* em, ExprIndex idx = 0) const;

public:
  //! Constructor
  ExprNodeTmp(ExprManager* em, int kind, const std::vector<Expr>& kids)
    : ExprValue(em, kind, 0), d_children(kids) { }

  //! Destructor
  virtual ~ExprNodeTmp() {}

  //! Compare with another ExprValue
  virtual bool operator==(const ExprValue& ev2) const;

}; // end of class ExprNodeTmp

// Special version for Expr Constructor
class ExprApplyTmp: public ExprNodeTmp {
  friend class Expr;
  friend class ExprManager;
private:
  Expr d_opExpr;
protected:
  size_t getMMIndex() const { return EXPR_APPLY; }
  size_t computeHash() const {
    return PRIME*ExprNodeTmp::computeHash() + d_opExpr.hash();
  }
  Op getOp() const { return Op(d_opExpr); }
  bool isApply() const { return true; }
  // Make a clean copy of itself using the given memory manager
  ExprValue* copy(ExprManager* em, ExprIndex idx = 0) const;
public:
  // Constructor
  ExprApplyTmp(ExprManager* em, const Op& op,
               const std::vector<Expr>& kids)
    : ExprNodeTmp(em, NULL_KIND, kids), d_opExpr(op.getExpr())
  { DebugAssert(!op.getExpr().isNull(), "Expected non-null Op");
    d_kind = APPLY; }
  virtual ~ExprApplyTmp() { }

  bool operator==(const ExprValue& ev2) const;
}; // end of class ExprApply

class CVC_DLL ExprApply: public ExprNode {
  friend class Expr;
  friend class ExprManager;
private:
  Expr d_opExpr;
protected:
  size_t getMMIndex() const { return EXPR_APPLY; }
  size_t computeHash() const {
    return PRIME*ExprNode::computeHash() + d_opExpr.hash();
  }
  Op getOp() const { return Op(d_opExpr); }
  bool isApply() const { return true; }
  // Make a clean copy of itself using the given memory manager
  ExprValue* copy(ExprManager* em, ExprIndex idx = 0) const;
public:
  // Constructor
  ExprApply(ExprManager* em, const Op& op, ExprIndex idx = 0)
    : ExprNode(em, NULL_KIND, idx), d_opExpr(op.getExpr())
  { DebugAssert(!op.getExpr().isNull(), "Expected non-null Op");
    d_kind = APPLY; }
  ExprApply(ExprManager* em, const Op& op,
            const std::vector<Expr>& kids, ExprIndex idx = 0)
    : ExprNode(em, NULL_KIND, kids, idx), d_opExpr(op.getExpr())
  { DebugAssert(!op.getExpr().isNull(), "Expected non-null Op");
    d_kind = APPLY; }
  virtual ~ExprApply() { }

  bool operator==(const ExprValue& ev2) const;
  // Memory management
  void* operator new(size_t size, MemoryManager* mm) {
    return mm->newData(size);
  }
  void operator delete(void* pMem, MemoryManager* mm) {
    mm->deleteData(pMem);
  }
  void operator delete(void*) { }
}; // end of class ExprApply

/*****************************************************************************/
/*!
 *\class NamedExprValue
 *\brief NamedExprValue
 *
 * Author: Clark Barrett
 *
 * Created: Thu Dec  2 23:18:17 2004
 *
 * Subclass of ExprValue for kinds that have a name associated with them.
 */
/*****************************************************************************/

// class NamedExprValue : public ExprNode {
//   friend class Expr;
//   friend class ExprManager;

// private:
//   std::string d_name;

// protected:

//   ExprValue* copy(ExprManager* em, ExprIndex idx = 0) const {
//     return new(em->getMM(getMMIndex()))
//       NamedExprValue(d_em, d_kind, d_name, d_children, idx);
//   }

//   ExprValue* copy(ExprManager* em, const std::vector<Expr>& kids,
//       	    ExprIndex idx = 0) const {
//     return new(em->getMM(getMMIndex()))
//       NamedExprValue(d_em, d_kind, d_name, kids, idx);
//   }

//   size_t computeHash() const {
//     return s_charHash(d_name.c_str())*PRIME + ExprNode::computeHash();
//   }

//   size_t getMMIndex() const { return EXPR_NAMED; }

// public:
//   // Constructor
//   NamedExprValue(ExprManager *em, int kind, const std::string& name,
//                  const std::vector<Expr>& kids, ExprIndex idx = 0)
//     : ExprNode(em, kind, kids, idx), d_name(name) { }
//   // virtual ~NamedExprValue();
//   bool operator==(const ExprValue& ev2) const {
//     if(getMMIndex() != ev2.getMMIndex()) return false;
//     return (getName() == ev2.getName())
//       && ExprNode::operator==(ev2);
//   }

//   const std::string& getName() const { return d_name; }

//   // Memory management
//   void* operator new(size_t size, MemoryManager* mm) {
//     return mm->newData(size);
//   }
//   void operator delete(void*) { }
// }; // end of class NamedExprValue

// Leaf expressions
class ExprString: public ExprValue {
  friend class Expr;
  friend class ExprManager;
private:
  std::string d_str;

  // Hash function for this subclass
  static size_t hash(const std::string& str) {
    return s_charHash(str.c_str());
  }

  // Tell ExprManager who we are
  virtual size_t getMMIndex() const { return EXPR_STRING; }

protected:
  // Use our static hash() for the member method
  virtual size_t computeHash() const { return hash(d_str); }

  virtual bool isString() const { return true; }
  virtual const std::string& getString() const { return d_str; }

  //! Make a clean copy of itself using the given memory manager
  virtual ExprValue* copy(ExprManager* em, ExprIndex idx = 0) const;
public:
  // Constructor
  ExprString(ExprManager* em, const std::string& s, ExprIndex idx = 0)
    : ExprValue(em, STRING_EXPR, idx), d_str(s) { }
  // Destructor
  virtual ~ExprString() { }

  virtual bool operator==(const ExprValue& ev2) const;
  // Memory management
  void* operator new(size_t size, MemoryManager* mm) {
    return mm->newData(size);
  }
  void operator delete(void* pMem, MemoryManager* mm) {
    mm->deleteData(pMem);
  }
  void operator delete(void*) { }
}; // end of class ExprString

class ExprSkolem: public ExprValue {
  friend class Expr;
  friend class ExprManager;
private:
  Expr d_quant; //!< The quantified expression to skolemize
  int d_idx; //!< Variable index in the quantified expression
  const Expr& getExistential() const {return d_quant;}
  int getBoundIndex() const {return d_idx;}

  // Tell ExprManager who we are
  size_t getMMIndex() const { return EXPR_SKOLEM;}

protected:
  size_t computeHash() const {
    size_t res = getExistential().getBody().hash();
    res = PRIME*res + getBoundIndex();
    return res;
  }

  bool operator==(const ExprValue& ev2) const;

  //! Make a clean copy of itself using the given memory manager
  ExprValue* copy(ExprManager* em, ExprIndex idx = 0) const;
  bool isVar() const { return true; }

public:
  // Constructor
  ExprSkolem(ExprManager* em, int index, const Expr& exist, ExprIndex idx = 0)
    : ExprValue(em, SKOLEM_VAR, idx), d_quant(exist), d_idx(index) { }
  // Destructor
  virtual ~ExprSkolem() { }
  // Memory management
  void* operator new(size_t size, MemoryManager* mm) {
    return mm->newData(size);
  }
  void operator delete(void* pMem, MemoryManager* mm) {
    mm->deleteData(pMem);
  }
  void operator delete(void*) { }
}; // end of class ExprSkolem

class ExprRational: public ExprValue {
  friend class Expr;
  friend class ExprManager;
private:
  Rational d_r;

  virtual const Rational& getRational() const { return d_r; }

  // Hash function for this subclass
  static size_t hash(const Rational& r) {
    return s_charHash(r.toString().c_str());
  }

  // Tell ExprManager who we are
  virtual size_t getMMIndex() const { return EXPR_RATIONAL; }

protected:

  virtual size_t computeHash() const { return hash(d_r); }
  virtual bool operator==(const ExprValue& ev2) const;
  //! Make a clean copy of itself using the given memory manager
  virtual ExprValue* copy(ExprManager* em, ExprIndex idx = 0) const;
  virtual bool isRational() const { return true; }

public:
  // Constructor
  ExprRational(ExprManager* em, const Rational& r, ExprIndex idx = 0)
    : ExprValue(em, RATIONAL_EXPR, idx), d_r(r) { }
  // Destructor
  virtual ~ExprRational() { }
  // Memory management
  void* operator new(size_t size, MemoryManager* mm) {
    return mm->newData(size);
  }
  void operator delete(void* pMem, MemoryManager* mm) {
    mm->deleteData(pMem);
  }
  void operator delete(void*) { }
}; // end of class ExprRational

// Uninterpreted constants (variables)
class ExprVar: public ExprValue {
  friend class Expr;
  friend class ExprManager;
private:
  std::string d_name;

  virtual const std::string& getName() const { return d_name; }

  // Tell ExprManager who we are
  virtual size_t getMMIndex() const { return EXPR_UCONST; }
protected:

  virtual size_t computeHash() const {
    return s_charHash(d_name.c_str());
  }
  virtual bool isVar() const { return true; }

  //! Make a clean copy of itself using the given memory manager
  virtual ExprValue* copy(ExprManager* em, ExprIndex idx = 0) const;

public:
  // Constructor
  ExprVar(ExprManager *em, const std::string& name, ExprIndex idx = 0)
    : ExprValue(em, UCONST, idx), d_name(name) { }
  // Destructor
  virtual ~ExprVar() { }

  virtual bool operator==(const ExprValue& ev2) const;
  // Memory management
  void* operator new(size_t size, MemoryManager* mm) {
    return mm->newData(size);
  }
  void operator delete(void* pMem, MemoryManager* mm) {
    mm->deleteData(pMem);
  }
  void operator delete(void*) { }
}; // end of class ExprVar

// Interpreted symbols: similar to UCONST, but returns false for isVar().
class ExprSymbol: public ExprValue {
  friend class Expr;
  friend class ExprManager;
private:
  std::string d_name;

  virtual const std::string& getName() const { return d_name; }

  // Tell ExprManager who we are
  virtual size_t getMMIndex() const { return EXPR_SYMBOL; }
protected:

  virtual size_t computeHash() const {
    return s_charHash(d_name.c_str())*PRIME + s_intHash(d_kind);
  }
  //! Make a clean copy of itself using the given memory manager
  virtual ExprValue* copy(ExprManager* em, ExprIndex idx = 0) const;
  bool isSymbol() const { return true; }

public:
  // Constructor
  ExprSymbol(ExprManager *em, int kind, const std::string& name,
             ExprIndex idx = 0)
    : ExprValue(em, kind, idx), d_name(name) { }
  // Destructor
  virtual ~ExprSymbol() { }

  virtual bool operator==(const ExprValue& ev2) const;
  // Memory management
  void* operator new(size_t size, MemoryManager* mm) {
    return mm->newData(size);
  }
  void operator delete(void* pMem, MemoryManager* mm) {
    mm->deleteData(pMem);
  }
  void operator delete(void*) { }
}; // end of class ExprSymbol

class ExprBoundVar: public ExprValue {
  friend class Expr;
  friend class ExprManager;
private:
  std::string d_name;
  std::string d_uid;

  virtual const std::string& getName() const { return d_name; }
  virtual const std::string& getUid() const { return d_uid; }

  // Tell ExprManager who we are
  virtual size_t getMMIndex() const { return EXPR_BOUND_VAR; }
protected:

  virtual size_t computeHash() const {
    return s_charHash(d_name.c_str())*PRIME + s_charHash(d_uid.c_str());
  }
  virtual bool isVar() const { return true; }
  //! Make a clean copy of itself using the given memory manager
  virtual ExprValue* copy(ExprManager* em, ExprIndex idx = 0) const;

public:
  // Constructor
  ExprBoundVar(ExprManager *em, const std::string& name,
               const std::string& uid, ExprIndex idx = 0)
    : ExprValue(em, BOUND_VAR, idx), d_name(name), d_uid(uid) { }
  // Destructor
  virtual ~ExprBoundVar() { }

  virtual bool operator==(const ExprValue& ev2) const;
  // Memory management
  void* operator new(size_t size, MemoryManager* mm) {
    return mm->newData(size);
  }
  void operator delete(void* pMem, MemoryManager* mm) {
    mm->deleteData(pMem);
  }
  void operator delete(void*) { }
}; // end of class ExprBoundVar

/*! @brief A "closure" expression which binds variables used in the
  "body".  Used by LAMBDA and quantifiers. */
class ExprClosure: public ExprValue {
  friend class Expr;
  friend class ExprManager;
private:
  //! Bound variables
  std::vector<Expr> d_vars;
  //! The body of the quantifier/lambda
  Expr d_body;
  //! Manual triggers. // added by yeting
  // Note that due to expr caching, only the most recent triggers specified for a given formula will be used.
  std::vector<std::vector<Expr> > d_manual_triggers;
  //! Tell ExprManager who we are
  virtual size_t getMMIndex() const { return EXPR_CLOSURE; }

  virtual const std::vector<Expr>& getVars() const { return d_vars; }
  virtual const Expr& getBody() const { return d_body; }
  virtual void setTriggers(const std::vector<std::vector<Expr> >& triggers) { d_manual_triggers = triggers; }
  virtual const std::vector<std::vector<Expr> >&  getTriggers() const { return d_manual_triggers; }

protected:

  size_t computeHash() const;
  Unsigned computeSize() const { return d_body.d_expr->getSize() + 1; }
  //! Make a clean copy of itself using the given memory manager
  ExprValue* copy(ExprManager* em, ExprIndex idx = 0) const;

public:
  // Constructor
  ExprClosure(ExprManager *em, int kind, const Expr& var,
              const Expr& body, ExprIndex idx = 0)
    : ExprValue(em, kind, idx), d_body(body) { d_vars.push_back(var); }

  ExprClosure(ExprManager *em, int kind, const std::vector<Expr>& vars,
              const Expr& body, ExprIndex idx = 0)
    : ExprValue(em, kind, idx), d_vars(vars), d_body(body) { }

  ExprClosure(ExprManager *em, int kind, const std::vector<Expr>& vars,
              const Expr& body, const std::vector<std::vector<Expr> >&  trigs, ExprIndex idx = 0)
    : ExprValue(em, kind, idx), d_vars(vars), d_body(body),  d_manual_triggers(trigs) { }

  // Destructor
  virtual ~ExprClosure() { }

  bool operator==(const ExprValue& ev2) const;
  // Memory management
  void* operator new(size_t size, MemoryManager* mm) {
    return mm->newData(size);
  }
  void operator delete(void* pMem, MemoryManager* mm) {
    mm->deleteData(pMem);
  }
  void operator delete(void*) { }
  virtual bool isClosure() const { return true; }
}; // end of class ExprClosure

} // end of namespace CVC3

#endif


text:
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="AbstractResourceIteratorFactory.php" local="130521601560000000" remote="130865403000000000" testing="0" />
<file name="CompositeResourceIteratorFactory.php" local="130521601560000000" remote="130865403000000000" testing="0" />
<file name="MapResourceIteratorFactory.php" local="130521601560000000" remote="130865403000000000" testing="0" />
<file name="Model.php" local="130521601560000000" remote="130865403000000000" testing="0" />
<file name="ResourceIterator.php" local="130521601560000000" remote="130865403000000000" testing="0" />
<file name="ResourceIteratorApplyBatched.php" local="130521601560000000" remote="130865403000000000" testing="0" />
<file name="ResourceIteratorClassFactory.php" local="130521601560000000" remote="130865403000000000" testing="0" />
<file name="ResourceIteratorFactoryInterface.php" local="130521601560000000" remote="130865403000000000" testing="0" />
<file name="ResourceIteratorInterface.php" local="130521601560000000" remote="130865403000000000" testing="0" />
</dwsync>


text:
<?php namespace Illuminate\Database\Connectors;

use PDO;

class SqlServerConnector extends Connector implements ConnectorInterface {

	/**
	 * The PDO connection options.
	 *
	 * @var array
	 */
	protected $options = array(
			PDO::ATTR_CASE => PDO::CASE_NATURAL,
			PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
			PDO::ATTR_ORACLE_NULLS => PDO::NULL_NATURAL,
			PDO::ATTR_STRINGIFY_FETCHES => false,
	);

	/**
	 * Establish a database connection.
	 *
	 * @param  array  $config
	 * @return PDO
	 */
	public function connect(array $config)
	{
		$options = $this->getOptions($config);

		return $this->createConnection($this->getDsn($config), $config, $options);
	}

	/**
	 * Create a DSN string from a configuration.
	 *
	 * @param  array   $config
	 * @return string
	 */
	protected function getDsn(array $config)
	{
		extract($config);

		// First we will create the basic DSN setup as well as the port if it is in
		// in the configuration options. This will give us the basic DSN we will
		// need to establish the PDO connections and return them back for use.
		$port = isset($config['port']) ? ','.$port : '';

		if (in_array('dblib', $this->getAvailableDrivers()))
		{
			return "dblib:host={$host}{$port};dbname={$database}";
		}
		else
		{
			$dbName = $database != '' ? ";Database={$database}" : '';

			return "sqlsrv:Server={$host}{$port}{$dbName}";
		}
	}

	/**
	 * Get the available PDO drivers.
	 *
	 * @return array
	 */
	protected function getAvailableDrivers()
	{
		return PDO::getAvailableDrivers();
	}

}


text:
<?php

/**
 * @file
 * Contains \Drupal\Core\Entity\EntityLastInstalledSchemaRepository.
 */

namespace Drupal\Core\Entity;

use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\KeyValueStore\KeyValueFactoryInterface;

/**
 * Provides a repository for installed entity definitions.
 */
class EntityLastInstalledSchemaRepository implements EntityLastInstalledSchemaRepositoryInterface {

  /**
   * The key-value factory.
   *
   * @var \Drupal\Core\KeyValueStore\KeyValueFactoryInterface
   */
  protected $keyValueFactory;

  /**
   * Constructs a new EntityLastInstalledSchemaRepository.
   *
   * @param \Drupal\Core\KeyValueStore\KeyValueFactoryInterface $key_value_factory
   *   The key-value factory.
   */
  public function __construct(KeyValueFactoryInterface $key_value_factory) {
    $this->keyValueFactory = $key_value_factory;
  }

  /**
   * {@inheritdoc}
   */
  public function getLastInstalledDefinition($entity_type_id) {
    return $this->keyValueFactory->get('entity.definitions.installed')->get($entity_type_id . '.entity_type');
  }

  /**
   * {@inheritdoc}
   */
  public function setLastInstalledDefinition(EntityTypeInterface $entity_type) {
    $entity_type_id = $entity_type->id();
    $this->keyValueFactory->get('entity.definitions.installed')->set($entity_type_id . '.entity_type', $entity_type);
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function deleteLastInstalledDefinition($entity_type_id) {
    $this->keyValueFactory->get('entity.definitions.installed')->delete($entity_type_id . '.entity_type');
    // Clean up field storage definitions as well. Even if the entity type
    // isn't currently fieldable, there might be legacy definitions or an
    // empty array stored from when it was.
    $this->keyValueFactory->get('entity.definitions.installed')->delete($entity_type_id . '.field_storage_definitions');
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getLastInstalledFieldStorageDefinitions($entity_type_id) {
    return $this->keyValueFactory->get('entity.definitions.installed')->get($entity_type_id . '.field_storage_definitions', []);
  }

  /**
   * {@inheritdoc}
   */
  public function setLastInstalledFieldStorageDefinitions($entity_type_id, array $storage_definitions) {
    $this->keyValueFactory->get('entity.definitions.installed')->set($entity_type_id . '.field_storage_definitions', $storage_definitions);
  }

  /**
   * {@inheritdoc}
   */
  public function setLastInstalledFieldStorageDefinition(FieldStorageDefinitionInterface $storage_definition) {
    $entity_type_id = $storage_definition->getTargetEntityTypeId();
    $definitions = $this->getLastInstalledFieldStorageDefinitions($entity_type_id);
    $definitions[$storage_definition->getName()] = $storage_definition;
    $this->setLastInstalledFieldStorageDefinitions($entity_type_id, $definitions);
  }

  /**
   * {@inheritdoc}
   */
  public function deleteLastInstalledFieldStorageDefinition(FieldStorageDefinitionInterface $storage_definition) {
    $entity_type_id = $storage_definition->getTargetEntityTypeId();
    $definitions = $this->getLastInstalledFieldStorageDefinitions($entity_type_id);
    unset($definitions[$storage_definition->getName()]);
    $this->setLastInstalledFieldStorageDefinitions($entity_type_id, $definitions);
  }

}


text:
'use strict';

// Project metadata.
var pkg = require('../package.json'),
    options = require('./cli/options.json');

exports.name = pkg.name;

exports.version = function() {
  console.log(pkg.version);
};

exports.help = function() {
  console.log('\nUsage : %s [options] file1.js file2.js ... fileN.js', pkg.name);
  Object.keys(options).forEach(function(shortOption){
    var option = options[shortOption];
    console.log(
      '  -%s%s%s%s',
      shortOption,
      option.long ? ', --' + option.long : '',
      option.type !== 'Boolean' ? ' : ' + option.type : '',
      option.required ? ' *required*' : ''
    );
    console.log('      %s', option.desc);
  });
};


text:
.class public Landroid/net/DummyDataStateTracker;
.super Ljava/lang/Object;
.source "DummyDataStateTracker.java"

# interfaces
.implements Landroid/net/NetworkStateTracker;

# static fields
.field private static final DBG:Z = true

.field private static final TAG:Ljava/lang/String; = "DummyDataStateTracker"

.field private static final VDBG:Z

# instance fields
.field private mContext:Landroid/content/Context;

.field private mDefaultRouteSet:Z

.field private mIsDefaultOrHipri:Z

.field private mLinkCapabilities:Landroid/net/LinkCapabilities;

.field private mLinkProperties:Landroid/net/LinkProperties;

.field private mNetworkInfo:Landroid/net/NetworkInfo;

.field private mPrivateDnsRouteSet:Z

.field private mTarget:Landroid/os/Handler;

.field private mTeardownRequested:Z

# direct methods
.method public constructor <init>(ILjava/lang/String;)V
    .locals 1
    .parameter "netType"
    .parameter "tag"

    .prologue
    const/4 v0, 0x0

    .line 55
    invoke-direct/range {p0 .. p0}, Ljava/lang/Object;-><init>()V

    .line 38
    iput-boolean v0, p0, Landroid/net/DummyDataStateTracker;->mTeardownRequested:Z

    .line 43
    iput-boolean v0, p0, Landroid/net/DummyDataStateTracker;->mPrivateDnsRouteSet:Z

    .line 44
    iput-boolean v0, p0, Landroid/net/DummyDataStateTracker;->mDefaultRouteSet:Z

    .line 48
    iput-boolean v0, p0, Landroid/net/DummyDataStateTracker;->mIsDefaultOrHipri:Z

    .line 56
    new-instance v0, Landroid/net/NetworkInfo;

    invoke-direct {v0, p1}, Landroid/net/NetworkInfo;-><init>(I)V

    iput-object v0, p0, Landroid/net/DummyDataStateTracker;->mNetworkInfo:Landroid/net/NetworkInfo;

    .line 57
    return-void
.end method

.method private static log(Ljava/lang/String;)V
    .locals 1
    .parameter "s"

    .prologue
    .line 203
    const-string v0, "DummyDataStateTracker"

    invoke-static {v0, p0}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 204
    return-void
.end method

.method private static loge(Ljava/lang/String;)V
    .locals 1
    .parameter "s"

    .prologue
    .line 207
    const-string v0, "DummyDataStateTracker"

    invoke-static {v0, p0}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 208
    return-void
.end method

.method private setDetailedState(Landroid/net/NetworkInfo$DetailedState;Ljava/lang/String;Ljava/lang/String;)V
    .locals 4
    .parameter "state"
    .parameter "reason"
    .parameter "extraInfo"

    .prologue
    .line 133
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v2, "setDetailed state, old ="

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v2, p0, Landroid/net/DummyDataStateTracker;->mNetworkInfo:Landroid/net/NetworkInfo;

    invoke-virtual {v2}, Landroid/net/NetworkInfo;->getDetailedState()Landroid/net/NetworkInfo$DetailedState;

    move-result-object v2

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string v2, " and new state="

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Landroid/net/DummyDataStateTracker;->log(Ljava/lang/String;)V

    .line 135
    iget-object v1, p0, Landroid/net/DummyDataStateTracker;->mNetworkInfo:Landroid/net/NetworkInfo;

    invoke-virtual {v1, p1, p2, p3}, Landroid/net/NetworkInfo;->setDetailedState(Landroid/net/NetworkInfo$DetailedState;Ljava/lang/String;Ljava/lang/String;)V

    .line 136
    iget-object v1, p0, Landroid/net/DummyDataStateTracker;->mTarget:Landroid/os/Handler;

    const/4 v2, 0x1

    iget-object v3, p0, Landroid/net/DummyDataStateTracker;->mNetworkInfo:Landroid/net/NetworkInfo;

    invoke-virtual {v1, v2, v3}, Landroid/os/Handler;->obtainMessage(ILjava/lang/Object;)Landroid/os/Message;

    move-result-object v0

    .line 137
    .local v0, msg:Landroid/os/Message;
    invoke-virtual {v0}, Landroid/os/Message;->sendToTarget()V

    .line 138
    return-void
.end method

# virtual methods
.method public defaultRouteSet(Z)V
    .locals 0
    .parameter "enabled"

    .prologue
    .line 87
    iput-boolean p1, p0, Landroid/net/DummyDataStateTracker;->mDefaultRouteSet:Z

    .line 88
    return-void
.end method

.method public getLinkCapabilities()Landroid/net/LinkCapabilities;
    .locals 2

    .prologue
    .line 195
    new-instance v0, Landroid/net/LinkCapabilities;

    iget-object v1, p0, Landroid/net/DummyDataStateTracker;->mLinkCapabilities:Landroid/net/LinkCapabilities;

    invoke-direct {v0, v1}, Landroid/net/LinkCapabilities;-><init>(Landroid/net/LinkCapabilities;)V

    return-object v0
.end method

.method public getLinkProperties()Landroid/net/LinkProperties;
    .locals 2

    .prologue
    .line 188
    new-instance v0, Landroid/net/LinkProperties;

    iget-object v1, p0, Landroid/net/DummyDataStateTracker;->mLinkProperties:Landroid/net/LinkProperties;

    invoke-direct {v0, v1}, Landroid/net/LinkProperties;-><init>(Landroid/net/LinkProperties;)V

    return-object v0
.end method

.method public getNetworkInfo()Landroid/net/NetworkInfo;
    .locals 1

    .prologue
    .line 79
    iget-object v0, p0, Landroid/net/DummyDataStateTracker;->mNetworkInfo:Landroid/net/NetworkInfo;

    return-object v0
.end method

.method public getTcpBufferSizesPropName()Ljava/lang/String;
    .locals 1

    .prologue
    .line 108
    const-string/jumbo v0, "net.tcp.buffersize.unknown"

    return-object v0
.end method

.method public isAvailable()Z
    .locals 1

    .prologue
    .line 100
    const/4 v0, 0x1

    return v0
.end method

.method public isDefaultRouteSet()Z
    .locals 1

    .prologue
    .line 83
    iget-boolean v0, p0, Landroid/net/DummyDataStateTracker;->mDefaultRouteSet:Z

    return v0
.end method

.method public isPrivateDnsRouteSet()Z
    .locals 1

    .prologue
    .line 71
    iget-boolean v0, p0, Landroid/net/DummyDataStateTracker;->mPrivateDnsRouteSet:Z

    return v0
.end method

.method public isTeardownRequested()Z
    .locals 1

    .prologue
    .line 145
    iget-boolean v0, p0, Landroid/net/DummyDataStateTracker;->mTeardownRequested:Z

    return v0
.end method

.method public privateDnsRouteSet(Z)V
    .locals 0
    .parameter "enabled"

    .prologue
    .line 75
    iput-boolean p1, p0, Landroid/net/DummyDataStateTracker;->mPrivateDnsRouteSet:Z

    .line 76
    return-void
.end method

.method public reconnect()Z
    .locals 3

    .prologue
    const/4 v2, 0x0

    .line 153
    sget-object v0, Landroid/net/NetworkInfo$DetailedState;->CONNECTING:Landroid/net/NetworkInfo$DetailedState;

    const-string v1, "enabled"

    invoke-direct {p0, v0, v1, v2}, Landroid/net/DummyDataStateTracker;->setDetailedState(Landroid/net/NetworkInfo$DetailedState;Ljava/lang/String;Ljava/lang/String;)V

    .line 154
    sget-object v0, Landroid/net/NetworkInfo$DetailedState;->CONNECTED:Landroid/net/NetworkInfo$DetailedState;

    const-string v1, "enabled"

    invoke-direct {p0, v0, v1, v2}, Landroid/net/DummyDataStateTracker;->setDetailedState(Landroid/net/NetworkInfo$DetailedState;Ljava/lang/String;Ljava/lang/String;)V

    .line 155
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Landroid/net/DummyDataStateTracker;->setTeardownRequested(Z)V

    .line 156
    const/4 v0, 0x1

    return v0
.end method

.method public releaseWakeLock()V
    .locals 0

    .prologue
    .line 94
    return-void
.end method

.method public setDependencyMet(Z)V
    .locals 0
    .parameter "met"

    .prologue
    .line 200
    return-void
.end method

.method public setPolicyDataEnable(Z)V
    .locals 0
    .parameter "enabled"

    .prologue
    .line 176
    return-void
.end method

.method public setRadio(Z)Z
    .locals 1
    .parameter "turnOn"

    .prologue
    .line 165
    const/4 v0, 0x1

    return v0
.end method

.method public setTeardownRequested(Z)V
    .locals 0
    .parameter "isRequested"

    .prologue
    .line 141
    iput-boolean p1, p0, Landroid/net/DummyDataStateTracker;->mTeardownRequested:Z

    .line 142
    return-void
.end method

.method public setUserDataEnable(Z)V
    .locals 0
    .parameter "enabled"

    .prologue
    .line 171
    return-void
.end method

.method public startMonitoring(Landroid/content/Context;Landroid/os/Handler;)V
    .locals 0
    .parameter "context"
    .parameter "target"

    .prologue
    .line 66
    iput-object p2, p0, Landroid/net/DummyDataStateTracker;->mTarget:Landroid/os/Handler;

    .line 67
    iput-object p1, p0, Landroid/net/DummyDataStateTracker;->mContext:Landroid/content/Context;

    .line 68
    return-void
.end method

.method public teardown()Z
    .locals 3

    .prologue
    const/4 v2, 0x0

    .line 117
    sget-object v0, Landroid/net/NetworkInfo$DetailedState;->DISCONNECTING:Landroid/net/NetworkInfo$DetailedState;

    const-string v1, "disabled"

    invoke-direct {p0, v0, v1, v2}, Landroid/net/DummyDataStateTracker;->setDetailedState(Landroid/net/NetworkInfo$DetailedState;Ljava/lang/String;Ljava/lang/String;)V

    .line 118
    sget-object v0, Landroid/net/NetworkInfo$DetailedState;->DISCONNECTED:Landroid/net/NetworkInfo$DetailedState;

    const-string v1, "disabled"

    invoke-direct {p0, v0, v1, v2}, Landroid/net/DummyDataStateTracker;->setDetailedState(Landroid/net/NetworkInfo$DetailedState;Ljava/lang/String;Ljava/lang/String;)V

    .line 119
    const/4 v0, 0x1

    return v0
.end method

.method public toString()Ljava/lang/String;
    .locals 2

    .prologue
    .line 180
    new-instance v0, Ljava/lang/StringBuffer;

    const-string v1, "Dummy data state: none, dummy!"

    invoke-direct {v0, v1}, Ljava/lang/StringBuffer;-><init>(Ljava/lang/String;)V

    .line 181
    .local v0, sb:Ljava/lang/StringBuffer;
    invoke-virtual {v0}, Ljava/lang/StringBuffer;->toString()Ljava/lang/String;

    move-result-object v1

    return-object v1
.end method


text:
define([
	"dojo/_base/declare",
	"dojo/_base/connect",
	"../core/_Module",
	"dojo/dom-class",
	"dojo/keys",
	"dojo/_base/event",
	"dojo/_base/lang",
	"dijit/registry",
	"dijit/Menu"
], function(declare, connect, _Module, domClass, keys, event, lang, registry, Menu){

/*=====
	var _MenuArgs = function(){
		//hookPoint: String?
		//		Indicates from where the menu should occur.
		//		One of "cell", "headercell", "row", "header", "body", "grid". If invalid, default to "grid".
		//selected: Boolean?
		//		Indicates whether to bind this menu only to the selected items. Default is false.
	};

	var _MenuContext = function(){
		//grid: Grid
		//		This grid that triggers this menu.
		//column: Column
		//		The column that triggers this menu. Only valid for "headercell" hookpoint.
		//row: Row
		//		The row that triggers this menu. Only valid for "row" hookpoint.
		//cell: Cell
		//		The cell that triggers this menu. Only valid for "cell" hookpoint.
	};
=====*/

	return declare(/*===== "gridx.modules.Menu", =====*/_Module, {
		name: 'menu',

		getAPIPath: function(){
			return {
				menu: this
			};
		},

		constructor: function(){
			this._menus = {};
		},

		//Public---------------------------------------------

		//context: __MenuContext
		//		An object representing the current context when user triggers a context menu.
		//		This property is updated everytime a menu of grid is popped up.
		//		Users can refer to this in their menu action handlers by grid.menu.context.
		context: null,

		bind: function(/* dijit.Menu|ID */ menu, /* __MenuArgs? */ args){
			// summary:
			//		Bind a memu to grid, according to the provided args
			//menu: dijit.Menu | ID
			//		The menu to be binded.
			//args: __MenuArgs
			//		Indicates how to bind the menu
			args = args || {};
			var t = this,
				g = t.grid,
				hookPoint = args.hookPoint && args.hookPoint.toLowerCase() || 'grid',
				type = args.selected ? hookPoint + '-selected' : hookPoint,
				evtName = t._evtMap[hookPoint],
				m = t._menus[type] = t._menus[type] || {},
				showMenu = lang.partial(t._showMenu, type);
			connect.disconnect(m.open);
			connect.disconnect(m.close);
			m.menu = registry.byId(menu);
			if(evtName){
				m.open = t.connect(g, evtName, showMenu);
			}else if(hookPoint == 'body'){
				m.open = t.connect(g.bodyNode, 'oncontextmenu', showMenu);
			}else{
				m.open = t.connect(g.domNode, 'oncontextmenu', showMenu);
			}
			m.close = t.connect(m.menu, 'onClose', function(){
				t._mutex = 0;
			});
		},

		unbind: function(menu){
			// summary:
			//		Unbind a menu from grid.
			//menu: dijit.Menu | ID
			//		The menu to be unbinded.
			var type, menus = this._menus, m;
			menu = registry.byId(menu);
			for(type in menus){
				m = menus[type];
				if(m.menu == menu){
					connect.disconnect(m.open);
					connect.disconnect(m.close);
					delete menus[type];
					return;
				}
			}
		},

		//[private]==
		_evtMap: {
			header: 'onHeaderContextMenu',
			headercell: 'onHeaderCellContextMenu',
			cell: 'onCellContextMenu',
			row: 'onRowContextMenu'
		},

		_showMenu: function(type, e){
			var t = this, menus = t._menus;
			if(!t._mutex && menus[type].menu){
				var g = t.grid,
					rid = e.rowId,
					cid = e.columnId,
					isRow = !type.indexOf('row'),
					isCell = !type.indexOf('cell'),
					isHeaderCell = !type.indexOf('headercell'),
					isSelectedType = type.indexOf('-') > 0,
					selected = !!((isCell && domClass.contains(e.cellNode, "gridxCellSelected")) ||
						(isHeaderCell && domClass.contains(g.header.getHeaderNode(cid), "gridxColumnSelected")) ||
						(isRow && domClass.contains(g.body.getRowNode({rowId: rid}), "gridxRowSelected")));
				if(isSelectedType == selected || (!isSelectedType && selected && !menus[type + '-selected'])){
					t.context = {
						grid: g,
						column: isHeaderCell && g.column(cid, 1),
						row: isRow && g.row(rid, 1),
						cell: isCell && g.cell(rid, cid, 1)
					};
					event.stop(e);
					t._mutex = 1;
					menus[type].menu._openMyself({
						target: e.target,
						coords: e.keyCode != keys.F10 && "pageX" in e ? {x: e.pageX, y: e.pageY} : null
					});
				}
			}
		}
	});
});