code
stringlengths
4
1.01M
language
stringclasses
2 values
<?php final class DifferentialLandingActionMenuEventListener extends PhabricatorEventListener { public function register() { $this->listen(PhabricatorEventType::TYPE_UI_DIDRENDERACTIONS); } public function handleEvent(PhutilEvent $event) { switch ($event->getType()) { case PhabricatorEventType::TYPE_UI_DIDRENDERACTIONS: $this->handleActionsEvent($event); break; } } private function handleActionsEvent(PhutilEvent $event) { $object = $event->getValue('object'); $actions = null; if ($object instanceof DifferentialRevision) { $actions = $this->renderRevisionAction($event); } $this->addActionMenuItems($event, $actions); } private function renderRevisionAction(PhutilEvent $event) { if (!$this->canUseApplication($event->getUser())) { return null; } $revision = $event->getValue('object'); $repository = $revision->getRepository(); if ($repository === null) { return null; } $strategies = id(new PhutilSymbolLoader()) ->setAncestorClass('DifferentialLandingStrategy') ->loadObjects(); foreach ($strategies as $strategy) { $actions = $strategy->createMenuItems( $event->getUser(), $revision, $repository); $this->addActionMenuItems($event, $actions); } } }
Java
/* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.elasticsearch.cluster.routing; import com.carrotsearch.hppc.ObjectIntHashMap; import com.carrotsearch.hppc.cursors.ObjectCursor; import org.apache.lucene.util.CollectionUtil; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.block.ClusterBlocks; import org.elasticsearch.cluster.metadata.MetaData; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.Nullable; import org.elasticsearch.common.Randomness; import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.index.Index; import org.elasticsearch.index.shard.ShardId; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import java.util.function.Predicate; /** * {@link RoutingNodes} represents a copy the routing information contained in * the {@link ClusterState cluster state}. */ public class RoutingNodes implements Iterable<RoutingNode> { private final MetaData metaData; private final ClusterBlocks blocks; private final RoutingTable routingTable; private final Map<String, RoutingNode> nodesToShards = new HashMap<>(); private final UnassignedShards unassignedShards = new UnassignedShards(this); private final Map<ShardId, List<ShardRouting>> assignedShards = new HashMap<>(); private final ImmutableOpenMap<String, ClusterState.Custom> customs; private final boolean readOnly; private int inactivePrimaryCount = 0; private int inactiveShardCount = 0; private int relocatingShards = 0; private final Map<String, ObjectIntHashMap<String>> nodesPerAttributeNames = new HashMap<>(); private final Map<String, Recoveries> recoveryiesPerNode = new HashMap<>(); public RoutingNodes(ClusterState clusterState) { this(clusterState, true); } public RoutingNodes(ClusterState clusterState, boolean readOnly) { this.readOnly = readOnly; this.metaData = clusterState.metaData(); this.blocks = clusterState.blocks(); this.routingTable = clusterState.routingTable(); this.customs = clusterState.customs(); Map<String, List<ShardRouting>> nodesToShards = new HashMap<>(); // fill in the nodeToShards with the "live" nodes for (ObjectCursor<DiscoveryNode> cursor : clusterState.nodes().dataNodes().values()) { nodesToShards.put(cursor.value.id(), new ArrayList<>()); } // fill in the inverse of node -> shards allocated // also fill replicaSet information for (ObjectCursor<IndexRoutingTable> indexRoutingTable : routingTable.indicesRouting().values()) { for (IndexShardRoutingTable indexShard : indexRoutingTable.value) { assert indexShard.primary != null; for (ShardRouting shard : indexShard) { // to get all the shards belonging to an index, including the replicas, // we define a replica set and keep track of it. A replica set is identified // by the ShardId, as this is common for primary and replicas. // A replica Set might have one (and not more) replicas with the state of RELOCATING. if (shard.assignedToNode()) { List<ShardRouting> entries = nodesToShards.computeIfAbsent(shard.currentNodeId(), k -> new ArrayList<>()); final ShardRouting sr = getRouting(shard, readOnly); entries.add(sr); assignedShardsAdd(sr); if (shard.relocating()) { relocatingShards++; entries = nodesToShards.computeIfAbsent(shard.relocatingNodeId(), k -> new ArrayList<>()); // add the counterpart shard with relocatingNodeId reflecting the source from which // it's relocating from. ShardRouting targetShardRouting = shard.buildTargetRelocatingShard(); addInitialRecovery(targetShardRouting); if (readOnly) { targetShardRouting.freeze(); } entries.add(targetShardRouting); assignedShardsAdd(targetShardRouting); } else if (shard.active() == false) { // shards that are initializing without being relocated if (shard.primary()) { inactivePrimaryCount++; } inactiveShardCount++; addInitialRecovery(shard); } } else { final ShardRouting sr = getRouting(shard, readOnly); assignedShardsAdd(sr); unassignedShards.add(sr); } } } } for (Map.Entry<String, List<ShardRouting>> entry : nodesToShards.entrySet()) { String nodeId = entry.getKey(); this.nodesToShards.put(nodeId, new RoutingNode(nodeId, clusterState.nodes().get(nodeId), entry.getValue())); } } private void addRecovery(ShardRouting routing) { addRecovery(routing, true, false); } private void removeRecovery(ShardRouting routing) { addRecovery(routing, false, false); } public void addInitialRecovery(ShardRouting routing) { addRecovery(routing,true, true); } private void addRecovery(final ShardRouting routing, final boolean increment, final boolean initializing) { final int howMany = increment ? 1 : -1; assert routing.initializing() : "routing must be initializing: " + routing; Recoveries.getOrAdd(recoveryiesPerNode, routing.currentNodeId()).addIncoming(howMany); final String sourceNodeId; if (routing.relocatingNodeId() != null) { // this is a relocation-target sourceNodeId = routing.relocatingNodeId(); if (routing.primary() && increment == false) { // primary is done relocating int numRecoveringReplicas = 0; for (ShardRouting assigned : assignedShards(routing)) { if (assigned.primary() == false && assigned.initializing() && assigned.relocatingNodeId() == null) { numRecoveringReplicas++; } } // we transfer the recoveries to the relocated primary recoveryiesPerNode.get(sourceNodeId).addOutgoing(-numRecoveringReplicas); recoveryiesPerNode.get(routing.currentNodeId()).addOutgoing(numRecoveringReplicas); } } else if (routing.primary() == false) { // primary without relocationID is initial recovery ShardRouting primary = findPrimary(routing); if (primary == null && initializing) { primary = routingTable.index(routing.index().getName()).shard(routing.shardId().id()).primary; } else if (primary == null) { throw new IllegalStateException("replica is initializing but primary is unassigned"); } sourceNodeId = primary.currentNodeId(); } else { sourceNodeId = null; } if (sourceNodeId != null) { Recoveries.getOrAdd(recoveryiesPerNode, sourceNodeId).addOutgoing(howMany); } } public int getIncomingRecoveries(String nodeId) { return recoveryiesPerNode.getOrDefault(nodeId, Recoveries.EMPTY).getIncoming(); } public int getOutgoingRecoveries(String nodeId) { return recoveryiesPerNode.getOrDefault(nodeId, Recoveries.EMPTY).getOutgoing(); } private ShardRouting findPrimary(ShardRouting routing) { List<ShardRouting> shardRoutings = assignedShards.get(routing.shardId()); ShardRouting primary = null; if (shardRoutings != null) { for (ShardRouting shardRouting : shardRoutings) { if (shardRouting.primary()) { if (shardRouting.active()) { return shardRouting; } else if (primary == null) { primary = shardRouting; } else if (primary.relocatingNodeId() != null) { primary = shardRouting; } } } } return primary; } private static ShardRouting getRouting(ShardRouting src, boolean readOnly) { if (readOnly) { src.freeze(); // we just freeze and reuse this instance if we are read only } else { src = new ShardRouting(src); } return src; } @Override public Iterator<RoutingNode> iterator() { return Collections.unmodifiableCollection(nodesToShards.values()).iterator(); } public RoutingTable routingTable() { return routingTable; } public RoutingTable getRoutingTable() { return routingTable(); } public MetaData metaData() { return this.metaData; } public MetaData getMetaData() { return metaData(); } public ClusterBlocks blocks() { return this.blocks; } public ClusterBlocks getBlocks() { return this.blocks; } public ImmutableOpenMap<String, ClusterState.Custom> customs() { return this.customs; } public <T extends ClusterState.Custom> T custom(String type) { return (T) customs.get(type); } public UnassignedShards unassigned() { return this.unassignedShards; } public RoutingNodesIterator nodes() { return new RoutingNodesIterator(nodesToShards.values().iterator()); } public RoutingNode node(String nodeId) { return nodesToShards.get(nodeId); } public ObjectIntHashMap<String> nodesPerAttributesCounts(String attributeName) { ObjectIntHashMap<String> nodesPerAttributesCounts = nodesPerAttributeNames.get(attributeName); if (nodesPerAttributesCounts != null) { return nodesPerAttributesCounts; } nodesPerAttributesCounts = new ObjectIntHashMap<>(); for (RoutingNode routingNode : this) { String attrValue = routingNode.node().attributes().get(attributeName); nodesPerAttributesCounts.addTo(attrValue, 1); } nodesPerAttributeNames.put(attributeName, nodesPerAttributesCounts); return nodesPerAttributesCounts; } /** * Returns <code>true</code> iff this {@link RoutingNodes} instance has any unassigned primaries even if the * primaries are marked as temporarily ignored. */ public boolean hasUnassignedPrimaries() { return unassignedShards.getNumPrimaries() + unassignedShards.getNumIgnoredPrimaries() > 0; } /** * Returns <code>true</code> iff this {@link RoutingNodes} instance has any unassigned shards even if the * shards are marked as temporarily ignored. * @see UnassignedShards#isEmpty() * @see UnassignedShards#isIgnoredEmpty() */ public boolean hasUnassignedShards() { return unassignedShards.isEmpty() == false || unassignedShards.isIgnoredEmpty() == false; } public boolean hasInactivePrimaries() { return inactivePrimaryCount > 0; } public boolean hasInactiveShards() { return inactiveShardCount > 0; } public int getRelocatingShardCount() { return relocatingShards; } /** * Returns the active primary shard for the given ShardRouting or <code>null</code> if * no primary is found or the primary is not active. */ public ShardRouting activePrimary(ShardRouting shard) { for (ShardRouting shardRouting : assignedShards(shard.shardId())) { if (shardRouting.primary() && shardRouting.active()) { return shardRouting; } } return null; } /** * Returns one active replica shard for the given ShardRouting shard ID or <code>null</code> if * no active replica is found. */ public ShardRouting activeReplica(ShardRouting shard) { for (ShardRouting shardRouting : assignedShards(shard.shardId())) { if (!shardRouting.primary() && shardRouting.active()) { return shardRouting; } } return null; } /** * Returns all shards that are not in the state UNASSIGNED with the same shard * ID as the given shard. */ public Iterable<ShardRouting> assignedShards(ShardRouting shard) { return assignedShards(shard.shardId()); } /** * Returns <code>true</code> iff all replicas are active for the given shard routing. Otherwise <code>false</code> */ public boolean allReplicasActive(ShardRouting shardRouting) { final List<ShardRouting> shards = assignedShards(shardRouting.shardId()); if (shards.isEmpty() || shards.size() < this.routingTable.index(shardRouting.index().getName()).shard(shardRouting.id()).size()) { return false; // if we are empty nothing is active if we have less than total at least one is unassigned } for (ShardRouting shard : shards) { if (!shard.active()) { return false; } } return true; } public List<ShardRouting> shards(Predicate<ShardRouting> predicate) { List<ShardRouting> shards = new ArrayList<>(); for (RoutingNode routingNode : this) { for (ShardRouting shardRouting : routingNode) { if (predicate.test(shardRouting)) { shards.add(shardRouting); } } } return shards; } public List<ShardRouting> shardsWithState(ShardRoutingState... state) { // TODO these are used on tests only - move into utils class List<ShardRouting> shards = new ArrayList<>(); for (RoutingNode routingNode : this) { shards.addAll(routingNode.shardsWithState(state)); } for (ShardRoutingState s : state) { if (s == ShardRoutingState.UNASSIGNED) { unassigned().forEach(shards::add); break; } } return shards; } public List<ShardRouting> shardsWithState(String index, ShardRoutingState... state) { // TODO these are used on tests only - move into utils class List<ShardRouting> shards = new ArrayList<>(); for (RoutingNode routingNode : this) { shards.addAll(routingNode.shardsWithState(index, state)); } for (ShardRoutingState s : state) { if (s == ShardRoutingState.UNASSIGNED) { for (ShardRouting unassignedShard : unassignedShards) { if (unassignedShard.index().equals(index)) { shards.add(unassignedShard); } } break; } } return shards; } public String prettyPrint() { StringBuilder sb = new StringBuilder("routing_nodes:\n"); for (RoutingNode routingNode : this) { sb.append(routingNode.prettyPrint()); } sb.append("---- unassigned\n"); for (ShardRouting shardEntry : unassignedShards) { sb.append("--------").append(shardEntry.shortSummary()).append('\n'); } return sb.toString(); } /** * Moves a shard from unassigned to initialize state * * @param existingAllocationId allocation id to use. If null, a fresh allocation id is generated. */ public void initialize(ShardRouting shard, String nodeId, @Nullable String existingAllocationId, long expectedSize) { ensureMutable(); assert shard.unassigned() : shard; shard.initialize(nodeId, existingAllocationId, expectedSize); node(nodeId).add(shard); inactiveShardCount++; if (shard.primary()) { inactivePrimaryCount++; } addRecovery(shard); assignedShardsAdd(shard); } /** * Relocate a shard to another node, adding the target initializing * shard as well as assigning it. And returning the target initializing * shard. */ public ShardRouting relocate(ShardRouting shard, String nodeId, long expectedShardSize) { ensureMutable(); relocatingShards++; shard.relocate(nodeId, expectedShardSize); ShardRouting target = shard.buildTargetRelocatingShard(); node(target.currentNodeId()).add(target); assignedShardsAdd(target); addRecovery(target); return target; } /** * Mark a shard as started and adjusts internal statistics. */ public void started(ShardRouting shard) { ensureMutable(); assert !shard.active() : "expected an initializing shard " + shard; if (shard.relocatingNodeId() == null) { // if this is not a target shard for relocation, we need to update statistics inactiveShardCount--; if (shard.primary()) { inactivePrimaryCount--; } } removeRecovery(shard); shard.moveToStarted(); } /** * Cancels a relocation of a shard that shard must relocating. */ public void cancelRelocation(ShardRouting shard) { ensureMutable(); relocatingShards--; shard.cancelRelocation(); } /** * swaps the status of a shard, making replicas primary and vice versa. * * @param shards the shard to have its primary status swapped. */ public void swapPrimaryFlag(ShardRouting... shards) { ensureMutable(); for (ShardRouting shard : shards) { if (shard.primary()) { shard.moveFromPrimary(); if (shard.unassigned()) { unassignedShards.primaries--; } } else { shard.moveToPrimary(); if (shard.unassigned()) { unassignedShards.primaries++; } } } } private static final List<ShardRouting> EMPTY = Collections.emptyList(); private List<ShardRouting> assignedShards(ShardId shardId) { final List<ShardRouting> replicaSet = assignedShards.get(shardId); return replicaSet == null ? EMPTY : Collections.unmodifiableList(replicaSet); } /** * Cancels the give shard from the Routing nodes internal statistics and cancels * the relocation if the shard is relocating. */ private void remove(ShardRouting shard) { ensureMutable(); if (!shard.active() && shard.relocatingNodeId() == null) { inactiveShardCount--; assert inactiveShardCount >= 0; if (shard.primary()) { inactivePrimaryCount--; } } else if (shard.relocating()) { cancelRelocation(shard); } assignedShardsRemove(shard); if (shard.initializing()) { removeRecovery(shard); } } private void assignedShardsAdd(ShardRouting shard) { if (shard.unassigned()) { // no unassigned return; } List<ShardRouting> shards = assignedShards.computeIfAbsent(shard.shardId(), k -> new ArrayList<>()); assert assertInstanceNotInList(shard, shards); shards.add(shard); } private boolean assertInstanceNotInList(ShardRouting shard, List<ShardRouting> shards) { for (ShardRouting s : shards) { assert s != shard; } return true; } private void assignedShardsRemove(ShardRouting shard) { ensureMutable(); final List<ShardRouting> replicaSet = assignedShards.get(shard.shardId()); if (replicaSet != null) { final Iterator<ShardRouting> iterator = replicaSet.iterator(); while(iterator.hasNext()) { // yes we check identity here if (shard == iterator.next()) { iterator.remove(); return; } } assert false : "Illegal state"; } } public boolean isKnown(DiscoveryNode node) { return nodesToShards.containsKey(node.getId()); } public void addNode(DiscoveryNode node) { ensureMutable(); RoutingNode routingNode = new RoutingNode(node.id(), node); nodesToShards.put(routingNode.nodeId(), routingNode); } public RoutingNodeIterator routingNodeIter(String nodeId) { final RoutingNode routingNode = nodesToShards.get(nodeId); if (routingNode == null) { return null; } return new RoutingNodeIterator(routingNode); } public RoutingNode[] toArray() { return nodesToShards.values().toArray(new RoutingNode[nodesToShards.size()]); } public void reinitShadowPrimary(ShardRouting candidate) { ensureMutable(); if (candidate.relocating()) { cancelRelocation(candidate); } candidate.reinitializeShard(); inactivePrimaryCount++; inactiveShardCount++; } /** * Returns the number of routing nodes */ public int size() { return nodesToShards.size(); } public static final class UnassignedShards implements Iterable<ShardRouting> { private final RoutingNodes nodes; private final List<ShardRouting> unassigned; private final List<ShardRouting> ignored; private int primaries = 0; private int ignoredPrimaries = 0; public UnassignedShards(RoutingNodes nodes) { this.nodes = nodes; unassigned = new ArrayList<>(); ignored = new ArrayList<>(); } public void add(ShardRouting shardRouting) { if(shardRouting.primary()) { primaries++; } unassigned.add(shardRouting); } public void sort(Comparator<ShardRouting> comparator) { CollectionUtil.timSort(unassigned, comparator); } /** * Returns the size of the non-ignored unassigned shards */ public int size() { return unassigned.size(); } /** * Returns the size of the temporarily marked as ignored unassigned shards */ public int ignoredSize() { return ignored.size(); } /** * Returns the number of non-ignored unassigned primaries */ public int getNumPrimaries() { return primaries; } /** * Returns the number of temporarily marked as ignored unassigned primaries */ public int getNumIgnoredPrimaries() { return ignoredPrimaries; } @Override public UnassignedIterator iterator() { return new UnassignedIterator(); } /** * The list of ignored unassigned shards (read only). The ignored unassigned shards * are not part of the formal unassigned list, but are kept around and used to build * back the list of unassigned shards as part of the routing table. */ public List<ShardRouting> ignored() { return Collections.unmodifiableList(ignored); } /** * Marks a shard as temporarily ignored and adds it to the ignore unassigned list. * Should be used with caution, typically, * the correct usage is to removeAndIgnore from the iterator. * @see #ignored() * @see UnassignedIterator#removeAndIgnore() * @see #isIgnoredEmpty() */ public void ignoreShard(ShardRouting shard) { if (shard.primary()) { ignoredPrimaries++; } ignored.add(shard); } public class UnassignedIterator implements Iterator<ShardRouting> { private final Iterator<ShardRouting> iterator; private ShardRouting current; public UnassignedIterator() { this.iterator = unassigned.iterator(); } @Override public boolean hasNext() { return iterator.hasNext(); } @Override public ShardRouting next() { return current = iterator.next(); } /** * Initializes the current unassigned shard and moves it from the unassigned list. * * @param existingAllocationId allocation id to use. If null, a fresh allocation id is generated. */ public void initialize(String nodeId, @Nullable String existingAllocationId, long expectedShardSize) { innerRemove(); nodes.initialize(new ShardRouting(current), nodeId, existingAllocationId, expectedShardSize); } /** * Removes and ignores the unassigned shard (will be ignored for this run, but * will be added back to unassigned once the metadata is constructed again). * Typically this is used when an allocation decision prevents a shard from being allocated such * that subsequent consumers of this API won't try to allocate this shard again. */ public void removeAndIgnore() { innerRemove(); ignoreShard(current); } /** * Unsupported operation, just there for the interface. Use {@link #removeAndIgnore()} or * {@link #initialize(String, String, long)}. */ @Override public void remove() { throw new UnsupportedOperationException("remove is not supported in unassigned iterator, use removeAndIgnore or initialize"); } private void innerRemove() { nodes.ensureMutable(); iterator.remove(); if (current.primary()) { primaries--; } } } /** * Returns <code>true</code> iff this collection contains one or more non-ignored unassigned shards. */ public boolean isEmpty() { return unassigned.isEmpty(); } /** * Returns <code>true</code> iff any unassigned shards are marked as temporarily ignored. * @see UnassignedShards#ignoreShard(ShardRouting) * @see UnassignedIterator#removeAndIgnore() */ public boolean isIgnoredEmpty() { return ignored.isEmpty(); } public void shuffle() { Randomness.shuffle(unassigned); } /** * Drains all unassigned shards and returns it. * This method will not drain ignored shards. */ public ShardRouting[] drain() { ShardRouting[] mutableShardRoutings = unassigned.toArray(new ShardRouting[unassigned.size()]); unassigned.clear(); primaries = 0; return mutableShardRoutings; } } /** * Calculates RoutingNodes statistics by iterating over all {@link ShardRouting}s * in the cluster to ensure the book-keeping is correct. * For performance reasons, this should only be called from asserts * * @return this method always returns <code>true</code> or throws an assertion error. If assertion are not enabled * this method does nothing. */ public static boolean assertShardStats(RoutingNodes routingNodes) { boolean run = false; assert (run = true); // only run if assertions are enabled! if (!run) { return true; } int unassignedPrimaryCount = 0; int unassignedIgnoredPrimaryCount = 0; int inactivePrimaryCount = 0; int inactiveShardCount = 0; int relocating = 0; Map<Index, Integer> indicesAndShards = new HashMap<>(); for (RoutingNode node : routingNodes) { for (ShardRouting shard : node) { if (!shard.active() && shard.relocatingNodeId() == null) { if (!shard.relocating()) { inactiveShardCount++; if (shard.primary()) { inactivePrimaryCount++; } } } if (shard.relocating()) { relocating++; } Integer i = indicesAndShards.get(shard.index()); if (i == null) { i = shard.id(); } indicesAndShards.put(shard.index(), Math.max(i, shard.id())); } } // Assert that the active shard routing are identical. Set<Map.Entry<Index, Integer>> entries = indicesAndShards.entrySet(); final List<ShardRouting> shards = new ArrayList<>(); for (Map.Entry<Index, Integer> e : entries) { Index index = e.getKey(); for (int i = 0; i < e.getValue(); i++) { for (RoutingNode routingNode : routingNodes) { for (ShardRouting shardRouting : routingNode) { if (shardRouting.index().equals(index) && shardRouting.id() == i) { shards.add(shardRouting); } } } List<ShardRouting> mutableShardRoutings = routingNodes.assignedShards(new ShardId(index, i)); assert mutableShardRoutings.size() == shards.size(); for (ShardRouting r : mutableShardRoutings) { assert shards.contains(r); shards.remove(r); } assert shards.isEmpty(); } } for (ShardRouting shard : routingNodes.unassigned()) { if (shard.primary()) { unassignedPrimaryCount++; } } for (ShardRouting shard : routingNodes.unassigned().ignored()) { if (shard.primary()) { unassignedIgnoredPrimaryCount++; } } for (Map.Entry<String, Recoveries> recoveries : routingNodes.recoveryiesPerNode.entrySet()) { String node = recoveries.getKey(); final Recoveries value = recoveries.getValue(); int incoming = 0; int outgoing = 0; RoutingNode routingNode = routingNodes.nodesToShards.get(node); if (routingNode != null) { // node might have dropped out of the cluster for (ShardRouting routing : routingNode) { if (routing.initializing()) { incoming++; } else if (routing.relocating()) { outgoing++; } if (routing.primary() && (routing.initializing() && routing.relocatingNodeId() != null) == false) { // we don't count the initialization end of the primary relocation List<ShardRouting> shardRoutings = routingNodes.assignedShards.get(routing.shardId()); for (ShardRouting assigned : shardRoutings) { if (assigned.primary() == false && assigned.initializing() && assigned.relocatingNodeId() == null) { outgoing++; } } } } } assert incoming == value.incoming : incoming + " != " + value.incoming; assert outgoing == value.outgoing : outgoing + " != " + value.outgoing + " node: " + routingNode; } assert unassignedPrimaryCount == routingNodes.unassignedShards.getNumPrimaries() : "Unassigned primaries is [" + unassignedPrimaryCount + "] but RoutingNodes returned unassigned primaries [" + routingNodes.unassigned().getNumPrimaries() + "]"; assert unassignedIgnoredPrimaryCount == routingNodes.unassignedShards.getNumIgnoredPrimaries() : "Unassigned ignored primaries is [" + unassignedIgnoredPrimaryCount + "] but RoutingNodes returned unassigned ignored primaries [" + routingNodes.unassigned().getNumIgnoredPrimaries() + "]"; assert inactivePrimaryCount == routingNodes.inactivePrimaryCount : "Inactive Primary count [" + inactivePrimaryCount + "] but RoutingNodes returned inactive primaries [" + routingNodes.inactivePrimaryCount + "]"; assert inactiveShardCount == routingNodes.inactiveShardCount : "Inactive Shard count [" + inactiveShardCount + "] but RoutingNodes returned inactive shards [" + routingNodes.inactiveShardCount + "]"; assert routingNodes.getRelocatingShardCount() == relocating : "Relocating shards mismatch [" + routingNodes.getRelocatingShardCount() + "] but expected [" + relocating + "]"; return true; } public class RoutingNodesIterator implements Iterator<RoutingNode>, Iterable<ShardRouting> { private RoutingNode current; private final Iterator<RoutingNode> delegate; public RoutingNodesIterator(Iterator<RoutingNode> iterator) { delegate = iterator; } @Override public boolean hasNext() { return delegate.hasNext(); } @Override public RoutingNode next() { return current = delegate.next(); } public RoutingNodeIterator nodeShards() { return new RoutingNodeIterator(current); } @Override public void remove() { delegate.remove(); } @Override public Iterator<ShardRouting> iterator() { return nodeShards(); } } public final class RoutingNodeIterator implements Iterator<ShardRouting>, Iterable<ShardRouting> { private final RoutingNode iterable; private ShardRouting shard; private final Iterator<ShardRouting> delegate; private boolean removed = false; public RoutingNodeIterator(RoutingNode iterable) { this.delegate = iterable.mutableIterator(); this.iterable = iterable; } @Override public boolean hasNext() { return delegate.hasNext(); } @Override public ShardRouting next() { removed = false; return shard = delegate.next(); } @Override public void remove() { ensureMutable(); delegate.remove(); RoutingNodes.this.remove(shard); removed = true; } /** returns true if {@link #remove()} or {@link #moveToUnassigned(UnassignedInfo)} were called on the current shard */ public boolean isRemoved() { return removed; } @Override public Iterator<ShardRouting> iterator() { return iterable.iterator(); } public void moveToUnassigned(UnassignedInfo unassignedInfo) { ensureMutable(); if (isRemoved() == false) { remove(); } ShardRouting unassigned = new ShardRouting(shard); // protective copy of the mutable shard unassigned.moveToUnassigned(unassignedInfo); unassigned().add(unassigned); } public ShardRouting current() { return shard; } } private void ensureMutable() { if (readOnly) { throw new IllegalStateException("can't modify RoutingNodes - readonly"); } } private static final class Recoveries { private static final Recoveries EMPTY = new Recoveries(); private int incoming = 0; private int outgoing = 0; int getTotal() { return incoming + outgoing; } void addOutgoing(int howMany) { assert outgoing + howMany >= 0 : outgoing + howMany+ " must be >= 0"; outgoing += howMany; } void addIncoming(int howMany) { assert incoming + howMany >= 0 : incoming + howMany+ " must be >= 0"; incoming += howMany; } int getOutgoing() { return outgoing; } int getIncoming() { return incoming; } public static Recoveries getOrAdd(Map<String, Recoveries> map, String key) { Recoveries recoveries = map.get(key); if (recoveries == null) { recoveries = new Recoveries(); map.put(key, recoveries); } return recoveries; } } }
Java
# Dianthus carthusianorum L. SPECIES #### Status ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in Sp. pl. 1:409. 1753 #### Original name null ### Remarks null
Java
{-# LANGUAGE OverloadedStrings #-} module Mdb.Status ( doStatus ) where import Control.Monad ( when ) import Control.Monad.Catch (MonadMask) import Control.Monad.IO.Class ( MonadIO, liftIO ) import Control.Monad.Logger ( logWarnN, logDebugN, logInfoN ) import Control.Monad.Reader ( ask ) import qualified Database.SQLite.Simple as SQL import Data.Monoid ( (<>) ) import qualified Data.Text as T import System.IO.Error ( tryIOError ) import System.Posix.Files ( getFileStatus, modificationTimeHiRes ) import Mdb.CmdLine ( OptStatus(..) ) import Mdb.Database ( MDB, dbExecute, runMDB', withConnection ) import Mdb.Types ( FileId ) doStatus :: (MonadMask m, MonadIO m) => OptStatus -> MDB m () doStatus = withFilesSeq . checkFile type FileInfo = (FileId, FilePath) withFilesSeq :: (MonadIO m, MonadMask m) => (FileInfo -> MDB IO ()) -> MDB m () withFilesSeq f = withConnection $ \c -> do mdb <- ask liftIO $ SQL.withStatement c "SELECT file_id, file_name FROM file ORDER BY file_id" $ \stmt -> let go = SQL.nextRow stmt >>= \mfi -> case mfi of Nothing -> return () Just fi -> (runMDB' mdb $ f fi) >> go in go checkFile :: (MonadIO m, MonadMask m) => OptStatus -> FileInfo -> MDB m () checkFile op (fid, fp) = do efs <- liftIO $ tryIOError $ getFileStatus fp case efs of Left ioe -> do logWarnN $ T.pack ( show ioe ) when (removeMissing op) $ do logInfoN $ "removing file with ID " <> (T.pack $ show fid) dbExecute "DELETE FROM file WHERE file_id = ?" (SQL.Only fid) Right fs -> logDebugN $ T.pack (show $ modificationTimeHiRes fs)
Java
/* * Copyright 2017 Yahoo Holdings, Inc. * * 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. */ package com.yahoo.athenz.zms; import java.util.List; import com.yahoo.athenz.zms.store.ObjectStoreConnection; import com.yahoo.athenz.zms.utils.ZMSUtils; import com.yahoo.rdl.Timestamp; class QuotaChecker { private final Quota defaultQuota; private boolean quotaCheckEnabled; public QuotaChecker() { // first check if the quota check is enabled or not quotaCheckEnabled = Boolean.parseBoolean(System.getProperty(ZMSConsts.ZMS_PROP_QUOTA_CHECK, "true")); // retrieve default quota values int roleQuota = Integer.parseInt(System.getProperty(ZMSConsts.ZMS_PROP_QUOTA_ROLE, "1000")); int roleMemberQuota = Integer.parseInt(System.getProperty(ZMSConsts.ZMS_PROP_QUOTA_ROLE_MEMBER, "100")); int policyQuota = Integer.parseInt(System.getProperty(ZMSConsts.ZMS_PROP_QUOTA_POLICY, "1000")); int assertionQuota = Integer.parseInt(System.getProperty(ZMSConsts.ZMS_PROP_QUOTA_ASSERTION, "100")); int serviceQuota = Integer.parseInt(System.getProperty(ZMSConsts.ZMS_PROP_QUOTA_SERVICE, "250")); int serviceHostQuota = Integer.parseInt(System.getProperty(ZMSConsts.ZMS_PROP_QUOTA_SERVICE_HOST, "10")); int publicKeyQuota = Integer.parseInt(System.getProperty(ZMSConsts.ZMS_PROP_QUOTA_PUBLIC_KEY, "100")); int entityQuota = Integer.parseInt(System.getProperty(ZMSConsts.ZMS_PROP_QUOTA_ENTITY, "100")); int subDomainQuota = Integer.parseInt(System.getProperty(ZMSConsts.ZMS_PROP_QUOTA_SUBDOMAIN, "100")); defaultQuota = new Quota().setName("server-default") .setAssertion(assertionQuota).setEntity(entityQuota) .setPolicy(policyQuota).setPublicKey(publicKeyQuota) .setRole(roleQuota).setRoleMember(roleMemberQuota) .setService(serviceQuota).setServiceHost(serviceHostQuota) .setSubdomain(subDomainQuota).setModified(Timestamp.fromCurrentTime()); } public Quota getDomainQuota(ObjectStoreConnection con, String domainName) { Quota quota = con.getQuota(domainName); return (quota == null) ? defaultQuota : quota; } void setQuotaCheckEnabled(boolean quotaCheckEnabled) { this.quotaCheckEnabled = quotaCheckEnabled; } int getListSize(List<?> list) { return (list == null) ? 0 : list.size(); } void checkSubdomainQuota(ObjectStoreConnection con, String domainName, String caller) { // if quota check is disabled we have nothing to do if (!quotaCheckEnabled) { return; } // for sub-domains we need to run the quota check against // the top level domain so let's get that first. If we are // creating a top level domain then there is no need for // quota check int idx = domainName.indexOf('.'); if (idx == -1) { return; } final String topLevelDomain = domainName.substring(0, idx); // now get the quota for the top level domain final Quota quota = getDomainQuota(con, topLevelDomain); // get the list of sub-domains for our given top level domain final String domainPrefix = topLevelDomain + "."; int objectCount = con.listDomains(domainPrefix, 0).size() + 1; if (quota.getSubdomain() < objectCount) { throw ZMSUtils.quotaLimitError("subdomain quota exceeded - limit: " + quota.getSubdomain() + " actual: " + objectCount, caller); } } void checkRoleQuota(ObjectStoreConnection con, String domainName, Role role, String caller) { // if quota check is disabled we have nothing to do if (!quotaCheckEnabled) { return; } // if our role is null then there is no quota check if (role == null) { return; } // first retrieve the domain quota final Quota quota = getDomainQuota(con, domainName); // first we're going to verify the elements that do not // require any further data from the object store int objectCount = getListSize(role.getRoleMembers()); if (quota.getRoleMember() < objectCount) { throw ZMSUtils.quotaLimitError("role member quota exceeded - limit: " + quota.getRoleMember() + " actual: " + objectCount, caller); } // now we're going to check if we'll be allowed // to create this role in the domain objectCount = con.countRoles(domainName) + 1; if (quota.getRole() < objectCount) { throw ZMSUtils.quotaLimitError("role quota exceeded - limit: " + quota.getRole() + " actual: " + objectCount, caller); } } void checkRoleMembershipQuota(ObjectStoreConnection con, String domainName, String roleName, String caller) { // if quota check is disabled we have nothing to do if (!quotaCheckEnabled) { return; } // first retrieve the domain quota final Quota quota = getDomainQuota(con, domainName); // now check to make sure we can add 1 more member // to this role without exceeding the quota int objectCount = con.countRoleMembers(domainName, roleName) + 1; if (quota.getRoleMember() < objectCount) { throw ZMSUtils.quotaLimitError("role member quota exceeded - limit: " + quota.getRoleMember() + " actual: " + objectCount, caller); } } void checkPolicyQuota(ObjectStoreConnection con, String domainName, Policy policy, String caller) { // if quota check is disabled we have nothing to do if (!quotaCheckEnabled) { return; } // if our policy is null then there is no quota check if (policy == null) { return; } // first retrieve the domain quota final Quota quota = getDomainQuota(con, domainName); // first we're going to verify the elements that do not // require any further data from the object store int objectCount = getListSize(policy.getAssertions()); if (quota.getAssertion() < objectCount) { throw ZMSUtils.quotaLimitError("policy assertion quota exceeded - limit: " + quota.getAssertion() + " actual: " + objectCount, caller); } // now we're going to check if we'll be allowed // to create this policy in the domain objectCount = con.countPolicies(domainName) + 1; if (quota.getPolicy() < objectCount) { throw ZMSUtils.quotaLimitError("policy quota exceeded - limit: " + quota.getPolicy() + " actual: " + objectCount, caller); } } void checkPolicyAssertionQuota(ObjectStoreConnection con, String domainName, String policyName, String caller) { // if quota check is disabled we have nothing to do if (!quotaCheckEnabled) { return; } // first retrieve the domain quota final Quota quota = getDomainQuota(con, domainName); // now check to make sure we can add 1 more assertion // to this policy without exceeding the quota int objectCount = con.countAssertions(domainName, policyName) + 1; if (quota.getAssertion() < objectCount) { throw ZMSUtils.quotaLimitError("policy assertion quota exceeded - limit: " + quota.getAssertion() + " actual: " + objectCount, caller); } } void checkServiceIdentityQuota(ObjectStoreConnection con, String domainName, ServiceIdentity service, String caller) { // if quota check is disabled we have nothing to do if (!quotaCheckEnabled) { return; } // if our service is null then there is no quota check if (service == null) { return; } // first retrieve the domain quota final Quota quota = getDomainQuota(con, domainName); // first we're going to verify the elements that do not // require any further data from the object store int objectCount = getListSize(service.getHosts()); if (quota.getServiceHost() < objectCount) { throw ZMSUtils.quotaLimitError("service host quota exceeded - limit: " + quota.getServiceHost() + " actual: " + objectCount, caller); } objectCount = getListSize(service.getPublicKeys()); if (quota.getPublicKey() < objectCount) { throw ZMSUtils.quotaLimitError("service public key quota exceeded - limit: " + quota.getPublicKey() + " actual: " + objectCount, caller); } // now we're going to check if we'll be allowed // to create this service in the domain objectCount = con.countServiceIdentities(domainName) + 1; if (quota.getService() < objectCount) { throw ZMSUtils.quotaLimitError("service quota exceeded - limit: " + quota.getService() + " actual: " + objectCount, caller); } } void checkServiceIdentityPublicKeyQuota(ObjectStoreConnection con, String domainName, String serviceName, String caller) { // if quota check is disabled we have nothing to do if (!quotaCheckEnabled) { return; } // first retrieve the domain quota final Quota quota = getDomainQuota(con, domainName); // now check to make sure we can add 1 more public key // to this policy without exceeding the quota int objectCount = con.countPublicKeys(domainName, serviceName) + 1; if (quota.getPublicKey() < objectCount) { throw ZMSUtils.quotaLimitError("service public key quota exceeded - limit: " + quota.getPublicKey() + " actual: " + objectCount, caller); } } void checkEntityQuota(ObjectStoreConnection con, String domainName, Entity entity, String caller) { // if quota check is disabled we have nothing to do if (!quotaCheckEnabled) { return; } // if our entity is null then there is no quota check if (entity == null) { return; } // first retrieve the domain quota final Quota quota = getDomainQuota(con, domainName); // we're going to check if we'll be allowed // to create this entity in the domain int objectCount = con.countEntities(domainName) + 1; if (quota.getEntity() < objectCount) { throw ZMSUtils.quotaLimitError("entity quota exceeded - limit: " + quota.getEntity() + " actual: " + objectCount, caller); } } }
Java
# Use this setup block to configure all options available in SimpleForm. SimpleForm.setup do |config| # Wrappers are used by the form builder to generate a # complete input. You can remove any component from the # wrapper, change the order or even add your own to the # stack. The options given below are used to wrap the # whole input. config.wrappers :default, class: :input, hint_class: :field_with_hint, error_class: :field_with_errors do |b| ## Extensions enabled by default # Any of these extensions can be disabled for a # given input by passing: `f.input EXTENSION_NAME => false`. # You can make any of these extensions optional by # renaming `b.use` to `b.optional`. # Determines whether to use HTML5 (:email, :url, ...) # and required attributes b.use :html5 # Calculates placeholders automatically from I18n # You can also pass a string as f.input placeholder: "Placeholder" b.use :placeholder ## Optional extensions # They are disabled unless you pass `f.input EXTENSION_NAME => :lookup` # to the input. If so, they will retrieve the values from the model # if any exists. If you want to enable the lookup for any of those # extensions by default, you can change `b.optional` to `b.use`. # Calculates maxlength from length validations for string inputs b.optional :maxlength # Calculates pattern from format validations for string inputs b.optional :pattern # Calculates min and max from length validations for numeric inputs b.optional :min_max # Calculates readonly automatically from readonly attributes b.optional :readonly ## Inputs b.use :label_input b.use :hint, wrap_with: { tag: :span, class: :hint } b.use :error, wrap_with: { tag: :span, class: :error } end # The default wrapper to be used by the FormBuilder. config.default_wrapper = :default # Define the way to render check boxes / radio buttons with labels. # Defaults to :nested for bootstrap config. # inline: input + label # nested: label > input config.boolean_style = :inline # Default class for buttons config.button_class = 'btn' # Method used to tidy up errors. Specify any Rails Array method. # :first lists the first message for each field. # Use :to_sentence to list all errors for each field. # config.error_method = :first # Default tag used for error notification helper. config.error_notification_tag = :div # CSS class to add for error notification helper. config.error_notification_class = 'alert alert-error' # ID to add for error notification helper. # config.error_notification_id = nil # Series of attempts to detect a default label method for collection. # config.collection_label_methods = [ :to_label, :name, :title, :to_s ] # Series of attempts to detect a default value method for collection. # config.collection_value_methods = [ :id, :to_s ] # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none. # config.collection_wrapper_tag = nil # You can define the class to use on all collection wrappers. Defaulting to none. # config.collection_wrapper_class = nil # You can wrap each item in a collection of radio/check boxes with a tag, # defaulting to :span. Please note that when using :boolean_style = :nested, # SimpleForm will force this option to be a label. # config.item_wrapper_tag = :span # You can define a class to use in all item wrappers. Defaulting to none. config.item_wrapper_class = nil # How the label text should be generated altogether with the required text. # config.label_text = lambda { |label, required| "#{required} #{label}" } # You can define the class to use on all labels. Default is nil. config.label_class = 'control-label' # You can define the class to use on all forms. Default is simple_form. # config.form_class = :simple_form # You can define which elements should obtain additional classes # config.generate_additional_classes_for = [:wrapper, :label, :input] # Whether attributes are required by default (or not). Default is true. # config.required_by_default = true # Tell browsers whether to use the native HTML5 validations (novalidate form option). # These validations are enabled in SimpleForm's internal config but disabled by default # in this configuration, which is recommended due to some quirks from different browsers. # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations, # change this configuration to true. config.browser_validations = false # Collection of methods to detect if a file type was given. # config.file_methods = [ :mounted_as, :file?, :public_filename ] # Custom mappings for input types. This should be a hash containing a regexp # to match as key, and the input type that will be used when the field name # matches the regexp as value. # config.input_mappings = { /count/ => :integer } # Custom wrappers for input types. This should be a hash containing an input # type as key and the wrapper that will be used for all inputs with specified type. # config.wrapper_mappings = { string: :prepend } # Default priority for time_zone inputs. # config.time_zone_priority = nil # Default priority for country inputs. # config.country_priority = nil # When false, do not use translations for labels. # config.translate_labels = true # Automatically discover new inputs in Rails' autoload path. # config.inputs_discovery = true # Cache SimpleForm inputs discovery # config.cache_discovery = !Rails.env.development? # Default class for inputs # config.input_class = ni # config.wrappers :checkbox, tag: :div, class: "algo", error_class: "has-error" do |b| b.use :html5 b.wrapper tag: :div do |ba| ba.use :input ba.use :label_text end b.use :hint, wrap_with: { tag: :p, class: "help-block" } b.use :error, wrap_with: { tag: :span, class: "help-block text-danger" } end end
Java
#!/usr/bin/env python # Copyright JS Foundation and other contributors, http://js.foundation # # 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. from __future__ import print_function import argparse import collections import hashlib import os import subprocess import sys import settings OUTPUT_DIR = os.path.join(settings.PROJECT_DIR, 'build', 'tests') Options = collections.namedtuple('Options', ['name', 'build_args', 'test_args']) Options.__new__.__defaults__ = ([], []) OPTIONS_PROFILE_MIN = ['--profile=minimal'] OPTIONS_PROFILE_ES51 = [] # NOTE: same as ['--profile=es5.1'] OPTIONS_PROFILE_ES2015 = ['--profile=es2015-subset'] OPTIONS_DEBUG = ['--debug'] OPTIONS_SNAPSHOT = ['--snapshot-save=on', '--snapshot-exec=on', '--jerry-cmdline-snapshot=on'] OPTIONS_UNITTESTS = ['--unittests=on', '--jerry-cmdline=off', '--error-messages=on', '--snapshot-save=on', '--snapshot-exec=on', '--vm-exec-stop=on', '--line-info=on', '--mem-stats=on'] OPTIONS_DOCTESTS = ['--doctests=on', '--jerry-cmdline=off', '--error-messages=on', '--snapshot-save=on', '--snapshot-exec=on', '--vm-exec-stop=on'] # Test options for unittests JERRY_UNITTESTS_OPTIONS = [ Options('unittests-es2015_subset', OPTIONS_UNITTESTS + OPTIONS_PROFILE_ES2015), Options('unittests-es2015_subset-debug', OPTIONS_UNITTESTS + OPTIONS_PROFILE_ES2015 + OPTIONS_DEBUG), Options('doctests-es2015_subset', OPTIONS_DOCTESTS + OPTIONS_PROFILE_ES2015), Options('doctests-es2015_subset-debug', OPTIONS_DOCTESTS + OPTIONS_PROFILE_ES2015 + OPTIONS_DEBUG), Options('unittests-es5.1', OPTIONS_UNITTESTS + OPTIONS_PROFILE_ES51), Options('unittests-es5.1-debug', OPTIONS_UNITTESTS + OPTIONS_PROFILE_ES51 + OPTIONS_DEBUG), Options('doctests-es5.1', OPTIONS_DOCTESTS + OPTIONS_PROFILE_ES51), Options('doctests-es5.1-debug', OPTIONS_DOCTESTS + OPTIONS_PROFILE_ES51 + OPTIONS_DEBUG) ] # Test options for jerry-tests JERRY_TESTS_OPTIONS = [ Options('jerry_tests-es5.1', OPTIONS_PROFILE_ES51), Options('jerry_tests-es5.1-snapshot', OPTIONS_PROFILE_ES51 + OPTIONS_SNAPSHOT, ['--snapshot']), Options('jerry_tests-es5.1-debug', OPTIONS_PROFILE_ES51 + OPTIONS_DEBUG), Options('jerry_tests-es5.1-debug-snapshot', OPTIONS_PROFILE_ES51 + OPTIONS_SNAPSHOT + OPTIONS_DEBUG, ['--snapshot']), Options('jerry_tests-es5.1-debug-cpointer_32bit', OPTIONS_PROFILE_ES51 + OPTIONS_DEBUG + ['--cpointer-32bit=on', '--mem-heap=1024']), Options('jerry_tests-es5.1-debug-external_context', OPTIONS_PROFILE_ES51 + OPTIONS_DEBUG + ['--jerry-libc=off', '--external-context=on']), Options('jerry_tests-es2015_subset-debug', OPTIONS_PROFILE_ES2015 + OPTIONS_DEBUG), ] # Test options for jerry-test-suite JERRY_TEST_SUITE_OPTIONS = JERRY_TESTS_OPTIONS[:] JERRY_TEST_SUITE_OPTIONS.extend([ Options('jerry_test_suite-minimal', OPTIONS_PROFILE_MIN), Options('jerry_test_suite-minimal-snapshot', OPTIONS_PROFILE_MIN + OPTIONS_SNAPSHOT, ['--snapshot']), Options('jerry_test_suite-minimal-debug', OPTIONS_PROFILE_MIN + OPTIONS_DEBUG), Options('jerry_test_suite-minimal-debug-snapshot', OPTIONS_PROFILE_MIN + OPTIONS_SNAPSHOT + OPTIONS_DEBUG, ['--snapshot']), Options('jerry_test_suite-es2015_subset', OPTIONS_PROFILE_ES2015), Options('jerry_test_suite-es2015_subset-snapshot', OPTIONS_PROFILE_ES2015 + OPTIONS_SNAPSHOT, ['--snapshot']), Options('jerry_test_suite-es2015_subset-debug-snapshot', OPTIONS_PROFILE_ES2015 + OPTIONS_SNAPSHOT + OPTIONS_DEBUG, ['--snapshot']), ]) # Test options for test262 TEST262_TEST_SUITE_OPTIONS = [ Options('test262_tests') ] # Test options for jerry-debugger DEBUGGER_TEST_OPTIONS = [ Options('jerry_debugger_tests', ['--debug', '--jerry-debugger=on', '--jerry-libc=off']) ] # Test options for buildoption-test JERRY_BUILDOPTIONS = [ Options('buildoption_test-lto', ['--lto=on']), Options('buildoption_test-error_messages', ['--error-messages=on']), Options('buildoption_test-all_in_one', ['--all-in-one=on']), Options('buildoption_test-valgrind', ['--valgrind=on']), Options('buildoption_test-mem_stats', ['--mem-stats=on']), Options('buildoption_test-show_opcodes', ['--show-opcodes=on']), Options('buildoption_test-show_regexp_opcodes', ['--show-regexp-opcodes=on']), Options('buildoption_test-compiler_default_libc', ['--jerry-libc=off']), Options('buildoption_test-cpointer_32bit', ['--jerry-libc=off', '--compile-flag=-m32', '--cpointer-32bit=on', '--system-allocator=on']), Options('buildoption_test-external_context', ['--jerry-libc=off', '--external-context=on']), Options('buildoption_test-shared_libs', ['--jerry-libc=off', '--shared-libs=on']), Options('buildoption_test-cmdline_test', ['--jerry-cmdline-test=on']), Options('buildoption_test-cmdline_snapshot', ['--jerry-cmdline-snapshot=on']), ] def get_arguments(): parser = argparse.ArgumentParser() parser.add_argument('--toolchain', metavar='FILE', help='Add toolchain file') parser.add_argument('-q', '--quiet', action='store_true', help='Only print out failing tests') parser.add_argument('--buildoptions', metavar='LIST', help='Add a comma separated list of extra build options to each test') parser.add_argument('--skip-list', metavar='LIST', help='Add a comma separated list of patterns of the excluded JS-tests') parser.add_argument('--outdir', metavar='DIR', default=OUTPUT_DIR, help='Specify output directory (default: %(default)s)') parser.add_argument('--check-signed-off', metavar='TYPE', nargs='?', choices=['strict', 'tolerant', 'travis'], const='strict', help='Run signed-off check (%(choices)s; default type if not given: %(const)s)') parser.add_argument('--check-cppcheck', action='store_true', help='Run cppcheck') parser.add_argument('--check-doxygen', action='store_true', help='Run doxygen') parser.add_argument('--check-pylint', action='store_true', help='Run pylint') parser.add_argument('--check-vera', action='store_true', help='Run vera check') parser.add_argument('--check-license', action='store_true', help='Run license check') parser.add_argument('--check-magic-strings', action='store_true', help='Run "magic string source code generator should be executed" check') parser.add_argument('--jerry-debugger', action='store_true', help='Run jerry-debugger tests') parser.add_argument('--jerry-tests', action='store_true', help='Run jerry-tests') parser.add_argument('--jerry-test-suite', action='store_true', help='Run jerry-test-suite') parser.add_argument('--test262', action='store_true', help='Run test262') parser.add_argument('--unittests', action='store_true', help='Run unittests (including doctests)') parser.add_argument('--buildoption-test', action='store_true', help='Run buildoption-test') parser.add_argument('--all', '--precommit', action='store_true', help='Run all tests') if len(sys.argv) == 1: parser.print_help() sys.exit(1) script_args = parser.parse_args() return script_args BINARY_CACHE = {} def create_binary(job, options): build_args = job.build_args[:] if options.buildoptions: for option in options.buildoptions.split(','): if option not in build_args: build_args.append(option) build_cmd = [settings.BUILD_SCRIPT] + build_args build_dir_path = os.path.join(options.outdir, job.name) build_cmd.append('--builddir=%s' % build_dir_path) install_dir_path = os.path.join(build_dir_path, 'local') build_cmd.append('--install=%s' % install_dir_path) if options.toolchain: build_cmd.append('--toolchain=%s' % options.toolchain) sys.stderr.write('Build command: %s\n' % ' '.join(build_cmd)) binary_key = tuple(sorted(build_args)) if binary_key in BINARY_CACHE: ret, build_dir_path = BINARY_CACHE[binary_key] sys.stderr.write('(skipping: already built at %s with returncode %d)\n' % (build_dir_path, ret)) return ret, build_dir_path try: subprocess.check_output(build_cmd) ret = 0 except subprocess.CalledProcessError as err: ret = err.returncode BINARY_CACHE[binary_key] = (ret, build_dir_path) return ret, build_dir_path def get_binary_path(build_dir_path): return os.path.join(build_dir_path, 'local', 'bin', 'jerry') def hash_binary(bin_path): blocksize = 65536 hasher = hashlib.sha1() with open(bin_path, 'rb') as bin_file: buf = bin_file.read(blocksize) while len(buf) > 0: hasher.update(buf) buf = bin_file.read(blocksize) return hasher.hexdigest() def iterate_test_runner_jobs(jobs, options): tested_paths = set() tested_hashes = {} for job in jobs: ret_build, build_dir_path = create_binary(job, options) if ret_build: yield job, ret_build, build_dir_path, None if build_dir_path in tested_paths: sys.stderr.write('(skipping: already tested with %s)\n' % build_dir_path) continue else: tested_paths.add(build_dir_path) bin_path = get_binary_path(build_dir_path) bin_hash = hash_binary(bin_path) if bin_hash in tested_hashes: sys.stderr.write('(skipping: already tested with equivalent %s)\n' % tested_hashes[bin_hash]) continue else: tested_hashes[bin_hash] = build_dir_path test_cmd = [settings.TEST_RUNNER_SCRIPT, bin_path] yield job, ret_build, test_cmd def run_check(runnable): sys.stderr.write('Test command: %s\n' % ' '.join(runnable)) try: ret = subprocess.check_call(runnable) except subprocess.CalledProcessError as err: return err.returncode return ret def run_jerry_debugger_tests(options): ret_build = ret_test = 0 for job in DEBUGGER_TEST_OPTIONS: ret_build, build_dir_path = create_binary(job, options) if ret_build: break for test_file in os.listdir(settings.DEBUGGER_TESTS_DIR): if test_file.endswith(".cmd"): test_case, _ = os.path.splitext(test_file) test_case_path = os.path.join(settings.DEBUGGER_TESTS_DIR, test_case) test_cmd = [ settings.DEBUGGER_TEST_RUNNER_SCRIPT, get_binary_path(build_dir_path), settings.DEBUGGER_CLIENT_SCRIPT, os.path.relpath(test_case_path, settings.PROJECT_DIR) ] if job.test_args: test_cmd.extend(job.test_args) ret_test |= run_check(test_cmd) return ret_build | ret_test def run_jerry_tests(options): ret_build = ret_test = 0 for job, ret_build, test_cmd in iterate_test_runner_jobs(JERRY_TESTS_OPTIONS, options): if ret_build: break test_cmd.append(settings.JERRY_TESTS_DIR) if options.quiet: test_cmd.append("-q") skip_list = [] if '--profile=es2015-subset' in job.build_args: skip_list.append(r"es5.1\/") else: skip_list.append(r"es2015\/") if options.skip_list: skip_list.append(options.skip_list) if skip_list: test_cmd.append("--skip-list=" + ",".join(skip_list)) if job.test_args: test_cmd.extend(job.test_args) ret_test |= run_check(test_cmd) return ret_build | ret_test def run_jerry_test_suite(options): ret_build = ret_test = 0 for job, ret_build, test_cmd in iterate_test_runner_jobs(JERRY_TEST_SUITE_OPTIONS, options): if ret_build: break if '--profile=minimal' in job.build_args: test_cmd.append(settings.JERRY_TEST_SUITE_MINIMAL_LIST) elif '--profile=es2015-subset' in job.build_args: test_cmd.append(settings.JERRY_TEST_SUITE_DIR) else: test_cmd.append(settings.JERRY_TEST_SUITE_ES51_LIST) if options.quiet: test_cmd.append("-q") if options.skip_list: test_cmd.append("--skip-list=" + options.skip_list) if job.test_args: test_cmd.extend(job.test_args) ret_test |= run_check(test_cmd) return ret_build | ret_test def run_test262_test_suite(options): ret_build = ret_test = 0 for job in TEST262_TEST_SUITE_OPTIONS: ret_build, build_dir_path = create_binary(job, options) if ret_build: break test_cmd = [ settings.TEST262_RUNNER_SCRIPT, get_binary_path(build_dir_path), settings.TEST262_TEST_SUITE_DIR ] if job.test_args: test_cmd.extend(job.test_args) ret_test |= run_check(test_cmd) return ret_build | ret_test def run_unittests(options): ret_build = ret_test = 0 for job in JERRY_UNITTESTS_OPTIONS: ret_build, build_dir_path = create_binary(job, options) if ret_build: break ret_test |= run_check([ settings.UNITTEST_RUNNER_SCRIPT, os.path.join(build_dir_path, 'tests'), "-q" if options.quiet else "", ]) return ret_build | ret_test def run_buildoption_test(options): for job in JERRY_BUILDOPTIONS: ret, _ = create_binary(job, options) if ret: break return ret Check = collections.namedtuple('Check', ['enabled', 'runner', 'arg']) def main(options): checks = [ Check(options.check_signed_off, run_check, [settings.SIGNED_OFF_SCRIPT] + {'tolerant': ['--tolerant'], 'travis': ['--travis']}.get(options.check_signed_off, [])), Check(options.check_cppcheck, run_check, [settings.CPPCHECK_SCRIPT]), Check(options.check_doxygen, run_check, [settings.DOXYGEN_SCRIPT]), Check(options.check_pylint, run_check, [settings.PYLINT_SCRIPT]), Check(options.check_vera, run_check, [settings.VERA_SCRIPT]), Check(options.check_license, run_check, [settings.LICENSE_SCRIPT]), Check(options.check_magic_strings, run_check, [settings.MAGIC_STRINGS_SCRIPT]), Check(options.jerry_debugger, run_jerry_debugger_tests, options), Check(options.jerry_tests, run_jerry_tests, options), Check(options.jerry_test_suite, run_jerry_test_suite, options), Check(options.test262, run_test262_test_suite, options), Check(options.unittests, run_unittests, options), Check(options.buildoption_test, run_buildoption_test, options), ] for check in checks: if check.enabled or options.all: ret = check.runner(check.arg) if ret: sys.exit(ret) if __name__ == "__main__": main(get_arguments())
Java
// Copyright 2021 The Grin Developers // // 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. mod chain_test_helper; use grin_chain as chain; use grin_core as core; use grin_keychain as keychain; use grin_util as util; use self::chain_test_helper::{clean_output_dir, genesis_block, init_chain}; use crate::chain::{Chain, Options}; use crate::core::core::{Block, KernelFeatures, NRDRelativeHeight, Transaction}; use crate::core::libtx::{build, reward, ProofBuilder}; use crate::core::{consensus, global, pow}; use crate::keychain::{ExtKeychain, ExtKeychainPath, Identifier, Keychain}; use chrono::Duration; fn build_block<K>(chain: &Chain, keychain: &K, key_id: &Identifier, txs: Vec<Transaction>) -> Block where K: Keychain, { let prev = chain.head_header().unwrap(); let next_header_info = consensus::next_difficulty(1, chain.difficulty_iter().unwrap()); let fee = txs.iter().map(|x| x.fee()).sum(); let reward = reward::output(keychain, &ProofBuilder::new(keychain), key_id, fee, false).unwrap(); let mut block = Block::new(&prev, &txs, next_header_info.clone().difficulty, reward).unwrap(); block.header.timestamp = prev.timestamp + Duration::seconds(60); block.header.pow.secondary_scaling = next_header_info.secondary_scaling; chain.set_txhashset_roots(&mut block).unwrap(); let edge_bits = global::min_edge_bits(); block.header.pow.proof.edge_bits = edge_bits; pow::pow_size( &mut block.header, next_header_info.difficulty, global::proofsize(), edge_bits, ) .unwrap(); block } #[test] fn mine_block_with_nrd_kernel_and_nrd_feature_enabled() { global::set_local_chain_type(global::ChainTypes::AutomatedTesting); global::set_local_nrd_enabled(true); util::init_test_logger(); let chain_dir = ".grin.nrd_kernel"; clean_output_dir(chain_dir); let keychain = ExtKeychain::from_random_seed(false).unwrap(); let pb = ProofBuilder::new(&keychain); let genesis = genesis_block(&keychain); let chain = init_chain(chain_dir, genesis.clone()); for n in 1..9 { let key_id = ExtKeychainPath::new(1, n, 0, 0, 0).to_identifier(); let block = build_block(&chain, &keychain, &key_id, vec![]); chain.process_block(block, Options::MINE).unwrap(); } assert_eq!(chain.head().unwrap().height, 8); let key_id1 = ExtKeychainPath::new(1, 1, 0, 0, 0).to_identifier(); let key_id2 = ExtKeychainPath::new(1, 2, 0, 0, 0).to_identifier(); let tx = build::transaction( KernelFeatures::NoRecentDuplicate { fee: 20000.into(), relative_height: NRDRelativeHeight::new(1440).unwrap(), }, &[ build::coinbase_input(consensus::REWARD, key_id1.clone()), build::output(consensus::REWARD - 20000, key_id2.clone()), ], &keychain, &pb, ) .unwrap(); let key_id9 = ExtKeychainPath::new(1, 9, 0, 0, 0).to_identifier(); let block = build_block(&chain, &keychain, &key_id9, vec![tx]); chain.process_block(block, Options::MINE).unwrap(); chain.validate(false).unwrap(); clean_output_dir(chain_dir); } #[test] fn mine_invalid_block_with_nrd_kernel_and_nrd_feature_enabled_before_hf() { global::set_local_chain_type(global::ChainTypes::AutomatedTesting); global::set_local_nrd_enabled(true); util::init_test_logger(); let chain_dir = ".grin.invalid_nrd_kernel"; clean_output_dir(chain_dir); let keychain = ExtKeychain::from_random_seed(false).unwrap(); let pb = ProofBuilder::new(&keychain); let genesis = genesis_block(&keychain); let chain = init_chain(chain_dir, genesis.clone()); for n in 1..8 { let key_id = ExtKeychainPath::new(1, n, 0, 0, 0).to_identifier(); let block = build_block(&chain, &keychain, &key_id, vec![]); chain.process_block(block, Options::MINE).unwrap(); } assert_eq!(chain.head().unwrap().height, 7); let key_id1 = ExtKeychainPath::new(1, 1, 0, 0, 0).to_identifier(); let key_id2 = ExtKeychainPath::new(1, 2, 0, 0, 0).to_identifier(); let tx = build::transaction( KernelFeatures::NoRecentDuplicate { fee: 20000.into(), relative_height: NRDRelativeHeight::new(1440).unwrap(), }, &[ build::coinbase_input(consensus::REWARD, key_id1.clone()), build::output(consensus::REWARD - 20000, key_id2.clone()), ], &keychain, &pb, ) .unwrap(); let key_id8 = ExtKeychainPath::new(1, 8, 0, 0, 0).to_identifier(); let block = build_block(&chain, &keychain, &key_id8, vec![tx]); let res = chain.process_block(block, Options::MINE); assert!(res.is_err()); clean_output_dir(chain_dir); }
Java
# AUTOGENERATED FILE FROM balenalib/jetson-xavier-nx-devkit-debian:bookworm-run ENV NODE_VERSION 12.22.9 ENV YARN_VERSION 1.22.4 RUN buildDeps='curl libatomic1' \ && set -x \ && for key in \ 6A010C5166006599AA17F08146C2130DFD2497F5 \ ; do \ gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \ gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \ gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \ done \ && apt-get update && apt-get install -y $buildDeps --no-install-recommends \ && rm -rf /var/lib/apt/lists/* \ && curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-arm64.tar.gz" \ && echo "307aa26c68600e2f73d699e58a15c59ea06928e4a348cd5a216278d9f2ee0d6c node-v$NODE_VERSION-linux-arm64.tar.gz" | sha256sum -c - \ && tar -xzf "node-v$NODE_VERSION-linux-arm64.tar.gz" -C /usr/local --strip-components=1 \ && rm "node-v$NODE_VERSION-linux-arm64.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \ && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && mkdir -p /opt/yarn \ && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \ && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && npm config set unsafe-perm true -g --unsafe-perm \ && rm -rf /tmp/* CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@node.sh" \ && echo "Running test-stack@node" \ && chmod +x test-stack@node.sh \ && bash test-stack@node.sh \ && rm -rf test-stack@node.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v8 \nOS: Debian Bookworm \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nNode.js v12.22.9, Yarn v1.22.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
Java
/* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package java.nio; import libcore.io.SizeOf; /** * This class wraps a byte buffer to be a char buffer. * <p> * Implementation notice: * <ul> * <li>After a byte buffer instance is wrapped, it becomes privately owned by * the adapter. It must NOT be accessed outside the adapter any more.</li> * <li>The byte buffer's position and limit are NOT linked with the adapter. * The adapter extends Buffer, thus has its own position and limit.</li> * </ul> * </p> * */ final class ByteBufferAsCharBuffer extends CharBuffer { private final ByteBuffer byteBuffer; static CharBuffer asCharBuffer(ByteBuffer byteBuffer) { ByteBuffer slice = byteBuffer.slice(); slice.order(byteBuffer.order()); return new ByteBufferAsCharBuffer(slice); } private ByteBufferAsCharBuffer(ByteBuffer byteBuffer) { super(byteBuffer.capacity() / SizeOf.CHAR); this.byteBuffer = byteBuffer; this.byteBuffer.clear(); this.effectiveDirectAddress = byteBuffer.effectiveDirectAddress; } @Override public CharBuffer asReadOnlyBuffer() { ByteBufferAsCharBuffer buf = new ByteBufferAsCharBuffer(byteBuffer.asReadOnlyBuffer()); buf.limit = limit; buf.position = position; buf.mark = mark; buf.byteBuffer.order = byteBuffer.order; return buf; } @Override public CharBuffer compact() { if (byteBuffer.isReadOnly()) { throw new ReadOnlyBufferException(); } byteBuffer.limit(limit * SizeOf.CHAR); byteBuffer.position(position * SizeOf.CHAR); byteBuffer.compact(); byteBuffer.clear(); position = limit - position; limit = capacity; mark = UNSET_MARK; return this; } @Override public CharBuffer duplicate() { ByteBuffer bb = byteBuffer.duplicate().order(byteBuffer.order()); ByteBufferAsCharBuffer buf = new ByteBufferAsCharBuffer(bb); buf.limit = limit; buf.position = position; buf.mark = mark; return buf; } @Override public char get() { if (position == limit) { throw new BufferUnderflowException(); } return byteBuffer.getChar(position++ * SizeOf.CHAR); } @Override public char get(int index) { checkIndex(index); return byteBuffer.getChar(index * SizeOf.CHAR); } @Override public CharBuffer get(char[] dst, int dstOffset, int charCount) { byteBuffer.limit(limit * SizeOf.CHAR); byteBuffer.position(position * SizeOf.CHAR); if (byteBuffer instanceof DirectByteBuffer) { ((DirectByteBuffer) byteBuffer).get(dst, dstOffset, charCount); } else { ((ByteArrayBuffer) byteBuffer).get(dst, dstOffset, charCount); } this.position += charCount; return this; } @Override public boolean isDirect() { return byteBuffer.isDirect(); } @Override public boolean isReadOnly() { return byteBuffer.isReadOnly(); } @Override public ByteOrder order() { return byteBuffer.order(); } @Override char[] protectedArray() { throw new UnsupportedOperationException(); } @Override int protectedArrayOffset() { throw new UnsupportedOperationException(); } @Override boolean protectedHasArray() { return false; } @Override public CharBuffer put(char c) { if (position == limit) { throw new BufferOverflowException(); } byteBuffer.putChar(position++ * SizeOf.CHAR, c); return this; } @Override public CharBuffer put(int index, char c) { checkIndex(index); byteBuffer.putChar(index * SizeOf.CHAR, c); return this; } @Override public CharBuffer put(char[] src, int srcOffset, int charCount) { byteBuffer.limit(limit * SizeOf.CHAR); byteBuffer.position(position * SizeOf.CHAR); if (byteBuffer instanceof DirectByteBuffer) { ((DirectByteBuffer) byteBuffer).put(src, srcOffset, charCount); } else { ((ByteArrayBuffer) byteBuffer).put(src, srcOffset, charCount); } this.position += charCount; return this; } @Override public CharBuffer slice() { byteBuffer.limit(limit * SizeOf.CHAR); byteBuffer.position(position * SizeOf.CHAR); ByteBuffer bb = byteBuffer.slice().order(byteBuffer.order()); CharBuffer result = new ByteBufferAsCharBuffer(bb); byteBuffer.clear(); return result; } @Override public CharBuffer subSequence(int start, int end) { checkStartEndRemaining(start, end); CharBuffer result = duplicate(); result.limit(position + end); result.position(position + start); return result; } }
Java
# AUTOGENERATED FILE FROM balenalib/photon-nano-debian:stretch-run # remove several traces of debian python RUN apt-get purge -y python.* # http://bugs.python.org/issue19846 # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 # install python dependencies RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ netbase \ && rm -rf /var/lib/apt/lists/* # key 63C7CC90: public key "Simon McVittie <smcv@pseudorandom.co.uk>" imported # key 3372DCFA: public key "Donald Stufft (dstufft) <donald@stufft.io>" imported RUN gpg --batch --keyserver keyring.debian.org --recv-keys 4DE8FF2A63C7CC90 \ && gpg --batch --keyserver keyserver.ubuntu.com --recv-key 6E3CBCE93372DCFA \ && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 0x52a43a1e4b77b059 ENV PYTHON_VERSION 3.8.12 # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'" ENV PYTHON_PIP_VERSION 21.3.1 ENV SETUPTOOLS_VERSION 60.5.4 RUN set -x \ && buildDeps=' \ curl \ ' \ && apt-get update && apt-get install -y $buildDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \ && curl -SLO "http://resin-packages.s3.amazonaws.com/python/v$PYTHON_VERSION/Python-$PYTHON_VERSION.linux-aarch64-libffi3.2.tar.gz" \ && echo "7431f1179737fed6518ccf8187ad738c2f2e16feb75b7528e4e0bb7934d192cf Python-$PYTHON_VERSION.linux-aarch64-libffi3.2.tar.gz" | sha256sum -c - \ && tar -xzf "Python-$PYTHON_VERSION.linux-aarch64-libffi3.2.tar.gz" --strip-components=1 \ && rm -rf "Python-$PYTHON_VERSION.linux-aarch64-libffi3.2.tar.gz" \ && ldconfig \ && if [ ! -e /usr/local/bin/pip3 ]; then : \ && curl -SLO "https://raw.githubusercontent.com/pypa/get-pip/430ba37776ae2ad89f794c7a43b90dc23bac334c/get-pip.py" \ && echo "19dae841a150c86e2a09d475b5eb0602861f2a5b7761ec268049a662dbd2bd0c get-pip.py" | sha256sum -c - \ && python3 get-pip.py \ && rm get-pip.py \ ; fi \ && pip3 install --no-cache-dir --upgrade --force-reinstall pip=="$PYTHON_PIP_VERSION" setuptools=="$SETUPTOOLS_VERSION" \ && find /usr/local \ \( -type d -a -name test -o -name tests \) \ -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ -exec rm -rf '{}' + \ && cd / \ && rm -rf /usr/src/python ~/.cache # make some useful symlinks that are expected to exist RUN cd /usr/local/bin \ && ln -sf pip3 pip \ && { [ -e easy_install ] || ln -s easy_install-* easy_install; } \ && ln -sf idle3 idle \ && ln -sf pydoc3 pydoc \ && ln -sf python3 python \ && ln -sf python3-config python-config # set PYTHONPATH to point to dist-packages ENV PYTHONPATH /usr/lib/python3/dist-packages:$PYTHONPATH CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@python.sh" \ && echo "Running test-stack@python" \ && chmod +x test-stack@python.sh \ && bash test-stack@python.sh \ && rm -rf test-stack@python.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v8 \nOS: Debian Stretch \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nPython v3.8.12, Pip v21.3.1, Setuptools v60.5.4 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
Java
// // TweetComposer.h // // Created by Calvin Lai on 8/11/13. // // #import <Foundation/Foundation.h> #import <Cordova/CDVPlugin.h> #import <Social/Social.h> #import <Accounts/Accounts.h> @interface BundleIdentifier : CDVPlugin { NSMutableDictionary* callbackIds; // NSString * phoneNumber; // NSString * messageText; } @property (nonatomic, retain) NSMutableDictionary* callbackIds; //@property (nonatomic, retain) NSString *phoneNumber; //@property (nonatomic, retain) NSString *messageText; - (void)get:(CDVInvokedUrlCommand*)command; @end
Java
/* * Copyright © 2014 - 2018 Leipzig University (Database Research Group) * * 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. */ package org.gradoop.examples.io; import org.apache.flink.api.common.ProgramDescription; import org.apache.flink.api.java.ExecutionEnvironment; import org.gradoop.examples.AbstractRunner; import org.gradoop.flink.io.impl.deprecated.json.JSONDataSink; import org.gradoop.flink.io.impl.deprecated.json.JSONDataSource; import org.gradoop.flink.model.impl.epgm.GraphCollection; import org.gradoop.flink.model.impl.epgm.LogicalGraph; import org.gradoop.flink.model.impl.operators.combination.ReduceCombination; import org.gradoop.flink.model.impl.operators.grouping.Grouping; import org.gradoop.flink.util.GradoopFlinkConfig; import static java.util.Collections.singletonList; /** * Example program that reads a graph from an EPGM-specific JSON representation * into a {@link GraphCollection}, does some computation and stores the * resulting {@link LogicalGraph} as JSON. * * In the JSON representation, an EPGM graph collection (or Logical Graph) is * stored in three (or two) separate files. Each line in those files contains * a valid JSON-document describing a single entity: * * Example graphHead (data attached to logical graphs): * * { * "id":"graph-uuid-1", * "data":{"interest":"Graphs","vertexCount":4}, * "meta":{"label":"Community"} * } * * Example vertex JSON document: * * { * "id":"vertex-uuid-1", * "data":{"gender":"m","city":"Dresden","name":"Dave","age":40}, * "meta":{"label":"Person","graphs":["graph-uuid-1"]} * } * * Example edge JSON document: * * { * "id":"edge-uuid-1", * "source":"14505ae1-5003-4458-b86b-d137daff6525", * "target":"ed8386ee-338a-4177-82c4-6c1080df0411", * "data":{}, * "meta":{"label":"friendOf","graphs":["graph-uuid-1"]} * } * * An example graph collection can be found under src/main/resources/data.json. * For further information, have a look at the {@link org.gradoop.flink.io.impl.deprecated.json} * package. */ public class JSONExample extends AbstractRunner implements ProgramDescription { /** * Reads an EPGM graph collection from a directory that contains the separate * files. Files can be stored in local file system or HDFS. * * args[0]: path to input graph * args[1]: path to output graph * * @param args program arguments */ public static void main(String[] args) throws Exception { if (args.length != 2) { throw new IllegalArgumentException( "provide graph/vertex/edge paths and output directory"); } final String inputPath = args[0]; final String outputPath = args[1]; // init Flink execution environment ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment(); // create default Gradoop config GradoopFlinkConfig config = GradoopFlinkConfig.createConfig(env); // create DataSource JSONDataSource dataSource = new JSONDataSource(inputPath, config); // read graph collection from DataSource GraphCollection graphCollection = dataSource.getGraphCollection(); // do some analytics LogicalGraph schema = graphCollection .reduce(new ReduceCombination()) .groupBy(singletonList(Grouping.LABEL_SYMBOL), singletonList(Grouping.LABEL_SYMBOL)); // write resulting graph to DataSink schema.writeTo(new JSONDataSink(outputPath, config)); // execute program env.execute(); } @Override public String getDescription() { return "EPGM JSON IO Example"; } }
Java
import math def isPrime(num): if num < 2: return False # 0, 1不是质数 # num为100时, 它是不可能有因子是大于50的. 比如说60 * ? = 100, 这是不可能的, 所以这里只要比较sqrt(), 平方根 boundary = int(math.sqrt(num)) + 1 for i in range(2, boundary): if num % i == 0: return False return True def primeSieve(size): sieve = [True] * size # 某格一为乘积, 就置为False sieve[0] = False sieve[1] = True # num为100时, 它是不可能有因子是大于50的. 比如说60 * ? = 100, 这是不可能的, 所以这里只要比较sqrt(), 平方根 boundary = int(math.sqrt(size)) + 1 for i in range(2, boundary): pointer = i * 2 # startPosition. 以3为例, 3其实是质数, 但它的位数6,9, 12, ...都不是质数 while pointer < size: sieve[pointer] = False pointer += i ret = [] # contains all the prime number within "size" for i in range(size): if sieve[i] == True: ret.append(str(i)) return ret if __name__ == '__main__': primes = primeSieve(100) primesString = ", ".join(primes) print("prime : ", primesString) ''' prime : 1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97 '''
Java
package pl.touk.nussknacker.engine.management.sample.signal import java.nio.charset.StandardCharsets import io.circe.generic.JsonCodec import io.circe.generic.extras.ConfiguredJsonCodec import pl.touk.nussknacker.engine.api.CirceUtil._ import pl.touk.nussknacker.engine.flink.util.source.EspDeserializationSchema object Signals { @JsonCodec case class SampleProcessSignal(processId: String, timestamp: Long, action: SignalAction) //Note: due to some problems with circe (https://circe.github.io/circe/codecs/known-issues.html#knowndirectsubclasses-error) // and scala 2.11 this definition should be *before* SignalAction. This problem occurs during doc generation... case class RemoveLock(lockId: String) extends SignalAction { override def key: String = lockId } @ConfiguredJsonCodec sealed trait SignalAction { def key: String } } object SignalSchema { import Signals._ import org.apache.flink.streaming.api.scala._ val deserializationSchema = new EspDeserializationSchema[SampleProcessSignal](jsonBytes => decodeJsonUnsafe[SampleProcessSignal](jsonBytes)) }
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_07) on Sat Aug 23 20:46:18 CST 2014 --> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <title>Uses of Class org.xclcharts.renderer.LnChart</title> <meta name="date" content="2014-08-23"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.xclcharts.renderer.LnChart"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../org/xclcharts/renderer/LnChart.html" title="class in org.xclcharts.renderer">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/xclcharts/renderer/class-use/LnChart.html" target="_top">Frames</a></li> <li><a href="LnChart.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.xclcharts.renderer.LnChart" class="title">Uses of Class<br>org.xclcharts.renderer.LnChart</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../org/xclcharts/renderer/LnChart.html" title="class in org.xclcharts.renderer">LnChart</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.xclcharts.chart">org.xclcharts.chart</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.xclcharts.chart"> <!-- --> </a> <h3>Uses of <a href="../../../../org/xclcharts/renderer/LnChart.html" title="class in org.xclcharts.renderer">LnChart</a> in <a href="../../../../org/xclcharts/chart/package-summary.html">org.xclcharts.chart</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing subclasses, and an explanation"> <caption><span>Subclasses of <a href="../../../../org/xclcharts/renderer/LnChart.html" title="class in org.xclcharts.renderer">LnChart</a> in <a href="../../../../org/xclcharts/chart/package-summary.html">org.xclcharts.chart</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../org/xclcharts/chart/AreaChart.html" title="class in org.xclcharts.chart">AreaChart</a></strong></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../org/xclcharts/chart/LineChart.html" title="class in org.xclcharts.chart">LineChart</a></strong></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../org/xclcharts/chart/SplineChart.html" title="class in org.xclcharts.chart">SplineChart</a></strong></code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../org/xclcharts/renderer/LnChart.html" title="class in org.xclcharts.renderer">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/xclcharts/renderer/class-use/LnChart.html" target="_top">Frames</a></li> <li><a href="LnChart.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
Java
import Ember from 'ember'; const DELAY = 100; export default Ember.Component.extend({ classNameBindings : ['inlineBlock:inline-block','clip:clip'], tooltipService : Ember.inject.service('tooltip'), inlineBlock : true, clip : false, model : null, size : 'default', ariaRole : ['tooltip'], textChangedEvent : null, showTimer : null, textChanged: Ember.observer('textChangedEvent', function() { this.show(this.get('textChangedEvent')); }), mouseEnter(evt) { if ( !this.get('tooltipService.requireClick') ) { let tgt = Ember.$(evt.currentTarget); if (this.get('tooltipService.tooltipOpts')) { this.set('tooltipService.tooltipOpts', null); } // Wait for a little bit of time so that the mouse can pass through // another tooltip-element on the way to the dropdown trigger of a // tooltip-action-menu without changing the tooltip. this.set('showTimer', Ember.run.later(() => { this.show(tgt); }, DELAY)); } }, show(node) { if ( this._state === 'destroying' ) { return; } let svc = this.get('tooltipService'); this.set('showTimer', null); svc.cancelTimer(); let out = { type : this.get('type'), baseClass : this.get('baseClass'), eventPosition : node.offset(), originalNode : node, model : this.get('model'), template : this.get('tooltipTemplate'), }; if ( this.get('isCopyTo') ) { out.isCopyTo = true; } svc.set('tooltipOpts', out); }, mouseLeave: function() { if (!this.get('tooltipService.openedViaContextClick')) { if ( this.get('showTimer') ) { Ember.run.cancel(this.get('showTimer')); } else { this.get('tooltipService').leave(); } } }, modelObserver: Ember.observer('model', 'textChangedEvent', function() { let opts = this.get('tooltipService.tooltipOpts'); if (opts) { this.set('tooltipService.tooltipOpts.model', this.get('model')); } }) });
Java
package com.altas.preferencevobjectfile.model; import java.io.Serializable; /** * @author Altas * @email Altas.TuTu@gmail.com * @date 2014年9月27日 */ public class UserInfo implements Serializable { /** * */ private static final long serialVersionUID = 8558071977129572083L; public int id; public String token; public String userName; public String headImg; public String phoneNum; public double balance; public int integral; public UserInfo(){} public UserInfo(int i,String t,String un,String hi,String pn,double b,int point){ id=i; token=t; userName = un; headImg = hi; phoneNum = pn; balance = b; integral = point; } }
Java
--- layout: base title: 'Statistics of cc:preconj in UD_Arabic-PUD' udver: '2' --- ## Treebank Statistics: UD_Arabic-PUD: Relations: `cc:preconj` This relation is a language-specific subtype of <tt><a href="ar_pud-dep-cc.html">cc</a></tt>. 2 nodes (0%) are attached to their parents as `cc:preconj`. 2 instances of `cc:preconj` (100%) are right-to-left (child precedes parent). Average distance between parent and child is 2. The following 2 pairs of parts of speech are connected with `cc:preconj`: <tt><a href="ar_pud-pos-NOUN.html">NOUN</a></tt>-<tt><a href="ar_pud-pos-PART.html">PART</a></tt> (1; 50% instances), <tt><a href="ar_pud-pos-VERB.html">VERB</a></tt>-<tt><a href="ar_pud-pos-PART.html">PART</a></tt> (1; 50% instances). ~~~ conllu # visual-style 20 bgColor:blue # visual-style 20 fgColor:white # visual-style 22 bgColor:blue # visual-style 22 fgColor:white # visual-style 22 20 cc:preconj color:blue 1 خارج xArij_1 ADP IN _ 2 case _ _ 2 اليابان yAbAn_1 PROPN NNP Animacy=Nhum|Case=Gen|Gender=Fem|Number=Sing 11 obl _ SpaceAfter=No 3 , ,_0 PUNCT , _ 5 punct _ _ 4 و w CCONJ CC _ 5 cc _ SpaceAfter=No 5 بدءاً bado'_1 NOUN VBG Case=Acc|Definite=Ind|Gender=Masc 2 conj _ _ 6 من min_1 ADP IN _ 7 case _ _ 7 الإمبراطور <imobirATuwr_1 NOUN NN Animacy=Hum|Case=Gen|Definite=Def|Gender=Masc|Number=Sing 5 obl _ _ 8 شووا $awaY-i_1 PROPN NNP Animacy=Hum|Gender=Masc|Number=Sing 7 appos _ SpaceAfter=No 9 , ,_0 PUNCT , _ 2 punct _ _ 10 بات bAt-i_1 VERB VBC Aspect=Perf|Gender=Masc|Number=Sing|Person=3|Tense=Past|Voice=Act 11 aux _ _ 11 يشار >a$Ar_1 VERB VBC Aspect=Imp|Gender=Masc|Mood=Ind|Number=Sing|Person=3|Tense=Pres|Voice=Pass 0 root _ _ 12 إلى <ilaY_1 ADP IN _ 13 case _ _ 13 الأباطرة >abATirap_1 NOUN NN Animacy=Hum|Case=Gen|Definite=Def|Gender=Masc|Number=Plur 11 obl _ _ 14 عادةً EAdap_1 ADV RB _ 11 advmod _ _ 15 ب b ADP IN _ 16 case _ SpaceAfter=No 16 أسمائ {isom_1 NOUN NN Animacy=Nhum|Case=Gen|Definite=Def|Gender=Masc|Number=Plur 11 obl _ SpaceAfter=No 17 هم hm PRON PRP Case=Gen|Gender=Masc|Number=Plur|Person=3 16 nmod _ _ 18 الأولى >aw~al_2 ADJ JJ Case=Gen|Definite=Def|Gender=Fem|Number=Sing 16 amod _ SpaceAfter=No 19 , ,_0 PUNCT , _ 22 punct _ _ 20 سواء sawA'_1 PART RP _ 22 cc:preconj _ _ 21 خلال xilAl_1 ADP IN _ 22 case _ _ 22 حيات HayAp_1 NOUN NN Animacy=Nhum|Case=Gen|Definite=Def|Gender=Fem|Number=Sing 11 obl _ SpaceAfter=No 23 هم hm PRON PRP Case=Gen|Gender=Masc|Number=Plur|Person=3 22 nmod _ _ 24 أو >awo_1 CCONJ CC _ 26 cc _ _ 25 بعد baEod_1 ADP IN _ 26 case _ _ 26 وفات wafAp_1 NOUN NN Animacy=Nhum|Case=Gen|Definite=Def|Gender=Fem|Number=Sing 22 conj _ SpaceAfter=No 27 هم hm PRON PRP Case=Gen|Gender=Masc|Number=Plur|Person=3 26 nmod _ SpaceAfter=No 28 . ._0 PUNCT . _ 11 punct _ _ ~~~ ~~~ conllu # visual-style 8 bgColor:blue # visual-style 8 fgColor:white # visual-style 10 bgColor:blue # visual-style 10 fgColor:white # visual-style 10 8 cc:preconj color:blue 1 و w PART RP _ 3 compound:prt _ SpaceAfter=No 2 قد qado_1 PART RP _ 3 compound:prt _ _ 3 ظهرت Zahar-a_1 VERB VBC Aspect=Perf|Gender=Fem|Number=Sing|Person=3|Tense=Past|Voice=Act 0 root _ _ 4 نبوءةٌ nubuw'ap_1 NOUN NN Animacy=Nhum|Case=Nom|Definite=Ind|Gender=Fem|Number=Sing 3 nsubj _ _ 5 تقول qAl-u_1 VERB VBC Aspect=Imp|Gender=Fem|Mood=Ind|Number=Sing|Person=3|Tense=Pres|Voice=Act 4 acl:relcl _ _ 6 أن >an~a_1 SCONJ IN _ 10 mark _ SpaceAfter=No 7 ه h PRON PRP Case=Acc|Gender=Masc|Number=Sing|Person=3 10 nsubj _ _ 8 إما >am~A_1 PART RP _ 10 cc:preconj _ _ 9 س s PART RP _ 10 compound:prt _ SpaceAfter=No 10 يموت mAt-u_1 VERB VBC Aspect=Imp|Gender=Masc|Mood=Ind|Number=Sing|Person=3|Tense=Fut|Voice=Act 5 ccomp _ _ 11 ب b ADP IN _ 12 case _ SpaceAfter=No 12 الشيخوخة $ayoxuwxap_1 NOUN NN Animacy=Nhum|Case=Gen|Definite=Def|Gender=Fem|Number=Sing 10 obl _ _ 13 بعد baEod_1 ADP IN _ 14 case _ _ 14 حياةٍ HayAp_1 NOUN NN Animacy=Nhum|Case=Gen|Definite=Ind|Gender=Fem|Number=Sing 10 obl _ _ 15 هادئة hAdi}_2 ADJ JJ Case=Gen|Definite=Ind|Gender=Fem|Number=Sing 14 amod _ SpaceAfter=No 16 , ,_0 PUNCT , _ 19 punct _ _ 17 أو >awo_1 CCONJ CC _ 19 cc _ _ 18 س s PART RP _ 19 compound:prt _ SpaceAfter=No 19 يموت mAt-u_1 VERB VBC Aspect=Imp|Gender=Masc|Mood=Ind|Number=Sing|Person=3|Tense=Fut|Voice=Act 10 conj _ _ 20 يافعاً yAfiE_1 NOUN VBN Case=Acc|Definite=Ind|Gender=Masc|Number=Sing|VerbForm=Part|Voice=Act 19 acl _ _ 21 في fiy_1 ADP IN _ 22 case _ _ 22 أرض >aroD_1 NOUN NN Animacy=Nhum|Case=Gen|Definite=Def|Gender=Fem|Number=Sing 19 obl _ _ 23 المعركة maEorakap_1 NOUN NN Animacy=Nhum|Case=Gen|Definite=Def|Gender=Fem|Number=Sing 22 nmod _ _ 24 و w CCONJ CC _ 26 cc _ SpaceAfter=No 25 س s PART RP _ 26 compound:prt _ SpaceAfter=No 26 يكتسب {ikotasab_1 VERB VBC Aspect=Imp|Gender=Masc|Mood=Ind|Number=Sing|Person=3|Tense=Fut|Voice=Act 19 conj _ _ 27 الخلود xuluwd_1 NOUN NN Animacy=Nhum|Case=Acc|Definite=Def|Gender=Masc|Number=Sing 26 obj _ _ 28 من min_1 ADP IN _ 30 case _ _ 29 خلال xilAl_1 ADP IN _ 28 fixed _ _ 30 الشعر $iEor_1 NOUN NN Animacy=Nhum|Case=Gen|Definite=Def|Gender=Masc|Number=Sing 26 obl _ SpaceAfter=No 31 . ._0 PUNCT . _ 3 punct _ _ ~~~
Java
# Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences * Gracefully accepting constructive criticism * Focusing on what is best for the community * Showing empathy towards other community members Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment * Publishing others' private information, such as a physical or electronic address, without explicit permission * Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at info@canerkorkmaz.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. ## Attribution This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org [version]: http://contributor-covenant.org/version/1/4/
Java
# -*- encoding: utf-8 -*- # # 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. import pyparsing as pp uninary_operators = ("not", ) binary_operator = (u">=", u"<=", u"!=", u">", u"<", u"=", u"==", u"eq", u"ne", u"lt", u"gt", u"ge", u"le", u"in", u"like", u"≠", u"≥", u"≤", u"like" "in") multiple_operators = (u"and", u"or", u"∧", u"∨") operator = pp.Regex(u"|".join(binary_operator)) null = pp.Regex("None|none|null").setParseAction(pp.replaceWith(None)) boolean = "False|True|false|true" boolean = pp.Regex(boolean).setParseAction(lambda t: t[0].lower() == "true") hex_string = lambda n: pp.Word(pp.hexnums, exact=n) uuid = pp.Combine(hex_string(8) + ("-" + hex_string(4)) * 3 + "-" + hex_string(12)) number = r"[+-]?\d+(:?\.\d*)?(:?[eE][+-]?\d+)?" number = pp.Regex(number).setParseAction(lambda t: float(t[0])) identifier = pp.Word(pp.alphas, pp.alphanums + "_") quoted_string = pp.QuotedString('"') | pp.QuotedString("'") comparison_term = pp.Forward() in_list = pp.Group(pp.Suppress('[') + pp.Optional(pp.delimitedList(comparison_term)) + pp.Suppress(']'))("list") comparison_term << (null | boolean | uuid | identifier | number | quoted_string | in_list) condition = pp.Group(comparison_term + operator + comparison_term) expr = pp.operatorPrecedence(condition, [ ("not", 1, pp.opAssoc.RIGHT, ), ("and", 2, pp.opAssoc.LEFT, ), ("∧", 2, pp.opAssoc.LEFT, ), ("or", 2, pp.opAssoc.LEFT, ), ("∨", 2, pp.opAssoc.LEFT, ), ]) def _parsed_query2dict(parsed_query): result = None while parsed_query: part = parsed_query.pop() if part in binary_operator: result = {part: {parsed_query.pop(): result}} elif part in multiple_operators: if result.get(part): result[part].append( _parsed_query2dict(parsed_query.pop())) else: result = {part: [result]} elif part in uninary_operators: result = {part: result} elif isinstance(part, pp.ParseResults): kind = part.getName() if kind == "list": res = part.asList() else: res = _parsed_query2dict(part) if result is None: result = res elif isinstance(result, dict): list(result.values())[0].append(res) else: result = part return result def search_query_builder(query): parsed_query = expr.parseString(query)[0] return _parsed_query2dict(parsed_query) def list2cols(cols, objs): return cols, [tuple([o[k] for k in cols]) for o in objs] def format_string_list(objs, field): objs[field] = ", ".join(objs[field]) def format_dict_list(objs, field): objs[field] = "\n".join( "- " + ", ".join("%s: %s" % (k, v) for k, v in elem.items()) for elem in objs[field]) def format_move_dict_to_root(obj, field): for attr in obj[field]: obj["%s/%s" % (field, attr)] = obj[field][attr] del obj[field] def format_archive_policy(ap): format_dict_list(ap, "definition") format_string_list(ap, "aggregation_methods") def dict_from_parsed_args(parsed_args, attrs): d = {} for attr in attrs: value = getattr(parsed_args, attr) if value is not None: d[attr] = value return d def dict_to_querystring(objs): return "&".join(["%s=%s" % (k, v) for k, v in objs.items() if v is not None])
Java
/* Copyright 2017 Braden Farmer * * 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. */ package com.farmerbb.secondscreen.service; import android.app.KeyguardManager; import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.app.admin.DevicePolicyManager; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; import android.content.res.Configuration; import android.inputmethodservice.InputMethodService; import android.os.Build; import androidx.core.app.NotificationCompat; import android.text.InputType; import android.view.inputmethod.EditorInfo; import android.view.inputmethod.InputMethodManager; import com.farmerbb.secondscreen.R; import com.farmerbb.secondscreen.receiver.KeyboardChangeReceiver; import com.farmerbb.secondscreen.util.U; import java.util.Random; public class DisableKeyboardService extends InputMethodService { Integer notificationId; @Override public boolean onShowInputRequested(int flags, boolean configChange) { return false; } @Override public void onStartInput(EditorInfo attribute, boolean restarting) { boolean isEditingText = attribute.inputType != InputType.TYPE_NULL; boolean hasHardwareKeyboard = getResources().getConfiguration().keyboard != Configuration.KEYBOARD_NOKEYS; if(notificationId == null && isEditingText && !hasHardwareKeyboard) { Intent keyboardChangeIntent = new Intent(this, KeyboardChangeReceiver.class); PendingIntent keyboardChangePendingIntent = PendingIntent.getBroadcast(this, 0, keyboardChangeIntent, PendingIntent.FLAG_UPDATE_CURRENT); NotificationCompat.Builder notification = new NotificationCompat.Builder(this) .setContentIntent(keyboardChangePendingIntent) .setSmallIcon(android.R.drawable.stat_sys_warning) .setContentTitle(getString(R.string.disabling_soft_keyboard)) .setContentText(getString(R.string.tap_to_change_keyboards)) .setOngoing(true) .setShowWhen(false); // Respect setting to hide notification SharedPreferences prefMain = U.getPrefMain(this); if(prefMain.getBoolean("hide_notification", false)) notification.setPriority(Notification.PRIORITY_MIN); notificationId = new Random().nextInt(); NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); nm.notify(notificationId, notification.build()); boolean autoShowInputMethodPicker = false; if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { DevicePolicyManager devicePolicyManager = (DevicePolicyManager) getSystemService(DEVICE_POLICY_SERVICE); switch(devicePolicyManager.getStorageEncryptionStatus()) { case DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE: case DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE_PER_USER: break; default: autoShowInputMethodPicker = true; break; } } KeyguardManager keyguardManager = (KeyguardManager) getSystemService(KEYGUARD_SERVICE); if(keyguardManager.inKeyguardRestrictedInputMode() && autoShowInputMethodPicker) { InputMethodManager manager = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE); manager.showInputMethodPicker(); } } else if(notificationId != null && !isEditingText) { NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); nm.cancel(notificationId); notificationId = null; } } @Override public void onDestroy() { if(notificationId != null) { NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); nm.cancel(notificationId); notificationId = null; } super.onDestroy(); } }
Java
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Web.Http; using AutoMapper; using Art.Domain; namespace Art.Rest.v1 { // Generated 07/20/2013 16:40:13 // Change code for each method public class UsersController : BaseApiController { // GET Collection [HttpGet] public IEnumerable<ApiUser> Get(string expand = "") { return new List<ApiUser>(); } // GET Single [HttpGet] public ApiUser Get(int? id, string expand = "") { return new ApiUser(); } // POST = Insert [HttpPost] public ApiUser Post([FromBody] ApiUser apiuser) { return apiuser; } // PUT = Update [HttpPut] public ApiUser Put(int? id, [FromBody] ApiUser apiuser) { return apiuser; } // DELETE [HttpDelete] public ApiUser Delete(int? id) { return new ApiUser(); } } }
Java
# Copyright 2013 - Red Hat, Inc. # # 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. from solum import objects from solum.objects import extension as abstract_extension from solum.objects import operation as abstract_operation from solum.objects import plan as abstract_plan from solum.objects import sensor as abstract_sensor from solum.objects import service as abstract_srvc from solum.objects.sqlalchemy import extension from solum.objects.sqlalchemy import operation from solum.objects.sqlalchemy import plan from solum.objects.sqlalchemy import sensor from solum.objects.sqlalchemy import service def load(): """Activate the sqlalchemy backend.""" objects.registry.add(abstract_plan.Plan, plan.Plan) objects.registry.add(abstract_plan.PlanList, plan.PlanList) objects.registry.add(abstract_srvc.Service, service.Service) objects.registry.add(abstract_srvc.ServiceList, service.ServiceList) objects.registry.add(abstract_operation.Operation, operation.Operation) objects.registry.add(abstract_operation.OperationList, operation.OperationList) objects.registry.add(abstract_sensor.Sensor, sensor.Sensor) objects.registry.add(abstract_sensor.SensorList, sensor.SensorList) objects.registry.add(abstract_extension.Extension, extension.Extension) objects.registry.add(abstract_extension.ExtensionList, extension.ExtensionList)
Java
/** * @license Apache-2.0 * * Copyright (c) 2018 The Stdlib Authors. * * 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. */ 'use strict'; // MODULES // var Readable = require( 'readable-stream' ).Readable; var isPositiveNumber = require( '@stdlib/assert/is-positive-number' ).isPrimitive; var isProbability = require( '@stdlib/assert/is-probability' ).isPrimitive; var isError = require( '@stdlib/assert/is-error' ); var copy = require( '@stdlib/utils/copy' ); var inherit = require( '@stdlib/utils/inherit' ); var setNonEnumerable = require( '@stdlib/utils/define-nonenumerable-property' ); var setNonEnumerableReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); var setReadOnlyAccessor = require( '@stdlib/utils/define-read-only-accessor' ); var setReadWriteAccessor = require( '@stdlib/utils/define-read-write-accessor' ); var rnbinom = require( '@stdlib/random/base/negative-binomial' ).factory; var string2buffer = require( '@stdlib/buffer/from-string' ); var nextTick = require( '@stdlib/utils/next-tick' ); var DEFAULTS = require( './defaults.json' ); var validate = require( './validate.js' ); var debug = require( './debug.js' ); // FUNCTIONS // /** * Returns the PRNG seed. * * @private * @returns {(PRNGSeedMT19937|null)} seed */ function getSeed() { return this._prng.seed; // eslint-disable-line no-invalid-this } /** * Returns the PRNG seed length. * * @private * @returns {(PositiveInteger|null)} seed length */ function getSeedLength() { return this._prng.seedLength; // eslint-disable-line no-invalid-this } /** * Returns the PRNG state length. * * @private * @returns {(PositiveInteger|null)} state length */ function getStateLength() { return this._prng.stateLength; // eslint-disable-line no-invalid-this } /** * Returns the PRNG state size (in bytes). * * @private * @returns {(PositiveInteger|null)} state size (in bytes) */ function getStateSize() { return this._prng.byteLength; // eslint-disable-line no-invalid-this } /** * Returns the current PRNG state. * * @private * @returns {(PRNGStateMT19937|null)} current state */ function getState() { return this._prng.state; // eslint-disable-line no-invalid-this } /** * Sets the PRNG state. * * @private * @param {PRNGStateMT19937} s - generator state * @throws {Error} must provide a valid state */ function setState( s ) { this._prng.state = s; // eslint-disable-line no-invalid-this } /** * Implements the `_read` method. * * @private * @param {number} size - number (of bytes) to read * @returns {void} */ function read() { /* eslint-disable no-invalid-this */ var FLG; var r; if ( this._destroyed ) { return; } FLG = true; while ( FLG ) { this._i += 1; if ( this._i > this._iter ) { debug( 'Finished generating pseudorandom numbers.' ); return this.push( null ); } r = this._prng(); debug( 'Generated a new pseudorandom number. Value: %d. Iter: %d.', r, this._i ); if ( this._objectMode === false ) { r = r.toString(); if ( this._i === 1 ) { r = string2buffer( r ); } else { r = string2buffer( this._sep+r ); } } FLG = this.push( r ); if ( this._i%this._siter === 0 ) { this.emit( 'state', this.state ); } } /* eslint-enable no-invalid-this */ } /** * Gracefully destroys a stream, providing backward compatibility. * * @private * @param {(string|Object|Error)} [error] - error * @returns {RandomStream} Stream instance */ function destroy( error ) { /* eslint-disable no-invalid-this */ var self; if ( this._destroyed ) { debug( 'Attempted to destroy an already destroyed stream.' ); return this; } self = this; this._destroyed = true; nextTick( close ); return this; /** * Closes a stream. * * @private */ function close() { if ( error ) { debug( 'Stream was destroyed due to an error. Error: %s.', ( isError( error ) ) ? error.message : JSON.stringify( error ) ); self.emit( 'error', error ); } debug( 'Closing the stream...' ); self.emit( 'close' ); } /* eslint-enable no-invalid-this */ } // MAIN // /** * Stream constructor for generating a stream of pseudorandom numbers drawn from a binomial distribution. * * @constructor * @param {PositiveNumber} r - number of successes until experiment is stopped * @param {Probability} p - success probability * @param {Options} [options] - stream options * @param {boolean} [options.objectMode=false] - specifies whether the stream should operate in object mode * @param {(string|null)} [options.encoding=null] - specifies how `Buffer` objects should be decoded to strings * @param {NonNegativeNumber} [options.highWaterMark] - specifies the maximum number of bytes to store in an internal buffer before ceasing to generate additional pseudorandom numbers * @param {string} [options.sep='\n'] - separator used to join streamed data * @param {NonNegativeInteger} [options.iter] - number of iterations * @param {PRNG} [options.prng] - pseudorandom number generator which generates uniformly distributed pseudorandom numbers * @param {PRNGSeedMT19937} [options.seed] - pseudorandom number generator seed * @param {PRNGStateMT19937} [options.state] - pseudorandom number generator state * @param {boolean} [options.copy=true] - boolean indicating whether to copy a provided pseudorandom number generator state * @param {PositiveInteger} [options.siter] - number of iterations after which to emit the PRNG state * @throws {TypeError} `r` must be a positive number * @throws {TypeError} `p` must be a probability * @throws {TypeError} options argument must be an object * @throws {TypeError} must provide valid options * @throws {Error} must provide a valid state * @returns {RandomStream} Stream instance * * @example * var inspectStream = require( '@stdlib/streams/node/inspect-sink' ); * * function log( chunk ) { * console.log( chunk.toString() ); * } * * var opts = { * 'iter': 10 * }; * * var stream = new RandomStream( 20.0, 0.2, opts ); * * stream.pipe( inspectStream( log ) ); */ function RandomStream( r, p, options ) { var opts; var err; if ( !( this instanceof RandomStream ) ) { if ( arguments.length > 2 ) { return new RandomStream( r, p, options ); } return new RandomStream( r, p ); } if ( !isPositiveNumber( r ) ) { throw new TypeError( 'invalid argument. First argument must be a positive number. Value: `'+r+'`.' ); } if ( !isProbability( p ) ) { throw new TypeError( 'invalid argument. Second argument must be a probability. Value: `'+p+'`.' ); } opts = copy( DEFAULTS ); if ( arguments.length > 2 ) { err = validate( opts, options ); if ( err ) { throw err; } } // Make the stream a readable stream: debug( 'Creating a readable stream configured with the following options: %s.', JSON.stringify( opts ) ); Readable.call( this, opts ); // Destruction state: setNonEnumerable( this, '_destroyed', false ); // Cache whether the stream is operating in object mode: setNonEnumerableReadOnly( this, '_objectMode', opts.objectMode ); // Cache the separator: setNonEnumerableReadOnly( this, '_sep', opts.sep ); // Cache the total number of iterations: setNonEnumerableReadOnly( this, '_iter', opts.iter ); // Cache the number of iterations after which to emit the underlying PRNG state: setNonEnumerableReadOnly( this, '_siter', opts.siter ); // Initialize an iteration counter: setNonEnumerable( this, '_i', 0 ); // Create the underlying PRNG: setNonEnumerableReadOnly( this, '_prng', rnbinom( r, p, opts ) ); setNonEnumerableReadOnly( this, 'PRNG', this._prng.PRNG ); return this; } /* * Inherit from the `Readable` prototype. */ inherit( RandomStream, Readable ); /** * PRNG seed. * * @name seed * @memberof RandomStream.prototype * @type {(PRNGSeedMT19937|null)} */ setReadOnlyAccessor( RandomStream.prototype, 'seed', getSeed ); /** * PRNG seed length. * * @name seedLength * @memberof RandomStream.prototype * @type {(PositiveInteger|null)} */ setReadOnlyAccessor( RandomStream.prototype, 'seedLength', getSeedLength ); /** * PRNG state getter/setter. * * @name state * @memberof RandomStream.prototype * @type {(PRNGStateMT19937|null)} * @throws {Error} must provide a valid state */ setReadWriteAccessor( RandomStream.prototype, 'state', getState, setState ); /** * PRNG state length. * * @name stateLength * @memberof RandomStream.prototype * @type {(PositiveInteger|null)} */ setReadOnlyAccessor( RandomStream.prototype, 'stateLength', getStateLength ); /** * PRNG state size (in bytes). * * @name byteLength * @memberof RandomStream.prototype * @type {(PositiveInteger|null)} */ setReadOnlyAccessor( RandomStream.prototype, 'byteLength', getStateSize ); /** * Implements the `_read` method. * * @private * @name _read * @memberof RandomStream.prototype * @type {Function} * @param {number} size - number (of bytes) to read * @returns {void} */ setNonEnumerableReadOnly( RandomStream.prototype, '_read', read ); /** * Gracefully destroys a stream, providing backward compatibility. * * @name destroy * @memberof RandomStream.prototype * @type {Function} * @param {(string|Object|Error)} [error] - error * @returns {RandomStream} Stream instance */ setNonEnumerableReadOnly( RandomStream.prototype, 'destroy', destroy ); // EXPORTS // module.exports = RandomStream;
Java
NLP Workshop ============== NLP 代码实践 * NLP Training * <https://nlp.stanford.edu/> * <http://cs224d.stanford.edu/syllabus.html> * <https://stanfordnlp.github.io/CoreNLP/> * <https://github.com/stanfordnlp> * What‘s NLP <https://en.wikipedia.org/wiki/Natural_language_processing> * 云服务厂商 * 阿里云:<https://ai.aliyun.com/nlp?spm=5176.224200.artificialIntelligence.10.59aa6ed6XqMKd8> <https://help.aliyun.com/document_detail/60866.html?spm=a2c4g.11186623.6.542.41e34b269dp7e9> * 百度云:<http://ai.baidu.com/docs#/NLP-API/top> <http://ai.baidu.com/docs#/> <http://ai.baidu.com/tech/nlp?track=cp:ainsem|pf:pc|pp:chanpin-NLP|pu:NLP|ci:|kw:10001432>
Java
/** * Copyright (c) 2005-2012 https://github.com/zhuruiboqq * * Licensed under the Apache License, Version 2.0 (the "License"); */ package com.sishuok.es.common.entity.search.filter; import com.sishuok.es.common.entity.search.SearchOperator; import com.sishuok.es.common.entity.search.exception.InvlidSearchOperatorException; import com.sishuok.es.common.entity.search.exception.SearchException; import org.apache.commons.lang3.StringUtils; import org.springframework.util.Assert; import java.util.List; /** * <p>查询过滤条件</p> * <p>User: Zhang Kaitao * <p>Date: 13-1-15 上午7:12 * <p>Version: 1.0 */ public final class Condition implements SearchFilter { //查询参数分隔符 public static final String separator = "_"; private String key; private String searchProperty; private SearchOperator operator; private Object value; /** * 根据查询key和值生成Condition * * @param key 如 name_like * @param value * @return */ static Condition newCondition(final String key, final Object value) throws SearchException { Assert.notNull(key, "Condition key must not null"); String[] searchs = StringUtils.split(key, separator); if (searchs.length == 0) { throw new SearchException("Condition key format must be : property or property_op"); } String searchProperty = searchs[0]; SearchOperator operator = null; if (searchs.length == 1) { operator = SearchOperator.custom; } else { try { operator = SearchOperator.valueOf(searchs[1]); } catch (IllegalArgumentException e) { throw new InvlidSearchOperatorException(searchProperty, searchs[1]); } } boolean allowBlankValue = SearchOperator.isAllowBlankValue(operator); boolean isValueBlank = (value == null); isValueBlank = isValueBlank || (value instanceof String && StringUtils.isBlank((String) value)); isValueBlank = isValueBlank || (value instanceof List && ((List) value).size() == 0); //过滤掉空值,即不参与查询 if (!allowBlankValue && isValueBlank) { return null; } Condition searchFilter = newCondition(searchProperty, operator, value); return searchFilter; } /** * 根据查询属性、操作符和值生成Condition * * @param searchProperty * @param operator * @param value * @return */ static Condition newCondition(final String searchProperty, final SearchOperator operator, final Object value) { return new Condition(searchProperty, operator, value); } /** * @param searchProperty 属性名 * @param operator 操作 * @param value 值 */ private Condition(final String searchProperty, final SearchOperator operator, final Object value) { this.searchProperty = searchProperty; this.operator = operator; this.value = value; this.key = this.searchProperty + separator + this.operator; } public String getKey() { return key; } public String getSearchProperty() { return searchProperty; } /** * 获取 操作符 * * @return */ public SearchOperator getOperator() throws InvlidSearchOperatorException { return operator; } /** * 获取自定义查询使用的操作符 * 1、首先获取前台传的 * 2、返回空 * * @return */ public String getOperatorStr() { if (operator != null) { return operator.getSymbol(); } return ""; } public Object getValue() { return value; } public void setValue(final Object value) { this.value = value; } public void setOperator(final SearchOperator operator) { this.operator = operator; } public void setSearchProperty(final String searchProperty) { this.searchProperty = searchProperty; } /** * 得到实体属性名 * * @return */ public String getEntityProperty() { return searchProperty; } /** * 是否是一元过滤 如is null is not null * * @return */ public boolean isUnaryFilter() { String operatorStr = getOperator().getSymbol(); return StringUtils.isNotEmpty(operatorStr) && operatorStr.startsWith("is"); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Condition that = (Condition) o; if (key != null ? !key.equals(that.key) : that.key != null) return false; return true; } @Override public int hashCode() { return key != null ? key.hashCode() : 0; } @Override public String toString() { return "Condition{" + "searchProperty='" + searchProperty + '\'' + ", operator=" + operator + ", value=" + value + '}'; } }
Java
/* Copyright 2011 Google Inc 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. */ using System; using System.CodeDom; using System.Collections.Generic; using NUnit.Framework; using Google.Apis.Tests.Apis.Requests; using Google.Apis.Tools.CodeGen.Decorator.ResourceDecorator; using Google.Apis.Testing; namespace Google.Apis.Tools.CodeGen.Tests.Decorator.ResourceDecorator { /// <summary> /// Test class for the "DefaultEnglishCommentCreator" /// </summary> [TestFixture] public class DefaultEnglishCommentCreatorTest { /// <summary> /// Tests if a comment is generated correctly /// </summary> [Test] public void CreateMethodComment() { var method = new MockMethod(); var instance = new DefaultEnglishCommentCreator(); method.Description = "A Test description"; CodeCommentStatementCollection result = instance.CreateMethodComment(method); Assert.IsNotNull(result); Assert.AreEqual(1, result.Count); Assert.IsNotNull(result[0].Comment); Assert.AreEqual("<summary>A Test description</summary>", result[0].Comment.Text); method.Description = "A <nasty> \"description\""; result = instance.CreateMethodComment(method); Assert.AreEqual("<summary>A &lt;nasty&gt; &quot;description&quot;</summary>", result[0].Comment.Text); } /// <summary> /// Tests if the creator validates input parameters /// </summary> [Test] public void CreateMethodCommentValidateParams() { var instance = new DefaultEnglishCommentCreator(); Assert.Throws(typeof(ArgumentNullException), () => instance.CreateMethodComment(null)); } /// <summary> /// Tests comments for parameters /// </summary> [Test] public void CreateParameterComment() { var instance = new DefaultEnglishCommentCreator(); var parameter = new MockParameter(); var progamaticName = "testParameter"; CodeCommentStatementCollection result = instance.CreateParameterComment(parameter, progamaticName); Assert.IsNotNull(result); Assert.AreEqual(1, result.Count); Assert.IsNotNull(result[0].Comment); Assert.AreEqual("<param name=\"testParameter\">Optional</param>", result[0].Comment.Text); } /// <summary> /// Tests if the creator validates inputs for parameter comments /// </summary> [Test] public void CreateParameterCommentValidateParams() { var instance = new DefaultEnglishCommentCreator(); var parameter = new MockParameter(); string progamaticName = null; Assert.Throws( typeof(ArgumentNullException), () => instance.CreateParameterComment(parameter, progamaticName)); progamaticName = ""; Assert.Throws(typeof(ArgumentException), () => instance.CreateParameterComment(parameter, progamaticName)); progamaticName = "testParameter"; parameter = null; Assert.Throws( typeof(ArgumentNullException), () => instance.CreateParameterComment(parameter, progamaticName)); } /// <summary> /// Tests if meta data is generated correctly /// </summary> [Test] public void GetParameterMetaData() { var instance = new DefaultEnglishCommentCreator(); var parameter = new MockParameter(); var progamaticName = "testParameter"; parameter.Name = progamaticName; parameter.IsRequired = false; string result = instance.GetParameterMetaData(parameter, progamaticName); Assert.AreEqual("Optional", result); parameter.IsRequired = true; result = instance.GetParameterMetaData(parameter, progamaticName); Assert.AreEqual("Required", result); parameter.Name = "test-parameters"; result = instance.GetParameterMetaData(parameter, progamaticName); Assert.AreEqual("test-parameters - Required", result); parameter.Name = progamaticName; parameter.Minimum = "53"; result = instance.GetParameterMetaData(parameter, progamaticName); Assert.AreEqual("Required - Minimum value of 53", result); parameter.Minimum = null; parameter.Maximum = "105"; result = instance.GetParameterMetaData(parameter, progamaticName); Assert.AreEqual("Required - Maximum value of 105", result); parameter.Maximum = null; parameter.Pattern = ".*\\.java"; result = instance.GetParameterMetaData(parameter, progamaticName); Assert.AreEqual("Required - Must match pattern .*\\.java", result); parameter.Pattern = null; parameter.EnumValues = new List<string> { "a", "b", "c", "d" }; result = instance.GetParameterMetaData(parameter, progamaticName); Assert.AreEqual("Required - Must be one of the following values [a, b, c, d]", result); parameter.EnumValues = null; parameter.Description = "A Test Description"; result = instance.GetParameterMetaData(parameter, progamaticName); Assert.AreEqual("Required - A Test Description", result); } } }
Java
<!DOCTYPE html> <html class="theme-next muse use-motion" lang="zh-Hans"> <head> <meta charset="UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/> <meta name="theme-color" content="#222"> <meta http-equiv="Cache-Control" content="no-transform" /> <meta http-equiv="Cache-Control" content="no-siteapp" /> <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" /> <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css"> <link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" /> <link href="/css/main.css?v=5.1.2" rel="stylesheet" type="text/css" /> <meta name="keywords" content="扯淡," /> <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.2" /> <meta name="description" content="hello wold!0一直想对本科阶段的实验室学习做一个总结,也一直找了各种理由拖了下来。 1毕业设计跟软件无线电有些关系,是基于GNU Radio平台,针对eclipse写一个插件。所以这段时间在学习GR。为了能捎带着练一下英语,翻译了一下它的官方教程,作为博客的第一个系列文章。(已更两篇,持续更新) 翻译GNU Radio教程(1): GNU Radio介绍 翻译GNU Radio教程(2"> <meta name="keywords" content="扯淡"> <meta property="og:type" content="article"> <meta property="og:title" content="hello world!"> <meta property="og:url" content="http://yoursite.com/2017/10/17/第一篇博客说明翻译系列/index.html"> <meta property="og:site_name" content="INGslh&#39;s blog"> <meta property="og:description" content="hello wold!0一直想对本科阶段的实验室学习做一个总结,也一直找了各种理由拖了下来。 1毕业设计跟软件无线电有些关系,是基于GNU Radio平台,针对eclipse写一个插件。所以这段时间在学习GR。为了能捎带着练一下英语,翻译了一下它的官方教程,作为博客的第一个系列文章。(已更两篇,持续更新) 翻译GNU Radio教程(1): GNU Radio介绍 翻译GNU Radio教程(2"> <meta property="og:locale" content="zh-Hans"> <meta property="og:updated_time" content="2017-10-30T14:17:08.540Z"> <meta name="twitter:card" content="summary"> <meta name="twitter:title" content="hello world!"> <meta name="twitter:description" content="hello wold!0一直想对本科阶段的实验室学习做一个总结,也一直找了各种理由拖了下来。 1毕业设计跟软件无线电有些关系,是基于GNU Radio平台,针对eclipse写一个插件。所以这段时间在学习GR。为了能捎带着练一下英语,翻译了一下它的官方教程,作为博客的第一个系列文章。(已更两篇,持续更新) 翻译GNU Radio教程(1): GNU Radio介绍 翻译GNU Radio教程(2"> <script type="text/javascript" id="hexo.configurations"> var NexT = window.NexT || {}; var CONFIG = { root: '/', scheme: 'Muse', version: '5.1.2', sidebar: {"position":"left","display":"post","offset":12,"offset_float":12,"b2t":false,"scrollpercent":false,"onmobile":false}, fancybox: true, tabs: true, motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn"}}, duoshuo: { userId: '0', author: '博主' }, algolia: { applicationID: '', apiKey: '', indexName: '', hits: {"per_page":10}, labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"} } }; </script> <link rel="canonical" href="http://yoursite.com/2017/10/17/第一篇博客说明翻译系列/"/> <title>hello world! | INGslh's blog</title> </head> <body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans"> <div class="container sidebar-position-left page-post-detail"> <div class="headband"></div> <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader"> <div class="header-inner"><div class="site-brand-wrapper"> <div class="site-meta "> <div class="custom-logo-site-title"> <a href="/" class="brand" rel="start"> <span class="logo-line-before"><i></i></span> <span class="site-title">INGslh's blog</span> <span class="logo-line-after"><i></i></span> </a> </div> <p class="site-subtitle">尽量周更</p> </div> <div class="site-nav-toggle"> <button> <span class="btn-bar"></span> <span class="btn-bar"></span> <span class="btn-bar"></span> </button> </div> </div> <nav class="site-nav"> <ul id="menu" class="menu"> <li class="menu-item menu-item-home"> <a href="/" rel="section"> <i class="menu-item-icon fa fa-fw fa-home"></i> <br /> 首页 </a> </li> <li class="menu-item menu-item-tags"> <a href="/tags/" rel="section"> <i class="menu-item-icon fa fa-fw fa-tags"></i> <br /> 标签 </a> </li> <li class="menu-item menu-item-archives"> <a href="/archives/" rel="section"> <i class="menu-item-icon fa fa-fw fa-archive"></i> <br /> 归档 </a> </li> </ul> </nav> </div> </header> <main id="main" class="main"> <div class="main-inner"> <div class="content-wrap"> <div id="content" class="content"> <div id="posts" class="posts-expand"> <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article"> <div class="post-block"> <link itemprop="mainEntityOfPage" href="http://yoursite.com/2017/10/17/第一篇博客说明翻译系列/"> <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person"> <meta itemprop="name" content="INGslh"> <meta itemprop="description" content=""> <meta itemprop="image" content="/uploads/touxiang1.jpg"> </span> <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization"> <meta itemprop="name" content="INGslh's blog"> </span> <header class="post-header"> <h1 class="post-title" itemprop="name headline">hello world!</h1> <div class="post-meta"> <span class="post-time"> <span class="post-meta-item-icon"> <i class="fa fa-calendar-o"></i> </span> <span class="post-meta-item-text">发表于</span> <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-10-17T15:43:05+08:00"> 2017-10-17 </time> </span> </div> </header> <div class="post-body" itemprop="articleBody"> <h1 id="hello-wold"><a href="#hello-wold" class="headerlink" title="hello wold!"></a>hello wold!</h1><h2 id="0"><a href="#0" class="headerlink" title="0"></a>0</h2><p>一直想对本科阶段的实验室学习做一个总结,也一直找了各种理由拖了下来。</p> <h2 id="1"><a href="#1" class="headerlink" title="1"></a>1</h2><p>毕业设计跟软件无线电有些关系,是基于GNU Radio平台,针对eclipse写一个插件。所以这段时间在学习GR。为了能捎带着练一下英语,翻译了一下它的官方教程,作为博客的第一个系列文章。(已更两篇,持续更新)</p> <ol> <li>翻译GNU Radio教程(1): GNU Radio介绍</li> <li><a href="https://ingslh.github.io/2017/10/18/Guided%20Tutorial%20GRC%E7%BF%BB%E8%AF%91/" target="_blank" rel="external">翻译GNU Radio教程(2):GNU Radio下的GRC编程</a></li> <li><a href="https://ingslh.github.io/2017/10/20/%E7%BF%BB%E8%AF%91GNU%20radio%E6%95%99%E7%A8%8B%EF%BC%9AGNUradio%E7%9A%84Python%E7%BC%96%E7%A8%8B/" target="_blank" rel="external">翻译GNU Radio教程(3):GNU Radio下的Python编程</a></li> <li>翻译GNU Radio教程(4):GNU Radio下的C++编程</li> <li>翻译GNU Radio教程(5):GNU Radio下编程总结</li> <li>翻译GNU Radio教程(6):在GNU Radio连接硬件工作</li> <li>翻译GNU Radio教程(7):实现PSK算法</li> </ol> <h2 id="2"><a href="#2" class="headerlink" title="2"></a>2</h2><p>有点想接毕设单。。</p> </div> <div> <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;"> <div>想吃雪糕!</div> <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}"> <span>打赏</span> </button> <div id="QR" style="display: none;"> <div id="wechat" style="display: inline-block"> <img id="wechat_qr" src="/images/wechat.png" alt="INGslh 微信支付"/> <p>微信支付</p> </div> <div id="alipay" style="display: inline-block"> <img id="alipay_qr" src="/images/alipay.png" alt="INGslh 支付宝"/> <p>支付宝</p> </div> </div> </div> </div> <footer class="post-footer"> <div class="post-tags"> <a href="/tags/扯淡/" rel="tag"># 扯淡</a> </div> <div class="post-nav"> <div class="post-nav-next post-nav-item"> </div> <span class="post-nav-divider"></span> <div class="post-nav-prev post-nav-item"> <a href="/2017/10/18/Guided Tutorial GRC翻译/" rel="prev" title="翻译GNU Radio教程(2):GNU Radio下的GRC编程"> 翻译GNU Radio教程(2):GNU Radio下的GRC编程 <i class="fa fa-chevron-right"></i> </a> </div> </div> </footer> </div> </article> <div class="post-spread"> </div> </div> </div> <div class="comments" id="comments"> </div> </div> <div class="sidebar-toggle"> <div class="sidebar-toggle-line-wrap"> <span class="sidebar-toggle-line sidebar-toggle-line-first"></span> <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span> <span class="sidebar-toggle-line sidebar-toggle-line-last"></span> </div> </div> <aside id="sidebar" class="sidebar"> <div class="sidebar-inner"> <ul class="sidebar-nav motion-element"> <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" > 文章目录 </li> <li class="sidebar-nav-overview" data-target="site-overview"> 站点概览 </li> </ul> <section class="site-overview sidebar-panel"> <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person"> <img class="site-author-image" itemprop="image" src="/uploads/touxiang1.jpg" alt="INGslh" /> <p class="site-author-name" itemprop="name">INGslh</p> <p class="site-description motion-element" itemprop="description">写着玩的</p> </div> <nav class="site-state motion-element"> <div class="site-state-item site-state-posts"> <a href="/archives/"> <span class="site-state-item-count">8</span> <span class="site-state-item-name">日志</span> </a> </div> <div class="site-state-item site-state-tags"> <a href="/tags/index.html"> <span class="site-state-item-count">9</span> <span class="site-state-item-name">标签</span> </a> </div> </nav> <div class="links-of-author motion-element"> <span class="links-of-author-item"> <a href="https://github.com/ingslh" target="_blank" title="GitHub"> <i class="fa fa-fw fa-github"></i>GitHub</a> </span> <span class="links-of-author-item"> <a href="mailto:ingslh@foxmail.com" target="_blank" title="E-Mail"> <i class="fa fa-fw fa-envelope"></i>E-Mail</a> </span> <span class="links-of-author-item"> <a href="https://weibo.com/ingslh" target="_blank" title="Weibo"> <i class="fa fa-fw fa-weibo"></i>Weibo</a> </span> <span class="links-of-author-item"> <a href="https://twitter.com/ingslh" target="_blank" title="Twitter"> <i class="fa fa-fw fa-twitter"></i>Twitter</a> </span> </div> </section> <!--noindex--> <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active"> <div class="post-toc"> <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#hello-wold"><span class="nav-number">1.</span> <span class="nav-text">hello wold!</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#0"><span class="nav-number">1.1.</span> <span class="nav-text">0</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#1"><span class="nav-number">1.2.</span> <span class="nav-text">1</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2"><span class="nav-number">1.3.</span> <span class="nav-text">2</span></a></li></ol></li></ol></div> </div> </section> <!--/noindex--> </div> </aside> </div> </main> <footer id="footer" class="footer"> <div class="footer-inner"> <div class="copyright" > &copy; <span itemprop="copyrightYear">2018</span> <span class="with-love"> <i class="fa fa-heart"></i> </span> <span class="author" itemprop="copyrightHolder">INGslh</span> </div> <div class="powered-by">由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动</div> <span class="post-meta-divider">|</span> <div class="theme-info">主题 &mdash; <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">NexT.Muse</a> v5.1.2</div> </div> </footer> <div class="back-to-top"> <i class="fa fa-arrow-up"></i> </div> </div> <script type="text/javascript"> if (Object.prototype.toString.call(window.Promise) !== '[object Function]') { window.Promise = null; } </script> <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script> <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script> <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script> <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script> <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script> <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script> <script type="text/javascript" src="/js/src/utils.js?v=5.1.2"></script> <script type="text/javascript" src="/js/src/motion.js?v=5.1.2"></script> <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.2"></script> <script type="text/javascript" src="/js/src/post-details.js?v=5.1.2"></script> <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.2"></script> <script type="text/javascript" src="/js/src/post-details.js?v=5.1.2"></script> <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.2"></script> </body> </html>
Java
<?php if (!defined('ACTIVE')) die(__FILE__); $oldname = isset($_REQUEST['oldname'])? $_REQUEST['oldname'] : ''; $oldname = substr($oldname,1); $newname = isset($_REQUEST['filename'])? $_REQUEST['filename'] : ''; if ($oldname=='') setErrorCode(4); if (!file_exists($path.'/'.$oldname)) setErrorCode(1); if ($newname=='') setErrorCode(4); if (file_exists($path.'/'.$newname)) setErrorCode(2); if ($errCode==0) @rename($path.'/'.$oldname,$path.'/'.$newname); $params = array( 'cmd' => 'list', 'sort' => $sort, 'path' => urlencode($path) ); if ($errCode!=0) $params['error'] = $errCode; $LOCATION = 'index.php?'.buildQuery($params); ?>
Java
/************************************************************************* * Copyright (c) 2016, Gooeen. 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. *************************************************************************/ #ifndef __OPENVX_CPP_DEFAULT_CONSTRUCTOR_H__ #define __OPENVX_CPP_DEFAULT_CONSTRUCTOR_H__ #include "ovxcontext.h" #include "constructor.h" namespace ovx { class openvxdll default_constructor : public constructor { public: default_constructor(vx_uint32 width, vx_uint32 height, vx_df_image color, const ovxcontext &context = vxcontext); default_constructor(default_constructor &&obj) noexcept; default_constructor(const default_constructor &obj) = delete; virtual ~default_constructor(void) noexcept; void operator=(const default_constructor &) = delete; void operator=(default_constructor &&obj) noexcept; void release(void) noexcept; }; } #endif // !__OPENVX_CPP_DEFAULT_CONSTRUCTOR_H__
Java
package com.hzh.corejava.proxy; public class SpeakerExample { public static void main(String[] args) { AiSpeaker speaker = (AiSpeaker) AuthenticationProxy.newInstance(new XiaoaiAiSpeeker()); speaker.greeting(); } }
Java
# Zulip-specific tools This article documents several useful tools that can save you a lot of time when working with Git on the Zulip project. ## Set up git repo script **Extremely useful**. In the `tools` directory of [zulip/zulip][github-zulip-zulip] you'll find a bash script `setup-git-repo`. This script installs a pre-commit hook, which will run each time you `git commit` to automatically run [Zulip's linter suite](../testing/linters.html) on just the files that the commit modifies (which is really fast!). The hook passes no matter the result of the linter, but you should still pay attention to any notices or warnings it displays. It's simple to use. Make sure you're in the clone of zulip and run the following: ``` $ ./tools/setup-git-repo ``` The script doesn't produce any output if successful. To check that the hook has been installed, print a directory listing for `.git/hooks` and you should see something similar to: ``` $ ls -l .git/hooks pre-commit -> ../../tools/pre-commit ``` ## Set up Travis CI integration You might also wish to [configure your fork for use with Travis CI][zulip-git-guide-travisci]. ## Reset to pull request `tools/reset-to-pull-request` is a short-cut for [checking out a pull request locally][zulip-git-guide-fetch-pr]. It works slightly differently from the method described above in that it does not create a branch for the pull request checkout. **This tool checks for uncommitted changes, but it will move the current branch using `git reset --hard`. Use with caution.** First, make sure you are working in a branch you want to move (in this example, we'll use the local `master` branch). Then run the script with the ID number of the pull request as the first argument. ``` $ git checkout master Switched to branch 'master' Your branch is up-to-date with 'origin/master'. $ ./tools/reset-to-pull-request 1900 + request_id=1900 + git fetch upstream pull/1900/head remote: Counting objects: 159, done. remote: Compressing objects: 100% (17/17), done. remote: Total 159 (delta 94), reused 91 (delta 91), pack-reused 51 Receiving objects: 100% (159/159), 55.57 KiB | 0 bytes/s, done. Resolving deltas: 100% (113/113), completed with 54 local objects. From https://github.com/zulip/zulip * branch refs/pull/1900/head -> FETCH_HEAD + git reset --hard FETCH_HEAD HEAD is now at 2bcd1d8 troubleshooting tip about provisioning ``` ## Fetch a pull request and rebase `tools/fetch-rebase-pull-request` is a short-cut for [checking out a pull request locally][zulip-git-guide-fetch-pr] in its own branch and then updating it with any changes from upstream/master with `git rebase`. Run the script with the ID number of the pull request as the first argument. ``` $ tools/fetch-rebase-pull-request 1913 + request_id=1913 + git fetch upstream pull/1913/head remote: Counting objects: 4, done. remote: Compressing objects: 100% (4/4), done. remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (4/4), done. From https://github.com/zulip/zulip * branch refs/pull/1913/head -> FETCH_HEAD + git checkout upstream/master -b review-1913 Branch review-1913 set up to track remote branch master from upstream. Switched to a new branch 'review-1913' + git reset --hard FETCH_HEAD HEAD is now at 99aa2bf Add provision.py fails issue in common erros + git pull --rebase Current branch review-1913 is up to date. ``` ## Fetch a pull request without rebasing `tools/fetch-pull-request` is a similar to `tools/fetch-rebase-pull-request`, but it does not rebase the pull request against upstream/master, thereby getting exactly the same repository state as the commit author had. Run the script with the ID number of the pull request as the first argument. ``` $ tools/fetch-pull-request 5156 + git diff-index --quiet HEAD + request_id=5156 + remote=upstream + git fetch upstream pull/5156/head From https://github.com/zulip/zulip * branch refs/pull/5156/head -> FETCH_HEAD + git checkout -B review-original-5156 Switched to a new branch 'review-original-5156' + git reset --hard FETCH_HEAD HEAD is now at 5a1e982 tools: Update clean-branches to clean review branches. ``` ## Delete unimportant branches `tools/clean-branches` is a shell script that removes branches that are either: 1. Local branches that are ancestors of origin/master. 2. Branches in origin that are ancestors of origin/master and named like `$USER-*`. 3. Review branches created by `tools/fetch-rebase-pull-request` and `tools/fetch-pull-request`. First, make sure you are working in branch `master`. Then run the script without any arguments for default behavior. Since removing review branches can inadvertently remove any feature branches whose names are like `review-*`, it is not done by default. To use it, run `tools/clean-branches --reviews`. ``` $ tools/clean-branches --reviews Deleting local branch review-original-5156 (was 5a1e982) ``` ## Merge conflict on yarn.lock file If there is a merge conflict on yarn.lock, yarn should be run to regenerate the file. *Important* don't delete the yarn.lock file. Checkout the latest one from origin/master so that yarn knows the previous asset versions. Run the following commands ``` git checkout origin/master -- yarn.lock yarn install git add yarn.lock git rebase --continue ``` [github-zulip-zulip]: https://github.com/zulip/zulip/ [zulip-git-guide-fetch-pr]: ../git/collaborate.html#checkout-a-pull-request-locally [zulip-git-guide-travisci]: ../git/cloning.html#step-3-configure-travis-ci-continuous-integration
Java
# Change Log Version 0.9.0 *(In development)* -------------------------------- Version 0.8.0 *(2021-09-27)* ---------------------------- - NoRecentEmoji implementation. Fixes \#477 [\#510](https://github.com/vanniktech/Emoji/pull/510) ([vanniktech](https://github.com/vanniktech)) - Fix Memory Leak with OnAttachStateChangeListener. [\#508](https://github.com/vanniktech/Emoji/pull/508) ([vanniktech](https://github.com/vanniktech)) - Update gradle-maven-publish-plugin to 0.16.0 [\#504](https://github.com/vanniktech/Emoji/pull/504) ([vanniktech](https://github.com/vanniktech)) - Switch to GitHub workflows. [\#503](https://github.com/vanniktech/Emoji/pull/503) ([vanniktech](https://github.com/vanniktech)) - EmojiEditText cursor height is too small by wirting emojis followed by text fixes \#492 [\#493](https://github.com/vanniktech/Emoji/pull/493) ([denjoo](https://github.com/denjoo)) - Only construct RecentEmojiManager if one hasn’t already been set [\#478](https://github.com/vanniktech/Emoji/pull/478) ([lukesleeman](https://github.com/lukesleeman)) - minSdk 21, targetSdk 29 & update all of the dependencies [\#465](https://github.com/vanniktech/Emoji/pull/465) ([vanniktech](https://github.com/vanniktech)) Version 0.7.0 *(2020-08-19)* ---------------------------- - Fix hardcoded text not displaying Emojis correctly [\#462](https://github.com/vanniktech/Emoji/pull/462) ([vanniktech](https://github.com/vanniktech)) - Add EmojiCheckbox. [\#460](https://github.com/vanniktech/Emoji/pull/460) ([vanniktech](https://github.com/vanniktech)) - Add duplicate support for Emoji start with variant selector. [\#456](https://github.com/vanniktech/Emoji/pull/456) ([vanniktech](https://github.com/vanniktech)) - Add license headers to JS/KT/Java files. [\#455](https://github.com/vanniktech/Emoji/pull/455) ([vanniktech](https://github.com/vanniktech)) - Add 3-arg-view constructors. [\#454](https://github.com/vanniktech/Emoji/pull/454) ([vanniktech](https://github.com/vanniktech)) - EmojiPopUp: RequestApplyInsets [\#452](https://github.com/vanniktech/Emoji/pull/452) ([ghshenavar](https://github.com/ghshenavar)) - Call EmojiPopup\#start\(\) when rootView is already laid out. [\#448](https://github.com/vanniktech/Emoji/pull/448) ([vanniktech](https://github.com/vanniktech)) - Add shortcodes to emojis [\#446](https://github.com/vanniktech/Emoji/pull/446) ([rubengees](https://github.com/rubengees)) - Unify code across widgets. [\#443](https://github.com/vanniktech/Emoji/pull/443) ([vanniktech](https://github.com/vanniktech)) - Add SingleEmojiTrait to force single \(replaceable\) on an EditText [\#442](https://github.com/vanniktech/Emoji/pull/442) ([vanniktech](https://github.com/vanniktech)) - Fix render issue when isInEditMode\(\) [\#435](https://github.com/vanniktech/Emoji/pull/435) ([Namolem](https://github.com/Namolem)) - Update generator for Unicode 12.1 [\#426](https://github.com/vanniktech/Emoji/pull/426) ([rubengees](https://github.com/rubengees)) - Allow to pass in selectedIconColor. [\#425](https://github.com/vanniktech/Emoji/pull/425) ([vanniktech](https://github.com/vanniktech)) - Fix emoji keyboard in samples [\#411](https://github.com/vanniktech/Emoji/pull/411) ([mario](https://github.com/mario)) - Delay opening of the popup to correctly align with window insets. Fixes \#400 [\#410](https://github.com/vanniktech/Emoji/pull/410) ([mario](https://github.com/mario)) - Add sample with custom view. [\#409](https://github.com/vanniktech/Emoji/pull/409) ([vanniktech](https://github.com/vanniktech)) - Fix set popup window height method [\#402](https://github.com/vanniktech/Emoji/pull/402) ([mario](https://github.com/mario)) - Automatically call start and stop when attaching/detaching EmojiPopup [\#397](https://github.com/vanniktech/Emoji/pull/397) ([rubengees](https://github.com/rubengees)) - Add MaterialEmojiLayoutFactory. [\#396](https://github.com/vanniktech/Emoji/pull/396) ([vanniktech](https://github.com/vanniktech)) - Add EmojiLayoutFactory. [\#395](https://github.com/vanniktech/Emoji/pull/395) ([vanniktech](https://github.com/vanniktech)) - Add emoji-material module for material bindings. [\#394](https://github.com/vanniktech/Emoji/pull/394) ([vanniktech](https://github.com/vanniktech)) - Fix emoji only filter [\#393](https://github.com/vanniktech/Emoji/pull/393) ([mario](https://github.com/mario)) - Fix custom keyboard height [\#392](https://github.com/vanniktech/Emoji/pull/392) ([mario](https://github.com/mario)) - Fix keyboard calculation for API v21+ by introducing start/stop into EmojiPopup [\#389](https://github.com/vanniktech/Emoji/pull/389) ([mario](https://github.com/mario)) - Support textAllCaps option. Fixes \#361 [\#383](https://github.com/vanniktech/Emoji/pull/383) ([mario](https://github.com/mario)) - Don't use bundled AppCompat emojis. Instead download the font. [\#380](https://github.com/vanniktech/Emoji/pull/380) ([vanniktech](https://github.com/vanniktech)) - Support use case where only Emoji Dialog should be shown. [\#378](https://github.com/vanniktech/Emoji/pull/378) ([vanniktech](https://github.com/vanniktech)) - Ship OnlyEmojisInputFilter & MaximalNumberOfEmojisInputFilter. [\#377](https://github.com/vanniktech/Emoji/pull/377) ([vanniktech](https://github.com/vanniktech)) - Update dependencies. [\#376](https://github.com/vanniktech/Emoji/pull/376) ([vanniktech](https://github.com/vanniktech)) - Allow popup height to be changed with a setter [\#373](https://github.com/vanniktech/Emoji/pull/373) ([VitalyKuznetsov](https://github.com/VitalyKuznetsov)) - Fix memory leak in EmojiPopup [\#370](https://github.com/vanniktech/Emoji/pull/370) ([rubengees](https://github.com/rubengees)) - Optimise the category png's to save some space [\#367](https://github.com/vanniktech/Emoji/pull/367) ([rocboronat](https://github.com/rocboronat)) - Make EmojiManager's initialization methods synchronized [\#365](https://github.com/vanniktech/Emoji/pull/365) ([rubengees](https://github.com/rubengees)) - Change default Keyboard + ViewPager animation. [\#353](https://github.com/vanniktech/Emoji/pull/353) ([vanniktech](https://github.com/vanniktech)) - Content descriptors added for supporting talkback accessibility [\#352](https://github.com/vanniktech/Emoji/pull/352) ([AlexMavDev](https://github.com/AlexMavDev)) - Remove EmojiOne [\#338](https://github.com/vanniktech/Emoji/pull/338) ([rubengees](https://github.com/rubengees)) - Update everything to AndroidX [\#335](https://github.com/vanniktech/Emoji/pull/335) ([mario](https://github.com/mario)) - Update README license [\#332](https://github.com/vanniktech/Emoji/pull/332) ([mario](https://github.com/mario)) I want to thank each and every contributor. Special thanks goes out to @mario & @rubengees. Version 0.6.0 *(2019-02-15)* ---------------------------- - Add disclaimer about instantiating the EmojiPopup early to the README [\#337](https://github.com/vanniktech/Emoji/pull/337) ([rubengees](https://github.com/rubengees)) - Show duplicate emojis in the input but not in the picker [\#336](https://github.com/vanniktech/Emoji/pull/336) ([rubengees](https://github.com/rubengees)) - Add support for custom ViewPager.PageTransformer. [\#334](https://github.com/vanniktech/Emoji/pull/334) ([mario](https://github.com/mario)) - Add keyboard animation [\#333](https://github.com/vanniktech/Emoji/pull/333) ([mario](https://github.com/mario)) - Fix emoji visibility issue [\#330](https://github.com/vanniktech/Emoji/pull/330) ([mario](https://github.com/mario)) - Fix Emoji keyboard in certain cases [\#329](https://github.com/vanniktech/Emoji/pull/329) ([mario](https://github.com/mario)) - Update Android SDK license. [\#327](https://github.com/vanniktech/Emoji/pull/327) ([vanniktech](https://github.com/vanniktech)) - Fix Layout issues in EmojiDialog for several edge cases. [\#326](https://github.com/vanniktech/Emoji/pull/326) ([mario](https://github.com/mario)) - Nuke EmojiEditTextInterface and allow any kind of EditText to be passed. [\#324](https://github.com/vanniktech/Emoji/pull/324) ([vanniktech](https://github.com/vanniktech)) - Add attrs for color customization on theme level [\#320](https://github.com/vanniktech/Emoji/pull/320) ([rubengees](https://github.com/rubengees)) - Remove sudo: false from travis config. [\#316](https://github.com/vanniktech/Emoji/pull/316) ([vanniktech](https://github.com/vanniktech)) - Fix some typos in CHANGELOG.md [\#309](https://github.com/vanniktech/Emoji/pull/309) ([felixonmars](https://github.com/felixonmars)) - Upgrade Jimp to 0.5.0, remove manual promises [\#302](https://github.com/vanniktech/Emoji/pull/302) ([akwizgran](https://github.com/akwizgran)) - Fix a crash when context instanceof ContextThemeWrapper [\#298](https://github.com/vanniktech/Emoji/pull/298) ([AlanGinger](https://github.com/AlanGinger)) - Use soft references to hold sprites [\#297](https://github.com/vanniktech/Emoji/pull/297) ([akwizgran](https://github.com/akwizgran)) - Allow to override background, icon and divider colors [\#295](https://github.com/vanniktech/Emoji/pull/295) ([RashidianPeyman](https://github.com/RashidianPeyman)) - Add support to AutoCompleteTextView and MultiAutoCompleteTextView [\#292](https://github.com/vanniktech/Emoji/pull/292) ([rocboronat](https://github.com/rocboronat)) - Use Gradle Maven Publish Plugin for publishing. [\#283](https://github.com/vanniktech/Emoji/pull/283) ([vanniktech](https://github.com/vanniktech)) - Add latest emojis for EmojiOne [\#281](https://github.com/vanniktech/Emoji/pull/281) ([rubengees](https://github.com/rubengees)) - Introduce EmojiEditTextInterface which allows custom EditText to work with the Popup. [\#277](https://github.com/vanniktech/Emoji/pull/277) ([Foo-Manroot](https://github.com/Foo-Manroot)) - Nuke badges in README. [\#276](https://github.com/vanniktech/Emoji/pull/276) ([vanniktech](https://github.com/vanniktech)) - Expose instance so that can access replaceWithImages from external package [\#270](https://github.com/vanniktech/Emoji/pull/270) ([SY102134](https://github.com/SY102134)) - Tweak Travis configuration. [\#267](https://github.com/vanniktech/Emoji/pull/267) ([vanniktech](https://github.com/vanniktech)) - Add release method which releases the sheet but not the data structure [\#266](https://github.com/vanniktech/Emoji/pull/266) ([rubengees](https://github.com/rubengees)) - Add missing verifyInstalled to the EmojiManager [\#265](https://github.com/vanniktech/Emoji/pull/265) ([rubengees](https://github.com/rubengees)) - Slightly improve README. [\#262](https://github.com/vanniktech/Emoji/pull/262) ([vanniktech](https://github.com/vanniktech)) - Update emojis and use sprite sheet instead of individual images [\#252](https://github.com/vanniktech/Emoji/pull/252) ([rubengees](https://github.com/rubengees)) - Expose some API so that the library can also be used with other systems such as React. [\#246](https://github.com/vanniktech/Emoji/pull/246) ([SY102134](https://github.com/SY102134)) - Unify Detekt configurations with RC6. [\#232](https://github.com/vanniktech/Emoji/pull/232) ([vanniktech](https://github.com/vanniktech)) - Better travis.yml [\#230](https://github.com/vanniktech/Emoji/pull/230) ([vanniktech](https://github.com/vanniktech)) - Remove duplicates from Checkstyle configuration file. [\#229](https://github.com/vanniktech/Emoji/pull/229) ([vanniktech](https://github.com/vanniktech)) - Fix for emoji keyboard UI artifact \(while fast scrolling\) [\#223](https://github.com/vanniktech/Emoji/pull/223) ([yshubin](https://github.com/yshubin)) - Update Support Library version [\#208](https://github.com/vanniktech/Emoji/pull/208) ([MrHadiSatrio](https://github.com/MrHadiSatrio)) - Empty list memory optimization [\#201](https://github.com/vanniktech/Emoji/pull/201) ([stefanhaustein](https://github.com/stefanhaustein)) - Obey library loading state and add modifiers only where needed [\#199](https://github.com/vanniktech/Emoji/pull/199) ([stefanhaustein](https://github.com/stefanhaustein)) - Add infrastructure to let the provider perform emoji span replacements and utilize in emoji-google-compat [\#198](https://github.com/vanniktech/Emoji/pull/198) ([stefanhaustein](https://github.com/stefanhaustein)) - Emoji Support Library integration [\#196](https://github.com/vanniktech/Emoji/pull/196) ([stefanhaustein](https://github.com/stefanhaustein)) - Let Emoji provide a drawable in addition to the resource id. [\#195](https://github.com/vanniktech/Emoji/pull/195) ([stefanhaustein](https://github.com/stefanhaustein)) - Don't clean build again when deploying SNAPSHOTS. [\#193](https://github.com/vanniktech/Emoji/pull/193) ([vanniktech](https://github.com/vanniktech)) - Adjust README for Snapshots [\#189](https://github.com/vanniktech/Emoji/pull/189) ([rubengees](https://github.com/rubengees)) - Delete codecov yml file. [\#186](https://github.com/vanniktech/Emoji/pull/186) ([vanniktech](https://github.com/vanniktech)) - Let Gradle install all of the Android dependencies. [\#178](https://github.com/vanniktech/Emoji/pull/178) ([vanniktech](https://github.com/vanniktech)) - Kotlin module [\#147](https://github.com/vanniktech/Emoji/pull/147) ([aballano](https://github.com/aballano)) I want to thank each and every contributor. Thanks @aballano for adding a kotlin module. @stefanhaustein for integrating Google's Emoji AppCompat. Big thanks to @rubengees & @mario who did most of the work and are actively contributing to this library. Version 0.5.1 *(2017-07-02)* ---------------------------- - Showcase different sizes. [\#172](https://github.com/vanniktech/Emoji/pull/172) ([vanniktech](https://github.com/vanniktech)) - Avoid scrolling the emoji grid after opening the variant popup [\#171](https://github.com/vanniktech/Emoji/pull/171) ([rubengees](https://github.com/rubengees)) - Fix emoji height calculations [\#170](https://github.com/vanniktech/Emoji/pull/170) ([rubengees](https://github.com/rubengees)) - Update Error Prone to 2.0.20 [\#169](https://github.com/vanniktech/Emoji/pull/169) ([vanniktech](https://github.com/vanniktech)) - Update generator for latest changes [\#166](https://github.com/vanniktech/Emoji/pull/166) ([rubengees](https://github.com/rubengees)) - Refactor the VariantEmojiManager [\#165](https://github.com/vanniktech/Emoji/pull/165) ([rubengees](https://github.com/rubengees)) - Update Android Studio Gradle Build Tools to 2.3.3 [\#163](https://github.com/vanniktech/Emoji/pull/163) ([vanniktech](https://github.com/vanniktech)) - Update Checkstyle to 7.8.2 [\#162](https://github.com/vanniktech/Emoji/pull/162) ([vanniktech](https://github.com/vanniktech)) - Update PMD to 5.8.0 [\#161](https://github.com/vanniktech/Emoji/pull/161) ([vanniktech](https://github.com/vanniktech)) - Reflect Emoji Skin Tone automatically in Emoji List. [\#157](https://github.com/vanniktech/Emoji/pull/157) ([vanniktech](https://github.com/vanniktech)) - Also don't generate BuildConfig for Emoji Vendors. [\#154](https://github.com/vanniktech/Emoji/pull/154) ([vanniktech](https://github.com/vanniktech)) - Pull out EmojiRange to package level. [\#152](https://github.com/vanniktech/Emoji/pull/152) ([vanniktech](https://github.com/vanniktech)) - EmojiUtils: Add some documentation to public methods and clean a few things up. [\#151](https://github.com/vanniktech/Emoji/pull/151) ([vanniktech](https://github.com/vanniktech)) - Merge EmojiHandler into EmojiManager. [\#150](https://github.com/vanniktech/Emoji/pull/150) ([vanniktech](https://github.com/vanniktech)) - Add back Emoji Size and use line height as the default. [\#146](https://github.com/vanniktech/Emoji/pull/146) ([vanniktech](https://github.com/vanniktech)) - Added EmojiUtils [\#145](https://github.com/vanniktech/Emoji/pull/145) ([aballano](https://github.com/aballano)) - Don't generate BuildConfig file for release builds. [\#143](https://github.com/vanniktech/Emoji/pull/143) ([vanniktech](https://github.com/vanniktech)) - Add fastlane screengrab to capture screenshots automatically. [\#142](https://github.com/vanniktech/Emoji/pull/142) ([vanniktech](https://github.com/vanniktech)) - Add EmojiButton. [\#137](https://github.com/vanniktech/Emoji/pull/137) ([vanniktech](https://github.com/vanniktech)) - Do some clean ups. [\#135](https://github.com/vanniktech/Emoji/pull/135) ([vanniktech](https://github.com/vanniktech)) - Add night theme support to sample and library. [\#134](https://github.com/vanniktech/Emoji/pull/134) ([vanniktech](https://github.com/vanniktech)) - Add new twitter module and clean up gradle files [\#133](https://github.com/vanniktech/Emoji/pull/133) ([rubengees](https://github.com/rubengees)) - New emojis [\#132](https://github.com/vanniktech/Emoji/pull/132) ([rubengees](https://github.com/rubengees)) - Performance optimization [\#129](https://github.com/vanniktech/Emoji/pull/129) ([rubengees](https://github.com/rubengees)) - Update all emojis to emoji 5.0 [\#119](https://github.com/vanniktech/Emoji/pull/119) ([rubengees](https://github.com/rubengees)) - Adjust generator for emoji 5.0 [\#118](https://github.com/vanniktech/Emoji/pull/118) ([rubengees](https://github.com/rubengees)) - Better emoji height management [\#117](https://github.com/vanniktech/Emoji/pull/117) ([rubengees](https://github.com/rubengees)) - Update Code Quality Configurations. [\#111](https://github.com/vanniktech/Emoji/pull/111) ([vanniktech](https://github.com/vanniktech)) - Remove right Scrollbar in Categories [\#108](https://github.com/vanniktech/Emoji/pull/108) ([RicoChr](https://github.com/RicoChr)) - Improve Popup logic [\#97](https://github.com/vanniktech/Emoji/pull/97) ([rubengees](https://github.com/rubengees)) - Add support for Google emojis [\#95](https://github.com/vanniktech/Emoji/pull/95) ([rubengees](https://github.com/rubengees)) - Make the EmojiEditText more performant [\#93](https://github.com/vanniktech/Emoji/pull/93) ([rubengees](https://github.com/rubengees)) - Support for skin tones in the picker [\#91](https://github.com/vanniktech/Emoji/pull/91) ([rubengees](https://github.com/rubengees)) Many thanks to [rubengees](https://github.com/rubengees) for helping out with a lot of issues. **Note:** 0.5.1 does contain a few breaking changes. Please consult with the README. Version 0.5.0 *(2017-07-02)* ---------------------------- There was a problem with publishing to mavenCentral. Please don't use this version. Instead use `0.5.1`. Version 0.4.0 *(2017-02-15)* ---------------------------- - Soft keyboard not detected when toggling the emoji-popup [\#60](https://github.com/vanniktech/Emoji/issues/60) - Can't show keyboard [\#58](https://github.com/vanniktech/Emoji/issues/58) - Opening emoticons, and change the keyboard [\#57](https://github.com/vanniktech/Emoji/issues/57) - On android 6 emoji not averlays keyboard [\#20](https://github.com/vanniktech/Emoji/issues/20) - Optimize EmojiGridView hierarchy [\#39](https://github.com/vanniktech/Emoji/pull/39) ([vanniktech](https://github.com/vanniktech)) - Split v4 [\#49](https://github.com/vanniktech/Emoji/pull/49) ([vanniktech](https://github.com/vanniktech)) - Make colors customizable [\#70](https://github.com/vanniktech/Emoji/pull/70) ([rubengees](https://github.com/rubengees)) - Rewrite for more Emojis, modularity and performance [\#77](https://github.com/vanniktech/Emoji/pull/77) ([rubengees](https://github.com/rubengees)) Huge thanks to [rubengees](https://github.com/rubengees) for making this library able to support multiple Emojis ([iOS](https://github.com/vanniktech/Emoji#ios-emojis) & [Emoji One](https://github.com/vanniktech/Emoji#emojione)) as well as fixing those issues: - Skin tones support [\#34](https://github.com/vanniktech/Emoji/issues/34) - Add flags [\#12](https://github.com/vanniktech/Emoji/issues/12) - Add missing Symbols [\#11](https://github.com/vanniktech/Emoji/issues/11) - Add missing People emojis [\#10](https://github.com/vanniktech/Emoji/issues/10) **Note:** 0.4.0 is a breaking change so please consult with the README in order to set it up correctly. If you want to continue using the iOS Emojis change this: ```diff -compile 'com.vanniktech:emoji:0.4.0' +compile 'com.vanniktech:emoji-ios:0.4.0' ``` and add `EmojiManager.install(new IosEmojiProvider());` in your Applications `onCreate()` method. Version 0.3.0 *(2016-05-03)* ---------------------------- - Remove Global Layout listener when dismissing the popup. Fixes \#22 [\#24](https://github.com/vanniktech/Emoji/pull/24) ([vanniktech](https://github.com/vanniktech)) - Show People category first when no recent emojis are present [\#16](https://github.com/vanniktech/Emoji/pull/16) ([vanniktech](https://github.com/vanniktech)) Version 0.2.0 *(2016-03-29)* ---------------------------- - Add Recent Emojis Tab [\#13](https://github.com/vanniktech/Emoji/pull/13) ([vanniktech](https://github.com/vanniktech)) - Adding new emojis [\#9](https://github.com/vanniktech/Emoji/pull/9) ([vanniktech](https://github.com/vanniktech)) - Add Library resource config file. Fixes \#6 [\#7](https://github.com/vanniktech/Emoji/pull/7) ([vanniktech](https://github.com/vanniktech)) Version 0.1.0 *(2016-03-12)* ---------------------------- - Initial release
Java
package io.skysail.server.queryfilter.nodes.test; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import org.junit.Ignore; import org.junit.Test; import io.skysail.domain.Entity; import io.skysail.server.domain.jvm.FieldFacet; import io.skysail.server.domain.jvm.facets.NumberFacet; import io.skysail.server.domain.jvm.facets.YearFacet; import io.skysail.server.filter.ExprNode; import io.skysail.server.filter.FilterVisitor; import io.skysail.server.filter.Operation; import io.skysail.server.filter.PreparedStatement; import io.skysail.server.filter.SqlFilterVisitor; import io.skysail.server.queryfilter.nodes.LessNode; import lombok.Data; public class LessNodeTest { @Data public class SomeEntity implements Entity { private String id, A, B; } @Test public void defaultConstructor_creates_node_with_AND_operation_and_zero_children() { LessNode lessNode = new LessNode("A", 0); assertThat(lessNode.getOperation(),is(Operation.LESS)); assertThat(lessNode.isLeaf(),is(true)); } @Test public void listConstructor_creates_node_with_AND_operation_and_assigns_the_children_parameter() { LessNode lessNode = new LessNode("A", 0); assertThat(lessNode.getOperation(),is(Operation.LESS)); } @Test public void lessNode_with_one_children_gets_rendered() { LessNode lessNode = new LessNode("A", 0); assertThat(lessNode.asLdapString(),is("(A<0)")); } @Test public void nodes_toString_method_provides_representation() { LessNode lessNode = new LessNode("A", 0); assertThat(lessNode.toString(),is("(A<0)")); } @Test public void reduce_removes_the_matching_child() { LessNode lessNode = new LessNode("A", 0); Map<String, String> config = new HashMap<>(); config.put("BORDERS", "1"); assertThat(lessNode.reduce("(A<0)", new NumberFacet("A",config), null).asLdapString(),is("")); } @Test public void reduce_does_not_remove_non_matching_child() { LessNode lessNode = new LessNode("A", 0); assertThat(lessNode.reduce("b",null, null).asLdapString(),is("(A<0)")); } @Test public void creates_a_simple_preparedStatement() { LessNode lessNode = new LessNode("A", 0); Map<String, FieldFacet> facets = new HashMap<>(); PreparedStatement createPreparedStatement = (PreparedStatement) lessNode.accept(new SqlFilterVisitor(facets)); assertThat(createPreparedStatement.getParams().get("A"),is("0")); assertThat(createPreparedStatement.getSql(), is("A<:A")); } @Test public void creates_a_preparedStatement_with_year_facet() { LessNode lessNode = new LessNode("A", 0); Map<String, FieldFacet> facets = new HashMap<>(); Map<String, String> config = new HashMap<>(); facets.put("A", new YearFacet("A", config)); PreparedStatement createPreparedStatement = (PreparedStatement) lessNode.accept(new SqlFilterVisitor(facets)); assertThat(createPreparedStatement.getParams().get("A"),is("0")); assertThat(createPreparedStatement.getSql(), is("A.format('YYYY')<:A")); } // @Test // public void evaluateEntity() { // LessNode lessNode = new LessNode("A", 0); // Map<String, FieldFacet> facets = new HashMap<>(); // Map<String, String> config = new HashMap<>(); // facets.put("A", new YearFacet("A", config)); // // SomeEntity someEntity = new SomeEntity(); // someEntity.setA(0); // someEntity.setB("b"); // // EntityEvaluationFilterVisitor entityEvaluationVisitor = new EntityEvaluationFilterVisitor(someEntity, facets); // boolean evaluateEntity = lessNode.evaluateEntity(entityEvaluationVisitor); // // assertThat(evaluateEntity,is(false)); // } @Test @Ignore public void getSelected() { LessNode lessNode = new LessNode("A", 0); FieldFacet facet = new YearFacet("id", Collections.emptyMap()); Iterator<String> iterator = lessNode.getSelected(facet,Collections.emptyMap()).iterator(); assertThat(iterator.next(),is("0")); } @Test public void getKeys() { LessNode lessNode = new LessNode("A", 0); assertThat(lessNode.getKeys().size(),is(1)); Iterator<String> iterator = lessNode.getKeys().iterator(); assertThat(iterator.next(),is("A")); } @Test public void accept() { LessNode lessNode = new LessNode("A", 0); assertThat(lessNode.accept(new FilterVisitor() { @Override public String visit(ExprNode node) { return "."; } }),is(".")); } }
Java
import ch.usi.overseer.OverAgent; import ch.usi.overseer.OverHpc; /** * Overseer.OverAgent sample application. * This example shows a basic usage of the OverAgent java agent to keep track of all the threads created * by the JVM. Threads include garbage collectors, finalizers, etc. In order to use OverAgent, make sure to * append this option to your command-line: * * -agentpath:/usr/local/lib/liboverAgent.so * * @author Achille Peternier (C) 2011 USI */ public class java_agent { static public void main(String argv[]) { // Credits: System.out.println("Overseer Java Agent test, A. Peternier (C) USI 2011\n"); // Check that -agentpath is working: if (OverAgent.isRunning()) System.out.println(" OverAgent is running"); else { System.out.println(" OverAgent is not running (check your JVM settings)"); return; } // Get some info: System.out.println(" Threads running: " + OverAgent.getNumberOfThreads()); System.out.println(); OverAgent.initEventCallback(new OverAgent.Callback() { // Callback invoked at thread creation: public int onThreadCreation(int pid, String name) { System.out.println("[new] " + name + " (" + pid + ")"); return 0; } // Callback invoked at thread termination: public int onThreadTermination(int pid, String name) { System.out.println("[delete] " + name + " (" + pid + ")"); return 0; }}); OverHpc oHpc = OverHpc.getInstance(); int pid = oHpc.getThreadId(); OverAgent.updateStats(); // Waste some time: double r = 0.0; for (int d=0; d<10; d++) { if (true) { for (long c=0; c<100000000; c++) { r += r * Math.sqrt(r) * Math.pow(r, 40.0); } } else { try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } } OverAgent.updateStats(); System.out.println(" Thread " + pid + " abs: " + OverAgent.getThreadCpuUsage(pid) + "%, rel: " + OverAgent.getThreadCpuUsageRelative(pid) + "%"); } // Done: System.out.println("Application terminated"); } }
Java
#import <Foundation/Foundation.h> #import "PBObject.h" /** * Location Intelligence APIs * Incorporate our extensive geodata into everyday applications, business processes and workflows. * * OpenAPI spec version: 8.5.0 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. * * 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. */ #import "PBGeoLocationFixedLineCountry.h" @protocol PBDeviceStatusNetwork @end @interface PBDeviceStatusNetwork : PBObject @property(nonatomic) NSString* carrier; @property(nonatomic) NSString* callType; @property(nonatomic) NSString* locAccuracySupport; @property(nonatomic) NSString* nationalNumber; @property(nonatomic) PBGeoLocationFixedLineCountry* country; @end
Java
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>ADDRTYPE_IPPORT &mdash; MIT Kerberos Documentation</title> <link rel="stylesheet" href="../../../_static/agogo.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> <link rel="stylesheet" href="../../../_static/kerb.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../../../', VERSION: '1.16', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../../../_static/jquery.js"></script> <script type="text/javascript" src="../../../_static/underscore.js"></script> <script type="text/javascript" src="../../../_static/doctools.js"></script> <link rel="author" title="About these documents" href="../../../about.html" /> <link rel="copyright" title="Copyright" href="../../../copyright.html" /> <link rel="top" title="MIT Kerberos Documentation" href="../../../index.html" /> <link rel="up" title="krb5 simple macros" href="index.html" /> <link rel="next" title="ADDRTYPE_ISO" href="ADDRTYPE_ISO.html" /> <link rel="prev" title="ADDRTYPE_INET6" href="ADDRTYPE_INET6.html" /> </head> <body> <div class="header-wrapper"> <div class="header"> <h1><a href="../../../index.html">MIT Kerberos Documentation</a></h1> <div class="rel"> <a href="../../../index.html" title="Full Table of Contents" accesskey="C">Contents</a> | <a href="ADDRTYPE_INET6.html" title="ADDRTYPE_INET6" accesskey="P">previous</a> | <a href="ADDRTYPE_ISO.html" title="ADDRTYPE_ISO" accesskey="N">next</a> | <a href="../../../genindex.html" title="General Index" accesskey="I">index</a> | <a href="../../../search.html" title="Enter search criteria" accesskey="S">Search</a> | <a href="mailto:krb5-bugs@mit.edu?subject=Documentation__ADDRTYPE_IPPORT">feedback</a> </div> </div> </div> <div class="content-wrapper"> <div class="content"> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="addrtype-ipport"> <span id="addrtype-ipport-data"></span><h1>ADDRTYPE_IPPORT<a class="headerlink" href="#addrtype-ipport" title="Permalink to this headline">¶</a></h1> <dl class="data"> <dt id="ADDRTYPE_IPPORT"> <tt class="descname">ADDRTYPE_IPPORT</tt><a class="headerlink" href="#ADDRTYPE_IPPORT" title="Permalink to this definition">¶</a></dt> <dd></dd></dl> <table border="1" class="docutils"> <colgroup> <col width="50%" /> <col width="50%" /> </colgroup> <tbody valign="top"> <tr class="row-odd"><td><tt class="docutils literal"><span class="pre">ADDRTYPE_IPPORT</span></tt></td> <td><tt class="docutils literal"><span class="pre">0x0101</span></tt></td> </tr> </tbody> </table> </div> </div> </div> </div> </div> <div class="sidebar"> <h2>On this page</h2> <ul> <li><a class="reference internal" href="#">ADDRTYPE_IPPORT</a></li> </ul> <br/> <h2>Table of contents</h2> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="../../../user/index.html">For users</a></li> <li class="toctree-l1"><a class="reference internal" href="../../../admin/index.html">For administrators</a></li> <li class="toctree-l1 current"><a class="reference internal" href="../../index.html">For application developers</a><ul class="current"> <li class="toctree-l2"><a class="reference internal" href="../../gssapi.html">Developing with GSSAPI</a></li> <li class="toctree-l2"><a class="reference internal" href="../../y2038.html">Year 2038 considerations for uses of krb5_timestamp</a></li> <li class="toctree-l2"><a class="reference internal" href="../../h5l_mit_apidiff.html">Differences between Heimdal and MIT Kerberos API</a></li> <li class="toctree-l2"><a class="reference internal" href="../../init_creds.html">Initial credentials</a></li> <li class="toctree-l2"><a class="reference internal" href="../../princ_handle.html">Principal manipulation and parsing</a></li> <li class="toctree-l2 current"><a class="reference internal" href="../index.html">Complete reference - API and datatypes</a><ul class="current"> <li class="toctree-l3"><a class="reference internal" href="../api/index.html">krb5 API</a></li> <li class="toctree-l3"><a class="reference internal" href="../types/index.html">krb5 types and structures</a></li> <li class="toctree-l3 current"><a class="reference internal" href="index.html">krb5 simple macros</a></li> </ul> </li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="../../../plugindev/index.html">For plugin module developers</a></li> <li class="toctree-l1"><a class="reference internal" href="../../../build/index.html">Building Kerberos V5</a></li> <li class="toctree-l1"><a class="reference internal" href="../../../basic/index.html">Kerberos V5 concepts</a></li> <li class="toctree-l1"><a class="reference internal" href="../../../formats/index.html">Protocols and file formats</a></li> <li class="toctree-l1"><a class="reference internal" href="../../../mitK5features.html">MIT Kerberos features</a></li> <li class="toctree-l1"><a class="reference internal" href="../../../build_this.html">How to build this documentation from the source</a></li> <li class="toctree-l1"><a class="reference internal" href="../../../about.html">Contributing to the MIT Kerberos Documentation</a></li> <li class="toctree-l1"><a class="reference internal" href="../../../resources.html">Resources</a></li> </ul> <br/> <h4><a href="../../../index.html">Full Table of Contents</a></h4> <h4>Search</h4> <form class="search" action="../../../search.html" method="get"> <input type="text" name="q" size="18" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> <div class="clearer"></div> </div> </div> <div class="footer-wrapper"> <div class="footer" > <div class="right" ><i>Release: 1.16</i><br /> &copy; <a href="../../../copyright.html">Copyright</a> 1985-2017, MIT. </div> <div class="left"> <a href="../../../index.html" title="Full Table of Contents" >Contents</a> | <a href="ADDRTYPE_INET6.html" title="ADDRTYPE_INET6" >previous</a> | <a href="ADDRTYPE_ISO.html" title="ADDRTYPE_ISO" >next</a> | <a href="../../../genindex.html" title="General Index" >index</a> | <a href="../../../search.html" title="Enter search criteria" >Search</a> | <a href="mailto:krb5-bugs@mit.edu?subject=Documentation__ADDRTYPE_IPPORT">feedback</a> </div> </div> </div> </body> </html>
Java
package mat.model; import com.google.gwt.user.client.rpc.IsSerializable; /** * The Class SecurityRole. */ public class SecurityRole implements IsSerializable { /** The Constant serialVersionUID. */ private static final long serialVersionUID = 1L; /** The Constant ADMIN_ROLE. */ public static final String ADMIN_ROLE = "Administrator"; /** The Constant USER_ROLE. */ public static final String USER_ROLE = "User"; /** The Constant SUPER_USER_ROLE. */ public static final String SUPER_USER_ROLE = "Super user"; /** The Constant ADMIN_ROLE_ID. */ public static final String ADMIN_ROLE_ID = "1"; /** The Constant USER_ROLE_ID. */ public static final String USER_ROLE_ID = "2"; /** The Constant SUPER_USER_ROLE_ID. */ public static final String SUPER_USER_ROLE_ID = "3"; /** The id. */ private String id; /** The description. */ private String description; /** * Gets the id. * * @return the id */ public String getId() { return id; } /** * Sets the id. * * @param id * the new id */ public void setId(String id) { this.id = id; } /** * Gets the description. * * @return the description */ public String getDescription() { return description; } /** * Sets the description. * * @param description * the new description */ public void setDescription(String description) { this.description = description; } }
Java
package com.gaojun.appmarket.ui.view; import android.content.Context; import android.content.res.TypedArray; import android.util.AttributeSet; import android.widget.FrameLayout; import com.gaojun.appmarket.R; /** * Created by Administrator on 2016/6/29. */ public class RationLayout extends FrameLayout { private float ratio; public RationLayout(Context context) { super(context); initView(); } public RationLayout(Context context, AttributeSet attrs) { super(context, attrs); initView(); TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.RationLayout); int n = array.length(); for (int i = 0; i < n; i++) { switch (i){ case R.styleable.RationLayout_ratio: ratio = array.getFloat(R.styleable.RationLayout_ratio,-1); break; } } array.recycle(); } public RationLayout(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); initView(); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int width = MeasureSpec.getSize(widthMeasureSpec); int widthMode = MeasureSpec.getMode(widthMeasureSpec); int height = MeasureSpec.getSize(heightMeasureSpec); int heightMode = MeasureSpec.getMode(heightMeasureSpec); if (widthMode == MeasureSpec.EXACTLY && heightMode != MeasureSpec.EXACTLY && ratio>0){ int imageWidth = width - getPaddingLeft() - getPaddingRight(); int imageHeight = (int) (imageWidth/ratio); height = imageHeight + getPaddingTop() + getPaddingBottom(); heightMeasureSpec = MeasureSpec.makeMeasureSpec(height,MeasureSpec.EXACTLY); } super.onMeasure(widthMeasureSpec, heightMeasureSpec); } private void initView() { } }
Java
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="X-UA-Compatible" content="IE=Edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>pandas.Series.memory_usage &#8212; pandas 0.24.0.dev0+81.g8d5032a8c.dirty documentation</title> <link rel="stylesheet" href="../_static/nature.css" type="text/css" /> <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> <script type="text/javascript" src="../_static/jquery.js"></script> <script type="text/javascript" src="../_static/underscore.js"></script> <script type="text/javascript" src="../_static/doctools.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="next" title="pandas.Series.min" href="pandas.Series.min.html" /> <link rel="prev" title="pandas.Series.median" href="pandas.Series.median.html" /> </head><body> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="pandas.Series.min.html" title="pandas.Series.min" accesskey="N">next</a> |</li> <li class="right" > <a href="pandas.Series.median.html" title="pandas.Series.median" accesskey="P">previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">pandas 0.24.0.dev0+81.g8d5032a8c.dirty documentation</a> &#187;</li> <li class="nav-item nav-item-1"><a href="../api.html" >API Reference</a> &#187;</li> <li class="nav-item nav-item-2"><a href="pandas.Series.html" accesskey="U">pandas.Series</a> &#187;</li> </ul> </div> <div class="content-wrapper"> <div class="content"> <div class="document"> <div class="sphinxsidebar"> <h3>Table Of Contents</h3> <ul class="current"> <li class="toctree-l1"><a class="reference internal" href="../whatsnew.html">What’s New</a></li> <li class="toctree-l1"><a class="reference internal" href="../install.html">Installation</a></li> <li class="toctree-l1"><a class="reference internal" href="../contributing.html">Contributing to pandas</a></li> <li class="toctree-l1"><a class="reference internal" href="../overview.html">Package overview</a></li> <li class="toctree-l1"><a class="reference internal" href="../10min.html">10 Minutes to pandas</a></li> <li class="toctree-l1"><a class="reference internal" href="../tutorials.html">Tutorials</a></li> <li class="toctree-l1"><a class="reference internal" href="../cookbook.html">Cookbook</a></li> <li class="toctree-l1"><a class="reference internal" href="../dsintro.html">Intro to Data Structures</a></li> <li class="toctree-l1"><a class="reference internal" href="../basics.html">Essential Basic Functionality</a></li> <li class="toctree-l1"><a class="reference internal" href="../text.html">Working with Text Data</a></li> <li class="toctree-l1"><a class="reference internal" href="../options.html">Options and Settings</a></li> <li class="toctree-l1"><a class="reference internal" href="../indexing.html">Indexing and Selecting Data</a></li> <li class="toctree-l1"><a class="reference internal" href="../advanced.html">MultiIndex / Advanced Indexing</a></li> <li class="toctree-l1"><a class="reference internal" href="../computation.html">Computational tools</a></li> <li class="toctree-l1"><a class="reference internal" href="../missing_data.html">Working with missing data</a></li> <li class="toctree-l1"><a class="reference internal" href="../groupby.html">Group By: split-apply-combine</a></li> <li class="toctree-l1"><a class="reference internal" href="../merging.html">Merge, join, and concatenate</a></li> <li class="toctree-l1"><a class="reference internal" href="../reshaping.html">Reshaping and Pivot Tables</a></li> <li class="toctree-l1"><a class="reference internal" href="../timeseries.html">Time Series / Date functionality</a></li> <li class="toctree-l1"><a class="reference internal" href="../timedeltas.html">Time Deltas</a></li> <li class="toctree-l1"><a class="reference internal" href="../categorical.html">Categorical Data</a></li> <li class="toctree-l1"><a class="reference internal" href="../visualization.html">Visualization</a></li> <li class="toctree-l1"><a class="reference internal" href="../style.html">Styling</a></li> <li class="toctree-l1"><a class="reference internal" href="../io.html">IO Tools (Text, CSV, HDF5, …)</a></li> <li class="toctree-l1"><a class="reference internal" href="../enhancingperf.html">Enhancing Performance</a></li> <li class="toctree-l1"><a class="reference internal" href="../sparse.html">Sparse data structures</a></li> <li class="toctree-l1"><a class="reference internal" href="../gotchas.html">Frequently Asked Questions (FAQ)</a></li> <li class="toctree-l1"><a class="reference internal" href="../r_interface.html">rpy2 / R interface</a></li> <li class="toctree-l1"><a class="reference internal" href="../ecosystem.html">pandas Ecosystem</a></li> <li class="toctree-l1"><a class="reference internal" href="../comparison_with_r.html">Comparison with R / R libraries</a></li> <li class="toctree-l1"><a class="reference internal" href="../comparison_with_sql.html">Comparison with SQL</a></li> <li class="toctree-l1"><a class="reference internal" href="../comparison_with_sas.html">Comparison with SAS</a></li> <li class="toctree-l1"><a class="reference internal" href="../comparison_with_stata.html">Comparison with Stata</a></li> <li class="toctree-l1 current"><a class="reference internal" href="../api.html">API Reference</a><ul class="current"> <li class="toctree-l2"><a class="reference internal" href="../api.html#input-output">Input/Output</a></li> <li class="toctree-l2"><a class="reference internal" href="../api.html#general-functions">General functions</a></li> <li class="toctree-l2 current"><a class="reference internal" href="../api.html#series">Series</a><ul class="current"> <li class="toctree-l3"><a class="reference internal" href="../api.html#constructor">Constructor</a></li> <li class="toctree-l3 current"><a class="reference internal" href="../api.html#attributes">Attributes</a><ul class="current"> <li class="toctree-l4"><a class="reference internal" href="pandas.Series.index.html">pandas.Series.index</a></li> <li class="toctree-l4"><a class="reference internal" href="pandas.Series.values.html">pandas.Series.values</a></li> <li class="toctree-l4"><a class="reference internal" href="pandas.Series.dtype.html">pandas.Series.dtype</a></li> <li class="toctree-l4"><a class="reference internal" href="pandas.Series.ftype.html">pandas.Series.ftype</a></li> <li class="toctree-l4"><a class="reference internal" href="pandas.Series.shape.html">pandas.Series.shape</a></li> <li class="toctree-l4"><a class="reference internal" href="pandas.Series.nbytes.html">pandas.Series.nbytes</a></li> <li class="toctree-l4"><a class="reference internal" href="pandas.Series.ndim.html">pandas.Series.ndim</a></li> <li class="toctree-l4"><a class="reference internal" href="pandas.Series.size.html">pandas.Series.size</a></li> <li class="toctree-l4"><a class="reference internal" href="pandas.Series.strides.html">pandas.Series.strides</a></li> <li class="toctree-l4"><a class="reference internal" href="pandas.Series.itemsize.html">pandas.Series.itemsize</a></li> <li class="toctree-l4"><a class="reference internal" href="pandas.Series.base.html">pandas.Series.base</a></li> <li class="toctree-l4"><a class="reference internal" href="pandas.Series.T.html">pandas.Series.T</a></li> <li class="toctree-l4 current"><a class="current reference internal" href="#">pandas.Series.memory_usage</a></li> <li class="toctree-l4"><a class="reference internal" href="pandas.Series.hasnans.html">pandas.Series.hasnans</a></li> <li class="toctree-l4"><a class="reference internal" href="pandas.Series.flags.html">pandas.Series.flags</a></li> <li class="toctree-l4"><a class="reference internal" href="pandas.Series.empty.html">pandas.Series.empty</a></li> <li class="toctree-l4"><a class="reference internal" href="pandas.Series.dtypes.html">pandas.Series.dtypes</a></li> <li class="toctree-l4"><a class="reference internal" href="pandas.Series.ftypes.html">pandas.Series.ftypes</a></li> <li class="toctree-l4"><a class="reference internal" href="pandas.Series.data.html">pandas.Series.data</a></li> <li class="toctree-l4"><a class="reference internal" href="pandas.Series.is_copy.html">pandas.Series.is_copy</a></li> <li class="toctree-l4"><a class="reference internal" href="pandas.Series.name.html">pandas.Series.name</a></li> <li class="toctree-l4"><a class="reference internal" href="pandas.Series.put.html">pandas.Series.put</a></li> </ul> </li> <li class="toctree-l3"><a class="reference internal" href="../api.html#conversion">Conversion</a></li> <li class="toctree-l3"><a class="reference internal" href="../api.html#indexing-iteration">Indexing, iteration</a></li> <li class="toctree-l3"><a class="reference internal" href="../api.html#binary-operator-functions">Binary operator functions</a></li> <li class="toctree-l3"><a class="reference internal" href="../api.html#function-application-groupby-window">Function application, GroupBy &amp; Window</a></li> <li class="toctree-l3"><a class="reference internal" href="../api.html#computations-descriptive-stats">Computations / Descriptive Stats</a></li> <li class="toctree-l3"><a class="reference internal" href="../api.html#reindexing-selection-label-manipulation">Reindexing / Selection / Label manipulation</a></li> <li class="toctree-l3"><a class="reference internal" href="../api.html#missing-data-handling">Missing data handling</a></li> <li class="toctree-l3"><a class="reference internal" href="../api.html#reshaping-sorting">Reshaping, sorting</a></li> <li class="toctree-l3"><a class="reference internal" href="../api.html#combining-joining-merging">Combining / joining / merging</a></li> <li class="toctree-l3"><a class="reference internal" href="../api.html#time-series-related">Time series-related</a></li> <li class="toctree-l3"><a class="reference internal" href="../api.html#datetimelike-properties">Datetimelike Properties</a></li> <li class="toctree-l3"><a class="reference internal" href="../api.html#string-handling">String handling</a></li> <li class="toctree-l3"><a class="reference internal" href="../api.html#categorical">Categorical</a></li> <li class="toctree-l3"><a class="reference internal" href="../api.html#plotting">Plotting</a></li> <li class="toctree-l3"><a class="reference internal" href="../api.html#serialization-io-conversion">Serialization / IO / Conversion</a></li> <li class="toctree-l3"><a class="reference internal" href="../api.html#sparse">Sparse</a></li> </ul> </li> <li class="toctree-l2"><a class="reference internal" href="../api.html#dataframe">DataFrame</a></li> <li class="toctree-l2"><a class="reference internal" href="../api.html#panel">Panel</a></li> <li class="toctree-l2"><a class="reference internal" href="../api.html#index">Index</a></li> <li class="toctree-l2"><a class="reference internal" href="../api.html#numeric-index">Numeric Index</a></li> <li class="toctree-l2"><a class="reference internal" href="../api.html#categoricalindex">CategoricalIndex</a></li> <li class="toctree-l2"><a class="reference internal" href="../api.html#intervalindex">IntervalIndex</a></li> <li class="toctree-l2"><a class="reference internal" href="../api.html#multiindex">MultiIndex</a></li> <li class="toctree-l2"><a class="reference internal" href="../api.html#datetimeindex">DatetimeIndex</a></li> <li class="toctree-l2"><a class="reference internal" href="../api.html#timedeltaindex">TimedeltaIndex</a></li> <li class="toctree-l2"><a class="reference internal" href="../api.html#periodindex">PeriodIndex</a></li> <li class="toctree-l2"><a class="reference internal" href="../api.html#scalars">Scalars</a></li> <li class="toctree-l2"><a class="reference internal" href="../api.html#frequencies">Frequencies</a></li> <li class="toctree-l2"><a class="reference internal" href="../api.html#window">Window</a></li> <li class="toctree-l2"><a class="reference internal" href="../api.html#groupby">GroupBy</a></li> <li class="toctree-l2"><a class="reference internal" href="../api.html#resampling">Resampling</a></li> <li class="toctree-l2"><a class="reference internal" href="../api.html#style">Style</a></li> <li class="toctree-l2"><a class="reference internal" href="../api.html#id43">Plotting</a></li> <li class="toctree-l2"><a class="reference internal" href="../api.html#general-utility-functions">General utility functions</a></li> <li class="toctree-l2"><a class="reference internal" href="../api.html#extensions">Extensions</a></li> </ul> </li> <li class="toctree-l1"><a class="reference internal" href="../developer.html">Developer</a></li> <li class="toctree-l1"><a class="reference internal" href="../internals.html">Internals</a></li> <li class="toctree-l1"><a class="reference internal" href="../extending.html">Extending Pandas</a></li> <li class="toctree-l1"><a class="reference internal" href="../release.html">Release Notes</a></li> </ul> <h3 style="margin-top: 1.5em;">Search</h3> <form class="search" action="../search.html" method="get"> <input type="text" name="q" size="18"/> <input type="submit" value="Go"/> <input type="hidden" name="check_keywords" value="yes"/> <input type="hidden" name="area" value="default"/> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="pandas-series-memory-usage"> <h1>pandas.Series.memory_usage<a class="headerlink" href="#pandas-series-memory-usage" title="Permalink to this headline">¶</a></h1> <dl class="method"> <dt id="pandas.Series.memory_usage"> <code class="descclassname">Series.</code><code class="descname">memory_usage</code><span class="sig-paren">(</span><em>index=True</em>, <em>deep=False</em><span class="sig-paren">)</span><a class="reference external" href="http://github.com/pandas-dev/pandas/blob/master/pandas/core/series.py#L3480-L3533"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#pandas.Series.memory_usage" title="Permalink to this definition">¶</a></dt> <dd><p>Return the memory usage of the Series.</p> <p>The memory usage can optionally include the contribution of the index and of elements of <cite>object</cite> dtype.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>index</strong> : bool, default True</p> <blockquote> <div><p>Specifies whether to include the memory usage of the Series index.</p> </div></blockquote> <p><strong>deep</strong> : bool, default False</p> <blockquote> <div><p>If True, introspect the data deeply by interrogating <cite>object</cite> dtypes for system-level memory consumption, and include it in the returned value.</p> </div></blockquote> </td> </tr> <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>int</strong></p> <blockquote class="last"> <div><p>Bytes of memory consumed.</p> </div></blockquote> </td> </tr> </tbody> </table> <div class="admonition seealso"> <p class="first admonition-title">See also</p> <dl class="last docutils"> <dt><a class="reference external" href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.nbytes.html#numpy.ndarray.nbytes" title="(in NumPy v1.14)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">numpy.ndarray.nbytes</span></code></a></dt> <dd>Total bytes consumed by the elements of the array.</dd> <dt><a class="reference internal" href="pandas.DataFrame.memory_usage.html#pandas.DataFrame.memory_usage" title="pandas.DataFrame.memory_usage"><code class="xref py py-obj docutils literal notranslate"><span class="pre">DataFrame.memory_usage</span></code></a></dt> <dd>Bytes consumed by a DataFrame.</dd> </dl> </div> <p class="rubric">Examples</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">s</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">Series</span><span class="p">(</span><span class="nb">range</span><span class="p">(</span><span class="mi">3</span><span class="p">))</span> <span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">memory_usage</span><span class="p">()</span> <span class="go">104</span> </pre></div> </div> <p>Not including the index gives the size of the rest of the data, which is necessarily smaller:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">memory_usage</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span> <span class="go">24</span> </pre></div> </div> <p>The memory footprint of <cite>object</cite> values is ignored by default:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">s</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">Series</span><span class="p">([</span><span class="s2">&quot;a&quot;</span><span class="p">,</span> <span class="s2">&quot;b&quot;</span><span class="p">])</span> <span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">values</span> <span class="go">array([&#39;a&#39;, &#39;b&#39;], dtype=object)</span> <span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">memory_usage</span><span class="p">()</span> <span class="go">96</span> <span class="gp">&gt;&gt;&gt; </span><span class="n">s</span><span class="o">.</span><span class="n">memory_usage</span><span class="p">(</span><span class="n">deep</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span> <span class="go">212</span> </pre></div> </div> </dd></dl> </div> </div> </div> </div> <div class="clearer"></div> </div> </div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="pandas.Series.min.html" title="pandas.Series.min" >next</a> |</li> <li class="right" > <a href="pandas.Series.median.html" title="pandas.Series.median" >previous</a> |</li> <li class="nav-item nav-item-0"><a href="../index.html">pandas 0.24.0.dev0+81.g8d5032a8c.dirty documentation</a> &#187;</li> <li class="nav-item nav-item-1"><a href="../api.html" >API Reference</a> &#187;</li> <li class="nav-item nav-item-2"><a href="pandas.Series.html" >pandas.Series</a> &#187;</li> </ul> </div> <style type="text/css"> .scrollToTop { text-align: center; font-weight: bold; position: fixed; bottom: 60px; right: 40px; display: none; } </style> <a href="#" class="scrollToTop">Scroll To Top</a> <script type="text/javascript"> $(document).ready(function() { //Check to see if the window is top if not then display button $(window).scroll(function() { if ($(this).scrollTop() > 200) { $('.scrollToTop').fadeIn(); } else { $('.scrollToTop').fadeOut(); } }); //Click event to scroll to top $('.scrollToTop').click(function() { $('html, body').animate({ scrollTop: 0 }, 500); return false; }); }); </script> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-27880019-2']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html>
Java
/* * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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. */ package com.amazonaws.services.lightsail.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** * <p> * Describes a block storage disk mapping. * </p> * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DiskMap" target="_top">AWS API * Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class DiskMap implements Serializable, Cloneable, StructuredPojo { /** * <p> * The original disk path exposed to the instance (for example, <code>/dev/sdh</code>). * </p> */ private String originalDiskPath; /** * <p> * The new disk name (e.g., <code>my-new-disk</code>). * </p> */ private String newDiskName; /** * <p> * The original disk path exposed to the instance (for example, <code>/dev/sdh</code>). * </p> * * @param originalDiskPath * The original disk path exposed to the instance (for example, <code>/dev/sdh</code>). */ public void setOriginalDiskPath(String originalDiskPath) { this.originalDiskPath = originalDiskPath; } /** * <p> * The original disk path exposed to the instance (for example, <code>/dev/sdh</code>). * </p> * * @return The original disk path exposed to the instance (for example, <code>/dev/sdh</code>). */ public String getOriginalDiskPath() { return this.originalDiskPath; } /** * <p> * The original disk path exposed to the instance (for example, <code>/dev/sdh</code>). * </p> * * @param originalDiskPath * The original disk path exposed to the instance (for example, <code>/dev/sdh</code>). * @return Returns a reference to this object so that method calls can be chained together. */ public DiskMap withOriginalDiskPath(String originalDiskPath) { setOriginalDiskPath(originalDiskPath); return this; } /** * <p> * The new disk name (e.g., <code>my-new-disk</code>). * </p> * * @param newDiskName * The new disk name (e.g., <code>my-new-disk</code>). */ public void setNewDiskName(String newDiskName) { this.newDiskName = newDiskName; } /** * <p> * The new disk name (e.g., <code>my-new-disk</code>). * </p> * * @return The new disk name (e.g., <code>my-new-disk</code>). */ public String getNewDiskName() { return this.newDiskName; } /** * <p> * The new disk name (e.g., <code>my-new-disk</code>). * </p> * * @param newDiskName * The new disk name (e.g., <code>my-new-disk</code>). * @return Returns a reference to this object so that method calls can be chained together. */ public DiskMap withNewDiskName(String newDiskName) { setNewDiskName(newDiskName); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getOriginalDiskPath() != null) sb.append("OriginalDiskPath: ").append(getOriginalDiskPath()).append(","); if (getNewDiskName() != null) sb.append("NewDiskName: ").append(getNewDiskName()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DiskMap == false) return false; DiskMap other = (DiskMap) obj; if (other.getOriginalDiskPath() == null ^ this.getOriginalDiskPath() == null) return false; if (other.getOriginalDiskPath() != null && other.getOriginalDiskPath().equals(this.getOriginalDiskPath()) == false) return false; if (other.getNewDiskName() == null ^ this.getNewDiskName() == null) return false; if (other.getNewDiskName() != null && other.getNewDiskName().equals(this.getNewDiskName()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getOriginalDiskPath() == null) ? 0 : getOriginalDiskPath().hashCode()); hashCode = prime * hashCode + ((getNewDiskName() == null) ? 0 : getNewDiskName().hashCode()); return hashCode; } @Override public DiskMap clone() { try { return (DiskMap) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.lightsail.model.transform.DiskMapMarshaller.getInstance().marshall(this, protocolMarshaller); } }
Java
namespace v_4_1.Protocol { public static class Asci { public const byte CR = 13; public const byte LF = 10; public const byte T = 84; public const byte R = 82; public const byte D = 68; public const byte H = 72; public const byte a = 97; public const byte o = 111; public const byte L = 76; public const byte P = 80; public const byte U = 85; public const byte S = 83; } }
Java
### 2019-03-11 #### java * [Snailclimb / JavaGuide](https://github.com/Snailclimb/JavaGuide):【Java学习+面试指南】 一份涵盖大部分Java程序员所需要掌握的核心知识。 * [CypherpunkArmory / UserLAnd](https://github.com/CypherpunkArmory/UserLAnd):Main UserLAnd Repository * [quarkusio / quarkus](https://github.com/quarkusio/quarkus):Quarkus: Supersonic Subatomic Java. * [doocs / advanced-java](https://github.com/doocs/advanced-java):😮 互联网 Java 工程师进阶知识完全扫盲 * [google / j2cl](https://github.com/google/j2cl):Java to Closure JavaScript transpiler * [macrozheng / mall](https://github.com/macrozheng/mall):mall项目是一套电商系统,包括前台商城系统及后台管理系统,基于SpringBoot+MyBatis实现。 前台商城系统包含首页门户、商品推荐、商品搜索、商品展示、购物车、订单流程、会员中心、客户服务、帮助中心等模块。 后台管理系统包含商品管理、订单管理、会员管理、促销管理、运营管理、内容管理、统计报表、财务管理、权限管理、设置等模块。 * [Meituan-Dianping / Leaf](https://github.com/Meituan-Dianping/Leaf):Distributed ID Generate Service * [spring-projects / spring-boot](https://github.com/spring-projects/spring-boot):Spring Boot * [gotify / android](https://github.com/gotify/android):An app for receiving push notifications on new messages posted to gotify/server. * [TheAlgorithms / Java](https://github.com/TheAlgorithms/Java):All Algorithms implemented in Java * [gedoor / MyBookshelf](https://github.com/gedoor/MyBookshelf):阅读是一款可以自定义来源阅读网络内容的工具,为广大网络文学爱好者提供一种方便、快捷舒适的试读体验。 * [eugenp / tutorials](https://github.com/eugenp/tutorials):The "REST With Spring" Course: * [spring-projects / spring-framework](https://github.com/spring-projects/spring-framework):Spring Framework * [ityouknow / spring-boot-examples](https://github.com/ityouknow/spring-boot-examples):about learning Spring Boot via examples. Spring Boot 教程、技术栈示例代码,快速简单上手教程。 * [elastic / elasticsearch](https://github.com/elastic/elasticsearch):Open Source, Distributed, RESTful Search Engine * [apache / incubator-dubbo](https://github.com/apache/incubator-dubbo):Apache Dubbo (incubating) is a high-performance, java based, open source RPC framework. * [wix / react-native-navigation](https://github.com/wix/react-native-navigation):A complete native navigation solution for React Native * [guanpj / JReadHub](https://github.com/guanpj/JReadHub):Readhub Android 客户端——官网 : https://readhub.cn * [google / guava](https://github.com/google/guava):Google core libraries for Java * [qiurunze123 / miaosha](https://github.com/qiurunze123/miaosha):⭐⭐⭐⭐秒杀系统设计与实现.互联网工程师进阶与分析🙋🐓 * [didi / DoraemonKit](https://github.com/didi/DoraemonKit):简称 "DoKit" 。一款功能齐全的客户端( iOS 、Android )研发助手,你值得拥有。 * [topjohnwu / Magisk](https://github.com/topjohnwu/Magisk):A Magic Mask to Alter Android System Systemless-ly * [crossoverJie / JCSprout](https://github.com/crossoverJie/JCSprout):👨‍🎓 Java Core Sprout : basic, concurrent, algorithm * [alibaba / nacos](https://github.com/alibaba/nacos):an easy-to-use dynamic service discovery, configuration and service management platform for building cloud native applications. * [oracle / graal](https://github.com/oracle/graal):GraalVM: Run Programs Faster Anywhere 🚀 #### vue * [PanJiaChen / vue-element-admin](https://github.com/PanJiaChen/vue-element-admin):🎉 A magical vue admin http://panjiachen.github.io/vue-element-admin * [emilkowalski / css-effects-snippets](https://github.com/emilkowalski/css-effects-snippets):A collection of CSS effects made with Vue.js. * [ElemeFE / element](https://github.com/ElemeFE/element):A Vue.js 2.0 UI Toolkit for Web * [Akryum / vue-virtual-scroller](https://github.com/Akryum/vue-virtual-scroller):⚡️ Blazing fast scrolling for any amount of data * [iview / iview](https://github.com/iview/iview):A high quality UI Toolkit built on Vue.js 2.0 * [dongweiming / lyanna](https://github.com/dongweiming/lyanna):My Blog Using Sanic * [System-Glitch / Solidity-IDE](https://github.com/System-Glitch/Solidity-IDE):A simple alternative to Remix IDE to develop and test Solidity Smart Contracts * [Molunerfinn / PicGo](https://github.com/Molunerfinn/PicGo):🚀A simple & beautiful tool for pictures uploading built by electron-vue * [vueComponent / ant-design-vue](https://github.com/vueComponent/ant-design-vue):An enterprise-class UI components based on Ant Design and Vue. 🐜 * [iview / iview-admin](https://github.com/iview/iview-admin):Vue 2.0 admin management system template based on iView * [sendya / ant-design-pro-vue](https://github.com/sendya/ant-design-pro-vue):👨🏻‍💻👩🏻‍💻 Use Ant Design Vue like a Pro! A simple vue admin template. * [jbaysolutions / vue-grid-layout](https://github.com/jbaysolutions/vue-grid-layout):A draggable and resizable grid layout, for Vue.js. * [jdf2e / nutui](https://github.com/jdf2e/nutui):京东风格的轻量级移动端Vue组件库 (A Vue.js 2.0 UI Toolkit for Mobile Web) * [epicmaxco / vuestic-admin](https://github.com/epicmaxco/vuestic-admin):Vue.js admin dashboard * [dcloudio / uni-app](https://github.com/dcloudio/uni-app):使用 Vue.js 开发跨平台应用的前端框架 * [syuilo / misskey](https://github.com/syuilo/misskey):✨🌎✨ A federated blogging platform ✨🚀✨ * [mdbootstrap / Vue-Bootstrap-with-Material-Design](https://github.com/mdbootstrap/Vue-Bootstrap-with-Material-Design):Vue Bootstrap with Material Design - Powerful and free UI KIT * [tuandm / laravue](https://github.com/tuandm/laravue):Laravel dashboard built by VueJS * [vapor / website](https://github.com/vapor/website):Vapor's website running on Vapor and Vue * [jae-jae / Userscript-Plus](https://github.com/jae-jae/Userscript-Plus):🐒 Show current site all UserJS,The easier way to install UserJs for Tampermonkey. 显示当前网站的所有可用Tampermonkey脚本 * [vue-bulma / vue-bulma](https://github.com/vue-bulma/vue-bulma):A modern UI framework based on Vue and Bulma * [owncloud / phoenix](https://github.com/owncloud/phoenix):Next generation frontend for ownCloud * [jecovier / vue-json-excel](https://github.com/jecovier/vue-json-excel): * [TaleLin / lin-cms-vue](https://github.com/TaleLin/lin-cms-vue):A simple and practical CMS implememted by Vue * [overtrue / yike.io](https://github.com/overtrue/yike.io):一刻社区前端源码 #### kotlin * [iammert / ReadableBottomBar](https://github.com/iammert/ReadableBottomBar):Yet another material bottom bar library for Android * [shadowsocks / shadowsocks-android](https://github.com/shadowsocks/shadowsocks-android):A shadowsocks client for Android * [guanpj / JShoppingMall](https://github.com/guanpj/JShoppingMall):一款商城购物 App,商品数据采用 Python 爬虫爬取自某小型电商平台,服务端部署在腾讯云。 * [ologe / canaree-music-player](https://github.com/ologe/canaree-music-player):Android music player * [JetBrains / kotlin](https://github.com/JetBrains/kotlin):The Kotlin Programming Language * [the-super-toys / glimpse-android](https://github.com/the-super-toys/glimpse-android):A content-aware cropping library for Android * [googlesamples / android-sunflower](https://github.com/googlesamples/android-sunflower):A gardening app illustrating Android development best practices with Android Jetpack. * [Ramotion / fluid-slider-android](https://github.com/Ramotion/fluid-slider-android):💧 A slider widget with a popup bubble displaying the precise value selected. Android library made by @Ramotion - https://github.com/Ramotion/android-ui-animation-components-and-libraries * [2dust / v2rayNG](https://github.com/2dust/v2rayNG): * [googlesamples / android-architecture-components](https://github.com/googlesamples/android-architecture-components):Samples for Android Architecture Components. * [inorichi / tachiyomi](https://github.com/inorichi/tachiyomi):Free and open source manga reader for Android * [shetmobile / MeowBottomNavigation](https://github.com/shetmobile/MeowBottomNavigation):Android Meow Bottm Navigation * [guolindev / coolweatherjetpack](https://github.com/guolindev/coolweatherjetpack):酷欧天气的Jetpack版本实现,采用了MVVM架构。 * [adrielcafe / KrumbsView](https://github.com/adrielcafe/KrumbsView):🍞 The ultimate breadcrumbs view for Android! * [alibaba / p3c](https://github.com/alibaba/p3c):Alibaba Java Coding Guidelines pmd implements and IDE plugin * [nickbutcher / plaid](https://github.com/nickbutcher/plaid):An Android app which provides design news & inspiration as well as being an example of implementing material design. * [JetBrains / swot](https://github.com/JetBrains/swot):Identify email addresses or domains names that belong to colleges or universities. Help automate the process of approving or rejecting academic discounts. * [MSF-Jarvis / viscerion](https://github.com/MSF-Jarvis/viscerion):Beautiful and feature filled Android client for the WireGuard™️ protocol * [h4h13 / RetroMusicPlayer](https://github.com/h4h13/RetroMusicPlayer):Best material design music player for Android * [SimpleMobileTools / Simple-Commons](https://github.com/SimpleMobileTools/Simple-Commons):Some helper functions and shared resources to be used only by the simple apps suite. * [proxer / ProxerAndroid](https://github.com/proxer/ProxerAndroid):The official Android App of Proxer.Me * [corda / corda](https://github.com/corda/corda):Corda is an open source blockchain project, designed for business from the start. Only Corda allows you to build interoperable blockchain networks that transact in strict privacy. Corda's smart contract technology allows businesses to transact directly, with value. * [rkudryashov / microservices-example](https://github.com/rkudryashov/microservices-example):Example of the microservices architecture on the modern stack of Java technologies * [MindorksOpenSource / RadialProgressBar](https://github.com/MindorksOpenSource/RadialProgressBar):Radial ProgressBar inspired by Apple Watch OS. It is highly Customisable * [kotlin-graphics / imgui](https://github.com/kotlin-graphics/imgui):Bloat-free Immediate Mode Graphical User interface for JVM with minimal dependencies (rewrite of dear imgui) #### javascript * [agalwood / Motrix](https://github.com/agalwood/Motrix):A full-featured download manager. * [vadimdemedes / ink](https://github.com/vadimdemedes/ink):🌈 React for interactive command-line apps * [viatsko / awesome-vscode](https://github.com/viatsko/awesome-vscode):🎨 A curated list of delightful VS Code packages and resources. * [bvaughn / react-window](https://github.com/bvaughn/react-window):React components for efficiently rendering large lists and tabular data * [vuejs / vue](https://github.com/vuejs/vue):🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web. * [facebook / react](https://github.com/facebook/react):A declarative, efficient, and flexible JavaScript library for building user interfaces. * [victordibia / handtrack.js](https://github.com/victordibia/handtrack.js):A library for prototyping realtime hand detection (bounding box), directly in the browser. * [pomber / git-history](https://github.com/pomber/git-history):Quickly browse the history of a file from any git repository * [facebook / react-native](https://github.com/facebook/react-native):A framework for building native apps with React. * [GoogleChrome / puppeteer](https://github.com/GoogleChrome/puppeteer):Headless Chrome Node API * [facebook / create-react-app](https://github.com/facebook/create-react-app):Set up a modern web app by running one command. * [30-seconds / 30-seconds-of-code](https://github.com/30-seconds/30-seconds-of-code):A curated collection of useful JavaScript snippets that you can understand in 30 seconds or less. * [frankmcsherry / blog](https://github.com/frankmcsherry/blog):Some notes on things I find interesting and important. * [mui-org / material-ui](https://github.com/mui-org/material-ui):React components for faster and easier web development. Build your own design system, or start with Material Design. * [axa-group / nlp.js](https://github.com/axa-group/nlp.js):An NLP library for building bots, with entity extraction, sentiment analysis, automatic language identify, and so more * [nodejs / node](https://github.com/nodejs/node):Node.js JavaScript runtime ✨🐢🚀✨ * [trekhleb / javascript-algorithms](https://github.com/trekhleb/javascript-algorithms):📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings * [NervJS / taro](https://github.com/NervJS/taro):多端统一开发框架,支持用 React 的开发方式编写一次代码,生成能运行在微信/百度/支付宝/字节跳动小程序、H5、React Native 等的应用。 https://taro.js.org/ * [twbs / bootstrap](https://github.com/twbs/bootstrap):The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web. * [storybooks / storybook](https://github.com/storybooks/storybook):UI component dev & test: React, React Native, Vue, Angular, Ember & more! * [lukeed / dequal](https://github.com/lukeed/dequal):A tiny (247B) utility for check for deep equality * [freeciv / freeciv-web](https://github.com/freeciv/freeciv-web):Freeciv-web is an Open Source strategy game implemented in HTML5 and WebGL, which can be played online against other players, or in single player mode against AI opponents. * [gatsbyjs / gatsby](https://github.com/gatsbyjs/gatsby):Build blazing fast, modern apps and websites with React * [facebook / jest](https://github.com/facebook/jest):Delightful JavaScript Testing. * [strapi / strapi](https://github.com/strapi/strapi):🚀 Open source Node.js Headless CMS to easily build customisable APIs #### css * [daneden / animate.css](https://github.com/daneden/animate.css):🍿 A cross-browser library of CSS animations. As easy to use as an easy thing. * [twbs / rfs](https://github.com/twbs/rfs):Automated responsive font sizes * [jgthms / bulma](https://github.com/jgthms/bulma):Modern CSS framework based on Flexbox * [ryanoasis / nerd-fonts](https://github.com/ryanoasis/nerd-fonts):🔡 Iconic font aggregator, collection, and patcher. 40+ patched fonts, over 3,600 glyph/icons, includes popular collections such as Font Awesome & fonts such as Hack * [rexlin600 / rexlin600.github.io](https://github.com/rexlin600/rexlin600.github.io):系列博客、涵盖领域广、不定时更新、欢迎加入 * [tailwindcss / tailwindcss](https://github.com/tailwindcss/tailwindcss):A utility-first CSS framework for rapid UI development. * [rstacruz / cheatsheets](https://github.com/rstacruz/cheatsheets):My cheatsheets * [apachecn / hands-on-ml-zh](https://github.com/apachecn/hands-on-ml-zh):📖 [译] Sklearn 与 TensorFlow 机器学习实用指南 * [BlackrockDigital / startbootstrap-sb-admin-2](https://github.com/BlackrockDigital/startbootstrap-sb-admin-2):A free, open source, Bootstrap admin theme created by Start Bootstrap * [uikit / uikit](https://github.com/uikit/uikit):A lightweight and modular front-end framework for developing fast and powerful web interfaces * [theme-next / hexo-theme-next](https://github.com/theme-next/hexo-theme-next):Elegant and powerful theme for Hexo. * [StylishThemes / GitHub-Dark](https://github.com/StylishThemes/GitHub-Dark):Dark GitHub style * [LiangJunrong / document-library](https://github.com/LiangJunrong/document-library):jsliang 的文档库. 里面包含了所有的前端文章,例如 vue、react,、angular、微信小程序、设计模式等…… * [elenapan / dotfiles](https://github.com/elenapan/dotfiles):There is no place like ~/ * [the-paperless-project / paperless](https://github.com/the-paperless-project/paperless):Scan, index, and archive all of your paper documents * [mozdevs / cssremedy](https://github.com/mozdevs/cssremedy):Start your project with a remedy for the technical debt of CSS. * [angea / pocorgtfo](https://github.com/angea/pocorgtfo):a "PoC or GTFO" mirror with extra article index, direct links and clean PDFs. * [gitpitch / in-60-seconds](https://github.com/gitpitch/in-60-seconds):GitPitch In 60 Seconds - A Very Short Tutorial * [poole / hyde](https://github.com/poole/hyde):A brazen two-column theme for Jekyll. * [jekyll / minima](https://github.com/jekyll/minima):Minima is a one-size-fits-all Jekyll theme for writers. * [picturepan2 / spectre](https://github.com/picturepan2/spectre):Spectre.css - A Lightweight, Responsive and Modern CSS Framework * [fireship-io / fireship.io](https://github.com/fireship-io/fireship.io):Content Designed for Developer Happiness https://fireship.io * [getpelican / pelican-themes](https://github.com/getpelican/pelican-themes):Themes for Pelican * [travis-ci / docs-travis-ci-com](https://github.com/travis-ci/docs-travis-ci-com):The Travis CI Documentation * [flutter / website](https://github.com/flutter/website):Flutter web site #### objective-c * [alibaba / coobjc](https://github.com/alibaba/coobjc):coobjc provides coroutine support for Objective-C and Swift. We added await method、generator and actor model like C#、Javascript and Kotlin. For convenience, we added coroutine categories for some Foundation and UIKit API in cokit framework like NSFileManager, JSON, NSData, UIImage etc. We also add tuple support in coobjc. * [react-native-community / react-native-maps](https://github.com/react-native-community/react-native-maps):React Native Mapview component for iOS + Android * [expo / expo](https://github.com/expo/expo):The Expo platform for making cross-platform mobile apps * [Cenmrev / V2RayX](https://github.com/Cenmrev/V2RayX):GUI for v2ray-core on macOS * [matryer / bitbar](https://github.com/matryer/bitbar):Put the output from any script or program in your Mac OS X Menu Bar * [sveinbjornt / Sloth](https://github.com/sveinbjornt/Sloth):Mac app that shows all open files and sockets in use by all running processes. Nice GUI for lsof. * [steventroughtonsmith / marzipanify](https://github.com/steventroughtonsmith/marzipanify):Convert an iOS Simulator app bundle to an iOSMac (Marzipan) one (Unsupported & undocumented, WIP) * [PsychoTea / machswap2](https://github.com/PsychoTea/machswap2):An iOS kernel exploit for iOS 11 through 12.1.2. Works on A7 - A11 devices. * [apache / cordova-plugin-inappbrowser](https://github.com/apache/cordova-plugin-inappbrowser):Apache Cordova Plugin inappbrowser * [januslo / react-native-bluetooth-escpos-printer](https://github.com/januslo/react-native-bluetooth-escpos-printer):React-Native plugin for the bluetooth ESC/POS & TSC printers. * [signalapp / Signal-iOS](https://github.com/signalapp/Signal-iOS):A private messenger for iOS. * [Codeux-Software / Textual](https://github.com/Codeux-Software/Textual):Textual is an IRC client for OS X * [googleads / googleads-mobile-ios-examples](https://github.com/googleads/googleads-mobile-ios-examples):googleads-mobile-ios * [bitstadium / HockeySDK-iOS](https://github.com/bitstadium/HockeySDK-iOS):The official iOS SDK for the HockeyApp service (Releases are in the master branch, current development in the default develop branch) * [bitstadium / HockeySDK-Mac](https://github.com/bitstadium/HockeySDK-Mac):The official Mac SDK for the HockeyApp service. It contains a crash reporter that checks at startup whether your application crashed last time it was launched, then offers to send that information to the HockeyApp service. It supports Mac OS X >= 10.9, Intel architectures and also the Mac Sandbox. * [jverkoey / nimbus](https://github.com/jverkoey/nimbus):The iOS framework that grows only as fast as its documentation * [xu-li / cordova-plugin-wechat](https://github.com/xu-li/cordova-plugin-wechat):A cordova plugin, a JS version of Wechat SDK * [AFNetworking / AFNetworking](https://github.com/AFNetworking/AFNetworking):A delightful networking framework for iOS, macOS, watchOS, and tvOS. * [SDWebImage / SDWebImage](https://github.com/SDWebImage/SDWebImage):Asynchronous image downloader with cache support as a UIImageView category * [BradLarson / GPUImage](https://github.com/BradLarson/GPUImage):An open source iOS framework for GPU-based image and video processing * [SnapKit / Masonry](https://github.com/SnapKit/Masonry):Harness the power of AutoLayout NSLayoutConstraints with a simplified, chainable and expressive syntax. Supports iOS and OSX Auto Layout * [airbnb / lottie-ios](https://github.com/airbnb/lottie-ios):An iOS library to natively render After Effects vector animations * [jdg / MBProgressHUD](https://github.com/jdg/MBProgressHUD):MBProgressHUD + Customizations * [realm / realm-cocoa](https://github.com/realm/realm-cocoa):Realm is a mobile database: a replacement for Core Data & SQLite * [ccgus / fmdb](https://github.com/ccgus/fmdb):A Cocoa / Objective-C wrapper around SQLite #### swift * [sagaya / Wobbly](https://github.com/sagaya/Wobbly):(Animate CSS) animations for iOS. An easy to use library of iOS animations. As easy to use as an easy thing. * [pedrommcarrasco / Brooklyn](https://github.com/pedrommcarrasco/Brooklyn):🍎 Screensaver inspired by Apple's Event on October 30, 2018 * [shadowsocks / ShadowsocksX-NG](https://github.com/shadowsocks/ShadowsocksX-NG):Next Generation of ShadowsocksX * [holzschu / Carnets](https://github.com/holzschu/Carnets):Carnets is a stand-alone Jupyter notebook server and client. Edit your notebooks on the go, even where there is no network. * [iina / iina](https://github.com/iina/iina):The modern video player for macOS. * [Ramotion / folding-cell](https://github.com/Ramotion/folding-cell):📃 FoldingCell is an expanding content cell with animation made by @Ramotion - https://github.com/Ramotion/swift-ui-animation-components-and-libraries * [Ramotion / animated-tab-bar](https://github.com/Ramotion/animated-tab-bar):RAMAnimatedTabBarController is a Swift UI module library for adding animation to iOS tabbar items and icons. iOS library made by @Ramotion - https://github.com/Ramotion/swift-ui-animation-components-and-libraries * [raywenderlich / swift-algorithm-club](https://github.com/raywenderlich/swift-algorithm-club):Algorithms and data structures in Swift, with explanations! * [Ramotion / swift-ui-animation-components-and-libraries](https://github.com/Ramotion/swift-ui-animation-components-and-libraries):Swift UI libraries, iOS components and animations by @Ramotion - https://github.com/Ramotion/android-ui-animation-components-and-libraries * [app-developers / top](https://github.com/app-developers/top):Top App Developers - March 2019 * [lukakerr / Pine](https://github.com/lukakerr/Pine):A modern, native macOS markdown editor - themeable, tabs, sidebar, github flavored markdown, exporting, latex and more * [serhii-londar / open-source-mac-os-apps](https://github.com/serhii-londar/open-source-mac-os-apps):🚀 Awesome list of open source applications for macOS. * [mxcl / Cake](https://github.com/mxcl/Cake):A delicious, quality‑of‑life supplement for your app‑development toolbox. * [dkhamsing / open-source-ios-apps](https://github.com/dkhamsing/open-source-ios-apps):📱 Collaborative List of Open-Source iOS Apps * [sindresorhus / touch-bar-simulator](https://github.com/sindresorhus/touch-bar-simulator):Use the Touch Bar on any Mac * [d-dotsenko / DDPerspectiveTransform](https://github.com/d-dotsenko/DDPerspectiveTransform):🔲 Warp image transformation * [ianyh / Amethyst](https://github.com/ianyh/Amethyst):Automatic tiling window manager for macOS à la xmonad. * [ReactiveX / RxSwift](https://github.com/ReactiveX/RxSwift):Reactive Programming in Swift * [Alamofire / Alamofire](https://github.com/Alamofire/Alamofire):Elegant HTTP Networking in Swift * [HeroTransitions / Hero](https://github.com/HeroTransitions/Hero):Elegant transition library for iOS & tvOS * [zagahr / Conferences.digital](https://github.com/zagahr/Conferences.digital):👨‍💻Watch the latest and greatest conference videos on your Mac * [vsouza / awesome-ios](https://github.com/vsouza/awesome-ios):A curated list of awesome iOS ecosystem, including Objective-C and Swift Projects * [mas-cli / mas](https://github.com/mas-cli/mas):📦 Mac App Store command line interface * [onevcat / Kingfisher](https://github.com/onevcat/Kingfisher):A lightweight, pure-Swift library for downloading and caching images from the web. * [IvanVorobei / SPStorkController](https://github.com/IvanVorobei/SPStorkController):Modal controller as in mail or Apple music application #### html * [hamukazu / lets-get-arrested](https://github.com/hamukazu/lets-get-arrested):This project is intended to protest against the police in Japan * [github / personal-website](https://github.com/github/personal-website):Code that'll help you kickstart a personal website that showcases your work as a software developer. * [fengdu78 / Coursera-ML-AndrewNg-Notes](https://github.com/fengdu78/Coursera-ML-AndrewNg-Notes):吴恩达老师的机器学习课程个人笔记 * [fengdu78 / deeplearning_ai_books](https://github.com/fengdu78/deeplearning_ai_books):deeplearning.ai(吴恩达老师的深度学习课程笔记及资源) * [emilbaehr / automatic-app-landing-page](https://github.com/emilbaehr/automatic-app-landing-page):A Jekyll theme for automatically generating and deploying landing page sites for mobile apps. * [huyaocode / webKnowledge](https://github.com/huyaocode/webKnowledge):前端知识点总结 * [iliakan / javascript-tutorial-en](https://github.com/iliakan/javascript-tutorial-en):Modern JavaScript Tutorial * [ionic-team / ionic](https://github.com/ionic-team/ionic):Build amazing native and progressive web apps with open web technologies. One app running on everything 🎉 * [Cryptogenic / PS4-6.20-WebKit-Code-Execution-Exploit](https://github.com/Cryptogenic/PS4-6.20-WebKit-Code-Execution-Exploit):A WebKit exploit using CVE-2018-4441 to obtain RCE on PS4 6.20. * [vincentarelbundock / gtsummary](https://github.com/vincentarelbundock/gtsummary):Beautiful, customizable, publication-ready model summaries in R. * [octocat / Spoon-Knife](https://github.com/octocat/Spoon-Knife):This repo is for demonstration purposes only. * [phodal / github](https://github.com/phodal/github):GitHub 漫游指南- a Chinese ebook on how to build a good project on Github. Explore the users' behavior. Find some thing interest. * [zeit / now-github-starter](https://github.com/zeit/now-github-starter):Starter project to demonstrate a project whose pull requests get automatically deployed * [flutterchina / flutter-in-action](https://github.com/flutterchina/flutter-in-action):《Flutter实战》电子书 * [kennethreitz / requests-html](https://github.com/kennethreitz/requests-html):Pythonic HTML Parsing for Humans™ * [typpo / quickchart](https://github.com/typpo/quickchart):Google Image Charts alternative * [Microsoft / dotnet](https://github.com/Microsoft/dotnet):This repo is the official home of .NET on GitHub. It's a great starting point to find many .NET OSS projects from Microsoft and the community, including many that are part of the .NET Foundation. * [circleci / circleci-docs](https://github.com/circleci/circleci-docs):Documentation for CircleCI. * [ripienaar / free-for-dev](https://github.com/ripienaar/free-for-dev):A list of SaaS, PaaS and IaaS offerings that have free tiers of interest to devops and infradev * [swagger-api / swagger-codegen](https://github.com/swagger-api/swagger-codegen):swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition. * [shd101wyy / markdown-preview-enhanced](https://github.com/shd101wyy/markdown-preview-enhanced):One of the 'BEST' markdown preview extensions for Atom editor! * [wesbos / JavaScript30](https://github.com/wesbos/JavaScript30):30 Day Vanilla JS Challenge * [clong / DetectionLab](https://github.com/clong/DetectionLab):Vagrant & Packer scripts to build a lab environment complete with security tooling and logging best practices * [ethereum / EIPs](https://github.com/ethereum/EIPs):The Ethereum Improvement Proposal repository * [be5invis / Iosevka](https://github.com/be5invis/Iosevka):Slender typeface for code, from code.
Java
/** ****************************************************************************** * @file discover_functions.h * @author Microcontroller Division * @version V1.2.4 * @date 01/2011 * @brief This file contains measurement values and boa ****************************************************************************** * @copy * * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. * * <h2><center>&copy; COPYRIGHT 2010 STMicroelectronics</center></h2> */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __DISCOVER_FUNCTIONS_H #define __DISCOVER_FUNCTIONS_H /* Includes ------------------------------------------------------------------*/ #include "stm8l15x.h" #define STR_VERSION tab[1] = 'V';tab[2] = '1'|DOT; tab[3] = '2'|DOT; tab[4] = '4' /*#define STATE_VREF 0 #define STATE_ICC_RUN 1 #define STATE_LPR_LCD 2 #define STATE_LPR 3 #define STATE_HALT 4 #define I2C_READ 5 */ #define MAX_STATE 6 typedef enum { STATE_CHECKNDEFMESSAGE = 0, STATE_VREF , STATE_TEMPMEAS } DemoState; /* Theorically BandGAP 1.224volt */ #define VREF 1.224L /* UNCOMMENT the line below for use the VREFINT_Factory_CONV value*/ /* else we use the typical value defined in the datasheet (see Vdd_appli function in the file discover_functions.c) */ // #define VREFINT_FACTORY_CONV 1 /* ADC Converter LSBIdeal = VREF/4096 or VDA/4096 */ #define ADC_CONV 4096 /* VDD Factory for VREFINT measurement */ #define VDD_FACTORY 3.0L /* The VREFINT_Factory_CONV byte represents the LSB of the VREFINT 12-bit ADC conversion result. The MSB have a fixed value: 0x6 */ #define VREFINT_Factory_CONV_ADDRESS ((uint8_t*)0x4910) /* * The Typical value is 1.224 * Min value 1.202 * Max value 1.242 * The value VREF is 0x668 to 0x69f * */ #define VREFINT_Factory_CONV_MSB 0x600 /* Le value MSB always 0x600 */ #define VREFINT_Factory_CONV_MIN 0x60 /* Low byte min */ #define VREFINT_Factory_CONV_MAX 0xA0 /* Low byte max */ #define MAX_CURRENT 9999 /* AUTO TEST VALUE */ /* #define VCC_MIN 2915 // nominal Vcc/Vdd is 2.99V, allow 2.5% lower - Vref can be ~2% lower than 1.225 #define VCC_MAX 3100 #define ICC_RUN_MIN 1000 #define ICC_RUN_MAX 1600 // typical ICC_RUN is ~1.3mA, allow ~15% bigger #define ICC_HALT_MIN 300 #define ICC_HALT_MAX 800 // typical ICC_HALT is 0.35uA, allow 800 nA instead 1000 this low value is for select the best circuits #define ICC_LP_MIN 2500 #define ICC_LP_MAX 4060 // typical ICC_LP is ~2.9uA, allow ~40% bigger #define LSE_DELAY 2000 */ /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ int _fctcpy(char name); void convert_into_char(uint16_t number, uint16_t *p_tab); //void LPR_init(void); //void Halt_Init(void); uint16_t Vref_measure(void); //void Icc_measure(void); //float Icc_measure_RUN(void); //float Icc_measure_HALT(void); //float Icc_measure_LPR(void); //void Icc_measure_LPR_LCD(void); //void auto_test(void); //void Bias_measurement(void); //void test_vdd(void); //void test_icc_Run(void); //void test_icc_LP(void); //void test_icc_HALT(void); //void display_MuAmp (uint16_t); void FLASH_ProgramBias(uint8_t) ; float Vdd_appli(void); void Display_Ram( void ); #endif /* __DISCOVER_FUNCTIONS_H*/ /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/
Java
# AUTOGENERATED FILE FROM balenalib/rockpi-4b-rk3399-fedora:34-run # http://bugs.python.org/issue19846 # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 RUN dnf install -y \ python3-pip \ python3-dbus \ && dnf clean all # install "virtualenv", since the vast majority of users of this image will want it RUN pip3 install -U --no-cache-dir --ignore-installed pip setuptools \ && pip3 install --no-cache-dir virtualenv RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'As of January 1st, 2020, Python 2 was end-of-life, we will change the latest tag for Balenalib Python base image to Python 3.x and drop support for Python 2 soon. So after 1st July, 2020, all the balenalib Python latest tag will point to the latest Python 3 version and no changes, or fixes will be made to balenalib Python 2 base image. If you are using Python 2 for your application, please upgrade to Python 3 before 1st July.' > /.balena/messages/python-deprecation-warnin CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/test-stack@python.sh" \ && echo "Running test-stack@python" \ && chmod +x test-stack@python.sh \ && bash test-stack@python.sh \ && rm -rf test-stack@python.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v8 \nOS: Fedora 34 \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nPython v3.10.0, Pip v21.2.4, Setuptools v58.0.0 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info RUN echo $'#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
Java
/* * Copyright 2011-2014 Zhaotian Wang <zhaotianzju@gmail.com> * * 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. */ package flex.android.magiccube; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.FloatBuffer; import java.util.Vector; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; import flex.android.magiccube.R; import flex.android.magiccube.bluetooth.MessageSender; import flex.android.magiccube.interfaces.OnStateListener; import flex.android.magiccube.interfaces.OnStepListener; import flex.android.magiccube.solver.MagicCubeSolver; import flex.android.magiccube.solver.SolverFactory; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.opengl.GLSurfaceView; import android.opengl.GLU; import android.opengl.GLUtils; import android.opengl.Matrix; public class MagicCubeRender implements GLSurfaceView.Renderer { protected Context context; private int width; private int height; //eye-coordinate private float eyex; private float eyey; protected float eyez; private float angle = 65.f; protected float ratio = 0.6f; protected float zfar = 25.5f; private float bgdist = 25.f; //background texture private int[] BgTextureID = new int[1]; private Bitmap[] bitmap = new Bitmap[1]; private FloatBuffer bgtexBuffer; // Texture Coords Buffer for background private FloatBuffer bgvertexBuffer; // Vertex Buffer for background protected final int nStep = 9;//nstep for one rotate protected int volume; private boolean solved = false; //indicate if the cube has been solved //background position //... //rotation variable public float rx, ry; protected Vector<Command> commands; private Vector<Command> commandsBack; //backward command private Vector<Command> commandsForward; //forward command private Vector<Command> commandsAuto; //forward command protected int[] command; protected boolean HasCommand; protected int CommandLoop; private String CmdStrBefore = ""; private String CmdStrAfter = ""; public static final boolean ROTATE = true; public static final boolean MOVE = false; //matrix public float[] pro_matrix = new float[16]; public int [] view_matrix = new int[4]; public float[] mod_matrix = new float[16]; //minimal valid move distance private float MinMovedist; //the cubes! protected Magiccube magiccube; private boolean DrawCube; private boolean Finished = false; private boolean Resetting = false; protected OnStateListener stateListener = null; private MessageSender messageSender = null; private OnStepListener stepListener = null; public MagicCubeRender(Context context, int w, int h) { this.context = context; this.width = w; this.height = h; this.eyex = 0.f; this.eyey = 0.f; this.eyez = 20.f; this.rx = 22.f; this.ry = -34.f; this.HasCommand = false; this.commands = new Vector<Command>(1,1); this.commandsBack = new Vector<Command>(100, 10); this.commandsForward = new Vector<Command>(100, 10); this.commandsAuto = new Vector<Command>(40,5); //this.Command = new int[3]; magiccube = new Magiccube(); DrawCube = true; solved = false; volume = MagiccubePreference.GetPreference(MagiccubePreference.MoveVolume, context); //SetCommands("L- R2 F- D+ L+ U2 L2 D2 R+ D2 L+ F- D+ L2 D2 R2 B+ L+ U2 R2 U2 F2 R+ D2 U+"); //SetCommands("F- U+ F- D- L- D- F- U- L2 D-"); // SetCommands("U+"); // mediaPlayer = MediaPlayer.create(context, R.raw.move2); } public void SetDrawCube(boolean DrawCube) { this.DrawCube = DrawCube; } private void LoadBgTexture(GL10 gl) { //Load texture bitmap bitmap[0] = BitmapFactory.decodeStream( context.getResources().openRawResource(R.drawable.mainbg2)); gl.glGenTextures(1, BgTextureID, 0); // Generate texture-ID array for 6 IDs //Set texture uv float[] texCoords = { 0.0f, 1.0f, // A. left-bottom 1.0f, 1.0f, // B. right-bottom 0.0f, 0.0f, // C. left-top 1.0f, 0.0f // D. right-top }; ByteBuffer tbb = ByteBuffer.allocateDirect(texCoords.length * 4 ); tbb.order(ByteOrder.nativeOrder()); bgtexBuffer = tbb.asFloatBuffer(); bgtexBuffer.put(texCoords); bgtexBuffer.position(0); // Rewind // Generate OpenGL texture images gl.glBindTexture(GL10.GL_TEXTURE_2D, BgTextureID[0]); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER,GL10.GL_LINEAR); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR); // Build Texture from loaded bitmap for the currently-bind texture ID GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap[0], 0); bitmap[0].recycle(); } protected void DrawBg(GL10 gl) { gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); gl.glEnableClientState(GL10.GL_TEXTURE_COORD_ARRAY); gl.glVertexPointer(3, GL10.GL_FLOAT, 0, bgvertexBuffer); gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, bgtexBuffer); gl.glEnable(GL10.GL_TEXTURE_2D); // Enable texture (NEW) gl.glPushMatrix(); gl.glBindTexture(GL10.GL_TEXTURE_2D, this.BgTextureID[0]); gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4); gl.glPopMatrix(); gl.glDisableClientState(GL10.GL_VERTEX_ARRAY); gl.glDisableClientState(GL10.GL_TEXTURE_COORD_ARRAY); } @Override public void onDrawFrame(GL10 gl) { // Clear color and depth buffers using clear-value set earlier gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); // You OpenGL|ES rendering code here gl.glLoadIdentity(); GLU.gluLookAt(gl, eyex, eyey, eyez, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f); Matrix.setIdentityM(mod_matrix, 0); Matrix.setLookAtM(mod_matrix, 0, eyex, eyey, eyez, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f); DrawScene(gl); } private void SetBackgroundPosition() { float halfheight = (float)Math.tan(angle/2.0/180.0*Math.PI)*bgdist*1.f; float halfwidth = halfheight/this.height*this.width; float[] vertices = { -halfwidth, -halfheight, eyez-bgdist, // 0. left-bottom-front halfwidth, -halfheight, eyez-bgdist, // 1. right-bottom-front -halfwidth, halfheight,eyez-bgdist, // 2. left-top-front halfwidth, halfheight, eyez-bgdist, // 3. right-top-front }; ByteBuffer vbb = ByteBuffer.allocateDirect(12 * 4); vbb.order(ByteOrder.nativeOrder()); bgvertexBuffer = vbb.asFloatBuffer(); bgvertexBuffer.put(vertices); // Populate bgvertexBuffer.position(0); // Rewind } @Override public void onSurfaceChanged(GL10 gl, int w, int h) { //reset the width and the height; //Log.e("screen", w+" "+h); if (h == 0) h = 1; // To prevent divide by zero this.width = w; this.height = h; float aspect = (float)w / h; // Set the viewport (display area) to cover the entire window gl.glViewport(0, 0, w, h); this.view_matrix[0] = 0; this.view_matrix[1] = 0; this.view_matrix[2] = w; this.view_matrix[3] = h; // Setup perspective projection, with aspect ratio matches viewport gl.glMatrixMode(GL10.GL_PROJECTION); // Select projection matrix gl.glLoadIdentity(); // Reset projection matrix // Use perspective projection angle = 60; //calculate the angle to adjust the screen resolution //float idealwidth = Cube.CubeSize*3.f/(Math.abs(this.eyez-Cube.CubeSize*1.5f))*zfar/ratio; float idealwidth = Cube.CubeSize*3.f/(Math.abs(this.eyez-Cube.CubeSize*1.5f))*zfar/ratio; float idealheight = idealwidth/(float)w*(float)h; angle = (float)(Math.atan2(idealheight/2.f, Math.abs(zfar))*2.f*180.f/Math.PI); SetBackgroundPosition(); GLU.gluPerspective(gl, angle, aspect, 0.1f, zfar); MinMovedist = w*ratio/3.f*0.15f; float r = (float)w/(float)h; float size = (float)(0.1*Math.tan(angle/2.0/180.0*Math.PI)); Matrix.setIdentityM(pro_matrix, 0); Matrix.frustumM(pro_matrix, 0, -size*r, size*r, -size , size, 0.1f, zfar); gl.glMatrixMode(GL10.GL_MODELVIEW); // Select model-view matrix gl.glLoadIdentity(); // Reset /* // You OpenGL|ES display re-sizing code here gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE); //float []lightparam = {0.6f, 0.2f, 0.2f, 0.6f, 0.2f, 0.2f, 0, 0, 10}; float []lightparam = {1f, 1f, 1f, 3f, 1f, 1f, 0, 0, 5}; gl.glEnable(GL10.GL_LIGHTING); // ���û����� gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_AMBIENT, lightparam, 0); // ��������� gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_DIFFUSE, lightparam, 3); // ���þ��淴�� gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_SPECULAR, lightparam, 3); // ���ù�Դλ�� gl.glLightfv(GL10.GL_LIGHT0, GL10.GL_POSITION, lightparam, 6); // ������Դ gl.glEnable(GL10.GL_LIGHT0); */ // ������� //gl.glEnable(GL10.GL_BLEND); if( this.stateListener != null ) { stateListener.OnStateChanged(OnStateListener.LOADED); } } @Override public void onSurfaceCreated(GL10 gl, EGLConfig arg1) { gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f); // Set color's clear-value to black gl.glClearDepthf(1.0f); // Set depth's clear-value to farthest gl.glEnable(GL10.GL_DEPTH_TEST); // Enables depth-buffer for hidden surface removal gl.glDepthFunc(GL10.GL_LEQUAL); // The type of depth testing to do gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST); // nice perspective view gl.glShadeModel(GL10.GL_SMOOTH); // Enable smooth shading of color gl.glDisable(GL10.GL_DITHER); // Disable dithering for better performance // You OpenGL|ES initialization code here //Initial the cubes magiccube.LoadTexture(gl, context); //this.MessUp(50); LoadBgTexture(gl); } public void SetMessageSender(MessageSender messageSender) { this.messageSender = messageSender; } protected void DrawScene(GL10 gl) { this.DrawBg(gl); if( !DrawCube) { return; } if(Resetting) { //Resetting = false; //reset(); } if(HasCommand) { Command command = commands.firstElement(); if( CommandLoop == 0 && messageSender != null) { messageSender.SendMessage(command.toString()); } int nsteps = command.N*this.nStep; //rotate nsteps if(CommandLoop%nStep == 0 && CommandLoop != nsteps) { MusicPlayThread musicPlayThread = new MusicPlayThread(context, R.raw.move2, volume); musicPlayThread.start(); } if(command.Type == Command.ROTATE_ROW) { magiccube.RotateRow(command.RowID, command.Direction, 90.f/nStep,CommandLoop%nStep==nStep-1); } else if(command.Type == Command.ROTATE_COL) { magiccube.RotateCol(command.RowID, command.Direction, 90.f/nStep,CommandLoop%nStep==nStep-1); } else { magiccube.RotateFace(command.RowID, command.Direction, 90.f/nStep,CommandLoop%nStep==nStep-1); } CommandLoop++; if(CommandLoop==nsteps) { CommandLoop = 0; if(commands.size() > 1) { //Log.e("full", "full"+commands.size()); } this.CmdStrAfter += command.toString() + " "; commands.removeElementAt(0); //Log.e("e", commands.size()+""); if( commands.size() <= 0) { HasCommand = false; } if( stepListener != null) { stepListener.AddStep(); } //this.ReportFaces(); //Log.e("state", this.GetState()); if(Finished && !this.IsComplete()) { Finished = false; if(this.stateListener != null) { stateListener.OnStateNotify(OnStateListener.CANAUTOSOLVE); } } } if(this.stateListener != null && this.IsComplete()) { if( !Finished ) { Finished = true; stateListener.OnStateChanged(OnStateListener.FINISH); stateListener.OnStateNotify(OnStateListener.CANNOTAUTOSOLVE); } } } DrawCubes(gl); } protected void DrawCubes(GL10 gl) { gl.glPushMatrix(); gl.glRotatef(rx, 1, 0, 0); //rotate gl.glRotatef(ry, 0, 1, 0); // Log.e("rxry", rx + " " + ry); if(this.HasCommand) { magiccube.Draw(gl); } else { magiccube.DrawSimple(gl); } gl.glPopMatrix(); } public void SetOnStateListener(OnStateListener stateListener) { this.stateListener = stateListener; } public void SetOnStepListnener(OnStepListener stepListener) { this.stepListener = stepListener; } public boolean GetPos(float[] point, int[] Pos) { //deal with the touch-point is out of the cube if( true) { //return false; } if( rx > 0 && rx < 90.f) { } return ROTATE; } public String SetCommand(Command command) { HasCommand = true; this.commands.add(command); this.commandsForward.clear(); this.commandsBack.add(command.Reverse()); if(this.stateListener != null) { stateListener.OnStateNotify(OnStateListener.CANMOVEBACK); stateListener.OnStateNotify(OnStateListener.CANNOTMOVEFORWARD); } return command.CmdToCmdStr(); } public void SetForwardCommand(String CmdStr) { //Log.e("cmdstr", CmdStr); this.commandsForward = Reverse(Command.CmdStrsToCmd(CmdStr)); } public String SetCommand(int ColOrRowOrFace, int ID, int Direction) { solved = false; return SetCommand(new Command(ColOrRowOrFace, ID, Direction)); } public boolean IsSolved() { return solved; } public String MoveBack() { if( this.commandsBack.size() <= 0) { return null; } Command command = commandsBack.lastElement(); HasCommand = true; this.commands.add(command); this.commandsBack.remove(this.commandsBack.size()-1); if(this.commandsBack.size() <= 0 && stateListener != null) { stateListener.OnStateNotify(OnStateListener.CANNOTMOVEBACK); } if( solved) { this.commandsAuto.add(command.Reverse()); } else { this.commandsForward.add(command.Reverse()); if(stateListener != null) { stateListener.OnStateNotify(OnStateListener.CANMOVEFORWARD); } } return command.CmdToCmdStr(); } public String MoveForward() { if( this.commandsForward.size() <= 0) { return null; } Command command = commandsForward.lastElement(); HasCommand = true; this.commands.add(command); this.commandsBack.add(command.Reverse()); this.commandsForward.remove(commandsForward.size()-1); if( this.commandsForward.size() <= 0 && stateListener != null) { this.stateListener.OnStateNotify(OnStateListener.CANNOTMOVEFORWARD); } if( this.stateListener != null) { this.stateListener.OnStateNotify(OnStateListener.CANMOVEBACK); } return command.CmdToCmdStr(); } public int MoveForward2() { if( this.commandsForward.size() <= 0) { return 0; } int n = commandsForward.size(); HasCommand = true; this.commands.addAll(Reverse(commandsForward)); for( int i=commandsForward.size()-1; i>=0; i--) { this.commandsBack.add(commandsForward.get(i).Reverse()); } this.commandsForward.clear(); if( this.commandsForward.size() <= 0 && stateListener != null) { this.stateListener.OnStateNotify(OnStateListener.CANNOTMOVEFORWARD); } if( this.stateListener != null) { this.stateListener.OnStateNotify(OnStateListener.CANMOVEBACK); } return n; } public int IsInCubeArea(float []Win) { int[] HitedFaceIndice = new int[6]; int HitNumber = 0; for(int i=0; i<6; i++) { if(IsInQuad3D(magiccube.faces[i], Win)) { HitedFaceIndice[HitNumber] = i; HitNumber++; } } if( HitNumber <=0) { return -1; } else { if( HitNumber == 1) { return HitedFaceIndice[0]; } else //if more than one hitted, then choose the max z-value face as the hitted one { float maxzvalue = -1000.f; int maxzindex = -1; for( int i = 0; i< HitNumber; i++) { float thisz = this.GetCenterZ(magiccube.faces[HitedFaceIndice[i]]); if( thisz > maxzvalue) { maxzvalue = thisz; maxzindex = HitedFaceIndice[i]; } } return maxzindex; } } } private float GetLength2D(float []P1, float []P2) { float dx = P1[0]-P2[0]; float dy = P1[1]-P2[1]; return (float)Math.sqrt(dx*dx + dy*dy); } private boolean IsInQuad3D(Face f, float []Win) { return IsInQuad3D(f.P1, f.P2, f.P3, f.P4, Win); } private boolean IsInQuad3D(float []Point1, float []Point2, float []Point3, float Point4[], float []Win) { float[] Win1 = new float[2]; float[] Win2 = new float[2]; float[] Win3 = new float[2]; float[] Win4 = new float[2]; Project(Point1, Win1); Project(Point2, Win2); Project(Point3, Win3); Project(Point4, Win4); /* Log.e("P1", Win1[0] + " " + Win1[1]); Log.e("P2", Win2[0] + " " + Win2[1]); Log.e("P3", Win3[0] + " " + Win3[1]); Log.e("P4", Win4[0] + " " + Win4[1]);*/ float []WinXY = new float[2]; WinXY[0] = Win[0]; WinXY[1] = this.view_matrix[3] - Win[1]; //Log.e("WinXY", WinXY[0] + " " + WinXY[1]); return IsInQuad2D(Win1, Win2, Win3, Win4, WinXY); } private boolean IsInQuad2D(float []Point1, float []Point2, float []Point3, float Point4[], float []Win) { float angle = 0.f; final float ZERO = 0.0001f; angle += GetAngle(Win, Point1, Point2); //Log.e("angle" , angle + " "); angle += GetAngle(Win, Point2, Point3); //Log.e("angle" , angle + " "); angle += GetAngle(Win, Point3, Point4); //Log.e("angle" , angle + " "); angle += GetAngle(Win, Point4, Point1); //Log.e("angle" , angle + " "); if( Math.abs(angle-Math.PI*2.f) <= ZERO ) { return true; } return false; } public String CalcCommand(float [] From, float [] To, int faceindex) { float [] from = new float[2]; float [] to = new float[2]; float angle, angleVertical, angleHorizon; from[0] = From[0]; from[1] = this.view_matrix[3] - From[1]; to[0] = To[0]; to[1] = this.view_matrix[3] - To[1]; angle = GetAngle(from, to);//(float)Math.atan((to[1]-from[1])/(to[0]-from[0]))/(float)Math.PI*180.f; //calc horizon angle float ObjFrom[] = new float[3]; float ObjTo[] = new float[3]; float WinFrom[] = new float[2]; float WinTo[] = new float[2]; for(int i=0; i<3; i++) { ObjFrom[i] = (magiccube.faces[faceindex].P1[i] + magiccube.faces[faceindex].P4[i])/2.f; ObjTo[i] = (magiccube.faces[faceindex].P2[i] + magiccube.faces[faceindex].P3[i])/2.f; } //Log.e("obj", ObjFrom[0]+" "+ObjFrom[1]+" "+ObjFrom[2]); this.Project(ObjFrom, WinFrom); this.Project(ObjTo, WinTo); angleHorizon = GetAngle(WinFrom, WinTo);//(float)Math.atan((WinTo[1]-WinFrom[1])/(WinTo[0]-WinFrom[0]))/(float)Math.PI*180.f; //calc vertical angle for(int i=0; i<3; i++) { ObjFrom[i] = (magiccube.faces[faceindex].P1[i] + magiccube.faces[faceindex].P2[i])/2.f; ObjTo[i] = (magiccube.faces[faceindex].P3[i] + magiccube.faces[faceindex].P4[i])/2.f; } this.Project(ObjFrom, WinFrom); this.Project(ObjTo, WinTo); angleVertical = GetAngle(WinFrom, WinTo);//(float)Math.atan((WinTo[1]-WinFrom[1])/(WinTo[0]-WinFrom[0]))/(float)Math.PI*180.f; //Log.e("angle", angle +" " + angleHorizon + " " + angleVertical); float dangle = DeltaAngle(angleHorizon, angleVertical); float threshold = Math.min(dangle/2.f, 90.f-dangle/2.f)*0.75f; //this........... if( DeltaAngle(angle, angleHorizon) < threshold || DeltaAngle(angle, (angleHorizon+180.f)%360.f) < threshold) //the direction { if(this.IsInQuad3D(magiccube.faces[faceindex].GetHorizonSubFace(0), From)) { if( faceindex == Face.FRONT) { if(DeltaAngle(angle, angleHorizon) < threshold) { return this.SetCommand(Command.ROTATE_ROW, 0, Cube.ClockWise); } else { return this.SetCommand(Command.ROTATE_ROW, 0, Cube.CounterClockWise); } } else if(faceindex == Face.BACK) { if(DeltaAngle(angle, angleHorizon) < threshold) { return this.SetCommand(Command.ROTATE_ROW, 0, Cube.ClockWise); } else { return this.SetCommand(Command.ROTATE_ROW, 0, Cube.CounterClockWise); } } else if(faceindex == Face.LEFT) { if(DeltaAngle(angle, angleHorizon) < threshold) { return this.SetCommand(Command.ROTATE_ROW, 0, Cube.ClockWise); } else { return this.SetCommand(Command.ROTATE_ROW, 0, Cube.CounterClockWise); } } else if(faceindex == Face.RIGHT) { if(DeltaAngle(angle, angleHorizon) < threshold) { return this.SetCommand(Command.ROTATE_ROW, 0, Cube.ClockWise); } else { return this.SetCommand(Command.ROTATE_ROW, 0, Cube.CounterClockWise); } } else if(faceindex == Face.TOP) { if(DeltaAngle(angle, angleHorizon) < threshold) { return this.SetCommand(Command.ROTATE_FACE, 2, Cube.CounterClockWise); } else { return this.SetCommand(Command.ROTATE_FACE, 2, Cube.ClockWise); } } else if(faceindex == Face.BOTTOM) { if(DeltaAngle(angle, angleHorizon) < threshold) { return this.SetCommand(Command.ROTATE_FACE, 0, Cube.ClockWise); } else { return this.SetCommand(Command.ROTATE_FACE, 0, Cube.CounterClockWise); } } } else if(this.IsInQuad3D(magiccube.faces[faceindex].GetHorizonSubFace(1), From)) { if( faceindex == Face.FRONT) { if(DeltaAngle(angle, angleHorizon) < threshold) { return this.SetCommand(Command.ROTATE_ROW, 1, Cube.ClockWise); } else { return this.SetCommand(Command.ROTATE_ROW, 1, Cube.CounterClockWise); } } else if( faceindex == Face.BACK) { if(DeltaAngle(angle, angleHorizon) < threshold) { return this.SetCommand(Command.ROTATE_ROW, 1, Cube.ClockWise); } else { return this.SetCommand(Command.ROTATE_ROW, 1, Cube.CounterClockWise); } } else if(faceindex == Face.LEFT) { if(DeltaAngle(angle, angleHorizon) < threshold) { return this.SetCommand(Command.ROTATE_ROW, 1, Cube.ClockWise); } else { return this.SetCommand(Command.ROTATE_ROW, 1, Cube.CounterClockWise); } } else if(faceindex == Face.RIGHT) { if(DeltaAngle(angle, angleHorizon) < threshold) { return this.SetCommand(Command.ROTATE_ROW, 1, Cube.ClockWise); } else { return this.SetCommand(Command.ROTATE_ROW, 1, Cube.CounterClockWise); } } else if(faceindex == Face.TOP) { if(DeltaAngle(angle, angleHorizon) < threshold) { return this.SetCommand(Command.ROTATE_FACE, 1, Cube.CounterClockWise); } else { return this.SetCommand(Command.ROTATE_FACE, 1, Cube.ClockWise); } } else if(faceindex == Face.BOTTOM) { if(DeltaAngle(angle, angleHorizon) < threshold) { return this.SetCommand(Command.ROTATE_FACE, 1, Cube.ClockWise); } else { return this.SetCommand(Command.ROTATE_FACE, 1, Cube.CounterClockWise); } } } else if(this.IsInQuad3D(magiccube.faces[faceindex].GetHorizonSubFace(2), From)) { if( faceindex == Face.FRONT) { if(DeltaAngle(angle, angleHorizon) < threshold) { return this.SetCommand(Command.ROTATE_ROW, 2, Cube.ClockWise); } else { return this.SetCommand(Command.ROTATE_ROW, 2, Cube.CounterClockWise); } } else if( faceindex == Face.BACK) { if(DeltaAngle(angle, angleHorizon) < threshold) { return this.SetCommand(Command.ROTATE_ROW, 2, Cube.ClockWise); } else { return this.SetCommand(Command.ROTATE_ROW, 2, Cube.CounterClockWise); } } else if(faceindex == Face.LEFT) { if(DeltaAngle(angle, angleHorizon) < threshold) { return this.SetCommand(Command.ROTATE_ROW, 2, Cube.ClockWise); } else { return this.SetCommand(Command.ROTATE_ROW, 2, Cube.CounterClockWise); } } else if(faceindex == Face.RIGHT) { if(DeltaAngle(angle, angleHorizon) < threshold) { return this.SetCommand(Command.ROTATE_ROW, 2, Cube.ClockWise); } else { return this.SetCommand(Command.ROTATE_ROW, 2, Cube.CounterClockWise); } } else if(faceindex == Face.TOP) { if(DeltaAngle(angle, angleHorizon) < threshold) { return this.SetCommand(Command.ROTATE_FACE, 0, Cube.CounterClockWise); } else { return this.SetCommand(Command.ROTATE_FACE, 0, Cube.ClockWise); } } else if(faceindex == Face.BOTTOM) { if(DeltaAngle(angle, angleHorizon) < threshold) { return this.SetCommand(Command.ROTATE_FACE, 2, Cube.ClockWise); } else { return this.SetCommand(Command.ROTATE_FACE, 2, Cube.CounterClockWise); } } } } else if( DeltaAngle(angle, angleVertical) < threshold || DeltaAngle(angle, (angleVertical+180.f)%360.f) < threshold) { if(this.IsInQuad3D(magiccube.faces[faceindex].GetVerticalSubFace(0), From)) { if( faceindex == Face.FRONT) { if(DeltaAngle(angle, angleVertical) < threshold) { return this.SetCommand(Command.ROTATE_COL, 0, Cube.CounterClockWise); } else { return this.SetCommand(Command.ROTATE_COL, 0, Cube.ClockWise); } } else if(faceindex == Face.BACK) { if(DeltaAngle(angle, angleVertical) < threshold) { return this.SetCommand(Command.ROTATE_COL, 2, Cube.ClockWise); } else { return this.SetCommand(Command.ROTATE_COL, 2, Cube.CounterClockWise); } } else if(faceindex == Face.LEFT) { if(DeltaAngle(angle, angleVertical) < threshold) { return this.SetCommand(Command.ROTATE_FACE, 2, Cube.CounterClockWise); } else { return this.SetCommand(Command.ROTATE_FACE, 2, Cube.ClockWise); } } else if(faceindex == Face.RIGHT) { if(DeltaAngle(angle, angleVertical) < threshold) { return this.SetCommand(Command.ROTATE_FACE, 0, Cube.ClockWise); } else { return this.SetCommand(Command.ROTATE_FACE, 0, Cube.CounterClockWise); } } else if(faceindex == Face.TOP) { if(DeltaAngle(angle, angleVertical) < threshold) { return this.SetCommand(Command.ROTATE_COL, 0, Cube.CounterClockWise); } else { return this.SetCommand(Command.ROTATE_COL, 0, Cube.ClockWise); } } else if(faceindex == Face.BOTTOM) { if(DeltaAngle(angle, angleVertical) < threshold) { return this.SetCommand(Command.ROTATE_COL, 0, Cube.CounterClockWise); } else { return this.SetCommand(Command.ROTATE_COL, 0, Cube.ClockWise); } } } else if(this.IsInQuad3D(magiccube.faces[faceindex].GetVerticalSubFace(1), From)) { if( faceindex == Face.FRONT) { if(DeltaAngle(angle, angleVertical) < threshold) { return this.SetCommand(Command.ROTATE_COL, 1, Cube.CounterClockWise); } else { return this.SetCommand(Command.ROTATE_COL, 1, Cube.ClockWise); } } else if(faceindex == Face.BACK) { if(DeltaAngle(angle, angleVertical) < threshold) { return this.SetCommand(Command.ROTATE_COL, 1, Cube.ClockWise); } else { return this.SetCommand(Command.ROTATE_COL, 1, Cube.CounterClockWise); } } else if(faceindex == Face.LEFT) { if(DeltaAngle(angle, angleVertical) < threshold) { return this.SetCommand(Command.ROTATE_FACE, 1, Cube.CounterClockWise); } else { return this.SetCommand(Command.ROTATE_FACE, 1, Cube.ClockWise); } } else if(faceindex == Face.RIGHT) { if(DeltaAngle(angle, angleVertical) < threshold) { return this.SetCommand(Command.ROTATE_FACE, 1, Cube.ClockWise); } else { return this.SetCommand(Command.ROTATE_FACE, 1, Cube.CounterClockWise); } } else if(faceindex == Face.TOP) { if(DeltaAngle(angle, angleVertical) < threshold) { return this.SetCommand(Command.ROTATE_COL, 1, Cube.CounterClockWise); } else { return this.SetCommand(Command.ROTATE_COL, 1, Cube.ClockWise); } } else if(faceindex == Face.BOTTOM) { if(DeltaAngle(angle, angleVertical) < threshold) { return this.SetCommand(Command.ROTATE_COL, 1, Cube.CounterClockWise); } else { return this.SetCommand(Command.ROTATE_COL, 1, Cube.ClockWise); } } } else if(this.IsInQuad3D(magiccube.faces[faceindex].GetVerticalSubFace(2), From)) { if( faceindex == Face.FRONT) { if(DeltaAngle(angle, angleVertical) < threshold) { return this.SetCommand(Command.ROTATE_COL, 2, Cube.CounterClockWise); } else { return this.SetCommand(Command.ROTATE_COL, 2, Cube.ClockWise); } } else if(faceindex == Face.BACK) { if(DeltaAngle(angle, angleVertical) < threshold) { return this.SetCommand(Command.ROTATE_COL, 0, Cube.ClockWise); } else { return this.SetCommand(Command.ROTATE_COL, 0, Cube.CounterClockWise); } } else if(faceindex == Face.LEFT) { if(DeltaAngle(angle, angleVertical) < threshold) { return this.SetCommand(Command.ROTATE_FACE, 0, Cube.CounterClockWise); } else { return this.SetCommand(Command.ROTATE_FACE, 0, Cube.ClockWise); } } else if(faceindex == Face.RIGHT) { if(DeltaAngle(angle, angleVertical) < threshold) { return this.SetCommand(Command.ROTATE_FACE, 2, Cube.ClockWise); } else { return this.SetCommand(Command.ROTATE_FACE, 2, Cube.CounterClockWise); } } else if(faceindex == Face.TOP) { if(DeltaAngle(angle, angleVertical) < threshold) { return this.SetCommand(Command.ROTATE_COL, 2, Cube.CounterClockWise); } else { return this.SetCommand(Command.ROTATE_COL, 2, Cube.ClockWise); } } else if(faceindex == Face.BOTTOM) { if(DeltaAngle(angle, angleVertical) < threshold) { return this.SetCommand(Command.ROTATE_COL, 2, Cube.CounterClockWise); } else { return this.SetCommand(Command.ROTATE_COL, 2, Cube.ClockWise); } } } } return null; } private float GetAngle(float[] From, float[] To) { float angle = (float)Math.atan((To[1]-From[1])/(To[0]-From[0]))/(float)Math.PI*180.f; float dy = To[1]-From[1]; float dx = To[0]-From[0]; if( dy >= 0.f && dx > 0.f) { angle = (float)Math.atan(dy/dx)/(float)Math.PI*180.f; } else if( dx == 0.f) { if( dy > 0.f) { angle = 90.f; } else { angle = 270.f; } } else if( dy >= 0.f && dx < 0.f) { angle = 180.f + (float)Math.atan(dy/dx)/(float)Math.PI*180.f; } else if( dy < 0.f && dx < 0.f) { angle = 180.f + (float)Math.atan(dy/dx)/(float)Math.PI*180.f; } else if(dy <0.f && dx > 0.f) { angle = 360.f + (float)Math.atan(dy/dx)/(float)Math.PI*180.f; } return angle; } private float DeltaAngle(float angle1, float angle2) { float a1 = Math.max(angle1, angle2); float a2 = Math.min(angle1, angle2); float delta = a1 - a2; if( delta >= 180.f ) { delta = 360.f - delta; } return delta; } private float GetCenterZ(Face f) { float zvalue = 0.f; float [] matrix1 = new float[16]; float [] matrix2 = new float[16]; float [] matrix = new float[16]; Matrix.setIdentityM(matrix1, 0); Matrix.setIdentityM(matrix2, 0); Matrix.setIdentityM(matrix, 0); Matrix.rotateM(matrix1, 0, rx, 1, 0, 0); Matrix.rotateM(matrix2, 0, ry, 0, 1, 0); Matrix.multiplyMM(matrix, 0, matrix1, 0, matrix2, 0); float xyz[] = new float[3]; xyz[0] = f.P1[0]; xyz[1] = f.P1[1]; xyz[2] = f.P1[2]; Transform(matrix, xyz); zvalue += xyz[2]; xyz[0] = f.P2[0]; xyz[1] = f.P2[1]; xyz[2] = f.P2[2]; Transform(matrix, xyz); zvalue += xyz[2]; xyz[0] = f.P3[0]; xyz[1] = f.P3[1]; xyz[2] = f.P3[2]; Transform(matrix, xyz); zvalue += xyz[2]; xyz[0] = f.P4[0]; xyz[1] = f.P4[1]; xyz[2] = f.P4[2]; Transform(matrix, xyz); zvalue += xyz[2]; return zvalue/4.f; } private float GetAngle(float []Point0, float []Point1, float[]Point2) { float cos_value = (Point2[0]-Point0[0])*(Point1[0]-Point0[0]) + (Point1[1]-Point0[1])*(Point2[1]-Point0[1]); cos_value /= Math.sqrt((Point2[0]-Point0[0])*(Point2[0]-Point0[0]) + (Point2[1]-Point0[1])*(Point2[1]-Point0[1])) * Math.sqrt((Point1[0]-Point0[0])*(Point1[0]-Point0[0]) + (Point1[1]-Point0[1])*(Point1[1]-Point0[1])); return (float)Math.acos(cos_value); } private void Project(float[] ObjXYZ, float [] WinXY) { float [] matrix1 = new float[16]; float [] matrix2 = new float[16]; float [] matrix = new float[16]; Matrix.setIdentityM(matrix1, 0); Matrix.setIdentityM(matrix2, 0); Matrix.setIdentityM(matrix, 0); Matrix.rotateM(matrix1, 0, rx, 1, 0, 0); Matrix.rotateM(matrix2, 0, ry, 0, 1, 0); Matrix.multiplyMM(matrix, 0, matrix1, 0, matrix2, 0); float xyz[] = new float[3]; xyz[0] = ObjXYZ[0]; xyz[1] = ObjXYZ[1]; xyz[2] = ObjXYZ[2]; Transform(matrix, xyz); //Log.e("xyz", xyz[0] + " " + xyz[1] + " " + xyz[2]); float []Win = new float[3]; GLU.gluProject(xyz[0], xyz[1], xyz[2], mod_matrix, 0, pro_matrix, 0, view_matrix, 0, Win, 0); WinXY[0] = Win[0]; WinXY[1] = Win[1]; } private void Transform(float[]matrix, float[]Point) { float w = 1.f; float x, y, z, ww; x = matrix[0]*Point[0] + matrix[4]*Point[1] + matrix[8]*Point[2] + matrix[12]*w; y = matrix[1]*Point[0] + matrix[5]*Point[1] + matrix[9]*Point[2] + matrix[13]*w; z = matrix[2]*Point[0] + matrix[6]*Point[1] + matrix[10]*Point[2] + matrix[14]*w; ww = matrix[3]*Point[0] + matrix[7]*Point[1] + matrix[11]*Point[2] + matrix[15]*w; Point[0] = x/ww; Point[1] = y/ww; Point[2] = z/ww; } public boolean IsComplete() { boolean r = true; for( int i=0; i<6; i++) { r = r&&magiccube.faces[i].IsSameColor(); } return magiccube.IsComplete(); } public String MessUp(int nStep) { this.solved = false; this.Finished = false; if( this.stateListener != null) { stateListener.OnStateNotify(OnStateListener.CANAUTOSOLVE); } return magiccube.MessUp(nStep); } public void MessUp(String cmdstr) { this.solved = false; magiccube.MessUp(cmdstr); this.Finished = false; if( this.stateListener != null) { stateListener.OnStateNotify(OnStateListener.CANAUTOSOLVE); } } public boolean IsMoveValid(float[]From, float []To) { return this.GetLength2D(From, To) > this.MinMovedist; } public void SetCommands(String cmdStr) { this.commands = Command.CmdStrsToCmd(cmdStr); this.HasCommand = true; } public String SetCommand(String cmdStr) { return SetCommand(Command.CmdStrToCmd(cmdStr)); } public void AutoSolve(String SolverName) { if( !solved) { MagicCubeSolver solver = SolverFactory.CreateSolver(SolverName); if(solver == null) { return; } //Log.e("state", this.GetState()); String SolveCmd = solver.AutoSolve(magiccube.GetState()); //Log.e("solve", SolveCmd); this.commands.clear(); this.commandsBack.clear(); this.commandsForward.clear(); if( this.stateListener != null) { this.stateListener.OnStateNotify(OnStateListener.CANNOTMOVEBACK); this.stateListener.OnStateNotify(OnStateListener.CANNOTMOVEFORWARD); } this.commandsAuto = Reverse(Command.CmdStrsToCmd(SolveCmd)); this.solved = true; } else if(commandsAuto.size() > 0) { Command command = commandsAuto.lastElement(); HasCommand = true; this.commands.add(command); this.commandsBack.add(command.Reverse()); this.commandsAuto.remove(commandsAuto.size()-1); if( this.stateListener != null) { this.stateListener.OnStateNotify(OnStateListener.CANMOVEBACK); } } } public void AutoSolve2(String SolverName) { if( !solved) { MagicCubeSolver solver = SolverFactory.CreateSolver(SolverName); if(solver == null) { return; } //Log.e("state", this.GetState()); String SolveCmd = solver.AutoSolve(magiccube.GetState()); //Log.e("solve", SolveCmd); this.commands.clear(); this.commandsBack.clear(); this.commandsForward.clear(); this.commands = Command.CmdStrsToCmd(SolveCmd); for( int i=0; i<commands.size(); i++) { commandsBack.add(commands.get(i).Reverse()); } this.HasCommand = true; this.solved = true; } else { commands.addAll(Reverse(commandsAuto)); for( int i=commandsAuto.size()-1; i>=0; i--) { commandsBack.add(commandsAuto.get(i).Reverse()); } commandsAuto.clear(); HasCommand = true; } } public void AutoSolve3(String SolverName) { if( !solved) { MagicCubeSolver solver = SolverFactory.CreateSolver(SolverName); if(solver == null) { return; } //Log.e("state", this.GetState()); String SolveCmd = solver.AutoSolve(magiccube.GetState()); //Log.e("solve", SolveCmd); this.commands.clear(); this.commandsBack.clear(); this.commandsForward.clear(); this.commands = Command.CmdStrsToCmd(SolveCmd); commands.remove(commands.size()-1); commands.remove(commands.size()-1); for( int i=0; i<commands.size(); i++) { commandsBack.add(commands.get(i).Reverse()); } this.HasCommand = true; this.solved = true; } else { commands.addAll(Reverse(commandsAuto)); for( int i=commandsAuto.size()-1; i>=0; i--) { commandsBack.add(commandsAuto.get(i).Reverse()); } commandsAuto.clear(); HasCommand = true; } } private Vector<Command> Reverse(Vector<Command> v) { Vector<Command> v2 = new Vector<Command>(v.size()); for(int i=v.size()-1; i>=0; i--) { v2.add(v.elementAt(i)); } return v2; } public void Reset() { Resetting = true; reset(); } private void reset() { this.rx = 22.f; this.ry = -34.f; this.HasCommand = false; Finished = false; this.CommandLoop = 0; this.commands.clear(); this.commandsBack.clear(); this.commandsForward.clear(); this.CmdStrAfter = ""; this.CmdStrBefore = ""; magiccube.Reset(); if( this.stateListener != null) { this.stateListener.OnStateNotify(OnStateListener.CANNOTMOVEBACK); this.stateListener.OnStateNotify(OnStateListener.CANNOTMOVEFORWARD); this.stateListener.OnStateNotify(OnStateListener.CANNOTAUTOSOLVE); } } public String GetCmdStrBefore() { return this.CmdStrBefore; } public void SetCmdStrBefore(String CmdStrBefore) { this.CmdStrBefore = CmdStrBefore; } public void SetCmdStrAfter(String CmdStrAfter) { this.CmdStrAfter = CmdStrAfter; } public String GetCmdStrAfter() { return this.CmdStrAfter; } public void setVolume(int volume) { this.volume = volume; } }
Java
<?php namespace Way\Generators\Syntax; class CreateTable extends Table { /** * Build string for creating a * table and columns * * @param $migrationData * @param $fields * @return mixed */ public function create($migrationData, $fields) { $migrationData = ['method' => 'create', 'table' => $migrationData['table']]; // All new tables should have an identifier // Let's add that for the user automatically $primaryKey['id'] = ['type' => 'increments']; $fields = $primaryKey + $fields; // We'll also add timestamps to new tables for convenience $fields[''] = ['type' => 'timestamps']; return (new AddToTable($this->file, $this->compiler))->add($migrationData, $fields); } }
Java
package sagex.phoenix.remote.services; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.util.HashMap; import java.util.Map; import javax.script.Invocable; import javax.script.ScriptException; import sagex.phoenix.util.PhoenixScriptEngine; public class JSMethodInvocationHandler implements InvocationHandler { private PhoenixScriptEngine eng; private Map<String, String> methodMap = new HashMap<String, String>(); public JSMethodInvocationHandler(PhoenixScriptEngine eng, String interfaceMethod, String jsMethod) { this.eng = eng; methodMap.put(interfaceMethod, jsMethod); } @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (Object.class == method.getDeclaringClass()) { String name = method.getName(); if ("equals".equals(name)) { return proxy == args[0]; } else if ("hashCode".equals(name)) { return System.identityHashCode(proxy); } else if ("toString".equals(name)) { return proxy.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(proxy)) + ", with InvocationHandler " + this; } else { throw new IllegalStateException(String.valueOf(method)); } } String jsMethod = methodMap.get(method.getName()); if (jsMethod == null) { throw new NoSuchMethodException("No Javascript Method for " + method.getName()); } Invocable inv = (Invocable) eng.getEngine(); try { return inv.invokeFunction(jsMethod, args); } catch (NoSuchMethodException e) { throw new NoSuchMethodException("The Java Method: " + method.getName() + " maps to a Javascript Method " + jsMethod + " that does not exist."); } catch (ScriptException e) { throw e; } } }
Java
package io.izenecloud.larser.framework; import io.izenecloud.conf.Configuration; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.Set; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.kohsuke.args4j.CmdLineException; import org.kohsuke.args4j.CmdLineParser; import org.kohsuke.args4j.Option; import org.kohsuke.args4j.spi.StringOptionHandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class LaserArgument { private static final Logger LOG = LoggerFactory .getLogger(LaserArgument.class); public static final Set<String> VALID_ARGUMENTS = new HashSet<String>( Arrays.asList("-configure")); @Option(name = "-configure", required = true, handler = StringOptionHandler.class) private String configure; public String getConfigure() { return configure; } public static void parseArgs(String[] args) throws CmdLineException, IOException { ArrayList<String> argsList = new ArrayList<String>(Arrays.asList(args)); for (int i = 0; i < args.length; i++) { if (i % 2 == 0 && !LaserArgument.VALID_ARGUMENTS.contains(args[i])) { argsList.remove(args[i]); argsList.remove(args[i + 1]); } } final LaserArgument laserArgument = new LaserArgument(); new CmdLineParser(laserArgument).parseArgument(argsList .toArray(new String[argsList.size()])); Configuration conf = Configuration.getInstance(); LOG.info("Load configure, {}", laserArgument.getConfigure()); Path path = new Path(laserArgument.getConfigure()); FileSystem fs = FileSystem .get(new org.apache.hadoop.conf.Configuration()); conf.load(path, fs); } }
Java
// Copyright 2015 Google Inc. 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. package node import ( "reflect" "testing" "github.com/kubernetes/dashboard/src/app/backend/resource/common" "github.com/kubernetes/dashboard/src/app/backend/resource/dataselect" "github.com/kubernetes/dashboard/src/app/backend/resource/metric" metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/fake" api "k8s.io/client-go/pkg/api/v1" ) func TestGetNodeList(t *testing.T) { cases := []struct { node *api.Node expected *NodeList }{ { &api.Node{ ObjectMeta: metaV1.ObjectMeta{Name: "test-node"}, Spec: api.NodeSpec{ Unschedulable: true, }, }, &NodeList{ ListMeta: common.ListMeta{ TotalItems: 1, }, CumulativeMetrics: make([]metric.Metric, 0), Nodes: []Node{{ ObjectMeta: common.ObjectMeta{Name: "test-node"}, TypeMeta: common.TypeMeta{Kind: common.ResourceKindNode}, Ready: "Unknown", AllocatedResources: NodeAllocatedResources{ CPURequests: 0, CPURequestsFraction: 0, CPULimits: 0, CPULimitsFraction: 0, CPUCapacity: 0, MemoryRequests: 0, MemoryRequestsFraction: 0, MemoryLimits: 0, MemoryLimitsFraction: 0, MemoryCapacity: 0, AllocatedPods: 0, PodCapacity: 0, }, }, }, }, }, } for _, c := range cases { fakeClient := fake.NewSimpleClientset(c.node) fakeHeapsterClient := FakeHeapsterClient{client: *fake.NewSimpleClientset()} actual, _ := GetNodeList(fakeClient, dataselect.NoDataSelect, fakeHeapsterClient) if !reflect.DeepEqual(actual, c.expected) { t.Errorf("GetNodeList() == \ngot: %#v, \nexpected %#v", actual, c.expected) } } }
Java
/* * This is a manifest file that'll be compiled into application.css, which will include all the files * listed below. * * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. * * You're free to add application-wide styles to this file and they'll appear at the bottom of the * compiled file so the styles you add here take precedence over styles defined in any styles * defined in the other CSS/SCSS files in this directory. It is generally better to create a new * file per style scope. * *= require_tree . *= require_self *= require jquery-ui */ /* * CSS workarounds */ input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } input[type=number] { -webkit-appearance: textfield; -moz-appearance: textfield; margin: 0; } select { -webkit-appearance: none; -moz-appearance: none; } ::-webkit-input-placeholder { /* WebKit, Blink, Edge */ color: #3a90c9; font-size: x-large; padding-top: 3px; padding-left: 3px; } ::-moz-placeholder { /* Mozilla Firefox 19+ */ color: #3a90c9; font-size: x-large; opacity: 1; } :-ms-input-placeholder { /* Internet Explorer 10-11 */ color: #3a90c9; font-size: x-large; }
Java
default_app_config = 'providers.com.dailyssrn.apps.AppConfig'
Java
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html lang="en-GB" xml:lang="en-GB" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title>Number</title> <link rel="root" href=""/> <!-- for JS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"> <link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/> <link rel="stylesheet" type="text/css" href="../../css/style.css"/> <link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/> <link rel="stylesheet" type="text/css" href="../../css/hint.css"/> <script type="text/javascript" src="../../lib/ext/head.load.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/3.2.2/anchor.min.js"></script> <script>document.addEventListener("DOMContentLoaded", function(event) {anchors.add();});</script> <!-- Set up this custom Google search at https://cse.google.com/cse/business/settings?cx=001145188882102106025:dl1mehhcgbo --> <!-- DZ 2021-01-22: I am temporarily hiding the search field to find out whether it slows down loading of the title page. <script> (function() { var cx = '001145188882102106025:dl1mehhcgbo'; var gcse = document.createElement('script'); gcse.type = 'text/javascript'; gcse.async = true; gcse.src = 'https://cse.google.com/cse.js?cx=' + cx; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s); })(); </script> --> <!-- <link rel="shortcut icon" href="favicon.ico"/> --> </head> <body> <div id="main" class="center"> <div id="hp-header"> <table width="100%"><tr><td width="50%"> <span class="header-text"><a href="http://universaldependencies.org/#language-cy">home</a></span> <span class="header-text"><a href="https://github.com/universaldependencies/docs/edit/pages-source/_cy/feat/Number.md" target="#">edit page</a></span> <span class="header-text"><a href="https://github.com/universaldependencies/docs/issues">issue tracker</a></span> </td><td> <gcse:search></gcse:search> </td></tr></table> </div> <hr/> <div class="v2complete"> This page pertains to UD version 2. </div> <div id="content"> <noscript> <div id="noscript"> It appears that you have Javascript disabled. Please consider enabling Javascript for this page to see the visualizations. </div> </noscript> <!-- The content may include scripts and styles, hence we must load the shared libraries before the content. --> <script type="text/javascript"> console.time('loading libraries'); var root = '../../'; // filled in by jekyll head.js( // External libraries // DZ: Copied from embedding.html. I don't know which one is needed for what, so I'm currently keeping them all. root + 'lib/ext/jquery.min.js', root + 'lib/ext/jquery.svg.min.js', root + 'lib/ext/jquery.svgdom.min.js', root + 'lib/ext/jquery.timeago.js', root + 'lib/ext/jquery-ui.min.js', root + 'lib/ext/waypoints.min.js', root + 'lib/ext/jquery.address.min.js' ); </script> <style>h3 {display:block;background-color:#dfeffc}</style> <h2><code>Number</code>: number of verbs, nouns, pronouns and adjectives</h2> <p>Number has two values in Welsh, Singular and Plural. It is marked on nouns, some adjectives, pronouns, verbs and inflected prepositions. Only very few adjectives are marked for number. Verbs with a pronominal subject are marked for Person and Number, verbs with a nominal subject are always in the 3rd person singular, also with plural subjects. There is a group of nouns in Welsh, whose lemma is a plural, the singular is formed by adding a singulative suffix: <em>plant</em> “children”, <em>plentyn</em> “child”). However, in the Welsh treebank, we always put the singular in the lemma column</p> <h3 id="sing-singular"><a name="Sing"><code class="language-plaintext highlighter-rouge">Sing</code></a>: singular</h3> <h4 id="examples">Examples</h4> <ul> <li><em>tŷ</em> “house”</li> <li><em>y ferch</em> “the woman”</li> <li><em>aderyn</em> “bird”</li> <li><em>o</em> “he”</li> </ul> <h3 id="plur-plural"><a name="Plur"><code class="language-plaintext highlighter-rouge">Plur</code></a>: plural</h3> <h4 id="examples-1">Examples</h4> <ul> <li><em>tai</em> “houses”</li> <li><em>y merched</em> “the women”</li> <li><em>adar</em> “birds”</li> <li><em>nhw</em> “they”</li> </ul> <!-- Interlanguage links updated St lis 3 20:58:24 CET 2021 --> <!-- "in other languages" links --> <hr/> Number in other languages: [<a href="../../arr/feat/Number.html">arr</a>] [<a href="../../bej/feat/Number.html">bej</a>] [<a href="../../bg/feat/Number.html">bg</a>] [<a href="../../bm/feat/Number.html">bm</a>] [<a href="../../cs/feat/Number.html">cs</a>] [<a href="../../cy/feat/Number.html">cy</a>] [<a href="../../en/feat/Number.html">en</a>] [<a href="../../ess/feat/Number.html">ess</a>] [<a href="../../eu/feat/Number.html">eu</a>] [<a href="../../fi/feat/Number.html">fi</a>] [<a href="../../fr/feat/Number.html">fr</a>] [<a href="../../ga/feat/Number.html">ga</a>] [<a href="../../gub/feat/Number.html">gub</a>] [<a href="../../hu/feat/Number.html">hu</a>] [<a href="../../hy/feat/Number.html">hy</a>] [<a href="../../it/feat/Number.html">it</a>] [<a href="../../myv/feat/Number.html">myv</a>] [<a href="../../orv/feat/Number.html">orv</a>] [<a href="../../pcm/feat/Number.html">pcm</a>] [<a href="../../pt/feat/Number.html">pt</a>] [<a href="../../ru/feat/Number.html">ru</a>] [<a href="../../sl/feat/Number.html">sl</a>] [<a href="../../sv/feat/Number.html">sv</a>] [<a href="../../tpn/feat/Number.html">tpn</a>] [<a href="../../tr/feat/Number.html">tr</a>] [<a href="../../tt/feat/Number.html">tt</a>] [<a href="../../u/feat/Number.html">u</a>] [<a href="../../uk/feat/Number.html">uk</a>] [<a href="../../urb/feat/Number.html">urb</a>] [<a href="../../urj/feat/Number.html">urj</a>] </div> <!-- support for embedded visualizations --> <script type="text/javascript"> var root = '../../'; // filled in by jekyll head.js( // We assume that external libraries such as jquery.min.js have already been loaded outside! // (See _layouts/base.html.) // brat helper modules root + 'lib/brat/configuration.js', root + 'lib/brat/util.js', root + 'lib/brat/annotation_log.js', root + 'lib/ext/webfont.js', // brat modules root + 'lib/brat/dispatcher.js', root + 'lib/brat/url_monitor.js', root + 'lib/brat/visualizer.js', // embedding configuration root + 'lib/local/config.js', // project-specific collection data root + 'lib/local/collections.js', // Annodoc root + 'lib/annodoc/annodoc.js', // NOTE: non-local libraries 'https://spyysalo.github.io/conllu.js/conllu.js' ); var webFontURLs = [ // root + 'static/fonts/Astloch-Bold.ttf', root + 'static/fonts/PT_Sans-Caption-Web-Regular.ttf', root + 'static/fonts/Liberation_Sans-Regular.ttf' ]; var setupTimeago = function() { jQuery("time.timeago").timeago(); }; head.ready(function() { setupTimeago(); // mark current collection (filled in by Jekyll) Collections.listing['_current'] = 'cy'; // perform all embedding and support functions Annodoc.activate(Config.bratCollData, Collections.listing); }); </script> <!-- google analytics --> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-55233688-1', 'auto'); ga('send', 'pageview'); </script> <div id="footer"> <p class="footer-text">&copy; 2014–2021 <a href="http://universaldependencies.org/introduction.html#contributors" style="color:gray">Universal Dependencies contributors</a>. Site powered by <a href="http://spyysalo.github.io/annodoc" style="color:gray">Annodoc</a> and <a href="http://brat.nlplab.org/" style="color:gray">brat</a></p>. </div> </div> </body> </html>
Java
package com.nagopy.android.disablemanager2; import android.os.Build; import com.android.uiautomator.core.UiSelector; @SuppressWarnings("unused") public class UiSelectorBuilder { private UiSelector uiSelector; public UiSelector build() { return uiSelector; } /** * @since API Level 16 */ public UiSelectorBuilder() { uiSelector = new UiSelector(); } /** * @since API Level 16 */ public UiSelectorBuilder text(String text) { uiSelector = uiSelector.text(text); return this; } /** * @since API Level 17 */ public UiSelectorBuilder textMatches(String regex) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { uiSelector = uiSelector.textMatches(regex); } return this; } /** * @since API Level 16 */ public UiSelectorBuilder textStartsWith(String text) { uiSelector = uiSelector.textStartsWith(text); return this; } /** * @since API Level 16 */ public UiSelectorBuilder textContains(String text) { uiSelector = uiSelector.textContains(text); return this; } /** * @since API Level 16 */ public UiSelectorBuilder className(String className) { uiSelector = uiSelector.className(className); return this; } /** * @since API Level 17 */ public UiSelectorBuilder classNameMatches(String regex) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { uiSelector = uiSelector.classNameMatches(regex); } return this; } /** * @since API Level 17 */ public UiSelectorBuilder className(Class<?> type) { uiSelector = uiSelector.className(type.getName()); return this; } /** * @since API Level 16 */ public UiSelectorBuilder description(String desc) { uiSelector = uiSelector.description(desc); return this; } /** * @since API Level 17 */ public UiSelectorBuilder descriptionMatches(String regex) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { uiSelector = uiSelector.descriptionMatches(regex); } return this; } /** * @since API Level 16 */ public UiSelectorBuilder descriptionStartsWith(String desc) { uiSelector = uiSelector.descriptionStartsWith(desc); return this; } /** * @since API Level 16 */ public UiSelectorBuilder descriptionContains(String desc) { uiSelector = uiSelector.descriptionContains(desc); return this; } /** * @since API Level 18 */ public UiSelectorBuilder resourceId(String id) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { uiSelector = uiSelector.resourceId(id); } return this; } /** * @since API Level 18 */ public UiSelectorBuilder resourceIdMatches(String regex) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { uiSelector = uiSelector.resourceIdMatches(regex); } return this; } /** * @since API Level 16 */ public UiSelectorBuilder index(final int index) { uiSelector = uiSelector.index(index); return this; } /** * @since API Level 16 */ public UiSelectorBuilder instance(final int instance) { uiSelector = uiSelector.instance(instance); return this; } /** * @since API Level 16 */ public UiSelectorBuilder enabled(boolean val) { uiSelector = uiSelector.enabled(val); return this; } /** * @since API Level 16 */ public UiSelectorBuilder focused(boolean val) { uiSelector = uiSelector.focused(val); return this; } /** * @since API Level 16 */ public UiSelectorBuilder focusable(boolean val) { uiSelector = uiSelector.focusable(val); return this; } /** * @since API Level 16 */ public UiSelectorBuilder scrollable(boolean val) { uiSelector = uiSelector.scrollable(val); return this; } /** * @since API Level 16 */ public UiSelectorBuilder selected(boolean val) { uiSelector = uiSelector.selected(val); return this; } /** * @since API Level 16 */ public UiSelectorBuilder checked(boolean val) { uiSelector = uiSelector.checked(val); return this; } /** * @since API Level 16 */ public UiSelectorBuilder clickable(boolean val) { uiSelector = uiSelector.clickable(val); return this; } /** * @since API Level 18 */ public UiSelectorBuilder checkable(boolean val) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { uiSelector = uiSelector.checkable(val); } return this; } /** * @since API Level 17 */ public UiSelectorBuilder longClickable(boolean val) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { uiSelector = uiSelector.longClickable(val); } return this; } /** * @since API Level 16 */ public UiSelectorBuilder childSelector(UiSelector selector) { uiSelector = uiSelector.childSelector(selector); return this; } /** * @since API Level 16 */ public UiSelectorBuilder fromParent(UiSelector selector) { uiSelector = uiSelector.fromParent(selector); return this; } /** * @since API Level 16 */ public UiSelectorBuilder packageName(String name) { uiSelector = uiSelector.packageName(name); return this; } /** * @since API Level 17 */ public UiSelectorBuilder packageNameMatches(String regex) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { uiSelector = uiSelector.packageNameMatches(regex); } return this; } }
Java
package com.salesmanager.shop.model.entity; import java.io.Serializable; public abstract class ReadableList implements Serializable { /** * */ private static final long serialVersionUID = 1L; private int totalPages;//totalPages private int number;//number of record in current page private long recordsTotal;//total number of records in db private int recordsFiltered; public int getTotalPages() { return totalPages; } public void setTotalPages(int totalCount) { this.totalPages = totalCount; } public long getRecordsTotal() { return recordsTotal; } public void setRecordsTotal(long recordsTotal) { this.recordsTotal = recordsTotal; } public int getRecordsFiltered() { return recordsFiltered; } public void setRecordsFiltered(int recordsFiltered) { this.recordsFiltered = recordsFiltered; } public int getNumber() { return number; } public void setNumber(int number) { this.number = number; } }
Java
# coding: UTF-8 name 'ops_tcpdump_handler' maintainer 'Operations Infrastructure Team - Cerner Innovation, Inc.' maintainer_email 'OpsInfraTeam@cerner.com' license 'Apache 2.0' description 'Installs/Configures ops_tcpdump_handler' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '1.1.0' supports 'ubuntu' supports 'centos' supports 'redhat' depends 'runit', '~> 1.5'
Java
/* * @(#)file SASLOutputStream.java * @(#)author Sun Microsystems, Inc. * @(#)version 1.10 * @(#)lastedit 07/03/08 * @(#)build @BUILD_TAG_PLACEHOLDER@ * * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * * Copyright (c) 2007 Sun Microsystems, Inc. All Rights Reserved. * * The contents of this file are subject to the terms of either the GNU General * Public License Version 2 only ("GPL") or the Common Development and * Distribution License("CDDL")(collectively, the "License"). You may not use * this file except in compliance with the License. You can obtain a copy of the * License at http://opendmk.dev.java.net/legal_notices/licenses.txt or in the * LEGAL_NOTICES folder that accompanied this code. See the License for the * specific language governing permissions and limitations under the License. * * When distributing the software, include this License Header Notice in each * file and include the License file found at * http://opendmk.dev.java.net/legal_notices/licenses.txt * or in the LEGAL_NOTICES folder that accompanied this code. * Sun designates this particular file as subject to the "Classpath" exception * as provided by Sun in the GPL Version 2 section of the License file that * accompanied this code. * * If applicable, add the following below the License Header, with the fields * enclosed by brackets [] replaced by your own identifying information: * * "Portions Copyrighted [year] [name of copyright owner]" * * Contributor(s): * * If you wish your version of this file to be governed by only the CDDL or * only the GPL Version 2, indicate your decision by adding * * "[Contributor] elects to include this software in this distribution * under the [CDDL or GPL Version 2] license." * * If you don't indicate a single choice of license, a recipient has the option * to distribute your version of this file under either the CDDL or the GPL * Version 2, or to extend the choice of license to its licensees as provided * above. However, if you add GPL Version 2 code and therefore, elected the * GPL Version 2 license, then the option applies only if the new code is made * subject to such option by the copyright holder. * */ package com.sun.jmx.remote.opt.security; import javax.security.sasl.Sasl; import javax.security.sasl.SaslClient; import javax.security.sasl.SaslServer; import java.io.IOException; import java.io.OutputStream; import com.sun.jmx.remote.opt.util.ClassLogger; public class SASLOutputStream extends OutputStream { private int rawSendSize = 65536; private byte[] lenBuf = new byte[4]; // buffer for storing length private OutputStream out; // underlying output stream private SaslClient sc; private SaslServer ss; public SASLOutputStream(SaslClient sc, OutputStream out) throws IOException { super(); this.out = out; this.sc = sc; this.ss = null; String str = (String) sc.getNegotiatedProperty(Sasl.RAW_SEND_SIZE); if (str != null) { try { rawSendSize = Integer.parseInt(str); } catch (NumberFormatException e) { throw new IOException(Sasl.RAW_SEND_SIZE + " property must be numeric string: " + str); } } } public SASLOutputStream(SaslServer ss, OutputStream out) throws IOException { super(); this.out = out; this.ss = ss; this.sc = null; String str = (String) ss.getNegotiatedProperty(Sasl.RAW_SEND_SIZE); if (str != null) { try { rawSendSize = Integer.parseInt(str); } catch (NumberFormatException e) { throw new IOException(Sasl.RAW_SEND_SIZE + " property must be numeric string: " + str); } } } public void write(int b) throws IOException { byte[] buffer = new byte[1]; buffer[0] = (byte)b; write(buffer, 0, 1); } public void write(byte[] buffer, int offset, int total) throws IOException { int count; byte[] wrappedToken, saslBuffer; // "Packetize" buffer to be within rawSendSize if (logger.traceOn()) { logger.trace("write", "Total size: " + total); } for (int i = 0; i < total; i += rawSendSize) { // Calculate length of current "packet" count = (total - i) < rawSendSize ? (total - i) : rawSendSize; // Generate wrapped token if (sc != null) wrappedToken = sc.wrap(buffer, offset+i, count); else wrappedToken = ss.wrap(buffer, offset+i, count); // Write out length intToNetworkByteOrder(wrappedToken.length, lenBuf, 0, 4); if (logger.traceOn()) { logger.trace("write", "sending size: " + wrappedToken.length); } out.write(lenBuf, 0, 4); // Write out wrapped token out.write(wrappedToken, 0, wrappedToken.length); } } public void close() throws IOException { if (sc != null) sc.dispose(); else ss.dispose(); out.close(); } /** * Encodes an integer into 4 bytes in network byte order in the buffer * supplied. */ private void intToNetworkByteOrder(int num, byte[] buf, int start, int count) { if (count > 4) { throw new IllegalArgumentException("Cannot handle more " + "than 4 bytes"); } for (int i = count-1; i >= 0; i--) { buf[start+i] = (byte)(num & 0xff); num >>>= 8; } } private static final ClassLogger logger = new ClassLogger("javax.management.remote.misc", "SASLOutputStream"); }
Java
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <link rel="SHORTCUT ICON" href="../../../../../img/clover.ico" /> <link rel="stylesheet" href="../../../../../aui/css/aui.min.css" media="all"/> <link rel="stylesheet" href="../../../../../aui/css/aui-experimental.min.css" media="all"/> <!--[if IE 9]><link rel="stylesheet" href="../../../../../aui/css/aui-ie9.min.css" media="all"/><![endif]--> <style type="text/css" media="all"> @import url('../../../../../style.css'); @import url('../../../../../tree.css'); </style> <script src="../../../../../jquery-1.8.3.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui-experimental.min.js" type="text/javascript"></script> <script src="../../../../../aui/js/aui-soy.min.js" type="text/javascript"></script> <script src="../../../../../package-nodes-tree.js" type="text/javascript"></script> <script src="../../../../../clover-tree.js" type="text/javascript"></script> <script src="../../../../../clover.js" type="text/javascript"></script> <script src="../../../../../clover-descriptions.js" type="text/javascript"></script> <script src="../../../../../cloud.js" type="text/javascript"></script> <title>ABA Route Transit Number Validator 1.0.1-SNAPSHOT</title> </head> <body> <div id="page"> <header id="header" role="banner"> <nav class="aui-header aui-dropdown2-trigger-group" role="navigation"> <div class="aui-header-inner"> <div class="aui-header-primary"> <h1 id="logo" class="aui-header-logo aui-header-logo-clover"> <a href="http://openclover.org" title="Visit OpenClover home page"><span class="aui-header-logo-device">OpenClover</span></a> </h1> </div> <div class="aui-header-secondary"> <ul class="aui-nav"> <li id="system-help-menu"> <a class="aui-nav-link" title="Open online documentation" target="_blank" href="http://openclover.org/documentation"> <span class="aui-icon aui-icon-small aui-iconfont-help">&#160;Help</span> </a> </li> </ul> </div> </div> </nav> </header> <div class="aui-page-panel"> <div class="aui-page-panel-inner"> <div class="aui-page-panel-nav aui-page-panel-nav-clover"> <div class="aui-page-header-inner" style="margin-bottom: 20px;"> <div class="aui-page-header-image"> <a href="http://cardatechnologies.com" target="_top"> <div class="aui-avatar aui-avatar-large aui-avatar-project"> <div class="aui-avatar-inner"> <img src="../../../../../img/clover_logo_large.png" alt="Clover icon"/> </div> </div> </a> </div> <div class="aui-page-header-main" > <h1> <a href="http://cardatechnologies.com" target="_top"> ABA Route Transit Number Validator 1.0.1-SNAPSHOT </a> </h1> </div> </div> <nav class="aui-navgroup aui-navgroup-vertical"> <div class="aui-navgroup-inner"> <ul class="aui-nav"> <li class=""> <a href="../../../../../dashboard.html">Project overview</a> </li> </ul> <div class="aui-nav-heading packages-nav-heading"> <strong>Packages</strong> </div> <div class="aui-nav project-packages"> <form method="get" action="#" class="aui package-filter-container"> <input type="text" autocomplete="off" class="package-filter text" placeholder="Type to filter packages..." name="package-filter" id="package-filter" title="Start typing package name (or part of the name) to search through the tree. Use arrow keys and the Enter key to navigate."/> </form> <p class="package-filter-no-results-message hidden"> <small>No results found.</small> </p> <div class="packages-tree-wrapper" data-root-relative="../../../../../" data-package-name="com.cardatechnologies.utils.validators.abaroutevalidator"> <div class="packages-tree-container"></div> <div class="clover-packages-lozenges"></div> </div> </div> </div> </nav> </div> <section class="aui-page-panel-content"> <div class="aui-page-panel-content-clover"> <div class="aui-page-header-main"><ol class="aui-nav aui-nav-breadcrumbs"> <li><a href="../../../../../dashboard.html"> Project Clover database Sat Aug 7 2021 12:29:33 MDT</a></li> <li><a href="test-pkg-summary.html">Package com.cardatechnologies.utils.validators.abaroutevalidator</a></li> <li><a href="test-Test_AbaRouteValidator_17a.html">Class Test_AbaRouteValidator_17a</a></li> </ol></div> <h1 class="aui-h2-clover"> Test testAbaNumberCheck_36860_bad </h1> <table class="aui"> <thead> <tr> <th>Test</th> <th><label title="The test result. Either a Pass, Fail or Error.">Status</label></th> <th><label title="When the test execution was started">Start time</label></th> <th><label title="The total time in seconds taken to run this test.">Time (seconds)</label></th> <th><label title="A failure or error message if the test is not successful.">Message</label></th> </tr> </thead> <tbody> <tr> <td> <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/Test_AbaRouteValidator_17a.html?line=42657#src-42657" >testAbaNumberCheck_36860_bad</a> </td> <td> <span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span> </td> <td> 7 Aug 12:46:26 </td> <td> 0.0 </td> <td> <div></div> <div class="errorMessage"></div> </td> </tr> </tbody> </table> <div>&#160;</div> <table class="aui aui-table-sortable"> <thead> <tr> <th style="white-space:nowrap;"><label title="A class that was directly hit by this test.">Target Class</label></th> <th colspan="4"><label title="The percentage of coverage contributed by each single test.">Coverage contributed by</label> testAbaNumberCheck_36860_bad</th> </tr> </thead> <tbody> <tr> <td> <span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.exceptions.AbaRouteValidationException</span> &#160;&#160;<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/exceptions/AbaRouteValidationException.html?id=9592#AbaRouteValidationException" title="AbaRouteValidationException" name="sl-43">com.cardatechnologies.utils.validators.abaroutevalidator.exceptions.AbaRouteValidationException</a> </td> <td> <span class="sortValue">0.5714286</span>57.1% </td> <td class="align-middle" style="width: 100%" colspan="3"> <div> <div title="57.1% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:57.1%"></div></div></div> </td> </tr> <tr> <td> <span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.ErrorCodes</span> &#160;&#160;<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/ErrorCodes.html?id=9592#ErrorCodes" title="ErrorCodes" name="sl-42">com.cardatechnologies.utils.validators.abaroutevalidator.ErrorCodes</a> </td> <td> <span class="sortValue">0.5714286</span>57.1% </td> <td class="align-middle" style="width: 100%" colspan="3"> <div> <div title="57.1% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:57.1%"></div></div></div> </td> </tr> <tr> <td> <span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</span> &#160;&#160;<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/AbaRouteValidator.html?id=9592#AbaRouteValidator" title="AbaRouteValidator" name="sl-47">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</a> </td> <td> <span class="sortValue">0.29411766</span>29.4% </td> <td class="align-middle" style="width: 100%" colspan="3"> <div> <div title="29.4% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:29.4%"></div></div></div> </td> </tr> </tbody> </table> </div> <!-- class="aui-page-panel-content-clover" --> <footer id="footer" role="contentinfo"> <section class="footer-body"> <ul> <li> Report generated by <a target="_new" href="http://openclover.org">OpenClover</a> v 4.4.1 on Sat Aug 7 2021 12:49:26 MDT using coverage data from Sat Aug 7 2021 12:47:23 MDT. </li> </ul> <ul> <li>OpenClover is free and open-source software. </li> </ul> </section> </footer> </section> <!-- class="aui-page-panel-content" --> </div> <!-- class="aui-page-panel-inner" --> </div> <!-- class="aui-page-panel" --> </div> <!-- id="page" --> </body> </html>
Java
# -*- coding:utf-8 -*- # # Copyright (c) 2017 mooncake. All Rights Reserved #### # @brief # @author Eric Yue ( hi.moonlight@gmail.com ) # @version 0.0.1 from distutils.core import setup V = "0.7" setup( name = 'mooncake_utils', packages = ['mooncake_utils'], version = V, description = 'just a useful utils for mooncake personal project.', author = 'mooncake', author_email = 'hi.moonlight@gmail.com', url = 'https://github.com/ericyue/mooncake_utils', download_url = 'https://github.com/ericyue/mooncake_utils/archive/%s.zip' % V, keywords = ['utils','data','machine-learning'], # arbitrary keywords classifiers = [], )
Java
function f1(a) { try { throw "x"; } catch (arguments) { console.log(arguments); } } f1(3);
Java
# Sorosporium hodsonii Zundel SPECIES #### Status ACCEPTED #### According to Index Fungorum #### Published in Mycologia 22(3): 152 (1930) #### Original name Sorosporium hodsonii Zundel ### Remarks null
Java
#!/bin/bash # Note: this requires the fix from: # https://github.com/kubernetes/kubernetes/pull/24299 ( # Clean-up from previous run kubectl delete rc app kubectl delete secret creds kubectl delete ServiceBroker mongodb-sb kubectl delete ServiceInstance mongodb-instance1 kubectl delete ServiceBinding mongodb-instance1-binding1 kubectl delete thirdpartyresource service-broker.cncf.org kubectl delete thirdpartyresource service-instance.cncf.org kubectl delete thirdpartyresource service-binding.cncf.org ) > /dev/null 2>&1 kubectl get thirdpartyresources set -ex # First create the new resource types kubectl create -f - <<-EOF apiVersion: extensions/v1beta1 kind: ThirdPartyResource metadata: name: service-broker.cncf.org versions: - name: v1 EOF kubectl create -f - <<-EOF apiVersion: extensions/v1beta1 kind: ThirdPartyResource metadata: name: service-instance.cncf.org versions: - name: v1 EOF kubectl create -f - <<-EOF apiVersion: extensions/v1beta1 kind: ThirdPartyResource metadata: name: service-binding.cncf.org versions: - name: v1 EOF sleep 10 # Verify everything is there curl http://localhost:8080/apis/cncf.org/v1/namespaces/default/servicebrokers curl http://localhost:8080/apis/cncf.org/v1/namespaces/default/serviceinstances curl http://localhost:8080/apis/cncf.org/v1/namespaces/default/servicebindings # New create instances of each type kubectl create -f - <<-EOF apiVersion: cncf.org/v1 kind: ServiceBroker metadata: name: mongodb-sb EOF kubectl create -f - <<-EOF apiVersion: cncf.org/v1 kind: ServiceInstance metadata: name: mongodb-instance1 EOF kubectl create -f - <<-EOF apiVersion: cncf.org/v1 kind: ServiceBinding metadata: name: mongodb-instance1-binding1 creds: user: john password: letMeIn EOF # And the secret to hold our creds kubectl create -f - <<EOF apiVersion: v1 kind: Secret metadata: name: creds data: vcap-services: eyAidXNlciI6ICJqb2huIiwgInBhc3N3b3JkIjogImxldE1lSW4iIH0= type: myspecial/secret EOF sleep 10 # Now create the app with VCAP_SERVICES binding info kubectl create -f - <<EOF apiVersion: v1 kind: ReplicationController metadata: name: app spec: replicas: 1 selector: version: v1.0 template: metadata: name: myserver labels: version: v1.0 spec: containers: - name: nginx image: nginx env: - name: VCAP_SERVICES valueFrom: secretKeyRef: name: creds key: vcap-services EOF sleep 15 # Prove it worked kubectl exec `kubectl get pods --template "{{ (index .items 0).metadata.name }}"` -- env
Java
--- title: 集群感知的服务路由 description: 利用 Istio 的水平分割 EDS 来创建多集群网格。 weight: 85 keywords: [kubernetes,multicluster] --- 这个示例展示了如何使用[单一控制平面拓扑](/zh/docs/concepts/multicluster-deployments/#单一控制平面拓扑)配置一个多集群网格,并使用 Istio 的`水平分割 EDS(Endpoints Discovery Service,Endpoint 发现服务)`特性(在 Istio 1.1 中引入),通过 ingress gateway 将服务请求路由到 remote 集群。水平分割 EDS 使 Istio 可以基于请求来源的位置,将其路由到不同的 endpoint。 按照此示例中的说明,您将设置一个两集群网格,如下图所示: {{< image width="80%" ratio="36.01%" link="/docs/examples/multicluster/split-horizon-eds/diagram.svg" caption="单个 Istio 控制平面配置水平分割 EDS,跨越多个 Kubernetes 集群" >}} `local` 集群将运行 Istio Pilot 和其它 Istio 控制平面组件,而 `remote` 集群仅运行 Istio Citadel、Sidecar Injector 和 Ingress gateway。不需要 VPN 连接,不同集群中的工作负载之间也无需直接网络访问。 ## 开始之前 除了安装 Istio 的先决条件之外,此示例还需要以下条件: * 两个 Kubernetes 集群(称之为 `local` 和 `remote`)。 {{< warning >}} 为了运行此配置,要求必须可以从 `local` 集群访问 `remote` 集群的 Kubernetes API server。 {{< /warning >}} * `kubectl` 命令使用 `--context` 参数,同时访问 `local` 和 `remote` 集群。请使用下列命令列出您的 context: {{< text bash >}} $ kubectl config get-contexts CURRENT NAME CLUSTER AUTHINFO NAMESPACE cluster1 cluster1 user@foo.com default cluster2 cluster2 user@foo.com default {{< /text >}} * 使用配置的 context 名称导出以下环境变量: {{< text bash >}} $ export CTX_LOCAL=<KUBECONFIG_LOCAL_CONTEXT_NAME> $ export CTX_REMOTE=<KUBECONFIG_REMOTE_CONTEXT_NAME> {{< /text >}} ## 多集群设置示例 在此示例中,您将安装对控制平面和应用程序 pod 都启用了双向 TLS 的 Istio。为了共享根 CA,您将使用同一个来自 Istio 示例目录的证书,在 `local` 和 `remote` 集群上创建一个相同的 `cacerts` secret。 下面的说明还设置了 `remote` 集群,包含一个无 selector 的 service 和具有 `local` Istio ingress gateway 地址的 `istio-pilot.istio-system` endpoint。这将用于通过 ingress gateway 安全地访问 `local` pilot,而无需双向 TLS 终止。 ### 配置 local 集群 1. 定义网格网络: 默认情况下 Istio 的 `global.meshNetworks` 值为空,但是您需要对其进行修改以为 `remote` 集群上的 endpoint 定义一个新的网络。修改 `install/kubernetes/helm/istio/values.yaml` 并添加一个 `network2` 定义: {{< text yaml >}} meshNetworks: network2: endpoints: - fromRegistry: remote_kubecfg gateways: - address: 0.0.0.0 port: 443 {{< /text >}} 请注意,gateway address 被设置为 `0.0.0.0`。这是一个临时占位符,稍后将被更新为 `remote` 集群 gateway 的公共 IP 地址,此 gateway 将在下一小节中部署。 1. 使用 Helm 创建 Istio `local` deployment YAML: {{< text bash >}} $ helm template --namespace=istio-system \ --values @install/kubernetes/helm/istio/values.yaml@ \ --set global.mtls.enabled=true \ --set global.enableTracing=false \ --set security.selfSigned=false \ --set mixer.telemetry.enabled=false \ --set mixer.policy.enabled=false \ --set global.useMCP=false \ --set global.controlPlaneSecurityEnabled=true \ --set gateways.istio-egressgateway.enabled=false \ --set global.meshExpansion.enabled=true \ install/kubernetes/helm/istio > istio-auth.yaml {{< /text >}} 1. 部署 Istio 到 `local` 集群: {{< text bash >}} $ kubectl create --context=$CTX_LOCAL ns istio-system $ kubectl create --context=$CTX_LOCAL secret generic cacerts -n istio-system --from-file=samples/certs/ca-cert.pem --from-file=samples/certs/ca-key.pem --from-file=samples/certs/root-cert.pem --from-file=samples/certs/cert-chain.pem $ for i in install/kubernetes/helm/istio-init/files/crd*yaml; do kubectl apply --context=$CTX_LOCAL -f $i; done $ kubectl create --context=$CTX_LOCAL -f istio-auth.yaml {{< /text >}} 通过检查 `local` pod 的状态等待其被拉起: {{< text bash >}} $ kubectl get pods --context=$CTX_LOCAL -n istio-system {{< /text >}} ### 设置 remote 集群 1. 导出 `local` gateway 地址: {{< text bash >}} $ export LOCAL_GW_ADDR=$(kubectl get --context=$CTX_LOCAL svc --selector=app=istio-ingressgateway \ -n istio-system -o jsonpath="{.items[0].status.loadBalancer.ingress[0].ip}") {{< /text >}} 此命令将值设置为 gateway 的公共 IP,但请注意,您也可以将其设置为一个 DNS 名称(如果有)。 1. 使用 Helm 创建 Istio `remote` deployment YAML: {{< text bash >}} $ helm template install/kubernetes/helm/istio-remote \ --name istio-remote \ --namespace=istio-system \ --set global.mtls.enabled=true \ --set global.enableTracing=false \ --set gateways.enabled=true \ --set gateways.istio-egressgateway.enabled=false \ --set gateways.istio-ingressgateway.enabled=true \ --set security.selfSigned=false \ --set global.controlPlaneSecurityEnabled=true \ --set global.createRemoteSvcEndpoints=true \ --set global.remotePilotCreateSvcEndpoint=true \ --set global.remotePilotAddress=${LOCAL_GW_ADDR} \ --set global.disablePolicyChecks=true \ --set global.policyCheckFailOpen=true \ --set gateways.istio-ingressgateway.env.ISTIO_META_NETWORK="network2" \ --set global.network="network2" > istio-remote-auth.yaml {{< /text >}} 1. 部署 Istio 到 `remote` 集群: {{< text bash >}} $ kubectl create --context=$CTX_REMOTE ns istio-system $ kubectl create --context=$CTX_REMOTE secret generic cacerts -n istio-system --from-file=samples/certs/ca-cert.pem --from-file=samples/certs/ca-key.pem --from-file=samples/certs/root-cert.pem --from-file=samples/certs/cert-chain.pem $ kubectl create --context=$CTX_REMOTE -f istio-remote-auth.yaml {{< /text >}} 通过检查 `remote` pod 的状态等待其被拉起: {{< text bash >}} $ kubectl get pods --context=$CTX_REMOTE -n istio-system {{< /text >}} 1. 更新网格网络配置中的 gateway 地址: * 确定 `remote` 网关地址: {{< text bash >}} $ kubectl get --context=$CTX_REMOTE svc --selector=app=istio-ingressgateway -n istio-system -o jsonpath="{.items[0].status.loadBalancer.ingress[0].ip}" 169.61.102.93 {{< /text >}} * 编辑 istio configmap: {{< text bash >}} $ kubectl edit cm -n istio-system --context=$CTX_LOCAL istio {{< /text >}} * 将 `network2` 的 gateway address 从 `0.0.0.0` 修改为 `remote` gateway 地址,保存并退出。 一旦保存,Pilot 将自动读取并更新网络配置。 1. 准备环境变量以构建 service account `istio-multi` 的 `remote_kubecfg` 文件: {{< text bash >}} $ CLUSTER_NAME=$(kubectl --context=$CTX_REMOTE config view --minify=true -o "jsonpath={.clusters[].name}") $ SERVER=$(kubectl --context=$CTX_REMOTE config view --minify=true -o "jsonpath={.clusters[].cluster.server}") $ SECRET_NAME=$(kubectl --context=$CTX_REMOTE get sa istio-multi -n istio-system -o jsonpath='{.secrets[].name}') $ CA_DATA=$(kubectl get --context=$CTX_REMOTE secret ${SECRET_NAME} -n istio-system -o "jsonpath={.data['ca\.crt']}") $ TOKEN=$(kubectl get --context=$CTX_REMOTE secret ${SECRET_NAME} -n istio-system -o "jsonpath={.data['token']}" | base64 --decode) {{< /text >}} {{< idea >}} 许多系统上使用 `openssl enc -d -base64 -A` 替代 `base64 --decode`。 {{< /idea >}} 1. 在工作目录创建 `remote_kubecfg` 文件: {{< text bash >}} $ cat <<EOF > remote_kubecfg apiVersion: v1 clusters: - cluster: certificate-authority-data: ${CA_DATA} server: ${SERVER} name: ${CLUSTER_NAME} contexts: - context: cluster: ${CLUSTER_NAME} user: ${CLUSTER_NAME} name: ${CLUSTER_NAME} current-context: ${CLUSTER_NAME} kind: Config preferences: {} users: - name: ${CLUSTER_NAME} user: token: ${TOKEN} EOF {{< /text >}} ### 开始监听 remote 集群 执行下列命令,添加并标记 `remote` Kubernetes 的 secret。执行这些命令之后,local Istio Pilot 将开始监听 `remote` 集群的 service 和 instance,就像在 `local` 集群中一样。 {{< text bash >}} $ kubectl create --context=$CTX_LOCAL secret generic iks --from-file remote_kubecfg -n istio-system $ kubectl label --context=$CTX_LOCAL secret iks istio/multiCluster=true -n istio-system {{< /text >}} 现在您已经设置了 `local` 和 `remote` 集群,可以开始部署示例 service。 ## 示例 service 在这个实例中,您将了解到一个 service 的流量是如何被分发到 local endpoint 和 remote gateway。如上图所示,您将为 `helloworld` service 部署两个实例,一个在 `local` 集群,另一个在 `remote` 集群。两个实例的区别在于其 `helloworld` 镜像的版本。 ### 在 remote 集群部署 helloworld v2 1. 使用 sidecar 自动注入标签创建一个 `sample` namespace: {{< text bash >}} $ kubectl create --context=$CTX_REMOTE ns sample $ kubectl label --context=$CTX_REMOTE namespace sample istio-injection=enabled {{< /text >}} 1. 使用以下内容创建 `helloworld-v2.yaml` 文件: {{< text yaml >}} apiVersion: v1 kind: Service metadata: name: helloworld labels: app: helloworld spec: ports: - port: 5000 name: http selector: app: helloworld --- apiVersion: extensions/v1beta1 kind: Deployment metadata: name: helloworld-v2 spec: replicas: 1 template: metadata: labels: app: helloworld version: v2 spec: containers: - name: helloworld image: istio/examples-helloworld-v2 imagePullPolicy: IfNotPresent ports: - containerPort: 5000 {{< /text >}} 1. 部署此文件: {{< text bash >}} $ kubectl create --context=$CTX_REMOTE -f helloworld-v2.yaml -n sample {{< /text >}} ### 在 local 集群部署 helloworld v1 1. 使用 sidecar 自动注入标签创建一个 `sample` namespace: {{< text bash >}} $ kubectl create --context=$CTX_LOCAL ns sample $ kubectl label --context=$CTX_LOCAL namespace sample istio-injection=enabled {{< /text >}} 1. 使用以下内容创建 `helloworld-v1.yaml` 文件: {{< text yaml >}} apiVersion: v1 kind: Service metadata: name: helloworld labels: app: helloworld spec: ports: - port: 5000 name: http selector: app: helloworld --- apiVersion: extensions/v1beta1 kind: Deployment metadata: name: helloworld-v1 spec: replicas: 1 template: metadata: labels: app: helloworld version: v1 spec: containers: - name: helloworld image: istio/examples-helloworld-v1 imagePullPolicy: IfNotPresent ports: - containerPort: 5000 {{< /text >}} 1. 使用下列内容创建 `helloworld-gateway.yaml` 文件: {{< text yaml >}} apiVersion: networking.istio.io/v1alpha3 kind: Gateway metadata: name: helloworld-gateway namespace: sample spec: selector: istio: ingressgateway servers: - port: number: 443 name: tls protocol: TLS tls: mode: AUTO_PASSTHROUGH hosts: - "*" {{< /text >}} 虽然是本地部署,这个 Gateway 实例仍然会影响 `remote` 集群,方法是将其配置为允许相关 remote service(基于 SNI)通过,但保持从源到目标 sidecar 的双向 TLS。 1. 部署此文件: {{< text bash >}} $ kubectl create --context=$CTX_LOCAL -f helloworld-v1.yaml -n sample $ kubectl create --context=$CTX_LOCAL -f helloworld-gateway.yaml -n sample {{< /text >}} ### 横向分割 EDS 实战 我们将从另一个集群中 `sleep` service 请求 `helloworld.sample` service。 1. 部署 `sleep` service: {{< text bash >}} $ kubectl create --context=$CTX_LOCAL -f @samples/sleep/sleep.yaml@ -n sample {{< /text >}} 1. 多次请求 `helloworld.sample` service: {{< text bash >}} $ kubectl exec --context=$CTX_LOCAL -it -n sample $(kubectl get pod --context=$CTX_LOCAL -n sample -l app=sleep -o jsonpath={.items[0].metadata.name}) -- curl helloworld.sample:5000/hello {{< /text >}} 如果设置正确,到 `helloworld.sample` service 的流量将在 local 和 remote 实例之间进行分发,导致响应 body 中 `v1` 或 `v2` 都可能出现。 {{< text bash >}} $ kubectl exec --context=$CTX_LOCAL -it -n sample $(kubectl get pod --context=$CTX_LOCAL -n sample -l app=sleep -o jsonpath={.items[0].metadata.name}) -- curl helloworld.sample:5000/hello Defaulting container name to sleep. Use 'kubectl describe pod/sleep-57f9d6fd6b-q4k4h -n sample' to see all of the containers in this pod. Hello version: v2, instance: helloworld-v2-758dd55874-6x4t8 {{< /text >}} {{< text bash >}} $ kubectl exec --context=$CTX_LOCAL -it -n sample $(kubectl get pod --context=$CTX_LOCAL -n sample -l app=sleep -o jsonpath={.items[0].metadata.name}) -- curl helloworld.sample:5000/hello Defaulting container name to sleep. Use 'kubectl describe pod/sleep-57f9d6fd6b-q4k4h -n sample' to see all of the containers in this pod. Hello version: v1, instance: helloworld-v1-86f77cd7bd-cpxhv {{< /text >}} 您可以通过打印 sleep pod 的 `istio-proxy` 容器日志来验证访问的 endpoint 的 IP 地址。 {{< text bash >}} $ kubectl logs --context=$CTX_LOCAL -n sample $(kubectl get pod --context=$CTX_LOCAL -n sample -l app=sleep -o jsonpath={.items[0].metadata.name}) istio-proxy [2018-11-25T12:37:52.077Z] "GET /hello HTTP/1.1" 200 - 0 60 190 189 "-" "curl/7.60.0" "6e096efe-f550-4dfa-8c8c-ba164baf4679" "helloworld.sample:5000" "192.23.120.32:443" outbound|5000||helloworld.sample.svc.cluster.local - 10.20.194.146:5000 10.10.0.89:59496 - [2018-11-25T12:38:06.745Z] "GET /hello HTTP/1.1" 200 - 0 60 171 170 "-" "curl/7.60.0" "6f93c9cc-d32a-4878-b56a-086a740045d2" "helloworld.sample:5000" "10.10.0.90:5000" outbound|5000||helloworld.sample.svc.cluster.local - 10.20.194.146:5000 10.10.0.89:59646 - {{< /text >}} v2 被调用时将记录 remote gateway IP `192.23.120.32:443`,v1 被调用时将记录 local 实例 IP `10.10.0.90:5000`。 ## 清理 执行下列命令清理 demo service __和__ Istio 组件。 清理 `remote` 集群: {{< text bash >}} $ kubectl delete --context=$CTX_REMOTE -f istio-remote-auth.yaml $ kubectl delete --context=$CTX_REMOTE ns istio-system $ kubectl delete --context=$CTX_REMOTE -f helloworld-v2.yaml -n sample $ kubectl delete --context=$CTX_REMOTE ns sample {{< /text >}} 清理 `local` 集群: {{< text bash >}} $ kubectl delete --context=$CTX_LOCAL -f istio-auth.yaml $ kubectl delete --context=$CTX_LOCAL ns istio-system $ helm delete --purge --kube-context=$CTX_LOCAL istio-init $ kubectl delete --context=$CTX_LOCAL -f helloworld-v1.yaml -n sample $ kubectl delete --context=$CTX_LOCAL -f @samples/sleep/sleep.yaml@ -n sample $ kubectl delete --context=$CTX_LOCAL ns sample {{< /text >}}
Java
# Copyright 2014 Mirantis Inc. # 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. import collections import copy import datetime import re import mock import six from osprofiler import profiler from osprofiler.tests import test class ProfilerGlobMethodsTestCase(test.TestCase): def test_get_profiler_not_inited(self): profiler.clean() self.assertIsNone(profiler.get()) def test_get_profiler_and_init(self): p = profiler.init("secret", base_id="1", parent_id="2") self.assertEqual(profiler.get(), p) self.assertEqual(p.get_base_id(), "1") # NOTE(boris-42): until we make first start we don't have self.assertEqual(p.get_id(), "2") def test_start_not_inited(self): profiler.clean() profiler.start("name") def test_start(self): p = profiler.init("secret", base_id="1", parent_id="2") p.start = mock.MagicMock() profiler.start("name", info="info") p.start.assert_called_once_with("name", info="info") def test_stop_not_inited(self): profiler.clean() profiler.stop() def test_stop(self): p = profiler.init("secret", base_id="1", parent_id="2") p.stop = mock.MagicMock() profiler.stop(info="info") p.stop.assert_called_once_with(info="info") class ProfilerTestCase(test.TestCase): def test_profiler_get_shorten_id(self): uuid_id = "4e3e0ec6-2938-40b1-8504-09eb1d4b0dee" prof = profiler._Profiler("secret", base_id="1", parent_id="2") result = prof.get_shorten_id(uuid_id) expected = "850409eb1d4b0dee" self.assertEqual(expected, result) def test_profiler_get_shorten_id_int(self): short_id_int = 42 prof = profiler._Profiler("secret", base_id="1", parent_id="2") result = prof.get_shorten_id(short_id_int) expected = "2a" self.assertEqual(expected, result) def test_profiler_get_base_id(self): prof = profiler._Profiler("secret", base_id="1", parent_id="2") self.assertEqual(prof.get_base_id(), "1") @mock.patch("osprofiler.profiler.uuidutils.generate_uuid") def test_profiler_get_parent_id(self, mock_generate_uuid): mock_generate_uuid.return_value = "42" prof = profiler._Profiler("secret", base_id="1", parent_id="2") prof.start("test") self.assertEqual(prof.get_parent_id(), "2") @mock.patch("osprofiler.profiler.uuidutils.generate_uuid") def test_profiler_get_base_id_unset_case(self, mock_generate_uuid): mock_generate_uuid.return_value = "42" prof = profiler._Profiler("secret") self.assertEqual(prof.get_base_id(), "42") self.assertEqual(prof.get_parent_id(), "42") @mock.patch("osprofiler.profiler.uuidutils.generate_uuid") def test_profiler_get_id(self, mock_generate_uuid): mock_generate_uuid.return_value = "43" prof = profiler._Profiler("secret") prof.start("test") self.assertEqual(prof.get_id(), "43") @mock.patch("osprofiler.profiler.datetime") @mock.patch("osprofiler.profiler.uuidutils.generate_uuid") @mock.patch("osprofiler.profiler.notifier.notify") def test_profiler_start(self, mock_notify, mock_generate_uuid, mock_datetime): mock_generate_uuid.return_value = "44" now = datetime.datetime.utcnow() mock_datetime.datetime.utcnow.return_value = now info = {"some": "info"} payload = { "name": "test-start", "base_id": "1", "parent_id": "2", "trace_id": "44", "info": info, "timestamp": now.strftime("%Y-%m-%dT%H:%M:%S.%f"), } prof = profiler._Profiler("secret", base_id="1", parent_id="2") prof.start("test", info=info) mock_notify.assert_called_once_with(payload) @mock.patch("osprofiler.profiler.datetime") @mock.patch("osprofiler.profiler.notifier.notify") def test_profiler_stop(self, mock_notify, mock_datetime): now = datetime.datetime.utcnow() mock_datetime.datetime.utcnow.return_value = now prof = profiler._Profiler("secret", base_id="1", parent_id="2") prof._trace_stack.append("44") prof._name.append("abc") info = {"some": "info"} prof.stop(info=info) payload = { "name": "abc-stop", "base_id": "1", "parent_id": "2", "trace_id": "44", "info": info, "timestamp": now.strftime("%Y-%m-%dT%H:%M:%S.%f"), } mock_notify.assert_called_once_with(payload) self.assertEqual(len(prof._name), 0) self.assertEqual(prof._trace_stack, collections.deque(["1", "2"])) def test_profiler_hmac(self): hmac = "secret" prof = profiler._Profiler(hmac, base_id="1", parent_id="2") self.assertEqual(hmac, prof.hmac_key) class WithTraceTestCase(test.TestCase): @mock.patch("osprofiler.profiler.stop") @mock.patch("osprofiler.profiler.start") def test_with_trace(self, mock_start, mock_stop): with profiler.Trace("a", info="a1"): mock_start.assert_called_once_with("a", info="a1") mock_start.reset_mock() with profiler.Trace("b", info="b1"): mock_start.assert_called_once_with("b", info="b1") mock_stop.assert_called_once_with() mock_stop.reset_mock() mock_stop.assert_called_once_with() @mock.patch("osprofiler.profiler.stop") @mock.patch("osprofiler.profiler.start") def test_with_trace_etype(self, mock_start, mock_stop): def foo(): with profiler.Trace("foo"): raise ValueError("bar") self.assertRaises(ValueError, foo) mock_start.assert_called_once_with("foo", info=None) mock_stop.assert_called_once_with(info={ "etype": "ValueError", "message": "bar" }) @profiler.trace("function", info={"info": "some_info"}) def traced_func(i): return i @profiler.trace("hide_args", hide_args=True) def trace_hide_args_func(a, i=10): return (a, i) @profiler.trace("foo", hide_args=True) def test_fn_exc(): raise ValueError() @profiler.trace("hide_result", hide_result=False) def trace_with_result_func(a, i=10): return (a, i) class TraceDecoratorTestCase(test.TestCase): @mock.patch("osprofiler.profiler.stop") @mock.patch("osprofiler.profiler.start") def test_duplicate_trace_disallow(self, mock_start, mock_stop): @profiler.trace("test") def trace_me(): pass self.assertRaises( ValueError, profiler.trace("test-again", allow_multiple_trace=False), trace_me) @mock.patch("osprofiler.profiler.stop") @mock.patch("osprofiler.profiler.start") def test_with_args(self, mock_start, mock_stop): self.assertEqual(1, traced_func(1)) expected_info = { "info": "some_info", "function": { "name": "osprofiler.tests.unit.test_profiler.traced_func", "args": str((1,)), "kwargs": str({}) } } mock_start.assert_called_once_with("function", info=expected_info) mock_stop.assert_called_once_with() @mock.patch("osprofiler.profiler.stop") @mock.patch("osprofiler.profiler.start") def test_without_args(self, mock_start, mock_stop): self.assertEqual((1, 2), trace_hide_args_func(1, i=2)) expected_info = { "function": { "name": "osprofiler.tests.unit.test_profiler" ".trace_hide_args_func" } } mock_start.assert_called_once_with("hide_args", info=expected_info) mock_stop.assert_called_once_with() @mock.patch("osprofiler.profiler.stop") @mock.patch("osprofiler.profiler.start") def test_with_exception(self, mock_start, mock_stop): self.assertRaises(ValueError, test_fn_exc) expected_info = { "function": { "name": "osprofiler.tests.unit.test_profiler.test_fn_exc" } } expected_stop_info = {"etype": "ValueError", "message": ""} mock_start.assert_called_once_with("foo", info=expected_info) mock_stop.assert_called_once_with(info=expected_stop_info) @mock.patch("osprofiler.profiler.stop") @mock.patch("osprofiler.profiler.start") def test_with_result(self, mock_start, mock_stop): self.assertEqual((1, 2), trace_with_result_func(1, i=2)) start_info = { "function": { "name": "osprofiler.tests.unit.test_profiler" ".trace_with_result_func", "args": str((1,)), "kwargs": str({"i": 2}) } } stop_info = { "function": { "result": str((1, 2)) } } mock_start.assert_called_once_with("hide_result", info=start_info) mock_stop.assert_called_once_with(info=stop_info) class FakeTracedCls(object): def method1(self, a, b, c=10): return a + b + c def method2(self, d, e): return d - e def method3(self, g=10, h=20): return g * h def _method(self, i): return i @profiler.trace_cls("rpc", info={"a": 10}) class FakeTraceClassWithInfo(FakeTracedCls): pass @profiler.trace_cls("a", info={"b": 20}, hide_args=True) class FakeTraceClassHideArgs(FakeTracedCls): pass @profiler.trace_cls("rpc", trace_private=True) class FakeTracePrivate(FakeTracedCls): pass class FakeTraceStaticMethodBase(FakeTracedCls): @staticmethod def static_method(arg): return arg @profiler.trace_cls("rpc", trace_static_methods=True) class FakeTraceStaticMethod(FakeTraceStaticMethodBase): pass @profiler.trace_cls("rpc") class FakeTraceStaticMethodSkip(FakeTraceStaticMethodBase): pass class FakeTraceClassMethodBase(FakeTracedCls): @classmethod def class_method(cls, arg): return arg @profiler.trace_cls("rpc") class FakeTraceClassMethodSkip(FakeTraceClassMethodBase): pass def py3_info(info): # NOTE(boris-42): py33 I hate you. info_py3 = copy.deepcopy(info) new_name = re.sub("FakeTrace[^.]*", "FakeTracedCls", info_py3["function"]["name"]) info_py3["function"]["name"] = new_name return info_py3 def possible_mock_calls(name, info): # NOTE(boris-42): py33 I hate you. return [mock.call(name, info=info), mock.call(name, info=py3_info(info))] class TraceClsDecoratorTestCase(test.TestCase): @mock.patch("osprofiler.profiler.stop") @mock.patch("osprofiler.profiler.start") def test_args(self, mock_start, mock_stop): fake_cls = FakeTraceClassWithInfo() self.assertEqual(30, fake_cls.method1(5, 15)) expected_info = { "a": 10, "function": { "name": ("osprofiler.tests.unit.test_profiler" ".FakeTraceClassWithInfo.method1"), "args": str((fake_cls, 5, 15)), "kwargs": str({}) } } self.assertEqual(1, len(mock_start.call_args_list)) self.assertIn(mock_start.call_args_list[0], possible_mock_calls("rpc", expected_info)) mock_stop.assert_called_once_with() @mock.patch("osprofiler.profiler.stop") @mock.patch("osprofiler.profiler.start") def test_kwargs(self, mock_start, mock_stop): fake_cls = FakeTraceClassWithInfo() self.assertEqual(50, fake_cls.method3(g=5, h=10)) expected_info = { "a": 10, "function": { "name": ("osprofiler.tests.unit.test_profiler" ".FakeTraceClassWithInfo.method3"), "args": str((fake_cls,)), "kwargs": str({"g": 5, "h": 10}) } } self.assertEqual(1, len(mock_start.call_args_list)) self.assertIn(mock_start.call_args_list[0], possible_mock_calls("rpc", expected_info)) mock_stop.assert_called_once_with() @mock.patch("osprofiler.profiler.stop") @mock.patch("osprofiler.profiler.start") def test_without_private(self, mock_start, mock_stop): fake_cls = FakeTraceClassHideArgs() self.assertEqual(10, fake_cls._method(10)) self.assertFalse(mock_start.called) self.assertFalse(mock_stop.called) @mock.patch("osprofiler.profiler.stop") @mock.patch("osprofiler.profiler.start") def test_without_args(self, mock_start, mock_stop): fake_cls = FakeTraceClassHideArgs() self.assertEqual(40, fake_cls.method1(5, 15, c=20)) expected_info = { "b": 20, "function": { "name": ("osprofiler.tests.unit.test_profiler" ".FakeTraceClassHideArgs.method1"), } } self.assertEqual(1, len(mock_start.call_args_list)) self.assertIn(mock_start.call_args_list[0], possible_mock_calls("a", expected_info)) mock_stop.assert_called_once_with() @mock.patch("osprofiler.profiler.stop") @mock.patch("osprofiler.profiler.start") def test_private_methods(self, mock_start, mock_stop): fake_cls = FakeTracePrivate() self.assertEqual(5, fake_cls._method(5)) expected_info = { "function": { "name": ("osprofiler.tests.unit.test_profiler" ".FakeTracePrivate._method"), "args": str((fake_cls, 5)), "kwargs": str({}) } } self.assertEqual(1, len(mock_start.call_args_list)) self.assertIn(mock_start.call_args_list[0], possible_mock_calls("rpc", expected_info)) mock_stop.assert_called_once_with() @mock.patch("osprofiler.profiler.stop") @mock.patch("osprofiler.profiler.start") @test.testcase.skip( "Static method tracing was disabled due the bug. This test should be " "skipped until we find the way to address it.") def test_static(self, mock_start, mock_stop): fake_cls = FakeTraceStaticMethod() self.assertEqual(25, fake_cls.static_method(25)) expected_info = { "function": { # fixme(boris-42): Static methods are treated differently in # Python 2.x and Python 3.x. So in PY2 we # expect to see method4 because method is # static and doesn't have reference to class # - and FakeTraceStatic.method4 in PY3 "name": "osprofiler.tests.unit.test_profiler" ".method4" if six.PY2 else "osprofiler.tests.unit.test_profiler.FakeTraceStatic" ".method4", "args": str((25,)), "kwargs": str({}) } } self.assertEqual(1, len(mock_start.call_args_list)) self.assertIn(mock_start.call_args_list[0], possible_mock_calls("rpc", expected_info)) mock_stop.assert_called_once_with() @mock.patch("osprofiler.profiler.stop") @mock.patch("osprofiler.profiler.start") def test_static_method_skip(self, mock_start, mock_stop): self.assertEqual(25, FakeTraceStaticMethodSkip.static_method(25)) self.assertFalse(mock_start.called) self.assertFalse(mock_stop.called) @mock.patch("osprofiler.profiler.stop") @mock.patch("osprofiler.profiler.start") def test_class_method_skip(self, mock_start, mock_stop): self.assertEqual("foo", FakeTraceClassMethodSkip.class_method("foo")) self.assertFalse(mock_start.called) self.assertFalse(mock_stop.called) @six.add_metaclass(profiler.TracedMeta) class FakeTraceWithMetaclassBase(object): __trace_args__ = {"name": "rpc", "info": {"a": 10}} def method1(self, a, b, c=10): return a + b + c def method2(self, d, e): return d - e def method3(self, g=10, h=20): return g * h def _method(self, i): return i class FakeTraceDummy(FakeTraceWithMetaclassBase): def method4(self, j): return j class FakeTraceWithMetaclassHideArgs(FakeTraceWithMetaclassBase): __trace_args__ = {"name": "a", "info": {"b": 20}, "hide_args": True} def method5(self, k, l): return k + l class FakeTraceWithMetaclassPrivate(FakeTraceWithMetaclassBase): __trace_args__ = {"name": "rpc", "trace_private": True} def _new_private_method(self, m): return 2 * m class TraceWithMetaclassTestCase(test.TestCase): def test_no_name_exception(self): def define_class_with_no_name(): @six.add_metaclass(profiler.TracedMeta) class FakeTraceWithMetaclassNoName(FakeTracedCls): pass self.assertRaises(TypeError, define_class_with_no_name, 1) @mock.patch("osprofiler.profiler.stop") @mock.patch("osprofiler.profiler.start") def test_args(self, mock_start, mock_stop): fake_cls = FakeTraceWithMetaclassBase() self.assertEqual(30, fake_cls.method1(5, 15)) expected_info = { "a": 10, "function": { "name": ("osprofiler.tests.unit.test_profiler" ".FakeTraceWithMetaclassBase.method1"), "args": str((fake_cls, 5, 15)), "kwargs": str({}) } } self.assertEqual(1, len(mock_start.call_args_list)) self.assertIn(mock_start.call_args_list[0], possible_mock_calls("rpc", expected_info)) mock_stop.assert_called_once_with() @mock.patch("osprofiler.profiler.stop") @mock.patch("osprofiler.profiler.start") def test_kwargs(self, mock_start, mock_stop): fake_cls = FakeTraceWithMetaclassBase() self.assertEqual(50, fake_cls.method3(g=5, h=10)) expected_info = { "a": 10, "function": { "name": ("osprofiler.tests.unit.test_profiler" ".FakeTraceWithMetaclassBase.method3"), "args": str((fake_cls,)), "kwargs": str({"g": 5, "h": 10}) } } self.assertEqual(1, len(mock_start.call_args_list)) self.assertIn(mock_start.call_args_list[0], possible_mock_calls("rpc", expected_info)) mock_stop.assert_called_once_with() @mock.patch("osprofiler.profiler.stop") @mock.patch("osprofiler.profiler.start") def test_without_private(self, mock_start, mock_stop): fake_cls = FakeTraceWithMetaclassHideArgs() self.assertEqual(10, fake_cls._method(10)) self.assertFalse(mock_start.called) self.assertFalse(mock_stop.called) @mock.patch("osprofiler.profiler.stop") @mock.patch("osprofiler.profiler.start") def test_without_args(self, mock_start, mock_stop): fake_cls = FakeTraceWithMetaclassHideArgs() self.assertEqual(20, fake_cls.method5(5, 15)) expected_info = { "b": 20, "function": { "name": ("osprofiler.tests.unit.test_profiler" ".FakeTraceWithMetaclassHideArgs.method5") } } self.assertEqual(1, len(mock_start.call_args_list)) self.assertIn(mock_start.call_args_list[0], possible_mock_calls("a", expected_info)) mock_stop.assert_called_once_with() @mock.patch("osprofiler.profiler.stop") @mock.patch("osprofiler.profiler.start") def test_private_methods(self, mock_start, mock_stop): fake_cls = FakeTraceWithMetaclassPrivate() self.assertEqual(10, fake_cls._new_private_method(5)) expected_info = { "function": { "name": ("osprofiler.tests.unit.test_profiler" ".FakeTraceWithMetaclassPrivate._new_private_method"), "args": str((fake_cls, 5)), "kwargs": str({}) } } self.assertEqual(1, len(mock_start.call_args_list)) self.assertIn(mock_start.call_args_list[0], possible_mock_calls("rpc", expected_info)) mock_stop.assert_called_once_with()
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="ja"> <head> <!-- Generated by javadoc (1.8.0_242) on Fri Aug 21 11:53:10 JST 2020 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>クラス jp.cafebabe.pochi.core.config.Valueの使用 (pochi: extensible birthmark toolkit 1.0.0 API)</title> <meta name="date" content="2020-08-21"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="\u30AF\u30E9\u30B9 jp.cafebabe.pochi.core.config.Value\u306E\u4F7F\u7528 (pochi: extensible birthmark toolkit 1.0.0 API)"; } } catch(err) { } //--> </script> <noscript> <div>ブラウザのJavaScriptが無効になっています。</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="ナビゲーション・リンクをスキップ">ナビゲーション・リンクをスキップ</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="ナビゲーション"> <li><a href="../../../../../../overview-summary.html">概要</a></li> <li><a href="../package-summary.html">パッケージ</a></li> <li><a href="../../../../../../jp/cafebabe/pochi/birthmarks/config/Value.html" title="jp.cafebabe.pochi.core.config内のクラス">クラス</a></li> <li class="navBarCell1Rev">使用</li> <li><a href="../package-tree.html">階層ツリー</a></li> <li><a href="../../../../../../deprecated-list.html">非推奨</a></li> <li><a href="../../../../../../index-all.html">索引</a></li> <li><a href="../../../../../../help-doc.html">ヘルプ</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>前</li> <li>次</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?jp/cafebabe/pochi/birthmarks/config/class-use/Value.html" target="_top">フレーム</a></li> <li><a href="Value.html" target="_top">フレームなし</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">すべてのクラス</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="クラスの使用 jp.cafebabe.pochi.core.config.Value" class="title">クラスの使用<br>jp.cafebabe.pochi.birthmarks.config.Value</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="表、パッケージのリストおよび説明の使用"> <caption><span><a href="../../../../../../jp/cafebabe/pochi/birthmarks/config/Value.html" title="jp.cafebabe.pochi.core.config内のクラス">Value</a>を使用しているパッケージ</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">パッケージ</th> <th class="colLast" scope="col">説明</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#jp.cafebabe.pochi.core.config">jp.cafebabe.pochi.core.config</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="jp.cafebabe.pochi.core.config"> <!-- --> </a> <h3><a href="../../../../../../jp/cafebabe/pochi/birthmarks/config/package-summary.html">jp.cafebabe.pochi.core.config</a>での<a href="../../../../../../jp/cafebabe/pochi/birthmarks/config/Value.html" title="jp.cafebabe.pochi.core.config内のクラス">Value</a>の使用</h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="表、サブクラスのリストおよび説明の使用"> <caption><span><a href="../../../../../../jp/cafebabe/pochi/birthmarks/config/package-summary.html">jp.cafebabe.pochi.core.config</a>での<a href="../../../../../../jp/cafebabe/pochi/birthmarks/config/Value.html" title="jp.cafebabe.pochi.core.config内のクラス">Value</a>のサブクラス</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">修飾子とタイプ</th> <th class="colLast" scope="col">クラスと説明</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../jp/cafebabe/pochi/birthmarks/config/ItemKey.html" title="jp.cafebabe.pochi.core.config内のクラス">ItemKey</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../jp/cafebabe/pochi/birthmarks/config/ItemValue.html" title="jp.cafebabe.pochi.core.config内のクラス">ItemValue</a></span></code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="ナビゲーション・リンクをスキップ">ナビゲーション・リンクをスキップ</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="ナビゲーション"> <li><a href="../../../../../../overview-summary.html">概要</a></li> <li><a href="../package-summary.html">パッケージ</a></li> <li><a href="../../../../../../jp/cafebabe/pochi/birthmarks/config/Value.html" title="jp.cafebabe.pochi.core.config内のクラス">クラス</a></li> <li class="navBarCell1Rev">使用</li> <li><a href="../package-tree.html">階層ツリー</a></li> <li><a href="../../../../../../deprecated-list.html">非推奨</a></li> <li><a href="../../../../../../index-all.html">索引</a></li> <li><a href="../../../../../../help-doc.html">ヘルプ</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>前</li> <li>次</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?jp/cafebabe/pochi/birthmarks/config/class-use/Value.html" target="_top">フレーム</a></li> <li><a href="Value.html" target="_top">フレームなし</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">すべてのクラス</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2020. All rights reserved.</small></p> </body> </html>
Java
package blended.itestsupport.condition import akka.testkit.{TestActorRef, TestProbe} import blended.itestsupport.condition.ConditionActor.CheckCondition import blended.itestsupport.condition.ConditionActor.ConditionCheckResult import org.scalatest.matchers.should.Matchers import org.scalatest.wordspec.AnyWordSpec import akka.actor.ActorSystem class ParallelCheckerSpec extends AnyWordSpec with Matchers { private implicit val system : ActorSystem = ActorSystem("ParallelChecker") "The Condition Checker" should { "respond with a satisfied message on an empty list of conditions" in { val probe = TestProbe() val checker = TestActorRef(ConditionActor.props(ParallelComposedCondition())) checker.tell(CheckCondition, probe.ref) probe.expectMsg(ConditionCheckResult(List.empty[Condition], List.empty[Condition])) } "respond with a satisfied message after a single wrapped condition has been satisfied" in { val probe = TestProbe() val conditions = (1 to 1).map { i => new AlwaysTrue() }.toList val condition = ParallelComposedCondition(conditions.toSeq:_*) val checker = TestActorRef(ConditionActor.props(condition)) checker.tell(CheckCondition, probe.ref) probe.expectMsg(ConditionCheckResult(conditions, List.empty[Condition])) } "respond with a satisfied message after some wrapped conditions have been satisfied" in { val probe = TestProbe() val conditions = (1 to 5).map { i => new AlwaysTrue() }.toList val condition = ParallelComposedCondition(conditions.toSeq:_*) val checker = TestActorRef(ConditionActor.props(condition)) checker.tell(CheckCondition, probe.ref) probe.expectMsg(ConditionCheckResult(conditions, List.empty[Condition])) } "respond with a timeout message after a single wrapped condition has timed out" in { val probe = TestProbe() val conditions = (1 to 1).map { i => new NeverTrue() }.toList val condition = ParallelComposedCondition(conditions.toSeq:_*) val checker = TestActorRef(ConditionActor.props(condition)) checker.tell(CheckCondition, probe.ref) probe.expectMsg(ConditionCheckResult(List.empty[Condition], conditions)) } "respond with a timeout message containing the timed out conditions only" in { val probe = TestProbe() val conditions = List( new AlwaysTrue(), new AlwaysTrue(), new NeverTrue(), new AlwaysTrue(), new AlwaysTrue() ) val condition = ParallelComposedCondition(conditions.toSeq:_*) val checker = TestActorRef(ConditionActor.props(condition)) checker.tell(CheckCondition, probe.ref) probe.expectMsg(ConditionCheckResult( conditions.filter(_.isInstanceOf[AlwaysTrue]), conditions.filter(_.isInstanceOf[NeverTrue]) )) } } }
Java
<?php namespace CultuurNet\UDB3\EventSourcing\DBAL; class NonCompatibleUuid { /** * @var string */ private $uuid; /** * DummyUuid constructor. * @param string $uuid */ public function __construct($uuid) { $this->uuid = $uuid; } }
Java
// JavaScript Document var flag1=true; var flag2=true; $(function () { /*********************/ $.ajax({ type : 'POST', dataType : 'json', url : 'baseNeiName.do', async : true, cache : false, error : function(request) { bootbox.alert({ message : "请求异常", size : 'small' }); }, success : function(data) { var i = 0; for ( var item in data) { $("#baselistid").after( "<option value="+data[i].id+">" + data[i].name + "</option>"); i++; } } }); /**************************/ /*########*/ $(document).on("click", "#Submit", function() { var projectname=$("#projectname").val(); var name=$("#name").val(); var address=$("#address").val(); var budget=$("#budget").val(); budget=budget.trim(); var baselist=$("#baselist").val(); var reason=$("#reason").val(); var strmoney=/^[0-9]*$/.test(budget); var money=budget.substring(1,0); if(projectname==""){ bootbox.alert({ message : "请填写项目名称", size : 'small' }); return 0; } else if(name==""){ bootbox.alert({ message : "请填写报修人", size : 'small' }); return 0; } else if(address==""){ bootbox.alert({ message : "请填写具体位置", size : 'small' }); return 0; } else if(budget==""){ bootbox.alert({ message : "请填写预算金额", size : 'small' }); return 0; } else if(strmoney==false){ bootbox.alert({ message : "预算金额只能为数字", size : 'small' }); return 0; } else if(budget.length>1&&money==0){ bootbox.alert({ message : "请填写正确的预算金额格式,第一个数字不能为零", size : 'small' }); return 0; } else if(baselist=="请选择"){ bootbox.alert({ message : "请选择基地", size : 'small' }); return 0; } else if(reason==""){ bootbox.alert({ message : "请填写原因", size : 'small' }); return 0; } if (!flag1) { bootbox.alert({ message: "上传资料仅限于rar,zip压缩包格式", size: 'small' }); $("#applyfile").val(''); return; } if (!flag2) { bootbox.alert({ message: "上传资料大小不能大于10M", size: 'small' }); $("#applyfile").val(''); return; } /*************/ $("#applyform").submit(); /*************/ }) $('#applyfile').change(function() { var filepath = $(this).val(); var file_size = this.files[0].size; var size = file_size / 1024; var extStart = filepath.lastIndexOf("."); var ext = filepath.substring(extStart, filepath.length).toUpperCase(); if (ext != ".RAR" && ext != ".ZIP") { bootbox.alert({ message: "上传资料仅限于rar,zip压缩包格式", size: 'small' }); $("#applyfile").val(''); flag1=false; return; } if (size > 1024 * 10) { bootbox.alert({ message: "上传资料大小不能大于10M", size: 'small' }); $("#applyfile").val(''); flag2=false; return; } flag1=true; flag2=true; }); /*########*/ });
Java
<!DOCTYPE html > <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <title>Spark NLP 3.4.2 ScalaDoc - com.johnsnowlabs.ml.tensorflow.sign.ModelSignatureConstants.AttentionMask</title> <meta name="description" content="Spark NLP 3.4.2 ScalaDoc - com.johnsnowlabs.ml.tensorflow.sign.ModelSignatureConstants.AttentionMask" /> <meta name="keywords" content="Spark NLP 3.4.2 ScalaDoc com.johnsnowlabs.ml.tensorflow.sign.ModelSignatureConstants.AttentionMask" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <link href="../../../../../lib/index.css" media="screen" type="text/css" rel="stylesheet" /> <link href="../../../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" /> <link href="../../../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" /> <script type="text/javascript" src="../../../../../lib/jquery.min.js"></script> <script type="text/javascript" src="../../../../../lib/jquery.panzoom.min.js"></script> <script type="text/javascript" src="../../../../../lib/jquery.mousewheel.min.js"></script> <script type="text/javascript" src="../../../../../lib/index.js"></script> <script type="text/javascript" src="../../../../../index.js"></script> <script type="text/javascript" src="../../../../../lib/scheduler.js"></script> <script type="text/javascript" src="../../../../../lib/template.js"></script> <script type="text/javascript"> /* this variable can be used by the JS to determine the path to the root document */ var toRoot = '../../../../../'; </script> </head> <body> <div id="search"> <span id="doc-title">Spark NLP 3.4.2 ScalaDoc<span id="doc-version"></span></span> <span class="close-results"><span class="left">&lt;</span> Back</span> <div id="textfilter"> <span class="input"> <input autocapitalize="none" placeholder="Search" id="index-input" type="text" accesskey="/" /> <i class="clear material-icons"></i> <i id="search-icon" class="material-icons"></i> </span> </div> </div> <div id="search-results"> <div id="search-progress"> <div id="progress-fill"></div> </div> <div id="results-content"> <div id="entity-results"></div> <div id="member-results"></div> </div> </div> <div id="content-scroll-container" style="-webkit-overflow-scrolling: touch;"> <div id="content-container" style="-webkit-overflow-scrolling: touch;"> <div id="subpackage-spacer"> <div id="packages"> <h1>Packages</h1> <ul> <li name="_root_.root" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="_root_"></a><a id="root:_root_"></a> <span class="permalink"> <a href="../../../../../index.html" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">package</span> </span> <span class="symbol"> <a title="" href="../../../../../index.html"><span class="name">root</span></a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../../../../index.html" class="extype" name="_root_">root</a></dd></dl></div> </li><li name="_root_.com" visbl="pub" class="indented1 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="com"></a><a id="com:com"></a> <span class="permalink"> <a href="../../../../../com/index.html" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">package</span> </span> <span class="symbol"> <a title="" href="../../../../index.html"><span class="name">com</span></a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../../../../index.html" class="extype" name="_root_">root</a></dd></dl></div> </li><li name="com.johnsnowlabs" visbl="pub" class="indented2 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="johnsnowlabs"></a><a id="johnsnowlabs:johnsnowlabs"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/index.html" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">package</span> </span> <span class="symbol"> <a title="" href="../../../index.html"><span class="name">johnsnowlabs</span></a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../../../index.html" class="extype" name="com">com</a></dd></dl></div> </li><li name="com.johnsnowlabs.ml" visbl="pub" class="indented3 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="ml"></a><a id="ml:ml"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/index.html" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">package</span> </span> <span class="symbol"> <a title="" href="../../index.html"><span class="name">ml</span></a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../../index.html" class="extype" name="com.johnsnowlabs">johnsnowlabs</a></dd></dl></div> </li><li name="com.johnsnowlabs.ml.tensorflow" visbl="pub" class="indented4 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="tensorflow"></a><a id="tensorflow:tensorflow"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/tensorflow/index.html" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">package</span> </span> <span class="symbol"> <a title="" href="../index.html"><span class="name">tensorflow</span></a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../index.html" class="extype" name="com.johnsnowlabs.ml">ml</a></dd></dl></div> </li><li name="com.johnsnowlabs.ml.tensorflow.sign" visbl="pub" class="indented5 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="sign"></a><a id="sign:sign"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/index.html" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">package</span> </span> <span class="symbol"> <a title="" href="index.html"><span class="name">sign</span></a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../index.html" class="extype" name="com.johnsnowlabs.ml.tensorflow">tensorflow</a></dd></dl></div> </li><li name="com.johnsnowlabs.ml.tensorflow.sign.ModelSignatureConstants" visbl="pub" class="indented6 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="ModelSignatureConstants"></a><a id="ModelSignatureConstants:ModelSignatureConstants"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/ModelSignatureConstants$.html" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">object</span> </span> <span class="symbol"> <a title="Based on BERT SavedModel reference, for instance:" href="ModelSignatureConstants$.html"><span class="name">ModelSignatureConstants</span></a> </span> <p class="shortcomment cmt">Based on BERT SavedModel reference, for instance:</p><div class="fullcomment"><div class="comment cmt"><p>Based on BERT SavedModel reference, for instance:</p><p>signature_def['serving_default']: The given SavedModel SignatureDef contains the following input(s):</p><p>inputs['attention_mask'] tensor_info: dtype: DT_INT32 shape: (-1, -1) name: serving_default_attention_mask:0</p><p>inputs['input_ids'] tensor_info: dtype: DT_INT32 shape: (-1, -1) name: serving_default_input_ids:0</p><p>inputs['token_type_ids'] tensor_info: dtype: DT_INT32 shape: (-1, -1) name: serving_default_token_type_ids:0</p><p>The given SavedModel SignatureDef contains the following output(s):</p><p>outputs['last_hidden_state'] tensor_info: dtype: DT_FLOAT shape: (-1, -1, 768) name: StatefulPartitionedCall:0</p><p>outputs['pooler_output'] tensor_info: dtype: DT_FLOAT shape: (-1, 768) name: StatefulPartitionedCall:1</p><p>Method name is: tensorflow/serving/predict* </p></div><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="index.html" class="extype" name="com.johnsnowlabs.ml.tensorflow.sign">sign</a></dd></dl></div> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="object" href="" title=""></a> <a href="" title="">AttentionMask</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="object" href="ModelSignatureConstants$$AttentionMaskV1$.html" title=""></a> <a href="ModelSignatureConstants$$AttentionMaskV1$.html" title="">AttentionMaskV1</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="object" href="ModelSignatureConstants$$DType$.html" title=""></a> <a href="ModelSignatureConstants$$DType$.html" title="">DType</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="object" href="ModelSignatureConstants$$DecoderAttentionMask$.html" title=""></a> <a href="ModelSignatureConstants$$DecoderAttentionMask$.html" title="">DecoderAttentionMask</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="object" href="ModelSignatureConstants$$DecoderEncoderInputIds$.html" title=""></a> <a href="ModelSignatureConstants$$DecoderEncoderInputIds$.html" title="">DecoderEncoderInputIds</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="object" href="ModelSignatureConstants$$DecoderInputIds$.html" title=""></a> <a href="ModelSignatureConstants$$DecoderInputIds$.html" title="">DecoderInputIds</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="object" href="ModelSignatureConstants$$DecoderOutput$.html" title=""></a> <a href="ModelSignatureConstants$$DecoderOutput$.html" title="">DecoderOutput</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="object" href="ModelSignatureConstants$$DimCount$.html" title=""></a> <a href="ModelSignatureConstants$$DimCount$.html" title="">DimCount</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="object" href="ModelSignatureConstants$$EncoderAttentionMask$.html" title=""></a> <a href="ModelSignatureConstants$$EncoderAttentionMask$.html" title="">EncoderAttentionMask</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="object" href="ModelSignatureConstants$$EncoderInputIds$.html" title=""></a> <a href="ModelSignatureConstants$$EncoderInputIds$.html" title="">EncoderInputIds</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="object" href="ModelSignatureConstants$$EncoderOutput$.html" title=""></a> <a href="ModelSignatureConstants$$EncoderOutput$.html" title="">EncoderOutput</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="object" href="ModelSignatureConstants$$InputIds$.html" title=""></a> <a href="ModelSignatureConstants$$InputIds$.html" title="">InputIds</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="object" href="ModelSignatureConstants$$InputIdsV1$.html" title=""></a> <a href="ModelSignatureConstants$$InputIdsV1$.html" title="">InputIdsV1</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="object" href="ModelSignatureConstants$$LastHiddenState$.html" title=""></a> <a href="ModelSignatureConstants$$LastHiddenState$.html" title="">LastHiddenState</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="object" href="ModelSignatureConstants$$LastHiddenStateV1$.html" title=""></a> <a href="ModelSignatureConstants$$LastHiddenStateV1$.html" title="">LastHiddenStateV1</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="object" href="ModelSignatureConstants$$LogitsOutput$.html" title=""></a> <a href="ModelSignatureConstants$$LogitsOutput$.html" title="">LogitsOutput</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="object" href="ModelSignatureConstants$$Name$.html" title=""></a> <a href="ModelSignatureConstants$$Name$.html" title="">Name</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="object" href="ModelSignatureConstants$$PoolerOutput$.html" title=""></a> <a href="ModelSignatureConstants$$PoolerOutput$.html" title="">PoolerOutput</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="object" href="ModelSignatureConstants$$PoolerOutputV1$.html" title=""></a> <a href="ModelSignatureConstants$$PoolerOutputV1$.html" title="">PoolerOutputV1</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="object" href="ModelSignatureConstants$$SerializedSize$.html" title=""></a> <a href="ModelSignatureConstants$$SerializedSize$.html" title="">SerializedSize</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="object" href="ModelSignatureConstants$$ShapeDimList$.html" title=""></a> <a href="ModelSignatureConstants$$ShapeDimList$.html" title="">ShapeDimList</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="trait" href="ModelSignatureConstants$$TFInfoDescriptor.html" title=""></a> <a href="ModelSignatureConstants$$TFInfoDescriptor.html" title="">TFInfoDescriptor</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="trait" href="ModelSignatureConstants$$TFInfoNameMapper.html" title=""></a> <a href="ModelSignatureConstants$$TFInfoNameMapper.html" title="">TFInfoNameMapper</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="object" href="ModelSignatureConstants$$TokenTypeIds$.html" title=""></a> <a href="ModelSignatureConstants$$TokenTypeIds$.html" title="">TokenTypeIds</a> </li><li class="current-entities indented6"> <span class="separator"></span> <a class="object" href="ModelSignatureConstants$$TokenTypeIdsV1$.html" title=""></a> <a href="ModelSignatureConstants$$TokenTypeIdsV1$.html" title="">TokenTypeIdsV1</a> </li> </ul> </div> </div> <div id="content"> <body class="object value"> <div id="definition"> <div class="big-circle object">o</div> <p id="owner"><a href="../../../../index.html" class="extype" name="com">com</a>.<a href="../../../index.html" class="extype" name="com.johnsnowlabs">johnsnowlabs</a>.<a href="../../index.html" class="extype" name="com.johnsnowlabs.ml">ml</a>.<a href="../index.html" class="extype" name="com.johnsnowlabs.ml.tensorflow">tensorflow</a>.<a href="index.html" class="extype" name="com.johnsnowlabs.ml.tensorflow.sign">sign</a>.<a href="ModelSignatureConstants$.html" class="extype" name="com.johnsnowlabs.ml.tensorflow.sign.ModelSignatureConstants">ModelSignatureConstants</a></p> <h1>AttentionMask<span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/ModelSignatureConstants$$AttentionMask$.html" title="Permalink"> <i class="material-icons"></i> </a> </span></h1> <h3><span class="morelinks"></span></h3> </div> <h4 id="signature" class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">object</span> </span> <span class="symbol"> <span class="name">AttentionMask</span><span class="result"> extends <a href="ModelSignatureConstants$$TFInfoNameMapper.html" class="extype" name="com.johnsnowlabs.ml.tensorflow.sign.ModelSignatureConstants.TFInfoNameMapper">TFInfoNameMapper</a> with <span class="extype" name="scala.Product">Product</span> with <span class="extype" name="scala.Serializable">Serializable</span></span> </span> </h4> <div id="comment" class="fullcommenttop"><div class="toggleContainer block"> <span class="toggle"> Linear Supertypes </span> <div class="superTypes hiddenContent"><span class="extype" name="scala.Serializable">Serializable</span>, <span class="extype" name="java.io.Serializable">Serializable</span>, <span class="extype" name="scala.Product">Product</span>, <span class="extype" name="scala.Equals">Equals</span>, <a href="ModelSignatureConstants$$TFInfoNameMapper.html" class="extype" name="com.johnsnowlabs.ml.tensorflow.sign.ModelSignatureConstants.TFInfoNameMapper">TFInfoNameMapper</a>, <span class="extype" name="scala.AnyRef">AnyRef</span>, <span class="extype" name="scala.Any">Any</span></div> </div></div> <div id="mbrsel"> <div class="toggle"></div> <div id="memberfilter"> <i class="material-icons arrow"></i> <span class="input"> <input id="mbrsel-input" placeholder="Filter all members" type="text" accesskey="/" /> </span> <i class="clear material-icons"></i> </div> <div id="filterby"> <div id="order"> <span class="filtertype">Ordering</span> <ol> <li class="alpha in"><span>Alphabetic</span></li> <li class="inherit out"><span>By Inheritance</span></li> </ol> </div> <div class="ancestors"> <span class="filtertype">Inherited<br /> </span> <ol id="linearization"> <li class="in" name="com.johnsnowlabs.ml.tensorflow.sign.ModelSignatureConstants.AttentionMask"><span>AttentionMask</span></li><li class="in" name="scala.Serializable"><span>Serializable</span></li><li class="in" name="java.io.Serializable"><span>Serializable</span></li><li class="in" name="scala.Product"><span>Product</span></li><li class="in" name="scala.Equals"><span>Equals</span></li><li class="in" name="com.johnsnowlabs.ml.tensorflow.sign.ModelSignatureConstants.TFInfoNameMapper"><span>TFInfoNameMapper</span></li><li class="in" name="scala.AnyRef"><span>AnyRef</span></li><li class="in" name="scala.Any"><span>Any</span></li> </ol> </div><div class="ancestors"> <span class="filtertype"></span> <ol> <li class="hideall out"><span>Hide All</span></li> <li class="showall in"><span>Show All</span></li> </ol> </div> <div id="visbl"> <span class="filtertype">Visibility</span> <ol><li class="public in"><span>Public</span></li><li class="all out"><span>All</span></li></ol> </div> </div> </div> <div id="template"> <div id="allMembers"> <div class="values members"> <h3>Value Members</h3> <ol> <li name="scala.AnyRef#!=" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="!=(x$1:Any):Boolean"></a><a id="!=(Any):Boolean"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/ModelSignatureConstants$$AttentionMask$.html#!=(x$1:Any):Boolean" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.AnyRef###" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="##():Int"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/ModelSignatureConstants$$AttentionMask$.html###():Int" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $hash$hash" class="name">##</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.AnyRef#==" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="==(x$1:Any):Boolean"></a><a id="==(Any):Boolean"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/ModelSignatureConstants$$AttentionMask$.html#==(x$1:Any):Boolean" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.Any#asInstanceOf" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="asInstanceOf[T0]:T0"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/ModelSignatureConstants$$AttentionMask$.html#asInstanceOf[T0]:T0" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">asInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Any.asInstanceOf.T0">T0</span></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div> </li><li name="scala.AnyRef#clone" visbl="prt" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="clone():Object"></a><a id="clone():AnyRef"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/ModelSignatureConstants$$AttentionMask$.html#clone():Object" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">clone</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.AnyRef">AnyRef</span></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<span class="extype" name="java.lang">lang</span>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.CloneNotSupportedException]">...</span> </span>)</span> <span class="name">@native</span><span class="args">()</span> </dd></dl></div> </li><li name="scala.AnyRef#eq" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="eq(x$1:AnyRef):Boolean"></a><a id="eq(AnyRef):Boolean"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/ModelSignatureConstants$$AttentionMask$.html#eq(x$1:AnyRef):Boolean" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">eq</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#equals" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="equals(x$1:Any):Boolean"></a><a id="equals(Any):Boolean"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/ModelSignatureConstants$$AttentionMask$.html#equals(x$1:Any):Boolean" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">equals</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.AnyRef#finalize" visbl="prt" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="finalize():Unit"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/ModelSignatureConstants$$AttentionMask$.html#finalize():Unit" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">finalize</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<span class="extype" name="java.lang">lang</span>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="symbol">classOf[java.lang.Throwable]</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#getClass" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="getClass():Class[_]"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/ModelSignatureConstants$$AttentionMask$.html#getClass():Class[_]" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">getClass</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.Class">Class</span>[_]</span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd><dt>Annotations</dt><dd> <span class="name">@native</span><span class="args">()</span> </dd></dl></div> </li><li name="scala.Any#isInstanceOf" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="isInstanceOf[T0]:Boolean"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/ModelSignatureConstants$$AttentionMask$.html#isInstanceOf[T0]:Boolean" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">isInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div> </li><li name="com.johnsnowlabs.ml.tensorflow.sign.ModelSignatureConstants.AttentionMask#key" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="key:String"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/ModelSignatureConstants$$AttentionMask$.html#key:String" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">val</span> </span> <span class="symbol"> <span class="name">key</span><span class="result">: <span class="extype" name="scala.Predef.String">String</span></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="" class="extype" name="com.johnsnowlabs.ml.tensorflow.sign.ModelSignatureConstants.AttentionMask">AttentionMask</a> → <a href="ModelSignatureConstants$$TFInfoNameMapper.html" class="extype" name="com.johnsnowlabs.ml.tensorflow.sign.ModelSignatureConstants.TFInfoNameMapper">TFInfoNameMapper</a></dd></dl></div> </li><li name="scala.AnyRef#ne" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="ne(x$1:AnyRef):Boolean"></a><a id="ne(AnyRef):Boolean"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/ModelSignatureConstants$$AttentionMask$.html#ne(x$1:AnyRef):Boolean" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">ne</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#notify" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="notify():Unit"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/ModelSignatureConstants$$AttentionMask$.html#notify():Unit" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">notify</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@native</span><span class="args">()</span> </dd></dl></div> </li><li name="scala.AnyRef#notifyAll" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="notifyAll():Unit"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/ModelSignatureConstants$$AttentionMask$.html#notifyAll():Unit" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">notifyAll</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@native</span><span class="args">()</span> </dd></dl></div> </li><li name="scala.AnyRef#synchronized" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="synchronized[T0](x$1:=&gt;T0):T0"></a><a id="synchronized[T0](⇒T0):T0"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/ModelSignatureConstants$$AttentionMask$.html#synchronized[T0](x$1:=&gt;T0):T0" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">synchronized</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="params">(<span name="arg0">arg0: ⇒ <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>)</span><span class="result">: <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="com.johnsnowlabs.ml.tensorflow.sign.ModelSignatureConstants.AttentionMask#value" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="value:String"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/ModelSignatureConstants$$AttentionMask$.html#value:String" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">val</span> </span> <span class="symbol"> <span class="name">value</span><span class="result">: <span class="extype" name="scala.Predef.String">String</span></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="" class="extype" name="com.johnsnowlabs.ml.tensorflow.sign.ModelSignatureConstants.AttentionMask">AttentionMask</a> → <a href="ModelSignatureConstants$$TFInfoNameMapper.html" class="extype" name="com.johnsnowlabs.ml.tensorflow.sign.ModelSignatureConstants.TFInfoNameMapper">TFInfoNameMapper</a></dd></dl></div> </li><li name="scala.AnyRef#wait" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait():Unit"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/ModelSignatureConstants$$AttentionMask$.html#wait():Unit" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.InterruptedException]">...</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#wait" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait(x$1:Long,x$2:Int):Unit"></a><a id="wait(Long,Int):Unit"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/ModelSignatureConstants$$AttentionMask$.html#wait(x$1:Long,x$2:Int):Unit" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>, <span name="arg1">arg1: <span class="extype" name="scala.Int">Int</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.InterruptedException]">...</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#wait" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait(x$1:Long):Unit"></a><a id="wait(Long):Unit"></a> <span class="permalink"> <a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/ModelSignatureConstants$$AttentionMask$.html#wait(x$1:Long):Unit" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.InterruptedException]">...</span> </span>)</span> <span class="name">@native</span><span class="args">()</span> </dd></dl></div> </li> </ol> </div> </div> <div id="inheritedMembers"> <div class="parent" name="scala.Serializable"> <h3>Inherited from <span class="extype" name="scala.Serializable">Serializable</span></h3> </div><div class="parent" name="java.io.Serializable"> <h3>Inherited from <span class="extype" name="java.io.Serializable">Serializable</span></h3> </div><div class="parent" name="scala.Product"> <h3>Inherited from <span class="extype" name="scala.Product">Product</span></h3> </div><div class="parent" name="scala.Equals"> <h3>Inherited from <span class="extype" name="scala.Equals">Equals</span></h3> </div><div class="parent" name="com.johnsnowlabs.ml.tensorflow.sign.ModelSignatureConstants.TFInfoNameMapper"> <h3>Inherited from <a href="ModelSignatureConstants$$TFInfoNameMapper.html" class="extype" name="com.johnsnowlabs.ml.tensorflow.sign.ModelSignatureConstants.TFInfoNameMapper">TFInfoNameMapper</a></h3> </div><div class="parent" name="scala.AnyRef"> <h3>Inherited from <span class="extype" name="scala.AnyRef">AnyRef</span></h3> </div><div class="parent" name="scala.Any"> <h3>Inherited from <span class="extype" name="scala.Any">Any</span></h3> </div> </div> <div id="groupedMembers"> <div class="group" name="Ungrouped"> <h3>Ungrouped</h3> </div> </div> </div> <div id="tooltip"></div> <div id="footer"> </div> </body> </div> </div> </div> </body> </html>
Java
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ * * Copyright (c) 1999-2007 IVT Corporation * * All rights reserved. * ---------------------------------------------------------------------------*/ ///////////////////////////////////////////////////////////////////////////// // Module Name: // Btsdk_Stru.h // Abstract: // This module defines BlueSoleil SDK structures. // Usage: // #include "Btsdk_Stru.h" // // Author:// // // Revision History: // 2007-12-25 Created // ///////////////////////////////////////////////////////////////////////////// #ifndef _BTSDK_STRU_H #define _BTSDK_STRU_H /*************** Structure Definition ******************/ typedef struct _BtSdkCallbackStru { BTUINT16 type; /*type of callback*/ void *func; /*callback function*/ }BtSdkCallbackStru, *PBtSdkCallbackStru; typedef struct _BtSdkLocalLMPInfoStru { BTUINT8 lmp_feature[8]; /* LMP features */ BTUINT16 manuf_name; /* the name of the manufacturer */ BTUINT16 lmp_subversion; /* the sub version of the LMP firmware */ BTUINT8 lmp_version; /* the main version of the LMP firmware */ BTUINT8 hci_version; /* HCI version */ BTUINT16 hci_revision; /* HCI revision */ BTUINT8 country_code; /* country code */ } BtSdkLocalLMPInfoStru, *PBtSdkLocalLMPInfoStru; typedef struct _BtSdkVendorCmdStru { BTUINT16 ocf; /* OCF Range (10 bits): 0x0000-0x03FF */ BTUINT8 param_len; /* length of param in bytes */ BTUINT8 param[1]; /* Parameters to be packed in the vendor command. Little endian is adopted. */ } BtSdkVendorCmdStru, *PBtSdkVendorCmdStru; typedef struct _BtSdkEventParamStru { BTUINT8 ev_code; /* Event code. */ BTUINT8 param_len; /* length of param in bytes */ BTUINT8 param[1]; /* Event parameters. */ } BtSdkEventParamStru, *PBtSdkEventParamStru; typedef struct _BtSdkRemoteLMPInfoStru { BTUINT8 lmp_feature[8]; /* LMP features */ BTUINT16 manuf_name; /* the name of the manufacturer */ BTUINT16 lmp_subversion; /* the sub version of the LMP firmware */ BTUINT8 lmp_version; /* the main version of the LMP firmware */ } BtSdkRemoteLMPInfoStru, *PBtSdkRemoteLMPInfoStru; typedef struct _BtSdkRemoteDevicePropertyStru { BTUINT32 mask; /*Specifies members available.*/ BTDEVHDL dev_hdl; /*Handle assigned to the device record*/ BTUINT8 bd_addr[BTSDK_BDADDR_LEN]; /*BT address of the device record*/ BTUINT8 name[BTSDK_DEVNAME_LEN]; /*Name of the device record, must be in UTF-8*/ BTUINT32 dev_class; /*Device class*/ BtSdkRemoteLMPInfoStru lmp_info; /* LMP info */ BTUINT8 link_key[BTSDK_LINKKEY_LEN]; /* link key for this device. */ } BtSdkRemoteDevicePropertyStru; typedef BtSdkRemoteDevicePropertyStru* PBtSdkRemoteDevicePropertyStru; /* Parameters of Hold_Mode command */ typedef struct _BtSdkHoldModeStru { BTUINT16 conn_hdl; /* reserved, set it to 0. */ BTUINT16 max; /* Hold mode max interval. */ BTUINT16 min; /* Hold mode min interval. */ } BtSdkHoldModeStru; typedef BtSdkHoldModeStru* PBtSdkHoldModeStru; /* Parameters of Sniff_Mode command */ typedef struct _BtSdkSniffModeStru { BTUINT16 conn_hdl; /* reserved, set it to 0. */ BTUINT16 max; /* Sniff mode max interval. */ BTUINT16 min; /* Sniff mode min interval. */ BTUINT16 attempt; /* Sniff mode attempt value. */ BTUINT16 timeout; /* Sniff mode timeout value. */ } BtSdkSniffModeStru; typedef BtSdkSniffModeStru* PBtSdkSniffModeStru; /* Parameters of Park_Mode (V1.1) or Park_State (V1.2) command */ typedef struct _BtSdkParkModeStru { BTUINT16 conn_hdl; /* reserved, set it to 0. */ BTUINT16 max; /* Beacon max interval. */ BTUINT16 min; /* Beacon min interval. */ } BtSdkParkModeStru; typedef BtSdkParkModeStru* PBtSdkParkModeStru; /* Basic SDP Element */ typedef struct _BtSdkUUIDStru { BTUINT32 Data1; BTUINT16 Data2; BTUINT16 Data3; BTUINT8 Data4[8]; } BtSdkUUIDStru, *PBtSdkUUIDStru; typedef struct _BtSdkSDPSearchPatternStru { BTUINT32 mask; /*Specifies the valid bytes in the uuid*/ BtSdkUUIDStru uuid; /*UUID value*/ } BtSdkSDPSearchPatternStru, *PBtSdkSDPSearchPatternStru; /* Remote service record attributes */ typedef struct _BtSdkRemoteServiceAttrStru { BTUINT16 mask; /*Decide which parameter to be retrieved*/ union { BTUINT16 svc_class; /* For Compatibility */ BTUINT16 service_class; }; /*Type of this service record*/ BTDEVHDL dev_hdl; /*Handle to the remote device which provides this service.*/ BTUINT8 svc_name[BTSDK_SERVICENAME_MAXLENGTH]; /*Service name in UTF-8*/ BTLPVOID ext_attributes; /*Free by the APP*/ BTUINT16 status; } BtSdkRemoteServiceAttrStru, *PBtSdkRemoteServiceAttrStru; typedef struct _BtSdkRmtSPPSvcExtAttrStru { BTUINT32 size; /*Size of BtSdkRmtSPPSvcExtAttrStru*/ BTUINT8 server_channel; /*Server channel value of this SPP service record*/ } BtSdkRmtSPPSvcExtAttrStru, *PBtSdkRmtSPPSvcExtAttrStru; typedef struct _BtSdkConnectionPropertyStru { BTUINT32 role : 2; BTUINT32 result : 30; BTDEVHDL device_handle; BTSVCHDL service_handle; BTUINT16 service_class; BTUINT32 duration; BTUINT32 received_bytes; BTUINT32 sent_bytes; } BtSdkConnectionPropertyStru, *PBtSdkConnectionPropertyStru; typedef struct _BtSdkFileTransferReqStru { BTDEVHDL dev_hdl; /* Handle to the remote device tries to upload/delete the file. */ BTUINT16 operation; /* Specify the operation on the file. It can be one of the following values: BTSDK_APP_EV_FTP_PUT: The remote device request to upload the file. BTSDK_APP_EV_FTP_DEL_FILE: The remote device request to delete the file. BTSDK_APP_EV_FTP_DEL_FOLDER: The remote device request to delete the folder. In this case, file_name specify the name of the folder to be deleted. */ BTUINT16 flag; /* Flag specifies the current status of uploading/deleting. It can be one of the following values: BTSDK_ER_CONTINUE: The remote device request to upload/delete the file. BTSDK_ER_SUCCESS: The remote device uploads/deletes the file successfully. Other value: Error code specifies the reason of uploading/deleting failure. */ BTUINT8 file_name[BTSDK_PATH_MAXLENGTH]; /* the name of the file uploaded/deleted or to be uploaded/deleted */ } BtSdkFileTransferReqStru, *PBtSdkFileTransferReqStru; typedef struct _BtSdkAppExtSPPAttrStru { BTUINT32 size; /* Size of this structure */ BTUINT32 sdp_record_handle; /* 32bit interger specifies the SDP service record handle */ BtSdkUUIDStru service_class_128; /* 128bit UUID specifies the service class of this service record */ BTUINT8 svc_name[BTSDK_SERVICENAME_MAXLENGTH]; /* Service name, in UTF-8 */ BTUINT8 rf_svr_chnl; /* RFCOMM server channel assigned to this service record */ BTUINT8 com_index; /* Index of the local COM port assigned to this service record */ } BtSdkAppExtSPPAttrStru, *PBtSdkAppExtSPPAttrStru; /* lParam for SPP */ typedef struct _BtSdkSPPConnParamStru { BTUINT32 size; BTUINT16 mask; //Reserved set 0 BTUINT8 com_index; } BtSdkSPPConnParamStru, *PBtSdkSPPConnParamStru; /* lParam for OPP */ typedef struct _BtSdkOPPConnParamStru { BTUINT32 size; /*Size of this structure, use for verification and versioning.*/ BTUINT8 inbox_path[BTSDK_PATH_MAXLENGTH]; /*must in UTF-8*/ BTUINT8 outbox_path[BTSDK_PATH_MAXLENGTH]; /*must in UTF-8*/ BTUINT8 own_card[BTSDK_CARDNAME_MAXLENGTH]; /*must in UTF-8*/ } BtSdkOPPConnParamStru, *PBtSdkOPPConnParamStru; /* lParam for DUN */ typedef struct _BtSdkDUNConnParamStru { BTUINT32 size; BTUINT16 mask; //Reserved set 0 BTUINT8 com_index; } BtSdkDUNConnParamStru, *PBtSdkDUNConnParamStru; /* lParam for FAX */ typedef struct _BtSdkFAXConnParamStru { BTUINT32 size; BTUINT16 mask; //Reserved set 0 BTUINT8 com_index; } BtSdkFAXConnParamStru, *PBtSdkFAXConnParamStru; /* Used By +COPS */ typedef struct Btsdk_HFP_COPSInfo { BTUINT8 mode; /* current mode and provides no information with regard to the name of the operator */ BTUINT8 format; /* the format of the operator parameter string */ BTUINT8 operator_len; BTINT8 operator_name[1]; /* the string in alphanumeric format representing the name of the network operator */ } Btsdk_HFP_COPSInfoStru, *PBtsdk_HFP_COPSInfoStru; /* Used By +BINP, +CNUM, +CLIP, +CCWA */ typedef struct Btsdk_HFP_PhoneInfo { BTUINT8 type; /* the format of the phone number provided */ BTUINT8 service; /* Indicates which service this phone number relates to. Shall be either 4 (voice) or 5 (fax). */ BTUINT8 num_len; /* the length of the phone number provided */ BTINT8 number[32]; /* subscriber number, the length shall be PHONENUM_MAX_DIGITS */ BTUINT8 name_len; /* length of subaddr */ BTINT8 alpha_str[1]; /* string type subaddress of format specified by <cli_validity> */ } Btsdk_HFP_PhoneInfoStru, *PBtsdk_HFP_PhoneInfoStru; /* Used By +CLCC */ typedef struct Btsdk_HFP_CLCCInfo { BTUINT8 idx; /* The numbering (start with 1) of the call given by the sequence of setting up or receiving the calls */ BTUINT8 dir; /* Direction, 0=outgoing, 1=incoming */ BTUINT8 status; /* 0=active, 1=held, 2=dialling(outgoing), 3=alerting(outgoing), 4=incoming(incoming), 5=waiting(incoming) */ BTUINT8 mode; /* 0=voice, 1=data, 2=fax */ BTUINT8 mpty; /* 0=not multiparty, 1=multiparty */ BTUINT8 type; /* the format of the phone number provided */ BTUINT8 num_len; /* the length of the phone number provided */ BTINT8 number[1]; /* phone number */ } Btsdk_HFP_CLCCInfoStru, *PBtsdk_HFP_CLCCInfoStru; /* current state mask code for function HFP_AG_SetCurIndicatorVal */ typedef struct Btsdk_HFP_CINDInfo { BTUINT8 service; /* 0=unavailable, 1=available */ BTUINT8 call; /* 0=no active call, 1=have active call */ BTUINT8 callsetup; /* 0=no callsetup, 1=incoming, 2=outgoing, 3=outalert */ BTUINT8 callheld; /* 0=no callheld, 1=active-hold, 2=onhold */ BTUINT8 signal; /* 0~5 */ BTUINT8 roam; /* 0=no roam, 1= roam */ BTUINT8 battchg; /* 0~5 */ } Btsdk_HFP_CINDInfoStru, *PBtsdk_HFP_CINDInfoStru; /* Parameter of the BTSDK_HFP_EV_SLC_ESTABLISHED_IND and BTSDK_HFP_EV_SLC_RELEASED_IND events */ typedef struct Btsdk_HFP_ConnInfo { BTUINT16 role; /* 16bit UUID specifies the local role of the connection: BTSDK_CLS_HANDSFREE - Local device acts as a HF. BTSDK_CLS_HANDSFREE_AG - Local device acts as a Hands-free AG. BTSDK_CLS_HEADSET - Local device acts as a HS. BTSDK_CLS_HEADSET_AG - Local device acts as a Headset AG. */ BTDEVHDL dev_hdl; /* Handle to the remote device. */ } Btsdk_HFP_ConnInfoStru, *PBtsdk_HFP_ConnInfoStru; /* Used by BTSDK_HFP_EV_ATCMD_RESULT */ typedef struct Btsdk_HFP_ATCmdResult { BTUINT16 cmd_code; /* Which AT command code got an error */ BTUINT8 result_code; /* What result occurs, BTSDK_HFP_APPERR_TIMEOUT, CME Error Code or standard error result code */ } Btsdk_HFP_ATCmdResultStru, *PBtsdk_HFP_ATCmdResultStru; /* lParam of Btsdk_StartClient, Btsdk_StartClientEx and Btsdk_ConnectShortCutEx; and, ext_attributes of BtSdkLocalServerAttrStru. */ typedef struct _BtSdkHFPUIParam { BTUINT32 size; /* Must set to sizeof(BtSdkHFPConnParamStru) */ BTUINT16 mask; /* Reserved, set to 0 */ BTUINT16 features; /* Local supported features. 1) For HSP, it shall be 0. 2) For HFP-HF, it can be the bit OR operation of following values: BTSDK_HF_BRSF_NREC, BTSDK_HF_BRSF_3WAYCALL, BTSDK_HF_BRSF_CLIP, BTSDK_HF_BRSF_BVRA, BTSDK_HF_BRSF_RMTVOLCTRL, BTSDK_HF_BRSF_ENHANCED_CALLSTATUS, BTSDK_HF_BRSF_ENHANCED_CALLCONTROL. 3) For HFP-AG, it can be the bit OR operation of following values: BTSDK_AG_BRSF_3WAYCALL, BTSDK_AG_BRSF_NREC, BTSDK_AG_BRSF_BVRA, BTSDK_AG_BRSF_INBANDRING, BTSDK_AG_BRSF_BINP, BTSDK_AG_BRSF_REJECT_CALL, BTSDK_AG_BRSF_ENHANCED_CALLSTATUS, BTSDK_AG_BRSF_ENHANCED_CALLCONTROL, BTSDK_AG_BRSF_EXTENDED_ERRORRESULT. */ } BtSdkHFPUIParamStru, *PBtSdkHFPUIParamStru, BtSdkHFPConnParamStru, *PBtSdkHFPConnParamStru, BtSdkLocalHFPServerAttrStru, *PBtSdkHFPLocalHFPServerAttrStru; typedef struct _BtSdk_SDAP_PNPINFO { BTUINT16 size; BTUINT16 mask; BTUINT32 svc_hdl; BTUINT16 spec_id; BTUINT16 vendor_id; BTUINT16 product_id; BTUINT16 version_value; BTUINT16 vendor_id_src; }BtSdk_SDAP_PNPINFO, *PBtSdk_SDAP_PNPINFO; typedef struct _BtSdkRmtDISvcExtAttrStru { BTUINT32 size; BTUINT16 mask; BTUINT16 spec_id; BTUINT16 vendor_id; BTUINT16 product_id; BTUINT16 version; BTBOOL primary_record; BTUINT16 vendor_id_source; BTUINT16 list_size; BTUINT8 str_url_list[1]; } BtSdkRmtDISvcExtAttrStru, *PBtSdkRmtDISvcExtAttrStru; #endif
Java
/* * Copyright 2019 The Project Oak Authors * * 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. */ 'use strict'; const showGreenIconForExtensionPages = { conditions: [ new chrome.declarativeContent.PageStateMatcher({ pageUrl: { hostEquals: chrome.runtime.id, schemes: ['chrome-extension'], pathEquals: '/index.html', }, }), ], actions: [new chrome.declarativeContent.SetIcon({ path: 'icon-green.png' })], }; chrome.runtime.onInstalled.addListener(function () { chrome.declarativeContent.onPageChanged.removeRules(undefined, function () { chrome.declarativeContent.onPageChanged.addRules([ showGreenIconForExtensionPages, ]); }); }); async function loadPageInASecureSandbox({ id: tabId }) { const src = ( await new Promise((resolve) => chrome.tabs.executeScript(tabId, { file: 'getInnerHtml.js' }, resolve) ) )?.[0]; // It's possible that the chrome extension cannot read the source code, either // because it is served via a non-permitted scheme (eg `chrome-extension://`), // or bc the user/adminstrator has denied this extension access to the page. if (!src) { chrome.notifications.create(undefined, { type: 'basic', title: 'Could not sandbox this page', message: 'The extension does not have permission to modify this page.', iconUrl: 'icon-red.png', isClickable: false, eventTime: Date.now(), }); return; } const searchParams = new URLSearchParams({ src }); const url = `index.html?${searchParams.toString()}`; chrome.tabs.update({ url }); } chrome.browserAction.onClicked.addListener(loadPageInASecureSandbox);
Java
/******************************************************************************* * Copyright © 2012-2015 eBay Software Foundation * This program is dual licensed under the MIT and Apache 2.0 licenses. * Please see LICENSE for more information. *******************************************************************************/ package com.ebay.pulsar.analytics.metricstore.druid.query.sql; /** * * @author mingmwang * */ public class HllConstants { public static final String HLLPREFIX = "hllhaving_"; }
Java
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Copyright 2014 Thomas Barnekow (cloning, Flat OPC (with Eric White)) using System; using System.Diagnostics; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; using System.Text; using System.IO; using System.IO.Packaging; using System.Globalization; using DocumentFormat.OpenXml; using System.Linq; using System.Xml; using System.Xml.Linq; #if FEATURE_SERIALIZATION using System.Runtime.Serialization; #endif using static System.ReflectionExtensions; namespace DocumentFormat.OpenXml.Packaging { internal struct RelationshipProperty { internal string Id; internal string RelationshipType; internal TargetMode TargetMode; internal Uri TargetUri; }; /// <summary> /// Defines the base class for PackageRelationshipPropertyCollection and PackagePartRelationshipPropertyCollection objects. /// </summary> abstract internal class RelationshipCollection : List<RelationshipProperty> { protected PackageRelationshipCollection BasePackageRelationshipCollection { get; set; } internal bool StrictTranslation { get; set; } /// <summary> /// This method fills the collection with PackageRels from the PackageRelationshipCollection that is given in the sub class. /// </summary> protected void Build() { foreach (PackageRelationship relationship in this.BasePackageRelationshipCollection) { bool found; string transitionalNamespace; RelationshipProperty relationshipProperty; relationshipProperty.TargetUri = relationship.TargetUri; relationshipProperty.TargetMode = relationship.TargetMode; relationshipProperty.Id = relationship.Id; relationshipProperty.RelationshipType = relationship.RelationshipType; // If packageRel.RelationshipType is something for Strict, it tries to get the equivalent in Transitional. found = NamespaceIdMap.TryGetTransitionalRelationship(relationshipProperty.RelationshipType, out transitionalNamespace); if (found) { relationshipProperty.RelationshipType = transitionalNamespace; this.StrictTranslation = true; } this.Add(relationshipProperty); } } internal void UpdateRelationshipTypesInPackage() { // Update the relationshipTypes when editable. if (this.GetPackage().FileOpenAccess != FileAccess.Read) { for (int index = 0; index < this.Count; index++) { RelationshipProperty relationshipProperty = this[index]; this.ReplaceRelationship(relationshipProperty.TargetUri, relationshipProperty.TargetMode, relationshipProperty.RelationshipType, relationshipProperty.Id); } } } abstract internal void ReplaceRelationship(Uri targetUri, TargetMode targetMode, string strRelationshipType, string strId); abstract internal Package GetPackage(); } /// <summary> /// Represents a collection of relationships that are obtained from the package. /// </summary> internal class PackageRelationshipPropertyCollection : RelationshipCollection { public Package BasePackage { get; set; } public PackageRelationshipPropertyCollection(Package package) { this.BasePackage = package; if (this.BasePackage == null) { throw new ArgumentNullException(nameof(BasePackage)); } this.BasePackageRelationshipCollection = this.BasePackage.GetRelationships(); this.Build(); } internal override void ReplaceRelationship(Uri targetUri, TargetMode targetMode, string strRelationshipType, string strId) { this.BasePackage.DeleteRelationship(strId); this.BasePackage.CreateRelationship(targetUri, targetMode, strRelationshipType, strId); } internal override Package GetPackage() { return this.BasePackage; } } /// <summary> /// Represents a collection of relationships that are obtained from the package part. /// </summary> internal class PackagePartRelationshipPropertyCollection : RelationshipCollection { public PackagePart BasePackagePart { get; set; } public PackagePartRelationshipPropertyCollection(PackagePart packagePart) { this.BasePackagePart = packagePart; if (this.BasePackagePart == null) { throw new ArgumentNullException(nameof(BasePackagePart)); } this.BasePackageRelationshipCollection = this.BasePackagePart.GetRelationships(); this.Build(); } internal override void ReplaceRelationship(Uri targetUri, TargetMode targetMode, string strRelationshipType, string strId) { this.BasePackagePart.DeleteRelationship(strId); this.BasePackagePart.CreateRelationship(targetUri, targetMode, strRelationshipType, strId); } internal override Package GetPackage() { return this.BasePackagePart.Package; } } /// <summary> /// Represents a base class for strong typed Open XML document classes. /// </summary> public abstract class OpenXmlPackage : OpenXmlPartContainer, IDisposable { #region private data members //internal object _lock = new object( ); private bool _disposed; [DebuggerBrowsable(DebuggerBrowsableState.Never)] private Package _metroPackage; private FileAccess _accessMode; private string _mainPartContentType; // compression level for content that is stored in a PackagePart. [DebuggerBrowsable(DebuggerBrowsableState.Never)] private CompressionOption _compressionOption = CompressionOption.Normal; private PartUriHelper _partUriHelper = new PartUriHelper(); [DebuggerBrowsable(DebuggerBrowsableState.Never)] private PartExtensionProvider _partExtensionProvider = new PartExtensionProvider(); private LinkedList<DataPart> _dataPartList = new LinkedList<DataPart>(); #endregion internal OpenSettings OpenSettings { get; set; } private bool _strictTranslation = false; internal bool StrictTranslation { get { return this._strictTranslation; } set { this._strictTranslation = value; } } #region internal constructors /// <summary> /// Initializes a new instance of the OpenXmlPackage class. /// </summary> protected OpenXmlPackage() : base() { } /// <summary> /// Initializes a new instance of the OpenXmlPackage class using the supplied Open XML package. /// </summary> /// <param name="package">The target package for the OpenXmlPackage class.</param> /// <exception cref="ArgumentNullException">Thrown when package is a null reference.</exception> /// <exception cref="IOException">Thrown when package is not opened with read access.</exception> /// <exception cref="OpenXmlPackageException">Thrown when the package is not a valid Open XML document.</exception> internal void OpenCore(Package package) { if (package == null) { throw new ArgumentNullException(nameof(package)); } if (package.FileOpenAccess == FileAccess.Write) { // TODO: move this line to derived class throw new IOException(ExceptionMessages.PackageMustCanBeRead); } this._accessMode = package.FileOpenAccess; this._metroPackage = package; this.Load(); } /// <summary> /// Initializes a new instance of the OpenXmlPackage class with access to a specified Open XML package. /// </summary> /// <param name="package">The target package for the OpenXmlPackage class.</param> /// <exception cref="ArgumentNullException">Thrown when package is a null reference.</exception> /// <exception cref="IOException">Thrown when package is not opened with write access.</exception> /// <exception cref="OpenXmlPackageException">Thrown when the package is not a valid Open XML document.</exception> internal void CreateCore(Package package) { if (package == null) { throw new ArgumentNullException(nameof(package)); } //if (package.FileOpenAccess != FileAccess.Write) //{ // // TODO: move this line to derived class // throw new IOException(ExceptionMessages.PackageAccessModeShouldBeWrite); //} this._accessMode = package.FileOpenAccess; this._metroPackage = package; } /// <summary> /// Initializes a new instance of the OpenXmlPackage class using the supplied I/O stream class. /// </summary> /// <param name="stream">The I/O stream on which to open the package.</param> /// <param name="readWriteMode">Indicates whether or not the package is in read/write mode. False indicates read-only mode.</param> /// <exception cref="IOException">Thrown when the specified stream is write-only. The package to open requires read or read/write permission.</exception> internal void OpenCore(Stream stream, bool readWriteMode) { if (stream == null) { throw new ArgumentNullException(nameof(stream)); } if (readWriteMode) { this._accessMode = FileAccess.ReadWrite; } else { this._accessMode = FileAccess.Read; } this._metroPackage = Package.Open(stream, (this._accessMode == FileAccess.Read) ? FileMode.Open : FileMode.OpenOrCreate, this._accessMode); this.Load(); } /// <summary> /// Initializes a new instance of the OpenXmlPackage class using the supplied I/O stream class. /// </summary> /// <param name="stream">The I/O stream on which to open the package.</param> /// <exception cref="IOException">Thrown when the specified stream is read-only. The package to open requires write or read/write permission. </exception> internal void CreateCore(Stream stream) { if (stream == null) { throw new ArgumentNullException(nameof(stream)); } if (!stream.CanWrite) { throw new OpenXmlPackageException(ExceptionMessages.StreamAccessModeShouldBeWrite); } this._accessMode = FileAccess.ReadWrite; //this._accessMode = FileAccess.Write; // below line will exception by Package. Packaging API bug? // this._metroPackage = Package.Open(stream, FileMode.Create, packageAccess); this._metroPackage = Package.Open(stream, FileMode.Create, FileAccess.ReadWrite); } /// <summary> /// Initializes a new instance of the OpenXmlPackage class using the specified file. /// </summary> /// <param name="path">The path and file name of the target package for the OpenXmlPackage.</param> /// <param name="readWriteMode">Indicates whether or not the package is in read/write mode. False for read only mode.</param> internal void OpenCore(string path, bool readWriteMode) { if (path == null) { throw new ArgumentNullException(nameof(path)); } if (readWriteMode) { this._accessMode = FileAccess.ReadWrite; } else { this._accessMode = FileAccess.Read; } this._metroPackage = Package.Open(path, (this._accessMode == FileAccess.Read) ? FileMode.Open : FileMode.OpenOrCreate, this._accessMode, (this._accessMode == FileAccess.Read) ? FileShare.Read : FileShare.None); this.Load(); } /// <summary> /// Initializes a new instance of the OpenXmlPackage class using the supplied file. /// </summary> /// <param name="path">The path and file name of the target package for the OpenXmlPackage.</param> internal void CreateCore(string path) { if (path == null) { throw new ArgumentNullException(nameof(path)); } this._accessMode = FileAccess.ReadWrite; //this._accessMode = FileAccess.Write; // below line will exception by Package. Packaging API bug? // this._metroPackage = Package.Open(path, FileMode.Create, packageAccess, FileShare.None); this._metroPackage = Package.Open(path, FileMode.Create, FileAccess.ReadWrite, FileShare.None); } /// <summary> /// Loads the package. This method must be called in the constructor of a derived class. /// </summary> private void Load() { Profiler.CommentMarkProfile(Profiler.MarkId.OpenXmlPackage_Load_In); try { Dictionary<Uri, OpenXmlPart> loadedParts = new Dictionary<Uri, OpenXmlPart>(); bool hasMainPart = false; RelationshipCollection relationshipCollection = new PackageRelationshipPropertyCollection(this._metroPackage); // relationCollection.StrictTranslation is true when this collection contains Transitional relationships converted from Strict. this.StrictTranslation = relationshipCollection.StrictTranslation; // AutoSave must be false when opening ISO Strict doc as editable. // (Attention: #2545529. Now we disable this code until we finally decide to go with this. Instead, we take an alternative approach that is added in the SavePartContents() method // which we ignore AutoSave when this.StrictTranslation is true to keep consistency in the document.) //if (this.StrictTranslation && (this._accessMode == FileAccess.ReadWrite || this._accessMode == FileAccess.Write) && !this.AutoSave) //{ // OpenXmlPackageException exception = new OpenXmlPackageException(ExceptionMessages.StrictEditNeedsAutoSave); // throw exception; //} // auto detect document type (main part type for Transitional) foreach (RelationshipProperty relationship in relationshipCollection) { if (relationship.RelationshipType == this.MainPartRelationshipType) { hasMainPart = true; Uri uriTarget = PackUriHelper.ResolvePartUri(new Uri("/", UriKind.Relative), relationship.TargetUri); PackagePart metroPart = this.Package.GetPart(uriTarget); if (!this.IsValidMainPartContentType(metroPart.ContentType)) { OpenXmlPackageException exception = new OpenXmlPackageException(ExceptionMessages.InvalidPackageType); throw exception; } this.MainPartContentType = metroPart.ContentType; break; } } if (!hasMainPart) { // throw exception is the package do not have the main part (MainDocument / Workbook / Presentation part) OpenXmlPackageException exception = new OpenXmlPackageException(ExceptionMessages.NoMainPart); throw exception; } this.LoadReferencedPartsAndRelationships(this, null, relationshipCollection, loadedParts); } catch (OpenXmlPackageException) { // invalid part ( content type is not expected ) this.Close(); throw; } catch (System.UriFormatException) { // UriFormatException is replaced here with OpenXmlPackageException. <O15:#322821> OpenXmlPackageException exception = new OpenXmlPackageException(ExceptionMessages.InvalidUriFormat); this.Close(); throw exception; } catch (Exception) { this.Close(); throw; } Profiler.CommentMarkProfile(Profiler.MarkId.OpenXmlPackage_Load_Out); } #endregion #region public properties /// <summary> /// Gets the package of the document. /// </summary> public Package Package { get { this.ThrowIfObjectDisposed(); return _metroPackage; } } /// <summary> /// Gets the FileAccess setting for the document. /// The current I/O access settings are: Read, Write, or ReadWrite. /// </summary> public FileAccess FileOpenAccess { get { return this._metroPackage.FileOpenAccess; } } /// <summary> /// Gets or sets the compression level for the content of the new part. /// </summary> public CompressionOption CompressionOption { get { return this._compressionOption; } set { this._compressionOption = value; } } /// <summary> /// Gets the core package properties of the Open XML document. /// </summary> public PackageProperties PackageProperties { get { this.ThrowIfObjectDisposed(); return this.Package.PackageProperties; } } /// <summary> /// Gets a PartExtensionProvider part which provides a mapping from ContentType to part extension. /// </summary> public PartExtensionProvider PartExtensionProvider { get { this.ThrowIfObjectDisposed(); return this._partExtensionProvider; } } /// <summary> /// Gets or sets a value that indicates the maximum allowable number of characters in an Open XML part. A zero (0) value indicates that there are no limits on the size of the part. A non-zero value specifies the maximum size, in characters. /// </summary> /// <remarks> /// This property allows you to mitigate denial of service attacks where the attacker submits a package with an extremely large Open XML part. By limiting the size of a part, you can detect the attack and recover reliably. /// </remarks> public long MaxCharactersInPart { get; internal set; } /// <summary> /// Enumerates all the <see cref="DataPart"/> parts in the document package. /// </summary> public IEnumerable<DataPart> DataParts { get { return this._dataPartList; } } #endregion #region public methods /// <summary> /// Adds the specified part to the document. /// Use the returned part to operate on the part added to the document. /// </summary> /// <typeparam name="T">A class that is derived from the OpenXmlPart class.</typeparam> /// <param name="part">The part to add to the document.</param> /// <returns>The added part in the document. Differs from the part that was passed as an argument.</returns> /// <exception cref="ArgumentOutOfRangeException">Thrown when the part is not allowed to be added.</exception> /// <exception cref="OpenXmlPackageException">Thrown when the part type already exists and multiple instances of the part type is not allowed.</exception> public override T AddPart<T>(T part) { this.ThrowIfObjectDisposed(); if (part == null) { throw new ArgumentNullException(nameof(part)); } if (part.RelationshipType == this.MainPartRelationshipType && part.ContentType != this.MainPartContentType) { throw new ArgumentOutOfRangeException(ExceptionMessages.MainPartIsDifferent); } return (T)AddPartFrom(part, null); } /// <summary> /// Deletes all the parts with the specified part type from the package recursively. /// </summary> [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")] public void DeletePartsRecursivelyOfType<T>() where T : OpenXmlPart { this.ThrowIfObjectDisposed(); DeletePartsRecursivelyOfTypeBase<T>(); } // Remove this method due to bug #18394 // User can call doc.Package.Flush( ) as a workaround. ///// <summary> ///// Saves the contents of all parts and relationships that are contained in the OpenXml package. ///// </summary> //public void Save() //{ // this.ThrowIfObjectDisposed(); // this.Package.Flush(); //} /// <summary> /// Saves and closes the OpenXml package and all underlying part streams. /// </summary> public void Close() { this.ThrowIfObjectDisposed(); Dispose(); } #region methods to operate DataPart /// <summary> /// Creates a new <see cref="MediaDataPart"/> part in the document package. /// </summary> /// <param name="contentType">The content type of the new <see cref="MediaDataPart"/> part.</param> /// <returns>The added <see cref="MediaDataPart"/> part.</returns> /// <exception cref="ArgumentNullException">Thrown when <paramref name="contentType"/> is a null reference.</exception> public MediaDataPart CreateMediaDataPart(string contentType) { ThrowIfObjectDisposed(); if (contentType == null) { throw new ArgumentNullException(nameof(contentType)); } MediaDataPart mediaDataPart = new MediaDataPart(); mediaDataPart.CreateInternal(this.InternalOpenXmlPackage, contentType, null); this._dataPartList.AddLast(mediaDataPart); return mediaDataPart; } /// <summary> /// Creates a new <see cref="MediaDataPart"/> part in the document package. /// </summary> /// <param name="contentType">The content type of the new <see cref="MediaDataPart"/> part.</param> /// <param name="extension">The part name extension (.dat, etc.) of the new <see cref="MediaDataPart"/> part.</param> /// <returns>The added <see cref="MediaDataPart"/> part.</returns> /// <exception cref="ArgumentNullException">Thrown when <paramref name="contentType"/> is a null reference.</exception> /// <exception cref="ArgumentNullException">Thrown when <paramref name="extension"/> is a null reference.</exception> public MediaDataPart CreateMediaDataPart(string contentType, string extension) { ThrowIfObjectDisposed(); if (contentType == null) { throw new ArgumentNullException(nameof(contentType)); } if (extension == null) { throw new ArgumentNullException(nameof(extension)); } MediaDataPart mediaDataPart = new MediaDataPart(); mediaDataPart.CreateInternal(this.InternalOpenXmlPackage, contentType, extension); this._dataPartList.AddLast(mediaDataPart); return mediaDataPart; } /// <summary> /// Creates a new <see cref="MediaDataPart"/> part in the document package. /// </summary> /// <param name="mediaDataPartType">The content type of the new <see cref="MediaDataPart"/> part.</param> /// <returns>The added <see cref="MediaDataPart"/> part.</returns> public MediaDataPart CreateMediaDataPart(MediaDataPartType mediaDataPartType) { ThrowIfObjectDisposed(); MediaDataPart mediaDataPart = new MediaDataPart(); mediaDataPart.CreateInternal(this.InternalOpenXmlPackage, mediaDataPartType); this._dataPartList.AddLast(mediaDataPart); return mediaDataPart; } /// <summary> /// Deletes the specified <see cref="DataPart"/> from the document package. /// </summary> /// <param name="dataPart">The <see cref="DataPart"/> to be deleted.</param> /// <returns>Returns true if the part is successfully removed; otherwise returns false. This method also returns false if the part was not found or the parameter is null.</returns> /// <exception cref="InvalidOperationException">Thrown when <paramref name="dataPart"/> is referenced by another part in the document package.</exception> public bool DeletePart(DataPart dataPart) { ThrowIfObjectDisposed(); if (dataPart == null) { throw new ArgumentNullException(nameof(dataPart)); } if (dataPart.OpenXmlPackage != this) { throw new InvalidOperationException(ExceptionMessages.ForeignDataPart); } if (IsOrphanDataPart(dataPart)) { // delete the part from the package dataPart.Destroy(); return this._dataPartList.Remove(dataPart); } else { throw new InvalidOperationException(ExceptionMessages.DataPartIsInUse); } } #endregion #endregion #region public virtual methods /// <summary> /// Validates the package. This method does not validate the XML content in each part. /// </summary> /// <param name="validationSettings">The OpenXmlPackageValidationSettings for validation events.</param> /// <remarks>If validationSettings is null or no EventHandler is set, the default behavior is to throw an OpenXmlPackageException on the validation error. </remarks> [Obsolete(ObsoleteAttributeMessages.ObsoleteV1ValidationFunctionality, false)] public void Validate(OpenXmlPackageValidationSettings validationSettings) { this.ThrowIfObjectDisposed(); OpenXmlPackageValidationSettings actualValidationSettings; if (validationSettings != null && validationSettings.GetEventHandler() != null) { actualValidationSettings = validationSettings; } else { // use default DefaultValidationEventHandler( ) which throw an exception actualValidationSettings = new OpenXmlPackageValidationSettings(); actualValidationSettings.EventHandler += new EventHandler<OpenXmlPackageValidationEventArgs>(DefaultValidationEventHandler); } // TODO: what's expected behavior? actualValidationSettings.FileFormat = FileFormatVersions.Office2007; // for cycle defense Dictionary<OpenXmlPart, bool> processedParts = new Dictionary<OpenXmlPart, bool>(); ValidateInternal(actualValidationSettings, processedParts); } #pragma warning disable 0618 // CS0618: A class member was marked with the Obsolete attribute, such that a warning will be issued when the class member is referenced. /// <summary> /// Validates the package. This method does not validate the XML content in each part. /// </summary> /// <param name="validationSettings">The OpenXmlPackageValidationSettings for validation events.</param> /// <param name="fileFormatVersion">The target file format version.</param> /// <remarks>If validationSettings is null or no EventHandler is set, the default behavior is to throw an OpenXmlPackageException on the validation error. </remarks> internal void Validate(OpenXmlPackageValidationSettings validationSettings, FileFormatVersions fileFormatVersion) { this.ThrowIfObjectDisposed(); Debug.Assert(validationSettings != null); Debug.Assert(fileFormatVersion == FileFormatVersions.Office2007 || fileFormatVersion == FileFormatVersions.Office2010 || fileFormatVersion == FileFormatVersions.Office2013); validationSettings.FileFormat = fileFormatVersion; // for cycle defense Dictionary<OpenXmlPart, bool> processedParts = new Dictionary<OpenXmlPart, bool>(); ValidateInternal(validationSettings, processedParts); } #endregion #region virtual methods / properties #endregion #region internal methods /// <summary> /// Reserves the URI of the loaded part. /// </summary> /// <param name="contentType"></param> /// <param name="partUri"></param> internal void ReserveUri(string contentType, Uri partUri) { this.ThrowIfObjectDisposed(); this._partUriHelper.ReserveUri(contentType, partUri); } /// <summary> /// Gets a unique part URI for the newly created part. /// </summary> /// <param name="contentType">The content type of the part.</param> /// <param name="parentUri">The URI of the parent part.</param> /// <param name="targetPath"></param> /// <param name="targetName"></param> /// <param name="targetExt"></param> /// <returns></returns> internal Uri GetUniquePartUri(string contentType, Uri parentUri, string targetPath, string targetName, string targetExt) { this.ThrowIfObjectDisposed(); Uri partUri = null; // fix bug #241492 // check to avoid name conflict with orphan parts in the packages. do { partUri = this._partUriHelper.GetUniquePartUri(contentType, parentUri, targetPath, targetName, targetExt); } while (this._metroPackage.PartExists(partUri)); return partUri; } /// <summary> /// Gets a unique part URI for the newly created part. /// </summary> /// <param name="contentType">The content type of the part.</param> /// <param name="parentUri">The URI of the parent part.</param> /// <param name="targetUri"></param> /// <returns></returns> internal Uri GetUniquePartUri(string contentType, Uri parentUri, Uri targetUri) { this.ThrowIfObjectDisposed(); Uri partUri = null; // fix bug #241492 // check to avoid name conflict with orphan parts in the packages. do { partUri = this._partUriHelper.GetUniquePartUri(contentType, parentUri, targetUri); } while (this._metroPackage.PartExists(partUri)); return partUri; } #endregion #region dispose related methods /// <summary> /// Thrown if an object is disposed. /// </summary> protected override void ThrowIfObjectDisposed() { if (this._disposed) { throw new ObjectDisposedException(base.GetType().Name); } } /// <summary> /// Flushes and saves the content, closes the document, and releases all resources. /// </summary> /// <param name="disposing">Specify true to release both managed and unmanaged resources; false to release only unmanaged resources.</param> protected virtual void Dispose(bool disposing) { if (!this._disposed) { if (disposing) { // Try to save contents of every part in the package SavePartContents(); DeleteUnusedDataPartOnClose(); // TODO: Close resources this._metroPackage.Close(); this._metroPackage = null; this.PartDictionary = null; this.ReferenceRelationshipList.Clear(); this._partUriHelper = null; } this._disposed = true; } } #endregion #region IDisposable Members /// <summary> /// Flushes and saves the content, closes the document, and releases all resources. /// </summary> public void Dispose() { this.Dispose(true); GC.SuppressFinalize(this); } #endregion #region MC Staffs /// <summary> /// Gets the markup compatibility settings applied at loading time. /// </summary> public MarkupCompatibilityProcessSettings MarkupCompatibilityProcessSettings { get { if (OpenSettings.MarkupCompatibilityProcessSettings == null) return new MarkupCompatibilityProcessSettings(MarkupCompatibilityProcessMode.NoProcess, FileFormatVersions.Office2007); else return OpenSettings.MarkupCompatibilityProcessSettings; } } //internal FileFormatVersions MCTargetFormat //{ // get // { // if (MarkupCompatibilityProcessSettings.ProcessMode == MarkupCompatibilityProcessMode.NoProcess) // return (FileFormatVersions.Office2007 | FileFormatVersions.Office2010); // else // { // return MarkupCompatibilityProcessSettings.TargetFileFormatVersions; // } // } //} //internal bool ProcessMCInWholePackage //{ // get // { // return MarkupCompatibilityProcessSettings.ProcessMode == MarkupCompatibilityProcessMode.ProcessAllParts; // } //} #endregion #region Auto-Save functions /// <summary> /// Gets a flag that indicates whether the parts should be saved when disposed. /// </summary> public bool AutoSave { get { return OpenSettings.AutoSave; } } private void SavePartContents() { OpenXmlPackagePartIterator iterator; bool isAnyPartChanged; if (this.FileOpenAccess == FileAccess.Read) { return; // do nothing if the package is open in read-only mode. } // When this.StrictTranslation is true, we ignore AutoSave to do the translation if isAnyPartChanged is true. That's the way to keep consistency. if (!this.AutoSave && !this.StrictTranslation) { return; // do nothing if AutoSave is false. } // Traversal the whole package and save changed contents. iterator = new OpenXmlPackagePartIterator(this); isAnyPartChanged = false; // If a part is in the state of 'loaded', something in the part should've been changed. // When all the part is not loaded yet, we can skip saving all parts' contents and updating Package relationship types. foreach (var part in iterator) { if (part.IsRootElementLoaded) { isAnyPartChanged = true; break; } } // We update parts and relationship types only when any one of the parts was changed (i.e. loaded). if (isAnyPartChanged) { foreach (var part in iterator) { TrySavePartContent(part); } if (this.StrictTranslation) { RelationshipCollection relationshipCollection; // For Package: Invoking UpdateRelationshipTypesInPackage() changes the relationship types in the package. // We need to new PackageRelationshipPropertyCollection to read through the package contents right here // because some operation may have updated the package before we get here. relationshipCollection = new PackageRelationshipPropertyCollection(this._metroPackage); relationshipCollection.UpdateRelationshipTypesInPackage(); } } } // Check if the part content changed and save it if yes. private static void TrySavePartContent(OpenXmlPart part) { Debug.Assert(part != null); Debug.Assert(part.OpenXmlPackage != null); // If StrictTranslation is true, we need to update the part anyway. if (part.OpenXmlPackage.StrictTranslation) { RelationshipCollection relationshipCollection; // For PackagePart: Invoking UpdateRelationshipTypesInPackage() changes the relationship types in the package part. // We need to new PackageRelationshipPropertyCollection to read through the package part contents right here // because some operation may have updated the package part before we get here. relationshipCollection = new PackagePartRelationshipPropertyCollection(part.PackagePart); relationshipCollection.UpdateRelationshipTypesInPackage(); // For ISO Strict documents, we read and save the part anyway to translate the contents. The contents are translated when PartRootElement is being loaded. if (part.PartRootElement != null) { SavePartContent(part); } } else { // For Transitional documents, we only save the 'changed' part. if (IsPartContentChanged(part)) { SavePartContent(part); } } } // Check if the content of a part is changed. private static bool IsPartContentChanged(OpenXmlPart part) { Debug.Assert(part != null); // If the root element of the part is loaded, // consider the part changed and should be saved. Debug.Assert(part.OpenXmlPackage != null); if (!part.IsRootElementLoaded && part.OpenXmlPackage.MarkupCompatibilityProcessSettings.ProcessMode == MarkupCompatibilityProcessMode.ProcessAllParts) { if (part.PartRootElement != null) { return true; } } return part.IsRootElementLoaded; } // Save the content of a part to its stream. private static void SavePartContent(OpenXmlPart part) { Debug.Assert(part != null); Debug.Assert(part.IsRootElementLoaded); // Save PartRootElement to the part stream. part.PartRootElement.Save(); } #endregion #region internal methods related main part /// <summary> /// Gets the relationship type of the main part. /// </summary> internal abstract string MainPartRelationshipType { get; } /// <summary> /// Gets or sets the content type of the main part of the package. /// </summary> internal string MainPartContentType { get { return _mainPartContentType; } set { if (this.IsValidMainPartContentType(value)) { this._mainPartContentType = value; } else { throw new ArgumentOutOfRangeException(ExceptionMessages.InvalidMainPartContentType); } } } /// <summary> /// Gets the list of valid content types for the main part. /// </summary> internal abstract ICollection<string> ValidMainPartContentTypes { get; } /// <summary> /// Determines whether the content type is valid for the main part of the package. /// </summary> /// <param name="contentType">The content type.</param> /// <returns>Returns true if the content type is valid.</returns> internal bool IsValidMainPartContentType(string contentType) { return ValidMainPartContentTypes.Contains(contentType); } /// <summary> /// Changes the type of the document. /// </summary> /// <typeparam name="T">The type of the document's main part.</typeparam> /// <remarks>The MainDocumentPart will be changed.</remarks> internal void ChangeDocumentTypeInternal<T>() where T : OpenXmlPart { ThrowIfObjectDisposed(); T mainPart = this.GetSubPartOfType<T>(); MemoryStream memoryStream = null; ExtendedPart tempPart = null; Dictionary<string, OpenXmlPart> childParts = new Dictionary<string, OpenXmlPart>(); ReferenceRelationship[] referenceRelationships; try { // read the content to local string using (Stream mainPartStream = mainPart.GetStream()) { if (mainPartStream.Length > Int32.MaxValue) { throw new OpenXmlPackageException(ExceptionMessages.DocumentTooBig); } memoryStream = new MemoryStream(Convert.ToInt32(mainPartStream.Length)); OpenXmlPart.CopyStream(mainPartStream, memoryStream); } // tempPart = this.AddExtendedPart(@"http://temp", this.MainPartContentType, @".xml"); foreach (KeyValuePair<string, OpenXmlPart> idPartPair in mainPart.ChildrenParts) { childParts.Add(idPartPair.Key, idPartPair.Value); } referenceRelationships = mainPart.ReferenceRelationshipList.ToArray(); } catch (OpenXmlPackageException e) { throw new OpenXmlPackageException(ExceptionMessages.CannotChangeDocumentType, e); } #if FEATURE_SYSTEMEXCEPTION catch (SystemException e) { throw new OpenXmlPackageException(ExceptionMessages.CannotChangeDocumentType, e); } #endif try { Uri uri = mainPart.Uri; string id = this.GetIdOfPart(mainPart); // remove the old part this.ChildrenParts.Remove(id); this.DeleteRelationship(id); mainPart.Destroy(); // create new part T newMainPart = CreateInstance<T>(); // do not call this.InitPart( ). copy the code here newMainPart.CreateInternal2(this, null, this.MainPartContentType, uri); // add it and get the id string relationshipId = this.AttachChild(newMainPart, id); this.ChildrenParts.Add(relationshipId, newMainPart); // copy the stream back memoryStream.Position = 0; newMainPart.FeedData(memoryStream); // add back all relationships foreach (KeyValuePair<string, OpenXmlPart> idPartPair in childParts) { // just call AttachChild( ) is OK. No need to call AddPart( ... ) newMainPart.AttachChild(idPartPair.Value, idPartPair.Key); newMainPart.ChildrenParts.Add(idPartPair); } foreach (ExternalRelationship externalRel in referenceRelationships.OfType<ExternalRelationship>()) { newMainPart.AddExternalRelationship(externalRel.RelationshipType, externalRel.Uri, externalRel.Id); } foreach (HyperlinkRelationship hyperlinkRel in referenceRelationships.OfType<HyperlinkRelationship>()) { newMainPart.AddHyperlinkRelationship(hyperlinkRel.Uri, hyperlinkRel.IsExternal, hyperlinkRel.Id); } foreach (DataPartReferenceRelationship dataPartReference in referenceRelationships.OfType<DataPartReferenceRelationship>()) { newMainPart.AddDataPartReferenceRelationship(dataPartReference); } // delete the temp part id = this.GetIdOfPart(tempPart); this.ChildrenParts.Remove(id); this.DeleteRelationship(id); tempPart.Destroy(); } catch (OpenXmlPackageException e) { throw new OpenXmlPackageException(ExceptionMessages.CannotChangeDocumentType, e); } #if FEATURE_SYSTEMEXCEPTION catch (SystemException e) { throw new OpenXmlPackageException(ExceptionMessages.CannotChangeDocumentTypeSerious, e); } #endif } #endregion #region internal methods // internal abstract IExtensionPartFactory ExtensionPartFactory { get; } // cannot use generic, at it will emit error // Compiler Error CS0310 // The type 'typename' must have a public parameter less constructor in order to use it as parameter 'parameter' in the generic type or method 'generic' internal sealed override OpenXmlPart NewPart(string relationshipType, string contentType) { ThrowIfObjectDisposed(); if (contentType == null) { throw new ArgumentNullException(nameof(contentType)); } PartConstraintRule partConstraintRule; if (GetPartConstraint().TryGetValue(relationshipType, out partConstraintRule)) { if (!partConstraintRule.MaxOccursGreatThanOne) { if (this.GetSubPart(relationshipType) != null) { // already have one, cannot add new one. throw new InvalidOperationException(); } } OpenXmlPart child = CreateOpenXmlPart(relationshipType); child.CreateInternal(this, null, contentType, null); // add it and get the id string relationshipId = this.AttachChild(child); this.ChildrenParts.Add(relationshipId, child); return child; } throw new ArgumentOutOfRangeException(nameof(relationshipType)); } internal sealed override OpenXmlPackage InternalOpenXmlPackage { get { return this; } } internal sealed override OpenXmlPart ThisOpenXmlPart { get { return null; } } // find all reachable parts from the package root, the dictionary also used for cycle reference defense internal sealed override void FindAllReachableParts(IDictionary<OpenXmlPart, bool> reachableParts) { ThrowIfObjectDisposed(); if (reachableParts == null) { throw new ArgumentNullException(nameof(reachableParts)); } foreach (OpenXmlPart part in this.ChildrenParts.Values) { if (!reachableParts.ContainsKey(part)) { part.FindAllReachableParts(reachableParts); } } } internal sealed override void DeleteRelationship(string id) { ThrowIfObjectDisposed(); this.Package.DeleteRelationship(id); } internal sealed override PackageRelationship CreateRelationship(Uri targetUri, TargetMode targetMode, string relationshipType) { ThrowIfObjectDisposed(); return this.Package.CreateRelationship(targetUri, targetMode, relationshipType); } internal sealed override PackageRelationship CreateRelationship(Uri targetUri, TargetMode targetMode, string relationshipType, string id) { ThrowIfObjectDisposed(); return this.Package.CreateRelationship(targetUri, targetMode, relationshipType, id); } // create the metro part in the package with the CompressionOption internal PackagePart CreateMetroPart(Uri partUri, string contentType) { return this.Package.CreatePart(partUri, contentType, this.CompressionOption); } // default package validation event handler static void DefaultValidationEventHandler(Object sender, OpenXmlPackageValidationEventArgs e) { OpenXmlPackageException exception = new OpenXmlPackageException(ExceptionMessages.ValidationException); exception.Data.Add("OpenXmlPackageValidationEventArgs", e); throw exception; } #endregion #region methods on DataPart private static bool IsOrphanDataPart(DataPart dataPart) { return !dataPart.GetDataPartReferenceRelationships().Any(); } /// <summary> /// Deletes all DataParts that are not referenced by any media, audio, or video reference relationships. /// </summary> private void DeleteUnusedDataPartOnClose() { if (this._dataPartList.Count > 0) { HashSet<DataPart> dataPartSet = new HashSet<DataPart>(); foreach (var dataPart in this.DataParts) { dataPartSet.Add(dataPart); } // first, see if there are any reference in package level. foreach (var dataPartReferenceRelationship in this.DataPartReferenceRelationships) { dataPartSet.Remove(dataPartReferenceRelationship.DataPart); if (dataPartSet.Count == 0) { // No more DataPart in the set. All DataParts are referenced somewhere. return; } } // for each part in the package, check the DataPartReferenceRelationships. OpenXmlPackagePartIterator partIterator = new OpenXmlPackagePartIterator(this); foreach (var openXmlPart in partIterator) { foreach (var dataPartReferenceRelationship in openXmlPart.DataPartReferenceRelationships) { dataPartSet.Remove(dataPartReferenceRelationship.DataPart); if (dataPartSet.Count == 0) { // No more DataPart in the set. All DataParts are referenced somethwherr. return; } } } // foreach (var dataPart in dataPartSet) { // delete the part from the package dataPart.Destroy(); this._dataPartList.Remove(dataPart); } } } /// <summary> /// Finds the DataPart that has the specified part URI. /// </summary> /// <param name="partUri">The part URI.</param> /// <returns>Returns null if there is no DataPart with the specified URI.</returns> internal DataPart FindDataPart(Uri partUri) { foreach (var dataPart in this.DataParts) { if (dataPart.Uri == partUri) { return dataPart; } } return null; } internal DataPart AddDataPartToList(DataPart dataPart) { this._dataPartList.AddLast(dataPart); return dataPart; } #endregion internal class PartUriHelper { private Dictionary<string, int> _sequenceNumbers = new Dictionary<string, int>(20); private Dictionary<string, int> _reservedUri = new Dictionary<string, int>(); public PartUriHelper() { } private bool IsReservedUri(Uri uri) { string uriString = uri.OriginalString.ToUpperInvariant(); return this._reservedUri.ContainsKey(uriString); } internal void AddToReserveUri(Uri partUri) { string uriString = partUri.OriginalString.ToUpperInvariant(); this._reservedUri.Add(uriString, 0); } internal void ReserveUri(string contentType, Uri partUri) { GetNextSequenceNumber(contentType); this.AddToReserveUri(PackUriHelper.GetNormalizedPartUri(partUri)); } internal Uri GetUniquePartUri(string contentType, Uri parentUri, string targetPath, string targetName, string targetExt) { Uri partUri; do { string sequenceNumber = this.GetNextSequenceNumber(contentType); string path = Path.Combine(targetPath, targetName + sequenceNumber + targetExt); Uri uri = new Uri(path, UriKind.RelativeOrAbsolute); partUri = PackUriHelper.ResolvePartUri(parentUri, uri); // partUri = PackUriHelper.GetNormalizedPartUri(PackUriHelper.CreatePartUri(uri)); } while (this.IsReservedUri(partUri)); this.AddToReserveUri(partUri); // do not need to add to the _existedNames return partUri; } internal Uri GetUniquePartUri(string contentType, Uri parentUri, Uri targetUri) { Uri partUri; partUri = PackUriHelper.ResolvePartUri(parentUri, targetUri); if (this.IsReservedUri(partUri)) { // already have one, create new string targetPath = "."; string targetName = Path.GetFileNameWithoutExtension(targetUri.OriginalString); string targetExt = Path.GetExtension(targetUri.OriginalString); partUri = GetUniquePartUri(contentType, partUri, targetPath, targetName, targetExt); } else { // not used, can use it. this.AddToReserveUri(partUri); } return partUri; } private string GetNextSequenceNumber(string contentType) { if (this._sequenceNumbers.ContainsKey(contentType)) { this._sequenceNumbers[contentType] += 1; // use the default read-only NumberFormatInfo that is culture-independent (invariant). // return this._sequenceNumbers[contentType].ToString(NumberFormatInfo.InvariantInfo); // Let's use the number string in hex return Convert.ToString(this._sequenceNumbers[contentType], 16); } else { this._sequenceNumbers.Add(contentType, 1); return ""; } } } #region saving and cloning #region saving private readonly object _saveAndCloneLock = new object(); /// <summary> /// Saves the contents of all parts and relationships that are contained /// in the OpenXml package, if FileOpenAccess is ReadWrite. /// </summary> public void Save() { ThrowIfObjectDisposed(); if (FileOpenAccess == FileAccess.ReadWrite) { lock (_saveAndCloneLock) { SavePartContents(); // TODO: Revisit. // Package.Flush(); } } } /// <summary> /// Saves the contents of all parts and relationships that are contained /// in the OpenXml package to the specified file. Opens the saved document /// using the same settings that were used to open this OpenXml package. /// </summary> /// <remarks> /// Calling SaveAs(string) is exactly equivalent to calling Clone(string). /// This method is essentially provided for convenience. /// </remarks> /// <param name="path">The path and file name of the target document.</param> /// <returns>The cloned OpenXml package</returns> public OpenXmlPackage SaveAs(string path) { return Clone(path); } #endregion saving #region Default clone method /// <summary> /// Creates an editable clone of this OpenXml package, opened on a /// <see cref="MemoryStream"/> with expandable capacity and using /// default OpenSettings. /// </summary> /// <returns>The cloned OpenXml package.</returns> public OpenXmlPackage Clone() { return Clone(new MemoryStream(), true, new OpenSettings()); } #endregion Default clone method #region Stream-based cloning /// <summary> /// Creates a clone of this OpenXml package, opened on the given stream. /// The cloned OpenXml package is opened with the same settings, i.e., /// FileOpenAccess and OpenSettings, as this OpenXml package. /// </summary> /// <param name="stream">The IO stream on which to open the OpenXml package.</param> /// <returns>The cloned OpenXml package.</returns> public OpenXmlPackage Clone(Stream stream) { return Clone(stream, FileOpenAccess == FileAccess.ReadWrite, OpenSettings); } /// <summary> /// Creates a clone of this OpenXml package, opened on the given stream. /// The cloned OpenXml package is opened with the same OpenSettings as /// this OpenXml package. /// </summary> /// <param name="stream">The IO stream on which to open the OpenXml package.</param> /// <param name="isEditable">In ReadWrite mode. False for Read only mode.</param> /// <returns>The cloned OpenXml package.</returns> public OpenXmlPackage Clone(Stream stream, bool isEditable) { return Clone(stream, isEditable, OpenSettings); } /// <summary> /// Creates a clone of this OpenXml package, opened on the given stream. /// </summary> /// <param name="stream">The IO stream on which to open the OpenXml package.</param> /// <param name="isEditable">In ReadWrite mode. False for Read only mode.</param> /// <param name="openSettings">The advanced settings for opening a document.</param> /// <returns>The cloned OpenXml package.</returns> public OpenXmlPackage Clone(Stream stream, bool isEditable, OpenSettings openSettings) { if (stream == null) throw new ArgumentNullException(nameof(stream)); // Use this OpenXml package's OpenSettings if none are provided. // This is more in line with cloning than providing the default // OpenSettings, i.e., unless the caller explicitly specifies // something, we'll later open the clone with this OpenXml // package's OpenSettings. if (openSettings == null) openSettings = OpenSettings; lock (_saveAndCloneLock) { // Save the contents of all parts and relationships that are contained // in the OpenXml package to make sure we clone a consistent state. // This will also invoke ThrowIfObjectDisposed(), so we don't need // to call it here. Save(); // Create new OpenXmlPackage backed by stream. Next, copy all document // parts (AddPart will copy the parts and their children in a recursive // fashion) and close/dispose the document (by leaving the scope of the // using statement). Finally, reopen the clone from the MemoryStream. // This way, writing the stream to a file, for example, directly after // returning from this method will not lead to issues with corrupt files // and a FileFormatException ("Compressed part has inconsistent data length") // thrown within OpenXmlPackage.OpenCore(string, bool) by the // this._metroPackage = Package.Open(path, ...); // assignment. using (OpenXmlPackage clone = CreateClone(stream)) { foreach (var part in this.Parts) clone.AddPart(part.OpenXmlPart, part.RelationshipId); } return OpenClone(stream, isEditable, openSettings); } } /// <summary> /// Creates a new OpenXmlPackage on the given stream. /// </summary> /// <param name="stream">The stream on which the concrete OpenXml package will be created.</param> /// <returns>A new instance of OpenXmlPackage.</returns> protected abstract OpenXmlPackage CreateClone(Stream stream); /// <summary> /// Opens the cloned OpenXml package on the given stream. /// </summary> /// <param name="stream">The stream on which the cloned OpenXml package will be opened.</param> /// <param name="isEditable">In ReadWrite mode. False for Read only mode.</param> /// <param name="openSettings">The advanced settings for opening a document.</param> /// <returns>A new instance of OpenXmlPackage.</returns> protected abstract OpenXmlPackage OpenClone(Stream stream, bool isEditable, OpenSettings openSettings); #endregion Stream-based cloning #region File-based cloning /// <summary> /// Creates a clone of this OpenXml package opened from the given file /// (which will be created by cloning this OpenXml package). /// The cloned OpenXml package is opened with the same settings, i.e., /// FileOpenAccess and OpenSettings, as this OpenXml package. /// </summary> /// <param name="path">The path and file name of the target document.</param> /// <returns>The cloned document.</returns> public OpenXmlPackage Clone(string path) { return Clone(path, FileOpenAccess == FileAccess.ReadWrite, OpenSettings); } /// <summary> /// Creates a clone of this OpenXml package opened from the given file /// (which will be created by cloning this OpenXml package). /// The cloned OpenXml package is opened with the same OpenSettings as /// this OpenXml package. /// </summary> /// <param name="path">The path and file name of the target document.</param> /// <param name="isEditable">In ReadWrite mode. False for Read only mode.</param> /// <returns>The cloned document.</returns> public OpenXmlPackage Clone(string path, bool isEditable) { return Clone(path, isEditable, OpenSettings); } /// <summary> /// Creates a clone of this OpenXml package opened from the given file (which /// will be created by cloning this OpenXml package). /// </summary> /// <param name="path">The path and file name of the target document.</param> /// <param name="isEditable">In ReadWrite mode. False for Read only mode.</param> /// <param name="openSettings">The advanced settings for opening a document.</param> /// <returns>The cloned document.</returns> public OpenXmlPackage Clone(string path, bool isEditable, OpenSettings openSettings) { if (path == null) throw new ArgumentNullException(nameof(path)); // Use this OpenXml package's OpenSettings if none are provided. // This is more in line with cloning than providing the default // OpenSettings, i.e., unless the caller explicitly specifies // something, we'll later open the clone with this OpenXml // package's OpenSettings. if (openSettings == null) openSettings = OpenSettings; lock (_saveAndCloneLock) { // Save the contents of all parts and relationships that are contained // in the OpenXml package to make sure we clone a consistent state. // This will also invoke ThrowIfObjectDisposed(), so we don't need // to call it here. Save(); // Use the same approach as for the streams-based cloning, i.e., close // and reopen the document. using (OpenXmlPackage clone = CreateClone(path)) { foreach (var part in this.Parts) clone.AddPart(part.OpenXmlPart, part.RelationshipId); } return OpenClone(path, isEditable, openSettings); } } /// <summary> /// Creates a new OpenXml package on the given file. /// </summary> /// <param name="path">The path and file name of the target OpenXml package.</param> /// <returns>A new instance of OpenXmlPackage.</returns> protected abstract OpenXmlPackage CreateClone(string path); /// <summary> /// Opens the cloned OpenXml package on the given file. /// </summary> /// <param name="path">The path and file name of the target OpenXml package.</param> /// <param name="isEditable">In ReadWrite mode. False for Read only mode.</param> /// <param name="openSettings">The advanced settings for opening a document.</param> /// <returns>A new instance of OpenXmlPackage.</returns> protected abstract OpenXmlPackage OpenClone(string path, bool isEditable, OpenSettings openSettings); #endregion File-based cloning #region Package-based cloning /// <summary> /// Creates a clone of this OpenXml package, opened on the specified instance /// of Package. The clone will be opened with the same OpenSettings as this /// OpenXml package. /// </summary> /// <param name="package">The specified instance of Package.</param> /// <returns>The cloned OpenXml package.</returns> public OpenXmlPackage Clone(Package package) { return Clone(package, OpenSettings); } /// <summary> /// Creates a clone of this OpenXml package, opened on the specified instance /// of Package. /// </summary> /// <param name="package">The specified instance of Package.</param> /// <param name="openSettings">The advanced settings for opening a document.</param> /// <returns>The cloned OpenXml package.</returns> public OpenXmlPackage Clone(Package package, OpenSettings openSettings) { if (package == null) throw new ArgumentNullException(nameof(package)); // Use this OpenXml package's OpenSettings if none are provided. // This is more in line with cloning than providing the default // OpenSettings, i.e., unless the caller explicitly specifies // something, we'll later open the clone with this OpenXml // package's OpenSettings. if (openSettings == null) openSettings = OpenSettings; lock (_saveAndCloneLock) { // Save the contents of all parts and relationships that are contained // in the OpenXml package to make sure we clone a consistent state. // This will also invoke ThrowIfObjectDisposed(), so we don't need // to call it here. Save(); // Create a new OpenXml package, copy this package's parts, and flush. // This is different from the stream and file-based cloning, because // we don't close the package here (whereas it will be closed in // stream and file-based cloning to make sure the underlying stream // or file can be read without any corruption issues directly after // having cloned the OpenXml package). OpenXmlPackage clone = CreateClone(package); foreach (var part in this.Parts) { clone.AddPart(part.OpenXmlPart, part.RelationshipId); } // TODO: Revisit. // package.Flush(); // Configure OpenSettings. clone.OpenSettings.AutoSave = openSettings.AutoSave; clone.OpenSettings.MarkupCompatibilityProcessSettings.ProcessMode = openSettings.MarkupCompatibilityProcessSettings.ProcessMode; clone.OpenSettings.MarkupCompatibilityProcessSettings.TargetFileFormatVersions = openSettings.MarkupCompatibilityProcessSettings.TargetFileFormatVersions; clone.MaxCharactersInPart = openSettings.MaxCharactersInPart; return clone; } } /// <summary> /// Creates a new instance of OpenXmlPackage on the specified instance /// of Package. /// </summary> /// <param name="package">The specified instance of Package.</param> /// <returns>A new instance of OpenXmlPackage.</returns> protected abstract OpenXmlPackage CreateClone(Package package); #endregion Package-based cloning #endregion saving and cloning #region Flat OPC private static readonly XNamespace pkg = "http://schemas.microsoft.com/office/2006/xmlPackage"; private static readonly XNamespace rel = "http://schemas.openxmlformats.org/package/2006/relationships"; /// <summary> /// Converts an OpenXml package in OPC format to string in Flat OPC format. /// </summary> /// <returns>The OpenXml package in Flat OPC format.</returns> public string ToFlatOpcString() { return ToFlatOpcDocument().ToString(); } /// <summary> /// Converts an OpenXml package in OPC format to an <see cref="XDocument"/> /// in Flat OPC format. /// </summary> /// <returns>The OpenXml package in Flat OPC format.</returns> public abstract XDocument ToFlatOpcDocument(); /// <summary> /// Converts an OpenXml package in OPC format to an <see cref="XDocument"/> /// in Flat OPC format. /// </summary> /// <param name="instruction">The processing instruction.</param> /// <returns>The OpenXml package in Flat OPC format.</returns> protected XDocument ToFlatOpcDocument(XProcessingInstruction instruction) { // Save the contents of all parts and relationships that are contained // in the OpenXml package to make sure we convert a consistent state. // This will also invoke ThrowIfObjectDisposed(), so we don't need // to call it here. Save(); // Create an XML document with a standalone declaration, processing // instruction (if not null), and a package root element with a // namespace declaration and one child element for each part. return new XDocument( new XDeclaration("1.0", "UTF-8", "yes"), instruction, new XElement( pkg + "package", new XAttribute(XNamespace.Xmlns + "pkg", pkg.ToString()), Package.GetParts().Select(part => GetContentsAsXml(part)))); } /// <summary> /// Gets the <see cref="PackagePart"/>'s contents as an <see cref="XElement"/>. /// </summary> /// <param name="part">The package part.</param> /// <returns>The corresponding <see cref="XElement"/>.</returns> private static XElement GetContentsAsXml(PackagePart part) { if (part.ContentType.EndsWith("xml")) { using (Stream stream = part.GetStream()) using (StreamReader streamReader = new StreamReader(stream)) using (XmlReader xmlReader = XmlReader.Create(streamReader)) return new XElement(pkg + "part", new XAttribute(pkg + "name", part.Uri), new XAttribute(pkg + "contentType", part.ContentType), new XElement(pkg + "xmlData", XElement.Load(xmlReader))); } else { using (Stream stream = part.GetStream()) using (BinaryReader binaryReader = new BinaryReader(stream)) { int len = (int)binaryReader.BaseStream.Length; byte[] byteArray = binaryReader.ReadBytes(len); // The following expression creates the base64String, then chunks // it to lines of 76 characters long. string base64String = System.Convert.ToBase64String(byteArray) .Select((c, i) => new { Character = c, Chunk = i / 76 }) .GroupBy(c => c.Chunk) .Aggregate( new StringBuilder(), (s, i) => s.Append( i.Aggregate( new StringBuilder(), (seed, it) => seed.Append(it.Character), sb => sb.ToString())).Append(Environment.NewLine), s => s.ToString()); return new XElement(pkg + "part", new XAttribute(pkg + "name", part.Uri), new XAttribute(pkg + "contentType", part.ContentType), new XAttribute(pkg + "compression", "store"), new XElement(pkg + "binaryData", base64String)); } } } /// <summary> /// Converts an <see cref="XDocument"/> in Flat OPC format to an OpenXml package /// stored on a <see cref="Stream"/>. /// </summary> /// <param name="document">The document in Flat OPC format.</param> /// <param name="stream">The <see cref="Stream"/> on which to store the OpenXml package.</param> /// <returns>The <see cref="Stream"/> containing the OpenXml package.</returns> protected static Stream FromFlatOpcDocumentCore(XDocument document, Stream stream) { using (Package package = Package.Open(stream, FileMode.Create, FileAccess.ReadWrite)) { FromFlatOpcDocumentCore(document, package); } return stream; } /// <summary> /// Converts an <see cref="XDocument"/> in Flat OPC format to an OpenXml package /// stored in a file. /// </summary> /// <param name="document">The document in Flat OPC format.</param> /// <param name="path">The path and file name of the file in which to store the OpenXml package.</param> /// <returns>The path and file name of the file containing the OpenXml package.</returns> protected static string FromFlatOpcDocumentCore(XDocument document, string path) { using (Package package = Package.Open(path, FileMode.Create, FileAccess.ReadWrite, FileShare.None)) { FromFlatOpcDocumentCore(document, package); } return path; } /// <summary> /// Converts an <see cref="XDocument"/> in Flat OPC format to an OpenXml package /// stored in a <see cref="Package"/>. /// </summary> /// <param name="document">The document in Flat OPC format.</param> /// <param name="package">The <see cref="Package"/> in which to store the OpenXml package.</param> /// <returns>The <see cref="Package"/> containing the OpenXml package.</returns> protected static Package FromFlatOpcDocumentCore(XDocument document, Package package) { // Add all parts (but not relationships). foreach (var xmlPart in document.Root .Elements() .Where(p => (string)p.Attribute(pkg + "contentType") != "application/vnd.openxmlformats-package.relationships+xml")) { string name = (string)xmlPart.Attribute(pkg + "name"); string contentType = (string)xmlPart.Attribute(pkg + "contentType"); if (contentType.EndsWith("xml")) { Uri uri = new Uri(name, UriKind.Relative); PackagePart part = package.CreatePart(uri, contentType, CompressionOption.SuperFast); using (Stream stream = part.GetStream(FileMode.Create)) using (XmlWriter xmlWriter = XmlWriter.Create(stream)) xmlPart.Element(pkg + "xmlData") .Elements() .First() .WriteTo(xmlWriter); } else { Uri uri = new Uri(name, UriKind.Relative); PackagePart part = package.CreatePart(uri, contentType, CompressionOption.SuperFast); using (Stream stream = part.GetStream(FileMode.Create)) using (BinaryWriter binaryWriter = new BinaryWriter(stream)) { string base64StringInChunks = (string)xmlPart.Element(pkg + "binaryData"); char[] base64CharArray = base64StringInChunks .Where(c => c != '\r' && c != '\n').ToArray(); byte[] byteArray = System.Convert.FromBase64CharArray( base64CharArray, 0, base64CharArray.Length); binaryWriter.Write(byteArray); } } } foreach (var xmlPart in document.Root.Elements()) { string name = (string)xmlPart.Attribute(pkg + "name"); string contentType = (string)xmlPart.Attribute(pkg + "contentType"); if (contentType == "application/vnd.openxmlformats-package.relationships+xml") { if (name == "/_rels/.rels") { // Add the package level relationships. foreach (XElement xmlRel in xmlPart.Descendants(rel + "Relationship")) { string id = (string)xmlRel.Attribute("Id"); string type = (string)xmlRel.Attribute("Type"); string target = (string)xmlRel.Attribute("Target"); string targetMode = (string)xmlRel.Attribute("TargetMode"); if (targetMode == "External") package.CreateRelationship( new Uri(target, UriKind.Absolute), TargetMode.External, type, id); else package.CreateRelationship( new Uri(target, UriKind.Relative), TargetMode.Internal, type, id); } } else { // Add part level relationships. string directory = name.Substring(0, name.IndexOf("/_rels")); string relsFilename = name.Substring(name.LastIndexOf('/')); string filename = relsFilename.Substring(0, relsFilename.IndexOf(".rels")); PackagePart fromPart = package.GetPart(new Uri(directory + filename, UriKind.Relative)); foreach (XElement xmlRel in xmlPart.Descendants(rel + "Relationship")) { string id = (string)xmlRel.Attribute("Id"); string type = (string)xmlRel.Attribute("Type"); string target = (string)xmlRel.Attribute("Target"); string targetMode = (string)xmlRel.Attribute("TargetMode"); if (targetMode == "External") fromPart.CreateRelationship( new Uri(target, UriKind.Absolute), TargetMode.External, type, id); else fromPart.CreateRelationship( new Uri(target, UriKind.Relative), TargetMode.Internal, type, id); } } } } // Save contents of all parts and relationships contained in package. package.Flush(); return package; } #endregion Flat OPC } /// <summary> /// Specifies event handlers that will handle OpenXmlPackage validation events and the OpenXmlPackageValidationEventArgs. /// </summary> // Building on Travis CI failed, saying that ObsoleteAttributeMessages does not contain a definition // for 'ObsoleteV1ValidationFunctionality'. Thus, we've replaced the member with its value. [Obsolete("This functionality is obsolete and will be removed from future version release. Please see OpenXmlValidator class for supported validation functionality.", false)] public class OpenXmlPackageValidationSettings { private EventHandler<OpenXmlPackageValidationEventArgs> valEventHandler; /// <summary> /// Gets the event handler. /// </summary> /// <returns></returns> internal EventHandler<OpenXmlPackageValidationEventArgs> GetEventHandler() { return this.valEventHandler; } /// <summary> /// Represents the callback method that will handle OpenXmlPackage validation events and the OpenXmlPackageValidationEventArgs. /// </summary> public event EventHandler<OpenXmlPackageValidationEventArgs> EventHandler { add { this.valEventHandler = (EventHandler<OpenXmlPackageValidationEventArgs>)Delegate.Combine(this.valEventHandler, value); } remove { this.valEventHandler = (EventHandler<OpenXmlPackageValidationEventArgs>)Delegate.Remove(this.valEventHandler, value); } } /// <summary> /// Gets or sets the file format version that the validation is targeting. /// </summary> internal FileFormatVersions FileFormat { get; set; } } /// <summary> /// Represents the Open XML package validation events. /// </summary> [SerializableAttribute] [Obsolete(ObsoleteAttributeMessages.ObsoleteV1ValidationFunctionality, false)] public sealed class OpenXmlPackageValidationEventArgs : EventArgs { private string _message; private string _partClassName; [NonSerializedAttribute] private OpenXmlPart _childPart; [NonSerializedAttribute] private OpenXmlPart _parentPart; internal OpenXmlPackageValidationEventArgs() { } /// <summary> /// Gets the message string of the event. /// </summary> public string Message { get { if (this._message == null && this.MessageId != null) { return ExceptionMessages.ResourceManager.GetString(this.MessageId); } else { return this._message; } } set { this._message = value; } } /// <summary> /// Gets the class name of the part. /// </summary> public string PartClassName { get { return _partClassName; } internal set { _partClassName = value; } } /// <summary> /// Gets the part that caused the event. /// </summary> public OpenXmlPart SubPart { get { return _childPart; } internal set { _childPart = value; } } /// <summary> /// Gets the part in which to process the validation. /// </summary> public OpenXmlPart Part { get { return _parentPart; } internal set { _parentPart = value; } } internal string MessageId { get; set; } /// <summary> /// The DataPartReferenceRelationship that caused the event. /// </summary> internal DataPartReferenceRelationship DataPartReferenceRelationship { get; set; } } /// <summary> /// Represents an Open XML package exception class for errors. /// </summary> [SerializableAttribute] public sealed class OpenXmlPackageException : Exception { /// <summary> /// Initializes a new instance of the OpenXmlPackageException class. /// </summary> public OpenXmlPackageException() : base() { } /// <summary> /// Initializes a new instance of the OpenXmlPackageException class using the supplied error message. /// </summary> /// <param name="message">The message that describes the error. </param> public OpenXmlPackageException(string message) : base(message) { } #if FEATURE_SERIALIZATION /// <summary> /// Initializes a new instance of the OpenXmlPackageException class using the supplied serialized data. /// </summary> /// <param name="info">The serialized object data about the exception being thrown.</param> /// <param name="context">The contextual information about the source or destination.</param> private OpenXmlPackageException(SerializationInfo info, StreamingContext context) : base(info, context) { } #endif /// <summary> /// Initializes a new instance of the OpenXmlPackageException class using the supplied error message and a reference to the inner exception that caused the current exception. /// </summary> /// <param name="message">The error message that indicates the reason for the exception.</param> /// <param name="innerException">The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified.</param> public OpenXmlPackageException(string message, Exception innerException) : base(message, innerException) { } } /// <summary> /// Represents the settings when opening a document. /// </summary> public class OpenSettings { bool? autoSave; MarkupCompatibilityProcessSettings _mcSettings; /// <summary> /// Gets or sets a value that indicates whether or not to auto save document modifications. /// The default value is true. /// </summary> public bool AutoSave { get { if (autoSave == null) { return true; } return (bool)autoSave; } set { autoSave = value; } } /// <summary> /// Gets or sets the value of the markup compatibility processing mode. /// </summary> public MarkupCompatibilityProcessSettings MarkupCompatibilityProcessSettings { get { if (_mcSettings == null) _mcSettings = new MarkupCompatibilityProcessSettings(MarkupCompatibilityProcessMode.NoProcess, FileFormatVersions.Office2007); return _mcSettings; } set { _mcSettings = value; } } /// <summary> /// Gets or sets a value that indicates the maximum number of allowable characters in an Open XML part. A zero (0) value indicates that there are no limits on the size of the part. A non-zero value specifies the maximum size, in characters. /// </summary> /// <remarks> /// This property allows you to mitigate denial of service attacks where the attacker submits a package with an extremely large Open XML part. By limiting the size of the part, you can detect the attack and recover reliably. /// </remarks> public long MaxCharactersInPart { get; set; } } /// <summary> /// Represents markup compatibility processing settings. /// </summary> public class MarkupCompatibilityProcessSettings { /// <summary> /// Gets the markup compatibility process mode. /// </summary> public MarkupCompatibilityProcessMode ProcessMode { get; internal set; } /// <summary> /// Gets the target file format versions. /// </summary> public FileFormatVersions TargetFileFormatVersions { get; internal set; } /// <summary> /// Creates a MarkupCompatibilityProcessSettings object using the supplied process mode and file format versions. /// </summary> /// <param name="processMode">The process mode.</param> /// <param name="targetFileFormatVersions">The file format versions. This parameter is ignored if the value is NoProcess.</param> public MarkupCompatibilityProcessSettings(MarkupCompatibilityProcessMode processMode, FileFormatVersions targetFileFormatVersions) { ProcessMode = processMode; TargetFileFormatVersions = targetFileFormatVersions; } private MarkupCompatibilityProcessSettings() { ProcessMode = MarkupCompatibilityProcessMode.NoProcess; TargetFileFormatVersions = FileFormatVersions.Office2007; } } /// <summary> /// Specifies the mode in which to process the markup compatibility tags in the document. /// </summary> public enum MarkupCompatibilityProcessMode { /// <summary> /// Do not process MarkupCompatibility tags. /// </summary> NoProcess = 0, /// <summary> /// Process the loaded parts. /// </summary> ProcessLoadedPartsOnly, /// <summary> /// Process all the parts in the package. /// </summary> ProcessAllParts, } /// <summary> /// Traversal parts in the <see cref="OpenXmlPackage"/> by breadth-first. /// </summary> internal class OpenXmlPackagePartIterator : IEnumerable<OpenXmlPart> { private OpenXmlPackage _package; #region Constructor /// <summary> /// Initializes a new instance of the OpenXmlPackagePartIterator class using the supplied OpenXmlPackage class. /// </summary> /// <param name="package">The OpenXmlPackage to use to enumerate parts.</param> public OpenXmlPackagePartIterator(OpenXmlPackage package) { Debug.Assert(package != null); this._package = package; } #endregion #region IEnumerable<OpenXmlPart> Members /// <summary> /// Gets an enumerator for parts in the whole package. /// </summary> /// <returns></returns> public IEnumerator<OpenXmlPart> GetEnumerator() { return GetPartsByBreadthFirstTraversal(); } // Traverses the parts graph by breath-first private IEnumerator<OpenXmlPart> GetPartsByBreadthFirstTraversal() { Debug.Assert(_package != null); var returnedParts = new List<OpenXmlPart>(); Queue<OpenXmlPart> tmpQueue = new Queue<OpenXmlPart>(); // Enqueue child parts of the package. foreach (var idPartPair in _package.Parts) { tmpQueue.Enqueue(idPartPair.OpenXmlPart); } while (tmpQueue.Count > 0) { var part = tmpQueue.Dequeue(); returnedParts.Add(part); foreach (var subIdPartPair in part.Parts) { if (!tmpQueue.Contains(subIdPartPair.OpenXmlPart) && !returnedParts.Contains(subIdPartPair.OpenXmlPart)) { tmpQueue.Enqueue(subIdPartPair.OpenXmlPart); } } } return returnedParts.GetEnumerator(); } #endregion #region IEnumerable Members /// <summary> /// Gets an enumerator for parts in the whole package. /// </summary> /// <returns></returns> System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { return GetEnumerator(); } #endregion } }
Java
/************************************************************************** * Mask.java is part of Touch4j 4.0. Copyright 2012 Emitrom LLC * * 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. **************************************************************************/ package com.emitrom.touch4j.client.ui; import com.emitrom.touch4j.client.core.Component; import com.emitrom.touch4j.client.core.config.Attribute; import com.emitrom.touch4j.client.core.config.Event; import com.emitrom.touch4j.client.core.config.XType; import com.emitrom.touch4j.client.core.handlers.CallbackRegistration; import com.emitrom.touch4j.client.core.handlers.mask.MaskTapHandler; import com.google.gwt.core.client.JavaScriptObject; /** * A simple class used to mask any Container. This should rarely be used * directly, instead look at the Container.mask configuration. * * @see <a href=http://docs.sencha.com/touch/2-0/#!/api/Ext.Mask>Ext.Mask</a> */ public class Mask extends Component { @Override protected native void init()/*-{ var c = new $wnd.Ext.Mask(); this.@com.emitrom.touch4j.client.core.Component::configPrototype = c.initialConfig; }-*/; @Override public String getXType() { return XType.MASK.getValue(); } @Override protected native JavaScriptObject create(JavaScriptObject config) /*-{ return new $wnd.Ext.Mask(config); }-*/; public Mask() { } protected Mask(JavaScriptObject jso) { super(jso); } /** * True to make this mask transparent. * * Defaults to: false * * @param value */ public void setTransparent(String value) { setAttribute(Attribute.TRANSPARENT.getValue(), value, true); } /** * A tap event fired when a user taps on this mask * * @param handler */ public CallbackRegistration addTapHandler(MaskTapHandler handler) { return this.addWidgetListener(Event.TAP.getValue(), handler.getJsoPeer()); } }
Java
// lightbox_plus.js // == written by Takuya Otani <takuya.otani@gmail.com> === // == Copyright (C) 2006 SimpleBoxes/SerendipityNZ Ltd. == /* Copyright (C) 2006 Takuya Otani/SimpleBoxes - http://serennz.cool.ne.jp/sb/ Copyright (C) 2006 SerendipityNZ - http://serennz.cool.ne.jp/snz/ This script is licensed under the Creative Commons Attribution 2.5 License http://creativecommons.org/licenses/by/2.5/ basically, do anything you want, just leave my name and link. */ /* Original script : Lightbox JS : Fullsize Image Overlays Copyright (C) 2005 Lokesh Dhakar - http://www.huddletogether.com For more information on this script, visit: http://huddletogether.com/projects/lightbox/ */ // ver. 20061027 - fixed a bug ( not work at xhml documents on Netscape7 ) // ver. 20061026 - fixed bugs // ver. 20061010 - implemented image set feature // ver. 20060921 - fixed a bug / added overall view // ver. 20060920 - added flag to prevent mouse wheel event // ver. 20060919 - fixed a bug // ver. 20060918 - implemented functionality of wheel zoom & drag'n drop // ver. 20060131 - fixed a bug to work correctly on Internet Explorer for Windows // ver. 20060128 - implemented functionality of echoic word // ver. 20060120 - implemented functionality of caption and close button function WindowSize() { // window size object this.w = 0; this.h = 0; return this.update(); } WindowSize.prototype.update = function() { var d = document; this.w = (window.innerWidth) ? window.innerWidth : (d.documentElement && d.documentElement.clientWidth) ? d.documentElement.clientWidth : d.body.clientWidth; this.h = (window.innerHeight) ? window.innerHeight : (d.documentElement && d.documentElement.clientHeight) ? d.documentElement.clientHeight : d.body.clientHeight; return this; }; function PageSize() { // page size object this.win = new WindowSize(); this.w = 0; this.h = 0; return this.update(); } PageSize.prototype.update = function() { var d = document; this.w = (window.innerWidth && window.scrollMaxX) ? window.innerWidth + window.scrollMaxX : (d.body.scrollWidth > d.body.offsetWidth) ? d.body.scrollWidth : d.body.offsetWidt; this.h = (window.innerHeight && window.scrollMaxY) ? window.innerHeight + window.scrollMaxY : (d.body.scrollHeight > d.body.offsetHeight) ? d.body.scrollHeight : d.body.offsetHeight; this.win.update(); if (this.w < this.win.w) this.w = this.win.w; if (this.h < this.win.h) this.h = this.win.h; return this; }; function PagePos() { // page position object this.x = 0; this.y = 0; return this.update(); } PagePos.prototype.update = function() { var d = document; this.x = (window.pageXOffset) ? window.pageXOffset : (d.documentElement && d.documentElement.scrollLeft) ? d.documentElement.scrollLeft : (d.body) ? d.body.scrollLeft : 0; this.y = (window.pageYOffset) ? window.pageYOffset : (d.documentElement && d.documentElement.scrollTop) ? d.documentElement.scrollTop : (d.body) ? d.body.scrollTop : 0; return this; }; function LightBox(option) { var self = this; self._imgs = []; self._sets = []; self._wrap = null; self._box = null; self._img = null; self._open = -1; self._page = new PageSize(); self._pos = new PagePos(); self._zoomimg = null; self._expandable = false; self._expanded = false; self._funcs = {'move':null,'up':null,'drag':null,'wheel':null,'dbl':null}; self._level = 1; self._curpos = {x:0,y:0}; self._imgpos = {x:0,y:0}; self._minpos = {x:0,y:0}; self._expand = option.expandimg; self._shrink = option.shrinkimg; self._resizable = option.resizable; self._timer = null; self._indicator = null; self._overall = null; self._openedset = null; self._prev = null; self._next = null; self._hiding = []; self._first = false; return self._init(option); } LightBox.prototype = { _init : function(option) { var self = this; var d = document; if (!d.getElementsByTagName) return; if (Browser.isMacIE) return self; var links = d.getElementsByTagName("a"); for (var i = 0; i < links.length; i++) { var anchor = links[i]; var num = self._imgs.length; var rel = String(anchor.getAttribute("rel")).toLowerCase(); if (!anchor.getAttribute("href") || !rel.match('lightbox')) continue; // initialize item self._imgs[num] = { src:anchor.getAttribute("href"), w:-1, h:-1, title:'', cls:anchor.className, set:rel }; if (anchor.getAttribute("title")) self._imgs[num].title = anchor.getAttribute("title"); else if (anchor.firstChild && anchor.firstChild.getAttribute && anchor.firstChild.getAttribute("title")) self._imgs[num].title = anchor.firstChild.getAttribute("title"); anchor.onclick = self._genOpener(num); // set closure to onclick event if (rel != 'lightbox') { if (!self._sets[rel]) self._sets[rel] = []; self._sets[rel].push(num); } } var body = d.getElementsByTagName("body")[0]; self._wrap = self._createWrapOn(body, option.loadingimg); self._box = self._createBoxOn(body, option); self._img = self._box.firstChild; self._zoomimg = d.getElementById('actionImage'); return self; }, _genOpener : function(num) { var self = this; return function() { self._show(num); return false; } }, _createWrapOn : function(obj, imagePath) { var self = this; if (!obj) return null; // create wrapper object, translucent background var wrap = document.createElement('div'); obj.appendChild(wrap); wrap.id = 'overlay'; wrap.style.display = 'none'; wrap.style.position = 'fixed'; wrap.style.top = '0px'; wrap.style.left = '0px'; wrap.style.zIndex = '50'; wrap.style.width = '100%'; wrap.style.height = '100%'; if (Browser.isWinIE) wrap.style.position = 'absolute'; Event.register(wrap, "click", function(evt) { self._close(evt); }); // create loading image, animated image var imag = new Image; imag.onload = function() { var spin = document.createElement('img'); wrap.appendChild(spin); spin.id = 'loadingImage'; spin.src = imag.src; spin.style.position = 'relative'; self._set_cursor(spin); Event.register(spin, 'click', function(evt) { self._close(evt); }); imag.onload = function() { }; }; if (imagePath != '') imag.src = imagePath; return wrap; }, _createBoxOn : function(obj, option) { var self = this; if (!obj) return null; // create lightbox object, frame rectangle var box = document.createElement('div'); obj.appendChild(box); box.id = 'lightbox'; box.style.display = 'none'; box.style.position = 'absolute'; box.style.zIndex = '60'; // create image object to display a target image var img = document.createElement('img'); box.appendChild(img); img.id = 'lightboxImage'; self._set_cursor(img); Event.register(img, 'mouseover', function() { self._show_action(); }); Event.register(img, 'mouseout', function() { self._hide_action(); }); Event.register(img, 'click', function(evt) { self._close(evt); }); // create hover navi - prev if (option.previmg) { var prevLink = document.createElement('img'); box.appendChild(prevLink); prevLink.id = 'prevLink'; prevLink.style.display = 'none'; prevLink.style.position = 'absolute'; prevLink.style.left = '9px'; prevLink.style.zIndex = '70'; prevLink.src = option.previmg; self._prev = prevLink; Event.register(prevLink, 'mouseover', function() { self._show_action(); }); Event.register(prevLink, 'click', function() { self._show_next(-1); }); } // create hover navi - next if (option.nextimg) { var nextLink = document.createElement('img'); box.appendChild(nextLink); nextLink.id = 'nextLink'; nextLink.style.display = 'none'; nextLink.style.position = 'absolute'; nextLink.style.right = '9px'; nextLink.style.zIndex = '70'; nextLink.src = option.nextimg; self._next = nextLink; Event.register(nextLink, 'mouseover', function() { self._show_action(); }); Event.register(nextLink, 'click', function() { self._show_next(+1); }); } // create zoom indicator var zoom = document.createElement('img'); box.appendChild(zoom); zoom.id = 'actionImage'; zoom.style.display = 'none'; zoom.style.position = 'absolute'; zoom.style.top = '15px'; zoom.style.left = '15px'; zoom.style.zIndex = '70'; self._set_cursor(zoom); zoom.src = self._expand; Event.register(zoom, 'mouseover', function() { self._show_action(); }); Event.register(zoom, 'click', function() { self._zoom(); }); Event.register(window, 'resize', function() { self._set_size(true); }); // create close button if (option.closeimg) { var btn = document.createElement('img'); box.appendChild(btn); btn.id = 'closeButton'; btn.style.display = 'inline'; btn.style.position = 'absolute'; btn.style.right = '9px'; btn.style.top = '10px'; btn.style.zIndex = '80'; btn.src = option.closeimg; self._set_cursor(btn); Event.register(btn, 'click', function(evt) { self._close(evt); }); } // caption text var caption = document.createElement('span'); box.appendChild(caption); caption.id = 'lightboxCaption'; caption.style.display = 'none'; caption.style.position = 'absolute'; caption.style.zIndex = '80'; // create effect image /* if (!option.effectpos) option.effectpos = {x:0,y:0}; else { if (option.effectpos.x == '') option.effectpos.x = 0; if (option.effectpos.y == '') option.effectpos.y = 0; } var effect = new Image; effect.onload = function() { var effectImg = document.createElement('img'); box.appendChild(effectImg); effectImg.id = 'effectImage'; effectImg.src = effect.src; if (option.effectclass) effectImg.className = option.effectclass; effectImg.style.position = 'absolute'; effectImg.style.display = 'none'; effectImg.style.left = [option.effectpos.x,'px'].join('');; effectImg.style.top = [option.effectpos.y,'px'].join(''); effectImg.style.zIndex = '90'; self._set_cursor(effectImg); Event.register(effectImg,'click',function() { effectImg.style.display = 'none'; }); }; if (option.effectimg != '') effect.src = option.effectimg;*/ if (self._resizable) { var overall = document.createElement('div'); obj.appendChild(overall); overall.id = 'lightboxOverallView'; overall.style.display = 'none'; overall.style.position = 'absolute'; overall.style.zIndex = '70'; self._overall = overall; var indicator = document.createElement('div'); obj.appendChild(indicator); indicator.id = 'lightboxIndicator'; indicator.style.display = 'none'; indicator.style.position = 'absolute'; indicator.style.zIndex = '80'; self._indicator = indicator; } return box; }, _set_photo_size : function() { var self = this; if (self._open == -1) return; var targ = { w:self._page.win.w - 30, h:self._page.win.h - 30 }; var zoom = { x:15, y:15 }; var navi = { p:9, n:9, y:0 }; if (!self._expanded) { // shrink image with the same aspect var orig = { w:self._imgs[self._open].w, h:self._imgs[self._open].h }; var ratio = 1.0; if ((orig.w >= targ.w || orig.h >= targ.h) && orig.h && orig.w) ratio = ((targ.w / orig.w) < (targ.h / orig.h)) ? targ.w / orig.w : targ.h / orig.h; self._img.width = Math.floor(orig.w * ratio); self._img.height = Math.floor(orig.h * ratio); self._expandable = (ratio < 1.0) ? true : false; if (self._resizable) self._expandable = true; if (Browser.isWinIE) self._box.style.display = "block"; self._imgpos.x = self._pos.x + (targ.w - self._img.width) / 2; self._imgpos.y = self._pos.y + (targ.h - self._img.height) / 2; navi.y = Math.floor(self._img.height / 2) - 10; self._show_caption(true); self._show_overall(false); } else { // zoomed or actual sized image var width = parseInt(self._imgs[self._open].w * self._level); var height = parseInt(self._imgs[self._open].h * self._level); self._minpos.x = self._pos.x + targ.w - width; self._minpos.y = self._pos.y + targ.h - height; if (width <= targ.w) self._imgpos.x = self._pos.x + (targ.w - width) / 2; else { if (self._imgpos.x > self._pos.x) self._imgpos.x = self._pos.x; else if (self._imgpos.x < self._minpos.x) self._imgpos.x = self._minpos.x; zoom.x = 15 + self._pos.x - self._imgpos.x; navi.p = self._pos.x - self._imgpos.x - 5; navi.n = width - self._page.win.w + self._imgpos.x + 25; if (Browser.isWinIE) navi.n -= 10; } if (height <= targ.h) { self._imgpos.y = self._pos.y + (targ.h - height) / 2; navi.y = Math.floor(self._img.height / 2) - 10; } else { if (self._imgpos.y > self._pos.y) self._imgpos.y = self._pos.y; else if (self._imgpos.y < self._minpos.y) self._imgpos.y = self._minpos.y; zoom.y = 15 + self._pos.y - self._imgpos.y; navi.y = Math.floor(targ.h / 2) - 10 + self._pos.y - self._imgpos.y; } self._img.width = width; self._img.height = height; self._show_caption(false); self._show_overall(true); } self._box.style.left = [self._imgpos.x,'px'].join(''); self._box.style.top = [self._imgpos.y,'px'].join(''); self._zoomimg.style.left = [zoom.x,'px'].join(''); self._zoomimg.style.top = [zoom.y,'px'].join(''); self._wrap.style.left = self._pos.x; if (self._prev && self._next) { self._prev.style.left = [navi.p,'px'].join(''); self._next.style.right = [navi.n,'px'].join(''); self._prev.style.top = self._next.style.top = [navi.y,'px'].join(''); } }, _show_overall : function(visible) { var self = this; if (self._overall == null) return; if (visible) { if (self._open == -1) return; var base = 100; var outer = { w:0, h:0, x:0, y:0 }; var inner = { w:0, h:0, x:0, y:0 }; var orig = { w:self._img.width , h:self._img.height }; var targ = { w:self._page.win.w - 30, h:self._page.win.h - 30 }; var max = orig.w; if (max < orig.h) max = orig.h; if (max < targ.w) max = targ.w; if (max < targ.h) max = targ.h; if (max < 1) return; outer.w = parseInt(orig.w / max * base); outer.h = parseInt(orig.h / max * base); inner.w = parseInt(targ.w / max * base); inner.h = parseInt(targ.h / max * base); outer.x = self._pos.x + targ.w - base - 20; outer.y = self._pos.y + targ.h - base - 20; inner.x = outer.x - parseInt((self._imgpos.x - self._pos.x) / max * base); inner.y = outer.y - parseInt((self._imgpos.y - self._pos.y) / max * base); self._overall.style.left = [outer.x,'px'].join(''); self._overall.style.top = [outer.y,'px'].join(''); self._overall.style.width = [outer.w,'px'].join(''); self._overall.style.height = [outer.h,'px'].join(''); self._indicator.style.left = [inner.x,'px'].join(''); self._indicator.style.top = [inner.y,'px'].join(''); self._indicator.style.width = [inner.w,'px'].join(''); self._indicator.style.height = [inner.h,'px'].join(''); self._overall.style.display = 'block' self._indicator.style.display = 'block'; } else { self._overall.style.display = 'none'; self._indicator.style.display = 'none'; } }, _set_size : function(onResize) { var self = this; if (self._open == -1) return; self._page.update(); self._pos.update(); var spin = self._wrap.firstChild; if (spin) { var top = (self._page.win.h - spin.height) / 2; if (self._wrap.style.position == 'absolute') top += self._pos.y; spin.style.top = [top,'px'].join(''); spin.style.left = [(self._page.win.w - spin.width - 30) / 2,'px'].join(''); } if (Browser.isWinIE) { self._wrap.style.width = [self._page.win.w,'px'].join(''); self._wrap.style.height = [self._page.win.h,'px'].join(''); self._wrap.style.top = [self._pos.y,'px'].join(''); } if (onResize) self._set_photo_size(); }, _set_cursor : function(obj) { var self = this; if (Browser.isWinIE && !Browser.isNewIE) return; obj.style.cursor = 'pointer'; }, _current_setindex : function() { var self = this; if (!self._openedset) return -1; var list = self._sets[self._openedset]; for (var i = 0,n = list.length; i < n; i++) { if (list[i] == self._open) return i; } return -1; }, _get_setlength : function() { var self = this; if (!self._openedset) return -1; return self._sets[self._openedset].length; }, _show_action : function() { var self = this; if (self._open == -1 || !self._expandable) return; if (!self._zoomimg) return; self._zoomimg.src = (self._expanded) ? self._shrink : self._expand; self._zoomimg.style.display = 'inline'; var check = self._current_setindex(); if (check > -1) { if (check > 0) self._prev.style.display = 'inline'; if (check < self._get_setlength() - 1) self._next.style.display = 'inline'; } }, _hide_action : function() { var self = this; if (self._zoomimg) self._zoomimg.style.display = 'none'; if (self._open > -1 && self._expanded) self._dragstop(null); if (self._prev) self._prev.style.display = 'none'; if (self._next) self._next.style.display = 'none'; }, _zoom : function() { var self = this; var closeBtn = document.getElementById('closeButton'); if (self._expanded) { self._reset_func(); self._expanded = false; if (closeBtn) closeBtn.style.display = 'inline'; } else if (self._open > -1) { self._level = 1; self._imgpos.x = self._pos.x; self._imgpos.y = self._pos.y; self._expanded = true; self._funcs.drag = function(evt) { self._dragstart(evt) }; self._funcs.dbl = function(evt) { self._close(null) }; if (self._resizable) { self._funcs.wheel = function(evt) { self._onwheel(evt) }; Event.register(self._box, 'mousewheel', self._funcs.wheel); } Event.register(self._img, 'mousedown', self._funcs.drag); Event.register(self._img, 'dblclick', self._funcs.dbl); if (closeBtn) closeBtn.style.display = 'none'; } self._set_photo_size(); self._show_action(); }, _reset_func : function() { var self = this; if (self._funcs.wheel != null) Event.deregister(self._box, 'mousewheel', self._funcs.wheel); if (self._funcs.move != null) Event.deregister(self._img, 'mousemove', self._funcs.move); if (self._funcs.up != null) Event.deregister(self._img, 'mouseup', self._funcs.up); if (self._funcs.drag != null) Event.deregister(self._img, 'mousedown', self._funcs.drag); if (self._funcs.dbl != null) Event.deregister(self._img, 'dblclick', self._funcs.dbl); self._funcs = {'move':null,'up':null,'drag':null,'wheel':null,'dbl':null}; }, _onwheel : function(evt) { var self = this; var delta = 0; evt = Event.getEvent(evt); if (evt.wheelDelta) delta = event.wheelDelta / -120; else if (evt.detail) delta = evt.detail / 3; if (Browser.isOpera) delta = - delta; var step = (self._level < 1) ? 0.1 : (self._level < 2) ? 0.25 : (self._level < 4) ? 0.5 : 1; self._level = (delta > 0) ? self._level + step : self._level - step; if (self._level > 8) self._level = 8; else if (self._level < 0.5) self._level = 0.5; self._set_photo_size(); return Event.stop(evt); }, _dragstart : function(evt) { var self = this; evt = Event.getEvent(evt); self._curpos.x = evt.screenX; self._curpos.y = evt.screenY; self._funcs.move = function(evnt) { self._dragging(evnt); }; self._funcs.up = function(evnt) { self._dragstop(evnt); }; Event.register(self._img, 'mousemove', self._funcs.move); Event.register(self._img, 'mouseup', self._funcs.up); return Event.stop(evt); }, _dragging : function(evt) { var self = this; evt = Event.getEvent(evt); self._imgpos.x += evt.screenX - self._curpos.x; self._imgpos.y += evt.screenY - self._curpos.y; self._curpos.x = evt.screenX; self._curpos.y = evt.screenY; self._set_photo_size(); return Event.stop(evt); }, _dragstop : function(evt) { var self = this; evt = Event.getEvent(evt); if (self._funcs.move != null) Event.deregister(self._img, 'mousemove', self._funcs.move); if (self._funcs.up != null) Event.deregister(self._img, 'mouseup', self._funcs.up); self._funcs.move = null; self._funcs.up = null; self._set_photo_size(); return (evt) ? Event.stop(evt) : false; }, _show_caption : function(enable) { var self = this; var caption = document.getElementById('lightboxCaption'); if (!caption) return; if (caption.innerHTML.length == 0 || !enable) { caption.style.display = 'none'; } else { // now display caption caption.style.top = [self._img.height + 10,'px'].join(''); // 10 is top margin of lightbox caption.style.left = '0px'; caption.style.width = [self._img.width + 20,'px'].join(''); // 20 is total side margin of lightbox caption.style.display = 'block'; } }, _toggle_wrap : function(flag) { var self = this; self._wrap.style.display = flag ? "block" : "none"; if (self._hiding.length == 0 && !self._first) { // some objects may overlap on overlay, so we hide them temporarily. var tags = ['select','embed','object']; for (var i = 0,n = tags.length; i < n; i++) { var elem = document.getElementsByTagName(tags[i]); for (var j = 0,m = elem.length; j < m; j++) { // check the original value at first. when alredy hidden, dont touch them var check = elem[j].style.visibility; if (!check) { if (elem[j].currentStyle) check = elem[j].currentStyle['visibility']; else if (document.defaultView) check = document.defaultView.getComputedStyle(elem[j], '').getPropertyValue('visibility'); } if (check == 'hidden') continue; self._hiding.push(elem[j]); } } self._first = true; } for (var i = 0,n = self._hiding.length; i < n; i++) self._hiding[i].style.visibility = flag ? "hidden" : "visible"; }, _show : function(num) { var self = this; var imag = new Image; if (num < 0 || num >= self._imgs.length) return; var loading = document.getElementById('loadingImage'); var caption = document.getElementById('lightboxCaption'); // var effect = document.getElementById('effectImage'); self._open = num; // set opened image number self._set_size(false); // calc and set wrapper size self._toggle_wrap(true); if (loading) loading.style.display = 'inline'; imag.onload = function() { if (self._imgs[self._open].w == -1) { // store original image width and height self._imgs[self._open].w = imag.width; self._imgs[self._open].h = imag.height; } /* if (effect) { effect.style.display = (!effect.className || self._imgs[self._open].cls == effect.className) ? 'block' : 'none'; }*/ if (caption) try { caption.innerHTML = self._imgs[self._open].title; } catch(e) { } self._set_photo_size(); // calc and set lightbox size self._hide_action(); self._box.style.display = "block"; self._img.src = imag.src; self._img.setAttribute('title', self._imgs[self._open].title); self._timer = window.setInterval(function() { self._set_size(true) }, 100); if (loading) loading.style.display = 'none'; if (self._imgs[self._open].set != 'lightbox') { var set = self._imgs[self._open].set; if (self._sets[set].length > 1) self._openedset = set; if (!self._prev || !self._next) self._openedset = null; } }; self._expandable = false; self._expanded = false; imag.src = self._imgs[self._open].src; }, _close_box : function() { var self = this; self._open = -1; self._openedset = null; self._hide_action(); self._hide_action(); self._reset_func(); self._show_overall(false); self._box.style.display = "none"; if (self._timer != null) { window.clearInterval(self._timer); self._timer = null; } }, _show_next : function(direction) { var self = this; if (!self._openedset) return self._close(null); var index = self._current_setindex() + direction; var targ = self._sets[self._openedset][index]; self._close_box(); self._show(targ); }, _close : function(evt) { var self = this; if (evt != null) { evt = Event.getEvent(evt); var targ = evt.target || evt.srcElement; if (targ && targ.getAttribute('id') == 'lightboxImage' && self._expanded) return; } self._close_box(); self._toggle_wrap(false); } }; Event.register(window, "load", function() { var lightbox = new LightBox({ loadingimg:'lightbox/loading.gif', expandimg:'lightbox/expand.gif', shrinkimg:'lightbox/shrink.gif', previmg:'lightbox/prev.gif', nextimg:'lightbox/next.gif', /* effectpos:{x:-40,y:-20}, effectclass:'effectable',*/ closeimg:'lightbox/close.gif', resizable:true }); });
Java
/* * Copyright 2017-present Facebook, Inc. * * 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. */ package com.facebook.buck.util.trace.uploader.launcher; import com.facebook.buck.core.model.BuildId; import com.facebook.buck.log.Logger; import com.facebook.buck.util.env.BuckClasspath; import com.facebook.buck.util.trace.uploader.types.CompressionType; import com.google.common.base.Strings; import java.io.IOException; import java.net.URI; import java.nio.file.Path; /** Utility to upload chrome trace in background. */ public class UploaderLauncher { private static final Logger LOG = Logger.get(UploaderLauncher.class); /** Upload chrome trace in background process which runs even after current process dies. */ public static void uploadInBackground( BuildId buildId, Path traceFilePath, String traceFileKind, URI traceUploadUri, Path logFile, CompressionType compressionType) { LOG.debug("Uploading build trace in the background. Upload will log to %s", logFile); String buckClasspath = BuckClasspath.getBuckClasspathFromEnvVarOrNull(); if (Strings.isNullOrEmpty(buckClasspath)) { LOG.error( BuckClasspath.ENV_VAR_NAME + " env var is not set. Will not upload the trace file."); return; } try { String[] args = { "java", "-cp", buckClasspath, "com.facebook.buck.util.trace.uploader.Main", "--buildId", buildId.toString(), "--traceFilePath", traceFilePath.toString(), "--traceFileKind", traceFileKind, "--baseUrl", traceUploadUri.toString(), "--log", logFile.toString(), "--compressionType", compressionType.name(), }; Runtime.getRuntime().exec(args); } catch (IOException e) { LOG.error(e, e.getMessage()); } } }
Java
/* * Copyright 2013, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.jf.dexlib2.builder; import org.jf.dexlib2.*; import org.jf.dexlib2.builder.instruction.*; import org.jf.dexlib2.iface.instruction.*; import java.util.*; import javax.annotation.*; public abstract class BuilderSwitchPayload extends BuilderInstruction implements SwitchPayload { @Nullable MethodLocation referrer; protected BuilderSwitchPayload(@Nonnull Opcode opcode) { super(opcode); } @Nonnull public MethodLocation getReferrer() { if (referrer == null) { throw new IllegalStateException("The referrer has not been set yet"); } return referrer; } @Nonnull @Override public abstract List<? extends BuilderSwitchElement> getSwitchElements(); }
Java
fraggle-sample ============== A demonstration of Fraggle capabilities. [Fraggle](http://fraggle.sefford.com/) is a wrapper to Android's FragmentManager that encapsulates common logic used over the applications. This project is just a sample project demonstration of its capabilities Usage ----- Clone the repo and execute `mvn clean install`. It requires internet connection to download its dependencies, Fraggle itself. You can install it to an emulator or phone via `mvn android:deploy android:run`. It requires an Android device with API 15 or superior. Fraggle-Sample will not require any specific permissions Explanation ----------- Once you open the Sample you will be presented with an Activity that shows a Fragment. The Fragment number will be incremental from the current Fragment. The name and the strip of the bottom serves as identification of different Fragments. Clicking on the button will create and add a new Fragment configurable via some options. You are presented every time with four selectable options: - Selecting `Make it return to First` will create a fragment whose onBackTarget returns the Fragment #1 to showcase the custom flow return. - If `Is Single Instance` is selected will create a `Fragment #1` instance and will force Fraggle to pop back to the initial Fragment. - `Show a Toast on Back` will open a Fragment that first will show a Toast, then go back to demonstrate the feature of custom actions on backPressed. - If `Is Entry Fragment` a Fragment will create a Fragment that will trigger Fraggle to reach an Activity `finish()` termination by pressing the back buttons. For more information about the concepts discussed, visit [Fraggle page](http://fraggle.sefford.com/) License ------- Copyright 2014 Sefford. 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.
Java
#!/usr/bin/python # -*- coding: utf-8 -*- """Tests for the Google Chrome Cache files event formatter.""" import unittest from plaso.formatters import chrome_cache from tests.formatters import test_lib class ChromeCacheEntryEventFormatterTest(test_lib.EventFormatterTestCase): """Tests for the Chrome Cache entry event formatter.""" def testInitialization(self): """Tests the initialization.""" event_formatter = chrome_cache.ChromeCacheEntryEventFormatter() self.assertIsNotNone(event_formatter) def testGetFormatStringAttributeNames(self): """Tests the GetFormatStringAttributeNames function.""" event_formatter = chrome_cache.ChromeCacheEntryEventFormatter() expected_attribute_names = [u'original_url'] self._TestGetFormatStringAttributeNames( event_formatter, expected_attribute_names) # TODO: add test for GetMessages. if __name__ == '__main__': unittest.main()
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="ro"> <head> <!-- Generated by javadoc (version 1.7.0_07) on Tue May 27 14:37:25 EEST 2014 --> <title>Uses of Interface net.sf.jasperreports.engine.export.oasis.GenericElementOdtHandler (JasperReports 5.6.0 API)</title> <meta name="date" content="2014-05-27"> <link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface net.sf.jasperreports.engine.export.oasis.GenericElementOdtHandler (JasperReports 5.6.0 API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../net/sf/jasperreports/engine/export/oasis/GenericElementOdtHandler.html" title="interface in net.sf.jasperreports.engine.export.oasis">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?net/sf/jasperreports/engine/export/oasis/class-use/GenericElementOdtHandler.html" target="_top">Frames</a></li> <li><a href="GenericElementOdtHandler.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Interface net.sf.jasperreports.engine.export.oasis.GenericElementOdtHandler" class="title">Uses of Interface<br>net.sf.jasperreports.engine.export.oasis.GenericElementOdtHandler</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../../net/sf/jasperreports/engine/export/oasis/GenericElementOdtHandler.html" title="interface in net.sf.jasperreports.engine.export.oasis">GenericElementOdtHandler</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#net.sf.jasperreports.components.iconlabel">net.sf.jasperreports.components.iconlabel</a></td> <td class="colLast"> <div class="block">Contains classes for the built-in Icon Label component.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#net.sf.jasperreports.components.map">net.sf.jasperreports.components.map</a></td> <td class="colLast"> <div class="block">Contains classes for the built-in Google Map component.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="net.sf.jasperreports.components.iconlabel"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../net/sf/jasperreports/engine/export/oasis/GenericElementOdtHandler.html" title="interface in net.sf.jasperreports.engine.export.oasis">GenericElementOdtHandler</a> in <a href="../../../../../../../net/sf/jasperreports/components/iconlabel/package-summary.html">net.sf.jasperreports.components.iconlabel</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../../../../net/sf/jasperreports/components/iconlabel/package-summary.html">net.sf.jasperreports.components.iconlabel</a> that implement <a href="../../../../../../../net/sf/jasperreports/engine/export/oasis/GenericElementOdtHandler.html" title="interface in net.sf.jasperreports.engine.export.oasis">GenericElementOdtHandler</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../../../net/sf/jasperreports/components/iconlabel/IconLabelElementOdtHandler.html" title="class in net.sf.jasperreports.components.iconlabel">IconLabelElementOdtHandler</a></strong></code>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="net.sf.jasperreports.components.map"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../net/sf/jasperreports/engine/export/oasis/GenericElementOdtHandler.html" title="interface in net.sf.jasperreports.engine.export.oasis">GenericElementOdtHandler</a> in <a href="../../../../../../../net/sf/jasperreports/components/map/package-summary.html">net.sf.jasperreports.components.map</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../../../../net/sf/jasperreports/components/map/package-summary.html">net.sf.jasperreports.components.map</a> that implement <a href="../../../../../../../net/sf/jasperreports/engine/export/oasis/GenericElementOdtHandler.html" title="interface in net.sf.jasperreports.engine.export.oasis">GenericElementOdtHandler</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><strong><a href="../../../../../../../net/sf/jasperreports/components/map/MapElementOdtHandler.html" title="class in net.sf.jasperreports.components.map">MapElementOdtHandler</a></strong></code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../net/sf/jasperreports/engine/export/oasis/GenericElementOdtHandler.html" title="interface in net.sf.jasperreports.engine.export.oasis">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?net/sf/jasperreports/engine/export/oasis/class-use/GenericElementOdtHandler.html" target="_top">Frames</a></li> <li><a href="GenericElementOdtHandler.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small> <span style="font-decoration:none;font-family:Arial,Helvetica,sans-serif;font-size:8pt;font-style:normal;color:#000000;">&copy; 2001-2010 Jaspersoft Corporation <a href="http://www.jaspersoft.com" target="_blank" style="color:#000000;">www.jaspersoft.com</a></span> </small></p> </body> </html>
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="ro"> <head> <!-- Generated by javadoc (version 1.7.0_07) on Tue May 27 14:37:18 EEST 2014 --> <title>DeduplicableRegistry.DeduplicableWrapper (JasperReports 5.6.0 API)</title> <meta name="date" content="2014-05-27"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="DeduplicableRegistry.DeduplicableWrapper (JasperReports 5.6.0 API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/DeduplicableRegistry.DeduplicableWrapper.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../net/sf/jasperreports/engine/util/DeduplicableRegistry.DeduplicableMap.html" title="class in net.sf.jasperreports.engine.util"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../../net/sf/jasperreports/engine/util/DeepPrintElementCounter.html" title="class in net.sf.jasperreports.engine.util"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?net/sf/jasperreports/engine/util/DeduplicableRegistry.DeduplicableWrapper.html" target="_top">Frames</a></li> <li><a href="DeduplicableRegistry.DeduplicableWrapper.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">net.sf.jasperreports.engine.util</div> <h2 title="Class DeduplicableRegistry.DeduplicableWrapper" class="title">Class DeduplicableRegistry.DeduplicableWrapper&lt;T extends <a href="../../../../../net/sf/jasperreports/engine/Deduplicable.html" title="interface in net.sf.jasperreports.engine">Deduplicable</a>&gt;</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>net.sf.jasperreports.engine.util.DeduplicableRegistry.DeduplicableWrapper&lt;T&gt;</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>Enclosing class:</dt> <dd><a href="../../../../../net/sf/jasperreports/engine/util/DeduplicableRegistry.html" title="class in net.sf.jasperreports.engine.util">DeduplicableRegistry</a></dd> </dl> <hr> <br> <pre>protected static class <span class="strong">DeduplicableRegistry.DeduplicableWrapper&lt;T extends <a href="../../../../../net/sf/jasperreports/engine/Deduplicable.html" title="interface in net.sf.jasperreports.engine">Deduplicable</a>&gt;</span> extends java.lang.Object</pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../../net/sf/jasperreports/engine/util/DeduplicableRegistry.DeduplicableWrapper.html#DeduplicableRegistry.DeduplicableWrapper(T)">DeduplicableRegistry.DeduplicableWrapper</a></strong>(<a href="../../../../../net/sf/jasperreports/engine/util/DeduplicableRegistry.DeduplicableWrapper.html" title="type parameter in DeduplicableRegistry.DeduplicableWrapper">T</a>&nbsp;object)</code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><strong><a href="../../../../../net/sf/jasperreports/engine/util/DeduplicableRegistry.DeduplicableWrapper.html#equals(java.lang.Object)">equals</a></strong>(java.lang.Object&nbsp;other)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><strong><a href="../../../../../net/sf/jasperreports/engine/util/DeduplicableRegistry.DeduplicableWrapper.html#hashCode()">hashCode</a></strong>()</code>&nbsp;</td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="DeduplicableRegistry.DeduplicableWrapper(net.sf.jasperreports.engine.Deduplicable)"> <!-- --> </a><a name="DeduplicableRegistry.DeduplicableWrapper(T)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>DeduplicableRegistry.DeduplicableWrapper</h4> <pre>public&nbsp;DeduplicableRegistry.DeduplicableWrapper(<a href="../../../../../net/sf/jasperreports/engine/util/DeduplicableRegistry.DeduplicableWrapper.html" title="type parameter in DeduplicableRegistry.DeduplicableWrapper">T</a>&nbsp;object)</pre> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="hashCode()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>hashCode</h4> <pre>public&nbsp;int&nbsp;hashCode()</pre> <dl> <dt><strong>Overrides:</strong></dt> <dd><code>hashCode</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd> </dl> </li> </ul> <a name="equals(java.lang.Object)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>equals</h4> <pre>public&nbsp;boolean&nbsp;equals(java.lang.Object&nbsp;other)</pre> <dl> <dt><strong>Overrides:</strong></dt> <dd><code>equals</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/DeduplicableRegistry.DeduplicableWrapper.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../net/sf/jasperreports/engine/util/DeduplicableRegistry.DeduplicableMap.html" title="class in net.sf.jasperreports.engine.util"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../../net/sf/jasperreports/engine/util/DeepPrintElementCounter.html" title="class in net.sf.jasperreports.engine.util"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?net/sf/jasperreports/engine/util/DeduplicableRegistry.DeduplicableWrapper.html" target="_top">Frames</a></li> <li><a href="DeduplicableRegistry.DeduplicableWrapper.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small> <span style="font-decoration:none;font-family:Arial,Helvetica,sans-serif;font-size:8pt;font-style:normal;color:#000000;">&copy; 2001-2010 Jaspersoft Corporation <a href="http://www.jaspersoft.com" target="_blank" style="color:#000000;">www.jaspersoft.com</a></span> </small></p> </body> </html>
Java
<HTML> <HEAD> <TITLE>VectotToDoubleArray</TITLE> </HEAD> <BODY TEXT="#000000" LINK="#ff00ff" VLINK="#800080" BGCOLOR="#fdf5e6" alink="#FF0000"> <H1 ALIGN="CENTER">VectToDoubleArray</H1> <P ALIGN="CENTER"> <LARGE><B>Author : Ian Wang</B> </P> <P ALIGN="CENTER"> <LARGE><B>Version : VERSION <BR> <BR> Input Types : <A HREF="C:\triana\help/JavaDoc/triana/types/VectorType.html">VectorType</A><BR> Output Types : double[]<BR> Date : 16 Jun 2003</LARGE> </P> </B><H2><A NAME="contents"></A>Contents</H2> <UL> <LI><A HREF="#description">Description of VectToDoubleArray</A></LI> <LI><A HREF="#using">Using VectotToDoubleArray</A></LI> </UL> <P> <HR WIDTH="15%" SIZE=4> </P> <H2><A NAME="description"></A>Description of VectToDoubleArray</H2> <P>Converts a vector type into two double arrays</P> <P>The unit called VectToDoubleArray ...... <BR> &nbsp; </P> <H2><A NAME="using"></A>Using VectToDoubleArray</H2> <P>VectToDoubleArray's parameter window (double-click on the unit while holding down the Control key) is used to .... </P> <P> <HR WIDTH="15%" SIZE=4> </P></BODY> </HTML>
Java
package nodeAST.relational; import java.util.Map; import nodeAST.BinaryExpr; import nodeAST.Expression; import nodeAST.Ident; import nodeAST.literals.Literal; import types.BoolType; import types.Type; import visitor.ASTVisitor; import visitor.IdentifiersTypeMatcher; public class NEq extends BinaryExpr { public NEq(Expression leftHandOperand, Expression rightHandOperand) { super(leftHandOperand,rightHandOperand); } @Override public void accept(ASTVisitor visitor) { visitor.visit(this, this.leftHandOperand, this.rightHandOperand); } @Override public String toString() { return this.leftHandOperand.toString() + "!=" + this.rightHandOperand.toString(); } @Override public Type getType(IdentifiersTypeMatcher typeMatcher) { return new BoolType(); } @Override public boolean areOperandsTypeValid(IdentifiersTypeMatcher typeMatcher) { Type t1=this.leftHandOperand.getType(typeMatcher); Type t2=this.rightHandOperand.getType(typeMatcher); return t1.isCompatibleWith(t2) && (t1.isArithmetic() || t1.isBoolean() || t1.isRelational() || t1.isString() ); } @Override public Literal compute(Map<Ident, Expression> identifiers) { return this.leftHandOperand.compute(identifiers).neq( this.rightHandOperand.compute(identifiers) ); } }
Java
package edu.ptu.javatest._60_dsa; import org.junit.Test; import java.util.TreeMap; import static edu.ptu.javatest._20_ooad._50_dynamic._00_ReflectionTest.getRefFieldBool; import static edu.ptu.javatest._20_ooad._50_dynamic._00_ReflectionTest.getRefFieldObj; public class _35_TreeMapTest { @Test public void testPrintTreeMap() { TreeMap hashMapTest = new TreeMap<>(); for (int i = 0; i < 6; i++) { hashMapTest.put(new TMHashObj(1,i*2 ), i*2 ); } Object table = getRefFieldObj(hashMapTest, hashMapTest.getClass(), "root"); printTreeMapNode(table); hashMapTest.put(new TMHashObj(1,9), 9); printTreeMapNode(table); System.out.println(); } public static int getTreeDepth(Object rootNode) { if (rootNode == null || !rootNode.getClass().toString().equals("class java.util.TreeMap$Entry")) return 0; return rootNode == null ? 0 : (1 + Math.max(getTreeDepth(getRefFieldObj(rootNode, rootNode.getClass(), "left")), getTreeDepth(getRefFieldObj(rootNode, rootNode.getClass(), "right")))); } public static void printTreeMapNode(Object rootNode) {//转化为堆 if (rootNode == null || !rootNode.getClass().toString().equals("class java.util.TreeMap$Entry")) return; int treeDepth = getTreeDepth(rootNode); Object[] objects = new Object[(int) (Math.pow(2, treeDepth) - 1)]; objects[0] = rootNode; // objects[0]=rootNode; // objects[1]=getRefFieldObj(objects,objects.getClass(),"left"); // objects[2]=getRefFieldObj(objects,objects.getClass(),"right"); // // objects[3]=getRefFieldObj(objects[1],objects[1].getClass(),"left"); // objects[4]=getRefFieldObj(objects[1],objects[1].getClass(),"right"); // objects[5]=getRefFieldObj(objects[2],objects[3].getClass(),"left"); // objects[6]=getRefFieldObj(objects[2],objects[4].getClass(),"right"); for (int i = 1; i < objects.length; i++) {//数组打印 int index = (i - 1) / 2;//parent if (objects[index] != null) { if (i % 2 == 1) objects[i] = getRefFieldObj(objects[index], objects[index].getClass(), "left"); else objects[i] = getRefFieldObj(objects[index], objects[index].getClass(), "right"); } } StringBuilder sb = new StringBuilder(); StringBuilder outSb = new StringBuilder(); String space = " "; for (int i = 0; i < treeDepth + 1; i++) { sb.append(space); } int nextlineIndex = 0; for (int i = 0; i < objects.length; i++) {//new line: 0,1 ,3,7 //print space //print value if (nextlineIndex == i) { outSb.append("\n\n"); if (sb.length() >= space.length()) { sb.delete(0, space.length()); } nextlineIndex = i * 2 + 1; } outSb.append(sb.toString()); if (objects[i] != null) { Object value = getRefFieldObj(objects[i], objects[i].getClass(), "value"); boolean red = !getRefFieldBool(objects[i], objects[i].getClass(), "color");// BLACK = true; String result = "" + value + "(" + (red ? "r" : "b") + ")"; outSb.append(result); } else { outSb.append("nil"); } } System.out.println(outSb.toString()); } public static class TMHashObj implements Comparable{ int hash; int value; TMHashObj(int hash, int value) { this.hash = hash; this.value = value; } @Override public int hashCode() { return hash; } @Override public int compareTo(Object o) { if (o instanceof TMHashObj){ return this.value-((TMHashObj) o).value; } return value-o.hashCode(); } } }
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_22) on Tue Nov 16 12:39:11 CET 2010 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> GenericService (RESThub framework 1.0 API) </TITLE> <META NAME="date" CONTENT="2010-11-16"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="GenericService (RESThub framework 1.0 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/GenericService.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../org/resthub/core/service/GenericResourceServiceImpl.html" title="class in org.resthub.core.service"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../org/resthub/core/service/GenericServiceImpl.html" title="class in org.resthub.core.service"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?org/resthub/core/service/GenericService.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="GenericService.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> org.resthub.core.service</FONT> <BR> Interface GenericService&lt;T,ID extends java.io.Serializable&gt;</H2> <DL> <DT><DT><B>Type Parameters:</B><DD><CODE>T</CODE> - Domain model class managed, must be an Entity<DD><CODE>PK</CODE> - Primary key class of T</DL> <DL> <DT><B>All Known Subinterfaces:</B> <DD><A HREF="../../../../org/resthub/oauth2/provider/service/AuthorizationService.html" title="interface in org.resthub.oauth2.provider.service">AuthorizationService</A>, <A HREF="../../../../org/resthub/core/service/GenericResourceService.html" title="interface in org.resthub.core.service">GenericResourceService</A>&lt;T&gt;</DD> </DL> <DL> <DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../org/resthub/oauth2/provider/service/AuthorizationServiceImpl.html" title="class in org.resthub.oauth2.provider.service">AuthorizationServiceImpl</A>, <A HREF="../../../../org/resthub/core/service/GenericResourceServiceImpl.html" title="class in org.resthub.core.service">GenericResourceServiceImpl</A>, <A HREF="../../../../org/resthub/core/service/GenericServiceImpl.html" title="class in org.resthub.core.service">GenericServiceImpl</A></DD> </DL> <HR> <DL> <DT><PRE>public interface <B>GenericService&lt;T,ID extends java.io.Serializable&gt;</B></DL> </PRE> <P> Generic Service interface. <P> <P> <HR> <P> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.lang.Long</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/resthub/core/service/GenericService.html#count()">count</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Count all resources.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/resthub/core/service/GenericService.html#create(T)">create</A></B>(<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A>&nbsp;resource)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create new resource.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/resthub/core/service/GenericService.html#delete(ID)">delete</A></B>(<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">ID</A>&nbsp;id)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Delete existing resource.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/resthub/core/service/GenericService.html#delete(T)">delete</A></B>(<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A>&nbsp;resource)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Delete existing resource.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.util.List&lt;<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/resthub/core/service/GenericService.html#findAll()">findAll</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Find all resources.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;java.util.List&lt;<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/resthub/core/service/GenericService.html#findAll(java.lang.Integer, java.lang.Integer)">findAll</A></B>(java.lang.Integer&nbsp;offset, java.lang.Integer&nbsp;limit)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Find all resources.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;org.synyx.hades.domain.Page&lt;<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A>&gt;</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/resthub/core/service/GenericService.html#findAll(org.synyx.hades.domain.Pageable)">findAll</A></B>(org.synyx.hades.domain.Pageable&nbsp;pageRequest)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Find all resources (pageable).</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/resthub/core/service/GenericService.html#findById(ID)">findById</A></B>(<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">ID</A>&nbsp;id)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Find resource by id.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../org/resthub/core/service/GenericService.html#update(T)">update</A></B>(<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A>&nbsp;resource)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Update existing resource.</TD> </TR> </TABLE> &nbsp; <P> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="create(java.lang.Object)"><!-- --></A><A NAME="create(T)"><!-- --></A><H3> create</H3> <PRE> <A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A> <B>create</B>(<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A>&nbsp;resource)</PRE> <DL> <DD>Create new resource. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>resource</CODE> - Resource to create <DT><B>Returns:</B><DD>new resource</DL> </DD> </DL> <HR> <A NAME="update(java.lang.Object)"><!-- --></A><A NAME="update(T)"><!-- --></A><H3> update</H3> <PRE> <A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A> <B>update</B>(<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A>&nbsp;resource)</PRE> <DL> <DD>Update existing resource. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>resource</CODE> - Resource to update <DT><B>Returns:</B><DD>resource updated</DL> </DD> </DL> <HR> <A NAME="delete(java.lang.Object)"><!-- --></A><A NAME="delete(T)"><!-- --></A><H3> delete</H3> <PRE> void <B>delete</B>(<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A>&nbsp;resource)</PRE> <DL> <DD>Delete existing resource. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>resource</CODE> - Resource to delete</DL> </DD> </DL> <HR> <A NAME="delete(java.io.Serializable)"><!-- --></A><A NAME="delete(ID)"><!-- --></A><H3> delete</H3> <PRE> void <B>delete</B>(<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">ID</A>&nbsp;id)</PRE> <DL> <DD>Delete existing resource. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>id</CODE> - Resource id</DL> </DD> </DL> <HR> <A NAME="findById(java.io.Serializable)"><!-- --></A><A NAME="findById(ID)"><!-- --></A><H3> findById</H3> <PRE> <A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A> <B>findById</B>(<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">ID</A>&nbsp;id)</PRE> <DL> <DD>Find resource by id. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>id</CODE> - Resource id <DT><B>Returns:</B><DD>resource</DL> </DD> </DL> <HR> <A NAME="findAll(java.lang.Integer, java.lang.Integer)"><!-- --></A><H3> findAll</H3> <PRE> java.util.List&lt;<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A>&gt; <B>findAll</B>(java.lang.Integer&nbsp;offset, java.lang.Integer&nbsp;limit)</PRE> <DL> <DD>Find all resources. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>offset</CODE> - offset (default 0)<DD><CODE>limit</CODE> - limit (default 100) <DT><B>Returns:</B><DD>resources.</DL> </DD> </DL> <HR> <A NAME="findAll()"><!-- --></A><H3> findAll</H3> <PRE> java.util.List&lt;<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A>&gt; <B>findAll</B>()</PRE> <DL> <DD>Find all resources. <P> <DD><DL> <DT><B>Returns:</B><DD>a list of all resources.</DL> </DD> </DL> <HR> <A NAME="findAll(org.synyx.hades.domain.Pageable)"><!-- --></A><H3> findAll</H3> <PRE> org.synyx.hades.domain.Page&lt;<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A>&gt; <B>findAll</B>(org.synyx.hades.domain.Pageable&nbsp;pageRequest)</PRE> <DL> <DD>Find all resources (pageable). <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>pageRequest</CODE> - page request <DT><B>Returns:</B><DD>resources</DL> </DD> </DL> <HR> <A NAME="count()"><!-- --></A><H3> count</H3> <PRE> java.lang.Long <B>count</B>()</PRE> <DL> <DD>Count all resources. <P> <DD><DL> <DT><B>Returns:</B><DD>number of resources</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/GenericService.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../org/resthub/core/service/GenericResourceServiceImpl.html" title="class in org.resthub.core.service"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../org/resthub/core/service/GenericServiceImpl.html" title="class in org.resthub.core.service"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?org/resthub/core/service/GenericService.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="GenericService.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Copyright &#169; 2009-2010. All Rights Reserved. </BODY> </HTML>
Java
using System; using System.Html; using System.Runtime.CompilerServices; namespace jQueryApi.UI.Widgets { [Imported] [IgnoreNamespace] [Serializable] public sealed class DialogResizeStartEvent { public object OriginalPosition { get; set; } public object OriginalSize { get; set; } public object Position { get; set; } public object Size { get; set; } } }
Java
--- layout: default modal-id: 7 date: 2013-01-31 img: themis.png alt: UOCD project-date: Spring 2013 client: Olin title: User-Oriented Collaborative Design size: 5 tags: [Design, Project] description: "As part of Olin’s User-Oriented Collaborative Design course, I worked for a semester with parents of visually impaired children to understand their experiences and design a product based on their challenges and values. <br/> <br/> After interviews with dozens of parents, children, educators and community advocates, my team realized that getting people to challenge visually impaired children is a difficulty for many parents. They’re trying to raise their children, while teachers, family members and even other children often go out of their way to make sure visually impaired children aren’t challenged or disadvantaged. These people, while meaning well, are making it so visually impaired children are not prepared to handle the real world. Many parents spoke about being exhausted from simply trying to get teacher to challenge their students. <br/> <br/> Our solution: Themis, a VR headset giving anyone the experience of being a visually impaired person with the tools and experience necessary to thrive. Themis totally simulates the sight, hearing, and some of the tactile sensations experienced by a visually impaired person completing a variety of tasks. It allows users to walk through these experiences first on their own, with the sense of a visually impaired person, and then with expert guidance to help them understand the actual experience of a visually impaired person, who has tools to navigate the world. <br/> <br/> During this project, we encountered a variety of design challenges, but the most prominent was the fact that parents wanted us to design for their children, not them. In interviews, every idea we co-designed with was changed into a product for the children. Essentially, in their eyes, we should focus on designing for their children, not them. The course guideline was quite clear; we were designing for the parents. To help overcome this challenge we changed our co-design approach and introduced our ideas as tools focused on the child that the parent could use. With this approach, we narrowed in on Themis as the idea that parents found the most valuable. " ---
Java
package com.cisco.axl.api._8; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for LPhoneSecurityProfile complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="LPhoneSecurityProfile"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence minOccurs="0"> * &lt;element name="phoneType" type="{http://www.cisco.com/AXL/API/8.0}XModel" minOccurs="0"/> * &lt;element name="protocol" type="{http://www.cisco.com/AXL/API/8.0}XDeviceProtocol" minOccurs="0"/> * &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * &lt;element name="deviceSecurityMode" type="{http://www.cisco.com/AXL/API/8.0}XDeviceSecurityMode" minOccurs="0"/> * &lt;element name="authenticationMode" type="{http://www.cisco.com/AXL/API/8.0}XAuthenticationMode" minOccurs="0"/> * &lt;element name="keySize" type="{http://www.cisco.com/AXL/API/8.0}XKeySize" minOccurs="0"/> * &lt;element name="tftpEncryptedConfig" type="{http://www.cisco.com/AXL/API/8.0}boolean" minOccurs="0"/> * &lt;element name="nonceValidityTime" type="{http://www.cisco.com/AXL/API/8.0}XInteger" minOccurs="0"/> * &lt;element name="transportType" type="{http://www.cisco.com/AXL/API/8.0}XTransport" minOccurs="0"/> * &lt;element name="sipPhonePort" type="{http://www.cisco.com/AXL/API/8.0}XInteger" minOccurs="0"/> * &lt;element name="enableDigestAuthentication" type="{http://www.cisco.com/AXL/API/8.0}boolean" minOccurs="0"/> * &lt;element name="excludeDigestCredentials" type="{http://www.cisco.com/AXL/API/8.0}boolean" minOccurs="0"/> * &lt;/sequence> * &lt;attribute name="uuid" type="{http://www.cisco.com/AXL/API/8.0}XUUID" /> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "LPhoneSecurityProfile", propOrder = { "phoneType", "protocol", "name", "description", "deviceSecurityMode", "authenticationMode", "keySize", "tftpEncryptedConfig", "nonceValidityTime", "transportType", "sipPhonePort", "enableDigestAuthentication", "excludeDigestCredentials" }) public class LPhoneSecurityProfile { protected String phoneType; protected String protocol; protected String name; protected String description; protected String deviceSecurityMode; protected String authenticationMode; protected String keySize; protected String tftpEncryptedConfig; protected String nonceValidityTime; protected String transportType; protected String sipPhonePort; protected String enableDigestAuthentication; protected String excludeDigestCredentials; @XmlAttribute protected String uuid; /** * Gets the value of the phoneType property. * * @return * possible object is * {@link String } * */ public String getPhoneType() { return phoneType; } /** * Sets the value of the phoneType property. * * @param value * allowed object is * {@link String } * */ public void setPhoneType(String value) { this.phoneType = value; } /** * Gets the value of the protocol property. * * @return * possible object is * {@link String } * */ public String getProtocol() { return protocol; } /** * Sets the value of the protocol property. * * @param value * allowed object is * {@link String } * */ public void setProtocol(String value) { this.protocol = value; } /** * Gets the value of the name property. * * @return * possible object is * {@link String } * */ public String getName() { return name; } /** * Sets the value of the name property. * * @param value * allowed object is * {@link String } * */ public void setName(String value) { this.name = value; } /** * Gets the value of the description property. * * @return * possible object is * {@link String } * */ public String getDescription() { return description; } /** * Sets the value of the description property. * * @param value * allowed object is * {@link String } * */ public void setDescription(String value) { this.description = value; } /** * Gets the value of the deviceSecurityMode property. * * @return * possible object is * {@link String } * */ public String getDeviceSecurityMode() { return deviceSecurityMode; } /** * Sets the value of the deviceSecurityMode property. * * @param value * allowed object is * {@link String } * */ public void setDeviceSecurityMode(String value) { this.deviceSecurityMode = value; } /** * Gets the value of the authenticationMode property. * * @return * possible object is * {@link String } * */ public String getAuthenticationMode() { return authenticationMode; } /** * Sets the value of the authenticationMode property. * * @param value * allowed object is * {@link String } * */ public void setAuthenticationMode(String value) { this.authenticationMode = value; } /** * Gets the value of the keySize property. * * @return * possible object is * {@link String } * */ public String getKeySize() { return keySize; } /** * Sets the value of the keySize property. * * @param value * allowed object is * {@link String } * */ public void setKeySize(String value) { this.keySize = value; } /** * Gets the value of the tftpEncryptedConfig property. * * @return * possible object is * {@link String } * */ public String getTftpEncryptedConfig() { return tftpEncryptedConfig; } /** * Sets the value of the tftpEncryptedConfig property. * * @param value * allowed object is * {@link String } * */ public void setTftpEncryptedConfig(String value) { this.tftpEncryptedConfig = value; } /** * Gets the value of the nonceValidityTime property. * * @return * possible object is * {@link String } * */ public String getNonceValidityTime() { return nonceValidityTime; } /** * Sets the value of the nonceValidityTime property. * * @param value * allowed object is * {@link String } * */ public void setNonceValidityTime(String value) { this.nonceValidityTime = value; } /** * Gets the value of the transportType property. * * @return * possible object is * {@link String } * */ public String getTransportType() { return transportType; } /** * Sets the value of the transportType property. * * @param value * allowed object is * {@link String } * */ public void setTransportType(String value) { this.transportType = value; } /** * Gets the value of the sipPhonePort property. * * @return * possible object is * {@link String } * */ public String getSipPhonePort() { return sipPhonePort; } /** * Sets the value of the sipPhonePort property. * * @param value * allowed object is * {@link String } * */ public void setSipPhonePort(String value) { this.sipPhonePort = value; } /** * Gets the value of the enableDigestAuthentication property. * * @return * possible object is * {@link String } * */ public String getEnableDigestAuthentication() { return enableDigestAuthentication; } /** * Sets the value of the enableDigestAuthentication property. * * @param value * allowed object is * {@link String } * */ public void setEnableDigestAuthentication(String value) { this.enableDigestAuthentication = value; } /** * Gets the value of the excludeDigestCredentials property. * * @return * possible object is * {@link String } * */ public String getExcludeDigestCredentials() { return excludeDigestCredentials; } /** * Sets the value of the excludeDigestCredentials property. * * @param value * allowed object is * {@link String } * */ public void setExcludeDigestCredentials(String value) { this.excludeDigestCredentials = value; } /** * Gets the value of the uuid property. * * @return * possible object is * {@link String } * */ public String getUuid() { return uuid; } /** * Sets the value of the uuid property. * * @param value * allowed object is * {@link String } * */ public void setUuid(String value) { this.uuid = value; } }
Java
package pokemon.vue; import pokemon.launcher.PokemonCore; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.graphics.g2d.Batch; import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.actions.*; public class MyActor extends Actor { public Texture s=new Texture(Gdx.files.internal("crosshair.png")); SpriteBatch b=new SpriteBatch(); float x,y; public MyActor (float x, float y) { this.x=x; this.y=y; System.out.print(PokemonCore.m.getCities().get(0).getX()); this.setBounds(x+PokemonCore.m.getCities().get(0).getX(),y+PokemonCore.m.getCities().get(0).getY(),s.getWidth(),s.getHeight()); /* RepeatAction action = new RepeatAction(); action.setCount(RepeatAction.FOREVER); action.setAction(Actions.fadeOut(2f));*/ this.addAction(Actions.repeat(RepeatAction.FOREVER,Actions.sequence(Actions.fadeOut(1f),Actions.fadeIn(1f)))); //posx=this.getX(); //posy=this.getY(); //this.addAction(action); //this.addAction(Actions.sequence(Actions.alpha(0),Actions.fadeIn(2f))); System.out.println("Actor constructed"); b.getProjectionMatrix().setToOrtho2D(0, 0,640,360); } @Override public void draw (Batch batch, float parentAlpha) { b.begin(); Color color = getColor(); b.setColor(color.r, color.g, color.b, color.a * parentAlpha); b.draw(s,this.getX()-15,this.getY()-15,30,30); b.setColor(color); b.end(); //System.out.println("Called"); //batch.draw(t,this.getX(),this.getY(),t.getWidth(),t.getHeight()); //batch.draw(s,this.getX()+Minimap.BourgPalette.getX(),this.getY()+Minimap.BourgPalette.getY(),30,30); } public void setPosition(float x, float y){ this.setX(x+this.x); this.setY(y+this.y); } }
Java
# Cookbook Name:: postgresql # Attributes:: postgresql # # 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. # default['postgresql']['enable_pgdg_apt'] = false default['postgresql']['server']['config_change_notify'] = :restart default['postgresql']['assign_postgres_password'] = true # Establish default database name default['postgresql']['database_name'] = 'template1' case node['platform'] when "debian" case when node['platform_version'].to_f < 6.0 # All 5.X default['postgresql']['version'] = "8.3" when node['platform_version'].to_f < 7.0 # All 6.X default['postgresql']['version'] = "8.4" when node['platform_version'].to_f < 8.0 # All 7.X default['postgresql']['version'] = "9.1" else default['postgresql']['version'] = "9.4" end default['postgresql']['dir'] = "/etc/postgresql/#{node['postgresql']['version']}/main" case when node['platform_version'].to_f < 6.0 # All 5.X default['postgresql']['server']['service_name'] = "postgresql-#{node['postgresql']['version']}" else default['postgresql']['server']['service_name'] = "postgresql" end default['postgresql']['client']['packages'] = ["postgresql-client-#{node['postgresql']['version']}","libpq-dev"] default['postgresql']['server']['packages'] = ["postgresql-#{node['postgresql']['version']}"] default['postgresql']['contrib']['packages'] = ["postgresql-contrib-#{node['postgresql']['version']}"] when "ubuntu" case when node['platform_version'].to_f <= 9.04 default['postgresql']['version'] = "8.3" when node['platform_version'].to_f <= 11.04 default['postgresql']['version'] = "8.4" when node['platform_version'].to_f <= 13.10 default['postgresql']['version'] = "9.1" else default['postgresql']['version'] = "9.3" end default['postgresql']['dir'] = "/etc/postgresql/#{node['postgresql']['version']}/main" case when (node['platform_version'].to_f <= 10.04) && (! node['postgresql']['enable_pgdg_apt']) default['postgresql']['server']['service_name'] = "postgresql-#{node['postgresql']['version']}" else default['postgresql']['server']['service_name'] = "postgresql" end default['postgresql']['client']['packages'] = ["postgresql-client-#{node['postgresql']['version']}","libpq-dev"] default['postgresql']['server']['packages'] = ["postgresql-#{node['postgresql']['version']}"] default['postgresql']['contrib']['packages'] = ["postgresql-contrib-#{node['postgresql']['version']}"] when "fedora" if node['platform_version'].to_f <= 12 default['postgresql']['version'] = "8.3" else default['postgresql']['version'] = "8.4" end default['postgresql']['dir'] = "/var/lib/pgsql/data" default['postgresql']['client']['packages'] = %w{postgresql93-devel postgresql93} default['postgresql']['server']['packages'] = %w{postgresql93-server} default['postgresql']['contrib']['packages'] = %w{postgresql93-contrib} default['postgresql']['server']['service_name'] = 'postgresql' when "amazon" if node['platform_version'].to_f >= 2012.03 default['postgresql']['version'] = "9.0" default['postgresql']['dir'] = "/var/lib/pgsql9/data" else default['postgresql']['version'] = "8.4" default['postgresql']['dir'] = "/var/lib/pgsql/data" end default['postgresql']['client']['packages'] = %w{postgresql-devel} default['postgresql']['server']['packages'] = %w{postgresql-server} default['postgresql']['contrib']['packages'] = %w{postgresql-contrib} default['postgresql']['server']['service_name'] = "postgresql" when "redhat", "centos", "scientific", "oracle" default['postgresql']['version'] = "8.4" default['postgresql']['dir'] = "/var/lib/pgsql/data" if node['platform_version'].to_f >= 6.0 && node['postgresql']['version'] == '8.4' default['postgresql']['client']['packages'] = %w{postgresql-devel} default['postgresql']['server']['packages'] = %w{postgresql-server} default['postgresql']['contrib']['packages'] = %w{postgresql-contrib} else default['postgresql']['client']['packages'] = ["postgresql#{node['postgresql']['version'].split('.').join}-devel"] default['postgresql']['server']['packages'] = ["postgresql#{node['postgresql']['version'].split('.').join}-server"] default['postgresql']['contrib']['packages'] = ["postgresql#{node['postgresql']['version'].split('.').join}-contrib"] end if node['platform_version'].to_f >= 6.0 && node['postgresql']['version'] != '8.4' default['postgresql']['dir'] = "/var/lib/pgsql/#{node['postgresql']['version']}/data" default['postgresql']['server']['service_name'] = "postgresql-#{node['postgresql']['version']}" else default['postgresql']['dir'] = "/var/lib/pgsql/data" default['postgresql']['server']['service_name'] = "postgresql" end when "suse" if node['platform_version'].to_f <= 11.1 default['postgresql']['version'] = "8.3" default['postgresql']['client']['packages'] = ['postgresql', 'rubygem-pg'] default['postgresql']['server']['packages'] = ['postgresql-server'] default['postgresql']['contrib']['packages'] = ['postgresql-contrib'] else default['postgresql']['version'] = "9.1" default['postgresql']['client']['packages'] = ['postgresql91', 'rubygem-pg'] default['postgresql']['server']['packages'] = ['postgresql91-server'] default['postgresql']['contrib']['packages'] = ['postgresql91-contrib'] end default['postgresql']['dir'] = "/var/lib/pgsql/data" default['postgresql']['server']['service_name'] = "postgresql" else default['postgresql']['version'] = "8.4" default['postgresql']['dir'] = "/etc/postgresql/#{node['postgresql']['version']}/main" default['postgresql']['client']['packages'] = ["postgresql"] default['postgresql']['server']['packages'] = ["postgresql"] default['postgresql']['contrib']['packages'] = ["postgresql"] default['postgresql']['server']['service_name'] = "postgresql" end # These defaults have disparity between which postgresql configuration # settings are used because they were extracted from the original # configuration files that are now removed in favor of dynamic # generation. # # While the configuration ends up being the same as the default # in previous versions of the cookbook, the content of the rendered # template will change, and this will result in service notification # if you upgrade the cookbook on existing systems. # # The ssl config attribute is generated in the recipe to avoid awkward # merge/precedence order during the Chef run. case node['platform_family'] when 'debian' default['postgresql']['config']['data_directory'] = "/var/lib/postgresql/#{node['postgresql']['version']}/main" default['postgresql']['config']['hba_file'] = "/etc/postgresql/#{node['postgresql']['version']}/main/pg_hba.conf" default['postgresql']['config']['ident_file'] = "/etc/postgresql/#{node['postgresql']['version']}/main/pg_ident.conf" default['postgresql']['config']['external_pid_file'] = "/var/run/postgresql/#{node['postgresql']['version']}-main.pid" default['postgresql']['config']['listen_addresses'] = 'localhost' default['postgresql']['config']['port'] = 5432 default['postgresql']['config']['max_connections'] = 100 default['postgresql']['config']['unix_socket_directory'] = '/var/run/postgresql' if node['postgresql']['version'].to_f < 9.3 default['postgresql']['config']['unix_socket_directories'] = '/var/run/postgresql' if node['postgresql']['version'].to_f >= 9.3 default['postgresql']['config']['shared_buffers'] = '24MB' default['postgresql']['config']['max_fsm_pages'] = 153600 if node['postgresql']['version'].to_f < 8.4 default['postgresql']['config']['log_line_prefix'] = '%t ' default['postgresql']['config']['datestyle'] = 'iso, mdy' default['postgresql']['config']['default_text_search_config'] = 'pg_catalog.english' default['postgresql']['config']['ssl'] = true default['postgresql']['config']['ssl_cert_file'] = '/etc/ssl/certs/ssl-cert-snakeoil.pem' if node['postgresql']['version'].to_f >= 9.2 default['postgresql']['config']['ssl_key_file'] = '/etc/ssl/private/ssl-cert-snakeoil.key'if node['postgresql']['version'].to_f >= 9.2 when 'rhel', 'fedora', 'suse' default['postgresql']['config']['data_directory'] = node['postgresql']['dir'] default['postgresql']['config']['listen_addresses'] = 'localhost' default['postgresql']['config']['port'] = 5432 default['postgresql']['config']['max_connections'] = 100 default['postgresql']['config']['shared_buffers'] = '32MB' default['postgresql']['config']['logging_collector'] = true default['postgresql']['config']['log_directory'] = 'pg_log' default['postgresql']['config']['log_filename'] = 'postgresql-%a.log' default['postgresql']['config']['log_truncate_on_rotation'] = true default['postgresql']['config']['log_rotation_age'] = '1d' default['postgresql']['config']['log_rotation_size'] = 0 default['postgresql']['config']['datestyle'] = 'iso, mdy' default['postgresql']['config']['lc_messages'] = 'en_US.UTF-8' default['postgresql']['config']['lc_monetary'] = 'en_US.UTF-8' default['postgresql']['config']['lc_numeric'] = 'en_US.UTF-8' default['postgresql']['config']['lc_time'] = 'en_US.UTF-8' default['postgresql']['config']['default_text_search_config'] = 'pg_catalog.english' end default['postgresql']['config']['hot_standby'] = 'off' default['postgresql']['config']['max_standby_archive_delay'] = '30s' default['postgresql']['config']['max_standby_streaming_delay'] = '30s' default['postgresql']['config']['wal_receiver_status_interval'] = '10s' default['postgresql']['config']['hot_standby_feedback'] = 'off' default['postgresql']['config']['wal_level'] = 'archive' default['postgresql']['config']['archive_mode'] = 'off' default['postgresql']['config']['archive_command'] = '' default['postgresql']['config']['max_wal_senders'] = '2' default['postgresql']['config']['wal_keep_segments'] = '4' # attributes for recovery.conf default['postgresql']['recovery']['standby_mode'] = 'off' default['postgresql']['recovery']['restore_command'] = '' default['postgresql']['recovery']['archive_cleanup_command'] = '' default['postgresql']['recovery']['recovery_end_command'] = '' default['postgresql']['recovery']['primary_conninfo'] = '' default['postgresql']['recovery']['trigger_file'] = '' # replica user creation default['postgresql']['recovery_user'] = '' default['postgresql']['recovery_user_pass'] = '' default['postgresql']['master_ip'] = '' default['postgresql']['pg_hba'] = [ {:type => 'local', :db => 'all', :user => 'postgres', :addr => nil, :method => 'ident'}, {:type => 'local', :db => 'all', :user => 'all', :addr => nil, :method => 'ident'}, {:type => 'host', :db => 'all', :user => 'all', :addr => '127.0.0.1/32', :method => 'md5'}, {:type => 'host', :db => 'all', :user => 'all', :addr => '::1/128', :method => 'md5'} ] default['postgresql']['password'] = Hash.new case node['platform_family'] when 'debian' default['postgresql']['pgdg']['release_apt_codename'] = node['lsb']['codename'] end default['postgresql']['enable_pgdg_yum'] = false default['postgresql']['initdb_locale'] = nil # The PostgreSQL RPM Building Project built repository RPMs for easy # access to the PGDG yum repositories. Links to RPMs for installation # on the supported version/platform combinations are listed at # http://yum.postgresql.org/repopackages.php, and the links for # PostgreSQL 8.4, 9.0, 9.1, 9.2 and 9.3 are captured below. # # The correct RPM for installing /etc/yum.repos.d is based on: # * the attribute configuring the desired Postgres Software: # node['postgresql']['version'] e.g., "9.1" # * the chef ohai description of the target Operating System: # node['platform'] e.g., "centos" # node['platform_version'] e.g., "5.7", truncated as "5" # node['kernel']['machine'] e.g., "i386" or "x86_64" default['postgresql']['pgdg']['repo_rpm_url'] = { "9.4" => { "amazon" => { "2014" => { "i386" => "http://yum.postgresql.org/9.4/redhat/rhel-6-i386/pgdg-redhat94-9.4-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm" }, "2013" => { "i386" => "http://yum.postgresql.org/9.4/redhat/rhel-6-i386/pgdg-redhat94-9.4-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm" } }, "centos" => { "7" => { "x86_64" => "http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-1.noarch.rpm" }, "6" => { "i386" => "http://yum.postgresql.org/9.4/redhat/rhel-6-i386/pgdg-centos94-9.4-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-1.noarch.rpm" }, "5" => { "i386" => "http://yum.postgresql.org/9.4/redhat/rhel-5-i386/pgdg-centos94-9.4-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.4/redhat/rhel-5-x86_64/pgdg-centos94-9.4-1.noarch.rpm" } }, "redhat" => { "7" => { "x86_64" => "http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-redhat94-9.4-1.noarch.rpm" }, "6" => { "i386" => "http://yum.postgresql.org/9.4/redhat/rhel-6-i386/pgdg-redhat94-9.4-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm" }, "5" => { "i386" => "http://yum.postgresql.org/9.4/redhat/rhel-5-i386/pgdg-redhat94-9.4-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.4/redhat/rhel-5-x86_64/pgdg-redhat94-9.4-1.noarch.rpm" } }, "oracle" => { "7" => { "x86_64" => "http://yum.postgresql.org/9.4/redhat/rhel-7-x86_64/pgdg-redhat94-9.4-1.noarch.rpm" }, "6" => { "i386" => "http://yum.postgresql.org/9.4/redhat/rhel-6-i386/pgdg-redhat94-9.4-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm" }, "5" => { "i386" => "http://yum.postgresql.org/9.4/redhat/rhel-5-i386/pgdg-redhat94-9.4-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.4/redhat/rhel-5-x86_64/pgdg-redhat94-9.4-1.noarch.rpm" } }, "scientific" => { "6" => { "i386" => "http://yum.postgresql.org/9.4/redhat/rhel-6-i386/pgdg-sl94-9.4-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-sl94-9.4-1.noarch.rpm" }, "5" => { "i386" => "http://yum.postgresql.org/9.4/redhat/rhel-5-i386/pgdg-sl94-9.4-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.4/redhat/rhel-5-x86_64/pgdg-sl94-9.4-1.noarch.rpm" } }, "fedora" => { "21" => { "i386" => "http://yum.postgresql.org/9.4/fedora/fedora-21-i686/pgdg-fedora94-9.4-2.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.4/fedora/fedora-21-x86_64/pgdg-fedora94-9.4-2.noarch.rpm" }, "20" => { "i386" => "http://yum.postgresql.org/9.4/fedora/fedora-20-i686/pgdg-fedora94-9.4-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.4/fedora/fedora-20-x86_64/pgdg-fedora94-9.4-1.noarch.rpm" }, "19" => { "i386" => "http://yum.postgresql.org/9.4/fedora/fedora-19-i686/pgdg-fedora94-9.4-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.4/fedora/fedora-19-x86_64/pgdg-fedora94-9.4-1.noarch.rpm" }, } }, "9.3" => { "amazon" => { "2015" => { "i386" => "http://yum.postgresql.org/9.3/redhat/rhel-6-i386/pgdg-redhat93-9.3-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm" }, "2014" => { "i386" => "http://yum.postgresql.org/9.3/redhat/rhel-6-i386/pgdg-redhat93-9.3-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm" }, "2013" => { "i386" => "http://yum.postgresql.org/9.3/redhat/rhel-6-i386/pgdg-redhat93-9.3-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm" } }, "centos" => { "7" => { "x86_64" => "http://yum.postgresql.org/9.3/redhat/rhel-7-x86_64/pgdg-centos93-9.3-1.noarch.rpm" }, "6" => { "i386" => "http://yum.postgresql.org/9.3/redhat/rhel-6-i386/pgdg-centos93-9.3-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm" }, "5" => { "i386" => "http://yum.postgresql.org/9.3/redhat/rhel-5-i386/pgdg-centos93-9.3-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.3/redhat/rhel-5-x86_64/pgdg-centos93-9.3-1.noarch.rpm" } }, "redhat" => { "7" => { "x86_64" => "http://yum.postgresql.org/9.3/redhat/rhel-7-x86_64/pgdg-redhat93-9.3-1.noarch.rpm" }, "6" => { "i386" => "http://yum.postgresql.org/9.3/redhat/rhel-6-i386/pgdg-redhat93-9.3-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm" }, "5" => { "i386" => "http://yum.postgresql.org/9.3/redhat/rhel-5-i386/pgdg-redhat93-9.3-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.3/redhat/rhel-5-x86_64/pgdg-redhat93-9.3-1.noarch.rpm" } }, "oracle" => { "6" => { "i386" => "http://yum.postgresql.org/9.3/redhat/rhel-6-i386/pgdg-redhat93-9.3-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm" }, "5" => { "i386" => "http://yum.postgresql.org/9.3/redhat/rhel-5-i386/pgdg-redhat93-9.3-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.3/redhat/rhel-5-x86_64/pgdg-redhat93-9.3-1.noarch.rpm" } }, "scientific" => { "6" => { "i386" => "http://yum.postgresql.org/9.3/redhat/rhel-6-i386/pgdg-sl93-9.3-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-sl93-9.3-1.noarch.rpm" }, "5" => { "i386" => "http://yum.postgresql.org/9.3/redhat/rhel-5-i386/pgdg-sl93-9.3-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.3/redhat/rhel-5-x86_64/pgdg-sl93-9.3-1.noarch.rpm" } }, "fedora" => { "20" => { "x86_64" => "http://yum.postgresql.org/9.3/fedora/fedora-20-x86_64/pgdg-fedora93-9.3-1.noarch.rpm" }, "19" => { "x86_64" => "http://yum.postgresql.org/9.3/fedora/fedora-19-x86_64/pgdg-fedora93-9.3-1.noarch.rpm" }, "18" => { "i386" => "http://yum.postgresql.org/9.3/fedora/fedora-18-i386/pgdg-fedora93-9.3-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.3/fedora/fedora-18-x86_64/pgdg-fedora93-9.3-1.noarch.rpm" }, "17" => { "i386" => "http://yum.postgresql.org/9.3/fedora/fedora-17-i386/pgdg-fedora93-9.3-1.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.3/fedora/fedora-17-x86_64/pgdg-fedora93-9.3-1.noarch.rpm" } } }, "9.2" => { "centos" => { "6" => { "i386" => "http://yum.postgresql.org/9.2/redhat/rhel-6-i386/pgdg-centos92-9.2-6.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-6.noarch.rpm" }, "5" => { "i386" => "http://yum.postgresql.org/9.2/redhat/rhel-5-i386/pgdg-centos92-9.2-6.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.2/redhat/rhel-5-x86_64/pgdg-centos92-9.2-6.noarch.rpm" } }, "redhat" => { "6" => { # # encoding: utf-8 # encoding: utf-8 "i386" => "http://yum.postgresql.org/9.2/redhat/rhel-6-i386/pgdg-redhat92-9.2-7.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-redhat92-9.2-7.noarch.rpm" }, "5" => { "i386" => "http://yum.postgresql.org/9.2/redhat/rhel-5-i386/pgdg-redhat92-9.2-7.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.2/redhat/rhel-5-x86_64/pgdg-redhat92-9.2-7.noarch.rpm" } }, "oracle" => { "6" => { "i386" => "http://yum.postgresql.org/9.2/redhat/rhel-6-i386/pgdg-redhat92-9.2-7.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-redhat92-9.2-7.noarch.rpm" }, "5" => { "i386" => "http://yum.postgresql.org/9.2/redhat/rhel-5-i386/pgdg-redhat92-9.2-7.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.2/redhat/rhel-5-x86_64/pgdg-redhat92-9.2-7.noarch.rpm" } }, "scientific" => { "6" => { "i386" => "http://yum.postgresql.org/9.2/redhat/rhel-6-i386/pgdg-sl92-9.2-8.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-sl92-9.2-8.noarch.rpm" }, "5" => { "i386" => "http://yum.postgresql.org/9.2/redhat/rhel-5-i386/pgdg-sl92-9.2-8.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.2/redhat/rhel-5-x86_64/pgdg-sl92-9.2-8.noarch.rpm" } }, "fedora" => { "19" => { "i386" => "http://yum.postgresql.org/9.2/fedora/fedora-19-i386/pgdg-fedora92-9.2-6.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.2/fedora/fedora-19-x86_64/pgdg-fedora92-9.2-6.noarch.rpm" }, "18" => { "i386" => "http://yum.postgresql.org/9.2/fedora/fedora-18-i386/pgdg-fedora92-9.2-6.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.2/fedora/fedora-18-x86_64/pgdg-fedora92-9.2-6.noarch.rpm" }, "17" => { "i386" => "http://yum.postgresql.org/9.2/fedora/fedora-17-i386/pgdg-fedora92-9.2-6.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.2/fedora/fedora-17-x86_64/pgdg-fedora92-9.2-5.noarch.rpm" }, "16" => { "i386" => "http://yum.postgresql.org/9.2/fedora/fedora-16-i386/pgdg-fedora92-9.2-5.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.2/fedora/fedora-16-x86_64/pgdg-fedora92-9.2-5.noarch.rpm" } } }, "9.1" => { "centos" => { "6" => { "i386" => "http://yum.postgresql.org/9.1/redhat/rhel-6-i386/pgdg-centos91-9.1-4.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.1/redhat/rhel-5-x86_64/pgdg-centos91-9.1-4.noarch.rpm" }, "5" => { "i386" => "http://yum.postgresql.org/9.1/redhat/rhel-5-i386/pgdg-centos91-9.1-4.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.1/redhat/rhel-5-x86_64/pgdg-centos91-9.1-4.noarch.rpm" }, "4" => { "i386" => "http://yum.postgresql.org/9.1/redhat/rhel-4-i386/pgdg-centos91-9.1-4.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.1/redhat/rhel-4-x86_64/pgdg-centos91-9.1-4.noarch.rpm" } }, "redhat" => { "6" => { "i386" => "http://yum.postgresql.org/9.1/redhat/rhel-6-i386/pgdg-redhat91-9.1-5.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.1/redhat/rhel-6-x86_64/pgdg-redhat91-9.1-5.noarch.rpm" }, "5" => { "i386" => "http://yum.postgresql.org/9.1/redhat/rhel-5-i386/pgdg-redhat91-9.1-5.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.1/redhat/rhel-5-x86_64/pgdg-redhat91-9.1-5.noarch.rpm" }, "4" => { "i386" => "http://yum.postgresql.org/9.1/redhat/rhel-4-i386/pgdg-redhat-9.1-4.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.1/redhat/rhel-4-x86_64/pgdg-redhat-9.1-4.noarch.rpm" } }, "scientific" => { "6" => { "i386" => "http://yum.postgresql.org/9.1/redhat/rhel-6-i386/pgdg-sl91-9.1-6.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.1/redhat/rhel-6-x86_64/pgdg-sl91-9.1-6.noarch.rpm" }, "5" => { "i386" => "http://yum.postgresql.org/9.1/redhat/rhel-5-i386/pgdg-sl91-9.1-6.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.1/redhat/rhel-5-x86_64/pgdg-sl91-9.1-6.noarch.rpm" } }, "fedora" => { "16" => { "i386" => "http://yum.postgresql.org/9.1/fedora/fedora-16-i386/pgdg-fedora91-9.1-4.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.1/fedora/fedora-16-x86_64/pgdg-fedora91-9.1-4.noarch.rpm" }, "15" => { "i386" => "http://yum.postgresql.org/9.1/fedora/fedora-15-i386/pgdg-fedora91-9.1-4.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.1/fedora/fedora-15-x86_64/pgdg-fedora91-9.1-4.noarch.rpm" }, "14" => { "i386" => "http://yum.postgresql.org/9.1/fedora/fedora-14-i386/pgdg-fedora91-9.1-4.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.1/fedora/fedora-14-x86_64/pgdg-fedora-9.1-2.noarch.rpm" } } }, "9.0" => { "centos" => { "6" => { "i386" => "http://yum.postgresql.org/9.0/redhat/rhel-6-i386/pgdg-centos90-9.0-5.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.0/redhat/rhel-6-x86_64/pgdg-centos90-9.0-5.noarch.rpm" }, "5" => { "i386" => "http://yum.postgresql.org/9.0/redhat/rhel-5-i386/pgdg-centos90-9.0-5.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.0/redhat/rhel-5-x86_64/pgdg-centos90-9.0-5.noarch.rpm" }, "4" => { "i386" => "http://yum.postgresql.org/9.0/redhat/rhel-4-i386/pgdg-centos90-9.0-5.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.0/redhat/rhel-4-x86_64/pgdg-centos90-9.0-5.noarch.rpm" } }, "redhat" => { "6" => { "i386" => "http://yum.postgresql.org/9.0/redhat/rhel-6-i386/pgdg-redhat90-9.0-5.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.0/redhat/rhel-6-x86_64/pgdg-redhat90-9.0-5.noarch.rpm" }, "5" => { "i386" => "http://yum.postgresql.org/9.0/redhat/rhel-5-i386/pgdg-redhat90-9.0-5.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.0/redhat/rhel-5-x86_64/pgdg-redhat90-9.0-5.noarch.rpm" }, "4" => { "i386" => "http://yum.postgresql.org/9.0/redhat/rhel-4-i386/pgdg-redhat90-9.0-5.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.0/redhat/rhel-4-x86_64/pgdg-redhat90-9.0-5.noarch.rpm" } }, "scientific" => { "6" => { "i386" => "http://yum.postgresql.org/9.0/redhat/rhel-6-i386/pgdg-sl90-9.0-6.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.0/redhat/rhel-6-x86_64/pgdg-sl90-9.0-6.noarch.rpm" }, "5" => { "i386" => "http://yum.postgresql.org/9.0/redhat/rhel-5-i386/pgdg-sl90-9.0-6.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.0/redhat/rhel-5-x86_64/pgdg-sl90-9.0-6.noarch.rpm" } }, "fedora" => { "15" => { "i386" => "http://yum.postgresql.org/9.0/fedora/fedora-15-i386/pgdg-fedora90-9.0-5.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.0/fedora/fedora-15-x86_64/pgdg-fedora90-9.0-5.noarch.rpm" }, "14" => { "i386" => "http://yum.postgresql.org/9.0/fedora/fedora-14-i386/pgdg-fedora90-9.0-5.noarch.rpm", "x86_64" => "http://yum.postgresql.org/9.0/fedora/fedora-14-x86_64/pgdg-fedora90-9.0-5.noarch.rpm" } } }, "8.4" => { "centos" => { "6" => { "i386" => "http://yum.postgresql.org/8.4/redhat/rhel-6-i386/pgdg-centos-8.4-3.noarch.rpm", "x86_64" => "http://yum.postgresql.org/8.4/redhat/rhel-6-x86_64/pgdg-centos-8.4-3.noarch.rpm" }, "5" => { "i386" => "http://yum.postgresql.org/8.4/redhat/rhel-5-i386/pgdg-centos-8.4-3.noarch.rpm", "x86_64" => "http://yum.postgresql.org/8.4/redhat/rhel-5-x86_64/pgdg-centos-8.4-3.noarch.rpm" }, "4" => { "i386" => "http://yum.postgresql.org/8.4/redhat/rhel-4-i386/pgdg-centos-8.4-3.noarch.rpm", "x86_64" => "http://yum.postgresql.org/8.4/redhat/rhel-4-x86_64/pgdg-centos-8.4-3.noarch.rpm" } }, "redhat" => { "6" => { "i386" => "http://yum.postgresql.org/8.4/redhat/rhel-6-i386/pgdg-redhat-8.4-3.noarch.rpm", "x86_64" => "http://yum.postgresql.org/8.4/redhat/rhel-6-x86_64/pgdg-redhat-8.4-3.noarch.rpm" }, "5" => { "i386" => "http://yum.postgresql.org/8.4/redhat/rhel-5-i386/pgdg-redhat-8.4-3.noarch.rpm", "x86_64" => "http://yum.postgresql.org/8.4/redhat/rhel-5-x86_64/pgdg-redhat-8.4-3.noarch.rpm" }, "4" => { "i386" => "http://yum.postgresql.org/8.4/redhat/rhel-4-i386/pgdg-redhat-8.4-3.noarch.rpm", "x86_64" => "http://yum.postgresql.org/8.4/redhat/rhel-4-x86_64/pgdg-redhat-8.4-3.noarch.rpm" } }, "scientific" => { "6" => { "i386" => "http://yum.postgresql.org/8.4/redhat/rhel-6-i386/pgdg-sl84-8.4-4.noarch.rpm", "x86_64" => "http://yum.postgresql.org/8.4/redhat/rhel-6-x86_64/pgdg-sl84-8.4-4.noarch.rpm" }, "5" => { "i386" => "http://yum.postgresql.org/8.4/redhat/rhel-5-i386/pgdg-sl-8.4-4.noarch.rpm", "x86_64" => "http://yum.postgresql.org/8.4/redhat/rhel-5-x86_64/pgdg-sl-8.4-4.noarch.rpm" } }, "fedora" => { "14" => { "i386" => "http://yum.postgresql.org/8.4/fedora/fedora-14-i386/", "x86_64" => "http://yum.postgresql.org/8.4/fedora/fedora-14-x86_64/" }, "13" => { "i386" => "http://yum.postgresql.org/8.4/fedora/fedora-13-i386/", "x86_64" => "http://yum.postgresql.org/8.4/fedora/fedora-13-x86_64/" }, "12" => { "i386" => "http://yum.postgresql.org/8.4/fedora/fedora-12-i386/", "x86_64" => "http://yum.postgresql.org/8.4/fedora/fedora-12-x86_64/" }, "8" => { "i386" => "http://yum.postgresql.org/8.4/fedora/fedora-8-i386/", "x86_64" => "http://yum.postgresql.org/8.4/fedora/fedora-8-x86_64/" }, "7" => { "i386" => "http://yum.postgresql.org/8.4/fedora/fedora-7-i386/", "x86_64" => "http://yum.postgresql.org/8.4/fedora/fedora-7-x86_64/" } } }, };
Java
package org.tiltedwindmills.fantasy.mfl.services; import org.tiltedwindmills.fantasy.mfl.model.LoginResponse; /** * Interface defining operations required for logging into an MFL league. */ public interface LoginService { /** * Login. * * @param leagueId the league id * @param serverId the server id * @param year the year * @param franchiseId the franchise id * @param password the password * @return the login response */ LoginResponse login(int leagueId, int serverId, int year, String franchiseId, String password); }
Java
# wc [option] command # -l, --lines : 打印行数 # -L, --max-line-length : 打印最长行的长度 # -w, --words : 打印单词数 # -m, --chars : 打印字符数 # -c, --bytes : 打印字节数 # 文件信息,包括行数,单词数,字节数 wc dstFile cat dstFile | wc # 文件行数与文件名 wc -l dstFile # 文件行数 cat dstFile | wc -l # 单词数与文件名 wc -w dstFile # 单词数 cat dstFile | wc -w # 字节数及文件名 wc -c dstFile # 字节数 cat dstFile | wc -c # 打印字符数与文件名 wc -m dstFile # 字符数 cat dstFile | wc -m # 用来统计当前目录下的文件数 # 数量中包含当前目录 ls -l | wc -l # line counts wc -l # word counts wc -w # char counts wc -m # bytes wc -c # 打印最长行的长度 wc -L # 计某文件夹下文件的个数 ls -l |grep "^-"| wc -l # 统计某文件夹下目录的个数 ls -l |grep "^d"| wc -l # 统计文件夹下文件的个数,包括子文件夹里的 ls -lR|grep "^-"| wc -l # 如统计目录(包含子目录)下的所有js文件 ls -lR dir | grep .js | wc -l ls -l "dir" | grep ".js" | wc -l # 统计文件夹下目录的个数,包括子文件夹里的 ls -lR|grep "^d"|wc -l # 长列表输出该目录下文件信息(R代表子目录注意这里的文件,不同于一般的文件,可能是目录、链接、设备文件等) ls -lR # 这里将长列表输出信息过滤一部分,只保留一般文件,如果只保留目录就是 ^d grep "^-" # 统计输出信息的行数 wc -l # 如果只查看文件夹, 只能显示一个 ls -d # 可以看到子文件夹 find -type d # 只看当前目录下的文件夹,不包括往下的文件夹 ls -lF |grep / ls -l |grep '^d'
Java
<?php /* TwigBundle:Exception:exception.rdf.twig */ class __TwigTemplate_70e8b249c1428c255435d8a44ef7c09891fdf8c23551b886c441d0a716433b6a extends Twig_Template { public function __construct(Twig_Environment $env) { parent::__construct($env); $this->parent = false; $this->blocks = array( ); } protected function doDisplay(array $context, array $blocks = array()) { $__internal_526d7a805785be4fb721c754b2cee69154d58ade11c606da9590ba90d330241a = $this->env->getExtension("Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"); $__internal_526d7a805785be4fb721c754b2cee69154d58ade11c606da9590ba90d330241a->enter($__internal_526d7a805785be4fb721c754b2cee69154d58ade11c606da9590ba90d330241a_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "TwigBundle:Exception:exception.rdf.twig")); $__internal_eec35cd5a10ba99b284e27c6831565132f96b0a120b58f10f2e9b54513d0d1f7 = $this->env->getExtension("Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"); $__internal_eec35cd5a10ba99b284e27c6831565132f96b0a120b58f10f2e9b54513d0d1f7->enter($__internal_eec35cd5a10ba99b284e27c6831565132f96b0a120b58f10f2e9b54513d0d1f7_prof = new Twig_Profiler_Profile($this->getTemplateName(), "template", "TwigBundle:Exception:exception.rdf.twig")); // line 1 $this->loadTemplate("@Twig/Exception/exception.xml.twig", "TwigBundle:Exception:exception.rdf.twig", 1)->display(array_merge($context, array("exception" => (isset($context["exception"]) ? $context["exception"] : $this->getContext($context, "exception"))))); $__internal_526d7a805785be4fb721c754b2cee69154d58ade11c606da9590ba90d330241a->leave($__internal_526d7a805785be4fb721c754b2cee69154d58ade11c606da9590ba90d330241a_prof); $__internal_eec35cd5a10ba99b284e27c6831565132f96b0a120b58f10f2e9b54513d0d1f7->leave($__internal_eec35cd5a10ba99b284e27c6831565132f96b0a120b58f10f2e9b54513d0d1f7_prof); } public function getTemplateName() { return "TwigBundle:Exception:exception.rdf.twig"; } public function isTraitable() { return false; } public function getDebugInfo() { return array ( 25 => 1,); } /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ public function getSource() { @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); return $this->getSourceContext()->getCode(); } public function getSourceContext() { return new Twig_Source("{% include '@Twig/Exception/exception.xml.twig' with { 'exception': exception } %} ", "TwigBundle:Exception:exception.rdf.twig", "C:\\wamp64\\www\\Symfony\\vendor\\symfony\\symfony\\src\\Symfony\\Bundle\\TwigBundle/Resources/views/Exception/exception.rdf.twig"); } }
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_20) on Tue Dec 23 13:29:41 PST 2014 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Deprecated List (jcuda-windows64 6.5 API)</title> <meta name="date" content="2014-12-23"> <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> <script type="text/javascript" src="script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Deprecated List (jcuda-windows64 6.5 API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="overview-summary.html">Overview</a></li> <li>Package</li> <li>Class</li> <li>Use</li> <li><a href="overview-tree.html">Tree</a></li> <li class="navBarCell1Rev">Deprecated</li> <li><a href="index-all.html">Index</a></li> <li><a href="help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="index.html?deprecated-list.html" target="_top">Frames</a></li> <li><a href="deprecated-list.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h1 title="Deprecated API" class="title">Deprecated API</h1> <h2 title="Contents">Contents</h2> <ul> <li><a href="#class">Deprecated Classes</a></li> <li><a href="#field">Deprecated Fields</a></li> <li><a href="#method">Deprecated Methods</a></li> </ul> </div> <div class="contentContainer"><a name="class"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <table class="deprecatedSummary" border="0" cellpadding="3" cellspacing="0" summary="Deprecated Classes table, listing deprecated classes, and an explanation"> <caption><span>Deprecated Classes</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="jcuda/driver/CUGLmap_flags.html" title="class in jcuda.driver">jcuda.driver.CUGLmap_flags</a> <div class="block"><span class="deprecationComment">As of CUDA 3.0</span></div> </td> </tr> </tbody> </table> </li> </ul> <a name="field"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <table class="deprecatedSummary" border="0" cellpadding="3" cellspacing="0" summary="Deprecated Fields table, listing deprecated fields, and an explanation"> <caption><span>Deprecated Fields</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Field and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="jcuda/driver/CUdevice_attribute.html#CU_DEVICE_ATTRIBUTE_CAN_TEX2D_GATHER">jcuda.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_CAN_TEX2D_GATHER</a> <div class="block"><span class="deprecationComment">Deprecated, do not use.</span></div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="jcuda/driver/CUdevice_attribute.html#CU_DEVICE_ATTRIBUTE_GPU_OVERLAP">jcuda.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_GPU_OVERLAP</a> <div class="block"><span class="deprecationComment">Use instead CU_DEVICE_ATTRIBUTE_ASYNC_ENGINE_COUNT</span></div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="jcuda/driver/CUdevice_attribute.html#CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_HEIGHT">jcuda.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_HEIGHT</a> <div class="block"><span class="deprecationComment">Use CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_HEIGHT</span></div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="jcuda/driver/CUdevice_attribute.html#CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES">jcuda.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_NUMSLICES</a> <div class="block"><span class="deprecationComment">Use CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_LAYERS</span></div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="jcuda/driver/CUdevice_attribute.html#CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_WIDTH">jcuda.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_ARRAY_WIDTH</a> <div class="block"><span class="deprecationComment">Use CU_DEVICE_ATTRIBUTE_MAXIMUM_TEXTURE2D_LAYERED_WIDTH</span></div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="jcuda/driver/CUdevice_attribute.html#CU_DEVICE_ATTRIBUTE_REGISTERS_PER_BLOCK">jcuda.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_REGISTERS_PER_BLOCK</a> <div class="block"><span class="deprecationComment">use CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK</span></div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="jcuda/driver/CUdevice_attribute.html#CU_DEVICE_ATTRIBUTE_SHARED_MEMORY_PER_BLOCK">jcuda.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_SHARED_MEMORY_PER_BLOCK</a> <div class="block"><span class="deprecationComment">use CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK</span></div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="jcuda/driver/JCudaDriver.html#CU_MEMPEERREGISTER_DEVICEMAP">jcuda.driver.JCudaDriver.CU_MEMPEERREGISTER_DEVICEMAP</a> <div class="block"><span class="deprecationComment">This value has been added in CUDA 4.0 RC, and removed in CUDA 4.0 RC2</span></div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="jcuda/driver/JCudaDriver.html#CU_STREAM_CALLBACK_BLOCKING">jcuda.driver.JCudaDriver.CU_STREAM_CALLBACK_BLOCKING</a> <div class="block"><span class="deprecationComment">This flag was only present in CUDA 5.0.25 (release candidate) and may be removed (or added again) in future releases</span></div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="jcuda/driver/JCudaDriver.html#CU_STREAM_CALLBACK_NONBLOCKING">jcuda.driver.JCudaDriver.CU_STREAM_CALLBACK_NONBLOCKING</a> <div class="block"><span class="deprecationComment">This flag was only present in CUDA 5.0.25 (release candidate) and may be removed (or added again) in future releases</span></div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="jcuda/driver/JCudaDriver.html#CUDA_ARRAY3D_2DARRAY">jcuda.driver.JCudaDriver.CUDA_ARRAY3D_2DARRAY</a> <div class="block"><span class="deprecationComment">use CUDA_ARRAY3D_LAYERED</span></div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="jcuda/driver/CUresult.html#CUDA_ERROR_PEER_MEMORY_ALREADY_REGISTERED">jcuda.driver.CUresult.CUDA_ERROR_PEER_MEMORY_ALREADY_REGISTERED</a> <div class="block"><span class="deprecationComment">This value has been added in CUDA 4.0 RC, and removed in CUDA 4.0 RC2</span></div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="jcuda/driver/CUresult.html#CUDA_ERROR_PEER_MEMORY_NOT_REGISTERED">jcuda.driver.CUresult.CUDA_ERROR_PEER_MEMORY_NOT_REGISTERED</a> <div class="block"><span class="deprecationComment">This value has been added in CUDA 4.0 RC, and removed in CUDA 4.0 RC2</span></div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="jcuda/driver/CUresult.html#CUDA_ERROR_PROFILER_ALREADY_STARTED">jcuda.driver.CUresult.CUDA_ERROR_PROFILER_ALREADY_STARTED</a> <div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 5.0. It is no longer an error to call cuProfilerStart() when profiling is already enabled.</span></div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="jcuda/driver/CUresult.html#CUDA_ERROR_PROFILER_ALREADY_STOPPED">jcuda.driver.CUresult.CUDA_ERROR_PROFILER_ALREADY_STOPPED</a> <div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 5.0. It is no longer an error to call cuProfilerStop() when profiling is already disabled.</span></div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="jcuda/driver/CUresult.html#CUDA_ERROR_PROFILER_NOT_INITIALIZED">jcuda.driver.CUresult.CUDA_ERROR_PROFILER_NOT_INITIALIZED</a> <div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 5.0. It is no longer an error to attempt to enable/disable the profiling via ::cuProfilerStart or ::cuProfilerStop without initialization.</span></div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="jcuda/runtime/JCuda.html#cudaDeviceBlockingSync">jcuda.runtime.JCuda.cudaDeviceBlockingSync</a> <div class="block"><span class="deprecationComment">As of CUDA 4.0 and replaced by cudaDeviceScheduleBlockingSync</span></div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="jcuda/runtime/cudaError.html#cudaErrorAddressOfConstant">jcuda.runtime.cudaError.cudaErrorAddressOfConstant</a> <div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 3.1. Variables in constant memory may now have their address taken by the runtime via <a href="jcuda/runtime/JCuda.html#cudaGetSymbolAddress-jcuda.Pointer-java.lang.String-"><code>JCuda.cudaGetSymbolAddress(jcuda.Pointer, java.lang.String)</code></a>.</span></div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="jcuda/runtime/cudaError.html#cudaErrorApiFailureBase">jcuda.runtime.cudaError.cudaErrorApiFailureBase</a> <div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 4.1.</span></div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="jcuda/runtime/cudaError.html#cudaErrorMemoryValueTooLarge">jcuda.runtime.cudaError.cudaErrorMemoryValueTooLarge</a> <div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 3.1. Device emulation mode was removed with the CUDA 3.1 release.</span></div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="jcuda/runtime/cudaError.html#cudaErrorMixedDeviceExecution">jcuda.runtime.cudaError.cudaErrorMixedDeviceExecution</a> <div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 3.1. Device emulation mode was removed with the CUDA 3.1 release.</span></div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="jcuda/runtime/cudaError.html#cudaErrorNotYetImplemented">jcuda.runtime.cudaError.cudaErrorNotYetImplemented</a> <div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 4.1.</span></div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="jcuda/runtime/cudaError.html#cudaErrorPriorLaunchFailure">jcuda.runtime.cudaError.cudaErrorPriorLaunchFailure</a> <div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 3.1. Device emulation mode was removed with the CUDA 3.1 release.</span></div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="jcuda/runtime/cudaError.html#cudaErrorProfilerAlreadyStarted">jcuda.runtime.cudaError.cudaErrorProfilerAlreadyStarted</a> <div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 5.0. It is no longer an error to call <a href="jcuda/runtime/JCuda.html#cudaProfilerStart--"><code>JCuda.cudaProfilerStart()</code></a> when profiling is already enabled.</span></div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="jcuda/runtime/cudaError.html#cudaErrorProfilerAlreadyStopped">jcuda.runtime.cudaError.cudaErrorProfilerAlreadyStopped</a> <div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 5.0. It is no longer an error to call <a href="jcuda/runtime/JCuda.html#cudaProfilerStop--"><code>JCuda.cudaProfilerStop()</code></a> when profiling is already disabled.</span></div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="jcuda/runtime/cudaError.html#cudaErrorProfilerNotInitialized">jcuda.runtime.cudaError.cudaErrorProfilerNotInitialized</a> <div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 5.0. It is no longer an error to attempt to enable/disable the profiling via <a href="jcuda/runtime/JCuda.html#cudaProfilerStart--"><code>JCuda.cudaProfilerStart()</code></a> or <a href="jcuda/runtime/JCuda.html#cudaProfilerStop--"><code>JCuda.cudaProfilerStop()</code></a> without initialization.</span></div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="jcuda/runtime/cudaError.html#cudaErrorSynchronizationError">jcuda.runtime.cudaError.cudaErrorSynchronizationError</a> <div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 3.1. Device emulation mode was removed with the CUDA 3.1 release.</span></div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="jcuda/runtime/cudaError.html#cudaErrorTextureFetchFailed">jcuda.runtime.cudaError.cudaErrorTextureFetchFailed</a> <div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 3.1. Device emulation mode was removed with the CUDA 3.1 release.</span></div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="jcuda/runtime/cudaError.html#cudaErrorTextureNotBound">jcuda.runtime.cudaError.cudaErrorTextureNotBound</a> <div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 3.1. Device emulation mode was removed with the CUDA 3.1 release.</span></div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="jcuda/runtime/JCuda.html#cudaStreamCallbackBlocking">jcuda.runtime.JCuda.cudaStreamCallbackBlocking</a> <div class="block"><span class="deprecationComment">This flag was only present in CUDA 5.0.25 (release candidate) and may be removed (or added again) in future releases</span></div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="jcuda/runtime/JCuda.html#cudaStreamCallbackNonblocking">jcuda.runtime.JCuda.cudaStreamCallbackNonblocking</a> <div class="block"><span class="deprecationComment">This flag was only present in CUDA 5.0.25 (release candidate) and may be removed (or added again) in future releases</span></div> </td> </tr> </tbody> </table> </li> </ul> <a name="method"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <table class="deprecatedSummary" border="0" cellpadding="3" cellspacing="0" summary="Deprecated Methods table, listing deprecated methods, and an explanation"> <caption><span>Deprecated Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="jcuda/driver/JCudaDriver.html#align-int-int-">jcuda.driver.JCudaDriver.align(int, int)</a> <div class="block"><span class="deprecationComment">This method was intended for a simpler kernel parameter setup in earlier CUDA versions, and should not be required any more. It may be removed in future releases.</span></div> </td> </tr> </tbody> </table> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="overview-summary.html">Overview</a></li> <li>Package</li> <li>Class</li> <li>Use</li> <li><a href="overview-tree.html">Tree</a></li> <li class="navBarCell1Rev">Deprecated</li> <li><a href="index-all.html">Index</a></li> <li><a href="help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="index.html?deprecated-list.html" target="_top">Frames</a></li> <li><a href="deprecated-list.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2014. All Rights Reserved.</small></p> </body> </html>
Java
# Vermilacinia cerebra Spjut SPECIES #### Status ACCEPTED #### According to Index Fungorum #### Published in Sida, Bot. Misc. 14: 181 (1996) #### Original name Vermilacinia cerebra Spjut ### Remarks null
Java
/* Copyright (c) 2015 "Naftoreiclag" https://github.com/Naftoreiclag * * Distributed under the Apache License Version 2.0 (http://www.apache.org/licenses/) * See accompanying file LICENSE */ #include "nrsalPrimitives.h" nrsalPrimitives::nrsalPrimitives() { //ctor } nrsalPrimitives::~nrsalPrimitives() { //dtor }
Java
#/ # @license Apache-2.0 # # Copyright (c) 2020 The Stdlib Authors. # # 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. #/ # VARIABLES # ifndef VERBOSE QUIET := @ else QUIET := endif # Determine the OS ([1][1], [2][2]). # # [1]: https://en.wikipedia.org/wiki/Uname#Examples # [2]: http://stackoverflow.com/a/27776822/2225624 OS ?= $(shell uname) ifneq (, $(findstring MINGW,$(OS))) OS := WINNT else ifneq (, $(findstring MSYS,$(OS))) OS := WINNT else ifneq (, $(findstring CYGWIN,$(OS))) OS := WINNT else ifneq (, $(findstring Windows_NT,$(OS))) OS := WINNT endif endif endif endif # Define the program used for compiling C source files: ifdef C_COMPILER CC := $(C_COMPILER) else CC := gcc endif # Define the command-line options when compiling C files: CFLAGS ?= \ -std=c99 \ -O3 \ -Wall \ -pedantic # Determine whether to generate position independent code ([1][1], [2][2]). # # [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options # [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option ifeq ($(OS), WINNT) fPIC ?= else fPIC ?= -fPIC endif # List of source files: c_src := ../../src/dcopy.c # List of C targets: c_targets := benchmark.length.out # RULES # #/ # Compiles C source files. # # @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) # @param {string} [CFLAGS] - C compiler options # @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code (e.g., `-fPIC`) # # @example # make # # @example # make all #/ all: $(c_targets) .PHONY: all #/ # Compiles C source files. # # @private # @param {string} CC - C compiler # @param {string} CFLAGS - C compiler flags # @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code #/ $(c_targets): %.out: %.c $(QUIET) $(CC) $(CFLAGS) $(fPIC) -I ../../include -o $@ $(c_src) $< -lm #/ # Runs compiled benchmarks. # # @example # make run #/ run: $(c_targets) $(QUIET) ./$< .PHONY: run #/ # Removes generated files. # # @example # make clean #/ clean: $(QUIET) -rm -f *.o *.out .PHONY: clean
Java
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_79) on Thu Sep 17 01:48:58 IST 2015 --> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Uses of Class org.apache.solr.cloud.ZkTestServer.LimitViolationAction (Solr 5.3.1 API)</title> <meta name="date" content="2015-09-17"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.solr.cloud.ZkTestServer.LimitViolationAction (Solr 5.3.1 API)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/apache/solr/cloud/ZkTestServer.LimitViolationAction.html" title="enum in org.apache.solr.cloud">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/solr/cloud/class-use/ZkTestServer.LimitViolationAction.html" target="_top">Frames</a></li> <li><a href="ZkTestServer.LimitViolationAction.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.apache.solr.cloud.ZkTestServer.LimitViolationAction" class="title">Uses of Class<br>org.apache.solr.cloud.ZkTestServer.LimitViolationAction</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../org/apache/solr/cloud/ZkTestServer.LimitViolationAction.html" title="enum in org.apache.solr.cloud">ZkTestServer.LimitViolationAction</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.apache.solr.cloud">org.apache.solr.cloud</a></td> <td class="colLast"> <div class="block">Base classes and utilities for creating and testing <a href="https://wiki.apache.org/solr/SolrCloud">Solr Cloud</a> clusters.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.apache.solr.cloud"> <!-- --> </a> <h3>Uses of <a href="../../../../../org/apache/solr/cloud/ZkTestServer.LimitViolationAction.html" title="enum in org.apache.solr.cloud">ZkTestServer.LimitViolationAction</a> in <a href="../../../../../org/apache/solr/cloud/package-summary.html">org.apache.solr.cloud</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/apache/solr/cloud/package-summary.html">org.apache.solr.cloud</a> that return <a href="../../../../../org/apache/solr/cloud/ZkTestServer.LimitViolationAction.html" title="enum in org.apache.solr.cloud">ZkTestServer.LimitViolationAction</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../org/apache/solr/cloud/ZkTestServer.LimitViolationAction.html" title="enum in org.apache.solr.cloud">ZkTestServer.LimitViolationAction</a></code></td> <td class="colLast"><span class="strong">ZkTestServer.LimitViolationAction.</span><code><strong><a href="../../../../../org/apache/solr/cloud/ZkTestServer.LimitViolationAction.html#valueOf(java.lang.String)">valueOf</a></strong>(<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</code> <div class="block">Returns the enum constant of this type with the specified name.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../org/apache/solr/cloud/ZkTestServer.LimitViolationAction.html" title="enum in org.apache.solr.cloud">ZkTestServer.LimitViolationAction</a>[]</code></td> <td class="colLast"><span class="strong">ZkTestServer.LimitViolationAction.</span><code><strong><a href="../../../../../org/apache/solr/cloud/ZkTestServer.LimitViolationAction.html#values()">values</a></strong>()</code> <div class="block">Returns an array containing the constants of this enum type, in the order they are declared.</div> </td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/apache/solr/cloud/package-summary.html">org.apache.solr.cloud</a> with parameters of type <a href="../../../../../org/apache/solr/cloud/ZkTestServer.LimitViolationAction.html" title="enum in org.apache.solr.cloud">ZkTestServer.LimitViolationAction</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><span class="strong">ZkTestServer.</span><code><strong><a href="../../../../../org/apache/solr/cloud/ZkTestServer.html#setViolationReportAction(org.apache.solr.cloud.ZkTestServer.LimitViolationAction)">setViolationReportAction</a></strong>(<a href="../../../../../org/apache/solr/cloud/ZkTestServer.LimitViolationAction.html" title="enum in org.apache.solr.cloud">ZkTestServer.LimitViolationAction</a>&nbsp;violationReportAction)</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/apache/solr/cloud/ZkTestServer.LimitViolationAction.html" title="enum in org.apache.solr.cloud">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/solr/cloud/class-use/ZkTestServer.LimitViolationAction.html" target="_top">Frames</a></li> <li><a href="ZkTestServer.LimitViolationAction.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small> <i>Copyright &copy; 2000-2015 Apache Software Foundation. All Rights Reserved.</i> <script src='../../../../../prettify.js' type='text/javascript'></script> <script type='text/javascript'> (function(){ var oldonload = window.onload; if (typeof oldonload != 'function') { window.onload = prettyPrint; } else { window.onload = function() { oldonload(); prettyPrint(); } } })(); </script> </small></p> </body> </html>
Java
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html> <head> <title>ObjFormatType - com.ligadata.olep.metadata.ObjFormatType</title> <meta name="description" content="ObjFormatType - com.ligadata.olep.metadata.ObjFormatType" /> <meta name="keywords" content="ObjFormatType com.ligadata.olep.metadata.ObjFormatType" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <link href="../../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" /> <link href="../../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" /> <script type="text/javascript"> if(top === self) { var url = '../../../../index.html'; var hash = 'com.ligadata.olep.metadata.ObjFormatType$'; var anchor = window.location.hash; var anchor_opt = ''; if (anchor.length >= 1) anchor_opt = '@' + anchor.substring(1); window.location.href = url + '#' + hash + anchor_opt; } </script> </head> <body class="value"> <div id="definition"> <img src="../../../../lib/object_big.png" /> <p id="owner"><a href="../../../package.html" class="extype" name="com">com</a>.<a href="../../package.html" class="extype" name="com.ligadata">ligadata</a>.<a href="../package.html" class="extype" name="com.ligadata.olep">olep</a>.<a href="package.html" class="extype" name="com.ligadata.olep.metadata">metadata</a></p> <h1>ObjFormatType</h1> </div> <h4 id="signature" class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">object</span> </span> <span class="symbol"> <span class="name">ObjFormatType</span><span class="result"> extends <span class="extype" name="scala.Enumeration">Enumeration</span></span> </span> </h4> <div id="comment" class="fullcommenttop"><div class="toggleContainer block"> <span class="toggle">Linear Supertypes</span> <div class="superTypes hiddenContent"><span class="extype" name="scala.Enumeration">Enumeration</span>, <span class="extype" name="scala.Serializable">Serializable</span>, <span class="extype" name="java.io.Serializable">Serializable</span>, <span class="extype" name="scala.AnyRef">AnyRef</span>, <span class="extype" name="scala.Any">Any</span></div> </div></div> <div id="mbrsel"> <div id="textfilter"><span class="pre"></span><span class="input"><input id="mbrsel-input" type="text" accesskey="/" /></span><span class="post"></span></div> <div id="order"> <span class="filtertype">Ordering</span> <ol> <li class="alpha in"><span>Alphabetic</span></li> <li class="inherit out"><span>By inheritance</span></li> </ol> </div> <div id="ancestors"> <span class="filtertype">Inherited<br /> </span> <ol id="linearization"> <li class="in" name="com.ligadata.olep.metadata.ObjFormatType"><span>ObjFormatType</span></li><li class="in" name="scala.Enumeration"><span>Enumeration</span></li><li class="in" name="scala.Serializable"><span>Serializable</span></li><li class="in" name="java.io.Serializable"><span>Serializable</span></li><li class="in" name="scala.AnyRef"><span>AnyRef</span></li><li class="in" name="scala.Any"><span>Any</span></li> </ol> </div><div id="ancestors"> <span class="filtertype"></span> <ol> <li class="hideall out"><span>Hide All</span></li> <li class="showall in"><span>Show all</span></li> </ol> <a href="http://docs.scala-lang.org/overviews/scaladoc/usage.html#members" target="_blank">Learn more about member selection</a> </div> <div id="visbl"> <span class="filtertype">Visibility</span> <ol><li class="public in"><span>Public</span></li><li class="all out"><span>All</span></li></ol> </div> </div> <div id="template"> <div id="allMembers"> <div id="types" class="types members"> <h3>Type Members</h3> <ol><li name="com.ligadata.olep.metadata.ObjFormatType.FormatType" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped"> <a id="FormatType=com.ligadata.olep.metadata.ObjFormatType.Value"></a> <a id="FormatType:FormatType"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">type</span> </span> <span class="symbol"> <span class="name">FormatType</span><span class="result"> = <a href="#ValueextendsOrdered[Enumeration.this.Value]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.Value">Value</a></span> </span> </h4> </li><li name="scala.Enumeration.Val" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="ValextendsEnumeration.this.ValuewithSerializable"></a> <a id="Val:Val"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">class</span> </span> <span class="symbol"> <span class="name">Val</span><span class="result"> extends <span class="extype" name="scala.Enumeration.Value">Value</span> with <span class="extype" name="scala.Serializable">Serializable</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected </dd><dt>Definition Classes</dt><dd>Enumeration</dd><dt>Annotations</dt><dd> <span class="name">@SerialVersionUID</span><span class="args">(<span> <span class="symbol">-3501153230598116017L</span> </span>)</span> </dd></dl></div> </li><li name="scala.Enumeration.Value" visbl="pub" data-isabs="true" fullComment="yes" group="Ungrouped"> <a id="ValueextendsOrdered[Enumeration.this.Value]withSerializable"></a> <a id="Value:Value"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">abstract </span> <span class="kind">class</span> </span> <span class="symbol"> <span class="name">Value</span><span class="result"> extends <span class="extype" name="scala.Ordered">Ordered</span>[<span class="extype" name="scala.Enumeration.Value">Value</span>] with <span class="extype" name="scala.Serializable">Serializable</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Enumeration</dd><dt>Annotations</dt><dd> <span class="name">@SerialVersionUID</span><span class="args">(<span> <span class="symbol">7091335633555234129L</span> </span>)</span> </dd></dl></div> </li><li name="scala.Enumeration.ValueSet" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="ValueSetextendsAbstractSet[Enumeration.this.Value]withSortedSet[Enumeration.this.Value]withSortedSetLike[Enumeration.this.Value,Enumeration.this.ValueSet]withSerializable"></a> <a id="ValueSet:ValueSet"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">class</span> </span> <span class="symbol"> <span class="name">ValueSet</span><span class="result"> extends <span class="extype" name="scala.collection.AbstractSet">AbstractSet</span>[<span class="extype" name="scala.Enumeration.Value">Value</span>] with <span class="extype" name="scala.collection.immutable.SortedSet">SortedSet</span>[<span class="extype" name="scala.Enumeration.Value">Value</span>] with <span class="extype" name="scala.collection.SortedSetLike">SortedSetLike</span>[<span class="extype" name="scala.Enumeration.Value">Value</span>, <span class="extype" name="scala.Enumeration.ValueSet">ValueSet</span>] with <span class="extype" name="scala.Serializable">Serializable</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Enumeration</dd></dl></div> </li></ol> </div> <div id="values" class="values members"> <h3>Value Members</h3> <ol><li name="scala.AnyRef#!=" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="!=(x$1:AnyRef):Boolean"></a> <a id="!=(AnyRef):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.Any#!=" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="!=(x$1:Any):Boolean"></a> <a id="!=(Any):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div> </li><li name="scala.AnyRef###" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="##():Int"></a> <a id="##():Int"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $hash$hash" class="name">##</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.AnyRef#==" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="==(x$1:AnyRef):Boolean"></a> <a id="==(AnyRef):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.Any#==" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="==(x$1:Any):Boolean"></a> <a id="==(Any):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div> </li><li name="scala.Enumeration#Value" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="Value(i:Int,name:String):Enumeration.this.Value"></a> <a id="Value(Int,String):Value"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">Value</span><span class="params">(<span name="i">i: <span class="extype" name="scala.Int">Int</span></span>, <span name="name">name: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <a href="#ValueextendsOrdered[Enumeration.this.Value]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.Value">Value</a></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected </dd><dt>Definition Classes</dt><dd>Enumeration</dd></dl></div> </li><li name="scala.Enumeration#Value" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="Value(name:String):Enumeration.this.Value"></a> <a id="Value(String):Value"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">Value</span><span class="params">(<span name="name">name: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <a href="#ValueextendsOrdered[Enumeration.this.Value]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.Value">Value</a></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected </dd><dt>Definition Classes</dt><dd>Enumeration</dd></dl></div> </li><li name="scala.Enumeration#Value" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="Value(i:Int):Enumeration.this.Value"></a> <a id="Value(Int):Value"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">Value</span><span class="params">(<span name="i">i: <span class="extype" name="scala.Int">Int</span></span>)</span><span class="result">: <a href="#ValueextendsOrdered[Enumeration.this.Value]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.Value">Value</a></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected </dd><dt>Definition Classes</dt><dd>Enumeration</dd></dl></div> </li><li name="scala.Enumeration#Value" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="Value:Enumeration.this.Value"></a> <a id="Value:Value"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">Value</span><span class="result">: <a href="#ValueextendsOrdered[Enumeration.this.Value]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.Value">Value</a></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected </dd><dt>Definition Classes</dt><dd>Enumeration</dd></dl></div> </li><li name="scala.Enumeration#apply" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="apply(x:Int):Enumeration.this.Value"></a> <a id="apply(Int):Value"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">apply</span><span class="params">(<span name="x">x: <span class="extype" name="scala.Int">Int</span></span>)</span><span class="result">: <a href="#ValueextendsOrdered[Enumeration.this.Value]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.Value">Value</a></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Enumeration</dd></dl></div> </li><li name="scala.Any#asInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="asInstanceOf[T0]:T0"></a> <a id="asInstanceOf[T0]:T0"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">asInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Any.asInstanceOf.T0">T0</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div> </li><li name="com.ligadata.olep.metadata.ObjFormatType#asString" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped"> <a id="asString(typ:com.ligadata.olep.metadata.ObjFormatType.FormatType):String"></a> <a id="asString(FormatType):String"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">asString</span><span class="params">(<span name="typ">typ: <a href="#FormatType=com.ligadata.olep.metadata.ObjFormatType.Value" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.FormatType">FormatType</a></span>)</span><span class="result">: <span class="extype" name="scala.Predef.String">String</span></span> </span> </h4> </li><li name="scala.AnyRef#clone" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="clone():Object"></a> <a id="clone():AnyRef"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">clone</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.AnyRef">AnyRef</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../../../java$lang.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.CloneNotSupportedException]">...</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#eq" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="eq(x$1:AnyRef):Boolean"></a> <a id="eq(AnyRef):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">eq</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#equals" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="equals(x$1:Any):Boolean"></a> <a id="equals(Any):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">equals</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="com.ligadata.olep.metadata.ObjFormatType#fCSV" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped"> <a id="fCSV:com.ligadata.olep.metadata.ObjFormatType.Value"></a> <a id="fCSV:Value"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">val</span> </span> <span class="symbol"> <span class="name">fCSV</span><span class="result">: <a href="#ValueextendsOrdered[Enumeration.this.Value]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.Value">Value</a></span> </span> </h4> </li><li name="com.ligadata.olep.metadata.ObjFormatType#fJSON" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped"> <a id="fJSON:com.ligadata.olep.metadata.ObjFormatType.Value"></a> <a id="fJSON:Value"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">val</span> </span> <span class="symbol"> <span class="name">fJSON</span><span class="result">: <a href="#ValueextendsOrdered[Enumeration.this.Value]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.Value">Value</a></span> </span> </h4> </li><li name="com.ligadata.olep.metadata.ObjFormatType#fSERIALIZED" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped"> <a id="fSERIALIZED:com.ligadata.olep.metadata.ObjFormatType.Value"></a> <a id="fSERIALIZED:Value"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">val</span> </span> <span class="symbol"> <span class="name">fSERIALIZED</span><span class="result">: <a href="#ValueextendsOrdered[Enumeration.this.Value]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.Value">Value</a></span> </span> </h4> </li><li name="com.ligadata.olep.metadata.ObjFormatType#fXML" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped"> <a id="fXML:com.ligadata.olep.metadata.ObjFormatType.Value"></a> <a id="fXML:Value"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">val</span> </span> <span class="symbol"> <span class="name">fXML</span><span class="result">: <a href="#ValueextendsOrdered[Enumeration.this.Value]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.Value">Value</a></span> </span> </h4> </li><li name="scala.AnyRef#finalize" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="finalize():Unit"></a> <a id="finalize():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">finalize</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../../../java$lang.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="symbol">classOf[java.lang.Throwable]</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#getClass" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="getClass():Class[_]"></a> <a id="getClass():Class[_]"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">getClass</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.Class">Class</span>[_]</span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.AnyRef#hashCode" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="hashCode():Int"></a> <a id="hashCode():Int"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">hashCode</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.Any#isInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="isInstanceOf[T0]:Boolean"></a> <a id="isInstanceOf[T0]:Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">isInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div> </li><li name="scala.Enumeration#maxId" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="maxId:Int"></a> <a id="maxId:Int"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">maxId</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Enumeration</dd></dl></div> </li><li name="scala.AnyRef#ne" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="ne(x$1:AnyRef):Boolean"></a> <a id="ne(AnyRef):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">ne</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.Enumeration#nextId" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="nextId:Int"></a> <a id="nextId:Int"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">var</span> </span> <span class="symbol"> <span class="name">nextId</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected </dd><dt>Definition Classes</dt><dd>Enumeration</dd></dl></div> </li><li name="scala.Enumeration#nextName" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="nextName:Iterator[String]"></a> <a id="nextName:Iterator[String]"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">var</span> </span> <span class="symbol"> <span class="name">nextName</span><span class="result">: <span class="extype" name="scala.Iterator">Iterator</span>[<span class="extype" name="scala.Predef.String">String</span>]</span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected </dd><dt>Definition Classes</dt><dd>Enumeration</dd></dl></div> </li><li name="scala.AnyRef#notify" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="notify():Unit"></a> <a id="notify():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">notify</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#notifyAll" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="notifyAll():Unit"></a> <a id="notifyAll():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">notifyAll</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.Enumeration#readResolve" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="readResolve():AnyRef"></a> <a id="readResolve():AnyRef"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">readResolve</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.AnyRef">AnyRef</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected </dd><dt>Definition Classes</dt><dd>Enumeration</dd></dl></div> </li><li name="scala.AnyRef#synchronized" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="synchronized[T0](x$1:=&gt;T0):T0"></a> <a id="synchronized[T0](⇒T0):T0"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">synchronized</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="params">(<span name="arg0">arg0: ⇒ <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>)</span><span class="result">: <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.Enumeration#toString" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="toString():String"></a> <a id="toString():String"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">toString</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.String">String</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Enumeration → AnyRef → Any</dd></dl></div> </li><li name="scala.Enumeration#values" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="values:Enumeration.this.ValueSet"></a> <a id="values:ValueSet"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">values</span><span class="result">: <a href="#ValueSetextendsAbstractSet[Enumeration.this.Value]withSortedSet[Enumeration.this.Value]withSortedSetLike[Enumeration.this.Value,Enumeration.this.ValueSet]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.ValueSet">ValueSet</a></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Enumeration</dd></dl></div> </li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait():Unit"></a> <a id="wait():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.InterruptedException]">...</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait(x$1:Long,x$2:Int):Unit"></a> <a id="wait(Long,Int):Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>, <span name="arg1">arg1: <span class="extype" name="scala.Int">Int</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.InterruptedException]">...</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait(x$1:Long):Unit"></a> <a id="wait(Long):Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.InterruptedException]">...</span> </span>)</span> </dd></dl></div> </li><li name="scala.Enumeration#withName" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="withName(s:String):Enumeration.this.Value"></a> <a id="withName(String):Value"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">withName</span><span class="params">(<span name="s">s: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <a href="#ValueextendsOrdered[Enumeration.this.Value]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.Value">Value</a></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Enumeration</dd></dl></div> </li></ol> </div> </div> <div id="inheritedMembers"> <div class="parent" name="scala.Enumeration"> <h3>Inherited from <span class="extype" name="scala.Enumeration">Enumeration</span></h3> </div><div class="parent" name="scala.Serializable"> <h3>Inherited from <span class="extype" name="scala.Serializable">Serializable</span></h3> </div><div class="parent" name="java.io.Serializable"> <h3>Inherited from <span class="extype" name="java.io.Serializable">Serializable</span></h3> </div><div class="parent" name="scala.AnyRef"> <h3>Inherited from <span class="extype" name="scala.AnyRef">AnyRef</span></h3> </div><div class="parent" name="scala.Any"> <h3>Inherited from <span class="extype" name="scala.Any">Any</span></h3> </div> </div> <div id="groupedMembers"> <div class="group" name="Ungrouped"> <h3>Ungrouped</h3> </div> </div> </div> <div id="tooltip"></div> <div id="footer"> </div> <script defer="defer" type="text/javascript" id="jquery-js" src="../../../../lib/jquery.js"></script><script defer="defer" type="text/javascript" id="jquery-ui-js" src="../../../../lib/jquery-ui.js"></script><script defer="defer" type="text/javascript" id="tools-tooltip-js" src="../../../../lib/tools.tooltip.js"></script><script defer="defer" type="text/javascript" id="template-js" src="../../../../lib/template.js"></script> </body> </html>
Java